langgraph-ui-components 0.0.1 → 0.0.2

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 (532) hide show
  1. package/dist/index.es.js +9 -27085
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.es10.js +21 -0
  4. package/dist/index.es10.js.map +1 -0
  5. package/dist/index.es100.js +43 -0
  6. package/dist/index.es100.js.map +1 -0
  7. package/dist/index.es101.js +94 -0
  8. package/dist/index.es101.js.map +1 -0
  9. package/dist/index.es102.js +5 -0
  10. package/dist/index.es102.js.map +1 -0
  11. package/dist/index.es103.js +5 -0
  12. package/dist/index.es103.js.map +1 -0
  13. package/dist/index.es104.js +25 -0
  14. package/dist/index.es104.js.map +1 -0
  15. package/dist/index.es105.js +5 -0
  16. package/dist/index.es105.js.map +1 -0
  17. package/dist/index.es106.js +28 -0
  18. package/dist/index.es106.js.map +1 -0
  19. package/dist/index.es107.js +8 -0
  20. package/dist/index.es107.js.map +1 -0
  21. package/dist/index.es108.js +3 -0
  22. package/dist/index.es108.js.map +1 -0
  23. package/dist/index.es109.js +14 -0
  24. package/dist/index.es109.js.map +1 -0
  25. package/dist/index.es11.js +125 -0
  26. package/dist/index.es11.js.map +1 -0
  27. package/dist/index.es110.js +504 -0
  28. package/dist/index.es110.js.map +1 -0
  29. package/dist/index.es111.js +3 -0
  30. package/dist/index.es111.js.map +1 -0
  31. package/dist/index.es112.js +149 -0
  32. package/dist/index.es112.js.map +1 -0
  33. package/dist/index.es113.js +889 -0
  34. package/dist/index.es113.js.map +1 -0
  35. package/dist/index.es114.js +283 -0
  36. package/dist/index.es114.js.map +1 -0
  37. package/dist/index.es115.js +5 -0
  38. package/dist/index.es115.js.map +1 -0
  39. package/dist/index.es116.js +447 -0
  40. package/dist/index.es116.js.map +1 -0
  41. package/dist/index.es117.js +49 -0
  42. package/dist/index.es117.js.map +1 -0
  43. package/dist/index.es118.js +25 -0
  44. package/dist/index.es118.js.map +1 -0
  45. package/dist/index.es119.js +82 -0
  46. package/dist/index.es119.js.map +1 -0
  47. package/dist/index.es12.js +104 -0
  48. package/dist/index.es12.js.map +1 -0
  49. package/dist/index.es120.js +132 -0
  50. package/dist/index.es120.js.map +1 -0
  51. package/dist/index.es121.js +52 -0
  52. package/dist/index.es121.js.map +1 -0
  53. package/dist/index.es122.js +13 -0
  54. package/dist/index.es122.js.map +1 -0
  55. package/dist/index.es123.js +48 -0
  56. package/dist/index.es123.js.map +1 -0
  57. package/dist/index.es124.js +102 -0
  58. package/dist/index.es124.js.map +1 -0
  59. package/dist/index.es125.js +56 -0
  60. package/dist/index.es125.js.map +1 -0
  61. package/dist/index.es126.js +5 -0
  62. package/dist/index.es126.js.map +1 -0
  63. package/dist/index.es127.js +140 -0
  64. package/dist/index.es127.js.map +1 -0
  65. package/dist/index.es128.js +5 -0
  66. package/dist/index.es128.js.map +1 -0
  67. package/dist/index.es129.js +18 -0
  68. package/dist/index.es129.js.map +1 -0
  69. package/dist/index.es13.js +37 -0
  70. package/dist/index.es13.js.map +1 -0
  71. package/dist/index.es130.js +92 -0
  72. package/dist/index.es130.js.map +1 -0
  73. package/dist/index.es131.js +5 -0
  74. package/dist/index.es131.js.map +1 -0
  75. package/dist/index.es132.js +59 -0
  76. package/dist/index.es132.js.map +1 -0
  77. package/dist/index.es133.js +103 -0
  78. package/dist/index.es133.js.map +1 -0
  79. package/dist/index.es134.js +194 -0
  80. package/dist/index.es134.js.map +1 -0
  81. package/dist/index.es135.js +113 -0
  82. package/dist/index.es135.js.map +1 -0
  83. package/dist/index.es136.js +38 -0
  84. package/dist/index.es136.js.map +1 -0
  85. package/dist/index.es137.js +13 -0
  86. package/dist/index.es137.js.map +1 -0
  87. package/dist/index.es138.js +14 -0
  88. package/dist/index.es138.js.map +1 -0
  89. package/dist/index.es139.js +15 -0
  90. package/dist/index.es139.js.map +1 -0
  91. package/dist/index.es14.js +148 -0
  92. package/dist/index.es14.js.map +1 -0
  93. package/dist/index.es140.js +94 -0
  94. package/dist/index.es140.js.map +1 -0
  95. package/dist/index.es141.js +38 -0
  96. package/dist/index.es141.js.map +1 -0
  97. package/dist/index.es142.js +43 -0
  98. package/dist/index.es142.js.map +1 -0
  99. package/dist/index.es143.js +27 -0
  100. package/dist/index.es143.js.map +1 -0
  101. package/dist/index.es144.js +594 -0
  102. package/dist/index.es144.js.map +1 -0
  103. package/dist/index.es145.js +128 -0
  104. package/dist/index.es145.js.map +1 -0
  105. package/dist/index.es146.js +7 -0
  106. package/dist/index.es146.js.map +1 -0
  107. package/dist/index.es147.js +8 -0
  108. package/dist/index.es147.js.map +1 -0
  109. package/dist/index.es148.js +16 -0
  110. package/dist/index.es148.js.map +1 -0
  111. package/dist/index.es149.js +9 -0
  112. package/dist/index.es149.js.map +1 -0
  113. package/dist/index.es15.js +15 -0
  114. package/dist/index.es15.js.map +1 -0
  115. package/dist/index.es150.js +11 -0
  116. package/dist/index.es150.js.map +1 -0
  117. package/dist/index.es151.js +28 -0
  118. package/dist/index.es151.js.map +1 -0
  119. package/dist/index.es152.js +15 -0
  120. package/dist/index.es152.js.map +1 -0
  121. package/dist/index.es153.js +57 -0
  122. package/dist/index.es153.js.map +1 -0
  123. package/dist/index.es154.js +67 -0
  124. package/dist/index.es154.js.map +1 -0
  125. package/dist/index.es155.js +25 -0
  126. package/dist/index.es155.js.map +1 -0
  127. package/dist/index.es156.js +9 -0
  128. package/dist/index.es156.js.map +1 -0
  129. package/dist/index.es157.js +352 -0
  130. package/dist/index.es157.js.map +1 -0
  131. package/dist/index.es158.js +10 -0
  132. package/dist/index.es158.js.map +1 -0
  133. package/dist/index.es159.js +106 -0
  134. package/dist/index.es159.js.map +1 -0
  135. package/dist/index.es16.js +8 -0
  136. package/dist/index.es16.js.map +1 -0
  137. package/dist/index.es160.js +122 -0
  138. package/dist/index.es160.js.map +1 -0
  139. package/dist/index.es161.js +139 -0
  140. package/dist/index.es161.js.map +1 -0
  141. package/dist/index.es162.js +118 -0
  142. package/dist/index.es162.js.map +1 -0
  143. package/dist/index.es163.js +9 -0
  144. package/dist/index.es163.js.map +1 -0
  145. package/dist/index.es164.js +145 -0
  146. package/dist/index.es164.js.map +1 -0
  147. package/dist/index.es165.js +5 -0
  148. package/dist/index.es165.js.map +1 -0
  149. package/dist/index.es166.js +3685 -0
  150. package/dist/index.es166.js.map +1 -0
  151. package/dist/index.es167.js +345 -0
  152. package/dist/index.es167.js.map +1 -0
  153. package/dist/index.es168.js +112 -0
  154. package/dist/index.es168.js.map +1 -0
  155. package/dist/index.es169.js +136 -0
  156. package/dist/index.es169.js.map +1 -0
  157. package/dist/index.es17.js +36 -0
  158. package/dist/index.es17.js.map +1 -0
  159. package/dist/index.es170.js +18 -0
  160. package/dist/index.es170.js.map +1 -0
  161. package/dist/index.es171.js +155 -0
  162. package/dist/index.es171.js.map +1 -0
  163. package/dist/index.es172.js +18 -0
  164. package/dist/index.es172.js.map +1 -0
  165. package/dist/index.es173.js +11 -0
  166. package/dist/index.es173.js.map +1 -0
  167. package/dist/index.es174.js +24 -0
  168. package/dist/index.es174.js.map +1 -0
  169. package/dist/index.es175.js +93 -0
  170. package/dist/index.es175.js.map +1 -0
  171. package/dist/index.es176.js +27 -0
  172. package/dist/index.es176.js.map +1 -0
  173. package/dist/index.es177.js +9 -0
  174. package/dist/index.es177.js.map +1 -0
  175. package/dist/index.es178.js +7 -0
  176. package/dist/index.es178.js.map +1 -0
  177. package/dist/index.es179.js +21 -0
  178. package/dist/index.es179.js.map +1 -0
  179. package/dist/index.es18.js +126 -0
  180. package/dist/index.es18.js.map +1 -0
  181. package/dist/index.es180.js +35 -0
  182. package/dist/index.es180.js.map +1 -0
  183. package/dist/index.es181.js +9 -0
  184. package/dist/index.es181.js.map +1 -0
  185. package/dist/index.es182.js +109 -0
  186. package/dist/index.es182.js.map +1 -0
  187. package/dist/index.es183.js +16 -0
  188. package/dist/index.es183.js.map +1 -0
  189. package/dist/index.es184.js +21 -0
  190. package/dist/index.es184.js.map +1 -0
  191. package/dist/index.es185.js +34 -0
  192. package/dist/index.es185.js.map +1 -0
  193. package/dist/index.es186.js +7 -0
  194. package/dist/index.es186.js.map +1 -0
  195. package/dist/index.es187.js +8 -0
  196. package/dist/index.es187.js.map +1 -0
  197. package/dist/index.es188.js +8 -0
  198. package/dist/index.es188.js.map +1 -0
  199. package/dist/index.es189.js +40 -0
  200. package/dist/index.es189.js.map +1 -0
  201. package/dist/index.es19.js +41 -0
  202. package/dist/index.es19.js.map +1 -0
  203. package/dist/index.es190.js +11 -0
  204. package/dist/index.es190.js.map +1 -0
  205. package/dist/index.es191.js +9 -0
  206. package/dist/index.es191.js.map +1 -0
  207. package/dist/index.es192.js +10 -0
  208. package/dist/index.es192.js.map +1 -0
  209. package/dist/index.es193.js +45 -0
  210. package/dist/index.es193.js.map +1 -0
  211. package/dist/index.es194.js +16 -0
  212. package/dist/index.es194.js.map +1 -0
  213. package/dist/index.es195.js +245 -0
  214. package/dist/index.es195.js.map +1 -0
  215. package/dist/index.es196.js +54 -0
  216. package/dist/index.es196.js.map +1 -0
  217. package/dist/index.es197.js +38 -0
  218. package/dist/index.es197.js.map +1 -0
  219. package/dist/index.es198.js +16 -0
  220. package/dist/index.es198.js.map +1 -0
  221. package/dist/index.es199.js +11 -0
  222. package/dist/index.es199.js.map +1 -0
  223. package/dist/index.es2.js +142 -0
  224. package/dist/index.es2.js.map +1 -0
  225. package/dist/index.es20.js +46 -0
  226. package/dist/index.es20.js.map +1 -0
  227. package/dist/index.es200.js +10 -0
  228. package/dist/index.es200.js.map +1 -0
  229. package/dist/index.es201.js +68 -0
  230. package/dist/index.es201.js.map +1 -0
  231. package/dist/index.es202.js +44 -0
  232. package/dist/index.es202.js.map +1 -0
  233. package/dist/index.es203.js +35 -0
  234. package/dist/index.es203.js.map +1 -0
  235. package/dist/index.es204.js +65 -0
  236. package/dist/index.es204.js.map +1 -0
  237. package/dist/index.es205.js +18 -0
  238. package/dist/index.es205.js.map +1 -0
  239. package/dist/index.es206.js +26 -0
  240. package/dist/index.es206.js.map +1 -0
  241. package/dist/index.es207.js +8 -0
  242. package/dist/index.es207.js.map +1 -0
  243. package/dist/index.es208.js +20 -0
  244. package/dist/index.es208.js.map +1 -0
  245. package/dist/index.es209.js +36 -0
  246. package/dist/index.es209.js.map +1 -0
  247. package/dist/index.es21.js +21 -0
  248. package/dist/index.es21.js.map +1 -0
  249. package/dist/index.es210.js +8 -0
  250. package/dist/index.es210.js.map +1 -0
  251. package/dist/index.es211.js +8 -0
  252. package/dist/index.es211.js.map +1 -0
  253. package/dist/index.es212.js +8 -0
  254. package/dist/index.es212.js.map +1 -0
  255. package/dist/index.es213.js +11 -0
  256. package/dist/index.es213.js.map +1 -0
  257. package/dist/index.es214.js +95 -0
  258. package/dist/index.es214.js.map +1 -0
  259. package/dist/index.es215.js +21 -0
  260. package/dist/index.es215.js.map +1 -0
  261. package/dist/index.es216.js +765 -0
  262. package/dist/index.es216.js.map +1 -0
  263. package/dist/index.es217.js +69 -0
  264. package/dist/index.es217.js.map +1 -0
  265. package/dist/index.es218.js +177 -0
  266. package/dist/index.es218.js.map +1 -0
  267. package/dist/index.es219.js +41 -0
  268. package/dist/index.es219.js.map +1 -0
  269. package/dist/index.es22.js +76 -0
  270. package/dist/index.es22.js.map +1 -0
  271. package/dist/index.es220.js +140 -0
  272. package/dist/index.es220.js.map +1 -0
  273. package/dist/index.es221.js +96 -0
  274. package/dist/index.es221.js.map +1 -0
  275. package/dist/index.es222.js +36 -0
  276. package/dist/index.es222.js.map +1 -0
  277. package/dist/index.es223.js +288 -0
  278. package/dist/index.es223.js.map +1 -0
  279. package/dist/index.es224.js +29 -0
  280. package/dist/index.es224.js.map +1 -0
  281. package/dist/index.es225.js +27 -0
  282. package/dist/index.es225.js.map +1 -0
  283. package/dist/index.es226.js +18 -0
  284. package/dist/index.es226.js.map +1 -0
  285. package/dist/index.es227.js +18 -0
  286. package/dist/index.es227.js.map +1 -0
  287. package/dist/index.es228.js +29 -0
  288. package/dist/index.es228.js.map +1 -0
  289. package/dist/index.es229.js +49 -0
  290. package/dist/index.es229.js.map +1 -0
  291. package/dist/index.es23.js +34 -0
  292. package/dist/index.es23.js.map +1 -0
  293. package/dist/index.es230.js +15 -0
  294. package/dist/index.es230.js.map +1 -0
  295. package/dist/index.es231.js +15 -0
  296. package/dist/index.es231.js.map +1 -0
  297. package/dist/index.es232.js +15 -0
  298. package/dist/index.es232.js.map +1 -0
  299. package/dist/index.es233.js +18 -0
  300. package/dist/index.es233.js.map +1 -0
  301. package/dist/index.es234.js +15 -0
  302. package/dist/index.es234.js.map +1 -0
  303. package/dist/index.es235.js +15 -0
  304. package/dist/index.es235.js.map +1 -0
  305. package/dist/index.es236.js +15 -0
  306. package/dist/index.es236.js.map +1 -0
  307. package/dist/index.es237.js +19 -0
  308. package/dist/index.es237.js.map +1 -0
  309. package/dist/index.es238.js +15 -0
  310. package/dist/index.es238.js.map +1 -0
  311. package/dist/index.es239.js +15 -0
  312. package/dist/index.es239.js.map +1 -0
  313. package/dist/index.es24.js +97 -0
  314. package/dist/index.es24.js.map +1 -0
  315. package/dist/index.es240.js +15 -0
  316. package/dist/index.es240.js.map +1 -0
  317. package/dist/index.es241.js +15 -0
  318. package/dist/index.es241.js.map +1 -0
  319. package/dist/index.es242.js +15 -0
  320. package/dist/index.es242.js.map +1 -0
  321. package/dist/index.es243.js +15 -0
  322. package/dist/index.es243.js.map +1 -0
  323. package/dist/index.es244.js +15 -0
  324. package/dist/index.es244.js.map +1 -0
  325. package/dist/index.es245.js +15 -0
  326. package/dist/index.es245.js.map +1 -0
  327. package/dist/index.es246.js +60 -0
  328. package/dist/index.es246.js.map +1 -0
  329. package/dist/index.es247.js +53 -0
  330. package/dist/index.es247.js.map +1 -0
  331. package/dist/index.es248.js +123 -0
  332. package/dist/index.es248.js.map +1 -0
  333. package/dist/index.es249.js +388 -0
  334. package/dist/index.es249.js.map +1 -0
  335. package/dist/index.es25.js +74 -0
  336. package/dist/index.es25.js.map +1 -0
  337. package/dist/index.es250.js +22 -0
  338. package/dist/index.es250.js.map +1 -0
  339. package/dist/index.es251.js +15 -0
  340. package/dist/index.es251.js.map +1 -0
  341. package/dist/index.es252.js +35 -0
  342. package/dist/index.es252.js.map +1 -0
  343. package/dist/index.es253.js +35 -0
  344. package/dist/index.es253.js.map +1 -0
  345. package/dist/index.es254.js +66 -0
  346. package/dist/index.es254.js.map +1 -0
  347. package/dist/index.es255.js +21 -0
  348. package/dist/index.es255.js.map +1 -0
  349. package/dist/index.es256.js +81 -0
  350. package/dist/index.es256.js.map +1 -0
  351. package/dist/index.es257.js +15 -0
  352. package/dist/index.es257.js.map +1 -0
  353. package/dist/index.es258.js +15 -0
  354. package/dist/index.es258.js.map +1 -0
  355. package/dist/index.es259.js +19 -0
  356. package/dist/index.es259.js.map +1 -0
  357. package/dist/index.es26.js +180 -0
  358. package/dist/index.es26.js.map +1 -0
  359. package/dist/index.es260.js +56 -0
  360. package/dist/index.es260.js.map +1 -0
  361. package/dist/index.es261.js +170 -0
  362. package/dist/index.es261.js.map +1 -0
  363. package/dist/index.es262.js +5 -0
  364. package/dist/index.es262.js.map +1 -0
  365. package/dist/index.es263.js +14 -0
  366. package/dist/index.es263.js.map +1 -0
  367. package/dist/index.es264.js +23 -0
  368. package/dist/index.es264.js.map +1 -0
  369. package/dist/index.es265.js +42 -0
  370. package/dist/index.es265.js.map +1 -0
  371. package/dist/index.es27.js +16 -0
  372. package/dist/index.es27.js.map +1 -0
  373. package/dist/index.es28.js +441 -0
  374. package/dist/index.es28.js.map +1 -0
  375. package/dist/index.es29.js +122 -0
  376. package/dist/index.es29.js.map +1 -0
  377. package/dist/index.es3.js +30 -0
  378. package/dist/index.es3.js.map +1 -0
  379. package/dist/index.es30.js +77 -0
  380. package/dist/index.es30.js.map +1 -0
  381. package/dist/index.es31.js +15 -0
  382. package/dist/index.es31.js.map +1 -0
  383. package/dist/index.es32.js +262 -0
  384. package/dist/index.es32.js.map +1 -0
  385. package/dist/index.es33.js +47 -0
  386. package/dist/index.es33.js.map +1 -0
  387. package/dist/index.es34.js +215 -0
  388. package/dist/index.es34.js.map +1 -0
  389. package/dist/index.es35.js +71 -0
  390. package/dist/index.es35.js.map +1 -0
  391. package/dist/index.es36.js +146 -0
  392. package/dist/index.es36.js.map +1 -0
  393. package/dist/index.es37.js +28 -0
  394. package/dist/index.es37.js.map +1 -0
  395. package/dist/index.es38.js +228 -0
  396. package/dist/index.es38.js.map +1 -0
  397. package/dist/index.es39.js +13 -0
  398. package/dist/index.es39.js.map +1 -0
  399. package/dist/index.es4.js +30 -0
  400. package/dist/index.es4.js.map +1 -0
  401. package/dist/index.es40.js +1203 -0
  402. package/dist/index.es40.js.map +1 -0
  403. package/dist/index.es41.js +12 -0
  404. package/dist/index.es41.js.map +1 -0
  405. package/dist/index.es42.js +151 -0
  406. package/dist/index.es42.js.map +1 -0
  407. package/dist/index.es43.js +18 -0
  408. package/dist/index.es43.js.map +1 -0
  409. package/dist/index.es44.js +11 -0
  410. package/dist/index.es44.js.map +1 -0
  411. package/dist/index.es45.js +97 -0
  412. package/dist/index.es45.js.map +1 -0
  413. package/dist/index.es46.js +7 -0
  414. package/dist/index.es46.js.map +1 -0
  415. package/dist/index.es47.js +39 -0
  416. package/dist/index.es47.js.map +1 -0
  417. package/dist/index.es48.js +75 -0
  418. package/dist/index.es48.js.map +1 -0
  419. package/dist/index.es49.js +41 -0
  420. package/dist/index.es49.js.map +1 -0
  421. package/dist/index.es5.js +26 -0
  422. package/dist/index.es5.js.map +1 -0
  423. package/dist/index.es50.js +309 -0
  424. package/dist/index.es50.js.map +1 -0
  425. package/dist/index.es51.js +12 -0
  426. package/dist/index.es51.js.map +1 -0
  427. package/dist/index.es52.js +88 -0
  428. package/dist/index.es52.js.map +1 -0
  429. package/dist/index.es53.js +11 -0
  430. package/dist/index.es53.js.map +1 -0
  431. package/dist/index.es54.js +18 -0
  432. package/dist/index.es54.js.map +1 -0
  433. package/dist/index.es55.js +144 -0
  434. package/dist/index.es55.js.map +1 -0
  435. package/dist/index.es56.js +303 -0
  436. package/dist/index.es56.js.map +1 -0
  437. package/dist/index.es57.js +69 -0
  438. package/dist/index.es57.js.map +1 -0
  439. package/dist/index.es58.js +216 -0
  440. package/dist/index.es58.js.map +1 -0
  441. package/dist/index.es59.js +37 -0
  442. package/dist/index.es59.js.map +1 -0
  443. package/dist/index.es6.js +122 -0
  444. package/dist/index.es6.js.map +1 -0
  445. package/dist/index.es60.js +12 -0
  446. package/dist/index.es60.js.map +1 -0
  447. package/dist/index.es61.js +15 -0
  448. package/dist/index.es61.js.map +1 -0
  449. package/dist/index.es62.js +190 -0
  450. package/dist/index.es62.js.map +1 -0
  451. package/dist/index.es63.js +19 -0
  452. package/dist/index.es63.js.map +1 -0
  453. package/dist/index.es64.js +1403 -0
  454. package/dist/index.es64.js.map +1 -0
  455. package/dist/index.es65.js +12 -0
  456. package/dist/index.es65.js.map +1 -0
  457. package/dist/index.es66.js +11 -0
  458. package/dist/index.es66.js.map +1 -0
  459. package/dist/index.es67.js +9 -0
  460. package/dist/index.es67.js.map +1 -0
  461. package/dist/index.es68.js +8 -0
  462. package/dist/index.es68.js.map +1 -0
  463. package/dist/index.es69.js +8 -0
  464. package/dist/index.es69.js.map +1 -0
  465. package/dist/index.es7.js +19 -0
  466. package/dist/index.es7.js.map +1 -0
  467. package/dist/index.es70.js +15 -0
  468. package/dist/index.es70.js.map +1 -0
  469. package/dist/index.es71.js +26 -0
  470. package/dist/index.es71.js.map +1 -0
  471. package/dist/index.es72.js +37 -0
  472. package/dist/index.es72.js.map +1 -0
  473. package/dist/index.es73.js +235 -0
  474. package/dist/index.es73.js.map +1 -0
  475. package/dist/index.es74.js +71 -0
  476. package/dist/index.es74.js.map +1 -0
  477. package/dist/index.es75.js +72 -0
  478. package/dist/index.es75.js.map +1 -0
  479. package/dist/index.es76.js +60 -0
  480. package/dist/index.es76.js.map +1 -0
  481. package/dist/index.es77.js +16 -0
  482. package/dist/index.es77.js.map +1 -0
  483. package/dist/index.es78.js +140 -0
  484. package/dist/index.es78.js.map +1 -0
  485. package/dist/index.es79.js +24 -0
  486. package/dist/index.es79.js.map +1 -0
  487. package/dist/index.es8.js +61 -0
  488. package/dist/index.es8.js.map +1 -0
  489. package/dist/index.es80.js +185 -0
  490. package/dist/index.es80.js.map +1 -0
  491. package/dist/index.es81.js +244 -0
  492. package/dist/index.es81.js.map +1 -0
  493. package/dist/index.es82.js +358 -0
  494. package/dist/index.es82.js.map +1 -0
  495. package/dist/index.es83.js +140 -0
  496. package/dist/index.es83.js.map +1 -0
  497. package/dist/index.es84.js +73 -0
  498. package/dist/index.es84.js.map +1 -0
  499. package/dist/index.es85.js +40 -0
  500. package/dist/index.es85.js.map +1 -0
  501. package/dist/index.es86.js +40 -0
  502. package/dist/index.es86.js.map +1 -0
  503. package/dist/index.es87.js +169 -0
  504. package/dist/index.es87.js.map +1 -0
  505. package/dist/index.es88.js +206 -0
  506. package/dist/index.es88.js.map +1 -0
  507. package/dist/index.es89.js +17 -0
  508. package/dist/index.es89.js.map +1 -0
  509. package/dist/index.es9.js +109 -0
  510. package/dist/index.es9.js.map +1 -0
  511. package/dist/index.es90.js +33 -0
  512. package/dist/index.es90.js.map +1 -0
  513. package/dist/index.es91.js +37 -0
  514. package/dist/index.es91.js.map +1 -0
  515. package/dist/index.es92.js +3160 -0
  516. package/dist/index.es92.js.map +1 -0
  517. package/dist/index.es93.js +84 -0
  518. package/dist/index.es93.js.map +1 -0
  519. package/dist/index.es94.js +5 -0
  520. package/dist/index.es94.js.map +1 -0
  521. package/dist/index.es95.js +13 -0
  522. package/dist/index.es95.js.map +1 -0
  523. package/dist/index.es96.js +278 -0
  524. package/dist/index.es96.js.map +1 -0
  525. package/dist/index.es97.js +5 -0
  526. package/dist/index.es97.js.map +1 -0
  527. package/dist/index.es98.js +167 -0
  528. package/dist/index.es98.js.map +1 -0
  529. package/dist/index.es99.js +54 -0
  530. package/dist/index.es99.js.map +1 -0
  531. package/dist/styles.css +1 -1
  532. package/package.json +12 -10
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es119.js","sources":["../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/util.js"],"sourcesContent":["// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error(\"Unexpected value in exhaustive check\");\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepString = step.toString();\n let stepDecCount = (stepString.split(\".\")[1] || \"\").length;\n if (stepDecCount === 0 && /\\d?e-\\d?/.test(stepString)) {\n const match = stepString.match(/\\d?e-(\\d?)/);\n if (match?.[1]) {\n stepDecCount = Number.parseInt(match[1]);\n }\n }\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nconst EVALUATING = Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n let value = undefined;\n Object.defineProperty(object, key, {\n get() {\n if (value === EVALUATING) {\n // Circular reference detected, return undefined to break the cycle\n return undefined;\n }\n if (value === undefined) {\n value = EVALUATING;\n value = getter();\n }\n return value;\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function objectClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function mergeDefs(...defs) {\n const mergedDescriptors = {};\n for (const def of defs) {\n const descriptors = Object.getOwnPropertyDescriptors(def);\n Object.assign(mergedDescriptors, descriptors);\n }\n return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function slugify(input) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = cached(() => {\n // @ts-ignore\n if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n return false;\n }\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(o) {\n if (isObject(o) === false)\n return false;\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined)\n return true;\n if (typeof ctor !== \"function\")\n return true;\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false)\n return false;\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nexport function shallowClone(o) {\n if (isPlainObject(o))\n return { ...o };\n if (Array.isArray(o))\n return [...o];\n return o;\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n // @ts-ignore\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = new Set([\"string\", \"number\", \"bigint\", \"boolean\", \"symbol\", \"undefined\"]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = {};\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n newShape[key] = currDef.shape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function omit(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".omit() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = { ...schema._zod.def.shape };\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function extend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to extend: expected a plain object\");\n }\n const checks = schema._zod.def.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n // Only throw if new shape overlaps with existing shape\n // Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = schema._zod.def.shape;\n for (const key in shape) {\n if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {\n throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\");\n }\n }\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function merge(a, b) {\n const def = mergeDefs(a._zod.def, {\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: [], // delete existing checks\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".partial() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function required(Class, schema, mask) {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n });\n return clone(schema, def);\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue !== true) {\n return true;\n }\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const full = { ...iss, path: iss.path ?? [] };\n // for backwards compatibility\n if (!iss.message) {\n const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\";\n full.message = message;\n }\n // delete (full as any).def;\n delete full.inst;\n delete full.continue;\n if (!ctx?.reportInput) {\n delete full.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n // @ts-ignore\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function parsedType(data) {\n const t = typeof data;\n switch (t) {\n case \"number\": {\n return Number.isNaN(data) ? \"nan\" : \"number\";\n }\n case \"object\": {\n if (data === null) {\n return \"null\";\n }\n if (Array.isArray(data)) {\n return \"array\";\n }\n const obj = data;\n if (obj && Object.getPrototypeOf(obj) !== Object.prototype && \"constructor\" in obj && obj.constructor) {\n return obj.constructor.name;\n }\n }\n }\n return t;\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n let binaryString = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binaryString += String.fromCharCode(bytes[i]);\n }\n return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n const cleanHex = hex.replace(/^0x/, \"\");\n if (cleanHex.length % 2 !== 0) {\n throw new Error(\"Invalid hex string length\");\n }\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < cleanHex.length; i += 2) {\n bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n"],"names":[],"mappings":"AAYO,SAAS,cAAc,SAAS;AACnC,QAAM,gBAAgB,OAAO,OAAO,OAAO,EAAE,OAAO,CAAC,MAAM,OAAO,MAAM,QAAQ;AAChF,QAAM,SAAS,OAAO,QAAQ,OAAO,EAChC,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,cAAc,QAAQ,CAAC,CAAC,MAAM,EAAE,EACnD,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;AACtB,SAAO;AACX;AAIO,SAAS,sBAAsB,GAAG,OAAO;AAC5C,MAAI,OAAO,UAAU;AACjB,WAAO,MAAM,SAAQ;AACzB,SAAO;AACX;AAqCA,MAAM,aAAa,uBAAO,YAAY;AAC/B,SAAS,WAAW,QAAQ,KAAK,QAAQ;AAC5C,MAAI,QAAQ;AACZ,SAAO,eAAe,QAAQ,KAAK;AAAA,IAC/B,MAAM;AACF,UAAI,UAAU,YAAY;AAEtB,eAAO;AAAA,MACX;AACA,UAAI,UAAU,QAAW;AACrB,gBAAQ;AACR,gBAAQ,OAAM;AAAA,MAClB;AACA,aAAO;AAAA,IACX;AAAA,IACA,IAAI,GAAG;AACH,aAAO,eAAe,QAAQ,KAAK;AAAA,QAC/B,OAAO;AAAA;AAAA,MAEvB,CAAa;AAAA,IAEL;AAAA,IACA,cAAc;AAAA,EACtB,CAAK;AACL;AA0DY,MAAC,oBAAqB,uBAAuB,QAAQ,MAAM,oBAAoB,IAAI,UAAU;AAAE;AAwGpG,SAAS,MAAM,MAAM,KAAK,QAAQ;AACrC,QAAM,KAAK,IAAI,KAAK,KAAK,OAAO,OAAO,KAAK,KAAK,GAAG;AACpD,MAAI,CAAC,OAAO,QAAQ;AAChB,OAAG,KAAK,SAAS;AACrB,SAAO;AACX;AACO,SAAS,gBAAgB,SAAS;AAGjC,SAAO,CAAA;AAYf;AA+OO,SAAS,QAAQ,GAAG,aAAa,GAAG;AACvC,MAAI,EAAE,YAAY;AACd,WAAO;AACX,WAAS,IAAI,YAAY,IAAI,EAAE,OAAO,QAAQ,KAAK;AAC/C,QAAI,EAAE,OAAO,CAAC,GAAG,aAAa,MAAM;AAChC,aAAO;AAAA,IACX;AAAA,EACJ;AACA,SAAO;AACX;AASO,SAAS,cAAc,SAAS;AACnC,SAAO,OAAO,YAAY,WAAW,UAAU,SAAS;AAC5D;AACO,SAAS,cAAc,KAAK,KAAK,QAAQ;AAC5C,QAAM,OAAO,EAAE,GAAG,KAAK,MAAM,IAAI,QAAQ,GAAE;AAE3C,MAAI,CAAC,IAAI,SAAS;AACd,UAAM,UAAU,cAAc,IAAI,MAAM,KAAK,KAAK,QAAQ,GAAG,CAAC,KAC1D,cAAc,KAAK,QAAQ,GAAG,CAAC,KAC/B,cAAc,OAAO,cAAc,GAAG,CAAC,KACvC,cAAc,OAAO,cAAc,GAAG,CAAC,KACvC;AACJ,SAAK,UAAU;AAAA,EACnB;AAEA,SAAO,KAAK;AACZ,SAAO,KAAK;AACZ,MAAI,CAAC,KAAK,aAAa;AACnB,WAAO,KAAK;AAAA,EAChB;AACA,SAAO;AACX;","x_google_ignoreList":[0]}
@@ -0,0 +1,104 @@
1
+ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
2
+ import { useStreamContext } from "./index.es6.js";
3
+ import { useMemo, useRef, useCallback, Fragment, useEffect } from "react";
4
+ import AgentMessage from "./index.es19.js";
5
+ import HumanMessage from "./index.es20.js";
6
+ import { isToolMessage, isAiWithToolCalls } from "./index.es21.js";
7
+ import Thinking from "./index.es22.js";
8
+ import CustomComponentRender from "./index.es23.js";
9
+ function ChatBodyComponent() {
10
+ const stream = useStreamContext();
11
+ const messages = stream.messages;
12
+ const isLoading = stream.isLoading;
13
+ const memoMessages = useMemo(() => messages ?? [], [messages]);
14
+ const messagesRef = useRef(null);
15
+ const prevMessageCountRef = useRef(0);
16
+ const renderMessage = useCallback((msg, index, messagesArray) => {
17
+ if (!msg.content.length) return null;
18
+ if (isToolMessage(msg) && index > 0 && isAiWithToolCalls(messagesArray[index - 1])) {
19
+ return null;
20
+ }
21
+ const isLastMessage = index === messagesArray.length - 1;
22
+ const isStreamingThisMessage = isLoading && isLastMessage && msg.type === "ai";
23
+ if (msg.type === "human") {
24
+ return /* @__PURE__ */ jsx(HumanMessage, { message: msg }, msg.id);
25
+ }
26
+ if (isAiWithToolCalls(msg)) {
27
+ const toolMessages = [];
28
+ let nextIndex = index + 1;
29
+ while (nextIndex < messagesArray.length && isToolMessage(messagesArray[nextIndex])) {
30
+ toolMessages.push(messagesArray[nextIndex]);
31
+ nextIndex++;
32
+ }
33
+ const hasTextContent = Array.isArray(msg.content) && msg.content.some((c) => c.type === "text" && c.text?.trim());
34
+ if (hasTextContent) {
35
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
36
+ /* @__PURE__ */ jsx(
37
+ AgentMessage,
38
+ {
39
+ message: msg,
40
+ isStreaming: isStreamingThisMessage
41
+ }
42
+ ),
43
+ /* @__PURE__ */ jsx(CustomComponentRender, { message: msg, thread: stream })
44
+ ] }, msg.id);
45
+ } else {
46
+ return /* @__PURE__ */ jsx(
47
+ Thinking,
48
+ {
49
+ title: "Agent Thinking",
50
+ message: msg,
51
+ toolMessages
52
+ },
53
+ msg.id
54
+ );
55
+ }
56
+ }
57
+ if (isToolMessage(msg)) {
58
+ return /* @__PURE__ */ jsx(Thinking, { title: "Agent Thinking", message: msg }, msg.id);
59
+ }
60
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
61
+ /* @__PURE__ */ jsx(CustomComponentRender, { message: msg, thread: stream }),
62
+ /* @__PURE__ */ jsx(
63
+ AgentMessage,
64
+ {
65
+ message: msg,
66
+ isStreaming: isStreamingThisMessage
67
+ }
68
+ )
69
+ ] }, msg.id);
70
+ }, [isLoading, stream]);
71
+ const renderedMessages = useMemo(() => {
72
+ return memoMessages.map((msg, index) => renderMessage(msg, index, memoMessages));
73
+ }, [memoMessages, renderMessage]);
74
+ useEffect(() => {
75
+ const currentCount = memoMessages.length;
76
+ const hasNewMessage = currentCount > prevMessageCountRef.current;
77
+ if (messagesRef.current && (hasNewMessage || isLoading)) {
78
+ const { scrollTop, scrollHeight, clientHeight } = messagesRef.current;
79
+ const isNearBottom = scrollHeight - scrollTop - clientHeight < 100;
80
+ if (isNearBottom || hasNewMessage) {
81
+ messagesRef.current.scrollTop = messagesRef.current.scrollHeight;
82
+ }
83
+ }
84
+ prevMessageCountRef.current = currentCount;
85
+ }, [memoMessages, isLoading]);
86
+ return /* @__PURE__ */ jsx(
87
+ "div",
88
+ {
89
+ ref: messagesRef,
90
+ className: "flex flex-col gap-4 rounded-4xl p-2 bg-black/20",
91
+ children: memoMessages.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full text-zinc-500", children: "Start a conversation..." }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
92
+ renderedMessages,
93
+ isLoading && memoMessages.length > 0 && memoMessages[memoMessages.length - 1].type === "human" && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
94
+ "Thinking",
95
+ /* @__PURE__ */ jsx("span", { className: "animate-pulse", children: "..." })
96
+ ] })
97
+ ] })
98
+ }
99
+ );
100
+ }
101
+ export {
102
+ ChatBodyComponent as default
103
+ };
104
+ //# sourceMappingURL=index.es12.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es12.js","sources":["../src/components/ChatBody.tsx"],"sourcesContent":["import { useStreamContext } from \"@/providers/Stream\";\nimport { Fragment, useCallback, useEffect, useMemo, useRef } from \"react\";\nimport AgentMessage from \"./messages/AgentMessage\";\nimport HumanMessage from \"./messages/HumanMessage\";\nimport { isAiWithToolCalls, isToolMessage } from \"@/utils/utils\";\nimport Thinking from \"./Thinking\";\nimport CustomComponentRender from \"./messages/CustomComponentRender\";\n\nexport default function ChatBodyComponent() {\n const stream = useStreamContext();\n const messages = stream.messages;\n const isLoading = stream.isLoading;\n\n // Memoize messages with stable reference\n const memoMessages = useMemo(() => messages ?? [], [messages]);\n\n const messagesRef = useRef<HTMLDivElement | null>(null);\n const prevMessageCountRef = useRef(0);\n\n // Memoize message rendering logic to prevent unnecessary re-renders\n const renderMessage = useCallback((msg: typeof messages[0], index: number, messagesArray: typeof messages) => {\n if (!msg.content.length) return null;\n\n // Skip tool messages that follow an AI message with tool calls\n if (\n isToolMessage(msg) &&\n index > 0 &&\n isAiWithToolCalls(messagesArray[index - 1])\n ) {\n return null;\n }\n\n const isLastMessage = index === messagesArray.length - 1;\n const isStreamingThisMessage =\n isLoading && isLastMessage && msg.type === \"ai\";\n\n if (msg.type === \"human\") {\n return <HumanMessage key={msg.id} message={msg} />;\n }\n\n // Group AI message with tool calls and subsequent tool messages\n if (isAiWithToolCalls(msg)) {\n const toolMessages = [];\n let nextIndex = index + 1;\n while (\n nextIndex < messagesArray.length &&\n isToolMessage(messagesArray[nextIndex])\n ) {\n toolMessages.push(messagesArray[nextIndex]);\n nextIndex++;\n }\n\n // Check if there's text content to display\n const hasTextContent =\n Array.isArray(msg.content) &&\n msg.content.some((c: any) => c.type === \"text\" && c.text?.trim());\n\n if (hasTextContent) {\n return (\n <Fragment key={msg.id}>\n <AgentMessage\n message={msg}\n isStreaming={isStreamingThisMessage}\n />\n <CustomComponentRender message={msg} thread={stream} />\n </Fragment>\n );\n } else {\n return (\n <Thinking\n key={msg.id}\n title=\"Agent Thinking\"\n message={msg}\n toolMessages={toolMessages}\n />\n );\n }\n }\n\n // Standalone tool messages (shouldn't happen in normal flow)\n if (isToolMessage(msg)) {\n return (\n <Thinking key={msg.id} title=\"Agent Thinking\" message={msg} />\n );\n }\n\n return (\n <Fragment key={msg.id}>\n <CustomComponentRender message={msg} thread={stream} />\n <AgentMessage\n message={msg}\n isStreaming={isStreamingThisMessage}\n />\n </Fragment>\n );\n }, [isLoading, stream]);\n\n // Memoize the rendered messages array\n const renderedMessages = useMemo(() => {\n return memoMessages.map((msg, index) => renderMessage(msg, index, memoMessages));\n }, [memoMessages, renderMessage]);\n\n // Auto-scroll only when new messages are added or content updates\n useEffect(() => {\n const currentCount = memoMessages.length;\n const hasNewMessage = currentCount > prevMessageCountRef.current;\n\n if (messagesRef.current && (hasNewMessage || isLoading)) {\n const { scrollTop, scrollHeight, clientHeight } = messagesRef.current;\n const isNearBottom = scrollHeight - scrollTop - clientHeight < 100;\n\n // Only auto-scroll if user is near bottom\n if (isNearBottom || hasNewMessage) {\n messagesRef.current.scrollTop = messagesRef.current.scrollHeight;\n }\n }\n\n prevMessageCountRef.current = currentCount;\n }, [memoMessages, isLoading]);\n\n return (\n <div\n ref={messagesRef}\n className=\"flex flex-col gap-4 rounded-4xl p-2 bg-black/20\"\n >\n {memoMessages.length === 0 ? (\n <div className=\"flex items-center justify-center h-full text-zinc-500\">\n Start a conversation...\n </div>\n ) : (\n <>\n {renderedMessages}\n {/* Show thinking indicator when loading but no AI response yet */}\n {isLoading && memoMessages.length > 0 && memoMessages[memoMessages.length - 1].type === \"human\" && (\n <div className=\"flex items-center gap-2\">\n {/* <div className=\"animate rounded-full h-6 w-6 border-b-2 border-zinc-400\"></div> */}\n Thinking<span className=\"animate-pulse\">...</span>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"names":["Fragment"],"mappings":"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"}
@@ -0,0 +1,132 @@
1
+ import { $constructor, $ZodAsyncError } from "./index.es154.js";
2
+ import { defineLazy, aborted } from "./index.es119.js";
3
+ import { clone } from "./index.es119.js";
4
+ import { safeParse, safeParseAsync } from "./index.es123.js";
5
+ import { version } from "./index.es156.js";
6
+ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
7
+ var _a;
8
+ inst ?? (inst = {});
9
+ inst._zod.def = def;
10
+ inst._zod.bag = inst._zod.bag || {};
11
+ inst._zod.version = version;
12
+ const checks = [...inst._zod.def.checks ?? []];
13
+ if (inst._zod.traits.has("$ZodCheck")) {
14
+ checks.unshift(inst);
15
+ }
16
+ for (const ch of checks) {
17
+ for (const fn of ch._zod.onattach) {
18
+ fn(inst);
19
+ }
20
+ }
21
+ if (checks.length === 0) {
22
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
23
+ inst._zod.deferred?.push(() => {
24
+ inst._zod.run = inst._zod.parse;
25
+ });
26
+ } else {
27
+ const runChecks = (payload, checks2, ctx) => {
28
+ let isAborted = aborted(payload);
29
+ let asyncResult;
30
+ for (const ch of checks2) {
31
+ if (ch._zod.def.when) {
32
+ const shouldRun = ch._zod.def.when(payload);
33
+ if (!shouldRun)
34
+ continue;
35
+ } else if (isAborted) {
36
+ continue;
37
+ }
38
+ const currLen = payload.issues.length;
39
+ const _ = ch._zod.check(payload);
40
+ if (_ instanceof Promise && ctx?.async === false) {
41
+ throw new $ZodAsyncError();
42
+ }
43
+ if (asyncResult || _ instanceof Promise) {
44
+ asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
45
+ await _;
46
+ const nextLen = payload.issues.length;
47
+ if (nextLen === currLen)
48
+ return;
49
+ if (!isAborted)
50
+ isAborted = aborted(payload, currLen);
51
+ });
52
+ } else {
53
+ const nextLen = payload.issues.length;
54
+ if (nextLen === currLen)
55
+ continue;
56
+ if (!isAborted)
57
+ isAborted = aborted(payload, currLen);
58
+ }
59
+ }
60
+ if (asyncResult) {
61
+ return asyncResult.then(() => {
62
+ return payload;
63
+ });
64
+ }
65
+ return payload;
66
+ };
67
+ const handleCanaryResult = (canary, payload, ctx) => {
68
+ if (aborted(canary)) {
69
+ canary.aborted = true;
70
+ return canary;
71
+ }
72
+ const checkResult = runChecks(payload, checks, ctx);
73
+ if (checkResult instanceof Promise) {
74
+ if (ctx.async === false)
75
+ throw new $ZodAsyncError();
76
+ return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx));
77
+ }
78
+ return inst._zod.parse(checkResult, ctx);
79
+ };
80
+ inst._zod.run = (payload, ctx) => {
81
+ if (ctx.skipChecks) {
82
+ return inst._zod.parse(payload, ctx);
83
+ }
84
+ if (ctx.direction === "backward") {
85
+ const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
86
+ if (canary instanceof Promise) {
87
+ return canary.then((canary2) => {
88
+ return handleCanaryResult(canary2, payload, ctx);
89
+ });
90
+ }
91
+ return handleCanaryResult(canary, payload, ctx);
92
+ }
93
+ const result = inst._zod.parse(payload, ctx);
94
+ if (result instanceof Promise) {
95
+ if (ctx.async === false)
96
+ throw new $ZodAsyncError();
97
+ return result.then((result2) => runChecks(result2, checks, ctx));
98
+ }
99
+ return runChecks(result, checks, ctx);
100
+ };
101
+ }
102
+ defineLazy(inst, "~standard", () => ({
103
+ validate: (value) => {
104
+ try {
105
+ const r = safeParse(inst, value);
106
+ return r.success ? { value: r.data } : { issues: r.error?.issues };
107
+ } catch (_) {
108
+ return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
109
+ }
110
+ },
111
+ vendor: "zod",
112
+ version: 1
113
+ }));
114
+ });
115
+ const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
116
+ $ZodType.init(inst, def);
117
+ inst._zod.parse = (payload, _ctx) => {
118
+ payload.issues.push({
119
+ expected: "never",
120
+ code: "invalid_type",
121
+ input: payload.value,
122
+ inst
123
+ });
124
+ return payload;
125
+ };
126
+ });
127
+ export {
128
+ $ZodNever,
129
+ $ZodType,
130
+ clone
131
+ };
132
+ //# sourceMappingURL=index.es120.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es120.js","sources":["../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js"],"sourcesContent":["import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync, safeParse, safeParseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n var _a;\n inst ?? (inst = {});\n inst._zod.def = def; // set _def property\n inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n inst._zod.version = version;\n const checks = [...(inst._zod.def.checks ?? [])];\n // if inst is itself a checks.$ZodCheck, run it as a check\n if (inst._zod.traits.has(\"$ZodCheck\")) {\n checks.unshift(inst);\n }\n for (const ch of checks) {\n for (const fn of ch._zod.onattach) {\n fn(inst);\n }\n }\n if (checks.length === 0) {\n // deferred initializer\n // inst._zod.parse is not yet defined\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred?.push(() => {\n inst._zod.run = inst._zod.parse;\n });\n }\n else {\n const runChecks = (payload, checks, ctx) => {\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.def.when) {\n const shouldRun = ch._zod.def.when(payload);\n if (!shouldRun)\n continue;\n }\n else if (isAborted) {\n continue;\n }\n const currLen = payload.issues.length;\n const _ = ch._zod.check(payload);\n if (_ instanceof Promise && ctx?.async === false) {\n throw new core.$ZodAsyncError();\n }\n if (asyncResult || _ instanceof Promise) {\n asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n await _;\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n return;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n });\n }\n else {\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n continue;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n }\n }\n if (asyncResult) {\n return asyncResult.then(() => {\n return payload;\n });\n }\n return payload;\n };\n const handleCanaryResult = (canary, payload, ctx) => {\n // abort if the canary is aborted\n if (util.aborted(canary)) {\n canary.aborted = true;\n return canary;\n }\n // run checks first, then\n const checkResult = runChecks(payload, checks, ctx);\n if (checkResult instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));\n }\n return inst._zod.parse(checkResult, ctx);\n };\n inst._zod.run = (payload, ctx) => {\n if (ctx.skipChecks) {\n return inst._zod.parse(payload, ctx);\n }\n if (ctx.direction === \"backward\") {\n // run canary\n // initial pass (no checks)\n const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });\n if (canary instanceof Promise) {\n return canary.then((canary) => {\n return handleCanaryResult(canary, payload, ctx);\n });\n }\n return handleCanaryResult(canary, payload, ctx);\n }\n // forward\n const result = inst._zod.parse(payload, ctx);\n if (result instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return result.then((result) => runChecks(result, checks, ctx));\n }\n return runChecks(result, checks, ctx);\n };\n }\n // Lazy initialize ~standard to avoid creating objects for every schema\n util.defineLazy(inst, \"~standard\", () => ({\n validate: (value) => {\n try {\n const r = safeParse(inst, value);\n return r.success ? { value: r.data } : { issues: r.error?.issues };\n }\n catch (_) {\n return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));\n }\n },\n vendor: \"zod\",\n version: 1,\n }));\n});\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);\n inst._zod.parse = (payload, _) => {\n if (def.coerce)\n try {\n payload.value = String(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"string\")\n return payload;\n payload.issues.push({\n expected: \"string\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n // check initialization must come first\n checks.$ZodCheckStringFormat.init(inst, def);\n $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.guid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n if (def.version) {\n const versionMap = {\n v1: 1,\n v2: 2,\n v3: 3,\n v4: 4,\n v5: 5,\n v6: 6,\n v7: 7,\n v8: 8,\n };\n const v = versionMap[def.version];\n if (v === undefined)\n throw new Error(`Invalid UUID version: \"${def.version}\"`);\n def.pattern ?? (def.pattern = regexes.uuid(v));\n }\n else\n def.pattern ?? (def.pattern = regexes.uuid());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.email);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n try {\n // Trim whitespace from input\n const trimmed = payload.value.trim();\n // @ts-ignore\n const url = new URL(trimmed);\n if (def.hostname) {\n def.hostname.lastIndex = 0;\n if (!def.hostname.test(url.hostname)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid hostname\",\n pattern: def.hostname.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n if (def.protocol) {\n def.protocol.lastIndex = 0;\n if (!def.protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid protocol\",\n pattern: def.protocol.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n // Set the output value based on normalize flag\n if (def.normalize) {\n // Use normalized URL\n payload.value = url.href;\n }\n else {\n // Preserve the original input (trimmed)\n payload.value = trimmed;\n }\n return;\n }\n catch (_) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.emoji());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.nanoid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid2);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ulid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.xid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ksuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.datetime(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.date);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.time(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.duration);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv4);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv4`;\n});\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv6);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv6`;\n inst._zod.check = (payload) => {\n try {\n // @ts-ignore\n new URL(`http://[${payload.value}]`);\n // return;\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"ipv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodMAC = /*@__PURE__*/ core.$constructor(\"$ZodMAC\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.mac(def.delimiter));\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `mac`;\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n const parts = payload.value.split(\"/\");\n try {\n if (parts.length !== 2)\n throw new Error();\n const [address, prefix] = parts;\n if (!prefix)\n throw new Error();\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n throw new Error();\n if (prefixNum < 0 || prefixNum > 128)\n throw new Error();\n // @ts-ignore\n new URL(`http://[${address}]`);\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"cidrv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64(data) {\n if (data === \"\")\n return true;\n if (data.length % 4 !== 0)\n return false;\n try {\n // @ts-ignore\n atob(data);\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64\";\n inst._zod.check = (payload) => {\n if (isValidBase64(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64URL(data) {\n if (!regexes.base64url.test(data))\n return false;\n const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64url);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64url\";\n inst._zod.check = (payload) => {\n if (isValidBase64URL(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.e164);\n $ZodStringFormat.init(inst, def);\n});\n////////////////////////////// ZodJWT //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n try {\n const tokensParts = token.split(\".\");\n if (tokensParts.length !== 3)\n return false;\n const [header] = tokensParts;\n if (!header)\n return false;\n // @ts-ignore\n const parsedHeader = JSON.parse(atob(header));\n if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n return false;\n if (!parsedHeader.alg)\n return false;\n if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidJWT(payload.value, def.alg))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"jwt\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCustomStringFormat\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (def.fn(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Number(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n return payload;\n }\n const received = typeof input === \"number\"\n ? Number.isNaN(input)\n ? \"NaN\"\n : !Number.isFinite(input)\n ? \"Infinity\"\n : undefined\n : undefined;\n payload.issues.push({\n expected: \"number\",\n code: \"invalid_type\",\n input,\n inst,\n ...(received ? { received } : {}),\n });\n return payload;\n };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumberFormat\", (inst, def) => {\n checks.$ZodCheckNumberFormat.init(inst, def);\n $ZodNumber.init(inst, def); // no format checks\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.boolean;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Boolean(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"boolean\")\n return payload;\n payload.issues.push({\n expected: \"boolean\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.bigint;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = BigInt(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"bigint\")\n return payload;\n payload.issues.push({\n expected: \"bigint\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigIntFormat\", (inst, def) => {\n checks.$ZodCheckBigIntFormat.init(inst, def);\n $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"symbol\")\n return payload;\n payload.issues.push({\n expected: \"symbol\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.undefined;\n inst._zod.values = new Set([undefined]);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"undefined\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.null;\n inst._zod.values = new Set([null]);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (input === null)\n return payload;\n payload.issues.push({\n expected: \"null\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.issues.push({\n expected: \"never\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"void\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce) {\n try {\n payload.value = new Date(payload.value);\n }\n catch (_err) { }\n }\n const input = payload.value;\n const isDate = input instanceof Date;\n const isValidDate = isDate && !Number.isNaN(input.getTime());\n if (isValidDate)\n return payload;\n payload.issues.push({\n expected: \"date\",\n code: \"invalid_type\",\n input,\n ...(isDate ? { received: \"Invalid Date\" } : {}),\n inst,\n });\n return payload;\n };\n});\nfunction handleArrayResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n expected: \"array\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = Array(input.length);\n const proms = [];\n for (let i = 0; i < input.length; i++) {\n const item = input[i];\n const result = def.element._zod.run({\n value: item,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n }\n else {\n handleArrayResult(result, payload, i);\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n});\nfunction handlePropertyResult(result, final, key, input, isOptionalOut) {\n if (result.issues.length) {\n // For optional-out schemas, ignore errors on absent keys\n if (isOptionalOut && !(key in input)) {\n return;\n }\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n if (result.value === undefined) {\n if (key in input) {\n final.value[key] = undefined;\n }\n }\n else {\n final.value[key] = result.value;\n }\n}\nfunction normalizeDef(def) {\n const keys = Object.keys(def.shape);\n for (const k of keys) {\n if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n throw new Error(`Invalid element at key \"${k}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n ...def,\n keys,\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst) {\n const unrecognized = [];\n // iterate over input keys\n const keySet = def.keySet;\n const _catchall = def.catchall._zod;\n const t = _catchall.def.type;\n const isOptionalOut = _catchall.optout === \"optional\";\n for (const key in input) {\n if (keySet.has(key))\n continue;\n if (t === \"never\") {\n unrecognized.push(key);\n continue;\n }\n const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalOut);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n });\n }\n if (!proms.length)\n return payload;\n return Promise.all(proms).then(() => {\n return payload;\n });\n}\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodType.init(inst, def);\n // const sh = def.shape;\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n if (!desc?.get) {\n const sh = def.shape;\n Object.defineProperty(def, \"shape\", {\n get: () => {\n const newSh = { ...sh };\n Object.defineProperty(def, \"shape\", {\n value: newSh,\n });\n return newSh;\n },\n });\n }\n const _normalized = util.cached(() => normalizeDef(def));\n util.defineLazy(inst._zod, \"propValues\", () => {\n const shape = def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n propValues[key] ?? (propValues[key] = new Set());\n for (const v of field.values)\n propValues[key].add(v);\n }\n }\n return propValues;\n });\n const isObject = util.isObject;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = {};\n const proms = [];\n const shape = value.shape;\n for (const key of value.keys) {\n const el = shape[key];\n const isOptionalOut = el._zod.optout === \"optional\";\n const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalOut);\n }\n }\n if (!catchall) {\n return proms.length ? Promise.all(proms).then(() => payload) : payload;\n }\n return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);\n };\n});\nexport const $ZodObjectJIT = /*@__PURE__*/ core.$constructor(\"$ZodObjectJIT\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodObject.init(inst, def);\n const superParse = inst._zod.parse;\n const _normalized = util.cached(() => normalizeDef(def));\n const generateFastpass = (shape) => {\n const doc = new Doc([\"shape\", \"payload\", \"ctx\"]);\n const normalized = _normalized.value;\n const parseStr = (key) => {\n const k = util.esc(key);\n return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n };\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n let counter = 0;\n for (const key of normalized.keys) {\n ids[key] = `key_${counter++}`;\n }\n // A: preserve key order {\n doc.write(`const newResult = {};`);\n for (const key of normalized.keys) {\n const id = ids[key];\n const k = util.esc(key);\n const schema = shape[key];\n const isOptionalOut = schema?._zod?.optout === \"optional\";\n doc.write(`const ${id} = ${parseStr(key)};`);\n if (isOptionalOut) {\n // For optional-out schemas, ignore errors on absent keys\n doc.write(`\n if (${id}.issues.length) {\n if (${k} in input) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n else {\n doc.write(`\n if (${id}.issues.length) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n const fn = doc.compile();\n return (payload, ctx) => fn(shape, payload, ctx);\n };\n let fastpass;\n const isObject = util.isObject;\n const jit = !core.globalConfig.jitless;\n const allowsEval = util.allowsEval;\n const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n // always synchronous\n if (!fastpass)\n fastpass = generateFastpass(def.shape);\n payload = fastpass(payload, ctx);\n if (!catchall)\n return payload;\n return handleCatchall([], input, payload, ctx, value, inst);\n }\n return superParse(payload, ctx);\n };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n for (const result of results) {\n if (result.issues.length === 0) {\n final.value = result.value;\n return final;\n }\n }\n const nonaborted = results.filter((r) => !util.aborted(r));\n if (nonaborted.length === 1) {\n final.value = nonaborted[0].value;\n return nonaborted[0];\n }\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.options.some((o) => o._zod.optin === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"optout\", () => def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"values\", () => {\n if (def.options.every((o) => o._zod.values)) {\n return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n if (def.options.every((o) => o._zod.pattern)) {\n const patterns = def.options.map((o) => o._zod.pattern);\n return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n }\n return undefined;\n });\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n if (result.issues.length === 0)\n return result;\n results.push(result);\n }\n }\n if (!async)\n return handleUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleUnionResults(results, payload, inst, ctx);\n });\n };\n});\nfunction handleExclusiveUnionResults(results, final, inst, ctx) {\n const successes = results.filter((r) => r.issues.length === 0);\n if (successes.length === 1) {\n final.value = successes[0].value;\n return final;\n }\n if (successes.length === 0) {\n // No matches - same as regular union\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n }\n else {\n // Multiple matches - exclusive union failure\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: [],\n inclusive: false,\n });\n }\n return final;\n}\nexport const $ZodXor = /*@__PURE__*/ core.$constructor(\"$ZodXor\", (inst, def) => {\n $ZodUnion.init(inst, def);\n def.inclusive = false;\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n results.push(result);\n }\n }\n if (!async)\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n });\n };\n});\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n def.inclusive = false;\n $ZodUnion.init(inst, def);\n const _super = inst._zod.parse;\n util.defineLazy(inst._zod, \"propValues\", () => {\n const propValues = {};\n for (const option of def.options) {\n const pv = option._zod.propValues;\n if (!pv || Object.keys(pv).length === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const [k, v] of Object.entries(pv)) {\n if (!propValues[k])\n propValues[k] = new Set();\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n return propValues;\n });\n const disc = util.cached(() => {\n const opts = def.options;\n const map = new Map();\n for (const o of opts) {\n const values = o._zod.propValues?.[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(o)}\"`);\n for (const v of values) {\n if (map.has(v)) {\n throw new Error(`Duplicate discriminator value \"${String(v)}\"`);\n }\n map.set(v, o);\n }\n }\n return map;\n });\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isObject(input)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"object\",\n input,\n inst,\n });\n return payload;\n }\n const opt = disc.value.get(input?.[def.discriminator]);\n if (opt) {\n return opt._zod.run(payload, ctx);\n }\n if (def.unionFallback) {\n return _super(payload, ctx);\n }\n // no matching discriminator\n payload.issues.push({\n code: \"invalid_union\",\n errors: [],\n note: \"No matching discriminator\",\n discriminator: def.discriminator,\n input,\n path: [def.discriminator],\n inst,\n });\n return payload;\n };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n const async = left instanceof Promise || right instanceof Promise;\n if (async) {\n return Promise.all([left, right]).then(([left, right]) => {\n return handleIntersectionResults(payload, left, right);\n });\n }\n return handleIntersectionResults(payload, left, right);\n };\n});\nfunction mergeValues(a, b) {\n // const aType = parse.t(a);\n // const bType = parse.t(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n if (a instanceof Date && b instanceof Date && +a === +b) {\n return { valid: true, data: a };\n }\n if (util.isPlainObject(a) && util.isPlainObject(b)) {\n const bKeys = Object.keys(b);\n const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return { valid: false, mergeErrorPath: [] };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n // Track which side(s) report each key as unrecognized\n const unrecKeys = new Map();\n let unrecIssue;\n for (const iss of left.issues) {\n if (iss.code === \"unrecognized_keys\") {\n unrecIssue ?? (unrecIssue = iss);\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).l = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n for (const iss of right.issues) {\n if (iss.code === \"unrecognized_keys\") {\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).r = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n // Report only keys unrecognized by BOTH sides\n const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);\n if (bothKeys.length && unrecIssue) {\n result.issues.push({ ...unrecIssue, keys: bothKeys });\n }\n if (util.aborted(result))\n return result;\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n }\n result.value = merged.data;\n return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n $ZodType.init(inst, def);\n const items = def.items;\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n input,\n inst,\n expected: \"tuple\",\n code: \"invalid_type\",\n });\n return payload;\n }\n payload.value = [];\n const proms = [];\n const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== \"optional\");\n const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;\n if (!def.rest) {\n const tooBig = input.length > items.length;\n const tooSmall = input.length < optStart - 1;\n if (tooBig || tooSmall) {\n payload.issues.push({\n ...(tooBig\n ? { code: \"too_big\", maximum: items.length, inclusive: true }\n : { code: \"too_small\", minimum: items.length }),\n input,\n inst,\n origin: \"array\",\n });\n return payload;\n }\n }\n let i = -1;\n for (const item of items) {\n i++;\n if (i >= input.length)\n if (i >= optStart)\n continue;\n const result = item._zod.run({\n value: input[i],\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n if (def.rest) {\n const rest = input.slice(items.length);\n for (const el of rest) {\n i++;\n const result = def.rest._zod.run({\n value: el,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleTupleResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isPlainObject(input)) {\n payload.issues.push({\n expected: \"record\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n const values = def.keyType._zod.values;\n if (values) {\n payload.value = {};\n const recordKeys = new Set();\n for (const key of values) {\n if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n recordKeys.add(typeof key === \"number\" ? key.toString() : key);\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!recordKeys.has(key)) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n });\n }\n }\n else {\n payload.value = {};\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n // Numeric string fallback: if key failed with \"expected number\", retry with Number(key)\n const checkNumericKey = typeof key === \"string\" &&\n regexes.number.test(key) &&\n keyResult.issues.length &&\n keyResult.issues.some((iss) => iss.code === \"invalid_type\" && iss.expected === \"number\");\n if (checkNumericKey) {\n const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);\n if (retryResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (retryResult.issues.length === 0) {\n keyResult = retryResult;\n }\n }\n if (keyResult.issues.length) {\n if (def.mode === \"loose\") {\n // Pass through unchanged\n payload.value[key] = input[key];\n }\n else {\n // Default \"strict\" behavior: error on invalid key\n payload.issues.push({\n code: \"invalid_key\",\n origin: \"record\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n }\n continue;\n }\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload;\n };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Map)) {\n payload.issues.push({\n expected: \"map\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n payload.value = new Map();\n for (const [key, value] of input) {\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n if (keyResult instanceof Promise || valueResult instanceof Promise) {\n proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }));\n }\n else {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n if (keyResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, keyResult.issues));\n }\n else {\n final.issues.push({\n code: \"invalid_key\",\n origin: \"map\",\n input,\n inst,\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n if (valueResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, valueResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_element\",\n input,\n inst,\n key: key,\n issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Set)) {\n payload.issues.push({\n input,\n inst,\n expected: \"set\",\n code: \"invalid_type\",\n });\n return payload;\n }\n const proms = [];\n payload.value = new Set();\n for (const item of input) {\n const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleSetResult(result, payload)));\n }\n else\n handleSetResult(result, payload);\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleSetResult(result, final) {\n if (result.issues.length) {\n final.issues.push(...result.issues);\n }\n final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = util.getEnumValues(def.entries);\n const valuesSet = new Set(values);\n inst._zod.values = valuesSet;\n inst._zod.pattern = new RegExp(`^(${values\n .filter((k) => util.propertyKeyTypes.has(typeof k))\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o.toString()))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (valuesSet.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n if (def.values.length === 0) {\n throw new Error(\"Cannot create literal schema with no valid values\");\n }\n const values = new Set(def.values);\n inst._zod.values = values;\n inst._zod.pattern = new RegExp(`^(${def.values\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values: def.values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n // @ts-ignore\n if (input instanceof File)\n return payload;\n payload.issues.push({\n expected: \"file\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n const _out = def.transform(payload.value, payload);\n if (ctx.async) {\n const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n if (_out instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n payload.value = _out;\n return payload;\n };\n});\nfunction handleOptionalResult(result, input) {\n if (result.issues.length && input === undefined) {\n return { issues: [], value: undefined };\n }\n return result;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (def.innerType._zod.optin === \"optional\") {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise)\n return result.then((r) => handleOptionalResult(r, payload.value));\n return handleOptionalResult(result, payload.value);\n }\n if (payload.value === undefined) {\n return payload;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodExactOptional = /*@__PURE__*/ core.$constructor(\"$ZodExactOptional\", (inst, def) => {\n // Call parent init - inherits optin/optout = \"optional\"\n $ZodOptional.init(inst, def);\n // Override values/pattern to NOT add undefined\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"pattern\", () => def.innerType._zod.pattern);\n // Override parse to just delegate (no undefined handling)\n inst._zod.parse = (payload, ctx) => {\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n // Forward direction (decode): allow null to pass through\n if (payload.value === null)\n return payload;\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n $ZodType.init(inst, def);\n // inst._zod.qin = \"true\";\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply defaults for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n /**\n * $ZodDefault returns the default value immediately in forward direction.\n * It doesn't pass the default value into the validator (\"prefault\"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a \"prefault\" for the pipe. */\n return payload;\n }\n // Forward direction: continue with default handling\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleDefaultResult(result, def));\n }\n return handleDefaultResult(result, def);\n };\n});\nfunction handleDefaultResult(payload, def) {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply prefault for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n const v = def.innerType._zod.values;\n return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleNonOptionalResult(result, inst));\n }\n return handleNonOptionalResult(result, inst);\n };\n});\nfunction handleNonOptionalResult(payload, inst) {\n if (!payload.issues.length && payload.value === undefined) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: payload.value,\n inst,\n });\n }\n return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(\"ZodSuccess\");\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.issues.length === 0;\n return payload;\n });\n }\n payload.value = result.issues.length === 0;\n return payload;\n };\n});\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply catch logic\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n });\n }\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"nan\",\n code: \"invalid_type\",\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handlePipeResult(right, def.in, ctx));\n }\n return handlePipeResult(right, def.in, ctx);\n }\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handlePipeResult(left, def.out, ctx));\n }\n return handlePipeResult(left, def.out, ctx);\n };\n});\nfunction handlePipeResult(left, next, ctx) {\n if (left.issues.length) {\n // prevent further checks\n left.aborted = true;\n return left;\n }\n return next._zod.run({ value: left.value, issues: left.issues }, ctx);\n}\nexport const $ZodCodec = /*@__PURE__*/ core.$constructor(\"$ZodCodec\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handleCodecAResult(left, def, ctx));\n }\n return handleCodecAResult(left, def, ctx);\n }\n else {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handleCodecAResult(right, def, ctx));\n }\n return handleCodecAResult(right, def, ctx);\n }\n };\n});\nfunction handleCodecAResult(result, def, ctx) {\n if (result.issues.length) {\n // prevent further checks\n result.aborted = true;\n return result;\n }\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const transformed = def.transform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));\n }\n return handleCodecTxResult(result, transformed, def.out, ctx);\n }\n else {\n const transformed = def.reverseTransform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));\n }\n return handleCodecTxResult(result, transformed, def.in, ctx);\n }\n}\nfunction handleCodecTxResult(left, value, nextSchema, ctx) {\n // Check if transform added any issues\n if (left.issues.length) {\n left.aborted = true;\n return left;\n }\n return nextSchema._zod.run({ value, issues: left.issues }, ctx);\n}\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"propValues\", () => def.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType?._zod?.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType?._zod?.optout);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then(handleReadonlyResult);\n }\n return handleReadonlyResult(result);\n };\n});\nfunction handleReadonlyResult(payload) {\n payload.value = Object.freeze(payload.value);\n return payload;\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const regexParts = [];\n for (const part of def.parts) {\n if (typeof part === \"object\" && part !== null) {\n // is Zod schema\n if (!part._zod.pattern) {\n // if (!source)\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;\n if (!source)\n throw new Error(`Invalid template literal part: ${part._zod.traits}`);\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n regexParts.push(source.slice(start, end));\n }\n else if (part === null || util.primitiveTypes.has(typeof part)) {\n regexParts.push(util.escapeRegex(`${part}`));\n }\n else {\n throw new Error(`Invalid template literal part: ${part}`);\n }\n }\n inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"string\") {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"string\",\n code: \"invalid_type\",\n });\n return payload;\n }\n inst._zod.pattern.lastIndex = 0;\n if (!inst._zod.pattern.test(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n code: \"invalid_format\",\n format: def.format ?? \"template_literal\",\n pattern: inst._zod.pattern.source,\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodFunction = /*@__PURE__*/ core.$constructor(\"$ZodFunction\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._def = def;\n inst._zod.def = def;\n inst.implement = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implement() must be called with a function\");\n }\n return function (...args) {\n const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;\n const result = Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return parse(inst._def.output, result);\n }\n return result;\n };\n };\n inst.implementAsync = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implementAsync() must be called with a function\");\n }\n return async function (...args) {\n const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;\n const result = await Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return await parseAsync(inst._def.output, result);\n }\n return result;\n };\n };\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"function\") {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"function\",\n input: payload.value,\n inst,\n });\n return payload;\n }\n // Check if output is a promise type to determine if we should use async implementation\n const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === \"promise\";\n if (hasPromiseOutput) {\n payload.value = inst.implementAsync(payload.value);\n }\n else {\n payload.value = inst.implement(payload.value);\n }\n return payload;\n };\n inst.input = (...args) => {\n const F = inst.constructor;\n if (Array.isArray(args[0])) {\n return new F({\n type: \"function\",\n input: new $ZodTuple({\n type: \"tuple\",\n items: args[0],\n rest: args[1],\n }),\n output: inst._def.output,\n });\n }\n return new F({\n type: \"function\",\n input: args[0],\n output: inst._def.output,\n });\n };\n inst.output = (output) => {\n const F = inst.constructor;\n return new F({\n type: \"function\",\n input: inst._def.input,\n output,\n });\n };\n return inst;\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n $ZodType.init(inst, def);\n // let _innerType!: any;\n // util.defineLazy(def, \"getter\", () => {\n // if (!_innerType) {\n // _innerType = def.getter();\n // }\n // return () => _innerType;\n // });\n util.defineLazy(inst._zod, \"innerType\", () => def.getter());\n util.defineLazy(inst._zod, \"pattern\", () => inst._zod.innerType?._zod?.pattern);\n util.defineLazy(inst._zod, \"propValues\", () => inst._zod.innerType?._zod?.propValues);\n util.defineLazy(inst._zod, \"optin\", () => inst._zod.innerType?._zod?.optin ?? undefined);\n util.defineLazy(inst._zod, \"optout\", () => inst._zod.innerType?._zod?.optout ?? undefined);\n inst._zod.parse = (payload, ctx) => {\n const inner = inst._zod.innerType;\n return inner._zod.run(payload, ctx);\n };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n checks.$ZodCheck.init(inst, def);\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _) => {\n return payload;\n };\n inst._zod.check = (payload) => {\n const input = payload.value;\n const r = def.fn(input);\n if (r instanceof Promise) {\n return r.then((r) => handleRefineResult(r, payload, input, inst));\n }\n handleRefineResult(r, payload, input, inst);\n return;\n };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n if (!result) {\n const _iss = {\n code: \"custom\",\n input,\n inst, // incorporates params.error into issue reporting\n path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n continue: !inst._zod.def.abort,\n // params: inst._zod.def.params,\n };\n if (inst._zod.def.params)\n _iss.params = inst._zod.def.params;\n payload.issues.push(util.issue(_iss));\n }\n}\n"],"names":["core.$constructor","checks","util.aborted","core.$ZodAsyncError","checkResult","canary","result","util.defineLazy"],"mappings":"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","x_google_ignoreList":[0]}
@@ -0,0 +1,52 @@
1
+ var _a;
2
+ class $ZodRegistry {
3
+ constructor() {
4
+ this._map = /* @__PURE__ */ new WeakMap();
5
+ this._idmap = /* @__PURE__ */ new Map();
6
+ }
7
+ add(schema, ..._meta) {
8
+ const meta = _meta[0];
9
+ this._map.set(schema, meta);
10
+ if (meta && typeof meta === "object" && "id" in meta) {
11
+ this._idmap.set(meta.id, schema);
12
+ }
13
+ return this;
14
+ }
15
+ clear() {
16
+ this._map = /* @__PURE__ */ new WeakMap();
17
+ this._idmap = /* @__PURE__ */ new Map();
18
+ return this;
19
+ }
20
+ remove(schema) {
21
+ const meta = this._map.get(schema);
22
+ if (meta && typeof meta === "object" && "id" in meta) {
23
+ this._idmap.delete(meta.id);
24
+ }
25
+ this._map.delete(schema);
26
+ return this;
27
+ }
28
+ get(schema) {
29
+ const p = schema._zod.parent;
30
+ if (p) {
31
+ const pm = { ...this.get(p) ?? {} };
32
+ delete pm.id;
33
+ const f = { ...pm, ...this._map.get(schema) };
34
+ return Object.keys(f).length ? f : void 0;
35
+ }
36
+ return this._map.get(schema);
37
+ }
38
+ has(schema) {
39
+ return this._map.has(schema);
40
+ }
41
+ }
42
+ function registry() {
43
+ return new $ZodRegistry();
44
+ }
45
+ (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
46
+ const globalRegistry = globalThis.__zod_globalRegistry;
47
+ export {
48
+ $ZodRegistry,
49
+ globalRegistry,
50
+ registry
51
+ };
52
+ //# sourceMappingURL=index.es121.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es121.js","sources":["../node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/registries.js"],"sourcesContent":["var _a;\nexport const $output = Symbol(\"ZodOutput\");\nexport const $input = Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n constructor() {\n this._map = new WeakMap();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n clear() {\n this._map = new WeakMap();\n this._idmap = new Map();\n return this;\n }\n remove(schema) {\n const meta = this._map.get(schema);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.delete(meta.id);\n }\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n const f = { ...pm, ...this._map.get(schema) };\n return Object.keys(f).length ? f : undefined;\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nexport function registry() {\n return new $ZodRegistry();\n}\n(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());\nexport const globalRegistry = globalThis.__zod_globalRegistry;\n"],"names":[],"mappings":"AAAA,IAAI;AAGG,MAAM,aAAa;AAAA,EACtB,cAAc;AACV,SAAK,OAAO,oBAAI,QAAO;AACvB,SAAK,SAAS,oBAAI,IAAG;AAAA,EACzB;AAAA,EACA,IAAI,WAAW,OAAO;AAClB,UAAM,OAAO,MAAM,CAAC;AACpB,SAAK,KAAK,IAAI,QAAQ,IAAI;AAC1B,QAAI,QAAQ,OAAO,SAAS,YAAY,QAAQ,MAAM;AAClD,WAAK,OAAO,IAAI,KAAK,IAAI,MAAM;AAAA,IACnC;AACA,WAAO;AAAA,EACX;AAAA,EACA,QAAQ;AACJ,SAAK,OAAO,oBAAI,QAAO;AACvB,SAAK,SAAS,oBAAI,IAAG;AACrB,WAAO;AAAA,EACX;AAAA,EACA,OAAO,QAAQ;AACX,UAAM,OAAO,KAAK,KAAK,IAAI,MAAM;AACjC,QAAI,QAAQ,OAAO,SAAS,YAAY,QAAQ,MAAM;AAClD,WAAK,OAAO,OAAO,KAAK,EAAE;AAAA,IAC9B;AACA,SAAK,KAAK,OAAO,MAAM;AACvB,WAAO;AAAA,EACX;AAAA,EACA,IAAI,QAAQ;AAGR,UAAM,IAAI,OAAO,KAAK;AACtB,QAAI,GAAG;AACH,YAAM,KAAK,EAAE,GAAI,KAAK,IAAI,CAAC,KAAK,CAAA,EAAG;AACnC,aAAO,GAAG;AACV,YAAM,IAAI,EAAE,GAAG,IAAI,GAAG,KAAK,KAAK,IAAI,MAAM,EAAC;AAC3C,aAAO,OAAO,KAAK,CAAC,EAAE,SAAS,IAAI;AAAA,IACvC;AACA,WAAO,KAAK,KAAK,IAAI,MAAM;AAAA,EAC/B;AAAA,EACA,IAAI,QAAQ;AACR,WAAO,KAAK,KAAK,IAAI,MAAM;AAAA,EAC/B;AACJ;AAEO,SAAS,WAAW;AACvB,SAAO,IAAI,aAAY;AAC3B;AAAA,CACC,KAAK,YAAY,yBAAyB,GAAG,uBAAuB,SAAQ;AACjE,MAAC,iBAAiB,WAAW;","x_google_ignoreList":[0]}
@@ -0,0 +1,13 @@
1
+ import { normalizeParams } from "./index.es119.js";
2
+ import "./index.es121.js";
3
+ // @__NO_SIDE_EFFECTS__
4
+ function _never(Class, params) {
5
+ return new Class({
6
+ type: "never",
7
+ ...normalizeParams()
8
+ });
9
+ }
10
+ export {
11
+ _never
12
+ };
13
+ //# sourceMappingURL=index.es122.js.map