@kyro-cms/core 0.13.5 → 0.13.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/dist/api-handler-graphql.cjs +1 -1
  2. package/dist/api-handler-graphql.js +2 -2
  3. package/dist/api-handler-trpc.cjs +1 -1
  4. package/dist/api-handler-trpc.js +2 -2
  5. package/dist/api-handler.cjs +1 -1
  6. package/dist/api-handler.js +1 -1
  7. package/dist/auth-session-4WJUKESW.js +1 -0
  8. package/dist/auth-session-VHUHDBCL.cjs +1 -0
  9. package/dist/bootstrap-JYAUQ52D.cjs +1 -0
  10. package/dist/bootstrap-TTMLNQM3.js +1 -0
  11. package/dist/chunk-23RSKVJP.cjs +1 -0
  12. package/dist/chunk-24W5I6SJ.cjs +2 -0
  13. package/dist/{chunk-CH4TZZI5.js → chunk-2I2AXTKY.cjs} +38 -39
  14. package/dist/chunk-34LCWI5X.cjs +1 -0
  15. package/dist/chunk-3A5UO6OQ.cjs +114 -0
  16. package/dist/chunk-3N34WXBS.js +2 -0
  17. package/dist/chunk-3RIGRHON.js +109 -0
  18. package/dist/chunk-5BUAWCU6.js +91 -0
  19. package/dist/{chunk-7NKNSRCB.cjs → chunk-5I3BM5TV.js} +33 -32
  20. package/dist/chunk-5RBGM5N5.js +3 -0
  21. package/dist/chunk-7EY3GXRA.js +2 -0
  22. package/dist/chunk-7KTPBTH5.cjs +1 -0
  23. package/dist/chunk-A7763NCF.cjs +19 -0
  24. package/dist/chunk-AQWTJGML.cjs +1 -0
  25. package/dist/chunk-DCFOVCJX.cjs +1 -0
  26. package/dist/chunk-DCKJT247.cjs +1 -0
  27. package/dist/chunk-EG4SRTYS.cjs +2 -0
  28. package/dist/chunk-FAG2645P.js +2 -0
  29. package/dist/chunk-FIVTKI25.cjs +3 -0
  30. package/dist/chunk-FU76HURF.cjs +1 -0
  31. package/dist/chunk-GS4CMYKS.cjs +1 -0
  32. package/dist/chunk-GTAKGVUY.js +2 -0
  33. package/dist/chunk-GWUHIIPO.cjs +132 -0
  34. package/dist/chunk-H2IJDTA2.cjs +1 -0
  35. package/dist/chunk-HCM2G674.cjs +20 -0
  36. package/dist/chunk-I22MSXGL.js +2 -0
  37. package/dist/chunk-IIPSXKNV.js +115 -0
  38. package/dist/{chunk-WNU76M2C.js → chunk-IIVBEZC2.js} +6 -6
  39. package/dist/chunk-JHFD3IAU.cjs +1 -0
  40. package/dist/chunk-JJY2F6NL.cjs +3 -0
  41. package/dist/chunk-JQ4V2MGJ.cjs +2 -0
  42. package/dist/chunk-JXJTFBHG.js +3 -0
  43. package/dist/chunk-KOSR7235.cjs +1 -0
  44. package/dist/chunk-KUY4QDAL.js +2 -0
  45. package/dist/chunk-LGUHXOEW.js +3 -0
  46. package/dist/chunk-LXTVMP5F.cjs +6 -0
  47. package/dist/chunk-MCK2QRAU.cjs +4 -0
  48. package/dist/chunk-N2BMGZIX.cjs +90 -0
  49. package/dist/chunk-N7CDHWQH.cjs +2 -0
  50. package/dist/chunk-NGNXOXI5.js +2 -0
  51. package/dist/chunk-O2SA56P2.cjs +108 -0
  52. package/dist/chunk-O4PPZOVI.cjs +1 -0
  53. package/dist/chunk-O4RKZQYQ.js +2 -0
  54. package/dist/chunk-O6I26T6A.js +3 -0
  55. package/dist/chunk-OJBL4CXK.cjs +2 -0
  56. package/dist/chunk-OPKZYQV7.js +3 -0
  57. package/dist/chunk-OXEJCIOA.cjs +1 -0
  58. package/dist/chunk-OXH6CANN.js +2 -0
  59. package/dist/chunk-PPGZHOYR.cjs +1 -0
  60. package/dist/{chunk-EQN3HDES.cjs → chunk-PW6Y5MQL.cjs} +5 -5
  61. package/dist/chunk-RLW6AQF2.js +2 -0
  62. package/dist/chunk-SBFVITY2.js +7 -0
  63. package/dist/chunk-SEJ7LMYY.js +4 -0
  64. package/dist/chunk-SYE3OS5T.js +5 -0
  65. package/dist/chunk-SZY25KAE.js +21 -0
  66. package/dist/chunk-TJ6N5ZPZ.js +133 -0
  67. package/dist/chunk-TVWHTVLI.js +2 -0
  68. package/dist/chunk-UE7DTBD7.cjs +1 -0
  69. package/dist/chunk-V2RMDMWN.js +2 -0
  70. package/dist/chunk-V4SR7DU5.js +3 -0
  71. package/dist/chunk-VLFM66BZ.js +4 -0
  72. package/dist/chunk-VPBGZW4P.cjs +1 -0
  73. package/dist/chunk-W5GDZG64.js +2 -0
  74. package/dist/chunk-WLSVS3NC.js +2 -0
  75. package/dist/chunk-XL64URKD.cjs +2 -0
  76. package/dist/chunk-YNBJGPIU.js +2 -0
  77. package/dist/chunk-YNSKDTFG.js +2 -0
  78. package/dist/chunk-YOJOVQIH.cjs +1 -0
  79. package/dist/chunk-ZE2X3FBU.js +20 -0
  80. package/dist/chunk-ZMH35QYG.js +2 -0
  81. package/dist/cli/index.cjs +53 -182
  82. package/dist/cli/index.js +54 -183
  83. package/dist/drizzle/index.cjs +1 -1
  84. package/dist/drizzle/index.js +1 -1
  85. package/dist/fields/index.cjs +1 -1
  86. package/dist/fields/index.js +1 -1
  87. package/dist/graphql/index.cjs +1 -1
  88. package/dist/graphql/index.js +1 -1
  89. package/dist/index-B_39z2jP.d.cts +217 -0
  90. package/dist/index-xqpVL2Zq.d.ts +217 -0
  91. package/dist/index.cjs +30 -30
  92. package/dist/index.d.cts +2 -31
  93. package/dist/index.d.ts +2 -31
  94. package/dist/index.js +31 -31
  95. package/dist/integration.cjs +1 -1
  96. package/dist/integration.js +1 -1
  97. package/dist/local-DKP43BWQ.cjs +1 -0
  98. package/dist/local-TF5ZMHWW.js +1 -0
  99. package/dist/media-M3EIZ4QS.cjs +1 -0
  100. package/dist/media-WYEILC6K.js +1 -0
  101. package/dist/mongo-auth-adapter-22MV3TI3.cjs +1 -0
  102. package/dist/mongo-auth-adapter-66PWVRZW.js +1 -0
  103. package/dist/mongodb/index.cjs +1 -1
  104. package/dist/mongodb/index.d.cts +3 -130
  105. package/dist/mongodb/index.d.ts +3 -130
  106. package/dist/mongodb/index.js +1 -1
  107. package/dist/nodemailer-transport-7F3VLLBW.js +1 -0
  108. package/dist/nodemailer-transport-WAPZD3SJ.cjs +1 -0
  109. package/dist/postgres-auth-adapter-7BCPXNBO.js +1 -0
  110. package/dist/postgres-auth-adapter-HMXFUM5W.cjs +1 -0
  111. package/dist/redis-adapter-2E5AWMMA.cjs +1 -0
  112. package/dist/redis-adapter-GFH74CF4.js +1 -0
  113. package/dist/rest/index.cjs +1 -1
  114. package/dist/rest/index.js +1 -1
  115. package/dist/schema-FNIDQKIJ.cjs +1 -0
  116. package/dist/schema-KD736QFN.js +1 -0
  117. package/dist/sqlite-adapter-HL53RLSN.cjs +1 -0
  118. package/dist/sqlite-adapter-TT6ZASDG.js +1 -0
  119. package/dist/templates/index.cjs +1 -1
  120. package/dist/templates/index.js +1 -1
  121. package/dist/trpc/index.cjs +1 -1
  122. package/dist/trpc/index.js +1 -1
  123. package/dist/ws/index.cjs +1 -1
  124. package/dist/ws/index.js +1 -1
  125. package/package.json +2 -10
  126. package/dist/WebhookService-CGxHtw7E.d.cts +0 -143
  127. package/dist/WebhookService-CNC1lYz7.d.ts +0 -143
  128. package/dist/auth-session-DHVGXHOH.cjs +0 -1
  129. package/dist/auth-session-O7IIH7EP.js +0 -1
  130. package/dist/base-A9AJPCG5.d.ts +0 -219
  131. package/dist/base-C6wyX2nC.d.cts +0 -219
  132. package/dist/bcryptjs-WIQSWJGK.cjs +0 -1
  133. package/dist/bcryptjs-ZEEHSMAG.js +0 -2
  134. package/dist/better-sqlite3-5IISPX34.cjs +0 -1
  135. package/dist/better-sqlite3-B34RIU4C.js +0 -2
  136. package/dist/bootstrap-PG2LGDLB.js +0 -1
  137. package/dist/bootstrap-YD3GLTWX.cjs +0 -1
  138. package/dist/bowser-SB3ZUPO4.js +0 -11
  139. package/dist/bowser-VX6B6ZSE.cjs +0 -10
  140. package/dist/chokidar-5RVQZVHP.cjs +0 -5
  141. package/dist/chokidar-BOYGRT4Q.js +0 -6
  142. package/dist/chunk-262YP5XA.cjs +0 -1
  143. package/dist/chunk-2HA6EKXX.js +0 -24
  144. package/dist/chunk-2SPWRQ5O.js +0 -122
  145. package/dist/chunk-2TYITUOC.js +0 -122
  146. package/dist/chunk-35PGCW3S.cjs +0 -1
  147. package/dist/chunk-3CIMGC2F.cjs +0 -56
  148. package/dist/chunk-3KZXF4US.js +0 -2
  149. package/dist/chunk-3NSZZCOJ.js +0 -2
  150. package/dist/chunk-3TAUNYEM.js +0 -8
  151. package/dist/chunk-3VXEK5ZW.cjs +0 -1
  152. package/dist/chunk-47CXBWMA.js +0 -2
  153. package/dist/chunk-4BMWWGJN.js +0 -384
  154. package/dist/chunk-4NTIK6DF.cjs +0 -2
  155. package/dist/chunk-6E44MQQ5.js +0 -115
  156. package/dist/chunk-6LWF5MPL.js +0 -20
  157. package/dist/chunk-6NBZDW53.js +0 -133
  158. package/dist/chunk-6TPICJ2L.js +0 -7
  159. package/dist/chunk-6YS6XLOD.cjs +0 -121
  160. package/dist/chunk-73D2PNHD.cjs +0 -7
  161. package/dist/chunk-7ACHOBWY.cjs +0 -13
  162. package/dist/chunk-7GGZA5YU.cjs +0 -2
  163. package/dist/chunk-7JWQ2PZP.cjs +0 -1
  164. package/dist/chunk-7KLEANTO.cjs +0 -1
  165. package/dist/chunk-7MNDQU6K.js +0 -8
  166. package/dist/chunk-7NH7H3WA.js +0 -10
  167. package/dist/chunk-7WMMKGEO.cjs +0 -1
  168. package/dist/chunk-ALTU3FDG.js +0 -2
  169. package/dist/chunk-BAVN7VDR.cjs +0 -1
  170. package/dist/chunk-BCEE4NBZ.cjs +0 -2
  171. package/dist/chunk-BUNLC3II.cjs +0 -1
  172. package/dist/chunk-C7QCZX7X.js +0 -2
  173. package/dist/chunk-D6SDGHY6.js +0 -2
  174. package/dist/chunk-DVWYO3KK.cjs +0 -1
  175. package/dist/chunk-EHWUALGH.cjs +0 -1
  176. package/dist/chunk-EML5FDUU.js +0 -2
  177. package/dist/chunk-EN65ZEK2.cjs +0 -2
  178. package/dist/chunk-EW424IBO.cjs +0 -1
  179. package/dist/chunk-EZIDQBXI.cjs +0 -1
  180. package/dist/chunk-F2O4QO5N.cjs +0 -383
  181. package/dist/chunk-F4ITQ6XQ.cjs +0 -3
  182. package/dist/chunk-FK2BG4HU.js +0 -3
  183. package/dist/chunk-FLMUMPDE.js +0 -2
  184. package/dist/chunk-GIS6X43A.cjs +0 -3
  185. package/dist/chunk-GNEVCEJU.cjs +0 -3
  186. package/dist/chunk-GNOSG3PK.cjs +0 -1
  187. package/dist/chunk-GQGFNTDZ.js +0 -2
  188. package/dist/chunk-GTR7JAKP.cjs +0 -3
  189. package/dist/chunk-HPIJI7TM.js +0 -3
  190. package/dist/chunk-HPYH7GTS.cjs +0 -1
  191. package/dist/chunk-HRAY65XH.js +0 -3
  192. package/dist/chunk-HTYVI2HK.cjs +0 -9
  193. package/dist/chunk-IKGVPXMK.js +0 -3
  194. package/dist/chunk-J6V573PE.cjs +0 -1
  195. package/dist/chunk-JA44K75G.js +0 -2
  196. package/dist/chunk-JRUQ5ABB.js +0 -4
  197. package/dist/chunk-JV4HJBXW.js +0 -14
  198. package/dist/chunk-KEITOXIP.js +0 -2
  199. package/dist/chunk-KMFLHGD5.cjs +0 -1
  200. package/dist/chunk-KZHXYXSH.cjs +0 -10
  201. package/dist/chunk-L3Q64RUX.js +0 -3
  202. package/dist/chunk-LEBM6ZSZ.cjs +0 -10
  203. package/dist/chunk-LKRI5X2V.cjs +0 -1
  204. package/dist/chunk-LQ3YZTPU.cjs +0 -15
  205. package/dist/chunk-LVBHOZZF.js +0 -4
  206. package/dist/chunk-LWM4WABU.js +0 -3
  207. package/dist/chunk-LY7N3UHH.cjs +0 -23
  208. package/dist/chunk-MCIZG4A3.cjs +0 -1
  209. package/dist/chunk-MDLJTZLV.cjs +0 -1
  210. package/dist/chunk-N4FXLQE3.cjs +0 -132
  211. package/dist/chunk-N5POANYV.js +0 -2
  212. package/dist/chunk-NGNJSUGL.cjs +0 -1
  213. package/dist/chunk-NRE6VKL6.cjs +0 -121
  214. package/dist/chunk-O4YE57OS.cjs +0 -6
  215. package/dist/chunk-OBYAIJVU.js +0 -11
  216. package/dist/chunk-OLRCZ6E3.js +0 -2
  217. package/dist/chunk-OOVNTOZC.cjs +0 -56
  218. package/dist/chunk-P6JITOFF.js +0 -4
  219. package/dist/chunk-PITMDQYN.cjs +0 -18
  220. package/dist/chunk-PYUWSKKP.js +0 -57
  221. package/dist/chunk-Q5TFO66G.cjs +0 -1
  222. package/dist/chunk-QO5ZWQA3.cjs +0 -74
  223. package/dist/chunk-QYN6C3FZ.cjs +0 -114
  224. package/dist/chunk-REQ622YC.js +0 -3
  225. package/dist/chunk-RPRGGGIW.js +0 -11
  226. package/dist/chunk-RVBSJ4UQ.cjs +0 -7
  227. package/dist/chunk-RYHOWZLK.js +0 -2
  228. package/dist/chunk-RYXLEFS5.js +0 -2
  229. package/dist/chunk-SBNMXQNO.cjs +0 -2
  230. package/dist/chunk-SLMIYECU.js +0 -2
  231. package/dist/chunk-SRIXRJHL.js +0 -4
  232. package/dist/chunk-TBHNE4VV.js +0 -2
  233. package/dist/chunk-TCFL3UWT.cjs +0 -2
  234. package/dist/chunk-TYQYKKWJ.js +0 -16
  235. package/dist/chunk-U6KFONKM.js +0 -2
  236. package/dist/chunk-UNYXWPLZ.cjs +0 -2
  237. package/dist/chunk-UWHWSWDE.js +0 -2
  238. package/dist/chunk-V4FAL7AG.js +0 -2
  239. package/dist/chunk-VQ53TFYA.cjs +0 -1
  240. package/dist/chunk-VRZC4TTF.cjs +0 -1
  241. package/dist/chunk-W45TLOOT.js +0 -2
  242. package/dist/chunk-WAVGRSE6.js +0 -2
  243. package/dist/chunk-WPM6LFCY.js +0 -2
  244. package/dist/chunk-WXT2XW7T.js +0 -13
  245. package/dist/chunk-X473JI7Z.js +0 -75
  246. package/dist/chunk-X6HUA6EF.cjs +0 -20
  247. package/dist/chunk-XDPLVJRO.js +0 -21
  248. package/dist/chunk-XDQVYCIR.cjs +0 -1
  249. package/dist/chunk-XFYSADHV.cjs +0 -2
  250. package/dist/chunk-XOR64WUQ.cjs +0 -19
  251. package/dist/chunk-Y2YAKDEQ.js +0 -2
  252. package/dist/chunk-YENNL5HG.js +0 -2
  253. package/dist/chunk-YGI5W4RS.js +0 -2
  254. package/dist/chunk-YIFKTA5N.js +0 -57
  255. package/dist/chunk-YUUXFD73.js +0 -19
  256. package/dist/chunk-ZAKYTBEN.js +0 -3
  257. package/dist/chunk-ZHA446FA.cjs +0 -1
  258. package/dist/chunk-ZTLGK6R4.cjs +0 -12
  259. package/dist/chunk-ZUBJ6RLQ.cjs +0 -1
  260. package/dist/client.d.cts +0 -1291
  261. package/dist/client.d.ts +0 -1291
  262. package/dist/d1-5ZQJOFDX.cjs +0 -1
  263. package/dist/d1-HPB6B253.js +0 -2
  264. package/dist/dist-es-3SSNUZST.cjs +0 -1
  265. package/dist/dist-es-64F22JL2.js +0 -2
  266. package/dist/dist-es-A5OF2STN.cjs +0 -2
  267. package/dist/dist-es-BOW5V247.cjs +0 -6
  268. package/dist/dist-es-CRIMATLL.cjs +0 -2
  269. package/dist/dist-es-DL3VLVP6.cjs +0 -1
  270. package/dist/dist-es-F2ZR55UK.js +0 -4
  271. package/dist/dist-es-IPSSZNFP.js +0 -1
  272. package/dist/dist-es-M2F7M27Y.js +0 -2
  273. package/dist/dist-es-M66JKZF5.js +0 -7
  274. package/dist/dist-es-OKLLRYI3.js +0 -2
  275. package/dist/dist-es-P25IKLBI.cjs +0 -1
  276. package/dist/dist-es-SRPWSAF4.cjs +0 -1
  277. package/dist/dist-es-SVHZDVUF.js +0 -3
  278. package/dist/dist-es-T2H2W5BX.cjs +0 -3
  279. package/dist/dist-es-WFI55HKT.js +0 -3
  280. package/dist/drizzle-orm-47ELDEM6.cjs +0 -1
  281. package/dist/drizzle-orm-XRTSOQJS.js +0 -1
  282. package/dist/event-streams-7NAWZW2I.js +0 -1
  283. package/dist/event-streams-JBMWCI2O.cjs +0 -1
  284. package/dist/fs-KWBRQ6T6.js +0 -1
  285. package/dist/fs-ZQYOJOIO.cjs +0 -1
  286. package/dist/index-NGnJpSgf.d.ts +0 -105
  287. package/dist/index-Zrg3sZ6R.d.cts +0 -105
  288. package/dist/jsonwebtoken-DFB6ZBZA.cjs +0 -8
  289. package/dist/jsonwebtoken-OD67R5JS.js +0 -9
  290. package/dist/lib-A2D63VXD.cjs +0 -1
  291. package/dist/lib-JQD2JAOO.js +0 -2
  292. package/dist/loadSso-JY4WDQPS.cjs +0 -2
  293. package/dist/loadSso-UQR6545M.js +0 -3
  294. package/dist/local-6UUGBZ4M.js +0 -1
  295. package/dist/local-ZYHV3J2K.cjs +0 -1
  296. package/dist/media-3Z6YW5J4.cjs +0 -1
  297. package/dist/media-E762GEHL.js +0 -1
  298. package/dist/mongo-auth-adapter-2H2AXDRH.cjs +0 -1
  299. package/dist/mongo-auth-adapter-YWMEOC42.js +0 -1
  300. package/dist/nodemailer-IDML4L6W.cjs +0 -53
  301. package/dist/nodemailer-NITB45SS.js +0 -54
  302. package/dist/nodemailer-transport-3VWVUBM5.cjs +0 -1
  303. package/dist/nodemailer-transport-7RHATUKL.js +0 -1
  304. package/dist/postgres-auth-adapter-QKBNXVPT.js +0 -1
  305. package/dist/postgres-auth-adapter-WMLM4UUC.cjs +0 -1
  306. package/dist/postgres-js-7YBZKGXG.cjs +0 -1
  307. package/dist/postgres-js-JLFIWOBH.js +0 -1
  308. package/dist/redis-adapter-EVK2SMKH.cjs +0 -1
  309. package/dist/redis-adapter-LY2NBSAG.js +0 -1
  310. package/dist/schema-RT6WSUYC.cjs +0 -1
  311. package/dist/schema-YFMSJK2P.js +0 -2
  312. package/dist/signin-N3T2KF5Q.js +0 -3
  313. package/dist/signin-VFBLX7EL.cjs +0 -2
  314. package/dist/sqlite-adapter-KPSISY6E.cjs +0 -1
  315. package/dist/sqlite-adapter-PI6SIY7O.js +0 -1
  316. package/dist/src-6LAUXXDM.cjs +0 -1
  317. package/dist/src-QBADSZV4.js +0 -1
  318. package/dist/sso-oidc-54BIRYR6.cjs +0 -2
  319. package/dist/sso-oidc-UB7G4END.js +0 -3
  320. package/dist/sts-WAA6I22C.js +0 -3
  321. package/dist/sts-YLXXIB3X.cjs +0 -2
  322. package/dist/types-BCOhfwHC.d.ts +0 -839
  323. package/dist/types-DxaK39ix.d.cts +0 -330
  324. package/dist/types-DxaK39ix.d.ts +0 -330
  325. package/dist/types-QglJ7PwT.d.cts +0 -839
@@ -1,4 +0,0 @@
1
- import {B as B$1,A as A$1,p,q as q$1,b,m,o,n,k as k$1,r,e,c,D as D$1,d,f,l}from'./chunk-TYQYKKWJ.js';import {g}from'./chunk-Y2YAKDEQ.js';import {join,sep}from'path';import {homedir}from'os';import {readFile}from'fs/promises';import {createHash}from'crypto';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g();var te;(function(r){r.MD5="md5",r.CRC32="crc32",r.CRC32C="crc32c",r.SHA1="sha1",r.SHA256="sha256";})(te||(te={}));g();g();var re="__smithy_context";g();g();var ye;(function(r){r.HTTP="http",r.HTTPS="https";})(ye||(ye={}));g();var _;(function(r){r.PROFILE="profile",r.SSO_SESSION="sso-session",r.SERVICES="services";})(_||(_={}));g();var H=r=>r[re]||(r[re]={});g();var Lt=r=>{if(typeof r=="function")return r;let e=Promise.resolve(r);return ()=>e};g();g();function qe(r){let e={};if(r=r.replace(/^\?/,""),r)for(let t of r.split("&")){let[o,s=null]=t.split("=");o=decodeURIComponent(o),s&&(s=decodeURIComponent(s)),o in e?Array.isArray(e[o])?e[o].push(s):e[o]=[e[o],s]:e[o]=s;}return e}var M=r=>{if(typeof r=="string")return M(new URL(r));let{hostname:e,pathname:t,port:o,protocol:s,search:n}=r,a;return n&&(a=qe(n)),{hostname:e,port:o?parseInt(o):void 0,protocol:s,path:t,query:a}};g();g();var N=class r{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment;}static clone(e){let t=new r({...e,headers:{...e.headers}});return t.query&&(t.query=zt(t.query)),t}static isInstance(e){if(!e)return false;let t=e;return "method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query=="object"&&typeof t.headers=="object"}clone(){return r.clone(this)}};function zt(r){return Object.keys(r).reduce((e,t)=>{let o=r[t];return {...e,[t]:Array.isArray(o)?[...o]:o}},{})}g();var v=class{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body;}static isInstance(e){if(!e)return false;let t=e;return typeof t.statusCode=="number"&&typeof t.headers=="object"}};g();var Ht=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),oe=(r,e=false)=>{if(!e)return Ht.test(r);let t=r.split(".");for(let o of t)if(!oe(o))return false;return true};g();function xe(r){return /^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(r)}g();var Te=r=>{if(typeof r=="object"){if("url"in r){let e=M(r.url);if(r.headers){e.headers={};for(let t in r.headers)e.headers[t.toLowerCase()]=r.headers[t].join(", ");}return e}return r}return M(r)};g();g();g();var se=(r,e,t,o,s)=>({name:e,namespace:r,traits:t,input:o,output:s});var Qe=r=>(e,t)=>async o=>{let{response:s}=await e(o),{operationSchema:n}=H(t),[,a,h,f,l,g]=n??[];try{let d=await r.protocol.deserializeResponse(se(a,h,f,l,g),{...r,...t},s);return {response:s,output:d}}catch(d){if(Object.defineProperty(d,"$response",{value:s,enumerable:false,writable:false,configurable:false}),!("$metadata"in d)){let E="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{d.message+=`
3
- `+E;}catch{!t.logger||t.logger?.constructor?.name==="NoOpLogger"?console.warn(E):t.logger?.warn?.(E);}typeof d.$responseBodyText<"u"&&d.$response&&(d.$response.body=d.$responseBodyText);try{if(v.isInstance(s)){let{headers:y={},statusCode:u}=s,p=Object.entries(y);d.$metadata={httpStatusCode:u,requestId:be(/^x-[\w-]+-request-?id$/,p),extendedRequestId:be(/^x-[\w-]+-id-2$/,p),cfId:be(/^x-[\w-]+-cf-id$/,p)};}}catch{}}throw d}},be=(r,e)=>(e.find(([t])=>t.match(r))||[void 0,void 0])[1];g();var Xe=r=>(e,t)=>async o=>{let{operationSchema:s}=H(t),[,n,a,h,f,l]=s??[],g=t.endpointV2?async()=>Te(t.endpointV2):r.endpoint,d=await r.protocol.serializeRequest(se(n,a,h,f,l),o.input,{...r,...t,endpoint:g});return e({...o,request:d})};var Je={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:true},Ye={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:true};function Ut(r){return {applyToStack:e=>{e.add(Xe(r),Ye),e.add(Qe(r),Je),r.protocol.setSerdeContext(r);}}}g();var U=class r{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,o=new Map){this.namespace=e,this.schemas=t,this.exceptions=o;}static for(e){return r.registries.has(e)||r.registries.set(e,new r(e)),r.registries.get(e)}copyFrom(e){let{schemas:t,exceptions:o}=this;for(let[s,n]of e.schemas)t.has(s)||t.set(s,n);for(let[s,n]of e.exceptions)o.has(s)||o.set(s,n);}register(e,t){let o=this.normalizeShapeId(e);for(let s of [this,r.for(o.split("#")[0])])s.schemas.set(o,t);}getSchema(e){let t=this.normalizeShapeId(e);if(!this.schemas.has(t)){if(!e.includes("#")){let o="#"+e,s=[];for(let[n,a]of this.schemas.entries())n.endsWith(o)&&s.push(a);if(s.length===1)return s[0]}throw new Error(`@smithy/core/schema - schema not found for ${t}`)}return this.schemas.get(t)}registerError(e,t){let o=e,s=o[1];for(let n of [this,r.for(s)])n.schemas.set(s+"#"+o[2],o),n.exceptions.set(o,t);}getErrorCtor(e){let t=e;return this.exceptions.has(t)?this.exceptions.get(t):r.for(t[1]).exceptions.get(t)}getBaseException(){for(let e of this.exceptions.keys())if(Array.isArray(e)){let[,t,o]=e,s=t+"#"+o;if(s.startsWith("smithy.ts.sdk.synthetic.")&&s.endsWith("ServiceException"))return e}}find(e){for(let t of this.schemas.values())if(e(t))return t}clear(){this.schemas.clear(),this.exceptions.clear();}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}};g();g();var k=r=>typeof r=="function"?r():r;g();g();var ie=[];function w(r){if(typeof r=="object")return r;if(r=r|0,ie[r])return ie[r];let e={},t=0;for(let o of ["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(r>>t++&1)===1&&(e[o]=1);return ie[r]=e}var $={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},ne=[],ae={},x=class r{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=r.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,t){this.ref=e,this.memberName=t;let o=[],s=e,n=e;for(this._isMemberSchema=false;Ne(s);)o.push(s[1]),s=s[0],n=k(s),this._isMemberSchema=true;if(o.length>0){this.memberTraits={};for(let a=o.length-1;a>=0;--a){let h=o[a];Object.assign(this.memberTraits,w(h));}}else this.memberTraits=0;if(n instanceof r){let a=this.memberTraits;Object.assign(this,n),this.memberTraits=Object.assign({},a,n.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=t??n.memberName;return}if(this.schema=k(n),Ze(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(n),this.traits=0),this._isMemberSchema&&!t)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);return !t&&typeof e=="object"&&e!==null?e.symbol===this.symbol:t}static of(e){let t=typeof e=="function"||typeof e=="object"&&e!==null;if(typeof e=="number"){if(ne[e])return ne[e]}else if(typeof e=="string"){if(ae[e])return ae[e]}else if(t&&e[$.ns])return e[$.ns];let o=k(e);if(o instanceof r)return o;if(Ne(o)){let[n,a]=o;if(n instanceof r)return Object.assign(n.getMergedTraits(),w(a)),n;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}let s=new r(o);return t?e[$.ns]=s:typeof o=="string"?ae[o]=s:typeof o=="number"?ne[o]=s:s}getSchema(){let e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=false){let{name:t}=this;return !e&&t&&t.includes("#")?t.split("#")[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){let e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){let e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){let e=this.getSchema();if(typeof e!="object")return false;let t=e[0];return t===3||t===-3||t===4}isUnionSchema(){let e=this.getSchema();return typeof e!="object"?false:e[0]===4}isBlobSchema(){let e=this.getSchema();return e===21||e===42}isTimestampSchema(){let e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){let{streaming:e}=this.getMergedTraits();return !!e||this.getSchema()===42}isIdempotencyToken(){return !!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return w(this.memberTraits)}getOwnTraits(){return w(this.traits)}getKeySchema(){let[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);let o=this.getSchema(),s=e?15:o[4]??0;return V([s,0],"key")}getValueSchema(){let e=this.getSchema(),[t,o,s]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],n=typeof e=="number"?63&e:e&&typeof e=="object"&&(o||s)?e[3+e[0]]:t?15:void 0;if(n!=null)return V([n,0],o?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`)}getMemberSchema(e){let t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){let o=t[4].indexOf(e),s=t[5][o];return V(Ne(s)?s:[s,0],e)}if(this.isDocumentSchema())return V([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${e}.`)}getMemberSchemas(){let e={};try{for(let[t,o]of this.structIterator())e[t]=o;}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(let[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e}return ""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");let e=this.getSchema(),t=e[4].length,o=e[$.it];if(o&&t===o.length){yield*o;return}o=Array(t);for(let s=0;s<t;++s){let n=e[4][s],a=V([e[5][s],0],n);yield o[s]=[n,a];}e[$.it]=o;}};function V(r,e){if(r instanceof x)return Object.assign(r,{memberName:e,_isMemberSchema:true});let t=x;return new t(r,e)}var Ne=r=>Array.isArray(r)&&r.length===2,Ze=r=>Array.isArray(r)&&r.length>=5;g();var I=class r extends Error{name="ProviderError";tryNextLink;constructor(e,t=true){let o,s=true;typeof t=="boolean"?(o=void 0,s=t):t!=null&&typeof t=="object"&&(o=t.logger,s=t.tryNextLink??true),super(e),this.tryNextLink=s,Object.setPrototypeOf(this,r.prototype),o?.debug?.(`@smithy/property-provider ${s?"->":"(!)"} ${e}`);}static from(e,t=true){return Object.assign(new this(e.message,t),e)}};g();var P=class r extends I{name="CredentialsProviderError";constructor(e,t=true){super(e,t),Object.setPrototypeOf(this,r.prototype);}};g();var et="AWS_PROFILE",tt="default",Ce=r=>r.profile||process.env[et]||tt;g();g();g();var _e={},Vt=()=>process&&process.geteuid?`${process.geteuid()}`:"DEFAULT",F=()=>{let{HOME:r,USERPROFILE:e,HOMEPATH:t,HOMEDRIVE:o=`C:${sep}`}=process.env;if(r)return r;if(e)return e;if(t)return `${o}${t}`;let s=Vt();return _e[s]||(_e[s]=homedir()),_e[s]};var Gt="AWS_CONFIG_FILE",ce=()=>process.env[Gt]||join(F(),".aws","config");g();g();g();var rt=r=>Object.entries(r).filter(([e])=>{let t=e.indexOf(".");return t===-1?false:Object.values(_).includes(e.substring(0,t))}).reduce((e,[t,o])=>{let s=t.indexOf("."),n=t.substring(0,s)===_.PROFILE?t.substring(s+1):t;return e[n]=o,e},{...r.default&&{default:r.default}});g();var Wt="AWS_SHARED_CREDENTIALS_FILE",ot=()=>process.env[Wt]||join(F(),".aws","credentials");g();var Kt=/^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/,qt=["__proto__","profile __proto__"],G=r=>{let e={},t,o;for(let s of r.split(/\r?\n/)){let n=s.split(/(^|\s)[;#]/)[0].trim();if(n[0]==="["&&n[n.length-1]==="]"){t=void 0,o=void 0;let h=n.substring(1,n.length-1),f=Kt.exec(h);if(f){let[,l,,g]=f;Object.values(_).includes(l)&&(t=[l,g].join("."));}else t=h;if(qt.includes(h))throw new Error(`Found invalid profile name "${h}"`)}else if(t){let h=n.indexOf("=");if(![0,-1].includes(h)){let[f,l]=[n.substring(0,h).trim(),n.substring(h+1).trim()];if(l==="")o=f;else {o&&s.trimStart()===s&&(o=void 0),e[t]=e[t]||{};let g=o?[o,f].join("."):f;e[t][g]=l;}}}}return e};g();var we={},B={},L=(r,e)=>B[r]!==void 0?B[r]:((!we[r]||e?.ignoreCache)&&(we[r]=readFile(r,"utf8")),we[r]);var it=()=>({}),me=async(r={})=>{let{filepath:e=ot(),configFilepath:t=ce()}=r,o=F(),s="~/",n=e;e.startsWith(s)&&(n=join(o,e.slice(2)));let a=t;t.startsWith(s)&&(a=join(o,t.slice(2)));let h=await Promise.all([L(a,{ignoreCache:r.ignoreCache}).then(G).then(rt).catch(it),L(n,{ignoreCache:r.ignoreCache}).then(G).catch(it)]);return {configFile:h[0],credentialsFile:h[1]}};var nt=r=>Object.entries(r).filter(([e])=>e.startsWith(_.SSO_SESSION+".")).reduce((e,[t,o])=>({...e,[t.substring(t.indexOf(".")+1)]:o}),{});var Xt=()=>({}),Jt=async(r={})=>L(r.configFilepath??ce()).then(G).then(nt).catch(Xt);g();g();var at=(...r)=>{let e={};for(let t of r)for(let[o,s]of Object.entries(t))e[o]!==void 0?Object.assign(e[o],s):e[o]=s;return e};var Yt=async r=>{let e=await me(r);return at(e.configFile,e.credentialsFile)};g();g();g();var Oe=r=>{let t=createHash("sha1").update(r).digest("hex");return join(F(),".aws","sso","cache",`${t}.json`)};var W={},rr=async r=>{if(W[r])return W[r];let e=Oe(r),t=await readFile(e,"utf8");return JSON.parse(t)};var or={getFileRecord(){return B},interceptFile(r,e){B[r]=Promise.resolve(e);},getTokenRecord(){return W},interceptToken(r,e){W[r]=e;}};g();g();var Ie=(...r)=>async()=>{if(r.length===0)throw new I("No providers in chain");let e;for(let t of r)try{return await t()}catch(o){if(e=o,o?.tryNextLink)continue;throw o}throw e};g();var fe=(r,e,t)=>{let o,s,n,a=false,h=async()=>{s||(s=r());try{o=await s,n=!0,a=!1;}finally{s=void 0;}return o};return e===void 0?async f=>((!n||f?.forceRefresh)&&(o=await h()),o):async f=>((!n||f?.forceRefresh)&&(o=await h()),a?o:t&&!t(o)?(a=true,o):(e(o)&&await h(),o))};g();g();function he(r){try{let e=new Set(Array.from(r.match(/([A-Z_]){3,}/g)??[]));return e.delete("CONFIG"),e.delete("CONFIG_PREFIX_SEPARATOR"),e.delete("ENV"),[...e].join(", ")}catch{return r}}var ct=(r,e)=>async()=>{try{let t=r(process.env,e);if(t===void 0)throw new Error;return t}catch(t){throw new P(t.message||`Not found in ENV: ${he(r.toString())}`,{logger:e?.logger})}};g();var mt=(r,{preferredFile:e="config",...t}={})=>async()=>{let o=Ce(t),{configFile:s,credentialsFile:n}=await me(t),a=n[o]||{},h=s[o]||{},f=e==="config"?{...a,...h}:{...h,...a};try{let g=r(f,e==="config"?s:n);if(g===void 0)throw new Error;return g}catch(l){throw new P(l.message||`Not found in config files w/ profile [${o}]: ${he(r.toString())}`,{logger:t.logger})}};g();g();var ft=r=>()=>Promise.resolve(r);var sr=r=>typeof r=="function",ht=r=>sr(r)?async()=>await r():ft(r);var le=({environmentVariableSelector:r,configFileSelector:e,default:t},o={})=>{let{signingName:s,logger:n}=o;return fe(Ie(ct(r,{signingName:s,logger:n}),mt(e,o),ht(t)))};g();g();var lt=new Set,pt=(r,e=oe)=>{if(!lt.has(r)&&!e(r))if(r==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${r}" is not a valid hostname component.`);else lt.add(r);};g();g();var pe=r=>typeof r=="string"&&(r.startsWith("fips-")||r.endsWith("-fips"));var dt=r=>pe(r)?["fips-aws-global","aws-fips"].includes(r)?"us-east-1":r.replace(/fips-(dkr-|prod-)?|-fips/,""):r;var ir=r=>{let{region:e,useFipsEndpoint:t}=r;if(!e)throw new Error("Region is missing");return Object.assign(r,{region:async()=>{let o=typeof e=="function"?await e():e,s=dt(o);return pt(s),s},useFipsEndpoint:async()=>{let o=typeof e=="string"?e:await e();return pe(o)?true:typeof t!="function"?Promise.resolve(!!t):t()}})};g();g();var Ae=class r extends I{name="TokenProviderError";constructor(e,t=true){super(e,t),Object.setPrototypeOf(this,r.prototype);}};g();var R=(r,e,t)=>{if(e in r){if(r[e]==="true")return true;if(r[e]==="false")return false;throw new Error(`Cannot load ${t} "${e}". Expected "true" or "false", got ${r[e]}.`)}};g();var A;(function(r){r.ENV="env",r.CONFIG="shared config entry";})(A||(A={}));g();var ut="AWS_USE_DUALSTACK_ENDPOINT",gt="use_dualstack_endpoint";var nr={environmentVariableSelector:r=>R(r,ut,A.ENV),configFileSelector:r=>R(r,gt,A.CONFIG),default:false};g();var St="AWS_USE_FIPS_ENDPOINT",Et="use_fips_endpoint";var ar={environmentVariableSelector:r=>R(r,St,A.ENV),configFileSelector:r=>R(r,Et,A.CONFIG),default:false};g();g();g();var yt="AWS_EXECUTION_ENV",De="AWS_REGION",ve="AWS_DEFAULT_REGION",xt="AWS_EC2_METADATA_DISABLED",Tt=["in-region","cross-region","mobile","standard","legacy"],bt="/latest/meta-data/placement/region",Nt="/latest/api/token",Ct="x-aws-ec2-metadata-token",_t="x-aws-ec2-metadata-token-ttl-seconds";var wt=1e3,cr=6e4,At=0,de=async()=>{if(!process.env[xt]&&!(Date.now()<At))try{let r=mr(),e=(await It({...r,path:Nt,method:"PUT",headers:{[_t]:"21600"}})).toString();return (await It({...r,path:bt,method:"GET",headers:{[Ct]:e}})).toString().trim()||Ot()}catch{return Ot()}},Ot=()=>{At=Date.now()+cr;},mr=()=>{let r=process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;if(r){let e=new URL(r);return {hostname:e.hostname.replace(/^\[(.+)]$/,"$1"),port:e.port?Number(e.port):void 0}}return process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE==="IPv6"?{hostname:"fd00:ec2::254"}:{hostname:"169.254.169.254"}},It=async r=>{let{request:e}=await import('http');return new Promise((t,o)=>{let s=e({hostname:r.hostname,port:r.port,path:r.path,method:r.method,headers:r.headers,timeout:wt,signal:AbortSignal.timeout(wt)});s.on("error",n=>{o(n),s.destroy();}),s.on("timeout",()=>{o(new Error("TimeoutError from instance metadata service")),s.destroy();}),s.on("response",n=>{let{statusCode:a=400}=n;if(a<200||a>=300){o(Object.assign(new Error("Error response received from instance metadata service"),{statusCode:a})),s.destroy();return}let h=[];n.on("data",f=>h.push(f)),n.on("end",()=>{t(Buffer.concat(h)),s.destroy();});}),s.end();})};var Dt="AWS_REGION",vt="region",Fe={environmentVariableSelector:r=>r[Dt],configFileSelector:r=>r[vt],default:async()=>{let r=await de();if(r)return r;throw new Error("Region is missing")}},fr={preferredFile:"credentials"};g();g();var hr="AWS_DEFAULTS_MODE",lr="defaults_mode",Ft={environmentVariableSelector:r=>r[hr],configFileSelector:r=>r[lr],default:"legacy"};var pr=({region:r=le(Fe),defaultsMode:e=le(Ft)}={})=>fe(async()=>{let t=typeof e=="function"?await e():e;switch(t?.toLowerCase()){case "auto":return dr(r);case "in-region":case "cross-region":case "mobile":case "standard":case "legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Tt.join(", ")}, got ${t}`)}}),dr=async r=>{if(r){let e=typeof r=="function"?await r():r,t=await ur();return t?e===t?"in-region":"cross-region":"standard"}return "standard"},ur=async()=>process.env[yt]&&(process.env[De]||process.env[ve])?process.env[De]??process.env[ve]:de();g();var Pt="content-length";function Rt(r){return e=>async t=>{let o=t.request;if(N.isInstance(o)){let{body:s,headers:n}=o;if(s&&Object.keys(n).map(a=>a.toLowerCase()).indexOf(Pt)===-1)try{let a=r(s);o.headers={...o.headers,[Pt]:String(a)};}catch{}}return e({...t,request:o})}}var Mt={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:true},gr=r=>({applyToStack:e=>{e.add(Rt(r.bodyLengthChecker),Mt);}});g();g();var D=async(r=new Uint8Array,e)=>{if(r instanceof Uint8Array)return B$1.mutate(r);if(!r)return B$1.mutate(new Uint8Array);let t=e.streamCollector(r);return B$1.mutate(await t)};g();function ue(r){return encodeURIComponent(r).replace(/[!'()*]/g,function(e){return "%"+e.charCodeAt(0).toString(16).toUpperCase()})}g();g();g();var O=class{serdeContext;setSerdeContext(e){this.serdeContext=e;}};var z=class extends O{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=U.for(e.defaultNamespace);for(let t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t);}getRequestType(){return N}getResponseType(){return v}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e);}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(let[o,s]of t.url.searchParams.entries())e.query[o]=s;if(t.headers)for(let o in t.headers)e.headers[o]=t.headers[o].join(", ");return e}else {if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(let o in t.headers)e.headers[o]=t.headers[o];return e}}setHostPrefix(e,t,o){if(this.serdeContext?.disableHostPrefix)return;let s=x.of(t.input),n=w(t.traits??{});if(n.endpoint){let a=n.endpoint?.[0];if(typeof a=="string"){for(let[h,f]of s.structIterator()){if(!f.getMergedTraits().hostLabel)continue;let l=o[h];if(typeof l!="string")throw new Error(`@smithy/core/schema - ${h} in input must be a string as hostLabel.`);a=a.replace(`{${h}}`,l);}if(e.hostname=a+e.hostname,!xe(e.hostname))throw new Error(`[${e.hostname}] is not a valid hostname.`)}}}deserializeMetadata(e){return {httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:o}){return (await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:o})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:o}){return (await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:o})}async loadEventStreamCapability(){let{EventStreamSerde:e,eventStreamSerdeProvider:t}=await import('./event-streams-7NAWZW2I.js'),o=this.resolveEventStreamMarshaller(t);return new e({marshaller:o,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}resolveEventStreamMarshaller(e){let t=this.serdeContext;return t.eventStreamMarshaller?t.eventStreamMarshaller:e(this.serdeContext)}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,o,s,n){return []}getEventStreamMarshaller(){let e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}};var Pe=class extends z{async serializeRequest(e,t,o){let s=t&&typeof t=="object"?t:{},n=this.serializer,a={},h={},f=await o.endpoint(),l=x.of(e?.input),g=[],d=[],E=false,y,u=new N({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:a,headers:h,body:void 0});if(f){this.updateServiceEndpoint(u,f),this.setHostPrefix(u,e,s);let p=w(e.traits);if(p.http){u.method=p.http[0];let[S,T]=p.http[1].split("?");u.path=="/"?u.path=S:u.path+=S;let b=new URLSearchParams(T??"");for(let[C,X]of b)a[C]=X;}}for(let[p,S]of l.structIterator()){let T=S.getMergedTraits()??{},b=s[p];if(b==null&&!S.isIdempotencyToken()){if(T.httpLabel&&(u.path.includes(`{${p}+}`)||u.path.includes(`{${p}}`)))throw new Error(`No value provided for input HTTP label: ${p}.`);continue}if(T.httpPayload)S.isStreaming()?S.isStructSchema()?s[p]&&(y=await this.serializeEventStream({eventStream:s[p],requestSchema:l})):y=b:(n.write(S,b),y=n.flush());else if(T.httpLabel){n.write(S,b);let C=n.flush();u.path.includes(`{${p}+}`)?u.path=u.path.replace(`{${p}+}`,C.split("/").map(ue).join("/")):u.path.includes(`{${p}}`)&&(u.path=u.path.replace(`{${p}}`,ue(C)));}else if(T.httpHeader)n.write(S,b),h[T.httpHeader.toLowerCase()]=String(n.flush());else if(typeof T.httpPrefixHeaders=="string")for(let C in b){let X=b[C],ze=T.httpPrefixHeaders+C;n.write([S.getValueSchema(),{httpHeader:ze}],X),h[ze.toLowerCase()]=n.flush();}else T.httpQuery||T.httpQueryParams?this.serializeQuery(S,b,a):(E=true,g.push(p),d.push(S));}if(E&&s){let[p,S]=(l.getName(true)??"#Unknown").split("#"),T=l.getSchema()[6],b=[3,p,S,l.getMergedTraits(),g,d,void 0];T?b[6]=T:b.pop(),n.write(b,s),y=n.flush();}return u.headers=h,u.query=a,u.body=y,u}serializeQuery(e,t,o){let s=this.serializer,n=e.getMergedTraits();if(n.httpQueryParams){for(let a in t)if(!(a in o)){let h=t[a],f=e.getValueSchema();Object.assign(f.getMergedTraits(),{...n,httpQuery:a,httpQueryParams:void 0}),this.serializeQuery(f,h,o);}return}if(e.isListSchema()){let a=!!e.getMergedTraits().sparse,h=[];for(let f of t){s.write([e.getValueSchema(),n],f);let l=s.flush();(a||l!==void 0)&&h.push(l);}o[n.httpQuery]=h;}else s.write([e,n],t),o[n.httpQuery]=s.flush();}async deserializeResponse(e,t,o){let s=this.deserializer,n=x.of(e.output),a={};if(o.statusCode>=300){let f=await D(o.body,t);throw f.byteLength>0&&Object.assign(a,await s.read(15,f)),await this.handleError(e,t,o,a,this.deserializeMetadata(o)),new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let f in o.headers){let l=o.headers[f];delete o.headers[f],o.headers[f.toLowerCase()]=l;}let h=await this.deserializeHttpMessage(n,t,o,a);if(h.length){let f=await D(o.body,t);if(f.byteLength>0){let l=await s.read(n,f);for(let g of h)l[g]!=null&&(a[g]=l[g]);}}else h.discardResponseBody&&await D(o.body,t);return a.$metadata=this.deserializeMetadata(o),a}async deserializeHttpMessage(e,t,o,s,n){let a;s instanceof Set?a=n:a=s;let h=true,f=this.deserializer,l=x.of(e),g=[];for(let[d,E]of l.structIterator()){let y=E.getMemberTraits();if(y.httpPayload){if(h=false,E.isStreaming())E.isStructSchema()?a[d]=await this.deserializeEventStream({response:o,responseSchema:l}):a[d]=A$1(o.body);else if(o.body){let p=await D(o.body,t);p.byteLength>0&&(a[d]=await f.read(E,p));}}else if(y.httpHeader){let u=String(y.httpHeader).toLowerCase(),p$1=o.headers[u];if(p$1!=null)if(E.isListSchema()){let S=E.getValueSchema();S.getMergedTraits().httpHeader=u;let T;S.isTimestampSchema()&&S.getSchema()===4?T=p(p$1,",",2):T=q$1(p$1);let b=[];for(let C of T)b.push(await f.read(S,C.trim()));a[d]=b;}else a[d]=await f.read(E,p$1);}else if(y.httpPrefixHeaders!==void 0){a[d]={};for(let u in o.headers)if(u.startsWith(y.httpPrefixHeaders)){let p=o.headers[u],S=E.getValueSchema();S.getMergedTraits().httpHeader=u,a[d][u.slice(y.httpPrefixHeaders.length)]=await f.read(S,p);}}else y.httpResponseCode?a[d]=o.statusCode:g.push(d);}return g.discardResponseBody=h,g}};g();var Re=class extends z{async serializeRequest(e,t,o){let s=this.serializer,n={},a={},h=await o.endpoint(),f=x.of(e?.input),l=f.getSchema(),g,d=t&&typeof t=="object"?t:{},E=new N({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:n,headers:a,body:void 0});if(h&&(this.updateServiceEndpoint(E,h),this.setHostPrefix(E,e,d)),d){let y=f.getEventStreamMember();if(y){if(d[y]){let u={};for(let[p,S]of f.structIterator())p!==y&&d[p]&&(s.write(S,d[p]),u[p]=s.flush());g=await this.serializeEventStream({eventStream:d[y],requestSchema:f,initialRequest:u});}}else s.write(l,d),g=s.flush();}return E.headers=Object.assign(E.headers,a),E.query=n,E.body=g,E.method="POST",E}async deserializeResponse(e,t,o){let s=this.deserializer,n=x.of(e.output),a={};if(o.statusCode>=300){let f=await D(o.body,t);throw f.byteLength>0&&Object.assign(a,await s.read(15,f)),await this.handleError(e,t,o,a,this.deserializeMetadata(o)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let f in o.headers){let l=o.headers[f];delete o.headers[f],o.headers[f.toLowerCase()]=l;}let h=n.getEventStreamMember();if(h)a[h]=await this.deserializeEventStream({response:o,responseSchema:n,initialResponseContainer:a});else {let f=await D(o.body,t);f.byteLength>0&&Object.assign(a,await s.read(n,f));}return a.$metadata=this.deserializeMetadata(o),a}};g();g();function K(r,e){if(e.timestampFormat.useTrait&&r.isTimestampSchema()&&(r.getSchema()===5||r.getSchema()===6||r.getSchema()===7))return r.getSchema();let{httpLabel:t,httpPrefixHeaders:o,httpHeader:s,httpQuery:n}=r.getMergedTraits();return (e.httpBindings?typeof o=="string"||s?6:n||t?5:void 0:void 0)??e.timestampFormat.default}var q=class extends O{settings;constructor(e){super(),this.settings=e;}read(e,t){let o$1=x.of(e);if(o$1.isListSchema())return q$1(t).map(s=>this.read(o$1.getValueSchema(),s));if(o$1.isBlobSchema())return (this.serdeContext?.base64Decoder??b)(t);if(o$1.isTimestampSchema())switch(K(o$1,this.settings)){case 5:return n(t);case 6:return o(t);case 7:return m(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(o$1.isStringSchema()){let s=o$1.getMergedTraits().mediaType,n=t;if(s)return o$1.getMergedTraits().httpHeader&&(n=this.base64ToUtf8(n)),(s==="application/json"||s.endsWith("+json"))&&(n=k$1.from(n)),n}return o$1.isNumericSchema()?Number(t):o$1.isBigIntegerSchema()?BigInt(t):o$1.isBigDecimalSchema()?new r(t,"bigDecimal"):o$1.isBooleanSchema()?String(t).toLowerCase()==="true":t}base64ToUtf8(e$1){return (this.serdeContext?.utf8Encoder??e)((this.serdeContext?.base64Decoder??b)(e$1))}};g();var Me=class extends O{codecDeserializer;stringDeserializer;constructor(e,t){super(),this.codecDeserializer=e,this.stringDeserializer=new q(t);}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e;}read(e$1,t){let o=x.of(e$1),s=o.getMergedTraits(),n=this.serdeContext?.utf8Encoder??e;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(o,n(t));if(s.httpPayload){if(o.isBlobSchema()){let a=this.serdeContext?.utf8Decoder??c;return typeof t=="string"?a(t):t}else if(o.isStringSchema())return "byteLength"in t?n(t):t}return this.codecDeserializer.read(o,t)}};g();g();var ge=class extends O{settings;stringBuffer="";constructor(e){super(),this.settings=e;}write(e,t){let o=x.of(e);switch(typeof t){case "object":if(t===null){this.stringBuffer="null";return}if(o.isTimestampSchema()){if(!(t instanceof Date))throw new Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${o.getName(true)}`);switch(K(o,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=f(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1e3);}return}if(o.isBlobSchema()&&"byteLength"in t){this.stringBuffer=(this.serdeContext?.base64Encoder??d)(t);return}if(o.isListSchema()&&Array.isArray(t)){let a="";for(let h of t){this.write([o.getValueSchema(),o.getMergedTraits()],h);let f=this.flush(),l$1=o.getValueSchema().isTimestampSchema()?f:l(f);a!==""&&(a+=", "),a+=l$1;}this.stringBuffer=a;return}this.stringBuffer=JSON.stringify(t,null,2);break;case "string":let s=o.getMergedTraits().mediaType,n=t;if(s&&((s==="application/json"||s.endsWith("+json"))&&(n=k$1.from(n)),o.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??d)(n.toString());return}this.stringBuffer=t;break;default:o.isIdempotencyToken()?this.stringBuffer=D$1():this.stringBuffer=String(t);}}flush(){let e=this.stringBuffer;return this.stringBuffer="",e}};var Le=class{codecSerializer;stringSerializer;buffer;constructor(e,t,o=new ge(t)){this.codecSerializer=e,this.stringSerializer=o;}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e);}write(e,t){let o=x.of(e),s=o.getMergedTraits();if(s.httpHeader||s.httpLabel||s.httpQuery){this.stringSerializer.write(o,t),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(o,t)}flush(){if(this.buffer!==void 0){let e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}};g();var Sr=r=>({setHttpHandler(e){r.httpHandler=e;},httpHandler(){return r.httpHandler},updateHttpClientConfig(e,t){r.httpHandler?.updateHttpClientConfig(e,t);},httpHandlerConfigs(){return r.httpHandler.httpHandlerConfigs()}}),Er=r=>({httpHandler:r.httpHandler()});g();var Q=r=>encodeURIComponent(r).replace(/[!'()*]/g,yr),yr=r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`;g();function xr(r){let e=[];for(let t of Object.keys(r).sort()){let o=r[t];if(t=Q(t),Array.isArray(o))for(let s=0,n=o.length;s<n;s++)e.push(`${t}=${Q(o[s])}`);else {let s=t;(o||typeof o=="string")&&(s+=`=${Q(o)}`),e.push(s);}}return e.join("&")}
4
- export{Yt as A,or as B,le as C,nr as D,ar as E,Fe as F,fr as G,ir as H,pr as I,D as J,ue as K,Pe as L,Re as M,K as N,q as O,Me as P,Le as Q,Sr as R,Er as S,gr as T,Q as U,xr as V,ye as a,te as b,re as c,H as d,N as e,v as f,oe as g,Lt as h,M as i,Te as j,k,Ut as l,x as m,U as n,I as o,P as p,Ae as q,Ie as r,R as s,A as t,et as u,Ce as v,Oe as w,rr as x,L as y,Jt as z};
@@ -1,14 +0,0 @@
1
- import {b}from'./chunk-N5POANYV.js';import {f,R as R$1,h,g as g$1,S as S$1,X as X$1,p,n,P,j,Q,d as d$1}from'./chunk-HRAY65XH.js';import {t,a,Y,N,J as J$1,c,A,d,R,v,i,l,H as H$1,w,e,f as f$1,_}from'./chunk-3NSZZCOJ.js';import {g}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g();g();g();var X=class{static[a]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(e,t){this.reference=()=>{let{name:n,columns:s,foreignColumns:o}=e();return {name:n,columns:s,foreignTable:o[0].table,foreignColumns:o}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete);}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new re(e,this)}},re=class{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete;}static[a]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),s=t.map(r=>r.name),o=n.map(r=>r.name),u=[this.table[f$1],...s,n[0].table[f$1],...o];return e??`${u.join("_")}_fk`}};g();function ue(a,e){return `${a[f$1]}_${e.join("_")}_unique`}var q=class extends e{static[a]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=true,this.config.uniqueName=e,this}generatedAlwaysAs(e,t){return this.config.generated={as:e,type:"always",mode:t?.mode??"virtual"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:s})=>((o,u)=>{let r=new X(()=>{let c=o();return {columns:[e],foreignColumns:[c]}});return u.onUpdate&&r.onUpdate(u.onUpdate),u.onDelete&&r.onDelete(u.onDelete),r.build(t)})(n,s))}},S=class extends d{constructor(e,t){t.uniqueName||(t.uniqueName=ue(e,[t.name])),super(e,t),this.table=e;}static[a]="SQLiteColumn"};var k=class extends q{static[a]="SQLiteBaseIntegerBuilder";constructor(e,t,n){super(e,t,n),this.config.autoIncrement=false;}primaryKey(e){return e?.autoIncrement&&(this.config.autoIncrement=true),this.config.hasDefault=true,super.primaryKey()}},J=class extends S{static[a]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return "integer"}},ae=class extends k{static[a]="SQLiteIntegerBuilder";constructor(e){super(e,"number","SQLiteInteger");}build(e){return new le(e,this.config)}},le=class extends J{static[a]="SQLiteInteger"},me=class extends k{static[a]="SQLiteTimestampBuilder";constructor(e,t){super(e,"date","SQLiteTimestamp"),this.config.mode=t;}defaultNow(){return this.default(J$1`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(e){return new ce(e,this.config)}},ce=class extends J{static[a]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(e){return this.config.mode==="timestamp"?new Date(e*1e3):new Date(e)}mapToDriverValue(e){let t=e.getTime();return this.config.mode==="timestamp"?Math.floor(t/1e3):t}},fe=class extends k{static[a]="SQLiteBooleanBuilder";constructor(e,t){super(e,"boolean","SQLiteBoolean"),this.config.mode=t;}build(e){return new de(e,this.config)}},de=class extends J{static[a]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(e){return Number(e)===1}mapToDriverValue(e){return e?1:0}};function Ge(a,e){let{name:t,config:n}=Y(a,e);return n?.mode==="timestamp"||n?.mode==="timestamp_ms"?new me(t,n.mode):n?.mode==="boolean"?new fe(t,n.mode):new ae(t)}g();var pe=class extends q{static[a]="SQLiteNumericBuilder";constructor(e){super(e,"string","SQLiteNumeric");}build(e){return new he(e,this.config)}},he=class extends S{static[a]="SQLiteNumeric";mapFromDriverValue(e){return typeof e=="string"?e:String(e)}getSQLType(){return "numeric"}},ge=class extends q{static[a]="SQLiteNumericNumberBuilder";constructor(e){super(e,"number","SQLiteNumericNumber");}build(e){return new ye(e,this.config)}},ye=class extends S{static[a]="SQLiteNumericNumber";mapFromDriverValue(e){return typeof e=="number"?e:Number(e)}mapToDriverValue=String;getSQLType(){return "numeric"}},be=class extends q{static[a]="SQLiteNumericBigIntBuilder";constructor(e){super(e,"bigint","SQLiteNumericBigInt");}build(e){return new Se(e,this.config)}},Se=class extends S{static[a]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return "numeric"}};function He(a,e){let{name:t,config:n}=Y(a,e),s=n?.mode;return s==="number"?new ge(t):s==="bigint"?new be(t):new pe(t)}g();var $e=class extends q{static[a]="SQLiteTextBuilder";constructor(e,t){super(e,"string","SQLiteText"),this.config.enumValues=t.enum,this.config.length=t.length;}build(e){return new Te(e,this.config)}},Te=class extends S{static[a]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(e,t){super(e,t);}getSQLType(){return `text${this.config.length?`(${this.config.length})`:""}`}},Ce=class extends q{static[a]="SQLiteTextJsonBuilder";constructor(e){super(e,"json","SQLiteTextJson");}build(e){return new we(e,this.config)}},we=class extends S{static[a]="SQLiteTextJson";getSQLType(){return "text"}mapFromDriverValue(e){return JSON.parse(e)}mapToDriverValue(e){return JSON.stringify(e)}};function Ze(a,e={}){let{name:t,config:n}=Y(a,e);return n.mode==="json"?new Ce(t):new $e(t,n)}g();g();g();var Le=class extends q{static[a]="SQLiteBigIntBuilder";constructor(e){super(e,"bigint","SQLiteBigInt");}build(e){return new qe(e,this.config)}},qe=class extends S{static[a]="SQLiteBigInt";getSQLType(){return "blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return BigInt(t.toString("utf8"))}return BigInt(_.decode(e))}mapToDriverValue(e){return Buffer.from(e.toString())}},xe=class extends q{static[a]="SQLiteBlobJsonBuilder";constructor(e){super(e,"json","SQLiteBlobJson");}build(e){return new Qe(e,this.config)}},Qe=class extends S{static[a]="SQLiteBlobJson";getSQLType(){return "blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return JSON.parse(t.toString("utf8"))}return JSON.parse(_.decode(e))}mapToDriverValue(e){return Buffer.from(JSON.stringify(e))}},Be=class extends q{static[a]="SQLiteBlobBufferBuilder";constructor(e){super(e,"buffer","SQLiteBlobBuffer");}build(e){return new Ne(e,this.config)}},Ne=class extends S{static[a]="SQLiteBlobBuffer";mapFromDriverValue(e){return Buffer.isBuffer(e)?e:Buffer.from(e)}getSQLType(){return "blob"}};function et(a,e){let{name:t,config:n}=Y(a,e);return n?.mode==="json"?new xe(t):n?.mode==="bigint"?new Le(t):new Be(t)}g();var Oe=class extends q{static[a]="SQLiteCustomColumnBuilder";constructor(e,t,n){super(e,"custom","SQLiteCustomColumn"),this.config.fieldConfig=t,this.config.customTypeParams=n;}build(e){return new ve(e,this.config)}},ve=class extends S{static[a]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(e,t){super(e,t),this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver;}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom=="function"?this.mapFrom(e):e}mapToDriverValue(e){return typeof this.mapTo=="function"?this.mapTo(e):e}};function tt(a){return (e,t)=>{let{name:n,config:s}=Y(e,t);return new Oe(n,s,a)}}g();var _e=class extends q{static[a]="SQLiteRealBuilder";constructor(e){super(e,"number","SQLiteReal");}build(e){return new De(e,this.config)}},De=class extends S{static[a]="SQLiteReal";getSQLType(){return "real"}};function it(a){return new _e(a??"")}function nt(){return {blob:et,customType:tt,integer:Ge,numeric:He,real:it,text:Ze}}var Ke=Symbol.for("drizzle:SQLiteInlineForeignKeys"),F=class extends t{static[a]="SQLiteTable";static Symbol=Object.assign({},t.Symbol,{InlineForeignKeys:Ke});[t.Symbol.Columns];[Ke]=[];[t.Symbol.ExtraConfigBuilder]=void 0};function lt(a,e,t$1,n,s=a){let o=new F(a,n,s),u=typeof e=="function"?e(nt()):e,r=Object.fromEntries(Object.entries(u).map(([f,p])=>{let $=p;$.setName(f);let x=$.build(o);return o[Ke].push(...$.buildForeignKeys(x,o)),[f,x]})),c=Object.assign(o,r);return c[t.Symbol.Columns]=r,c[t.Symbol.ExtraConfigColumns]=r,t$1&&(c[F.Symbol.ExtraConfigBuilder]=t$1),c}var fi=(a,e,t)=>lt(a,e,t);g();g();var G=class extends N{static[a]="SQLiteViewBase"};var H=class{static[a]="SQLiteDialect";casing;constructor(e){this.casing=new b(e?.casing);}escapeName(e){return `"${e}"`}escapeParam(e){return "?"}escapeString(e){return `'${e.replace(/'/g,"''")}'`}buildWithCTE(e){if(!e?.length)return;let t=[J$1`with `];for(let[n,s]of e.entries())t.push(J$1`${J$1.identifier(s._.alias)} as (${s._.sql})`),n<e.length-1&&t.push(J$1`, `);return t.push(J$1` `),J$1.join(t)}buildDeleteQuery({table:e,where:t,returning:n,withList:s,limit:o,orderBy:u}){let r=this.buildWithCTE(s),c=n?J$1` returning ${this.buildSelection(n,{isSingleTable:true})}`:void 0,f=t?J$1` where ${t}`:void 0,p=this.buildOrderBy(u),$=this.buildLimit(o);return J$1`${r}delete from ${e}${f}${c}${p}${$}`}buildUpdateSet(e,t$1){let n=e[t.Symbol.Columns],s=Object.keys(n).filter(u=>t$1[u]!==void 0||n[u]?.onUpdateFn!==void 0),o=s.length;return J$1.join(s.flatMap((u,r)=>{let c=n[u],f=t$1[u]??J$1.param(c.onUpdateFn(),c),p=J$1`${J$1.identifier(this.casing.getColumnCasing(c))} = ${f}`;return r<o-1?[p,J$1.raw(", ")]:[p]}))}buildUpdateQuery({table:e,set:t,where:n,returning:s,withList:o,joins:u,from:r,limit:c,orderBy:f}){let p=this.buildWithCTE(o),$=this.buildUpdateSet(e,t),x=r&&J$1.join([J$1.raw(" from "),this.buildFromTable(r)]),Q=this.buildJoins(u),w=s?J$1` returning ${this.buildSelection(s,{isSingleTable:true})}`:void 0,b=n?J$1` where ${n}`:void 0,T=this.buildOrderBy(f),C=this.buildLimit(c);return J$1`${p}update ${e} set ${$}${x}${Q}${b}${w}${T}${C}`}buildSelection(e,{isSingleTable:t$1=false}={}){let n=e.length,s=e.flatMap(({field:o},u)=>{let r=[];if(c(o,A.Aliased)&&o.isSelectionField)r.push(J$1.identifier(o.fieldAlias));else if(c(o,A.Aliased)||c(o,A)){let c$1=c(o,A.Aliased)?o.sql:o;t$1?r.push(new A(c$1.queryChunks.map(f=>c(f,d)?J$1.identifier(this.casing.getColumnCasing(f)):f))):r.push(c$1),c(o,A.Aliased)&&r.push(J$1` as ${J$1.identifier(o.fieldAlias)}`);}else if(c(o,d)){let c=o.table[t.Symbol.Name];o.columnType==="SQLiteNumericBigInt"?t$1?r.push(J$1`cast(${J$1.identifier(this.casing.getColumnCasing(o))} as text)`):r.push(J$1`cast(${J$1.identifier(c)}.${J$1.identifier(this.casing.getColumnCasing(o))} as text)`):t$1?r.push(J$1.identifier(this.casing.getColumnCasing(o))):r.push(J$1`${J$1.identifier(c)}.${J$1.identifier(this.casing.getColumnCasing(o))}`);}return u<n-1&&r.push(J$1`, `),r});return J$1.join(s)}buildJoins(e){if(!e||e.length===0)return;let t=[];if(e)for(let[n,s]of e.entries()){n===0&&t.push(J$1` `);let o=s.table,u=s.on?J$1` on ${s.on}`:void 0;if(c(o,F)){let r=o[F.Symbol.Name],c=o[F.Symbol.Schema],f=o[F.Symbol.OriginalName],p=r===f?void 0:s.alias;t.push(J$1`${J$1.raw(s.joinType)} join ${c?J$1`${J$1.identifier(c)}.`:void 0}${J$1.identifier(f)}${p&&J$1` ${J$1.identifier(p)}`}${u}`);}else t.push(J$1`${J$1.raw(s.joinType)} join ${o}${u}`);n<e.length-1&&t.push(J$1` `);}return J$1.join(t)}buildLimit(e){return typeof e=="object"||typeof e=="number"&&e>=0?J$1` limit ${e}`:void 0}buildOrderBy(e){let t=[];if(e)for(let[n,s]of e.entries())t.push(s),n<e.length-1&&t.push(J$1`, `);return t.length>0?J$1` order by ${J$1.join(t)}`:void 0}buildFromTable(e){return c(e,t)&&e[t.Symbol.IsAlias]?J$1`${J$1`${J$1.identifier(e[t.Symbol.Schema]??"")}.`.if(e[t.Symbol.Schema])}${J$1.identifier(e[t.Symbol.OriginalName])} ${J$1.identifier(e[t.Symbol.Name])}`:e}buildSelectQuery({withList:e,fields:t$1,fieldsFlat:n,where:s,having:o,table:u,joins:r,orderBy:c$1,groupBy:f,limit:p,offset:$,distinct:x,setOperators:Q}){let w=n??R(t$1);for(let K of w)if(c(K.field,d)&&v(K.field.table)!==(c(u,i)?u._.alias:c(u,G)?u[l].name:c(u,A)?void 0:v(u))&&!(j=>r?.some(({alias:Y})=>Y===(j[t.Symbol.IsAlias]?v(j):j[t.Symbol.BaseName])))(K.field.table)){let j=v(K.field.table);throw new Error(`Your "${K.path.join("->")}" field references a column "${j}"."${K.field.name}", but the table "${j}" is not part of the query! Did you forget to join it?`)}let b=!r||r.length===0,T=this.buildWithCTE(e),C=x?J$1` distinct`:void 0,O=this.buildSelection(w,{isSingleTable:b}),B=this.buildFromTable(u),h=this.buildJoins(r),V=s?J$1` where ${s}`:void 0,v$1=o?J$1` having ${o}`:void 0,m=[];if(f)for(let[K,j]of f.entries())m.push(j),K<f.length-1&&m.push(J$1`, `);let g=m.length>0?J$1` group by ${J$1.join(m)}`:void 0,R$1=this.buildOrderBy(c$1),P=this.buildLimit(p),Z=$?J$1` offset ${$}`:void 0,A$1=J$1`${T}select${C} ${O} from ${B}${h}${V}${g}${v$1}${R$1}${P}${Z}`;return Q.length>0?this.buildSetOperations(A$1,Q):A$1}buildSetOperations(e,t){let[n,...s]=t;if(!n)throw new Error("Cannot pass undefined values to any set operator");return s.length===0?this.buildSetOperationQuery({leftSelect:e,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:n}),s)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:n,rightSelect:s,limit:o,orderBy:u,offset:r}}){let c$1=J$1`${e.getSQL()} `,f=J$1`${s.getSQL()}`,p;if(u&&u.length>0){let w=[];for(let b of u)if(c(b,S))w.push(J$1.identifier(b.name));else if(c(b,A)){for(let T=0;T<b.queryChunks.length;T++){let C=b.queryChunks[T];c(C,S)&&(b.queryChunks[T]=J$1.identifier(this.casing.getColumnCasing(C)));}w.push(J$1`${b}`);}else w.push(J$1`${b}`);p=J$1` order by ${J$1.join(w,J$1`, `)}`;}let $=typeof o=="object"||typeof o=="number"&&o>=0?J$1` limit ${o}`:void 0,x=J$1.raw(`${t} ${n?"all ":""}`),Q=r?J$1` offset ${r}`:void 0;return J$1`${c$1}${x}${f}${p}${$}${Q}`}buildInsertQuery({table:e,values:t$1,onConflict:n,returning:s,withList:o,select:u}){let r=[],c$1=e[t.Symbol.Columns],f=Object.entries(c$1).filter(([b,T])=>!T.shouldDisableInsert()),p=f.map(([,b])=>J$1.identifier(this.casing.getColumnCasing(b)));if(u){let b=t$1;c(b,A)?r.push(b):r.push(b.getSQL());}else {let b=t$1;r.push(J$1.raw("values "));for(let[T,C]of b.entries()){let O=[];for(let[B,h]of f){let V=C[B];if(V===void 0||c(V,H$1)&&V.value===void 0){let v;if(h.default!==null&&h.default!==void 0)v=c(h.default,A)?h.default:J$1.param(h.default,h);else if(h.defaultFn!==void 0){let m=h.defaultFn();v=c(m,A)?m:J$1.param(m,h);}else if(!h.default&&h.onUpdateFn!==void 0){let m=h.onUpdateFn();v=c(m,A)?m:J$1.param(m,h);}else v=J$1`null`;O.push(v);}else O.push(V);}r.push(O),T<b.length-1&&r.push(J$1`, `);}}let $=this.buildWithCTE(o),x=J$1.join(r),Q=s?J$1` returning ${this.buildSelection(s,{isSingleTable:true})}`:void 0,w=n?.length?J$1.join(n):void 0;return J$1`${$}insert into ${e} ${p} ${x}${w}${Q}`}sqlToQuery(e,t){return e.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,invokeSource:t})}buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:n$1,table:s,tableConfig:o,queryConfig:u,tableAlias:r,nestedQueryRelation:c$1,joinOn:f$1}){let p$1=[],$,x,Q$1=[],w$1,b=[];if(u===true)p$1=Object.entries(o.columns).map(([O,B])=>({dbKey:B.name,tsKey:O,field:f(B,r),relationTableTsKey:void 0,isJson:false,selection:[]}));else {let C=Object.fromEntries(Object.entries(o.columns).map(([m,g])=>[m,f(g,r)]));if(u.where){let m=typeof u.where=="function"?u.where(C,R$1()):u.where;w$1=m&&h(m,r);}let O=[],B=[];if(u.columns){let m=false;for(let[g,R]of Object.entries(u.columns))R!==void 0&&g in o.columns&&(!m&&R===true&&(m=true),B.push(g));B.length>0&&(B=m?B.filter(g=>u.columns?.[g]===true):Object.keys(o.columns).filter(g=>!B.includes(g)));}else B=Object.keys(o.columns);for(let m of B){let g=o.columns[m];O.push({tsKey:m,value:g});}let h$1=[];u.with&&(h$1=Object.entries(u.with).filter(m=>!!m[1]).map(([m,g])=>({tsKey:m,queryConfig:g,relation:o.relations[m]})));let V;if(u.extras){V=typeof u.extras=="function"?u.extras(C,{sql:J$1}):u.extras;for(let[m,g]of Object.entries(V))O.push({tsKey:m,value:g$1(g,r)});}for(let{tsKey:m,value:g}of O)p$1.push({dbKey:c(g,A.Aliased)?g.fieldAlias:o.columns[m].name,tsKey:m,field:c(g,d)?f(g,r):g,relationTableTsKey:void 0,isJson:false,selection:[]});let v=typeof u.orderBy=="function"?u.orderBy(C,S$1()):u.orderBy??[];Array.isArray(v)||(v=[v]),Q$1=v.map(m=>c(m,d)?f(m,r):h(m,r)),$=u.limit,x=u.offset;for(let{tsKey:m,queryConfig:g,relation:R}of h$1){let P$1=X$1(t,n$1,R),Z=w(R.referencedTable),A=n$1[Z],K=`${r}_${m}`,j=p(...P$1.fields.map((ut,at)=>n(f(P$1.references[at],K),f(ut,r)))),Y=this.buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:n$1,table:e[A],tableConfig:t[A],queryConfig:c(R,P)?g===true?{limit:1}:{...g,limit:1}:g,tableAlias:K,joinOn:j,nestedQueryRelation:R}),st=J$1`(${Y.sql})`.as(m);p$1.push({dbKey:m,tsKey:m,field:st,relationTableTsKey:A,isJson:true,selection:Y.selection});}}if(p$1.length===0)throw new j({message:`No fields selected for table "${o.tsName}" ("${r}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.`});let T;if(w$1=p(f$1,w$1),c$1){let C=J$1`json_array(${J$1.join(p$1.map(({field:h})=>c(h,S)?J$1.identifier(this.casing.getColumnCasing(h)):c(h,A.Aliased)?h.sql:h),J$1`, `)})`;c(c$1,Q)&&(C=J$1`coalesce(json_group_array(${C}), json_array())`);let O=[{dbKey:"data",tsKey:"data",field:C.as("data"),isJson:true,relationTableTsKey:o.tsName,selection:p$1}];$!==void 0||x!==void 0||Q$1.length>0?(T=this.buildSelectQuery({table:d$1(s,r),fields:{},fieldsFlat:[{path:[],field:J$1.raw("*")}],where:w$1,limit:$,offset:x,orderBy:Q$1,setOperators:[]}),w$1=void 0,$=void 0,x=void 0,Q$1=void 0):T=d$1(s,r),T=this.buildSelectQuery({table:c(T,F)?T:new i(T,{},r),fields:{},fieldsFlat:O.map(({field:h})=>({path:[],field:c(h,d)?f(h,r):h})),joins:b,where:w$1,limit:$,offset:x,orderBy:Q$1,setOperators:[]});}else T=this.buildSelectQuery({table:d$1(s,r),fields:{},fieldsFlat:p$1.map(({field:C})=>({path:[],field:c(C,d)?f(C,r):C})),joins:b,where:w$1,limit:$,offset:x,orderBy:Q$1,setOperators:[]});return {tableTsKey:o.tsName,sql:T,selection:p$1}}},rt=class extends H{static[a]="SQLiteSyncDialect";migrate(e,t,n){let s=n===void 0||typeof n=="string"?"__drizzle_migrations":n.migrationsTable??"__drizzle_migrations",o=J$1`
3
- CREATE TABLE IF NOT EXISTS ${J$1.identifier(s)} (
4
- id SERIAL PRIMARY KEY,
5
- hash text NOT NULL,
6
- created_at numeric
7
- )
8
- `;t.run(o);let r=t.values(J$1`SELECT id, hash, created_at FROM ${J$1.identifier(s)} ORDER BY created_at DESC LIMIT 1`)[0]??void 0;t.run(J$1`BEGIN`);try{for(let c of e)if(!r||Number(r[2])<c.folderMillis){for(let f of c.sql)t.run(J$1.raw(f));t.run(J$1`INSERT INTO ${J$1.identifier(s)} ("hash", "created_at") VALUES(${c.hash}, ${c.folderMillis})`);}t.run(J$1`COMMIT`);}catch(c){throw t.run(J$1`ROLLBACK`),c}}},ot=class extends H{static[a]="SQLiteAsyncDialect";async migrate(e,t,n){let s=n===void 0||typeof n=="string"?"__drizzle_migrations":n.migrationsTable??"__drizzle_migrations",o=J$1`
9
- CREATE TABLE IF NOT EXISTS ${J$1.identifier(s)} (
10
- id SERIAL PRIMARY KEY,
11
- hash text NOT NULL,
12
- created_at numeric
13
- )
14
- `;await t.run(o);let r=(await t.values(J$1`SELECT id, hash, created_at FROM ${J$1.identifier(s)} ORDER BY created_at DESC LIMIT 1`))[0]??void 0;await t.transaction(async c=>{for(let f of e)if(!r||Number(r[2])<f.folderMillis){for(let p of f.sql)await c.run(J$1.raw(p));await c.run(J$1`INSERT INTO ${J$1.identifier(s)} ("hash", "created_at") VALUES(${f.hash}, ${f.folderMillis})`);}});}};export{Ge as a,He as b,Ze as c,F as d,fi as e,G as f,H as g,rt as h,ot as i};
@@ -1,2 +0,0 @@
1
- import {b as b$1,a}from'./chunk-7MNDQU6K.js';import {g}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g();g();var d=class{channels=new Map;maxListeners;constructor(e=100){this.maxListeners=e;}subscribe(e,s){this.channels.has(e)||this.channels.set(e,new Set);let t=this.channels.get(e);if(t.size>=this.maxListeners)throw new Error(`Max listeners (${this.maxListeners}) reached for channel "${e}"`);return t.add(s),()=>{t.delete(s),t.size===0&&this.channels.delete(e);}}publish(e,s){let t=this.channels.get(e);if(t)for(let r of t)try{let n=r(s);n instanceof Promise&&n.catch(i=>{console.error(`[PubSub] Error in handler for channel "${e}":`,i);});}catch(n){console.error(`[PubSub] Error in handler for channel "${e}":`,n);}}hasSubscribers(e){return this.channels.has(e)&&this.channels.get(e).size>0}getSubscriberCount(e){return this.channels.get(e)?.size||0}getChannels(){return Array.from(this.channels.keys())}clear(){this.channels.clear();}},b=class extends d{registry;constructor(e,s=100){super(s),this.registry=e;}publishCollectionEvent(e,s){this.publish(`collection:${e}`,s),this.publish("events:collection",s),s.tenantId&&(this.publish(`tenant:${s.tenantId}:collection:${e}`,s),this.publish(`tenant:${s.tenantId}:events`,s)),this.publish(`collection:${e}:${s.type}`,s);}subscribeToCollection(e,s){return this.subscribe(`collection:${e}`,s)}subscribeToCollectionEvent(e,s,t){return this.subscribe(`collection:${e}:${s}`,t)}subscribeToTenant(e,s){return this.subscribe(`tenant:${e}:events`,s)}subscribeToTenantCollection(e,s,t){return this.subscribe(`tenant:${e}:collection:${s}`,t)}subscribeToAllCollections(e){return this.subscribe("events:collection",e)}createAfterChangeHook(e){return async s=>{this.publishCollectionEvent(e,{type:s.operation==="create"?"create":"update",collection:e,doc:s.doc,originalDoc:s.originalDoc,id:s.id||s.doc?.id,tenantId:s.tenantId,timestamp:new Date().toISOString(),user:s.user});}}createAfterDeleteHook(e){return async s=>{this.publishCollectionEvent(e,{type:"delete",collection:e,doc:s.doc,originalDoc:s.originalDoc,id:s.id||s.doc?.id,tenantId:s.tenantId,timestamp:new Date().toISOString(),user:s.user});}}autoRegisterHooks(){let e=this.registry.getCollections();for(let s of e){let t=this.registry.getCollection(s.slug);t&&(t.hooks||(t.hooks={}),t.hooks.afterChange||(t.hooks.afterChange=[]),t.hooks.afterDelete||(t.hooks.afterDelete=[]),t.hooks.afterChange.push(this.createAfterChangeHook(s.slug)),t.hooks.afterDelete.push(this.createAfterDeleteHook(s.slug)));}}};g();g();var l=class{documents=new Map;defaultLockTtlMs=3e4;getOrCreateDoc(e){let s=this.documents.get(e);return s||(s={docKey:e,users:new Map,cursors:new Map,locks:new Map,comments:[]},this.documents.set(e,s)),s}join(e,s){let t=this.getOrCreateDoc(e),r={...s,color:s.color||this.generateUserColor(s.id),lastSeen:Date.now()};return t.users.set(s.id,r),Array.from(t.users.values())}leave(e,s){let t=this.documents.get(e);if(!t)return {remainingUsers:[],releasedLocks:[]};t.users.delete(s),t.cursors.delete(s);let r=[];for(let[n,i]of t.locks.entries())i.userId===s&&(t.locks.delete(n),r.push(n));return t.users.size===0&&t.locks.size===0&&t.comments.length===0&&this.documents.delete(e),{remainingUsers:Array.from(t.users.values()),releasedLocks:r}}updateCursor(e,s,t){let r=this.getOrCreateDoc(e),n=r.users.get(s);n&&(n.lastSeen=Date.now());let i={userId:s,field:t.field,position:t.position,selection:t.selection,updatedAt:Date.now()};return r.cursors.set(s,i),i}acquireLock(e,s,t,r=this.defaultLockTtlMs){let n=this.getOrCreateDoc(e),i=Date.now(),o=n.locks.get(s);if(o&&o.expiresAt>i&&o.userId!==t.id)return {success:false,currentLock:o};let a={fieldName:s,userId:t.id,userName:t.name,lockedAt:i,expiresAt:i+r};return n.locks.set(s,a),{success:true,lock:a}}releaseLock(e,s,t){let r=this.documents.get(e);if(!r)return false;let n=r.locks.get(s);return n&&(n.userId===t||n.expiresAt<=Date.now())?(r.locks.delete(s),true):false}addComment(e,s){let t=this.getOrCreateDoc(e),r={...s,createdAt:new Date().toISOString(),resolved:false};return t.comments.push(r),r}resolveComment(e,s){let t=this.documents.get(e);if(!t)return false;let r=t.comments.find(n=>n.id===s);return r?(r.resolved=true,true):false}getSnapshot(e){let s=this.documents.get(e);if(!s)return {users:[],cursors:[],locks:[],comments:[]};let t=Date.now();for(let[r,n]of s.locks.entries())n.expiresAt<=t&&s.locks.delete(r);return {users:Array.from(s.users.values()),cursors:Array.from(s.cursors.values()),locks:Array.from(s.locks.values()),comments:s.comments}}generateUserColor(e){let s=["#ef4444","#f97316","#eab308","#10b981","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);return s[Math.abs(t)%s.length]}};var p=class{wss;clients=new Map;pubsub;options;pingTimer;presence=new l;constructor(e){this.options=e,this.pubsub=e.pubsub,this.wss=new b$1.default({port:e.port||8080}),this.setupServer(),this.startPingInterval();}setupServer(){this.wss.on("connection",(e,s)=>{let t=this.generateClientId();if(this.options.maxConnections&&this.clients.size>=this.options.maxConnections){e.close(1013,"Server at capacity");return}let r={id:t,ws:e,subscriptions:new Map,authenticated:false,connectedAt:new Date,lastActivity:new Date};this.clients.set(t,r),this.sendToClient(r,{type:"connected",clientId:t,timestamp:new Date().toISOString()}),e.on("message",n=>{this.handleMessage(r,n);}),e.on("error",n=>{console.error(`[WS] Client error ${t}:`,n);}),e.on("close",()=>{this.handleDisconnect(r);}),e.on("pong",()=>{r.lastActivity=new Date;});}),this.wss.on("error",e=>{console.error("[WS] Server error:",e);});}handleMessage(e,s){e.lastActivity=new Date;let t;try{t=JSON.parse(s.toString());}catch{this.sendToClient(e,{type:"error",error:"Invalid JSON"});return}switch(t.type){case "authenticate":this.handleAuthenticate(e,t);break;case "subscribe":this.handleSubscribe(e,t);break;case "unsubscribe":this.handleUnsubscribe(e,t);break;case "unsubscribeAll":this.handleUnsubscribeAll(e);break;case "list":this.handleList(e);break;case "ping":this.sendToClient(e,{type:"pong",timestamp:new Date().toISOString()});break;case "presence:join":this.handlePresenceJoin(e,t);break;case "presence:leave":this.handlePresenceLeave(e,t);break;case "presence:cursor":this.handlePresenceCursor(e,t);break;case "presence:lock":this.handlePresenceLock(e,t);break;case "presence:unlock":this.handlePresenceUnlock(e,t);break;case "presence:comment":this.handlePresenceComment(e,t);break;case "presence:snapshot":this.handlePresenceSnapshot(e,t);break;default:this.sendToClient(e,{type:"error",error:`Unknown message type: ${t.type}`});}}async handleAuthenticate(e,s){if(!this.options.requireAuth){e.authenticated=true,this.sendToClient(e,{type:"authenticated",success:true});return}if(!this.options.verifyToken){e.authenticated=true,this.sendToClient(e,{type:"authenticated",success:true});return}try{let t=await this.options.verifyToken(s.token);e.authenticated=!0,e.user=t,e.tenantId=t.tenantId,this.sendToClient(e,{type:"authenticated",success:!0,user:{id:t.id,email:t.email}});}catch(t){this.sendToClient(e,{type:"authenticated",success:false,error:t.message});}}handleSubscribe(e,s){if(this.options.requireAuth&&!e.authenticated){this.sendToClient(e,{type:"error",error:"Not authenticated"});return}let t=s.channel;if(!t){this.sendToClient(e,{type:"error",error:"Channel is required"});return}if(e.subscriptions.has(t)){this.sendToClient(e,{type:"subscribed",channel:t,success:true,message:"Already subscribed"});return}let r=this.pubsub.subscribe(t,n=>{this.sendToClient(e,{type:"event",channel:t,data:n,timestamp:new Date().toISOString()});});e.subscriptions.set(t,{channel:t,unsubscribe:r}),this.sendToClient(e,{type:"subscribed",channel:t,success:true});}handleUnsubscribe(e,s){let t=s.channel;if(!t){this.sendToClient(e,{type:"error",error:"Channel is required"});return}let r=e.subscriptions.get(t);r?(r.unsubscribe(),e.subscriptions.delete(t),this.sendToClient(e,{type:"unsubscribed",channel:t,success:true})):this.sendToClient(e,{type:"unsubscribed",channel:t,success:false,message:"Not subscribed"});}handleUnsubscribeAll(e){for(let[,s]of e.subscriptions)s.unsubscribe();e.subscriptions.clear(),this.sendToClient(e,{type:"unsubscribedAll",success:true});}handleList(e){let s=this.pubsub.getChannels();this.sendToClient(e,{type:"channels",channels:s,count:s.length});}handlePresenceJoin(e,s){let{docKey:t,user:r}=s;if(!t||!r||!r.id){this.sendToClient(e,{type:"error",error:"docKey and user object with id are required for presence:join"});return}e.activeDocKey=t;let n=this.presence.join(t,r),i=`presence:${t}`;if(!e.subscriptions.has(i)){let o=this.pubsub.subscribe(i,a=>{this.sendToClient(e,{type:"event",channel:i,data:a,timestamp:new Date().toISOString()});});e.subscriptions.set(i,{channel:i,unsubscribe:o});}this.sendToClient(e,{type:"presence:joined",docKey:t,users:n,snapshot:this.presence.getSnapshot(t)}),this.pubsub.publish(i,{type:"presence:users_changed",docKey:t,users:n});}handlePresenceLeave(e,s){let{docKey:t,userId:r}=s;if(!t||!r)return;let{remainingUsers:n,releasedLocks:i}=this.presence.leave(t,r);e.activeDocKey=void 0;let o=`presence:${t}`;this.pubsub.publish(o,{type:"presence:users_changed",docKey:t,users:n,releasedLocks:i}),this.sendToClient(e,{type:"presence:left",docKey:t,success:true});}handlePresenceCursor(e,s){let{docKey:t,userId:r,cursor:n}=s;if(!t||!r||!n)return;let i=this.presence.updateCursor(t,r,n),o=`presence:${t}`;this.pubsub.publish(o,{type:"presence:cursor_moved",docKey:t,cursor:i});}handlePresenceLock(e,s){let{docKey:t,fieldName:r,user:n,ttlMs:i}=s;if(!t||!r||!n||!n.id){this.sendToClient(e,{type:"error",error:"docKey, fieldName, and user are required to acquire lock"});return}let o=this.presence.acquireLock(t,r,n,i),a=`presence:${t}`;o.success?(this.pubsub.publish(a,{type:"presence:field_locked",docKey:t,lock:o.lock}),this.sendToClient(e,{type:"presence:lock_acquired",docKey:t,lock:o.lock})):this.sendToClient(e,{type:"presence:lock_rejected",docKey:t,fieldName:r,currentLock:o.currentLock});}handlePresenceUnlock(e,s){let{docKey:t,fieldName:r,userId:n}=s;if(!t||!r||!n)return;let i=this.presence.releaseLock(t,r,n);if(i){let o=`presence:${t}`;this.pubsub.publish(o,{type:"presence:field_unlocked",docKey:t,fieldName:r,userId:n});}this.sendToClient(e,{type:"presence:unlocked",docKey:t,fieldName:r,success:i});}handlePresenceComment(e,s){let{docKey:t,comment:r}=s;if(!t||!r||!r.id){this.sendToClient(e,{type:"error",error:"docKey and comment payload are required"});return}let n=this.presence.addComment(t,r),i=`presence:${t}`;this.pubsub.publish(i,{type:"presence:comment_added",docKey:t,comment:n}),this.sendToClient(e,{type:"presence:comment_created",docKey:t,comment:n});}handlePresenceSnapshot(e,s){let{docKey:t}=s;if(!t){this.sendToClient(e,{type:"error",error:"docKey is required for snapshot"});return}let r=this.presence.getSnapshot(t);this.sendToClient(e,{type:"presence:snapshot",docKey:t,snapshot:r});}handleDisconnect(e){if(e.activeDocKey&&e.user?.id){let{remainingUsers:s,releasedLocks:t}=this.presence.leave(e.activeDocKey,e.user.id);this.pubsub.publish(`presence:${e.activeDocKey}`,{type:"presence:users_changed",docKey:e.activeDocKey,users:s,releasedLocks:t});}for(let[,s]of e.subscriptions)s.unsubscribe();this.clients.delete(e.id);}sendToClient(e,s){e.ws.readyState===a.default.OPEN&&e.ws.send(JSON.stringify(s));}generateClientId(){return `ws_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}startPingInterval(){this.options.pingInterval&&(this.pingTimer=setInterval(()=>{for(let[e,s]of this.clients)if(s.ws.readyState===a.default.OPEN){if(Date.now()-s.lastActivity.getTime()>this.options.pingInterval*3){s.ws.terminate(),this.handleDisconnect(s);continue}s.ws.ping();}},this.options.pingInterval));}broadcast(e,s){this.pubsub.publish(e,s);}getConnectedClients(){return Array.from(this.clients.values())}getClientCount(){return this.clients.size}getSubscriptionCount(){let e=0;for(let s of this.clients.values())e+=s.subscriptions.size;return e}async close(){this.pingTimer&&clearInterval(this.pingTimer);for(let e of this.clients.values())e.ws.close(1001,"Server shutting down");return new Promise(e=>{this.wss.close(()=>{e();});})}getServer(){return this.wss}};function f(u){return new p(u)}export{d as a,b,l as c,p as d,f as e};
@@ -1 +0,0 @@
1
- 'use strict';var chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();function t(){return {name:"seo",type:"group",label:"SEO Settings",fields:[{name:"metaTitle",type:"text",label:"Meta Title",admin:{description:"The title used for search engines (recommended < 60 chars). Leave empty for AI auto-generation."}},{name:"metaDescription",type:"textarea",label:"Meta Description",admin:{description:"A brief summary for search engines (recommended < 160 chars). Leave empty for AI auto-generation."}},{name:"keywords",type:"text",label:"Keywords",admin:{description:"Comma-separated list of keywords for this page."}},{name:"ogImage",type:"upload",label:"OpenGraph Image",relationTo:"media",admin:{description:"The image shown when the post is shared on social media (Facebook, LinkedIn)."}},{name:"twitter",type:"group",label:"Twitter Card",fields:[{name:"title",type:"text",label:"Twitter Title"},{name:"description",type:"textarea",label:"Twitter Description"},{name:"image",type:"upload",label:"Twitter Image",relationTo:"media"}]},{name:"advanced",type:"group",label:"Advanced Search Settings",fields:[{name:"noindex",type:"checkbox",label:"Hide from search engines (noindex)",defaultValue:false},{name:"nofollow",type:"checkbox",label:"Do not follow links (nofollow)",defaultValue:false},{name:"canonicalUrl",type:"text",label:"Canonical URL Override",admin:{description:"Leave empty to use the default canonical URL."}},{name:"structuredData",type:"code",label:"JSON-LD Structured Data",admin:{description:"Custom JSON-LD schema for this specific page."}}]}]}}exports.a=t;
@@ -1,10 +0,0 @@
1
- 'use strict';var chunkMCIZG4A3_cjs=require('./chunk-MCIZG4A3.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs'),fs=require('fs'),path=require('path');var oe=chunkBUNLC3II_cjs.c((gr,Ge)=>{chunkBUNLC3II_cjs.h();var yt=chunkBUNLC3II_cjs.a("path"),z="\\\\/",Ne=`[^${z}]`,bt=0,V="\\.",St="\\+",Ct="\\?",pe="\\/",$t="(?=.)",Be="[^/]",Re=`(?:${pe}|$)`,Pe=`(?:^|${pe})`,_e=`${V}{1,2}${Re}`,mt=`(?!${V})`,Ht=`(?!${Pe}${_e})`,Tt=`(?!${V}{0,1}${Re})`,Lt=`(?!${_e})`,Ot=`[^.${pe}]`,vt=`${Be}*?`,De={DOT_LITERAL:V,PLUS_LITERAL:St,QMARK_LITERAL:Ct,SLASH_LITERAL:pe,ONE_CHAR:$t,QMARK:Be,END_ANCHOR:Re,DOTS_SLASH:_e,NO_DOT:mt,NO_DOTS:Ht,NO_DOT_SLASH:Tt,NO_DOTS_SLASH:Lt,QMARK_NO_DOT:Ot,STAR:vt,START_ANCHOR:Pe},wt={...De,SLASH_LITERAL:`[${z}]`,QMARK:Ne,STAR:`${Ne}*?`,DOTS_SLASH:`${V}{1,2}(?:[${z}]|$)`,NO_DOT:`(?!${V})`,NO_DOTS:`(?!(?:^|[${z}])${V}{1,2}(?:[${z}]|$))`,NO_DOT_SLASH:`(?!${V}{0,1}(?:[${z}]|$))`,NO_DOTS_SLASH:`(?!${V}{1,2}(?:[${z}]|$))`,QMARK_NO_DOT:`[^.${z}]`,START_ANCHOR:`(?:^|[${z}])`,END_ANCHOR:`(?:[${z}]|$)`},It={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Ge.exports={DEFAULT_MAX_EXTGLOB_RECURSION:bt,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:It,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:yt.sep,extglobChars(e){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===true?wt:De}};});var fe=chunkBUNLC3II_cjs.c(M=>{chunkBUNLC3II_cjs.h();var kt=chunkBUNLC3II_cjs.a("path"),Nt=process.platform==="win32",{REGEX_BACKSLASH:Bt,REGEX_REMOVE_BACKSLASH:Pt,REGEX_SPECIAL_CHARS:Dt,REGEX_SPECIAL_CHARS_GLOBAL:Gt}=oe();M.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);M.hasRegexChars=e=>Dt.test(e);M.isRegexChar=e=>e.length===1&&M.hasRegexChars(e);M.escapeRegex=e=>e.replace(Gt,"\\$1");M.toPosixSlashes=e=>e.replace(Bt,"/");M.removeBackslashes=e=>e.replace(Pt,r=>r==="\\"?"":r);M.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};M.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Nt===true||kt.sep==="\\";M.escapeLast=(e,r,t)=>{let i=e.lastIndexOf(r,t);return i===-1?e:e[i-1]==="\\"?M.escapeLast(e,r,i-1):`${e.slice(0,i)}\\${e.slice(i)}`};M.removePrefix=(e,r={})=>{let t=e;return t.startsWith("./")&&(t=t.slice(2),r.prefix="./"),t};M.wrapOutput=(e,r={},t={})=>{let i=t.contains?"":"^",a=t.contains?"":"$",p=`${i}(?:${e})${a}`;return r.negated===true&&(p=`(?:^(?!${p}).*$)`),p};});var Qe=chunkBUNLC3II_cjs.c((yr,We)=>{chunkBUNLC3II_cjs.h();var Me=fe(),{CHAR_ASTERISK:ge,CHAR_AT:Mt,CHAR_BACKWARD_SLASH:ue,CHAR_COMMA:Ft,CHAR_DOT:Ee,CHAR_EXCLAMATION_MARK:de,CHAR_FORWARD_SLASH:Xe,CHAR_LEFT_CURLY_BRACE:xe,CHAR_LEFT_PARENTHESES:ye,CHAR_LEFT_SQUARE_BRACKET:Ut,CHAR_PLUS:Kt,CHAR_QUESTION_MARK:Fe,CHAR_RIGHT_CURLY_BRACE:qt,CHAR_RIGHT_PARENTHESES:Ue,CHAR_RIGHT_SQUARE_BRACKET:Xt}=oe(),Ke=e=>e===Xe||e===ue,qe=e=>{e.isPrefix!==true&&(e.depth=e.isGlobstar?1/0:1);},Wt=(e,r)=>{let t=r||{},i=e.length-1,a=t.parts===true||t.scanToEnd===true,p=[],u=[],f=[],h=e,d=-1,R=0,$=0,O=false,P=false,y=false,T=false,Y=false,K=false,U=false,L=false,q=false,N=false,J=0,D,A,x={value:"",depth:0,isGlob:false},k=()=>d>=i,o=()=>h.charCodeAt(d+1),m=()=>(D=A,h.charCodeAt(++d));for(;d<i;){A=m();let G;if(A===ue){U=x.backslashes=true,A=m(),A===xe&&(K=true);continue}if(K===true||A===xe){for(J++;k()!==true&&(A=m());){if(A===ue){U=x.backslashes=true,m();continue}if(A===xe){J++;continue}if(K!==true&&A===Ee&&(A=m())===Ee){if(O=x.isBrace=true,y=x.isGlob=true,N=true,a===true)continue;break}if(K!==true&&A===Ft){if(O=x.isBrace=true,y=x.isGlob=true,N=true,a===true)continue;break}if(A===qt&&(J--,J===0)){K=false,O=x.isBrace=true,N=true;break}}if(a===true)continue;break}if(A===Xe){if(p.push(d),u.push(x),x={value:"",depth:0,isGlob:false},N===true)continue;if(D===Ee&&d===R+1){R+=2;continue}$=d+1;continue}if(t.noext!==true&&(A===Kt||A===Mt||A===ge||A===Fe||A===de)===true&&o()===ye){if(y=x.isGlob=true,T=x.isExtglob=true,N=true,A===de&&d===R&&(q=true),a===true){for(;k()!==true&&(A=m());){if(A===ue){U=x.backslashes=true,A=m();continue}if(A===Ue){y=x.isGlob=true,N=true;break}}continue}break}if(A===ge){if(D===ge&&(Y=x.isGlobstar=true),y=x.isGlob=true,N=true,a===true)continue;break}if(A===Fe){if(y=x.isGlob=true,N=true,a===true)continue;break}if(A===Ut){for(;k()!==true&&(G=m());){if(G===ue){U=x.backslashes=true,m();continue}if(G===Xt){P=x.isBracket=true,y=x.isGlob=true,N=true;break}}if(a===true)continue;break}if(t.nonegate!==true&&A===de&&d===R){L=x.negated=true,R++;continue}if(t.noparen!==true&&A===ye){if(y=x.isGlob=true,a===true){for(;k()!==true&&(A=m());){if(A===ye){U=x.backslashes=true,A=m();continue}if(A===Ue){N=true;break}}continue}break}if(y===true){if(N=true,a===true)continue;break}}t.noext===true&&(T=false,y=false);let S=h,ee="",n="";R>0&&(ee=h.slice(0,R),h=h.slice(R),$-=R),S&&y===true&&$>0?(S=h.slice(0,$),n=h.slice($)):y===true?(S="",n=h):S=h,S&&S!==""&&S!=="/"&&S!==h&&Ke(S.charCodeAt(S.length-1))&&(S=S.slice(0,-1)),t.unescape===true&&(n&&(n=Me.removeBackslashes(n)),S&&U===true&&(S=Me.removeBackslashes(S)));let s={prefix:ee,input:e,start:R,base:S,glob:n,isBrace:O,isBracket:P,isGlob:y,isExtglob:T,isGlobstar:Y,negated:L,negatedExtglob:q};if(t.tokens===true&&(s.maxDepth=0,Ke(A)||u.push(x),s.tokens=u),t.parts===true||t.tokens===true){let G;for(let E=0;E<p.length;E++){let X=G?G+1:R,W=p[E],F=e.slice(X,W);t.tokens&&(E===0&&R!==0?(u[E].isPrefix=true,u[E].value=ee):u[E].value=F,qe(u[E]),s.maxDepth+=u[E].depth),(E!==0||F!=="")&&f.push(F),G=W;}if(G&&G+1<e.length){let E=e.slice(G+1);f.push(E),t.tokens&&(u[u.length-1].value=E,qe(u[u.length-1]),s.maxDepth+=u[u.length-1].depth);}s.slashes=p,s.parts=f;}return s};We.exports=Wt;});var Ye=chunkBUNLC3II_cjs.c((Sr,Ze)=>{chunkBUNLC3II_cjs.h();var ae=oe(),B=fe(),{MAX_LENGTH:he,POSIX_REGEX_SOURCE:Qt,REGEX_NON_SPECIAL_CHARS:jt,REGEX_SPECIAL_CHARS_BACKREF:zt,REPLACEMENTS:je}=ae,Vt=(e,r)=>{if(typeof r.expandRange=="function")return r.expandRange(...e,r);e.sort();let t=`[${e.join("-")}]`;try{new RegExp(t);}catch{return e.map(a=>B.escapeRegex(a)).join("..")}return t},se=(e,r)=>`Missing ${e}: "${r}" - use "\\\\${r}" to match literal characters`,ze=e=>{let r=[],t=0,i=0,a=0,p="",u=false;for(let f of e){if(u===true){p+=f,u=false;continue}if(f==="\\"){p+=f,u=true;continue}if(f==='"'){a=a===1?0:1,p+=f;continue}if(a===0){if(f==="[")t++;else if(f==="]"&&t>0)t--;else if(t===0){if(f==="(")i++;else if(f===")"&&i>0)i--;else if(f==="|"&&i===0){r.push(p),p="";continue}}}p+=f;}return r.push(p),r},Zt=e=>{let r=false;for(let t of e){if(r===true){r=false;continue}if(t==="\\"){r=true;continue}if(/[?*+@!()[\]{}]/.test(t))return false}return true},Ve=e=>{let r=e.trim(),t=true;for(;t===true;)t=false,/^@\([^\\()[\]{}|]+\)$/.test(r)&&(r=r.slice(2,-1),t=true);if(Zt(r))return r.replace(/\\(.)/g,"$1")},Yt=e=>{let r=e.map(Ve).filter(Boolean);for(let t=0;t<r.length;t++)for(let i=t+1;i<r.length;i++){let a=r[t],p=r[i],u=a[0];if(!(!u||a!==u.repeat(a.length)||p!==u.repeat(p.length))&&(a===p||a.startsWith(p)||p.startsWith(a)))return true}return false},be=(e,r=true)=>{if(e[0]!=="+"&&e[0]!=="*"||e[1]!=="(")return;let t=0,i=0,a=0,p=false;for(let u=1;u<e.length;u++){let f=e[u];if(p===true){p=false;continue}if(f==="\\"){p=true;continue}if(f==='"'){a=a===1?0:1;continue}if(a!==1){if(f==="["){t++;continue}if(f==="]"&&t>0){t--;continue}if(!(t>0)){if(f==="("){i++;continue}if(f===")"&&(i--,i===0))return r===true&&u!==e.length-1?void 0:{type:e[0],body:e.slice(2,u),end:u}}}}},Jt=e=>{let r=0,t=[];for(;r<e.length;){let a=be(e.slice(r),false);if(!a||a.type!=="*")return;let p=ze(a.body).map(f=>f.trim());if(p.length!==1)return;let u=Ve(p[0]);if(!u||u.length!==1)return;t.push(u),r+=a.end+1;}return t.length<1?void 0:`${t.length===1?B.escapeRegex(t[0]):`[${t.map(a=>B.escapeRegex(a)).join("")}]`}*`},er=e=>{let r=0,t=e.trim(),i=be(t);for(;i;)r++,t=i.body.trim(),i=be(t);return r},tr=(e,r)=>{if(r.maxExtglobRecursion===false)return {risky:false};let t=typeof r.maxExtglobRecursion=="number"?r.maxExtglobRecursion:ae.DEFAULT_MAX_EXTGLOB_RECURSION,i=ze(e).map(a=>a.trim());if(i.length>1&&(i.some(a=>a==="")||i.some(a=>/^[*?]+$/.test(a))||Yt(i)))return {risky:true};for(let a of i){let p=Jt(a);if(p)return {risky:true,safeOutput:p};if(er(a)>t)return {risky:true}}return {risky:false}},Se=(e,r)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=je[e]||e;let t={...r},i=typeof t.maxLength=="number"?Math.min(he,t.maxLength):he,a=e.length;if(a>i)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${i}`);let p={type:"bos",value:"",output:t.prepend||""},u=[p],f=t.capture?"":"?:",h=B.isWindows(r),d=ae.globChars(h),R=ae.extglobChars(d),{DOT_LITERAL:$,PLUS_LITERAL:O,SLASH_LITERAL:P,ONE_CHAR:y,DOTS_SLASH:T,NO_DOT:Y,NO_DOT_SLASH:K,NO_DOTS_SLASH:U,QMARK:L,QMARK_NO_DOT:q,STAR:N,START_ANCHOR:J}=d,D=l=>`(${f}(?:(?!${J}${l.dot?T:$}).)*?)`,A=t.dot?"":Y,x=t.dot?L:q,k=t.bash===true?D(t):N;t.capture&&(k=`(${k})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let o={input:e,index:-1,start:0,dot:t.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:u};e=B.removePrefix(e,o),a=e.length;let m=[],S=[],ee=[],n=p,s,G=()=>o.index===a-1,E=o.peek=(l=1)=>e[o.index+l],X=o.advance=()=>e[++o.index]||"",W=()=>e.slice(o.index+1),F=(l="",H=0)=>{o.consumed+=l,o.index+=H;},ie=l=>{o.output+=l.output!=null?l.output:l.value,F(l.value);},Et=()=>{let l=1;for(;E()==="!"&&(E(2)!=="("||E(3)==="?");)X(),o.start++,l++;return l%2===0?false:(o.negated=true,o.start++,true)},ce=l=>{o[l]++,ee.push(l);},te=l=>{o[l]--,ee.pop();},g=l=>{if(n.type==="globstar"){let H=o.braces>0&&(l.type==="comma"||l.type==="brace"),c=l.extglob===true||m.length&&(l.type==="pipe"||l.type==="paren");l.type!=="slash"&&l.type!=="paren"&&!H&&!c&&(o.output=o.output.slice(0,-n.output.length),n.type="star",n.value="*",n.output=k,o.output+=n.output);}if(m.length&&l.type!=="paren"&&(m[m.length-1].inner+=l.value),(l.value||l.output)&&ie(l),n&&n.type==="text"&&l.type==="text"){n.value+=l.value,n.output=(n.output||"")+l.value;return}l.prev=n,u.push(l),n=l;},le=(l,H)=>{let c={...R[H],conditions:1,inner:""};c.prev=n,c.parens=o.parens,c.output=o.output,c.startIndex=o.index,c.tokensIndex=u.length;let _=(t.capture?"(":"")+c.open;ce("parens"),g({type:l,value:H,output:o.output?"":y}),g({type:"paren",extglob:true,value:X(),output:_}),m.push(c);},dt=l=>{let H=e.slice(l.startIndex,o.index+1),c=e.slice(l.startIndex+2,o.index),_=tr(c,t);if((l.type==="plus"||l.type==="star")&&_.risky){let b=_.safeOutput?(l.output?"":y)+(t.capture?`(${_.safeOutput})`:_.safeOutput):void 0,Q=u[l.tokensIndex];Q.type="text",Q.value=H,Q.output=b||B.escapeRegex(H);for(let j=l.tokensIndex+1;j<u.length;j++)u[j].value="",u[j].output="",delete u[j].suffix;o.output=l.output+Q.output,o.backtrack=true,g({type:"paren",extglob:true,value:s,output:""}),te("parens");return}let C=l.close+(t.capture?")":""),I;if(l.type==="negate"){let b=k;if(l.inner&&l.inner.length>1&&l.inner.includes("/")&&(b=D(t)),(b!==k||G()||/^\)+$/.test(W()))&&(C=l.close=`)$))${b}`),l.inner.includes("*")&&(I=W())&&/^\.[^\\/.]+$/.test(I)){let Q=Se(I,{...r,fastpaths:false}).output;C=l.close=`)${Q})${b})`;}l.prev.type==="bos"&&(o.negatedExtglob=true);}g({type:"paren",extglob:true,value:s,output:C}),te("parens");};if(t.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(e)){let l=false,H=e.replace(zt,(c,_,C,I,b,Q)=>I==="\\"?(l=true,c):I==="?"?_?_+I+(b?L.repeat(b.length):""):Q===0?x+(b?L.repeat(b.length):""):L.repeat(C.length):I==="."?$.repeat(C.length):I==="*"?_?_+I+(b?k:""):k:_?c:`\\${c}`);return l===true&&(t.unescape===true?H=H.replace(/\\/g,""):H=H.replace(/\\+/g,c=>c.length%2===0?"\\\\":c?"\\":"")),H===e&&t.contains===true?(o.output=e,o):(o.output=B.wrapOutput(H,o,r),o)}for(;!G();){if(s=X(),s==="\0")continue;if(s==="\\"){let c=E();if(c==="/"&&t.bash!==true||c==="."||c===";")continue;if(!c){s+="\\",g({type:"text",value:s});continue}let _=/^\\+/.exec(W()),C=0;if(_&&_[0].length>2&&(C=_[0].length,o.index+=C,C%2!==0&&(s+="\\")),t.unescape===true?s=X():s+=X(),o.brackets===0){g({type:"text",value:s});continue}}if(o.brackets>0&&(s!=="]"||n.value==="["||n.value==="[^")){if(t.posix!==false&&s===":"){let c=n.value.slice(1);if(c.includes("[")&&(n.posix=true,c.includes(":"))){let _=n.value.lastIndexOf("["),C=n.value.slice(0,_),I=n.value.slice(_+2),b=Qt[I];if(b){n.value=C+b,o.backtrack=true,X(),!p.output&&u.indexOf(n)===1&&(p.output=y);continue}}}(s==="["&&E()!==":"||s==="-"&&E()==="]")&&(s=`\\${s}`),s==="]"&&(n.value==="["||n.value==="[^")&&(s=`\\${s}`),t.posix===true&&s==="!"&&n.value==="["&&(s="^"),n.value+=s,ie({value:s});continue}if(o.quotes===1&&s!=='"'){s=B.escapeRegex(s),n.value+=s,ie({value:s});continue}if(s==='"'){o.quotes=o.quotes===1?0:1,t.keepQuotes===true&&g({type:"text",value:s});continue}if(s==="("){ce("parens"),g({type:"paren",value:s});continue}if(s===")"){if(o.parens===0&&t.strictBrackets===true)throw new SyntaxError(se("opening","("));let c=m[m.length-1];if(c&&o.parens===c.parens+1){dt(m.pop());continue}g({type:"paren",value:s,output:o.parens?")":"\\)"}),te("parens");continue}if(s==="["){if(t.nobracket===true||!W().includes("]")){if(t.nobracket!==true&&t.strictBrackets===true)throw new SyntaxError(se("closing","]"));s=`\\${s}`;}else ce("brackets");g({type:"bracket",value:s});continue}if(s==="]"){if(t.nobracket===true||n&&n.type==="bracket"&&n.value.length===1){g({type:"text",value:s,output:`\\${s}`});continue}if(o.brackets===0){if(t.strictBrackets===true)throw new SyntaxError(se("opening","["));g({type:"text",value:s,output:`\\${s}`});continue}te("brackets");let c=n.value.slice(1);if(n.posix!==true&&c[0]==="^"&&!c.includes("/")&&(s=`/${s}`),n.value+=s,ie({value:s}),t.literalBrackets===false||B.hasRegexChars(c))continue;let _=B.escapeRegex(n.value);if(o.output=o.output.slice(0,-n.value.length),t.literalBrackets===true){o.output+=_,n.value=_;continue}n.value=`(${f}${_}|${n.value})`,o.output+=n.value;continue}if(s==="{"&&t.nobrace!==true){ce("braces");let c={type:"brace",value:s,output:"(",outputIndex:o.output.length,tokensIndex:o.tokens.length};S.push(c),g(c);continue}if(s==="}"){let c=S[S.length-1];if(t.nobrace===true||!c){g({type:"text",value:s,output:s});continue}let _=")";if(c.dots===true){let C=u.slice(),I=[];for(let b=C.length-1;b>=0&&(u.pop(),C[b].type!=="brace");b--)C[b].type!=="dots"&&I.unshift(C[b].value);_=Vt(I,t),o.backtrack=true;}if(c.comma!==true&&c.dots!==true){let C=o.output.slice(0,c.outputIndex),I=o.tokens.slice(c.tokensIndex);c.value=c.output="\\{",s=_="\\}",o.output=C;for(let b of I)o.output+=b.output||b.value;}g({type:"brace",value:s,output:_}),te("braces"),S.pop();continue}if(s==="|"){m.length>0&&m[m.length-1].conditions++,g({type:"text",value:s});continue}if(s===","){let c=s,_=S[S.length-1];_&&ee[ee.length-1]==="braces"&&(_.comma=true,c="|"),g({type:"comma",value:s,output:c});continue}if(s==="/"){if(n.type==="dot"&&o.index===o.start+1){o.start=o.index+1,o.consumed="",o.output="",u.pop(),n=p;continue}g({type:"slash",value:s,output:P});continue}if(s==="."){if(o.braces>0&&n.type==="dot"){n.value==="."&&(n.output=$);let c=S[S.length-1];n.type="dots",n.output+=s,n.value+=s,c.dots=true;continue}if(o.braces+o.parens===0&&n.type!=="bos"&&n.type!=="slash"){g({type:"text",value:s,output:$});continue}g({type:"dot",value:s,output:$});continue}if(s==="?"){if(!(n&&n.value==="(")&&t.noextglob!==true&&E()==="("&&E(2)!=="?"){le("qmark",s);continue}if(n&&n.type==="paren"){let _=E(),C=s;if(_==="<"&&!B.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(n.value==="("&&!/[!=<:]/.test(_)||_==="<"&&!/<([!=]|\w+>)/.test(W()))&&(C=`\\${s}`),g({type:"text",value:s,output:C});continue}if(t.dot!==true&&(n.type==="slash"||n.type==="bos")){g({type:"qmark",value:s,output:q});continue}g({type:"qmark",value:s,output:L});continue}if(s==="!"){if(t.noextglob!==true&&E()==="("&&(E(2)!=="?"||!/[!=<:]/.test(E(3)))){le("negate",s);continue}if(t.nonegate!==true&&o.index===0){Et();continue}}if(s==="+"){if(t.noextglob!==true&&E()==="("&&E(2)!=="?"){le("plus",s);continue}if(n&&n.value==="("||t.regex===false){g({type:"plus",value:s,output:O});continue}if(n&&(n.type==="bracket"||n.type==="paren"||n.type==="brace")||o.parens>0){g({type:"plus",value:s});continue}g({type:"plus",value:O});continue}if(s==="@"){if(t.noextglob!==true&&E()==="("&&E(2)!=="?"){g({type:"at",extglob:true,value:s,output:""});continue}g({type:"text",value:s});continue}if(s!=="*"){(s==="$"||s==="^")&&(s=`\\${s}`);let c=jt.exec(W());c&&(s+=c[0],o.index+=c[0].length),g({type:"text",value:s});continue}if(n&&(n.type==="globstar"||n.star===true)){n.type="star",n.star=true,n.value+=s,n.output=k,o.backtrack=true,o.globstar=true,F(s);continue}let l=W();if(t.noextglob!==true&&/^\([^?]/.test(l)){le("star",s);continue}if(n.type==="star"){if(t.noglobstar===true){F(s);continue}let c=n.prev,_=c.prev,C=c.type==="slash"||c.type==="bos",I=_&&(_.type==="star"||_.type==="globstar");if(t.bash===true&&(!C||l[0]&&l[0]!=="/")){g({type:"star",value:s,output:""});continue}let b=o.braces>0&&(c.type==="comma"||c.type==="brace"),Q=m.length&&(c.type==="pipe"||c.type==="paren");if(!C&&c.type!=="paren"&&!b&&!Q){g({type:"star",value:s,output:""});continue}for(;l.slice(0,3)==="/**";){let j=e[o.index+4];if(j&&j!=="/")break;l=l.slice(3),F("/**",3);}if(c.type==="bos"&&G()){n.type="globstar",n.value+=s,n.output=D(t),o.output=n.output,o.globstar=true,F(s);continue}if(c.type==="slash"&&c.prev.type!=="bos"&&!I&&G()){o.output=o.output.slice(0,-(c.output+n.output).length),c.output=`(?:${c.output}`,n.type="globstar",n.output=D(t)+(t.strictSlashes?")":"|$)"),n.value+=s,o.globstar=true,o.output+=c.output+n.output,F(s);continue}if(c.type==="slash"&&c.prev.type!=="bos"&&l[0]==="/"){let j=l[1]!==void 0?"|$":"";o.output=o.output.slice(0,-(c.output+n.output).length),c.output=`(?:${c.output}`,n.type="globstar",n.output=`${D(t)}${P}|${P}${j})`,n.value+=s,o.output+=c.output+n.output,o.globstar=true,F(s+X()),g({type:"slash",value:"/",output:""});continue}if(c.type==="bos"&&l[0]==="/"){n.type="globstar",n.value+=s,n.output=`(?:^|${P}|${D(t)}${P})`,o.output=n.output,o.globstar=true,F(s+X()),g({type:"slash",value:"/",output:""});continue}o.output=o.output.slice(0,-n.output.length),n.type="globstar",n.output=D(t),n.value+=s,o.output+=n.output,o.globstar=true,F(s);continue}let H={type:"star",value:s,output:k};if(t.bash===true){H.output=".*?",(n.type==="bos"||n.type==="slash")&&(H.output=A+H.output),g(H);continue}if(n&&(n.type==="bracket"||n.type==="paren")&&t.regex===true){H.output=s,g(H);continue}(o.index===o.start||n.type==="slash"||n.type==="dot")&&(n.type==="dot"?(o.output+=K,n.output+=K):t.dot===true?(o.output+=U,n.output+=U):(o.output+=A,n.output+=A),E()!=="*"&&(o.output+=y,n.output+=y)),g(H);}for(;o.brackets>0;){if(t.strictBrackets===true)throw new SyntaxError(se("closing","]"));o.output=B.escapeLast(o.output,"["),te("brackets");}for(;o.parens>0;){if(t.strictBrackets===true)throw new SyntaxError(se("closing",")"));o.output=B.escapeLast(o.output,"("),te("parens");}for(;o.braces>0;){if(t.strictBrackets===true)throw new SyntaxError(se("closing","}"));o.output=B.escapeLast(o.output,"{"),te("braces");}if(t.strictSlashes!==true&&(n.type==="star"||n.type==="bracket")&&g({type:"maybe_slash",value:"",output:`${P}?`}),o.backtrack===true){o.output="";for(let l of o.tokens)o.output+=l.output!=null?l.output:l.value,l.suffix&&(o.output+=l.suffix);}return o};Se.fastpaths=(e,r)=>{let t={...r},i=typeof t.maxLength=="number"?Math.min(he,t.maxLength):he,a=e.length;if(a>i)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${i}`);e=je[e]||e;let p=B.isWindows(r),{DOT_LITERAL:u,SLASH_LITERAL:f,ONE_CHAR:h,DOTS_SLASH:d,NO_DOT:R,NO_DOTS:$,NO_DOTS_SLASH:O,STAR:P,START_ANCHOR:y}=ae.globChars(p),T=t.dot?$:R,Y=t.dot?O:R,K=t.capture?"":"?:",U={negated:false,prefix:""},L=t.bash===true?".*?":P;t.capture&&(L=`(${L})`);let q=A=>A.noglobstar===true?L:`(${K}(?:(?!${y}${A.dot?d:u}).)*?)`,N=A=>{switch(A){case "*":return `${T}${h}${L}`;case ".*":return `${u}${h}${L}`;case "*.*":return `${T}${L}${u}${h}${L}`;case "*/*":return `${T}${L}${f}${h}${Y}${L}`;case "**":return T+q(t);case "**/*":return `(?:${T}${q(t)}${f})?${Y}${h}${L}`;case "**/*.*":return `(?:${T}${q(t)}${f})?${Y}${L}${u}${h}${L}`;case "**/.*":return `(?:${T}${q(t)}${f})?${u}${h}${L}`;default:{let x=/^(.*?)\.(\w+)$/.exec(A);if(!x)return;let k=N(x[1]);return k?k+u+x[2]:void 0}}},J=B.removePrefix(e,U),D=N(J);return D&&t.strictSlashes!==true&&(D+=`${f}?`),D};Ze.exports=Se;});var et=chunkBUNLC3II_cjs.c(($r,Je)=>{chunkBUNLC3II_cjs.h();var rr=chunkBUNLC3II_cjs.a("path"),nr=Qe(),Ce=Ye(),$e=fe(),sr=oe(),or=e=>e&&typeof e=="object"&&!Array.isArray(e),v=(e,r,t=false)=>{if(Array.isArray(e)){let R=e.map(O=>v(O,r,t));return O=>{for(let P of R){let y=P(O);if(y)return y}return false}}let i=or(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!i)throw new TypeError("Expected pattern to be a non-empty string");let a=r||{},p=$e.isWindows(r),u=i?v.compileRe(e,r):v.makeRe(e,r,false,true),f=u.state;delete u.state;let h=()=>false;if(a.ignore){let R={...r,ignore:null,onMatch:null,onResult:null};h=v(a.ignore,R,t);}let d=(R,$=false)=>{let{isMatch:O,match:P,output:y}=v.test(R,u,r,{glob:e,posix:p}),T={glob:e,state:f,regex:u,posix:p,input:R,output:y,match:P,isMatch:O};return typeof a.onResult=="function"&&a.onResult(T),O===false?(T.isMatch=false,$?T:false):h(R)?(typeof a.onIgnore=="function"&&a.onIgnore(T),T.isMatch=false,$?T:false):(typeof a.onMatch=="function"&&a.onMatch(T),$?T:true)};return t&&(d.state=f),d};v.test=(e,r,t,{glob:i,posix:a}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return {isMatch:false,output:""};let p=t||{},u=p.format||(a?$e.toPosixSlashes:null),f=e===i,h=f&&u?u(e):e;return f===false&&(h=u?u(e):e,f=h===i),(f===false||p.capture===true)&&(p.matchBase===true||p.basename===true?f=v.matchBase(e,r,t,a):f=r.exec(h)),{isMatch:!!f,match:f,output:h}};v.matchBase=(e,r,t,i=$e.isWindows(t))=>(r instanceof RegExp?r:v.makeRe(r,t)).test(rr.basename(e));v.isMatch=(e,r,t)=>v(r,t)(e);v.parse=(e,r)=>Array.isArray(e)?e.map(t=>v.parse(t,r)):Ce(e,{...r,fastpaths:false});v.scan=(e,r)=>nr(e,r);v.compileRe=(e,r,t=false,i=false)=>{if(t===true)return e.output;let a=r||{},p=a.contains?"":"^",u=a.contains?"":"$",f=`${p}(?:${e.output})${u}`;e&&e.negated===true&&(f=`^(?!${f}).*$`);let h=v.toRegex(f,r);return i===true&&(h.state=e),h};v.makeRe=(e,r={},t=false,i=false)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let a={negated:false,fastpaths:true};return r.fastpaths!==false&&(e[0]==="."||e[0]==="*")&&(a.output=Ce.fastpaths(e,r)),a.output||(a=Ce(e,r)),v.compileRe(a,r,t,i)};v.toRegex=(e,r)=>{try{let t=r||{};return new RegExp(e,t.flags||(t.nocase?"i":""))}catch(t){if(r&&r.debug===true)throw t;return /$^/}};v.constants=sr;Je.exports=v;});var rt=chunkBUNLC3II_cjs.c((Hr,tt)=>{chunkBUNLC3II_cjs.h();tt.exports=et();});var st=chunkBUNLC3II_cjs.c((Lr,nt)=>{chunkBUNLC3II_cjs.h();nt.exports=function(e,r){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return "/";var t=e.length;if(t<=1)return e;var i="";if(t>4&&e[3]==="\\"){var a=e[2];(a==="?"||a===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),i="//");}var p=e.split(/[/\\]+/);return r!==false&&p[p.length-1]===""&&p.pop(),i+p.join("/")};});var lt=chunkBUNLC3II_cjs.c((it,ct)=>{chunkBUNLC3II_cjs.h();Object.defineProperty(it,"__esModule",{value:true});var at=rt(),ur=st(),ot="!",ar={returnIndex:false},ir=e=>Array.isArray(e)?e:[e],cr=(e,r)=>{if(typeof e=="function")return e;if(typeof e=="string"){let t=at(e,r);return i=>e===i||t(i)}return e instanceof RegExp?t=>e.test(t):t=>false},ut=(e,r,t,i)=>{let a=Array.isArray(t),p=a?t[0]:t;if(!a&&typeof p!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(p));let u=ur(p,false);for(let h=0;h<r.length;h++){let d=r[h];if(d(u))return i?-1:false}let f=a&&[u].concat(t.slice(1));for(let h=0;h<e.length;h++){let d=e[h];if(a?d(...f):d(u))return i?h:true}return i?-1:false},me=(e,r,t=ar)=>{if(e==null)throw new TypeError("anymatch: specify first argument");let i=typeof t=="boolean"?{returnIndex:t}:t,a=i.returnIndex||false,p=ir(e),u=p.filter(h=>typeof h=="string"&&h.charAt(0)===ot).map(h=>h.slice(1)).map(h=>at(h,i)),f=p.filter(h=>typeof h!="string"||typeof h=="string"&&h.charAt(0)!==ot).map(h=>cr(h,i));return r==null?(h,d=false)=>ut(f,u,h,typeof d=="boolean"?d:false):ut(f,u,r,a)};me.default=me;ct.exports=me;});chunkBUNLC3II_cjs.h();var gt=chunkBUNLC3II_cjs.e(lt(),1);chunkBUNLC3II_cjs.h();function He(e){return e.code==="ENOENT"||e.code==="EISDIR"?null:e}function pt(e){return e.code==="EEXIST"?null:e}async function Te(e,r,t){return await _t(path.dirname(e)),fs.promises.writeFile(e,r,t)}function Le(e,r){return fs.promises.readFile(e,r).catch(He)}function At(e){return fs.promises.unlink(e).catch(He)}function Rt(e){return fs.promises.readdir(e,{withFileTypes:true}).catch(He).then(r=>r||[])}async function _t(e){fs.existsSync(e)||(await _t(path.dirname(e)).catch(pt),await fs.promises.mkdir(e).catch(pt));}async function Oe(e,r,t){if(r&&r(e))return [];let i=await Rt(e),a=[];return await Promise.all(i.map(async p=>{let u=path.resolve(e,p.name);if(p.isDirectory()){if(t===void 0||t>0){let f=await Oe(u,r,t===void 0?void 0:t-1);a.push(...f.map(h=>p.name+"/"+h));}}else r&&r(p.name)||a.push(p.name);})),a}async function ve(e){let r=await Rt(e);await Promise.all(r.map(t=>{let i=path.resolve(e,t.name);return t.isDirectory()?ve(i).then(()=>fs.promises.rmdir(i)):fs.promises.unlink(i)}));}var _r=/\.\.:|\.\.$/,we="fs",Fr=(e={})=>{if(!e.base)throw chunkMCIZG4A3_cjs.b(we,"base");let r=path.resolve(e.base),t=(0, gt.default)(e.ignore||["**/node_modules/**","**/.git/**"]),i=u=>{if(_r.test(u))throw chunkMCIZG4A3_cjs.a(we,`Invalid key: ${JSON.stringify(u)}. It should not contain .. segments`);return path.join(r,u.replace(/:/g,"/"))},a,p=async()=>{a&&(await a.close(),a=void 0);};return {name:we,options:e,flags:{maxDepth:true},hasItem(u){return fs.existsSync(i(u))},getItem(u){return Le(i(u),"utf8")},getItemRaw(u){return Le(i(u))},async getMeta(u){let{atime:f,mtime:h,size:d,birthtime:R,ctime:$}=await fs.promises.stat(i(u)).catch(()=>({}));return {atime:f,mtime:h,size:d,birthtime:R,ctime:$}},setItem(u,f){if(!e.readOnly)return Te(i(u),f,"utf8")},setItemRaw(u,f){if(!e.readOnly)return Te(i(u),f)},removeItem(u){if(!e.readOnly)return At(i(u))},getKeys(u,f){return Oe(i("."),t,f?.maxDepth)},async clear(){e.readOnly||e.noClear||await ve(i("."));},async dispose(){a&&await a.close();},async watch(u){if(a)return p;let{watch:f}=await import('./chokidar-5RVQZVHP.cjs');return await new Promise((h,d)=>{let R={ignoreInitial:true,...e.watchOptions};R.ignored?Array.isArray(R.ignored)?R.ignored=[...R.ignored]:R.ignored=[R.ignored]:R.ignored=[],R.ignored.push(t),a=f(r,R).on("ready",()=>{h();}).on("error",d).on("all",($,O)=>{O=path.relative(r,O),$==="change"||$==="add"?u("update",O):$==="unlink"&&u("remove",O);});}),p}}};/*! Bundled license information:
2
-
3
- normalize-path/index.js:
4
- (*!
5
- * normalize-path <https://github.com/jonschlinkert/normalize-path>
6
- *
7
- * Copyright (c) 2014-2018, Jon Schlinkert.
8
- * Released under the MIT License.
9
- *)
10
- */exports.a=Fr;
@@ -1,3 +0,0 @@
1
- if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- var i={name:"@aws-sdk/nested-clients",version:"3.997.33",description:"Nested clients for AWS SDK packages.",homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",license:"Apache-2.0",author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/sdk-for-javascript/"},repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"packages/nested-clients"},files:["./cognito-identity.d.ts","./cognito-identity.js","./signin.d.ts","./signin.js","./sso-oidc.d.ts","./sso-oidc.js","./sso.d.ts","./sso.js","./sts.d.ts","./sts.js","dist-*/**"],sideEffects:false,main:"./dist-cjs/index.js",module:"./dist-es/index.js",browser:{"./dist-es/submodules/cognito-identity/runtimeConfig":"./dist-es/submodules/cognito-identity/runtimeConfig.browser","./dist-es/submodules/signin/runtimeConfig":"./dist-es/submodules/signin/runtimeConfig.browser","./dist-es/submodules/sso-oidc/runtimeConfig":"./dist-es/submodules/sso-oidc/runtimeConfig.browser","./dist-es/submodules/sso/runtimeConfig":"./dist-es/submodules/sso/runtimeConfig.browser","./dist-es/submodules/sts/runtimeConfig":"./dist-es/submodules/sts/runtimeConfig.browser"},types:"./dist-types/index.d.ts",typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"],"*":["dist-types/ts3.4/submodules/*/index.d.ts"]}},"react-native":{},exports:{"./package.json":"./package.json","./sso-oidc":{types:"./dist-types/submodules/sso-oidc/index.d.ts",module:"./dist-es/submodules/sso-oidc/index.js",node:"./dist-cjs/submodules/sso-oidc/index.js",import:"./dist-es/submodules/sso-oidc/index.js",require:"./dist-cjs/submodules/sso-oidc/index.js"},"./sts":{types:"./dist-types/submodules/sts/index.d.ts",module:"./dist-es/submodules/sts/index.js",node:"./dist-cjs/submodules/sts/index.js",import:"./dist-es/submodules/sts/index.js",require:"./dist-cjs/submodules/sts/index.js"},"./signin":{types:"./dist-types/submodules/signin/index.d.ts",module:"./dist-es/submodules/signin/index.js",node:"./dist-cjs/submodules/signin/index.js",import:"./dist-es/submodules/signin/index.js",require:"./dist-cjs/submodules/signin/index.js"},"./cognito-identity":{types:"./dist-types/submodules/cognito-identity/index.d.ts",module:"./dist-es/submodules/cognito-identity/index.js",node:"./dist-cjs/submodules/cognito-identity/index.js",import:"./dist-es/submodules/cognito-identity/index.js",require:"./dist-cjs/submodules/cognito-identity/index.js"},"./sso":{types:"./dist-types/submodules/sso/index.d.ts",module:"./dist-es/submodules/sso/index.js",node:"./dist-cjs/submodules/sso/index.js",import:"./dist-es/submodules/sso/index.js",require:"./dist-cjs/submodules/sso/index.js"}},scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline","build:es":"premove dist-es && tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"premove dist-types && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types",lint:"node ../../scripts/validation/submodules-linter.js",prebuild:"yarn lint",test:"yarn g:vitest run","test:watch":"yarn g:vitest watch"},dependencies:{"@aws-sdk/core":"^3.975.3","@aws-sdk/signature-v4-multi-region":"^3.996.41","@aws-sdk/types":"^3.974.2","@smithy/core":"^3.29.4","@smithy/fetch-http-handler":"^5.6.6","@smithy/node-http-handler":"^4.9.6","@smithy/types":"^4.16.1",tslib:"^2.6.2"},devDependencies:{concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3"},engines:{node:">=20.0.0"}};
3
- export{i as a};
@@ -1,10 +0,0 @@
1
- 'use strict';var chunkGNEVCEJU_cjs=require('./chunk-GNEVCEJU.cjs'),chunkLQ3YZTPU_cjs=require('./chunk-LQ3YZTPU.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs'),stream=require('stream'),os=require('os'),process$1=require('process');chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var D=(e,t)=>{let r=[];if(e&&r.push(e),t)for(let o of t)r.push(o);return r},O=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,F=()=>{let e=[],t=[],r=false,o=new Set,s=l=>l.sort((f,m)=>ht[m.step]-ht[f.step]||gt[m.priority||"normal"]-gt[f.priority||"normal"]),i=l=>{let f=false,m=E=>{let S=D(E.name,E.aliases);if(S.includes(l)){f=true;for(let g of S)o.delete(g);return false}return true};return e=e.filter(m),t=t.filter(m),f},a=l=>{let f=false,m=E=>{if(E.middleware===l){f=true;for(let S of D(E.name,E.aliases))o.delete(S);return false}return true};return e=e.filter(m),t=t.filter(m),f},d=l=>(e.forEach(f=>{l.add(f.middleware,{...f});}),t.forEach(f=>{l.addRelativeTo(f.middleware,{...f});}),l.identifyOnResolve?.(h.identifyOnResolve()),l),u=l=>{let f=[];return l.before.forEach(m=>{m.before.length===0&&m.after.length===0?f.push(m):f.push(...u(m));}),f.push(l),l.after.reverse().forEach(m=>{m.before.length===0&&m.after.length===0?f.push(m):f.push(...u(m));}),f},p=(l=false)=>{let f=[],m=[],E={};return e.forEach(g=>{let R={...g,before:[],after:[]};for(let A of D(R.name,R.aliases))E[A]=R;f.push(R);}),t.forEach(g=>{let R={...g,before:[],after:[]};for(let A of D(R.name,R.aliases))E[A]=R;m.push(R);}),m.forEach(g=>{if(g.toMiddleware){let R=E[g.toMiddleware];if(R===void 0){if(l)return;throw new Error(`${g.toMiddleware} is not found when adding ${O(g.name,g.aliases)} middleware ${g.relation} ${g.toMiddleware}`)}g.relation==="after"&&R.after.push(g),g.relation==="before"&&R.before.push(g);}}),s(f).map(u).reduce((g,R)=>(g.push(...R),g),[])},h={add:(l,f={})=>{let{name:m,override:E,aliases:S}=f,g={step:"initialize",priority:"normal",middleware:l,...f},R=D(m,S);if(R.length>0){if(R.some(A=>o.has(A))){if(!E)throw new Error(`Duplicate middleware name '${O(m,S)}'`);for(let A of R){let w=e.findIndex(G=>G.name===A||G.aliases?.some(ge=>ge===A));if(w===-1)continue;let y=e[w];if(y.step!==g.step||g.priority!==y.priority)throw new Error(`"${O(y.name,y.aliases)}" middleware with ${y.priority} priority in ${y.step} step cannot be overridden by "${O(m,S)}" middleware with ${g.priority} priority in ${g.step} step.`);e.splice(w,1);}}for(let A of R)o.add(A);}e.push(g);},addRelativeTo:(l,f)=>{let{name:m,override:E,aliases:S}=f,g={middleware:l,...f},R=D(m,S);if(R.length>0){if(R.some(A=>o.has(A))){if(!E)throw new Error(`Duplicate middleware name '${O(m,S)}'`);for(let A of R){let w=t.findIndex(G=>G.name===A||G.aliases?.some(ge=>ge===A));if(w===-1)continue;let y=t[w];if(y.toMiddleware!==g.toMiddleware||y.relation!==g.relation)throw new Error(`"${O(y.name,y.aliases)}" middleware ${y.relation} "${y.toMiddleware}" middleware cannot be overridden by "${O(m,S)}" middleware ${g.relation} "${g.toMiddleware}" middleware.`);t.splice(w,1);}}for(let A of R)o.add(A);}t.push(g);},clone:()=>d(F()),use:l=>{l.applyToStack(h);},remove:l=>typeof l=="string"?i(l):a(l),removeByTag:l=>{let f=false,m=E=>{let{tags:S,name:g,aliases:R}=E;if(S&&S.includes(l)){let A=D(g,R);for(let w of A)o.delete(w);return f=true,false}return true};return e=e.filter(m),t=t.filter(m),f},concat:l=>{let f=d(F());return f.use(l),f.identifyOnResolve(r||f.identifyOnResolve()||(l.identifyOnResolve?.()??false)),f},applyToStack:d,identify:()=>p(true).map(l=>{let f=l.step??l.relation+" "+l.toMiddleware;return O(l.name,l.aliases)+" - "+f}),identifyOnResolve(l){return typeof l=="boolean"&&(r=l),r},resolve:(l,f)=>{for(let m of p().map(E=>E.middleware).reverse())l=m(l,f);return r&&console.log(h.identify()),l}};return h},ht={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},gt={high:3,normal:2,low:1};var Se=class{config;middlewareStack=F();initConfig;handlers;constructor(t){this.config=t;let{protocol:r,protocolSettings:o}=t;o&&typeof r=="function"&&(t.protocol=new r(o));}send(t,r,o){let s=typeof r!="function"?r:void 0,i=typeof r=="function"?r:o,a=s===void 0&&this.config.cacheMiddleware===true,d;if(a){this.handlers||(this.handlers=new WeakMap);let u=this.handlers;u.has(t.constructor)?d=u.get(t.constructor):(d=t.resolveMiddleware(this.middlewareStack,this.config,s),u.set(t.constructor,d));}else delete this.handlers,d=t.resolveMiddleware(this.middlewareStack,this.config,s);if(i)d(t).then(u=>i(null,u.output),u=>i(u)).catch(()=>{});else return d(t).then(u=>u.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers;}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ae="***SensitiveInformation***";function Z(e,t){if(t==null)return t;let r=chunkGNEVCEJU_cjs.m.of(e);if(r.getMergedTraits().sensitive)return Ae;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return Ae}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return Ae}else if(r.isStructSchema()&&typeof t=="object"){let o=t,s={};for(let[i,a]of r.structIterator())o[i]!=null&&(s[i]=Z(a,o[i]));return s}return t}var L=class{middlewareStack=F();schema;static classBuilder(){return new Te}resolveMiddlewareWithContext(t,r,o,{middlewareFn:s,clientName:i,commandName:a,inputFilterSensitiveLog:d,outputFilterSensitiveLog:u,smithyContext:p,additionalContext:h,CommandCtor:l}){for(let R of s.bind(this)(l,t,r,o))this.middlewareStack.use(R);let f=t.concat(this.middlewareStack),{logger:m}=r,E={logger:m,clientName:i,commandName:a,inputFilterSensitiveLog:d,outputFilterSensitiveLog:u,[chunkGNEVCEJU_cjs.c]:{commandInstance:this,...p},...h},{requestHandler:S}=r,g=o??{};return p.eventStream&&(g={isEventStream:true,...g}),f.resolve(R=>S.handle(R.request,g),E)}},Te=class{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(t){this._init=t;}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,r,o={}){return this._smithyContext={service:t,operation:r,...o},this}c(t={}){return this._additionalContext=t,this}n(t,r){return this._clientName=t,this._commandName=r,this}f(t=o=>o,r=o=>o){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=r,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}sc(t){return this._operationSchema=t,this._smithyContext.operationSchema=t,this}build(){let t=this,r;return r=class extends L{input;static getEndpointParameterInstructions(){return t._ep}constructor(...[o]){super(),this.input=o??{},t._init(this),this.schema=t._operationSchema;}resolveMiddleware(o,s,i){let a=t._operationSchema,d=a?.[4]??a?.input,u=a?.[5]??a?.output;return this.resolveMiddlewareWithContext(o,s,i,{CommandCtor:r,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog??(a?Z.bind(null,d):p=>p),outputFilterSensitiveLog:t._outputFilterSensitiveLog??(a?Z.bind(null,u):p=>p),smithyContext:t._smithyContext,additionalContext:t._additionalContext})}serialize=t._serializer;deserialize=t._deserializer}}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Mr=(e,t,r)=>{for(let[i,a]of Object.entries(e)){let d=async function(p,h,l){let f=new a(p);if(typeof h=="function")this.send(f,h);else if(typeof l=="function"){if(typeof h!="object")throw new Error(`Expected http options but got ${typeof h}`);this.send(f,h||{},l);}else return this.send(f,h)},u=(i[0].toLowerCase()+i.slice(1)).replace(/Command$/,"");t.prototype[u]=d;}let{paginators:o={},waiters:s={}}=r??{};for(let[i,a]of Object.entries(o))t.prototype[i]===void 0&&(t.prototype[i]=function(d={},u,...p){return a({...u,client:this},d,...p)});for(let[i,a]of Object.entries(s))t.prototype[i]===void 0&&(t.prototype[i]=async function(d={},u,...p){let h=u;return typeof u=="number"&&(h={maxWaitTime:u}),a({...h,client:this},d,...p)});};chunkBUNLC3II_cjs.h();var xe=class e extends Error{$fault;$response;$retryable;$metadata;constructor(t){super(t.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata;}static isInstance(t){if(!t)return false;let r=t;return e.prototype.isPrototypeOf(r)||!!r.$fault&&!!r.$metadata&&(r.$fault==="client"||r.$fault==="server")}static[Symbol.hasInstance](t){if(!t)return false;let r=t;return this===e?e.isInstance(t):e.isInstance(t)?r.name&&this.name?this.prototype.isPrototypeOf(t)||r.name===this.name:this.prototype.isPrototypeOf(t):false}},kr=(e,t={})=>{Object.entries(t).filter(([,o])=>o!==void 0).forEach(([o,s])=>{(e[o]==null||e[o]==="")&&(e[o]=s);});let r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e};chunkBUNLC3II_cjs.h();var Ur=e=>{switch(e){case "standard":return {retryMode:"standard",connectionTimeout:3100};case "in-region":return {retryMode:"standard",connectionTimeout:1100};case "cross-region":return {retryMode:"standard",connectionTimeout:3100};case "mobile":return {retryMode:"standard",connectionTimeout:3e4};default:return {}}};chunkBUNLC3II_cjs.h();var Et=false,Fr=e=>{e&&!Et&&parseInt(e.substring(1,e.indexOf(".")))<16&&(Et=true);};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Rt=Object.values(chunkGNEVCEJU_cjs.b),St=e=>{let t=[];for(let r in chunkGNEVCEJU_cjs.b){let o=chunkGNEVCEJU_cjs.b[r];e[o]!==void 0&&t.push({algorithmId:()=>o,checksumConstructor:()=>e[o]});}for(let[r,o]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>r,checksumConstructor:()=>o});return {addChecksumAlgorithm(r){e.checksumAlgorithms=e.checksumAlgorithms??{};let o=r.algorithmId(),s=r.checksumConstructor();Rt.includes(o)?e.checksumAlgorithms[o.toUpperCase()]=s:e.checksumAlgorithms[o]=s,t.push(r);},checksumAlgorithms(){return t}}},At=e=>{let t={};return e.checksumAlgorithms().forEach(r=>{let o=r.algorithmId();Rt.includes(o)&&(t[o]=r.checksumConstructor());}),t};chunkBUNLC3II_cjs.h();var Tt=e=>({setRetryStrategy(t){e.retryStrategy=t;},retryStrategy(){return e.retryStrategy}}),xt=e=>{let t={};return t.retryStrategy=e.retryStrategy(),t};var Lr=e=>Object.assign(St(e),Tt(e));var $r=e=>Object.assign(At(e),xt(e));chunkBUNLC3II_cjs.h();var yt=e=>{let t="#text";for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&e[r][t]!==void 0?e[r]=e[r][t]:typeof e[r]=="object"&&e[r]!==null&&(e[r]=yt(e[r]));return e};chunkBUNLC3II_cjs.h();var W=class{trace(){}debug(){}info(){}warn(){}error(){}};chunkBUNLC3II_cjs.h();function Hr(e,t,r,o){return function(i,a,d,u,p={}){let h=Object.assign({},e,i);return L.classBuilder().ep(h).m(function(l,f,m,E){let S=a.call(this,l,f,m,E);return S.unshift(o(m,l.getEndpointParameterInstructions())),S}).s(t,d,p).n(r,d.charAt(0).toUpperCase()+d.slice(1)+"Command").sc(u).build()}}chunkBUNLC3II_cjs.h();function Gr(e,t,r){return e.$source||(e.$source={}),e.$source[t]=r,e}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var _t="AWS_ENDPOINT_URL",wt="endpoint_url",It=e=>({environmentVariableSelector:t=>{let r=e.split(" ").map(i=>i.toUpperCase()),o=t[[_t,...r].join("_")];if(o)return o;let s=t[_t];if(s)return s},configFileSelector:(t,r)=>{if(t.services){let s=["services",t.services].join(".");if(!r||!r[s])throw new Error(`The services section "${t.services}" specified in the profile is not present in the shared configuration file.`);let i=r[s],a=e.split(" ").map(u=>u.toLowerCase()),d=i[[a.join("_"),wt].join(".")];if(d)return d}let o=t[wt];if(o)return o},default:void 0});chunkBUNLC3II_cjs.h();var Vr="AWS_IGNORE_CONFIGURED_ENDPOINT_URLS",Wr="ignore_configured_endpoint_urls",Nt={environmentVariableSelector:e=>chunkGNEVCEJU_cjs.s(e,Vr,chunkGNEVCEJU_cjs.t.ENV),configFileSelector:e=>chunkGNEVCEJU_cjs.s(e,Wr,chunkGNEVCEJU_cjs.t.CONFIG),default:false};var q=async e=>{if(!await chunkGNEVCEJU_cjs.C(Nt)())return chunkGNEVCEJU_cjs.C(It(e??""))()};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var ye=async e=>{let t=e?.Bucket||"";if(typeof e.Bucket=="string"&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Ot(t)){if(e.ForcePathStyle===true)throw new Error("Path-style addressing cannot be used with ARN buckets")}else (!Ct(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=true);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=true,e.DisableMRAP=true),e},qr=/^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/,zr=/(\d+\.){3}\d+/,Yr=/\.\./;var Ct=e=>qr.test(e)&&!zr.test(e)&&!Yr.test(e),Ot=e=>{let[t,r,o,,,s]=e.split(":"),i=t==="arn"&&e.split(":").length>=6,a=!!(i&&r&&o&&s);if(i&&!a)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return a};chunkBUNLC3II_cjs.h();var vt=(e,t,r,o=false)=>{let s=async()=>{let i;return o?i=r.clientContextParams?.[e]??r[e]??r[t]:i=r[e]??r[t],typeof i=="function"?i():i};return e==="credentialScope"||t==="CredentialScope"?async()=>{let i=typeof r.credentials=="function"?await r.credentials():r.credentials;return i?.credentialScope??i?.CredentialScope}:e==="accountId"||t==="AccountId"?async()=>{let i=typeof r.credentials=="function"?await r.credentials():r.credentials;return i?.accountId??i?.AccountId}:e==="endpoint"||t==="endpoint"?async()=>{if(r.isCustomEndpoint===false)return;let i=await s();if(i&&typeof i=="object"){if("url"in i)return i.url.href;if("hostname"in i){let{protocol:a,hostname:d,port:u,path:p}=i;return `${a}//${d}${u?":"+u:""}${p}`}}return i}:s};chunkBUNLC3II_cjs.h();function ee(e){return async(t,r,o,s)=>{if(!o.isCustomEndpoint&&!o.ignoreConfiguredEndpointUrls){let d;o.serviceConfiguredEndpoint?d=await o.serviceConfiguredEndpoint():d=await e(o.serviceId),d&&(o.endpoint=()=>Promise.resolve(chunkGNEVCEJU_cjs.j(d)),o.isCustomEndpoint=true,s?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${d}`));}let i=await Pt(t,r,o);if(typeof o.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");let a=o.endpointProvider(i,s);if(o.isCustomEndpoint&&o.endpoint){let d=await o.endpoint();if(d?.headers){a.headers??={};for(let[u,p]of Object.entries(d.headers))a.headers[u]=Array.isArray(p)?p:[p];}}return a}}var Pt=async(e,t,r)=>{let o={},s=t?.getEndpointParameterInstructions?.()||{};for(let[i,a]of Object.entries(s))switch(a.type){case "staticContextParams":o[i]=a.value;break;case "contextParams":o[i]=e[a.name];break;case "clientContextParams":case "builtInParams":o[i]=await vt(a.name,i,r,a.type!=="builtInParams")();break;case "operationContextParams":o[i]=a.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(a))}return Object.keys(s).length===0&&Object.assign(o,r),String(r.serviceId).toLowerCase()==="s3"&&await ye(o),o};chunkBUNLC3II_cjs.h();function jr(e,t,r){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=r;}function te(e){let t=ee(e);return ({config:r,instructions:o})=>(s,i)=>async a=>{r.isCustomEndpoint&&jr(i,"ENDPOINT_OVERRIDE","N");let d=await t(a.input,{getEndpointParameterInstructions(){return o}},{...r},i);i.endpointV2=d,i.authSchemes=d.properties?.authSchemes;let u=i.authSchemes?.[0];if(u){i.signing_region=u.signingRegion,i.signing_service=u.signingName;let h=chunkGNEVCEJU_cjs.d(i)?.selectedHttpAuthScheme?.httpAuthOption;h&&(h.signingProperties=Object.assign(h.signingProperties||{},{signing_region:u.signingRegion,signingRegion:u.signingRegion,signing_service:u.signingName,signingName:u.signingName,signingRegionSet:u.signingRegionSet},u.properties));}return s({...a})}}chunkBUNLC3II_cjs.h();var Xr={name:"serializerMiddleware"},Kr={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:true,relation:"before",toMiddleware:Xr.name};function bt(e){let t=te(e);return (r,o)=>({applyToStack:s=>{s.addRelativeTo(t({config:r,instructions:o}),Kr);}})}chunkBUNLC3II_cjs.h();function Dt(e){return t=>{let r=t.tls??true,{endpoint:o,useDualstackEndpoint:s,useFipsEndpoint:i}=t,a=o!=null?async()=>chunkGNEVCEJU_cjs.j(await chunkGNEVCEJU_cjs.h(o)()):void 0,u=Object.assign(t,{endpoint:a,tls:r,isCustomEndpoint:!!o,useDualstackEndpoint:chunkGNEVCEJU_cjs.h(s??false),useFipsEndpoint:chunkGNEVCEJU_cjs.h(i??false),ignoreConfiguredEndpointUrls:!!t.ignoreConfiguredEndpointUrls}),p;return u.serviceConfiguredEndpoint=async()=>(t.serviceId&&!p&&(p=e(t.serviceId)),p),u}}chunkBUNLC3II_cjs.h();var _e=class e{nodes;root;conditions;results;constructor(t,r,o,s){this.nodes=t,this.root=r,this.conditions=o,this.results=s;}static from(t,r,o,s){return new e(t,r,o,s)}};chunkBUNLC3II_cjs.h();var we=class{capacity;data=new Map;parameters=[];constructor({size:t,params:r}){this.capacity=t??50,r&&(this.parameters=r);}get(t,r){let o=this.hash(t);if(o===false)return r();if(!this.data.has(o)){if(this.data.size>this.capacity+10){let s=this.data.keys(),i=0;for(;;){let{value:a,done:d}=s.next();if(this.data.delete(a),d||++i>10)break}}this.data.set(o,r());}return this.data.get(o)}size(){return this.data.size}hash(t){let r="",{parameters:o}=this;if(o.length===0)return false;for(let s of o){let i=String(t[s]??"");if(i.includes("|;"))return false;r+=i+"|;";}return r}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var T=class extends Error{constructor(t){super(t),this.name="EndpointError";}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ie="endpoints";chunkBUNLC3II_cjs.h();function $(e){return typeof e!="object"||e==null?e:"ref"in e?`$${$(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map($).join(", ")})`:JSON.stringify(e,null,2)}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var z={};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ne=(e,t)=>e===t;chunkBUNLC3II_cjs.h();function Ce(...e){for(let t of e)if(t!=null)return t}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Mt=e=>{let t=e.split("."),r=[];for(let o of t){let s=o.indexOf("[");if(s!==-1){if(o.indexOf("]")!==o.length-1)throw new T(`Path: '${e}' does not end with ']'`);let i=o.slice(s+1,-1);if(Number.isNaN(parseInt(i)))throw new T(`Invalid array index: '${i}' in path: '${e}'`);s!==0&&r.push(o.slice(0,s)),r.push(i);}else r.push(o);}return r};var Y=(e,t)=>Mt(t).reduce((r,o)=>{if(typeof r!="object")throw new T(`Index '${o}' in '${t}' not found in '${JSON.stringify(e)}'`);if(Array.isArray(r)){let s=parseInt(o);return r[s<0?r.length+s:s]}return r[o]},e);chunkBUNLC3II_cjs.h();var Oe=e=>e!=null;chunkBUNLC3II_cjs.h();function ve(e,t,r){return e?t:r}chunkBUNLC3II_cjs.h();var Pe=e=>!e;chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Jr=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),H=e=>Jr.test(e)||e.startsWith("[")&&e.endsWith("]");var be={[chunkGNEVCEJU_cjs.a.HTTP]:80,[chunkGNEVCEJU_cjs.a.HTTPS]:443},De=e=>{let t=(()=>{try{if(e instanceof URL)return e;if(typeof e=="object"&&"hostname"in e){let{hostname:f,port:m,protocol:E="",path:S="",query:g={}}=e,R=new URL(`${E}//${f}${m?`:${m}`:""}${S}`);return R.search=Object.entries(g).map(([A,w])=>`${A}=${w}`).join("&"),R}return new URL(e)}catch{return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;let r=t.href,{host:o,hostname:s,pathname:i,protocol:a,search:d}=t;if(d)return null;let u=a.slice(0,-1);if(!Object.values(chunkGNEVCEJU_cjs.a).includes(u))return null;let p=H(s),h=r.includes(`${o}:${be[u]}`)||typeof e=="string"&&e.includes(`${o}:${be[u]}`),l=`${o}${h?`:${be[u]}`:""}`;return {scheme:u,authority:l,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:p}};chunkBUNLC3II_cjs.h();function Me(e,t,r){if(r===1)return [e];if(e==="")return [""];let o=e.split(t);return r===0?o:o.slice(0,r-1).concat(o.slice(1).join(t))}chunkBUNLC3II_cjs.h();var ke=(e,t)=>e===t;chunkBUNLC3II_cjs.h();var Ue=(e,t,r,o)=>e==null||t>=r||e.length<r||/[^\u0000-\u007f]/.test(e)?null:o?e.substring(e.length-r,e.length-t):e.substring(t,r);chunkBUNLC3II_cjs.h();var Fe=e=>encodeURIComponent(e).replace(/[!*'()]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`);var kt={booleanEquals:Ne,coalesce:Ce,getAttr:Y,isSet:Oe,isValidHostLabel:chunkGNEVCEJU_cjs.g,ite:ve,not:Pe,parseURL:De,split:Me,stringEquals:ke,substring:Ue,uriEncode:Fe};chunkBUNLC3II_cjs.h();var re=(e,t)=>{let r=[],{referenceRecord:o,endpointParams:s}=t,i=0;for(;i<e.length;){let a=e.indexOf("{",i);if(a===-1){r.push(e.slice(i));break}r.push(e.slice(i,a));let d=e.indexOf("}",a);if(d===-1){r.push(e.slice(a));break}e[a+1]==="{"&&e[d+1]==="}"&&(r.push(e.slice(a+1,d)),i=d+2);let u=e.substring(a+1,d);if(u.includes("#")){let[p,h]=u.split("#");r.push(Y(o[p]??s[p],h));}else r.push(o[u]??s[u]);i=d+1;}return r.join("")};chunkBUNLC3II_cjs.h();var Ut=({ref:e},t)=>t.referenceRecord[e]??t.endpointParams[e];var M=(e,t,r)=>{if(typeof e=="string")return re(e,r);if(e.fn)return Ft.callFunction(e,r);if(e.ref)return Ut(e,r);throw new T(`'${t}': ${String(e)} is not a string, function or reference.`)},oe=({fn:e,argv:t},r)=>{let o=Array(t.length);for(let a=0;a<o.length;++a){let d=t[a];typeof d=="boolean"||typeof d=="number"?o[a]=d:o[a]=Ft.evaluateExpression(d,"arg",r);}let s=e.indexOf(".");if(s!==-1){let d=z[e.slice(0,s)]?.[e.slice(s+1)];if(typeof d=="function")return d(...o)}let i=kt[e];if(typeof i=="function")return i(...o);throw new Error(`function ${e} not loaded in endpointFunctions.`)},Ft={evaluateExpression:M,callFunction:oe};var Lt=(e,t)=>{let{assign:r}=e;if(r&&r in t.referenceRecord)throw new T(`'${r}' is already defined in Reference Record.`);let o=oe(e,t);t.logger?.debug?.(`${Ie} evaluateCondition: ${$(e)} = ${$(o)}`);let s=o===""?true:!!o;return r!=null?{result:s,toAssign:{name:r,value:o}}:{result:s}};chunkBUNLC3II_cjs.h();var $t=(e,t)=>Object.entries(e??{}).reduce((r,[o,s])=>(r[o]=s.map(i=>{let a=M(i,"Header value entry",t);if(typeof a!="string")throw new T(`Header '${o}' value '${a}' is not a string`);return a}),r),{});chunkBUNLC3II_cjs.h();var Le=(e,t)=>Object.entries(e).reduce((r,[o,s])=>(r[o]=Gt.getEndpointProperty(s,t),r),{}),Ht=(e,t)=>{if(Array.isArray(e))return e.map(r=>Ht(r,t));switch(typeof e){case "string":return re(e,t);case "object":if(e===null)throw new T(`Unexpected endpoint property: ${e}`);return Gt.getEndpointProperties(e,t);case "boolean":return e;default:throw new T(`Unexpected endpoint property type: ${typeof e}`)}},Gt={getEndpointProperty:Ht,getEndpointProperties:Le};chunkBUNLC3II_cjs.h();var Bt=(e,t)=>{let r=M(e,"Endpoint URL",t);if(typeof r=="string")try{return new URL(r)}catch(o){throw console.error(`Failed to construct URL with ${r}`,o),o}throw new T(`Endpoint URL must be a string, got ${typeof r}`)};var $e=1e8,Qr=(e,t)=>{let{nodes:r,root:o,results:s,conditions:i}=e,a=o,d={},u={referenceRecord:d,endpointParams:t.endpointParams,logger:t.logger};for(;a!==1&&a!==-1&&a<$e;){let p=3*(Math.abs(a)-1),[h,l,f]=[r[p],r[p+1],r[p+2]],[m,E,S]=i[h],g=Lt({fn:m,assign:S,argv:E},u);if(g.toAssign){let{name:R,value:A}=g.toAssign;d[R]=A;}a=a>=0===g.result?l:f;}if(a>=$e){let p=s[a-$e];if(p[0]===-1){let[,m]=p;throw new T(M(m,"Error",u))}let[h,l,f]=p;return {url:Bt(h,u),properties:Le(l,u),headers:$t(f??{},u)}}throw new T("No matching endpoint.")};var Da=Dt(q),ka=bt(q);chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Vt=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Wt=["TimeoutError","RequestTimeout","RequestTimeoutException"],qt=[500,502,503,504],zt=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Yt=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"];var Zr=e=>e?.$retryable!==void 0;var eo=e=>e.$metadata?.clockSkewCorrected,to=e=>{let t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return e&&e instanceof TypeError?t.has(e.message):false},ne=e=>e.$metadata?.httpStatusCode===429||Vt.includes(e.name)||e.$retryable?.throttling==true,ie=(e,t=0)=>Zr(e)||eo(e)||e.name==="InvalidSignatureException"&&e.message?.includes("Signature expired")||Wt.includes(e.name)||zt.includes(e?.code||"")||Yt.includes(e?.code||"")||qt.includes(e.$metadata?.httpStatusCode||0)||to(e)||ro(e)||e.cause!==void 0&&t<=10&&ie(e.cause,t+1),jt=e=>{if(e.$metadata?.httpStatusCode!==void 0){let t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!ie(e)}return false};function ro(e){return e.code==="ERR_HTTP2_STREAM_ERROR"&&e.message.includes("NGHTTP2_REFUSED_STREAM")}var se=class e{static setTimeoutFn=(t,r)=>setTimeout(t,r);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=false;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(t){this.beta=t?.beta??.7,this.minCapacity=t?.minCapacity??1,this.minFillRate=t?.minFillRate??.5,this.scaleConstant=t?.scaleConstant??.4,this.smooth=t?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity;}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(t){let r;this.updateMeasuredRate();let o=t;if(o?.errorType==="THROTTLING"||ne(o?.error??t)){let a=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=a,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(a),this.enableTokenBucket();}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());let i=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(i);}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(t){if(this.enabled){for(this.refillTokenBucket();t>this.availableTokens;){let r=(t-this.availableTokens)/this.fillRate*1e3;await new Promise(o=>e.setTimeoutFn(o,r)),this.refillTokenBucket();}this.availableTokens=this.availableTokens-t;}}refillTokenBucket(){let t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}let r=(t-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+r),this.lastTimestamp=t;}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3));}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=true;}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity);}updateMeasuredRate(){let t=this.getCurrentTimeInSeconds(),r=Math.floor(t*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){let o=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(o*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r;}}getPrecise(t){return parseFloat(t.toFixed(8))}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Xt="amz-sdk-invocation-id",Kt="amz-sdk-request";chunkBUNLC3II_cjs.h();var x=class e{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return e.v2026?50:100}static throttlingDelay(){return e.v2026?1e3:500}static cost(){return e.v2026?14:5}static throttlingCost(){return e.v2026?5:10}static modifiedCostType(){return e.v2026?"THROTTLING":"TRANSIENT"}};var ae=class{x=x.delay();computeNextBackoffDelay(t){let s=Math.random()*Math.min(this.x*2**t,2e4);return Math.floor(s)}setDelayBase(t){this.x=t;}};chunkBUNLC3II_cjs.h();var j=class{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(t,r,o,s){this.delay=t,this.count=r,this.cost=o,this.longPoll=s;}getRetryCount(){return this.count}getRetryDelay(){return Math.min(2e4,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}};chunkBUNLC3II_cjs.h();var _;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive";})(_||(_={}));var v=3,He=_.STANDARD;var ce={incompatible:1,attempts:2,capacity:3},k=class{mode=_.STANDARD;retryBackoffStrategy;capacity=500;maxAttemptsProvider;baseDelay;constructor(t){typeof t=="number"?this.maxAttemptsProvider=async()=>t:typeof t=="function"?this.maxAttemptsProvider=t:t&&typeof t=="object"&&(this.maxAttemptsProvider=async()=>t.maxAttempts,this.baseDelay=t.baseDelay,this.retryBackoffStrategy=t.backoff),this.maxAttemptsProvider??=async()=>v,this.baseDelay??=x.delay(),this.retryBackoffStrategy??=new ae;}async acquireInitialRetryToken(t){return new j(x.delay(),0,void 0,x.v2026&&t.includes(":longpoll"))}async refreshRetryTokenForRetry(t,r){let o=await this.getMaxAttempts(),s=this.retryCode(t,r,o),i=s===0,a=t.isLongPoll?.();if(i||a){let d=r.errorType;this.retryBackoffStrategy.setDelayBase(d==="THROTTLING"?x.throttlingDelay():this.baseDelay);let u=this.retryBackoffStrategy.computeNextBackoffDelay(t.getRetryCount()),p=u;if(r.retryAfterHint instanceof Date&&(p=Math.max(u,Math.min(r.retryAfterHint.getTime()-Date.now(),u+5e3))),i){let h=this.getCapacityCost(d);this.capacity-=h;let l=new j(0,t.getRetryCount()+1,h,t.isLongPoll?.()??false);return await new Promise(f=>setTimeout(f,p)),l.$retryLog.acquisitionDelay=p,l}else {let h=x.v2026&&s===ce.capacity&&a?p:0;h>0&&await new Promise(l=>setTimeout(l,h));}}throw new Error("No retry token available")}recordSuccess(t){this.capacity=Math.min(500,this.capacity+(t.getRetryCost()??1));}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${v}`),v}}retryCode(t,r,o){let s=t.getRetryCount()+1,i=this.isRetryableError(r.errorType)?0:ce.incompatible,a=s<o?0:ce.attempts,d=this.capacity>=this.getCapacityCost(r.errorType)?0:ce.capacity;return i||a||d}getCapacityCost(t){return t===x.modifiedCostType()?x.throttlingCost():x.cost()}isRetryableError(t){return t==="THROTTLING"||t==="TRANSIENT"}};var de=class{mode=_.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(t,r){let{rateLimiter:o}=r??{};this.rateLimiter=o??new se,this.standardRetryStrategy=r?new k({maxAttempts:typeof t=="number"?t:3,...r}):new k(t);}async acquireInitialRetryToken(t){let r=await this.standardRetryStrategy.acquireInitialRetryToken(t);return await this.rateLimiter.getSendToken(),r}async refreshRetryTokenForRetry(t,r){this.rateLimiter.updateClientSendingRate(r);let o=await this.standardRetryStrategy.refreshRetryTokenForRetry(t,r);return await this.rateLimiter.getSendToken(),o}recordSuccess(t){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(t);}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}};var Ge="AWS_MAX_ATTEMPTS",Be="max_attempts",io={environmentVariableSelector:e=>{let t=e[Ge];if(!t)return;let r=parseInt(t);if(Number.isNaN(r))throw new Error(`Environment variable ${Ge} mast be a number, got "${t}"`);return r},configFileSelector:e=>{let t=e[Be];if(!t)return;let r=parseInt(t);if(Number.isNaN(r))throw new Error(`Shared config file entry ${Be} mast be a number, got "${t}"`);return r},default:v},so=(e,t)=>{let{retryStrategy:r,retryMode:o}=e,{defaultMaxAttempts:s=v,defaultBaseDelay:i=x.delay()}=t??{},a=chunkGNEVCEJU_cjs.h(e.maxAttempts??s),d=r?Promise.resolve(r):void 0,u=async()=>{let p=await a();return await chunkGNEVCEJU_cjs.h(o)()===_.ADAPTIVE?new de(a,{maxAttempts:p,baseDelay:i}):new k({maxAttempts:p,baseDelay:i})};return Object.assign(e,{maxAttempts:a,retryStrategy:()=>d??=u()})},Jt="AWS_RETRY_MODE",Qt="retry_mode",ao={environmentVariableSelector:e=>e[Jt],configFileSelector:e=>e[Qt],default:He};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ve=e=>e?.body instanceof stream.Readable||typeof ReadableStream<"u"&&e?.body instanceof ReadableStream;chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();function Zt(e,t){if(chunkGNEVCEJU_cjs.f.isInstance(e))for(let r of Object.keys(e.headers)){let o=r.toLowerCase();if(o==="retry-after"){let s=e.headers[r],i=NaN;if(s.endsWith("GMT"))try{i=(chunkLQ3YZTPU_cjs.i(s).getTime()-Date.now())/1e3;}catch(a){t?.trace?.("Failed to parse retry-after header"),t?.trace?.(a);}else s.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?i=Number(s.match(/ GMT, ([\d.]+)$/)?.[1]):s.match(/^((\d+)|(\d+\.\d+))$/)?i=Number(s):Date.parse(s)>=Date.now()&&(i=(Date.parse(s)-Date.now())/1e3);return isNaN(i)?void 0:new Date(Date.now()+i*1e3)}else if(o==="x-amz-retry-after"){let s=e.headers[r],i=Number(s);if(isNaN(i)){t?.trace?.(`Failed to parse x-amz-retry-after=${s}`);return}return new Date(Date.now()+i)}}}chunkBUNLC3II_cjs.h();var er=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):typeof e=="string"?new Error(e):new Error(`AWS SDK error wrapper for ${e}`);function We(e){return t=>(r,o)=>async s=>{let i=await t.retryStrategy(),a=await t.maxAttempts();if(lo(i)){i=i;let d=await i.acquireInitialRetryToken((o.partition_id??"")+(o.__retryLongPoll?":longpoll":"")),u=new Error,p=0,h=0,{request:l}=s,f=chunkGNEVCEJU_cjs.e.isInstance(l);for(f&&(l.headers[Xt]=chunkLQ3YZTPU_cjs.C());;)try{f&&(l.headers[Kt]=`attempt=${p+1}; max=${a}`);let{response:m,output:E}=await r(s);return i.recordSuccess(d),E.$metadata.attempts=p+1,E.$metadata.totalRetryDelay=h,{response:m,output:E}}catch(m){let E=po(m,t.logger);if(u=er(m),f&&e(l))throw (o.logger instanceof W?console:o.logger)?.warn("An error was encountered in a non-retryable streaming request."),u;try{d=await i.refreshRetryTokenForRetry(d,E);}catch{throw u.$metadata||(u.$metadata={}),u.$metadata.attempts=p+1,u.$metadata.totalRetryDelay=h,u}p=d.getRetryCount();let S=d.getRetryDelay();h+=(d?.$retryLog?.acquisitionDelay??0)+S,S>0&&await uo(S);}}else return i=i,i?.mode&&(o.userAgent=[...o.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(r,s)}}var uo=e=>new Promise(t=>setTimeout(t,e)),lo=e=>typeof e.acquireInitialRetryToken<"u"&&typeof e.refreshRetryTokenForRetry<"u"&&typeof e.recordSuccess<"u",po=(e,t)=>{let r={error:e,errorType:fo(e)},o=Zt(e.$response,t);return o&&(r.retryAfterHint=o),r},fo=e=>ne(e)?"THROTTLING":ie(e)?"TRANSIENT":jt(e)?"SERVER_ERROR":"CLIENT_ERROR",mo={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:true};function tr(e){let t=We(e);return r=>({applyToStack:o=>{o.add(t(r),mo);}})}var Jc=tr(Ve);chunkBUNLC3II_cjs.h();var rr=e=>t=>async r=>{if(!chunkGNEVCEJU_cjs.e.isInstance(r.request))return t(r);let{request:o}=r,{handlerProtocol:s=""}=e.requestHandler.metadata||{};if(s.indexOf("h2")>=0&&!o.headers[":authority"])delete o.headers.host,o.headers[":authority"]=o.hostname+(o.port?":"+o.port:"");else if(!o.headers.host){let i=o.hostname;o.port!=null&&(i+=`:${o.port}`),o.headers.host=i;}return t(r)},or={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:true},ho=e=>({applyToStack:t=>{t.add(rr(e),or);}});chunkBUNLC3II_cjs.h();var nr=()=>(e,t)=>async r=>{try{let o=await e(r),{clientName:s,commandName:i,logger:a,dynamoDbDocumentClientOptions:d={}}=t,{overrideInputFilterSensitiveLog:u,overrideOutputFilterSensitiveLog:p}=d,h=u??t.inputFilterSensitiveLog,l=p??t.outputFilterSensitiveLog,{$metadata:f,...m}=o.output;return a?.info?.({clientName:s,commandName:i,input:h(r.input),output:l(m),metadata:f}),o}catch(o){let{clientName:s,commandName:i,logger:a,dynamoDbDocumentClientOptions:d={}}=t,{overrideInputFilterSensitiveLog:u}=d,p=u??t.inputFilterSensitiveLog;throw a?.error?.({clientName:s,commandName:i,input:p(r.input),error:o,metadata:o.$metadata}),o}},ir={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:true},go=e=>({applyToStack:t=>{t.add(nr(),ir);}});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var sr={step:"build",tags:["RECURSION_DETECTION","TRACE_CONTEXT_PROPAGATION"],name:"recursionDetectionMiddleware",override:true,priority:"low"};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var P={REQUEST_ID:Symbol.for("_AWS_LAMBDA_REQUEST_ID"),X_RAY_TRACE_ID:Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),TENANT_ID:Symbol.for("_AWS_LAMBDA_TENANT_ID"),TRACEPARENT:Symbol.for("_AWS_LAMBDA_TRACEPARENT"),TRACESTATE:Symbol.for("_AWS_LAMBDA_TRACESTATE"),BAGGAGE:Symbol.for("_AWS_LAMBDA_BAGGAGE")},qe=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");qe||(globalThis.awslambda=globalThis.awslambda||{});var ue=class{static PROTECTED_KEYS=P;isProtectedKey(t){return Object.values(P).includes(t)}getRequestId(){return this.get(P.REQUEST_ID)??"-"}getXRayTraceId(){return this.get(P.X_RAY_TRACE_ID)}getTenantId(){return this.get(P.TENANT_ID)}getTraceparent(){return this.get(P.TRACEPARENT)}getTracestate(){return this.get(P.TRACESTATE)}getBaggage(){return this.get(P.BAGGAGE)}},ze=class extends ue{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(t){return this.currentContext?.[t]}set(t,r){if(this.isProtectedKey(t))throw new Error(`Cannot modify protected Lambda context field: ${String(t)}`);this.currentContext=this.currentContext||{},this.currentContext[t]=r;}run(t,r){return this.currentContext=t,r()}},Ye=class e extends ue{als;static async create(){let t=new e,r=await import('async_hooks');return t.als=new r.AsyncLocalStorage,t}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(t){return this.als.getStore()?.[t]}set(t,r){if(this.isProtectedKey(t))throw new Error(`Cannot modify protected Lambda context field: ${String(t)}`);let o=this.als.getStore();if(!o)throw new Error("No context available");o[t]=r;}run(t,r){return this.als.run(t,r)}},X;(function(e){let t=null;async function r(o){return t||(t=(async()=>{let i=o===true||"AWS_LAMBDA_MAX_CONCURRENCY"in process.env?await Ye.create():new ze;return !qe&&globalThis.awslambda?.InvokeStore?globalThis.awslambda.InvokeStore:(!qe&&globalThis.awslambda&&(globalThis.awslambda.InvokeStore=i),i)})()),t}e.getInstanceAsync=r,e._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE==="1"?{reset:()=>{t=null,globalThis.awslambda?.InvokeStore&&delete globalThis.awslambda.InvokeStore,globalThis.awslambda={InvokeStore:void 0};}}:void 0;})(X||(X={}));var Eo="AWS_LAMBDA_FUNCTION_NAME",Ro="_X_AMZN_TRACE_ID",je="X-Amzn-Trace-Id",Xe="traceparent",ar="tracestate",cr="baggage",dr=()=>e=>async t=>{let{request:r}=t;if(!chunkGNEVCEJU_cjs.e.isInstance(r))return e(t);let o;{let s=Object.keys(r.headers??{}).find(i=>i.toLowerCase()===je.toLowerCase())??je;if(!r.headers.hasOwnProperty(s)){let i=process.env[Eo],a=process.env[Ro];o??=await X.getInstanceAsync();let u=o?.getXRayTraceId()??a,p=h=>typeof h=="string"&&h.length>0;p(i)&&p(u)&&(r.headers[je]=u);}}if(So(r.headers),!r.headers[Xe]){let i=(o??=await X.getInstanceAsync())?.getTraceparent?.();if(i){r.headers[Xe]=i;let a=o?.getTracestate?.();a&&(r.headers[ar]=a);let d=o?.getBaggage?.();d&&(r.headers[cr]=d);}}return e(t)};function So(e){for(let t of Object.keys(e)){let r=t.toLowerCase();t!==r&&(r===Xe||r===ar||r===cr)&&(e[r]=e[t],delete e[t]);}}var Ao=e=>({applyToStack:t=>{t.add(dr(),sr);}});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var ur=(e,t)=>{if(!t||t.length===0)return e;let r=[];for(let o of t)for(let s of e)s.schemeId.split("#")[1]===o&&r.push(s);for(let o of e)r.find(({schemeId:s})=>s===o.schemeId)||r.push(o);return r};function To(e){let t=new Map;for(let r of e)t.set(r.schemeId,r);return t}var Ke=(e,t)=>(r,o)=>async s=>{let i=e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,o,s.input)),a=e.authSchemePreference?await e.authSchemePreference():[],d=ur(i,a),u=To(e.httpAuthSchemes),p=chunkGNEVCEJU_cjs.d(o),h=[];for(let l of d){let f=u.get(l.schemeId);if(!f){h.push(`HttpAuthScheme \`${l.schemeId}\` was not enabled for this service.`);continue}let m=f.identityProvider(await t.identityProviderConfigProvider(e));if(!m){h.push(`HttpAuthScheme \`${l.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:E={},signingProperties:S={}}=l.propertiesExtractor?.(e,o)||{};l.identityProperties=Object.assign(l.identityProperties||{},E),l.signingProperties=Object.assign(l.signingProperties||{},S),p.selectedHttpAuthScheme={httpAuthOption:l,identity:await m(l.identityProperties),signer:f.signer};break}if(!p.selectedHttpAuthScheme)throw new Error(h.join(`
2
- `));return r(s)};var Je={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:true,relation:"before",toMiddleware:"endpointV2Middleware"},lr=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:r})=>({applyToStack:o=>{o.addRelativeTo(Ke(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:r}),Je);}});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var xo=e=>t=>{throw t},yo=(e,t)=>{},Qe=e=>(t,r)=>async o=>{if(!chunkGNEVCEJU_cjs.e.isInstance(o.request))return t(o);let i=chunkGNEVCEJU_cjs.d(r).selectedHttpAuthScheme;if(!i)throw new Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:a={}},identity:d,signer:u}=i,p=await t({...o,request:await u.sign(o.request,d,a)}).catch((u.errorHandler||xo)(a));return (u.successHandler||yo)(p.response,a),p};var Ze={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:true,relation:"after",toMiddleware:"retryMiddleware"},pr=e=>({applyToStack:t=>{t.addRelativeTo(Qe(),Ze);}});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var le=class{authSchemes=new Map;constructor(t){for(let r in t){let o=t[r];o!==void 0&&this.authSchemes.set(r,o);}}getIdentityProvider(t){return this.authSchemes.get(t)}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var K=class{async sign(t,r,o){return t}};chunkBUNLC3II_cjs.h();var et=e=>function(r){return tt(r)&&r.expiration.getTime()-Date.now()<e};var fr=et(3e5),tt=e=>e.expiration!==void 0,mr=(e,t,r)=>{if(e===void 0)return;let o=typeof e!="function"?async()=>Promise.resolve(e):e,s,i,a,d=false,u=async p=>{i||(i=o(p));try{s=await i,a=!0,d=!1;}finally{i=void 0;}return s};return t===void 0?async p=>((!a||p?.forceRefresh)&&(s=await u(p)),s):async p=>((!a||p?.forceRefresh)&&(s=await u(p)),d?s:r(s)?(t(s)&&await u(p),s):(d=true,s))};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var rt=e=>{if(typeof e=="function")return e;let t=Promise.resolve(e);return ()=>t};chunkBUNLC3II_cjs.h();var pe=void 0;function No(e){return e===void 0?true:typeof e=="string"&&e.length<=50}function Co(e){let t=rt(e.userAgentAppId??pe),{customUserAgent:r}=e;return Object.assign(e,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:async()=>{let o=await t();if(!No(o)){let s=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console:e.logger;typeof o!="string"?s?.warn("userAgentAppId must be a string or undefined."):o.length>50&&s?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");}return o}})}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var hr={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:true,supportsFIPS:true},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:true,supportsFIPS:true},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:true,supportsFIPS:true},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:true,supportsFIPS:true},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:true,supportsFIPS:true},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:true,supportsFIPS:true},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:true,supportsFIPS:true},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:true,supportsFIPS:true},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}]};var Oo=hr,gr=e=>{let{partitions:t}=Oo;for(let o of t){let{regions:s,outputs:i}=o;for(let[a,d]of Object.entries(s))if(a===e)return {...i,...d}}for(let o of t){let{regionRegex:s,outputs:i}=o;if(new RegExp(s).test(e))return {...i}}let r=t.find(o=>o.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return {...r.outputs}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();x.v2026||=typeof process=="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function I(e,t,r){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=r;}var Po=/\d{12}\.ddb/;async function Rr(e,t,r){if(r.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&I(e,"PROTOCOL_RPC_V2_CBOR","M"),typeof t.retryStrategy=="function"){let i=await t.retryStrategy();if(typeof i.mode=="string")switch(i.mode){case _.ADAPTIVE:I(e,"RETRY_MODE_ADAPTIVE","F");break;case _.STANDARD:I(e,"RETRY_MODE_STANDARD","E");break}}if(typeof t.accountIdEndpointMode=="function"){let i=e.endpointV2;switch(String(i?.url?.hostname).match(Po)&&I(e,"ACCOUNT_ID_ENDPOINT","O"),await t.accountIdEndpointMode?.()){case "disabled":I(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case "preferred":I(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case "required":I(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let s=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(s?.$source){let i=s;i.accountId&&I(e,"RESOLVED_ACCOUNT_ID","T");for(let[a,d]of Object.entries(i.$source??{}))I(e,a,d);}}chunkBUNLC3II_cjs.h();var ot="user-agent",fe="x-amz-user-agent";var Sr=/[^!$%&'*+\-.^_`|~\w]/g,Ar=/[^!$%&'*+\-.^_`|~\w#]/g;chunkBUNLC3II_cjs.h();function Tr(e){let t="";for(let r in e){let o=e[r];if(t.length+o.length+1<=1024){t.length?t+=","+o:t+=o;continue}break}return t}var _r=e=>(t,r)=>async o=>{let{request:s}=o;if(!chunkGNEVCEJU_cjs.e.isInstance(s))return t(o);let{headers:i}=s,a=r?.userAgent?.map(me)||[],d=(await e.defaultUserAgentProvider()).map(me);await Rr(r,e,o);let u=r;d.push(`m/${Tr(Object.assign({},r.__smithy_context?.features,u.__aws_sdk_context?.features))}`);let p=e?.customUserAgent?.map(me)||[],h=await e.userAgentAppId();h&&d.push(me(["app",`${h}`]));let f=([]).concat([...d,...a,...p]).join(" "),m=[...d.filter(E=>E.startsWith("aws-sdk-")),...p].join(" ");return e.runtime!=="browser"?(m&&(i[fe]=i[fe]?`${i[ot]} ${m}`:m),i[ot]=f):i[fe]=f,t({...o,request:s})},me=e=>{let t=e[0].split("/").map(a=>a.replace(Sr,"-")).join("/"),r=e[1]?.replace(Ar,"-"),o=t.indexOf("/"),s=t.substring(0,o),i=t.substring(o+1);return s==="api"&&(i=i.toLowerCase()),[s,i,r].filter(a=>a&&a.length>0).reduce((a,d,u)=>{switch(u){case 0:return d;case 1:return `${a}/${d}`;default:return `${a}#${d}`}},"")},wr={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:true},bo=e=>({applyToStack:t=>{t.add(_r(e),wr);}});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var he={warningEmitted:false},Do=e=>{if(e&&!he.warningEmitted){if(process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED==="true"){he.warningEmitted=true;return}let t=parseInt(e.substring(1,e.indexOf("."))),r=22;t<r&&(he.warningEmitted=true,process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3)
3
- versions published after the first week of January 2027
4
- will require node >=${r}. You are running node ${e}.
5
-
6
- To continue receiving updates to AWS services, bug fixes,
7
- and security updates please upgrade to node >=${r}.
8
-
9
- More information can be found at: https://a.co/c895JFp`));}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ir=()=>{let e=["deno","bun","llrt"];for(let t of e)if(process$1.versions[t])return [`md/${t}`,process$1.versions[t]];return ["md/nodejs",process$1.versions.node]};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Uo=({serviceId:e,clientVersion:t})=>{let r=Ir();return async o=>{let s=[["aws-sdk-js",t],["ua","2.1"],[`os/${os.platform()}`,os.release()],["lang/js"],r];e&&s.push([`api/${e}`,t]),process$1.env.AWS_EXECUTION_ENV&&s.push([`exec-env/${process$1.env.AWS_EXECUTION_ENV}`]);let a=await o?.userAgentAppId?.();return a?[...s,[`app/${a}`]]:[...s]}};chunkBUNLC3II_cjs.h();var Or="AWS_SDK_UA_APP_ID",vr="sdk_ua_app_id",Fo="sdk-ua-app-id",Lo={environmentVariableSelector:e=>e[Or],configFileSelector:e=>e[vr]??e[Fo],default:pe};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var at=(e,t=false)=>{if(t){for(let r of e.split("."))if(!at(r))return false;return true}return !(!chunkGNEVCEJU_cjs.g(e)||e.length<3||e.length>63||e!==e.toLowerCase()||H(e))};chunkBUNLC3II_cjs.h();var Pr=e=>{let t=e.split(":");if(t.length<6)return null;let[r,o,s,i,a,...d]=t;if(r!=="arn"||o===""||s===""||d.join(":")==="")return null;let u=d.map(p=>p.split("/")).flat();return {partition:o,service:s,region:i,accountId:a,resourceId:u}};var br={isVirtualHostableS3Bucket:at,parseArn:Pr,partition:gr};z.aws=br;chunkBUNLC3II_cjs.h();function $o(e={}){return chunkGNEVCEJU_cjs.C({...chunkGNEVCEJU_cjs.F,async default(){return console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."),"us-east-1"}},{...chunkGNEVCEJU_cjs.G,...e})}chunkBUNLC3II_cjs.h();var Ho=e=>({setRegion(t){e.region=t;},region(){return e.region}}),Go=e=>({region:e.region()});
10
- exports.A=I;exports.B=ho;exports.C=go;exports.D=Ao;exports.E=lr;exports.F=Ze;exports.G=pr;exports.H=rt;exports.I=le;exports.J=K;exports.K=fr;exports.L=tt;exports.M=mr;exports.N=Co;exports.O=bo;exports.P=Uo;exports.Q=Lo;exports.R=br;exports.S=$o;exports.T=Ho;exports.U=Go;exports.a=Do;exports.b=Gr;exports.c=Se;exports.d=L;exports.e=Mr;exports.f=xe;exports.g=kr;exports.h=Ur;exports.i=Fr;exports.j=Lr;exports.k=$r;exports.l=yt;exports.m=W;exports.n=Hr;exports.o=Pt;exports.p=_e;exports.q=we;exports.r=z;exports.s=Qr;exports.t=Da;exports.u=ka;exports.v=He;exports.w=io;exports.x=so;exports.y=ao;exports.z=Jc;
@@ -1 +0,0 @@
1
- 'use strict';var chunk3CIMGC2F_cjs=require('./chunk-3CIMGC2F.cjs'),chunkEW424IBO_cjs=require('./chunk-EW424IBO.cjs'),chunk6YS6XLOD_cjs=require('./chunk-6YS6XLOD.cjs'),chunkEQN3HDES_cjs=require('./chunk-EQN3HDES.cjs'),chunkN4FXLQE3_cjs=require('./chunk-N4FXLQE3.cjs'),chunkQYN6C3FZ_cjs=require('./chunk-QYN6C3FZ.cjs'),chunkJ6V573PE_cjs=require('./chunk-J6V573PE.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs'),w=require('kyro:config');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var w__default=/*#__PURE__*/_interopDefault(w);chunkBUNLC3II_cjs.h();exports.a=null;var l=null;async function b(){if(!exports.a){if(globalThis.__KYRO_INSTANCE__)try{await globalThis.__KYRO_INSTANCE__.shutdown();}catch{}try{let e=w__default.default.default||w__default.default,t=e.adapter,o=t&&!t.dialect&&typeof t.connect=="function";if(globalThis.DB&&(!t||o)){let s=globalThis.DB;e.adapter=new chunkN4FXLQE3_cjs.c({type:"sqlite",client:s}),chunk3CIMGC2F_cjs.K.info("Hot-swapped to D1 DrizzleAdapter");}exports.a=chunk3CIMGC2F_cjs.H(e),await exports.a.init();let a=e.adapter,p=a&&a.dialect&&(a.dialect==="postgres"||a.dialect==="sqlite"),c=a&&a.dialect==="mongodb",n;if(p)a.dialect==="postgres"?n=new chunkQYN6C3FZ_cjs.a({db:a.client}):a.dialect==="sqlite"&&(n=new chunk6YS6XLOD_cjs.hb({db:a.rawClient||a.client}));else if(o&&!globalThis.DB){let s=process.env.KYRO_AUTH_DB_PATH||"./data/auth.db";n=new chunkEQN3HDES_cjs.a({path:s});}else c&&(n=new chunkJ6V573PE_cjs.a({adapter:a}));if(n?.connect)try{await n.connect();}catch(s){chunk3CIMGC2F_cjs.K.warn("Auth connect warning:",s);}try{await exports.a.loadSettings();}catch(s){chunk3CIMGC2F_cjs.K.warn("loadSettings warning:",s);}try{await chunkEW424IBO_cjs.e(n);}catch(s){chunk3CIMGC2F_cjs.K.warn("autoBootstrap warning:",s);}globalThis.__KYRO_INSTANCE__=exports.a;}catch(e){throw exports.a=null,l=null,chunk3CIMGC2F_cjs.K.error("Init failed, will retry:",e),e}}}async function E(e){let t=globalThis.DB?globalThis:null;try{let{env:o}=await import('cloudflare:workers');o&&(t=o);}catch{}if(e)try{t=e.locals?.cfContext?.env||e?.env||t;}catch{}if(!t)try{t=process.env;}catch{}t?.DB&&(globalThis.DB=t.DB),t?.STORAGE_BUCKET&&(globalThis.STORAGE_BUCKET=t.STORAGE_BUCKET),l||(l=b()),await l;}var _={graphqlEnabled:false,trpcEnabled:false,wsEnabled:false,requireAuth:false};function T(e){return exports.a?exports.a.settings?.access?.apiAccess?.[e]??_[e]??true:_[e]??true}var R=async e=>{if(!exports.a)try{await Promise.race([E(e),new Promise((t,o)=>setTimeout(()=>o(new Error("Initialization timeout")),3e4))]);}catch(t){return console.error("[Kyro API] Warm error:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Service Unavailable",message:"Kyro CMS is still starting up. Please try again in a moment."}),{status:503,headers:{"Content-Type":"application/json","Retry-After":"5"}})}try{let o=new URL(e.request.url).pathname,a=__KYRO_API_PATH__;if(o===`${a}/graphql`&&typeof exports.a.getGraphQL=="function"){if(!T("graphqlEnabled"))return new Response(JSON.stringify({error:"GraphQL is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await exports.a.getGraphQL().fetch(e.request,e.locals);return new Response(n.body,n)}if(o.startsWith(`${a}/trpc/`)&&typeof exports.a.getTRPC=="function"){if(!T("trpcEnabled"))return new Response(JSON.stringify({error:"tRPC is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await exports.a.getTRPC().fetch(e.request,e.locals);return new Response(n.body,n)}return await(await exports.a.getREST()).fetch(e.request,e.locals)}catch(t){return console.error("[Kyro API Execution Error]:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Internal Server Error",message:t?.message||String(t),stack:t?.stack}),{status:500,headers:{"Content-Type":"application/json"}})}},L=R;exports.b=E;exports.c=R;exports.d=L;
@@ -1,15 +0,0 @@
1
- 'use strict';var chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs'),crypto$1=require('crypto'),fs=require('fs'),stream=require('stream');chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var H=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]";var A=(e,t=0,r=e.byteLength-t)=>{if(!H(e))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return Buffer.from(e,t,r)},M=(e,t)=>{if(typeof e!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?Buffer.from(e,t):Buffer.from(e)};var B=e=>{let t=M(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)};chunkBUNLC3II_cjs.h();var oe=e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return A(e.buffer,e.byteOffset,e.byteLength).toString("utf8")};chunkBUNLC3II_cjs.h();var se={},J={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),se[e]=t,J[t]=e;}function Ie(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){let n=e.slice(r,r+2).toLowerCase();if(n in J)t[r/2]=J[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return t}function W(e){let t="";for(let r=0;r<e.byteLength;r++)t+=se[e[r]];return t}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var De=/^[A-Za-z0-9+/]*={0,2}$/,ie=e=>{if(e.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!De.exec(e))throw new TypeError("Invalid base64 string.");let t=M(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};chunkBUNLC3II_cjs.h();var U=e=>{let t;if(typeof e=="string"?t=B(e):t=e,typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return A(t.buffer,t.byteOffset,t.byteLength).toString("base64")};chunkBUNLC3II_cjs.h();function ae(e,t,r,n){return class F extends Uint8Array{static fromString(s,a="utf-8"){if(typeof s=="string")return a==="base64"?F.mutate(n(s)):F.mutate(t(s));throw new Error(`Unsupported conversion from ${typeof s} to Uint8ArrayBlobAdapter.`)}static mutate(s){return Object.setPrototypeOf(s,F.prototype),s}transformToString(s="utf-8"){return s==="base64"?r(this):e(this)}}}chunkBUNLC3II_cjs.h();var y=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function fe(e){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?()=>crypto.randomUUID():()=>{let t=new Uint8Array(16);return e(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128,y[t[0]]+y[t[1]]+y[t[2]]+y[t[3]]+"-"+y[t[4]]+y[t[5]]+"-"+y[t[6]]+y[t[7]]+"-"+y[t[8]]+y[t[9]]+"-"+y[t[10]]+y[t[11]]+y[t[12]]+y[t[13]]+y[t[14]]+y[t[15]]}}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var z=e=>{if(e!=null){if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&We.warn(Je(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},_e=Math.ceil(34028234663852886e22),ce=e=>{let t=z(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>_e)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},ke=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}};var ue=e=>pe(e,16),de=e=>pe(e,8),pe=(e,t)=>{let r=ke(e);if(r!==void 0&&Pe(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},Pe=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}};var me=e=>z(typeof e=="string"?O(e):e);var he=e=>ce(typeof e=="string"?O(e):e),He=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,O=e=>{let t=e.match(He);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)};var R=e=>ue(typeof e=="string"?O(e):e),ye=e=>de(typeof e=="string"?O(e):e),Je=e=>String(new TypeError(e).stack||e).split(`
2
- `).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(`
3
- `),We={warn:console.warn};var ze=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function je(e){let t=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),o=e.getUTCDate(),s=e.getUTCHours(),a=e.getUTCMinutes(),f=e.getUTCSeconds(),c=o<10?`0${o}`:`${o}`,u=s<10?`0${s}`:`${s}`,p=a<10?`0${a}`:`${a}`,m=f<10?`0${f}`:`${f}`;return `${ze[n]}, ${c} ${q[r]} ${t} ${u}:${p}:${m} GMT`}var qe=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Ye=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=qe.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,n,o,s,a,f,c,u]=t,p=R(N(n)),m=g(o,"month",1,12),h=g(s,"day",1,31);return C(p,m,h,{hours:a,minutes:f,seconds:c,fractionalMilliseconds:u})},Ve=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}:\d{2})|[zZ])$/),Ge=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let t=Ve.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");let[r,n,o,s,a,f,c,u,p]=t,m=R(N(n)),h=g(o,"month",1,12),l=g(s,"day",1,31),w=C(m,h,l,{hours:a,minutes:f,seconds:c,fractionalMilliseconds:u});return p.toUpperCase()!="Z"&&w.setTime(w.getTime()-at(p)),w},Xe=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Ze=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Ke=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),Qe=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=Xe.exec(e);if(t){let[r,n,o,s,a,f,c,u]=t;return C(R(N(s)),j(o),g(n,"day",1,31),{hours:a,minutes:f,seconds:c,fractionalMilliseconds:u})}if(t=Ze.exec(e),t){let[r,n,o,s,a,f,c,u]=t;return rt(C(et(s),j(o),g(n,"day",1,31),{hours:a,minutes:f,seconds:c,fractionalMilliseconds:u}))}if(t=Ke.exec(e),t){let[r,n,o,s,a,f,c,u]=t;return C(R(N(u)),j(n),g(o.trimLeft(),"day",1,31),{hours:s,minutes:a,seconds:f,fractionalMilliseconds:c})}throw new TypeError("Invalid RFC-7231 date-time value")},ve=e=>{if(e==null)return;let t;if(typeof e=="number")t=e;else if(typeof e=="string")t=me(e);else if(typeof e=="object"&&e.tag===1)t=e.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1e3))},C=(e,t,r,n)=>{let o=t-1;return ot(e,o,r),new Date(Date.UTC(e,o,r,g(n.hours,"hour",0,23),g(n.minutes,"minute",0,59),g(n.seconds,"seconds",0,60),it(n.fractionalMilliseconds)))},et=e=>{let t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+R(N(e));return r<t?r+100:r},tt=50*365*24*60*60*1e3,rt=e=>e.getTime()-new Date().getTime()>tt?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,j=e=>{let t=q.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},nt=[31,28,31,30,31,30,31,31,30,31,30,31],ot=(e,t,r)=>{let n=nt[t];if(t===1&&st(e)&&(n=29),r>n)throw new TypeError(`Invalid day for ${q[t]} in ${e}: ${r}`)},st=e=>e%4===0&&(e%100!==0||e%400===0),g=(e,t,r,n)=>{let o=ye(N(e));if(o<r||o>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return o},it=e=>e==null?0:he("0."+e)*1e3,at=e=>{let t=e[0],r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);let n=Number(e.substring(1,3)),o=Number(e.substring(4,6));return r*(n*60+o)*60*1e3},N=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)};chunkBUNLC3II_cjs.h();var E=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};E.from=e=>e&&typeof e=="object"&&(e instanceof E||"deserializeJSON"in e)?e:typeof e=="string"||Object.getPrototypeOf(e)===String.prototype?E(String(e)):E(JSON.stringify(e));E.fromObject=E.from;chunkBUNLC3II_cjs.h();function ft(e){return (e.includes(",")||e.includes('"'))&&(e=`"${e.replace(/"/g,'\\"')}"`),e}chunkBUNLC3II_cjs.h();var Y="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",V="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",G="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",le="(\\d?\\d)",be="(\\d{4})",ct=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),ut=new RegExp(`^${Y}, ${le} ${V} ${be} ${G} GMT$`),dt=new RegExp(`^${Y}, ${le}-${V}-(\\d\\d) ${G} GMT$`),pt=new RegExp(`^${Y} ${V} ( [1-9]|\\d\\d) ${G} ${be}$`),mt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ht=e=>{if(e==null)return;let t=NaN;if(typeof e=="number")t=e;else if(typeof e=="string"){if(!/^-?\d*\.?\d+$/.test(e))throw new TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e);}else typeof e=="object"&&e.tag===1&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1e3))},yt=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC3339 timestamps must be strings");let t=ct.exec(e);if(!t)throw new TypeError(`Invalid RFC3339 timestamp format ${e}`);let[,r,n,o,s,a,f,,c,u]=t;x(n,1,12),x(o,1,31),x(s,0,23),x(a,0,59),x(f,0,60);let p=new Date(Date.UTC(Number(r),Number(n)-1,Number(o),Number(s),Number(a),Number(f),Number(c)?Math.round(parseFloat(`0.${c}`)*1e3):0));if(p.setUTCFullYear(Number(r)),u.toUpperCase()!="Z"){let[,m,h,l]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],w=m==="-"?1:-1;p.setTime(p.getTime()+w*(Number(h)*60*60*1e3+Number(l)*60*1e3));}return p},lt=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC7231 timestamps must be strings.");let t,r,n,o,s,a,f,c;if((c=ut.exec(e))?[,t,r,n,o,s,a,f]=c:(c=dt.exec(e))?([,t,r,n,o,s,a,f]=c,n=(Number(n)+1900).toString()):(c=pt.exec(e))&&([,r,t,o,s,a,f,n]=c),n&&a){let u=Date.UTC(Number(n),mt.indexOf(r),Number(t),Number(o),Number(s),Number(a),f?Math.round(parseFloat(`0.${f}`)*1e3):0);x(t,1,31),x(o,0,23),x(s,0,59),x(a,0,60);let p=new Date(u);return p.setUTCFullYear(Number(n)),p}throw new TypeError(`Invalid RFC7231 date-time value ${e}.`)};function x(e,t,r){let n=Number(e);if(n<t||n>r)throw new Error(`Value ${n} out of range [${t}, ${r}]`)}chunkBUNLC3II_cjs.h();function bt(e,t,r){if(r<=0||!Number.isInteger(r))throw new Error("Invalid number of delimiters ("+r+") for splitEvery.");let n=e.split(t);if(r===1)return n;let o=[],s="";for(let a=0;a<n.length;a++)s===""?s=n[a]:s+=t+n[a],(a+1)%r===0&&(o.push(s),s="");return s!==""&&o.push(s),o}chunkBUNLC3II_cjs.h();var gt=e=>{let t=e.length,r=[],n=false,o,s=0;for(let a=0;a<t;++a){let f=e[a];switch(f){case '"':o!=="\\"&&(n=!n);break;case ",":n||(r.push(e.slice(s,a)),s=a+1);break;}o=f;}return r.push(e.slice(s)),r.map(a=>{a=a.trim();let f=a.length;return f<2?a:(a[0]==='"'&&a[f-1]==='"'&&(a=a.slice(1,f-1)),a.replace(/\\"/g,'"'))})};chunkBUNLC3II_cjs.h();var ge=/^-?\d*(\.\d+)?$/,X=class e{string;type;constructor(t,r){if(this.string=t,this.type=r,!ge.test(t))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](t){if(!t||typeof t!="object")return false;let r=t;return e.prototype.isPrototypeOf(t)||r.type==="bigDecimal"&&ge.test(r.string)}};chunkBUNLC3II_cjs.h();var Et=e=>{if(!e)return 0;if(typeof e=="string")return Buffer.byteLength(e);if(typeof e.byteLength=="number")return e.byteLength;if(typeof e.size=="number")return e.size;if(typeof e.start=="number"&&typeof e.end=="number")return e.end+1-e.start;if(e instanceof fs.ReadStream){if(e.path!=null)return fs.lstatSync(e.path).size;if(typeof e.fd=="number")return fs.fstatSync(e.fd).size}throw new Error(`Body Length computation failed for ${e}`)};chunkBUNLC3II_cjs.h();var Tt=e=>e instanceof Uint8Array?e:typeof e=="string"?B(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e);chunkBUNLC3II_cjs.h();function L(e,t){if(t===void 0){t=0;for(let o of e)t+=o.byteLength;}let r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.byteLength;return r}chunkBUNLC3II_cjs.h();var I=class extends stream.Readable{expectedChecksum;checksumSourceLocation;checksum;source;base64Encoder;constructor({expectedChecksum:t,checksum:r,source:n,checksumSourceLocation:o,base64Encoder:s}){if(super(),typeof n.pipe!="function")throw new Error(`@smithy/util-stream: unsupported source type ${n?.constructor?.name??n} in ChecksumStream.`);this.source=n,this.base64Encoder=s??U,this.expectedChecksum=t,this.checksum=r,this.checksumSourceLocation=o,this.source.on("data",this.onSourceData),this.source.on("end",this.onSourceEnd),this.source.on("error",this.onSourceError),this.source.on("close",this.onSourceClose),this.source.pause();}onSourceData=t=>{if(!this.destroyed){try{this.checksum.update(t);}catch(r){this.destroy(r);return}this.push(t)||this.source.pause();}};onSourceEnd=async()=>{if(!this.destroyed){try{let t=await this.checksum.digest(),r=this.base64Encoder(t);if(this.expectedChecksum!==r){this.destroy(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${r}" in response header "${this.checksumSourceLocation}".`));return}}catch(t){this.destroy(t);return}this.push(null);}};onSourceError=t=>{this.destroy(t);};onSourceClose=()=>{!this.destroyed&&!this.source.readableEnded&&this.destroy(new Error("Connection lost or stream closed before all data was received."));};_read(t){this.source.resume();}_destroy(t,r){this.source?.removeListener("data",this.onSourceData),this.source?.removeListener("end",this.onSourceEnd),this.source?.removeListener("error",this.onSourceError),this.source?.removeListener("close",this.onSourceClose),this.source?.destroy(),r(t);}};chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var b=e=>typeof ReadableStream=="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),D=e=>typeof Blob=="function"&&(e?.constructor?.name===Blob.name||e instanceof Blob);chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var we=e=>new TextEncoder().encode(e);chunkBUNLC3II_cjs.h();var xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";Object.entries(xe).reduce((e,[t,r])=>(e[r]=Number(t),e),{});var Se=xe.split(""),_=6,Z=8,Ee=63;function k(e){let t;typeof e=="string"?t=we(e):t=e;let r=typeof t=="object"&&typeof t.length=="number",n=typeof t=="object"&&typeof t.byteOffset=="number"&&typeof t.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let o="";for(let s=0;s<t.length;s+=3){let a=0,f=0;for(let u=s,p=Math.min(s+3,t.length);u<p;u++)a|=t[u]<<(p-u-1)*Z,f+=Z;let c=Math.ceil(f/_);a<<=c*_-f;for(let u=1;u<=c;u++){let p=(c-u)*_;o+=Se[(a&Ee<<p)>>p];}o+="==".slice(0,4-c);}return o}chunkBUNLC3II_cjs.h();var At=typeof ReadableStream=="function"?ReadableStream:function(){},P=class extends At{};var Te=({expectedChecksum:e,checksum:t,source:r,checksumSourceLocation:n,base64Encoder:o})=>{if(!b(r))throw new Error(`@smithy/util-stream: unsupported source type ${r?.constructor?.name??r} in ChecksumStream.`);let s=o??k;if(typeof TransformStream!="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let a=new TransformStream({start(){},async transform(c,u){t.update(c),u.enqueue(c);},async flush(c){let u=await t.digest(),p=s(u);if(e!==p){let m=new Error(`Checksum mismatch: expected "${e}" but received "${p}" in response header "${n}".`);c.error(m);}else c.terminate();}});r.pipeThrough(a);let f=a.readable;return Object.setPrototypeOf(f,P.prototype),f};function Bt(e){return typeof ReadableStream=="function"&&b(e.source)?Te(e):new I(e)}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var T=class{allocByteArray;byteLength=0;byteArrays=[];constructor(t){this.allocByteArray=t;}push(t){this.byteArrays.push(t),this.byteLength+=t.byteLength;}flush(){if(this.byteArrays.length===1){let n=this.byteArrays[0];return this.reset(),n}let t=this.allocByteArray(this.byteLength),r=0;for(let n=0;n<this.byteArrays.length;++n){let o=this.byteArrays[n];t.set(o,r),r+=o.byteLength;}return this.reset(),t}reset(){this.byteArrays=[],this.byteLength=0;}};chunkBUNLC3II_cjs.h();function $e(e,t,r){let n=e.getReader(),o=false,s=0,a=["",new T(u=>new Uint8Array(u))],f=-1,c=async u=>{let{value:p,done:m}=await n.read(),h=p;if(m){if(f!==-1){let l=$(a,f);S(l)>0&&u.enqueue(l);}u.close();}else {let l=Q(h,false);if(f!==l&&(f>=0&&u.enqueue($(a,f)),f=l),f===-1){u.enqueue(h);return}let w=S(h);s+=w;let Oe=S(a[f]);if(w>=t&&Oe===0)u.enqueue(h);else {let Le=K(a,f,h);!o&&s>t*2&&(o=true,r?.warn(`@smithy/util-stream - stream chunk size ${w} is below threshold of ${t}, automatically buffering.`)),Le>=t?u.enqueue($(a,f)):await c(u);}}};return new ReadableStream({pull:c})}function K(e,t,r){switch(t){case 0:return e[0]+=r,S(e[0]);case 1:case 2:return e[t].push(r),S(e[t])}}function $(e,t){switch(t){case 0:let r=e[0];return e[0]="",r;case 1:case 2:return e[t].flush()}throw new Error(`@smithy/util-stream - invalid index ${t} given to flush()`)}function S(e){return e?.byteLength??e?.length??0}function Q(e,t=true){return t&&typeof Buffer<"u"&&e instanceof Buffer?2:e instanceof Uint8Array?1:typeof e=="string"?0:-1}function Nt(e,t,r){if(b(e))return $e(e,t,r);let n=new stream.Readable({read(){}}),o=false,s=0,a=["",new T(c=>new Uint8Array(c)),new T(c=>Buffer.from(new Uint8Array(c)))],f=-1;return e.on("data",c=>{let u=Q(c,true);if(f!==u&&(f>=0&&n.push($(a,f)),f=u),f===-1){n.push(c);return}let p=S(c);s+=p;let m=S(a[f]);if(p>=t&&m===0)n.push(c);else {let h=K(a,f,c);!o&&s>t*2&&(o=true,r?.warn(`@smithy/util-stream - stream chunk size ${p} is below threshold of ${t}, automatically buffering.`)),h>=t&&n.push($(a,f));}}),e.on("end",()=>{if(f!==-1){let c=$(a,f);S(c)>0&&n.push(c);}n.push(null);}),n}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Ae=(e,t)=>{let{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:o,checksumLocationName:s,streamHasher:a}=t,f=r!==void 0&&n!==void 0&&o!==void 0&&s!==void 0&&a!==void 0,c=f?a(o,e):void 0,u=e.getReader();return new ReadableStream({async pull(p){let{value:m,done:h}=await u.read();if(h){if(p.enqueue(`0\r
4
- `),f){let l=r(await c);p.enqueue(`${s}:${l}\r
5
- `),p.enqueue(`\r
6
- `);}p.close();}else p.enqueue(`${(n(m)||0).toString(16)}\r
7
- ${m}\r
8
- `);}})};function Mt(e,t){let r=e,n=e;if(b(n))return Ae(n,t);let{base64Encoder:o,bodyLengthChecker:s,checksumAlgorithmFn:a,checksumLocationName:f,streamHasher:c}=t,u=o!==void 0&&a!==void 0&&f!==void 0&&c!==void 0,p=u?c(a,r):void 0,m=new stream.Readable({read:()=>{}});return r.on("data",h=>{let l=s(h)||0;l!==0&&(m.push(`${l.toString(16)}\r
9
- `),m.push(h),m.push(`\r
10
- `));}),r.on("end",async()=>{if(m.push(`0\r
11
- `),u){let h=o(await p);m.push(`${f}:${h}\r
12
- `),m.push(`\r
13
- `);}m.push(null);}),m}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var Be=e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};chunkBUNLC3II_cjs.h();var Re=async e=>D(e)?v(e):ee(e);async function v(e){return e.arrayBuffer().then(t=>new Uint8Array(t))}async function ee(e){let t=[],r=e.getReader(),n=0;for(;;){let{done:o,value:s}=await r.read();if(s&&(t.push(s),n+=s.length),o)break}return L(t,n)}var Ne="The stream has already been transformed.",Me=e=>{if(!Ce(e)&&!b(e)){let o=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let t=false,r=async()=>{if(t)throw new Error(Ne);return t=true,await Re(e)},n=o=>{if(typeof o.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
14
- If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return o.stream()};return Object.assign(e,{transformToByteArray:r,transformToString:async o=>{let s=await r();if(o==="base64")return k(s);if(o==="hex")return W(s);if(o===void 0||o==="utf8"||o==="utf-8")return Be(s);if(typeof TextDecoder=="function")return new TextDecoder(o).decode(s);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw new Error(Ne);if(t=true,Ce(e))return n(e);if(b(e))return e;throw new Error(`Cannot transform payload to web stream, got ${e}`)}})},Ce=e=>typeof Blob=="function"&&e instanceof Blob;chunkBUNLC3II_cjs.h();var re=e=>D(e)?v(e):b(e)?ee(e):new Promise((t,r)=>{let n=new te,o=e;o.pipe(n),o.on("error",s=>{n.end(),r(s);}),n.on("error",r),n.on("finish",function(){let s=L(this.bufferedBytes);t(s);});}),te=class extends stream.Writable{bufferedBytes=[];_write(t,r,n){this.bufferedBytes.push(t),n();}};var Ue="The stream has already been transformed.",Ft=e=>{if(!(e instanceof stream.Readable))try{return Me(e)}catch{let o=e?.__proto__?.constructor?.name||e;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${o}`)}let t=false,r=async()=>{if(t)throw new Error(Ue);return t=true,await re(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async n=>{let o=await r();return n===void 0||Buffer.isEncoding(n)?A(o.buffer,o.byteOffset,o.byteLength).toString(n):new TextDecoder(n).decode(o)},transformToWebStream:()=>{if(t)throw new Error(Ue);if(e.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof stream.Readable.toWeb!="function")throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=true,stream.Readable.toWeb(e)}})};var Fe=class extends ae(oe,B,U,ie){},Lt=crypto$1.getRandomValues,It=fe(Lt),ro=It;
15
- exports.A=Ft;exports.B=Fe;exports.C=It;exports.D=ro;exports.a=H;exports.b=ie;exports.c=B;exports.d=U;exports.e=oe;exports.f=je;exports.g=Ye;exports.h=Ge;exports.i=Qe;exports.j=ve;exports.k=E;exports.l=ft;exports.m=ht;exports.n=yt;exports.o=lt;exports.p=bt;exports.q=gt;exports.r=X;exports.s=Ie;exports.t=W;exports.u=Et;exports.v=Tt;exports.w=Bt;exports.x=Nt;exports.y=Mt;exports.z=re;
@@ -1,4 +0,0 @@
1
- import {V as V$1,f}from'./chunk-JRUQ5ABB.js';import {g}from'./chunk-Y2YAKDEQ.js';import x from'https';import {Readable}from'stream';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g();g();function I(o){let e=o&&typeof o=="object"&&"reason"in o?o.reason:void 0;if(e){if(e instanceof Error){let n=new Error("Request aborted");return n.name="AbortError",n.cause=e,n}let r=new Error(String(e));return r.name="AbortError",r}let t=new Error("Request aborted");return t.name="AbortError",t}g();var B=["ECONNRESET","EPIPE","ETIMEDOUT"];g();var $=o=>{let e={};for(let t in o){let r=o[t];e[t]=Array.isArray(r)?r.join(","):r;}return e};g();g();g();var a={setTimeout:(o,e)=>setTimeout(o,e),clearTimeout:o=>clearTimeout(o)};var j=1e3,W=(o,e,t=0)=>{if(!t)return -1;let r=n=>{let c=a.setTimeout(()=>{o.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${t} ms.`),{name:"TimeoutError"}));},t-n),i=u=>{u?.connecting?u.on("connect",()=>{a.clearTimeout(c);}):a.clearTimeout(c);};o.socket?i(o.socket):o.on("socket",i);};return t<2e3?(r(0),0):a.setTimeout(r.bind(null,j),j)};g();var F=(o,e,t=0,r,n)=>t?a.setTimeout(()=>{let c=`@smithy/node-http-handler - [${r?"ERROR":"WARN"}] a request has exceeded the configured ${t} ms requestTimeout.`;if(r){let i=Object.assign(new Error(c),{name:"TimeoutError",code:"ETIMEDOUT"});o.destroy(i),e(i);}else c+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",n?.warn?.(c);},t):-1;g();var X=3e3,K=(o,{keepAlive:e,keepAliveMsecs:t},r=X)=>{if(e!==true)return -1;let n=()=>{o.socket?o.socket.setKeepAlive(e,t||0):o.on("socket",c=>{c.setKeepAlive(e,t||0);});};return r===0?(n(),0):a.setTimeout(n,r)};g();var M=3e3,V=(o,e,t=0)=>{let r=n=>{let c=t-n,i=()=>{o.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${t} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}));};o.socket?(o.socket.setTimeout(c,i),o.on("close",()=>o.socket?.removeListener("timeout",i))):o.setTimeout(c,i);};return 0<t&&t<6e3?(r(0),0):a.setTimeout(r.bind(null,t===0?0:M),M)};g();var Q=6e3;async function J(o,e,t=Q,r=false){let n=e.headers,c=n?n.Expect||n.expect:void 0,i=-1,u=true;!r&&c==="100-continue"&&(u=await Promise.race([new Promise(m=>{i=Number(a.setTimeout(()=>m(true),Math.max(Q,t)));}),new Promise(m=>{o.on("continue",()=>{a.clearTimeout(i),m(true);}),o.on("response",()=>{a.clearTimeout(i),m(false);}),o.on("error",()=>{a.clearTimeout(i),m(false);});})])),u&&Z(o,e.body);}function Z(o,e){if(e instanceof Readable){e.pipe(o);return}if(e){let t=Buffer.isBuffer(e);if(t||typeof e=="string"){t&&e.byteLength===0?o.end():o.end(e);return}let n=e;if(typeof n=="object"&&n.buffer&&typeof n.byteOffset=="number"&&typeof n.byteLength=="number"){o.end(Buffer.from(n.buffer,n.byteOffset,n.byteLength));return}o.end(Buffer.from(e));return}o.end();}var R,q,D=class o{config;configProvider;socketWarningTimestamp=0;externalAgent=false;metadata={handlerProtocol:"http/1.1"};static create(e){return typeof e?.handle=="function"?e:new o(e)}static checkSocketUsage(e,t,r=console){let{sockets:n,requests:c,maxSockets:i}=e;if(typeof i!="number"||i===1/0||Date.now()-15e3<t)return t;if(n&&c)for(let m in n){let T=n[m]?.length??0,h=c[m]?.length??0;if(T>=i&&h>=2*i)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${T} and ${h} additional requests are enqueued.
3
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
4
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,r)=>{typeof e=="function"?e().then(n=>{t(this.resolveDefaultConfig(n));}).catch(r):t(this.resolveDefaultConfig(e));});}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy();}async handle(e,{abortSignal:t,requestTimeout:r}={}){this.config||(this.config=await this.configProvider);let n=this.config,c=e.protocol==="https:";return !c&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((i,u)=>{let m,T=-1,h=-1,A=-1,y=-1,v=-1,k=()=>{a.clearTimeout(T),a.clearTimeout(h),a.clearTimeout(A),a.clearTimeout(y),a.clearTimeout(v);},z=async f=>{await m,k(),i(f);},E=async f=>{await m,k(),u(f);};if(t?.aborted){let f=I(t);E(f);return}let _=e.headers,G=_?(_.Expect??_.expect)==="100-continue":false,O=c?n.httpsAgent:n.httpAgent;G&&!this.externalAgent&&(O=new(c?x.Agent:R)({keepAlive:false,maxSockets:1/0})),T=a.setTimeout(()=>{this.socketWarningTimestamp=o.checkSocketUsage(O,this.socketWarningTimestamp,n.logger);},n.socketAcquisitionWarningTimeout??(n.requestTimeout??2e3)+(n.connectionTimeout??1e3));let N=e.query?V$1(e.query):"",P;if(e.username!=null||e.password!=null){let f=e.username??"",g=e.password??"";P=`${f}:${g}`;}let S=e.path;N&&(S+=`?${N}`),e.fragment&&(S+=`#${e.fragment}`);let w=e.hostname??"";w[0]==="["&&w.endsWith("]")?w=e.hostname.slice(1,-1):w=e.hostname;let C={headers:e.headers,host:w,method:e.method,path:S,port:e.port,agent:O,auth:P},p=(c?x.request:q)(C,f$1=>{let g=new f({statusCode:f$1.statusCode||-1,reason:f$1.statusMessage,headers:$(f$1.headers),body:f$1});z({response:g});});if(p.on("error",f=>{B.includes(f.code)?E(Object.assign(f,{name:"TimeoutError"})):E(f);}),t){let f=()=>{p.destroy();let g=I(t);E(g);};if(typeof t.addEventListener=="function"){let g=t;g.addEventListener("abort",f,{once:true}),p.once("close",()=>g.removeEventListener("abort",f));}else t.onabort=f;}let L=r??n.requestTimeout;h=W(p,E,n.connectionTimeout),A=F(p,E,L,n.throwOnRequestTimeout,n.logger??console),y=V(p,E,n.socketTimeout);let b=C.agent;typeof b=="object"&&"keepAlive"in b&&(v=K(p,{keepAlive:b.keepAlive,keepAliveMsecs:b.keepAliveMsecs})),m=J(p,e,L,this.externalAgent).catch(f=>(k(),u(f)));})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(r=>({...r,[e]:t}));}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:r,socketTimeout:n,socketAcquisitionWarningTimeout:c,httpAgent:i,httpsAgent:u,throwOnRequestTimeout:m,logger:T}=e||{},h=true,A=50;return {connectionTimeout:r,requestTimeout:t,socketTimeout:n,socketAcquisitionWarningTimeout:c,throwOnRequestTimeout:m,httpAgentProvider:async()=>{let y=await import('http'),{Agent:v,request:k}=y.default??y;return q=k,R=v,i instanceof R||typeof i?.destroy=="function"?(this.externalAgent=true,i):new R({keepAlive:h,maxSockets:A,...i})},httpsAgent:u instanceof x.Agent||typeof u?.destroy=="function"?(this.externalAgent=true,u):new x.Agent({keepAlive:h,maxSockets:A,...u}),logger:T}}};g();export{D as a};
@@ -1,3 +0,0 @@
1
- import {g}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
2
- g();var t=[{name:"uploadDir",type:"text",label:"Upload Directory",defaultValue:"./public/uploads"},{name:"baseUrl",type:"text",label:"Base URL",defaultValue:"/uploads"}],i=[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"us-east-1",admin:{placeholder:"us-east-1"}},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"endpoint",type:"text",label:"Endpoint URL",admin:{placeholder:"https://s3.custom.com"}},{name:"cdnUrl",type:"text",label:"CDN URL",admin:{placeholder:"https://cdn.example.com"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads"}}],r=[{name:"accountId",type:"text",label:"Account ID",required:true,admin:{placeholder:"Your Cloudflare Account ID"}},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"publicDevUrl",type:"text",label:"Public Dev URL ID",admin:{placeholder:"pub-xxxxxxxxxxxxxxxx",description:"Enter ONLY the ID (e.g., pub-b8d8c4cc8bcf4d868ddd95efc1b305aa). Do NOT include https:// or the full URL. Found in R2 Dashboard \u2192 Public Dev URL."}},{name:"cdnUrl",type:"text",label:"Custom CDN URL",admin:{placeholder:"https://assets.example.com (optional)"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads (optional)",description:"Optional prefix for all object keys. Do not use '/' as prefix."}}],d=[{name:"cloudName",type:"text",label:"Cloud Name",required:true},{name:"apiKey",type:"text",label:"API Key",required:true},{name:"apiSecret",type:"password",label:"API Secret",required:true},{name:"folder",type:"text",label:"Folder",admin:{placeholder:"Optional folder path"}},{name:"uploadPreset",type:"text",label:"Upload Preset (optional)",admin:{placeholder:"Leave empty for signed uploads",description:"If not set, uploads will be signed with API Secret"}}],o=[{name:"host",type:"text",label:"Host",required:true,admin:{placeholder:"ftp.example.com"}},{name:"port",type:"number",label:"Port",defaultValue:21,admin:{placeholder:"21 for FTP"}},{name:"user",type:"text",label:"Username",required:true},{name:"password",type:"password",label:"Password",required:true},{name:"secure",type:"checkbox",label:"Use TLS/SSL",defaultValue:false,admin:{description:"Enable TLS/SSL for secure connections (FTP only)"}},{name:"baseUrl",type:"text",label:"Base URL",required:true,admin:{placeholder:"https://files.example.com"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads"}}],s=[{name:"note",type:"text",label:"Storage Status",defaultValue:"Cloudflare R2 Native Binding ('STORAGE_BUCKET') active.",admin:{readOnly:true}}],l=[{type:"local",displayName:"Local Server",configFields:t},{type:"cloudflare_r2",displayName:"Cloudflare Native Assets (R2 Binding)",configFields:s},{type:"aws",displayName:"S3 Compatible (AWS, Backblaze, Wasabi, etc.)",configFields:i},{type:"r2",displayName:"Cloudflare R2 (S3 API)",configFields:r},{type:"cloudinary",displayName:"Cloudinary",configFields:d},{type:"ftp",displayName:"FTP",configFields:o}],p=l.map(e=>({label:e.displayName,value:e.type})),n=l.map(e=>({name:e.type,type:"group",label:`${e.displayName} Settings`,admin:{condition:{field:"provider",equals:e.type}},fields:e.configFields})),m={slug:"storage-settings",label:"Storage Settings",admin:{group:"settings"},access:{read:()=>true,update:()=>true},fields:[{name:"provider",type:"select",label:"Storage Provider",defaultValue:"local",options:p},...n,{name:"limits",type:"group",label:"Upload Limits",fields:[{name:"maxFileSize",type:"number",label:"Max File Size (bytes)",defaultValue:10485760},{name:"allowedTypes",type:"json",label:"Allowed MIME Types",defaultValue:["image/*","video/*","audio/*","application/pdf"]},{name:"maxFilesPerUpload",type:"number",label:"Max Files per Upload",defaultValue:10}]}]};
3
- export{m as a};