@lssm/lib.ui-kit 1.10.0 → 1.11.1

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 (363) hide show
  1. package/README.md +11 -0
  2. package/dist/index.d.ts +1 -2
  3. package/dist/index.js +1 -2
  4. package/dist/tsconfig.tsbuildinfo +1 -1
  5. package/dist/ui/accordion.d.ts +6 -7
  6. package/dist/ui/accordion.js +1 -2
  7. package/dist/ui/alert-dialog.d.ts +12 -13
  8. package/dist/ui/alert-dialog.js +1 -2
  9. package/dist/ui/alert.d.ts +7 -8
  10. package/dist/ui/alert.js +1 -2
  11. package/dist/ui/aspect-ratio.d.ts +1 -2
  12. package/dist/ui/aspect-ratio.js +1 -2
  13. package/dist/ui/atoms/FilterSelect/FilterSelect.d.ts +1 -2
  14. package/dist/ui/atoms/FilterSelect/FilterSelect.js +1 -2
  15. package/dist/ui/atoms/FilterSelect/types.d.ts +1 -2
  16. package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.d.ts +1 -2
  17. package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.js +1 -2
  18. package/dist/ui/atoms/Pagination/Pagination.d.ts +1 -2
  19. package/dist/ui/atoms/Pagination/Pagination.js +1 -2
  20. package/dist/ui/atoms/Pagination/types.d.ts +1 -2
  21. package/dist/ui/atoms/SearchInput/SearchInput.d.ts +1 -2
  22. package/dist/ui/atoms/SearchInput/SearchInput.js +1 -2
  23. package/dist/ui/atoms/SearchInput/types.d.ts +1 -2
  24. package/dist/ui/avatar.d.ts +5 -6
  25. package/dist/ui/avatar.js +1 -2
  26. package/dist/ui/badge.d.ts +6 -7
  27. package/dist/ui/badge.js +1 -2
  28. package/dist/ui/breadcrumb.d.ts +9 -10
  29. package/dist/ui/breadcrumb.js +1 -2
  30. package/dist/ui/button.d.ts +8 -9
  31. package/dist/ui/button.js +1 -2
  32. package/dist/ui/card.d.ts +8 -9
  33. package/dist/ui/card.js +1 -2
  34. package/dist/ui/carousel.d.ts +1 -2
  35. package/dist/ui/carousel.js +1 -2
  36. package/dist/ui/checkbox.d.ts +4 -5
  37. package/dist/ui/checkbox.js +1 -2
  38. package/dist/ui/collapsible.d.ts +9 -10
  39. package/dist/ui/collapsible.js +1 -2
  40. package/dist/ui/command.d.ts +1 -2
  41. package/dist/ui/command.js +1 -2
  42. package/dist/ui/context-menu.d.ts +17 -18
  43. package/dist/ui/context-menu.js +1 -2
  44. package/dist/ui/date-picker.d.ts +3 -4
  45. package/dist/ui/date-picker.js +1 -2
  46. package/dist/ui/date-range-picker.d.ts +3 -4
  47. package/dist/ui/date-range-picker.js +1 -2
  48. package/dist/ui/datetime-picker.d.ts +3 -4
  49. package/dist/ui/datetime-picker.js +1 -2
  50. package/dist/ui/dialog.d.ts +11 -12
  51. package/dist/ui/dialog.js +1 -2
  52. package/dist/ui/dropdown-menu.d.ts +17 -18
  53. package/dist/ui/dropdown-menu.js +1 -2
  54. package/dist/ui/empty-state.d.ts +5 -6
  55. package/dist/ui/empty-state.js +1 -2
  56. package/dist/ui/empty.d.ts +10 -11
  57. package/dist/ui/empty.js +1 -2
  58. package/dist/ui/fab.d.ts +4 -5
  59. package/dist/ui/fab.js +1 -2
  60. package/dist/ui/field.d.ts +15 -16
  61. package/dist/ui/field.js +1 -2
  62. package/dist/ui/form.d.ts +8 -9
  63. package/dist/ui/form.js +2 -3
  64. package/dist/ui/hover-card.d.ts +7 -8
  65. package/dist/ui/hover-card.js +1 -2
  66. package/dist/ui/icons/Check.js +1 -2
  67. package/dist/ui/icons/ChevronDown.js +1 -2
  68. package/dist/ui/icons/ChevronRight.js +1 -2
  69. package/dist/ui/icons/ChevronUp.js +1 -2
  70. package/dist/ui/icons/CircleUser.js +1 -2
  71. package/dist/ui/icons/Info.js +1 -2
  72. package/dist/ui/icons/Key.js +1 -2
  73. package/dist/ui/icons/MoonStar.js +1 -2
  74. package/dist/ui/icons/Sun.js +1 -2
  75. package/dist/ui/icons/X.js +1 -2
  76. package/dist/ui/icons/iconWithClassName.d.ts +1 -2
  77. package/dist/ui/icons/iconWithClassName.js +1 -2
  78. package/dist/ui/input.d.ts +3 -4
  79. package/dist/ui/input.js +1 -2
  80. package/dist/ui/label.d.ts +3 -4
  81. package/dist/ui/label.js +1 -2
  82. package/dist/ui/link.d.ts +3 -4
  83. package/dist/ui/link.js +1 -2
  84. package/dist/ui/loading-button.d.ts +3 -4
  85. package/dist/ui/loading-button.js +1 -2
  86. package/dist/ui/loading-overlay.d.ts +3 -4
  87. package/dist/ui/loading-overlay.js +1 -2
  88. package/dist/ui/loading-screen.d.ts +3 -4
  89. package/dist/ui/loading-screen.js +1 -2
  90. package/dist/ui/marketing/FeatureGrid.d.ts +3 -4
  91. package/dist/ui/marketing/FeatureGrid.js +1 -2
  92. package/dist/ui/marketing/Hero.d.ts +3 -4
  93. package/dist/ui/marketing/Hero.js +1 -2
  94. package/dist/ui/marketing/PricingTable.d.ts +3 -4
  95. package/dist/ui/marketing/PricingTable.js +1 -2
  96. package/dist/ui/menubar.d.ts +18 -19
  97. package/dist/ui/menubar.js +1 -2
  98. package/dist/ui/molecules/Autocomplete/index.d.ts +1 -2
  99. package/dist/ui/molecules/Autocomplete/index.js +1 -2
  100. package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.d.ts +1 -2
  101. package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js +1 -2
  102. package/dist/ui/molecules/SearchAndFilter/types.d.ts +1 -2
  103. package/dist/ui/molecules/SkeletonList.d.ts +3 -4
  104. package/dist/ui/molecules/SkeletonList.js +1 -2
  105. package/dist/ui/navigation-menu.d.ts +13 -14
  106. package/dist/ui/navigation-menu.js +1 -2
  107. package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.d.ts +3 -4
  108. package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js +1 -2
  109. package/dist/ui/organisms/ListPage/ListPage.d.ts +3 -4
  110. package/dist/ui/organisms/ListPage/ListPage.js +1 -2
  111. package/dist/ui/organisms/ListPage/types.d.ts +1 -2
  112. package/dist/ui/page-header.d.ts +6 -7
  113. package/dist/ui/page-header.js +1 -2
  114. package/dist/ui/password-strength.d.ts +3 -4
  115. package/dist/ui/password-strength.js +1 -2
  116. package/dist/ui/popover.d.ts +7 -8
  117. package/dist/ui/popover.js +1 -2
  118. package/dist/ui/progress.d.ts +3 -4
  119. package/dist/ui/progress.js +1 -2
  120. package/dist/ui/radio-group.d.ts +4 -5
  121. package/dist/ui/radio-group.js +1 -2
  122. package/dist/ui/select.d.ts +14 -15
  123. package/dist/ui/select.js +1 -2
  124. package/dist/ui/separator.d.ts +3 -4
  125. package/dist/ui/separator.js +1 -2
  126. package/dist/ui/sheet.d.ts +1 -2
  127. package/dist/ui/sheet.js +1 -2
  128. package/dist/ui/sidebar.d.ts +1 -2
  129. package/dist/ui/sidebar.js +1 -2
  130. package/dist/ui/skeleton.d.ts +3 -4
  131. package/dist/ui/skeleton.js +1 -2
  132. package/dist/ui/stack.d.ts +20 -21
  133. package/dist/ui/stack.js +1 -2
  134. package/dist/ui/stepper.d.ts +5 -6
  135. package/dist/ui/stepper.js +1 -2
  136. package/dist/ui/switch.d.ts +3 -4
  137. package/dist/ui/switch.js +1 -2
  138. package/dist/ui/table.d.ts +9 -10
  139. package/dist/ui/table.js +1 -2
  140. package/dist/ui/tabs.d.ts +12 -13
  141. package/dist/ui/tabs.js +1 -2
  142. package/dist/ui/text.d.ts +3 -4
  143. package/dist/ui/text.js +1 -2
  144. package/dist/ui/textarea.d.ts +1 -2
  145. package/dist/ui/textarea.js +1 -2
  146. package/dist/ui/time-picker.d.ts +3 -4
  147. package/dist/ui/time-picker.js +1 -2
  148. package/dist/ui/toggle-group.d.ts +5 -6
  149. package/dist/ui/toggle-group.js +1 -2
  150. package/dist/ui/toggle.d.ts +7 -8
  151. package/dist/ui/toggle.js +1 -2
  152. package/dist/ui/tooltip.d.ts +7 -8
  153. package/dist/ui/tooltip.js +1 -2
  154. package/dist/ui/typography.d.ts +13 -14
  155. package/dist/ui/typography.js +1 -2
  156. package/dist/ui/useColorScheme.d.ts +3 -4
  157. package/dist/ui/useColorScheme.js +1 -2
  158. package/dist/ui/useListState.d.ts +1 -2
  159. package/dist/ui/useListState.js +1 -2
  160. package/dist/ui/usecases/UseCaseCard.d.ts +3 -4
  161. package/dist/ui/usecases/UseCaseCard.js +1 -2
  162. package/dist/ui/usecases/UserStoryCard.d.ts +3 -4
  163. package/dist/ui/usecases/UserStoryCard.js +1 -2
  164. package/dist/ui/utils.d.ts +1 -2
  165. package/dist/ui/utils.js +1 -2
  166. package/package.json +5 -3
  167. package/dist/index.d.ts.map +0 -1
  168. package/dist/index.js.map +0 -1
  169. package/dist/node_modules/@hookform/resolvers/dist/resolvers.js +0 -29
  170. package/dist/node_modules/@hookform/resolvers/dist/resolvers.js.map +0 -1
  171. package/dist/node_modules/@hookform/resolvers/zod/dist/zod.js +0 -61
  172. package/dist/node_modules/@hookform/resolvers/zod/dist/zod.js.map +0 -1
  173. package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -2073
  174. package/dist/node_modules/react-hook-form/dist/index.esm.js.map +0 -1
  175. package/dist/node_modules/zod/v4/classic/errors.js +0 -30
  176. package/dist/node_modules/zod/v4/classic/errors.js.map +0 -1
  177. package/dist/node_modules/zod/v4/classic/iso.js +0 -38
  178. package/dist/node_modules/zod/v4/classic/iso.js.map +0 -1
  179. package/dist/node_modules/zod/v4/classic/parse.js +0 -20
  180. package/dist/node_modules/zod/v4/classic/parse.js.map +0 -1
  181. package/dist/node_modules/zod/v4/classic/schemas.js +0 -395
  182. package/dist/node_modules/zod/v4/classic/schemas.js.map +0 -1
  183. package/dist/node_modules/zod/v4/core/api.js +0 -377
  184. package/dist/node_modules/zod/v4/core/api.js.map +0 -1
  185. package/dist/node_modules/zod/v4/core/checks.js +0 -226
  186. package/dist/node_modules/zod/v4/core/checks.js.map +0 -1
  187. package/dist/node_modules/zod/v4/core/core.js +0 -56
  188. package/dist/node_modules/zod/v4/core/core.js.map +0 -1
  189. package/dist/node_modules/zod/v4/core/errors.js +0 -63
  190. package/dist/node_modules/zod/v4/core/errors.js.map +0 -1
  191. package/dist/node_modules/zod/v4/core/parse.js +0 -110
  192. package/dist/node_modules/zod/v4/core/parse.js.map +0 -1
  193. package/dist/node_modules/zod/v4/core/regexes.js +0 -59
  194. package/dist/node_modules/zod/v4/core/regexes.js.map +0 -1
  195. package/dist/node_modules/zod/v4/core/registries.js +0 -51
  196. package/dist/node_modules/zod/v4/core/registries.js.map +0 -1
  197. package/dist/node_modules/zod/v4/core/schemas.js +0 -755
  198. package/dist/node_modules/zod/v4/core/schemas.js.map +0 -1
  199. package/dist/node_modules/zod/v4/core/util.js +0 -152
  200. package/dist/node_modules/zod/v4/core/util.js.map +0 -1
  201. package/dist/node_modules/zod/v4/core/versions.js +0 -10
  202. package/dist/node_modules/zod/v4/core/versions.js.map +0 -1
  203. package/dist/ui/accordion.d.ts.map +0 -1
  204. package/dist/ui/accordion.js.map +0 -1
  205. package/dist/ui/alert-dialog.d.ts.map +0 -1
  206. package/dist/ui/alert-dialog.js.map +0 -1
  207. package/dist/ui/alert.d.ts.map +0 -1
  208. package/dist/ui/alert.js.map +0 -1
  209. package/dist/ui/aspect-ratio.d.ts.map +0 -1
  210. package/dist/ui/aspect-ratio.js.map +0 -1
  211. package/dist/ui/atoms/FilterSelect/FilterSelect.d.ts.map +0 -1
  212. package/dist/ui/atoms/FilterSelect/FilterSelect.js.map +0 -1
  213. package/dist/ui/atoms/FilterSelect/types.d.ts.map +0 -1
  214. package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.d.ts.map +0 -1
  215. package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.js.map +0 -1
  216. package/dist/ui/atoms/Pagination/Pagination.d.ts.map +0 -1
  217. package/dist/ui/atoms/Pagination/Pagination.js.map +0 -1
  218. package/dist/ui/atoms/Pagination/types.d.ts.map +0 -1
  219. package/dist/ui/atoms/SearchInput/SearchInput.d.ts.map +0 -1
  220. package/dist/ui/atoms/SearchInput/SearchInput.js.map +0 -1
  221. package/dist/ui/atoms/SearchInput/types.d.ts.map +0 -1
  222. package/dist/ui/avatar.d.ts.map +0 -1
  223. package/dist/ui/avatar.js.map +0 -1
  224. package/dist/ui/badge.d.ts.map +0 -1
  225. package/dist/ui/badge.js.map +0 -1
  226. package/dist/ui/breadcrumb.d.ts.map +0 -1
  227. package/dist/ui/breadcrumb.js.map +0 -1
  228. package/dist/ui/button.d.ts.map +0 -1
  229. package/dist/ui/button.js.map +0 -1
  230. package/dist/ui/card.d.ts.map +0 -1
  231. package/dist/ui/card.js.map +0 -1
  232. package/dist/ui/carousel.d.ts.map +0 -1
  233. package/dist/ui/carousel.js.map +0 -1
  234. package/dist/ui/checkbox.d.ts.map +0 -1
  235. package/dist/ui/checkbox.js.map +0 -1
  236. package/dist/ui/collapsible.d.ts.map +0 -1
  237. package/dist/ui/collapsible.js.map +0 -1
  238. package/dist/ui/command.d.ts.map +0 -1
  239. package/dist/ui/command.js.map +0 -1
  240. package/dist/ui/context-menu.d.ts.map +0 -1
  241. package/dist/ui/context-menu.js.map +0 -1
  242. package/dist/ui/date-picker.d.ts.map +0 -1
  243. package/dist/ui/date-picker.js.map +0 -1
  244. package/dist/ui/date-range-picker.d.ts.map +0 -1
  245. package/dist/ui/date-range-picker.js.map +0 -1
  246. package/dist/ui/datetime-picker.d.ts.map +0 -1
  247. package/dist/ui/datetime-picker.js.map +0 -1
  248. package/dist/ui/dialog.d.ts.map +0 -1
  249. package/dist/ui/dialog.js.map +0 -1
  250. package/dist/ui/dropdown-menu.d.ts.map +0 -1
  251. package/dist/ui/dropdown-menu.js.map +0 -1
  252. package/dist/ui/empty-state.d.ts.map +0 -1
  253. package/dist/ui/empty-state.js.map +0 -1
  254. package/dist/ui/empty.d.ts.map +0 -1
  255. package/dist/ui/empty.js.map +0 -1
  256. package/dist/ui/fab.d.ts.map +0 -1
  257. package/dist/ui/fab.js.map +0 -1
  258. package/dist/ui/field.d.ts.map +0 -1
  259. package/dist/ui/field.js.map +0 -1
  260. package/dist/ui/form.d.ts.map +0 -1
  261. package/dist/ui/form.js.map +0 -1
  262. package/dist/ui/hover-card.d.ts.map +0 -1
  263. package/dist/ui/hover-card.js.map +0 -1
  264. package/dist/ui/icons/Check.js.map +0 -1
  265. package/dist/ui/icons/ChevronDown.js.map +0 -1
  266. package/dist/ui/icons/ChevronRight.js.map +0 -1
  267. package/dist/ui/icons/ChevronUp.js.map +0 -1
  268. package/dist/ui/icons/CircleUser.js.map +0 -1
  269. package/dist/ui/icons/Info.js.map +0 -1
  270. package/dist/ui/icons/Key.js.map +0 -1
  271. package/dist/ui/icons/MoonStar.js.map +0 -1
  272. package/dist/ui/icons/Sun.js.map +0 -1
  273. package/dist/ui/icons/X.js.map +0 -1
  274. package/dist/ui/icons/iconWithClassName.d.ts.map +0 -1
  275. package/dist/ui/icons/iconWithClassName.js.map +0 -1
  276. package/dist/ui/input.d.ts.map +0 -1
  277. package/dist/ui/input.js.map +0 -1
  278. package/dist/ui/label.d.ts.map +0 -1
  279. package/dist/ui/label.js.map +0 -1
  280. package/dist/ui/link.d.ts.map +0 -1
  281. package/dist/ui/link.js.map +0 -1
  282. package/dist/ui/loading-button.d.ts.map +0 -1
  283. package/dist/ui/loading-button.js.map +0 -1
  284. package/dist/ui/loading-overlay.d.ts.map +0 -1
  285. package/dist/ui/loading-overlay.js.map +0 -1
  286. package/dist/ui/loading-screen.d.ts.map +0 -1
  287. package/dist/ui/loading-screen.js.map +0 -1
  288. package/dist/ui/marketing/FeatureGrid.d.ts.map +0 -1
  289. package/dist/ui/marketing/FeatureGrid.js.map +0 -1
  290. package/dist/ui/marketing/Hero.d.ts.map +0 -1
  291. package/dist/ui/marketing/Hero.js.map +0 -1
  292. package/dist/ui/marketing/PricingTable.d.ts.map +0 -1
  293. package/dist/ui/marketing/PricingTable.js.map +0 -1
  294. package/dist/ui/menubar.d.ts.map +0 -1
  295. package/dist/ui/menubar.js.map +0 -1
  296. package/dist/ui/molecules/Autocomplete/index.d.ts.map +0 -1
  297. package/dist/ui/molecules/Autocomplete/index.js.map +0 -1
  298. package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.d.ts.map +0 -1
  299. package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js.map +0 -1
  300. package/dist/ui/molecules/SearchAndFilter/types.d.ts.map +0 -1
  301. package/dist/ui/molecules/SkeletonList.d.ts.map +0 -1
  302. package/dist/ui/molecules/SkeletonList.js.map +0 -1
  303. package/dist/ui/navigation-menu.d.ts.map +0 -1
  304. package/dist/ui/navigation-menu.js.map +0 -1
  305. package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.d.ts.map +0 -1
  306. package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js.map +0 -1
  307. package/dist/ui/organisms/ListPage/ListPage.d.ts.map +0 -1
  308. package/dist/ui/organisms/ListPage/ListPage.js.map +0 -1
  309. package/dist/ui/organisms/ListPage/types.d.ts.map +0 -1
  310. package/dist/ui/page-header.d.ts.map +0 -1
  311. package/dist/ui/page-header.js.map +0 -1
  312. package/dist/ui/password-strength.d.ts.map +0 -1
  313. package/dist/ui/password-strength.js.map +0 -1
  314. package/dist/ui/popover.d.ts.map +0 -1
  315. package/dist/ui/popover.js.map +0 -1
  316. package/dist/ui/progress.d.ts.map +0 -1
  317. package/dist/ui/progress.js.map +0 -1
  318. package/dist/ui/radio-group.d.ts.map +0 -1
  319. package/dist/ui/radio-group.js.map +0 -1
  320. package/dist/ui/select.d.ts.map +0 -1
  321. package/dist/ui/select.js.map +0 -1
  322. package/dist/ui/separator.d.ts.map +0 -1
  323. package/dist/ui/separator.js.map +0 -1
  324. package/dist/ui/sheet.d.ts.map +0 -1
  325. package/dist/ui/sheet.js.map +0 -1
  326. package/dist/ui/sidebar.d.ts.map +0 -1
  327. package/dist/ui/sidebar.js.map +0 -1
  328. package/dist/ui/skeleton.d.ts.map +0 -1
  329. package/dist/ui/skeleton.js.map +0 -1
  330. package/dist/ui/stack.d.ts.map +0 -1
  331. package/dist/ui/stack.js.map +0 -1
  332. package/dist/ui/stepper.d.ts.map +0 -1
  333. package/dist/ui/stepper.js.map +0 -1
  334. package/dist/ui/switch.d.ts.map +0 -1
  335. package/dist/ui/switch.js.map +0 -1
  336. package/dist/ui/table.d.ts.map +0 -1
  337. package/dist/ui/table.js.map +0 -1
  338. package/dist/ui/tabs.d.ts.map +0 -1
  339. package/dist/ui/tabs.js.map +0 -1
  340. package/dist/ui/text.d.ts.map +0 -1
  341. package/dist/ui/text.js.map +0 -1
  342. package/dist/ui/textarea.d.ts.map +0 -1
  343. package/dist/ui/textarea.js.map +0 -1
  344. package/dist/ui/time-picker.d.ts.map +0 -1
  345. package/dist/ui/time-picker.js.map +0 -1
  346. package/dist/ui/toggle-group.d.ts.map +0 -1
  347. package/dist/ui/toggle-group.js.map +0 -1
  348. package/dist/ui/toggle.d.ts.map +0 -1
  349. package/dist/ui/toggle.js.map +0 -1
  350. package/dist/ui/tooltip.d.ts.map +0 -1
  351. package/dist/ui/tooltip.js.map +0 -1
  352. package/dist/ui/typography.d.ts.map +0 -1
  353. package/dist/ui/typography.js.map +0 -1
  354. package/dist/ui/useColorScheme.d.ts.map +0 -1
  355. package/dist/ui/useColorScheme.js.map +0 -1
  356. package/dist/ui/useListState.d.ts.map +0 -1
  357. package/dist/ui/useListState.js.map +0 -1
  358. package/dist/ui/usecases/UseCaseCard.d.ts.map +0 -1
  359. package/dist/ui/usecases/UseCaseCard.js.map +0 -1
  360. package/dist/ui/usecases/UserStoryCard.d.ts.map +0 -1
  361. package/dist/ui/usecases/UserStoryCard.js.map +0 -1
  362. package/dist/ui/utils.d.ts.map +0 -1
  363. package/dist/ui/utils.js.map +0 -1
@@ -1,755 +0,0 @@
1
- import { $ZodAsyncError, $ZodEncodeError, $constructor, config } from "./core.js";
2
- import { aborted, cleanRegex, clone, defineLazy, finalizeIssue, isPlainObject, issue, prefixIssues } from "./util.js";
3
- import { safeParse, safeParseAsync } from "./parse.js";
4
- import { base64, base64url, cidrv4, cidrv6, cuid, cuid2, date, datetime, duration, e164, email, emoji, guid, hostname, ipv4, ipv6, ksuid, nanoid, string, time, ulid, uuid, xid } from "./regexes.js";
5
- import { $ZodCheck, $ZodCheckStringFormat } from "./checks.js";
6
- import { version } from "./versions.js";
7
-
8
- //#region ../../../node_modules/zod/v4/core/schemas.js
9
- const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
10
- var _a;
11
- inst ?? (inst = {});
12
- inst._zod.def = def;
13
- inst._zod.bag = inst._zod.bag || {};
14
- inst._zod.version = version;
15
- const checks = [...inst._zod.def.checks ?? []];
16
- if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
17
- for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
18
- if (checks.length === 0) {
19
- (_a = inst._zod).deferred ?? (_a.deferred = []);
20
- inst._zod.deferred?.push(() => {
21
- inst._zod.run = inst._zod.parse;
22
- });
23
- } else {
24
- const runChecks = (payload, checks$1, ctx) => {
25
- let isAborted = aborted(payload);
26
- let asyncResult;
27
- for (const ch of checks$1) {
28
- if (ch._zod.def.when) {
29
- if (!ch._zod.def.when(payload)) continue;
30
- } else if (isAborted) continue;
31
- const currLen = payload.issues.length;
32
- const _ = ch._zod.check(payload);
33
- if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
34
- if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
35
- await _;
36
- if (payload.issues.length === currLen) return;
37
- if (!isAborted) isAborted = aborted(payload, currLen);
38
- });
39
- else {
40
- if (payload.issues.length === currLen) continue;
41
- if (!isAborted) isAborted = aborted(payload, currLen);
42
- }
43
- }
44
- if (asyncResult) return asyncResult.then(() => {
45
- return payload;
46
- });
47
- return payload;
48
- };
49
- const handleCanaryResult = (canary, payload, ctx) => {
50
- if (aborted(canary)) {
51
- canary.aborted = true;
52
- return canary;
53
- }
54
- const checkResult = runChecks(payload, checks, ctx);
55
- if (checkResult instanceof Promise) {
56
- if (ctx.async === false) throw new $ZodAsyncError();
57
- return checkResult.then((checkResult$1) => inst._zod.parse(checkResult$1, ctx));
58
- }
59
- return inst._zod.parse(checkResult, ctx);
60
- };
61
- inst._zod.run = (payload, ctx) => {
62
- if (ctx.skipChecks) return inst._zod.parse(payload, ctx);
63
- if (ctx.direction === "backward") {
64
- const canary = inst._zod.parse({
65
- value: payload.value,
66
- issues: []
67
- }, {
68
- ...ctx,
69
- skipChecks: true
70
- });
71
- if (canary instanceof Promise) return canary.then((canary$1) => {
72
- return handleCanaryResult(canary$1, payload, ctx);
73
- });
74
- return handleCanaryResult(canary, payload, ctx);
75
- }
76
- const result = inst._zod.parse(payload, ctx);
77
- if (result instanceof Promise) {
78
- if (ctx.async === false) throw new $ZodAsyncError();
79
- return result.then((result$1) => runChecks(result$1, checks, ctx));
80
- }
81
- return runChecks(result, checks, ctx);
82
- };
83
- }
84
- inst["~standard"] = {
85
- validate: (value) => {
86
- try {
87
- const r = safeParse(inst, value);
88
- return r.success ? { value: r.data } : { issues: r.error?.issues };
89
- } catch (_) {
90
- return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
91
- }
92
- },
93
- vendor: "zod",
94
- version: 1
95
- };
96
- });
97
- const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
98
- $ZodType.init(inst, def);
99
- inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
100
- inst._zod.parse = (payload, _) => {
101
- if (def.coerce) try {
102
- payload.value = String(payload.value);
103
- } catch (_$1) {}
104
- if (typeof payload.value === "string") return payload;
105
- payload.issues.push({
106
- expected: "string",
107
- code: "invalid_type",
108
- input: payload.value,
109
- inst
110
- });
111
- return payload;
112
- };
113
- });
114
- const $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
115
- $ZodCheckStringFormat.init(inst, def);
116
- $ZodString.init(inst, def);
117
- });
118
- const $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => {
119
- def.pattern ?? (def.pattern = guid);
120
- $ZodStringFormat.init(inst, def);
121
- });
122
- const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
123
- if (def.version) {
124
- const v = {
125
- v1: 1,
126
- v2: 2,
127
- v3: 3,
128
- v4: 4,
129
- v5: 5,
130
- v6: 6,
131
- v7: 7,
132
- v8: 8
133
- }[def.version];
134
- if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
135
- def.pattern ?? (def.pattern = uuid(v));
136
- } else def.pattern ?? (def.pattern = uuid());
137
- $ZodStringFormat.init(inst, def);
138
- });
139
- const $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
140
- def.pattern ?? (def.pattern = email);
141
- $ZodStringFormat.init(inst, def);
142
- });
143
- const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
144
- $ZodStringFormat.init(inst, def);
145
- inst._zod.check = (payload) => {
146
- try {
147
- const trimmed = payload.value.trim();
148
- const url = new URL(trimmed);
149
- if (def.hostname) {
150
- def.hostname.lastIndex = 0;
151
- if (!def.hostname.test(url.hostname)) payload.issues.push({
152
- code: "invalid_format",
153
- format: "url",
154
- note: "Invalid hostname",
155
- pattern: hostname.source,
156
- input: payload.value,
157
- inst,
158
- continue: !def.abort
159
- });
160
- }
161
- if (def.protocol) {
162
- def.protocol.lastIndex = 0;
163
- if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({
164
- code: "invalid_format",
165
- format: "url",
166
- note: "Invalid protocol",
167
- pattern: def.protocol.source,
168
- input: payload.value,
169
- inst,
170
- continue: !def.abort
171
- });
172
- }
173
- if (def.normalize) payload.value = url.href;
174
- else payload.value = trimmed;
175
- return;
176
- } catch (_) {
177
- payload.issues.push({
178
- code: "invalid_format",
179
- format: "url",
180
- input: payload.value,
181
- inst,
182
- continue: !def.abort
183
- });
184
- }
185
- };
186
- });
187
- const $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
188
- def.pattern ?? (def.pattern = emoji());
189
- $ZodStringFormat.init(inst, def);
190
- });
191
- const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
192
- def.pattern ?? (def.pattern = nanoid);
193
- $ZodStringFormat.init(inst, def);
194
- });
195
- const $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
196
- def.pattern ?? (def.pattern = cuid);
197
- $ZodStringFormat.init(inst, def);
198
- });
199
- const $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => {
200
- def.pattern ?? (def.pattern = cuid2);
201
- $ZodStringFormat.init(inst, def);
202
- });
203
- const $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => {
204
- def.pattern ?? (def.pattern = ulid);
205
- $ZodStringFormat.init(inst, def);
206
- });
207
- const $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => {
208
- def.pattern ?? (def.pattern = xid);
209
- $ZodStringFormat.init(inst, def);
210
- });
211
- const $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
212
- def.pattern ?? (def.pattern = ksuid);
213
- $ZodStringFormat.init(inst, def);
214
- });
215
- const $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
216
- def.pattern ?? (def.pattern = datetime(def));
217
- $ZodStringFormat.init(inst, def);
218
- });
219
- const $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
220
- def.pattern ?? (def.pattern = date);
221
- $ZodStringFormat.init(inst, def);
222
- });
223
- const $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
224
- def.pattern ?? (def.pattern = time(def));
225
- $ZodStringFormat.init(inst, def);
226
- });
227
- const $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => {
228
- def.pattern ?? (def.pattern = duration);
229
- $ZodStringFormat.init(inst, def);
230
- });
231
- const $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
232
- def.pattern ?? (def.pattern = ipv4);
233
- $ZodStringFormat.init(inst, def);
234
- inst._zod.onattach.push((inst$1) => {
235
- const bag = inst$1._zod.bag;
236
- bag.format = `ipv4`;
237
- });
238
- });
239
- const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
240
- def.pattern ?? (def.pattern = ipv6);
241
- $ZodStringFormat.init(inst, def);
242
- inst._zod.onattach.push((inst$1) => {
243
- const bag = inst$1._zod.bag;
244
- bag.format = `ipv6`;
245
- });
246
- inst._zod.check = (payload) => {
247
- try {
248
- new URL(`http://[${payload.value}]`);
249
- } catch {
250
- payload.issues.push({
251
- code: "invalid_format",
252
- format: "ipv6",
253
- input: payload.value,
254
- inst,
255
- continue: !def.abort
256
- });
257
- }
258
- };
259
- });
260
- const $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
261
- def.pattern ?? (def.pattern = cidrv4);
262
- $ZodStringFormat.init(inst, def);
263
- });
264
- const $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
265
- def.pattern ?? (def.pattern = cidrv6);
266
- $ZodStringFormat.init(inst, def);
267
- inst._zod.check = (payload) => {
268
- const parts = payload.value.split("/");
269
- try {
270
- if (parts.length !== 2) throw new Error();
271
- const [address, prefix] = parts;
272
- if (!prefix) throw new Error();
273
- const prefixNum = Number(prefix);
274
- if (`${prefixNum}` !== prefix) throw new Error();
275
- if (prefixNum < 0 || prefixNum > 128) throw new Error();
276
- new URL(`http://[${address}]`);
277
- } catch {
278
- payload.issues.push({
279
- code: "invalid_format",
280
- format: "cidrv6",
281
- input: payload.value,
282
- inst,
283
- continue: !def.abort
284
- });
285
- }
286
- };
287
- });
288
- function isValidBase64(data) {
289
- if (data === "") return true;
290
- if (data.length % 4 !== 0) return false;
291
- try {
292
- atob(data);
293
- return true;
294
- } catch {
295
- return false;
296
- }
297
- }
298
- const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
299
- def.pattern ?? (def.pattern = base64);
300
- $ZodStringFormat.init(inst, def);
301
- inst._zod.onattach.push((inst$1) => {
302
- inst$1._zod.bag.contentEncoding = "base64";
303
- });
304
- inst._zod.check = (payload) => {
305
- if (isValidBase64(payload.value)) return;
306
- payload.issues.push({
307
- code: "invalid_format",
308
- format: "base64",
309
- input: payload.value,
310
- inst,
311
- continue: !def.abort
312
- });
313
- };
314
- });
315
- function isValidBase64URL(data) {
316
- if (!base64url.test(data)) return false;
317
- const base64$1 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
318
- return isValidBase64(base64$1.padEnd(Math.ceil(base64$1.length / 4) * 4, "="));
319
- }
320
- const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
321
- def.pattern ?? (def.pattern = base64url);
322
- $ZodStringFormat.init(inst, def);
323
- inst._zod.onattach.push((inst$1) => {
324
- inst$1._zod.bag.contentEncoding = "base64url";
325
- });
326
- inst._zod.check = (payload) => {
327
- if (isValidBase64URL(payload.value)) return;
328
- payload.issues.push({
329
- code: "invalid_format",
330
- format: "base64url",
331
- input: payload.value,
332
- inst,
333
- continue: !def.abort
334
- });
335
- };
336
- });
337
- const $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => {
338
- def.pattern ?? (def.pattern = e164);
339
- $ZodStringFormat.init(inst, def);
340
- });
341
- function isValidJWT(token, algorithm = null) {
342
- try {
343
- const tokensParts = token.split(".");
344
- if (tokensParts.length !== 3) return false;
345
- const [header] = tokensParts;
346
- if (!header) return false;
347
- const parsedHeader = JSON.parse(atob(header));
348
- if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
349
- if (!parsedHeader.alg) return false;
350
- if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false;
351
- return true;
352
- } catch {
353
- return false;
354
- }
355
- }
356
- const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
357
- $ZodStringFormat.init(inst, def);
358
- inst._zod.check = (payload) => {
359
- if (isValidJWT(payload.value, def.alg)) return;
360
- payload.issues.push({
361
- code: "invalid_format",
362
- format: "jwt",
363
- input: payload.value,
364
- inst,
365
- continue: !def.abort
366
- });
367
- };
368
- });
369
- function handleArrayResult(result, final, index) {
370
- if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
371
- final.value[index] = result.value;
372
- }
373
- const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
374
- $ZodType.init(inst, def);
375
- inst._zod.parse = (payload, ctx) => {
376
- const input = payload.value;
377
- if (!Array.isArray(input)) {
378
- payload.issues.push({
379
- expected: "array",
380
- code: "invalid_type",
381
- input,
382
- inst
383
- });
384
- return payload;
385
- }
386
- payload.value = Array(input.length);
387
- const proms = [];
388
- for (let i = 0; i < input.length; i++) {
389
- const item = input[i];
390
- const result = def.element._zod.run({
391
- value: item,
392
- issues: []
393
- }, ctx);
394
- if (result instanceof Promise) proms.push(result.then((result$1) => handleArrayResult(result$1, payload, i)));
395
- else handleArrayResult(result, payload, i);
396
- }
397
- if (proms.length) return Promise.all(proms).then(() => payload);
398
- return payload;
399
- };
400
- });
401
- function handleUnionResults(results, final, inst, ctx) {
402
- for (const result of results) if (result.issues.length === 0) {
403
- final.value = result.value;
404
- return final;
405
- }
406
- const nonaborted = results.filter((r) => !aborted(r));
407
- if (nonaborted.length === 1) {
408
- final.value = nonaborted[0].value;
409
- return nonaborted[0];
410
- }
411
- final.issues.push({
412
- code: "invalid_union",
413
- input: final.value,
414
- inst,
415
- errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
416
- });
417
- return final;
418
- }
419
- const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
420
- $ZodType.init(inst, def);
421
- defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
422
- defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
423
- defineLazy(inst._zod, "values", () => {
424
- if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
425
- });
426
- defineLazy(inst._zod, "pattern", () => {
427
- if (def.options.every((o) => o._zod.pattern)) {
428
- const patterns = def.options.map((o) => o._zod.pattern);
429
- return /* @__PURE__ */ new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
430
- }
431
- });
432
- const single = def.options.length === 1;
433
- const first = def.options[0]._zod.run;
434
- inst._zod.parse = (payload, ctx) => {
435
- if (single) return first(payload, ctx);
436
- let async = false;
437
- const results = [];
438
- for (const option of def.options) {
439
- const result = option._zod.run({
440
- value: payload.value,
441
- issues: []
442
- }, ctx);
443
- if (result instanceof Promise) {
444
- results.push(result);
445
- async = true;
446
- } else {
447
- if (result.issues.length === 0) return result;
448
- results.push(result);
449
- }
450
- }
451
- if (!async) return handleUnionResults(results, payload, inst, ctx);
452
- return Promise.all(results).then((results$1) => {
453
- return handleUnionResults(results$1, payload, inst, ctx);
454
- });
455
- };
456
- });
457
- const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
458
- $ZodType.init(inst, def);
459
- inst._zod.parse = (payload, ctx) => {
460
- const input = payload.value;
461
- const left = def.left._zod.run({
462
- value: input,
463
- issues: []
464
- }, ctx);
465
- const right = def.right._zod.run({
466
- value: input,
467
- issues: []
468
- }, ctx);
469
- if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left$1, right$1]) => {
470
- return handleIntersectionResults(payload, left$1, right$1);
471
- });
472
- return handleIntersectionResults(payload, left, right);
473
- };
474
- });
475
- function mergeValues(a, b) {
476
- if (a === b) return {
477
- valid: true,
478
- data: a
479
- };
480
- if (a instanceof Date && b instanceof Date && +a === +b) return {
481
- valid: true,
482
- data: a
483
- };
484
- if (isPlainObject(a) && isPlainObject(b)) {
485
- const bKeys = Object.keys(b);
486
- const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
487
- const newObj = {
488
- ...a,
489
- ...b
490
- };
491
- for (const key of sharedKeys) {
492
- const sharedValue = mergeValues(a[key], b[key]);
493
- if (!sharedValue.valid) return {
494
- valid: false,
495
- mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
496
- };
497
- newObj[key] = sharedValue.data;
498
- }
499
- return {
500
- valid: true,
501
- data: newObj
502
- };
503
- }
504
- if (Array.isArray(a) && Array.isArray(b)) {
505
- if (a.length !== b.length) return {
506
- valid: false,
507
- mergeErrorPath: []
508
- };
509
- const newArray = [];
510
- for (let index = 0; index < a.length; index++) {
511
- const itemA = a[index];
512
- const itemB = b[index];
513
- const sharedValue = mergeValues(itemA, itemB);
514
- if (!sharedValue.valid) return {
515
- valid: false,
516
- mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
517
- };
518
- newArray.push(sharedValue.data);
519
- }
520
- return {
521
- valid: true,
522
- data: newArray
523
- };
524
- }
525
- return {
526
- valid: false,
527
- mergeErrorPath: []
528
- };
529
- }
530
- function handleIntersectionResults(result, left, right) {
531
- if (left.issues.length) result.issues.push(...left.issues);
532
- if (right.issues.length) result.issues.push(...right.issues);
533
- if (aborted(result)) return result;
534
- const merged = mergeValues(left.value, right.value);
535
- if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
536
- result.value = merged.data;
537
- return result;
538
- }
539
- const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
540
- $ZodType.init(inst, def);
541
- inst._zod.parse = (payload, ctx) => {
542
- if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
543
- const _out = def.transform(payload.value, payload);
544
- if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
545
- payload.value = output;
546
- return payload;
547
- });
548
- if (_out instanceof Promise) throw new $ZodAsyncError();
549
- payload.value = _out;
550
- return payload;
551
- };
552
- });
553
- function handleOptionalResult(result, input) {
554
- if (result.issues.length && input === void 0) return {
555
- issues: [],
556
- value: void 0
557
- };
558
- return result;
559
- }
560
- const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
561
- $ZodType.init(inst, def);
562
- inst._zod.optin = "optional";
563
- inst._zod.optout = "optional";
564
- defineLazy(inst._zod, "values", () => {
565
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
566
- });
567
- defineLazy(inst._zod, "pattern", () => {
568
- const pattern = def.innerType._zod.pattern;
569
- return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
570
- });
571
- inst._zod.parse = (payload, ctx) => {
572
- if (def.innerType._zod.optin === "optional") {
573
- const result = def.innerType._zod.run(payload, ctx);
574
- if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, payload.value));
575
- return handleOptionalResult(result, payload.value);
576
- }
577
- if (payload.value === void 0) return payload;
578
- return def.innerType._zod.run(payload, ctx);
579
- };
580
- });
581
- const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
582
- $ZodType.init(inst, def);
583
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
584
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
585
- defineLazy(inst._zod, "pattern", () => {
586
- const pattern = def.innerType._zod.pattern;
587
- return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
588
- });
589
- defineLazy(inst._zod, "values", () => {
590
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0;
591
- });
592
- inst._zod.parse = (payload, ctx) => {
593
- if (payload.value === null) return payload;
594
- return def.innerType._zod.run(payload, ctx);
595
- };
596
- });
597
- const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
598
- $ZodType.init(inst, def);
599
- inst._zod.optin = "optional";
600
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
601
- inst._zod.parse = (payload, ctx) => {
602
- if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
603
- if (payload.value === void 0) {
604
- payload.value = def.defaultValue;
605
- /**
606
- * $ZodDefault returns the default value immediately in forward direction.
607
- * 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. */
608
- return payload;
609
- }
610
- const result = def.innerType._zod.run(payload, ctx);
611
- if (result instanceof Promise) return result.then((result$1) => handleDefaultResult(result$1, def));
612
- return handleDefaultResult(result, def);
613
- };
614
- });
615
- function handleDefaultResult(payload, def) {
616
- if (payload.value === void 0) payload.value = def.defaultValue;
617
- return payload;
618
- }
619
- const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
620
- $ZodType.init(inst, def);
621
- inst._zod.optin = "optional";
622
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
623
- inst._zod.parse = (payload, ctx) => {
624
- if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
625
- if (payload.value === void 0) payload.value = def.defaultValue;
626
- return def.innerType._zod.run(payload, ctx);
627
- };
628
- });
629
- const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
630
- $ZodType.init(inst, def);
631
- defineLazy(inst._zod, "values", () => {
632
- const v = def.innerType._zod.values;
633
- return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
634
- });
635
- inst._zod.parse = (payload, ctx) => {
636
- const result = def.innerType._zod.run(payload, ctx);
637
- if (result instanceof Promise) return result.then((result$1) => handleNonOptionalResult(result$1, inst));
638
- return handleNonOptionalResult(result, inst);
639
- };
640
- });
641
- function handleNonOptionalResult(payload, inst) {
642
- if (!payload.issues.length && payload.value === void 0) payload.issues.push({
643
- code: "invalid_type",
644
- expected: "nonoptional",
645
- input: payload.value,
646
- inst
647
- });
648
- return payload;
649
- }
650
- const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
651
- $ZodType.init(inst, def);
652
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
653
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
654
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
655
- inst._zod.parse = (payload, ctx) => {
656
- if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
657
- const result = def.innerType._zod.run(payload, ctx);
658
- if (result instanceof Promise) return result.then((result$1) => {
659
- payload.value = result$1.value;
660
- if (result$1.issues.length) {
661
- payload.value = def.catchValue({
662
- ...payload,
663
- error: { issues: result$1.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
664
- input: payload.value
665
- });
666
- payload.issues = [];
667
- }
668
- return payload;
669
- });
670
- payload.value = result.value;
671
- if (result.issues.length) {
672
- payload.value = def.catchValue({
673
- ...payload,
674
- error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
675
- input: payload.value
676
- });
677
- payload.issues = [];
678
- }
679
- return payload;
680
- };
681
- });
682
- const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
683
- $ZodType.init(inst, def);
684
- defineLazy(inst._zod, "values", () => def.in._zod.values);
685
- defineLazy(inst._zod, "optin", () => def.in._zod.optin);
686
- defineLazy(inst._zod, "optout", () => def.out._zod.optout);
687
- defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
688
- inst._zod.parse = (payload, ctx) => {
689
- if (ctx.direction === "backward") {
690
- const right = def.out._zod.run(payload, ctx);
691
- if (right instanceof Promise) return right.then((right$1) => handlePipeResult(right$1, def.in, ctx));
692
- return handlePipeResult(right, def.in, ctx);
693
- }
694
- const left = def.in._zod.run(payload, ctx);
695
- if (left instanceof Promise) return left.then((left$1) => handlePipeResult(left$1, def.out, ctx));
696
- return handlePipeResult(left, def.out, ctx);
697
- };
698
- });
699
- function handlePipeResult(left, next, ctx) {
700
- if (left.issues.length) {
701
- left.aborted = true;
702
- return left;
703
- }
704
- return next._zod.run({
705
- value: left.value,
706
- issues: left.issues
707
- }, ctx);
708
- }
709
- const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
710
- $ZodType.init(inst, def);
711
- defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
712
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
713
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
714
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
715
- inst._zod.parse = (payload, ctx) => {
716
- if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
717
- const result = def.innerType._zod.run(payload, ctx);
718
- if (result instanceof Promise) return result.then(handleReadonlyResult);
719
- return handleReadonlyResult(result);
720
- };
721
- });
722
- function handleReadonlyResult(payload) {
723
- payload.value = Object.freeze(payload.value);
724
- return payload;
725
- }
726
- const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
727
- $ZodCheck.init(inst, def);
728
- $ZodType.init(inst, def);
729
- inst._zod.parse = (payload, _) => {
730
- return payload;
731
- };
732
- inst._zod.check = (payload) => {
733
- const input = payload.value;
734
- const r = def.fn(input);
735
- if (r instanceof Promise) return r.then((r$1) => handleRefineResult(r$1, payload, input, inst));
736
- handleRefineResult(r, payload, input, inst);
737
- };
738
- });
739
- function handleRefineResult(result, payload, input, inst) {
740
- if (!result) {
741
- const _iss = {
742
- code: "custom",
743
- input,
744
- inst,
745
- path: [...inst._zod.def.path ?? []],
746
- continue: !inst._zod.def.abort
747
- };
748
- if (inst._zod.def.params) _iss.params = inst._zod.def.params;
749
- payload.issues.push(issue(_iss));
750
- }
751
- }
752
-
753
- //#endregion
754
- export { $ZodArray, $ZodBase64, $ZodBase64URL, $ZodCIDRv4, $ZodCIDRv6, $ZodCUID, $ZodCUID2, $ZodCatch, $ZodCustom, $ZodDefault, $ZodE164, $ZodEmail, $ZodEmoji, $ZodGUID, $ZodIPv4, $ZodIPv6, $ZodISODate, $ZodISODateTime, $ZodISODuration, $ZodISOTime, $ZodIntersection, $ZodJWT, $ZodKSUID, $ZodNanoID, $ZodNonOptional, $ZodNullable, $ZodOptional, $ZodPipe, $ZodPrefault, $ZodReadonly, $ZodString, $ZodStringFormat, $ZodTransform, $ZodType, $ZodULID, $ZodURL, $ZodUUID, $ZodUnion, $ZodXID };
755
- //# sourceMappingURL=schemas.js.map