@synnaxlabs/pluto 0.21.9 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (615) hide show
  1. package/dist/Animated-DPIV1IH6.js +19 -0
  2. package/dist/Animated-DjcnDVGC.cjs +1 -0
  3. package/dist/Keyboard-BLHHROrq.js +13 -0
  4. package/dist/Keyboard-CJLEUbYu.cjs +1 -0
  5. package/dist/LinePlot-C9MVJErC.js +10771 -0
  6. package/dist/LinePlot-DkAUE5Nq.cjs +68 -0
  7. package/dist/Link-BsqVxj6V.js +10 -0
  8. package/dist/Link-C3NUk5cp.cjs +1 -0
  9. package/dist/List-BbB1S5Vo.cjs +1 -0
  10. package/dist/List-DPugi06W.js +22 -0
  11. package/dist/Pack-CBNcamuh.cjs +1 -0
  12. package/dist/Pack-mkZBsSIU.js +125 -0
  13. package/dist/Toggle-BBGPiXIA.cjs +188 -0
  14. package/dist/Toggle-W4K3cLf7.js +43751 -0
  15. package/dist/Video-C2EYBKLN.js +14 -0
  16. package/dist/Video-Kb-c-N69.cjs +1 -0
  17. package/dist/aggregator-BZJAV5yZ.js +11109 -0
  18. package/dist/aggregator-DueF6Q-Z.cjs +45 -0
  19. package/dist/align.cjs +1 -5
  20. package/dist/align.js +2 -3
  21. package/dist/button.cjs +1 -5
  22. package/dist/button.js +1 -2
  23. package/dist/color.cjs +1 -5
  24. package/dist/color.js +1 -2
  25. package/dist/css-DZx3bWkH.cjs +1 -0
  26. package/dist/css-TXuXKs3A.js +1364 -0
  27. package/dist/css.cjs +1 -9
  28. package/dist/css.js +6 -7
  29. package/dist/dropdown.cjs +1 -5
  30. package/dist/dropdown.js +2 -3
  31. package/dist/ether.cjs +1 -84
  32. package/dist/ether.js +72 -77
  33. package/dist/external-0w2SHXg_.js +13 -0
  34. package/dist/external-B-CtJFCn.js +96 -0
  35. package/dist/external-B39SmpRo.js +201 -0
  36. package/dist/external-BB2SaR1o.js +14 -0
  37. package/dist/external-BKWizK6o.cjs +1 -0
  38. package/dist/external-BbnWD0Pc.js +66 -0
  39. package/dist/external-BphNoXuB.js +92 -0
  40. package/dist/external-CduvGaPN.js +1183 -0
  41. package/dist/external-CsPOXIEm.cjs +1 -0
  42. package/dist/external-CyiLaYmg.js +322 -0
  43. package/dist/external-CztU6wom.cjs +1 -0
  44. package/dist/external-D1NnASGa.cjs +1 -0
  45. package/dist/external-DjjMU4Z6.cjs +1 -0
  46. package/dist/external-DlCoToEB.cjs +1 -0
  47. package/dist/external-DrS33VU5.cjs +1 -0
  48. package/dist/external-DsNtnR-y.cjs +1 -0
  49. package/dist/external-TNsi3_BK.js +111 -0
  50. package/dist/external-WGyRiKbb.js +129 -0
  51. package/dist/external-WzX6JA2j.cjs +1 -0
  52. package/dist/external-XoJlPNFB.js +22 -0
  53. package/dist/external-fg-pJfZR.js +260 -0
  54. package/dist/external-mlV4Onnq.cjs +1 -0
  55. package/dist/external-vZfda3xX.cjs +1 -0
  56. package/dist/external-vgqH7hLg.cjs +1 -0
  57. package/dist/header.cjs +1 -5
  58. package/dist/header.js +2 -3
  59. package/dist/index.cjs +1 -8534
  60. package/dist/index.js +5918 -7439
  61. package/dist/input.cjs +1 -5
  62. package/dist/input.js +2 -3
  63. package/dist/jsx-runtime-DqxPLdyS.js +623 -0
  64. package/dist/jsx-runtime-fmb_vB8K.cjs +25 -0
  65. package/dist/list.cjs +1 -5
  66. package/dist/list.js +2 -3
  67. package/dist/menu.cjs +1 -5
  68. package/dist/menu.js +2 -3
  69. package/dist/src/accordion/Accordion.d.ts.map +1 -1
  70. package/dist/src/aether/aether/aether.d.ts +1 -1
  71. package/dist/src/aether/aether/aether.d.ts.map +1 -1
  72. package/dist/src/aether/main.d.ts +1 -1
  73. package/dist/src/aether/main.d.ts.map +1 -1
  74. package/dist/src/aether/main.spec.d.ts.map +1 -1
  75. package/dist/src/aether/test/test.d.ts.map +1 -1
  76. package/dist/src/alamos/Provider.d.ts +1 -1
  77. package/dist/src/alamos/Provider.d.ts.map +1 -1
  78. package/dist/src/alamos/aether/alamos.d.ts +6 -6
  79. package/dist/src/align/Center.d.ts.map +1 -1
  80. package/dist/src/align/Pack.d.ts.map +1 -1
  81. package/dist/src/align/Space.d.ts +1 -1
  82. package/dist/src/align/Space.d.ts.map +1 -1
  83. package/dist/src/align/external.d.ts +2 -2
  84. package/dist/src/align/external.d.ts.map +1 -1
  85. package/dist/src/button/Button.d.ts +1 -1
  86. package/dist/src/button/Button.d.ts.map +1 -1
  87. package/dist/src/button/Icon.d.ts.map +1 -1
  88. package/dist/src/button/Toggle.d.ts.map +1 -1
  89. package/dist/src/caret/Animated.d.ts +9 -0
  90. package/dist/src/caret/Animated.d.ts.map +1 -0
  91. package/dist/src/caret/index.d.ts +2 -0
  92. package/dist/src/caret/index.d.ts.map +1 -0
  93. package/dist/src/channel/AliasProvider.d.ts +1 -1
  94. package/dist/src/channel/AliasProvider.d.ts.map +1 -1
  95. package/dist/src/channel/LinePlot.d.ts +1 -1
  96. package/dist/src/channel/LinePlot.d.ts.map +1 -1
  97. package/dist/src/channel/Select.d.ts +1 -1
  98. package/dist/src/channel/Select.d.ts.map +1 -1
  99. package/dist/src/channel/external.d.ts +1 -1
  100. package/dist/src/channel/external.d.ts.map +1 -1
  101. package/dist/src/color/Picker/Picker.d.ts.map +1 -1
  102. package/dist/src/color/Swatch/Swatch.d.ts +1 -1
  103. package/dist/src/color/Swatch/Swatch.d.ts.map +1 -1
  104. package/dist/src/color/core/color.d.ts.map +1 -1
  105. package/dist/src/color/external.d.ts +1 -1
  106. package/dist/src/color/external.d.ts.map +1 -1
  107. package/dist/src/css/bem.d.ts.map +1 -1
  108. package/dist/src/css/css.d.ts +2 -1
  109. package/dist/src/css/css.d.ts.map +1 -1
  110. package/dist/src/css/index.d.ts +2 -2
  111. package/dist/src/css/index.d.ts.map +1 -1
  112. package/dist/src/cursor/cursor.d.ts +1 -1
  113. package/dist/src/cursor/cursor.d.ts.map +1 -1
  114. package/dist/src/divider/Divider.d.ts +1 -1
  115. package/dist/src/divider/Divider.d.ts.map +1 -1
  116. package/dist/src/dropdown/Dropdown.d.ts +1 -1
  117. package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
  118. package/dist/src/ether.d.ts +6 -6
  119. package/dist/src/ether.d.ts.map +1 -1
  120. package/dist/src/form/Form.d.ts +6 -6
  121. package/dist/src/form/Form.d.ts.map +1 -1
  122. package/dist/src/hardware/device/Select.d.ts +1 -1
  123. package/dist/src/hardware/device/Select.d.ts.map +1 -1
  124. package/dist/src/haul/Haul.d.ts +17 -5
  125. package/dist/src/haul/Haul.d.ts.map +1 -1
  126. package/dist/src/header/Actions.d.ts.map +1 -1
  127. package/dist/src/header/Header.d.ts.map +1 -1
  128. package/dist/src/hooks/index.d.ts +4 -4
  129. package/dist/src/hooks/index.d.ts.map +1 -1
  130. package/dist/src/hooks/ref.d.ts +1 -1
  131. package/dist/src/hooks/ref.d.ts.map +1 -1
  132. package/dist/src/hooks/useClickOutside.d.ts.map +1 -1
  133. package/dist/src/hooks/useCursorDrag/useCursorDrag.d.ts +1 -1
  134. package/dist/src/hooks/useCursorDrag/useCursorDrag.d.ts.map +1 -1
  135. package/dist/src/hooks/useCursorDrag/useVirtualCursorDragWebKit.d.ts.map +1 -1
  136. package/dist/src/hooks/useCursorDrag/useVirtualCursorDragWebView.d.ts.map +1 -1
  137. package/dist/src/hooks/useDebouncedCallback.d.ts.map +1 -1
  138. package/dist/src/hooks/useFilter.d.ts +1 -1
  139. package/dist/src/hooks/useFilter.d.ts.map +1 -1
  140. package/dist/src/hooks/useResize.d.ts +1 -1
  141. package/dist/src/hooks/useResize.d.ts.map +1 -1
  142. package/dist/src/hooks/useTransforms.d.ts.map +1 -1
  143. package/dist/src/hooks/useUniqueKey.d.ts.map +1 -1
  144. package/dist/src/index.d.ts +23 -22
  145. package/dist/src/index.d.ts.map +1 -1
  146. package/dist/src/input/Date.d.ts.map +1 -1
  147. package/dist/src/input/DateTime.d.ts.map +1 -1
  148. package/dist/src/input/DragButton.d.ts +1 -1
  149. package/dist/src/input/DragButton.d.ts.map +1 -1
  150. package/dist/src/input/HelpText.d.ts.map +1 -1
  151. package/dist/src/input/Item.d.ts.map +1 -1
  152. package/dist/src/input/Label.d.ts.map +1 -1
  153. package/dist/src/input/Numeric.d.ts.map +1 -1
  154. package/dist/src/input/Switch.d.ts.map +1 -1
  155. package/dist/src/input/Text.d.ts.map +1 -1
  156. package/dist/src/input/TextArea.d.ts.map +1 -1
  157. package/dist/src/input/Time.d.ts.map +1 -1
  158. package/dist/src/input/external.d.ts +4 -4
  159. package/dist/src/input/external.d.ts.map +1 -1
  160. package/dist/src/input/types.d.ts +1 -1
  161. package/dist/src/input/types.d.ts.map +1 -1
  162. package/dist/src/list/Column.d.ts +1 -1
  163. package/dist/src/list/Column.d.ts.map +1 -1
  164. package/dist/src/list/Core.d.ts +1 -1
  165. package/dist/src/list/Core.d.ts.map +1 -1
  166. package/dist/src/list/Data.d.ts +1 -1
  167. package/dist/src/list/Data.d.ts.map +1 -1
  168. package/dist/src/list/Filter.d.ts +1 -1
  169. package/dist/src/list/Filter.d.ts.map +1 -1
  170. package/dist/src/list/Hover.d.ts +1 -1
  171. package/dist/src/list/Hover.d.ts.map +1 -1
  172. package/dist/src/list/Infinite.d.ts.map +1 -1
  173. package/dist/src/list/Item.d.ts +3 -3
  174. package/dist/src/list/Item.d.ts.map +1 -1
  175. package/dist/src/list/List.d.ts +1 -1
  176. package/dist/src/list/List.d.ts.map +1 -1
  177. package/dist/src/list/Search.d.ts +1 -1
  178. package/dist/src/list/Search.d.ts.map +1 -1
  179. package/dist/src/list/Selector.d.ts +2 -2
  180. package/dist/src/list/Selector.d.ts.map +1 -1
  181. package/dist/src/list/external.d.ts +4 -4
  182. package/dist/src/list/external.d.ts.map +1 -1
  183. package/dist/src/list/useSelect.d.ts +18 -12
  184. package/dist/src/list/useSelect.d.ts.map +1 -1
  185. package/dist/src/memo/index.d.ts +1 -1
  186. package/dist/src/memo/index.d.ts.map +1 -1
  187. package/dist/src/memo/useMemoCompare.d.ts +1 -1
  188. package/dist/src/memo/useMemoCompare.d.ts.map +1 -1
  189. package/dist/src/menu/ContextMenu.d.ts +20 -13
  190. package/dist/src/menu/ContextMenu.d.ts.map +1 -1
  191. package/dist/src/menu/Item.d.ts.map +1 -1
  192. package/dist/src/menu/external.d.ts +1 -1
  193. package/dist/src/menu/external.d.ts.map +1 -1
  194. package/dist/src/mock/MockGLBufferController.d.ts.map +1 -1
  195. package/dist/src/mosaic/Mosaic.d.ts +2 -1
  196. package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
  197. package/dist/src/mosaic/use.d.ts.map +1 -1
  198. package/dist/src/nav/Bar.d.ts +1 -1
  199. package/dist/src/nav/Bar.d.ts.map +1 -1
  200. package/dist/src/nav/Drawer.d.ts.map +1 -1
  201. package/dist/src/nav/external.d.ts +1 -1
  202. package/dist/src/nav/external.d.ts.map +1 -1
  203. package/dist/src/note/Note.d.ts.map +1 -1
  204. package/dist/src/note/index.d.ts.map +1 -1
  205. package/dist/src/os/Controls/Controls.d.ts +1 -1
  206. package/dist/src/os/Controls/Controls.d.ts.map +1 -1
  207. package/dist/src/os/Controls/Mac.d.ts.map +1 -1
  208. package/dist/src/os/Controls/Windows.d.ts.map +1 -1
  209. package/dist/src/os/Controls/index.d.ts +1 -1
  210. package/dist/src/os/Controls/index.d.ts.map +1 -1
  211. package/dist/src/os/use.d.ts +1 -1
  212. package/dist/src/os/use.d.ts.map +1 -1
  213. package/dist/src/pluto/Pluto.d.ts.map +1 -1
  214. package/dist/src/portal/Portal.d.ts.map +1 -1
  215. package/dist/src/portal/index.d.ts.map +1 -1
  216. package/dist/src/progress/Progress.d.ts.map +1 -1
  217. package/dist/src/ranger/SelectLabel.d.ts +1 -1
  218. package/dist/src/ranger/SelectLabel.d.ts.map +1 -1
  219. package/dist/src/ranger/TimeRangeChip.d.ts +1 -1
  220. package/dist/src/ranger/TimeRangeChip.d.ts.map +1 -1
  221. package/dist/src/ranger/external.d.ts +1 -1
  222. package/dist/src/ranger/external.d.ts.map +1 -1
  223. package/dist/src/resize/Core.d.ts +1 -1
  224. package/dist/src/resize/Core.d.ts.map +1 -1
  225. package/dist/src/resize/Multiple.d.ts +1 -1
  226. package/dist/src/resize/Multiple.d.ts.map +1 -1
  227. package/dist/src/resize/Single.d.ts +1 -1
  228. package/dist/src/resize/Single.d.ts.map +1 -1
  229. package/dist/src/select/Button.d.ts +1 -1
  230. package/dist/src/select/Button.d.ts.map +1 -1
  231. package/dist/src/select/ClearButton.d.ts.map +1 -1
  232. package/dist/src/select/DataType.d.ts.map +1 -1
  233. package/dist/src/select/Direction.d.ts +3 -3
  234. package/dist/src/select/Direction.d.ts.map +1 -1
  235. package/dist/src/select/List.d.ts +4 -4
  236. package/dist/src/select/List.d.ts.map +1 -1
  237. package/dist/src/select/Multiple.d.ts +1 -1
  238. package/dist/src/select/Multiple.d.ts.map +1 -1
  239. package/dist/src/select/Select.spec.d.ts.map +1 -1
  240. package/dist/src/select/Single.d.ts +2 -2
  241. package/dist/src/select/Single.d.ts.map +1 -1
  242. package/dist/src/select/external.d.ts +3 -3
  243. package/dist/src/select/external.d.ts.map +1 -1
  244. package/dist/src/state/state.d.ts +1 -1
  245. package/dist/src/state/state.d.ts.map +1 -1
  246. package/dist/src/status/Aggregator.d.ts +1 -1
  247. package/dist/src/status/Aggregator.d.ts.map +1 -1
  248. package/dist/src/status/Circle.d.ts +1 -1
  249. package/dist/src/status/Circle.d.ts.map +1 -1
  250. package/dist/src/status/Notification.d.ts +1 -1
  251. package/dist/src/status/Notification.d.ts.map +1 -1
  252. package/dist/src/status/Text.d.ts.map +1 -1
  253. package/dist/src/status/aether/aggregator.d.ts +12 -60
  254. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  255. package/dist/src/status/aether/external.d.ts +1 -1
  256. package/dist/src/status/aether/external.d.ts.map +1 -1
  257. package/dist/src/status/aether/types.d.ts +3 -15
  258. package/dist/src/status/aether/types.d.ts.map +1 -1
  259. package/dist/src/status/external.d.ts +1 -1
  260. package/dist/src/status/external.d.ts.map +1 -1
  261. package/dist/src/steps/Steps.d.ts.map +1 -1
  262. package/dist/src/synnax/Provider.d.ts +1 -1
  263. package/dist/src/synnax/Provider.d.ts.map +1 -1
  264. package/dist/src/synnax/aether/provider.d.ts +24 -24
  265. package/dist/src/tabs/Selector.d.ts +3 -1
  266. package/dist/src/tabs/Selector.d.ts.map +1 -1
  267. package/dist/src/tabs/Tabs.d.ts +2 -1
  268. package/dist/src/tabs/Tabs.d.ts.map +1 -1
  269. package/dist/src/tag/Tag.d.ts +1 -1
  270. package/dist/src/tag/Tag.d.ts.map +1 -1
  271. package/dist/src/telem/aether/convertSeries.d.ts +1 -1
  272. package/dist/src/telem/aether/convertSeries.d.ts.map +1 -1
  273. package/dist/src/telem/aether/external.d.ts +5 -5
  274. package/dist/src/telem/aether/external.d.ts.map +1 -1
  275. package/dist/src/telem/aether/noop.d.ts +1 -1
  276. package/dist/src/telem/aether/noop.d.ts.map +1 -1
  277. package/dist/src/telem/aether/pipeline.d.ts +21 -13
  278. package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
  279. package/dist/src/telem/aether/remote.d.ts +34 -296
  280. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  281. package/dist/src/telem/aether/static.d.ts +12 -10
  282. package/dist/src/telem/aether/static.d.ts.map +1 -1
  283. package/dist/src/telem/aether/telem.d.ts +99 -48
  284. package/dist/src/telem/aether/telem.d.ts.map +1 -1
  285. package/dist/src/telem/aether/transformers.d.ts +4 -4
  286. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  287. package/dist/src/telem/client/cache/cache.d.ts +2 -2
  288. package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
  289. package/dist/src/telem/client/cache/dynamic.d.ts +1 -1
  290. package/dist/src/telem/client/cache/dynamic.d.ts.map +1 -1
  291. package/dist/src/telem/client/cache/static.d.ts +1 -1
  292. package/dist/src/telem/client/cache/static.d.ts.map +1 -1
  293. package/dist/src/telem/client/cache/unary.d.ts +1 -1
  294. package/dist/src/telem/client/cache/unary.d.ts.map +1 -1
  295. package/dist/src/telem/client/external.d.ts +1 -1
  296. package/dist/src/telem/client/external.d.ts.map +1 -1
  297. package/dist/src/telem/client/reader.d.ts +2 -2
  298. package/dist/src/telem/client/reader.d.ts.map +1 -1
  299. package/dist/src/telem/client/streamer.d.ts +1 -0
  300. package/dist/src/telem/client/streamer.d.ts.map +1 -1
  301. package/dist/src/telem/client/types.d.ts +1 -1
  302. package/dist/src/telem/client/types.d.ts.map +1 -1
  303. package/dist/src/telem/control/Chip.d.ts.map +1 -1
  304. package/dist/src/telem/control/Controller.d.ts +1 -1
  305. package/dist/src/telem/control/Controller.d.ts.map +1 -1
  306. package/dist/src/telem/control/Indicator.d.ts.map +1 -1
  307. package/dist/src/telem/control/Legend.d.ts.map +1 -1
  308. package/dist/src/telem/control/StateProvider.d.ts.map +1 -1
  309. package/dist/src/telem/control/aether/chip.d.ts +52 -84
  310. package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
  311. package/dist/src/telem/control/aether/controller.d.ts +4 -4
  312. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  313. package/dist/src/telem/control/aether/external.d.ts +3 -3
  314. package/dist/src/telem/control/aether/external.d.ts.map +1 -1
  315. package/dist/src/telem/control/aether/indicator.d.ts +46 -78
  316. package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
  317. package/dist/src/telem/control/aether/legend.d.ts +33 -96
  318. package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
  319. package/dist/src/telem/control/aether/state.d.ts +15 -29
  320. package/dist/src/telem/control/aether/state.d.ts.map +1 -1
  321. package/dist/src/telem/control/external.d.ts +3 -3
  322. package/dist/src/telem/control/external.d.ts.map +1 -1
  323. package/dist/src/telem/test/index.d.ts.map +1 -1
  324. package/dist/src/telem/test/mock.d.ts +2 -2
  325. package/dist/src/telem/test/mock.d.ts.map +1 -1
  326. package/dist/src/text/DateTime.d.ts +1 -1
  327. package/dist/src/text/DateTime.d.ts.map +1 -1
  328. package/dist/src/text/Editable.d.ts +1 -1
  329. package/dist/src/text/Editable.d.ts.map +1 -1
  330. package/dist/src/text/Keyboard.d.ts.map +1 -1
  331. package/dist/src/text/Link.d.ts.map +1 -1
  332. package/dist/src/text/Text.d.ts.map +1 -1
  333. package/dist/src/text/WithIcon.d.ts +1 -1
  334. package/dist/src/text/WithIcon.d.ts.map +1 -1
  335. package/dist/src/text/core/types.d.ts.map +1 -1
  336. package/dist/src/text/external.d.ts +3 -3
  337. package/dist/src/text/external.d.ts.map +1 -1
  338. package/dist/src/text/symbols.d.ts.map +1 -1
  339. package/dist/src/theming/Provider.d.ts +1 -1
  340. package/dist/src/theming/Provider.d.ts.map +1 -1
  341. package/dist/src/theming/aether/external.d.ts +1 -1
  342. package/dist/src/theming/aether/external.d.ts.map +1 -1
  343. package/dist/src/theming/aether/provider.d.ts.map +1 -1
  344. package/dist/src/theming/core/theme.d.ts +1220 -24196
  345. package/dist/src/theming/core/theme.d.ts.map +1 -1
  346. package/dist/src/theming/external.d.ts +1 -1
  347. package/dist/src/theming/external.d.ts.map +1 -1
  348. package/dist/src/tooltip/Config.d.ts +1 -1
  349. package/dist/src/tooltip/Config.d.ts.map +1 -1
  350. package/dist/src/tooltip/Dialog.d.ts +1 -1
  351. package/dist/src/tooltip/Dialog.d.ts.map +1 -1
  352. package/dist/src/tooltip/external.d.ts +1 -1
  353. package/dist/src/tooltip/wrap.d.ts.map +1 -1
  354. package/dist/src/tree/Tree.d.ts +10 -9
  355. package/dist/src/tree/Tree.d.ts.map +1 -1
  356. package/dist/src/tree/core.d.ts +8 -0
  357. package/dist/src/tree/core.d.ts.map +1 -1
  358. package/dist/src/tree/external.d.ts +1 -1
  359. package/dist/src/triggers/Provider.d.ts +2 -2
  360. package/dist/src/triggers/Provider.d.ts.map +1 -1
  361. package/dist/src/triggers/Text.d.ts.map +1 -1
  362. package/dist/src/triggers/external.d.ts +2 -2
  363. package/dist/src/triggers/external.d.ts.map +1 -1
  364. package/dist/src/triggers/hooks.d.ts +1 -1
  365. package/dist/src/triggers/hooks.d.ts.map +1 -1
  366. package/dist/src/triggers/useDrag.d.ts +1 -1
  367. package/dist/src/triggers/useDrag.d.ts.map +1 -1
  368. package/dist/src/util/children.d.ts.map +1 -1
  369. package/dist/src/video/Video.d.ts.map +1 -1
  370. package/dist/src/viewport/Mask.d.ts.map +1 -1
  371. package/dist/src/viewport/SelectMode.d.ts.map +1 -1
  372. package/dist/src/viewport/external.d.ts +1 -1
  373. package/dist/src/viewport/external.d.ts.map +1 -1
  374. package/dist/src/viewport/use.d.ts +2 -2
  375. package/dist/src/viewport/use.d.ts.map +1 -1
  376. package/dist/src/vis/axis/axis.d.ts +8 -38
  377. package/dist/src/vis/axis/axis.d.ts.map +1 -1
  378. package/dist/src/vis/axis/canvas.d.ts +1 -1
  379. package/dist/src/vis/axis/canvas.d.ts.map +1 -1
  380. package/dist/src/vis/axis/ticks.d.ts +1 -1
  381. package/dist/src/vis/button/aether/button.d.ts +14 -6
  382. package/dist/src/vis/button/aether/button.d.ts.map +1 -1
  383. package/dist/src/vis/button/use.d.ts.map +1 -1
  384. package/dist/src/vis/canvas/Canvas.d.ts +2 -2
  385. package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
  386. package/dist/src/vis/diagram/Diagram.d.ts +1 -1
  387. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  388. package/dist/src/vis/diagram/aether/Diagram.d.ts +6 -42
  389. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  390. package/dist/src/vis/diagram/align.d.ts.map +1 -1
  391. package/dist/src/vis/diagram/edge/Edge.d.ts +2 -2
  392. package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
  393. package/dist/src/vis/diagram/edge/connector/connector.d.ts +1 -1
  394. package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
  395. package/dist/src/vis/diagram/external.d.ts +2 -2
  396. package/dist/src/vis/diagram/external.d.ts.map +1 -1
  397. package/dist/src/vis/diagram/util.d.ts +1 -1
  398. package/dist/src/vis/diagram/util.d.ts.map +1 -1
  399. package/dist/src/vis/draw2d/canvas.d.ts +1 -1
  400. package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
  401. package/dist/src/vis/draw2d/index.d.ts +1 -1
  402. package/dist/src/vis/draw2d/index.d.ts.map +1 -1
  403. package/dist/src/vis/eraser/use.d.ts +1 -1
  404. package/dist/src/vis/eraser/use.d.ts.map +1 -1
  405. package/dist/src/vis/legend/Container.d.ts +1 -1
  406. package/dist/src/vis/legend/Container.d.ts.map +1 -1
  407. package/dist/src/vis/line/Line.d.ts.map +1 -1
  408. package/dist/src/vis/line/aether/line.d.ts +17 -25
  409. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  410. package/dist/src/vis/lineplot/Axis.d.ts +2 -3
  411. package/dist/src/vis/lineplot/Axis.d.ts.map +1 -1
  412. package/dist/src/vis/lineplot/Legend.d.ts.map +1 -1
  413. package/dist/src/vis/lineplot/LinePlot.d.ts +1 -1
  414. package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
  415. package/dist/src/vis/lineplot/Viewport.d.ts.map +1 -1
  416. package/dist/src/vis/lineplot/aether/LinePlot.d.ts +4 -28
  417. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  418. package/dist/src/vis/lineplot/aether/XAxis.d.ts +9 -15
  419. package/dist/src/vis/lineplot/aether/XAxis.d.ts.map +1 -1
  420. package/dist/src/vis/lineplot/aether/YAxis.d.ts +13 -17
  421. package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +1 -1
  422. package/dist/src/vis/lineplot/aether/axis.d.ts +5 -8
  423. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  424. package/dist/src/vis/lineplot/aether/grid.d.ts.map +1 -1
  425. package/dist/src/vis/lineplot/external.d.ts +2 -2
  426. package/dist/src/vis/lineplot/external.d.ts.map +1 -1
  427. package/dist/src/vis/lineplot/range/Annotation.d.ts +1 -1
  428. package/dist/src/vis/lineplot/range/Annotation.d.ts.map +1 -1
  429. package/dist/src/vis/lineplot/range/Provider.d.ts +1 -1
  430. package/dist/src/vis/lineplot/range/Provider.d.ts.map +1 -1
  431. package/dist/src/vis/lineplot/range/aether/annotation.d.ts +7 -59
  432. package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
  433. package/dist/src/vis/lineplot/range/aether/external.d.ts +1 -1
  434. package/dist/src/vis/lineplot/range/aether/external.d.ts.map +1 -1
  435. package/dist/src/vis/lineplot/range/aether/index.d.ts.map +1 -1
  436. package/dist/src/vis/lineplot/range/aether/provider.d.ts +70 -550
  437. package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
  438. package/dist/src/vis/lineplot/range/external.d.ts.map +1 -1
  439. package/dist/src/vis/lineplot/range/index.d.ts.map +1 -1
  440. package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts.map +1 -1
  441. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +6 -6
  442. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts.map +1 -1
  443. package/dist/src/vis/measure/Measure.d.ts.map +1 -1
  444. package/dist/src/vis/measure/aether/measure.d.ts +4 -12
  445. package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
  446. package/dist/src/vis/render/context.d.ts +1 -1
  447. package/dist/src/vis/render/context.d.ts.map +1 -1
  448. package/dist/src/vis/render/external.d.ts +1 -1
  449. package/dist/src/vis/render/external.d.ts.map +1 -1
  450. package/dist/src/vis/render/util.d.ts.map +1 -1
  451. package/dist/src/vis/rule/Rule.d.ts.map +1 -1
  452. package/dist/src/vis/rule/aether/aether.d.ts +4 -36
  453. package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
  454. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  455. package/dist/src/vis/schematic/Labeled.d.ts.map +1 -1
  456. package/dist/src/vis/schematic/SelectOrientation.d.ts +1 -1
  457. package/dist/src/vis/schematic/SelectOrientation.d.ts.map +1 -1
  458. package/dist/src/vis/schematic/Symbols.d.ts +1 -1
  459. package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
  460. package/dist/src/vis/schematic/external.d.ts +1 -1
  461. package/dist/src/vis/schematic/external.d.ts.map +1 -1
  462. package/dist/src/vis/schematic/primitives/Primitives.d.ts +3 -3
  463. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  464. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  465. package/dist/src/vis/toggle/aether/toggle.d.ts +36 -20
  466. package/dist/src/vis/toggle/aether/toggle.d.ts.map +1 -1
  467. package/dist/src/vis/toggle/use.d.ts.map +1 -1
  468. package/dist/src/vis/value/aether/value.d.ts +42 -30
  469. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  470. package/dist/src/vis/value/use.d.ts +11 -6
  471. package/dist/src/vis/value/use.d.ts.map +1 -1
  472. package/dist/src/worker/Context.d.ts +1 -1
  473. package/dist/src/worker/Context.d.ts.map +1 -1
  474. package/dist/style.css +1 -3372
  475. package/dist/tabs.cjs +1 -5
  476. package/dist/tabs.js +2 -3
  477. package/dist/text.cjs +1 -6
  478. package/dist/text.js +3 -4
  479. package/dist/theming.cjs +1 -6
  480. package/dist/theming.js +3 -4
  481. package/dist/tree.cjs +1 -5
  482. package/dist/tree.js +2 -3
  483. package/dist/triggers.cjs +1 -5
  484. package/dist/triggers.js +2 -3
  485. package/dist/units-BsHX82D_.cjs +1 -0
  486. package/dist/units-DechjShe.js +8 -0
  487. package/dist/video.cjs +1 -5
  488. package/dist/video.js +2 -3
  489. package/package.json +15 -24
  490. package/dist/Center-BK9Rcaa0.js +0 -149
  491. package/dist/Center-BK9Rcaa0.js.map +0 -1
  492. package/dist/Center-Cc_rR5pQ.cjs +0 -148
  493. package/dist/Center-Cc_rR5pQ.cjs.map +0 -1
  494. package/dist/Keyboard-Byx8rGZt.cjs +0 -13
  495. package/dist/Keyboard-Byx8rGZt.cjs.map +0 -1
  496. package/dist/Keyboard-D31SwhYT.js +0 -14
  497. package/dist/Keyboard-D31SwhYT.js.map +0 -1
  498. package/dist/LinePlot-Bnb8Ufob.cjs +0 -14337
  499. package/dist/LinePlot-Bnb8Ufob.cjs.map +0 -1
  500. package/dist/LinePlot-KYwy1D7H.js +0 -14341
  501. package/dist/LinePlot-KYwy1D7H.js.map +0 -1
  502. package/dist/Link-Bq38h1dw.cjs +0 -12
  503. package/dist/Link-Bq38h1dw.cjs.map +0 -1
  504. package/dist/Link-DQKdkwWL.js +0 -13
  505. package/dist/Link-DQKdkwWL.js.map +0 -1
  506. package/dist/List-BmP_se57.js +0 -27
  507. package/dist/List-BmP_se57.js.map +0 -1
  508. package/dist/List-BnB-C5vQ.cjs +0 -26
  509. package/dist/List-BnB-C5vQ.cjs.map +0 -1
  510. package/dist/Toggle-D3iCEbO1.cjs +0 -59480
  511. package/dist/Toggle-D3iCEbO1.cjs.map +0 -1
  512. package/dist/Toggle-bT5RpwfA.js +0 -59465
  513. package/dist/Toggle-bT5RpwfA.js.map +0 -1
  514. package/dist/Video-B4sma9fk.cjs +0 -14
  515. package/dist/Video-B4sma9fk.cjs.map +0 -1
  516. package/dist/Video-Cp6XjjOK.js +0 -15
  517. package/dist/Video-Cp6XjjOK.js.map +0 -1
  518. package/dist/aggregator-B8fg7W2s.js +0 -19640
  519. package/dist/aggregator-B8fg7W2s.js.map +0 -1
  520. package/dist/aggregator-Bh2Kyzkg.cjs +0 -19639
  521. package/dist/aggregator-Bh2Kyzkg.cjs.map +0 -1
  522. package/dist/align.cjs.map +0 -1
  523. package/dist/align.js.map +0 -1
  524. package/dist/button.cjs.map +0 -1
  525. package/dist/button.js.map +0 -1
  526. package/dist/color-CjdRh-aN.js +0 -10
  527. package/dist/color-CjdRh-aN.js.map +0 -1
  528. package/dist/color-DBNbbjJy.cjs +0 -9
  529. package/dist/color-DBNbbjJy.cjs.map +0 -1
  530. package/dist/color.cjs.map +0 -1
  531. package/dist/color.js.map +0 -1
  532. package/dist/css-Ci8WUD5E.cjs +0 -4234
  533. package/dist/css-Ci8WUD5E.cjs.map +0 -1
  534. package/dist/css-DKKmdhSr.js +0 -4235
  535. package/dist/css-DKKmdhSr.js.map +0 -1
  536. package/dist/css.cjs.map +0 -1
  537. package/dist/css.js.map +0 -1
  538. package/dist/dropdown.cjs.map +0 -1
  539. package/dist/dropdown.js.map +0 -1
  540. package/dist/ether.cjs.map +0 -1
  541. package/dist/ether.js.map +0 -1
  542. package/dist/external-9_cqFQy3.cjs +0 -121
  543. package/dist/external-9_cqFQy3.cjs.map +0 -1
  544. package/dist/external-B-zN2e5z.cjs +0 -1507
  545. package/dist/external-B-zN2e5z.cjs.map +0 -1
  546. package/dist/external-BM82B8W2.js +0 -122
  547. package/dist/external-BM82B8W2.js.map +0 -1
  548. package/dist/external-BYqTC99W.js +0 -23
  549. package/dist/external-BYqTC99W.js.map +0 -1
  550. package/dist/external-BfZYUV3z.js +0 -157
  551. package/dist/external-BfZYUV3z.js.map +0 -1
  552. package/dist/external-BpqCp_M1.js +0 -15
  553. package/dist/external-BpqCp_M1.js.map +0 -1
  554. package/dist/external-BrW40HJx.js +0 -1508
  555. package/dist/external-BrW40HJx.js.map +0 -1
  556. package/dist/external-CAOQcoqL.js +0 -287
  557. package/dist/external-CAOQcoqL.js.map +0 -1
  558. package/dist/external-CIVsFXOp.cjs +0 -14
  559. package/dist/external-CIVsFXOp.cjs.map +0 -1
  560. package/dist/external-CnNdgPsB.js +0 -122
  561. package/dist/external-CnNdgPsB.js.map +0 -1
  562. package/dist/external-CwjCCHPi.js +0 -372
  563. package/dist/external-CwjCCHPi.js.map +0 -1
  564. package/dist/external-DNHMAfGi.js +0 -108
  565. package/dist/external-DNHMAfGi.js.map +0 -1
  566. package/dist/external-DVQ2SRoH.cjs +0 -121
  567. package/dist/external-DVQ2SRoH.cjs.map +0 -1
  568. package/dist/external-D_yXh8rn.cjs +0 -156
  569. package/dist/external-D_yXh8rn.cjs.map +0 -1
  570. package/dist/external-Df0D1YYb.cjs +0 -371
  571. package/dist/external-Df0D1YYb.cjs.map +0 -1
  572. package/dist/external-DhPBdJpR.cjs +0 -22
  573. package/dist/external-DhPBdJpR.cjs.map +0 -1
  574. package/dist/external-DhiN6pEk.cjs +0 -77
  575. package/dist/external-DhiN6pEk.cjs.map +0 -1
  576. package/dist/external-DjYXzP7v.cjs +0 -219
  577. package/dist/external-DjYXzP7v.cjs.map +0 -1
  578. package/dist/external-FWIwgLzc.js +0 -220
  579. package/dist/external-FWIwgLzc.js.map +0 -1
  580. package/dist/external-Iv2mRce8.cjs +0 -286
  581. package/dist/external-Iv2mRce8.cjs.map +0 -1
  582. package/dist/external-P6zP6dBA.cjs +0 -13
  583. package/dist/external-P6zP6dBA.cjs.map +0 -1
  584. package/dist/external-d-vI8EHK.cjs +0 -107
  585. package/dist/external-d-vI8EHK.cjs.map +0 -1
  586. package/dist/external-giUMrk8w.js +0 -78
  587. package/dist/external-giUMrk8w.js.map +0 -1
  588. package/dist/external-zG96smqq.js +0 -14
  589. package/dist/external-zG96smqq.js.map +0 -1
  590. package/dist/header.cjs.map +0 -1
  591. package/dist/header.js.map +0 -1
  592. package/dist/index.cjs.map +0 -1
  593. package/dist/index.js.map +0 -1
  594. package/dist/input.cjs.map +0 -1
  595. package/dist/input.js.map +0 -1
  596. package/dist/jsx-runtime-B3vWrP5x.cjs +0 -941
  597. package/dist/jsx-runtime-B3vWrP5x.cjs.map +0 -1
  598. package/dist/jsx-runtime-mMz73N64.js +0 -942
  599. package/dist/jsx-runtime-mMz73N64.js.map +0 -1
  600. package/dist/list.cjs.map +0 -1
  601. package/dist/list.js.map +0 -1
  602. package/dist/menu.cjs.map +0 -1
  603. package/dist/menu.js.map +0 -1
  604. package/dist/tabs.cjs.map +0 -1
  605. package/dist/tabs.js.map +0 -1
  606. package/dist/text.cjs.map +0 -1
  607. package/dist/text.js.map +0 -1
  608. package/dist/theming.cjs.map +0 -1
  609. package/dist/theming.js.map +0 -1
  610. package/dist/tree.cjs.map +0 -1
  611. package/dist/tree.js.map +0 -1
  612. package/dist/triggers.cjs.map +0 -1
  613. package/dist/triggers.js.map +0 -1
  614. package/dist/video.cjs.map +0 -1
  615. package/dist/video.js.map +0 -1
@@ -1,4235 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
7
- import { z as z$6 } from "zod";
8
- var g$4;
9
- (function(r2) {
10
- r2.assertEqual = (n2) => n2;
11
- function e2(n2) {
12
- }
13
- r2.assertIs = e2;
14
- function t2(n2) {
15
- throw new Error();
16
- }
17
- r2.assertNever = t2, r2.arrayToEnum = (n2) => {
18
- const a3 = {};
19
- for (const i2 of n2)
20
- a3[i2] = i2;
21
- return a3;
22
- }, r2.getValidEnumValues = (n2) => {
23
- const a3 = r2.objectKeys(n2).filter((o2) => typeof n2[n2[o2]] != "number"), i2 = {};
24
- for (const o2 of a3)
25
- i2[o2] = n2[o2];
26
- return r2.objectValues(i2);
27
- }, r2.objectValues = (n2) => r2.objectKeys(n2).map(function(a3) {
28
- return n2[a3];
29
- }), r2.objectKeys = typeof Object.keys == "function" ? (n2) => Object.keys(n2) : (n2) => {
30
- const a3 = [];
31
- for (const i2 in n2)
32
- Object.prototype.hasOwnProperty.call(n2, i2) && a3.push(i2);
33
- return a3;
34
- }, r2.find = (n2, a3) => {
35
- for (const i2 of n2)
36
- if (a3(i2))
37
- return i2;
38
- }, r2.isInteger = typeof Number.isInteger == "function" ? (n2) => Number.isInteger(n2) : (n2) => typeof n2 == "number" && isFinite(n2) && Math.floor(n2) === n2;
39
- function s2(n2, a3 = " | ") {
40
- return n2.map((i2) => typeof i2 == "string" ? `'${i2}'` : i2).join(a3);
41
- }
42
- r2.joinValues = s2, r2.jsonStringifyReplacer = (n2, a3) => typeof a3 == "bigint" ? a3.toString() : a3;
43
- })(g$4 || (g$4 = {}));
44
- var ye$1;
45
- (function(r2) {
46
- r2.mergeShapes = (e2, t2) => ({
47
- ...e2,
48
- ...t2
49
- // second overwrites first
50
- });
51
- })(ye$1 || (ye$1 = {}));
52
- const u$6 = g$4.arrayToEnum([
53
- "string",
54
- "nan",
55
- "number",
56
- "integer",
57
- "float",
58
- "boolean",
59
- "date",
60
- "bigint",
61
- "symbol",
62
- "function",
63
- "undefined",
64
- "null",
65
- "array",
66
- "object",
67
- "unknown",
68
- "promise",
69
- "void",
70
- "never",
71
- "map",
72
- "set"
73
- ]), R$4 = (r2) => {
74
- switch (typeof r2) {
75
- case "undefined":
76
- return u$6.undefined;
77
- case "string":
78
- return u$6.string;
79
- case "number":
80
- return isNaN(r2) ? u$6.nan : u$6.number;
81
- case "boolean":
82
- return u$6.boolean;
83
- case "function":
84
- return u$6.function;
85
- case "bigint":
86
- return u$6.bigint;
87
- case "symbol":
88
- return u$6.symbol;
89
- case "object":
90
- return Array.isArray(r2) ? u$6.array : r2 === null ? u$6.null : r2.then && typeof r2.then == "function" && r2.catch && typeof r2.catch == "function" ? u$6.promise : typeof Map < "u" && r2 instanceof Map ? u$6.map : typeof Set < "u" && r2 instanceof Set ? u$6.set : typeof Date < "u" && r2 instanceof Date ? u$6.date : u$6.object;
91
- default:
92
- return u$6.unknown;
93
- }
94
- }, d$5 = g$4.arrayToEnum([
95
- "invalid_type",
96
- "invalid_literal",
97
- "custom",
98
- "invalid_union",
99
- "invalid_union_discriminator",
100
- "invalid_enum_value",
101
- "unrecognized_keys",
102
- "invalid_arguments",
103
- "invalid_return_type",
104
- "invalid_date",
105
- "invalid_string",
106
- "too_small",
107
- "too_big",
108
- "invalid_intersection_types",
109
- "not_multiple_of",
110
- "not_finite"
111
- ]), Ee = (r2) => JSON.stringify(r2, null, 2).replace(/"([^"]+)":/g, "$1:");
112
- let Z$2 = class Z extends Error {
113
- constructor(e2) {
114
- super(), this.issues = [], this.addIssue = (s2) => {
115
- this.issues = [...this.issues, s2];
116
- }, this.addIssues = (s2 = []) => {
117
- this.issues = [...this.issues, ...s2];
118
- };
119
- const t2 = new.target.prototype;
120
- Object.setPrototypeOf ? Object.setPrototypeOf(this, t2) : this.__proto__ = t2, this.name = "ZodError", this.issues = e2;
121
- }
122
- get errors() {
123
- return this.issues;
124
- }
125
- format(e2) {
126
- const t2 = e2 || function(a3) {
127
- return a3.message;
128
- }, s2 = { _errors: [] }, n2 = (a3) => {
129
- for (const i2 of a3.issues)
130
- if (i2.code === "invalid_union")
131
- i2.unionErrors.map(n2);
132
- else if (i2.code === "invalid_return_type")
133
- n2(i2.returnTypeError);
134
- else if (i2.code === "invalid_arguments")
135
- n2(i2.argumentsError);
136
- else if (i2.path.length === 0)
137
- s2._errors.push(t2(i2));
138
- else {
139
- let o2 = s2, f2 = 0;
140
- for (; f2 < i2.path.length; ) {
141
- const c3 = i2.path[f2];
142
- f2 === i2.path.length - 1 ? (o2[c3] = o2[c3] || { _errors: [] }, o2[c3]._errors.push(t2(i2))) : o2[c3] = o2[c3] || { _errors: [] }, o2 = o2[c3], f2++;
143
- }
144
- }
145
- };
146
- return n2(this), s2;
147
- }
148
- toString() {
149
- return this.message;
150
- }
151
- get message() {
152
- return JSON.stringify(this.issues, g$4.jsonStringifyReplacer, 2);
153
- }
154
- get isEmpty() {
155
- return this.issues.length === 0;
156
- }
157
- flatten(e2 = (t2) => t2.message) {
158
- const t2 = {}, s2 = [];
159
- for (const n2 of this.issues)
160
- n2.path.length > 0 ? (t2[n2.path[0]] = t2[n2.path[0]] || [], t2[n2.path[0]].push(e2(n2))) : s2.push(e2(n2));
161
- return { formErrors: s2, fieldErrors: t2 };
162
- }
163
- get formErrors() {
164
- return this.flatten();
165
- }
166
- };
167
- Z$2.create = (r2) => new Z$2(r2);
168
- const W$2 = (r2, e2) => {
169
- let t2;
170
- switch (r2.code) {
171
- case d$5.invalid_type:
172
- r2.received === u$6.undefined ? t2 = "Required" : t2 = `Expected ${r2.expected}, received ${r2.received}`;
173
- break;
174
- case d$5.invalid_literal:
175
- t2 = `Invalid literal value, expected ${JSON.stringify(r2.expected, g$4.jsonStringifyReplacer)}`;
176
- break;
177
- case d$5.unrecognized_keys:
178
- t2 = `Unrecognized key(s) in object: ${g$4.joinValues(r2.keys, ", ")}`;
179
- break;
180
- case d$5.invalid_union:
181
- t2 = "Invalid input";
182
- break;
183
- case d$5.invalid_union_discriminator:
184
- t2 = `Invalid discriminator value. Expected ${g$4.joinValues(r2.options)}`;
185
- break;
186
- case d$5.invalid_enum_value:
187
- t2 = `Invalid enum value. Expected ${g$4.joinValues(r2.options)}, received '${r2.received}'`;
188
- break;
189
- case d$5.invalid_arguments:
190
- t2 = "Invalid function arguments";
191
- break;
192
- case d$5.invalid_return_type:
193
- t2 = "Invalid function return type";
194
- break;
195
- case d$5.invalid_date:
196
- t2 = "Invalid date";
197
- break;
198
- case d$5.invalid_string:
199
- typeof r2.validation == "object" ? "includes" in r2.validation ? (t2 = `Invalid input: must include "${r2.validation.includes}"`, typeof r2.validation.position == "number" && (t2 = `${t2} at one or more positions greater than or equal to ${r2.validation.position}`)) : "startsWith" in r2.validation ? t2 = `Invalid input: must start with "${r2.validation.startsWith}"` : "endsWith" in r2.validation ? t2 = `Invalid input: must end with "${r2.validation.endsWith}"` : g$4.assertNever(r2.validation) : r2.validation !== "regex" ? t2 = `Invalid ${r2.validation}` : t2 = "Invalid";
200
- break;
201
- case d$5.too_small:
202
- r2.type === "array" ? t2 = `Array must contain ${r2.exact ? "exactly" : r2.inclusive ? "at least" : "more than"} ${r2.minimum} element(s)` : r2.type === "string" ? t2 = `String must contain ${r2.exact ? "exactly" : r2.inclusive ? "at least" : "over"} ${r2.minimum} character(s)` : r2.type === "number" ? t2 = `Number must be ${r2.exact ? "exactly equal to " : r2.inclusive ? "greater than or equal to " : "greater than "}${r2.minimum}` : r2.type === "date" ? t2 = `Date must be ${r2.exact ? "exactly equal to " : r2.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(r2.minimum))}` : t2 = "Invalid input";
203
- break;
204
- case d$5.too_big:
205
- r2.type === "array" ? t2 = `Array must contain ${r2.exact ? "exactly" : r2.inclusive ? "at most" : "less than"} ${r2.maximum} element(s)` : r2.type === "string" ? t2 = `String must contain ${r2.exact ? "exactly" : r2.inclusive ? "at most" : "under"} ${r2.maximum} character(s)` : r2.type === "number" ? t2 = `Number must be ${r2.exact ? "exactly" : r2.inclusive ? "less than or equal to" : "less than"} ${r2.maximum}` : r2.type === "bigint" ? t2 = `BigInt must be ${r2.exact ? "exactly" : r2.inclusive ? "less than or equal to" : "less than"} ${r2.maximum}` : r2.type === "date" ? t2 = `Date must be ${r2.exact ? "exactly" : r2.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(r2.maximum))}` : t2 = "Invalid input";
206
- break;
207
- case d$5.custom:
208
- t2 = "Invalid input";
209
- break;
210
- case d$5.invalid_intersection_types:
211
- t2 = "Intersection results could not be merged";
212
- break;
213
- case d$5.not_multiple_of:
214
- t2 = `Number must be a multiple of ${r2.multipleOf}`;
215
- break;
216
- case d$5.not_finite:
217
- t2 = "Number must be finite";
218
- break;
219
- default:
220
- t2 = e2.defaultError, g$4.assertNever(r2);
221
- }
222
- return { message: t2 };
223
- };
224
- let be$1 = W$2;
225
- function Ie(r2) {
226
- be$1 = r2;
227
- }
228
- function ne$1() {
229
- return be$1;
230
- }
231
- const ae$1 = (r2) => {
232
- const { data: e2, path: t2, errorMaps: s2, issueData: n2 } = r2, a3 = [...t2, ...n2.path || []], i2 = {
233
- ...n2,
234
- path: a3
235
- };
236
- let o2 = "";
237
- const f2 = s2.filter((c3) => !!c3).slice().reverse();
238
- for (const c3 of f2)
239
- o2 = c3(i2, { data: e2, defaultError: o2 }).message;
240
- return {
241
- ...n2,
242
- path: a3,
243
- message: n2.message || o2
244
- };
245
- }, Re = [];
246
- function l$6(r2, e2) {
247
- const t2 = ae$1({
248
- issueData: e2,
249
- data: r2.data,
250
- path: r2.path,
251
- errorMaps: [
252
- r2.common.contextualErrorMap,
253
- r2.schemaErrorMap,
254
- ne$1(),
255
- W$2
256
- // then global default map
257
- ].filter((s2) => !!s2)
258
- });
259
- r2.common.issues.push(t2);
260
- }
261
- let k$4 = class k {
262
- constructor() {
263
- this.value = "valid";
264
- }
265
- dirty() {
266
- this.value === "valid" && (this.value = "dirty");
267
- }
268
- abort() {
269
- this.value !== "aborted" && (this.value = "aborted");
270
- }
271
- static mergeArray(e2, t2) {
272
- const s2 = [];
273
- for (const n2 of t2) {
274
- if (n2.status === "aborted")
275
- return m$4;
276
- n2.status === "dirty" && e2.dirty(), s2.push(n2.value);
277
- }
278
- return { status: e2.value, value: s2 };
279
- }
280
- static async mergeObjectAsync(e2, t2) {
281
- const s2 = [];
282
- for (const n2 of t2)
283
- s2.push({
284
- key: await n2.key,
285
- value: await n2.value
286
- });
287
- return k.mergeObjectSync(e2, s2);
288
- }
289
- static mergeObjectSync(e2, t2) {
290
- const s2 = {};
291
- for (const n2 of t2) {
292
- const { key: a3, value: i2 } = n2;
293
- if (a3.status === "aborted" || i2.status === "aborted")
294
- return m$4;
295
- a3.status === "dirty" && e2.dirty(), i2.status === "dirty" && e2.dirty(), a3.value !== "__proto__" && (typeof i2.value < "u" || n2.alwaysSet) && (s2[a3.value] = i2.value);
296
- }
297
- return { status: e2.value, value: s2 };
298
- }
299
- };
300
- const m$4 = Object.freeze({
301
- status: "aborted"
302
- }), we = (r2) => ({ status: "dirty", value: r2 }), b$7 = (r2) => ({ status: "valid", value: r2 }), ve$1 = (r2) => r2.status === "aborted", _e$1 = (r2) => r2.status === "dirty", q$2 = (r2) => r2.status === "valid", ie$1 = (r2) => typeof Promise < "u" && r2 instanceof Promise;
303
- var h$5;
304
- (function(r2) {
305
- r2.errToObj = (e2) => typeof e2 == "string" ? { message: e2 } : e2 || {}, r2.toString = (e2) => typeof e2 == "string" ? e2 : e2 == null ? void 0 : e2.message;
306
- })(h$5 || (h$5 = {}));
307
- let C$3 = class C {
308
- constructor(e2, t2, s2, n2) {
309
- this._cachedPath = [], this.parent = e2, this.data = t2, this._path = s2, this._key = n2;
310
- }
311
- get path() {
312
- return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
313
- }
314
- };
315
- const xe = (r2, e2) => {
316
- if (q$2(e2))
317
- return { success: true, data: e2.value };
318
- if (!r2.common.issues.length)
319
- throw new Error("Validation failed but no issues detected.");
320
- return {
321
- success: false,
322
- get error() {
323
- if (this._error)
324
- return this._error;
325
- const t2 = new Z$2(r2.common.issues);
326
- return this._error = t2, this._error;
327
- }
328
- };
329
- };
330
- function y$3(r2) {
331
- if (!r2)
332
- return {};
333
- const { errorMap: e2, invalid_type_error: t2, required_error: s2, description: n2 } = r2;
334
- if (e2 && (t2 || s2))
335
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
336
- return e2 ? { errorMap: e2, description: n2 } : { errorMap: (i2, o2) => i2.code !== "invalid_type" ? { message: o2.defaultError } : typeof o2.data > "u" ? { message: s2 ?? o2.defaultError } : { message: t2 ?? o2.defaultError }, description: n2 };
337
- }
338
- let v$2 = class v {
339
- constructor(e2) {
340
- this.spa = this.safeParseAsync, this._def = e2, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this);
341
- }
342
- get description() {
343
- return this._def.description;
344
- }
345
- _getType(e2) {
346
- return R$4(e2.data);
347
- }
348
- _getOrReturnCtx(e2, t2) {
349
- return t2 || {
350
- common: e2.parent.common,
351
- data: e2.data,
352
- parsedType: R$4(e2.data),
353
- schemaErrorMap: this._def.errorMap,
354
- path: e2.path,
355
- parent: e2.parent
356
- };
357
- }
358
- _processInputParams(e2) {
359
- return {
360
- status: new k$4(),
361
- ctx: {
362
- common: e2.parent.common,
363
- data: e2.data,
364
- parsedType: R$4(e2.data),
365
- schemaErrorMap: this._def.errorMap,
366
- path: e2.path,
367
- parent: e2.parent
368
- }
369
- };
370
- }
371
- _parseSync(e2) {
372
- const t2 = this._parse(e2);
373
- if (ie$1(t2))
374
- throw new Error("Synchronous parse encountered promise.");
375
- return t2;
376
- }
377
- _parseAsync(e2) {
378
- const t2 = this._parse(e2);
379
- return Promise.resolve(t2);
380
- }
381
- parse(e2, t2) {
382
- const s2 = this.safeParse(e2, t2);
383
- if (s2.success)
384
- return s2.data;
385
- throw s2.error;
386
- }
387
- safeParse(e2, t2) {
388
- var s2;
389
- const n2 = {
390
- common: {
391
- issues: [],
392
- async: (s2 = t2 == null ? void 0 : t2.async) !== null && s2 !== void 0 ? s2 : false,
393
- contextualErrorMap: t2 == null ? void 0 : t2.errorMap
394
- },
395
- path: (t2 == null ? void 0 : t2.path) || [],
396
- schemaErrorMap: this._def.errorMap,
397
- parent: null,
398
- data: e2,
399
- parsedType: R$4(e2)
400
- }, a3 = this._parseSync({ data: e2, path: n2.path, parent: n2 });
401
- return xe(n2, a3);
402
- }
403
- async parseAsync(e2, t2) {
404
- const s2 = await this.safeParseAsync(e2, t2);
405
- if (s2.success)
406
- return s2.data;
407
- throw s2.error;
408
- }
409
- async safeParseAsync(e2, t2) {
410
- const s2 = {
411
- common: {
412
- issues: [],
413
- contextualErrorMap: t2 == null ? void 0 : t2.errorMap,
414
- async: true
415
- },
416
- path: (t2 == null ? void 0 : t2.path) || [],
417
- schemaErrorMap: this._def.errorMap,
418
- parent: null,
419
- data: e2,
420
- parsedType: R$4(e2)
421
- }, n2 = this._parse({ data: e2, path: s2.path, parent: s2 }), a3 = await (ie$1(n2) ? n2 : Promise.resolve(n2));
422
- return xe(s2, a3);
423
- }
424
- refine(e2, t2) {
425
- const s2 = (n2) => typeof t2 == "string" || typeof t2 > "u" ? { message: t2 } : typeof t2 == "function" ? t2(n2) : t2;
426
- return this._refinement((n2, a3) => {
427
- const i2 = e2(n2), o2 = () => a3.addIssue({
428
- code: d$5.custom,
429
- ...s2(n2)
430
- });
431
- return typeof Promise < "u" && i2 instanceof Promise ? i2.then((f2) => f2 ? true : (o2(), false)) : i2 ? true : (o2(), false);
432
- });
433
- }
434
- refinement(e2, t2) {
435
- return this._refinement((s2, n2) => e2(s2) ? true : (n2.addIssue(typeof t2 == "function" ? t2(s2, n2) : t2), false));
436
- }
437
- _refinement(e2) {
438
- return new N$4({
439
- schema: this,
440
- typeName: p$5.ZodEffects,
441
- effect: { type: "refinement", refinement: e2 }
442
- });
443
- }
444
- superRefine(e2) {
445
- return this._refinement(e2);
446
- }
447
- optional() {
448
- return E$4.create(this, this._def);
449
- }
450
- nullable() {
451
- return L$5.create(this, this._def);
452
- }
453
- nullish() {
454
- return this.nullable().optional();
455
- }
456
- array() {
457
- return S$3.create(this, this._def);
458
- }
459
- promise() {
460
- return B$5.create(this, this._def);
461
- }
462
- or(e2) {
463
- return G$2.create([this, e2], this._def);
464
- }
465
- and(e2) {
466
- return X$4.create(this, e2, this._def);
467
- }
468
- transform(e2) {
469
- return new N$4({
470
- ...y$3(this._def),
471
- schema: this,
472
- typeName: p$5.ZodEffects,
473
- effect: { type: "transform", transform: e2 }
474
- });
475
- }
476
- default(e2) {
477
- const t2 = typeof e2 == "function" ? e2 : () => e2;
478
- return new te$1({
479
- ...y$3(this._def),
480
- innerType: this,
481
- defaultValue: t2,
482
- typeName: p$5.ZodDefault
483
- });
484
- }
485
- brand() {
486
- return new Ze({
487
- typeName: p$5.ZodBranded,
488
- type: this,
489
- ...y$3(this._def)
490
- });
491
- }
492
- catch(e2) {
493
- const t2 = typeof e2 == "function" ? e2 : () => e2;
494
- return new ue$1({
495
- ...y$3(this._def),
496
- innerType: this,
497
- catchValue: t2,
498
- typeName: p$5.ZodCatch
499
- });
500
- }
501
- describe(e2) {
502
- const t2 = this.constructor;
503
- return new t2({
504
- ...this._def,
505
- description: e2
506
- });
507
- }
508
- pipe(e2) {
509
- return re$1.create(this, e2);
510
- }
511
- readonly() {
512
- return fe$1.create(this);
513
- }
514
- isOptional() {
515
- return this.safeParse(void 0).success;
516
- }
517
- isNullable() {
518
- return this.safeParse(null).success;
519
- }
520
- };
521
- const je$1 = /^c[^\s-]{8,}$/i, Ae$1 = /^[a-z][a-z0-9]*$/, Me = /^[0-9A-HJKMNP-TV-Z]{26}$/, Pe = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ve = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, $e = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
522
- let me$1;
523
- const Le = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/, De = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, ze$1 = (r2) => r2.precision ? r2.offset ? new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r2.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`) : new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r2.precision}}Z$`) : r2.precision === 0 ? r2.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$") : r2.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");
524
- function Ue(r2, e2) {
525
- return !!((e2 === "v4" || !e2) && Le.test(r2) || (e2 === "v6" || !e2) && De.test(r2));
526
- }
527
- let T$5 = class T extends v$2 {
528
- _parse(e2) {
529
- if (this._def.coerce && (e2.data = String(e2.data)), this._getType(e2) !== u$6.string) {
530
- const a3 = this._getOrReturnCtx(e2);
531
- return l$6(
532
- a3,
533
- {
534
- code: d$5.invalid_type,
535
- expected: u$6.string,
536
- received: a3.parsedType
537
- }
538
- //
539
- ), m$4;
540
- }
541
- const s2 = new k$4();
542
- let n2;
543
- for (const a3 of this._def.checks)
544
- if (a3.kind === "min")
545
- e2.data.length < a3.value && (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
546
- code: d$5.too_small,
547
- minimum: a3.value,
548
- type: "string",
549
- inclusive: true,
550
- exact: false,
551
- message: a3.message
552
- }), s2.dirty());
553
- else if (a3.kind === "max")
554
- e2.data.length > a3.value && (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
555
- code: d$5.too_big,
556
- maximum: a3.value,
557
- type: "string",
558
- inclusive: true,
559
- exact: false,
560
- message: a3.message
561
- }), s2.dirty());
562
- else if (a3.kind === "length") {
563
- const i2 = e2.data.length > a3.value, o2 = e2.data.length < a3.value;
564
- (i2 || o2) && (n2 = this._getOrReturnCtx(e2, n2), i2 ? l$6(n2, {
565
- code: d$5.too_big,
566
- maximum: a3.value,
567
- type: "string",
568
- inclusive: true,
569
- exact: true,
570
- message: a3.message
571
- }) : o2 && l$6(n2, {
572
- code: d$5.too_small,
573
- minimum: a3.value,
574
- type: "string",
575
- inclusive: true,
576
- exact: true,
577
- message: a3.message
578
- }), s2.dirty());
579
- } else if (a3.kind === "email")
580
- Ve.test(e2.data) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
581
- validation: "email",
582
- code: d$5.invalid_string,
583
- message: a3.message
584
- }), s2.dirty());
585
- else if (a3.kind === "emoji")
586
- me$1 || (me$1 = new RegExp($e, "u")), me$1.test(e2.data) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
587
- validation: "emoji",
588
- code: d$5.invalid_string,
589
- message: a3.message
590
- }), s2.dirty());
591
- else if (a3.kind === "uuid")
592
- Pe.test(e2.data) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
593
- validation: "uuid",
594
- code: d$5.invalid_string,
595
- message: a3.message
596
- }), s2.dirty());
597
- else if (a3.kind === "cuid")
598
- je$1.test(e2.data) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
599
- validation: "cuid",
600
- code: d$5.invalid_string,
601
- message: a3.message
602
- }), s2.dirty());
603
- else if (a3.kind === "cuid2")
604
- Ae$1.test(e2.data) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
605
- validation: "cuid2",
606
- code: d$5.invalid_string,
607
- message: a3.message
608
- }), s2.dirty());
609
- else if (a3.kind === "ulid")
610
- Me.test(e2.data) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
611
- validation: "ulid",
612
- code: d$5.invalid_string,
613
- message: a3.message
614
- }), s2.dirty());
615
- else if (a3.kind === "url")
616
- try {
617
- new URL(e2.data);
618
- } catch {
619
- n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
620
- validation: "url",
621
- code: d$5.invalid_string,
622
- message: a3.message
623
- }), s2.dirty();
624
- }
625
- else
626
- a3.kind === "regex" ? (a3.regex.lastIndex = 0, a3.regex.test(e2.data) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
627
- validation: "regex",
628
- code: d$5.invalid_string,
629
- message: a3.message
630
- }), s2.dirty())) : a3.kind === "trim" ? e2.data = e2.data.trim() : a3.kind === "includes" ? e2.data.includes(a3.value, a3.position) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
631
- code: d$5.invalid_string,
632
- validation: { includes: a3.value, position: a3.position },
633
- message: a3.message
634
- }), s2.dirty()) : a3.kind === "toLowerCase" ? e2.data = e2.data.toLowerCase() : a3.kind === "toUpperCase" ? e2.data = e2.data.toUpperCase() : a3.kind === "startsWith" ? e2.data.startsWith(a3.value) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
635
- code: d$5.invalid_string,
636
- validation: { startsWith: a3.value },
637
- message: a3.message
638
- }), s2.dirty()) : a3.kind === "endsWith" ? e2.data.endsWith(a3.value) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
639
- code: d$5.invalid_string,
640
- validation: { endsWith: a3.value },
641
- message: a3.message
642
- }), s2.dirty()) : a3.kind === "datetime" ? ze$1(a3).test(e2.data) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
643
- code: d$5.invalid_string,
644
- validation: "datetime",
645
- message: a3.message
646
- }), s2.dirty()) : a3.kind === "ip" ? Ue(e2.data, a3.version) || (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
647
- validation: "ip",
648
- code: d$5.invalid_string,
649
- message: a3.message
650
- }), s2.dirty()) : g$4.assertNever(a3);
651
- return { status: s2.value, value: e2.data };
652
- }
653
- _regex(e2, t2, s2) {
654
- return this.refinement((n2) => e2.test(n2), {
655
- validation: t2,
656
- code: d$5.invalid_string,
657
- ...h$5.errToObj(s2)
658
- });
659
- }
660
- _addCheck(e2) {
661
- return new T({
662
- ...this._def,
663
- checks: [...this._def.checks, e2]
664
- });
665
- }
666
- email(e2) {
667
- return this._addCheck({ kind: "email", ...h$5.errToObj(e2) });
668
- }
669
- url(e2) {
670
- return this._addCheck({ kind: "url", ...h$5.errToObj(e2) });
671
- }
672
- emoji(e2) {
673
- return this._addCheck({ kind: "emoji", ...h$5.errToObj(e2) });
674
- }
675
- uuid(e2) {
676
- return this._addCheck({ kind: "uuid", ...h$5.errToObj(e2) });
677
- }
678
- cuid(e2) {
679
- return this._addCheck({ kind: "cuid", ...h$5.errToObj(e2) });
680
- }
681
- cuid2(e2) {
682
- return this._addCheck({ kind: "cuid2", ...h$5.errToObj(e2) });
683
- }
684
- ulid(e2) {
685
- return this._addCheck({ kind: "ulid", ...h$5.errToObj(e2) });
686
- }
687
- ip(e2) {
688
- return this._addCheck({ kind: "ip", ...h$5.errToObj(e2) });
689
- }
690
- datetime(e2) {
691
- var t2;
692
- return typeof e2 == "string" ? this._addCheck({
693
- kind: "datetime",
694
- precision: null,
695
- offset: false,
696
- message: e2
697
- }) : this._addCheck({
698
- kind: "datetime",
699
- precision: typeof (e2 == null ? void 0 : e2.precision) > "u" ? null : e2 == null ? void 0 : e2.precision,
700
- offset: (t2 = e2 == null ? void 0 : e2.offset) !== null && t2 !== void 0 ? t2 : false,
701
- ...h$5.errToObj(e2 == null ? void 0 : e2.message)
702
- });
703
- }
704
- regex(e2, t2) {
705
- return this._addCheck({
706
- kind: "regex",
707
- regex: e2,
708
- ...h$5.errToObj(t2)
709
- });
710
- }
711
- includes(e2, t2) {
712
- return this._addCheck({
713
- kind: "includes",
714
- value: e2,
715
- position: t2 == null ? void 0 : t2.position,
716
- ...h$5.errToObj(t2 == null ? void 0 : t2.message)
717
- });
718
- }
719
- startsWith(e2, t2) {
720
- return this._addCheck({
721
- kind: "startsWith",
722
- value: e2,
723
- ...h$5.errToObj(t2)
724
- });
725
- }
726
- endsWith(e2, t2) {
727
- return this._addCheck({
728
- kind: "endsWith",
729
- value: e2,
730
- ...h$5.errToObj(t2)
731
- });
732
- }
733
- min(e2, t2) {
734
- return this._addCheck({
735
- kind: "min",
736
- value: e2,
737
- ...h$5.errToObj(t2)
738
- });
739
- }
740
- max(e2, t2) {
741
- return this._addCheck({
742
- kind: "max",
743
- value: e2,
744
- ...h$5.errToObj(t2)
745
- });
746
- }
747
- length(e2, t2) {
748
- return this._addCheck({
749
- kind: "length",
750
- value: e2,
751
- ...h$5.errToObj(t2)
752
- });
753
- }
754
- /**
755
- * @deprecated Use z.string().min(1) instead.
756
- * @see {@link ZodString.min}
757
- */
758
- nonempty(e2) {
759
- return this.min(1, h$5.errToObj(e2));
760
- }
761
- trim() {
762
- return new T({
763
- ...this._def,
764
- checks: [...this._def.checks, { kind: "trim" }]
765
- });
766
- }
767
- toLowerCase() {
768
- return new T({
769
- ...this._def,
770
- checks: [...this._def.checks, { kind: "toLowerCase" }]
771
- });
772
- }
773
- toUpperCase() {
774
- return new T({
775
- ...this._def,
776
- checks: [...this._def.checks, { kind: "toUpperCase" }]
777
- });
778
- }
779
- get isDatetime() {
780
- return !!this._def.checks.find((e2) => e2.kind === "datetime");
781
- }
782
- get isEmail() {
783
- return !!this._def.checks.find((e2) => e2.kind === "email");
784
- }
785
- get isURL() {
786
- return !!this._def.checks.find((e2) => e2.kind === "url");
787
- }
788
- get isEmoji() {
789
- return !!this._def.checks.find((e2) => e2.kind === "emoji");
790
- }
791
- get isUUID() {
792
- return !!this._def.checks.find((e2) => e2.kind === "uuid");
793
- }
794
- get isCUID() {
795
- return !!this._def.checks.find((e2) => e2.kind === "cuid");
796
- }
797
- get isCUID2() {
798
- return !!this._def.checks.find((e2) => e2.kind === "cuid2");
799
- }
800
- get isULID() {
801
- return !!this._def.checks.find((e2) => e2.kind === "ulid");
802
- }
803
- get isIP() {
804
- return !!this._def.checks.find((e2) => e2.kind === "ip");
805
- }
806
- get minLength() {
807
- let e2 = null;
808
- for (const t2 of this._def.checks)
809
- t2.kind === "min" && (e2 === null || t2.value > e2) && (e2 = t2.value);
810
- return e2;
811
- }
812
- get maxLength() {
813
- let e2 = null;
814
- for (const t2 of this._def.checks)
815
- t2.kind === "max" && (e2 === null || t2.value < e2) && (e2 = t2.value);
816
- return e2;
817
- }
818
- };
819
- T$5.create = (r2) => {
820
- var e2;
821
- return new T$5({
822
- checks: [],
823
- typeName: p$5.ZodString,
824
- coerce: (e2 = r2 == null ? void 0 : r2.coerce) !== null && e2 !== void 0 ? e2 : false,
825
- ...y$3(r2)
826
- });
827
- };
828
- function Be(r2, e2) {
829
- const t2 = (r2.toString().split(".")[1] || "").length, s2 = (e2.toString().split(".")[1] || "").length, n2 = t2 > s2 ? t2 : s2, a3 = parseInt(r2.toFixed(n2).replace(".", "")), i2 = parseInt(e2.toFixed(n2).replace(".", ""));
830
- return a3 % i2 / Math.pow(10, n2);
831
- }
832
- let j$6 = class j extends v$2 {
833
- constructor() {
834
- super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
835
- }
836
- _parse(e2) {
837
- if (this._def.coerce && (e2.data = Number(e2.data)), this._getType(e2) !== u$6.number) {
838
- const a3 = this._getOrReturnCtx(e2);
839
- return l$6(a3, {
840
- code: d$5.invalid_type,
841
- expected: u$6.number,
842
- received: a3.parsedType
843
- }), m$4;
844
- }
845
- let s2;
846
- const n2 = new k$4();
847
- for (const a3 of this._def.checks)
848
- a3.kind === "int" ? g$4.isInteger(e2.data) || (s2 = this._getOrReturnCtx(e2, s2), l$6(s2, {
849
- code: d$5.invalid_type,
850
- expected: "integer",
851
- received: "float",
852
- message: a3.message
853
- }), n2.dirty()) : a3.kind === "min" ? (a3.inclusive ? e2.data < a3.value : e2.data <= a3.value) && (s2 = this._getOrReturnCtx(e2, s2), l$6(s2, {
854
- code: d$5.too_small,
855
- minimum: a3.value,
856
- type: "number",
857
- inclusive: a3.inclusive,
858
- exact: false,
859
- message: a3.message
860
- }), n2.dirty()) : a3.kind === "max" ? (a3.inclusive ? e2.data > a3.value : e2.data >= a3.value) && (s2 = this._getOrReturnCtx(e2, s2), l$6(s2, {
861
- code: d$5.too_big,
862
- maximum: a3.value,
863
- type: "number",
864
- inclusive: a3.inclusive,
865
- exact: false,
866
- message: a3.message
867
- }), n2.dirty()) : a3.kind === "multipleOf" ? Be(e2.data, a3.value) !== 0 && (s2 = this._getOrReturnCtx(e2, s2), l$6(s2, {
868
- code: d$5.not_multiple_of,
869
- multipleOf: a3.value,
870
- message: a3.message
871
- }), n2.dirty()) : a3.kind === "finite" ? Number.isFinite(e2.data) || (s2 = this._getOrReturnCtx(e2, s2), l$6(s2, {
872
- code: d$5.not_finite,
873
- message: a3.message
874
- }), n2.dirty()) : g$4.assertNever(a3);
875
- return { status: n2.value, value: e2.data };
876
- }
877
- gte(e2, t2) {
878
- return this.setLimit("min", e2, true, h$5.toString(t2));
879
- }
880
- gt(e2, t2) {
881
- return this.setLimit("min", e2, false, h$5.toString(t2));
882
- }
883
- lte(e2, t2) {
884
- return this.setLimit("max", e2, true, h$5.toString(t2));
885
- }
886
- lt(e2, t2) {
887
- return this.setLimit("max", e2, false, h$5.toString(t2));
888
- }
889
- setLimit(e2, t2, s2, n2) {
890
- return new j({
891
- ...this._def,
892
- checks: [
893
- ...this._def.checks,
894
- {
895
- kind: e2,
896
- value: t2,
897
- inclusive: s2,
898
- message: h$5.toString(n2)
899
- }
900
- ]
901
- });
902
- }
903
- _addCheck(e2) {
904
- return new j({
905
- ...this._def,
906
- checks: [...this._def.checks, e2]
907
- });
908
- }
909
- int(e2) {
910
- return this._addCheck({
911
- kind: "int",
912
- message: h$5.toString(e2)
913
- });
914
- }
915
- positive(e2) {
916
- return this._addCheck({
917
- kind: "min",
918
- value: 0,
919
- inclusive: false,
920
- message: h$5.toString(e2)
921
- });
922
- }
923
- negative(e2) {
924
- return this._addCheck({
925
- kind: "max",
926
- value: 0,
927
- inclusive: false,
928
- message: h$5.toString(e2)
929
- });
930
- }
931
- nonpositive(e2) {
932
- return this._addCheck({
933
- kind: "max",
934
- value: 0,
935
- inclusive: true,
936
- message: h$5.toString(e2)
937
- });
938
- }
939
- nonnegative(e2) {
940
- return this._addCheck({
941
- kind: "min",
942
- value: 0,
943
- inclusive: true,
944
- message: h$5.toString(e2)
945
- });
946
- }
947
- multipleOf(e2, t2) {
948
- return this._addCheck({
949
- kind: "multipleOf",
950
- value: e2,
951
- message: h$5.toString(t2)
952
- });
953
- }
954
- finite(e2) {
955
- return this._addCheck({
956
- kind: "finite",
957
- message: h$5.toString(e2)
958
- });
959
- }
960
- safe(e2) {
961
- return this._addCheck({
962
- kind: "min",
963
- inclusive: true,
964
- value: Number.MIN_SAFE_INTEGER,
965
- message: h$5.toString(e2)
966
- })._addCheck({
967
- kind: "max",
968
- inclusive: true,
969
- value: Number.MAX_SAFE_INTEGER,
970
- message: h$5.toString(e2)
971
- });
972
- }
973
- get minValue() {
974
- let e2 = null;
975
- for (const t2 of this._def.checks)
976
- t2.kind === "min" && (e2 === null || t2.value > e2) && (e2 = t2.value);
977
- return e2;
978
- }
979
- get maxValue() {
980
- let e2 = null;
981
- for (const t2 of this._def.checks)
982
- t2.kind === "max" && (e2 === null || t2.value < e2) && (e2 = t2.value);
983
- return e2;
984
- }
985
- get isInt() {
986
- return !!this._def.checks.find((e2) => e2.kind === "int" || e2.kind === "multipleOf" && g$4.isInteger(e2.value));
987
- }
988
- get isFinite() {
989
- let e2 = null, t2 = null;
990
- for (const s2 of this._def.checks) {
991
- if (s2.kind === "finite" || s2.kind === "int" || s2.kind === "multipleOf")
992
- return true;
993
- s2.kind === "min" ? (t2 === null || s2.value > t2) && (t2 = s2.value) : s2.kind === "max" && (e2 === null || s2.value < e2) && (e2 = s2.value);
994
- }
995
- return Number.isFinite(t2) && Number.isFinite(e2);
996
- }
997
- };
998
- j$6.create = (r2) => new j$6({
999
- checks: [],
1000
- typeName: p$5.ZodNumber,
1001
- coerce: (r2 == null ? void 0 : r2.coerce) || false,
1002
- ...y$3(r2)
1003
- });
1004
- let A$6 = class A extends v$2 {
1005
- constructor() {
1006
- super(...arguments), this.min = this.gte, this.max = this.lte;
1007
- }
1008
- _parse(e2) {
1009
- if (this._def.coerce && (e2.data = BigInt(e2.data)), this._getType(e2) !== u$6.bigint) {
1010
- const a3 = this._getOrReturnCtx(e2);
1011
- return l$6(a3, {
1012
- code: d$5.invalid_type,
1013
- expected: u$6.bigint,
1014
- received: a3.parsedType
1015
- }), m$4;
1016
- }
1017
- let s2;
1018
- const n2 = new k$4();
1019
- for (const a3 of this._def.checks)
1020
- a3.kind === "min" ? (a3.inclusive ? e2.data < a3.value : e2.data <= a3.value) && (s2 = this._getOrReturnCtx(e2, s2), l$6(s2, {
1021
- code: d$5.too_small,
1022
- type: "bigint",
1023
- minimum: a3.value,
1024
- inclusive: a3.inclusive,
1025
- message: a3.message
1026
- }), n2.dirty()) : a3.kind === "max" ? (a3.inclusive ? e2.data > a3.value : e2.data >= a3.value) && (s2 = this._getOrReturnCtx(e2, s2), l$6(s2, {
1027
- code: d$5.too_big,
1028
- type: "bigint",
1029
- maximum: a3.value,
1030
- inclusive: a3.inclusive,
1031
- message: a3.message
1032
- }), n2.dirty()) : a3.kind === "multipleOf" ? e2.data % a3.value !== BigInt(0) && (s2 = this._getOrReturnCtx(e2, s2), l$6(s2, {
1033
- code: d$5.not_multiple_of,
1034
- multipleOf: a3.value,
1035
- message: a3.message
1036
- }), n2.dirty()) : g$4.assertNever(a3);
1037
- return { status: n2.value, value: e2.data };
1038
- }
1039
- gte(e2, t2) {
1040
- return this.setLimit("min", e2, true, h$5.toString(t2));
1041
- }
1042
- gt(e2, t2) {
1043
- return this.setLimit("min", e2, false, h$5.toString(t2));
1044
- }
1045
- lte(e2, t2) {
1046
- return this.setLimit("max", e2, true, h$5.toString(t2));
1047
- }
1048
- lt(e2, t2) {
1049
- return this.setLimit("max", e2, false, h$5.toString(t2));
1050
- }
1051
- setLimit(e2, t2, s2, n2) {
1052
- return new A({
1053
- ...this._def,
1054
- checks: [
1055
- ...this._def.checks,
1056
- {
1057
- kind: e2,
1058
- value: t2,
1059
- inclusive: s2,
1060
- message: h$5.toString(n2)
1061
- }
1062
- ]
1063
- });
1064
- }
1065
- _addCheck(e2) {
1066
- return new A({
1067
- ...this._def,
1068
- checks: [...this._def.checks, e2]
1069
- });
1070
- }
1071
- positive(e2) {
1072
- return this._addCheck({
1073
- kind: "min",
1074
- value: BigInt(0),
1075
- inclusive: false,
1076
- message: h$5.toString(e2)
1077
- });
1078
- }
1079
- negative(e2) {
1080
- return this._addCheck({
1081
- kind: "max",
1082
- value: BigInt(0),
1083
- inclusive: false,
1084
- message: h$5.toString(e2)
1085
- });
1086
- }
1087
- nonpositive(e2) {
1088
- return this._addCheck({
1089
- kind: "max",
1090
- value: BigInt(0),
1091
- inclusive: true,
1092
- message: h$5.toString(e2)
1093
- });
1094
- }
1095
- nonnegative(e2) {
1096
- return this._addCheck({
1097
- kind: "min",
1098
- value: BigInt(0),
1099
- inclusive: true,
1100
- message: h$5.toString(e2)
1101
- });
1102
- }
1103
- multipleOf(e2, t2) {
1104
- return this._addCheck({
1105
- kind: "multipleOf",
1106
- value: e2,
1107
- message: h$5.toString(t2)
1108
- });
1109
- }
1110
- get minValue() {
1111
- let e2 = null;
1112
- for (const t2 of this._def.checks)
1113
- t2.kind === "min" && (e2 === null || t2.value > e2) && (e2 = t2.value);
1114
- return e2;
1115
- }
1116
- get maxValue() {
1117
- let e2 = null;
1118
- for (const t2 of this._def.checks)
1119
- t2.kind === "max" && (e2 === null || t2.value < e2) && (e2 = t2.value);
1120
- return e2;
1121
- }
1122
- };
1123
- A$6.create = (r2) => {
1124
- var e2;
1125
- return new A$6({
1126
- checks: [],
1127
- typeName: p$5.ZodBigInt,
1128
- coerce: (e2 = r2 == null ? void 0 : r2.coerce) !== null && e2 !== void 0 ? e2 : false,
1129
- ...y$3(r2)
1130
- });
1131
- };
1132
- let J$3 = class J extends v$2 {
1133
- _parse(e2) {
1134
- if (this._def.coerce && (e2.data = !!e2.data), this._getType(e2) !== u$6.boolean) {
1135
- const s2 = this._getOrReturnCtx(e2);
1136
- return l$6(s2, {
1137
- code: d$5.invalid_type,
1138
- expected: u$6.boolean,
1139
- received: s2.parsedType
1140
- }), m$4;
1141
- }
1142
- return b$7(e2.data);
1143
- }
1144
- };
1145
- J$3.create = (r2) => new J$3({
1146
- typeName: p$5.ZodBoolean,
1147
- coerce: (r2 == null ? void 0 : r2.coerce) || false,
1148
- ...y$3(r2)
1149
- });
1150
- let V$2 = class V extends v$2 {
1151
- _parse(e2) {
1152
- if (this._def.coerce && (e2.data = new Date(e2.data)), this._getType(e2) !== u$6.date) {
1153
- const a3 = this._getOrReturnCtx(e2);
1154
- return l$6(a3, {
1155
- code: d$5.invalid_type,
1156
- expected: u$6.date,
1157
- received: a3.parsedType
1158
- }), m$4;
1159
- }
1160
- if (isNaN(e2.data.getTime())) {
1161
- const a3 = this._getOrReturnCtx(e2);
1162
- return l$6(a3, {
1163
- code: d$5.invalid_date
1164
- }), m$4;
1165
- }
1166
- const s2 = new k$4();
1167
- let n2;
1168
- for (const a3 of this._def.checks)
1169
- a3.kind === "min" ? e2.data.getTime() < a3.value && (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
1170
- code: d$5.too_small,
1171
- message: a3.message,
1172
- inclusive: true,
1173
- exact: false,
1174
- minimum: a3.value,
1175
- type: "date"
1176
- }), s2.dirty()) : a3.kind === "max" ? e2.data.getTime() > a3.value && (n2 = this._getOrReturnCtx(e2, n2), l$6(n2, {
1177
- code: d$5.too_big,
1178
- message: a3.message,
1179
- inclusive: true,
1180
- exact: false,
1181
- maximum: a3.value,
1182
- type: "date"
1183
- }), s2.dirty()) : g$4.assertNever(a3);
1184
- return {
1185
- status: s2.value,
1186
- value: new Date(e2.data.getTime())
1187
- };
1188
- }
1189
- _addCheck(e2) {
1190
- return new V({
1191
- ...this._def,
1192
- checks: [...this._def.checks, e2]
1193
- });
1194
- }
1195
- min(e2, t2) {
1196
- return this._addCheck({
1197
- kind: "min",
1198
- value: e2.getTime(),
1199
- message: h$5.toString(t2)
1200
- });
1201
- }
1202
- max(e2, t2) {
1203
- return this._addCheck({
1204
- kind: "max",
1205
- value: e2.getTime(),
1206
- message: h$5.toString(t2)
1207
- });
1208
- }
1209
- get minDate() {
1210
- let e2 = null;
1211
- for (const t2 of this._def.checks)
1212
- t2.kind === "min" && (e2 === null || t2.value > e2) && (e2 = t2.value);
1213
- return e2 != null ? new Date(e2) : null;
1214
- }
1215
- get maxDate() {
1216
- let e2 = null;
1217
- for (const t2 of this._def.checks)
1218
- t2.kind === "max" && (e2 === null || t2.value < e2) && (e2 = t2.value);
1219
- return e2 != null ? new Date(e2) : null;
1220
- }
1221
- };
1222
- V$2.create = (r2) => new V$2({
1223
- checks: [],
1224
- coerce: (r2 == null ? void 0 : r2.coerce) || false,
1225
- typeName: p$5.ZodDate,
1226
- ...y$3(r2)
1227
- });
1228
- let oe$1 = class oe extends v$2 {
1229
- _parse(e2) {
1230
- if (this._getType(e2) !== u$6.symbol) {
1231
- const s2 = this._getOrReturnCtx(e2);
1232
- return l$6(s2, {
1233
- code: d$5.invalid_type,
1234
- expected: u$6.symbol,
1235
- received: s2.parsedType
1236
- }), m$4;
1237
- }
1238
- return b$7(e2.data);
1239
- }
1240
- };
1241
- oe$1.create = (r2) => new oe$1({
1242
- typeName: p$5.ZodSymbol,
1243
- ...y$3(r2)
1244
- });
1245
- let Y$5 = class Y extends v$2 {
1246
- _parse(e2) {
1247
- if (this._getType(e2) !== u$6.undefined) {
1248
- const s2 = this._getOrReturnCtx(e2);
1249
- return l$6(s2, {
1250
- code: d$5.invalid_type,
1251
- expected: u$6.undefined,
1252
- received: s2.parsedType
1253
- }), m$4;
1254
- }
1255
- return b$7(e2.data);
1256
- }
1257
- };
1258
- Y$5.create = (r2) => new Y$5({
1259
- typeName: p$5.ZodUndefined,
1260
- ...y$3(r2)
1261
- });
1262
- let H$2 = class H extends v$2 {
1263
- _parse(e2) {
1264
- if (this._getType(e2) !== u$6.null) {
1265
- const s2 = this._getOrReturnCtx(e2);
1266
- return l$6(s2, {
1267
- code: d$5.invalid_type,
1268
- expected: u$6.null,
1269
- received: s2.parsedType
1270
- }), m$4;
1271
- }
1272
- return b$7(e2.data);
1273
- }
1274
- };
1275
- H$2.create = (r2) => new H$2({
1276
- typeName: p$5.ZodNull,
1277
- ...y$3(r2)
1278
- });
1279
- let U$3 = class U extends v$2 {
1280
- constructor() {
1281
- super(...arguments), this._any = true;
1282
- }
1283
- _parse(e2) {
1284
- return b$7(e2.data);
1285
- }
1286
- };
1287
- U$3.create = (r2) => new U$3({
1288
- typeName: p$5.ZodAny,
1289
- ...y$3(r2)
1290
- });
1291
- let P$3 = class P extends v$2 {
1292
- constructor() {
1293
- super(...arguments), this._unknown = true;
1294
- }
1295
- _parse(e2) {
1296
- return b$7(e2.data);
1297
- }
1298
- };
1299
- P$3.create = (r2) => new P$3({
1300
- typeName: p$5.ZodUnknown,
1301
- ...y$3(r2)
1302
- });
1303
- let I$6 = class I extends v$2 {
1304
- _parse(e2) {
1305
- const t2 = this._getOrReturnCtx(e2);
1306
- return l$6(t2, {
1307
- code: d$5.invalid_type,
1308
- expected: u$6.never,
1309
- received: t2.parsedType
1310
- }), m$4;
1311
- }
1312
- };
1313
- I$6.create = (r2) => new I$6({
1314
- typeName: p$5.ZodNever,
1315
- ...y$3(r2)
1316
- });
1317
- let de$1 = class de extends v$2 {
1318
- _parse(e2) {
1319
- if (this._getType(e2) !== u$6.undefined) {
1320
- const s2 = this._getOrReturnCtx(e2);
1321
- return l$6(s2, {
1322
- code: d$5.invalid_type,
1323
- expected: u$6.void,
1324
- received: s2.parsedType
1325
- }), m$4;
1326
- }
1327
- return b$7(e2.data);
1328
- }
1329
- };
1330
- de$1.create = (r2) => new de$1({
1331
- typeName: p$5.ZodVoid,
1332
- ...y$3(r2)
1333
- });
1334
- let S$3 = class S extends v$2 {
1335
- _parse(e2) {
1336
- const { ctx: t2, status: s2 } = this._processInputParams(e2), n2 = this._def;
1337
- if (t2.parsedType !== u$6.array)
1338
- return l$6(t2, {
1339
- code: d$5.invalid_type,
1340
- expected: u$6.array,
1341
- received: t2.parsedType
1342
- }), m$4;
1343
- if (n2.exactLength !== null) {
1344
- const i2 = t2.data.length > n2.exactLength.value, o2 = t2.data.length < n2.exactLength.value;
1345
- (i2 || o2) && (l$6(t2, {
1346
- code: i2 ? d$5.too_big : d$5.too_small,
1347
- minimum: o2 ? n2.exactLength.value : void 0,
1348
- maximum: i2 ? n2.exactLength.value : void 0,
1349
- type: "array",
1350
- inclusive: true,
1351
- exact: true,
1352
- message: n2.exactLength.message
1353
- }), s2.dirty());
1354
- }
1355
- if (n2.minLength !== null && t2.data.length < n2.minLength.value && (l$6(t2, {
1356
- code: d$5.too_small,
1357
- minimum: n2.minLength.value,
1358
- type: "array",
1359
- inclusive: true,
1360
- exact: false,
1361
- message: n2.minLength.message
1362
- }), s2.dirty()), n2.maxLength !== null && t2.data.length > n2.maxLength.value && (l$6(t2, {
1363
- code: d$5.too_big,
1364
- maximum: n2.maxLength.value,
1365
- type: "array",
1366
- inclusive: true,
1367
- exact: false,
1368
- message: n2.maxLength.message
1369
- }), s2.dirty()), t2.common.async)
1370
- return Promise.all([...t2.data].map((i2, o2) => n2.type._parseAsync(new C$3(t2, i2, t2.path, o2)))).then((i2) => k$4.mergeArray(s2, i2));
1371
- const a3 = [...t2.data].map((i2, o2) => n2.type._parseSync(new C$3(t2, i2, t2.path, o2)));
1372
- return k$4.mergeArray(s2, a3);
1373
- }
1374
- get element() {
1375
- return this._def.type;
1376
- }
1377
- min(e2, t2) {
1378
- return new S({
1379
- ...this._def,
1380
- minLength: { value: e2, message: h$5.toString(t2) }
1381
- });
1382
- }
1383
- max(e2, t2) {
1384
- return new S({
1385
- ...this._def,
1386
- maxLength: { value: e2, message: h$5.toString(t2) }
1387
- });
1388
- }
1389
- length(e2, t2) {
1390
- return new S({
1391
- ...this._def,
1392
- exactLength: { value: e2, message: h$5.toString(t2) }
1393
- });
1394
- }
1395
- nonempty(e2) {
1396
- return this.min(1, e2);
1397
- }
1398
- };
1399
- S$3.create = (r2, e2) => new S$3({
1400
- type: r2,
1401
- minLength: null,
1402
- maxLength: null,
1403
- exactLength: null,
1404
- typeName: p$5.ZodArray,
1405
- ...y$3(e2)
1406
- });
1407
- function D$4(r2) {
1408
- if (r2 instanceof x$4) {
1409
- const e2 = {};
1410
- for (const t2 in r2.shape) {
1411
- const s2 = r2.shape[t2];
1412
- e2[t2] = E$4.create(D$4(s2));
1413
- }
1414
- return new x$4({
1415
- ...r2._def,
1416
- shape: () => e2
1417
- });
1418
- } else
1419
- return r2 instanceof S$3 ? new S$3({
1420
- ...r2._def,
1421
- type: D$4(r2.element)
1422
- }) : r2 instanceof E$4 ? E$4.create(D$4(r2.unwrap())) : r2 instanceof L$5 ? L$5.create(D$4(r2.unwrap())) : r2 instanceof O$5 ? O$5.create(r2.items.map((e2) => D$4(e2))) : r2;
1423
- }
1424
- let x$4 = class x extends v$2 {
1425
- constructor() {
1426
- super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1427
- }
1428
- _getCached() {
1429
- if (this._cached !== null)
1430
- return this._cached;
1431
- const e2 = this._def.shape(), t2 = g$4.objectKeys(e2);
1432
- return this._cached = { shape: e2, keys: t2 };
1433
- }
1434
- _parse(e2) {
1435
- if (this._getType(e2) !== u$6.object) {
1436
- const c3 = this._getOrReturnCtx(e2);
1437
- return l$6(c3, {
1438
- code: d$5.invalid_type,
1439
- expected: u$6.object,
1440
- received: c3.parsedType
1441
- }), m$4;
1442
- }
1443
- const { status: s2, ctx: n2 } = this._processInputParams(e2), { shape: a3, keys: i2 } = this._getCached(), o2 = [];
1444
- if (!(this._def.catchall instanceof I$6 && this._def.unknownKeys === "strip"))
1445
- for (const c3 in n2.data)
1446
- i2.includes(c3) || o2.push(c3);
1447
- const f2 = [];
1448
- for (const c3 of i2) {
1449
- const _2 = a3[c3], w2 = n2.data[c3];
1450
- f2.push({
1451
- key: { status: "valid", value: c3 },
1452
- value: _2._parse(new C$3(n2, w2, n2.path, c3)),
1453
- alwaysSet: c3 in n2.data
1454
- });
1455
- }
1456
- if (this._def.catchall instanceof I$6) {
1457
- const c3 = this._def.unknownKeys;
1458
- if (c3 === "passthrough")
1459
- for (const _2 of o2)
1460
- f2.push({
1461
- key: { status: "valid", value: _2 },
1462
- value: { status: "valid", value: n2.data[_2] }
1463
- });
1464
- else if (c3 === "strict")
1465
- o2.length > 0 && (l$6(n2, {
1466
- code: d$5.unrecognized_keys,
1467
- keys: o2
1468
- }), s2.dirty());
1469
- else if (c3 !== "strip")
1470
- throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1471
- } else {
1472
- const c3 = this._def.catchall;
1473
- for (const _2 of o2) {
1474
- const w2 = n2.data[_2];
1475
- f2.push({
1476
- key: { status: "valid", value: _2 },
1477
- value: c3._parse(
1478
- new C$3(n2, w2, n2.path, _2)
1479
- //, ctx.child(key), value, getParsedType(value)
1480
- ),
1481
- alwaysSet: _2 in n2.data
1482
- });
1483
- }
1484
- }
1485
- return n2.common.async ? Promise.resolve().then(async () => {
1486
- const c3 = [];
1487
- for (const _2 of f2) {
1488
- const w2 = await _2.key;
1489
- c3.push({
1490
- key: w2,
1491
- value: await _2.value,
1492
- alwaysSet: _2.alwaysSet
1493
- });
1494
- }
1495
- return c3;
1496
- }).then((c3) => k$4.mergeObjectSync(s2, c3)) : k$4.mergeObjectSync(s2, f2);
1497
- }
1498
- get shape() {
1499
- return this._def.shape();
1500
- }
1501
- strict(e2) {
1502
- return h$5.errToObj, new x({
1503
- ...this._def,
1504
- unknownKeys: "strict",
1505
- ...e2 !== void 0 ? {
1506
- errorMap: (t2, s2) => {
1507
- var n2, a3, i2, o2;
1508
- const f2 = (i2 = (a3 = (n2 = this._def).errorMap) === null || a3 === void 0 ? void 0 : a3.call(n2, t2, s2).message) !== null && i2 !== void 0 ? i2 : s2.defaultError;
1509
- return t2.code === "unrecognized_keys" ? {
1510
- message: (o2 = h$5.errToObj(e2).message) !== null && o2 !== void 0 ? o2 : f2
1511
- } : {
1512
- message: f2
1513
- };
1514
- }
1515
- } : {}
1516
- });
1517
- }
1518
- strip() {
1519
- return new x({
1520
- ...this._def,
1521
- unknownKeys: "strip"
1522
- });
1523
- }
1524
- passthrough() {
1525
- return new x({
1526
- ...this._def,
1527
- unknownKeys: "passthrough"
1528
- });
1529
- }
1530
- // const AugmentFactory =
1531
- // <Def extends ZodObjectDef>(def: Def) =>
1532
- // <Augmentation extends ZodRawShape>(
1533
- // augmentation: Augmentation
1534
- // ): ZodObject<
1535
- // extendShape<ReturnType<Def["shape"]>, Augmentation>,
1536
- // Def["unknownKeys"],
1537
- // Def["catchall"]
1538
- // > => {
1539
- // return new ZodObject({
1540
- // ...def,
1541
- // shape: () => ({
1542
- // ...def.shape(),
1543
- // ...augmentation,
1544
- // }),
1545
- // }) as any;
1546
- // };
1547
- extend(e2) {
1548
- return new x({
1549
- ...this._def,
1550
- shape: () => ({
1551
- ...this._def.shape(),
1552
- ...e2
1553
- })
1554
- });
1555
- }
1556
- /**
1557
- * Prior to zod@1.0.12 there was a bug in the
1558
- * inferred type of merged objects. Please
1559
- * upgrade if you are experiencing issues.
1560
- */
1561
- merge(e2) {
1562
- return new x({
1563
- unknownKeys: e2._def.unknownKeys,
1564
- catchall: e2._def.catchall,
1565
- shape: () => ({
1566
- ...this._def.shape(),
1567
- ...e2._def.shape()
1568
- }),
1569
- typeName: p$5.ZodObject
1570
- });
1571
- }
1572
- // merge<
1573
- // Incoming extends AnyZodObject,
1574
- // Augmentation extends Incoming["shape"],
1575
- // NewOutput extends {
1576
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
1577
- // ? Augmentation[k]["_output"]
1578
- // : k extends keyof Output
1579
- // ? Output[k]
1580
- // : never;
1581
- // },
1582
- // NewInput extends {
1583
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
1584
- // ? Augmentation[k]["_input"]
1585
- // : k extends keyof Input
1586
- // ? Input[k]
1587
- // : never;
1588
- // }
1589
- // >(
1590
- // merging: Incoming
1591
- // ): ZodObject<
1592
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1593
- // Incoming["_def"]["unknownKeys"],
1594
- // Incoming["_def"]["catchall"],
1595
- // NewOutput,
1596
- // NewInput
1597
- // > {
1598
- // const merged: any = new ZodObject({
1599
- // unknownKeys: merging._def.unknownKeys,
1600
- // catchall: merging._def.catchall,
1601
- // shape: () =>
1602
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1603
- // typeName: ZodFirstPartyTypeKind.ZodObject,
1604
- // }) as any;
1605
- // return merged;
1606
- // }
1607
- setKey(e2, t2) {
1608
- return this.augment({ [e2]: t2 });
1609
- }
1610
- // merge<Incoming extends AnyZodObject>(
1611
- // merging: Incoming
1612
- // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
1613
- // ZodObject<
1614
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
1615
- // Incoming["_def"]["unknownKeys"],
1616
- // Incoming["_def"]["catchall"]
1617
- // > {
1618
- // // const mergedShape = objectUtil.mergeShapes(
1619
- // // this._def.shape(),
1620
- // // merging._def.shape()
1621
- // // );
1622
- // const merged: any = new ZodObject({
1623
- // unknownKeys: merging._def.unknownKeys,
1624
- // catchall: merging._def.catchall,
1625
- // shape: () =>
1626
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
1627
- // typeName: ZodFirstPartyTypeKind.ZodObject,
1628
- // }) as any;
1629
- // return merged;
1630
- // }
1631
- catchall(e2) {
1632
- return new x({
1633
- ...this._def,
1634
- catchall: e2
1635
- });
1636
- }
1637
- pick(e2) {
1638
- const t2 = {};
1639
- return g$4.objectKeys(e2).forEach((s2) => {
1640
- e2[s2] && this.shape[s2] && (t2[s2] = this.shape[s2]);
1641
- }), new x({
1642
- ...this._def,
1643
- shape: () => t2
1644
- });
1645
- }
1646
- omit(e2) {
1647
- const t2 = {};
1648
- return g$4.objectKeys(this.shape).forEach((s2) => {
1649
- e2[s2] || (t2[s2] = this.shape[s2]);
1650
- }), new x({
1651
- ...this._def,
1652
- shape: () => t2
1653
- });
1654
- }
1655
- /**
1656
- * @deprecated
1657
- */
1658
- deepPartial() {
1659
- return D$4(this);
1660
- }
1661
- partial(e2) {
1662
- const t2 = {};
1663
- return g$4.objectKeys(this.shape).forEach((s2) => {
1664
- const n2 = this.shape[s2];
1665
- e2 && !e2[s2] ? t2[s2] = n2 : t2[s2] = n2.optional();
1666
- }), new x({
1667
- ...this._def,
1668
- shape: () => t2
1669
- });
1670
- }
1671
- required(e2) {
1672
- const t2 = {};
1673
- return g$4.objectKeys(this.shape).forEach((s2) => {
1674
- if (e2 && !e2[s2])
1675
- t2[s2] = this.shape[s2];
1676
- else {
1677
- let a3 = this.shape[s2];
1678
- for (; a3 instanceof E$4; )
1679
- a3 = a3._def.innerType;
1680
- t2[s2] = a3;
1681
- }
1682
- }), new x({
1683
- ...this._def,
1684
- shape: () => t2
1685
- });
1686
- }
1687
- keyof() {
1688
- return Te$1(g$4.objectKeys(this.shape));
1689
- }
1690
- };
1691
- x$4.create = (r2, e2) => new x$4({
1692
- shape: () => r2,
1693
- unknownKeys: "strip",
1694
- catchall: I$6.create(),
1695
- typeName: p$5.ZodObject,
1696
- ...y$3(e2)
1697
- });
1698
- x$4.strictCreate = (r2, e2) => new x$4({
1699
- shape: () => r2,
1700
- unknownKeys: "strict",
1701
- catchall: I$6.create(),
1702
- typeName: p$5.ZodObject,
1703
- ...y$3(e2)
1704
- });
1705
- x$4.lazycreate = (r2, e2) => new x$4({
1706
- shape: r2,
1707
- unknownKeys: "strip",
1708
- catchall: I$6.create(),
1709
- typeName: p$5.ZodObject,
1710
- ...y$3(e2)
1711
- });
1712
- let G$2 = class G extends v$2 {
1713
- _parse(e2) {
1714
- const { ctx: t2 } = this._processInputParams(e2), s2 = this._def.options;
1715
- function n2(a3) {
1716
- for (const o2 of a3)
1717
- if (o2.result.status === "valid")
1718
- return o2.result;
1719
- for (const o2 of a3)
1720
- if (o2.result.status === "dirty")
1721
- return t2.common.issues.push(...o2.ctx.common.issues), o2.result;
1722
- const i2 = a3.map((o2) => new Z$2(o2.ctx.common.issues));
1723
- return l$6(t2, {
1724
- code: d$5.invalid_union,
1725
- unionErrors: i2
1726
- }), m$4;
1727
- }
1728
- if (t2.common.async)
1729
- return Promise.all(s2.map(async (a3) => {
1730
- const i2 = {
1731
- ...t2,
1732
- common: {
1733
- ...t2.common,
1734
- issues: []
1735
- },
1736
- parent: null
1737
- };
1738
- return {
1739
- result: await a3._parseAsync({
1740
- data: t2.data,
1741
- path: t2.path,
1742
- parent: i2
1743
- }),
1744
- ctx: i2
1745
- };
1746
- })).then(n2);
1747
- {
1748
- let a3;
1749
- const i2 = [];
1750
- for (const f2 of s2) {
1751
- const c3 = {
1752
- ...t2,
1753
- common: {
1754
- ...t2.common,
1755
- issues: []
1756
- },
1757
- parent: null
1758
- }, _2 = f2._parseSync({
1759
- data: t2.data,
1760
- path: t2.path,
1761
- parent: c3
1762
- });
1763
- if (_2.status === "valid")
1764
- return _2;
1765
- _2.status === "dirty" && !a3 && (a3 = { result: _2, ctx: c3 }), c3.common.issues.length && i2.push(c3.common.issues);
1766
- }
1767
- if (a3)
1768
- return t2.common.issues.push(...a3.ctx.common.issues), a3.result;
1769
- const o2 = i2.map((f2) => new Z$2(f2));
1770
- return l$6(t2, {
1771
- code: d$5.invalid_union,
1772
- unionErrors: o2
1773
- }), m$4;
1774
- }
1775
- }
1776
- get options() {
1777
- return this._def.options;
1778
- }
1779
- };
1780
- G$2.create = (r2, e2) => new G$2({
1781
- options: r2,
1782
- typeName: p$5.ZodUnion,
1783
- ...y$3(e2)
1784
- });
1785
- const se$1 = (r2) => r2 instanceof K$2 ? se$1(r2.schema) : r2 instanceof N$4 ? se$1(r2.innerType()) : r2 instanceof F$4 ? [r2.value] : r2 instanceof M$4 ? r2.options : r2 instanceof ee$1 ? Object.keys(r2.enum) : r2 instanceof te$1 ? se$1(r2._def.innerType) : r2 instanceof Y$5 ? [void 0] : r2 instanceof H$2 ? [null] : null;
1786
- class he extends v$2 {
1787
- _parse(e2) {
1788
- const { ctx: t2 } = this._processInputParams(e2);
1789
- if (t2.parsedType !== u$6.object)
1790
- return l$6(t2, {
1791
- code: d$5.invalid_type,
1792
- expected: u$6.object,
1793
- received: t2.parsedType
1794
- }), m$4;
1795
- const s2 = this.discriminator, n2 = t2.data[s2], a3 = this.optionsMap.get(n2);
1796
- return a3 ? t2.common.async ? a3._parseAsync({
1797
- data: t2.data,
1798
- path: t2.path,
1799
- parent: t2
1800
- }) : a3._parseSync({
1801
- data: t2.data,
1802
- path: t2.path,
1803
- parent: t2
1804
- }) : (l$6(t2, {
1805
- code: d$5.invalid_union_discriminator,
1806
- options: Array.from(this.optionsMap.keys()),
1807
- path: [s2]
1808
- }), m$4);
1809
- }
1810
- get discriminator() {
1811
- return this._def.discriminator;
1812
- }
1813
- get options() {
1814
- return this._def.options;
1815
- }
1816
- get optionsMap() {
1817
- return this._def.optionsMap;
1818
- }
1819
- /**
1820
- * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
1821
- * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
1822
- * have a different value for each object in the union.
1823
- * @param discriminator the name of the discriminator property
1824
- * @param types an array of object schemas
1825
- * @param params
1826
- */
1827
- static create(e2, t2, s2) {
1828
- const n2 = /* @__PURE__ */ new Map();
1829
- for (const a3 of t2) {
1830
- const i2 = se$1(a3.shape[e2]);
1831
- if (!i2)
1832
- throw new Error(`A discriminator value for key \`${e2}\` could not be extracted from all schema options`);
1833
- for (const o2 of i2) {
1834
- if (n2.has(o2))
1835
- throw new Error(`Discriminator property ${String(e2)} has duplicate value ${String(o2)}`);
1836
- n2.set(o2, a3);
1837
- }
1838
- }
1839
- return new he({
1840
- typeName: p$5.ZodDiscriminatedUnion,
1841
- discriminator: e2,
1842
- options: t2,
1843
- optionsMap: n2,
1844
- ...y$3(s2)
1845
- });
1846
- }
1847
- }
1848
- function ge$1(r2, e2) {
1849
- const t2 = R$4(r2), s2 = R$4(e2);
1850
- if (r2 === e2)
1851
- return { valid: true, data: r2 };
1852
- if (t2 === u$6.object && s2 === u$6.object) {
1853
- const n2 = g$4.objectKeys(e2), a3 = g$4.objectKeys(r2).filter((o2) => n2.indexOf(o2) !== -1), i2 = { ...r2, ...e2 };
1854
- for (const o2 of a3) {
1855
- const f2 = ge$1(r2[o2], e2[o2]);
1856
- if (!f2.valid)
1857
- return { valid: false };
1858
- i2[o2] = f2.data;
1859
- }
1860
- return { valid: true, data: i2 };
1861
- } else if (t2 === u$6.array && s2 === u$6.array) {
1862
- if (r2.length !== e2.length)
1863
- return { valid: false };
1864
- const n2 = [];
1865
- for (let a3 = 0; a3 < r2.length; a3++) {
1866
- const i2 = r2[a3], o2 = e2[a3], f2 = ge$1(i2, o2);
1867
- if (!f2.valid)
1868
- return { valid: false };
1869
- n2.push(f2.data);
1870
- }
1871
- return { valid: true, data: n2 };
1872
- } else
1873
- return t2 === u$6.date && s2 === u$6.date && +r2 == +e2 ? { valid: true, data: r2 } : { valid: false };
1874
- }
1875
- let X$4 = class X extends v$2 {
1876
- _parse(e2) {
1877
- const { status: t2, ctx: s2 } = this._processInputParams(e2), n2 = (a3, i2) => {
1878
- if (ve$1(a3) || ve$1(i2))
1879
- return m$4;
1880
- const o2 = ge$1(a3.value, i2.value);
1881
- return o2.valid ? ((_e$1(a3) || _e$1(i2)) && t2.dirty(), { status: t2.value, value: o2.data }) : (l$6(s2, {
1882
- code: d$5.invalid_intersection_types
1883
- }), m$4);
1884
- };
1885
- return s2.common.async ? Promise.all([
1886
- this._def.left._parseAsync({
1887
- data: s2.data,
1888
- path: s2.path,
1889
- parent: s2
1890
- }),
1891
- this._def.right._parseAsync({
1892
- data: s2.data,
1893
- path: s2.path,
1894
- parent: s2
1895
- })
1896
- ]).then(([a3, i2]) => n2(a3, i2)) : n2(this._def.left._parseSync({
1897
- data: s2.data,
1898
- path: s2.path,
1899
- parent: s2
1900
- }), this._def.right._parseSync({
1901
- data: s2.data,
1902
- path: s2.path,
1903
- parent: s2
1904
- }));
1905
- }
1906
- };
1907
- X$4.create = (r2, e2, t2) => new X$4({
1908
- left: r2,
1909
- right: e2,
1910
- typeName: p$5.ZodIntersection,
1911
- ...y$3(t2)
1912
- });
1913
- let O$5 = class O extends v$2 {
1914
- _parse(e2) {
1915
- const { status: t2, ctx: s2 } = this._processInputParams(e2);
1916
- if (s2.parsedType !== u$6.array)
1917
- return l$6(s2, {
1918
- code: d$5.invalid_type,
1919
- expected: u$6.array,
1920
- received: s2.parsedType
1921
- }), m$4;
1922
- if (s2.data.length < this._def.items.length)
1923
- return l$6(s2, {
1924
- code: d$5.too_small,
1925
- minimum: this._def.items.length,
1926
- inclusive: true,
1927
- exact: false,
1928
- type: "array"
1929
- }), m$4;
1930
- !this._def.rest && s2.data.length > this._def.items.length && (l$6(s2, {
1931
- code: d$5.too_big,
1932
- maximum: this._def.items.length,
1933
- inclusive: true,
1934
- exact: false,
1935
- type: "array"
1936
- }), t2.dirty());
1937
- const a3 = [...s2.data].map((i2, o2) => {
1938
- const f2 = this._def.items[o2] || this._def.rest;
1939
- return f2 ? f2._parse(new C$3(s2, i2, s2.path, o2)) : null;
1940
- }).filter((i2) => !!i2);
1941
- return s2.common.async ? Promise.all(a3).then((i2) => k$4.mergeArray(t2, i2)) : k$4.mergeArray(t2, a3);
1942
- }
1943
- get items() {
1944
- return this._def.items;
1945
- }
1946
- rest(e2) {
1947
- return new O({
1948
- ...this._def,
1949
- rest: e2
1950
- });
1951
- }
1952
- };
1953
- O$5.create = (r2, e2) => {
1954
- if (!Array.isArray(r2))
1955
- throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
1956
- return new O$5({
1957
- items: r2,
1958
- typeName: p$5.ZodTuple,
1959
- rest: null,
1960
- ...y$3(e2)
1961
- });
1962
- };
1963
- let Q$2 = class Q extends v$2 {
1964
- get keySchema() {
1965
- return this._def.keyType;
1966
- }
1967
- get valueSchema() {
1968
- return this._def.valueType;
1969
- }
1970
- _parse(e2) {
1971
- const { status: t2, ctx: s2 } = this._processInputParams(e2);
1972
- if (s2.parsedType !== u$6.object)
1973
- return l$6(s2, {
1974
- code: d$5.invalid_type,
1975
- expected: u$6.object,
1976
- received: s2.parsedType
1977
- }), m$4;
1978
- const n2 = [], a3 = this._def.keyType, i2 = this._def.valueType;
1979
- for (const o2 in s2.data)
1980
- n2.push({
1981
- key: a3._parse(new C$3(s2, o2, s2.path, o2)),
1982
- value: i2._parse(new C$3(s2, s2.data[o2], s2.path, o2))
1983
- });
1984
- return s2.common.async ? k$4.mergeObjectAsync(t2, n2) : k$4.mergeObjectSync(t2, n2);
1985
- }
1986
- get element() {
1987
- return this._def.valueType;
1988
- }
1989
- static create(e2, t2, s2) {
1990
- return t2 instanceof v$2 ? new Q({
1991
- keyType: e2,
1992
- valueType: t2,
1993
- typeName: p$5.ZodRecord,
1994
- ...y$3(s2)
1995
- }) : new Q({
1996
- keyType: T$5.create(),
1997
- valueType: e2,
1998
- typeName: p$5.ZodRecord,
1999
- ...y$3(t2)
2000
- });
2001
- }
2002
- };
2003
- let ce$1 = class ce extends v$2 {
2004
- get keySchema() {
2005
- return this._def.keyType;
2006
- }
2007
- get valueSchema() {
2008
- return this._def.valueType;
2009
- }
2010
- _parse(e2) {
2011
- const { status: t2, ctx: s2 } = this._processInputParams(e2);
2012
- if (s2.parsedType !== u$6.map)
2013
- return l$6(s2, {
2014
- code: d$5.invalid_type,
2015
- expected: u$6.map,
2016
- received: s2.parsedType
2017
- }), m$4;
2018
- const n2 = this._def.keyType, a3 = this._def.valueType, i2 = [...s2.data.entries()].map(([o2, f2], c3) => ({
2019
- key: n2._parse(new C$3(s2, o2, s2.path, [c3, "key"])),
2020
- value: a3._parse(new C$3(s2, f2, s2.path, [c3, "value"]))
2021
- }));
2022
- if (s2.common.async) {
2023
- const o2 = /* @__PURE__ */ new Map();
2024
- return Promise.resolve().then(async () => {
2025
- for (const f2 of i2) {
2026
- const c3 = await f2.key, _2 = await f2.value;
2027
- if (c3.status === "aborted" || _2.status === "aborted")
2028
- return m$4;
2029
- (c3.status === "dirty" || _2.status === "dirty") && t2.dirty(), o2.set(c3.value, _2.value);
2030
- }
2031
- return { status: t2.value, value: o2 };
2032
- });
2033
- } else {
2034
- const o2 = /* @__PURE__ */ new Map();
2035
- for (const f2 of i2) {
2036
- const c3 = f2.key, _2 = f2.value;
2037
- if (c3.status === "aborted" || _2.status === "aborted")
2038
- return m$4;
2039
- (c3.status === "dirty" || _2.status === "dirty") && t2.dirty(), o2.set(c3.value, _2.value);
2040
- }
2041
- return { status: t2.value, value: o2 };
2042
- }
2043
- }
2044
- };
2045
- ce$1.create = (r2, e2, t2) => new ce$1({
2046
- valueType: e2,
2047
- keyType: r2,
2048
- typeName: p$5.ZodMap,
2049
- ...y$3(t2)
2050
- });
2051
- let $$2 = class $ extends v$2 {
2052
- _parse(e2) {
2053
- const { status: t2, ctx: s2 } = this._processInputParams(e2);
2054
- if (s2.parsedType !== u$6.set)
2055
- return l$6(s2, {
2056
- code: d$5.invalid_type,
2057
- expected: u$6.set,
2058
- received: s2.parsedType
2059
- }), m$4;
2060
- const n2 = this._def;
2061
- n2.minSize !== null && s2.data.size < n2.minSize.value && (l$6(s2, {
2062
- code: d$5.too_small,
2063
- minimum: n2.minSize.value,
2064
- type: "set",
2065
- inclusive: true,
2066
- exact: false,
2067
- message: n2.minSize.message
2068
- }), t2.dirty()), n2.maxSize !== null && s2.data.size > n2.maxSize.value && (l$6(s2, {
2069
- code: d$5.too_big,
2070
- maximum: n2.maxSize.value,
2071
- type: "set",
2072
- inclusive: true,
2073
- exact: false,
2074
- message: n2.maxSize.message
2075
- }), t2.dirty());
2076
- const a3 = this._def.valueType;
2077
- function i2(f2) {
2078
- const c3 = /* @__PURE__ */ new Set();
2079
- for (const _2 of f2) {
2080
- if (_2.status === "aborted")
2081
- return m$4;
2082
- _2.status === "dirty" && t2.dirty(), c3.add(_2.value);
2083
- }
2084
- return { status: t2.value, value: c3 };
2085
- }
2086
- const o2 = [...s2.data.values()].map((f2, c3) => a3._parse(new C$3(s2, f2, s2.path, c3)));
2087
- return s2.common.async ? Promise.all(o2).then((f2) => i2(f2)) : i2(o2);
2088
- }
2089
- min(e2, t2) {
2090
- return new $({
2091
- ...this._def,
2092
- minSize: { value: e2, message: h$5.toString(t2) }
2093
- });
2094
- }
2095
- max(e2, t2) {
2096
- return new $({
2097
- ...this._def,
2098
- maxSize: { value: e2, message: h$5.toString(t2) }
2099
- });
2100
- }
2101
- size(e2, t2) {
2102
- return this.min(e2, t2).max(e2, t2);
2103
- }
2104
- nonempty(e2) {
2105
- return this.min(1, e2);
2106
- }
2107
- };
2108
- $$2.create = (r2, e2) => new $$2({
2109
- valueType: r2,
2110
- minSize: null,
2111
- maxSize: null,
2112
- typeName: p$5.ZodSet,
2113
- ...y$3(e2)
2114
- });
2115
- let z$5 = class z extends v$2 {
2116
- constructor() {
2117
- super(...arguments), this.validate = this.implement;
2118
- }
2119
- _parse(e2) {
2120
- const { ctx: t2 } = this._processInputParams(e2);
2121
- if (t2.parsedType !== u$6.function)
2122
- return l$6(t2, {
2123
- code: d$5.invalid_type,
2124
- expected: u$6.function,
2125
- received: t2.parsedType
2126
- }), m$4;
2127
- function s2(o2, f2) {
2128
- return ae$1({
2129
- data: o2,
2130
- path: t2.path,
2131
- errorMaps: [
2132
- t2.common.contextualErrorMap,
2133
- t2.schemaErrorMap,
2134
- ne$1(),
2135
- W$2
2136
- ].filter((c3) => !!c3),
2137
- issueData: {
2138
- code: d$5.invalid_arguments,
2139
- argumentsError: f2
2140
- }
2141
- });
2142
- }
2143
- function n2(o2, f2) {
2144
- return ae$1({
2145
- data: o2,
2146
- path: t2.path,
2147
- errorMaps: [
2148
- t2.common.contextualErrorMap,
2149
- t2.schemaErrorMap,
2150
- ne$1(),
2151
- W$2
2152
- ].filter((c3) => !!c3),
2153
- issueData: {
2154
- code: d$5.invalid_return_type,
2155
- returnTypeError: f2
2156
- }
2157
- });
2158
- }
2159
- const a3 = { errorMap: t2.common.contextualErrorMap }, i2 = t2.data;
2160
- if (this._def.returns instanceof B$5) {
2161
- const o2 = this;
2162
- return b$7(async function(...f2) {
2163
- const c3 = new Z$2([]), _2 = await o2._def.args.parseAsync(f2, a3).catch((pe2) => {
2164
- throw c3.addIssue(s2(f2, pe2)), c3;
2165
- }), w2 = await Reflect.apply(i2, this, _2);
2166
- return await o2._def.returns._def.type.parseAsync(w2, a3).catch((pe2) => {
2167
- throw c3.addIssue(n2(w2, pe2)), c3;
2168
- });
2169
- });
2170
- } else {
2171
- const o2 = this;
2172
- return b$7(function(...f2) {
2173
- const c3 = o2._def.args.safeParse(f2, a3);
2174
- if (!c3.success)
2175
- throw new Z$2([s2(f2, c3.error)]);
2176
- const _2 = Reflect.apply(i2, this, c3.data), w2 = o2._def.returns.safeParse(_2, a3);
2177
- if (!w2.success)
2178
- throw new Z$2([n2(_2, w2.error)]);
2179
- return w2.data;
2180
- });
2181
- }
2182
- }
2183
- parameters() {
2184
- return this._def.args;
2185
- }
2186
- returnType() {
2187
- return this._def.returns;
2188
- }
2189
- args(...e2) {
2190
- return new z({
2191
- ...this._def,
2192
- args: O$5.create(e2).rest(P$3.create())
2193
- });
2194
- }
2195
- returns(e2) {
2196
- return new z({
2197
- ...this._def,
2198
- returns: e2
2199
- });
2200
- }
2201
- implement(e2) {
2202
- return this.parse(e2);
2203
- }
2204
- strictImplement(e2) {
2205
- return this.parse(e2);
2206
- }
2207
- static create(e2, t2, s2) {
2208
- return new z({
2209
- args: e2 || O$5.create([]).rest(P$3.create()),
2210
- returns: t2 || P$3.create(),
2211
- typeName: p$5.ZodFunction,
2212
- ...y$3(s2)
2213
- });
2214
- }
2215
- };
2216
- let K$2 = class K extends v$2 {
2217
- get schema() {
2218
- return this._def.getter();
2219
- }
2220
- _parse(e2) {
2221
- const { ctx: t2 } = this._processInputParams(e2);
2222
- return this._def.getter()._parse({ data: t2.data, path: t2.path, parent: t2 });
2223
- }
2224
- };
2225
- K$2.create = (r2, e2) => new K$2({
2226
- getter: r2,
2227
- typeName: p$5.ZodLazy,
2228
- ...y$3(e2)
2229
- });
2230
- let F$4 = class F extends v$2 {
2231
- _parse(e2) {
2232
- if (e2.data !== this._def.value) {
2233
- const t2 = this._getOrReturnCtx(e2);
2234
- return l$6(t2, {
2235
- received: t2.data,
2236
- code: d$5.invalid_literal,
2237
- expected: this._def.value
2238
- }), m$4;
2239
- }
2240
- return { status: "valid", value: e2.data };
2241
- }
2242
- get value() {
2243
- return this._def.value;
2244
- }
2245
- };
2246
- F$4.create = (r2, e2) => new F$4({
2247
- value: r2,
2248
- typeName: p$5.ZodLiteral,
2249
- ...y$3(e2)
2250
- });
2251
- function Te$1(r2, e2) {
2252
- return new M$4({
2253
- values: r2,
2254
- typeName: p$5.ZodEnum,
2255
- ...y$3(e2)
2256
- });
2257
- }
2258
- let M$4 = class M extends v$2 {
2259
- _parse(e2) {
2260
- if (typeof e2.data != "string") {
2261
- const t2 = this._getOrReturnCtx(e2), s2 = this._def.values;
2262
- return l$6(t2, {
2263
- expected: g$4.joinValues(s2),
2264
- received: t2.parsedType,
2265
- code: d$5.invalid_type
2266
- }), m$4;
2267
- }
2268
- if (this._def.values.indexOf(e2.data) === -1) {
2269
- const t2 = this._getOrReturnCtx(e2), s2 = this._def.values;
2270
- return l$6(t2, {
2271
- received: t2.data,
2272
- code: d$5.invalid_enum_value,
2273
- options: s2
2274
- }), m$4;
2275
- }
2276
- return b$7(e2.data);
2277
- }
2278
- get options() {
2279
- return this._def.values;
2280
- }
2281
- get enum() {
2282
- const e2 = {};
2283
- for (const t2 of this._def.values)
2284
- e2[t2] = t2;
2285
- return e2;
2286
- }
2287
- get Values() {
2288
- const e2 = {};
2289
- for (const t2 of this._def.values)
2290
- e2[t2] = t2;
2291
- return e2;
2292
- }
2293
- get Enum() {
2294
- const e2 = {};
2295
- for (const t2 of this._def.values)
2296
- e2[t2] = t2;
2297
- return e2;
2298
- }
2299
- extract(e2) {
2300
- return M.create(e2);
2301
- }
2302
- exclude(e2) {
2303
- return M.create(this.options.filter((t2) => !e2.includes(t2)));
2304
- }
2305
- };
2306
- M$4.create = Te$1;
2307
- let ee$1 = class ee extends v$2 {
2308
- _parse(e2) {
2309
- const t2 = g$4.getValidEnumValues(this._def.values), s2 = this._getOrReturnCtx(e2);
2310
- if (s2.parsedType !== u$6.string && s2.parsedType !== u$6.number) {
2311
- const n2 = g$4.objectValues(t2);
2312
- return l$6(s2, {
2313
- expected: g$4.joinValues(n2),
2314
- received: s2.parsedType,
2315
- code: d$5.invalid_type
2316
- }), m$4;
2317
- }
2318
- if (t2.indexOf(e2.data) === -1) {
2319
- const n2 = g$4.objectValues(t2);
2320
- return l$6(s2, {
2321
- received: s2.data,
2322
- code: d$5.invalid_enum_value,
2323
- options: n2
2324
- }), m$4;
2325
- }
2326
- return b$7(e2.data);
2327
- }
2328
- get enum() {
2329
- return this._def.values;
2330
- }
2331
- };
2332
- ee$1.create = (r2, e2) => new ee$1({
2333
- values: r2,
2334
- typeName: p$5.ZodNativeEnum,
2335
- ...y$3(e2)
2336
- });
2337
- let B$5 = class B extends v$2 {
2338
- unwrap() {
2339
- return this._def.type;
2340
- }
2341
- _parse(e2) {
2342
- const { ctx: t2 } = this._processInputParams(e2);
2343
- if (t2.parsedType !== u$6.promise && t2.common.async === false)
2344
- return l$6(t2, {
2345
- code: d$5.invalid_type,
2346
- expected: u$6.promise,
2347
- received: t2.parsedType
2348
- }), m$4;
2349
- const s2 = t2.parsedType === u$6.promise ? t2.data : Promise.resolve(t2.data);
2350
- return b$7(s2.then((n2) => this._def.type.parseAsync(n2, {
2351
- path: t2.path,
2352
- errorMap: t2.common.contextualErrorMap
2353
- })));
2354
- }
2355
- };
2356
- B$5.create = (r2, e2) => new B$5({
2357
- type: r2,
2358
- typeName: p$5.ZodPromise,
2359
- ...y$3(e2)
2360
- });
2361
- let N$4 = class N extends v$2 {
2362
- innerType() {
2363
- return this._def.schema;
2364
- }
2365
- sourceType() {
2366
- return this._def.schema._def.typeName === p$5.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2367
- }
2368
- _parse(e2) {
2369
- const { status: t2, ctx: s2 } = this._processInputParams(e2), n2 = this._def.effect || null, a3 = {
2370
- addIssue: (i2) => {
2371
- l$6(s2, i2), i2.fatal ? t2.abort() : t2.dirty();
2372
- },
2373
- get path() {
2374
- return s2.path;
2375
- }
2376
- };
2377
- if (a3.addIssue = a3.addIssue.bind(a3), n2.type === "preprocess") {
2378
- const i2 = n2.transform(s2.data, a3);
2379
- return s2.common.issues.length ? {
2380
- status: "dirty",
2381
- value: s2.data
2382
- } : s2.common.async ? Promise.resolve(i2).then((o2) => this._def.schema._parseAsync({
2383
- data: o2,
2384
- path: s2.path,
2385
- parent: s2
2386
- })) : this._def.schema._parseSync({
2387
- data: i2,
2388
- path: s2.path,
2389
- parent: s2
2390
- });
2391
- }
2392
- if (n2.type === "refinement") {
2393
- const i2 = (o2) => {
2394
- const f2 = n2.refinement(o2, a3);
2395
- if (s2.common.async)
2396
- return Promise.resolve(f2);
2397
- if (f2 instanceof Promise)
2398
- throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
2399
- return o2;
2400
- };
2401
- if (s2.common.async === false) {
2402
- const o2 = this._def.schema._parseSync({
2403
- data: s2.data,
2404
- path: s2.path,
2405
- parent: s2
2406
- });
2407
- return o2.status === "aborted" ? m$4 : (o2.status === "dirty" && t2.dirty(), i2(o2.value), { status: t2.value, value: o2.value });
2408
- } else
2409
- return this._def.schema._parseAsync({ data: s2.data, path: s2.path, parent: s2 }).then((o2) => o2.status === "aborted" ? m$4 : (o2.status === "dirty" && t2.dirty(), i2(o2.value).then(() => ({ status: t2.value, value: o2.value }))));
2410
- }
2411
- if (n2.type === "transform")
2412
- if (s2.common.async === false) {
2413
- const i2 = this._def.schema._parseSync({
2414
- data: s2.data,
2415
- path: s2.path,
2416
- parent: s2
2417
- });
2418
- if (!q$2(i2))
2419
- return i2;
2420
- const o2 = n2.transform(i2.value, a3);
2421
- if (o2 instanceof Promise)
2422
- throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2423
- return { status: t2.value, value: o2 };
2424
- } else
2425
- return this._def.schema._parseAsync({ data: s2.data, path: s2.path, parent: s2 }).then((i2) => q$2(i2) ? Promise.resolve(n2.transform(i2.value, a3)).then((o2) => ({ status: t2.value, value: o2 })) : i2);
2426
- g$4.assertNever(n2);
2427
- }
2428
- };
2429
- N$4.create = (r2, e2, t2) => new N$4({
2430
- schema: r2,
2431
- typeName: p$5.ZodEffects,
2432
- effect: e2,
2433
- ...y$3(t2)
2434
- });
2435
- N$4.createWithPreprocess = (r2, e2, t2) => new N$4({
2436
- schema: e2,
2437
- effect: { type: "preprocess", transform: r2 },
2438
- typeName: p$5.ZodEffects,
2439
- ...y$3(t2)
2440
- });
2441
- let E$4 = class E extends v$2 {
2442
- _parse(e2) {
2443
- return this._getType(e2) === u$6.undefined ? b$7(void 0) : this._def.innerType._parse(e2);
2444
- }
2445
- unwrap() {
2446
- return this._def.innerType;
2447
- }
2448
- };
2449
- E$4.create = (r2, e2) => new E$4({
2450
- innerType: r2,
2451
- typeName: p$5.ZodOptional,
2452
- ...y$3(e2)
2453
- });
2454
- let L$5 = class L extends v$2 {
2455
- _parse(e2) {
2456
- return this._getType(e2) === u$6.null ? b$7(null) : this._def.innerType._parse(e2);
2457
- }
2458
- unwrap() {
2459
- return this._def.innerType;
2460
- }
2461
- };
2462
- L$5.create = (r2, e2) => new L$5({
2463
- innerType: r2,
2464
- typeName: p$5.ZodNullable,
2465
- ...y$3(e2)
2466
- });
2467
- let te$1 = class te extends v$2 {
2468
- _parse(e2) {
2469
- const { ctx: t2 } = this._processInputParams(e2);
2470
- let s2 = t2.data;
2471
- return t2.parsedType === u$6.undefined && (s2 = this._def.defaultValue()), this._def.innerType._parse({
2472
- data: s2,
2473
- path: t2.path,
2474
- parent: t2
2475
- });
2476
- }
2477
- removeDefault() {
2478
- return this._def.innerType;
2479
- }
2480
- };
2481
- te$1.create = (r2, e2) => new te$1({
2482
- innerType: r2,
2483
- typeName: p$5.ZodDefault,
2484
- defaultValue: typeof e2.default == "function" ? e2.default : () => e2.default,
2485
- ...y$3(e2)
2486
- });
2487
- let ue$1 = class ue extends v$2 {
2488
- _parse(e2) {
2489
- const { ctx: t2 } = this._processInputParams(e2), s2 = {
2490
- ...t2,
2491
- common: {
2492
- ...t2.common,
2493
- issues: []
2494
- }
2495
- }, n2 = this._def.innerType._parse({
2496
- data: s2.data,
2497
- path: s2.path,
2498
- parent: {
2499
- ...s2
2500
- }
2501
- });
2502
- return ie$1(n2) ? n2.then((a3) => ({
2503
- status: "valid",
2504
- value: a3.status === "valid" ? a3.value : this._def.catchValue({
2505
- get error() {
2506
- return new Z$2(s2.common.issues);
2507
- },
2508
- input: s2.data
2509
- })
2510
- })) : {
2511
- status: "valid",
2512
- value: n2.status === "valid" ? n2.value : this._def.catchValue({
2513
- get error() {
2514
- return new Z$2(s2.common.issues);
2515
- },
2516
- input: s2.data
2517
- })
2518
- };
2519
- }
2520
- removeCatch() {
2521
- return this._def.innerType;
2522
- }
2523
- };
2524
- ue$1.create = (r2, e2) => new ue$1({
2525
- innerType: r2,
2526
- typeName: p$5.ZodCatch,
2527
- catchValue: typeof e2.catch == "function" ? e2.catch : () => e2.catch,
2528
- ...y$3(e2)
2529
- });
2530
- let le$1 = class le extends v$2 {
2531
- _parse(e2) {
2532
- if (this._getType(e2) !== u$6.nan) {
2533
- const s2 = this._getOrReturnCtx(e2);
2534
- return l$6(s2, {
2535
- code: d$5.invalid_type,
2536
- expected: u$6.nan,
2537
- received: s2.parsedType
2538
- }), m$4;
2539
- }
2540
- return { status: "valid", value: e2.data };
2541
- }
2542
- };
2543
- le$1.create = (r2) => new le$1({
2544
- typeName: p$5.ZodNaN,
2545
- ...y$3(r2)
2546
- });
2547
- const We = Symbol("zod_brand");
2548
- class Ze extends v$2 {
2549
- _parse(e2) {
2550
- const { ctx: t2 } = this._processInputParams(e2), s2 = t2.data;
2551
- return this._def.type._parse({
2552
- data: s2,
2553
- path: t2.path,
2554
- parent: t2
2555
- });
2556
- }
2557
- unwrap() {
2558
- return this._def.type;
2559
- }
2560
- }
2561
- let re$1 = class re extends v$2 {
2562
- _parse(e2) {
2563
- const { status: t2, ctx: s2 } = this._processInputParams(e2);
2564
- if (s2.common.async)
2565
- return (async () => {
2566
- const a3 = await this._def.in._parseAsync({
2567
- data: s2.data,
2568
- path: s2.path,
2569
- parent: s2
2570
- });
2571
- return a3.status === "aborted" ? m$4 : a3.status === "dirty" ? (t2.dirty(), we(a3.value)) : this._def.out._parseAsync({
2572
- data: a3.value,
2573
- path: s2.path,
2574
- parent: s2
2575
- });
2576
- })();
2577
- {
2578
- const n2 = this._def.in._parseSync({
2579
- data: s2.data,
2580
- path: s2.path,
2581
- parent: s2
2582
- });
2583
- return n2.status === "aborted" ? m$4 : n2.status === "dirty" ? (t2.dirty(), {
2584
- status: "dirty",
2585
- value: n2.value
2586
- }) : this._def.out._parseSync({
2587
- data: n2.value,
2588
- path: s2.path,
2589
- parent: s2
2590
- });
2591
- }
2592
- }
2593
- static create(e2, t2) {
2594
- return new re({
2595
- in: e2,
2596
- out: t2,
2597
- typeName: p$5.ZodPipeline
2598
- });
2599
- }
2600
- };
2601
- let fe$1 = class fe extends v$2 {
2602
- _parse(e2) {
2603
- const t2 = this._def.innerType._parse(e2);
2604
- return q$2(t2) && (t2.value = Object.freeze(t2.value)), t2;
2605
- }
2606
- };
2607
- fe$1.create = (r2, e2) => new fe$1({
2608
- innerType: r2,
2609
- typeName: p$5.ZodReadonly,
2610
- ...y$3(e2)
2611
- });
2612
- const Se = (r2, e2 = {}, t2) => r2 ? U$3.create().superRefine((s2, n2) => {
2613
- var a3, i2;
2614
- if (!r2(s2)) {
2615
- const o2 = typeof e2 == "function" ? e2(s2) : typeof e2 == "string" ? { message: e2 } : e2, f2 = (i2 = (a3 = o2.fatal) !== null && a3 !== void 0 ? a3 : t2) !== null && i2 !== void 0 ? i2 : true, c3 = typeof o2 == "string" ? { message: o2 } : o2;
2616
- n2.addIssue({ code: "custom", ...c3, fatal: f2 });
2617
- }
2618
- }) : U$3.create(), qe = {
2619
- object: x$4.lazycreate
2620
- };
2621
- var p$5;
2622
- (function(r2) {
2623
- r2.ZodString = "ZodString", r2.ZodNumber = "ZodNumber", r2.ZodNaN = "ZodNaN", r2.ZodBigInt = "ZodBigInt", r2.ZodBoolean = "ZodBoolean", r2.ZodDate = "ZodDate", r2.ZodSymbol = "ZodSymbol", r2.ZodUndefined = "ZodUndefined", r2.ZodNull = "ZodNull", r2.ZodAny = "ZodAny", r2.ZodUnknown = "ZodUnknown", r2.ZodNever = "ZodNever", r2.ZodVoid = "ZodVoid", r2.ZodArray = "ZodArray", r2.ZodObject = "ZodObject", r2.ZodUnion = "ZodUnion", r2.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r2.ZodIntersection = "ZodIntersection", r2.ZodTuple = "ZodTuple", r2.ZodRecord = "ZodRecord", r2.ZodMap = "ZodMap", r2.ZodSet = "ZodSet", r2.ZodFunction = "ZodFunction", r2.ZodLazy = "ZodLazy", r2.ZodLiteral = "ZodLiteral", r2.ZodEnum = "ZodEnum", r2.ZodEffects = "ZodEffects", r2.ZodNativeEnum = "ZodNativeEnum", r2.ZodOptional = "ZodOptional", r2.ZodNullable = "ZodNullable", r2.ZodDefault = "ZodDefault", r2.ZodCatch = "ZodCatch", r2.ZodPromise = "ZodPromise", r2.ZodBranded = "ZodBranded", r2.ZodPipeline = "ZodPipeline", r2.ZodReadonly = "ZodReadonly";
2624
- })(p$5 || (p$5 = {}));
2625
- const Je = (r2, e2 = {
2626
- message: `Input not instance of ${r2.name}`
2627
- }) => Se((t2) => t2 instanceof r2, e2), Ne = T$5.create, Ce$1 = j$6.create, Ye = le$1.create, He = A$6.create, Oe$1 = J$3.create, Ge = V$2.create, Xe = oe$1.create, Qe = Y$5.create, Ke$1 = H$2.create, Fe = U$3.create, et = P$3.create, tt = I$6.create, rt = de$1.create, st = S$3.create, nt = x$4.create, at = x$4.strictCreate, it = G$2.create, ot = he.create, dt = X$4.create, ct = O$5.create, ut = Q$2.create, lt = ce$1.create, ft = $$2.create, ht = z$5.create, pt = K$2.create, mt = F$4.create, yt = M$4.create, vt = ee$1.create, _t = B$5.create, ke$1 = N$4.create, gt = E$4.create, xt = L$5.create, kt = N$4.createWithPreprocess, bt = re$1.create, wt = () => Ne().optional(), Tt = () => Ce$1().optional(), Zt = () => Oe$1().optional(), St = {
2628
- string: (r2) => T$5.create({ ...r2, coerce: true }),
2629
- number: (r2) => j$6.create({ ...r2, coerce: true }),
2630
- boolean: (r2) => J$3.create({
2631
- ...r2,
2632
- coerce: true
2633
- }),
2634
- bigint: (r2) => A$6.create({ ...r2, coerce: true }),
2635
- date: (r2) => V$2.create({ ...r2, coerce: true })
2636
- }, Nt = m$4;
2637
- var Ot = /* @__PURE__ */ Object.freeze({
2638
- __proto__: null,
2639
- defaultErrorMap: W$2,
2640
- setErrorMap: Ie,
2641
- getErrorMap: ne$1,
2642
- makeIssue: ae$1,
2643
- EMPTY_PATH: Re,
2644
- addIssueToContext: l$6,
2645
- ParseStatus: k$4,
2646
- INVALID: m$4,
2647
- DIRTY: we,
2648
- OK: b$7,
2649
- isAborted: ve$1,
2650
- isDirty: _e$1,
2651
- isValid: q$2,
2652
- isAsync: ie$1,
2653
- get util() {
2654
- return g$4;
2655
- },
2656
- get objectUtil() {
2657
- return ye$1;
2658
- },
2659
- ZodParsedType: u$6,
2660
- getParsedType: R$4,
2661
- ZodType: v$2,
2662
- ZodString: T$5,
2663
- ZodNumber: j$6,
2664
- ZodBigInt: A$6,
2665
- ZodBoolean: J$3,
2666
- ZodDate: V$2,
2667
- ZodSymbol: oe$1,
2668
- ZodUndefined: Y$5,
2669
- ZodNull: H$2,
2670
- ZodAny: U$3,
2671
- ZodUnknown: P$3,
2672
- ZodNever: I$6,
2673
- ZodVoid: de$1,
2674
- ZodArray: S$3,
2675
- ZodObject: x$4,
2676
- ZodUnion: G$2,
2677
- ZodDiscriminatedUnion: he,
2678
- ZodIntersection: X$4,
2679
- ZodTuple: O$5,
2680
- ZodRecord: Q$2,
2681
- ZodMap: ce$1,
2682
- ZodSet: $$2,
2683
- ZodFunction: z$5,
2684
- ZodLazy: K$2,
2685
- ZodLiteral: F$4,
2686
- ZodEnum: M$4,
2687
- ZodNativeEnum: ee$1,
2688
- ZodPromise: B$5,
2689
- ZodEffects: N$4,
2690
- ZodTransformer: N$4,
2691
- ZodOptional: E$4,
2692
- ZodNullable: L$5,
2693
- ZodDefault: te$1,
2694
- ZodCatch: ue$1,
2695
- ZodNaN: le$1,
2696
- BRAND: We,
2697
- ZodBranded: Ze,
2698
- ZodPipeline: re$1,
2699
- ZodReadonly: fe$1,
2700
- custom: Se,
2701
- Schema: v$2,
2702
- ZodSchema: v$2,
2703
- late: qe,
2704
- get ZodFirstPartyTypeKind() {
2705
- return p$5;
2706
- },
2707
- coerce: St,
2708
- any: Fe,
2709
- array: st,
2710
- bigint: He,
2711
- boolean: Oe$1,
2712
- date: Ge,
2713
- discriminatedUnion: ot,
2714
- effect: ke$1,
2715
- enum: yt,
2716
- function: ht,
2717
- instanceof: Je,
2718
- intersection: dt,
2719
- lazy: pt,
2720
- literal: mt,
2721
- map: lt,
2722
- nan: Ye,
2723
- nativeEnum: vt,
2724
- never: tt,
2725
- null: Ke$1,
2726
- nullable: xt,
2727
- number: Ce$1,
2728
- object: nt,
2729
- oboolean: Zt,
2730
- onumber: Tt,
2731
- optional: gt,
2732
- ostring: wt,
2733
- pipeline: bt,
2734
- preprocess: kt,
2735
- promise: _t,
2736
- record: ut,
2737
- set: ft,
2738
- strictObject: at,
2739
- string: Ne,
2740
- symbol: Xe,
2741
- transformer: ke$1,
2742
- tuple: ct,
2743
- undefined: Qe,
2744
- union: it,
2745
- unknown: et,
2746
- void: rt,
2747
- NEVER: Nt,
2748
- ZodIssueCode: d$5,
2749
- quotelessJson: Ee,
2750
- ZodError: Z$2
2751
- });
2752
- const t$1 = Ot.tuple([Ot.number(), Ot.number()]);
2753
- Ot.tuple([Ot.bigint(), Ot.bigint()]);
2754
- const S$2 = Ot.object({ width: Ot.number(), height: Ot.number() }), h$4 = Ot.object({
2755
- signedWidth: Ot.number(),
2756
- signedHeight: Ot.number()
2757
- }), i$5 = ["width", "height"];
2758
- Ot.enum(i$5);
2759
- const u$5 = ["start", "center", "end"], r$3 = ["signedWidth", "signedHeight"];
2760
- Ot.enum(r$3);
2761
- const I$5 = Ot.object({ x: Ot.number(), y: Ot.number() }), p$4 = Ot.object({ clientX: Ot.number(), clientY: Ot.number() }), a$3 = ["x", "y"], o$1 = Ot.enum(a$3), e = ["top", "right", "bottom", "left"], L$4 = Ot.enum(e), m$3 = ["left", "right"], C$2 = Ot.enum(m$3), b$6 = ["top", "bottom"], E$3 = Ot.enum(b$6), s$4 = ["center"], T$4 = Ot.enum(s$4), g$3 = [...e, ...s$4], c$6 = Ot.enum(g$3), D$3 = Ot.enum(u$5), d$4 = ["first", "last"], A$5 = Ot.enum(d$4), O$4 = Ot.object({ lower: Ot.number(), upper: Ot.number() }), l$5 = Ot.object({ lower: Ot.bigint(), upper: Ot.bigint() });
2762
- Ot.union([O$4, t$1]);
2763
- Ot.union([l$5, t$1]);
2764
- const f$6 = Ot.union([o$1, c$6]), j$5 = Ot.union([o$1, c$6, Ot.instanceof(String)]);
2765
- const w$5 = (e2, r2) => typeof e2 == "bigint" ? e2 - BigInt(r2) : e2 - Number(r2), b$5 = (e2, r2) => typeof e2 == "bigint" ? e2 + BigInt(r2) : e2 + Number(r2), h$3 = (e2, r2, n2 = 1e-4) => Math.abs(e2 - r2) < n2, _$5 = (e2) => {
2766
- const r2 = Math.pow(10, Math.floor(Math.log10(e2)));
2767
- return Math.round(e2 / r2) * r2;
2768
- }, L$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2769
- __proto__: null,
2770
- add: b$5,
2771
- closeTo: h$3,
2772
- roundToNearestMagnitude: _$5,
2773
- sub: w$5
2774
- }, Symbol.toStringTag, { value: "Module" })), i$4 = (e2, r2) => {
2775
- const n2 = {};
2776
- if (typeof e2 == "number" || typeof e2 == "bigint")
2777
- r2 != null ? (n2.lower = e2, n2.upper = r2) : (n2.lower = typeof e2 == "bigint" ? 0n : 0, n2.upper = e2);
2778
- else if (Array.isArray(e2)) {
2779
- if (e2.length !== 2)
2780
- throw new Error("bounds: expected array of length 2");
2781
- [n2.lower, n2.upper] = e2;
2782
- } else
2783
- return f$5(e2);
2784
- return f$5(n2);
2785
- }, x$3 = Object.freeze({ lower: 0, upper: 0 }), M$3 = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), B$4 = Object.freeze({ lower: 0, upper: 1 }), v$1 = Object.freeze({ lower: -1, upper: 1 }), N$3 = (e2, r2) => {
2786
- if (e2 == null && r2 == null)
2787
- return true;
2788
- if (e2 == null || r2 == null)
2789
- return false;
2790
- const n2 = i$4(e2), t2 = i$4(r2);
2791
- return (n2 == null ? void 0 : n2.lower) === (t2 == null ? void 0 : t2.lower) && (n2 == null ? void 0 : n2.upper) === (t2 == null ? void 0 : t2.upper);
2792
- }, f$5 = (e2) => e2.lower > e2.upper ? { lower: e2.upper, upper: e2.lower } : e2, A$4 = (e2, r2) => {
2793
- const n2 = i$4(e2);
2794
- return r2 < n2.lower ? n2.lower : r2 >= n2.upper ? n2.upper - (typeof n2.upper == "number" ? 1 : 1n) : r2;
2795
- }, u$4 = (e2, r2) => {
2796
- const n2 = i$4(e2);
2797
- if (typeof r2 == "number" || typeof r2 == "bigint")
2798
- return r2 >= n2.lower && r2 < n2.upper;
2799
- const t2 = i$4(r2);
2800
- return t2.lower >= n2.lower && t2.upper <= n2.upper;
2801
- }, O$3 = (e2, r2) => {
2802
- const n2 = i$4(e2), t2 = i$4(r2);
2803
- return n2.lower === t2.lower ? true : t2.upper === n2.lower || t2.lower === n2.upper ? false : u$4(n2, t2.upper) || u$4(n2, t2.lower) || u$4(t2, n2.upper) || u$4(t2, n2.lower);
2804
- }, l$4 = (e2) => {
2805
- const r2 = i$4(e2);
2806
- return r2.upper - r2.lower;
2807
- }, j$4 = (e2) => {
2808
- const r2 = i$4(e2);
2809
- return typeof r2.lower == "bigint" ? r2.lower === 0n && r2.upper === 0n : r2.lower === 0 && r2.upper === 0;
2810
- }, z$4 = (e2) => l$4(e2) === 0, P$2 = (e2) => {
2811
- const r2 = i$4(e2);
2812
- return Number.isFinite(r2.lower) && Number.isFinite(r2.upper);
2813
- }, E$2 = (e2) => ({
2814
- lower: Math.min(...e2.map((r2) => i$4(r2).lower)),
2815
- upper: Math.max(...e2.map((r2) => i$4(r2).upper))
2816
- }), T$3 = (e2) => ({
2817
- lower: Math.max(...e2.map((r2) => i$4(r2).lower)),
2818
- upper: Math.min(...e2.map((r2) => i$4(r2).upper))
2819
- }), F$3 = (e2) => {
2820
- const r2 = i$4(e2), n2 = typeof r2.lower == "bigint";
2821
- return Array.from({ length: Number(l$4(e2)) }, (t2, o2) => n2 ? r2.lower + BigInt(o2) : r2.lower + o2);
2822
- }, m$2 = (e2, r2) => {
2823
- const n2 = e2.map((p2) => i$4(p2)), t2 = n2.findIndex(
2824
- (p2, s2) => u$4(p2, r2) || r2 < n2[s2].lower
2825
- );
2826
- if (t2 === -1)
2827
- return { index: e2.length, position: 0 };
2828
- const o2 = n2[t2];
2829
- return u$4(o2, r2) ? { index: t2, position: Number(r2 - o2.lower) } : { index: t2, position: 0 };
2830
- }, c$5 = {
2831
- removeBefore: 0,
2832
- removeAfter: 0,
2833
- insertInto: 0,
2834
- deleteInBetween: 0
2835
- }, I$4 = (e2, r2) => {
2836
- const n2 = e2.map((y2) => i$4(y2)), t2 = i$4(r2);
2837
- if (n2.length === 0)
2838
- return c$5;
2839
- const o2 = m$2(n2, t2.lower), p2 = m$2(n2, t2.upper);
2840
- if (o2.index === e2.length)
2841
- return { ...c$5, insertInto: e2.length };
2842
- if (p2.index === 0)
2843
- return { ...c$5, removeAfter: p2.position };
2844
- if (o2.index === p2.index)
2845
- return o2.position !== 0 && p2.position !== 0 ? null : {
2846
- removeAfter: p2.position,
2847
- removeBefore: o2.position,
2848
- insertInto: o2.index,
2849
- deleteInBetween: 0
2850
- };
2851
- let s2 = p2.index - o2.index, a3 = o2.index, d2 = w$5(Number(l$4(n2[o2.index])), o2.position);
2852
- return o2.position !== 0 ? (s2 -= 1, a3 += 1) : d2 = 0, {
2853
- removeBefore: d2,
2854
- removeAfter: p2.position,
2855
- insertInto: a3,
2856
- deleteInBetween: s2
2857
- };
2858
- }, S$1 = (e2, r2) => {
2859
- const n2 = I$4(e2, r2), t2 = e2.map((p2) => i$4(p2));
2860
- if (n2 == null)
2861
- return t2;
2862
- const o2 = i$4(r2);
2863
- return o2.lower = b$5(o2.lower, n2.removeBefore), o2.upper = w$5(o2.upper, n2.removeAfter), t2.splice(n2.insertInto, n2.deleteInBetween, o2), t2;
2864
- }, C$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2865
- __proto__: null,
2866
- CLIP: v$1,
2867
- DECIMAL: B$4,
2868
- INFINITE: M$3,
2869
- ZERO: x$3,
2870
- bounds: O$4,
2871
- buildInsertionPlan: I$4,
2872
- clamp: A$4,
2873
- construct: i$4,
2874
- contains: u$4,
2875
- equals: N$3,
2876
- findInsertPosition: m$2,
2877
- insert: S$1,
2878
- isFinite: P$2,
2879
- isZero: j$4,
2880
- linspace: F$3,
2881
- makeValid: f$5,
2882
- max: E$2,
2883
- min: T$3,
2884
- overlapsWith: O$3,
2885
- span: l$4,
2886
- spanIsZero: z$4
2887
- }, Symbol.toStringTag, { value: "Module" }));
2888
- const s$3 = f$6, t = (e2) => a$3.includes(e2) ? e2 : b$6.includes(e2) ? "y" : "x", c$4 = (e2) => t(e2) === "x" ? "y" : "x", r$2 = (e2) => t(e2) === "x" ? "width" : "height", d$3 = (e2) => t(e2) === "x" ? "left" : "top", u$3 = (e2) => s$3.safeParse(e2).success, a$2 = (e2) => t(e2) === "x" ? "signedWidth" : "signedHeight", f$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2889
- __proto__: null,
2890
- construct: t,
2891
- crude: s$3,
2892
- dimension: r$2,
2893
- isDirection: u$3,
2894
- location: d$3,
2895
- signedDimension: a$2,
2896
- swap: c$4
2897
- }, Symbol.toStringTag, { value: "Module" }));
2898
- var c$3 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, i$3 = {}, k$3 = {};
2899
- Object.defineProperty(k$3, "__esModule", { value: true });
2900
- function ne(a3) {
2901
- return a3 === void 0 && (a3 = ""), a3 ? String(a3).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g, "").replace(/[^A-Za-z0-9]+/g, "$").replace(/([a-z])([A-Z])/g, function(e2, s2, t2) {
2902
- return s2 + "$" + t2;
2903
- }).toLowerCase().replace(/(\$)(\w)/g, function(e2, s2, t2) {
2904
- return t2.toUpperCase();
2905
- }) : "";
2906
- }
2907
- k$3.default = ne;
2908
- var T$2 = {};
2909
- Object.defineProperty(T$2, "__esModule", { value: true });
2910
- function se(a3) {
2911
- return a3 === void 0 && (a3 = ""), a3 ? String(a3).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g, "").replace(/([a-z])([A-Z])/g, function(e2, s2, t2) {
2912
- return s2 + "_" + t2.toLowerCase();
2913
- }).replace(/[^A-Za-z0-9]+|_+/g, "_").toLowerCase() : "";
2914
- }
2915
- T$2.default = se;
2916
- var z$3 = {};
2917
- Object.defineProperty(z$3, "__esModule", { value: true });
2918
- function ue2(a3) {
2919
- return a3 === void 0 && (a3 = ""), a3 ? String(a3).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g, "$").replace(/[^A-Za-z0-9]+/g, "$").replace(/([a-z])([A-Z])/g, function(e2, s2, t2) {
2920
- return s2 + "$" + t2;
2921
- }).toLowerCase().replace(/(\$)(\w?)/g, function(e2, s2, t2) {
2922
- return t2.toUpperCase();
2923
- }) : "";
2924
- }
2925
- z$3.default = ue2;
2926
- var Z$1 = {};
2927
- Object.defineProperty(Z$1, "__esModule", { value: true });
2928
- function ie(a3) {
2929
- return a3 === void 0 && (a3 = ""), a3 ? String(a3).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g, "").replace(/([a-z])([A-Z])/g, function(e2, s2, t2) {
2930
- return s2 + "_" + t2.toLowerCase();
2931
- }).replace(/[^A-Za-z0-9]+|_+/g, ".").toLowerCase() : "";
2932
- }
2933
- Z$1.default = ie;
2934
- var h$2 = {};
2935
- Object.defineProperty(h$2, "__esModule", { value: true });
2936
- function le2(a3) {
2937
- return a3 === void 0 && (a3 = ""), a3 ? String(a3).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g, "").replace(/([a-z])([A-Z])/g, function(e2, s2, t2) {
2938
- return s2 + "_" + t2.toLowerCase();
2939
- }).replace(/[^A-Za-z0-9]+|_+/g, "/").toLowerCase() : "";
2940
- }
2941
- h$2.default = le2;
2942
- var w$4 = {};
2943
- Object.defineProperty(w$4, "__esModule", { value: true });
2944
- function ce2(a3) {
2945
- return a3 === void 0 && (a3 = ""), a3 ? String(a3).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g, "").replace(/([a-z])([A-Z])/g, function(e2, s2, t2) {
2946
- return s2 + "_" + t2.toLowerCase();
2947
- }).replace(/[^A-Za-z0-9]+|_+/g, " ").toLowerCase() : "";
2948
- }
2949
- w$4.default = ce2;
2950
- var $$1 = {};
2951
- Object.defineProperty($$1, "__esModule", { value: true });
2952
- function fe2(a3) {
2953
- if (a3 === void 0 && (a3 = ""), !a3)
2954
- return "";
2955
- var e2 = String(a3).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g, "").replace(/([a-z])([A-Z])/g, function(s2, t2, r2) {
2956
- return t2 + "_" + r2.toLowerCase();
2957
- }).replace(/[^A-Za-z0-9]+|_+/g, " ").toLowerCase();
2958
- return e2.charAt(0).toUpperCase() + e2.slice(1);
2959
- }
2960
- $$1.default = fe2;
2961
- var P$1 = {};
2962
- Object.defineProperty(P$1, "__esModule", { value: true });
2963
- function oe2(a3) {
2964
- return a3 === void 0 && (a3 = ""), a3 ? String(a3).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g, "").replace(/([a-z])([A-Z])/g, function(e2, s2, t2) {
2965
- return s2 + "_" + t2.toLowerCase();
2966
- }).replace(/[^A-Za-z0-9]+|_+/g, " ").toLowerCase().replace(/( ?)(\w+)( ?)/g, function(e2, s2, t2, r2) {
2967
- return s2 + t2.charAt(0).toUpperCase() + t2.slice(1) + r2;
2968
- }) : "";
2969
- }
2970
- P$1.default = oe2;
2971
- var K$1 = {};
2972
- Object.defineProperty(K$1, "__esModule", { value: true });
2973
- function de2(a3) {
2974
- return a3 === void 0 && (a3 = ""), a3 ? String(a3).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g, "").replace(/([a-z])([A-Z])/g, function(e2, s2, t2) {
2975
- return s2 + "_" + t2.toLowerCase();
2976
- }).replace(/[^A-Za-z0-9]+|_+/g, "-").toLowerCase() : "";
2977
- }
2978
- K$1.default = de2;
2979
- var S2 = {}, p$3 = {};
2980
- (function(a3) {
2981
- Object.defineProperty(a3, "__esModule", { value: true }), a3.belongToTypes = a3.isValidObject = a3.isArrayObject = a3.validateOptions = a3.DefaultOption = void 0, a3.DefaultOption = {
2982
- recursive: false,
2983
- recursiveInArray: false,
2984
- keepTypesOnRecursion: []
2985
- }, a3.validateOptions = function(e2) {
2986
- return e2 === void 0 && (e2 = a3.DefaultOption), e2.recursive == null ? e2 = a3.DefaultOption : e2.recursiveInArray == null && (e2.recursiveInArray = false), e2;
2987
- }, a3.isArrayObject = function(e2) {
2988
- return e2 != null && Array.isArray(e2);
2989
- }, a3.isValidObject = function(e2) {
2990
- return e2 != null && typeof e2 == "object" && !Array.isArray(e2);
2991
- }, a3.belongToTypes = function(e2, s2) {
2992
- return (s2 || []).some(function(t2) {
2993
- return e2 instanceof t2;
2994
- });
2995
- };
2996
- })(p$3);
2997
- var ye = c$3 && c$3.__spreadArrays || function() {
2998
- for (var a3 = 0, e2 = 0, s2 = arguments.length; e2 < s2; e2++)
2999
- a3 += arguments[e2].length;
3000
- for (var t2 = Array(a3), r2 = 0, e2 = 0; e2 < s2; e2++)
3001
- for (var l2 = arguments[e2], n2 = 0, u2 = l2.length; n2 < u2; n2++, r2++)
3002
- t2[r2] = l2[n2];
3003
- return t2;
3004
- };
3005
- Object.defineProperty(S2, "__esModule", { value: true });
3006
- var o = p$3;
3007
- function g$2(a3, e2) {
3008
- if (e2 === void 0 && (e2 = o.DefaultOption), !o.isValidObject(a3))
3009
- return null;
3010
- e2 = o.validateOptions(e2);
3011
- var s2 = {};
3012
- return Object.keys(a3).forEach(function(t2) {
3013
- var r2 = a3[t2], l2 = t2.toLowerCase();
3014
- e2.recursive && (o.isValidObject(r2) ? o.belongToTypes(r2, e2.keepTypesOnRecursion) || (r2 = g$2(r2, e2)) : e2.recursiveInArray && o.isArrayObject(r2) && (r2 = ye(r2).map(function(n2) {
3015
- var u2 = n2;
3016
- if (o.isValidObject(n2))
3017
- o.belongToTypes(u2, e2.keepTypesOnRecursion) || (u2 = g$2(n2, e2));
3018
- else if (o.isArrayObject(n2)) {
3019
- var f2 = g$2({ key: n2 }, e2);
3020
- u2 = f2.key;
3021
- }
3022
- return u2;
3023
- }))), s2[l2] = r2;
3024
- }), s2;
3025
- }
3026
- S2.default = g$2;
3027
- var L$2 = {}, ve = c$3 && c$3.__spreadArrays || function() {
3028
- for (var a3 = 0, e2 = 0, s2 = arguments.length; e2 < s2; e2++)
3029
- a3 += arguments[e2].length;
3030
- for (var t2 = Array(a3), r2 = 0, e2 = 0; e2 < s2; e2++)
3031
- for (var l2 = arguments[e2], n2 = 0, u2 = l2.length; n2 < u2; n2++, r2++)
3032
- t2[r2] = l2[n2];
3033
- return t2;
3034
- };
3035
- Object.defineProperty(L$2, "__esModule", { value: true });
3036
- var d$2 = p$3;
3037
- function O$2(a3, e2) {
3038
- if (e2 === void 0 && (e2 = d$2.DefaultOption), !d$2.isValidObject(a3))
3039
- return null;
3040
- e2 = d$2.validateOptions(e2);
3041
- var s2 = {};
3042
- return Object.keys(a3).forEach(function(t2) {
3043
- var r2 = a3[t2], l2 = t2.toUpperCase();
3044
- e2.recursive && (d$2.isValidObject(r2) ? d$2.belongToTypes(r2, e2.keepTypesOnRecursion) || (r2 = O$2(r2, e2)) : e2.recursiveInArray && d$2.isArrayObject(r2) && (r2 = ve(r2).map(function(n2) {
3045
- var u2 = n2;
3046
- if (d$2.isValidObject(n2))
3047
- d$2.belongToTypes(u2, e2.keepTypesOnRecursion) || (u2 = O$2(n2, e2));
3048
- else if (d$2.isArrayObject(n2)) {
3049
- var f2 = O$2({ key: n2 }, e2);
3050
- u2 = f2.key;
3051
- }
3052
- return u2;
3053
- }))), s2[l2] = r2;
3054
- }), s2;
3055
- }
3056
- L$2.default = O$2;
3057
- var V$1 = {}, _e = c$3 && c$3.__spreadArrays || function() {
3058
- for (var a3 = 0, e2 = 0, s2 = arguments.length; e2 < s2; e2++)
3059
- a3 += arguments[e2].length;
3060
- for (var t2 = Array(a3), r2 = 0, e2 = 0; e2 < s2; e2++)
3061
- for (var l2 = arguments[e2], n2 = 0, u2 = l2.length; n2 < u2; n2++, r2++)
3062
- t2[r2] = l2[n2];
3063
- return t2;
3064
- };
3065
- Object.defineProperty(V$1, "__esModule", { value: true });
3066
- var y$2 = p$3, be = k$3;
3067
- function A$3(a3, e2) {
3068
- if (e2 === void 0 && (e2 = y$2.DefaultOption), !y$2.isValidObject(a3))
3069
- return null;
3070
- e2 = y$2.validateOptions(e2);
3071
- var s2 = {};
3072
- return Object.keys(a3).forEach(function(t2) {
3073
- var r2 = a3[t2], l2 = be.default(t2);
3074
- e2.recursive && (y$2.isValidObject(r2) ? y$2.belongToTypes(r2, e2.keepTypesOnRecursion) || (r2 = A$3(r2, e2)) : e2.recursiveInArray && y$2.isArrayObject(r2) && (r2 = _e(r2).map(function(n2) {
3075
- var u2 = n2;
3076
- if (y$2.isValidObject(n2))
3077
- y$2.belongToTypes(u2, e2.keepTypesOnRecursion) || (u2 = A$3(n2, e2));
3078
- else if (y$2.isArrayObject(n2)) {
3079
- var f2 = A$3({ key: n2 }, e2);
3080
- u2 = f2.key;
3081
- }
3082
- return u2;
3083
- }))), s2[l2] = r2;
3084
- }), s2;
3085
- }
3086
- V$1.default = A$3;
3087
- var M$2 = {}, pe = c$3 && c$3.__spreadArrays || function() {
3088
- for (var a3 = 0, e2 = 0, s2 = arguments.length; e2 < s2; e2++)
3089
- a3 += arguments[e2].length;
3090
- for (var t2 = Array(a3), r2 = 0, e2 = 0; e2 < s2; e2++)
3091
- for (var l2 = arguments[e2], n2 = 0, u2 = l2.length; n2 < u2; n2++, r2++)
3092
- t2[r2] = l2[n2];
3093
- return t2;
3094
- };
3095
- Object.defineProperty(M$2, "__esModule", { value: true });
3096
- var v2 = p$3, ge = T$2;
3097
- function C2(a3, e2) {
3098
- if (e2 === void 0 && (e2 = v2.DefaultOption), !v2.isValidObject(a3))
3099
- return null;
3100
- e2 = v2.validateOptions(e2);
3101
- var s2 = {};
3102
- return Object.keys(a3).forEach(function(t2) {
3103
- var r2 = a3[t2], l2 = ge.default(t2);
3104
- e2.recursive && (v2.isValidObject(r2) ? v2.belongToTypes(r2, e2.keepTypesOnRecursion) || (r2 = C2(r2, e2)) : e2.recursiveInArray && v2.isArrayObject(r2) && (r2 = pe(r2).map(function(n2) {
3105
- var u2 = n2;
3106
- if (v2.isValidObject(n2))
3107
- v2.belongToTypes(u2, e2.keepTypesOnRecursion) || (u2 = C2(n2, e2));
3108
- else if (v2.isArrayObject(n2)) {
3109
- var f2 = C2({ key: n2 }, e2);
3110
- u2 = f2.key;
3111
- }
3112
- return u2;
3113
- }))), s2[l2] = r2;
3114
- }), s2;
3115
- }
3116
- M$2.default = C2;
3117
- var D$2 = {}, Oe = c$3 && c$3.__spreadArrays || function() {
3118
- for (var a3 = 0, e2 = 0, s2 = arguments.length; e2 < s2; e2++)
3119
- a3 += arguments[e2].length;
3120
- for (var t2 = Array(a3), r2 = 0, e2 = 0; e2 < s2; e2++)
3121
- for (var l2 = arguments[e2], n2 = 0, u2 = l2.length; n2 < u2; n2++, r2++)
3122
- t2[r2] = l2[n2];
3123
- return t2;
3124
- };
3125
- Object.defineProperty(D$2, "__esModule", { value: true });
3126
- var _$4 = p$3, Ae = z$3;
3127
- function j$3(a3, e2) {
3128
- if (e2 === void 0 && (e2 = _$4.DefaultOption), !_$4.isValidObject(a3))
3129
- return null;
3130
- e2 = _$4.validateOptions(e2);
3131
- var s2 = {};
3132
- return Object.keys(a3).forEach(function(t2) {
3133
- var r2 = a3[t2], l2 = Ae.default(t2);
3134
- e2.recursive && (_$4.isValidObject(r2) ? _$4.belongToTypes(r2, e2.keepTypesOnRecursion) || (r2 = j$3(r2, e2)) : e2.recursiveInArray && _$4.isArrayObject(r2) && (r2 = Oe(r2).map(function(n2) {
3135
- var u2 = n2;
3136
- if (_$4.isValidObject(n2))
3137
- _$4.belongToTypes(u2, e2.keepTypesOnRecursion) || (u2 = j$3(n2, e2));
3138
- else if (_$4.isArrayObject(n2)) {
3139
- var f2 = j$3({ key: n2 }, e2);
3140
- u2 = f2.key;
3141
- }
3142
- return u2;
3143
- }))), s2[l2] = r2;
3144
- }), s2;
3145
- }
3146
- D$2.default = j$3;
3147
- var R$3 = {}, Ce = c$3 && c$3.__spreadArrays || function() {
3148
- for (var a3 = 0, e2 = 0, s2 = arguments.length; e2 < s2; e2++)
3149
- a3 += arguments[e2].length;
3150
- for (var t2 = Array(a3), r2 = 0, e2 = 0; e2 < s2; e2++)
3151
- for (var l2 = arguments[e2], n2 = 0, u2 = l2.length; n2 < u2; n2++, r2++)
3152
- t2[r2] = l2[n2];
3153
- return t2;
3154
- };
3155
- Object.defineProperty(R$3, "__esModule", { value: true });
3156
- var b$4 = p$3, je = K$1;
3157
- function m$1(a3, e2) {
3158
- if (e2 === void 0 && (e2 = b$4.DefaultOption), !b$4.isValidObject(a3))
3159
- return null;
3160
- e2 = b$4.validateOptions(e2);
3161
- var s2 = {};
3162
- return Object.keys(a3).forEach(function(t2) {
3163
- var r2 = a3[t2], l2 = je.default(t2);
3164
- e2.recursive && (b$4.isValidObject(r2) ? b$4.belongToTypes(r2, e2.keepTypesOnRecursion) || (r2 = m$1(r2, e2)) : e2.recursiveInArray && b$4.isArrayObject(r2) && (r2 = Ce(r2).map(function(n2) {
3165
- var u2 = n2;
3166
- if (b$4.isValidObject(n2))
3167
- b$4.belongToTypes(u2, e2.keepTypesOnRecursion) || (u2 = m$1(n2, e2));
3168
- else if (b$4.isArrayObject(n2)) {
3169
- var f2 = m$1({ key: n2 }, e2);
3170
- u2 = f2.key;
3171
- }
3172
- return u2;
3173
- }))), s2[l2] = r2;
3174
- }), s2;
3175
- }
3176
- R$3.default = m$1;
3177
- Object.defineProperty(i$3, "__esModule", { value: true });
3178
- i$3.kebabKeys = i$3.pascalKeys = i$3.snakeKeys = i$3.camelKeys = i$3.upperKeys = i$3.lowerKeys = i$3.toLowerCase = i$3.toUpperCase = i$3.toKebabCase = i$3.toHeaderCase = i$3.toSentenceCase = i$3.toTextCase = i$3.toPathCase = i$3.toDotCase = i$3.toPascalCase = i$3.toSnakeCase = i$3.toCamelCase = void 0;
3179
- var U$2 = k$3;
3180
- i$3.toCamelCase = U$2.default;
3181
- var I$3 = T$2;
3182
- i$3.toSnakeCase = I$3.default;
3183
- var E$1 = z$3;
3184
- i$3.toPascalCase = E$1.default;
3185
- var H$1 = Z$1;
3186
- i$3.toDotCase = H$1.default;
3187
- var G$1 = h$2;
3188
- i$3.toPathCase = G$1.default;
3189
- var N$2 = w$4;
3190
- i$3.toTextCase = N$2.default;
3191
- var q$1 = $$1;
3192
- i$3.toSentenceCase = q$1.default;
3193
- var B$3 = P$1;
3194
- i$3.toHeaderCase = B$3.default;
3195
- var F$2 = K$1;
3196
- i$3.toKebabCase = F$2.default;
3197
- var J$2 = S2;
3198
- i$3.lowerKeys = J$2.default;
3199
- var Q$1 = L$2;
3200
- i$3.upperKeys = Q$1.default;
3201
- var W$1 = V$1;
3202
- i$3.camelKeys = W$1.default;
3203
- var X$3 = M$2;
3204
- i$3.snakeKeys = X$3.default;
3205
- var Y$4 = D$2;
3206
- i$3.pascalKeys = Y$4.default;
3207
- var x$2 = R$3;
3208
- i$3.kebabKeys = x$2.default;
3209
- var ee2 = function(a3) {
3210
- return String(a3 || "").toLowerCase();
3211
- };
3212
- i$3.toLowerCase = ee2;
3213
- var ae = function(a3) {
3214
- return String(a3 || "").toUpperCase();
3215
- };
3216
- i$3.toUpperCase = ae;
3217
- var me = {
3218
- toCamelCase: U$2.default,
3219
- toSnakeCase: I$3.default,
3220
- toPascalCase: E$1.default,
3221
- toDotCase: H$1.default,
3222
- toPathCase: G$1.default,
3223
- toTextCase: N$2.default,
3224
- toSentenceCase: q$1.default,
3225
- toHeaderCase: B$3.default,
3226
- toKebabCase: F$2.default,
3227
- toUpperCase: ae,
3228
- toLowerCase: ee2,
3229
- lowerKeys: J$2.default,
3230
- upperKeys: Q$1.default,
3231
- camelKeys: W$1.default,
3232
- snakeKeys: X$3.default,
3233
- pascalKeys: Y$4.default,
3234
- kebabKeys: x$2.default
3235
- };
3236
- i$3.default = me;
3237
- var re2 = i$3;
3238
- const te2 = {
3239
- recursive: true,
3240
- recursiveInArray: true,
3241
- keepTypesOnRecursion: [Number, String, Uint8Array]
3242
- }, ke = (a3) => re2.snakeKeys(a3, te2), Te = (a3) => re2.camelKeys(a3, te2), ze = (a3) => a3[0].toUpperCase() + a3.slice(1), Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3243
- __proto__: null,
3244
- capitalize: ze,
3245
- toCamel: Te,
3246
- toSnake: ke
3247
- }, Symbol.toStringTag, { value: "Module" }));
3248
- const N$1 = C$2, R$2 = E$3, I$2 = {
3249
- top: "bottom",
3250
- right: "left",
3251
- bottom: "top",
3252
- left: "right",
3253
- center: "center"
3254
- }, X$2 = {
3255
- top: "left",
3256
- right: "top",
3257
- bottom: "right",
3258
- left: "bottom",
3259
- center: "center"
3260
- }, Y$3 = j$5, c$2 = (t2) => t2 instanceof String ? t2 : a$3.includes(t2) ? t2 === "x" ? "left" : "top" : t2, A$2 = (t2) => I$2[c$2(t2)], P2 = (t2) => X$2[c$2(t2)], s$2 = (t2) => {
3261
- const o2 = c$2(t2);
3262
- return o2 === "top" || o2 === "bottom" ? "y" : "x";
3263
- }, k$2 = Ot.object({
3264
- x: C$2.or(T$4),
3265
- y: E$3.or(T$4)
3266
- }), w$3 = Ot.object({ x: C$2, y: E$3 }), T$1 = Object.freeze({ x: "left", y: "top" }), l$3 = Object.freeze({ x: "right", y: "top" }), b$3 = Object.freeze({ x: "left", y: "bottom" }), u$2 = Object.freeze({ x: "right", y: "bottom" }), y$1 = Object.freeze({ x: "center", y: "center" }), p$2 = Object.freeze({ x: "center", y: "top" }), _$3 = Object.freeze({ x: "center", y: "bottom" }), E2 = Object.freeze({ x: "right", y: "center" }), j$2 = Object.freeze({ x: "left", y: "center" }), M$1 = Object.freeze([
3267
- j$2,
3268
- E2,
3269
- p$2,
3270
- _$3,
3271
- T$1,
3272
- l$3,
3273
- b$3,
3274
- u$2,
3275
- y$1
3276
- ]), $2 = (t2, o2) => t2.x === o2.x && t2.y === o2.y, B$2 = (t2, o2) => {
3277
- if (typeof o2 == "object") {
3278
- let e2 = true;
3279
- return "x" in o2 && (t2.x === o2.x || (e2 = false)), "y" in o2 && (t2.y === o2.y || (e2 = false)), e2;
3280
- }
3281
- return t2.x === o2 || t2.y === o2;
3282
- }, D$1 = (t2) => [t2.x, t2.y], i$2 = (t2) => s$2(c$2(t2)) === "x", F$1 = (t2) => s$2(c$2(t2)) === "y", G2 = (t2) => `${t2.x}${ze(t2.y)}`, H2 = (t2, o2) => {
3283
- let e2, n2;
3284
- if (typeof t2 == "object" && "x" in t2 ? (e2 = t2.x, n2 = t2.y) : (e2 = c$2(t2), n2 = c$2(o2 ?? t2)), s$2(e2) === s$2(n2) && e2 !== "center" && n2 !== "center")
3285
- throw new Error(
3286
- `[XYLocation] - encountered two locations with the same direction: ${e2.toString()} - ${n2.toString()}`
3287
- );
3288
- const r2 = { ...y$1 };
3289
- return e2 === "center" ? i$2(n2) ? [r2.x, r2.y] = [n2, e2] : [r2.x, r2.y] = [e2, n2] : n2 === "center" ? i$2(e2) ? [r2.x, r2.y] = [e2, n2] : [r2.x, r2.y] = [n2, e2] : i$2(e2) ? [r2.x, r2.y] = [e2, n2] : [r2.x, r2.y] = [n2, e2], r2;
3290
- }, J$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3291
- __proto__: null,
3292
- BOTTOM_CENTER: _$3,
3293
- BOTTOM_LEFT: b$3,
3294
- BOTTOM_RIGHT: u$2,
3295
- CENTER: y$1,
3296
- CENTER_LOCATIONS: s$4,
3297
- LEFT_CENTER: j$2,
3298
- RIGHT_CENTER: E2,
3299
- TOP_CENTER: p$2,
3300
- TOP_LEFT: T$1,
3301
- TOP_RIGHT: l$3,
3302
- XY_LOCATIONS: M$1,
3303
- X_LOCATIONS: m$3,
3304
- Y_LOCATIONS: b$6,
3305
- construct: c$2,
3306
- constructXY: H2,
3307
- corner: w$3,
3308
- crude: Y$3,
3309
- direction: s$2,
3310
- isX: i$2,
3311
- isY: F$1,
3312
- location: c$6,
3313
- outer: L$4,
3314
- rotate90: P2,
3315
- swap: A$2,
3316
- x: N$1,
3317
- xy: k$2,
3318
- xyCouple: D$1,
3319
- xyEquals: $2,
3320
- xyMatches: B$2,
3321
- xyToString: G2,
3322
- y: R$2
3323
- }, Symbol.toStringTag, { value: "Module" }));
3324
- const p$1 = Ot.union([
3325
- Ot.number(),
3326
- I$5,
3327
- t$1,
3328
- S$2,
3329
- h$4,
3330
- p$4
3331
- ]), s$1 = (t2, n2) => {
3332
- if (typeof t2 == "string") {
3333
- if (n2 === void 0)
3334
- throw new Error("The y coordinate must be given.");
3335
- return t2 === "x" ? { x: n2, y: 0 } : { x: 0, y: n2 };
3336
- }
3337
- return typeof t2 == "number" ? { x: t2, y: n2 ?? t2 } : Array.isArray(t2) ? { x: t2[0], y: t2[1] } : "signedWidth" in t2 ? { x: t2.signedWidth, y: t2.signedHeight } : "clientX" in t2 ? { x: t2.clientX, y: t2.clientY } : "width" in t2 ? { x: t2.width, y: t2.height } : { x: t2.x, y: t2.y };
3338
- }, i$1 = Object.freeze({ x: 0, y: 0 }), g$1 = Object.freeze({ x: 1, y: 1 }), O$1 = Object.freeze({ x: 1 / 0, y: 1 / 0 }), h$1 = Object.freeze({ x: NaN, y: NaN }), x$1 = (t2, n2, e2 = 0) => {
3339
- const r2 = s$1(t2), o2 = s$1(n2);
3340
- return e2 === 0 ? r2.x === o2.x && r2.y === o2.y : Math.abs(r2.x - o2.x) <= e2 && Math.abs(r2.y - o2.y) <= e2;
3341
- }, j$1 = (t2) => x$1(t2, i$1), z$2 = (t2, n2, e2 = n2) => {
3342
- const r2 = s$1(t2);
3343
- return { x: r2.x * n2, y: r2.y * e2 };
3344
- }, f$3 = (t2, n2) => {
3345
- const e2 = s$1(t2);
3346
- return { x: e2.x + n2, y: e2.y };
3347
- }, b$2 = (t2, n2) => {
3348
- const e2 = s$1(t2);
3349
- return { x: e2.x, y: e2.y + n2 };
3350
- }, F2 = (t2, n2, e2, ...r2) => typeof n2 == "string" && typeof e2 == "number" ? n2 === "x" ? f$3(t2, e2) : b$2(t2, e2) : [t2, n2, e2 ?? i$1, ...r2].reduce((o2, N3) => {
3351
- const c3 = s$1(N3);
3352
- return { x: o2.x + c3.x, y: o2.y + c3.y };
3353
- }, i$1), _$2 = (t2, n2, e2) => {
3354
- const r2 = s$1(t2);
3355
- return n2 === "x" ? { x: e2, y: r2.y } : { x: r2.x, y: e2 };
3356
- }, I$1 = (t2, n2) => {
3357
- const e2 = s$1(t2), r2 = s$1(n2);
3358
- return Math.sqrt((e2.x - r2.x) ** 2 + (e2.y - r2.y) ** 2);
3359
- }, w$2 = (t2, n2) => {
3360
- const e2 = s$1(t2), r2 = s$1(n2);
3361
- return { x: r2.x - e2.x, y: r2.y - e2.y };
3362
- }, M2 = (t2) => {
3363
- const n2 = s$1(t2);
3364
- return Number.isNaN(n2.x) || Number.isNaN(n2.y);
3365
- }, X$1 = (t2) => {
3366
- const n2 = s$1(t2);
3367
- return Number.isFinite(n2.x) && Number.isFinite(n2.y);
3368
- }, Y$2 = (t2) => {
3369
- const n2 = s$1(t2);
3370
- return [n2.x, n2.y];
3371
- }, Z2 = (t2) => {
3372
- const n2 = s$1(t2);
3373
- return { left: n2.x, top: n2.y };
3374
- }, A$1 = (t2, n2 = 0) => {
3375
- const e2 = s$1(t2);
3376
- return { x: Number(e2.x.toFixed(n2)), y: Number(e2.y.toFixed(n2)) };
3377
- }, q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3378
- __proto__: null,
3379
- INFINITY: O$1,
3380
- NAN: h$1,
3381
- ONE: g$1,
3382
- ZERO: i$1,
3383
- clientXY: p$4,
3384
- construct: s$1,
3385
- couple: Y$2,
3386
- crudeZ: p$1,
3387
- css: Z2,
3388
- distance: I$1,
3389
- equals: x$1,
3390
- isFinite: X$1,
3391
- isNan: M2,
3392
- isZero: j$1,
3393
- scale: z$2,
3394
- set: _$2,
3395
- translate: F2,
3396
- translateX: f$3,
3397
- translateY: b$2,
3398
- translation: w$2,
3399
- truncate: A$1,
3400
- xy: I$5
3401
- }, Symbol.toStringTag, { value: "Module" }));
3402
- const h = Ot.union([Ot.number(), Ot.string()]);
3403
- Ot.object({
3404
- top: h,
3405
- left: h,
3406
- width: h,
3407
- height: h
3408
- });
3409
- Ot.object({
3410
- left: Ot.number(),
3411
- top: Ot.number(),
3412
- right: Ot.number(),
3413
- bottom: Ot.number()
3414
- });
3415
- const Y$1 = Ot.object({
3416
- one: I$5,
3417
- two: I$5,
3418
- root: w$3
3419
- }), W = { one: i$1, two: i$1, root: T$1 }, U$1 = { one: i$1, two: g$1, root: b$3 }, z$1 = (o2, t2) => ({
3420
- one: o2.one,
3421
- two: o2.two,
3422
- root: t2 ?? o2.root
3423
- }), s = (o2, t2, n2 = 0, e2 = 0, c3) => {
3424
- const r2 = {
3425
- one: { ...i$1 },
3426
- two: { ...i$1 },
3427
- root: c3 ?? T$1
3428
- };
3429
- if (typeof o2 == "number") {
3430
- if (typeof t2 != "number")
3431
- throw new Error("Box constructor called with invalid arguments");
3432
- return r2.one = { x: o2, y: t2 }, r2.two = { x: r2.one.x + n2, y: r2.one.y + e2 }, r2;
3433
- }
3434
- return "one" in o2 && "two" in o2 && "root" in o2 ? { ...o2, root: c3 ?? o2.root } : ("getBoundingClientRect" in o2 && (o2 = o2.getBoundingClientRect()), "left" in o2 ? (r2.one = { x: o2.left, y: o2.top }, r2.two = { x: o2.right, y: o2.bottom }, r2) : (r2.one = o2, t2 == null ? r2.two = { x: r2.one.x + n2, y: r2.one.y + e2 } : typeof t2 == "number" ? r2.two = { x: r2.one.x + t2, y: r2.one.y + n2 } : "width" in t2 ? r2.two = {
3435
- x: r2.one.x + t2.width,
3436
- y: r2.one.y + t2.height
3437
- } : "signedWidth" in t2 ? r2.two = {
3438
- x: r2.one.x + t2.signedWidth,
3439
- y: r2.one.y + t2.signedHeight
3440
- } : r2.two = t2, r2));
3441
- }, k$1 = (o2, t$12, n2) => {
3442
- const e2 = s(o2);
3443
- if (typeof t$12 == "string") {
3444
- if (n2 == null)
3445
- throw new Error("Invalid arguments for resize");
3446
- const c3 = t(t$12);
3447
- return s(
3448
- e2.one,
3449
- void 0,
3450
- c3 === "x" ? n2 : u$1(e2),
3451
- c3 === "y" ? n2 : w$1(e2),
3452
- e2.root
3453
- );
3454
- }
3455
- return s(e2.one, t$12, void 0, void 0, e2.root);
3456
- }, J2 = (o2, t2) => {
3457
- const n2 = s(o2);
3458
- return "one" in t2 ? y(t2) >= y(n2) && l$2(t2) <= l$2(n2) && a$1(t2) >= a$1(n2) && f$2(t2) <= f$2(n2) : t2.x >= y(n2) && t2.x <= l$2(n2) && t2.y >= a$1(n2) && t2.y <= f$2(n2);
3459
- }, K2 = (o2, t2) => x$1(o2.one, t2.one) && x$1(o2.two, t2.two) && $2(o2.root, t2.root), A2 = (o2) => ({
3460
- width: u$1(o2),
3461
- height: w$1(o2)
3462
- }), Q2 = (o2) => ({
3463
- signedWidth: _$1(o2),
3464
- signedHeight: b$1(o2)
3465
- }), V2 = (o2) => ({
3466
- top: a$1(o2),
3467
- left: y(o2),
3468
- width: u$1(o2),
3469
- height: w$1(o2)
3470
- }), B$1 = (o2, t$12, n2 = false) => {
3471
- const e2 = t(t$12) === "y" ? b$1(o2) : _$1(o2);
3472
- return n2 ? e2 : Math.abs(e2);
3473
- }, g = (o2, t2) => {
3474
- const n2 = s(o2);
3475
- return {
3476
- x: t2.x === "center" ? T2(n2).x : d$1(n2, t2.x),
3477
- y: t2.y === "center" ? T2(n2).y : d$1(n2, t2.y)
3478
- };
3479
- }, d$1 = (o2, t2) => {
3480
- const n2 = s(o2), e2 = D$1(n2.root).includes(t2) ? Math.min : Math.max;
3481
- return m$3.includes(t2) ? e2(n2.one.x, n2.two.x) : e2(n2.one.y, n2.two.y);
3482
- }, oo = (o2) => o2.one.x === o2.two.x && o2.one.y === o2.two.y, u$1 = (o2) => B$1(o2, "x"), w$1 = (o2) => B$1(o2, "y"), _$1 = (o2) => {
3483
- const t2 = s(o2);
3484
- return t2.two.x - t2.one.x;
3485
- }, b$1 = (o2) => {
3486
- const t2 = s(o2);
3487
- return t2.two.y - t2.one.y;
3488
- }, R$1 = (o2) => g(o2, T$1), to = (o2) => g(o2, l$3), no = (o2) => g(o2, b$3), eo = (o2) => g(o2, u$2), l$2 = (o2) => d$1(o2, "right"), f$2 = (o2) => d$1(o2, "bottom"), y = (o2) => d$1(o2, "left"), a$1 = (o2) => d$1(o2, "top"), T2 = (o2) => F2(R$1(o2), {
3489
- x: _$1(o2) / 2,
3490
- y: b$1(o2) / 2
3491
- }), I2 = (o2) => {
3492
- const t2 = s(o2);
3493
- return t2.root.x === "left" ? y(t2) : l$2(t2);
3494
- }, L$1 = (o2) => {
3495
- const t2 = s(o2);
3496
- return t2.root.y === "top" ? a$1(t2) : f$2(t2);
3497
- }, ro = (o2) => ({ x: I2(o2), y: L$1(o2) }), so = (o2) => {
3498
- const t2 = s(o2);
3499
- return { lower: t2.one.x, upper: t2.two.x };
3500
- }, co = (o2) => {
3501
- const t2 = s(o2);
3502
- return { lower: t2.one.y, upper: t2.two.y };
3503
- }, io = (o2, t2) => z$1(o2, t2), xo = (o2, t2) => {
3504
- const n2 = s(o2), e2 = m$3.includes(t2) ? "x" : b$6.includes(t2) ? "y" : null;
3505
- if (e2 === null)
3506
- throw new Error(`Invalid location: ${J$1}`);
3507
- const c3 = t2 === "top" || t2 === "left" ? Math.min : Math.max, r2 = { ...n2.one }, x3 = { ...n2.two };
3508
- return r2[e2] = c3(n2.one[e2], n2.two[e2]), x3[e2] = c3(n2.one[e2], n2.two[e2]), [r2, x3];
3509
- }, yo = (o2, t2) => {
3510
- const n2 = s(o2), e2 = s(t2), c3 = I2(e2) + (u$1(e2) - u$1(n2)) / 2, r2 = L$1(e2) + (w$1(e2) - w$1(n2)) / 2;
3511
- return s({ x: c3, y: r2 }, A2(n2));
3512
- }, ao = (o2) => typeof o2 != "object" || o2 == null ? false : "one" in o2 && "two" in o2 && "root" in o2, uo = (o2) => u$1(o2) / w$1(o2), wo = (o2, t$12, n2) => {
3513
- if (typeof t$12 == "string") {
3514
- if (n2 == null)
3515
- throw new Error("Undefined amount passed into box.translate");
3516
- const c3 = t(t$12);
3517
- t$12 = s$1(c3, n2);
3518
- }
3519
- const e2 = s(o2);
3520
- return s(
3521
- F2(e2.one, t$12),
3522
- F2(e2.two, t$12),
3523
- void 0,
3524
- void 0,
3525
- e2.root
3526
- );
3527
- }, lo = (o2, t2) => {
3528
- const n2 = Math.max(y(o2), y(t2)), e2 = Math.max(a$1(o2), a$1(t2)), c3 = Math.min(l$2(o2), l$2(t2)), r2 = Math.min(f$2(o2), f$2(t2));
3529
- return n2 > c3 || e2 > r2 ? W : s({ x: n2, y: e2 }, { x: c3, y: r2 }, void 0, void 0, o2.root);
3530
- }, fo = (o2) => u$1(o2) * w$1(o2), mo = (o2, t2) => {
3531
- const n2 = s(o2);
3532
- return s(
3533
- A$1(n2.one, t2),
3534
- A$1(n2.two, t2),
3535
- void 0,
3536
- void 0,
3537
- n2.root
3538
- );
3539
- }, po = (o2, t2, n2, e2, c3, r2) => {
3540
- const x3 = { x: o2, y: t2 }, m2 = { x: o2 + n2, y: t2 + e2 };
3541
- return c3.x !== r2.x && (c3.x === "center" ? (x3.x -= n2 / 2, m2.x -= n2 / 2) : (x3.x -= n2, m2.x -= n2)), c3.y !== r2.y && (c3.y === "center" ? (x3.y -= e2 / 2, m2.y -= e2 / 2) : (x3.y -= e2, m2.y -= e2)), s(x3, m2, void 0, void 0, r2);
3542
- }, To = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3543
- __proto__: null,
3544
- DECIMAL: U$1,
3545
- ZERO: W,
3546
- area: fo,
3547
- areaIsZero: oo,
3548
- aspect: uo,
3549
- bottom: f$2,
3550
- bottomLeft: no,
3551
- bottomRight: eo,
3552
- box: Y$1,
3553
- center: T2,
3554
- construct: s,
3555
- constructWithAlternateRoot: po,
3556
- contains: J2,
3557
- copy: z$1,
3558
- css: V2,
3559
- dim: B$1,
3560
- dims: A2,
3561
- edgePoints: xo,
3562
- equals: K2,
3563
- height: w$1,
3564
- intersection: lo,
3565
- isBox: ao,
3566
- left: y,
3567
- loc: d$1,
3568
- positionInCenter: yo,
3569
- reRoot: io,
3570
- resize: k$1,
3571
- right: l$2,
3572
- root: ro,
3573
- signedDims: Q2,
3574
- signedHeight: b$1,
3575
- signedWidth: _$1,
3576
- top: a$1,
3577
- topLeft: R$1,
3578
- topRight: to,
3579
- translate: wo,
3580
- truncate: mo,
3581
- width: u$1,
3582
- x: I2,
3583
- xBounds: so,
3584
- xyLoc: g,
3585
- y: L$1,
3586
- yBounds: co
3587
- }, Symbol.toStringTag, { value: "Module" }));
3588
- const r$1 = Ot.object({ signedWidth: Ot.number(), signedHeight: Ot.number() }), c$1 = Ot.union([S$2, r$1, I$5, t$1]), u = { width: 0, height: 0 }, m = { width: 1, height: 1 }, n = (t2, e2) => typeof t2 == "number" ? { width: t2, height: e2 ?? t2 } : Array.isArray(t2) ? { width: t2[0], height: t2[1] } : "x" in t2 ? { width: t2.x, height: t2.y } : "signedWidth" in t2 ? { width: t2.signedWidth, height: t2.signedHeight } : { ...t2 }, d = (t2, e2) => {
3589
- if (e2 == null)
3590
- return false;
3591
- const i2 = n(t2), s2 = n(e2);
3592
- return i2.width === s2.width && i2.height === s2.height;
3593
- }, p = (t2) => {
3594
- const e2 = n(t2);
3595
- return { width: e2.height, height: e2.width };
3596
- }, l$1 = (t2) => {
3597
- const e2 = n(t2);
3598
- return `0 0 ${e2.width} ${e2.height}`;
3599
- }, f$1 = (t2) => {
3600
- const e2 = n(t2);
3601
- return [e2.width, e2.height];
3602
- }, x2 = (t2) => ({
3603
- width: Math.max(...t2.map((e2) => n(e2).width)),
3604
- height: Math.max(...t2.map((e2) => n(e2).height))
3605
- }), b = (t2) => ({
3606
- width: Math.min(...t2.map((e2) => n(e2).width)),
3607
- height: Math.min(...t2.map((e2) => n(e2).height))
3608
- }), w = (t2, e2) => {
3609
- const i2 = n(t2);
3610
- return { width: i2.width * e2, height: i2.height * e2 };
3611
- }, _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3612
- __proto__: null,
3613
- DECIMAL: m,
3614
- ZERO: u,
3615
- construct: n,
3616
- couple: f$1,
3617
- crude: c$1,
3618
- dimensions: S$2,
3619
- equals: d,
3620
- max: x2,
3621
- min: b,
3622
- scale: w,
3623
- signed: r$1,
3624
- svgViewBox: l$1,
3625
- swap: p
3626
- }, Symbol.toStringTag, { value: "Module" }));
3627
- var B2 = Object.defineProperty;
3628
- var R = (r2, t2, e2) => t2 in r2 ? B2(r2, t2, { enumerable: true, configurable: true, writable: true, value: e2 }) : r2[t2] = e2;
3629
- var i = (r2, t2, e2) => (R(r2, typeof t2 != "symbol" ? t2 + "" : t2, e2), e2);
3630
- const Y2 = (r2, t2, e2) => (t2 != null && (r2 = Math.max(r2, t2)), e2 != null && (r2 = Math.min(r2, e2)), r2), j2 = Ot.object({ offset: p$1, scale: p$1 }), z2 = (r2) => (t2, e2, s2, n2) => e2 === "dimension" ? [t2, s2] : [t2, n2 ? s2 - r2 : s2 + r2], D = (r2) => (t2, e2, s2, n2) => [t2, n2 ? s2 / r2 : s2 * r2], L2 = (r2) => (t2, e2, s2) => {
3631
- if (t2 === null)
3632
- return [r2, s2];
3633
- const { lower: n2, upper: o2 } = t2, { lower: u2, upper: p2 } = r2, m2 = o2 - n2, d2 = p2 - u2;
3634
- if (e2 === "dimension")
3635
- return [r2, s2 * (d2 / m2)];
3636
- const g2 = (s2 - n2) * (d2 / m2) + u2;
3637
- return [r2, g2];
3638
- }, N2 = (r2) => (t2, e2, s2) => [r2, s2], O2 = () => (r2, t2, e2) => {
3639
- if (r2 === null)
3640
- throw new Error("cannot invert without bounds");
3641
- if (t2 === "dimension")
3642
- return [r2, e2];
3643
- const { lower: s2, upper: n2 } = r2;
3644
- return [r2, n2 - (e2 - s2)];
3645
- }, U2 = (r2) => (t2, e2, s2) => {
3646
- const { lower: n2, upper: o2 } = r2;
3647
- return s2 = Y2(s2, n2, o2), [t2, s2];
3648
- }, a = class a2 {
3649
- constructor() {
3650
- i(this, "ops", []);
3651
- i(this, "currBounds", null);
3652
- i(this, "currType", null);
3653
- i(this, "reversed", false);
3654
- this.ops = [];
3655
- }
3656
- static translate(t2) {
3657
- return new a2().translate(t2);
3658
- }
3659
- static magnify(t2) {
3660
- return new a2().magnify(t2);
3661
- }
3662
- static scale(t2, e2) {
3663
- return new a2().scale(t2, e2);
3664
- }
3665
- translate(t2) {
3666
- const e2 = this.new(), s2 = z2(t2);
3667
- return s2.type = "translate", e2.ops.push(s2), e2;
3668
- }
3669
- magnify(t2) {
3670
- const e2 = this.new(), s2 = D(t2);
3671
- return s2.type = "magnify", e2.ops.push(s2), e2;
3672
- }
3673
- scale(t2, e2) {
3674
- const s2 = i$4(t2, e2), n2 = this.new(), o2 = L2(s2);
3675
- return o2.type = "scale", n2.ops.push(o2), n2;
3676
- }
3677
- clamp(t2, e2) {
3678
- const s2 = i$4(t2, e2), n2 = this.new(), o2 = U2(s2);
3679
- return o2.type = "clamp", n2.ops.push(o2), n2;
3680
- }
3681
- reBound(t2, e2) {
3682
- const s2 = i$4(t2, e2), n2 = this.new(), o2 = N2(s2);
3683
- return o2.type = "re-bound", n2.ops.push(o2), n2;
3684
- }
3685
- invert() {
3686
- const t2 = O2();
3687
- t2.type = "invert";
3688
- const e2 = this.new();
3689
- return e2.ops.push(t2), e2;
3690
- }
3691
- pos(t2) {
3692
- return this.exec("position", t2);
3693
- }
3694
- dim(t2) {
3695
- return this.exec("dimension", t2);
3696
- }
3697
- new() {
3698
- const t2 = new a2();
3699
- return t2.ops = this.ops.slice(), t2.reversed = this.reversed, t2;
3700
- }
3701
- exec(t2, e2) {
3702
- return this.currBounds = null, this.ops.reduce(
3703
- ([s2, n2], o2) => o2(s2, t2, n2, this.reversed),
3704
- [null, e2]
3705
- )[1];
3706
- }
3707
- reverse() {
3708
- const t2 = this.new();
3709
- t2.ops.reverse();
3710
- const e2 = [];
3711
- return t2.ops.forEach((s2, n2) => {
3712
- if (s2.type === "scale" || e2.some(([u2, p2]) => n2 >= u2 && n2 <= p2))
3713
- return;
3714
- const o2 = t2.ops.findIndex((u2, p2) => u2.type === "scale" && p2 > n2);
3715
- o2 !== -1 && e2.push([n2, o2]);
3716
- }), e2.forEach(([s2, n2]) => {
3717
- const o2 = t2.ops.slice(s2, n2);
3718
- o2.unshift(t2.ops[n2]), t2.ops.splice(s2, n2 - s2 + 1, ...o2);
3719
- }), t2.reversed = !t2.reversed, t2;
3720
- }
3721
- };
3722
- i(a, "IDENTITY", new a());
3723
- let l = a;
3724
- const X2 = (r2) => ({
3725
- scale: {
3726
- x: r2.x.dim(1),
3727
- y: r2.y.dim(1)
3728
- },
3729
- offset: {
3730
- x: r2.x.pos(0),
3731
- y: r2.y.pos(0)
3732
- }
3733
- }), c = class c2 {
3734
- constructor(t2 = new l(), e2 = new l(), s2 = null) {
3735
- i(this, "x");
3736
- i(this, "y");
3737
- i(this, "currRoot");
3738
- this.x = t2, this.y = e2, this.currRoot = s2;
3739
- }
3740
- static translate(t2, e2) {
3741
- return new c2().translate(t2, e2);
3742
- }
3743
- static translateX(t2) {
3744
- return new c2().translateX(t2);
3745
- }
3746
- static translateY(t2) {
3747
- return new c2().translateY(t2);
3748
- }
3749
- static clamp(t2) {
3750
- return new c2().clamp(t2);
3751
- }
3752
- static magnify(t2) {
3753
- return new c2().magnify(t2);
3754
- }
3755
- static scale(t2) {
3756
- return new c2().scale(t2);
3757
- }
3758
- static reBound(t2) {
3759
- return new c2().reBound(t2);
3760
- }
3761
- translate(t2, e2) {
3762
- const s2 = s$1(t2, e2), n2 = this.copy();
3763
- return n2.x = this.x.translate(s2.x), n2.y = this.y.translate(s2.y), n2;
3764
- }
3765
- translateX(t2) {
3766
- const e2 = this.copy();
3767
- return e2.x = this.x.translate(t2), e2;
3768
- }
3769
- translateY(t2) {
3770
- const e2 = this.copy();
3771
- return e2.y = this.y.translate(t2), e2;
3772
- }
3773
- magnify(t2) {
3774
- const e2 = this.copy();
3775
- return e2.x = this.x.magnify(t2.x), e2.y = this.y.magnify(t2.y), e2;
3776
- }
3777
- scale(t2) {
3778
- const e2 = this.copy();
3779
- if (ao(t2)) {
3780
- const s2 = this.currRoot;
3781
- return e2.currRoot = t2.root, s2 != null && !$2(s2, t2.root) && (s2.x !== t2.root.x && (e2.x = e2.x.invert()), s2.y !== t2.root.y && (e2.y = e2.y.invert())), e2.x = e2.x.scale(so(t2)), e2.y = e2.y.scale(co(t2)), e2;
3782
- }
3783
- return e2.x = e2.x.scale(t2.width), e2.y = e2.y.scale(t2.height), e2;
3784
- }
3785
- reBound(t2) {
3786
- const e2 = this.copy();
3787
- return e2.x = this.x.reBound(so(t2)), e2.y = this.y.reBound(co(t2)), e2;
3788
- }
3789
- clamp(t2) {
3790
- const e2 = this.copy();
3791
- return e2.x = this.x.clamp(so(t2)), e2.y = this.y.clamp(co(t2)), e2;
3792
- }
3793
- copy() {
3794
- const t2 = new c2();
3795
- return t2.currRoot = this.currRoot, t2.x = this.x, t2.y = this.y, t2;
3796
- }
3797
- reverse() {
3798
- const t2 = this.copy();
3799
- return t2.x = this.x.reverse(), t2.y = this.y.reverse(), t2;
3800
- }
3801
- pos(t2) {
3802
- return { x: this.x.pos(t2.x), y: this.y.pos(t2.y) };
3803
- }
3804
- box(t2) {
3805
- return s(
3806
- this.pos(t2.one),
3807
- this.pos(t2.two),
3808
- 0,
3809
- 0,
3810
- this.currRoot ?? t2.root
3811
- );
3812
- }
3813
- };
3814
- i(c, "IDENTITY", new c());
3815
- let f = c;
3816
- const k2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3817
- __proto__: null,
3818
- Scale: l,
3819
- XY: f,
3820
- crudeXYTransform: j2,
3821
- xyScaleToTransform: X2
3822
- }, Symbol.toStringTag, { value: "Module" }));
3823
- const hexRegex = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i;
3824
- const hexZ = z$6.string().regex(hexRegex);
3825
- const rgbValueZ = z$6.number().min(0).max(255);
3826
- const alphaZ = z$6.number().min(0).max(1);
3827
- const rgbaZ = z$6.tuple([rgbValueZ, rgbValueZ, rgbValueZ, alphaZ]);
3828
- const rgbZ = z$6.tuple([rgbValueZ, rgbValueZ, rgbValueZ]);
3829
- const crudeColor = z$6.object({ rgba255: rgbaZ });
3830
- const toHex = (color2) => {
3831
- return color2 == null ? void 0 : new Color(color2).hex;
3832
- };
3833
- const cssString = (color2) => {
3834
- if (color2 == null)
3835
- return void 0;
3836
- const res = Color.z.safeParse(color2);
3837
- if (res.success)
3838
- return res.data.rgbaCSS;
3839
- if (typeof color2 === "string")
3840
- return color2;
3841
- throw res.error;
3842
- };
3843
- const _Color = class _Color {
3844
- /**
3845
- * @constructor Creates a new color from the given color value. The color value can be
3846
- * a hex string, an array of RGB or RGBA values, or another color.
3847
- *
3848
- * @param color - The color value to create the color from. If the color value is a
3849
- * string, it must be a valid hex color (with or without the '#') with a hasheless
3850
- * length 6 or 8. If the hex color is 8 characters long, the last twoc haracters are
3851
- * used as the alpha value. If the color value is an array, it must be an array of
3852
- * length 3 or 4, with each value between 0 and 255. If the color value is another
3853
- * color, the color will be copied.
3854
- *
3855
- * @param alpha - An optional alpha value to set. If the color value carries its own
3856
- * alpha value, this value will be ignored. Defaults to 1.
3857
- */
3858
- constructor(color2, alpha = 1) {
3859
- /**
3860
- * @property the color as an RGBA tuple, with each color value between 0 and 255,
3861
- * and the alpha value between 0 and 1.
3862
- */
3863
- __publicField(this, "rgba255");
3864
- if (typeof color2 === "string") {
3865
- this.rgba255 = _Color.fromHex(color2, alpha);
3866
- } else if (Array.isArray(color2)) {
3867
- if (color2.length < 3 || color2.length > 4)
3868
- throw new Error(`Invalid color: [${color2.join(", ")}]`);
3869
- this.rgba255 = color2.length === 3 ? [...color2, alpha ?? 1] : color2;
3870
- } else
3871
- this.rgba255 = color2.rgba255;
3872
- }
3873
- /**
3874
- * @returns true if the given color is semantically equal to this color. Different
3875
- * representations of the same color are considered equal (e.g. hex and rgba).
3876
- */
3877
- equals(other) {
3878
- if (other == null)
3879
- return false;
3880
- const other_ = new _Color(other);
3881
- return this.rgba255.every((v3, i2) => v3 === other_.rgba255[i2]);
3882
- }
3883
- /**
3884
- * @returns the hex representation of the color. If the color has an opacity of 1,
3885
- * the returned hex will be 6 characters long. Otherwise, it will be 8 characters
3886
- * long.
3887
- */
3888
- get hex() {
3889
- const [r2, g2, b2, a3] = this.rgba255;
3890
- return `#${rgbaToHex(r2)}${rgbaToHex(g2)}${rgbaToHex(b2)}${a3 === 1 ? "" : rgbaToHex(a3 * 255)}`;
3891
- }
3892
- /**
3893
- * @returns the color as a CSS RGBA string.
3894
- */
3895
- get rgbaCSS() {
3896
- const [r2, g2, b2, a3] = this.rgba255;
3897
- return `rgba(${r2}, ${g2}, ${b2}, ${a3})`;
3898
- }
3899
- /**
3900
- * @returns the color as a CSS RGB string with no alpha value.
3901
- */
3902
- get rgbCSS() {
3903
- return `rgb(${this.rgbString})`;
3904
- }
3905
- /**
3906
- * @returns the color as an RGB string, with each color value between 0 and 255.
3907
- * @example "255, 255, 255"
3908
- */
3909
- get rgbString() {
3910
- const [r2, g2, b2] = this.rgba255;
3911
- return `${r2}, ${g2}, ${b2}`;
3912
- }
3913
- /**
3914
- * @returns the color as an RGBA tuple, with each color value between 0 and 1,
3915
- * and the alpha value between 0 and 1.
3916
- */
3917
- get rgba1() {
3918
- return [...this.rgb1, this.rgba255[3]];
3919
- }
3920
- get rgb1() {
3921
- return [this.rgba255[0] / 255, this.rgba255[1] / 255, this.rgba255[2] / 255];
3922
- }
3923
- /** @returns the red value of the color, between 0 and 255. */
3924
- get r() {
3925
- return this.rgba255[0];
3926
- }
3927
- /** @returns the green value of the color, between 0 and 255. */
3928
- get g() {
3929
- return this.rgba255[1];
3930
- }
3931
- /** @returns the blue value of the color, between 0 and 255. */
3932
- get b() {
3933
- return this.rgba255[2];
3934
- }
3935
- /** @returns the alpha value of the color, between 0 and 1. */
3936
- get a() {
3937
- return this.rgba255[3];
3938
- }
3939
- /** @returns true if all RGBA values are 0. */
3940
- get isZero() {
3941
- return this.equals(ZERO);
3942
- }
3943
- get hsla() {
3944
- return rgbaToHSLA(this.rgba255);
3945
- }
3946
- /**
3947
- * Creates a new color with the given alpha.
3948
- *
3949
- * @param alpha - The alpha value to set. If the value is greater than 1, it will be
3950
- * divided by 100.
3951
- * @returns A new color with the given alpha.
3952
- */
3953
- setAlpha(alpha) {
3954
- const [r2, g2, b2] = this.rgba255;
3955
- if (alpha > 100)
3956
- throw new Error(`Color opacity must be between 0 and 100, got ${alpha}`);
3957
- if (alpha > 1)
3958
- alpha = alpha / 100;
3959
- return new _Color([r2, g2, b2, alpha]);
3960
- }
3961
- /**
3962
- * @returns the luminance of the color, between 0 and 1.
3963
- */
3964
- get luminance() {
3965
- const [r2, g2, b2] = this.rgb1.map((v3) => {
3966
- return v3 <= 0.03928 ? v3 / 12.92 : ((v3 + 0.055) / 1.055) ** 2.4;
3967
- });
3968
- return Number((0.2126 * r2 + 0.7152 * g2 + 0.0722 * b2).toFixed(3));
3969
- }
3970
- /**
3971
- * @returns the contrast ratio between this color and the given color. The contrast
3972
- * ratio is a number between 1 and 21, where 1 is the lowest contrast and 21 is the
3973
- * highest.
3974
- * @param other
3975
- * @returns
3976
- */
3977
- contrast(other) {
3978
- const other_ = new _Color(other);
3979
- const l1 = this.luminance;
3980
- const l2 = other_.luminance;
3981
- return (Math.max(l1, l2) + 0.5) / (Math.min(l1, l2) + 0.5);
3982
- }
3983
- pickByContrast(...colors) {
3984
- if (colors.length === 0)
3985
- throw new Error("[Color.pickByContrast] - must provide at least one color");
3986
- const [best] = colors.map((c3) => new _Color(c3)).sort((a3, b2) => this.contrast(b2) - this.contrast(a3));
3987
- return best;
3988
- }
3989
- get isDark() {
3990
- return this.luminance < 0.5;
3991
- }
3992
- get isLight() {
3993
- return !this.isDark;
3994
- }
3995
- static fromHex(hex_, alpha = 1) {
3996
- const valid = hexZ.safeParse(hex_);
3997
- if (!valid.success)
3998
- throw new Error(`Invalid hex color: ${hex_}`);
3999
- hex_ = stripHash(hex_);
4000
- return [
4001
- hexToRgba(hex_, 0),
4002
- hexToRgba(hex_, 2),
4003
- hexToRgba(hex_, 4),
4004
- hex_.length === 8 ? hexToRgba(hex_, 6) / 255 : alpha
4005
- ];
4006
- }
4007
- };
4008
- __publicField(_Color, "z", z$6.union([hexZ, rgbaZ, rgbZ, z$6.instanceof(_Color), crudeColor]).transform((v3) => new _Color(v3)));
4009
- let Color = _Color;
4010
- const ZERO = new Color([0, 0, 0, 0]);
4011
- const rgbaToHex = (n2) => Math.floor(n2).toString(16).padStart(2, "0");
4012
- const hexToRgba = (s2, n2) => parseInt(s2.slice(n2, n2 + 2), 16);
4013
- const stripHash = (hex) => hex.startsWith("#") ? hex.slice(1) : hex;
4014
- const fromHSLA = (hsla) => {
4015
- let [h2, s2, l2, a3] = hsla;
4016
- h2 /= 360;
4017
- s2 /= 100;
4018
- l2 /= 100;
4019
- let r2, g2, b2;
4020
- if (s2 === 0) {
4021
- r2 = g2 = b2 = l2;
4022
- } else {
4023
- const q2 = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2;
4024
- const p2 = 2 * l2 - q2;
4025
- r2 = hueToRgb(p2, q2, h2 + 1 / 3);
4026
- g2 = hueToRgb(p2, q2, h2);
4027
- b2 = hueToRgb(p2, q2, h2 - 1 / 3);
4028
- }
4029
- return [Math.round(r2 * 255), Math.round(g2 * 255), Math.round(b2 * 255), a3];
4030
- };
4031
- const hueToRgb = (p2, q2, t2) => {
4032
- if (t2 < 0)
4033
- t2 += 1;
4034
- if (t2 > 1)
4035
- t2 -= 1;
4036
- if (t2 < 1 / 6)
4037
- return p2 + (q2 - p2) * 6 * t2;
4038
- if (t2 < 1 / 2)
4039
- return q2;
4040
- if (t2 < 2 / 3)
4041
- return p2 + (q2 - p2) * (2 / 3 - t2) * 6;
4042
- return p2;
4043
- };
4044
- const rgbaToHSLA = (rgba) => {
4045
- let [r2, g2, b2, a3] = rgba;
4046
- r2 /= 255;
4047
- g2 /= 255;
4048
- b2 /= 255;
4049
- r2 /= 255;
4050
- g2 /= 255;
4051
- b2 /= 255;
4052
- const max = Math.max(r2, g2, b2);
4053
- const min = Math.min(r2, g2, b2);
4054
- let h2;
4055
- let s2;
4056
- let l2 = (max + min) / 2;
4057
- if (max === min) {
4058
- h2 = s2 = 0;
4059
- } else {
4060
- const d2 = max - min;
4061
- s2 = l2 > 0.5 ? d2 / (2 - max - min) : d2 / (max + min);
4062
- if (max === r2) {
4063
- h2 = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0);
4064
- } else if (max === g2) {
4065
- h2 = (b2 - r2) / d2 + 2;
4066
- } else {
4067
- h2 = (r2 - g2) / d2 + 4;
4068
- }
4069
- h2 /= 6;
4070
- }
4071
- h2 *= 360;
4072
- s2 *= 100;
4073
- l2 *= 100;
4074
- return [Math.round(h2), Math.round(s2), Math.round(l2), a3];
4075
- };
4076
- const color = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4077
- __proto__: null,
4078
- Color,
4079
- ZERO,
4080
- cssString,
4081
- fromHSLA,
4082
- toHex
4083
- }, Symbol.toStringTag, { value: "Module" }));
4084
- function r(e2) {
4085
- var t2, f2, n2 = "";
4086
- if ("string" == typeof e2 || "number" == typeof e2)
4087
- n2 += e2;
4088
- else if ("object" == typeof e2)
4089
- if (Array.isArray(e2)) {
4090
- var o2 = e2.length;
4091
- for (t2 = 0; t2 < o2; t2++)
4092
- e2[t2] && (f2 = r(e2[t2])) && (n2 && (n2 += " "), n2 += f2);
4093
- } else
4094
- for (f2 in e2)
4095
- e2[f2] && (n2 && (n2 += " "), n2 += f2);
4096
- return n2;
4097
- }
4098
- function clsx() {
4099
- for (var e2, t2, f2 = 0, n2 = "", o2 = arguments.length; f2 < o2; f2++)
4100
- (e2 = arguments[f2]) && (t2 = r(e2)) && (n2 && (n2 += " "), n2 += t2);
4101
- return n2;
4102
- }
4103
- const CoreBEM = clsx;
4104
- const BLOCK = "-";
4105
- const ELEMENT = "__";
4106
- const MODIFIER = "--";
4107
- const newBEM = (prefix) => {
4108
- const BEM_ = (...args) => CoreBEM(...args);
4109
- BEM_.B = (block) => prefix + BLOCK + block;
4110
- BEM_.E = (element) => prefix + ELEMENT + element;
4111
- BEM_.M = (modifier) => prefix + MODIFIER + modifier;
4112
- BEM_.BM = (block, modifier) => BEM_.B(block) + MODIFIER + modifier;
4113
- BEM_.BE = (block, element) => BEM_.B(block) + ELEMENT + element;
4114
- BEM_.BEM = (block, element, modifier) => BEM_.BE(block, element) + MODIFIER + modifier;
4115
- BEM_.extend = (prefix_) => newBEM(BEM_.B(prefix_));
4116
- BEM_.var = (variable) => MODIFIER + prefix + BLOCK + variable;
4117
- return BEM_;
4118
- };
4119
- class CSSGridBuilder {
4120
- constructor(prefix = "") {
4121
- __publicField(this, "rows", []);
4122
- __publicField(this, "columns", []);
4123
- __publicField(this, "prefix");
4124
- this.prefix = prefix;
4125
- }
4126
- row(start, end, size) {
4127
- const { prefix } = this;
4128
- this.rows.push({ startLabel: prefix + start, endLabel: prefix + end, size });
4129
- return this;
4130
- }
4131
- col(start, end, size) {
4132
- const { prefix } = this;
4133
- this.columns.push({ startLabel: prefix + start, endLabel: prefix + end, size });
4134
- return this;
4135
- }
4136
- build() {
4137
- return {
4138
- display: "grid",
4139
- gridTemplateRows: this.rows.map((r2, i2) => {
4140
- let t2 = i2 === 0 ? "[" : "";
4141
- t2 += `${r2.startLabel}] ${r2.size}${typeof r2.size === "number" ? "px" : ""} [${r2.endLabel}`;
4142
- t2 += i2 === this.rows.length - 1 ? "]" : "";
4143
- return t2;
4144
- }).join(" "),
4145
- gridTemplateColumns: this.columns.map((c3, i2) => {
4146
- let t2 = i2 === 0 ? "[" : "";
4147
- t2 += `${c3.startLabel}] ${c3.size}${typeof c3.size === "number" ? "px" : ""} [${c3.endLabel}`;
4148
- t2 += i2 === this.columns.length - 1 ? "]" : "";
4149
- return t2;
4150
- }).join(" ")
4151
- };
4152
- }
4153
- }
4154
- const applyCSSVars = (element, vars) => Object.entries(vars).forEach(
4155
- ([key, value]) => value != null && element.style.setProperty(key, `${value}`)
4156
- );
4157
- const removeCSSVars = (element, prefix) => Array.from(element.style).forEach((key) => {
4158
- if (key.startsWith(prefix))
4159
- element.style.removeProperty(key);
4160
- });
4161
- const newCSS = (prefix) => {
4162
- const CSS2 = newBEM(prefix);
4163
- CSS2.visible = (visible) => CSS2.M(visible ? "visible" : "hidden");
4164
- CSS2.expanded = (expanded) => CSS2.M(expanded ? "expanded" : "collapsed");
4165
- CSS2.loc = (l2) => CSS2.M(J$1.construct(l2));
4166
- CSS2.disabled = (disabled) => disabled === true && CSS2.M("disabled");
4167
- CSS2.align = (position) => CSS2.M(position);
4168
- CSS2.dir = (dir) => dir != null && CSS2.M(f$4.construct(dir));
4169
- CSS2.size = (size) => typeof size === "string" && CSS2.M(size);
4170
- CSS2.sharp = (sharp) => !(sharp === false) && CSS2.M("sharp");
4171
- CSS2.rounded = (rounded) => !(rounded === false) && CSS2.M("rounded");
4172
- CSS2.bordered = (location2) => {
4173
- if (typeof location2 === "boolean")
4174
- return location2 && CSS2.M("bordered");
4175
- return location2 != null ? CSS2.M("bordered-" + location2) : CSS2.M("bordered");
4176
- };
4177
- CSS2.selected = (selected) => selected && CSS2.M("selected");
4178
- CSS2.editable = (editable) => editable && CSS2.M("editable");
4179
- CSS2.noSelect = CSS2.M("no-select");
4180
- CSS2.noWrap = (noWrap) => noWrap && CSS2.M("no-wrap");
4181
- CSS2.applyVars = applyCSSVars;
4182
- CSS2.removeVars = removeCSSVars;
4183
- CSS2.newGridBuilder = (prefix2) => new CSSGridBuilder(prefix2);
4184
- CSS2.dropRegion = (active) => active && CSS2.B("haul-drop-region");
4185
- CSS2.px = (value) => `${value}px`;
4186
- CSS2.inheritDims = (inherit = true) => inherit && CSS2.M("inherit-dims");
4187
- return CSS2;
4188
- };
4189
- const CSS = newCSS("pluto");
4190
- export {
4191
- $2 as $,
4192
- A$5 as A,
4193
- B$2 as B,
4194
- CSS as C,
4195
- D$3 as D,
4196
- fo as E,
4197
- lo as F,
4198
- A$2 as G,
4199
- J$1 as J,
4200
- Ke as K,
4201
- L$3 as L,
4202
- M$1 as M,
4203
- Ot as O,
4204
- To as T,
4205
- Y2 as Y,
4206
- ZERO as Z,
4207
- _,
4208
- Color as a,
4209
- color as b,
4210
- cssString as c,
4211
- f$4 as d,
4212
- Te as e,
4213
- fromHSLA as f,
4214
- clsx as g,
4215
- k2 as h,
4216
- i$4 as i,
4217
- C$1 as j,
4218
- ke as k,
4219
- d$4 as l,
4220
- k$2 as m,
4221
- newBEM as n,
4222
- c$6 as o,
4223
- t as p,
4224
- q,
4225
- g as r,
4226
- s,
4227
- toHex as t,
4228
- u$5 as u,
4229
- po as v,
4230
- T$1 as w,
4231
- w$1 as x,
4232
- y$1 as y,
4233
- u$1 as z
4234
- };
4235
- //# sourceMappingURL=css-DKKmdhSr.js.map