@synnaxlabs/pluto 0.42.4 → 0.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. package/README.md +3 -3
  2. package/dist/{Center-D0JeI7Ta.js → Center-Bq5L7oy0.js} +2 -2
  3. package/dist/{Center-DuI3XH-Q.cjs → Center-DE_BtCCX.cjs} +1 -1
  4. package/dist/ContextMenu-BC5x7XR5.cjs +1 -0
  5. package/dist/{ContextMenu-BiNr7Gxv.js → ContextMenu-DLM5eLLG.js} +11 -11
  6. package/dist/DateTime-CdNKxVxT.js +17 -0
  7. package/dist/DateTime-DC19AIGq.cjs +1 -0
  8. package/dist/{Divider-DqEkzRIY.js → Divider-CDFHLK9U.js} +213 -215
  9. package/dist/Divider-D74_FAXn.cjs +22 -0
  10. package/dist/Dropdown-BpoU-xVd.cjs +1 -0
  11. package/dist/Dropdown-CQu3yo3v.js +327 -0
  12. package/dist/Haul-D6kpOYBa.js +124 -0
  13. package/dist/Haul-De8axVdi.cjs +1 -0
  14. package/dist/{Item-DSBs9VLu.cjs → Item-CB5c--eX.cjs} +1 -1
  15. package/dist/{Item-C5SQraZM.js → Item-LAMTj0X2.js} +6 -6
  16. package/dist/{Keyboard-Ca7TAAHK.cjs → Keyboard-CiNuYBa3.cjs} +1 -1
  17. package/dist/{Keyboard-Duo41pJL.js → Keyboard-DjeQa-Nx.js} +2 -2
  18. package/dist/{Link-B9ZGvoBU.cjs → Link-CPnT8Xp9.cjs} +1 -1
  19. package/dist/{Link-C9GeoB0w.js → Link-DcudTtgT.js} +1 -1
  20. package/dist/Pack-80N7XB5O.cjs +1 -0
  21. package/dist/Pack-BiS6QIuA.js +52 -0
  22. package/dist/Provider-CLPfWTcl.js +464 -0
  23. package/dist/Provider-s70PZ9lg.cjs +1 -0
  24. package/dist/{Space-DvalhzRj.cjs → Space-ByFmfiTa.cjs} +1 -1
  25. package/dist/{Space-CyTH97CN.js → Space-DxHm2ok7.js} +1 -1
  26. package/dist/{Text-sH_NOelc.js → Text-BiWcjO1i.js} +17 -17
  27. package/dist/{Text-8ps3Uw4T.js → Text-CacHYC7L.js} +4 -4
  28. package/dist/{Text-DkA06TeT.cjs → Text-DTPuORh0.cjs} +1 -1
  29. package/dist/Text-Dw0NDc2A.cjs +4 -0
  30. package/dist/Text-bSIbkBIL.cjs +1 -0
  31. package/dist/{Text-BR4FW9Hy.js → Text-wL3te5S6.js} +125 -122
  32. package/dist/{Toggle-BRuUrO2N.js → Toggle-CbzT5wR_.js} +115 -109
  33. package/dist/Toggle-CpDGR6M6.cjs +1 -0
  34. package/dist/{Video-DWStbcmD.js → Video-Bq_WSdfc.js} +1 -1
  35. package/dist/{Video-DgjuFLiE.cjs → Video-BuzHLiXL.cjs} +1 -1
  36. package/dist/{WithIcon-BhR6nwRh.js → WithIcon-B7VPBqA2.js} +24 -27
  37. package/dist/WithIcon-CCnlO2LC.cjs +1 -0
  38. package/dist/align.cjs +1 -1
  39. package/dist/align.js +1 -1
  40. package/dist/array-CPtP5Oov.js +7 -0
  41. package/dist/array-CZHEGH95.cjs +1 -0
  42. package/dist/button.cjs +1 -1
  43. package/dist/button.js +1 -1
  44. package/dist/color.cjs +1 -1
  45. package/dist/color.js +1 -1
  46. package/dist/css-C7rJrqRi.cjs +38 -0
  47. package/dist/css-DjQu2Qyf.js +12511 -0
  48. package/dist/css.cjs +1 -1
  49. package/dist/css.js +11 -5
  50. package/dist/deep-BRgXTyZn.cjs +1 -0
  51. package/dist/deep-D72Fid_q.js +193 -0
  52. package/dist/{dimensions-By-vgVks.cjs → dimensions-BmlCx5q4.cjs} +1 -1
  53. package/dist/{dimensions-B6qmnzv3.js → dimensions-FnMV2fyj.js} +1 -1
  54. package/dist/dropdown.cjs +1 -1
  55. package/dist/dropdown.js +1 -1
  56. package/dist/{eraser-CK8SwEJa.js → eraser-BJxXs5KS.js} +246 -427
  57. package/dist/eraser-CGxyWj3B.cjs +11 -0
  58. package/dist/ether.cjs +1 -1
  59. package/dist/ether.js +36 -37
  60. package/dist/{external-B1YsdhS4.js → external-5nVYtLDI.js} +122 -123
  61. package/dist/{external-Bl8q9UBF.js → external-69bqTAcN.js} +1837 -1838
  62. package/dist/external-B-B5ro_s.cjs +1 -0
  63. package/dist/{external-BwUa_5Vs.cjs → external-B3Mtbu36.cjs} +1 -1
  64. package/dist/external-BgwS5D0j.cjs +1 -0
  65. package/dist/{external-BnK4UIFe.js → external-Bn3A7Rew.js} +3 -3
  66. package/dist/{external-DmryCcwg.cjs → external-Bojct8Fy.cjs} +1 -1
  67. package/dist/{external-DissGp_3.js → external-C6mmYO7R.js} +8 -8
  68. package/dist/{external-C0X4mXVG.js → external-CVHgvs0C.js} +6 -6
  69. package/dist/external-CnkWbciu.js +399 -0
  70. package/dist/{external-zbKPQ9ls.cjs → external-Cxwmal3D.cjs} +2 -2
  71. package/dist/external-DC1RT1Js.cjs +1 -0
  72. package/dist/external-DOujCKRS.cjs +1 -0
  73. package/dist/{external-BOMdfX8_.js → external-Dm9rg2x7.js} +2 -2
  74. package/dist/external-EvgywGSS.cjs +1 -0
  75. package/dist/external-GjPk23XZ.cjs +1 -0
  76. package/dist/{external-CUgPP-JD.cjs → external-MJ2UMa_L.cjs} +1 -1
  77. package/dist/{external-BDkqwq72.js → external-UeyJ6mPv.js} +7901 -7839
  78. package/dist/{external-B8uaUKhb.cjs → external-V0yO0q2n.cjs} +1 -1
  79. package/dist/{external-DQwznOyH.cjs → external-cDUxSE0v.cjs} +38 -38
  80. package/dist/{external-_8qdWaAg.js → external-cJGWYB3x.js} +2 -2
  81. package/dist/{external-C7yPkamb.js → external-fwvNilmo.js} +8 -8
  82. package/dist/{external-bSUra-q7.js → external-l7imNJRR.js} +26 -26
  83. package/dist/external-upR9Jz-8.js +60 -0
  84. package/dist/{font-CjYcjBiv.js → font-Csp00pQP.js} +2 -2
  85. package/dist/{font-XlUAG1-r.cjs → font-ifUcrCey.cjs} +1 -1
  86. package/dist/fontString-BWECl_1B.cjs +1 -0
  87. package/dist/{fontString-BN1kd1AP.js → fontString-ap-NPnCD.js} +6 -5
  88. package/dist/header.cjs +1 -1
  89. package/dist/header.js +1 -1
  90. package/dist/hooks-B92WH57y.cjs +1 -0
  91. package/dist/{hooks-DjznxGgm.js → hooks-u_TgL0Xi.js} +79 -79
  92. package/dist/index.cjs +7 -7
  93. package/dist/index.js +7378 -7351
  94. package/dist/input.cjs +1 -1
  95. package/dist/input.js +1 -1
  96. package/dist/list.cjs +1 -1
  97. package/dist/list.js +1 -1
  98. package/dist/menu.cjs +1 -1
  99. package/dist/menu.js +1 -1
  100. package/dist/pluto.css +1 -1
  101. package/dist/provider-YWPkhTn6.cjs +154 -0
  102. package/dist/provider-gW90qzEG.js +32024 -0
  103. package/dist/src/aether/aether/aether.d.ts +16 -16
  104. package/dist/src/aether/aether/aether.d.ts.map +1 -1
  105. package/dist/src/aether/aether/aether.spec.d.ts +5 -0
  106. package/dist/src/aether/aether/aether.spec.d.ts.map +1 -0
  107. package/dist/src/aether/main.d.ts +68 -19
  108. package/dist/src/aether/main.d.ts.map +1 -1
  109. package/dist/src/aether/main.spec.d.ts +2 -2
  110. package/dist/src/aether/main.spec.d.ts.map +1 -1
  111. package/dist/src/aether/message.d.ts +24 -14
  112. package/dist/src/aether/message.d.ts.map +1 -1
  113. package/dist/src/alamos/aether/alamos.d.ts +3 -3
  114. package/dist/src/alamos/aether/alamos.d.ts.map +1 -1
  115. package/dist/src/align/Pack.d.ts.map +1 -1
  116. package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
  117. package/dist/src/button/Button.d.ts +1 -2
  118. package/dist/src/button/Button.d.ts.map +1 -1
  119. package/dist/src/button/color.d.ts +2 -2
  120. package/dist/src/button/color.d.ts.map +1 -1
  121. package/dist/src/channel/LinePlot.d.ts +2 -2
  122. package/dist/src/channel/LinePlot.d.ts.map +1 -1
  123. package/dist/src/channel/Select.d.ts.map +1 -1
  124. package/dist/src/color/Provider.d.ts +10 -10
  125. package/dist/src/color/Provider.d.ts.map +1 -1
  126. package/dist/src/css/color.d.ts +2 -2
  127. package/dist/src/css/color.d.ts.map +1 -1
  128. package/dist/src/divider/Divider.d.ts.map +1 -1
  129. package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
  130. package/dist/src/form/Field.d.ts +3 -3
  131. package/dist/src/form/Field.d.ts.map +1 -1
  132. package/dist/src/form/Form.d.ts +42 -28
  133. package/dist/src/form/Form.d.ts.map +1 -1
  134. package/dist/src/form/synced.d.ts +8 -8
  135. package/dist/src/form/synced.d.ts.map +1 -1
  136. package/dist/src/haul/Haul.d.ts +6 -6
  137. package/dist/src/haul/Haul.d.ts.map +1 -1
  138. package/dist/src/hooks/ref.d.ts +2 -2
  139. package/dist/src/hooks/ref.d.ts.map +1 -1
  140. package/dist/src/hooks/useResize.d.ts.map +1 -1
  141. package/dist/src/index.d.ts +0 -1
  142. package/dist/src/index.d.ts.map +1 -1
  143. package/dist/src/input/HelpText.d.ts +4 -4
  144. package/dist/src/input/HelpText.d.ts.map +1 -1
  145. package/dist/src/input/Item.d.ts +1 -1
  146. package/dist/src/input/Item.d.ts.map +1 -1
  147. package/dist/src/input/Text.d.ts +2 -3
  148. package/dist/src/input/Text.d.ts.map +1 -1
  149. package/dist/src/label/Select.d.ts.map +1 -1
  150. package/dist/src/list/Selector.d.ts.map +1 -1
  151. package/dist/src/list/useSelect.d.ts.map +1 -1
  152. package/dist/src/memo/proxyMemo.d.ts.map +1 -1
  153. package/dist/src/memo/useMemoCompare.d.ts +3 -3
  154. package/dist/src/memo/useMemoCompare.d.ts.map +1 -1
  155. package/dist/src/mosaic/types.d.ts +9 -1
  156. package/dist/src/mosaic/types.d.ts.map +1 -1
  157. package/dist/src/note/Note.d.ts +2 -2
  158. package/dist/src/note/Note.d.ts.map +1 -1
  159. package/dist/src/observe/use.d.ts +2 -2
  160. package/dist/src/observe/use.d.ts.map +1 -1
  161. package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
  162. package/dist/src/ranger/Select.d.ts.map +1 -1
  163. package/dist/src/select/Button.d.ts +5 -3
  164. package/dist/src/select/Button.d.ts.map +1 -1
  165. package/dist/src/select/Multiple.d.ts.map +1 -1
  166. package/dist/src/select/Single.d.ts.map +1 -1
  167. package/dist/src/state/state.d.ts +2 -1
  168. package/dist/src/state/state.d.ts.map +1 -1
  169. package/dist/src/status/Indicator.d.ts +8 -0
  170. package/dist/src/status/Indicator.d.ts.map +1 -0
  171. package/dist/src/status/Text.d.ts +2 -2
  172. package/dist/src/status/Text.d.ts.map +1 -1
  173. package/dist/src/status/aether/aggregator.d.ts +14 -17
  174. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  175. package/dist/src/status/aether/types.d.ts +5 -17
  176. package/dist/src/status/aether/types.d.ts.map +1 -1
  177. package/dist/src/status/colors.d.ts +1 -1
  178. package/dist/src/status/colors.d.ts.map +1 -1
  179. package/dist/src/status/external.d.ts +1 -1
  180. package/dist/src/status/external.d.ts.map +1 -1
  181. package/dist/src/synnax/Provider.d.ts +2 -0
  182. package/dist/src/synnax/Provider.d.ts.map +1 -1
  183. package/dist/src/synnax/aether/provider.d.ts +28 -28
  184. package/dist/src/synnax/aether/provider.d.ts.map +1 -1
  185. package/dist/src/table/Table.d.ts +1 -1
  186. package/dist/src/table/Table.d.ts.map +1 -1
  187. package/dist/src/table/aether/Table.d.ts +28 -28
  188. package/dist/src/table/aether/Table.d.ts.map +1 -1
  189. package/dist/src/table/cells/Cells.d.ts +16 -16
  190. package/dist/src/table/cells/Cells.d.ts.map +1 -1
  191. package/dist/src/table/cells/registry.d.ts +2 -2
  192. package/dist/src/table/cells/registry.d.ts.map +1 -1
  193. package/dist/src/tabs/types.d.ts +3 -3
  194. package/dist/src/tabs/types.d.ts.map +1 -1
  195. package/dist/src/telem/aether/context.d.ts +1 -1
  196. package/dist/src/telem/aether/context.d.ts.map +1 -1
  197. package/dist/src/telem/aether/pipeline.d.ts +19 -19
  198. package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
  199. package/dist/src/telem/aether/provider.d.ts +4 -4
  200. package/dist/src/telem/aether/provider.d.ts.map +1 -1
  201. package/dist/src/telem/aether/remote.d.ts +27 -28
  202. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  203. package/dist/src/telem/aether/static.d.ts +13 -13
  204. package/dist/src/telem/aether/static.d.ts.map +1 -1
  205. package/dist/src/telem/aether/telem.d.ts +44 -45
  206. package/dist/src/telem/aether/telem.d.ts.map +1 -1
  207. package/dist/src/telem/aether/transformers.d.ts +44 -47
  208. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  209. package/dist/src/telem/client/cache/cache.d.ts +1 -1
  210. package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
  211. package/dist/src/telem/client/streamer.d.ts.map +1 -1
  212. package/dist/src/telem/control/Chip.d.ts +1 -1
  213. package/dist/src/telem/control/Chip.d.ts.map +1 -1
  214. package/dist/src/telem/control/Controller.d.ts +1 -1
  215. package/dist/src/telem/control/Controller.d.ts.map +1 -1
  216. package/dist/src/telem/control/Indicator.d.ts +1 -1
  217. package/dist/src/telem/control/Indicator.d.ts.map +1 -1
  218. package/dist/src/telem/control/StateProvider.d.ts +1 -3
  219. package/dist/src/telem/control/StateProvider.d.ts.map +1 -1
  220. package/dist/src/telem/control/aether/chip.d.ts +19 -21
  221. package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
  222. package/dist/src/telem/control/aether/controller.d.ts +17 -14
  223. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  224. package/dist/src/telem/control/aether/indicator.d.ts +25 -28
  225. package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
  226. package/dist/src/telem/control/aether/legend.d.ts +13 -13
  227. package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
  228. package/dist/src/telem/control/aether/state.d.ts +8 -8
  229. package/dist/src/telem/control/aether/state.d.ts.map +1 -1
  230. package/dist/src/text/Editable.d.ts.map +1 -1
  231. package/dist/src/text/Text.d.ts +2 -2
  232. package/dist/src/text/Text.d.ts.map +1 -1
  233. package/dist/src/text/WithIcon.d.ts.map +1 -1
  234. package/dist/src/text/core/dimensions.d.ts +24 -0
  235. package/dist/src/text/core/dimensions.d.ts.map +1 -0
  236. package/dist/src/text/core/dimensions.spec.d.ts +2 -0
  237. package/dist/src/text/core/dimensions.spec.d.ts.map +1 -0
  238. package/dist/src/text/core/external.d.ts +3 -0
  239. package/dist/src/text/core/external.d.ts.map +1 -0
  240. package/dist/src/text/core/index.d.ts +1 -1
  241. package/dist/src/text/core/index.d.ts.map +1 -1
  242. package/dist/src/text/core/types.d.ts +5 -5
  243. package/dist/src/text/core/types.d.ts.map +1 -1
  244. package/dist/src/text/external.d.ts +1 -1
  245. package/dist/src/text/external.d.ts.map +1 -1
  246. package/dist/src/theming/aether/provider.d.ts +809 -809
  247. package/dist/src/theming/aether/provider.d.ts.map +1 -1
  248. package/dist/src/theming/core/theme.d.ts +423 -424
  249. package/dist/src/theming/core/theme.d.ts.map +1 -1
  250. package/dist/src/tooltip/Dialog.d.ts.map +1 -1
  251. package/dist/src/tree/Tree.d.ts.map +1 -1
  252. package/dist/src/tree/core.d.ts.map +1 -1
  253. package/dist/src/triggers/triggers.d.ts +1 -1
  254. package/dist/src/triggers/triggers.d.ts.map +1 -1
  255. package/dist/src/util/component.d.ts +1 -1
  256. package/dist/src/util/component.d.ts.map +1 -1
  257. package/dist/src/util/zod.d.ts +2 -2
  258. package/dist/src/util/zod.d.ts.map +1 -1
  259. package/dist/src/viewport/use.d.ts +1 -1
  260. package/dist/src/viewport/use.d.ts.map +1 -1
  261. package/dist/src/vis/axis/axis.d.ts +10 -10
  262. package/dist/src/vis/axis/axis.d.ts.map +1 -1
  263. package/dist/src/vis/axis/ticks.d.ts +2 -2
  264. package/dist/src/vis/axis/ticks.d.ts.map +1 -1
  265. package/dist/src/vis/button/aether/button.d.ts +25 -7
  266. package/dist/src/vis/button/aether/button.d.ts.map +1 -1
  267. package/dist/src/vis/button/use.d.ts +5 -3
  268. package/dist/src/vis/button/use.d.ts.map +1 -1
  269. package/dist/src/vis/canvas/aether/canvas.d.ts +11 -11
  270. package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
  271. package/dist/src/vis/diagram/Diagram.d.ts +3 -2
  272. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  273. package/dist/src/vis/diagram/aether/Diagram.d.ts +32 -32
  274. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  275. package/dist/src/vis/diagram/aether/types.d.ts +19 -45
  276. package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
  277. package/dist/src/vis/diagram/align.d.ts.map +1 -1
  278. package/dist/src/vis/diagram/edge/connector/connector.d.ts +2 -2
  279. package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
  280. package/dist/src/vis/draw2d/canvas.d.ts +1 -4
  281. package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
  282. package/dist/src/vis/draw2d/index.d.ts.map +1 -1
  283. package/dist/src/vis/eraser/aether/eraser.d.ts +11 -11
  284. package/dist/src/vis/eraser/aether/eraser.d.ts.map +1 -1
  285. package/dist/src/vis/eraser/use.d.ts +1 -1
  286. package/dist/src/vis/eraser/use.d.ts.map +1 -1
  287. package/dist/src/vis/grid/grid.d.ts +3 -3
  288. package/dist/src/vis/grid/grid.d.ts.map +1 -1
  289. package/dist/src/vis/legend/Container.d.ts +7 -7
  290. package/dist/src/vis/legend/Container.d.ts.map +1 -1
  291. package/dist/src/vis/light/aether/light.d.ts +7 -8
  292. package/dist/src/vis/light/aether/light.d.ts.map +1 -1
  293. package/dist/src/vis/light/use.d.ts +2 -2
  294. package/dist/src/vis/light/use.d.ts.map +1 -1
  295. package/dist/src/vis/line/Line.d.ts +1 -1
  296. package/dist/src/vis/line/Line.d.ts.map +1 -1
  297. package/dist/src/vis/line/aether/line.d.ts +10 -10
  298. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  299. package/dist/src/vis/lineplot/Axis.d.ts +2 -2
  300. package/dist/src/vis/lineplot/Axis.d.ts.map +1 -1
  301. package/dist/src/vis/lineplot/Line.d.ts +1 -1
  302. package/dist/src/vis/lineplot/Line.d.ts.map +1 -1
  303. package/dist/src/vis/lineplot/LinePlot.d.ts +2 -2
  304. package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
  305. package/dist/src/vis/lineplot/aether/BoundQuerier.d.ts +7 -7
  306. package/dist/src/vis/lineplot/aether/BoundQuerier.d.ts.map +1 -1
  307. package/dist/src/vis/lineplot/aether/LinePlot.d.ts +30 -30
  308. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  309. package/dist/src/vis/lineplot/aether/XAxis.d.ts +64 -64
  310. package/dist/src/vis/lineplot/aether/XAxis.d.ts.map +1 -1
  311. package/dist/src/vis/lineplot/aether/YAxis.d.ts +64 -64
  312. package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +1 -1
  313. package/dist/src/vis/lineplot/aether/axis.d.ts +13 -13
  314. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  315. package/dist/src/vis/lineplot/range/Annotation.d.ts +2 -2
  316. package/dist/src/vis/lineplot/range/Annotation.d.ts.map +1 -1
  317. package/dist/src/vis/lineplot/range/Provider.d.ts +1 -1
  318. package/dist/src/vis/lineplot/range/Provider.d.ts.map +1 -1
  319. package/dist/src/vis/lineplot/range/aether/annotation.d.ts +11 -11
  320. package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
  321. package/dist/src/vis/lineplot/range/aether/provider.d.ts +33 -31
  322. package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
  323. package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts +2 -2
  324. package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts.map +1 -1
  325. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +29 -29
  326. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts.map +1 -1
  327. package/dist/src/vis/lineplot/useBoundQuerier.d.ts.map +1 -1
  328. package/dist/src/vis/log/Log.d.ts +2 -2
  329. package/dist/src/vis/log/Log.d.ts.map +1 -1
  330. package/dist/src/vis/log/aether/Log.d.ts +37 -37
  331. package/dist/src/vis/log/aether/Log.d.ts.map +1 -1
  332. package/dist/src/vis/measure/Measure.d.ts +1 -1
  333. package/dist/src/vis/measure/Measure.d.ts.map +1 -1
  334. package/dist/src/vis/measure/aether/measure.d.ts +36 -36
  335. package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
  336. package/dist/src/vis/render/context.d.ts.map +1 -1
  337. package/dist/src/vis/render/loop.d.ts +10 -15
  338. package/dist/src/vis/render/loop.d.ts.map +1 -1
  339. package/dist/src/vis/rule/Rule.d.ts +2 -2
  340. package/dist/src/vis/rule/Rule.d.ts.map +1 -1
  341. package/dist/src/vis/rule/aether/aether.d.ts +10 -10
  342. package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
  343. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  344. package/dist/src/vis/schematic/Grid.d.ts +6 -3
  345. package/dist/src/vis/schematic/Grid.d.ts.map +1 -1
  346. package/dist/src/vis/schematic/SelectOrientation.d.ts +3 -2
  347. package/dist/src/vis/schematic/SelectOrientation.d.ts.map +1 -1
  348. package/dist/src/vis/schematic/Symbols.d.ts +108 -99
  349. package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
  350. package/dist/src/vis/schematic/external.d.ts +1 -0
  351. package/dist/src/vis/schematic/external.d.ts.map +1 -1
  352. package/dist/src/vis/schematic/primitives/Primitives.d.ts +28 -28
  353. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  354. package/dist/src/vis/schematic/registry.d.ts +5 -5
  355. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  356. package/dist/src/vis/setpoint/aether/setpoint.d.ts +11 -11
  357. package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -1
  358. package/dist/src/vis/setpoint/use.d.ts +2 -2
  359. package/dist/src/vis/setpoint/use.d.ts.map +1 -1
  360. package/dist/src/vis/text/atlas.d.ts +0 -2
  361. package/dist/src/vis/text/atlas.d.ts.map +1 -1
  362. package/dist/src/vis/text/index.d.ts.map +1 -1
  363. package/dist/src/vis/toggle/aether/toggle.d.ts +11 -12
  364. package/dist/src/vis/toggle/aether/toggle.d.ts.map +1 -1
  365. package/dist/src/vis/toggle/use.d.ts +2 -2
  366. package/dist/src/vis/toggle/use.d.ts.map +1 -1
  367. package/dist/src/vis/value/aether/value.d.ts +43 -43
  368. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  369. package/dist/src/vis/value/use.d.ts +15 -15
  370. package/dist/src/vis/value/use.d.ts.map +1 -1
  371. package/dist/state-DAFH2z9y.js +4082 -0
  372. package/dist/state-DwM4WaEw.cjs +27 -0
  373. package/dist/tabs.cjs +1 -1
  374. package/dist/tabs.js +1 -1
  375. package/dist/text.cjs +1 -1
  376. package/dist/text.js +2 -2
  377. package/dist/theming.cjs +1 -1
  378. package/dist/theming.js +2 -2
  379. package/dist/tree.cjs +1 -1
  380. package/dist/tree.js +1 -1
  381. package/dist/triggers.cjs +1 -1
  382. package/dist/triggers.js +1 -1
  383. package/dist/useClickOutside-CUa496t0.cjs +1 -0
  384. package/dist/{useClickOutside-DDCP7Fh-.js → useClickOutside-Dw3KdU3w.js} +22 -22
  385. package/dist/{useDebouncedCallback-DnwYZzjR.cjs → useDebouncedCallback-Bx-HX76R.cjs} +1 -1
  386. package/dist/{useDebouncedCallback-BG4I7mbT.js → useDebouncedCallback-Cvo_HNow.js} +1 -1
  387. package/dist/{useMemoCompare-BViQehyd.js → useMemoCompare-B5QPDK2p.js} +2 -2
  388. package/dist/{useMemoCompare-C2X7Mzx8.cjs → useMemoCompare-BDs2sKw5.cjs} +1 -1
  389. package/dist/useVirtualCursorDragWebKit-CUbBopD6.cjs +1 -0
  390. package/dist/{useVirtualCursorDragWebKit-DTU2tUmp.js → useVirtualCursorDragWebKit-CfxbToxm.js} +7 -7
  391. package/dist/value--TYeJRXm.cjs +55 -0
  392. package/dist/value-dkHk-BsO.js +10797 -0
  393. package/dist/video.cjs +1 -1
  394. package/dist/video.js +1 -1
  395. package/package.json +24 -23
  396. package/dist/ContextMenu-HpMLd1Ht.cjs +0 -1
  397. package/dist/DateTime-BsjSfOY-.cjs +0 -1
  398. package/dist/DateTime-r6hocEmI.js +0 -17
  399. package/dist/Divider-Dut8qPee.cjs +0 -22
  400. package/dist/Dropdown-BSSe1E1e.cjs +0 -1
  401. package/dist/Dropdown-BrFL1eSc.js +0 -327
  402. package/dist/Haul-C6i2oI7z.cjs +0 -1
  403. package/dist/Haul-CEFSvdy9.js +0 -124
  404. package/dist/Pack-BozAEHBp.js +0 -48
  405. package/dist/Pack-DeZUUdJM.cjs +0 -1
  406. package/dist/Provider-B86QO9NT.js +0 -461
  407. package/dist/Provider-Cw0mSr2D.cjs +0 -1
  408. package/dist/Text-C8GBHl-F.cjs +0 -1
  409. package/dist/Text-CMTkSEWx.cjs +0 -4
  410. package/dist/Toggle-C0lZDyeo.cjs +0 -1
  411. package/dist/WithIcon-BgS5shNZ.cjs +0 -1
  412. package/dist/css-9iEiTRNL.cjs +0 -15
  413. package/dist/css-Cnb9DQMD.js +0 -4747
  414. package/dist/deep-BNa3STCp.cjs +0 -1
  415. package/dist/deep-P35D0Sz7.js +0 -112
  416. package/dist/eraser-BkqFgBRY.cjs +0 -11
  417. package/dist/external-B7NxSklQ.js +0 -60
  418. package/dist/external-BA_VOnV-.js +0 -400
  419. package/dist/external-BGBgNbe2.cjs +0 -1
  420. package/dist/external-CTc1n-JC.cjs +0 -1
  421. package/dist/external-CzTBFiv_.cjs +0 -1
  422. package/dist/external-DGJ8YAe-.cjs +0 -1
  423. package/dist/external-DiLZ1dEk.cjs +0 -1
  424. package/dist/external-Dq8-cbf3.cjs +0 -1
  425. package/dist/fontString-Ddza50DF.cjs +0 -1
  426. package/dist/hooks-B5aLaWzS.cjs +0 -1
  427. package/dist/provider-aWtsGnV8.cjs +0 -58
  428. package/dist/provider-r5Ly36FI.js +0 -12854
  429. package/dist/src/aether/aether/aether.spec.spec.d.ts +0 -5
  430. package/dist/src/aether/aether/aether.spec.spec.d.ts.map +0 -1
  431. package/dist/src/select/Modal.d.ts +0 -1
  432. package/dist/src/select/Modal.d.ts.map +0 -1
  433. package/dist/src/status/Circle.d.ts +0 -8
  434. package/dist/src/status/Circle.d.ts.map +0 -1
  435. package/dist/src/text/dimensions.d.ts +0 -4
  436. package/dist/src/text/dimensions.d.ts.map +0 -1
  437. package/dist/src/vis/performance/Performance.d.ts +0 -2
  438. package/dist/src/vis/performance/Performance.d.ts.map +0 -1
  439. package/dist/src/vis/performance/aether/index.d.ts +0 -2
  440. package/dist/src/vis/performance/aether/index.d.ts.map +0 -1
  441. package/dist/src/vis/performance/aether/performance.d.ts +0 -15
  442. package/dist/src/vis/performance/aether/performance.d.ts.map +0 -1
  443. package/dist/src/vis/performance/index.d.ts +0 -2
  444. package/dist/src/vis/performance/index.d.ts.map +0 -1
  445. package/dist/state-CjGemC7S.js +0 -88
  446. package/dist/state-_FFrG5nH.cjs +0 -1
  447. package/dist/toArray-B7nD2CTw.js +0 -5
  448. package/dist/toArray-BvVYuN_b.cjs +0 -1
  449. package/dist/units-CX_coN92.cjs +0 -1
  450. package/dist/units-Ct3Xl5nK.js +0 -11
  451. package/dist/useClickOutside-CSff8yb-.cjs +0 -1
  452. package/dist/useVirtualCursorDragWebKit-DDmXE4RW.cjs +0 -1
  453. package/dist/value-CkzEjG7v.cjs +0 -57
  454. package/dist/value-DIoBc3VU.js +0 -5977
@@ -0,0 +1,154 @@
1
+ "use strict";var ZS=Object.defineProperty;var DS=(e,t,r)=>t in e?ZS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ie=(e,t,r)=>DS(e,typeof t!="symbol"?t+"":t,r);const B=require("./state-DwM4WaEw.cjs"),M=require("./css-C7rJrqRi.cjs"),CS=require("./deep-BRgXTyZn.cjs");var RS=Object.defineProperty,LS=(e,t,r)=>t in e?RS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ts=(e,t,r)=>LS(e,typeof t!="symbol"?t+"":t,r);let MS=class{constructor(t){Ts(this,"sender"),Ts(this,"handlers"),this.sender=t,this.handlers=new Map}handle({data:t}){var r;const i=(r=this.handlers.get(t.type))==null?void 0:r.handler;i==null?console.warn(`No handler for ${t.type}`):i(t.payload)}route(t){const r=BS(t,this.sender),i=new FS(r);return this.handlers.set(t,i),i}};const BS=(e,t)=>(r,i)=>t({type:e,payload:r},i);class FS{constructor(t){Ts(this,"_send"),Ts(this,"handler"),this._send=t,this.handler=null}send(t,r=[]){this._send(t,r)}handle(t){this.handler=t}}const JS=B.object({l0:M.od.colorZ,l1:M.od.colorZ,l2:M.od.colorZ,l3:M.od.colorZ,l4:M.od.colorZ,l5:M.od.colorZ,l6:M.od.colorZ,l7:M.od.colorZ,l8:M.od.colorZ,l9:M.od.colorZ,l10:M.od.colorZ,l11:M.od.colorZ}),kt=(e,t)=>[e[0],e[1],t,e[3]],VS=B.object({m2:M.od.colorZ,m1:M.od.colorZ,z:M.od.colorZ,p1:M.od.colorZ,p2:M.od.colorZ}),es=VS.or(M.od.colorZ.transform(e=>{const t=M.od.hsla(e);return{m2:M.od.fromHSLA(kt(t,40)),m1:M.od.fromHSLA(kt(t,45)),z:e,p1:M.od.fromHSLA(kt(t,55)),p2:M.od.fromHSLA(kt(t,65))}})),ap=B.object({name:B.string(),key:B.string(),colors:B.object({border:M.od.colorZ,primary:es,gray:JS,error:es,secondary:es,warning:es,palettes:B.record(B.string(),M.od.paletteZ),visualization:B.object({palettes:B.record(B.string(),B.array(M.od.colorZ))}).optional().default({palettes:{}}),white:M.od.colorZ,black:M.od.colorZ,text:M.od.colorZ,textInverted:M.od.colorZ,textOnPrimary:M.od.colorZ.optional().default(M.od.ZERO),logo:B.string()}),sizes:B.object({base:B.number(),border:B.object({radius:B.number(),width:B.number(),thickWidth:B.number()}),schematic:B.object({elementStrokeWidth:B.number()})}),typography:B.object({family:B.string(),codeFamily:B.string(),h1:B.specZ,h2:B.specZ,h3:B.specZ,h4:B.specZ,h5:B.specZ,p:B.specZ,small:B.specZ})}).transform(e=>((e.colors.textOnPrimary==null||M.od.isZero(e.colors.textOnPrimary))&&(e.colors.textOnPrimary=M.od.pickByContrast(e.colors.primary.z,e.colors.text,e.colors.textInverted)),e)),WS="'Inter Variable', sans-serif",qS="'Geist Mono', monospace",GS=6,Ar=[357,91,55,1],Pr=[58,100,50,1],YS=["#FEFEFE","#FAFAFA","#F2F2F2","#ECECEC","#E4E4E4","#D1D1D1","#BCBCBC","#ACACAC","#8F8F8F","#4F4F4F","#292929","#050505"],Zr=Object.fromEntries(YS.map((e,t)=>[`l${t}`,e])),KS=()=>typeof window>"u"?!1:window.devicePixelRatio>1,XS=KS(),Bo={key:"synnaxBase",name:"Synnax Base",colors:{primary:{m2:"#041B3D",m1:"#356fc5",z:"#3774D0",p1:"#5E94EE",p2:"#8AB8FF"},secondary:{m2:"#2D8F4E",m1:"#38B261",z:"#50C878",p1:"#73D393",p2:"#96DEAE"},gray:Zr,border:Zr.l4,error:{m2:M.od.fromHSLA(kt(Ar,30)),m1:M.od.fromHSLA(kt(Ar,40)),z:M.od.fromHSLA(Ar),p1:M.od.fromHSLA(kt(Ar,65)),p2:M.od.fromHSLA(kt(Ar,77))},warning:{m2:M.od.fromHSLA(kt(Pr,30)),m1:M.od.fromHSLA(kt(Pr,40)),z:M.od.fromHSLA(Pr),p1:M.od.fromHSLA(kt(Pr,65)),p2:M.od.fromHSLA(kt(Pr,75))},palettes:{recent:{key:"recent",name:"Recent",swatches:[]}},visualization:{palettes:{default:["#DC136C","#20A4F3","#7AC74F","#FFC43D","#FE5F55","#8075FF","#D90429","#f7aef8","#f18f01","#791e94","#279af1","#d9fff5","#ff6b6b","#52ffb8"]}},logo:"url(#synnax-linear-gradient)",white:"#FFFFFF",black:"#000000",text:Zr.l11,textInverted:Zr.l0,textOnPrimary:Zr.l0},sizes:{base:GS,border:{radius:3,width:XS?.5:1,thickWidth:1},schematic:{elementStrokeWidth:2}},typography:{family:WS,codeFamily:qS,h1:{size:6,weight:"500",lineHeight:6*1.5},h2:{size:4.5,weight:"medium",lineHeight:4.5*1.5},h3:{size:3.5,weight:"medium",lineHeight:3.5*1.5},h4:{size:2.6666,weight:"medium",lineHeight:2.6666*1.5},h5:{size:2.333333,weight:450,lineHeight:2.333333*1.5},p:{size:2.1666666666,weight:"regular",lineHeight:2*1.5},small:{size:1.916666,weight:"regular",lineHeight:2.3333333}}},op=Object.freeze({...Bo,key:"synnaxLight",name:"Synnax Light"}),HS=["#020202","#080808","#151515","#242424","#2F2F2F","#3B3B3B","#4A4A4A","#5C5C5C","#767676","#959595","#dadada","#FAFAFA"],Dr=Object.fromEntries(HS.map((e,t)=>[`l${t}`,e])),up=Object.freeze({...Bo,key:"synnaxDark",name:"Synnax Dark",colors:{...Bo.colors,gray:Dr,logo:"var(--pluto-text-color)",border:Dr.l3,text:Dr.l11,textInverted:Dr.l0,textOnPrimary:Dr.l11}}),QS={synnaxDark:up,synnaxLight:op},e0=["tiny","small","medium","large","huge"],t0=B._enum(e0),n0=e=>t0.safeParse(e).success;var r0=Object.defineProperty,i0=(e,t,r)=>t in e?r0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t,r)=>i0(e,typeof t!="symbol"?t+"":t,r);const s0=e=>Array.isArray(e)?e:e==null?[]:[e],D=Object.freeze(Object.defineProperty({__proto__:null,toArray:s0},Symbol.toStringTag,{value:"Module"})),a0=e=>{const t=e.replace(/_[a-z]/g,r=>r[1].toUpperCase());return t.length>1&&t[0]===t[0].toUpperCase()&&t[1]===t[1].toUpperCase()||t.length===0?t:t[0].toLowerCase()+t.slice(1)},cp=e=>{const t=(r,i=Fo)=>{if(typeof r=="string")return e(r);if(Array.isArray(r))return r.map(a=>t(a,i));if(!ho(r))return r;i=c0(i);const n={},s=r;return"toJSON"in s&&typeof s.toJSON=="function"?t(s.toJSON(),i):(Object.keys(s).forEach(a=>{let o=s[a];const u=e(a);i.recursive&&(ho(o)?im(o,i.keepTypesOnRecursion)||(o=t(o,i)):i.recursiveInArray&&rm(o)&&(o=[...o].map(c=>{let l=c;return ho(c)?im(l,i.keepTypesOnRecursion)||(l=t(c,i)):rm(c)&&(l=t({key:c},i).key),l}))),n[u]=o}),n)};return t},lp=cp(a0),o0=e=>e.replace(/([a-z0-9])([A-Z])/g,(t,r,i)=>`${r}_${i.toLowerCase()}`),u0=cp(o0),Fo={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},c0=(e=Fo)=>(e.recursive==null?e=Fo:e.recursiveInArray??(e.recursiveInArray=!1),e),rm=e=>e!=null&&Array.isArray(e),ho=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),im=(e,t)=>(t||[]).some(r=>e instanceof r),dp=e=>e!=null&&typeof e=="object"&&!Array.isArray(e);var l0=Object.defineProperty,d0=(e,t,r)=>t in e?l0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ri=(e,t,r)=>d0(e,typeof t!="symbol"?t+"":t,r);let hp=class{constructor(){ri(this,"contentType","application/json"),ri(this,"decoder"),ri(this,"encoder"),this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const r=JSON.parse(e),i=lp(r);return t!=null?t.parse(i):i}encodeString(e){const t=u0(e);return JSON.stringify(t,(r,i)=>ArrayBuffer.isView(i)?Array.from(i):typeof i=="bigint"?i.toString():i)}},mp=class{constructor(){ri(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t)}decode(e,t){const r=new TextDecoder().decode(e);return this.decodeString(r,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!dp(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),r=[t.join(",")];return e.forEach(i=>{const n=t.map(s=>JSON.stringify(i[s]??""));r.push(n.join(","))}),r.join(`
2
+ `)}decodeString(e,t){const[r,...i]=e.trim().split(`
3
+ `).map(a=>a.trim());if(r.length===0)return t!=null?t.parse({}):{};const n=r.split(",").map(a=>a.trim()),s={};return n.forEach(a=>{s[a]=[]}),i.forEach(a=>{const o=a.split(",").map(u=>u.trim());n.forEach((u,c)=>{const l=this.parseValue(o[c]);l!=null&&s[u].push(l)})}),t!=null?t.parse(s):s}parseValue(e){if(e==null||e.length===0)return null;const t=Number(e);return isNaN(t)?e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e:t}},fp=class{constructor(){ri(this,"contentType","text/plain")}encode(e){if(typeof e!="string")throw new Error("TextCodec.encode payload must be a string");return new TextEncoder().encode(e)}decode(e,t){const r=new TextDecoder().decode(e);return t!=null?t.parse(r):r}};const li=new hp,h0=new mp,m0=new fp,f0=[li],Tn=Object.freeze(Object.defineProperty({__proto__:null,CSVCodec:mp,CSV_CODEC:h0,ENCODERS:f0,JSONCodec:hp,JSON_CODEC:li,TEXT_CODEC:m0,TextCodec:fp},Symbol.toStringTag,{value:"Module"})),p0=e=>[...new Set(e)],v0=(e,t,r=!0)=>{const i=new Map;return e.forEach(n=>{const s=t(n);if(i.has(s)){if(r)return;i.delete(s)}i.set(s,n)}),Array.from(i.values())},sm=Object.freeze(Object.defineProperty({__proto__:null,by:v0,unique:p0},Symbol.toStringTag,{value:"Module"}));var g0=Object.defineProperty,y0=(e,t,r)=>t in e?g0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b0=(e,t,r)=>y0(e,t+"",r);let yr=class{constructor(e){b0(this,"value"),this.value=e}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}};const w0=e=>e!=null&&typeof e=="object"&&"toString"in e,$0=(e,t=!1)=>{const r=w0(e)?"stringer":typeof e;let i;switch(r){case"string":i=(n,s)=>n.localeCompare(s);break;case"stringer":i=(n,s)=>n.toString().localeCompare(s.toString());break;case"number":i=(n,s)=>Number(n)-Number(s);break;case"bigint":i=(n,s)=>BigInt(n)-BigInt(s)>0n?1:-1;break;case"boolean":i=(n,s)=>Number(n)-Number(s);break;case"undefined":i=()=>0;break;default:return console.warn(`sortFunc: unknown type ${r}`),()=>-1}return t?_0(i):i},_0=e=>(t,r)=>e(r,t),oa=0,mo=-1,fo=1,k0=e=>e<oa,I0=e=>e>oa,O0=e=>e===oa;function $(e,t,r){function i(o,u){var c;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(c=o._zod).traits??(c.traits=new Set),o._zod.traits.add(e),t(o,u);for(const l in a.prototype)l in o||Object.defineProperty(o,l,{value:a.prototype[l].bind(o)});o._zod.constr=a,o._zod.def=u}const n=(r==null?void 0:r.Parent)??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function a(o){var u;const c=r!=null&&r.Parent?new s:this;i(c,o),(u=c._zod).deferred??(u.deferred=[]);for(const l of c._zod.deferred)l();return c}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>{var u,c;return r!=null&&r.Parent&&o instanceof r.Parent?!0:(c=(u=o==null?void 0:o._zod)==null?void 0:u.traits)==null?void 0:c.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}const pp=Symbol("zod_brand");let nr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};const Us={};function ht(e){return e&&Object.assign(Us,e),Us}function S0(e){return e}function z0(e){return e}function x0(e){}function N0(e){throw new Error}function T0(e){}function Wu(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function A(e,t="|"){return e.map(r=>K(r)).join(t)}function vp(e,t){return typeof t=="bigint"?t.toString():t}function ua(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Un(e){return e==null}function ca(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function gp(e,t){const r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,s=Number.parseInt(e.toFixed(n).replace(".","")),a=Number.parseInt(t.toFixed(n).replace(".",""));return s%a/10**n}function ae(e,t,r){Object.defineProperty(e,t,{get(){{const i=r();return e[t]=i,i}},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function br(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function U0(e,t){return t?t.reduce((r,i)=>r==null?void 0:r[i],e):e}function E0(e){const t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{const n={};for(let s=0;s<t.length;s++)n[t[s]]=i[s];return n})}function qu(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function Fn(e){return JSON.stringify(e)}function di(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const yp=ua(()=>{if(typeof navigator<"u"&&navigator!=null&&navigator.userAgent.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Es(e){if(di(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(di(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function j0(e){let t=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}const A0=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},js=new Set(["string","number","symbol"]),bp=new Set(["string","number","bigint","boolean","symbol","undefined"]);function En(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lt(e,t,r){const i=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(i._zod.parent=e),i}function S(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function P0(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,s){return t??(t=e()),Reflect.set(t,i,n,s)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function K(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function wp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const $p={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},_p={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function kp(e,t){const r={},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(r[n]=i.shape[n])}return Lt(e,{...e._zod.def,shape:r,checks:[]})}function Ip(e,t){const r={...e._zod.def.shape},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&delete r[n]}return Lt(e,{...e._zod.def,shape:r,checks:[]})}function Op(e,t){const r={...e._zod.def,get shape(){const i={...e._zod.def.shape,...t};return br(this,"shape",i),i},checks:[]};return Lt(e,r)}function Sp(e,t){return Lt(e,{...e._zod.def,get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return br(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function zp(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(n[s]=e?new e({type:"optional",innerType:i[s]}):i[s])}else for(const s in i)n[s]=e?new e({type:"optional",innerType:i[s]}):i[s];return Lt(t,{...t._zod.def,shape:n,checks:[]})}function xp(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(n[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(const s in i)n[s]=new e({type:"nonoptional",innerType:i[s]});return Lt(t,{...t._zod.def,shape:n,checks:[]})}function Xn(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r].continue!==!0)return!0;return!1}function It(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Br(e){return typeof e=="string"?e:e==null?void 0:e.message}function Nt(e,t,r){var i,n,s,a,o,u;const c={...e,path:e.path??[]};if(!e.message){const l=Br((s=(n=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:n.error)==null?void 0:s.call(n,e))??Br((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??Br((o=r.customError)==null?void 0:o.call(r,e))??Br((u=r.localeError)==null?void 0:u.call(r,e))??"Invalid input";c.message=l}return delete c.inst,delete c.continue,t!=null&&t.reportInput||delete c.input,c}function la(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function da(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function rr(...e){const[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function Z0(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}let D0=class{constructor(...e){}};const C0=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:_p,Class:D0,NUMBER_FORMAT_RANGES:$p,aborted:Xn,allowsEval:yp,assert:T0,assertEqual:S0,assertIs:x0,assertNever:N0,assertNotEqual:z0,assignProp:br,cached:ua,cleanEnum:Z0,cleanRegex:ca,clone:Lt,createTransparentProxy:P0,defineLazy:ae,esc:Fn,escapeRegex:En,extend:Op,finalizeIssue:Nt,floatSafeRemainder:gp,getElementAtPath:U0,getEnumValues:Wu,getLengthableOrigin:da,getParsedType:A0,getSizableOrigin:la,isObject:di,isPlainObject:Es,issue:rr,joinValues:A,jsonStringifyReplacer:vp,merge:Sp,normalizeParams:S,nullish:Un,numKeys:j0,omit:Ip,optionalKeys:wp,partial:zp,pick:kp,prefixIssues:It,primitiveTypes:bp,promiseAllObject:E0,propertyKeyTypes:js,randomString:qu,required:xp,stringifyPrimitive:K,unwrapMessage:Br},Symbol.toStringTag,{value:"Module"})),Np=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,vp,2)},enumerable:!0})},Gu=$("$ZodError",Np),Ui=$("$ZodError",Np,{Parent:Error});function Yu(e,t=r=>r.message){const r={},i=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function Ku(e,t){const r=t||function(s){return s.message},i={_errors:[]},n=s=>{for(const a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>n({issues:o}));else if(a.code==="invalid_key")n({issues:a.issues});else if(a.code==="invalid_element")n({issues:a.issues});else if(a.path.length===0)i._errors.push(r(a));else{let o=i,u=0;for(;u<a.path.length;){const c=a.path[u];u===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(r(a))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return n(e),i}function Tp(e,t){const r=t||function(s){return s.message},i={errors:[]},n=(s,a=[])=>{var o,u;for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>n({issues:l},c.path));else if(c.code==="invalid_key")n({issues:c.issues},c.path);else if(c.code==="invalid_element")n({issues:c.issues},c.path);else{const l=[...a,...c.path];if(l.length===0){i.errors.push(r(c));continue}let d=i,m=0;for(;m<l.length;){const y=l[m],k=m===l.length-1;typeof y=="string"?(d.properties??(d.properties={}),(o=d.properties)[y]??(o[y]={errors:[]}),d=d.properties[y]):(d.items??(d.items=[]),(u=d.items)[y]??(u[y]={errors:[]}),d=d.items[y]),k&&d.errors.push(r(c)),m++}}};return n(e),i}function Up(e){const t=[];for(const r of e)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function Ep(e){var t;const r=[],i=[...e.issues].sort((n,s)=>n.path.length-s.path.length);for(const n of i)r.push(`✖ ${n.message}`),(t=n.path)!=null&&t.length&&r.push(` → at ${Up(n.path)}`);return r.join(`
4
+ `)}const Xu=e=>(t,r,i,n)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new nr;if(a.issues.length){const o=new((n==null?void 0:n.Err)??e)(a.issues.map(u=>Nt(u,s,ht())));throw Error.captureStackTrace(o,n==null?void 0:n.callee),o}return a.value},Jo=Xu(Ui),Hu=e=>async(t,r,i,n)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new((n==null?void 0:n.Err)??e)(a.issues.map(u=>Nt(u,s,ht())));throw Error.captureStackTrace(o,n==null?void 0:n.callee),o}return a.value},Vo=Hu(Ui),Qu=e=>(t,r,i)=>{const n=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new nr;return s.issues.length?{success:!1,error:new(e??Gu)(s.issues.map(a=>Nt(a,n,ht())))}:{success:!0,data:s.value}},jp=Qu(Ui),ec=e=>async(t,r,i)=>{const n=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>Nt(a,n,ht())))}:{success:!0,data:s.value}},Ap=ec(Ui),Pp=/^[cC][^\s-]{8,}$/,Zp=/^[0-9a-z]+$/,Dp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Cp=/^[0-9a-vA-V]{20}$/,Rp=/^[A-Za-z0-9]{27}$/,Lp=/^[a-zA-Z0-9_-]{21}$/,Mp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,R0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Bp=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ir=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,L0=ir(4),M0=ir(6),B0=ir(7),Fp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,F0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,J0=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,V0=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,W0=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Jp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Vp(){return new RegExp(Jp,"u")}const Wp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Gp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Kp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tc=/^[A-Za-z0-9_-]*$/,Xp=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,q0=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Hp=/^\+(?:[0-9]){6,14}[0-9]$/,Qp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ev=new RegExp(`^${Qp}$`);function tv(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function nv(e){return new RegExp(`^${tv(e)}$`)}function rv(e){const t=tv({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");const i=`${t}(?:${r.join("|")})`;return new RegExp(`^${Qp}T(?:${i})$`)}const iv=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},sv=/^\d+n?$/,av=/^\d+$/,ov=/^-?\d+(?:\.\d+)?/i,uv=/true|false/i,cv=/null/i,lv=/undefined/i,dv=/^[^A-Z]*$/,hv=/^[^a-z]*$/,mv=Object.freeze(Object.defineProperty({__proto__:null,_emoji:Jp,base64:Kp,base64url:tc,bigint:sv,boolean:uv,browserEmail:W0,cidrv4:Gp,cidrv6:Yp,cuid:Pp,cuid2:Zp,date:ev,datetime:rv,domain:q0,duration:Mp,e164:Hp,email:Fp,emoji:Vp,extendedDuration:R0,guid:Bp,hostname:Xp,html5Email:F0,integer:av,ipv4:Wp,ipv6:qp,ksuid:Rp,lowercase:dv,nanoid:Lp,null:cv,number:ov,rfc5322Email:J0,string:iv,time:nv,ulid:Dp,undefined:lv,unicodeEmail:V0,uppercase:hv,uuid:ir,uuid4:L0,uuid6:M0,uuid7:B0,xid:Cp},Symbol.toStringTag,{value:"Module"})),Be=$("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),fv={number:"number",bigint:"bigint",object:"date"},nc=$("$ZodCheckLessThan",(e,t)=>{Be.init(e,t);const r=fv[typeof t.value];e._zod.onattach.push(i=>{const n=i._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rc=$("$ZodCheckGreaterThan",(e,t)=>{Be.init(e,t);const r=fv[typeof t.value];e._zod.onattach.push(i=>{const n=i._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pv=$("$ZodCheckMultipleOf",(e,t)=>{Be.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):gp(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),vv=$("$ZodCheckNumberFormat",(e,t)=>{var r;Be.init(e,t),t.format=t.format||"float64";const i=(r=t.format)==null?void 0:r.includes("int"),n=i?"int":"number",[s,a]=$p[t.format];e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,u.minimum=s,u.maximum=a,i&&(u.pattern=av)}),e._zod.check=o=>{const u=o.value;if(i){if(!Number.isInteger(u)){o.issues.push({expected:n,format:t.format,code:"invalid_type",input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?o.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):o.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}u<s&&o.issues.push({origin:"number",input:u,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),u>a&&o.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inst:e})}}),gv=$("$ZodCheckBigIntFormat",(e,t)=>{Be.init(e,t);const[r,i]=_p[t.format];e._zod.onattach.push(n=>{const s=n._zod.bag;s.format=t.format,s.minimum=r,s.maximum=i}),e._zod.check=n=>{const s=n.value;s<r&&n.issues.push({origin:"bigint",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>i&&n.issues.push({origin:"bigint",input:s,code:"too_big",maximum:i,inst:e})}}),yv=$("$ZodCheckMaxSize",(e,t)=>{Be.init(e,t),e._zod.when=r=>{const i=r.value;return!Un(i)&&i.size!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;i.size<=t.maximum||r.issues.push({origin:la(i),code:"too_big",maximum:t.maximum,input:i,inst:e,continue:!t.abort})}}),bv=$("$ZodCheckMinSize",(e,t)=>{Be.init(e,t),e._zod.when=r=>{const i=r.value;return!Un(i)&&i.size!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;i.size>=t.minimum||r.issues.push({origin:la(i),code:"too_small",minimum:t.minimum,input:i,inst:e,continue:!t.abort})}}),wv=$("$ZodCheckSizeEquals",(e,t)=>{Be.init(e,t),e._zod.when=r=>{const i=r.value;return!Un(i)&&i.size!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=r=>{const i=r.value,n=i.size;if(n===t.size)return;const s=n>t.size;r.issues.push({origin:la(i),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},input:r.value,inst:e,continue:!t.abort})}}),$v=$("$ZodCheckMaxLength",(e,t)=>{Be.init(e,t),e._zod.when=r=>{const i=r.value;return!Un(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const n=da(i);r.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),_v=$("$ZodCheckMinLength",(e,t)=>{Be.init(e,t),e._zod.when=r=>{const i=r.value;return!Un(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const n=da(i);r.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),kv=$("$ZodCheckLengthEquals",(e,t)=>{Be.init(e,t),e._zod.when=r=>{const i=r.value;return!Un(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,n=i.length;if(n===t.length)return;const s=da(i),a=n>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:r.value,inst:e,continue:!t.abort})}}),Ei=$("$ZodCheckStringFormat",(e,t)=>{var r;Be.init(e,t),e._zod.onattach.push(i=>{const n=i._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),(r=e._zod).check??(r.check=i=>{if(!t.pattern)throw new Error("Not implemented.");t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})})}),Iv=$("$ZodCheckRegex",(e,t)=>{Ei.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ov=$("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=dv),Ei.init(e,t)}),Sv=$("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=hv),Ei.init(e,t)}),zv=$("$ZodCheckIncludes",(e,t)=>{Be.init(e,t);const r=En(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),xv=$("$ZodCheckStartsWith",(e,t)=>{Be.init(e,t);const r=new RegExp(`^${En(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Nv=$("$ZodCheckEndsWith",(e,t)=>{Be.init(e,t);const r=new RegExp(`.*${En(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function am(e,t,r){e.issues.length&&t.issues.push(...It(r,e.issues))}const Tv=$("$ZodCheckProperty",(e,t)=>{Be.init(e,t),e._zod.check=r=>{const i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>am(n,r,t.property));am(i,r,t.property)}}),Uv=$("$ZodCheckMimeType",(e,t)=>{Be.init(e,t);const r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,path:["type"],inst:e})}}),Ev=$("$ZodCheckOverwrite",(e,t)=>{Be.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});let jv=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const t=e.split(`
5
+ `).filter(n=>n),r=Math.min(...t.map(n=>n.length-n.trimStart().length)),i=t.map(n=>n.slice(r)).map(n=>" ".repeat(this.indent*2)+n);for(const n of i)this.content.push(n)}compile(){const e=Function,t=this==null?void 0:this.args,r=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new e(...t,r.join(`
6
+ `))}};const Av={major:4,minor:0,patch:0},J=$("$ZodType",(e,t)=>{var r,i;e??(e={}),ae(e._zod,"id",()=>t.type+"_"+qu(10)),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Av;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const a of s._zod.onattach)a(e);if(n.length===0)(i=e._zod).deferred??(i.deferred=[]),(r=e._zod.deferred)==null||r.push(()=>{e._zod.run=e._zod.parse});else{const s=(a,o,u)=>{let c=Xn(a),l;for(const d of o){if(d._zod.when){if(!d._zod.when(a))continue}else if(c)continue;const m=a.issues.length,y=d._zod.check(a);if(y instanceof Promise&&(u==null?void 0:u.async)===!1)throw new nr;if(l||y instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await y,a.issues.length!==m&&(c||(c=Xn(a,m)))});else{if(a.issues.length===m)continue;c||(c=Xn(a,m))}}return l?l.then(()=>a):a};e._zod.run=(a,o)=>{const u=e._zod.parse(a,o);if(u instanceof Promise){if(o.async===!1)throw new nr;return u.then(c=>s(c,n,o))}return s(u,n,o)}}e["~standard"]={validate:s=>{var a;try{const o=jp(e,s);return o.success?{value:o.data}:{issues:(a=o.error)==null?void 0:a.issues}}catch{return Ap(e,s).then(o=>{var u;return o.success?{value:o.data}:{issues:(u=o.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),ji=$("$ZodString",(e,t)=>{var r;J.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??iv(e._zod.bag),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),we=$("$ZodStringFormat",(e,t)=>{Ei.init(e,t),ji.init(e,t)}),Pv=$("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Bp),we.init(e,t)}),Zv=$("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ir(r))}else t.pattern??(t.pattern=ir());we.init(e,t)}),Dv=$("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fp),we.init(e,t)}),Cv=$("$ZodURL",(e,t)=>{we.init(e,t),e._zod.check=r=>{try{const i=new URL(r.value);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Xp.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}));return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Rv=$("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Vp()),we.init(e,t)}),Lv=$("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Lp),we.init(e,t)}),Mv=$("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Pp),we.init(e,t)}),Bv=$("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Zp),we.init(e,t)}),Fv=$("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Dp),we.init(e,t)}),Jv=$("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Cp),we.init(e,t)}),Vv=$("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Rp),we.init(e,t)}),Wv=$("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=rv(t)),we.init(e,t),e._zod.check}),qv=$("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ev),we.init(e,t)}),Gv=$("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=nv(t)),we.init(e,t),e._zod.check}),Yv=$("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Mp),we.init(e,t)}),Kv=$("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wp),we.init(e,t),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format="ipv4"})}),Xv=$("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=qp),we.init(e,t),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Hv=$("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Gp),we.init(e,t)}),Qv=$("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yp),we.init(e,t),e._zod.check=r=>{const[i,n]=r.value.split("/");try{if(!n)throw new Error;const s=Number(n);if(`${s}`!==n)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function ic(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const eg=$("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Kp),we.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{ic(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function tg(e){if(!tc.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ic(r)}const ng=$("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=tc),we.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{tg(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),rg=$("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Hp),we.init(e,t)});function ig(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r,n=JSON.parse(atob(i));return!("typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const sg=$("$ZodJWT",(e,t)=>{we.init(e,t),e._zod.check=r=>{ig(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),sc=$("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??ov,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),ag=$("$ZodNumber",(e,t)=>{vv.init(e,t),sc.init(e,t)}),ac=$("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=uv,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),oc=$("$ZodBigInt",(e,t)=>{J.init(e,t),e._zod.pattern=sv,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}const{value:n}=r;return typeof n=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:n,inst:e}),r}}),og=$("$ZodBigInt",(e,t)=>{gv.init(e,t),oc.init(e,t)}),ug=$("$ZodSymbol",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),cg=$("$ZodUndefined",(e,t)=>{J.init(e,t),e._zod.pattern=lv,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{const{value:n}=r;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),lg=$("$ZodNull",(e,t)=>{J.init(e,t),e._zod.pattern=cv,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{const{value:n}=r;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),dg=$("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=r=>r}),As=$("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=r=>r}),hg=$("$ZodNever",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),mg=$("$ZodVoid",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),fg=$("$ZodDate",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}const n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function om(e,t,r){e.issues.length&&t.issues.push(...It(r,e.issues)),t.value[r]=e.value}const uc=$("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const s=[];for(let a=0;a<n.length;a++){const o=n[a],u=t.element._zod.run({value:o,issues:[]},i);u instanceof Promise?s.push(u.then(c=>om(c,r,a))):om(u,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function ts(e,t,r){e.issues.length&&t.issues.push(...It(r,e.issues)),t.value[r]=e.value}function um(e,t,r,i){e.issues.length?i[r]===void 0?r in i?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...It(r,e.issues)):e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}const pg=$("$ZodObject",(e,t)=>{J.init(e,t);const r=ua(()=>{const l=Object.keys(t.shape);for(const m of l)if(!(t.shape[m]instanceof J))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);const d=wp(t.shape);return{shape:t.shape,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(d)}});ae(e._zod,"propValues",()=>{const l=t.shape,d={};for(const m in l){const y=l[m]._zod;if(y.values){d[m]??(d[m]=new Set);for(const k of y.values)d[m].add(k)}}return d});const i=l=>{const d=new jv(["shape","payload","ctx"]),{keys:m,optionalKeys:y}=r.value,k=p=>{const g=Fn(p);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};d.write("const input = payload.value;");const v=Object.create(null);for(const p of m)v[p]=qu(15);d.write("const newResult = {}");for(const p of m)if(y.has(p)){const g=v[p];d.write(`const ${g} = ${k(p)};`);const w=Fn(p);d.write(`
7
+ if (${g}.issues.length) {
8
+ if (input[${w}] === undefined) {
9
+ if (${w} in input) {
10
+ newResult[${w}] = undefined;
11
+ }
12
+ } else {
13
+ payload.issues = payload.issues.concat(
14
+ ${g}.issues.map((iss) => ({
15
+ ...iss,
16
+ path: iss.path ? [${w}, ...iss.path] : [${w}],
17
+ }))
18
+ );
19
+ }
20
+ } else if (${g}.value === undefined) {
21
+ if (${w} in input) newResult[${w}] = undefined;
22
+ } else {
23
+ newResult[${w}] = ${g}.value;
24
+ }
25
+ `)}else{const g=v[p];d.write(`const ${g} = ${k(p)};`),d.write(`
26
+ if (${g}.issues.length) payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
27
+ ...iss,
28
+ path: iss.path ? [${Fn(p)}, ...iss.path] : [${Fn(p)}]
29
+ })));`),d.write(`newResult[${Fn(p)}] = ${g}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");const f=d.compile();return(p,g)=>f(l,p,g)};let n;const s=di,a=!Us.jitless,o=a&&yp.value,{catchall:u}=t;let c;e._zod.parse=(l,d)=>{c??(c=r.value);const m=l.value;if(!s(m))return l.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),l;const y=[];if(a&&o&&(d==null?void 0:d.async)===!1&&d.jitless!==!0)n||(n=i(t.shape)),l=n(l,d);else{l.value={};const g=c.shape;for(const w of c.keys){const x=g[w],C=x._zod.run({value:m[w],issues:[]},d),ne=x._zod.optin==="optional"&&x._zod.optout==="optional";C instanceof Promise?y.push(C.then(ke=>ne?um(ke,l,w,m):ts(ke,l,w))):ne?um(C,l,w,m):ts(C,l,w)}}if(!u)return y.length?Promise.all(y).then(()=>l):l;const k=[],v=c.keySet,f=u._zod,p=f.def.type;for(const g of Object.keys(m)){if(v.has(g))continue;if(p==="never"){k.push(g);continue}const w=f.run({value:m[g],issues:[]},d);w instanceof Promise?y.push(w.then(x=>ts(x,l,g))):ts(w,l,g)}return k.length&&l.issues.push({code:"unrecognized_keys",keys:k,input:m,inst:e}),y.length?Promise.all(y).then(()=>l):l}});function cm(e,t,r,i){for(const n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(s=>Nt(s,i,ht())))}),t}const cc=$("$ZodUnion",(e,t)=>{J.init(e,t),ae(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ae(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>ca(i.source)).join("|")})$`)}}),e._zod.parse=(r,i)=>{let n=!1;const s=[];for(const a of t.options){const o=a._zod.run({value:r.value,issues:[]},i);if(o instanceof Promise)s.push(o),n=!0;else{if(o.issues.length===0)return o;s.push(o)}}return n?Promise.all(s).then(a=>cm(a,r,e,i)):cm(s,r,e,i)}}),vg=$("$ZodDiscriminatedUnion",(e,t)=>{cc.init(e,t);const r=e._zod.parse;ae(e._zod,"propValues",()=>{const n={};for(const s of t.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[o,u]of Object.entries(a)){n[o]||(n[o]=new Set);for(const c of u)n[o].add(c)}}return n});const i=ua(()=>{const n=t.options,s=new Map;for(const a of n){const o=a._zod.propValues[t.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const u of o){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,a)}}return s});e._zod.parse=(n,s)=>{const a=n.value;if(!di(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;const o=i.value.get(a==null?void 0:a[t.discriminator]);return o?o._zod.run(n,s):t.unionFallback?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[t.discriminator],inst:e}),n)}}),gg=$("$ZodIntersection",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r,s=t.left._zod.run({value:n,issues:[]},i),a=t.right._zod.run({value:n,issues:[]},i);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([o,u])=>lm(r,o,u)):lm(r,s,a)}});function Wo(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Es(e)&&Es(t)){const r=Object.keys(t),i=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};for(const s of i){const a=Wo(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};n[s]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i<e.length;i++){const n=e[i],s=t[i],a=Wo(n,s);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function lm(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Xn(e))return e;const i=Wo(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const ha=$("$ZodTuple",(e,t)=>{J.init(e,t);const r=t.items,i=r.length-[...r].reverse().findIndex(n=>n._zod.optin!=="optional");e._zod.parse=(n,s)=>{const a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];const o=[];if(!t.rest){const c=a.length>r.length,l=a.length<i-1;if(c||l)return n.issues.push({input:a,inst:e,origin:"array",...c?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),n}let u=-1;for(const c of r){if(u++,u>=a.length&&u>=i)continue;const l=c._zod.run({value:a[u],issues:[]},s);l instanceof Promise?o.push(l.then(d=>ns(d,n,u))):ns(l,n,u)}if(t.rest){const c=a.slice(r.length);for(const l of c){u++;const d=t.rest._zod.run({value:l,issues:[]},s);d instanceof Promise?o.push(d.then(m=>ns(m,n,u))):ns(d,n,u)}}return o.length?Promise.all(o).then(()=>n):n}});function ns(e,t,r){e.issues.length&&t.issues.push(...It(r,e.issues)),t.value[r]=e.value}const yg=$("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Es(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;const s=[];if(t.keyType._zod.values){const a=t.keyType._zod.values;r.value={};for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const c=t.valueType._zod.run({value:n[u],issues:[]},i);c instanceof Promise?s.push(c.then(l=>{l.issues.length&&r.issues.push(...It(u,l.issues)),r.value[u]=l.value})):(c.issues.length&&r.issues.push(...It(u,c.issues)),r.value[u]=c.value)}let o;for(const u in n)a.has(u)||(o=o??[],o.push(u));o&&o.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:o})}else{r.value={};for(const a of Reflect.ownKeys(n)){if(a==="__proto__")continue;const o=t.keyType._zod.run({value:a,issues:[]},i);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map(c=>Nt(c,i,ht())),input:a,path:[a],inst:e}),r.value[o.value]=o.value;continue}const u=t.valueType._zod.run({value:n[a],issues:[]},i);u instanceof Promise?s.push(u.then(c=>{c.issues.length&&r.issues.push(...It(a,c.issues)),r.value[o.value]=c.value})):(u.issues.length&&r.issues.push(...It(a,u.issues)),r.value[o.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),bg=$("$ZodMap",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;const s=[];r.value=new Map;for(const[a,o]of n){const u=t.keyType._zod.run({value:a,issues:[]},i),c=t.valueType._zod.run({value:o,issues:[]},i);u instanceof Promise||c instanceof Promise?s.push(Promise.all([u,c]).then(([l,d])=>{dm(l,d,r,a,n,e,i)})):dm(u,c,r,a,n,e,i)}return s.length?Promise.all(s).then(()=>r):r}});function dm(e,t,r,i,n,s,a){e.issues.length&&(js.has(typeof i)?r.issues.push(...It(i,e.issues)):r.issues.push({origin:"map",code:"invalid_key",input:n,inst:s,issues:e.issues.map(o=>Nt(o,a,ht()))})),t.issues.length&&(js.has(typeof i)?r.issues.push(...It(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:i,issues:t.issues.map(o=>Nt(o,a,ht()))})),r.value.set(e.value,t.value)}const wg=$("$ZodSet",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;const s=[];r.value=new Set;for(const a of n){const o=t.valueType._zod.run({value:a,issues:[]},i);o instanceof Promise?s.push(o.then(u=>hm(u,r))):hm(o,r)}return s.length?Promise.all(s).then(()=>r):r}});function hm(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const $g=$("$ZodEnum",(e,t)=>{J.init(e,t);const r=Wu(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(i=>js.has(typeof i)).map(i=>typeof i=="string"?En(i):i.toString()).join("|")})$`),e._zod.parse=(i,n)=>{const s=i.value;return e._zod.values.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:e}),i}}),_g=$("$ZodLiteral",(e,t)=>{J.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?En(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const n=r.value;return e._zod.values.has(n)||r.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),r}}),kg=$("$ZodFile",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),lc=$("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{const n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new nr;return r.value=n,r}}),Ig=$("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ae(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${ca(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>r.value===void 0?r:t.innerType._zod.run(r,i)}),Og=$("$ZodNullable",(e,t)=>{J.init(e,t),ae(e._zod,"optin",()=>t.innerType._zod.optin),ae(e._zod,"optout",()=>t.innerType._zod.optout),ae(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${ca(r.source)}|null)$`):void 0}),ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),Sg=$("$ZodDefault",(e,t)=>{J.init(e,t),e._zod.optin="optional",ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>mm(s,t)):mm(n,t)}});function mm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zg=$("$ZodPrefault",(e,t)=>{J.init(e,t),e._zod.optin="optional",ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),xg=$("$ZodNonOptional",(e,t)=>{J.init(e,t),ae(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>fm(s,e)):fm(n,e)}});function fm(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ng=$("$ZodSuccess",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>(r.value=s.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),Tg=$("$ZodCatch",(e,t)=>{J.init(e,t),ae(e._zod,"optin",()=>t.innerType._zod.optin),ae(e._zod,"optout",()=>t.innerType._zod.optout),ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>Nt(a,i,ht()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(s=>Nt(s,i,ht()))},input:r.value}),r.issues=[]),r)}}),Ug=$("$ZodNaN",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),dc=$("$ZodPipe",(e,t)=>{J.init(e,t),ae(e._zod,"values",()=>t.in._zod.values),ae(e._zod,"optin",()=>t.in._zod.optin),ae(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,i)=>{const n=t.in._zod.run(r,i);return n instanceof Promise?n.then(s=>pm(s,t,i)):pm(n,t,i)}});function pm(e,t,r){return Xn(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const Eg=$("$ZodReadonly",(e,t)=>{J.init(e,t),ae(e._zod,"propValues",()=>t.innerType._zod.propValues),ae(e._zod,"optin",()=>t.innerType._zod.optin),ae(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(vm):vm(n)}});function vm(e){return e.value=Object.freeze(e.value),e}const jg=$("$ZodTemplateLiteral",(e,t)=>{J.init(e,t);const r=[];for(const i of t.parts)if(i instanceof J){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);const n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);const s=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(s,a))}else if(i===null||bp.has(typeof i))r.push(En(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"template_literal",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),i)}),Ag=$("$ZodPromise",(e,t)=>{J.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},i))}),Pg=$("$ZodLazy",(e,t)=>{J.init(e,t),ae(e._zod,"innerType",()=>t.getter()),ae(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),ae(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),ae(e._zod,"optin",()=>e._zod.innerType._zod.optin),ae(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),Zg=$("$ZodCustom",(e,t)=>{Be.init(e,t),J.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(s=>gm(s,r,i,e));gm(n,r,i,e)}});function gm(e,t,r,i){if(!e){const n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push(rr(n))}}const Dg=Symbol("ZodOutput"),Cg=Symbol("ZodInput");let hc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];if(this._map.set(e,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function mc(){return new hc}const fn=mc();function Rg(e,t){return new e({type:"string",...S(t)})}function Lg(e,t){return new e({type:"string",coerce:!0,...S(t)})}function fc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...S(t)})}function Ps(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...S(t)})}function pc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...S(t)})}function vc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(t)})}function gc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(t)})}function yc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(t)})}function bc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...S(t)})}function wc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...S(t)})}function $c(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(t)})}function _c(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...S(t)})}function kc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(t)})}function Ic(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...S(t)})}function Oc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...S(t)})}function Sc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(t)})}function zc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(t)})}function xc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(t)})}function Nc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(t)})}function Tc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(t)})}function Uc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...S(t)})}function Ec(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...S(t)})}function jc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...S(t)})}function Ac(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...S(t)})}const Mg={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Bg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(t)})}function Fg(e,t){return new e({type:"string",format:"date",check:"string_format",...S(t)})}function Jg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...S(t)})}function Vg(e,t){return new e({type:"string",format:"duration",check:"string_format",...S(t)})}function Wg(e,t){return new e({type:"number",checks:[],...S(t)})}function qg(e,t){return new e({type:"number",coerce:!0,checks:[],...S(t)})}function Gg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...S(t)})}function Yg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...S(t)})}function Kg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...S(t)})}function Xg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...S(t)})}function Hg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...S(t)})}function Qg(e,t){return new e({type:"boolean",...S(t)})}function ey(e,t){return new e({type:"boolean",coerce:!0,...S(t)})}function ty(e,t){return new e({type:"bigint",...S(t)})}function ny(e,t){return new e({type:"bigint",coerce:!0,...S(t)})}function ry(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(t)})}function iy(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(t)})}function sy(e,t){return new e({type:"symbol",...S(t)})}function ay(e,t){return new e({type:"undefined",...S(t)})}function oy(e,t){return new e({type:"null",...S(t)})}function uy(e){return new e({type:"any"})}function Zs(e){return new e({type:"unknown"})}function cy(e,t){return new e({type:"never",...S(t)})}function ly(e,t){return new e({type:"void",...S(t)})}function dy(e,t){return new e({type:"date",...S(t)})}function hy(e,t){return new e({type:"date",coerce:!0,...S(t)})}function my(e,t){return new e({type:"nan",...S(t)})}function bn(e,t){return new nc({check:"less_than",...S(t),value:e,inclusive:!1})}function zt(e,t){return new nc({check:"less_than",...S(t),value:e,inclusive:!0})}function wn(e,t){return new rc({check:"greater_than",...S(t),value:e,inclusive:!1})}function bt(e,t){return new rc({check:"greater_than",...S(t),value:e,inclusive:!0})}function fy(e){return wn(0,e)}function py(e){return bn(0,e)}function vy(e){return zt(0,e)}function gy(e){return bt(0,e)}function hi(e,t){return new pv({check:"multiple_of",...S(t),value:e})}function ma(e,t){return new yv({check:"max_size",...S(t),maximum:e})}function mi(e,t){return new bv({check:"min_size",...S(t),minimum:e})}function Pc(e,t){return new wv({check:"size_equals",...S(t),size:e})}function fa(e,t){return new $v({check:"max_length",...S(t),maximum:e})}function sr(e,t){return new _v({check:"min_length",...S(t),minimum:e})}function pa(e,t){return new kv({check:"length_equals",...S(t),length:e})}function Zc(e,t){return new Iv({check:"string_format",format:"regex",...S(t),pattern:e})}function Dc(e){return new Ov({check:"string_format",format:"lowercase",...S(e)})}function Cc(e){return new Sv({check:"string_format",format:"uppercase",...S(e)})}function Rc(e,t){return new zv({check:"string_format",format:"includes",...S(t),includes:e})}function Lc(e,t){return new xv({check:"string_format",format:"starts_with",...S(t),prefix:e})}function Mc(e,t){return new Nv({check:"string_format",format:"ends_with",...S(t),suffix:e})}function yy(e,t,r){return new Tv({check:"property",property:e,schema:t,...S(r)})}function Bc(e,t){return new Uv({check:"mime_type",mime:e,...S(t)})}function jn(e){return new Ev({check:"overwrite",tx:e})}function Fc(e){return jn(t=>t.normalize(e))}function Jc(){return jn(e=>e.trim())}function Vc(){return jn(e=>e.toLowerCase())}function Wc(){return jn(e=>e.toUpperCase())}function qc(e,t,r){return new e({type:"array",element:t,...S(r)})}function G0(e,t,r){return new e({type:"union",options:t,...S(r)})}function Y0(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...S(i)})}function K0(e,t,r){return new e({type:"intersection",left:t,right:r})}function by(e,t,r,i){const n=r instanceof J,s=n?i:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...S(s)})}function X0(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...S(i)})}function H0(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...S(i)})}function Q0(e,t,r){return new e({type:"set",valueType:t,...S(r)})}function ez(e,t,r){const i=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:i,...S(r)})}function tz(e,t,r){return new e({type:"enum",entries:t,...S(r)})}function nz(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...S(r)})}function wy(e,t){return new e({type:"file",...S(t)})}function rz(e,t){return new e({type:"transform",transform:t})}function iz(e,t){return new e({type:"optional",innerType:t})}function sz(e,t){return new e({type:"nullable",innerType:t})}function az(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():r}})}function oz(e,t,r){return new e({type:"nonoptional",innerType:t,...S(r)})}function uz(e,t){return new e({type:"success",innerType:t})}function cz(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function lz(e,t,r){return new e({type:"pipe",in:t,out:r})}function dz(e,t){return new e({type:"readonly",innerType:t})}function hz(e,t,r){return new e({type:"template_literal",parts:t,...S(r)})}function mz(e,t){return new e({type:"lazy",getter:t})}function fz(e,t){return new e({type:"promise",innerType:t})}function $y(e,t,r){const i=S(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function _y(e,t,r){return new e({type:"custom",check:"custom",fn:t,...S(r)})}function ky(e,t){const{case:r,error:i,truthy:n,falsy:s}=S(t);let a=n??["true","1","yes","on","y","enabled"],o=s??["false","0","no","off","n","disabled"];r!=="sensitive"&&(a=a.map(f=>typeof f=="string"?f.toLowerCase():f),o=o.map(f=>typeof f=="string"?f.toLowerCase():f));const u=new Set(a),c=new Set(o),l=e.Pipe??dc,d=e.Boolean??ac,m=e.String??ji,y=e.Transform??lc,k=new y({type:"transform",transform:(f,p)=>{let g=f;return r!=="sensitive"&&(g=g.toLowerCase()),u.has(g)?!0:c.has(g)?!1:(p.issues.push({code:"invalid_value",expected:"stringbool",values:[...u,...c],input:p.value,inst:k}),{})},error:i}),v=new l({type:"pipe",in:new m({type:"string",error:i}),out:k,error:i});return new l({type:"pipe",in:v,out:new d({type:"boolean",error:i}),error:i})}const Gc=$("ZodISODateTime",(e,t)=>{Wv.init(e,t),Oe.init(e,t)});function Iy(e){return Bg(Gc,e)}const Yc=$("ZodISODate",(e,t)=>{qv.init(e,t),Oe.init(e,t)});function Oy(e){return Fg(Yc,e)}const Kc=$("ZodISOTime",(e,t)=>{Gv.init(e,t),Oe.init(e,t)});function Sy(e){return Jg(Kc,e)}const Xc=$("ZodISODuration",(e,t)=>{Yv.init(e,t),Oe.init(e,t)});function zy(e){return Vg(Xc,e)}const pz=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:Yc,ZodISODateTime:Gc,ZodISODuration:Xc,ZodISOTime:Kc,date:Oy,datetime:Iy,duration:zy,time:Sy},Symbol.toStringTag,{value:"Module"})),xy=(e,t)=>{Gu.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Ku(e,r)},flatten:{value:r=>Yu(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},vz=$("ZodError",xy),Ai=$("ZodError",xy,{Parent:Error}),Ny=Xu(Ai),Ty=Hu(Ai),Uy=Qu(Ai),Ey=ec(Ai),ee=$("ZodType",(e,t)=>(J.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>Lt(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.parse=(r,i)=>Ny(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Uy(e,r,i),e.parseAsync=async(r,i)=>Ty(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Ey(e,r,i),e.spa=e.safeParseAsync,e.refine=(r,i)=>e.check(pb(r,i)),e.superRefine=r=>e.check(vb(r)),e.overwrite=r=>e.check(jn(r)),e.optional=()=>Cs(e),e.nullable=()=>Rs(e),e.nullish=()=>Cs(Rs(e)),e.nonoptional=r=>rb(e,r),e.array=()=>Zi(e),e.or=r=>Ee([e,r]),e.and=r=>Vy(e,r),e.transform=r=>Ls(e,_l(r)),e.default=r=>eb(e,r),e.prefault=r=>nb(e,r),e.catch=r=>ab(e,r),e.pipe=r=>Ls(e,r),e.readonly=()=>cb(e),e.describe=r=>{const i=e.clone();return fn.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){var r;return(r=fn.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return fn.get(e);const i=e.clone();return fn.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Hc=$("_ZodString",(e,t)=>{ji.init(e,t),ee.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(Zc(...i)),e.includes=(...i)=>e.check(Rc(...i)),e.startsWith=(...i)=>e.check(Lc(...i)),e.endsWith=(...i)=>e.check(Mc(...i)),e.min=(...i)=>e.check(sr(...i)),e.max=(...i)=>e.check(fa(...i)),e.length=(...i)=>e.check(pa(...i)),e.nonempty=(...i)=>e.check(sr(1,...i)),e.lowercase=i=>e.check(Dc(i)),e.uppercase=i=>e.check(Cc(i)),e.trim=()=>e.check(Jc()),e.normalize=(...i)=>e.check(Fc(...i)),e.toLowerCase=()=>e.check(Vc()),e.toUpperCase=()=>e.check(Wc())}),va=$("ZodString",(e,t)=>{ji.init(e,t),Hc.init(e,t),e.email=r=>e.check(fc(Qc,r)),e.url=r=>e.check(bc(el,r)),e.jwt=r=>e.check(Ac(pl,r)),e.emoji=r=>e.check(wc(tl,r)),e.guid=r=>e.check(Ps(Ds,r)),e.uuid=r=>e.check(pc(Vt,r)),e.uuidv4=r=>e.check(vc(Vt,r)),e.uuidv6=r=>e.check(gc(Vt,r)),e.uuidv7=r=>e.check(yc(Vt,r)),e.nanoid=r=>e.check($c(nl,r)),e.guid=r=>e.check(Ps(Ds,r)),e.cuid=r=>e.check(_c(rl,r)),e.cuid2=r=>e.check(kc(il,r)),e.ulid=r=>e.check(Ic(sl,r)),e.base64=r=>e.check(Uc(hl,r)),e.base64url=r=>e.check(Ec(ml,r)),e.xid=r=>e.check(Oc(al,r)),e.ksuid=r=>e.check(Sc(ol,r)),e.ipv4=r=>e.check(zc(ul,r)),e.ipv6=r=>e.check(xc(cl,r)),e.cidrv4=r=>e.check(Nc(ll,r)),e.cidrv6=r=>e.check(Tc(dl,r)),e.e164=r=>e.check(jc(fl,r)),e.datetime=r=>e.check(Iy(r)),e.date=r=>e.check(Oy(r)),e.time=r=>e.check(Sy(r)),e.duration=r=>e.check(zy(r))});function Te(e){return Rg(va,e)}const Oe=$("ZodStringFormat",(e,t)=>{we.init(e,t),Hc.init(e,t)}),Qc=$("ZodEmail",(e,t)=>{Dv.init(e,t),Oe.init(e,t)});function gz(e){return fc(Qc,e)}const Ds=$("ZodGUID",(e,t)=>{Pv.init(e,t),Oe.init(e,t)});function yz(e){return Ps(Ds,e)}const Vt=$("ZodUUID",(e,t)=>{Zv.init(e,t),Oe.init(e,t)});function bz(e){return pc(Vt,e)}function wz(e){return vc(Vt,e)}function $z(e){return gc(Vt,e)}function _z(e){return yc(Vt,e)}const el=$("ZodURL",(e,t)=>{Cv.init(e,t),Oe.init(e,t)});function kz(e){return bc(el,e)}const tl=$("ZodEmoji",(e,t)=>{Rv.init(e,t),Oe.init(e,t)});function Iz(e){return wc(tl,e)}const nl=$("ZodNanoID",(e,t)=>{Lv.init(e,t),Oe.init(e,t)});function Oz(e){return $c(nl,e)}const rl=$("ZodCUID",(e,t)=>{Mv.init(e,t),Oe.init(e,t)});function Sz(e){return _c(rl,e)}const il=$("ZodCUID2",(e,t)=>{Bv.init(e,t),Oe.init(e,t)});function zz(e){return kc(il,e)}const sl=$("ZodULID",(e,t)=>{Fv.init(e,t),Oe.init(e,t)});function xz(e){return Ic(sl,e)}const al=$("ZodXID",(e,t)=>{Jv.init(e,t),Oe.init(e,t)});function Nz(e){return Oc(al,e)}const ol=$("ZodKSUID",(e,t)=>{Vv.init(e,t),Oe.init(e,t)});function Tz(e){return Sc(ol,e)}const ul=$("ZodIPv4",(e,t)=>{Kv.init(e,t),Oe.init(e,t)});function Uz(e){return zc(ul,e)}const cl=$("ZodIPv6",(e,t)=>{Xv.init(e,t),Oe.init(e,t)});function Ez(e){return xc(cl,e)}const ll=$("ZodCIDRv4",(e,t)=>{Hv.init(e,t),Oe.init(e,t)});function jz(e){return Nc(ll,e)}const dl=$("ZodCIDRv6",(e,t)=>{Qv.init(e,t),Oe.init(e,t)});function Az(e){return Tc(dl,e)}const hl=$("ZodBase64",(e,t)=>{eg.init(e,t),Oe.init(e,t)});function Pz(e){return Uc(hl,e)}const ml=$("ZodBase64URL",(e,t)=>{ng.init(e,t),Oe.init(e,t)});function Zz(e){return Ec(ml,e)}const fl=$("ZodE164",(e,t)=>{rg.init(e,t),Oe.init(e,t)});function Dz(e){return jc(fl,e)}const pl=$("ZodJWT",(e,t)=>{sg.init(e,t),Oe.init(e,t)});function Cz(e){return Ac(pl,e)}const ga=$("ZodNumber",(e,t)=>{sc.init(e,t),ee.init(e,t),e.gt=(i,n)=>e.check(wn(i,n)),e.gte=(i,n)=>e.check(bt(i,n)),e.min=(i,n)=>e.check(bt(i,n)),e.lt=(i,n)=>e.check(bn(i,n)),e.lte=(i,n)=>e.check(zt(i,n)),e.max=(i,n)=>e.check(zt(i,n)),e.int=i=>e.check(qo(i)),e.safe=i=>e.check(qo(i)),e.positive=i=>e.check(wn(0,i)),e.nonnegative=i=>e.check(bt(0,i)),e.negative=i=>e.check(bn(0,i)),e.nonpositive=i=>e.check(zt(0,i)),e.multipleOf=(i,n)=>e.check(hi(i,n)),e.step=(i,n)=>e.check(hi(i,n)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function H(e){return Wg(ga,e)}const wr=$("ZodNumberFormat",(e,t)=>{ag.init(e,t),ga.init(e,t)});function qo(e){return Gg(wr,e)}function Rz(e){return Yg(wr,e)}function Lz(e){return Kg(wr,e)}function Mz(e){return Xg(wr,e)}function Bz(e){return Hg(wr,e)}const ya=$("ZodBoolean",(e,t)=>{ac.init(e,t),ee.init(e,t)});function vl(e){return Qg(ya,e)}const ba=$("ZodBigInt",(e,t)=>{oc.init(e,t),ee.init(e,t),e.gte=(i,n)=>e.check(bt(i,n)),e.min=(i,n)=>e.check(bt(i,n)),e.gt=(i,n)=>e.check(wn(i,n)),e.gte=(i,n)=>e.check(bt(i,n)),e.min=(i,n)=>e.check(bt(i,n)),e.lt=(i,n)=>e.check(bn(i,n)),e.lte=(i,n)=>e.check(zt(i,n)),e.max=(i,n)=>e.check(zt(i,n)),e.positive=i=>e.check(wn(BigInt(0),i)),e.negative=i=>e.check(bn(BigInt(0),i)),e.nonpositive=i=>e.check(zt(BigInt(0),i)),e.nonnegative=i=>e.check(bt(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(hi(i,n));const r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function $n(e){return ty(ba,e)}const gl=$("ZodBigIntFormat",(e,t)=>{og.init(e,t),ba.init(e,t)});function Fz(e){return ry(gl,e)}function Jz(e){return iy(gl,e)}const jy=$("ZodSymbol",(e,t)=>{ug.init(e,t),ee.init(e,t)});function Ay(e){return sy(jy,e)}const Py=$("ZodUndefined",(e,t)=>{cg.init(e,t),ee.init(e,t)});function Zy(e){return ay(Py,e)}const Dy=$("ZodNull",(e,t)=>{lg.init(e,t),ee.init(e,t)});function Pi(e){return oy(Dy,e)}const Cy=$("ZodAny",(e,t)=>{dg.init(e,t),ee.init(e,t)});function Vz(){return uy(Cy)}const Ry=$("ZodUnknown",(e,t)=>{As.init(e,t),ee.init(e,t)});function ar(){return Zs(Ry)}const Ly=$("ZodNever",(e,t)=>{hg.init(e,t),ee.init(e,t)});function wa(e){return cy(Ly,e)}const My=$("ZodVoid",(e,t)=>{mg.init(e,t),ee.init(e,t)});function Wz(e){return ly(My,e)}const yl=$("ZodDate",(e,t)=>{fg.init(e,t),ee.init(e,t),e.min=(i,n)=>e.check(bt(i,n)),e.max=(i,n)=>e.check(zt(i,n));const r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function qz(e){return dy(yl,e)}const By=$("ZodArray",(e,t)=>{uc.init(e,t),ee.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(sr(r,i)),e.nonempty=r=>e.check(sr(1,r)),e.max=(r,i)=>e.check(fa(r,i)),e.length=(r,i)=>e.check(pa(r,i)),e.unwrap=()=>e.element});function Zi(e,t){return qc(By,e,t)}function Gz(e){const t=e._zod.def.shape;return Ky(Object.keys(t))}const $a=$("ZodObject",(e,t)=>{pg.init(e,t),ee.init(e,t),ae(e,"shape",()=>Object.fromEntries(Object.entries(e._zod.def.shape))),e.keyof=()=>Qe(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ar()}),e.loose=()=>e.clone({...e._zod.def,catchall:ar()}),e.strict=()=>e.clone({...e._zod.def,catchall:wa()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Op(e,r),e.merge=r=>Sp(e,r),e.pick=r=>kp(e,r),e.omit=r=>Ip(e,r),e.partial=(...r)=>zp(kl,e,r[0]),e.required=(...r)=>xp(Il,e,r[0])});function ie(e,t){const r={type:"object",get shape(){return br(this,"shape",{...e}),this.shape},...S(t)};return new $a(r)}function Yz(e,t){return new $a({type:"object",get shape(){return br(this,"shape",{...e}),this.shape},catchall:wa(),...S(t)})}function Kz(e,t){return new $a({type:"object",get shape(){return br(this,"shape",{...e}),this.shape},catchall:ar(),...S(t)})}const bl=$("ZodUnion",(e,t)=>{cc.init(e,t),ee.init(e,t),e.options=t.options});function Ee(e,t){return new bl({type:"union",options:e,...S(t)})}const Fy=$("ZodDiscriminatedUnion",(e,t)=>{bl.init(e,t),vg.init(e,t)});function Xz(e,t,r){return new Fy({type:"union",options:t,discriminator:e,...S(r)})}const Jy=$("ZodIntersection",(e,t)=>{gg.init(e,t),ee.init(e,t)});function Vy(e,t){return new Jy({type:"intersection",left:e,right:t})}const Wy=$("ZodTuple",(e,t)=>{ha.init(e,t),ee.init(e,t),e.rest=r=>e.clone({...e._zod.def,rest:r})});function $r(e,t,r){const i=t instanceof J,n=i?r:t,s=i?t:null;return new Wy({type:"tuple",items:e,rest:s,...S(n)})}const wl=$("ZodRecord",(e,t)=>{yg.init(e,t),ee.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function _a(e,t,r){return new wl({type:"record",keyType:e,valueType:t,...S(r)})}function Hz(e,t,r){return new wl({type:"record",keyType:Ee([e,wa()]),valueType:t,...S(r)})}const qy=$("ZodMap",(e,t)=>{bg.init(e,t),ee.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Qz(e,t,r){return new qy({type:"map",keyType:e,valueType:t,...S(r)})}const Gy=$("ZodSet",(e,t)=>{wg.init(e,t),ee.init(e,t),e.min=(...r)=>e.check(mi(...r)),e.nonempty=r=>e.check(mi(1,r)),e.max=(...r)=>e.check(ma(...r)),e.size=(...r)=>e.check(Pc(...r))});function ex(e,t){return new Gy({type:"set",valueType:e,...S(t)})}const fi=$("ZodEnum",(e,t)=>{$g.init(e,t),ee.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{const s={};for(const a of i)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new fi({...t,checks:[],...S(n),entries:s})},e.exclude=(i,n)=>{const s={...t.entries};for(const a of i)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new fi({...t,checks:[],...S(n),entries:s})}});function Qe(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new fi({type:"enum",entries:r,...S(t)})}function tx(e,t){return new fi({type:"enum",entries:e,...S(t)})}const Yy=$("ZodLiteral",(e,t)=>{_g.init(e,t),ee.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ky(e,t){return new Yy({type:"literal",values:Array.isArray(e)?e:[e],...S(t)})}const Xy=$("ZodFile",(e,t)=>{kg.init(e,t),ee.init(e,t),e.min=(r,i)=>e.check(mi(r,i)),e.max=(r,i)=>e.check(ma(r,i)),e.mime=(r,i)=>e.check(Bc(Array.isArray(r)?r:[r],i))});function nx(e){return wy(Xy,e)}const $l=$("ZodTransform",(e,t)=>{lc.init(e,t),ee.init(e,t),e._zod.parse=(r,i)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(rr(s,r.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),a.continue??(a.continue=!0),r.issues.push(rr(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r)):(r.value=n,r)}});function _l(e){return new $l({type:"transform",transform:e})}const kl=$("ZodOptional",(e,t)=>{Ig.init(e,t),ee.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Cs(e){return new kl({type:"optional",innerType:e})}const Hy=$("ZodNullable",(e,t)=>{Og.init(e,t),ee.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Rs(e){return new Hy({type:"nullable",innerType:e})}function rx(e){return Cs(Rs(e))}const Qy=$("ZodDefault",(e,t)=>{Sg.init(e,t),ee.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eb(e,t){return new Qy({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const tb=$("ZodPrefault",(e,t)=>{zg.init(e,t),ee.init(e,t),e.unwrap=()=>e._zod.def.innerType});function nb(e,t){return new tb({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Il=$("ZodNonOptional",(e,t)=>{xg.init(e,t),ee.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rb(e,t){return new Il({type:"nonoptional",innerType:e,...S(t)})}const ib=$("ZodSuccess",(e,t)=>{Ng.init(e,t),ee.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ix(e){return new ib({type:"success",innerType:e})}const sb=$("ZodCatch",(e,t)=>{Tg.init(e,t),ee.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ab(e,t){return new sb({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ob=$("ZodNaN",(e,t)=>{Ug.init(e,t),ee.init(e,t)});function sx(e){return my(ob,e)}const Ol=$("ZodPipe",(e,t)=>{dc.init(e,t),ee.init(e,t),e.in=t.in,e.out=t.out});function Ls(e,t){return new Ol({type:"pipe",in:e,out:t})}const ub=$("ZodReadonly",(e,t)=>{Eg.init(e,t),ee.init(e,t)});function cb(e){return new ub({type:"readonly",innerType:e})}const lb=$("ZodTemplateLiteral",(e,t)=>{jg.init(e,t),ee.init(e,t)});function ax(e,t){return new lb({type:"template_literal",parts:e,...S(t)})}const db=$("ZodLazy",(e,t)=>{Pg.init(e,t),ee.init(e,t),e.unwrap=()=>e._zod.def.getter()});function hb(e){return new db({type:"lazy",getter:e})}const mb=$("ZodPromise",(e,t)=>{Ag.init(e,t),ee.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ox(e){return new mb({type:"promise",innerType:e})}const ka=$("ZodCustom",(e,t)=>{Zg.init(e,t),ee.init(e,t)});function fb(e,t){const r=new Be({check:"custom",...S(t)});return r._zod.check=e,r}function ux(e,t){return $y(ka,e??(()=>!0),t)}function pb(e,t={}){return _y(ka,e,t)}function vb(e,t){const r=fb(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(rr(n,i.value,r._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),i.issues.push(rr(s))}},e(i.value,i)),t);return r}function ye(e,t={error:`Input not instance of ${e.name}`}){const r=new ka({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...S(t)});return r._zod.bag.Class=e,r}const cx=(...e)=>ky({Pipe:Ol,Boolean:ya,String:va,Transform:$l},...e);function lx(e){const t=hb(()=>Ee([Te(e),H(),vl(),Pi(),Zi(t),_a(Te(),t)]));return t}function dx(e,t){return Ls(_l(e),t)}const Ia=$r([H(),H()]);$r([$n(),$n()]);const gb=ie({width:H(),height:H()}),hx=ie({signedWidth:H(),signedHeight:H()}),mx=["width","height"];Qe(mx);const fx=["start","center","end"],px=["signedWidth","signedHeight"];Qe(px);const Ms=ie({x:H(),y:H()}),vx=ie({clientX:H(),clientY:H()}),gx=["x","y"],yb=Qe(gx),bb=["top","right","bottom","left"];Qe(bb);const yx=["left","right"],wb=Qe(yx),bx=["top","bottom"],$b=Qe(bx),_b=["center"],ym=Qe(_b),wx=[...bb,..._b],kb=Qe(wx);Qe(fx);const $x=["first","last"];Qe($x);const _x=ie({lower:H(),upper:H()}),kx=ie({lower:$n(),upper:$n()});Ee([_x,Ia]);Ee([kx,Ia]);Qe([...yb.options,...kb.options]);Ee([yb,kb,ye(String)]);const _r=e=>typeof e=="bigint"||e instanceof BigInt,po=(e,t)=>_r(e)?e.valueOf()-BigInt(t.valueOf().valueOf()):e.valueOf()-Number(t.valueOf()),Ix=(e,t)=>_r(e)?e.valueOf()+BigInt(t.valueOf().valueOf()):e+Number(t.valueOf()),bm=(e,t)=>_r(e)?e===BigInt(t.valueOf().valueOf()):e===Number(t.valueOf()),Ox=(e,t)=>_r(e)?e.valueOf()<BigInt(t.valueOf())?e:BigInt(t.valueOf()):e.valueOf()<Number(t.valueOf())?e:Number(t.valueOf()),Sx=e=>_r(e)||e instanceof BigInt?e.valueOf()<0n?-e:e:e.valueOf()<0?-e:e,Mn=(e,t)=>_r(e)?e.valueOf()*BigInt(t.valueOf()):e.valueOf()*Number(t.valueOf()),st=(e,t,r)=>{const i={};if(typeof t=="object"&&(r=t,t=void 0),r={makeValid:!0,...r},typeof e=="number"||typeof e=="bigint")t!=null?(i.lower=e,i.upper=t):(i.lower=typeof e=="bigint"?0n:0,i.upper=e);else if(Array.isArray(e)){if(e.length!==2)throw new Error("bounds: expected array of length 2");[i.lower,i.upper]=e}else i.lower=e.lower,i.upper=e.upper;return r!=null&&r.makeValid?zx(i):i},zx=e=>e.lower>e.upper?{lower:e.upper,upper:e.lower}:e,wm=(e,t)=>{const r=st(e);return t<r.lower?r.lower:t>=r.upper?r.upper-(typeof r.upper=="number"?1:1n):t},rs=(e,t)=>{const r=st(e);if(typeof t=="number"||typeof t=="bigint")return t>=r.lower&&t<r.upper;const i=st(t);return i.lower>=r.lower&&i.upper<=r.upper},xx=e=>({lower:Math.min(...e.map(t=>st(t).lower)),upper:Math.max(...e.map(t=>st(t).upper))}),Nx=(e,t,r)=>{const i=e.map(o=>st(o)),n=r>0?1:r<0?-1:0;if(n===0)return t;let s=r,a=t;for(;bm(s,0)===!1;){const o=i.findIndex(u=>n>0?a>=u.lower&&a<u.upper:a>u.lower&&a<=u.upper);if(o!==-1){const u=i[o];let c;if(n>0?c=po(u.upper,a):c=po(a,u.lower),c>0){const l=Ox(Sx(s),c);if(a=Ix(a,n>0?l:-l),s=po(s,n>0?l:-l),bm(s,0))return a;continue}}if(n>0){const u=i.filter(c=>c.lower>a);if(u.length>0)a=u[0].lower;else return a}else{const u=i.filter(c=>c.upper<a);if(u.length>0)a=u[u.length-1].upper;else return a}}return a},Tx=(e,t,r)=>{const i=e.map(a=>st(a));if(t===r)return typeof t=="bigint"?0n:0;const n=t<r?st([t,r]):st([r,t]);let s=typeof t=="bigint"?0n:0;for(const a of i){const o=a.lower>n.lower?a.lower:n.lower,u=a.upper<n.upper?a.upper:n.upper;if(o<u){const c=u-o;s=s+c}}return s};ie({x:wb.or(ym),y:$b.or(ym)});const Ux=ie({x:wb,y:$b}),Ex=Object.freeze({x:"left",y:"top"}),jx=(e,t)=>e.x===t.x&&e.y===t.y,$m=Ee([H(),Ms,Ia,gb,hx,vx]),Ax=(e,t)=>{if(typeof e=="string"){if(t===void 0)throw new Error("The y coordinate must be given.");return e==="x"?{x:t,y:0}:{x:0,y:t}}return typeof e=="number"?{x:e,y:t??e}:Array.isArray(e)?{x:e[0],y:e[1]}:"signedWidth"in e?{x:e.signedWidth,y:e.signedHeight}:"clientX"in e?{x:e.clientX,y:e.clientY}:"width"in e?{x:e.width,y:e.height}:{x:e.x,y:e.y}},_m=Object.freeze({x:0,y:0}),is=Ee([H(),Te()]);ie({top:is,left:is,width:is,height:is});ie({left:H(),top:H(),right:H(),bottom:H()});ie({one:Ms,two:Ms,root:Ux});const Sl=(e,t,r=0,i=0,n)=>{const s={one:{..._m},two:{..._m},root:n??Ex};if(typeof e=="number"){if(typeof t!="number")throw new Error("Box constructor called with invalid arguments");return s.one={x:e,y:t},s.two={x:s.one.x+r,y:s.one.y+i},s}return"one"in e&&"two"in e&&"root"in e?{...e,root:n??e.root}:("getBoundingClientRect"in e&&(e=e.getBoundingClientRect()),"left"in e?(s.one={x:e.left,y:e.top},s.two={x:e.right,y:e.bottom},s):(s.one=e,t==null?s.two={x:s.one.x+r,y:s.one.y+i}:typeof t=="number"?s.two={x:s.one.x+t,y:s.one.y+r}:"width"in t?s.two={x:s.one.x+t.width,y:s.one.y+t.height}:"signedWidth"in t?s.two={x:s.one.x+t.signedWidth,y:s.one.y+t.signedHeight}:s.two=t,s))},vo=e=>{const t=Sl(e);return{lower:t.one.x,upper:t.two.x}},go=e=>{const t=Sl(e);return{lower:t.one.y,upper:t.two.y}},Px=e=>typeof e!="object"||e==null?!1:"one"in e&&"two"in e&&"root"in e,Zx=ie({signedWidth:H(),signedHeight:H()});Ee([gb,Zx,Ms,Ia]);var Dx=Object.defineProperty,Cx=(e,t,r)=>t in e?Dx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wt=(e,t,r)=>Cx(e,typeof t!="symbol"?t+"":t,r);const Rx=(e,t,r)=>t!==void 0&&e<t?t:r!==void 0&&e>r?r:e;ie({offset:$m,scale:$m});ie({offset:H(),scale:H()});const Lx=e=>(t,r,i,n)=>r==="dimension"?[t,i]:[t,n?i-e:i+e],Mx=e=>(t,r,i,n)=>[t,n?i/e:i*e],Bx=e=>(t,r,i)=>{if(t===null)return[e,i];const{lower:n,upper:s}=t,{lower:a,upper:o}=e,u=s-n,c=o-a;if(r==="dimension")return[e,i*(c/u)];const l=(i-n)*(c/u)+a;return[e,l]},Fx=e=>(t,r,i)=>[e,i],Jx=()=>(e,t,r)=>{if(e===null)throw new Error("cannot invert without bounds");if(t==="dimension")return[e,r];const{lower:i,upper:n}=e;return[e,n-(r-i)]},Vx=e=>(t,r,i)=>{const{lower:n,upper:s}=e;return i=Rx(i,n,s),[t,i]},Go=class Fr{constructor(){Wt(this,"ops",[]),Wt(this,"currBounds",null),Wt(this,"currType",null),Wt(this,"reversed",!1),this.ops=[]}static translate(t){return new Fr().translate(t)}static magnify(t){return new Fr().magnify(t)}static scale(t,r){return new Fr().scale(t,r)}translate(t){const r=this.new(),i=Lx(t);return i.type="translate",r.ops.push(i),r}magnify(t){const r=this.new(),i=Mx(t);return i.type="magnify",r.ops.push(i),r}scale(t,r){const i=st(t,r),n=this.new(),s=Bx(i);return s.type="scale",n.ops.push(s),n}clamp(t,r){const i=st(t,r),n=this.new(),s=Vx(i);return s.type="clamp",n.ops.push(s),n}reBound(t,r){const i=st(t,r),n=this.new(),s=Fx(i);return s.type="re-bound",n.ops.push(s),n}invert(){const t=Jx();t.type="invert";const r=this.new();return r.ops.push(t),r}pos(t){return this.exec("position",t)}dim(t){return this.exec("dimension",t)}new(){const t=new Fr;return t.ops=this.ops.slice(),t.reversed=this.reversed,t}exec(t,r){return this.currBounds=null,this.ops.reduce(([i,n],s)=>s(i,t,n,this.reversed),[null,r])[1]}reverse(){const t=this.new();t.ops.reverse();const r=[];return t.ops.forEach((i,n)=>{if(i.type==="scale"||r.some(([a,o])=>n>=a&&n<=o))return;const s=t.ops.findIndex((a,o)=>a.type==="scale"&&o>n);s!==-1&&r.push([n,s])}),r.forEach(([i,n])=>{const s=t.ops.slice(i,n);s.unshift(t.ops[n]),t.ops.splice(i,n-i+1,...s)}),t.reversed=!t.reversed,t}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}};Wt(Go,"IDENTITY",new Go);let km=Go;const Im=class Ft{constructor(t=new km,r=new km,i=null){Wt(this,"x"),Wt(this,"y"),Wt(this,"currRoot"),this.x=t,this.y=r,this.currRoot=i}static translate(t,r){return new Ft().translate(t,r)}static translateX(t){return new Ft().translateX(t)}static translateY(t){return new Ft().translateY(t)}static clamp(t){return new Ft().clamp(t)}static magnify(t){return new Ft().magnify(t)}static scale(t){return new Ft().scale(t)}static reBound(t){return new Ft().reBound(t)}translate(t,r){const i=Ax(t,r),n=this.copy();return n.x=this.x.translate(i.x),n.y=this.y.translate(i.y),n}translateX(t){const r=this.copy();return r.x=this.x.translate(t),r}translateY(t){const r=this.copy();return r.y=this.y.translate(t),r}magnify(t){const r=this.copy();return r.x=this.x.magnify(t.x),r.y=this.y.magnify(t.y),r}scale(t){const r=this.copy();if(Px(t)){const i=this.currRoot;return r.currRoot=t.root,i!=null&&!jx(i,t.root)&&(i.x!==t.root.x&&(r.x=r.x.invert()),i.y!==t.root.y&&(r.y=r.y.invert())),r.x=r.x.scale(vo(t)),r.y=r.y.scale(go(t)),r}return r.x=r.x.scale(t.width),r.y=r.y.scale(t.height),r}reBound(t){const r=this.copy();return r.x=this.x.reBound(vo(t)),r.y=this.y.reBound(go(t)),r}clamp(t){const r=this.copy();return r.x=this.x.clamp(vo(t)),r.y=this.y.clamp(go(t)),r}copy(){const t=new Ft;return t.currRoot=this.currRoot,t.x=this.x,t.y=this.y,t}reverse(){const t=this.copy();return t.x=this.x.reverse(),t.y=this.y.reverse(),t}pos(t){return{x:this.x.pos(t.x),y:this.y.pos(t.y)}}dim(t){return{x:this.x.dim(t.x),y:this.y.dim(t.y)}}box(t){return Sl(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}};Wt(Im,"IDENTITY",new Im);var Wx=Object.defineProperty,qx=(e,t,r)=>t in e?Wx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,N=(e,t,r)=>qx(e,typeof t!="symbol"?t+"":t,r);function Gx(e){return Lg(va,e)}function Yx(e){return qg(ga,e)}function Kx(e){return ey(ya,e)}function Ib(e){return ny(ba,e)}function Xx(e){return hy(yl,e)}const Hx=Object.freeze(Object.defineProperty({__proto__:null,bigint:Ib,boolean:Kx,date:Xx,number:Yx,string:Gx},Symbol.toStringTag,{value:"Module"}));let Qx=(e,t=21)=>(r=t)=>{let i="",n=r|0;for(;n--;)i+=e[Math.random()*e.length|0];return i};const eN="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",tN=Qx(eN,11),Ob=()=>tN(),nN=Object.freeze(Object.defineProperty({__proto__:null,create:Ob},Symbol.toStringTag,{value:"Module"})),rN=(e,t)=>r=>r instanceof t||typeof r=="object"&&r!==null&&"discriminator"in r&&r.discriminator===e,iN=Qe(["static","dynamic"]),Sb=(e,t)=>{const r=new q(t);if(![F.DAY,F.HOUR,F.MINUTE,F.SECOND,F.MILLISECOND,F.MICROSECOND,F.NANOSECOND].some(n=>n.equals(r)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const i=e.valueOf()%r.valueOf();return e instanceof q?new q(i):new F(i)},de=class R extends yr{constructor(t,r="UTC"){if(t==null)super(R.now().valueOf());else if(t instanceof Date)super(BigInt(t.getTime())*R.MILLISECOND.valueOf());else if(typeof t=="string")super(R.parseDateTimeString(t,r).valueOf());else if(Array.isArray(t))super(R.parseDate(t));else{let i=BigInt(0);t instanceof Number&&(t=t.valueOf()),r==="local"&&(i=R.utcOffset.valueOf()),typeof t=="number"&&(isFinite(t)?t=Math.trunc(t):(isNaN(t)&&(t=0),t===1/0?t=R.MAX:t=R.MIN)),super(BigInt(t.valueOf())+i)}}static parseDate([t=1970,r=1,i=1]){const n=new Date(t,r-1,i,0,0,0,0);return new R(BigInt(n.getTime())*R.MILLISECOND.valueOf()).truncate(R.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(t,r="UTC"){const[i,n,s]=t.split(":");let a="00",o="00";s!=null&&([a,o]=s.split("."));let u=R.hours(parseInt(i??"00")).add(R.minutes(parseInt(n??"00"))).add(R.seconds(parseInt(a??"00"))).add(R.milliseconds(parseInt(o??"00")));return r==="local"&&(u=u.add(R.utcOffset)),u.valueOf()}static parseDateTimeString(t,r="UTC"){if(!t.includes("/")&&!t.includes("-"))return R.parseTimeString(t,r);const i=new Date(t);return t.includes(":")||i.setUTCHours(0,0,0,0),new R(BigInt(i.getTime())*R.MILLISECOND.valueOf(),r).valueOf()}fString(t="ISO",r="UTC"){switch(t){case"ISODate":return this.toISOString(r).slice(0,10);case"ISOTime":return this.toISOString(r).slice(11,23);case"time":return this.timeString(!1,r);case"preciseTime":return this.timeString(!0,r);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,r)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,r)}`;default:return this.toISOString(r)}}toISOString(t="UTC"){return t==="UTC"?this.date().toISOString():this.sub(R.utcOffset).date().toISOString()}timeString(t=!1,r="UTC"){const i=this.toISOString(r);return t?i.slice(11,23):i.slice(11,19)}dateString(){const t=this.date(),r=t.toLocaleString("default",{month:"short"}),i=t.toLocaleString("default",{day:"numeric"});return`${r} ${i}`}static get utcOffset(){return new F(BigInt(new Date().getTimezoneOffset())*R.MINUTE.valueOf())}static since(t){return new R().span(t)}date(){return new Date(this.milliseconds)}equals(t){return this.valueOf()===new R(t).valueOf()}span(t){return this.range(t).span}range(t){return new Me(this,t).makeValid()}spanRange(t){return this.range(this.add(t)).makeValid()}get isZero(){return this.valueOf()===BigInt(0)}after(t){return this.valueOf()>new R(t).valueOf()}afterEq(t){return this.valueOf()>=new R(t).valueOf()}before(t){return this.valueOf()<new R(t).valueOf()}beforeEq(t){return this.valueOf()<=new R(t).valueOf()}add(t){return new R(this.valueOf()+BigInt(t.valueOf()))}sub(t){return new R(this.valueOf()-BigInt(t.valueOf()))}get hours(){return Number(this.valueOf())/Number(F.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(F.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(F.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(F.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(R.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(R.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getUTCFullYear()}setYear(t){const r=this.date();return r.setUTCFullYear(t),new R(r)}get month(){return this.date().getUTCMonth()}setMonth(t){const r=this.date();return r.setUTCMonth(t),new R(r)}get day(){return this.date().getUTCDate()}setDay(t){const r=this.date();return r.setUTCDate(t),new R(r)}get hour(){return this.date().getUTCHours()}setHour(t){const r=this.date();return r.setUTCHours(t),new R(r,"UTC")}get minute(){return this.date().getUTCMinutes()}setMinute(t){const r=this.date();return r.setUTCMinutes(t),new R(r)}get second(){return this.date().getUTCSeconds()}setSecond(t){const r=this.date();return r.setUTCSeconds(t),new R(r)}get millisecond(){return this.date().getUTCMilliseconds()}setMillisecond(t){const r=this.date();return r.setUTCMilliseconds(t),new R(r)}toString(){return this.date().toISOString()}remainder(t){return Sb(this,t)}get isToday(){return this.truncate(F.DAY).equals(R.now().truncate(F.DAY))}truncate(t){return this.sub(this.remainder(t))}static now(){return new R(new Date)}static max(...t){let r=R.MIN;for(const i of t){const n=new R(i);n.after(r)&&(r=n)}return r}static min(...t){let r=R.MAX;for(const i of t){const n=new R(i);n.before(r)&&(r=n)}return r}static nanoseconds(t,r="UTC"){return new R(t,r)}static microseconds(t,r="UTC"){return R.nanoseconds(t*1e3,r)}static milliseconds(t,r="UTC"){return R.microseconds(t*1e3,r)}static seconds(t,r="UTC"){return R.milliseconds(t*1e3,r)}static minutes(t,r="UTC"){return R.seconds(t*60,r)}static hours(t,r="UTC"){return R.minutes(t*60,r)}static days(t,r="UTC"){return R.hours(t*24,r)}};N(de,"NANOSECOND",de.nanoseconds(1)),N(de,"MICROSECOND",de.microseconds(1)),N(de,"MILLISECOND",de.milliseconds(1)),N(de,"SECOND",de.seconds(1)),N(de,"MINUTE",de.minutes(1)),N(de,"HOUR",de.hours(1)),N(de,"DAY",de.days(1)),N(de,"MAX",new de((1n<<63n)-1n)),N(de,"MIN",new de(0)),N(de,"ZERO",new de(0)),N(de,"z",Ee([ie({value:$n()}).transform(e=>new de(e.value)),Te().transform(e=>new de(BigInt(e))),ye(Number).transform(e=>new de(e)),H().transform(e=>new de(e)),ye(de)]));let q=de;const he=class G extends yr{constructor(t){typeof t=="number"&&(t=Math.trunc(t.valueOf())),super(BigInt(t.valueOf()))}static fromSeconds(t){return t instanceof G?t:t instanceof Om?t.period:t instanceof q?new G(t):["number","bigint"].includes(typeof t)?G.seconds(t):new G(t)}static fromMilliseconds(t){return t instanceof G?t:t instanceof Om?t.period:t instanceof q?new G(t):["number","bigint"].includes(typeof t)?G.milliseconds(t):new G(t)}valueOf(){return this.value}lessThan(t){return this.valueOf()<new G(t).valueOf()}greaterThan(t){return this.valueOf()>new G(t).valueOf()}lessThanOrEqual(t){return this.valueOf()<=new G(t).valueOf()}greaterThanOrEqual(t){return this.valueOf()>=new G(t).valueOf()}remainder(t){return Sb(this,t)}truncate(t){return new G(BigInt(Math.trunc(Number(this.valueOf()/t.valueOf())))*t.valueOf())}toString(){const t=this.truncate(G.DAY),r=this.truncate(G.HOUR),i=this.truncate(G.MINUTE),n=this.truncate(G.SECOND),s=this.truncate(G.MILLISECOND),a=this.truncate(G.MICROSECOND),o=this.truncate(G.NANOSECOND),u=t,c=r.sub(t),l=i.sub(r),d=n.sub(i),m=s.sub(n),y=a.sub(s),k=o.sub(a);let v="";return u.isZero||(v+=`${u.days}d `),c.isZero||(v+=`${c.hours}h `),l.isZero||(v+=`${l.minutes}m `),d.isZero||(v+=`${d.seconds}s `),m.isZero||(v+=`${m.milliseconds}ms `),y.isZero||(v+=`${y.microseconds}µs `),k.isZero||(v+=`${k.nanoseconds}ns`),v.trim()}mult(t){return new G(this.valueOf()*BigInt(t))}get days(){return Number(this.valueOf())/Number(G.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(G.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(G.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(G.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(G.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(G.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===BigInt(0)}equals(t){return this.valueOf()===new G(t).valueOf()}add(t){return new G(this.valueOf()+new G(t).valueOf())}sub(t){return new G(this.valueOf()-new G(t).valueOf())}static nanoseconds(t=1){return new G(t)}static microseconds(t=1){return G.nanoseconds(Mn(t,1e3))}static milliseconds(t=1){return G.microseconds(Mn(t,1e3))}static seconds(t=1){return G.milliseconds(Mn(t,1e3))}static minutes(t=1){return G.seconds(Mn(t,60))}static hours(t){return G.minutes(Mn(t,60))}static days(t){return G.hours(Mn(t,24))}};N(he,"NANOSECOND",he.nanoseconds(1)),N(he,"MICROSECOND",he.microseconds(1)),N(he,"MILLISECOND",he.milliseconds(1)),N(he,"SECOND",he.seconds(1)),N(he,"MINUTE",he.minutes(1)),N(he,"HOUR",he.hours(1)),N(he,"DAY",he.days(1)),N(he,"MAX",new he((1n<<63n)-1n)),N(he,"MIN",new he(0)),N(he,"ZERO",new he(0)),N(he,"z",Ee([ie({value:$n()}).transform(e=>new he(e.value)),Te().transform(e=>new he(BigInt(e))),ye(Number).transform(e=>new he(e)),H().transform(e=>new he(e)),ye(he)]));let F=he;const Jr=class $s extends yr{constructor(t){super(t.valueOf())}toString(){return`${this.valueOf()} Hz`}equals(t){return this.valueOf()===new $s(t).valueOf()}get period(){return F.seconds(1/this.valueOf())}sampleCount(t){return new F(t).seconds*this.valueOf()}byteCount(t,r){return this.sampleCount(t)*new lt(r).valueOf()}span(t){return F.seconds(t/this.valueOf())}byteSpan(t,r){return this.span(t.valueOf()/r.valueOf())}static hz(t){return new $s(t)}static khz(t){return $s.hz(t*1e3)}};N(Jr,"z",Ee([H().transform(e=>new Jr(e)),ye(Number).transform(e=>new Jr(e)),ye(Jr)]));let Om=Jr;const tt=class extends yr{constructor(e){super(e.valueOf())}length(e){return e.valueOf()/this.valueOf()}size(e){return new or(e*this.valueOf())}};N(tt,"UNKNOWN",new tt(0)),N(tt,"BIT128",new tt(16)),N(tt,"BIT64",new tt(8)),N(tt,"BIT32",new tt(4)),N(tt,"BIT16",new tt(2)),N(tt,"BIT8",new tt(1)),N(tt,"z",Ee([H().transform(e=>new tt(e)),ye(Number).transform(e=>new tt(e)),ye(tt)]));let lt=tt;const jt=class Vr{constructor(t,r){N(this,"start"),N(this,"end"),typeof t=="object"&&"start"in t?(this.start=new q(t.start),this.end=new q(t.end)):(this.start=new q(t),this.end=new q(r))}get span(){return new F(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new Vr(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(t,r=F.ZERO){if(r.isZero)return this.start.equals(t.start)&&this.end.equals(t.end);let i=this.start.sub(t.start).valueOf(),n=this.end.sub(t.end).valueOf();return i<0&&(i=-i),n<0&&(n=-n),i<=r.valueOf()&&n<=r.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(t,r=F.ZERO){t=t.makeValid();const i=this.makeValid();if(this.equals(t))return!0;if(t.end.equals(i.start)||i.end.equals(t.start))return!1;const n=q.max(i.start,t.start),s=q.min(i.end,t.end);return s.before(n)?!1:new F(s.sub(n)).greaterThanOrEqual(r)}contains(t){return t instanceof Vr?this.contains(t.start)&&this.contains(t.end):this.start.beforeEq(t)&&this.end.after(t)}boundBy(t){const r=new Vr(this.start,this.end);return t.start.after(this.start)&&(r.start=t.start),t.start.after(this.end)&&(r.end=t.start),t.end.before(this.end)&&(r.end=t.end),t.end.before(this.start)&&(r.start=t.end),r}static max(...t){return new Vr(q.min(...t.map(r=>r.start)),q.max(...t.map(r=>r.end)))}};N(jt,"MAX",new jt(q.MIN,q.MAX)),N(jt,"MIN",new jt(q.MAX,q.MIN)),N(jt,"ZERO",new jt(q.ZERO,q.ZERO)),N(jt,"z",Ee([ie({start:q.z,end:q.z}).transform(e=>new jt(e.start,e.end)),ye(jt)]));let Me=jt;const sN=(e,t)=>e.start.before(t.start)?-1:e.start.after(t.start)?1:e.end.before(t.end)?-1:e.end.after(t.end)?1:0,T=class Ze extends yr{constructor(t){if(t instanceof Ze||typeof t=="string"||typeof t.valueOf()=="string")super(t.valueOf());else{const r=Ze.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);if(r==null)throw new Error(`unable to find data type for ${t.toString()}`);super(r.valueOf())}}get Array(){const t=Ze.ARRAY_CONSTRUCTORS.get(this.toString());if(t==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return t}equals(t){return this.valueOf()===t.valueOf()}matches(...t){return t.some(r=>this.equals(r))}toString(){return this.valueOf()}get isVariable(){return this.equals(Ze.JSON)||this.equals(Ze.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(Ze.UUID)}get isInteger(){const t=this.toString();return t.startsWith("int")||t.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const t=Ze.DENSITIES.get(this.toString());if(t==null)throw new Error(`unable to find density for ${this.valueOf()}`);return t}get isUnsignedInteger(){return this.equals(Ze.UINT8)||this.equals(Ze.UINT16)||this.equals(Ze.UINT32)||this.equals(Ze.UINT64)}get isSignedInteger(){return this.equals(Ze.INT8)||this.equals(Ze.INT16)||this.equals(Ze.INT32)||this.equals(Ze.INT64)}canSafelyCastTo(t){return this.equals(t)?!0:!this.isNumeric||!t.isNumeric||this.isVariable||t.isVariable||this.isUnsignedInteger&&t.isSignedInteger?!1:this.isFloat?t.isFloat&&this.density.valueOf()<=t.density.valueOf():this.equals(Ze.INT32)&&t.equals(Ze.FLOAT64)||this.equals(Ze.INT8)&&t.equals(Ze.FLOAT32)?!0:this.isInteger&&t.isInteger?this.density.valueOf()<=t.density.valueOf()&&this.isUnsignedInteger===t.isUnsignedInteger:!1}canCastTo(t){return this.isNumeric&&t.isNumeric?!0:this.equals(t)}checkArray(t){return t.constructor===this.Array}get usesBigInt(){return Ze.BIG_INT_TYPES.some(t=>t.equals(this))}};N(T,"UNKNOWN",new T("unknown")),N(T,"FLOAT64",new T("float64")),N(T,"FLOAT32",new T("float32")),N(T,"INT64",new T("int64")),N(T,"INT32",new T("int32")),N(T,"INT16",new T("int16")),N(T,"INT8",new T("int8")),N(T,"UINT64",new T("uint64")),N(T,"UINT32",new T("uint32")),N(T,"UINT16",new T("uint16")),N(T,"UINT8",new T("uint8")),N(T,"BOOLEAN",T.UINT8),N(T,"TIMESTAMP",new T("timestamp")),N(T,"UUID",new T("uuid")),N(T,"STRING",new T("string")),N(T,"JSON",new T("json")),N(T,"ARRAY_CONSTRUCTORS",new Map([[T.UINT8.toString(),Uint8Array],[T.UINT16.toString(),Uint16Array],[T.UINT32.toString(),Uint32Array],[T.UINT64.toString(),BigUint64Array],[T.FLOAT32.toString(),Float32Array],[T.FLOAT64.toString(),Float64Array],[T.INT8.toString(),Int8Array],[T.INT16.toString(),Int16Array],[T.INT32.toString(),Int32Array],[T.INT64.toString(),BigInt64Array],[T.TIMESTAMP.toString(),BigInt64Array],[T.STRING.toString(),Uint8Array],[T.JSON.toString(),Uint8Array],[T.UUID.toString(),Uint8Array]])),N(T,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,T.UINT8],[Uint16Array.name,T.UINT16],[Uint32Array.name,T.UINT32],[BigUint64Array.name,T.UINT64],[Float32Array.name,T.FLOAT32],[Float64Array.name,T.FLOAT64],[Int8Array.name,T.INT8],[Int16Array.name,T.INT16],[Int32Array.name,T.INT32],[BigInt64Array.name,T.INT64]])),N(T,"DENSITIES",new Map([[T.UINT8.toString(),lt.BIT8],[T.UINT16.toString(),lt.BIT16],[T.UINT32.toString(),lt.BIT32],[T.UINT64.toString(),lt.BIT64],[T.FLOAT32.toString(),lt.BIT32],[T.FLOAT64.toString(),lt.BIT64],[T.INT8.toString(),lt.BIT8],[T.INT16.toString(),lt.BIT16],[T.INT32.toString(),lt.BIT32],[T.INT64.toString(),lt.BIT64],[T.TIMESTAMP.toString(),lt.BIT64],[T.STRING.toString(),lt.UNKNOWN],[T.JSON.toString(),lt.UNKNOWN],[T.UUID.toString(),lt.BIT128]])),N(T,"ALL",[T.UNKNOWN,T.FLOAT64,T.FLOAT32,T.INT64,T.INT32,T.INT16,T.INT8,T.UINT64,T.UINT32,T.UINT16,T.UINT8,T.TIMESTAMP,T.UUID,T.STRING,T.JSON]),N(T,"BIG_INT_TYPES",[T.INT64,T.UINT64,T.TIMESTAMP]),N(T,"z",Ee([Te().transform(e=>new T(e)),ye(T)]));let ce=T;const ut=class Je extends yr{constructor(t){super(t.valueOf())}largerThan(t){return this.valueOf()>t.valueOf()}smallerThan(t){return this.valueOf()<t.valueOf()}add(t){return Je.bytes(this.valueOf()+t.valueOf())}sub(t){return Je.bytes(this.valueOf()-t.valueOf())}truncate(t){return new Je(Math.trunc(this.valueOf()/t.valueOf())*t.valueOf())}remainder(t){return Je.bytes(this.valueOf()%t.valueOf())}get gigabytes(){return this.valueOf()/Je.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/Je.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/Je.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/Je.TERABYTE.valueOf()}toString(){const t=this.truncate(Je.TERABYTE),r=this.truncate(Je.GIGABYTE),i=this.truncate(Je.MEGABYTE),n=this.truncate(Je.KILOBYTE),s=this.truncate(Je.BYTE),a=t,o=r.sub(t),u=i.sub(r),c=n.sub(i),l=s.sub(n);let d="";return a.isZero||(d+=`${a.terabytes}TB `),o.isZero||(d+=`${o.gigabytes}GB `),u.isZero||(d+=`${u.megabytes}MB `),c.isZero||(d+=`${c.kilobytes}KB `),(!l.isZero||d==="")&&(d+=`${l.valueOf()}B`),d.trim()}static bytes(t=1){return new Je(t)}static kilobytes(t=1){return Je.bytes(t.valueOf()*1e3)}static megabytes(t=1){return Je.kilobytes(t.valueOf()*1e3)}static gigabytes(t=1){return Je.megabytes(t.valueOf()*1e3)}static terabytes(t){return Je.gigabytes(t.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};N(ut,"BYTE",new ut(1)),N(ut,"KILOBYTE",ut.kilobytes(1)),N(ut,"MEGABYTE",ut.megabytes(1)),N(ut,"GIGABYTE",ut.gigabytes(1)),N(ut,"TERABYTE",ut.terabytes(1)),N(ut,"ZERO",new ut(0)),N(ut,"z",Ee([H().transform(e=>new ut(e)),ye(ut)]));let or=ut;Ee([ye(Uint8Array),ye(Uint16Array),ye(Uint32Array),ye(BigUint64Array),ye(Float32Array),ye(Float64Array),ye(Int8Array),ye(Int16Array),ye(Int32Array),ye(BigInt64Array)]);const zb=e=>{const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t==="bigint"||e instanceof q||e instanceof F||e instanceof Date},aN=(e,t,r,i=0)=>e.usesBigInt&&!t.usesBigInt?Number(r)-Number(i):!e.usesBigInt&&t.usesBigInt?BigInt(r.valueOf())-BigInt(i.valueOf()):_s(r,-i).valueOf(),_s=(e,t)=>t==0?e:e==0?t:typeof e=="bigint"&&typeof t=="bigint"||typeof e=="number"&&typeof t=="number"?e+t:Number(e)+Number(t),oN=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function uN(e){return typeof e=="string"&&oN.test(e)}const nt=[];for(let e=0;e<256;++e)nt.push((e+256).toString(16).slice(1));function cN(e,t=0){return(nt[e[t+0]]+nt[e[t+1]]+nt[e[t+2]]+nt[e[t+3]]+"-"+nt[e[t+4]]+nt[e[t+5]]+"-"+nt[e[t+6]]+nt[e[t+7]]+"-"+nt[e[t+8]]+nt[e[t+9]]+"-"+nt[e[t+10]]+nt[e[t+11]]+nt[e[t+12]]+nt[e[t+13]]+nt[e[t+14]]+nt[e[t+15]]).toLowerCase()}function lN(e,t=0){const r=cN(e,t);if(!uN(r))throw TypeError("Stringified UUID is invalid");return r}typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const dN=(e,t)=>lN(e,t),Qt=-1,Yo={[Symbol.iterator]:()=>Yo,next:()=>({done:!0,value:void 0})},hN=Te().transform(e=>new Uint8Array(atob(e).split("").map(t=>t.charCodeAt(0))).buffer),mN=Ee([Pi(),Zy()]).transform(()=>new Uint8Array().buffer),Ko=10,xb=(e,t)=>{if(e==="string"&&!t.isVariable)throw new Error(`cannot convert series of type ${t.toString()} to string`);if(e==="number"&&!t.isNumeric)throw new Error(`cannot convert series of type ${t.toString()} to number`);if(e==="bigint"&&!t.usesBigInt)throw new Error(`cannot convert series of type ${t.toString()} to bigint`)},Nb="sy_x_telem_series",Wr=class Jn{constructor(t){N(this,"key"),N(this,"discriminator",Nb),N(this,"dataType"),N(this,"sampleOffset"),N(this,"gl"),N(this,"_data"),N(this,"timeRange",Me.ZERO),N(this,"alignment",0n),N(this,"cachedMin"),N(this,"cachedMax"),N(this,"writePos",Qt),N(this,"_refCount",0),N(this,"cachedLength"),N(this,"_cachedIndexes"),fN(t)&&(t={data:t}),t.data??(t.data=[]);const{dataType:r,timeRange:i,sampleOffset:n=0,glBufferUsage:s="static",alignment:a=0n,key:o=Ob(),data:u}=t;if(Tb(u)){const d=u;this.key=d.key,this.dataType=d.dataType,this.sampleOffset=d.sampleOffset,this.gl=d.gl,this._data=d._data,this.timeRange=d.timeRange,this.alignment=d.alignment,this.cachedMin=d.cachedMin,this.cachedMax=d.cachedMax,this.writePos=d.writePos,this._refCount=d._refCount,this.cachedLength=d.cachedLength;return}const c=zb(u),l=Array.isArray(u);if(r!=null)this.dataType=new ce(r);else{if(u instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(l||c){let d=u;if(!c){if(u.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");d=u[0]}if(typeof d=="string")this.dataType=ce.STRING;else if(typeof d=="number")this.dataType=ce.FLOAT64;else if(typeof d=="bigint")this.dataType=ce.INT64;else if(typeof d=="boolean")this.dataType=ce.BOOLEAN;else if(d instanceof q||d instanceof Date||d instanceof q)this.dataType=ce.TIMESTAMP;else if(typeof d=="object")this.dataType=ce.JSON;else throw new Error(`cannot infer data type of ${typeof d} when constructing a Series from a JS array`)}else this.dataType=new ce(u)}if(!l&&!c)this._data=u;else{let d=c?[u]:u;const m=d[0];(m instanceof q||m instanceof Date||m instanceof F)&&(d=d.map(y=>new q(y).valueOf())),this.dataType.equals(ce.STRING)?(this.cachedLength=d.length,this._data=new TextEncoder().encode(`${d.join(`
30
+ `)}
31
+ `).buffer):this.dataType.equals(ce.JSON)?(this.cachedLength=d.length,this._data=new TextEncoder().encode(`${d.map(y=>li.encodeString(y)).join(`
32
+ `)}
33
+ `).buffer):this.dataType.usesBigInt&&typeof m=="number"?this._data=new this.dataType.Array(d.map(y=>BigInt(Math.round(y)))).buffer:!this.dataType.usesBigInt&&typeof m=="bigint"?this._data=new this.dataType.Array(d.map(y=>Number(y))).buffer:this._data=new this.dataType.Array(d).buffer}this.key=o,this.alignment=a,this.sampleOffset=n??0,this.timeRange=i??Me.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:s}}static alloc({capacity:t,dataType:r,...i}){if(t===0)throw new Error("[Series] - cannot allocate an array of length 0");const n=new new ce(r).Array(t),s=new Jn({data:n.buffer,dataType:r,...i});return s.writePos=0,s}get refCount(){return this._refCount}acquire(t){this._refCount++,t!=null&&this.updateGLBuffer(t)}release(){this._refCount--,this.refCount===0&&this.gl.control!=null?this.maybeGarbageCollectGLBuffer(this.gl.control):this.refCount<0&&console.warn("cannot release a series with a negative reference count")}write(t){if(!t.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(t):this.writeFixed(t)}writeVariable(t){if(this.writePos===Qt)return 0;const r=this.byteCapacity.valueOf()-this.writePos,i=t.subBytes(0,r);return this.writeToUnderlyingData(i),this.writePos+=i.byteLength.valueOf(),this.cachedLength!=null&&(this.cachedLength+=i.length,this.calculateCachedLength()),i.length}writeFixed(t){if(this.writePos===Qt)return 0;const r=this.capacity-this.writePos,i=t.sub(0,r);return this.writeToUnderlyingData(i),this.cachedLength=void 0,this.maybeRecomputeMinMax(i),this.writePos+=i.length,i.length}writeToUnderlyingData(t){this.underlyingData.set(t.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===Qt?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){return this.dataType.isVariable?new TextDecoder().decode(this.underlyingData).split(`
34
+ `).slice(0,-1):Array.from(this).map(t=>t.toString())}toUUIDs(){if(!this.dataType.equals(ce.UUID))throw new Error("cannot convert non-uuid series to uuids");const t=ce.UUID.density.valueOf(),r=new Uint8Array(this.underlyingData.buffer);return Array.from({length:this.length},(i,n)=>dN(r,n*t))}parseJSON(t){if(!this.dataType.equals(ce.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.toStrings().map(r=>t.parse(li.decodeString(r)))}get byteCapacity(){return new or(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===Qt?this.byteCapacity:this.dataType.isVariable?new or(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this.cachedLength!=null?this.cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===Qt?this.byteCapacity.valueOf()/this.dataType.density.valueOf():this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let t=0;const r=[0];return this.data.forEach((i,n)=>{i===Ko&&(t++,r.push(n+1))}),this._cachedIndexes=r,this.cachedLength=t,t}convert(t,r=0){if(this.dataType.equals(t))return this;const i=new t.Array(this.length);for(let n=0;n<this.length;n++)i[n]=aN(this.dataType,t,this.data[n],r);return new Jn({data:i.buffer,dataType:t,timeRange:this.timeRange,sampleOffset:r,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(ce.TIMESTAMP))this.cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const t=this.data;this.cachedMax=t.reduce((r,i)=>r>i?r:i)}else{const t=this.data;this.cachedMax=t.reduce((r,i)=>r>i?r:i)}return this.cachedMax}get max(){return this.calcMax()}calcMax(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this.cachedMax??(this.cachedMax=this.calcRawMax()),_s(this.cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(ce.TIMESTAMP))this.cachedMin=this.data[0];else if(this.dataType.usesBigInt){const t=this.data;this.cachedMin=t.reduce((r,i)=>r<i?r:i)}else{const t=this.data;this.cachedMin=t.reduce((r,i)=>r<i?r:i)}return this.cachedMin}get min(){return this.calcMin()}calcMin(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this.cachedMin??(this.cachedMin=this.calcRawMin()),_s(this.cachedMin,this.sampleOffset))}get bounds(){return st(Number(this.min),Number(this.max),{makeValid:!1})}maybeRecomputeMinMax(t){if(this.cachedMin!=null){const r=t.cachedMin??t.calcRawMin();r<this.cachedMin&&(this.cachedMin=r)}if(this.cachedMax!=null){const r=t.cachedMax??t.calcRawMax();r>this.cachedMax&&(this.cachedMax=r)}}atAlignment(t,r){const i=Number(t-this.alignment);if(i<0||i>=this.length){if(r===!0)throw new Error(`[series] - no value at index ${i}`);return}return this.at(i,r)}at(t,r){if(this.dataType.isVariable)return this.atVariable(t,r??!1);t<0&&(t=this.length+t);const i=this.data[t];if(i==null){if(r===!0)throw new Error(`[series] - no value at index ${t}`);return}return _s(i,this.sampleOffset)}atVariable(t,r){let i=0,n=0;if(this._cachedIndexes!=null)i=this._cachedIndexes[t],n=this._cachedIndexes[t+1]-1;else{t<0&&(t=this.length+t);for(let a=0;a<this.data.length;a++)if(this.data[a]===Ko){if(t===0){n=a;break}i=a+1,t--}if(n===0&&(n=this.data.length),i>=n||t>0){if(r)throw new Error(`[series] - no value at index ${t}`);return}}const s=this.data.slice(i,n);return this.dataType.equals(ce.STRING)?new TextDecoder().decode(s):lp(JSON.parse(new TextDecoder().decode(s)))}binarySearch(t){let r=0,i=this.length-1;const n=$0(t);for(;r<=i;){const s=Math.floor((r+i)/2),a=n(this.at(s,!0),t);if(a===0)return s;a<0?r=s+1:i=s-1}return r}updateGLBuffer(t){if(this.gl.control=t,!this.dataType.equals(ce.FLOAT32)&&!this.dataType.equals(ce.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:r,bufferUsage:i,prevBuffer:n}=this.gl;if(r==null&&(this.gl.buffer=t.createBuffer()),this.writePos!==n)if(t.bindBuffer(t.ARRAY_BUFFER,this.gl.buffer),this.writePos!==Qt){n===0&&t.bufferData(t.ARRAY_BUFFER,this.byteCapacity.valueOf(),t.STATIC_DRAW);const s=this.dataType.density.size(n).valueOf(),a=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);t.bufferSubData(t.ARRAY_BUFFER,s,a.buffer),this.gl.prevBuffer=this.writePos}else t.bufferData(t.ARRAY_BUFFER,this.buffer,i==="static"?t.STATIC_DRAW:t.DYNAMIC_DRAW),this.gl.prevBuffer=Qt}as(t){return xb(t,this.dataType),this}get digest(){return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:zm(this.alignmentBounds.lower),upper:zm(this.alignmentBounds.upper)},timeRange:this.timeRange.toString(),length:this.length,capacity:this.capacity}}get alignmentBounds(){return st(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(t){this.gl.buffer!=null&&(t.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const t=new pN(this);return this.dataType.equals(ce.JSON)?new vN(t):t}return new gN(this)}slice(t,r){return this.sliceSub(!1,t,r)}sub(t,r){return this.sliceSub(!0,t,r)}subIterator(t,r){return new Sm(this,t,r??this.length)}subAlignmentIterator(t,r){return new Sm(this,Number(t-this.alignment),Number(r-this.alignment))}subBytes(t,r){if(t>=0&&(r==null||r>=this.byteLength.valueOf()))return this;const i=this.data.subarray(t,r);return new Jn({data:i,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(t)})}sliceSub(t,r,i){if(r<=0&&(i==null||i>=this.length))return this;let n;return t?n=this.data.subarray(r,i):n=this.data.slice(r,i),new Jn({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(r)})}reAlign(t){return new Jn({data:this.buffer,dataType:this.dataType,timeRange:Me.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:t})}toString(){var t,r;let i=`Series(${this.dataType.toString()} ${this.length} [`;if(this.length<=10)i+=Array.from(this).map(n=>n.toString());else{for(let n=0;n<5;n++)i+=`${(t=this.at(n))==null?void 0:t.toString()}`,i+=",";i+="...,";for(let n=-5;n<0;n++)i+=(r=this.at(n))==null?void 0:r.toString(),n<-1&&(i+=",")}return i+="])",i}};N(Wr,"crudeZ",ie({timeRange:Me.z.optional(),dataType:ce.z,alignment:Ib().optional(),data:Ee([hN,mN,ye(ArrayBuffer),ye(Uint8Array)]),glBufferUsage:iN.optional().default("static").optional()})),N(Wr,"z",Wr.crudeZ.transform(e=>new Wr(e)));let un=Wr;const fN=e=>e==null?!1:Array.isArray(e)||e instanceof ArrayBuffer||ArrayBuffer.isView(e)&&!(e instanceof DataView)||e instanceof un?!0:zb(e),Tb=rN(Nb,un);let Sm=class{constructor(e,t,r){N(this,"series"),N(this,"end"),N(this,"index"),this.series=e;const i=st(0,e.length);this.end=wm(i,r),this.index=wm(i,t)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}},pN=class{constructor(e){if(N(this,"series"),N(this,"index"),N(this,"decoder"),!e.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=e,this.index=0,this.decoder=new TextDecoder}next(){const e=this.index,t=this.series.data;for(;this.index<t.length&&t[this.index]!==Ko;)this.index++;const r=this.index;return e===r?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(e,r))})}};const Ub=class Eb{constructor(t){N(this,"wrapped"),this.wrapped=t}next(){const t=this.wrapped.next();return t.done===!0?{done:!0,value:void 0}:{done:!1,value:li.decodeString(t.value,Eb.schema)}}};N(Ub,"schema",_a(Te(),ar()));let vN=Ub,gN=class{constructor(e){N(this,"series"),N(this,"index"),this.series=e,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}};class yN{constructor(t=[]){if(N(this,"series"),t.length!==0){const r=t[0].dataType;for(let i=1;i<t.length;i++)if(!t[i].dataType.equals(r))throw new Error("[multi-series] - series must have the same data type")}this.series=t}as(t){return xb(t,this.dataType),this}get dataType(){return this.series.length===0?ce.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?Me.ZERO:new Me(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}get alignment(){return this.series.length===0?0n:this.series[0].alignment}get alignmentBounds(){return this.series.length===0?st(0n,0n):st(this.series[0].alignmentBounds.lower,this.series[this.series.length-1].alignmentBounds.upper)}push(t){const r=()=>new Error(`cannot push a ${t.dataType.toString()} series to a ${this.dataType.toString()} multi-series`),i=t.dataType.equals(this.dataType);if(Tb(t)){if(this.series.length!==0&&!i)throw r();this.series.push(t)}else{if(this.series.length!==0&&t.series.length!==0&&!i)throw r();this.series.push(...t.series)}}get length(){return this.series.reduce((t,r)=>t+r.length,0)}atAlignment(t,r){for(const i of this.series)if(rs(i.alignmentBounds,t))return i.atAlignment(t,r);if(r)throw new Error(`[series] - no value at alignment ${t}`)}at(t,r=!1){t<0&&(t=this.length+t);for(const i of this.series){if(t<i.length)return i.at(t,r);t-=i.length}if(r)throw new Error(`[series] - no value at index ${t}`)}subIterator(t,r){return new yo(this,t,r??this.length)}subAlignmentIterator(t,r){if(t>=this.alignmentBounds.upper||r<=this.alignmentBounds.lower)return Yo;let i=0;for(let s=0;s<this.series.length;s++){const a=this.series[s];if(t<a.alignment)break;if(t>=a.alignmentBounds.upper)i+=a.length;else if(rs(a.alignmentBounds,t)){i+=Number(t-a.alignment);break}}let n=0;for(let s=0;s<this.series.length;s++){const a=this.series[s];if(r<a.alignment)break;if(r>=a.alignmentBounds.upper)n+=a.length;else if(rs(a.alignmentBounds,r)){n+=Number(r-a.alignment);break}}return new yo(this,i,n)}subAlignmentSpanIterator(t,r){if(t>=this.alignmentBounds.upper)return Yo;r=Math.min(r,Number(this.distance(t,this.alignmentBounds.upper)));let i=0;for(let n=0;n<this.series.length;n++){const s=this.series[n];if(t<s.alignment)break;if(t>=s.alignmentBounds.upper)i+=s.length;else if(rs(s.alignmentBounds,t)){i+=Number(t-s.alignment);break}}return new yo(this,i,i+r)}updateGLBuffer(t){this.series.forEach(r=>r.updateGLBuffer(t))}get bounds(){return xx(this.series.map(t=>t.bounds))}get byteLength(){return new or(this.series.reduce((t,r)=>t+r.byteLength.valueOf(),0))}get data(){const t=new this.dataType.Array(this.length);let r=0;for(const i of this.series)t.set(i.data,r),r+=i.length;return new this.dataType.Array(t.buffer)}traverseAlignment(t,r){const i=this.series.map(n=>n.alignmentBounds);return Nx(i,t,r)}acquire(t){this.series.forEach(r=>r.acquire(t))}release(){this.series.forEach(t=>t.release())}distance(t,r){const i=this.series.map(n=>n.alignmentBounds);return Tx(i,t,r)}parseJSON(t){if(!this.dataType.equals(ce.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.series.flatMap(r=>r.parseJSON(t))}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new bN(this.series)}}let bN=class{constructor(e){N(this,"series"),N(this,"seriesIndex"),N(this,"internal"),this.series=e,this.seriesIndex=0,this.internal=e[0][Symbol.iterator]()}next(){const e=this.internal.next();return e.done===!1?e:this.seriesIndex===this.series.length-1?{done:!0,value:void 0}:(this.internal=this.series[++this.seriesIndex][Symbol.iterator](),this.next())}[Symbol.iterator](){return this}},yo=class{constructor(e,t,r){N(this,"series"),N(this,"index"),N(this,"end"),this.series=e,this.end=r,this.index=t}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}};const zm=e=>{const t=e>>32n,r=e&0xffffffffn;return{domain:t,sample:r}},wN=(e,t)=>{let r=null;return t===0?e:(...i)=>{r!==null&&(clearTimeout(r),r=null),r=setTimeout(()=>e(...i),t)}},$N=(e,t,r=".")=>{const i=e.split(r);return i.map((n,s)=>{const a=t(n,s,i);return a==null?null:typeof a=="string"?a:a.join(r)}).filter(n=>n!=null).join(r)},_N=(e,t,r={optional:!1,separator:"."})=>{r.separator??(r.separator=".");const{optional:i,getter:n=(o,u)=>o[u]}=r,s=t.split(r.separator);if(s.length===1&&s[0]==="")return e;let a=e;for(const o of s){const u=n(a,o);if(u==null){if(i)return null;throw new Error(`Path ${t} does not exist. ${o} is null`)}a=u}return a};ie({key:Te(),value:Te()});var kN=Object.defineProperty,IN=(e,t,r)=>t in e?kN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ks=(e,t,r)=>IN(e,typeof t!="symbol"?t+"":t,r);let ON=class{constructor(e,t){ks(this,"handlers"),ks(this,"transform"),ks(this,"closer"),this.transform=e,this.handlers=t??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){let t=e;if(this.transform!=null){const[r,i]=this.transform(e);if(!i)return;t=r}this.handlers.forEach((r,i)=>i(t))}setCloser(e){this.closer=e}async close(){var e;return await((e=this.closer)==null?void 0:e.call(this))}},SN=class{constructor(e){ks(this,"handlers"),this.handlers=e??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){this.handlers.forEach((t,r)=>r(e))}};const _n=Object.freeze(Object.defineProperty({__proto__:null,BaseObserver:SN,Observer:ON},Symbol.toStringTag,{value:"Module"})),St=_a(Ee([H(),Te(),Ay()]),ar()),zN=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser";zN();const xN=["macOS","Windows","Linux"],NN=["macos","windows","linux"],TN={macos:"macOS",windows:"Windows",linux:"Linux"};Qe(xN).or(Qe(NN).transform(e=>TN[e]));var UN=Object.defineProperty,EN=(e,t,r)=>t in e?UN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qr=(e,t,r)=>EN(e,typeof t!="symbol"?t+"":t,r);const jN=(...e)=>e.map(jb).join(""),jb=e=>(e.endsWith("/")||(e+="/"),e.startsWith("/")&&(e=e.slice(1)),e),AN=e=>e.endsWith("/")?e.slice(0,-1):e,Xo=class Ho{constructor({host:t,port:r,protocol:i="",pathPrefix:n=""}){qr(this,"protocol"),qr(this,"host"),qr(this,"port"),qr(this,"path"),this.protocol=i,this.host=t,this.port=r,this.path=jb(n)}replace(t){return new Ho({host:t.host??this.host,port:t.port??this.port,protocol:t.protocol??this.protocol,pathPrefix:t.pathPrefix??this.path})}child(t){return new Ho({...this,pathPrefix:jN(this.path,t)})}toString(){return AN(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}};qr(Xo,"UNKNOWN",new Xo({host:"unknown",port:0}));let PN=Xo;const ZN=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),Ab=e=>$N(e,(t,r,i)=>{const n=r===i.length-1,s=!isNaN(parseInt(t)),a=!isNaN(parseInt(i[r+1]));return s&&(t="element"),n||a?t:[t,"shape"]}),xm=(e,t)=>{if(e==null)return null;const r=e[t];return r==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:r},DN=(e,t,r)=>_N(xm(e,"shape"),Ab(t),{...r,getter:xm}),Pb=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:DN,getFieldSchemaPath:Ab,nullToUndefined:ZN},Symbol.toStringTag,{value:"Module"}));var CN=Object.defineProperty,RN=(e,t,r)=>t in e?CN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pt=(e,t,r)=>RN(e,typeof t!="symbol"?t+"":t,r);const LN=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return n=>{switch(n.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${n.expected}، ولكن تم إدخال ${r(n.input)}`;case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${K(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${s} ${n.maximum.toString()} ${a.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${s} ${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${s} ${n.minimum.toString()} ${a.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${s} ${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:s.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${s.suffix}"`:s.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${s.includes}"`:s.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${s.pattern}`:`${i[s.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${A(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function MN(){return{localeError:LN()}}const BN=()=>{const e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${n.expected}, daxil olan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${K(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${s}${n.maximum.toString()} ${a.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Çox kiçik: gözlənilən ${n.origin} ${s}${n.minimum.toString()} ${a.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Yanlış mətn: "${s.prefix}" ilə başlamalıdır`:s.format==="ends_with"?`Yanlış mətn: "${s.suffix}" ilə bitməlidir`:s.format==="includes"?`Yanlış mətn: "${s.includes}" daxil olmalıdır`:s.format==="regex"?`Yanlış mətn: ${s.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${i[s.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${A(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function FN(){return{localeError:BN()}}function Nm(e,t,r,i){const n=Math.abs(e),s=n%10,a=n%100;return a>=11&&a<=19?i:s===1?t:s>=2&&s<=4?r:i}const JN=()=>{const e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"лік";case"object":{if(Array.isArray(n))return"масіў";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return n=>{switch(n.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${n.expected}, атрымана ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Няправільны ўвод: чакалася ${K(n.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);if(a){const o=Number(n.maximum),u=Nm(o,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${a.verb} ${s}${n.maximum.toString()} ${u}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);if(a){const o=Number(n.minimum),u=Nm(o,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${a.verb} ${s}${n.minimum.toString()} ${u}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${s.prefix}"`:s.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${s.suffix}"`:s.format==="includes"?`Няправільны радок: павінен змяшчаць "${s.includes}"`:s.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${s.pattern}`:`Няправільны ${i[s.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${A(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function VN(){return{localeError:JN()}}const WN=()=>{const e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipus invàlid: s'esperava ${n.expected}, s'ha rebut ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${K(n.values[0])}`:`Opció invàlida: s'esperava una de ${A(n.values," o ")}`;case"too_big":{const s=n.inclusive?"com a màxim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${s} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${s} ${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?"com a mínim":"més de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingués ${s} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${s} ${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Format invàlid: ha de començar amb "${s.prefix}"`:s.format==="ends_with"?`Format invàlid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format invàlid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${s.pattern}`:`Format invàlid per a ${i[s.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${A(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function qN(){return{localeError:WN()}}const GN=()=>{const e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return n=>{switch(n.code){case"invalid_type":return`Neplatný vstup: očekáváno ${n.expected}, obdrženo ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${K(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${s}${n.maximum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${s}${n.minimum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Neplatný řetězec: musí začínat na "${s.prefix}"`:s.format==="ends_with"?`Neplatný řetězec: musí končit na "${s.suffix}"`:s.format==="includes"?`Neplatný řetězec: musí obsahovat "${s.includes}"`:s.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${s.pattern}`:`Neplatný formát ${i[s.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${A(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function YN(){return{localeError:GN()}}const KN=()=>{const e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return n=>{switch(n.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${n.expected}, erhalten ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${K(n.values[0])}`:`Ungültige Option: erwartet eine von ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${s}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${s}${n.maximum.toString()} ist`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${s}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${s}${n.minimum.toString()} ist`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Ungültiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ungültiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ungültiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ungültiger String: muss dem Muster ${s.pattern} entsprechen`:`Ungültig: ${i[s.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${A(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function XN(){return{localeError:KN()}}const HN=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},QN=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(i){return e[i]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${HN(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${K(i.values[0])}`:`Invalid option: expected one of ${A(i.values,"|")}`;case"too_big":{const n=i.inclusive?"<=":"<",s=t(i.origin);return s?`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{const n=i.inclusive?">=":">",s=t(i.origin);return s?`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${s.unit}`:`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{const n=i;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${r[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${A(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Zb(){return{localeError:QN()}}const eT=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"arreglo";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype)return n.constructor.name}}return s},i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Entrada inválida: se esperaba ${n.expected}, recibido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inválida: se esperaba ${K(n.values[0])}`:`Opción inválida: se esperaba una de ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Demasiado grande: se esperaba que ${n.origin??"valor"} tuviera ${s}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${n.origin??"valor"} fuera ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Demasiado pequeño: se esperaba que ${n.origin} tuviera ${s}${n.minimum.toString()} ${a.unit}`:`Demasiado pequeño: se esperaba que ${n.origin} fuera ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Cadena inválida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inválida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inválida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${s.pattern}`:`Inválido ${i[s.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${A(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${n.origin}`;default:return"Entrada inválida"}}};function tT(){return{localeError:eT()}}const nT=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"آرایه";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return n=>{switch(n.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${n.expected} می‌بود، ${r(n.input)} دریافت شد`;case"invalid_value":return n.values.length===1?`ورودی نامعتبر: می‌بایست ${K(n.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${A(n.values,"|")} می‌بود`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${s}${n.maximum.toString()} ${a.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${s}${n.maximum.toString()} باشد`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`خیلی کوچک: ${n.origin} باید ${s}${n.minimum.toString()} ${a.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${s}${n.minimum.toString()} باشد`}case"invalid_format":{const s=n;return s.format==="starts_with"?`رشته نامعتبر: باید با "${s.prefix}" شروع شود`:s.format==="ends_with"?`رشته نامعتبر: باید با "${s.suffix}" تمام شود`:s.format==="includes"?`رشته نامعتبر: باید شامل "${s.includes}" باشد`:s.format==="regex"?`رشته نامعتبر: باید با الگوی ${s.pattern} مطابقت داشته باشد`:`${i[s.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${A(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function rT(){return{localeError:nT()}}const iT=()=>{const e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${K(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} täytyy olla ${s}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon täytyy olla ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} täytyy olla ${s}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon täytyy olla ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen syöte: täytyy sisältää "${s.includes}"`:s.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${s.pattern}`:`Virheellinen ${i[s.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${A(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function sT(){return{localeError:iT()}}const aT=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return n=>{switch(n.code){case"invalid_type":return`Entrée invalide : ${n.expected} attendu, ${r(n.input)} reçu`;case"invalid_value":return n.values.length===1?`Entrée invalide : ${K(n.values[0])} attendu`:`Option invalide : une valeur parmi ${A(n.values,"|")} attendue`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${s}${n.maximum.toString()} ${a.unit??"élément(s)"}`:`Trop grand : ${n.origin??"valeur"} doit être ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${s}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit être ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Chaîne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Chaîne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Chaîne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${s.pattern}`:`${i[s.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${A(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function oT(){return{localeError:aT()}}const uT=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return n=>{switch(n.code){case"invalid_type":return`Entrée invalide : attendu ${n.expected}, reçu ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${K(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"≤":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${s}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?"≥":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${s}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Chaîne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Chaîne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Chaîne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Chaîne invalide : doit correspondre au motif ${s.pattern}`:`${i[s.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${A(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function cT(){return{localeError:uT()}}const lT=()=>{const e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return n=>{switch(n.code){case"invalid_type":return`קלט לא תקין: צריך ${n.expected}, התקבל ${r(n.input)}`;case"invalid_value":return n.values.length===1?`קלט לא תקין: צריך ${K(n.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`גדול מדי: ${n.origin??"value"} צריך להיות ${s}${n.maximum.toString()} ${a.unit??"elements"}`:`גדול מדי: ${n.origin??"value"} צריך להיות ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`קטן מדי: ${n.origin} צריך להיות ${s}${n.minimum.toString()} ${a.unit}`:`קטן מדי: ${n.origin} צריך להיות ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`מחרוזת לא תקינה: חייבת להתחיל ב"${s.prefix}"`:s.format==="ends_with"?`מחרוזת לא תקינה: חייבת להסתיים ב "${s.suffix}"`:s.format==="includes"?`מחרוזת לא תקינה: חייבת לכלול "${s.includes}"`:s.format==="regex"?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${s.pattern}`:`${i[s.format]??n.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${n.divisor}`;case"unrecognized_keys":return`מפתח${n.keys.length>1?"ות":""} לא מזוה${n.keys.length>1?"ים":"ה"}: ${A(n.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${n.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n.origin}`;default:return"קלט לא תקין"}}};function dT(){return{localeError:lT()}}const hT=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"szám";case"object":{if(Array.isArray(n))return"tömb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return n=>{switch(n.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${n.expected}, a kapott érték ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${K(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${s}${n.maximum.toString()} ${a.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${s}${n.minimum.toString()} ${a.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Érvénytelen string: "${s.prefix}" értékkel kell kezdődnie`:s.format==="ends_with"?`Érvénytelen string: "${s.suffix}" értékkel kell végződnie`:s.format==="includes"?`Érvénytelen string: "${s.includes}" értéket kell tartalmaznia`:s.format==="regex"?`Érvénytelen string: ${s.pattern} mintának kell megfelelnie`:`Érvénytelen ${i[s.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${A(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function mT(){return{localeError:hT()}}const fT=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${K(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${s}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${s}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${i[s.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${A(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function pT(){return{localeError:fT()}}const vT=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${K(n.values[0])}`:`Opzione non valida: atteso uno tra ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${s}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${s}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${i[s.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${A(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function gT(){return{localeError:vT()}}const yT=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"数値";case"object":{if(Array.isArray(n))return"配列";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return n=>{switch(n.code){case"invalid_type":return`無効な入力: ${n.expected}が期待されましたが、${r(n.input)}が入力されました`;case"invalid_value":return n.values.length===1?`無効な入力: ${K(n.values[0])}が期待されました`:`無効な選択: ${A(n.values,"、")}のいずれかである必要があります`;case"too_big":{const s=n.inclusive?"以下である":"より小さい",a=t(n.origin);return a?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${a.unit??"要素"}${s}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${s}必要があります`}case"too_small":{const s=n.inclusive?"以上である":"より大きい",a=t(n.origin);return a?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${a.unit}${s}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${s}必要があります`}case"invalid_format":{const s=n;return s.format==="starts_with"?`無効な文字列: "${s.prefix}"で始まる必要があります`:s.format==="ends_with"?`無効な文字列: "${s.suffix}"で終わる必要があります`:s.format==="includes"?`無効な文字列: "${s.includes}"を含む必要があります`:s.format==="regex"?`無効な文字列: パターン${s.pattern}に一致する必要があります`:`無効な${i[s.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${A(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function bT(){return{localeError:yT()}}const wT=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(n))return"អារេ (Array)";if(n===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return n=>{switch(n.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${n.expected} ប៉ុន្តែទទួលបាន ${r(n.input)}`;case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${K(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${s} ${n.maximum.toString()} ${a.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${s} ${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`តូចពេក៖ ត្រូវការ ${n.origin} ${s} ${n.minimum.toString()} ${a.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${s} ${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${s.prefix}"`:s.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${s.suffix}"`:s.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${s.includes}"`:s.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${s.pattern}`:`មិនត្រឹមត្រូវ៖ ${i[s.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${A(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function $T(){return{localeError:wT()}}const _T=()=>{const e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return n=>{switch(n.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${n.expected}, 받은 타입은 ${r(n.input)}입니다`;case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${K(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${A(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const s=n.inclusive?"이하":"미만",a=s==="미만"?"이어야 합니다":"여야 합니다",o=t(n.origin),u=(o==null?void 0:o.unit)??"요소";return o?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${u} ${s}${a}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${s}${a}`}case"too_small":{const s=n.inclusive?"이상":"초과",a=s==="이상"?"이어야 합니다":"여야 합니다",o=t(n.origin),u=(o==null?void 0:o.unit)??"요소";return o?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${u} ${s}${a}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${s}${a}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`잘못된 문자열: "${s.prefix}"(으)로 시작해야 합니다`:s.format==="ends_with"?`잘못된 문자열: "${s.suffix}"(으)로 끝나야 합니다`:s.format==="includes"?`잘못된 문자열: "${s.includes}"을(를) 포함해야 합니다`:s.format==="regex"?`잘못된 문자열: 정규식 ${s.pattern} 패턴과 일치해야 합니다`:`잘못된 ${i[s.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${A(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function kT(){return{localeError:_T()}}const IT=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"број";case"object":{if(Array.isArray(n))return"низа";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return n=>{switch(n.code){case"invalid_type":return`Грешен внес: се очекува ${n.expected}, примено ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${K(n.values[0])}`:`Грешана опција: се очекува една ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${s}${n.maximum.toString()} ${a.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Премногу мал: се очекува ${n.origin} да има ${s}${n.minimum.toString()} ${a.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Неважечка низа: мора да започнува со "${s.prefix}"`:s.format==="ends_with"?`Неважечка низа: мора да завршува со "${s.suffix}"`:s.format==="includes"?`Неважечка низа: мора да вклучува "${s.includes}"`:s.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${s.pattern}`:`Invalid ${i[s.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${A(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function OT(){return{localeError:IT()}}const ST=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${K(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${s}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${s}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${i[s.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${A(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function zT(){return{localeError:ST()}}const xT=()=>{const e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${K(n.values[0])}`:`Ongeldige optie: verwacht één van ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Te lang: verwacht dat ${n.origin??"waarde"} ${s}${n.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${n.origin??"waarde"} ${s}${n.maximum.toString()} is`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Te kort: verwacht dat ${n.origin} ${s}${n.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${n.origin} ${s}${n.minimum.toString()} is`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${i[s.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${A(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function NT(){return{localeError:xT()}}const TT=()=>{const e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${K(n.values[0])}`:`Ugyldig valg: forventet en av ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til å ha ${s}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til å ha ${s}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til å ha ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Ugyldig streng: må starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: må ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: må inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: må matche mønsteret ${s.pattern}`:`Ugyldig ${i[s.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${A(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function UT(){return{localeError:TT()}}const ET=()=>{const e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return n=>{switch(n.code){case"invalid_type":return`Fâsit giren: umulan ${n.expected}, alınan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${K(n.values[0])}`:`Fâsit tercih: mûteberler ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla büyük: ${n.origin??"value"}, ${s}${n.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${s}${n.maximum.toString()} olmalıydı.`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla küçük: ${n.origin}, ${s}${n.minimum.toString()} ${a.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${s}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Fâsit metin: "${s.prefix}" ile başlamalı.`:s.format==="ends_with"?`Fâsit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`Fâsit metin: "${s.includes}" ihtivâ etmeli.`:s.format==="regex"?`Fâsit metin: ${s.pattern} nakşına uymalı.`:`Fâsit ${i[s.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${A(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function jT(){return{localeError:ET()}}const AT=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"ارې";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return n=>{switch(n.code){case"invalid_type":return`ناسم ورودي: باید ${n.expected} وای, مګر ${r(n.input)} ترلاسه شو`;case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${K(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${A(n.values,"|")} څخه وای`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`ډیر لوی: ${n.origin??"ارزښت"} باید ${s}${n.maximum.toString()} ${a.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${s}${n.maximum.toString()} وي`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`ډیر کوچنی: ${n.origin} باید ${s}${n.minimum.toString()} ${a.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${s}${n.minimum.toString()} وي`}case"invalid_format":{const s=n;return s.format==="starts_with"?`ناسم متن: باید د "${s.prefix}" سره پیل شي`:s.format==="ends_with"?`ناسم متن: باید د "${s.suffix}" سره پای ته ورسيږي`:s.format==="includes"?`ناسم متن: باید "${s.includes}" ولري`:s.format==="regex"?`ناسم متن: باید د ${s.pattern} سره مطابقت ولري`:`${i[s.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${A(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function PT(){return{localeError:AT()}}const ZT=()=>{const e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return n=>{switch(n.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${n.expected}, otrzymano ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${K(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${s}${n.maximum.toString()} ${a.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${s}${n.minimum.toString()} ${a.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${s.prefix}"`:s.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${s.suffix}"`:s.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${s.includes}"`:s.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${s.pattern}`:`Nieprawidłow(y/a/e) ${i[s.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${A(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function DT(){return{localeError:ZT()}}const CT=()=>{const e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipo inválido: esperado ${n.expected}, recebido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${K(n.values[0])}`:`Opção inválida: esperada uma das ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${s}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${s}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Texto inválido: deve começar com "${s.prefix}"`:s.format==="ends_with"?`Texto inválido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inválido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inválido: deve corresponder ao padrão ${s.pattern}`:`${i[s.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${A(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function RT(){return{localeError:CT()}}function Tm(e,t,r,i){const n=Math.abs(e),s=n%10,a=n%100;return a>=11&&a<=19?i:s===1?t:s>=2&&s<=4?r:i}const LT=()=>{const e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"массив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return n=>{switch(n.code){case"invalid_type":return`Неверный ввод: ожидалось ${n.expected}, получено ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Неверный ввод: ожидалось ${K(n.values[0])}`:`Неверный вариант: ожидалось одно из ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);if(a){const o=Number(n.maximum),u=Tm(o,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${s}${n.maximum.toString()} ${u}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);if(a){const o=Number(n.minimum),u=Tm(o,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${s}${n.minimum.toString()} ${u}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Неверная строка: должна начинаться с "${s.prefix}"`:s.format==="ends_with"?`Неверная строка: должна заканчиваться на "${s.suffix}"`:s.format==="includes"?`Неверная строка: должна содержать "${s.includes}"`:s.format==="regex"?`Неверная строка: должна соответствовать шаблону ${s.pattern}`:`Неверный ${i[s.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${A(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function MT(){return{localeError:LT()}}const BT=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"število";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${n.expected}, prejeto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${K(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${s}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pričakovano, da bo ${n.origin} imelo ${s}${n.minimum.toString()} ${a.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Neveljaven niz: mora se začeti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se končati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${i[s.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${A(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function FT(){return{localeError:BT()}}const JT=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${n.expected}, fick ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${K(n.values[0])}`:`Ogiltigt val: förväntade en av ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${s}${n.maximum.toString()} ${a.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${s}${n.minimum.toString()} ${a.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Ogiltig sträng: måste börja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig sträng: måste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig sträng: måste innehålla "${s.includes}"`:s.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${s.pattern}"`:`Ogiltig(t) ${i[s.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${A(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function VT(){return{localeError:JT()}}const WT=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(n))return"அணி";if(n===null)return"வெறுமை";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${n.expected}, பெறப்பட்டது ${r(n.input)}`;case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${K(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${A(n.values,"|")} இல் ஒன்று`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${s}${n.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${s}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${s}${n.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${s}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const s=n;return s.format==="starts_with"?`தவறான சரம்: "${s.prefix}" இல் தொடங்க வேண்டும்`:s.format==="ends_with"?`தவறான சரம்: "${s.suffix}" இல் முடிவடைய வேண்டும்`:s.format==="includes"?`தவறான சரம்: "${s.includes}" ஐ உள்ளடக்க வேண்டும்`:s.format==="regex"?`தவறான சரம்: ${s.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${i[s.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${A(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function qT(){return{localeError:WT()}}const GT=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(n))return"อาร์เรย์ (Array)";if(n===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return n=>{switch(n.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${n.expected} แต่ได้รับ ${r(n.input)}`;case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${K(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(n.origin);return a?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${s} ${n.maximum.toString()} ${a.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${s} ${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?"อย่างน้อย":"มากกว่า",a=t(n.origin);return a?`น้อยกว่ากำหนด: ${n.origin} ควรมี${s} ${n.minimum.toString()} ${a.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${s} ${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${s.prefix}"`:s.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${s.suffix}"`:s.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${s.includes}" อยู่ในข้อความ`:s.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${s.pattern}`:`รูปแบบไม่ถูกต้อง: ${i[s.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${A(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function YT(){return{localeError:GT()}}const KT=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},XT=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(i){return e[i]??null}const r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return i=>{switch(i.code){case"invalid_type":return`Geçersiz değer: beklenen ${i.expected}, alınan ${KT(i.input)}`;case"invalid_value":return i.values.length===1?`Geçersiz değer: beklenen ${K(i.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${A(i.values,"|")}`;case"too_big":{const n=i.inclusive?"<=":"<",s=t(i.origin);return s?`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()} ${s.unit??"öğe"}`:`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()}`}case"too_small":{const n=i.inclusive?">=":">",s=t(i.origin);return s?`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()} ${s.unit}`:`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{const n=i;return n.format==="starts_with"?`Geçersiz metin: "${n.prefix}" ile başlamalı`:n.format==="ends_with"?`Geçersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Geçersiz metin: "${n.includes}" içermeli`:n.format==="regex"?`Geçersiz metin: ${n.pattern} desenine uymalı`:`Geçersiz ${r[n.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${A(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function HT(){return{localeError:XT()}}const QT=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"масив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return n=>{switch(n.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${n.expected}, отримано ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${K(n.values[0])}`:`Неправильна опція: очікується одне з ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Занадто велике: очікується, що ${n.origin??"значення"} ${a.verb} ${s}${n.maximum.toString()} ${a.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Занадто мале: очікується, що ${n.origin} ${a.verb} ${s}${n.minimum.toString()} ${a.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Неправильний рядок: повинен починатися з "${s.prefix}"`:s.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${s.suffix}"`:s.format==="includes"?`Неправильний рядок: повинен містити "${s.includes}"`:s.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${s.pattern}`:`Неправильний ${i[s.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${A(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function eU(){return{localeError:QT()}}const tU=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"نمبر";case"object":{if(Array.isArray(n))return"آرے";if(n===null)return"نل";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return n=>{switch(n.code){case"invalid_type":return`غلط ان پٹ: ${n.expected} متوقع تھا، ${r(n.input)} موصول ہوا`;case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${K(n.values[0])} متوقع تھا`:`غلط آپشن: ${A(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`بہت بڑا: ${n.origin??"ویلیو"} کے ${s}${n.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${s}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`بہت چھوٹا: ${n.origin} کے ${s}${n.minimum.toString()} ${a.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${s}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const s=n;return s.format==="starts_with"?`غلط سٹرنگ: "${s.prefix}" سے شروع ہونا چاہیے`:s.format==="ends_with"?`غلط سٹرنگ: "${s.suffix}" پر ختم ہونا چاہیے`:s.format==="includes"?`غلط سٹرنگ: "${s.includes}" شامل ہونا چاہیے`:s.format==="regex"?`غلط سٹرنگ: پیٹرن ${s.pattern} سے میچ ہونا چاہیے`:`غلط ${i[s.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${A(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function nU(){return{localeError:tU()}}const rU=()=>{const e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"số";case"object":{if(Array.isArray(n))return"mảng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return n=>{switch(n.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${n.expected}, nhận được ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${K(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${a.verb} ${s}${n.maximum.toString()} ${a.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Quá nhỏ: mong đợi ${n.origin} ${a.verb} ${s}${n.minimum.toString()} ${a.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${s.prefix}"`:s.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${s.suffix}"`:s.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${s.includes}"`:s.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${s.pattern}`:`${i[s.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${A(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function iU(){return{localeError:rU()}}const sU=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(n))return"数组";if(n===null)return"空值(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return n=>{switch(n.code){case"invalid_type":return`无效输入:期望 ${n.expected},实际接收 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`无效输入:期望 ${K(n.values[0])}`:`无效选项:期望以下之一 ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`数值过大:期望 ${n.origin??"值"} ${s}${n.maximum.toString()} ${a.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`数值过小:期望 ${n.origin} ${s}${n.minimum.toString()} ${a.unit}`:`数值过小:期望 ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`无效字符串:必须以 "${s.prefix}" 开头`:s.format==="ends_with"?`无效字符串:必须以 "${s.suffix}" 结尾`:s.format==="includes"?`无效字符串:必须包含 "${s.includes}"`:s.format==="regex"?`无效字符串:必须满足正则表达式 ${s.pattern}`:`无效${i[s.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${A(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function aU(){return{localeError:sU()}}const oU=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return n=>{switch(n.code){case"invalid_type":return`無效的輸入值:預期為 ${n.expected},但收到 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${K(n.values[0])}`:`無效的選項:預期為以下其中之一 ${A(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`數值過大:預期 ${n.origin??"值"} 應為 ${s}${n.maximum.toString()} ${a.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`數值過小:預期 ${n.origin} 應為 ${s}${n.minimum.toString()} ${a.unit}`:`數值過小:預期 ${n.origin} 應為 ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`無效的字串:必須以 "${s.prefix}" 開頭`:s.format==="ends_with"?`無效的字串:必須以 "${s.suffix}" 結尾`:s.format==="includes"?`無效的字串:必須包含 "${s.includes}"`:s.format==="regex"?`無效的字串:必須符合格式 ${s.pattern}`:`無效的 ${i[s.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${A(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function uU(){return{localeError:oU()}}const Db=Object.freeze(Object.defineProperty({__proto__:null,ar:MN,az:FN,be:VN,ca:qN,cs:YN,de:XN,en:Zb,es:tT,fa:rT,fi:sT,fr:oT,frCA:cT,he:dT,hu:mT,id:pT,it:gT,ja:bT,kh:$T,ko:kT,mk:OT,ms:zT,nl:NT,no:UT,ota:jT,pl:DT,ps:PT,pt:RT,ru:MT,sl:FT,sv:VT,ta:qT,th:YT,tr:HT,ua:eU,ur:nU,vi:iU,zhCN:aU,zhTW:uU},Symbol.toStringTag,{value:"Module"}));let Cb=class{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw new Error("implement() must be called with a function");const t=(...r)=>{const i=this._def.input?Jo(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(i))throw new Error("Invalid arguments schema: not an array or tuple schema.");const n=e(...i);return this._def.output?Jo(this._def.output,n,void 0,{callee:t}):n};return t}implementAsync(e){if(typeof e!="function")throw new Error("implement() must be called with a function");const t=async(...r)=>{const i=this._def.input?await Vo(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(i))throw new Error("Invalid arguments schema: not an array or tuple schema.");const n=await e(...i);return this._def.output?Vo(this._def.output,n,void 0,{callee:t}):n};return t}input(...e){const t=this.constructor;return Array.isArray(e[0])?new t({type:"function",input:new ha({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new t({type:"function",input:e[0],output:this._def.output})}output(e){const t=this.constructor;return new t({type:"function",input:this._def.input,output:e})}};function Rb(e){return new Cb({type:"function",input:Array.isArray(e==null?void 0:e.input)?by(ha,e==null?void 0:e.input):(e==null?void 0:e.input)??qc(uc,Zs(As)),output:(e==null?void 0:e.output)??Zs(As)})}let Qo=class{constructor(e){this.counter=0,this.metadataRegistry=(e==null?void 0:e.metadata)??fn,this.target=(e==null?void 0:e.target)??"draft-2020-12",this.unrepresentable=(e==null?void 0:e.unrepresentable)??"throw",this.override=(e==null?void 0:e.override)??(()=>{}),this.io=(e==null?void 0:e.io)??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var r,i,n,s;const a=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},u=this.seen.get(e);if(u)return u.count++,t.schemaPath.includes(e)&&(u.cycle=t.path),u.schema;const c={schema:{},count:1,cycle:void 0};this.seen.set(e,c);const l=(i=(r=e._zod).toJSONSchema)==null?void 0:i.call(r);if(l)c.schema=l;else{const m={...t,schemaPath:[...t.schemaPath,e],path:t.path},y=e._zod.parent;if(y)c.ref=y,this.process(y,m),this.seen.get(y).isParent=!0;else{const k=c.schema;switch(a.type){case"string":{const v=k;v.type="string";const{minimum:f,maximum:p,format:g,patterns:w,contentEncoding:x}=e._zod.bag;if(typeof f=="number"&&(v.minLength=f),typeof p=="number"&&(v.maxLength=p),g&&(v.format=o[g]??g,v.format===""&&delete v.format),x&&(v.contentEncoding=x),w&&w.size>0){const C=[...w];C.length===1?v.pattern=C[0].source:C.length>1&&(c.schema.allOf=[...C.map(ne=>({...this.target==="draft-7"?{type:"string"}:{},pattern:ne.source}))])}break}case"number":{const v=k,{minimum:f,maximum:p,format:g,multipleOf:w,exclusiveMaximum:x,exclusiveMinimum:C}=e._zod.bag;typeof g=="string"&&g.includes("int")?v.type="integer":v.type="number",typeof C=="number"&&(v.exclusiveMinimum=C),typeof f=="number"&&(v.minimum=f,typeof C=="number"&&(C>=f?delete v.minimum:delete v.exclusiveMinimum)),typeof x=="number"&&(v.exclusiveMaximum=x),typeof p=="number"&&(v.maximum=p,typeof x=="number"&&(x<=p?delete v.maximum:delete v.exclusiveMaximum)),typeof w=="number"&&(v.multipleOf=w);break}case"boolean":{const v=k;v.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"undefined":{const v=k;v.type="null";break}case"null":{k.type="null";break}case"any":break;case"unknown":break;case"never":{k.not={};break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const v=k,{minimum:f,maximum:p}=e._zod.bag;typeof f=="number"&&(v.minItems=f),typeof p=="number"&&(v.maxItems=p),v.type="array",v.items=this.process(a.element,{...m,path:[...m.path,"items"]});break}case"object":{const v=k;v.type="object",v.properties={};const f=a.shape;for(const w in f)v.properties[w]=this.process(f[w],{...m,path:[...m.path,"properties",w]});const p=new Set(Object.keys(f)),g=new Set([...p].filter(w=>{const x=a.shape[w]._zod;return this.io==="input"?x.optin===void 0:x.optout===void 0}));g.size>0&&(v.required=Array.from(g)),((n=a.catchall)==null?void 0:n._zod.def.type)==="never"?v.additionalProperties=!1:a.catchall?a.catchall&&(v.additionalProperties=this.process(a.catchall,{...m,path:[...m.path,"additionalProperties"]})):this.io==="output"&&(v.additionalProperties=!1);break}case"union":{const v=k;v.anyOf=a.options.map((f,p)=>this.process(f,{...m,path:[...m.path,"anyOf",p]}));break}case"intersection":{const v=k,f=this.process(a.left,{...m,path:[...m.path,"allOf",0]}),p=this.process(a.right,{...m,path:[...m.path,"allOf",1]}),g=x=>"allOf"in x&&Object.keys(x).length===1,w=[...g(f)?f.allOf:[f],...g(p)?p.allOf:[p]];v.allOf=w;break}case"tuple":{const v=k;v.type="array";const f=a.items.map((w,x)=>this.process(w,{...m,path:[...m.path,"prefixItems",x]}));if(this.target==="draft-2020-12"?v.prefixItems=f:v.items=f,a.rest){const w=this.process(a.rest,{...m,path:[...m.path,"items"]});this.target==="draft-2020-12"?v.items=w:v.additionalItems=w}a.rest&&(v.items=this.process(a.rest,{...m,path:[...m.path,"items"]}));const{minimum:p,maximum:g}=e._zod.bag;typeof p=="number"&&(v.minItems=p),typeof g=="number"&&(v.maxItems=g);break}case"record":{const v=k;v.type="object",v.propertyNames=this.process(a.keyType,{...m,path:[...m.path,"propertyNames"]}),v.additionalProperties=this.process(a.valueType,{...m,path:[...m.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const v=k,f=Wu(a.entries);f.every(p=>typeof p=="number")&&(v.type="number"),f.every(p=>typeof p=="string")&&(v.type="string"),v.enum=f;break}case"literal":{const v=k,f=[];for(const p of a.values)if(p===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof p=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");f.push(Number(p))}else f.push(p);if(f.length!==0)if(f.length===1){const p=f[0];v.type=p===null?"null":typeof p,v.const=p}else f.every(p=>typeof p=="number")&&(v.type="number"),f.every(p=>typeof p=="string")&&(v.type="string"),f.every(p=>typeof p=="boolean")&&(v.type="string"),f.every(p=>p===null)&&(v.type="null"),v.enum=f;break}case"file":{const v=k,f={type:"string",format:"binary",contentEncoding:"binary"},{minimum:p,maximum:g,mime:w}=e._zod.bag;p!==void 0&&(f.minLength=p),g!==void 0&&(f.maxLength=g),w?w.length===1?(f.contentMediaType=w[0],Object.assign(v,f)):v.anyOf=w.map(x=>({...f,contentMediaType:x})):Object.assign(v,f);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const v=this.process(a.innerType,m);k.anyOf=[v,{type:"null"}];break}case"nonoptional":{this.process(a.innerType,m),c.ref=a.innerType;break}case"success":{const v=k;v.type="boolean";break}case"default":{this.process(a.innerType,m),c.ref=a.innerType,k.default=JSON.parse(JSON.stringify(a.defaultValue));break}case"prefault":{this.process(a.innerType,m),c.ref=a.innerType,this.io==="input"&&(k._prefault=JSON.parse(JSON.stringify(a.defaultValue)));break}case"catch":{this.process(a.innerType,m),c.ref=a.innerType;let v;try{v=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}k.default=v;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const v=k,f=e._zod.pattern;if(!f)throw new Error("Pattern not found in template literal");v.type="string",v.pattern=f.source;break}case"pipe":{const v=this.io==="input"?a.in._zod.def.type==="transform"?a.out:a.in:a.out;this.process(v,m),c.ref=v;break}case"readonly":{this.process(a.innerType,m),c.ref=a.innerType,k.readOnly=!0;break}case"promise":{this.process(a.innerType,m),c.ref=a.innerType;break}case"optional":{this.process(a.innerType,m),c.ref=a.innerType;break}case"lazy":{const v=e._zod.innerType;this.process(v,m),c.ref=v;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const d=this.metadataRegistry.get(e);return d&&Object.assign(c.schema,d),this.io==="input"&&Ve(e)&&(delete c.schema.examples,delete c.schema.default),this.io==="input"&&c.schema._prefault&&((s=c.schema).default??(s.default=c.schema._prefault)),delete c.schema._prefault,this.seen.get(e).schema}emit(e,t){var r,i,n,s;const a={cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",external:(t==null?void 0:t.external)??void 0},o=this.seen.get(e);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");const u=y=>{var k;const v=this.target==="draft-2020-12"?"$defs":"definitions";if(a.external){const g=(k=a.external.registry.get(y[0]))==null?void 0:k.id;if(g)return{ref:a.external.uri(g)};const w=y[1].defId??y[1].schema.id??`schema${this.counter++}`;return y[1].defId=w,{defId:w,ref:`${a.external.uri("__shared")}#/${v}/${w}`}}if(y[1]===o)return{ref:"#"};const f=`#/${v}/`,p=y[1].schema.id??`__schema${this.counter++}`;return{defId:p,ref:f+p}},c=y=>{if(y[1].schema.$ref)return;const k=y[1],{ref:v,defId:f}=u(y);k.def={...k.schema},f&&(k.defId=f);const p=k.schema;for(const g in p)delete p[g];p.$ref=v};for(const y of this.seen.entries()){const k=y[1];if(e===y[0]){c(y);continue}if(a.external){const v=(r=a.external.registry.get(y[0]))==null?void 0:r.id;if(e!==y[0]&&v){c(y);continue}}if((i=this.metadataRegistry.get(y[0]))!=null&&i.id){c(y);continue}if(k.cycle){if(a.cycles==="throw")throw new Error(`Cycle detected: #/${(n=k.cycle)==null?void 0:n.join("/")}/<root>
35
+
36
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);a.cycles==="ref"&&c(y);continue}if(k.count>1&&a.reused==="ref"){c(y);continue}}const l=(y,k)=>{const v=this.seen.get(y),f=v.def??v.schema,p={...f};if(v.ref===null)return;const g=v.ref;if(v.ref=null,g){l(g,k);const w=this.seen.get(g).schema;w.$ref&&k.target==="draft-7"?(f.allOf=f.allOf??[],f.allOf.push(w)):(Object.assign(f,w),Object.assign(f,p))}v.isParent||this.override({zodSchema:y,jsonSchema:f})};for(const y of[...this.seen.entries()].reverse())l(y[0],{target:this.target});const d={};this.target==="draft-2020-12"?d.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?d.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(d,o.def);const m=((s=a.external)==null?void 0:s.defs)??{};for(const y of this.seen.entries()){const k=y[1];k.def&&k.defId&&(m[k.defId]=k.def)}!a.external&&Object.keys(m).length>0&&(this.target==="draft-2020-12"?d.$defs=m:d.definitions=m);try{return JSON.parse(JSON.stringify(d))}catch{throw new Error("Error converting schema to JSON.")}}};function Lb(e,t){if(e instanceof hc){const i=new Qo(t),n={};for(const o of e._idmap.entries()){const[u,c]=o;i.process(c)}const s={},a={registry:e,uri:(t==null?void 0:t.uri)||(o=>o),defs:n};for(const o of e._idmap.entries()){const[u,c]=o;s[u]=i.emit(c,{...t,external:a})}if(Object.keys(n).length>0){const o=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[o]:n}}return{schemas:s}}const r=new Qo(t);return r.process(e),r.emit(e,t)}function Ve(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const i=e._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Ve(i.element,r);case"object":{for(const n in i.shape)if(Ve(i.shape[n],r))return!0;return!1}case"union":{for(const n of i.options)if(Ve(n,r))return!0;return!1}case"intersection":return Ve(i.left,r)||Ve(i.right,r);case"tuple":{for(const n of i.items)if(Ve(n,r))return!0;return!!(i.rest&&Ve(i.rest,r))}case"record":return Ve(i.keyType,r)||Ve(i.valueType,r);case"map":return Ve(i.keyType,r)||Ve(i.valueType,r);case"set":return Ve(i.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Ve(i.innerType,r);case"lazy":return Ve(i.getter(),r);case"default":return Ve(i.innerType,r);case"prefault":return Ve(i.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Ve(i.in,r)||Ve(i.out,r);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}const cU=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),lU=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:dg,$ZodArray:uc,$ZodAsyncError:nr,$ZodBase64:eg,$ZodBase64URL:ng,$ZodBigInt:oc,$ZodBigIntFormat:og,$ZodBoolean:ac,$ZodCIDRv4:Hv,$ZodCIDRv6:Qv,$ZodCUID:Mv,$ZodCUID2:Bv,$ZodCatch:Tg,$ZodCheck:Be,$ZodCheckBigIntFormat:gv,$ZodCheckEndsWith:Nv,$ZodCheckGreaterThan:rc,$ZodCheckIncludes:zv,$ZodCheckLengthEquals:kv,$ZodCheckLessThan:nc,$ZodCheckLowerCase:Ov,$ZodCheckMaxLength:$v,$ZodCheckMaxSize:yv,$ZodCheckMimeType:Uv,$ZodCheckMinLength:_v,$ZodCheckMinSize:bv,$ZodCheckMultipleOf:pv,$ZodCheckNumberFormat:vv,$ZodCheckOverwrite:Ev,$ZodCheckProperty:Tv,$ZodCheckRegex:Iv,$ZodCheckSizeEquals:wv,$ZodCheckStartsWith:xv,$ZodCheckStringFormat:Ei,$ZodCheckUpperCase:Sv,$ZodCustom:Zg,$ZodDate:fg,$ZodDefault:Sg,$ZodDiscriminatedUnion:vg,$ZodE164:rg,$ZodEmail:Dv,$ZodEmoji:Rv,$ZodEnum:$g,$ZodError:Gu,$ZodFile:kg,$ZodFunction:Cb,$ZodGUID:Pv,$ZodIPv4:Kv,$ZodIPv6:Xv,$ZodISODate:qv,$ZodISODateTime:Wv,$ZodISODuration:Yv,$ZodISOTime:Gv,$ZodIntersection:gg,$ZodJWT:sg,$ZodKSUID:Vv,$ZodLazy:Pg,$ZodLiteral:_g,$ZodMap:bg,$ZodNaN:Ug,$ZodNanoID:Lv,$ZodNever:hg,$ZodNonOptional:xg,$ZodNull:lg,$ZodNullable:Og,$ZodNumber:sc,$ZodNumberFormat:ag,$ZodObject:pg,$ZodOptional:Ig,$ZodPipe:dc,$ZodPrefault:zg,$ZodPromise:Ag,$ZodReadonly:Eg,$ZodRealError:Ui,$ZodRecord:yg,$ZodRegistry:hc,$ZodSet:wg,$ZodString:ji,$ZodStringFormat:we,$ZodSuccess:Ng,$ZodSymbol:ug,$ZodTemplateLiteral:jg,$ZodTransform:lc,$ZodTuple:ha,$ZodType:J,$ZodULID:Fv,$ZodURL:Cv,$ZodUUID:Zv,$ZodUndefined:cg,$ZodUnion:cc,$ZodUnknown:As,$ZodVoid:mg,$ZodXID:Jv,$brand:pp,$constructor:$,$input:Cg,$output:Dg,Doc:jv,JSONSchema:cU,JSONSchemaGenerator:Qo,TimePrecision:Mg,_any:uy,_array:qc,_base64:Uc,_base64url:Ec,_bigint:ty,_boolean:Qg,_catch:cz,_cidrv4:Nc,_cidrv6:Tc,_coercedBigint:ny,_coercedBoolean:ey,_coercedDate:hy,_coercedNumber:qg,_coercedString:Lg,_cuid:_c,_cuid2:kc,_custom:$y,_date:dy,_default:az,_discriminatedUnion:Y0,_e164:jc,_email:fc,_emoji:wc,_endsWith:Mc,_enum:ez,_file:wy,_float32:Yg,_float64:Kg,_gt:wn,_gte:bt,_guid:Ps,_includes:Rc,_int:Gg,_int32:Xg,_int64:ry,_intersection:K0,_ipv4:zc,_ipv6:xc,_isoDate:Fg,_isoDateTime:Bg,_isoDuration:Vg,_isoTime:Jg,_jwt:Ac,_ksuid:Sc,_lazy:mz,_length:pa,_literal:nz,_lowercase:Dc,_lt:bn,_lte:zt,_map:H0,_max:zt,_maxLength:fa,_maxSize:ma,_mime:Bc,_min:bt,_minLength:sr,_minSize:mi,_multipleOf:hi,_nan:my,_nanoid:$c,_nativeEnum:tz,_negative:py,_never:cy,_nonnegative:gy,_nonoptional:oz,_nonpositive:vy,_normalize:Fc,_null:oy,_nullable:sz,_number:Wg,_optional:iz,_overwrite:jn,_parse:Xu,_parseAsync:Hu,_pipe:lz,_positive:fy,_promise:fz,_property:yy,_readonly:dz,_record:X0,_refine:_y,_regex:Zc,_safeParse:Qu,_safeParseAsync:ec,_set:Q0,_size:Pc,_startsWith:Lc,_string:Rg,_stringbool:ky,_success:uz,_symbol:sy,_templateLiteral:hz,_toLowerCase:Vc,_toUpperCase:Wc,_transform:rz,_trim:Jc,_tuple:by,_uint32:Hg,_uint64:iy,_ulid:Ic,_undefined:ay,_union:G0,_unknown:Zs,_uppercase:Cc,_url:bc,_uuid:pc,_uuidv4:vc,_uuidv6:gc,_uuidv7:yc,_void:ly,_xid:Oc,clone:Lt,config:ht,flattenError:Yu,formatError:Ku,function:Rb,globalConfig:Us,globalRegistry:fn,isValidBase64:ic,isValidBase64URL:tg,isValidJWT:ig,locales:Db,parse:Jo,parseAsync:Vo,prettifyError:Ep,regexes:mv,registry:mc,safeParse:jp,safeParseAsync:Ap,toDotPath:Up,toJSONSchema:Lb,treeifyError:Tp,util:C0,version:Av},Symbol.toStringTag,{value:"Module"})),dU={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},hU=Object.freeze({status:"aborted"}),mU=hU;function fU(e){ht({customError:e})}function pU(){return ht().customError}ht(Zb());const Re=Object.freeze(Object.defineProperty({__proto__:null,$brand:pp,$input:Cg,$output:Dg,NEVER:mU,TimePrecision:Mg,ZodAny:Cy,ZodArray:By,ZodBase64:hl,ZodBase64URL:ml,ZodBigInt:ba,ZodBigIntFormat:gl,ZodBoolean:ya,ZodCIDRv4:ll,ZodCIDRv6:dl,ZodCUID:rl,ZodCUID2:il,ZodCatch:sb,ZodCustom:ka,ZodDate:yl,ZodDefault:Qy,ZodDiscriminatedUnion:Fy,ZodE164:fl,ZodEmail:Qc,ZodEmoji:tl,ZodEnum:fi,ZodError:vz,ZodFile:Xy,ZodGUID:Ds,ZodIPv4:ul,ZodIPv6:cl,ZodISODate:Yc,ZodISODateTime:Gc,ZodISODuration:Xc,ZodISOTime:Kc,ZodIntersection:Jy,ZodIssueCode:dU,ZodJWT:pl,ZodKSUID:ol,ZodLazy:db,ZodLiteral:Yy,ZodMap:qy,ZodNaN:ob,ZodNanoID:nl,ZodNever:Ly,ZodNonOptional:Il,ZodNull:Dy,ZodNullable:Hy,ZodNumber:ga,ZodNumberFormat:wr,ZodObject:$a,ZodOptional:kl,ZodPipe:Ol,ZodPrefault:tb,ZodPromise:mb,ZodReadonly:ub,ZodRealError:Ai,ZodRecord:wl,ZodSet:Gy,ZodString:va,ZodStringFormat:Oe,ZodSuccess:ib,ZodSymbol:jy,ZodTemplateLiteral:lb,ZodTransform:$l,ZodTuple:Wy,ZodType:ee,ZodULID:sl,ZodURL:el,ZodUUID:Vt,ZodUndefined:Py,ZodUnion:bl,ZodUnknown:Ry,ZodVoid:My,ZodXID:al,_ZodString:Hc,_default:eb,any:Vz,array:Zi,base64:Pz,base64url:Zz,bigint:$n,boolean:vl,catch:ab,check:fb,cidrv4:jz,cidrv6:Az,clone:Lt,coerce:Hx,config:ht,core:lU,cuid:Sz,cuid2:zz,custom:ux,date:qz,discriminatedUnion:Xz,e164:Dz,email:gz,emoji:Iz,endsWith:Mc,enum:Qe,file:nx,flattenError:Yu,float32:Rz,float64:Lz,formatError:Ku,function:Rb,getErrorMap:pU,globalRegistry:fn,gt:wn,gte:bt,guid:yz,includes:Rc,instanceof:ye,int:qo,int32:Mz,int64:Fz,intersection:Vy,ipv4:Uz,ipv6:Ez,iso:pz,json:lx,jwt:Cz,keyof:Gz,ksuid:Tz,lazy:hb,length:pa,literal:Ky,locales:Db,looseObject:Kz,lowercase:Dc,lt:bn,lte:zt,map:Qz,maxLength:fa,maxSize:ma,mime:Bc,minLength:sr,minSize:mi,multipleOf:hi,nan:sx,nanoid:Oz,nativeEnum:tx,negative:py,never:wa,nonnegative:gy,nonoptional:rb,nonpositive:vy,normalize:Fc,null:Pi,nullable:Rs,nullish:rx,number:H,object:ie,optional:Cs,overwrite:jn,parse:Ny,parseAsync:Ty,partialRecord:Hz,pipe:Ls,positive:fy,prefault:nb,preprocess:dx,prettifyError:Ep,promise:ox,property:yy,readonly:cb,record:_a,refine:pb,regex:Zc,regexes:mv,registry:mc,safeParse:Uy,safeParseAsync:Ey,set:ex,setErrorMap:fU,size:Pc,startsWith:Lc,strictObject:Yz,string:Te,stringbool:cx,success:ix,superRefine:vb,symbol:Ay,templateLiteral:ax,toJSONSchema:Lb,toLowerCase:Vc,toUpperCase:Wc,transform:_l,treeifyError:Tp,trim:Jc,tuple:$r,uint32:Bz,uint64:Jz,ulid:xz,undefined:Zy,union:Ee,unknown:ar,uppercase:Cc,url:kz,uuid:bz,uuidv4:wz,uuidv6:$z,uuidv7:_z,void:Wz,xid:Nz},Symbol.toStringTag,{value:"Module"})),vU=async e=>await new Promise(t=>setTimeout(t,F.fromMilliseconds(e).milliseconds));let gU=class{constructor(e){Pt(this,"config"),Pt(this,"retries"),Pt(this,"interval"),this.config={baseInterval:new F((e==null?void 0:e.baseInterval)??F.seconds(1)),maxRetries:(e==null?void 0:e.maxRetries)??5,scale:(e==null?void 0:e.scale)??1,sleepFn:(e==null?void 0:e.sleepFn)??vU},this.retries=0,this.interval=new F(this.config.baseInterval)}async wait(){const{maxRetries:e,scale:t,sleepFn:r}=this.config;return this.retries>=e?!1:(await r(this.interval),this.interval=this.interval.mult(t),this.retries++,!0)}reset(){this.retries=0,this.interval=this.config.baseInterval}};const yU=ie({baseInterval:F.z.optional(),maxRetries:H().optional(),scale:H().optional()}),Mb=Object.freeze(Object.defineProperty({__proto__:null,Breaker:gU,breakerConfigZ:yU},Symbol.toStringTag,{value:"Module"})),bU=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,Bb=Te().regex(bU),Hn=H().min(0).max(255),Fb=H().min(0).max(1),Jb=$r([Hn,Hn,Hn,Fb]),wU=$r([Hn,Hn,Hn]),$U=ie({rgba255:Jb}),_U=H().min(0).max(360),kU=H().min(0).max(100),IU=H().min(0).max(100),OU=$r([_U,kU,IU,Fb]),zl=Ee([Bb,wU,Jb,OU,$U]),SU=zl.transform(e=>xl(e)),xl=(e,t=1)=>{if(e=zl.parse(e),typeof e=="string")return zU(e,t);if(Array.isArray(e)){if(e.length<3||e.length>4)throw new Error(`Invalid color: [${e.join(", ")}]`);return e.length===3?[...e,t]:e}return e.rgba255},zU=(e,t=1)=>(e=Bb.parse(e),e=xU(e),[ss(e,0),ss(e,2),ss(e,4),e.length===8?ss(e,6)/255:t]),ss=(e,t)=>parseInt(e.slice(t,t+2),16),xU=e=>e.startsWith("#")?e.slice(1):e;xl("#000000");xl("#ffffff");const NU=ie({key:Te(),color:zl,position:H(),switched:vl().optional()});Zi(NU);const TU=ie({key:Te(),name:Te(),color:SU});ie({key:Te(),name:Te(),swatches:Zi(TU)});const Vb=H().int().min(0).max(255),Wb=255,qb=0,UU={lower:qb,upper:Wb+1},Gb=ie({name:Te(),key:Te()}),pi=e=>ie({subject:Gb,resource:e,authority:Vb}),EU=(...e)=>t=>t.filter(r=>{let i=!1;return r.to!=null&&(i=e.includes(r.to.resource)),r.from!=null&&!i&&(i=e.includes(r.from.resource)),i}),Yb=e=>ie({from:pi(e),to:Pi()}),Kb=e=>ie({from:Pi(),to:pi(e)}),jU=e=>Ee([Yb(e),Kb(e),ie({from:pi(e),to:pi(e)})]),kn=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:Wb,AUTHORITY_BOUNDS:UU,ZERO_AUTHORITY:qb,acquireZ:Kb,authorityZ:Vb,filterTransfersByChannelKey:EU,releaseZ:Yb,stateZ:pi,subjectZ:Gb,transferZ:jU},Symbol.toStringTag,{value:"Module"})),AU=e=>Object.getOwnPropertySymbols(globalThis).includes(e),PU=(e,t)=>{const r=Symbol.for(e);if(!AU(r)){const i=t();Object.defineProperty(globalThis,r,{value:i})}return()=>globalThis[r]},Xb="sy_x_error",ZU=e=>t=>t!=null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type.startsWith(e):t instanceof Error?t.message.startsWith(e):typeof t!="string"?!1:t.startsWith(e),Oa=e=>{var t;return t=class extends Error{constructor(r,i){super(r,i),Pt(this,"discriminator",t.discriminator),Pt(this,"type",t.TYPE),Pt(this,"matches",t.matches),this.name=t.TYPE}static sub(r){return Oa(`${e}.${r}`)}},Pt(t,"discriminator",Xb),Pt(t,"TYPE",e),Pt(t,"matches",ZU(e)),t},Hb=e=>{if(e==null||typeof e!="object")return!1;const t=e;if(t.discriminator!==Xb)return!1;if(!("type"in t))throw new Error(`X Error is missing its type property: ${JSON.stringify(t)}`);return!0},Vn="unknown",eu="nil";let DU=class{constructor(){Pt(this,"providers",[])}register(e){this.providers.push(e)}encode(e){if(e==null)return{type:eu,data:""};if(Hb(e))for(const t of this.providers){const r=t.encode(e);if(r!=null)return r}if(e instanceof Error)return{type:Vn,data:e.message};if(typeof e=="string")return{type:Vn,data:e};try{return{type:Vn,data:JSON.stringify(e)}}catch{return{type:Vn,data:"unable to encode error information"}}}decode(e){if(e==null||e.type===eu)return null;if(e.type===Vn)return new tu(e.data);for(const t of this.providers){const r=t.decode(e);if(r!=null)return r}return new tu(e.data)}};const Nl=PU("synnax-error-registry",()=>new DU),CU=({encode:e,decode:t})=>Nl().register({encode:e,decode:t}),RU=e=>Nl().encode(e),LU=e=>e==null?null:Nl().decode(e);let tu=class extends Oa("unknown"){};const MU=ie({type:Te(),data:Te()});let BU=class extends Oa("canceled"){};const ur=Object.freeze(Object.defineProperty({__proto__:null,Canceled:BU,NONE:eu,UNKNOWN:Vn,Unknown:tu,createTyped:Oa,decode:LU,encode:RU,isTyped:Hb,payloadZ:MU,register:CU},Symbol.toStringTag,{value:"Module"})),FU=Re.object({jsonrpc:Re.literal("2.0"),method:Re.string(),params:Re.any().optional(),id:Re.union([Re.string(),Re.number(),Re.null()]).optional()}),Qb=Re.object({jsonrpc:Re.literal("2.0"),id:Re.union([Re.string(),Re.number(),Re.null()])}),JU=Qb.extend({result:Re.json()}),VU=Qb.extend({error:Re.object({code:Re.number().int(),message:Re.string().optional(),data:Re.json().optional()})}),WU=Re.union([JU,VU]);Re.union([FU,WU]);const nu=Te().regex(/^\d+\.\d+\.\d+$/),Di=(e,t,r={})=>{r.checkMajor??(r.checkMajor=!0),r.checkMinor??(r.checkMinor=!0),r.checkPatch??(r.checkPatch=!0);const i=nu.parse(e),n=nu.parse(t),[s,a,o]=i.split(".").map(Number),[u,c,l]=n.split(".").map(Number);if(r.checkMajor){if(s<u)return mo;if(s>u)return fo}if(r.checkMinor){if(a<c)return mo;if(a>c)return fo}if(r.checkPatch){if(o<l)return mo;if(o>l)return fo}return oa},qU=(e,t,r={})=>O0(Di(e,t,r)),ew=(e,t,r={})=>I0(Di(e,t,r)),GU=(e,t,r={})=>k0(Di(e,t,r)),YU=({name:e,migrate:t})=>r=>{try{const i=t(r);return console.log(`${e} migrated: ${r.version} -> ${i.version}`),i}catch(i){throw console.log(`${e} failed to migrate from ${r.version}`),console.error(i),i}},KU=({name:e,migrations:t,targetSchema:r,defaultVersion:i,def:n})=>{const s=Object.keys(t).sort(Di).pop();if(s==null)return c=>{if(c.version??(c.version=i),c.version!==n.version)return console.log(`${e} version ${c.version} is newer than latest version of ${n.version}.
37
+ Returning default instead.
38
+ `),n;try{return r!=null?r.parse(c):c}catch(l){return console.log(`${e} failed to parse default. Exiting with default`),console.error(l),n}};const a=Object.keys(t).length;let o=!1;const u=c=>{try{if(a===0||ew(c.version,s))return console.log(o?`${e} ${c.version} now up to date`:`${e} version ${c.version} is up to date with target version ${n.version}`),c;const l=c.version,d=t[l],m=d(c);return o=!0,u(m)}catch(l){return console.log(`${e} failed to migrate from ${c.version} to ${s}`),console.error(l),n}};return c=>{try{if(c.version==null)if(i!=null)console.log(`${e} version is null. Setting version to default of ${i}`),c.version=i;else return console.log(`${e} version is null and no default version set. Exiting with default`),n;return u(c)}catch(l){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(l),n}}},Um=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:Di,createMigration:YU,migrator:KU,semVerNewer:ew,semVerOlder:GU,semVerZ:nu,versionsEqual:qU},Symbol.toStringTag,{value:"Module"})),XU=["standard","scientific","engineering"];Qe(XU);const HU=Qe(["success","info","warning","error","loading","disabled"]),Sa=Object.freeze(Object.defineProperty({__proto__:null,variantZ:HU},Symbol.toStringTag,{value:"Module"})),QU=(e,t="")=>{const r=e.length;return r===0?t:r===1?e[0]:r===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[r-1]}`},eE=e=>{const t=e.split(" "),r=new Set,i=t.map(a=>a.charAt(0).toLowerCase()).join("");r.add(i.replace(/-/g,"_")),r.add(i.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"));const n=/\d+/g;e.match(n)&&t.forEach((a,o)=>{if(n.test(a)){const u=t.map((c,l)=>l!==o?c.charAt(0).toLowerCase():c).join("");r.add(u.replace(/-/g,"_")),r.add(u.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"))}});const s=t.map(a=>(a.length>3?a.substring(0,3):a).toLowerCase());return r.add(s.join("").replace(/-/g,"_")),r.add(s.join("_").replace(/-/g,"_")),Array.from(r).filter(a=>a.length>=2&&a.length<=12&&!/^\d/.test(a))},tE=Object.freeze(Object.defineProperty({__proto__:null,createShortIdentifiers:eE,naturalLanguageJoin:QU},Symbol.toStringTag,{value:"Module"})),nE="policy",tw="allow_all";var rE=Object.defineProperty,iE=(e,t,r)=>t in e?rE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xe=(e,t,r)=>iE(e,typeof t!="symbol"?t+"":t,r);const sE=e=>{const t=e.replace(/_[a-z]/g,r=>r[1].toUpperCase());return t.length>1&&t[0]===t[0].toUpperCase()&&t[1]===t[1].toUpperCase()||t.length===0?t:t[0].toLowerCase()+t.slice(1)},nw=e=>{const t=(r,i=ru)=>{if(typeof r=="string")return e(r);if(Array.isArray(r))return r.map(a=>t(a,i));if(!bo(r))return r;i=uE(i);const n={},s=r;return"toJSON"in s&&typeof s.toJSON=="function"?t(s.toJSON(),i):(Object.keys(s).forEach(a=>{let o=s[a];const u=e(a);i.recursive&&(bo(o)?jm(o,i.keepTypesOnRecursion)||(o=t(o,i)):i.recursiveInArray&&Em(o)&&(o=[...o].map(c=>{let l=c;return bo(c)?jm(l,i.keepTypesOnRecursion)||(l=t(c,i)):Em(c)&&(l=t({key:c},i).key),l}))),n[u]=o}),n)};return t},rw=nw(sE),aE=e=>e.replace(/([a-z0-9])([A-Z])/g,(t,r,i)=>`${r}_${i.toLowerCase()}`),oE=nw(aE),ru={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},uE=(e=ru)=>(e.recursive==null?e=ru:e.recursiveInArray??(e.recursiveInArray=!1),e),Em=e=>e!=null&&Array.isArray(e),bo=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),jm=(e,t)=>(t||[]).some(r=>e instanceof r),cE=e=>e!=null&&typeof e=="object"&&!Array.isArray(e);var lE=Object.defineProperty,dE=(e,t,r)=>t in e?lE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ii=(e,t,r)=>dE(e,typeof t!="symbol"?t+"":t,r);let hE=class{constructor(){ii(this,"contentType","application/json"),ii(this,"decoder"),ii(this,"encoder"),this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const r=JSON.parse(e),i=rw(r);return t!=null?t.parse(i):i}encodeString(e){const t=oE(e);return JSON.stringify(t,(r,i)=>ArrayBuffer.isView(i)?Array.from(i):typeof i=="bigint"?i.toString():i)}},mE=class{constructor(){ii(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t)}decode(e,t){const r=new TextDecoder().decode(e);return this.decodeString(r,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!cE(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),r=[t.join(",")];return e.forEach(i=>{const n=t.map(s=>JSON.stringify(i[s]??""));r.push(n.join(","))}),r.join(`
39
+ `)}decodeString(e,t){const[r,...i]=e.trim().split(`
40
+ `).map(a=>a.trim());if(r.length===0)return t!=null?t.parse({}):{};const n=r.split(",").map(a=>a.trim()),s={};return n.forEach(a=>{s[a]=[]}),i.forEach(a=>{const o=a.split(",").map(u=>u.trim());n.forEach((u,c)=>{const l=this.parseValue(o[c]);l!=null&&s[u].push(l)})}),t!=null?t.parse(s):s}parseValue(e){if(e==null||e.length===0)return null;const t=Number(e);return isNaN(t)?e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e:t}},fE=class{constructor(){ii(this,"contentType","text/plain")}encode(e){if(typeof e!="string")throw new Error("TextCodec.encode payload must be a string");return new TextEncoder().encode(e)}decode(e,t){const r=new TextDecoder().decode(e);return t!=null?t.parse(r):r}};const iu=new hE;new mE;new fE;var pE=Object.defineProperty,vE=(e,t,r)=>t in e?pE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gE=(e,t,r)=>vE(e,t+"",r);let kr=class{constructor(e){gE(this,"value"),this.value=e}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}};const yE=e=>e!=null&&typeof e=="object"&&"toString"in e,bE=(e,t=!1)=>{const r=yE(e)?"stringer":typeof e;let i;switch(r){case"string":i=(n,s)=>n.localeCompare(s);break;case"stringer":i=(n,s)=>n.toString().localeCompare(s.toString());break;case"number":i=(n,s)=>Number(n)-Number(s);break;case"bigint":i=(n,s)=>BigInt(n)-BigInt(s)>0n?1:-1;break;case"boolean":i=(n,s)=>Number(n)-Number(s);break;case"undefined":i=()=>0;break;default:return console.warn(`sortFunc: unknown type ${r}`),()=>-1}return t?wE(i):i},wE=e=>(t,r)=>e(r,t);function _(e,t,r){function i(o,u){var c;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(c=o._zod).traits??(c.traits=new Set),o._zod.traits.add(e),t(o,u);for(const l in a.prototype)l in o||Object.defineProperty(o,l,{value:a.prototype[l].bind(o)});o._zod.constr=a,o._zod.def=u}const n=(r==null?void 0:r.Parent)??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function a(o){var u;const c=r!=null&&r.Parent?new s:this;i(c,o),(u=c._zod).deferred??(u.deferred=[]);for(const l of c._zod.deferred)l();return c}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>{var u,c;return r!=null&&r.Parent&&o instanceof r.Parent?!0:(c=(u=o==null?void 0:o._zod)==null?void 0:u.traits)==null?void 0:c.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}const iw=Symbol("zod_brand");class cr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Bs={};function mt(e){return e&&Object.assign(Bs,e),Bs}function $E(e){return e}function _E(e){return e}function kE(e){}function IE(e){throw new Error}function OE(e){}function Tl(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function P(e,t="|"){return e.map(r=>X(r)).join(t)}function sw(e,t){return typeof t=="bigint"?t.toString():t}function za(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function An(e){return e==null}function xa(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function aw(e,t){const r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,s=Number.parseInt(e.toFixed(n).replace(".","")),a=Number.parseInt(t.toFixed(n).replace(".",""));return s%a/10**n}function oe(e,t,r){Object.defineProperty(e,t,{get(){{const i=r();return e[t]=i,i}},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Ir(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function SE(e,t){return t?t.reduce((r,i)=>r==null?void 0:r[i],e):e}function zE(e){const t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{const n={};for(let s=0;s<t.length;s++)n[t[s]]=i[s];return n})}function Ul(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function Wn(e){return JSON.stringify(e)}function vi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ow=za(()=>{if(typeof navigator<"u"&&navigator!=null&&navigator.userAgent.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Fs(e){if(vi(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(vi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function xE(e){let t=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}const NE=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Js=new Set(["string","number","symbol"]),uw=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Pn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Mt(e,t,r){const i=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(i._zod.parent=e),i}function z(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function TE(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,s){return t??(t=e()),Reflect.set(t,i,n,s)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function X(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function cw(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const lw={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},dw={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function hw(e,t){const r={},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(r[n]=i.shape[n])}return Mt(e,{...e._zod.def,shape:r,checks:[]})}function mw(e,t){const r={...e._zod.def.shape},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&delete r[n]}return Mt(e,{...e._zod.def,shape:r,checks:[]})}function fw(e,t){const r={...e._zod.def,get shape(){const i={...e._zod.def.shape,...t};return Ir(this,"shape",i),i},checks:[]};return Mt(e,r)}function pw(e,t){return Mt(e,{...e._zod.def,get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Ir(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function vw(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(n[s]=e?new e({type:"optional",innerType:i[s]}):i[s])}else for(const s in i)n[s]=e?new e({type:"optional",innerType:i[s]}):i[s];return Mt(t,{...t._zod.def,shape:n,checks:[]})}function gw(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(n[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(const s in i)n[s]=new e({type:"nonoptional",innerType:i[s]});return Mt(t,{...t._zod.def,shape:n,checks:[]})}function Qn(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r].continue!==!0)return!0;return!1}function Ot(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Gr(e){return typeof e=="string"?e:e==null?void 0:e.message}function Tt(e,t,r){var i,n,s,a,o,u;const c={...e,path:e.path??[]};if(!e.message){const l=Gr((s=(n=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:n.error)==null?void 0:s.call(n,e))??Gr((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??Gr((o=r.customError)==null?void 0:o.call(r,e))??Gr((u=r.localeError)==null?void 0:u.call(r,e))??"Invalid input";c.message=l}return delete c.inst,delete c.continue,t!=null&&t.reportInput||delete c.input,c}function Na(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Ta(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function lr(...e){const[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function UE(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}class EE{constructor(...t){}}const jE=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:dw,Class:EE,NUMBER_FORMAT_RANGES:lw,aborted:Qn,allowsEval:ow,assert:OE,assertEqual:$E,assertIs:kE,assertNever:IE,assertNotEqual:_E,assignProp:Ir,cached:za,cleanEnum:UE,cleanRegex:xa,clone:Mt,createTransparentProxy:TE,defineLazy:oe,esc:Wn,escapeRegex:Pn,extend:fw,finalizeIssue:Tt,floatSafeRemainder:aw,getElementAtPath:SE,getEnumValues:Tl,getLengthableOrigin:Ta,getParsedType:NE,getSizableOrigin:Na,isObject:vi,isPlainObject:Fs,issue:lr,joinValues:P,jsonStringifyReplacer:sw,merge:pw,normalizeParams:z,nullish:An,numKeys:xE,omit:mw,optionalKeys:cw,partial:vw,pick:hw,prefixIssues:Ot,primitiveTypes:uw,promiseAllObject:zE,propertyKeyTypes:Js,randomString:Ul,required:gw,stringifyPrimitive:X,unwrapMessage:Gr},Symbol.toStringTag,{value:"Module"})),yw=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,sw,2)},enumerable:!0})},El=_("$ZodError",yw),Ci=_("$ZodError",yw,{Parent:Error});function jl(e,t=r=>r.message){const r={},i=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function Al(e,t){const r=t||function(s){return s.message},i={_errors:[]},n=s=>{for(const a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>n({issues:o}));else if(a.code==="invalid_key")n({issues:a.issues});else if(a.code==="invalid_element")n({issues:a.issues});else if(a.path.length===0)i._errors.push(r(a));else{let o=i,u=0;for(;u<a.path.length;){const c=a.path[u];u===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(r(a))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return n(e),i}function bw(e,t){const r=t||function(s){return s.message},i={errors:[]},n=(s,a=[])=>{var o,u;for(const c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>n({issues:l},c.path));else if(c.code==="invalid_key")n({issues:c.issues},c.path);else if(c.code==="invalid_element")n({issues:c.issues},c.path);else{const l=[...a,...c.path];if(l.length===0){i.errors.push(r(c));continue}let d=i,m=0;for(;m<l.length;){const y=l[m],k=m===l.length-1;typeof y=="string"?(d.properties??(d.properties={}),(o=d.properties)[y]??(o[y]={errors:[]}),d=d.properties[y]):(d.items??(d.items=[]),(u=d.items)[y]??(u[y]={errors:[]}),d=d.items[y]),k&&d.errors.push(r(c)),m++}}};return n(e),i}function ww(e){const t=[];for(const r of e)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function $w(e){var t;const r=[],i=[...e.issues].sort((n,s)=>n.path.length-s.path.length);for(const n of i)r.push(`✖ ${n.message}`),(t=n.path)!=null&&t.length&&r.push(` → at ${ww(n.path)}`);return r.join(`
41
+ `)}const Pl=e=>(t,r,i,n)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new cr;if(a.issues.length){const o=new((n==null?void 0:n.Err)??e)(a.issues.map(u=>Tt(u,s,mt())));throw Error.captureStackTrace(o,n==null?void 0:n.callee),o}return a.value},su=Pl(Ci),Zl=e=>async(t,r,i,n)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new((n==null?void 0:n.Err)??e)(a.issues.map(u=>Tt(u,s,mt())));throw Error.captureStackTrace(o,n==null?void 0:n.callee),o}return a.value},au=Zl(Ci),Dl=e=>(t,r,i)=>{const n=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new cr;return s.issues.length?{success:!1,error:new(e??El)(s.issues.map(a=>Tt(a,n,mt())))}:{success:!0,data:s.value}},_w=Dl(Ci),Cl=e=>async(t,r,i)=>{const n=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>Tt(a,n,mt())))}:{success:!0,data:s.value}},kw=Cl(Ci),Iw=/^[cC][^\s-]{8,}$/,Ow=/^[0-9a-z]+$/,Sw=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zw=/^[0-9a-vA-V]{20}$/,xw=/^[A-Za-z0-9]{27}$/,Nw=/^[a-zA-Z0-9_-]{21}$/,Tw=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,AE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Uw=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,dr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,PE=dr(4),ZE=dr(6),DE=dr(7),Ew=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,CE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,RE=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,LE=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ME=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,jw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Aw(){return new RegExp(jw,"u")}const Pw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Dw=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Cw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rw=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rl=/^[A-Za-z0-9_-]*$/,Lw=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,BE=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Mw=/^\+(?:[0-9]){6,14}[0-9]$/,Bw="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Fw=new RegExp(`^${Bw}$`);function Jw(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vw(e){return new RegExp(`^${Jw(e)}$`)}function Ww(e){const t=Jw({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");const i=`${t}(?:${r.join("|")})`;return new RegExp(`^${Bw}T(?:${i})$`)}const qw=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Gw=/^\d+n?$/,Yw=/^\d+$/,Kw=/^-?\d+(?:\.\d+)?/i,Xw=/true|false/i,Hw=/null/i,Qw=/undefined/i,e$=/^[^A-Z]*$/,t$=/^[^a-z]*$/,n$=Object.freeze(Object.defineProperty({__proto__:null,_emoji:jw,base64:Rw,base64url:Rl,bigint:Gw,boolean:Xw,browserEmail:ME,cidrv4:Dw,cidrv6:Cw,cuid:Iw,cuid2:Ow,date:Fw,datetime:Ww,domain:BE,duration:Tw,e164:Mw,email:Ew,emoji:Aw,extendedDuration:AE,guid:Uw,hostname:Lw,html5Email:CE,integer:Yw,ipv4:Pw,ipv6:Zw,ksuid:xw,lowercase:e$,nanoid:Nw,null:Hw,number:Kw,rfc5322Email:RE,string:qw,time:Vw,ulid:Sw,undefined:Qw,unicodeEmail:LE,uppercase:t$,uuid:dr,uuid4:PE,uuid6:ZE,uuid7:DE,xid:zw},Symbol.toStringTag,{value:"Module"})),Fe=_("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),r$={number:"number",bigint:"bigint",object:"date"},Ll=_("$ZodCheckLessThan",(e,t)=>{Fe.init(e,t);const r=r$[typeof t.value];e._zod.onattach.push(i=>{const n=i._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ml=_("$ZodCheckGreaterThan",(e,t)=>{Fe.init(e,t);const r=r$[typeof t.value];e._zod.onattach.push(i=>{const n=i._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),i$=_("$ZodCheckMultipleOf",(e,t)=>{Fe.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):aw(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),s$=_("$ZodCheckNumberFormat",(e,t)=>{var r;Fe.init(e,t),t.format=t.format||"float64";const i=(r=t.format)==null?void 0:r.includes("int"),n=i?"int":"number",[s,a]=lw[t.format];e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,u.minimum=s,u.maximum=a,i&&(u.pattern=Yw)}),e._zod.check=o=>{const u=o.value;if(i){if(!Number.isInteger(u)){o.issues.push({expected:n,format:t.format,code:"invalid_type",input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?o.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):o.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}u<s&&o.issues.push({origin:"number",input:u,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),u>a&&o.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inst:e})}}),a$=_("$ZodCheckBigIntFormat",(e,t)=>{Fe.init(e,t);const[r,i]=dw[t.format];e._zod.onattach.push(n=>{const s=n._zod.bag;s.format=t.format,s.minimum=r,s.maximum=i}),e._zod.check=n=>{const s=n.value;s<r&&n.issues.push({origin:"bigint",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>i&&n.issues.push({origin:"bigint",input:s,code:"too_big",maximum:i,inst:e})}}),o$=_("$ZodCheckMaxSize",(e,t)=>{Fe.init(e,t),e._zod.when=r=>{const i=r.value;return!An(i)&&i.size!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;i.size<=t.maximum||r.issues.push({origin:Na(i),code:"too_big",maximum:t.maximum,input:i,inst:e,continue:!t.abort})}}),u$=_("$ZodCheckMinSize",(e,t)=>{Fe.init(e,t),e._zod.when=r=>{const i=r.value;return!An(i)&&i.size!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;i.size>=t.minimum||r.issues.push({origin:Na(i),code:"too_small",minimum:t.minimum,input:i,inst:e,continue:!t.abort})}}),c$=_("$ZodCheckSizeEquals",(e,t)=>{Fe.init(e,t),e._zod.when=r=>{const i=r.value;return!An(i)&&i.size!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=r=>{const i=r.value,n=i.size;if(n===t.size)return;const s=n>t.size;r.issues.push({origin:Na(i),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},input:r.value,inst:e,continue:!t.abort})}}),l$=_("$ZodCheckMaxLength",(e,t)=>{Fe.init(e,t),e._zod.when=r=>{const i=r.value;return!An(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const n=Ta(i);r.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),d$=_("$ZodCheckMinLength",(e,t)=>{Fe.init(e,t),e._zod.when=r=>{const i=r.value;return!An(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const n=Ta(i);r.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),h$=_("$ZodCheckLengthEquals",(e,t)=>{Fe.init(e,t),e._zod.when=r=>{const i=r.value;return!An(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,n=i.length;if(n===t.length)return;const s=Ta(i),a=n>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:r.value,inst:e,continue:!t.abort})}}),Ri=_("$ZodCheckStringFormat",(e,t)=>{var r;Fe.init(e,t),e._zod.onattach.push(i=>{const n=i._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),(r=e._zod).check??(r.check=i=>{if(!t.pattern)throw new Error("Not implemented.");t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})})}),m$=_("$ZodCheckRegex",(e,t)=>{Ri.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),f$=_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=e$),Ri.init(e,t)}),p$=_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=t$),Ri.init(e,t)}),v$=_("$ZodCheckIncludes",(e,t)=>{Fe.init(e,t);const r=Pn(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),g$=_("$ZodCheckStartsWith",(e,t)=>{Fe.init(e,t);const r=new RegExp(`^${Pn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),y$=_("$ZodCheckEndsWith",(e,t)=>{Fe.init(e,t);const r=new RegExp(`.*${Pn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Am(e,t,r){e.issues.length&&t.issues.push(...Ot(r,e.issues))}const b$=_("$ZodCheckProperty",(e,t)=>{Fe.init(e,t),e._zod.check=r=>{const i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>Am(n,r,t.property));Am(i,r,t.property)}}),w$=_("$ZodCheckMimeType",(e,t)=>{Fe.init(e,t);const r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,path:["type"],inst:e})}}),$$=_("$ZodCheckOverwrite",(e,t)=>{Fe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class _${constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
42
+ `).filter(s=>s),i=Math.min(...r.map(s=>s.length-s.trimStart().length)),n=r.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of n)this.content.push(s)}compile(){const t=Function,r=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(n=>` ${n}`)];return new t(...r,i.join(`
43
+ `))}}const k$={major:4,minor:0,patch:0},V=_("$ZodType",(e,t)=>{var r,i;e??(e={}),oe(e._zod,"id",()=>t.type+"_"+Ul(10)),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=k$;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const a of s._zod.onattach)a(e);if(n.length===0)(i=e._zod).deferred??(i.deferred=[]),(r=e._zod.deferred)==null||r.push(()=>{e._zod.run=e._zod.parse});else{const s=(a,o,u)=>{let c=Qn(a),l;for(const d of o){if(d._zod.when){if(!d._zod.when(a))continue}else if(c)continue;const m=a.issues.length,y=d._zod.check(a);if(y instanceof Promise&&(u==null?void 0:u.async)===!1)throw new cr;if(l||y instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await y,a.issues.length!==m&&(c||(c=Qn(a,m)))});else{if(a.issues.length===m)continue;c||(c=Qn(a,m))}}return l?l.then(()=>a):a};e._zod.run=(a,o)=>{const u=e._zod.parse(a,o);if(u instanceof Promise){if(o.async===!1)throw new cr;return u.then(c=>s(c,n,o))}return s(u,n,o)}}e["~standard"]={validate:s=>{var a;try{const o=_w(e,s);return o.success?{value:o.data}:{issues:(a=o.error)==null?void 0:a.issues}}catch{return kw(e,s).then(o=>{var u;return o.success?{value:o.data}:{issues:(u=o.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),Li=_("$ZodString",(e,t)=>{var r;V.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??qw(e._zod.bag),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),$e=_("$ZodStringFormat",(e,t)=>{Ri.init(e,t),Li.init(e,t)}),I$=_("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Uw),$e.init(e,t)}),O$=_("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=dr(r))}else t.pattern??(t.pattern=dr());$e.init(e,t)}),S$=_("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ew),$e.init(e,t)}),z$=_("$ZodURL",(e,t)=>{$e.init(e,t),e._zod.check=r=>{try{const i=new URL(r.value);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Lw.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}));return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),x$=_("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Aw()),$e.init(e,t)}),N$=_("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Nw),$e.init(e,t)}),T$=_("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Iw),$e.init(e,t)}),U$=_("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ow),$e.init(e,t)}),E$=_("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Sw),$e.init(e,t)}),j$=_("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zw),$e.init(e,t)}),A$=_("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=xw),$e.init(e,t)}),P$=_("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ww(t)),$e.init(e,t),e._zod.check}),Z$=_("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Fw),$e.init(e,t)}),D$=_("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Vw(t)),$e.init(e,t),e._zod.check}),C$=_("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Tw),$e.init(e,t)}),R$=_("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Pw),$e.init(e,t),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format="ipv4"})}),L$=_("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Zw),$e.init(e,t),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),M$=_("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Dw),$e.init(e,t)}),B$=_("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Cw),$e.init(e,t),e._zod.check=r=>{const[i,n]=r.value.split("/");try{if(!n)throw new Error;const s=Number(n);if(`${s}`!==n)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Bl(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const F$=_("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Rw),$e.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{Bl(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function J$(e){if(!Rl.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Bl(r)}const V$=_("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Rl),$e.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{J$(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),W$=_("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Mw),$e.init(e,t)});function q$(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r,n=JSON.parse(atob(i));return!("typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const G$=_("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=r=>{q$(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Fl=_("$ZodNumber",(e,t)=>{V.init(e,t),e._zod.pattern=e._zod.bag.pattern??Kw,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),Y$=_("$ZodNumber",(e,t)=>{s$.init(e,t),Fl.init(e,t)}),Jl=_("$ZodBoolean",(e,t)=>{V.init(e,t),e._zod.pattern=Xw,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Vl=_("$ZodBigInt",(e,t)=>{V.init(e,t),e._zod.pattern=Gw,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}const{value:n}=r;return typeof n=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:n,inst:e}),r}}),K$=_("$ZodBigInt",(e,t)=>{a$.init(e,t),Vl.init(e,t)}),X$=_("$ZodSymbol",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),H$=_("$ZodUndefined",(e,t)=>{V.init(e,t),e._zod.pattern=Qw,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{const{value:n}=r;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Q$=_("$ZodNull",(e,t)=>{V.init(e,t),e._zod.pattern=Hw,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{const{value:n}=r;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),e_=_("$ZodAny",(e,t)=>{V.init(e,t),e._zod.parse=r=>r}),Vs=_("$ZodUnknown",(e,t)=>{V.init(e,t),e._zod.parse=r=>r}),t_=_("$ZodNever",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),n_=_("$ZodVoid",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),r_=_("$ZodDate",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}const n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Pm(e,t,r){e.issues.length&&t.issues.push(...Ot(r,e.issues)),t.value[r]=e.value}const Wl=_("$ZodArray",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const s=[];for(let a=0;a<n.length;a++){const o=n[a],u=t.element._zod.run({value:o,issues:[]},i);u instanceof Promise?s.push(u.then(c=>Pm(c,r,a))):Pm(u,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function as(e,t,r){e.issues.length&&t.issues.push(...Ot(r,e.issues)),t.value[r]=e.value}function Zm(e,t,r,i){e.issues.length?i[r]===void 0?r in i?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...Ot(r,e.issues)):e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}const i_=_("$ZodObject",(e,t)=>{V.init(e,t);const r=za(()=>{const l=Object.keys(t.shape);for(const m of l)if(!(t.shape[m]instanceof V))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);const d=cw(t.shape);return{shape:t.shape,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(d)}});oe(e._zod,"propValues",()=>{const l=t.shape,d={};for(const m in l){const y=l[m]._zod;if(y.values){d[m]??(d[m]=new Set);for(const k of y.values)d[m].add(k)}}return d});const i=l=>{const d=new _$(["shape","payload","ctx"]),{keys:m,optionalKeys:y}=r.value,k=p=>{const g=Wn(p);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};d.write("const input = payload.value;");const v=Object.create(null);for(const p of m)v[p]=Ul(15);d.write("const newResult = {}");for(const p of m)if(y.has(p)){const g=v[p];d.write(`const ${g} = ${k(p)};`);const w=Wn(p);d.write(`
44
+ if (${g}.issues.length) {
45
+ if (input[${w}] === undefined) {
46
+ if (${w} in input) {
47
+ newResult[${w}] = undefined;
48
+ }
49
+ } else {
50
+ payload.issues = payload.issues.concat(
51
+ ${g}.issues.map((iss) => ({
52
+ ...iss,
53
+ path: iss.path ? [${w}, ...iss.path] : [${w}],
54
+ }))
55
+ );
56
+ }
57
+ } else if (${g}.value === undefined) {
58
+ if (${w} in input) newResult[${w}] = undefined;
59
+ } else {
60
+ newResult[${w}] = ${g}.value;
61
+ }
62
+ `)}else{const g=v[p];d.write(`const ${g} = ${k(p)};`),d.write(`
63
+ if (${g}.issues.length) payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
64
+ ...iss,
65
+ path: iss.path ? [${Wn(p)}, ...iss.path] : [${Wn(p)}]
66
+ })));`),d.write(`newResult[${Wn(p)}] = ${g}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");const f=d.compile();return(p,g)=>f(l,p,g)};let n;const s=vi,a=!Bs.jitless,o=a&&ow.value,{catchall:u}=t;let c;e._zod.parse=(l,d)=>{c??(c=r.value);const m=l.value;if(!s(m))return l.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),l;const y=[];if(a&&o&&(d==null?void 0:d.async)===!1&&d.jitless!==!0)n||(n=i(t.shape)),l=n(l,d);else{l.value={};const g=c.shape;for(const w of c.keys){const x=g[w],C=x._zod.run({value:m[w],issues:[]},d),ne=x._zod.optin==="optional"&&x._zod.optout==="optional";C instanceof Promise?y.push(C.then(ke=>ne?Zm(ke,l,w,m):as(ke,l,w))):ne?Zm(C,l,w,m):as(C,l,w)}}if(!u)return y.length?Promise.all(y).then(()=>l):l;const k=[],v=c.keySet,f=u._zod,p=f.def.type;for(const g of Object.keys(m)){if(v.has(g))continue;if(p==="never"){k.push(g);continue}const w=f.run({value:m[g],issues:[]},d);w instanceof Promise?y.push(w.then(x=>as(x,l,g))):as(w,l,g)}return k.length&&l.issues.push({code:"unrecognized_keys",keys:k,input:m,inst:e}),y.length?Promise.all(y).then(()=>l):l}});function Dm(e,t,r,i){for(const n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(s=>Tt(s,i,mt())))}),t}const ql=_("$ZodUnion",(e,t)=>{V.init(e,t),oe(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),oe(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>xa(i.source)).join("|")})$`)}}),e._zod.parse=(r,i)=>{let n=!1;const s=[];for(const a of t.options){const o=a._zod.run({value:r.value,issues:[]},i);if(o instanceof Promise)s.push(o),n=!0;else{if(o.issues.length===0)return o;s.push(o)}}return n?Promise.all(s).then(a=>Dm(a,r,e,i)):Dm(s,r,e,i)}}),s_=_("$ZodDiscriminatedUnion",(e,t)=>{ql.init(e,t);const r=e._zod.parse;oe(e._zod,"propValues",()=>{const n={};for(const s of t.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[o,u]of Object.entries(a)){n[o]||(n[o]=new Set);for(const c of u)n[o].add(c)}}return n});const i=za(()=>{const n=t.options,s=new Map;for(const a of n){const o=a._zod.propValues[t.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const u of o){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,a)}}return s});e._zod.parse=(n,s)=>{const a=n.value;if(!vi(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;const o=i.value.get(a==null?void 0:a[t.discriminator]);return o?o._zod.run(n,s):t.unionFallback?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[t.discriminator],inst:e}),n)}}),a_=_("$ZodIntersection",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r,s=t.left._zod.run({value:n,issues:[]},i),a=t.right._zod.run({value:n,issues:[]},i);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([o,u])=>Cm(r,o,u)):Cm(r,s,a)}});function ou(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Fs(e)&&Fs(t)){const r=Object.keys(t),i=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};for(const s of i){const a=ou(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};n[s]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i<e.length;i++){const n=e[i],s=t[i],a=ou(n,s);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Cm(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Qn(e))return e;const i=ou(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Ua=_("$ZodTuple",(e,t)=>{V.init(e,t);const r=t.items,i=r.length-[...r].reverse().findIndex(n=>n._zod.optin!=="optional");e._zod.parse=(n,s)=>{const a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];const o=[];if(!t.rest){const c=a.length>r.length,l=a.length<i-1;if(c||l)return n.issues.push({input:a,inst:e,origin:"array",...c?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),n}let u=-1;for(const c of r){if(u++,u>=a.length&&u>=i)continue;const l=c._zod.run({value:a[u],issues:[]},s);l instanceof Promise?o.push(l.then(d=>os(d,n,u))):os(l,n,u)}if(t.rest){const c=a.slice(r.length);for(const l of c){u++;const d=t.rest._zod.run({value:l,issues:[]},s);d instanceof Promise?o.push(d.then(m=>os(m,n,u))):os(d,n,u)}}return o.length?Promise.all(o).then(()=>n):n}});function os(e,t,r){e.issues.length&&t.issues.push(...Ot(r,e.issues)),t.value[r]=e.value}const o_=_("$ZodRecord",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Fs(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;const s=[];if(t.keyType._zod.values){const a=t.keyType._zod.values;r.value={};for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const c=t.valueType._zod.run({value:n[u],issues:[]},i);c instanceof Promise?s.push(c.then(l=>{l.issues.length&&r.issues.push(...Ot(u,l.issues)),r.value[u]=l.value})):(c.issues.length&&r.issues.push(...Ot(u,c.issues)),r.value[u]=c.value)}let o;for(const u in n)a.has(u)||(o=o??[],o.push(u));o&&o.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:o})}else{r.value={};for(const a of Reflect.ownKeys(n)){if(a==="__proto__")continue;const o=t.keyType._zod.run({value:a,issues:[]},i);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map(c=>Tt(c,i,mt())),input:a,path:[a],inst:e}),r.value[o.value]=o.value;continue}const u=t.valueType._zod.run({value:n[a],issues:[]},i);u instanceof Promise?s.push(u.then(c=>{c.issues.length&&r.issues.push(...Ot(a,c.issues)),r.value[o.value]=c.value})):(u.issues.length&&r.issues.push(...Ot(a,u.issues)),r.value[o.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),u_=_("$ZodMap",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;const s=[];r.value=new Map;for(const[a,o]of n){const u=t.keyType._zod.run({value:a,issues:[]},i),c=t.valueType._zod.run({value:o,issues:[]},i);u instanceof Promise||c instanceof Promise?s.push(Promise.all([u,c]).then(([l,d])=>{Rm(l,d,r,a,n,e,i)})):Rm(u,c,r,a,n,e,i)}return s.length?Promise.all(s).then(()=>r):r}});function Rm(e,t,r,i,n,s,a){e.issues.length&&(Js.has(typeof i)?r.issues.push(...Ot(i,e.issues)):r.issues.push({origin:"map",code:"invalid_key",input:n,inst:s,issues:e.issues.map(o=>Tt(o,a,mt()))})),t.issues.length&&(Js.has(typeof i)?r.issues.push(...Ot(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:i,issues:t.issues.map(o=>Tt(o,a,mt()))})),r.value.set(e.value,t.value)}const c_=_("$ZodSet",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;const s=[];r.value=new Set;for(const a of n){const o=t.valueType._zod.run({value:a,issues:[]},i);o instanceof Promise?s.push(o.then(u=>Lm(u,r))):Lm(o,r)}return s.length?Promise.all(s).then(()=>r):r}});function Lm(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const l_=_("$ZodEnum",(e,t)=>{V.init(e,t);const r=Tl(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(i=>Js.has(typeof i)).map(i=>typeof i=="string"?Pn(i):i.toString()).join("|")})$`),e._zod.parse=(i,n)=>{const s=i.value;return e._zod.values.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:e}),i}}),d_=_("$ZodLiteral",(e,t)=>{V.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Pn(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const n=r.value;return e._zod.values.has(n)||r.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),r}}),h_=_("$ZodFile",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Gl=_("$ZodTransform",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{const n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new cr;return r.value=n,r}}),m_=_("$ZodOptional",(e,t)=>{V.init(e,t),e._zod.optin="optional",e._zod.optout="optional",oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),oe(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${xa(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>r.value===void 0?r:t.innerType._zod.run(r,i)}),f_=_("$ZodNullable",(e,t)=>{V.init(e,t),oe(e._zod,"optin",()=>t.innerType._zod.optin),oe(e._zod,"optout",()=>t.innerType._zod.optout),oe(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${xa(r.source)}|null)$`):void 0}),oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),p_=_("$ZodDefault",(e,t)=>{V.init(e,t),e._zod.optin="optional",oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>Mm(s,t)):Mm(n,t)}});function Mm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const v_=_("$ZodPrefault",(e,t)=>{V.init(e,t),e._zod.optin="optional",oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),g_=_("$ZodNonOptional",(e,t)=>{V.init(e,t),oe(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>Bm(s,e)):Bm(n,e)}});function Bm(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const y_=_("$ZodSuccess",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>(r.value=s.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),b_=_("$ZodCatch",(e,t)=>{V.init(e,t),oe(e._zod,"optin",()=>t.innerType._zod.optin),oe(e._zod,"optout",()=>t.innerType._zod.optout),oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>Tt(a,i,mt()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(s=>Tt(s,i,mt()))},input:r.value}),r.issues=[]),r)}}),w_=_("$ZodNaN",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Yl=_("$ZodPipe",(e,t)=>{V.init(e,t),oe(e._zod,"values",()=>t.in._zod.values),oe(e._zod,"optin",()=>t.in._zod.optin),oe(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,i)=>{const n=t.in._zod.run(r,i);return n instanceof Promise?n.then(s=>Fm(s,t,i)):Fm(n,t,i)}});function Fm(e,t,r){return Qn(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const $_=_("$ZodReadonly",(e,t)=>{V.init(e,t),oe(e._zod,"propValues",()=>t.innerType._zod.propValues),oe(e._zod,"optin",()=>t.innerType._zod.optin),oe(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(Jm):Jm(n)}});function Jm(e){return e.value=Object.freeze(e.value),e}const __=_("$ZodTemplateLiteral",(e,t)=>{V.init(e,t);const r=[];for(const i of t.parts)if(i instanceof V){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);const n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);const s=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(s,a))}else if(i===null||uw.has(typeof i))r.push(Pn(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"template_literal",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),i)}),k_=_("$ZodPromise",(e,t)=>{V.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},i))}),I_=_("$ZodLazy",(e,t)=>{V.init(e,t),oe(e._zod,"innerType",()=>t.getter()),oe(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),oe(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),oe(e._zod,"optin",()=>e._zod.innerType._zod.optin),oe(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),O_=_("$ZodCustom",(e,t)=>{Fe.init(e,t),V.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(s=>Vm(s,r,i,e));Vm(n,r,i,e)}});function Vm(e,t,r,i){if(!e){const n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push(lr(n))}}const S_=Symbol("ZodOutput"),z_=Symbol("ZodInput");class Kl{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];if(this._map.set(t,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,t)}return this}remove(t){return this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};return delete i.id,{...i,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function Xl(){return new Kl}const pn=Xl();function x_(e,t){return new e({type:"string",...z(t)})}function N_(e,t){return new e({type:"string",coerce:!0,...z(t)})}function Hl(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function Ws(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...z(t)})}function Ql(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function ed(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...z(t)})}function td(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...z(t)})}function nd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...z(t)})}function rd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function id(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...z(t)})}function sd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...z(t)})}function ad(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...z(t)})}function od(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...z(t)})}function ud(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...z(t)})}function cd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...z(t)})}function ld(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...z(t)})}function dd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function hd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function md(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...z(t)})}function fd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...z(t)})}function pd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...z(t)})}function vd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...z(t)})}function gd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...z(t)})}function yd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...z(t)})}const T_={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function U_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function E_(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function j_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function A_(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function P_(e,t){return new e({type:"number",checks:[],...z(t)})}function Z_(e,t){return new e({type:"number",coerce:!0,checks:[],...z(t)})}function D_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function C_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...z(t)})}function R_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...z(t)})}function L_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...z(t)})}function M_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...z(t)})}function B_(e,t){return new e({type:"boolean",...z(t)})}function F_(e,t){return new e({type:"boolean",coerce:!0,...z(t)})}function J_(e,t){return new e({type:"bigint",...z(t)})}function V_(e,t){return new e({type:"bigint",coerce:!0,...z(t)})}function W_(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...z(t)})}function q_(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...z(t)})}function G_(e,t){return new e({type:"symbol",...z(t)})}function Y_(e,t){return new e({type:"undefined",...z(t)})}function K_(e,t){return new e({type:"null",...z(t)})}function X_(e){return new e({type:"any"})}function qs(e){return new e({type:"unknown"})}function H_(e,t){return new e({type:"never",...z(t)})}function Q_(e,t){return new e({type:"void",...z(t)})}function ek(e,t){return new e({type:"date",...z(t)})}function tk(e,t){return new e({type:"date",coerce:!0,...z(t)})}function nk(e,t){return new e({type:"nan",...z(t)})}function In(e,t){return new Ll({check:"less_than",...z(t),value:e,inclusive:!1})}function xt(e,t){return new Ll({check:"less_than",...z(t),value:e,inclusive:!0})}function On(e,t){return new Ml({check:"greater_than",...z(t),value:e,inclusive:!1})}function wt(e,t){return new Ml({check:"greater_than",...z(t),value:e,inclusive:!0})}function rk(e){return On(0,e)}function ik(e){return In(0,e)}function sk(e){return xt(0,e)}function ak(e){return wt(0,e)}function gi(e,t){return new i$({check:"multiple_of",...z(t),value:e})}function Ea(e,t){return new o$({check:"max_size",...z(t),maximum:e})}function yi(e,t){return new u$({check:"min_size",...z(t),minimum:e})}function bd(e,t){return new c$({check:"size_equals",...z(t),size:e})}function ja(e,t){return new l$({check:"max_length",...z(t),maximum:e})}function hr(e,t){return new d$({check:"min_length",...z(t),minimum:e})}function Aa(e,t){return new h$({check:"length_equals",...z(t),length:e})}function wd(e,t){return new m$({check:"string_format",format:"regex",...z(t),pattern:e})}function $d(e){return new f$({check:"string_format",format:"lowercase",...z(e)})}function _d(e){return new p$({check:"string_format",format:"uppercase",...z(e)})}function kd(e,t){return new v$({check:"string_format",format:"includes",...z(t),includes:e})}function Id(e,t){return new g$({check:"string_format",format:"starts_with",...z(t),prefix:e})}function Od(e,t){return new y$({check:"string_format",format:"ends_with",...z(t),suffix:e})}function ok(e,t,r){return new b$({check:"property",property:e,schema:t,...z(r)})}function Sd(e,t){return new w$({check:"mime_type",mime:e,...z(t)})}function Zn(e){return new $$({check:"overwrite",tx:e})}function zd(e){return Zn(t=>t.normalize(e))}function xd(){return Zn(e=>e.trim())}function Nd(){return Zn(e=>e.toLowerCase())}function Td(){return Zn(e=>e.toUpperCase())}function Ud(e,t,r){return new e({type:"array",element:t,...z(r)})}function FE(e,t,r){return new e({type:"union",options:t,...z(r)})}function JE(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...z(i)})}function VE(e,t,r){return new e({type:"intersection",left:t,right:r})}function uk(e,t,r,i){const n=r instanceof V,s=n?i:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...z(s)})}function WE(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...z(i)})}function qE(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...z(i)})}function GE(e,t,r){return new e({type:"set",valueType:t,...z(r)})}function YE(e,t,r){const i=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:i,...z(r)})}function KE(e,t,r){return new e({type:"enum",entries:t,...z(r)})}function XE(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...z(r)})}function ck(e,t){return new e({type:"file",...z(t)})}function HE(e,t){return new e({type:"transform",transform:t})}function QE(e,t){return new e({type:"optional",innerType:t})}function e4(e,t){return new e({type:"nullable",innerType:t})}function t4(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():r}})}function n4(e,t,r){return new e({type:"nonoptional",innerType:t,...z(r)})}function r4(e,t){return new e({type:"success",innerType:t})}function i4(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function s4(e,t,r){return new e({type:"pipe",in:t,out:r})}function a4(e,t){return new e({type:"readonly",innerType:t})}function o4(e,t,r){return new e({type:"template_literal",parts:t,...z(r)})}function u4(e,t){return new e({type:"lazy",getter:t})}function c4(e,t){return new e({type:"promise",innerType:t})}function lk(e,t,r){const i=z(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function dk(e,t,r){return new e({type:"custom",check:"custom",fn:t,...z(r)})}function hk(e,t){const{case:r,error:i,truthy:n,falsy:s}=z(t);let a=n??["true","1","yes","on","y","enabled"],o=s??["false","0","no","off","n","disabled"];r!=="sensitive"&&(a=a.map(f=>typeof f=="string"?f.toLowerCase():f),o=o.map(f=>typeof f=="string"?f.toLowerCase():f));const u=new Set(a),c=new Set(o),l=e.Pipe??Yl,d=e.Boolean??Jl,m=e.String??Li,y=e.Transform??Gl,k=new y({type:"transform",transform:(f,p)=>{let g=f;return r!=="sensitive"&&(g=g.toLowerCase()),u.has(g)?!0:c.has(g)?!1:(p.issues.push({code:"invalid_value",expected:"stringbool",values:[...u,...c],input:p.value,inst:k}),{})},error:i}),v=new l({type:"pipe",in:new m({type:"string",error:i}),out:k,error:i});return new l({type:"pipe",in:v,out:new d({type:"boolean",error:i}),error:i})}const Ed=_("ZodISODateTime",(e,t)=>{P$.init(e,t),Se.init(e,t)});function mk(e){return U_(Ed,e)}const jd=_("ZodISODate",(e,t)=>{Z$.init(e,t),Se.init(e,t)});function fk(e){return E_(jd,e)}const Ad=_("ZodISOTime",(e,t)=>{D$.init(e,t),Se.init(e,t)});function pk(e){return j_(Ad,e)}const Pd=_("ZodISODuration",(e,t)=>{C$.init(e,t),Se.init(e,t)});function vk(e){return A_(Pd,e)}const l4=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:jd,ZodISODateTime:Ed,ZodISODuration:Pd,ZodISOTime:Ad,date:fk,datetime:mk,duration:vk,time:pk},Symbol.toStringTag,{value:"Module"})),gk=(e,t)=>{El.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Al(e,r)},flatten:{value:r=>jl(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},d4=_("ZodError",gk),Mi=_("ZodError",gk,{Parent:Error}),yk=Pl(Mi),bk=Zl(Mi),wk=Dl(Mi),$k=Cl(Mi),te=_("ZodType",(e,t)=>(V.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>Mt(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.parse=(r,i)=>yk(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>wk(e,r,i),e.parseAsync=async(r,i)=>bk(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>$k(e,r,i),e.spa=e.safeParseAsync,e.refine=(r,i)=>e.check(iI(r,i)),e.superRefine=r=>e.check(sI(r)),e.overwrite=r=>e.check(Zn(r)),e.optional=()=>Ys(e),e.nullable=()=>Ks(e),e.nullish=()=>Ys(Ks(e)),e.nonoptional=r=>Wk(e,r),e.array=()=>Bi(e),e.or=r=>Pe([e,r]),e.and=r=>Ak(e,r),e.transform=r=>Xs(e,oh(r)),e.default=r=>Fk(e,r),e.prefault=r=>Vk(e,r),e.catch=r=>Yk(e,r),e.pipe=r=>Xs(e,r),e.readonly=()=>Hk(e),e.describe=r=>{const i=e.clone();return pn.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){var r;return(r=pn.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return pn.get(e);const i=e.clone();return pn.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Zd=_("_ZodString",(e,t)=>{Li.init(e,t),te.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(wd(...i)),e.includes=(...i)=>e.check(kd(...i)),e.startsWith=(...i)=>e.check(Id(...i)),e.endsWith=(...i)=>e.check(Od(...i)),e.min=(...i)=>e.check(hr(...i)),e.max=(...i)=>e.check(ja(...i)),e.length=(...i)=>e.check(Aa(...i)),e.nonempty=(...i)=>e.check(hr(1,...i)),e.lowercase=i=>e.check($d(i)),e.uppercase=i=>e.check(_d(i)),e.trim=()=>e.check(xd()),e.normalize=(...i)=>e.check(zd(...i)),e.toLowerCase=()=>e.check(Nd()),e.toUpperCase=()=>e.check(Td())}),Pa=_("ZodString",(e,t)=>{Li.init(e,t),Zd.init(e,t),e.email=r=>e.check(Hl(Dd,r)),e.url=r=>e.check(rd(Cd,r)),e.jwt=r=>e.check(yd(Qd,r)),e.emoji=r=>e.check(id(Rd,r)),e.guid=r=>e.check(Ws(Gs,r)),e.uuid=r=>e.check(Ql(qt,r)),e.uuidv4=r=>e.check(ed(qt,r)),e.uuidv6=r=>e.check(td(qt,r)),e.uuidv7=r=>e.check(nd(qt,r)),e.nanoid=r=>e.check(sd(Ld,r)),e.guid=r=>e.check(Ws(Gs,r)),e.cuid=r=>e.check(ad(Md,r)),e.cuid2=r=>e.check(od(Bd,r)),e.ulid=r=>e.check(ud(Fd,r)),e.base64=r=>e.check(pd(Kd,r)),e.base64url=r=>e.check(vd(Xd,r)),e.xid=r=>e.check(cd(Jd,r)),e.ksuid=r=>e.check(ld(Vd,r)),e.ipv4=r=>e.check(dd(Wd,r)),e.ipv6=r=>e.check(hd(qd,r)),e.cidrv4=r=>e.check(md(Gd,r)),e.cidrv6=r=>e.check(fd(Yd,r)),e.e164=r=>e.check(gd(Hd,r)),e.datetime=r=>e.check(mk(r)),e.date=r=>e.check(fk(r)),e.time=r=>e.check(pk(r)),e.duration=r=>e.check(vk(r))});function Ue(e){return x_(Pa,e)}const Se=_("ZodStringFormat",(e,t)=>{$e.init(e,t),Zd.init(e,t)}),Dd=_("ZodEmail",(e,t)=>{S$.init(e,t),Se.init(e,t)});function h4(e){return Hl(Dd,e)}const Gs=_("ZodGUID",(e,t)=>{I$.init(e,t),Se.init(e,t)});function m4(e){return Ws(Gs,e)}const qt=_("ZodUUID",(e,t)=>{O$.init(e,t),Se.init(e,t)});function f4(e){return Ql(qt,e)}function p4(e){return ed(qt,e)}function v4(e){return td(qt,e)}function g4(e){return nd(qt,e)}const Cd=_("ZodURL",(e,t)=>{z$.init(e,t),Se.init(e,t)});function y4(e){return rd(Cd,e)}const Rd=_("ZodEmoji",(e,t)=>{x$.init(e,t),Se.init(e,t)});function b4(e){return id(Rd,e)}const Ld=_("ZodNanoID",(e,t)=>{N$.init(e,t),Se.init(e,t)});function w4(e){return sd(Ld,e)}const Md=_("ZodCUID",(e,t)=>{T$.init(e,t),Se.init(e,t)});function $4(e){return ad(Md,e)}const Bd=_("ZodCUID2",(e,t)=>{U$.init(e,t),Se.init(e,t)});function _4(e){return od(Bd,e)}const Fd=_("ZodULID",(e,t)=>{E$.init(e,t),Se.init(e,t)});function k4(e){return ud(Fd,e)}const Jd=_("ZodXID",(e,t)=>{j$.init(e,t),Se.init(e,t)});function I4(e){return cd(Jd,e)}const Vd=_("ZodKSUID",(e,t)=>{A$.init(e,t),Se.init(e,t)});function O4(e){return ld(Vd,e)}const Wd=_("ZodIPv4",(e,t)=>{R$.init(e,t),Se.init(e,t)});function S4(e){return dd(Wd,e)}const qd=_("ZodIPv6",(e,t)=>{L$.init(e,t),Se.init(e,t)});function z4(e){return hd(qd,e)}const Gd=_("ZodCIDRv4",(e,t)=>{M$.init(e,t),Se.init(e,t)});function x4(e){return md(Gd,e)}const Yd=_("ZodCIDRv6",(e,t)=>{B$.init(e,t),Se.init(e,t)});function N4(e){return fd(Yd,e)}const Kd=_("ZodBase64",(e,t)=>{F$.init(e,t),Se.init(e,t)});function T4(e){return pd(Kd,e)}const Xd=_("ZodBase64URL",(e,t)=>{V$.init(e,t),Se.init(e,t)});function U4(e){return vd(Xd,e)}const Hd=_("ZodE164",(e,t)=>{W$.init(e,t),Se.init(e,t)});function E4(e){return gd(Hd,e)}const Qd=_("ZodJWT",(e,t)=>{G$.init(e,t),Se.init(e,t)});function j4(e){return yd(Qd,e)}const Za=_("ZodNumber",(e,t)=>{Fl.init(e,t),te.init(e,t),e.gt=(i,n)=>e.check(On(i,n)),e.gte=(i,n)=>e.check(wt(i,n)),e.min=(i,n)=>e.check(wt(i,n)),e.lt=(i,n)=>e.check(In(i,n)),e.lte=(i,n)=>e.check(xt(i,n)),e.max=(i,n)=>e.check(xt(i,n)),e.int=i=>e.check(uu(i)),e.safe=i=>e.check(uu(i)),e.positive=i=>e.check(On(0,i)),e.nonnegative=i=>e.check(wt(0,i)),e.negative=i=>e.check(In(0,i)),e.nonpositive=i=>e.check(xt(0,i)),e.multipleOf=(i,n)=>e.check(gi(i,n)),e.step=(i,n)=>e.check(gi(i,n)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Q(e){return P_(Za,e)}const Or=_("ZodNumberFormat",(e,t)=>{Y$.init(e,t),Za.init(e,t)});function uu(e){return D_(Or,e)}function A4(e){return C_(Or,e)}function P4(e){return R_(Or,e)}function Z4(e){return L_(Or,e)}function D4(e){return M_(Or,e)}const Da=_("ZodBoolean",(e,t)=>{Jl.init(e,t),te.init(e,t)});function eh(e){return B_(Da,e)}const Ca=_("ZodBigInt",(e,t)=>{Vl.init(e,t),te.init(e,t),e.gte=(i,n)=>e.check(wt(i,n)),e.min=(i,n)=>e.check(wt(i,n)),e.gt=(i,n)=>e.check(On(i,n)),e.gte=(i,n)=>e.check(wt(i,n)),e.min=(i,n)=>e.check(wt(i,n)),e.lt=(i,n)=>e.check(In(i,n)),e.lte=(i,n)=>e.check(xt(i,n)),e.max=(i,n)=>e.check(xt(i,n)),e.positive=i=>e.check(On(BigInt(0),i)),e.negative=i=>e.check(In(BigInt(0),i)),e.nonpositive=i=>e.check(xt(BigInt(0),i)),e.nonnegative=i=>e.check(wt(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(gi(i,n));const r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Sn(e){return J_(Ca,e)}const th=_("ZodBigIntFormat",(e,t)=>{K$.init(e,t),Ca.init(e,t)});function C4(e){return W_(th,e)}function R4(e){return q_(th,e)}const _k=_("ZodSymbol",(e,t)=>{X$.init(e,t),te.init(e,t)});function kk(e){return G_(_k,e)}const Ik=_("ZodUndefined",(e,t)=>{H$.init(e,t),te.init(e,t)});function Ok(e){return Y_(Ik,e)}const Sk=_("ZodNull",(e,t)=>{Q$.init(e,t),te.init(e,t)});function nh(e){return K_(Sk,e)}const zk=_("ZodAny",(e,t)=>{e_.init(e,t),te.init(e,t)});function L4(){return X_(zk)}const xk=_("ZodUnknown",(e,t)=>{Vs.init(e,t),te.init(e,t)});function mr(){return qs(xk)}const Nk=_("ZodNever",(e,t)=>{t_.init(e,t),te.init(e,t)});function Ra(e){return H_(Nk,e)}const Tk=_("ZodVoid",(e,t)=>{n_.init(e,t),te.init(e,t)});function M4(e){return Q_(Tk,e)}const rh=_("ZodDate",(e,t)=>{r_.init(e,t),te.init(e,t),e.min=(i,n)=>e.check(wt(i,n)),e.max=(i,n)=>e.check(xt(i,n));const r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function B4(e){return ek(rh,e)}const Uk=_("ZodArray",(e,t)=>{Wl.init(e,t),te.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(hr(r,i)),e.nonempty=r=>e.check(hr(1,r)),e.max=(r,i)=>e.check(ja(r,i)),e.length=(r,i)=>e.check(Aa(r,i)),e.unwrap=()=>e.element});function Bi(e,t){return Ud(Uk,e,t)}function F4(e){const t=e._zod.def.shape;return Rk(Object.keys(t))}const La=_("ZodObject",(e,t)=>{i_.init(e,t),te.init(e,t),oe(e,"shape",()=>Object.fromEntries(Object.entries(e._zod.def.shape))),e.keyof=()=>et(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:mr()}),e.loose=()=>e.clone({...e._zod.def,catchall:mr()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ra()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>fw(e,r),e.merge=r=>pw(e,r),e.pick=r=>hw(e,r),e.omit=r=>mw(e,r),e.partial=(...r)=>vw(uh,e,r[0]),e.required=(...r)=>gw(ch,e,r[0])});function ve(e,t){const r={type:"object",get shape(){return Ir(this,"shape",{...e}),this.shape},...z(t)};return new La(r)}function J4(e,t){return new La({type:"object",get shape(){return Ir(this,"shape",{...e}),this.shape},catchall:Ra(),...z(t)})}function V4(e,t){return new La({type:"object",get shape(){return Ir(this,"shape",{...e}),this.shape},catchall:mr(),...z(t)})}const ih=_("ZodUnion",(e,t)=>{ql.init(e,t),te.init(e,t),e.options=t.options});function Pe(e,t){return new ih({type:"union",options:e,...z(t)})}const Ek=_("ZodDiscriminatedUnion",(e,t)=>{ih.init(e,t),s_.init(e,t)});function W4(e,t,r){return new Ek({type:"union",options:t,discriminator:e,...z(r)})}const jk=_("ZodIntersection",(e,t)=>{a_.init(e,t),te.init(e,t)});function Ak(e,t){return new jk({type:"intersection",left:e,right:t})}const Pk=_("ZodTuple",(e,t)=>{Ua.init(e,t),te.init(e,t),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Sr(e,t,r){const i=t instanceof V,n=i?r:t,s=i?t:null;return new Pk({type:"tuple",items:e,rest:s,...z(n)})}const sh=_("ZodRecord",(e,t)=>{o_.init(e,t),te.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ma(e,t,r){return new sh({type:"record",keyType:e,valueType:t,...z(r)})}function q4(e,t,r){return new sh({type:"record",keyType:Pe([e,Ra()]),valueType:t,...z(r)})}const Zk=_("ZodMap",(e,t)=>{u_.init(e,t),te.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function G4(e,t,r){return new Zk({type:"map",keyType:e,valueType:t,...z(r)})}const Dk=_("ZodSet",(e,t)=>{c_.init(e,t),te.init(e,t),e.min=(...r)=>e.check(yi(...r)),e.nonempty=r=>e.check(yi(1,r)),e.max=(...r)=>e.check(Ea(...r)),e.size=(...r)=>e.check(bd(...r))});function Y4(e,t){return new Dk({type:"set",valueType:e,...z(t)})}const bi=_("ZodEnum",(e,t)=>{l_.init(e,t),te.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{const s={};for(const a of i)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new bi({...t,checks:[],...z(n),entries:s})},e.exclude=(i,n)=>{const s={...t.entries};for(const a of i)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new bi({...t,checks:[],...z(n),entries:s})}});function et(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new bi({type:"enum",entries:r,...z(t)})}function K4(e,t){return new bi({type:"enum",entries:e,...z(t)})}const Ck=_("ZodLiteral",(e,t)=>{d_.init(e,t),te.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Rk(e,t){return new Ck({type:"literal",values:Array.isArray(e)?e:[e],...z(t)})}const Lk=_("ZodFile",(e,t)=>{h_.init(e,t),te.init(e,t),e.min=(r,i)=>e.check(yi(r,i)),e.max=(r,i)=>e.check(Ea(r,i)),e.mime=(r,i)=>e.check(Sd(Array.isArray(r)?r:[r],i))});function X4(e){return ck(Lk,e)}const ah=_("ZodTransform",(e,t)=>{Gl.init(e,t),te.init(e,t),e._zod.parse=(r,i)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(lr(s,r.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),a.continue??(a.continue=!0),r.issues.push(lr(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r)):(r.value=n,r)}});function oh(e){return new ah({type:"transform",transform:e})}const uh=_("ZodOptional",(e,t)=>{m_.init(e,t),te.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ys(e){return new uh({type:"optional",innerType:e})}const Mk=_("ZodNullable",(e,t)=>{f_.init(e,t),te.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ks(e){return new Mk({type:"nullable",innerType:e})}function H4(e){return Ys(Ks(e))}const Bk=_("ZodDefault",(e,t)=>{p_.init(e,t),te.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Fk(e,t){return new Bk({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Jk=_("ZodPrefault",(e,t)=>{v_.init(e,t),te.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Vk(e,t){return new Jk({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const ch=_("ZodNonOptional",(e,t)=>{g_.init(e,t),te.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Wk(e,t){return new ch({type:"nonoptional",innerType:e,...z(t)})}const qk=_("ZodSuccess",(e,t)=>{y_.init(e,t),te.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Q4(e){return new qk({type:"success",innerType:e})}const Gk=_("ZodCatch",(e,t)=>{b_.init(e,t),te.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Yk(e,t){return new Gk({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Kk=_("ZodNaN",(e,t)=>{w_.init(e,t),te.init(e,t)});function e6(e){return nk(Kk,e)}const lh=_("ZodPipe",(e,t)=>{Yl.init(e,t),te.init(e,t),e.in=t.in,e.out=t.out});function Xs(e,t){return new lh({type:"pipe",in:e,out:t})}const Xk=_("ZodReadonly",(e,t)=>{$_.init(e,t),te.init(e,t)});function Hk(e){return new Xk({type:"readonly",innerType:e})}const Qk=_("ZodTemplateLiteral",(e,t)=>{__.init(e,t),te.init(e,t)});function t6(e,t){return new Qk({type:"template_literal",parts:e,...z(t)})}const eI=_("ZodLazy",(e,t)=>{I_.init(e,t),te.init(e,t),e.unwrap=()=>e._zod.def.getter()});function tI(e){return new eI({type:"lazy",getter:e})}const nI=_("ZodPromise",(e,t)=>{k_.init(e,t),te.init(e,t),e.unwrap=()=>e._zod.def.innerType});function n6(e){return new nI({type:"promise",innerType:e})}const Ba=_("ZodCustom",(e,t)=>{O_.init(e,t),te.init(e,t)});function rI(e,t){const r=new Fe({check:"custom",...z(t)});return r._zod.check=e,r}function r6(e,t){return lk(Ba,e??(()=>!0),t)}function iI(e,t={}){return dk(Ba,e,t)}function sI(e,t){const r=rI(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(lr(n,i.value,r._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),i.issues.push(lr(s))}},e(i.value,i)),t);return r}function be(e,t={error:`Input not instance of ${e.name}`}){const r=new Ba({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...z(t)});return r._zod.bag.Class=e,r}const i6=(...e)=>hk({Pipe:lh,Boolean:Da,String:Pa,Transform:ah},...e);function s6(e){const t=tI(()=>Pe([Ue(e),Q(),eh(),nh(),Bi(t),Ma(Ue(),t)]));return t}function a6(e,t){return Xs(oh(e),t)}const Fa=Sr([Q(),Q()]);Sr([Sn(),Sn()]);const aI=ve({width:Q(),height:Q()}),o6=ve({signedWidth:Q(),signedHeight:Q()}),u6=["width","height"];et(u6);const c6=["start","center","end"],l6=["signedWidth","signedHeight"];et(l6);const Hs=ve({x:Q(),y:Q()}),d6=ve({clientX:Q(),clientY:Q()}),h6=["x","y"],oI=et(h6),uI=["top","right","bottom","left"];et(uI);const m6=["left","right"],cI=et(m6),f6=["top","bottom"],lI=et(f6),dI=["center"],Wm=et(dI),p6=[...uI,...dI],hI=et(p6);et(c6);const v6=["first","last"];et(v6);const g6=ve({lower:Q(),upper:Q()}),y6=ve({lower:Sn(),upper:Sn()});Pe([g6,Fa]);Pe([y6,Fa]);et([...oI.options,...hI.options]);Pe([oI,hI,be(String)]);const b6=e=>typeof e=="bigint"||e instanceof BigInt,Bn=(e,t)=>b6(e)?e.valueOf()*BigInt(t.valueOf()):e.valueOf()*Number(t.valueOf()),yn=(e,t,r)=>{const i={};if(typeof t=="object"&&(r=t,t=void 0),r={makeValid:!0,...r},typeof e=="number"||typeof e=="bigint")t!=null?(i.lower=e,i.upper=t):(i.lower=typeof e=="bigint"?0n:0,i.upper=e);else if(Array.isArray(e)){if(e.length!==2)throw new Error("bounds: expected array of length 2");[i.lower,i.upper]=e}else i.lower=e.lower,i.upper=e.upper;return r!=null&&r.makeValid?w6(i):i},w6=e=>e.lower>e.upper?{lower:e.upper,upper:e.lower}:e,qm=(e,t)=>{const r=yn(e);return t<r.lower?r.lower:t>=r.upper?r.upper-(typeof r.upper=="number"?1:1n):t};ve({x:cI.or(Wm),y:lI.or(Wm)});const $6=ve({x:cI,y:lI}),_6=Object.freeze({x:"left",y:"top"}),k6=(e,t)=>e.x===t.x&&e.y===t.y,Gm=Pe([Q(),Hs,Fa,aI,o6,d6]),I6=(e,t)=>{if(typeof e=="string"){if(t===void 0)throw new Error("The y coordinate must be given.");return e==="x"?{x:t,y:0}:{x:0,y:t}}return typeof e=="number"?{x:e,y:t??e}:Array.isArray(e)?{x:e[0],y:e[1]}:"signedWidth"in e?{x:e.signedWidth,y:e.signedHeight}:"clientX"in e?{x:e.clientX,y:e.clientY}:"width"in e?{x:e.width,y:e.height}:{x:e.x,y:e.y}},Ym=Object.freeze({x:0,y:0}),us=Pe([Q(),Ue()]);ve({top:us,left:us,width:us,height:us});ve({left:Q(),top:Q(),right:Q(),bottom:Q()});ve({one:Hs,two:Hs,root:$6});const dh=(e,t,r=0,i=0,n)=>{const s={one:{...Ym},two:{...Ym},root:n??_6};if(typeof e=="number"){if(typeof t!="number")throw new Error("Box constructor called with invalid arguments");return s.one={x:e,y:t},s.two={x:s.one.x+r,y:s.one.y+i},s}return"one"in e&&"two"in e&&"root"in e?{...e,root:n??e.root}:("getBoundingClientRect"in e&&(e=e.getBoundingClientRect()),"left"in e?(s.one={x:e.left,y:e.top},s.two={x:e.right,y:e.bottom},s):(s.one=e,t==null?s.two={x:s.one.x+r,y:s.one.y+i}:typeof t=="number"?s.two={x:s.one.x+t,y:s.one.y+r}:"width"in t?s.two={x:s.one.x+t.width,y:s.one.y+t.height}:"signedWidth"in t?s.two={x:s.one.x+t.signedWidth,y:s.one.y+t.signedHeight}:s.two=t,s))},wo=e=>{const t=dh(e);return{lower:t.one.x,upper:t.two.x}},$o=e=>{const t=dh(e);return{lower:t.one.y,upper:t.two.y}},O6=e=>typeof e!="object"||e==null?!1:"one"in e&&"two"in e&&"root"in e,S6=ve({signedWidth:Q(),signedHeight:Q()});Pe([aI,S6,Hs,Fa]);var z6=Object.defineProperty,x6=(e,t,r)=>t in e?z6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gt=(e,t,r)=>x6(e,typeof t!="symbol"?t+"":t,r);const N6=(e,t,r)=>t!==void 0&&e<t?t:r!==void 0&&e>r?r:e;ve({offset:Gm,scale:Gm});ve({offset:Q(),scale:Q()});const T6=e=>(t,r,i,n)=>r==="dimension"?[t,i]:[t,n?i-e:i+e],U6=e=>(t,r,i,n)=>[t,n?i/e:i*e],E6=e=>(t,r,i)=>{if(t===null)return[e,i];const{lower:n,upper:s}=t,{lower:a,upper:o}=e,u=s-n,c=o-a;if(r==="dimension")return[e,i*(c/u)];const l=(i-n)*(c/u)+a;return[e,l]},j6=e=>(t,r,i)=>[e,i],A6=()=>(e,t,r)=>{if(e===null)throw new Error("cannot invert without bounds");if(t==="dimension")return[e,r];const{lower:i,upper:n}=e;return[e,n-(r-i)]},P6=e=>(t,r,i)=>{const{lower:n,upper:s}=e;return i=N6(i,n,s),[t,i]},cu=class Yr{constructor(){Gt(this,"ops",[]),Gt(this,"currBounds",null),Gt(this,"currType",null),Gt(this,"reversed",!1),this.ops=[]}static translate(t){return new Yr().translate(t)}static magnify(t){return new Yr().magnify(t)}static scale(t,r){return new Yr().scale(t,r)}translate(t){const r=this.new(),i=T6(t);return i.type="translate",r.ops.push(i),r}magnify(t){const r=this.new(),i=U6(t);return i.type="magnify",r.ops.push(i),r}scale(t,r){const i=yn(t,r),n=this.new(),s=E6(i);return s.type="scale",n.ops.push(s),n}clamp(t,r){const i=yn(t,r),n=this.new(),s=P6(i);return s.type="clamp",n.ops.push(s),n}reBound(t,r){const i=yn(t,r),n=this.new(),s=j6(i);return s.type="re-bound",n.ops.push(s),n}invert(){const t=A6();t.type="invert";const r=this.new();return r.ops.push(t),r}pos(t){return this.exec("position",t)}dim(t){return this.exec("dimension",t)}new(){const t=new Yr;return t.ops=this.ops.slice(),t.reversed=this.reversed,t}exec(t,r){return this.currBounds=null,this.ops.reduce(([i,n],s)=>s(i,t,n,this.reversed),[null,r])[1]}reverse(){const t=this.new();t.ops.reverse();const r=[];return t.ops.forEach((i,n)=>{if(i.type==="scale"||r.some(([a,o])=>n>=a&&n<=o))return;const s=t.ops.findIndex((a,o)=>a.type==="scale"&&o>n);s!==-1&&r.push([n,s])}),r.forEach(([i,n])=>{const s=t.ops.slice(i,n);s.unshift(t.ops[n]),t.ops.splice(i,n-i+1,...s)}),t.reversed=!t.reversed,t}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}};Gt(cu,"IDENTITY",new cu);let Km=cu;const Xm=class Jt{constructor(t=new Km,r=new Km,i=null){Gt(this,"x"),Gt(this,"y"),Gt(this,"currRoot"),this.x=t,this.y=r,this.currRoot=i}static translate(t,r){return new Jt().translate(t,r)}static translateX(t){return new Jt().translateX(t)}static translateY(t){return new Jt().translateY(t)}static clamp(t){return new Jt().clamp(t)}static magnify(t){return new Jt().magnify(t)}static scale(t){return new Jt().scale(t)}static reBound(t){return new Jt().reBound(t)}translate(t,r){const i=I6(t,r),n=this.copy();return n.x=this.x.translate(i.x),n.y=this.y.translate(i.y),n}translateX(t){const r=this.copy();return r.x=this.x.translate(t),r}translateY(t){const r=this.copy();return r.y=this.y.translate(t),r}magnify(t){const r=this.copy();return r.x=this.x.magnify(t.x),r.y=this.y.magnify(t.y),r}scale(t){const r=this.copy();if(O6(t)){const i=this.currRoot;return r.currRoot=t.root,i!=null&&!k6(i,t.root)&&(i.x!==t.root.x&&(r.x=r.x.invert()),i.y!==t.root.y&&(r.y=r.y.invert())),r.x=r.x.scale(wo(t)),r.y=r.y.scale($o(t)),r}return r.x=r.x.scale(t.width),r.y=r.y.scale(t.height),r}reBound(t){const r=this.copy();return r.x=this.x.reBound(wo(t)),r.y=this.y.reBound($o(t)),r}clamp(t){const r=this.copy();return r.x=this.x.clamp(wo(t)),r.y=this.y.clamp($o(t)),r}copy(){const t=new Jt;return t.currRoot=this.currRoot,t.x=this.x,t.y=this.y,t}reverse(){const t=this.copy();return t.x=this.x.reverse(),t.y=this.y.reverse(),t}pos(t){return{x:this.x.pos(t.x),y:this.y.pos(t.y)}}dim(t){return{x:this.x.dim(t.x),y:this.y.dim(t.y)}}box(t){return dh(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}};Gt(Xm,"IDENTITY",new Xm);var Z6=Object.defineProperty,D6=(e,t,r)=>t in e?Z6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,E=(e,t,r)=>D6(e,typeof t!="symbol"?t+"":t,r);function C6(e){return N_(Pa,e)}function R6(e){return Z_(Za,e)}function L6(e){return F_(Da,e)}function mI(e){return V_(Ca,e)}function M6(e){return tk(rh,e)}const B6=Object.freeze(Object.defineProperty({__proto__:null,bigint:mI,boolean:L6,date:M6,number:R6,string:C6},Symbol.toStringTag,{value:"Module"}));let F6=(e,t=21)=>(r=t)=>{let i="",n=r|0;for(;n--;)i+=e[Math.random()*e.length|0];return i};const J6="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",V6=F6(J6,11),W6=()=>V6(),q6=(e,t)=>r=>r instanceof t||typeof r=="object"&&r!==null&&"discriminator"in r&&r.discriminator===e,G6=et(["static","dynamic"]),fI=(e,t)=>{const r=new ge(t);if(![ue.DAY,ue.HOUR,ue.MINUTE,ue.SECOND,ue.MILLISECOND,ue.MICROSECOND,ue.NANOSECOND].some(n=>n.equals(r)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const i=e.valueOf()%r.valueOf();return e instanceof ge?new ge(i):new ue(i)},me=class L extends kr{constructor(t,r="UTC"){if(t==null)super(L.now().valueOf());else if(t instanceof Date)super(BigInt(t.getTime())*L.MILLISECOND.valueOf());else if(typeof t=="string")super(L.parseDateTimeString(t,r).valueOf());else if(Array.isArray(t))super(L.parseDate(t));else{let i=BigInt(0);t instanceof Number&&(t=t.valueOf()),r==="local"&&(i=L.utcOffset.valueOf()),typeof t=="number"&&(isFinite(t)?t=Math.trunc(t):(isNaN(t)&&(t=0),t===1/0?t=L.MAX:t=L.MIN)),super(BigInt(t.valueOf())+i)}}static parseDate([t=1970,r=1,i=1]){const n=new Date(t,r-1,i,0,0,0,0);return new L(BigInt(n.getTime())*L.MILLISECOND.valueOf()).truncate(L.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(t,r="UTC"){const[i,n,s]=t.split(":");let a="00",o="00";s!=null&&([a,o]=s.split("."));let u=L.hours(parseInt(i??"00")).add(L.minutes(parseInt(n??"00"))).add(L.seconds(parseInt(a??"00"))).add(L.milliseconds(parseInt(o??"00")));return r==="local"&&(u=u.add(L.utcOffset)),u.valueOf()}static parseDateTimeString(t,r="UTC"){if(!t.includes("/")&&!t.includes("-"))return L.parseTimeString(t,r);const i=new Date(t);return t.includes(":")||i.setUTCHours(0,0,0,0),new L(BigInt(i.getTime())*L.MILLISECOND.valueOf(),r).valueOf()}fString(t="ISO",r="UTC"){switch(t){case"ISODate":return this.toISOString(r).slice(0,10);case"ISOTime":return this.toISOString(r).slice(11,23);case"time":return this.timeString(!1,r);case"preciseTime":return this.timeString(!0,r);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,r)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,r)}`;default:return this.toISOString(r)}}toISOString(t="UTC"){return t==="UTC"?this.date().toISOString():this.sub(L.utcOffset).date().toISOString()}timeString(t=!1,r="UTC"){const i=this.toISOString(r);return t?i.slice(11,23):i.slice(11,19)}dateString(){const t=this.date(),r=t.toLocaleString("default",{month:"short"}),i=t.toLocaleString("default",{day:"numeric"});return`${r} ${i}`}static get utcOffset(){return new ue(BigInt(new Date().getTimezoneOffset())*L.MINUTE.valueOf())}static since(t){return new L().span(t)}date(){return new Date(this.milliseconds)}equals(t){return this.valueOf()===new L(t).valueOf()}span(t){return this.range(t).span}range(t){return new si(this,t).makeValid()}spanRange(t){return this.range(this.add(t)).makeValid()}get isZero(){return this.valueOf()===BigInt(0)}after(t){return this.valueOf()>new L(t).valueOf()}afterEq(t){return this.valueOf()>=new L(t).valueOf()}before(t){return this.valueOf()<new L(t).valueOf()}beforeEq(t){return this.valueOf()<=new L(t).valueOf()}add(t){return new L(this.valueOf()+BigInt(t.valueOf()))}sub(t){return new L(this.valueOf()-BigInt(t.valueOf()))}get hours(){return Number(this.valueOf())/Number(ue.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(ue.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(ue.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(ue.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(L.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(L.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getUTCFullYear()}setYear(t){const r=this.date();return r.setUTCFullYear(t),new L(r)}get month(){return this.date().getUTCMonth()}setMonth(t){const r=this.date();return r.setUTCMonth(t),new L(r)}get day(){return this.date().getUTCDate()}setDay(t){const r=this.date();return r.setUTCDate(t),new L(r)}get hour(){return this.date().getUTCHours()}setHour(t){const r=this.date();return r.setUTCHours(t),new L(r,"UTC")}get minute(){return this.date().getUTCMinutes()}setMinute(t){const r=this.date();return r.setUTCMinutes(t),new L(r)}get second(){return this.date().getUTCSeconds()}setSecond(t){const r=this.date();return r.setUTCSeconds(t),new L(r)}get millisecond(){return this.date().getUTCMilliseconds()}setMillisecond(t){const r=this.date();return r.setUTCMilliseconds(t),new L(r)}toString(){return this.date().toISOString()}remainder(t){return fI(this,t)}get isToday(){return this.truncate(ue.DAY).equals(L.now().truncate(ue.DAY))}truncate(t){return this.sub(this.remainder(t))}static now(){return new L(new Date)}static max(...t){let r=L.MIN;for(const i of t){const n=new L(i);n.after(r)&&(r=n)}return r}static min(...t){let r=L.MAX;for(const i of t){const n=new L(i);n.before(r)&&(r=n)}return r}static nanoseconds(t,r="UTC"){return new L(t,r)}static microseconds(t,r="UTC"){return L.nanoseconds(t*1e3,r)}static milliseconds(t,r="UTC"){return L.microseconds(t*1e3,r)}static seconds(t,r="UTC"){return L.milliseconds(t*1e3,r)}static minutes(t,r="UTC"){return L.seconds(t*60,r)}static hours(t,r="UTC"){return L.minutes(t*60,r)}static days(t,r="UTC"){return L.hours(t*24,r)}};E(me,"NANOSECOND",me.nanoseconds(1)),E(me,"MICROSECOND",me.microseconds(1)),E(me,"MILLISECOND",me.milliseconds(1)),E(me,"SECOND",me.seconds(1)),E(me,"MINUTE",me.minutes(1)),E(me,"HOUR",me.hours(1)),E(me,"DAY",me.days(1)),E(me,"MAX",new me((1n<<63n)-1n)),E(me,"MIN",new me(0)),E(me,"ZERO",new me(0)),E(me,"z",Pe([ve({value:Sn()}).transform(e=>new me(e.value)),Ue().transform(e=>new me(BigInt(e))),be(Number).transform(e=>new me(e)),Q().transform(e=>new me(e)),be(me)]));let ge=me;const fe=class Y extends kr{constructor(t){typeof t=="number"&&(t=Math.trunc(t.valueOf())),super(BigInt(t.valueOf()))}static fromSeconds(t){return t instanceof Y?t:t instanceof Hm?t.period:t instanceof ge?new Y(t):["number","bigint"].includes(typeof t)?Y.seconds(t):new Y(t)}static fromMilliseconds(t){return t instanceof Y?t:t instanceof Hm?t.period:t instanceof ge?new Y(t):["number","bigint"].includes(typeof t)?Y.milliseconds(t):new Y(t)}valueOf(){return this.value}lessThan(t){return this.valueOf()<new Y(t).valueOf()}greaterThan(t){return this.valueOf()>new Y(t).valueOf()}lessThanOrEqual(t){return this.valueOf()<=new Y(t).valueOf()}greaterThanOrEqual(t){return this.valueOf()>=new Y(t).valueOf()}remainder(t){return fI(this,t)}truncate(t){return new Y(BigInt(Math.trunc(Number(this.valueOf()/t.valueOf())))*t.valueOf())}toString(){const t=this.truncate(Y.DAY),r=this.truncate(Y.HOUR),i=this.truncate(Y.MINUTE),n=this.truncate(Y.SECOND),s=this.truncate(Y.MILLISECOND),a=this.truncate(Y.MICROSECOND),o=this.truncate(Y.NANOSECOND),u=t,c=r.sub(t),l=i.sub(r),d=n.sub(i),m=s.sub(n),y=a.sub(s),k=o.sub(a);let v="";return u.isZero||(v+=`${u.days}d `),c.isZero||(v+=`${c.hours}h `),l.isZero||(v+=`${l.minutes}m `),d.isZero||(v+=`${d.seconds}s `),m.isZero||(v+=`${m.milliseconds}ms `),y.isZero||(v+=`${y.microseconds}µs `),k.isZero||(v+=`${k.nanoseconds}ns`),v.trim()}mult(t){return new Y(this.valueOf()*BigInt(t))}get days(){return Number(this.valueOf())/Number(Y.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(Y.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(Y.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(Y.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(Y.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(Y.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===BigInt(0)}equals(t){return this.valueOf()===new Y(t).valueOf()}add(t){return new Y(this.valueOf()+new Y(t).valueOf())}sub(t){return new Y(this.valueOf()-new Y(t).valueOf())}static nanoseconds(t=1){return new Y(t)}static microseconds(t=1){return Y.nanoseconds(Bn(t,1e3))}static milliseconds(t=1){return Y.microseconds(Bn(t,1e3))}static seconds(t=1){return Y.milliseconds(Bn(t,1e3))}static minutes(t=1){return Y.seconds(Bn(t,60))}static hours(t){return Y.minutes(Bn(t,60))}static days(t){return Y.hours(Bn(t,24))}};E(fe,"NANOSECOND",fe.nanoseconds(1)),E(fe,"MICROSECOND",fe.microseconds(1)),E(fe,"MILLISECOND",fe.milliseconds(1)),E(fe,"SECOND",fe.seconds(1)),E(fe,"MINUTE",fe.minutes(1)),E(fe,"HOUR",fe.hours(1)),E(fe,"DAY",fe.days(1)),E(fe,"MAX",new fe((1n<<63n)-1n)),E(fe,"MIN",new fe(0)),E(fe,"ZERO",new fe(0)),E(fe,"z",Pe([ve({value:Sn()}).transform(e=>new fe(e.value)),Ue().transform(e=>new fe(BigInt(e))),be(Number).transform(e=>new fe(e)),Q().transform(e=>new fe(e)),be(fe)]));let ue=fe;const Kr=class Is extends kr{constructor(t){super(t.valueOf())}toString(){return`${this.valueOf()} Hz`}equals(t){return this.valueOf()===new Is(t).valueOf()}get period(){return ue.seconds(1/this.valueOf())}sampleCount(t){return new ue(t).seconds*this.valueOf()}byteCount(t,r){return this.sampleCount(t)*new dt(r).valueOf()}span(t){return ue.seconds(t/this.valueOf())}byteSpan(t,r){return this.span(t.valueOf()/r.valueOf())}static hz(t){return new Is(t)}static khz(t){return Is.hz(t*1e3)}};E(Kr,"z",Pe([Q().transform(e=>new Kr(e)),be(Number).transform(e=>new Kr(e)),be(Kr)]));let Hm=Kr;const rt=class extends kr{constructor(e){super(e.valueOf())}length(e){return e.valueOf()/this.valueOf()}size(e){return new lu(e*this.valueOf())}};E(rt,"UNKNOWN",new rt(0)),E(rt,"BIT128",new rt(16)),E(rt,"BIT64",new rt(8)),E(rt,"BIT32",new rt(4)),E(rt,"BIT16",new rt(2)),E(rt,"BIT8",new rt(1)),E(rt,"z",Pe([Q().transform(e=>new rt(e)),be(Number).transform(e=>new rt(e)),be(rt)]));let dt=rt;const At=class Xr{constructor(t,r){E(this,"start"),E(this,"end"),typeof t=="object"&&"start"in t?(this.start=new ge(t.start),this.end=new ge(t.end)):(this.start=new ge(t),this.end=new ge(r))}get span(){return new ue(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new Xr(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(t,r=ue.ZERO){if(r.isZero)return this.start.equals(t.start)&&this.end.equals(t.end);let i=this.start.sub(t.start).valueOf(),n=this.end.sub(t.end).valueOf();return i<0&&(i=-i),n<0&&(n=-n),i<=r.valueOf()&&n<=r.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(t,r=ue.ZERO){t=t.makeValid();const i=this.makeValid();if(this.equals(t))return!0;if(t.end.equals(i.start)||i.end.equals(t.start))return!1;const n=ge.max(i.start,t.start),s=ge.min(i.end,t.end);return s.before(n)?!1:new ue(s.sub(n)).greaterThanOrEqual(r)}contains(t){return t instanceof Xr?this.contains(t.start)&&this.contains(t.end):this.start.beforeEq(t)&&this.end.after(t)}boundBy(t){const r=new Xr(this.start,this.end);return t.start.after(this.start)&&(r.start=t.start),t.start.after(this.end)&&(r.end=t.start),t.end.before(this.end)&&(r.end=t.end),t.end.before(this.start)&&(r.start=t.end),r}static max(...t){return new Xr(ge.min(...t.map(r=>r.start)),ge.max(...t.map(r=>r.end)))}};E(At,"MAX",new At(ge.MIN,ge.MAX)),E(At,"MIN",new At(ge.MAX,ge.MIN)),E(At,"ZERO",new At(ge.ZERO,ge.ZERO)),E(At,"z",Pe([ve({start:ge.z,end:ge.z}).transform(e=>new At(e.start,e.end)),be(At)]));let si=At;const U=class De extends kr{constructor(t){if(t instanceof De||typeof t=="string"||typeof t.valueOf()=="string")super(t.valueOf());else{const r=De.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);if(r==null)throw new Error(`unable to find data type for ${t.toString()}`);super(r.valueOf())}}get Array(){const t=De.ARRAY_CONSTRUCTORS.get(this.toString());if(t==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return t}equals(t){return this.valueOf()===t.valueOf()}matches(...t){return t.some(r=>this.equals(r))}toString(){return this.valueOf()}get isVariable(){return this.equals(De.JSON)||this.equals(De.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(De.UUID)}get isInteger(){const t=this.toString();return t.startsWith("int")||t.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const t=De.DENSITIES.get(this.toString());if(t==null)throw new Error(`unable to find density for ${this.valueOf()}`);return t}get isUnsignedInteger(){return this.equals(De.UINT8)||this.equals(De.UINT16)||this.equals(De.UINT32)||this.equals(De.UINT64)}get isSignedInteger(){return this.equals(De.INT8)||this.equals(De.INT16)||this.equals(De.INT32)||this.equals(De.INT64)}canSafelyCastTo(t){return this.equals(t)?!0:!this.isNumeric||!t.isNumeric||this.isVariable||t.isVariable||this.isUnsignedInteger&&t.isSignedInteger?!1:this.isFloat?t.isFloat&&this.density.valueOf()<=t.density.valueOf():this.equals(De.INT32)&&t.equals(De.FLOAT64)||this.equals(De.INT8)&&t.equals(De.FLOAT32)?!0:this.isInteger&&t.isInteger?this.density.valueOf()<=t.density.valueOf()&&this.isUnsignedInteger===t.isUnsignedInteger:!1}canCastTo(t){return this.isNumeric&&t.isNumeric?!0:this.equals(t)}checkArray(t){return t.constructor===this.Array}get usesBigInt(){return De.BIG_INT_TYPES.some(t=>t.equals(this))}};E(U,"UNKNOWN",new U("unknown")),E(U,"FLOAT64",new U("float64")),E(U,"FLOAT32",new U("float32")),E(U,"INT64",new U("int64")),E(U,"INT32",new U("int32")),E(U,"INT16",new U("int16")),E(U,"INT8",new U("int8")),E(U,"UINT64",new U("uint64")),E(U,"UINT32",new U("uint32")),E(U,"UINT16",new U("uint16")),E(U,"UINT8",new U("uint8")),E(U,"BOOLEAN",U.UINT8),E(U,"TIMESTAMP",new U("timestamp")),E(U,"UUID",new U("uuid")),E(U,"STRING",new U("string")),E(U,"JSON",new U("json")),E(U,"ARRAY_CONSTRUCTORS",new Map([[U.UINT8.toString(),Uint8Array],[U.UINT16.toString(),Uint16Array],[U.UINT32.toString(),Uint32Array],[U.UINT64.toString(),BigUint64Array],[U.FLOAT32.toString(),Float32Array],[U.FLOAT64.toString(),Float64Array],[U.INT8.toString(),Int8Array],[U.INT16.toString(),Int16Array],[U.INT32.toString(),Int32Array],[U.INT64.toString(),BigInt64Array],[U.TIMESTAMP.toString(),BigInt64Array],[U.STRING.toString(),Uint8Array],[U.JSON.toString(),Uint8Array],[U.UUID.toString(),Uint8Array]])),E(U,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,U.UINT8],[Uint16Array.name,U.UINT16],[Uint32Array.name,U.UINT32],[BigUint64Array.name,U.UINT64],[Float32Array.name,U.FLOAT32],[Float64Array.name,U.FLOAT64],[Int8Array.name,U.INT8],[Int16Array.name,U.INT16],[Int32Array.name,U.INT32],[BigInt64Array.name,U.INT64]])),E(U,"DENSITIES",new Map([[U.UINT8.toString(),dt.BIT8],[U.UINT16.toString(),dt.BIT16],[U.UINT32.toString(),dt.BIT32],[U.UINT64.toString(),dt.BIT64],[U.FLOAT32.toString(),dt.BIT32],[U.FLOAT64.toString(),dt.BIT64],[U.INT8.toString(),dt.BIT8],[U.INT16.toString(),dt.BIT16],[U.INT32.toString(),dt.BIT32],[U.INT64.toString(),dt.BIT64],[U.TIMESTAMP.toString(),dt.BIT64],[U.STRING.toString(),dt.UNKNOWN],[U.JSON.toString(),dt.UNKNOWN],[U.UUID.toString(),dt.BIT128]])),E(U,"ALL",[U.UNKNOWN,U.FLOAT64,U.FLOAT32,U.INT64,U.INT32,U.INT16,U.INT8,U.UINT64,U.UINT32,U.UINT16,U.UINT8,U.TIMESTAMP,U.UUID,U.STRING,U.JSON]),E(U,"BIG_INT_TYPES",[U.INT64,U.UINT64,U.TIMESTAMP]),E(U,"z",Pe([Ue().transform(e=>new U(e)),be(U)]));let Ce=U;const ct=class We extends kr{constructor(t){super(t.valueOf())}largerThan(t){return this.valueOf()>t.valueOf()}smallerThan(t){return this.valueOf()<t.valueOf()}add(t){return We.bytes(this.valueOf()+t.valueOf())}sub(t){return We.bytes(this.valueOf()-t.valueOf())}truncate(t){return new We(Math.trunc(this.valueOf()/t.valueOf())*t.valueOf())}remainder(t){return We.bytes(this.valueOf()%t.valueOf())}get gigabytes(){return this.valueOf()/We.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/We.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/We.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/We.TERABYTE.valueOf()}toString(){const t=this.truncate(We.TERABYTE),r=this.truncate(We.GIGABYTE),i=this.truncate(We.MEGABYTE),n=this.truncate(We.KILOBYTE),s=this.truncate(We.BYTE),a=t,o=r.sub(t),u=i.sub(r),c=n.sub(i),l=s.sub(n);let d="";return a.isZero||(d+=`${a.terabytes}TB `),o.isZero||(d+=`${o.gigabytes}GB `),u.isZero||(d+=`${u.megabytes}MB `),c.isZero||(d+=`${c.kilobytes}KB `),(!l.isZero||d==="")&&(d+=`${l.valueOf()}B`),d.trim()}static bytes(t=1){return new We(t)}static kilobytes(t=1){return We.bytes(t.valueOf()*1e3)}static megabytes(t=1){return We.kilobytes(t.valueOf()*1e3)}static gigabytes(t=1){return We.megabytes(t.valueOf()*1e3)}static terabytes(t){return We.gigabytes(t.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};E(ct,"BYTE",new ct(1)),E(ct,"KILOBYTE",ct.kilobytes(1)),E(ct,"MEGABYTE",ct.megabytes(1)),E(ct,"GIGABYTE",ct.gigabytes(1)),E(ct,"TERABYTE",ct.terabytes(1)),E(ct,"ZERO",new ct(0)),E(ct,"z",Pe([Q().transform(e=>new ct(e)),be(ct)]));let lu=ct;Pe([be(Uint8Array),be(Uint16Array),be(Uint32Array),be(BigUint64Array),be(Float32Array),be(Float64Array),be(Int8Array),be(Int16Array),be(Int32Array),be(BigInt64Array)]);const pI=e=>{const t=typeof e;return t==="string"||t==="number"||t==="boolean"||t==="bigint"||e instanceof ge||e instanceof ue||e instanceof Date},Y6=(e,t,r,i=0)=>e.usesBigInt&&!t.usesBigInt?Number(r)-Number(i):!e.usesBigInt&&t.usesBigInt?BigInt(r.valueOf())-BigInt(i.valueOf()):Os(r,-i).valueOf(),Os=(e,t)=>t==0?e:e==0?t:typeof e=="bigint"&&typeof t=="bigint"||typeof e=="number"&&typeof t=="number"?e+t:Number(e)+Number(t),K6=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function X6(e){return typeof e=="string"&&K6.test(e)}const it=[];for(let e=0;e<256;++e)it.push((e+256).toString(16).slice(1));function H6(e,t=0){return(it[e[t+0]]+it[e[t+1]]+it[e[t+2]]+it[e[t+3]]+"-"+it[e[t+4]]+it[e[t+5]]+"-"+it[e[t+6]]+it[e[t+7]]+"-"+it[e[t+8]]+it[e[t+9]]+"-"+it[e[t+10]]+it[e[t+11]]+it[e[t+12]]+it[e[t+13]]+it[e[t+14]]+it[e[t+15]]).toLowerCase()}function Q6(e,t=0){const r=H6(e,t);if(!X6(r))throw TypeError("Stringified UUID is invalid");return r}typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const ej=(e,t)=>Q6(e,t),en=-1,tj=Ue().transform(e=>new Uint8Array(atob(e).split("").map(t=>t.charCodeAt(0))).buffer),nj=Pe([nh(),Ok()]).transform(()=>new Uint8Array().buffer),du=10,rj=(e,t)=>{if(e==="string"&&!t.isVariable)throw new Error(`cannot convert series of type ${t.toString()} to string`);if(e==="number"&&!t.isNumeric)throw new Error(`cannot convert series of type ${t.toString()} to number`);if(e==="bigint"&&!t.usesBigInt)throw new Error(`cannot convert series of type ${t.toString()} to bigint`)},vI="sy_x_telem_series",Hr=class qn{constructor(t){E(this,"key"),E(this,"discriminator",vI),E(this,"dataType"),E(this,"sampleOffset"),E(this,"gl"),E(this,"_data"),E(this,"timeRange",si.ZERO),E(this,"alignment",0n),E(this,"cachedMin"),E(this,"cachedMax"),E(this,"writePos",en),E(this,"_refCount",0),E(this,"cachedLength"),E(this,"_cachedIndexes"),ij(t)&&(t={data:t}),t.data??(t.data=[]);const{dataType:r,timeRange:i,sampleOffset:n=0,glBufferUsage:s="static",alignment:a=0n,key:o=W6(),data:u}=t;if(sj(u)){const d=u;this.key=d.key,this.dataType=d.dataType,this.sampleOffset=d.sampleOffset,this.gl=d.gl,this._data=d._data,this.timeRange=d.timeRange,this.alignment=d.alignment,this.cachedMin=d.cachedMin,this.cachedMax=d.cachedMax,this.writePos=d.writePos,this._refCount=d._refCount,this.cachedLength=d.cachedLength;return}const c=pI(u),l=Array.isArray(u);if(r!=null)this.dataType=new Ce(r);else{if(u instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(l||c){let d=u;if(!c){if(u.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");d=u[0]}if(typeof d=="string")this.dataType=Ce.STRING;else if(typeof d=="number")this.dataType=Ce.FLOAT64;else if(typeof d=="bigint")this.dataType=Ce.INT64;else if(typeof d=="boolean")this.dataType=Ce.BOOLEAN;else if(d instanceof ge||d instanceof Date||d instanceof ge)this.dataType=Ce.TIMESTAMP;else if(typeof d=="object")this.dataType=Ce.JSON;else throw new Error(`cannot infer data type of ${typeof d} when constructing a Series from a JS array`)}else this.dataType=new Ce(u)}if(!l&&!c)this._data=u;else{let d=c?[u]:u;const m=d[0];(m instanceof ge||m instanceof Date||m instanceof ue)&&(d=d.map(y=>new ge(y).valueOf())),this.dataType.equals(Ce.STRING)?(this.cachedLength=d.length,this._data=new TextEncoder().encode(`${d.join(`
67
+ `)}
68
+ `).buffer):this.dataType.equals(Ce.JSON)?(this.cachedLength=d.length,this._data=new TextEncoder().encode(`${d.map(y=>iu.encodeString(y)).join(`
69
+ `)}
70
+ `).buffer):this.dataType.usesBigInt&&typeof m=="number"?this._data=new this.dataType.Array(d.map(y=>BigInt(Math.round(y)))).buffer:!this.dataType.usesBigInt&&typeof m=="bigint"?this._data=new this.dataType.Array(d.map(y=>Number(y))).buffer:this._data=new this.dataType.Array(d).buffer}this.key=o,this.alignment=a,this.sampleOffset=n??0,this.timeRange=i??si.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:s}}static alloc({capacity:t,dataType:r,...i}){if(t===0)throw new Error("[Series] - cannot allocate an array of length 0");const n=new new Ce(r).Array(t),s=new qn({data:n.buffer,dataType:r,...i});return s.writePos=0,s}get refCount(){return this._refCount}acquire(t){this._refCount++,t!=null&&this.updateGLBuffer(t)}release(){this._refCount--,this.refCount===0&&this.gl.control!=null?this.maybeGarbageCollectGLBuffer(this.gl.control):this.refCount<0&&console.warn("cannot release a series with a negative reference count")}write(t){if(!t.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(t):this.writeFixed(t)}writeVariable(t){if(this.writePos===en)return 0;const r=this.byteCapacity.valueOf()-this.writePos,i=t.subBytes(0,r);return this.writeToUnderlyingData(i),this.writePos+=i.byteLength.valueOf(),this.cachedLength!=null&&(this.cachedLength+=i.length,this.calculateCachedLength()),i.length}writeFixed(t){if(this.writePos===en)return 0;const r=this.capacity-this.writePos,i=t.sub(0,r);return this.writeToUnderlyingData(i),this.cachedLength=void 0,this.maybeRecomputeMinMax(i),this.writePos+=i.length,i.length}writeToUnderlyingData(t){this.underlyingData.set(t.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===en?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){return this.dataType.isVariable?new TextDecoder().decode(this.underlyingData).split(`
71
+ `).slice(0,-1):Array.from(this).map(t=>t.toString())}toUUIDs(){if(!this.dataType.equals(Ce.UUID))throw new Error("cannot convert non-uuid series to uuids");const t=Ce.UUID.density.valueOf(),r=new Uint8Array(this.underlyingData.buffer);return Array.from({length:this.length},(i,n)=>ej(r,n*t))}parseJSON(t){if(!this.dataType.equals(Ce.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.toStrings().map(r=>t.parse(iu.decodeString(r)))}get byteCapacity(){return new lu(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===en?this.byteCapacity:this.dataType.isVariable?new lu(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this.cachedLength!=null?this.cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===en?this.byteCapacity.valueOf()/this.dataType.density.valueOf():this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let t=0;const r=[0];return this.data.forEach((i,n)=>{i===du&&(t++,r.push(n+1))}),this._cachedIndexes=r,this.cachedLength=t,t}convert(t,r=0){if(this.dataType.equals(t))return this;const i=new t.Array(this.length);for(let n=0;n<this.length;n++)i[n]=Y6(this.dataType,t,this.data[n],r);return new qn({data:i.buffer,dataType:t,timeRange:this.timeRange,sampleOffset:r,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(Ce.TIMESTAMP))this.cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const t=this.data;this.cachedMax=t.reduce((r,i)=>r>i?r:i)}else{const t=this.data;this.cachedMax=t.reduce((r,i)=>r>i?r:i)}return this.cachedMax}get max(){return this.calcMax()}calcMax(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this.cachedMax??(this.cachedMax=this.calcRawMax()),Os(this.cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(Ce.TIMESTAMP))this.cachedMin=this.data[0];else if(this.dataType.usesBigInt){const t=this.data;this.cachedMin=t.reduce((r,i)=>r<i?r:i)}else{const t=this.data;this.cachedMin=t.reduce((r,i)=>r<i?r:i)}return this.cachedMin}get min(){return this.calcMin()}calcMin(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this.cachedMin??(this.cachedMin=this.calcRawMin()),Os(this.cachedMin,this.sampleOffset))}get bounds(){return yn(Number(this.min),Number(this.max),{makeValid:!1})}maybeRecomputeMinMax(t){if(this.cachedMin!=null){const r=t.cachedMin??t.calcRawMin();r<this.cachedMin&&(this.cachedMin=r)}if(this.cachedMax!=null){const r=t.cachedMax??t.calcRawMax();r>this.cachedMax&&(this.cachedMax=r)}}atAlignment(t,r){const i=Number(t-this.alignment);if(i<0||i>=this.length){if(r===!0)throw new Error(`[series] - no value at index ${i}`);return}return this.at(i,r)}at(t,r){if(this.dataType.isVariable)return this.atVariable(t,r??!1);t<0&&(t=this.length+t);const i=this.data[t];if(i==null){if(r===!0)throw new Error(`[series] - no value at index ${t}`);return}return Os(i,this.sampleOffset)}atVariable(t,r){let i=0,n=0;if(this._cachedIndexes!=null)i=this._cachedIndexes[t],n=this._cachedIndexes[t+1]-1;else{t<0&&(t=this.length+t);for(let a=0;a<this.data.length;a++)if(this.data[a]===du){if(t===0){n=a;break}i=a+1,t--}if(n===0&&(n=this.data.length),i>=n||t>0){if(r)throw new Error(`[series] - no value at index ${t}`);return}}const s=this.data.slice(i,n);return this.dataType.equals(Ce.STRING)?new TextDecoder().decode(s):rw(JSON.parse(new TextDecoder().decode(s)))}binarySearch(t){let r=0,i=this.length-1;const n=bE(t);for(;r<=i;){const s=Math.floor((r+i)/2),a=n(this.at(s,!0),t);if(a===0)return s;a<0?r=s+1:i=s-1}return r}updateGLBuffer(t){if(this.gl.control=t,!this.dataType.equals(Ce.FLOAT32)&&!this.dataType.equals(Ce.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:r,bufferUsage:i,prevBuffer:n}=this.gl;if(r==null&&(this.gl.buffer=t.createBuffer()),this.writePos!==n)if(t.bindBuffer(t.ARRAY_BUFFER,this.gl.buffer),this.writePos!==en){n===0&&t.bufferData(t.ARRAY_BUFFER,this.byteCapacity.valueOf(),t.STATIC_DRAW);const s=this.dataType.density.size(n).valueOf(),a=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);t.bufferSubData(t.ARRAY_BUFFER,s,a.buffer),this.gl.prevBuffer=this.writePos}else t.bufferData(t.ARRAY_BUFFER,this.buffer,i==="static"?t.STATIC_DRAW:t.DYNAMIC_DRAW),this.gl.prevBuffer=en}as(t){return rj(t,this.dataType),this}get digest(){return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:ef(this.alignmentBounds.lower),upper:ef(this.alignmentBounds.upper)},timeRange:this.timeRange.toString(),length:this.length,capacity:this.capacity}}get alignmentBounds(){return yn(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(t){this.gl.buffer!=null&&(t.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const t=new aj(this);return this.dataType.equals(Ce.JSON)?new oj(t):t}return new uj(this)}slice(t,r){return this.sliceSub(!1,t,r)}sub(t,r){return this.sliceSub(!0,t,r)}subIterator(t,r){return new Qm(this,t,r??this.length)}subAlignmentIterator(t,r){return new Qm(this,Number(t-this.alignment),Number(r-this.alignment))}subBytes(t,r){if(t>=0&&(r==null||r>=this.byteLength.valueOf()))return this;const i=this.data.subarray(t,r);return new qn({data:i,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(t)})}sliceSub(t,r,i){if(r<=0&&(i==null||i>=this.length))return this;let n;return t?n=this.data.subarray(r,i):n=this.data.slice(r,i),new qn({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(r)})}reAlign(t){return new qn({data:this.buffer,dataType:this.dataType,timeRange:si.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:t})}toString(){var t,r;let i=`Series(${this.dataType.toString()} ${this.length} [`;if(this.length<=10)i+=Array.from(this).map(n=>n.toString());else{for(let n=0;n<5;n++)i+=`${(t=this.at(n))==null?void 0:t.toString()}`,i+=",";i+="...,";for(let n=-5;n<0;n++)i+=(r=this.at(n))==null?void 0:r.toString(),n<-1&&(i+=",")}return i+="])",i}};E(Hr,"crudeZ",ve({timeRange:si.z.optional(),dataType:Ce.z,alignment:mI().optional(),data:Pe([tj,nj,be(ArrayBuffer),be(Uint8Array)]),glBufferUsage:G6.optional().default("static").optional()})),E(Hr,"z",Hr.crudeZ.transform(e=>new Hr(e)));let gI=Hr;const ij=e=>e==null?!1:Array.isArray(e)||e instanceof ArrayBuffer||ArrayBuffer.isView(e)&&!(e instanceof DataView)||e instanceof gI?!0:pI(e),sj=q6(vI,gI);class Qm{constructor(t,r,i){E(this,"series"),E(this,"end"),E(this,"index"),this.series=t;const n=yn(0,t.length);this.end=qm(n,i),this.index=qm(n,r)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}class aj{constructor(t){if(E(this,"series"),E(this,"index"),E(this,"decoder"),!t.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=t,this.index=0,this.decoder=new TextDecoder}next(){const t=this.index,r=this.series.data;for(;this.index<r.length&&r[this.index]!==du;)this.index++;const i=this.index;return t===i?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(t,i))})}}const yI=class bI{constructor(t){E(this,"wrapped"),this.wrapped=t}next(){const t=this.wrapped.next();return t.done===!0?{done:!0,value:void 0}:{done:!1,value:iu.decodeString(t.value,bI.schema)}}};E(yI,"schema",Ma(Ue(),mr()));let oj=yI;class uj{constructor(t){E(this,"series"),E(this,"index"),this.series=t,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}const ef=e=>{const t=e>>32n,r=e&0xffffffffn;return{domain:t,sample:r}};ve({key:Ue(),value:Ue()});Ma(Pe([Q(),Ue(),kk()]),mr());const wI=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",cj=wI(),$I=["macOS","Windows","Linux"],lj=["macos","windows","linux"],dj={macos:"macOS",windows:"Windows",linux:"Linux"},hj=et($I).or(et(lj).transform(e=>dj[e])),mj=()=>{if(typeof window>"u")return;const e=window.navigator.userAgent.toLowerCase();if(e.includes("mac"))return"macOS";if(e.includes("win"))return"Windows";if(e.includes("linux"))return"Linux"};let _o;const fj=(e={})=>{const{force:t,default:r}=e;return t??_o??(_o=mj(),_o??r)},_I=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:$I,RUNTIME:cj,detect:wI,getOS:fj,osZ:hj},Symbol.toStringTag,{value:"Module"}));var pj=Object.defineProperty,vj=(e,t,r)=>t in e?pj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qr=(e,t,r)=>vj(e,typeof t!="symbol"?t+"":t,r);const gj=(...e)=>e.map(kI).join(""),kI=e=>(e.endsWith("/")||(e+="/"),e.startsWith("/")&&(e=e.slice(1)),e),yj=e=>e.endsWith("/")?e.slice(0,-1):e,bj=(e,t="")=>e===null?"":`?${Object.entries(e).filter(([,r])=>r==null?!1:Array.isArray(r)?r.length>0:!0).map(([r,i])=>`${t}${r}=${i}`).join("&")}`,hu=class mu{constructor({host:t,port:r,protocol:i="",pathPrefix:n=""}){Qr(this,"protocol"),Qr(this,"host"),Qr(this,"port"),Qr(this,"path"),this.protocol=i,this.host=t,this.port=r,this.path=kI(n)}replace(t){return new mu({host:t.host??this.host,port:t.port??this.port,protocol:t.protocol??this.protocol,pathPrefix:t.pathPrefix??this.path})}child(t){return new mu({...this,pathPrefix:gj(this.path,t)})}toString(){return yj(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}};Qr(hu,"UNKNOWN",new hu({host:"unknown",port:0}));let wj=hu;var $j=Object.defineProperty,_j=(e,t,r)=>t in e?$j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zt=(e,t,r)=>_j(e,typeof t!="symbol"?t+"":t,r);const kj=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return n=>{switch(n.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${n.expected}، ولكن تم إدخال ${r(n.input)}`;case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${X(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${s} ${n.maximum.toString()} ${a.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${s} ${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${s} ${n.minimum.toString()} ${a.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${s} ${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:s.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${s.suffix}"`:s.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${s.includes}"`:s.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${s.pattern}`:`${i[s.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${P(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function Ij(){return{localeError:kj()}}const Oj=()=>{const e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${n.expected}, daxil olan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${X(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${s}${n.maximum.toString()} ${a.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Çox kiçik: gözlənilən ${n.origin} ${s}${n.minimum.toString()} ${a.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Yanlış mətn: "${s.prefix}" ilə başlamalıdır`:s.format==="ends_with"?`Yanlış mətn: "${s.suffix}" ilə bitməlidir`:s.format==="includes"?`Yanlış mətn: "${s.includes}" daxil olmalıdır`:s.format==="regex"?`Yanlış mətn: ${s.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${i[s.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${P(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Sj(){return{localeError:Oj()}}function tf(e,t,r,i){const n=Math.abs(e),s=n%10,a=n%100;return a>=11&&a<=19?i:s===1?t:s>=2&&s<=4?r:i}const zj=()=>{const e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"лік";case"object":{if(Array.isArray(n))return"масіў";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return n=>{switch(n.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${n.expected}, атрымана ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Няправільны ўвод: чакалася ${X(n.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);if(a){const o=Number(n.maximum),u=tf(o,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${a.verb} ${s}${n.maximum.toString()} ${u}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);if(a){const o=Number(n.minimum),u=tf(o,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${a.verb} ${s}${n.minimum.toString()} ${u}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${s.prefix}"`:s.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${s.suffix}"`:s.format==="includes"?`Няправільны радок: павінен змяшчаць "${s.includes}"`:s.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${s.pattern}`:`Няправільны ${i[s.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${P(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function xj(){return{localeError:zj()}}const Nj=()=>{const e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipus invàlid: s'esperava ${n.expected}, s'ha rebut ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${X(n.values[0])}`:`Opció invàlida: s'esperava una de ${P(n.values," o ")}`;case"too_big":{const s=n.inclusive?"com a màxim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${s} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${s} ${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?"com a mínim":"més de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingués ${s} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${s} ${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Format invàlid: ha de començar amb "${s.prefix}"`:s.format==="ends_with"?`Format invàlid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format invàlid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${s.pattern}`:`Format invàlid per a ${i[s.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function Tj(){return{localeError:Nj()}}const Uj=()=>{const e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return n=>{switch(n.code){case"invalid_type":return`Neplatný vstup: očekáváno ${n.expected}, obdrženo ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${X(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${s}${n.maximum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${s}${n.minimum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Neplatný řetězec: musí začínat na "${s.prefix}"`:s.format==="ends_with"?`Neplatný řetězec: musí končit na "${s.suffix}"`:s.format==="includes"?`Neplatný řetězec: musí obsahovat "${s.includes}"`:s.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${s.pattern}`:`Neplatný formát ${i[s.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${P(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function Ej(){return{localeError:Uj()}}const jj=()=>{const e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return n=>{switch(n.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${n.expected}, erhalten ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${X(n.values[0])}`:`Ungültige Option: erwartet eine von ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${s}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${s}${n.maximum.toString()} ist`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${s}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${s}${n.minimum.toString()} ist`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Ungültiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ungültiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ungültiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ungültiger String: muss dem Muster ${s.pattern} entsprechen`:`Ungültig: ${i[s.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${P(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function Aj(){return{localeError:jj()}}const Pj=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},Zj=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(i){return e[i]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${Pj(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${X(i.values[0])}`:`Invalid option: expected one of ${P(i.values,"|")}`;case"too_big":{const n=i.inclusive?"<=":"<",s=t(i.origin);return s?`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{const n=i.inclusive?">=":">",s=t(i.origin);return s?`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${s.unit}`:`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{const n=i;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${r[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${P(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function II(){return{localeError:Zj()}}const Dj=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"arreglo";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype)return n.constructor.name}}return s},i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Entrada inválida: se esperaba ${n.expected}, recibido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inválida: se esperaba ${X(n.values[0])}`:`Opción inválida: se esperaba una de ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Demasiado grande: se esperaba que ${n.origin??"valor"} tuviera ${s}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${n.origin??"valor"} fuera ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Demasiado pequeño: se esperaba que ${n.origin} tuviera ${s}${n.minimum.toString()} ${a.unit}`:`Demasiado pequeño: se esperaba que ${n.origin} fuera ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Cadena inválida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inválida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inválida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${s.pattern}`:`Inválido ${i[s.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${n.origin}`;default:return"Entrada inválida"}}};function Cj(){return{localeError:Dj()}}const Rj=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"آرایه";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return n=>{switch(n.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${n.expected} می‌بود، ${r(n.input)} دریافت شد`;case"invalid_value":return n.values.length===1?`ورودی نامعتبر: می‌بایست ${X(n.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${P(n.values,"|")} می‌بود`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${s}${n.maximum.toString()} ${a.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${s}${n.maximum.toString()} باشد`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`خیلی کوچک: ${n.origin} باید ${s}${n.minimum.toString()} ${a.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${s}${n.minimum.toString()} باشد`}case"invalid_format":{const s=n;return s.format==="starts_with"?`رشته نامعتبر: باید با "${s.prefix}" شروع شود`:s.format==="ends_with"?`رشته نامعتبر: باید با "${s.suffix}" تمام شود`:s.format==="includes"?`رشته نامعتبر: باید شامل "${s.includes}" باشد`:s.format==="regex"?`رشته نامعتبر: باید با الگوی ${s.pattern} مطابقت داشته باشد`:`${i[s.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${P(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function Lj(){return{localeError:Rj()}}const Mj=()=>{const e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${X(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} täytyy olla ${s}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon täytyy olla ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} täytyy olla ${s}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon täytyy olla ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen syöte: täytyy sisältää "${s.includes}"`:s.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${s.pattern}`:`Virheellinen ${i[s.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${P(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function Bj(){return{localeError:Mj()}}const Fj=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return n=>{switch(n.code){case"invalid_type":return`Entrée invalide : ${n.expected} attendu, ${r(n.input)} reçu`;case"invalid_value":return n.values.length===1?`Entrée invalide : ${X(n.values[0])} attendu`:`Option invalide : une valeur parmi ${P(n.values,"|")} attendue`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${s}${n.maximum.toString()} ${a.unit??"élément(s)"}`:`Trop grand : ${n.origin??"valeur"} doit être ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${s}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit être ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Chaîne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Chaîne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Chaîne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${s.pattern}`:`${i[s.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${P(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function Jj(){return{localeError:Fj()}}const Vj=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return n=>{switch(n.code){case"invalid_type":return`Entrée invalide : attendu ${n.expected}, reçu ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${X(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"≤":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${s}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?"≥":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${s}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Chaîne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Chaîne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Chaîne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Chaîne invalide : doit correspondre au motif ${s.pattern}`:`${i[s.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${P(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function Wj(){return{localeError:Vj()}}const qj=()=>{const e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return n=>{switch(n.code){case"invalid_type":return`קלט לא תקין: צריך ${n.expected}, התקבל ${r(n.input)}`;case"invalid_value":return n.values.length===1?`קלט לא תקין: צריך ${X(n.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`גדול מדי: ${n.origin??"value"} צריך להיות ${s}${n.maximum.toString()} ${a.unit??"elements"}`:`גדול מדי: ${n.origin??"value"} צריך להיות ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`קטן מדי: ${n.origin} צריך להיות ${s}${n.minimum.toString()} ${a.unit}`:`קטן מדי: ${n.origin} צריך להיות ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`מחרוזת לא תקינה: חייבת להתחיל ב"${s.prefix}"`:s.format==="ends_with"?`מחרוזת לא תקינה: חייבת להסתיים ב "${s.suffix}"`:s.format==="includes"?`מחרוזת לא תקינה: חייבת לכלול "${s.includes}"`:s.format==="regex"?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${s.pattern}`:`${i[s.format]??n.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${n.divisor}`;case"unrecognized_keys":return`מפתח${n.keys.length>1?"ות":""} לא מזוה${n.keys.length>1?"ים":"ה"}: ${P(n.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${n.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n.origin}`;default:return"קלט לא תקין"}}};function Gj(){return{localeError:qj()}}const Yj=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"szám";case"object":{if(Array.isArray(n))return"tömb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return n=>{switch(n.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${n.expected}, a kapott érték ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${X(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${s}${n.maximum.toString()} ${a.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${s}${n.minimum.toString()} ${a.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Érvénytelen string: "${s.prefix}" értékkel kell kezdődnie`:s.format==="ends_with"?`Érvénytelen string: "${s.suffix}" értékkel kell végződnie`:s.format==="includes"?`Érvénytelen string: "${s.includes}" értéket kell tartalmaznia`:s.format==="regex"?`Érvénytelen string: ${s.pattern} mintának kell megfelelnie`:`Érvénytelen ${i[s.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function Kj(){return{localeError:Yj()}}const Xj=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${X(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${s}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${s}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${i[s.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function Hj(){return{localeError:Xj()}}const Qj=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${X(n.values[0])}`:`Opzione non valida: atteso uno tra ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${s}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${s}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${i[s.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${P(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function eA(){return{localeError:Qj()}}const tA=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"数値";case"object":{if(Array.isArray(n))return"配列";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return n=>{switch(n.code){case"invalid_type":return`無効な入力: ${n.expected}が期待されましたが、${r(n.input)}が入力されました`;case"invalid_value":return n.values.length===1?`無効な入力: ${X(n.values[0])}が期待されました`:`無効な選択: ${P(n.values,"、")}のいずれかである必要があります`;case"too_big":{const s=n.inclusive?"以下である":"より小さい",a=t(n.origin);return a?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${a.unit??"要素"}${s}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${s}必要があります`}case"too_small":{const s=n.inclusive?"以上である":"より大きい",a=t(n.origin);return a?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${a.unit}${s}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${s}必要があります`}case"invalid_format":{const s=n;return s.format==="starts_with"?`無効な文字列: "${s.prefix}"で始まる必要があります`:s.format==="ends_with"?`無効な文字列: "${s.suffix}"で終わる必要があります`:s.format==="includes"?`無効な文字列: "${s.includes}"を含む必要があります`:s.format==="regex"?`無効な文字列: パターン${s.pattern}に一致する必要があります`:`無効な${i[s.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${P(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function nA(){return{localeError:tA()}}const rA=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(n))return"អារេ (Array)";if(n===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return n=>{switch(n.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${n.expected} ប៉ុន្តែទទួលបាន ${r(n.input)}`;case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${X(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${s} ${n.maximum.toString()} ${a.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${s} ${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`តូចពេក៖ ត្រូវការ ${n.origin} ${s} ${n.minimum.toString()} ${a.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${s} ${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${s.prefix}"`:s.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${s.suffix}"`:s.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${s.includes}"`:s.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${s.pattern}`:`មិនត្រឹមត្រូវ៖ ${i[s.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${P(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function iA(){return{localeError:rA()}}const sA=()=>{const e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return n=>{switch(n.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${n.expected}, 받은 타입은 ${r(n.input)}입니다`;case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${X(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${P(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const s=n.inclusive?"이하":"미만",a=s==="미만"?"이어야 합니다":"여야 합니다",o=t(n.origin),u=(o==null?void 0:o.unit)??"요소";return o?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${u} ${s}${a}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${s}${a}`}case"too_small":{const s=n.inclusive?"이상":"초과",a=s==="이상"?"이어야 합니다":"여야 합니다",o=t(n.origin),u=(o==null?void 0:o.unit)??"요소";return o?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${u} ${s}${a}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${s}${a}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`잘못된 문자열: "${s.prefix}"(으)로 시작해야 합니다`:s.format==="ends_with"?`잘못된 문자열: "${s.suffix}"(으)로 끝나야 합니다`:s.format==="includes"?`잘못된 문자열: "${s.includes}"을(를) 포함해야 합니다`:s.format==="regex"?`잘못된 문자열: 정규식 ${s.pattern} 패턴과 일치해야 합니다`:`잘못된 ${i[s.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${P(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function aA(){return{localeError:sA()}}const oA=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"број";case"object":{if(Array.isArray(n))return"низа";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return n=>{switch(n.code){case"invalid_type":return`Грешен внес: се очекува ${n.expected}, примено ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${X(n.values[0])}`:`Грешана опција: се очекува една ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${s}${n.maximum.toString()} ${a.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Премногу мал: се очекува ${n.origin} да има ${s}${n.minimum.toString()} ${a.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Неважечка низа: мора да започнува со "${s.prefix}"`:s.format==="ends_with"?`Неважечка низа: мора да завршува со "${s.suffix}"`:s.format==="includes"?`Неважечка низа: мора да вклучува "${s.includes}"`:s.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${s.pattern}`:`Invalid ${i[s.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${P(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function uA(){return{localeError:oA()}}const cA=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${X(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${s}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${s}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${i[s.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${P(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function lA(){return{localeError:cA()}}const dA=()=>{const e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${X(n.values[0])}`:`Ongeldige optie: verwacht één van ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Te lang: verwacht dat ${n.origin??"waarde"} ${s}${n.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${n.origin??"waarde"} ${s}${n.maximum.toString()} is`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Te kort: verwacht dat ${n.origin} ${s}${n.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${n.origin} ${s}${n.minimum.toString()} is`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${i[s.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function hA(){return{localeError:dA()}}const mA=()=>{const e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${X(n.values[0])}`:`Ugyldig valg: forventet en av ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til å ha ${s}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til å ha ${s}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til å ha ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Ugyldig streng: må starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: må ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: må inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: må matche mønsteret ${s.pattern}`:`Ugyldig ${i[s.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${P(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function fA(){return{localeError:mA()}}const pA=()=>{const e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return n=>{switch(n.code){case"invalid_type":return`Fâsit giren: umulan ${n.expected}, alınan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${X(n.values[0])}`:`Fâsit tercih: mûteberler ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla büyük: ${n.origin??"value"}, ${s}${n.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${s}${n.maximum.toString()} olmalıydı.`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla küçük: ${n.origin}, ${s}${n.minimum.toString()} ${a.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${s}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Fâsit metin: "${s.prefix}" ile başlamalı.`:s.format==="ends_with"?`Fâsit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`Fâsit metin: "${s.includes}" ihtivâ etmeli.`:s.format==="regex"?`Fâsit metin: ${s.pattern} nakşına uymalı.`:`Fâsit ${i[s.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function vA(){return{localeError:pA()}}const gA=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"ارې";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return n=>{switch(n.code){case"invalid_type":return`ناسم ورودي: باید ${n.expected} وای, مګر ${r(n.input)} ترلاسه شو`;case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${X(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${P(n.values,"|")} څخه وای`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`ډیر لوی: ${n.origin??"ارزښت"} باید ${s}${n.maximum.toString()} ${a.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${s}${n.maximum.toString()} وي`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`ډیر کوچنی: ${n.origin} باید ${s}${n.minimum.toString()} ${a.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${s}${n.minimum.toString()} وي`}case"invalid_format":{const s=n;return s.format==="starts_with"?`ناسم متن: باید د "${s.prefix}" سره پیل شي`:s.format==="ends_with"?`ناسم متن: باید د "${s.suffix}" سره پای ته ورسيږي`:s.format==="includes"?`ناسم متن: باید "${s.includes}" ولري`:s.format==="regex"?`ناسم متن: باید د ${s.pattern} سره مطابقت ولري`:`${i[s.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${P(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function yA(){return{localeError:gA()}}const bA=()=>{const e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return n=>{switch(n.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${n.expected}, otrzymano ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${X(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${s}${n.maximum.toString()} ${a.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${s}${n.minimum.toString()} ${a.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${s.prefix}"`:s.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${s.suffix}"`:s.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${s.includes}"`:s.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${s.pattern}`:`Nieprawidłow(y/a/e) ${i[s.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function wA(){return{localeError:bA()}}const $A=()=>{const e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipo inválido: esperado ${n.expected}, recebido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${X(n.values[0])}`:`Opção inválida: esperada uma das ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${s}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${s}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Texto inválido: deve começar com "${s.prefix}"`:s.format==="ends_with"?`Texto inválido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inválido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inválido: deve corresponder ao padrão ${s.pattern}`:`${i[s.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function _A(){return{localeError:$A()}}function nf(e,t,r,i){const n=Math.abs(e),s=n%10,a=n%100;return a>=11&&a<=19?i:s===1?t:s>=2&&s<=4?r:i}const kA=()=>{const e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"массив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return n=>{switch(n.code){case"invalid_type":return`Неверный ввод: ожидалось ${n.expected}, получено ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Неверный ввод: ожидалось ${X(n.values[0])}`:`Неверный вариант: ожидалось одно из ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);if(a){const o=Number(n.maximum),u=nf(o,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${s}${n.maximum.toString()} ${u}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);if(a){const o=Number(n.minimum),u=nf(o,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${s}${n.minimum.toString()} ${u}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Неверная строка: должна начинаться с "${s.prefix}"`:s.format==="ends_with"?`Неверная строка: должна заканчиваться на "${s.suffix}"`:s.format==="includes"?`Неверная строка: должна содержать "${s.includes}"`:s.format==="regex"?`Неверная строка: должна соответствовать шаблону ${s.pattern}`:`Неверный ${i[s.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function IA(){return{localeError:kA()}}const OA=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"število";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${n.expected}, prejeto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${X(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${s}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pričakovano, da bo ${n.origin} imelo ${s}${n.minimum.toString()} ${a.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Neveljaven niz: mora se začeti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se končati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${i[s.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${P(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function SA(){return{localeError:OA()}}const zA=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${n.expected}, fick ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${X(n.values[0])}`:`Ogiltigt val: förväntade en av ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${s}${n.maximum.toString()} ${a.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${s}${n.minimum.toString()} ${a.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Ogiltig sträng: måste börja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig sträng: måste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig sträng: måste innehålla "${s.includes}"`:s.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${s.pattern}"`:`Ogiltig(t) ${i[s.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${P(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function xA(){return{localeError:zA()}}const NA=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(n))return"அணி";if(n===null)return"வெறுமை";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${n.expected}, பெறப்பட்டது ${r(n.input)}`;case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${X(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${P(n.values,"|")} இல் ஒன்று`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${s}${n.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${s}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${s}${n.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${s}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const s=n;return s.format==="starts_with"?`தவறான சரம்: "${s.prefix}" இல் தொடங்க வேண்டும்`:s.format==="ends_with"?`தவறான சரம்: "${s.suffix}" இல் முடிவடைய வேண்டும்`:s.format==="includes"?`தவறான சரம்: "${s.includes}" ஐ உள்ளடக்க வேண்டும்`:s.format==="regex"?`தவறான சரம்: ${s.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${i[s.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${P(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function TA(){return{localeError:NA()}}const UA=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(n))return"อาร์เรย์ (Array)";if(n===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return n=>{switch(n.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${n.expected} แต่ได้รับ ${r(n.input)}`;case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${X(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"ไม่เกิน":"น้อยกว่า",a=t(n.origin);return a?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${s} ${n.maximum.toString()} ${a.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${s} ${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?"อย่างน้อย":"มากกว่า",a=t(n.origin);return a?`น้อยกว่ากำหนด: ${n.origin} ควรมี${s} ${n.minimum.toString()} ${a.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${s} ${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${s.prefix}"`:s.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${s.suffix}"`:s.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${s.includes}" อยู่ในข้อความ`:s.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${s.pattern}`:`รูปแบบไม่ถูกต้อง: ${i[s.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${P(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function EA(){return{localeError:UA()}}const jA=e=>{const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},AA=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(i){return e[i]??null}const r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return i=>{switch(i.code){case"invalid_type":return`Geçersiz değer: beklenen ${i.expected}, alınan ${jA(i.input)}`;case"invalid_value":return i.values.length===1?`Geçersiz değer: beklenen ${X(i.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${P(i.values,"|")}`;case"too_big":{const n=i.inclusive?"<=":"<",s=t(i.origin);return s?`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()} ${s.unit??"öğe"}`:`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()}`}case"too_small":{const n=i.inclusive?">=":">",s=t(i.origin);return s?`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()} ${s.unit}`:`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{const n=i;return n.format==="starts_with"?`Geçersiz metin: "${n.prefix}" ile başlamalı`:n.format==="ends_with"?`Geçersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Geçersiz metin: "${n.includes}" içermeli`:n.format==="regex"?`Geçersiz metin: ${n.pattern} desenine uymalı`:`Geçersiz ${r[n.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${P(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function PA(){return{localeError:AA()}}const ZA=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"масив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return n=>{switch(n.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${n.expected}, отримано ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${X(n.values[0])}`:`Неправильна опція: очікується одне з ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Занадто велике: очікується, що ${n.origin??"значення"} ${a.verb} ${s}${n.maximum.toString()} ${a.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Занадто мале: очікується, що ${n.origin} ${a.verb} ${s}${n.minimum.toString()} ${a.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Неправильний рядок: повинен починатися з "${s.prefix}"`:s.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${s.suffix}"`:s.format==="includes"?`Неправильний рядок: повинен містити "${s.includes}"`:s.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${s.pattern}`:`Неправильний ${i[s.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function DA(){return{localeError:ZA()}}const CA=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"نمبر";case"object":{if(Array.isArray(n))return"آرے";if(n===null)return"نل";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return n=>{switch(n.code){case"invalid_type":return`غلط ان پٹ: ${n.expected} متوقع تھا، ${r(n.input)} موصول ہوا`;case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${X(n.values[0])} متوقع تھا`:`غلط آپشن: ${P(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`بہت بڑا: ${n.origin??"ویلیو"} کے ${s}${n.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${s}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`بہت چھوٹا: ${n.origin} کے ${s}${n.minimum.toString()} ${a.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${s}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const s=n;return s.format==="starts_with"?`غلط سٹرنگ: "${s.prefix}" سے شروع ہونا چاہیے`:s.format==="ends_with"?`غلط سٹرنگ: "${s.suffix}" پر ختم ہونا چاہیے`:s.format==="includes"?`غلط سٹرنگ: "${s.includes}" شامل ہونا چاہیے`:s.format==="regex"?`غلط سٹرنگ: پیٹرن ${s.pattern} سے میچ ہونا چاہیے`:`غلط ${i[s.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${P(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function RA(){return{localeError:CA()}}const LA=()=>{const e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"số";case"object":{if(Array.isArray(n))return"mảng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return n=>{switch(n.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${n.expected}, nhận được ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${X(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${a.verb} ${s}${n.maximum.toString()} ${a.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`Quá nhỏ: mong đợi ${n.origin} ${a.verb} ${s}${n.minimum.toString()} ${a.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${s.prefix}"`:s.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${s.suffix}"`:s.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${s.includes}"`:s.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${s.pattern}`:`${i[s.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${P(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function MA(){return{localeError:LA()}}const BA=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(n))return"数组";if(n===null)return"空值(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return n=>{switch(n.code){case"invalid_type":return`无效输入:期望 ${n.expected},实际接收 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`无效输入:期望 ${X(n.values[0])}`:`无效选项:期望以下之一 ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`数值过大:期望 ${n.origin??"值"} ${s}${n.maximum.toString()} ${a.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`数值过小:期望 ${n.origin} ${s}${n.minimum.toString()} ${a.unit}`:`数值过小:期望 ${n.origin} ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`无效字符串:必须以 "${s.prefix}" 开头`:s.format==="ends_with"?`无效字符串:必须以 "${s.suffix}" 结尾`:s.format==="includes"?`无效字符串:必须包含 "${s.includes}"`:s.format==="regex"?`无效字符串:必须满足正则表达式 ${s.pattern}`:`无效${i[s.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${P(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function FA(){return{localeError:BA()}}const JA=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return e[n]??null}const r=n=>{const s=typeof n;switch(s){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return s},i={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return n=>{switch(n.code){case"invalid_type":return`無效的輸入值:預期為 ${n.expected},但收到 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${X(n.values[0])}`:`無效的選項:預期為以下其中之一 ${P(n.values,"|")}`;case"too_big":{const s=n.inclusive?"<=":"<",a=t(n.origin);return a?`數值過大:預期 ${n.origin??"值"} 應為 ${s}${n.maximum.toString()} ${a.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${s}${n.maximum.toString()}`}case"too_small":{const s=n.inclusive?">=":">",a=t(n.origin);return a?`數值過小:預期 ${n.origin} 應為 ${s}${n.minimum.toString()} ${a.unit}`:`數值過小:預期 ${n.origin} 應為 ${s}${n.minimum.toString()}`}case"invalid_format":{const s=n;return s.format==="starts_with"?`無效的字串:必須以 "${s.prefix}" 開頭`:s.format==="ends_with"?`無效的字串:必須以 "${s.suffix}" 結尾`:s.format==="includes"?`無效的字串:必須包含 "${s.includes}"`:s.format==="regex"?`無效的字串:必須符合格式 ${s.pattern}`:`無效的 ${i[s.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${P(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function VA(){return{localeError:JA()}}const OI=Object.freeze(Object.defineProperty({__proto__:null,ar:Ij,az:Sj,be:xj,ca:Tj,cs:Ej,de:Aj,en:II,es:Cj,fa:Lj,fi:Bj,fr:Jj,frCA:Wj,he:Gj,hu:Kj,id:Hj,it:eA,ja:nA,kh:iA,ko:aA,mk:uA,ms:lA,nl:hA,no:fA,ota:vA,pl:wA,ps:yA,pt:_A,ru:IA,sl:SA,sv:xA,ta:TA,th:EA,tr:PA,ua:DA,ur:RA,vi:MA,zhCN:FA,zhTW:VA},Symbol.toStringTag,{value:"Module"}));class SI{constructor(t){this._def=t,this.def=t}implement(t){if(typeof t!="function")throw new Error("implement() must be called with a function");const r=(...i)=>{const n=this._def.input?su(this._def.input,i,void 0,{callee:r}):i;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");const s=t(...n);return this._def.output?su(this._def.output,s,void 0,{callee:r}):s};return r}implementAsync(t){if(typeof t!="function")throw new Error("implement() must be called with a function");const r=async(...i)=>{const n=this._def.input?await au(this._def.input,i,void 0,{callee:r}):i;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");const s=await t(...n);return this._def.output?au(this._def.output,s,void 0,{callee:r}):s};return r}input(...t){const r=this.constructor;return Array.isArray(t[0])?new r({type:"function",input:new Ua({type:"tuple",items:t[0],rest:t[1]}),output:this._def.output}):new r({type:"function",input:t[0],output:this._def.output})}output(t){const r=this.constructor;return new r({type:"function",input:this._def.input,output:t})}}function zI(e){return new SI({type:"function",input:Array.isArray(e==null?void 0:e.input)?uk(Ua,e==null?void 0:e.input):(e==null?void 0:e.input)??Ud(Wl,qs(Vs)),output:(e==null?void 0:e.output)??qs(Vs)})}class fu{constructor(t){this.counter=0,this.metadataRegistry=(t==null?void 0:t.metadata)??pn,this.target=(t==null?void 0:t.target)??"draft-2020-12",this.unrepresentable=(t==null?void 0:t.unrepresentable)??"throw",this.override=(t==null?void 0:t.override)??(()=>{}),this.io=(t==null?void 0:t.io)??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var i,n,s,a;const o=t._zod.def,u={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(t);if(c)return c.count++,r.schemaPath.includes(t)&&(c.cycle=r.path),c.schema;const l={schema:{},count:1,cycle:void 0};this.seen.set(t,l);const d=(n=(i=t._zod).toJSONSchema)==null?void 0:n.call(i);if(d)l.schema=d;else{const y={...r,schemaPath:[...r.schemaPath,t],path:r.path},k=t._zod.parent;if(k)l.ref=k,this.process(k,y),this.seen.get(k).isParent=!0;else{const v=l.schema;switch(o.type){case"string":{const f=v;f.type="string";const{minimum:p,maximum:g,format:w,patterns:x,contentEncoding:C}=t._zod.bag;if(typeof p=="number"&&(f.minLength=p),typeof g=="number"&&(f.maxLength=g),w&&(f.format=u[w]??w,f.format===""&&delete f.format),C&&(f.contentEncoding=C),x&&x.size>0){const ne=[...x];ne.length===1?f.pattern=ne[0].source:ne.length>1&&(l.schema.allOf=[...ne.map(ke=>({...this.target==="draft-7"?{type:"string"}:{},pattern:ke.source}))])}break}case"number":{const f=v,{minimum:p,maximum:g,format:w,multipleOf:x,exclusiveMaximum:C,exclusiveMinimum:ne}=t._zod.bag;typeof w=="string"&&w.includes("int")?f.type="integer":f.type="number",typeof ne=="number"&&(f.exclusiveMinimum=ne),typeof p=="number"&&(f.minimum=p,typeof ne=="number"&&(ne>=p?delete f.minimum:delete f.exclusiveMinimum)),typeof C=="number"&&(f.exclusiveMaximum=C),typeof g=="number"&&(f.maximum=g,typeof C=="number"&&(C<=g?delete f.maximum:delete f.exclusiveMaximum)),typeof x=="number"&&(f.multipleOf=x);break}case"boolean":{const f=v;f.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"undefined":{const f=v;f.type="null";break}case"null":{v.type="null";break}case"any":break;case"unknown":break;case"never":{v.not={};break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const f=v,{minimum:p,maximum:g}=t._zod.bag;typeof p=="number"&&(f.minItems=p),typeof g=="number"&&(f.maxItems=g),f.type="array",f.items=this.process(o.element,{...y,path:[...y.path,"items"]});break}case"object":{const f=v;f.type="object",f.properties={};const p=o.shape;for(const x in p)f.properties[x]=this.process(p[x],{...y,path:[...y.path,"properties",x]});const g=new Set(Object.keys(p)),w=new Set([...g].filter(x=>{const C=o.shape[x]._zod;return this.io==="input"?C.optin===void 0:C.optout===void 0}));w.size>0&&(f.required=Array.from(w)),((s=o.catchall)==null?void 0:s._zod.def.type)==="never"?f.additionalProperties=!1:o.catchall?o.catchall&&(f.additionalProperties=this.process(o.catchall,{...y,path:[...y.path,"additionalProperties"]})):this.io==="output"&&(f.additionalProperties=!1);break}case"union":{const f=v;f.anyOf=o.options.map((p,g)=>this.process(p,{...y,path:[...y.path,"anyOf",g]}));break}case"intersection":{const f=v,p=this.process(o.left,{...y,path:[...y.path,"allOf",0]}),g=this.process(o.right,{...y,path:[...y.path,"allOf",1]}),w=C=>"allOf"in C&&Object.keys(C).length===1,x=[...w(p)?p.allOf:[p],...w(g)?g.allOf:[g]];f.allOf=x;break}case"tuple":{const f=v;f.type="array";const p=o.items.map((x,C)=>this.process(x,{...y,path:[...y.path,"prefixItems",C]}));if(this.target==="draft-2020-12"?f.prefixItems=p:f.items=p,o.rest){const x=this.process(o.rest,{...y,path:[...y.path,"items"]});this.target==="draft-2020-12"?f.items=x:f.additionalItems=x}o.rest&&(f.items=this.process(o.rest,{...y,path:[...y.path,"items"]}));const{minimum:g,maximum:w}=t._zod.bag;typeof g=="number"&&(f.minItems=g),typeof w=="number"&&(f.maxItems=w);break}case"record":{const f=v;f.type="object",f.propertyNames=this.process(o.keyType,{...y,path:[...y.path,"propertyNames"]}),f.additionalProperties=this.process(o.valueType,{...y,path:[...y.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const f=v,p=Tl(o.entries);p.every(g=>typeof g=="number")&&(f.type="number"),p.every(g=>typeof g=="string")&&(f.type="string"),f.enum=p;break}case"literal":{const f=v,p=[];for(const g of o.values)if(g===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof g=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");p.push(Number(g))}else p.push(g);if(p.length!==0)if(p.length===1){const g=p[0];f.type=g===null?"null":typeof g,f.const=g}else p.every(g=>typeof g=="number")&&(f.type="number"),p.every(g=>typeof g=="string")&&(f.type="string"),p.every(g=>typeof g=="boolean")&&(f.type="string"),p.every(g=>g===null)&&(f.type="null"),f.enum=p;break}case"file":{const f=v,p={type:"string",format:"binary",contentEncoding:"binary"},{minimum:g,maximum:w,mime:x}=t._zod.bag;g!==void 0&&(p.minLength=g),w!==void 0&&(p.maxLength=w),x?x.length===1?(p.contentMediaType=x[0],Object.assign(f,p)):f.anyOf=x.map(C=>({...p,contentMediaType:C})):Object.assign(f,p);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const f=this.process(o.innerType,y);v.anyOf=[f,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,y),l.ref=o.innerType;break}case"success":{const f=v;f.type="boolean";break}case"default":{this.process(o.innerType,y),l.ref=o.innerType,v.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,y),l.ref=o.innerType,this.io==="input"&&(v._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,y),l.ref=o.innerType;let f;try{f=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}v.default=f;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const f=v,p=t._zod.pattern;if(!p)throw new Error("Pattern not found in template literal");f.type="string",f.pattern=p.source;break}case"pipe":{const f=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(f,y),l.ref=f;break}case"readonly":{this.process(o.innerType,y),l.ref=o.innerType,v.readOnly=!0;break}case"promise":{this.process(o.innerType,y),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,y),l.ref=o.innerType;break}case"lazy":{const f=t._zod.innerType;this.process(f,y),l.ref=f;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const m=this.metadataRegistry.get(t);return m&&Object.assign(l.schema,m),this.io==="input"&&qe(t)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((a=l.schema).default??(a.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(t).schema}emit(t,r){var i,n,s,a;const o={cycles:(r==null?void 0:r.cycles)??"ref",reused:(r==null?void 0:r.reused)??"inline",external:(r==null?void 0:r.external)??void 0},u=this.seen.get(t);if(!u)throw new Error("Unprocessed schema. This is a bug in Zod.");const c=k=>{var v;const f=this.target==="draft-2020-12"?"$defs":"definitions";if(o.external){const w=(v=o.external.registry.get(k[0]))==null?void 0:v.id;if(w)return{ref:o.external.uri(w)};const x=k[1].defId??k[1].schema.id??`schema${this.counter++}`;return k[1].defId=x,{defId:x,ref:`${o.external.uri("__shared")}#/${f}/${x}`}}if(k[1]===u)return{ref:"#"};const p=`#/${f}/`,g=k[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:p+g}},l=k=>{if(k[1].schema.$ref)return;const v=k[1],{ref:f,defId:p}=c(k);v.def={...v.schema},p&&(v.defId=p);const g=v.schema;for(const w in g)delete g[w];g.$ref=f};for(const k of this.seen.entries()){const v=k[1];if(t===k[0]){l(k);continue}if(o.external){const f=(i=o.external.registry.get(k[0]))==null?void 0:i.id;if(t!==k[0]&&f){l(k);continue}}if((n=this.metadataRegistry.get(k[0]))!=null&&n.id){l(k);continue}if(v.cycle){if(o.cycles==="throw")throw new Error(`Cycle detected: #/${(s=v.cycle)==null?void 0:s.join("/")}/<root>
72
+
73
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);o.cycles==="ref"&&l(k);continue}if(v.count>1&&o.reused==="ref"){l(k);continue}}const d=(k,v)=>{const f=this.seen.get(k),p=f.def??f.schema,g={...p};if(f.ref===null)return;const w=f.ref;if(f.ref=null,w){d(w,v);const x=this.seen.get(w).schema;x.$ref&&v.target==="draft-7"?(p.allOf=p.allOf??[],p.allOf.push(x)):(Object.assign(p,x),Object.assign(p,g))}f.isParent||this.override({zodSchema:k,jsonSchema:p})};for(const k of[...this.seen.entries()].reverse())d(k[0],{target:this.target});const m={};this.target==="draft-2020-12"?m.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?m.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(m,u.def);const y=((a=o.external)==null?void 0:a.defs)??{};for(const k of this.seen.entries()){const v=k[1];v.def&&v.defId&&(y[v.defId]=v.def)}!o.external&&Object.keys(y).length>0&&(this.target==="draft-2020-12"?m.$defs=y:m.definitions=y);try{return JSON.parse(JSON.stringify(m))}catch{throw new Error("Error converting schema to JSON.")}}}function xI(e,t){if(e instanceof Kl){const i=new fu(t),n={};for(const o of e._idmap.entries()){const[u,c]=o;i.process(c)}const s={},a={registry:e,uri:(t==null?void 0:t.uri)||(o=>o),defs:n};for(const o of e._idmap.entries()){const[u,c]=o;s[u]=i.emit(c,{...t,external:a})}if(Object.keys(n).length>0){const o=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[o]:n}}return{schemas:s}}const r=new fu(t);return r.process(e),r.emit(e,t)}function qe(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const i=e._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return qe(i.element,r);case"object":{for(const n in i.shape)if(qe(i.shape[n],r))return!0;return!1}case"union":{for(const n of i.options)if(qe(n,r))return!0;return!1}case"intersection":return qe(i.left,r)||qe(i.right,r);case"tuple":{for(const n of i.items)if(qe(n,r))return!0;return!!(i.rest&&qe(i.rest,r))}case"record":return qe(i.keyType,r)||qe(i.valueType,r);case"map":return qe(i.keyType,r)||qe(i.valueType,r);case"set":return qe(i.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return qe(i.innerType,r);case"lazy":return qe(i.getter(),r);case"default":return qe(i.innerType,r);case"prefault":return qe(i.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return qe(i.in,r)||qe(i.out,r);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}const WA=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),qA=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:e_,$ZodArray:Wl,$ZodAsyncError:cr,$ZodBase64:F$,$ZodBase64URL:V$,$ZodBigInt:Vl,$ZodBigIntFormat:K$,$ZodBoolean:Jl,$ZodCIDRv4:M$,$ZodCIDRv6:B$,$ZodCUID:T$,$ZodCUID2:U$,$ZodCatch:b_,$ZodCheck:Fe,$ZodCheckBigIntFormat:a$,$ZodCheckEndsWith:y$,$ZodCheckGreaterThan:Ml,$ZodCheckIncludes:v$,$ZodCheckLengthEquals:h$,$ZodCheckLessThan:Ll,$ZodCheckLowerCase:f$,$ZodCheckMaxLength:l$,$ZodCheckMaxSize:o$,$ZodCheckMimeType:w$,$ZodCheckMinLength:d$,$ZodCheckMinSize:u$,$ZodCheckMultipleOf:i$,$ZodCheckNumberFormat:s$,$ZodCheckOverwrite:$$,$ZodCheckProperty:b$,$ZodCheckRegex:m$,$ZodCheckSizeEquals:c$,$ZodCheckStartsWith:g$,$ZodCheckStringFormat:Ri,$ZodCheckUpperCase:p$,$ZodCustom:O_,$ZodDate:r_,$ZodDefault:p_,$ZodDiscriminatedUnion:s_,$ZodE164:W$,$ZodEmail:S$,$ZodEmoji:x$,$ZodEnum:l_,$ZodError:El,$ZodFile:h_,$ZodFunction:SI,$ZodGUID:I$,$ZodIPv4:R$,$ZodIPv6:L$,$ZodISODate:Z$,$ZodISODateTime:P$,$ZodISODuration:C$,$ZodISOTime:D$,$ZodIntersection:a_,$ZodJWT:G$,$ZodKSUID:A$,$ZodLazy:I_,$ZodLiteral:d_,$ZodMap:u_,$ZodNaN:w_,$ZodNanoID:N$,$ZodNever:t_,$ZodNonOptional:g_,$ZodNull:Q$,$ZodNullable:f_,$ZodNumber:Fl,$ZodNumberFormat:Y$,$ZodObject:i_,$ZodOptional:m_,$ZodPipe:Yl,$ZodPrefault:v_,$ZodPromise:k_,$ZodReadonly:$_,$ZodRealError:Ci,$ZodRecord:o_,$ZodRegistry:Kl,$ZodSet:c_,$ZodString:Li,$ZodStringFormat:$e,$ZodSuccess:y_,$ZodSymbol:X$,$ZodTemplateLiteral:__,$ZodTransform:Gl,$ZodTuple:Ua,$ZodType:V,$ZodULID:E$,$ZodURL:z$,$ZodUUID:O$,$ZodUndefined:H$,$ZodUnion:ql,$ZodUnknown:Vs,$ZodVoid:n_,$ZodXID:j$,$brand:iw,$constructor:_,$input:z_,$output:S_,Doc:_$,JSONSchema:WA,JSONSchemaGenerator:fu,TimePrecision:T_,_any:X_,_array:Ud,_base64:pd,_base64url:vd,_bigint:J_,_boolean:B_,_catch:i4,_cidrv4:md,_cidrv6:fd,_coercedBigint:V_,_coercedBoolean:F_,_coercedDate:tk,_coercedNumber:Z_,_coercedString:N_,_cuid:ad,_cuid2:od,_custom:lk,_date:ek,_default:t4,_discriminatedUnion:JE,_e164:gd,_email:Hl,_emoji:id,_endsWith:Od,_enum:YE,_file:ck,_float32:C_,_float64:R_,_gt:On,_gte:wt,_guid:Ws,_includes:kd,_int:D_,_int32:L_,_int64:W_,_intersection:VE,_ipv4:dd,_ipv6:hd,_isoDate:E_,_isoDateTime:U_,_isoDuration:A_,_isoTime:j_,_jwt:yd,_ksuid:ld,_lazy:u4,_length:Aa,_literal:XE,_lowercase:$d,_lt:In,_lte:xt,_map:qE,_max:xt,_maxLength:ja,_maxSize:Ea,_mime:Sd,_min:wt,_minLength:hr,_minSize:yi,_multipleOf:gi,_nan:nk,_nanoid:sd,_nativeEnum:KE,_negative:ik,_never:H_,_nonnegative:ak,_nonoptional:n4,_nonpositive:sk,_normalize:zd,_null:K_,_nullable:e4,_number:P_,_optional:QE,_overwrite:Zn,_parse:Pl,_parseAsync:Zl,_pipe:s4,_positive:rk,_promise:c4,_property:ok,_readonly:a4,_record:WE,_refine:dk,_regex:wd,_safeParse:Dl,_safeParseAsync:Cl,_set:GE,_size:bd,_startsWith:Id,_string:x_,_stringbool:hk,_success:r4,_symbol:G_,_templateLiteral:o4,_toLowerCase:Nd,_toUpperCase:Td,_transform:HE,_trim:xd,_tuple:uk,_uint32:M_,_uint64:q_,_ulid:ud,_undefined:Y_,_union:FE,_unknown:qs,_uppercase:_d,_url:rd,_uuid:Ql,_uuidv4:ed,_uuidv6:td,_uuidv7:nd,_void:Q_,_xid:cd,clone:Mt,config:mt,flattenError:jl,formatError:Al,function:zI,globalConfig:Bs,globalRegistry:pn,isValidBase64:Bl,isValidBase64URL:J$,isValidJWT:q$,locales:OI,parse:su,parseAsync:au,prettifyError:$w,regexes:n$,registry:Xl,safeParse:_w,safeParseAsync:kw,toDotPath:ww,toJSONSchema:xI,treeifyError:bw,util:jE,version:k$},Symbol.toStringTag,{value:"Module"})),GA={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"},YA=Object.freeze({status:"aborted"}),KA=YA;function XA(e){mt({customError:e})}function HA(){return mt().customError}mt(II());const Le=Object.freeze(Object.defineProperty({__proto__:null,$brand:iw,$input:z_,$output:S_,NEVER:KA,TimePrecision:T_,ZodAny:zk,ZodArray:Uk,ZodBase64:Kd,ZodBase64URL:Xd,ZodBigInt:Ca,ZodBigIntFormat:th,ZodBoolean:Da,ZodCIDRv4:Gd,ZodCIDRv6:Yd,ZodCUID:Md,ZodCUID2:Bd,ZodCatch:Gk,ZodCustom:Ba,ZodDate:rh,ZodDefault:Bk,ZodDiscriminatedUnion:Ek,ZodE164:Hd,ZodEmail:Dd,ZodEmoji:Rd,ZodEnum:bi,ZodError:d4,ZodFile:Lk,ZodGUID:Gs,ZodIPv4:Wd,ZodIPv6:qd,ZodISODate:jd,ZodISODateTime:Ed,ZodISODuration:Pd,ZodISOTime:Ad,ZodIntersection:jk,ZodIssueCode:GA,ZodJWT:Qd,ZodKSUID:Vd,ZodLazy:eI,ZodLiteral:Ck,ZodMap:Zk,ZodNaN:Kk,ZodNanoID:Ld,ZodNever:Nk,ZodNonOptional:ch,ZodNull:Sk,ZodNullable:Mk,ZodNumber:Za,ZodNumberFormat:Or,ZodObject:La,ZodOptional:uh,ZodPipe:lh,ZodPrefault:Jk,ZodPromise:nI,ZodReadonly:Xk,ZodRealError:Mi,ZodRecord:sh,ZodSet:Dk,ZodString:Pa,ZodStringFormat:Se,ZodSuccess:qk,ZodSymbol:_k,ZodTemplateLiteral:Qk,ZodTransform:ah,ZodTuple:Pk,ZodType:te,ZodULID:Fd,ZodURL:Cd,ZodUUID:qt,ZodUndefined:Ik,ZodUnion:ih,ZodUnknown:xk,ZodVoid:Tk,ZodXID:Jd,_ZodString:Zd,_default:Fk,any:L4,array:Bi,base64:T4,base64url:U4,bigint:Sn,boolean:eh,catch:Yk,check:rI,cidrv4:x4,cidrv6:N4,clone:Mt,coerce:B6,config:mt,core:qA,cuid:$4,cuid2:_4,custom:r6,date:B4,discriminatedUnion:W4,e164:E4,email:h4,emoji:b4,endsWith:Od,enum:et,file:X4,flattenError:jl,float32:A4,float64:P4,formatError:Al,function:zI,getErrorMap:HA,globalRegistry:pn,gt:On,gte:wt,guid:m4,includes:kd,instanceof:be,int:uu,int32:Z4,int64:C4,intersection:Ak,ipv4:S4,ipv6:z4,iso:l4,json:s6,jwt:j4,keyof:F4,ksuid:O4,lazy:tI,length:Aa,literal:Rk,locales:OI,looseObject:V4,lowercase:$d,lt:In,lte:xt,map:G4,maxLength:ja,maxSize:Ea,mime:Sd,minLength:hr,minSize:yi,multipleOf:gi,nan:e6,nanoid:w4,nativeEnum:K4,negative:ik,never:Ra,nonnegative:ak,nonoptional:Wk,nonpositive:sk,normalize:zd,null:nh,nullable:Ks,nullish:H4,number:Q,object:ve,optional:Ys,overwrite:Zn,parse:yk,parseAsync:bk,partialRecord:q4,pipe:Xs,positive:rk,prefault:Vk,preprocess:a6,prettifyError:$w,promise:n6,property:ok,readonly:Hk,record:Ma,refine:iI,regex:wd,regexes:n$,registry:Xl,safeParse:wk,safeParseAsync:$k,set:Y4,setErrorMap:XA,size:bd,startsWith:Id,strictObject:J4,string:Ue,stringbool:i6,success:Q4,superRefine:sI,symbol:kk,templateLiteral:t6,toJSONSchema:xI,toLowerCase:Nd,toUpperCase:Td,transform:oh,treeifyError:bw,trim:xd,tuple:Sr,uint32:D4,uint64:R4,ulid:k4,undefined:Ok,union:Pe,unknown:mr,uppercase:_d,url:y4,uuid:f4,uuidv4:p4,uuidv6:v4,uuidv7:g4,void:M4,xid:I4},Symbol.toStringTag,{value:"Module"})),QA=async e=>await new Promise(t=>setTimeout(t,ue.fromMilliseconds(e).milliseconds));class eP{constructor(t){Zt(this,"config"),Zt(this,"retries"),Zt(this,"interval"),this.config={baseInterval:new ue((t==null?void 0:t.baseInterval)??ue.seconds(1)),maxRetries:(t==null?void 0:t.maxRetries)??5,scale:(t==null?void 0:t.scale)??1,sleepFn:(t==null?void 0:t.sleepFn)??QA},this.retries=0,this.interval=new ue(this.config.baseInterval)}async wait(){const{maxRetries:t,scale:r,sleepFn:i}=this.config;return this.retries>=t?!1:(await i(this.interval),this.interval=this.interval.mult(r),this.retries++,!0)}reset(){this.retries=0,this.interval=this.config.baseInterval}}const tP=ve({baseInterval:ue.z.optional(),maxRetries:Q().optional(),scale:Q().optional()}),nP=Object.freeze(Object.defineProperty({__proto__:null,Breaker:eP,breakerConfigZ:tP},Symbol.toStringTag,{value:"Module"})),rP=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,NI=Ue().regex(rP),er=Q().min(0).max(255),TI=Q().min(0).max(1),UI=Sr([er,er,er,TI]),iP=Sr([er,er,er]),sP=ve({rgba255:UI}),aP=Q().min(0).max(360),oP=Q().min(0).max(100),uP=Q().min(0).max(100),cP=Sr([aP,oP,uP,TI]),hh=Pe([NI,iP,UI,cP,sP]),lP=hh.transform(e=>mh(e)),mh=(e,t=1)=>{if(e=hh.parse(e),typeof e=="string")return dP(e,t);if(Array.isArray(e)){if(e.length<3||e.length>4)throw new Error(`Invalid color: [${e.join(", ")}]`);return e.length===3?[...e,t]:e}return e.rgba255},dP=(e,t=1)=>(e=NI.parse(e),e=hP(e),[cs(e,0),cs(e,2),cs(e,4),e.length===8?cs(e,6)/255:t]),cs=(e,t)=>parseInt(e.slice(t,t+2),16),hP=e=>e.startsWith("#")?e.slice(1):e;mh("#000000");mh("#ffffff");const mP=ve({key:Ue(),color:hh,position:Q(),switched:eh().optional()});Bi(mP);const fP=ve({key:Ue(),name:Ue(),color:lP});ve({key:Ue(),name:Ue(),swatches:Bi(fP)});Q().int().min(0).max(255);ve({name:Ue(),key:Ue()});const pP=e=>Object.getOwnPropertySymbols(globalThis).includes(e),vP=(e,t)=>{const r=Symbol.for(e);if(!pP(r)){const i=t();Object.defineProperty(globalThis,r,{value:i})}return()=>globalThis[r]},EI="sy_x_error",gP=e=>t=>t!=null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"?t.type.startsWith(e):t instanceof Error?t.message.startsWith(e):typeof t!="string"?!1:t.startsWith(e),Ja=e=>{var t;return t=class extends Error{constructor(r,i){super(r,i),Zt(this,"discriminator",t.discriminator),Zt(this,"type",t.TYPE),Zt(this,"matches",t.matches),this.name=t.TYPE}static sub(r){return Ja(`${e}.${r}`)}},Zt(t,"discriminator",EI),Zt(t,"TYPE",e),Zt(t,"matches",gP(e)),t},jI=e=>{if(e==null||typeof e!="object")return!1;const t=e;if(t.discriminator!==EI)return!1;if(!("type"in t))throw new Error(`X Error is missing its type property: ${JSON.stringify(t)}`);return!0},Gn="unknown",pu="nil";class yP{constructor(){Zt(this,"providers",[])}register(t){this.providers.push(t)}encode(t){if(t==null)return{type:pu,data:""};if(jI(t))for(const r of this.providers){const i=r.encode(t);if(i!=null)return i}if(t instanceof Error)return{type:Gn,data:t.message};if(typeof t=="string")return{type:Gn,data:t};try{return{type:Gn,data:JSON.stringify(t)}}catch{return{type:Gn,data:"unable to encode error information"}}}decode(t){if(t==null||t.type===pu)return null;if(t.type===Gn)return new vu(t.data);for(const r of this.providers){const i=r.decode(t);if(i!=null)return i}return new vu(t.data)}}const fh=vP("synnax-error-registry",()=>new yP),bP=({encode:e,decode:t})=>fh().register({encode:e,decode:t}),wP=e=>fh().encode(e),$P=e=>e==null?null:fh().decode(e);class vu extends Ja("unknown"){}const _P=ve({type:Ue(),data:Ue()});class kP extends Ja("canceled"){}const cn=Object.freeze(Object.defineProperty({__proto__:null,Canceled:kP,NONE:pu,UNKNOWN:Gn,Unknown:vu,createTyped:Ja,decode:$P,encode:wP,isTyped:jI,payloadZ:_P,register:bP},Symbol.toStringTag,{value:"Module"})),IP=Le.object({jsonrpc:Le.literal("2.0"),method:Le.string(),params:Le.any().optional(),id:Le.union([Le.string(),Le.number(),Le.null()]).optional()}),AI=Le.object({jsonrpc:Le.literal("2.0"),id:Le.union([Le.string(),Le.number(),Le.null()])}),OP=AI.extend({result:Le.json()}),SP=AI.extend({error:Le.object({code:Le.number().int(),message:Le.string().optional(),data:Le.json().optional()})}),zP=Le.union([OP,SP]);Le.union([IP,zP]);Ue().regex(/^\d+\.\d+\.\d+$/);const xP=["standard","scientific","engineering"];et(xP);et(["success","info","warning","error","loading","disabled"]);class Fi extends cn.createTyped("freighter"){}class Ut extends Fi.sub("eof"){constructor(){super("EOF")}}class fr extends Fi.sub("stream_closed"){constructor(){super("StreamClosed")}}class ln extends Fi.sub("unreachable"){constructor(t={}){const{message:r="Unreachable",url:i=wj.UNKNOWN}=t;super(r),Xe(this,"url"),this.url=i}}const NP=e=>{if(!e.type.startsWith(Fi.TYPE))return null;if(Ut.matches(e))return{type:Ut.TYPE,data:"EOF"};if(fr.matches(e))return{type:fr.TYPE,data:"StreamClosed"};if(ln.matches(e))return{type:ln.TYPE,data:"Unreachable"};throw new Error(`Unknown error type: ${e.type}: ${e.message}`)},TP=e=>{if(!e.type.startsWith(Fi.TYPE))return null;switch(e.type){case Ut.TYPE:return new Ut;case fr.TYPE:return new fr;case ln.TYPE:return new ln;default:throw new cn.Unknown(`Unknown error type: ${e.data}`)}};cn.register({encode:NP,decode:TP});class PI{constructor(){Xe(this,"middleware",[])}use(...t){this.middleware.push(...t)}async executeMiddleware(t,r){let i=0;const n=async s=>{if(i===this.middleware.length)return await r(s);const a=this.middleware[i];return i++,await a(s,n)};return await n(t)}}const ZI="Content-Type",rf=e=>{if(_I.RUNTIME!=="node")return fetch;const t=require("node-fetch");if(e==="http")return t;const r=require("https"),i=new r.Agent({rejectUnauthorized:!1});return async(n,s)=>await t(n,{...s,agent:i})},UP=e=>"code"in e&&e.code==="ECONNREFUSED"||e.message.toLowerCase().includes("load failed"),EP=400;class jP extends PI{constructor(t,r,i=!1){return super(),Xe(this,"endpoint"),Xe(this,"encoder"),Xe(this,"fetch"),this.endpoint=t.replace({protocol:i?"https":"http"}),this.encoder=r,this.fetch=rf(this.endpoint.protocol),new Proxy(this,{get:(n,s,a)=>s==="endpoint"?this.endpoint:Reflect.get(n,s,a)})}get headers(){return{[ZI]:this.encoder.contentType}}async send(t,r,i,n){r=i==null?void 0:i.parse(r);let s=null;const a=this.endpoint.child(t),o={};o.method="POST",o.body=this.encoder.encode(r??{});const[,u]=await this.executeMiddleware({target:a.toString(),protocol:this.endpoint.protocol,params:{},role:"client"},async c=>{const l={...c,params:{}};o.headers={...this.headers,...c.params};let d;try{d=await rf(c.protocol)(c.target,o)}catch(y){let k=y;return UP(k)&&(k=new ln({url:a})),[l,k]}const m=await d.arrayBuffer();if(d!=null&&d.ok)return n!=null&&(s=this.encoder.decode(m,n)),[l,null];try{if(d.status!==EP)return[l,new Error(d.statusText)];const y=this.encoder.decode(m,cn.payloadZ),k=cn.decode(y);return[l,k]}catch(y){return[l,new Error(`[freighter] - failed to decode error: ${d.statusText}: ${y.message}`)]}});if(u!=null)return[null,u];if(s==null)throw new Error("Response must be defined");return[s,null]}}const AP=(e,t)=>{class r{constructor(n){Xe(this,"wrapped"),this.wrapped=n}use(...n){this.wrapped.use(...n)}async send(n,s,a,o){const u=new nP.Breaker(t);do{const[c,l]=await this.wrapped.send(n,s,a,o);if(l==null)return[c,null];if(!ln.matches(l))return[null,l];if(!await u.wait())return[c,l]}while(!0)}}return new r(e)},j=async(e,t,r,i,n)=>{const[s,a]=await e.send(t,r,i,n);if(a!=null)throw a;return s};function W(e,t,r){function i(o,u){var c;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(c=o._zod).traits??(c.traits=new Set),o._zod.traits.add(e),t(o,u);for(const l in a.prototype)l in o||Object.defineProperty(o,l,{value:a.prototype[l].bind(o)});o._zod.constr=a,o._zod.def=u}const n=(r==null?void 0:r.Parent)??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function a(o){var u;const c=r!=null&&r.Parent?new s:this;i(c,o),(u=c._zod).deferred??(u.deferred=[]);for(const l of c._zod.deferred)l();return c}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>{var u,c;return r!=null&&r.Parent&&o instanceof r.Parent?!0:(c=(u=o==null?void 0:o._zod)==null?void 0:u.traits)==null?void 0:c.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}class wi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const DI={};function zn(e){return DI}function PP(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function ZP(e,t){return typeof t=="bigint"?t.toString():t}function CI(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ph(e){return e==null}function vh(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function xe(e,t,r){Object.defineProperty(e,t,{get(){{const i=r();return e[t]=i,i}},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function gh(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function RI(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function Cr(e){return JSON.stringify(e)}function gu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const DP=CI(()=>{if(typeof navigator<"u"&&navigator!=null&&navigator.userAgent.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function sf(e){if(gu(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(gu(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}const CP=new Set(["string","number","symbol"]);function RP(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dn(e,t,r){const i=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(i._zod.parent=e),i}function _t(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function LP(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function MP(e,t){const r={},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(r[n]=i.shape[n])}return Dn(e,{...e._zod.def,shape:r,checks:[]})}function BP(e,t){const r={...e._zod.def.shape},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&delete r[n]}return Dn(e,{...e._zod.def,shape:r,checks:[]})}function FP(e,t){const r={...e._zod.def,get shape(){const i={...e._zod.def.shape,...t};return gh(this,"shape",i),i},checks:[]};return Dn(e,r)}function JP(e,t){return Dn(e,{...e._zod.def,get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return gh(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function VP(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(n[s]=e?new e({type:"optional",innerType:i[s]}):i[s])}else for(const s in i)n[s]=e?new e({type:"optional",innerType:i[s]}):i[s];return Dn(t,{...t._zod.def,shape:n,checks:[]})}function WP(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(n[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(const s in i)n[s]=new e({type:"nonoptional",innerType:i[s]});return Dn(t,{...t._zod.def,shape:n,checks:[]})}function ai(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r].continue!==!0)return!0;return!1}function yh(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function ls(e){return typeof e=="string"?e:e==null?void 0:e.message}function xn(e,t,r){var i,n,s,a,o,u;const c={...e,path:e.path??[]};if(!e.message){const l=ls((s=(n=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:n.error)==null?void 0:s.call(n,e))??ls((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??ls((o=r.customError)==null?void 0:o.call(r,e))??ls((u=r.localeError)==null?void 0:u.call(r,e))??"Invalid input";c.message=l}return delete c.inst,delete c.continue,t!=null&&t.reportInput||delete c.input,c}function bh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $i(...e){const[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}const LI=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,ZP,2)},enumerable:!0})},MI=W("$ZodError",LI),BI=W("$ZodError",LI,{Parent:Error});function qP(e,t=r=>r.message){const r={},i=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function GP(e,t){const r=t||function(s){return s.message},i={_errors:[]},n=s=>{for(const a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>n({issues:o}));else if(a.code==="invalid_key")n({issues:a.issues});else if(a.code==="invalid_element")n({issues:a.issues});else if(a.path.length===0)i._errors.push(r(a));else{let o=i,u=0;for(;u<a.path.length;){const c=a.path[u];u===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(r(a))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return n(e),i}const YP=e=>(t,r,i,n)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new wi;if(a.issues.length){const o=new((n==null?void 0:n.Err)??e)(a.issues.map(u=>xn(u,s,zn())));throw Error.captureStackTrace(o,n==null?void 0:n.callee),o}return a.value},KP=e=>async(t,r,i,n)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new((n==null?void 0:n.Err)??e)(a.issues.map(u=>xn(u,s,zn())));throw Error.captureStackTrace(o,n==null?void 0:n.callee),o}return a.value},FI=e=>(t,r,i)=>{const n=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new wi;return s.issues.length?{success:!1,error:new(e??MI)(s.issues.map(a=>xn(a,n,zn())))}:{success:!0,data:s.value}},XP=FI(BI),JI=e=>async(t,r,i)=>{const n=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>xn(a,n,zn())))}:{success:!0,data:s.value}},HP=JI(BI),zr=W("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),QP=W("$ZodCheckMaxLength",(e,t)=>{zr.init(e,t),e._zod.when=r=>{const i=r.value;return!ph(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const n=bh(i);r.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),e1=W("$ZodCheckMinLength",(e,t)=>{zr.init(e,t),e._zod.when=r=>{const i=r.value;return!ph(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const n=bh(i);r.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),t1=W("$ZodCheckLengthEquals",(e,t)=>{zr.init(e,t),e._zod.when=r=>{const i=r.value;return!ph(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,n=i.length;if(n===t.length)return;const s=bh(i),a=n>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:r.value,inst:e,continue:!t.abort})}}),n1=W("$ZodCheckOverwrite",(e,t)=>{zr.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class r1{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
74
+ `).filter(s=>s),i=Math.min(...r.map(s=>s.length-s.trimStart().length)),n=r.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of n)this.content.push(s)}compile(){const t=Function,r=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(n=>` ${n}`)];return new t(...r,i.join(`
75
+ `))}}const i1={major:4,minor:0,patch:0},Ke=W("$ZodType",(e,t)=>{var r,i;e??(e={}),xe(e._zod,"id",()=>t.type+"_"+RI(10)),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=i1;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const a of s._zod.onattach)a(e);if(n.length===0)(i=e._zod).deferred??(i.deferred=[]),(r=e._zod.deferred)==null||r.push(()=>{e._zod.run=e._zod.parse});else{const s=(a,o,u)=>{let c=ai(a),l;for(const d of o){if(d._zod.when){if(!d._zod.when(a))continue}else if(c)continue;const m=a.issues.length,y=d._zod.check(a);if(y instanceof Promise&&(u==null?void 0:u.async)===!1)throw new wi;if(l||y instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await y,a.issues.length!==m&&(c||(c=ai(a,m)))});else{if(a.issues.length===m)continue;c||(c=ai(a,m))}}return l?l.then(()=>a):a};e._zod.run=(a,o)=>{const u=e._zod.parse(a,o);if(u instanceof Promise){if(o.async===!1)throw new wi;return u.then(c=>s(c,n,o))}return s(u,n,o)}}e["~standard"]={validate:s=>{var a;try{const o=XP(e,s);return o.success?{value:o.data}:{issues:(a=o.error)==null?void 0:a.issues}}catch{return HP(e,s).then(o=>{var u;return o.success?{value:o.data}:{issues:(u=o.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),s1=W("$ZodUnknown",(e,t)=>{Ke.init(e,t),e._zod.parse=r=>r}),a1=W("$ZodNever",(e,t)=>{Ke.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function af(e,t,r){e.issues.length&&t.issues.push(...yh(r,e.issues)),t.value[r]=e.value}const o1=W("$ZodArray",(e,t)=>{Ke.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const s=[];for(let a=0;a<n.length;a++){const o=n[a],u=t.element._zod.run({value:o,issues:[]},i);u instanceof Promise?s.push(u.then(c=>af(c,r,a))):af(u,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function ds(e,t,r){e.issues.length&&t.issues.push(...yh(r,e.issues)),t.value[r]=e.value}function of(e,t,r,i){e.issues.length?i[r]===void 0?r in i?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...yh(r,e.issues)):e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}const u1=W("$ZodObject",(e,t)=>{Ke.init(e,t);const r=CI(()=>{const l=Object.keys(t.shape);for(const m of l)if(!(t.shape[m]instanceof Ke))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);const d=LP(t.shape);return{shape:t.shape,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(d)}});xe(e._zod,"propValues",()=>{const l=t.shape,d={};for(const m in l){const y=l[m]._zod;if(y.values){d[m]??(d[m]=new Set);for(const k of y.values)d[m].add(k)}}return d});const i=l=>{const d=new r1(["shape","payload","ctx"]),{keys:m,optionalKeys:y}=r.value,k=p=>{const g=Cr(p);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};d.write("const input = payload.value;");const v=Object.create(null);for(const p of m)v[p]=RI(15);d.write("const newResult = {}");for(const p of m)if(y.has(p)){const g=v[p];d.write(`const ${g} = ${k(p)};`);const w=Cr(p);d.write(`
76
+ if (${g}.issues.length) {
77
+ if (input[${w}] === undefined) {
78
+ if (${w} in input) {
79
+ newResult[${w}] = undefined;
80
+ }
81
+ } else {
82
+ payload.issues = payload.issues.concat(
83
+ ${g}.issues.map((iss) => ({
84
+ ...iss,
85
+ path: iss.path ? [${w}, ...iss.path] : [${w}],
86
+ }))
87
+ );
88
+ }
89
+ } else if (${g}.value === undefined) {
90
+ if (${w} in input) newResult[${w}] = undefined;
91
+ } else {
92
+ newResult[${w}] = ${g}.value;
93
+ }
94
+ `)}else{const g=v[p];d.write(`const ${g} = ${k(p)};`),d.write(`
95
+ if (${g}.issues.length) payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
96
+ ...iss,
97
+ path: iss.path ? [${Cr(p)}, ...iss.path] : [${Cr(p)}]
98
+ })));`),d.write(`newResult[${Cr(p)}] = ${g}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");const f=d.compile();return(p,g)=>f(l,p,g)};let n;const s=gu,a=!DI.jitless,o=a&&DP.value,{catchall:u}=t;let c;e._zod.parse=(l,d)=>{c??(c=r.value);const m=l.value;if(!s(m))return l.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),l;const y=[];if(a&&o&&(d==null?void 0:d.async)===!1&&d.jitless!==!0)n||(n=i(t.shape)),l=n(l,d);else{l.value={};const g=c.shape;for(const w of c.keys){const x=g[w],C=x._zod.run({value:m[w],issues:[]},d),ne=x._zod.optin==="optional"&&x._zod.optout==="optional";C instanceof Promise?y.push(C.then(ke=>ne?of(ke,l,w,m):ds(ke,l,w))):ne?of(C,l,w,m):ds(C,l,w)}}if(!u)return y.length?Promise.all(y).then(()=>l):l;const k=[],v=c.keySet,f=u._zod,p=f.def.type;for(const g of Object.keys(m)){if(v.has(g))continue;if(p==="never"){k.push(g);continue}const w=f.run({value:m[g],issues:[]},d);w instanceof Promise?y.push(w.then(x=>ds(x,l,g))):ds(w,l,g)}return k.length&&l.issues.push({code:"unrecognized_keys",keys:k,input:m,inst:e}),y.length?Promise.all(y).then(()=>l):l}});function uf(e,t,r,i){for(const n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(s=>xn(s,i,zn())))}),t}const c1=W("$ZodUnion",(e,t)=>{Ke.init(e,t),xe(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),xe(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>vh(i.source)).join("|")})$`)}}),e._zod.parse=(r,i)=>{let n=!1;const s=[];for(const a of t.options){const o=a._zod.run({value:r.value,issues:[]},i);if(o instanceof Promise)s.push(o),n=!0;else{if(o.issues.length===0)return o;s.push(o)}}return n?Promise.all(s).then(a=>uf(a,r,e,i)):uf(s,r,e,i)}}),l1=W("$ZodIntersection",(e,t)=>{Ke.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r,s=t.left._zod.run({value:n,issues:[]},i),a=t.right._zod.run({value:n,issues:[]},i);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([o,u])=>cf(r,o,u)):cf(r,s,a)}});function yu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(sf(e)&&sf(t)){const r=Object.keys(t),i=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};for(const s of i){const a=yu(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};n[s]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i<e.length;i++){const n=e[i],s=t[i],a=yu(n,s);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function cf(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),ai(e))return e;const i=yu(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const d1=W("$ZodEnum",(e,t)=>{Ke.init(e,t);const r=PP(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(i=>CP.has(typeof i)).map(i=>typeof i=="string"?RP(i):i.toString()).join("|")})$`),e._zod.parse=(i,n)=>{const s=i.value;return e._zod.values.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:e}),i}}),h1=W("$ZodTransform",(e,t)=>{Ke.init(e,t),e._zod.parse=(r,i)=>{const n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new wi;return r.value=n,r}}),m1=W("$ZodOptional",(e,t)=>{Ke.init(e,t),e._zod.optin="optional",e._zod.optout="optional",xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),xe(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${vh(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>r.value===void 0?r:t.innerType._zod.run(r,i)}),f1=W("$ZodNullable",(e,t)=>{Ke.init(e,t),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),xe(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${vh(r.source)}|null)$`):void 0}),xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),p1=W("$ZodDefault",(e,t)=>{Ke.init(e,t),e._zod.optin="optional",xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>lf(s,t)):lf(n,t)}});function lf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const v1=W("$ZodPrefault",(e,t)=>{Ke.init(e,t),e._zod.optin="optional",xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),g1=W("$ZodNonOptional",(e,t)=>{Ke.init(e,t),xe(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>df(s,e)):df(n,e)}});function df(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const y1=W("$ZodCatch",(e,t)=>{Ke.init(e,t),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>xn(a,i,zn()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(s=>xn(s,i,zn()))},input:r.value}),r.issues=[]),r)}}),b1=W("$ZodPipe",(e,t)=>{Ke.init(e,t),xe(e._zod,"values",()=>t.in._zod.values),xe(e._zod,"optin",()=>t.in._zod.optin),xe(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,i)=>{const n=t.in._zod.run(r,i);return n instanceof Promise?n.then(s=>hf(s,t,i)):hf(n,t,i)}});function hf(e,t,r){return ai(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const w1=W("$ZodReadonly",(e,t)=>{Ke.init(e,t),xe(e._zod,"propValues",()=>t.innerType._zod.propValues),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(mf):mf(n)}});function mf(e){return e.value=Object.freeze(e.value),e}const $1=W("$ZodCustom",(e,t)=>{zr.init(e,t),Ke.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(s=>ff(s,r,i,e));ff(n,r,i,e)}});function ff(e,t,r,i){if(!e){const n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push($i(n))}}class _1{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];if(this._map.set(t,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,t)}return this}remove(t){return this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};return delete i.id,{...i,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function k1(){return new _1}const hs=k1();function I1(e){return new e({type:"unknown"})}function O1(e,t){return new e({type:"never",..._t(t)})}function S1(e,t){return new QP({check:"max_length",..._t(t),maximum:e})}function pf(e,t){return new e1({check:"min_length",..._t(t),minimum:e})}function z1(e,t){return new t1({check:"length_equals",..._t(t),length:e})}function x1(e){return new n1({check:"overwrite",tx:e})}function N1(e,t,r){return new e({type:"array",element:t,..._t(r)})}function T1(e,t,r){return new e({type:"custom",check:"custom",fn:t,..._t(r)})}const U1=(e,t)=>{MI.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>GP(e,r)},flatten:{value:r=>qP(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},Va=W("ZodError",U1,{Parent:Error}),E1=YP(Va),j1=KP(Va),A1=FI(Va),P1=JI(Va),ot=W("ZodType",(e,t)=>(Ke.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>Dn(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.parse=(r,i)=>E1(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>A1(e,r,i),e.parseAsync=async(r,i)=>j1(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>P1(e,r,i),e.spa=e.safeParseAsync,e.refine=(r,i)=>e.check(uZ(r,i)),e.superRefine=r=>e.check(cZ(r)),e.overwrite=r=>e.check(x1(r)),e.optional=()=>$u(e),e.nullable=()=>vf(e),e.nullish=()=>$u(vf(e)),e.nonoptional=r=>eZ(e,r),e.array=()=>L1(e),e.or=r=>J1([e,r]),e.and=r=>W1(e,r),e.transform=r=>gf(e,G1(r)),e.default=r=>X1(e,r),e.prefault=r=>Q1(e,r),e.catch=r=>nZ(e,r),e.pipe=r=>gf(e,r),e.readonly=()=>sZ(e),e.describe=r=>{const i=e.clone();return hs.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){var r;return(r=hs.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return hs.get(e);const i=e.clone();return hs.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Z1=W("ZodUnknown",(e,t)=>{s1.init(e,t),ot.init(e,t)});function bu(){return I1(Z1)}const D1=W("ZodNever",(e,t)=>{a1.init(e,t),ot.init(e,t)});function C1(e){return O1(D1,e)}const R1=W("ZodArray",(e,t)=>{o1.init(e,t),ot.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(pf(r,i)),e.nonempty=r=>e.check(pf(1,r)),e.max=(r,i)=>e.check(S1(r,i)),e.length=(r,i)=>e.check(z1(r,i)),e.unwrap=()=>e.element});function L1(e,t){return N1(R1,e,t)}const M1=W("ZodObject",(e,t)=>{u1.init(e,t),ot.init(e,t),xe(e,"shape",()=>Object.fromEntries(Object.entries(e._zod.def.shape))),e.keyof=()=>VI(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:bu()}),e.loose=()=>e.clone({...e._zod.def,catchall:bu()}),e.strict=()=>e.clone({...e._zod.def,catchall:C1()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>FP(e,r),e.merge=r=>JP(e,r),e.pick=r=>MP(e,r),e.omit=r=>BP(e,r),e.partial=(...r)=>VP(WI,e,r[0]),e.required=(...r)=>WP(qI,e,r[0])});function B1(e,t){const r={type:"object",get shape(){return gh(this,"shape",{...e}),this.shape},..._t(t)};return new M1(r)}const F1=W("ZodUnion",(e,t)=>{c1.init(e,t),ot.init(e,t),e.options=t.options});function J1(e,t){return new F1({type:"union",options:e,..._t(t)})}const V1=W("ZodIntersection",(e,t)=>{l1.init(e,t),ot.init(e,t)});function W1(e,t){return new V1({type:"intersection",left:e,right:t})}const wu=W("ZodEnum",(e,t)=>{d1.init(e,t),ot.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{const s={};for(const a of i)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new wu({...t,checks:[],..._t(n),entries:s})},e.exclude=(i,n)=>{const s={...t.entries};for(const a of i)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new wu({...t,checks:[],..._t(n),entries:s})}});function VI(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new wu({type:"enum",entries:r,..._t(t)})}const q1=W("ZodTransform",(e,t)=>{h1.init(e,t),ot.init(e,t),e._zod.parse=(r,i)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push($i(s,r.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),a.continue??(a.continue=!0),r.issues.push($i(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r)):(r.value=n,r)}});function G1(e){return new q1({type:"transform",transform:e})}const WI=W("ZodOptional",(e,t)=>{m1.init(e,t),ot.init(e,t),e.unwrap=()=>e._zod.def.innerType});function $u(e){return new WI({type:"optional",innerType:e})}const Y1=W("ZodNullable",(e,t)=>{f1.init(e,t),ot.init(e,t),e.unwrap=()=>e._zod.def.innerType});function vf(e){return new Y1({type:"nullable",innerType:e})}const K1=W("ZodDefault",(e,t)=>{p1.init(e,t),ot.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function X1(e,t){return new K1({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const H1=W("ZodPrefault",(e,t)=>{v1.init(e,t),ot.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Q1(e,t){return new H1({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const qI=W("ZodNonOptional",(e,t)=>{g1.init(e,t),ot.init(e,t),e.unwrap=()=>e._zod.def.innerType});function eZ(e,t){return new qI({type:"nonoptional",innerType:e,..._t(t)})}const tZ=W("ZodCatch",(e,t)=>{y1.init(e,t),ot.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function nZ(e,t){return new tZ({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const rZ=W("ZodPipe",(e,t)=>{b1.init(e,t),ot.init(e,t),e.in=t.in,e.out=t.out});function gf(e,t){return new rZ({type:"pipe",in:e,out:t})}const iZ=W("ZodReadonly",(e,t)=>{w1.init(e,t),ot.init(e,t)});function sZ(e){return new iZ({type:"readonly",innerType:e})}const aZ=W("ZodCustom",(e,t)=>{$1.init(e,t),ot.init(e,t)});function oZ(e,t){const r=new zr({check:"custom",..._t(t)});return r._zod.check=e,r}function uZ(e,t={}){return T1(aZ,e,t)}function cZ(e,t){const r=oZ(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push($i(n,i.value,r._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),i.issues.push($i(s))}},e(i.value,i)),t);return r}const lZ=()=>_I.RUNTIME!=="node"?e=>new WebSocket(e):e=>new(require("ws")).WebSocket(e,{rejectUnauthorized:!1}),dZ=B1({type:VI(["data","close","open"]),payload:bu(),error:$u(cn.payloadZ)});class hZ{constructor(t,r,i,n){Xe(this,"codec"),Xe(this,"reqSchema"),Xe(this,"resSchema"),Xe(this,"ws"),Xe(this,"serverClosed"),Xe(this,"sendClosed"),Xe(this,"receiveDataQueue",[]),Xe(this,"receiveCallbacksQueue",[]),this.codec=r,this.reqSchema=i,this.resSchema=n,this.ws=t,this.sendClosed=!1,this.serverClosed=null,this.listenForMessages()}async receiveOpenAck(){const t=await this.receiveMsg();if(t.type!=="open"){if(t.error==null)throw new Error("Message error must be defined");return cn.decode(t.error)}return null}send(t){if(this.serverClosed!=null)return new Ut;if(this.sendClosed)throw new fr;return this.ws.send(this.codec.encode({type:"data",payload:t})),null}async receive(){if(this.serverClosed!=null)return[null,this.serverClosed];const t=await this.receiveMsg();if(t.type==="close"){if(t.error==null)throw new Error("Message error must be defined");if(this.serverClosed=cn.decode(t.error),this.serverClosed==null)throw new Error("Message error must be defined");return[null,this.serverClosed]}return[this.resSchema.parse(t.payload),null]}received(){return this.receiveDataQueue.length!==0}closeSend(){if(this.sendClosed||this.serverClosed!=null)return;const t={type:"close"};try{this.ws.send(this.codec.encode(t))}finally{this.sendClosed=!0}}async receiveMsg(){return this.receiveDataQueue.shift()??await new Promise((t,r)=>this.receiveCallbacksQueue.push({resolve:t,reject:r}))}addMessage(t){const r=this.receiveCallbacksQueue.shift();r!=null?r.resolve(t):this.receiveDataQueue.push(t)}listenForMessages(){this.ws.onmessage=this.onMessage.bind(this),this.ws.onclose=this.onClose.bind(this)}onMessage(t){this.addMessage(this.codec.decode(t.data,dZ))}onClose(t){this.addMessage({type:"close",error:{type:t.code===fZ?Ut.TYPE:fr.TYPE,data:""}})}}const mZ="freighterctx",fZ=1e3,GI=class _u extends PI{constructor(t,r,i=!1){super(),Xe(this,"baseUrl"),Xe(this,"encoder"),Xe(this,"secure"),this.secure=i,this.baseUrl=t.replace({protocol:i?"wss":"ws"}),this.encoder=r}withCodec(t){const r=new _u(this.baseUrl,t,this.secure);return r.use(...this.middleware),r}async stream(t,r,i){const n=lZ();let s;const[,a]=await this.executeMiddleware({target:t,protocol:"websocket",params:{},role:"client"},async o=>{const u=n(this.buildURL(t,o)),c={...o,params:{}};u.binaryType=_u.MESSAGE_TYPE;const l=await this.wrapSocket(u,r,i);return l instanceof Error?[c,l]:(s=l,[c,null])});if(a!=null)throw a;return s}buildURL(t,r){const i=bj({[ZI]:this.encoder.contentType,...r.params},mZ);return this.baseUrl.child(t).toString()+i}async wrapSocket(t,r,i){return await new Promise(n=>{t.onopen=()=>{const s=new hZ(t,this.encoder,r,i);s.receiveOpenAck().then(a=>{a!=null?n(a):n(s)}).catch(a=>n(a))},t.onerror=s=>{const a=s;n(new Error(a.message))}})}};Xe(GI,"MESSAGE_TYPE","arraybuffer");let pZ=GI;function I(e,t,r){function i(o,u){var c;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(c=o._zod).traits??(c.traits=new Set),o._zod.traits.add(e),t(o,u);for(const l in a.prototype)l in o||Object.defineProperty(o,l,{value:a.prototype[l].bind(o)});o._zod.constr=a,o._zod.def=u}const n=(r==null?void 0:r.Parent)??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function a(o){var u;const c=r!=null&&r.Parent?new s:this;i(c,o),(u=c._zod).deferred??(u.deferred=[]);for(const l of c._zod.deferred)l();return c}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>{var u,c;return r!=null&&r.Parent&&o instanceof r.Parent?!0:(c=(u=o==null?void 0:o._zod)==null?void 0:u.traits)==null?void 0:c.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}class _i extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const YI={};function dn(e){return YI}function vZ(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function gZ(e,t){return typeof t=="bigint"?t.toString():t}function KI(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function wh(e){return e==null}function $h(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function yZ(e,t){const r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,s=Number.parseInt(e.toFixed(n).replace(".","")),a=Number.parseInt(t.toFixed(n).replace(".",""));return s%a/10**n}function Ne(e,t,r){Object.defineProperty(e,t,{get(){{const i=r();return e[t]=i,i}},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function _h(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function XI(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function Rr(e){return JSON.stringify(e)}function ku(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const bZ=KI(()=>{if(typeof navigator<"u"&&navigator!=null&&navigator.userAgent.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Iu(e){if(ku(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(ku(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}const wZ=new Set(["string","number","symbol"]);function Ji(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Cn(e,t,r){const i=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(i._zod.parent=e),i}function Z(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function $Z(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _Z={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function kZ(e,t){const r={},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(r[n]=i.shape[n])}return Cn(e,{...e._zod.def,shape:r,checks:[]})}function IZ(e,t){const r={...e._zod.def.shape},i=e._zod.def;for(const n in t){if(!(n in i.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&delete r[n]}return Cn(e,{...e._zod.def,shape:r,checks:[]})}function OZ(e,t){const r={...e._zod.def,get shape(){const i={...e._zod.def.shape,...t};return _h(this,"shape",i),i},checks:[]};return Cn(e,r)}function SZ(e,t){return Cn(e,{...e._zod.def,get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return _h(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function zZ(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(n[s]=e?new e({type:"optional",innerType:i[s]}):i[s])}else for(const s in i)n[s]=e?new e({type:"optional",innerType:i[s]}):i[s];return Cn(t,{...t._zod.def,shape:n,checks:[]})}function xZ(e,t,r){const i=t._zod.def.shape,n={...i};if(r)for(const s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(n[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(const s in i)n[s]=new e({type:"nonoptional",innerType:i[s]});return Cn(t,{...t._zod.def,shape:n,checks:[]})}function oi(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r].continue!==!0)return!0;return!1}function vn(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function ms(e){return typeof e=="string"?e:e==null?void 0:e.message}function hn(e,t,r){var i,n,s,a,o,u;const c={...e,path:e.path??[]};if(!e.message){const l=ms((s=(n=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:n.error)==null?void 0:s.call(n,e))??ms((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??ms((o=r.customError)==null?void 0:o.call(r,e))??ms((u=r.localeError)==null?void 0:u.call(r,e))??"Invalid input";c.message=l}return delete c.inst,delete c.continue,t!=null&&t.reportInput||delete c.input,c}function kh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ki(...e){const[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}const HI=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,gZ,2)},enumerable:!0})},QI=I("$ZodError",HI),eO=I("$ZodError",HI,{Parent:Error});function NZ(e,t=r=>r.message){const r={},i=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function TZ(e,t){const r=t||function(s){return s.message},i={_errors:[]},n=s=>{for(const a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>n({issues:o}));else if(a.code==="invalid_key")n({issues:a.issues});else if(a.code==="invalid_element")n({issues:a.issues});else if(a.path.length===0)i._errors.push(r(a));else{let o=i,u=0;for(;u<a.path.length;){const c=a.path[u];u===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(r(a))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return n(e),i}const UZ=e=>(t,r,i,n)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new _i;if(a.issues.length){const o=new((n==null?void 0:n.Err)??e)(a.issues.map(u=>hn(u,s,dn())));throw Error.captureStackTrace(o,n==null?void 0:n.callee),o}return a.value},EZ=e=>async(t,r,i,n)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new((n==null?void 0:n.Err)??e)(a.issues.map(u=>hn(u,s,dn())));throw Error.captureStackTrace(o,n==null?void 0:n.callee),o}return a.value},tO=e=>(t,r,i)=>{const n=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new _i;return s.issues.length?{success:!1,error:new(e??QI)(s.issues.map(a=>hn(a,n,dn())))}:{success:!0,data:s.value}},jZ=tO(eO),nO=e=>async(t,r,i)=>{const n=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>hn(a,n,dn())))}:{success:!0,data:s.value}},AZ=nO(eO),PZ=/^[cC][^\s-]{8,}$/,ZZ=/^[0-9a-z]+$/,DZ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,CZ=/^[0-9a-vA-V]{20}$/,RZ=/^[A-Za-z0-9]{27}$/,LZ=/^[a-zA-Z0-9_-]{21}$/,MZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,BZ=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,yf=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,FZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,JZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function VZ(){return new RegExp(JZ,"u")}const WZ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,GZ=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,YZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,KZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rO=/^[A-Za-z0-9_-]*$/,XZ=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,HZ=/^\+(?:[0-9]){6,14}[0-9]$/,iO="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",QZ=new RegExp(`^${iO}$`);function sO(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function eD(e){return new RegExp(`^${sO(e)}$`)}function tD(e){const t=sO({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");const i=`${t}(?:${r.join("|")})`;return new RegExp(`^${iO}T(?:${i})$`)}const nD=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},rD=/^\d+n?$/,iD=/^\d+$/,sD=/^-?\d+(?:\.\d+)?/i,aD=/true|false/i,oD=/null/i,uD=/undefined/i,cD=/^[^A-Z]*$/,lD=/^[^a-z]*$/,vt=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),aO={number:"number",bigint:"bigint",object:"date"},oO=I("$ZodCheckLessThan",(e,t)=>{vt.init(e,t);const r=aO[typeof t.value];e._zod.onattach.push(i=>{const n=i._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),uO=I("$ZodCheckGreaterThan",(e,t)=>{vt.init(e,t);const r=aO[typeof t.value];e._zod.onattach.push(i=>{const n=i._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),dD=I("$ZodCheckMultipleOf",(e,t)=>{vt.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):yZ(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),hD=I("$ZodCheckNumberFormat",(e,t)=>{var r;vt.init(e,t),t.format=t.format||"float64";const i=(r=t.format)==null?void 0:r.includes("int"),n=i?"int":"number",[s,a]=_Z[t.format];e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,u.minimum=s,u.maximum=a,i&&(u.pattern=iD)}),e._zod.check=o=>{const u=o.value;if(i){if(!Number.isInteger(u)){o.issues.push({expected:n,format:t.format,code:"invalid_type",input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?o.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):o.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}u<s&&o.issues.push({origin:"number",input:u,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),u>a&&o.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inst:e})}}),mD=I("$ZodCheckMaxLength",(e,t)=>{vt.init(e,t),e._zod.when=r=>{const i=r.value;return!wh(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const n=kh(i);r.issues.push({origin:n,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),fD=I("$ZodCheckMinLength",(e,t)=>{vt.init(e,t),e._zod.when=r=>{const i=r.value;return!wh(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const n=kh(i);r.issues.push({origin:n,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),pD=I("$ZodCheckLengthEquals",(e,t)=>{vt.init(e,t),e._zod.when=r=>{const i=r.value;return!wh(i)&&i.length!==void 0},e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,n=i.length;if(n===t.length)return;const s=kh(i),a=n>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:r.value,inst:e,continue:!t.abort})}}),Wa=I("$ZodCheckStringFormat",(e,t)=>{var r;vt.init(e,t),e._zod.onattach.push(i=>{const n=i._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),(r=e._zod).check??(r.check=i=>{if(!t.pattern)throw new Error("Not implemented.");t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})})}),vD=I("$ZodCheckRegex",(e,t)=>{Wa.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),gD=I("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=cD),Wa.init(e,t)}),yD=I("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=lD),Wa.init(e,t)}),bD=I("$ZodCheckIncludes",(e,t)=>{vt.init(e,t);const r=Ji(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),wD=I("$ZodCheckStartsWith",(e,t)=>{vt.init(e,t);const r=new RegExp(`^${Ji(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),$D=I("$ZodCheckEndsWith",(e,t)=>{vt.init(e,t);const r=new RegExp(`.*${Ji(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{const n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),_D=I("$ZodCheckOverwrite",(e,t)=>{vt.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class kD{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
99
+ `).filter(s=>s),i=Math.min(...r.map(s=>s.length-s.trimStart().length)),n=r.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of n)this.content.push(s)}compile(){const t=Function,r=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(n=>` ${n}`)];return new t(...r,i.join(`
100
+ `))}}const ID={major:4,minor:0,patch:0},pe=I("$ZodType",(e,t)=>{var r,i;e??(e={}),Ne(e._zod,"id",()=>t.type+"_"+XI(10)),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ID;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const a of s._zod.onattach)a(e);if(n.length===0)(i=e._zod).deferred??(i.deferred=[]),(r=e._zod.deferred)==null||r.push(()=>{e._zod.run=e._zod.parse});else{const s=(a,o,u)=>{let c=oi(a),l;for(const d of o){if(d._zod.when){if(!d._zod.when(a))continue}else if(c)continue;const m=a.issues.length,y=d._zod.check(a);if(y instanceof Promise&&(u==null?void 0:u.async)===!1)throw new _i;if(l||y instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await y,a.issues.length!==m&&(c||(c=oi(a,m)))});else{if(a.issues.length===m)continue;c||(c=oi(a,m))}}return l?l.then(()=>a):a};e._zod.run=(a,o)=>{const u=e._zod.parse(a,o);if(u instanceof Promise){if(o.async===!1)throw new _i;return u.then(c=>s(c,n,o))}return s(u,n,o)}}e["~standard"]={validate:s=>{var a;try{const o=jZ(e,s);return o.success?{value:o.data}:{issues:(a=o.error)==null?void 0:a.issues}}catch{return AZ(e,s).then(o=>{var u;return o.success?{value:o.data}:{issues:(u=o.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),Ih=I("$ZodString",(e,t)=>{var r;pe.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??nD(e._zod.bag),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),ze=I("$ZodStringFormat",(e,t)=>{Wa.init(e,t),Ih.init(e,t)}),OD=I("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=BZ),ze.init(e,t)}),SD=I("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=yf(r))}else t.pattern??(t.pattern=yf());ze.init(e,t)}),zD=I("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=FZ),ze.init(e,t)}),xD=I("$ZodURL",(e,t)=>{ze.init(e,t),e._zod.check=r=>{try{const i=new URL(r.value);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:XZ.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}));return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),ND=I("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=VZ()),ze.init(e,t)}),TD=I("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=LZ),ze.init(e,t)}),UD=I("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=PZ),ze.init(e,t)}),ED=I("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ZZ),ze.init(e,t)}),jD=I("$ZodULID",(e,t)=>{t.pattern??(t.pattern=DZ),ze.init(e,t)}),AD=I("$ZodXID",(e,t)=>{t.pattern??(t.pattern=CZ),ze.init(e,t)}),PD=I("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=RZ),ze.init(e,t)}),ZD=I("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tD(t)),ze.init(e,t),e._zod.check}),DD=I("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=QZ),ze.init(e,t)}),CD=I("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=eD(t)),ze.init(e,t),e._zod.check}),RD=I("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=MZ),ze.init(e,t)}),LD=I("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=WZ),ze.init(e,t),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format="ipv4"})}),MD=I("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=qZ),ze.init(e,t),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),BD=I("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=GZ),ze.init(e,t)}),FD=I("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=YZ),ze.init(e,t),e._zod.check=r=>{const[i,n]=r.value.split("/");try{if(!n)throw new Error;const s=Number(n);if(`${s}`!==n)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function cO(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const JD=I("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=KZ),ze.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{cO(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function VD(e){if(!rO.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return cO(r)}const WD=I("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=rO),ze.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{VD(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),qD=I("$ZodE164",(e,t)=>{t.pattern??(t.pattern=HZ),ze.init(e,t)});function GD(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r,n=JSON.parse(atob(i));return!("typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const YD=I("$ZodJWT",(e,t)=>{ze.init(e,t),e._zod.check=r=>{GD(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),lO=I("$ZodNumber",(e,t)=>{pe.init(e,t),e._zod.pattern=e._zod.bag.pattern??sD,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),KD=I("$ZodNumber",(e,t)=>{hD.init(e,t),lO.init(e,t)}),XD=I("$ZodBoolean",(e,t)=>{pe.init(e,t),e._zod.pattern=aD,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),HD=I("$ZodBigInt",(e,t)=>{pe.init(e,t),e._zod.pattern=rD,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}const{value:n}=r;return typeof n=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:n,inst:e}),r}}),QD=I("$ZodUndefined",(e,t)=>{pe.init(e,t),e._zod.pattern=uD,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{const{value:n}=r;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),eC=I("$ZodNull",(e,t)=>{pe.init(e,t),e._zod.pattern=oD,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{const{value:n}=r;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),tC=I("$ZodUnknown",(e,t)=>{pe.init(e,t),e._zod.parse=r=>r}),nC=I("$ZodNever",(e,t)=>{pe.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function bf(e,t,r){e.issues.length&&t.issues.push(...vn(r,e.issues)),t.value[r]=e.value}const rC=I("$ZodArray",(e,t)=>{pe.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const s=[];for(let a=0;a<n.length;a++){const o=n[a],u=t.element._zod.run({value:o,issues:[]},i);u instanceof Promise?s.push(u.then(c=>bf(c,r,a))):bf(u,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function fs(e,t,r){e.issues.length&&t.issues.push(...vn(r,e.issues)),t.value[r]=e.value}function wf(e,t,r,i){e.issues.length?i[r]===void 0?r in i?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...vn(r,e.issues)):e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}const iC=I("$ZodObject",(e,t)=>{pe.init(e,t);const r=KI(()=>{const l=Object.keys(t.shape);for(const m of l)if(!(t.shape[m]instanceof pe))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);const d=$Z(t.shape);return{shape:t.shape,keys:l,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(d)}});Ne(e._zod,"propValues",()=>{const l=t.shape,d={};for(const m in l){const y=l[m]._zod;if(y.values){d[m]??(d[m]=new Set);for(const k of y.values)d[m].add(k)}}return d});const i=l=>{const d=new kD(["shape","payload","ctx"]),{keys:m,optionalKeys:y}=r.value,k=p=>{const g=Rr(p);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};d.write("const input = payload.value;");const v=Object.create(null);for(const p of m)v[p]=XI(15);d.write("const newResult = {}");for(const p of m)if(y.has(p)){const g=v[p];d.write(`const ${g} = ${k(p)};`);const w=Rr(p);d.write(`
101
+ if (${g}.issues.length) {
102
+ if (input[${w}] === undefined) {
103
+ if (${w} in input) {
104
+ newResult[${w}] = undefined;
105
+ }
106
+ } else {
107
+ payload.issues = payload.issues.concat(
108
+ ${g}.issues.map((iss) => ({
109
+ ...iss,
110
+ path: iss.path ? [${w}, ...iss.path] : [${w}],
111
+ }))
112
+ );
113
+ }
114
+ } else if (${g}.value === undefined) {
115
+ if (${w} in input) newResult[${w}] = undefined;
116
+ } else {
117
+ newResult[${w}] = ${g}.value;
118
+ }
119
+ `)}else{const g=v[p];d.write(`const ${g} = ${k(p)};`),d.write(`
120
+ if (${g}.issues.length) payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
121
+ ...iss,
122
+ path: iss.path ? [${Rr(p)}, ...iss.path] : [${Rr(p)}]
123
+ })));`),d.write(`newResult[${Rr(p)}] = ${g}.value`)}d.write("payload.value = newResult;"),d.write("return payload;");const f=d.compile();return(p,g)=>f(l,p,g)};let n;const s=ku,a=!YI.jitless,o=a&&bZ.value,{catchall:u}=t;let c;e._zod.parse=(l,d)=>{c??(c=r.value);const m=l.value;if(!s(m))return l.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),l;const y=[];if(a&&o&&(d==null?void 0:d.async)===!1&&d.jitless!==!0)n||(n=i(t.shape)),l=n(l,d);else{l.value={};const g=c.shape;for(const w of c.keys){const x=g[w],C=x._zod.run({value:m[w],issues:[]},d),ne=x._zod.optin==="optional"&&x._zod.optout==="optional";C instanceof Promise?y.push(C.then(ke=>ne?wf(ke,l,w,m):fs(ke,l,w))):ne?wf(C,l,w,m):fs(C,l,w)}}if(!u)return y.length?Promise.all(y).then(()=>l):l;const k=[],v=c.keySet,f=u._zod,p=f.def.type;for(const g of Object.keys(m)){if(v.has(g))continue;if(p==="never"){k.push(g);continue}const w=f.run({value:m[g],issues:[]},d);w instanceof Promise?y.push(w.then(x=>fs(x,l,g))):fs(w,l,g)}return k.length&&l.issues.push({code:"unrecognized_keys",keys:k,input:m,inst:e}),y.length?Promise.all(y).then(()=>l):l}});function $f(e,t,r,i){for(const n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(n=>n.issues.map(s=>hn(s,i,dn())))}),t}const sC=I("$ZodUnion",(e,t)=>{pe.init(e,t),Ne(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Ne(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>$h(i.source)).join("|")})$`)}}),e._zod.parse=(r,i)=>{let n=!1;const s=[];for(const a of t.options){const o=a._zod.run({value:r.value,issues:[]},i);if(o instanceof Promise)s.push(o),n=!0;else{if(o.issues.length===0)return o;s.push(o)}}return n?Promise.all(s).then(a=>$f(a,r,e,i)):$f(s,r,e,i)}}),aC=I("$ZodIntersection",(e,t)=>{pe.init(e,t),e._zod.parse=(r,i)=>{const{value:n}=r,s=t.left._zod.run({value:n,issues:[]},i),a=t.right._zod.run({value:n,issues:[]},i);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([o,u])=>_f(r,o,u)):_f(r,s,a)}});function Ou(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Iu(e)&&Iu(t)){const r=Object.keys(t),i=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};for(const s of i){const a=Ou(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};n[s]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i<e.length;i++){const n=e[i],s=t[i],a=Ou(n,s);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function _f(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),oi(e))return e;const i=Ou(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const oC=I("$ZodRecord",(e,t)=>{pe.init(e,t),e._zod.parse=(r,i)=>{const n=r.value;if(!Iu(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;const s=[];if(t.keyType._zod.values){const a=t.keyType._zod.values;r.value={};for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const c=t.valueType._zod.run({value:n[u],issues:[]},i);c instanceof Promise?s.push(c.then(l=>{l.issues.length&&r.issues.push(...vn(u,l.issues)),r.value[u]=l.value})):(c.issues.length&&r.issues.push(...vn(u,c.issues)),r.value[u]=c.value)}let o;for(const u in n)a.has(u)||(o=o??[],o.push(u));o&&o.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:o})}else{r.value={};for(const a of Reflect.ownKeys(n)){if(a==="__proto__")continue;const o=t.keyType._zod.run({value:a,issues:[]},i);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map(c=>hn(c,i,dn())),input:a,path:[a],inst:e}),r.value[o.value]=o.value;continue}const u=t.valueType._zod.run({value:n[a],issues:[]},i);u instanceof Promise?s.push(u.then(c=>{c.issues.length&&r.issues.push(...vn(a,c.issues)),r.value[o.value]=c.value})):(u.issues.length&&r.issues.push(...vn(a,u.issues)),r.value[o.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),uC=I("$ZodEnum",(e,t)=>{pe.init(e,t);const r=vZ(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(i=>wZ.has(typeof i)).map(i=>typeof i=="string"?Ji(i):i.toString()).join("|")})$`),e._zod.parse=(i,n)=>{const s=i.value;return e._zod.values.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:e}),i}}),cC=I("$ZodLiteral",(e,t)=>{pe.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Ji(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const n=r.value;return e._zod.values.has(n)||r.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),r}}),lC=I("$ZodTransform",(e,t)=>{pe.init(e,t),e._zod.parse=(r,i)=>{const n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new _i;return r.value=n,r}}),dC=I("$ZodOptional",(e,t)=>{pe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ne(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${$h(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>r.value===void 0?r:t.innerType._zod.run(r,i)}),hC=I("$ZodNullable",(e,t)=>{pe.init(e,t),Ne(e._zod,"optin",()=>t.innerType._zod.optin),Ne(e._zod,"optout",()=>t.innerType._zod.optout),Ne(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${$h(r.source)}|null)$`):void 0}),Ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),mC=I("$ZodDefault",(e,t)=>{pe.init(e,t),e._zod.optin="optional",Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>kf(s,t)):kf(n,t)}});function kf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const fC=I("$ZodPrefault",(e,t)=>{pe.init(e,t),e._zod.optin="optional",Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),pC=I("$ZodNonOptional",(e,t)=>{pe.init(e,t),Ne(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>If(s,e)):If(n,e)}});function If(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const vC=I("$ZodCatch",(e,t)=>{pe.init(e,t),Ne(e._zod,"optin",()=>t.innerType._zod.optin),Ne(e._zod,"optout",()=>t.innerType._zod.optout),Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>hn(a,i,dn()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(s=>hn(s,i,dn()))},input:r.value}),r.issues=[]),r)}}),gC=I("$ZodPipe",(e,t)=>{pe.init(e,t),Ne(e._zod,"values",()=>t.in._zod.values),Ne(e._zod,"optin",()=>t.in._zod.optin),Ne(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,i)=>{const n=t.in._zod.run(r,i);return n instanceof Promise?n.then(s=>Of(s,t,i)):Of(n,t,i)}});function Of(e,t,r){return oi(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const yC=I("$ZodReadonly",(e,t)=>{pe.init(e,t),Ne(e._zod,"propValues",()=>t.innerType._zod.propValues),Ne(e._zod,"optin",()=>t.innerType._zod.optin),Ne(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,i)=>{const n=t.innerType._zod.run(r,i);return n instanceof Promise?n.then(Sf):Sf(n)}});function Sf(e){return e.value=Object.freeze(e.value),e}const bC=I("$ZodCustom",(e,t)=>{vt.init(e,t),pe.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then(s=>zf(s,r,i,e));zf(n,r,i,e)}});function zf(e,t,r,i){if(!e){const n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),t.issues.push(ki(n))}}class wC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];if(this._map.set(t,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,t)}return this}remove(t){return this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};return delete i.id,{...i,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function $C(){return new wC}const ps=$C();function _C(e,t){return new e({type:"string",...Z(t)})}function kC(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Z(t)})}function xf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Z(t)})}function IC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(t)})}function OC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(t)})}function SC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(t)})}function zC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(t)})}function xC(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}function NC(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(t)})}function TC(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(t)})}function UC(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(t)})}function EC(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(t)})}function jC(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(t)})}function AC(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Z(t)})}function PC(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(t)})}function ZC(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(t)})}function DC(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(t)})}function CC(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(t)})}function RC(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(t)})}function LC(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Z(t)})}function MC(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(t)})}function BC(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Z(t)})}function FC(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(t)})}function JC(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(t)})}function VC(e,t){return new e({type:"string",format:"date",check:"string_format",...Z(t)})}function WC(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Z(t)})}function qC(e,t){return new e({type:"string",format:"duration",check:"string_format",...Z(t)})}function GC(e,t){return new e({type:"number",checks:[],...Z(t)})}function YC(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}function KC(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Z(t)})}function XC(e,t){return new e({type:"boolean",...Z(t)})}function HC(e,t){return new e({type:"bigint",...Z(t)})}function QC(e,t){return new e({type:"undefined",...Z(t)})}function eR(e,t){return new e({type:"null",...Z(t)})}function tR(e){return new e({type:"unknown"})}function nR(e,t){return new e({type:"never",...Z(t)})}function Qs(e,t){return new oO({check:"less_than",...Z(t),value:e,inclusive:!1})}function tr(e,t){return new oO({check:"less_than",...Z(t),value:e,inclusive:!0})}function ea(e,t){return new uO({check:"greater_than",...Z(t),value:e,inclusive:!1})}function on(e,t){return new uO({check:"greater_than",...Z(t),value:e,inclusive:!0})}function Su(e,t){return new dD({check:"multiple_of",...Z(t),value:e})}function dO(e,t){return new mD({check:"max_length",...Z(t),maximum:e})}function ta(e,t){return new fD({check:"min_length",...Z(t),minimum:e})}function hO(e,t){return new pD({check:"length_equals",...Z(t),length:e})}function rR(e,t){return new vD({check:"string_format",format:"regex",...Z(t),pattern:e})}function iR(e){return new gD({check:"string_format",format:"lowercase",...Z(e)})}function sR(e){return new yD({check:"string_format",format:"uppercase",...Z(e)})}function aR(e,t){return new bD({check:"string_format",format:"includes",...Z(t),includes:e})}function oR(e,t){return new wD({check:"string_format",format:"starts_with",...Z(t),prefix:e})}function uR(e,t){return new $D({check:"string_format",format:"ends_with",...Z(t),suffix:e})}function Vi(e){return new _D({check:"overwrite",tx:e})}function cR(e){return Vi(t=>t.normalize(e))}function lR(){return Vi(e=>e.trim())}function dR(){return Vi(e=>e.toLowerCase())}function hR(){return Vi(e=>e.toUpperCase())}function mR(e,t,r){return new e({type:"array",element:t,...Z(r)})}function fR(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Z(r)})}const pR=I("ZodISODateTime",(e,t)=>{ZD.init(e,t),je.init(e,t)});function vR(e){return JC(pR,e)}const gR=I("ZodISODate",(e,t)=>{DD.init(e,t),je.init(e,t)});function yR(e){return VC(gR,e)}const bR=I("ZodISOTime",(e,t)=>{CD.init(e,t),je.init(e,t)});function wR(e){return WC(bR,e)}const $R=I("ZodISODuration",(e,t)=>{RD.init(e,t),je.init(e,t)});function _R(e){return qC($R,e)}const kR=(e,t)=>{QI.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>TZ(e,r)},flatten:{value:r=>NZ(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},qa=I("ZodError",kR,{Parent:Error}),IR=UZ(qa),OR=EZ(qa),SR=tO(qa),zR=nO(qa),_e=I("ZodType",(e,t)=>(pe.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>Cn(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.parse=(r,i)=>IR(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>SR(e,r,i),e.parseAsync=async(r,i)=>OR(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>zR(e,r,i),e.spa=e.safeParseAsync,e.refine=(r,i)=>e.check(k2(r,i)),e.superRefine=r=>e.check(I2(r)),e.overwrite=r=>e.check(Vi(r)),e.optional=()=>Uf(e),e.nullable=()=>Ef(e),e.nullish=()=>Uf(Ef(e)),e.nonoptional=r=>v2(e,r),e.array=()=>xr(e),e.or=r=>mn([e,r]),e.and=r=>a2(e,r),e.transform=r=>jf(e,l2(r)),e.default=r=>m2(e,r),e.prefault=r=>p2(e,r),e.catch=r=>y2(e,r),e.pipe=r=>jf(e,r),e.readonly=()=>$2(e),e.describe=r=>{const i=e.clone();return ps.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){var r;return(r=ps.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return ps.get(e);const i=e.clone();return ps.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),mO=I("_ZodString",(e,t)=>{Ih.init(e,t),_e.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(rR(...i)),e.includes=(...i)=>e.check(aR(...i)),e.startsWith=(...i)=>e.check(oR(...i)),e.endsWith=(...i)=>e.check(uR(...i)),e.min=(...i)=>e.check(ta(...i)),e.max=(...i)=>e.check(dO(...i)),e.length=(...i)=>e.check(hO(...i)),e.nonempty=(...i)=>e.check(ta(1,...i)),e.lowercase=i=>e.check(iR(i)),e.uppercase=i=>e.check(sR(i)),e.trim=()=>e.check(lR()),e.normalize=(...i)=>e.check(cR(...i)),e.toLowerCase=()=>e.check(dR()),e.toUpperCase=()=>e.check(hR())}),xR=I("ZodString",(e,t)=>{Ih.init(e,t),mO.init(e,t),e.email=r=>e.check(kC(NR,r)),e.url=r=>e.check(xC(TR,r)),e.jwt=r=>e.check(FC(VR,r)),e.emoji=r=>e.check(NC(UR,r)),e.guid=r=>e.check(xf(Nf,r)),e.uuid=r=>e.check(IC(vs,r)),e.uuidv4=r=>e.check(OC(vs,r)),e.uuidv6=r=>e.check(SC(vs,r)),e.uuidv7=r=>e.check(zC(vs,r)),e.nanoid=r=>e.check(TC(ER,r)),e.guid=r=>e.check(xf(Nf,r)),e.cuid=r=>e.check(UC(jR,r)),e.cuid2=r=>e.check(EC(AR,r)),e.ulid=r=>e.check(jC(PR,r)),e.base64=r=>e.check(LC(BR,r)),e.base64url=r=>e.check(MC(FR,r)),e.xid=r=>e.check(AC(ZR,r)),e.ksuid=r=>e.check(PC(DR,r)),e.ipv4=r=>e.check(ZC(CR,r)),e.ipv6=r=>e.check(DC(RR,r)),e.cidrv4=r=>e.check(CC(LR,r)),e.cidrv6=r=>e.check(RC(MR,r)),e.e164=r=>e.check(BC(JR,r)),e.datetime=r=>e.check(vR(r)),e.date=r=>e.check(yR(r)),e.time=r=>e.check(wR(r)),e.duration=r=>e.check(_R(r))});function O(e){return _C(xR,e)}const je=I("ZodStringFormat",(e,t)=>{ze.init(e,t),mO.init(e,t)}),NR=I("ZodEmail",(e,t)=>{zD.init(e,t),je.init(e,t)}),Nf=I("ZodGUID",(e,t)=>{OD.init(e,t),je.init(e,t)}),vs=I("ZodUUID",(e,t)=>{SD.init(e,t),je.init(e,t)}),TR=I("ZodURL",(e,t)=>{xD.init(e,t),je.init(e,t)}),UR=I("ZodEmoji",(e,t)=>{ND.init(e,t),je.init(e,t)}),ER=I("ZodNanoID",(e,t)=>{TD.init(e,t),je.init(e,t)}),jR=I("ZodCUID",(e,t)=>{UD.init(e,t),je.init(e,t)}),AR=I("ZodCUID2",(e,t)=>{ED.init(e,t),je.init(e,t)}),PR=I("ZodULID",(e,t)=>{jD.init(e,t),je.init(e,t)}),ZR=I("ZodXID",(e,t)=>{AD.init(e,t),je.init(e,t)}),DR=I("ZodKSUID",(e,t)=>{PD.init(e,t),je.init(e,t)}),CR=I("ZodIPv4",(e,t)=>{LD.init(e,t),je.init(e,t)}),RR=I("ZodIPv6",(e,t)=>{MD.init(e,t),je.init(e,t)}),LR=I("ZodCIDRv4",(e,t)=>{BD.init(e,t),je.init(e,t)}),MR=I("ZodCIDRv6",(e,t)=>{FD.init(e,t),je.init(e,t)}),BR=I("ZodBase64",(e,t)=>{JD.init(e,t),je.init(e,t)}),FR=I("ZodBase64URL",(e,t)=>{WD.init(e,t),je.init(e,t)}),JR=I("ZodE164",(e,t)=>{qD.init(e,t),je.init(e,t)}),VR=I("ZodJWT",(e,t)=>{YD.init(e,t),je.init(e,t)}),fO=I("ZodNumber",(e,t)=>{lO.init(e,t),_e.init(e,t),e.gt=(i,n)=>e.check(ea(i,n)),e.gte=(i,n)=>e.check(on(i,n)),e.min=(i,n)=>e.check(on(i,n)),e.lt=(i,n)=>e.check(Qs(i,n)),e.lte=(i,n)=>e.check(tr(i,n)),e.max=(i,n)=>e.check(tr(i,n)),e.int=i=>e.check(Tf(i)),e.safe=i=>e.check(Tf(i)),e.positive=i=>e.check(ea(0,i)),e.nonnegative=i=>e.check(on(0,i)),e.negative=i=>e.check(Qs(0,i)),e.nonpositive=i=>e.check(tr(0,i)),e.multipleOf=(i,n)=>e.check(Su(i,n)),e.step=(i,n)=>e.check(Su(i,n)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function le(e){return GC(fO,e)}const pO=I("ZodNumberFormat",(e,t)=>{KD.init(e,t),fO.init(e,t)});function Tf(e){return YC(pO,e)}function WR(e){return KC(pO,e)}const qR=I("ZodBoolean",(e,t)=>{XD.init(e,t),_e.init(e,t)});function re(e){return XC(qR,e)}const GR=I("ZodBigInt",(e,t)=>{HD.init(e,t),_e.init(e,t),e.gte=(i,n)=>e.check(on(i,n)),e.min=(i,n)=>e.check(on(i,n)),e.gt=(i,n)=>e.check(ea(i,n)),e.gte=(i,n)=>e.check(on(i,n)),e.min=(i,n)=>e.check(on(i,n)),e.lt=(i,n)=>e.check(Qs(i,n)),e.lte=(i,n)=>e.check(tr(i,n)),e.max=(i,n)=>e.check(tr(i,n)),e.positive=i=>e.check(ea(BigInt(0),i)),e.negative=i=>e.check(Qs(BigInt(0),i)),e.nonpositive=i=>e.check(tr(BigInt(0),i)),e.nonnegative=i=>e.check(on(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(Su(i,n));const r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function YR(e){return HC(GR,e)}const KR=I("ZodUndefined",(e,t)=>{QD.init(e,t),_e.init(e,t)});function XR(e){return QC(KR,e)}const HR=I("ZodNull",(e,t)=>{eC.init(e,t),_e.init(e,t)});function Ii(e){return eR(HR,e)}const QR=I("ZodUnknown",(e,t)=>{tC.init(e,t),_e.init(e,t)});function Dt(){return tR(QR)}const e2=I("ZodNever",(e,t)=>{nC.init(e,t),_e.init(e,t)});function t2(e){return nR(e2,e)}const n2=I("ZodArray",(e,t)=>{rC.init(e,t),_e.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(ta(r,i)),e.nonempty=r=>e.check(ta(1,r)),e.max=(r,i)=>e.check(dO(r,i)),e.length=(r,i)=>e.check(hO(r,i)),e.unwrap=()=>e.element});function xr(e,t){return mR(n2,e,t)}const r2=I("ZodObject",(e,t)=>{iC.init(e,t),_e.init(e,t),Ne(e,"shape",()=>Object.fromEntries(Object.entries(e._zod.def.shape))),e.keyof=()=>Ct(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Dt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Dt()}),e.strict=()=>e.clone({...e._zod.def,catchall:t2()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>OZ(e,r),e.merge=r=>SZ(e,r),e.pick=r=>kZ(e,r),e.omit=r=>IZ(e,r),e.partial=(...r)=>zZ(vO,e,r[0]),e.required=(...r)=>xZ(gO,e,r[0])});function b(e,t){const r={type:"object",get shape(){return _h(this,"shape",{...e}),this.shape},...Z(t)};return new r2(r)}const i2=I("ZodUnion",(e,t)=>{sC.init(e,t),_e.init(e,t),e.options=t.options});function mn(e,t){return new i2({type:"union",options:e,...Z(t)})}const s2=I("ZodIntersection",(e,t)=>{aC.init(e,t),_e.init(e,t)});function a2(e,t){return new s2({type:"intersection",left:e,right:t})}const o2=I("ZodRecord",(e,t)=>{oC.init(e,t),_e.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ga(e,t,r){return new o2({type:"record",keyType:e,valueType:t,...Z(r)})}const zu=I("ZodEnum",(e,t)=>{uC.init(e,t),_e.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{const s={};for(const a of i)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new zu({...t,checks:[],...Z(n),entries:s})},e.exclude=(i,n)=>{const s={...t.entries};for(const a of i)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new zu({...t,checks:[],...Z(n),entries:s})}});function Ct(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new zu({type:"enum",entries:r,...Z(t)})}const u2=I("ZodLiteral",(e,t)=>{cC.init(e,t),_e.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Oh(e,t){return new u2({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}const c2=I("ZodTransform",(e,t)=>{lC.init(e,t),_e.init(e,t),e._zod.parse=(r,i)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(ki(s,r.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),a.continue??(a.continue=!0),r.issues.push(ki(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r)):(r.value=n,r)}});function l2(e){return new c2({type:"transform",transform:e})}const vO=I("ZodOptional",(e,t)=>{dC.init(e,t),_e.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Uf(e){return new vO({type:"optional",innerType:e})}const d2=I("ZodNullable",(e,t)=>{hC.init(e,t),_e.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ef(e){return new d2({type:"nullable",innerType:e})}const h2=I("ZodDefault",(e,t)=>{mC.init(e,t),_e.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function m2(e,t){return new h2({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const f2=I("ZodPrefault",(e,t)=>{fC.init(e,t),_e.init(e,t),e.unwrap=()=>e._zod.def.innerType});function p2(e,t){return new f2({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const gO=I("ZodNonOptional",(e,t)=>{pC.init(e,t),_e.init(e,t),e.unwrap=()=>e._zod.def.innerType});function v2(e,t){return new gO({type:"nonoptional",innerType:e,...Z(t)})}const g2=I("ZodCatch",(e,t)=>{vC.init(e,t),_e.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function y2(e,t){return new g2({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const b2=I("ZodPipe",(e,t)=>{gC.init(e,t),_e.init(e,t),e.in=t.in,e.out=t.out});function jf(e,t){return new b2({type:"pipe",in:e,out:t})}const w2=I("ZodReadonly",(e,t)=>{yC.init(e,t),_e.init(e,t)});function $2(e){return new w2({type:"readonly",innerType:e})}const yO=I("ZodCustom",(e,t)=>{bC.init(e,t),_e.init(e,t)});function _2(e,t){const r=new vt({check:"custom",...Z(t)});return r._zod.check=e,r}function k2(e,t={}){return fR(yO,e,t)}function I2(e,t){const r=_2(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(ki(n,i.value,r._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),i.issues.push(ki(s))}},e(i.value,i)),t);return r}function Sh(e,t={error:`Input not instance of ${e.name}`}){const r=new yO({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...Z(t)});return r._zod.bag.Class=e,r}const O2="all",S2="create",z2="delete",x2="retrieve",N2="update",xu=Ct([O2,S2,z2,x2,N2]);class Xt extends ur.createTyped("sy"){}class Ae extends Xt.sub("validation"){}class Af extends Ae.sub("field"){constructor(t,r){super(`${t}: ${r}`),h(this,"field"),h(this,"message"),this.field=t,this.message=r}}class na extends Xt.sub("auth"){}class Nu extends na.sub("invalid_token"){}class Tu extends na.sub("expired_token"){}class $t extends Xt.sub("unexpected"){constructor(t){super(`
124
+ Unexpected error encountered:
125
+
126
+ ${t}
127
+
128
+ Please report this to the Synnax team.
129
+ `)}}class Yt extends Xt.sub("query"){}class Nn extends Yt.sub("not_found"){}class pr extends Yt.sub("multiple_results"){}class Pf extends Xt.sub("route"){constructor(t,r){super(t),h(this,"path"),this.path=r}}class Uu extends Xt.sub("control"){}class Zf extends Uu.sub("unauthorized"){}class qV extends Xt.sub("contiguity"){}const T2=e=>{if(!e.type.startsWith(Xt.TYPE))return null;if(e.type.startsWith(Ae.TYPE)){if(e.type===Af.TYPE){const t=e.data.split(": ");return t.length<2?new Ae(e.data):new Af(t[0],t[1])}return new Ae(e.data)}return e.type.startsWith(na.TYPE)?e.type.startsWith(Nu.TYPE)?new Nu(e.data):e.type.startsWith(Tu.TYPE)?new Tu(e.data):new na(e.data):e.type.startsWith($t.TYPE)?new $t(e.data):e.type.startsWith(Yt.TYPE)?e.type.startsWith(Nn.TYPE)?new Nn(e.data):e.type.startsWith(pr.TYPE)?new pr(e.data):new Yt(e.data):e.type.startsWith(Uu.TYPE)?e.type.startsWith(Zf.TYPE)?new Zf(e.data):new Uu(e.data):e.type.startsWith(Pf.TYPE)?new Pf(e.data,e.data):new $t(e.data)},U2=()=>{throw new Error("Not implemented")};ur.register({encode:U2,decode:T2});const E2=async(e,t)=>{const[r,i]=await t(e);return i==null?[r,i]:i instanceof ln?[r,new ln({message:`Cannot reach cluster at ${i.url.host}:${i.url.port}`,url:i.url})]:[r,i]},Ya=O().uuid(),zh=O(),bO=b({key:Ya,name:zh}),wO="group",at=e=>mn([mn([Ii(),XR()]).transform(()=>[]),e.array()]),Ye=le(),Wi=O(),qi=b({name:Wi,key:Ye,dataType:ce.z,leaseholder:le(),index:Ye,isIndex:re(),internal:re(),virtual:re(),alias:O().optional(),expression:O().default(""),requires:at(Ye)}),$O=qi.extend({key:Ye.optional(),leaseholder:le().optional(),index:Ye.optional(),isIndex:re().optional(),internal:re().optional().default(!1),virtual:re().optional().default(!1),expression:O().optional().default(""),requires:at(Ye).optional().default([])}),Ka="channel",j2=b({key:Ye,variant:Sa.variantZ,message:O()}),xh="framer",Df=e=>{const t=D.toArray(e);return t.length===0?null:typeof t[0]=="number"||!isNaN(parseInt(t[0]))?"key":"name"},Cf=(e,t)=>{const r=D.toArray(e);if(r.length===t.length)return;const i=Df(e);throw Df===null?new Ae("[Frame] - channel keys or names must be provided when constructing a frame."):new Ae(`[Frame] - ${i}s and series must be the same length.
130
+ Got ${r.length} ${i}s and ${t.length} series.`)};class He{constructor(t=[],r=[]){if(h(this,"columns",[]),h(this,"series",[]),t instanceof He){this.columns=t.columns,this.series=t.series;return}if(t instanceof Map){t.forEach((i,n)=>this.push(n,...D.toArray(i)));return}if(typeof t=="object"&&!Array.isArray(t)){if("keys"in t&&"series"in t){const i=t;i.series??(i.series=[]),i.keys??(i.keys=[]);const n=i.series.map(s=>_O(s));Cf(i.keys,n),i.keys.forEach((s,a)=>this.push(s,n[a]))}else Object.entries(t).forEach(([i,n])=>{const s=parseInt(i);if(!isNaN(s))return this.push(s,...D.toArray(n));this.push(i,...D.toArray(n))});return}if(Array.isArray(t)||["string","number"].includes(typeof t)){const i=D.toArray(r),n=D.toArray(t);Cf(n,i),i.forEach((s,a)=>this.push(n[a],s));return}throw new Ae(`[Frame] - invalid frame construction parameters. data parameter ust be a frame
131
+ payload, a list of lazy series, a lazy array, a map, or a record keyed by channel
132
+ name. keys parameter must be a set of channel keys or channel names.`)}get colType(){return this.columns.length===0?null:typeof this.columns[0]=="string"?"name":"key"}get keys(){if(this.colType==="name")throw new $t("colType is not key");return this.columns??[]}get uniqueKeys(){return sm.unique(this.keys)}get names(){if(this.colType==="key")throw new $t("colType is not name");return this.columns??[]}get uniqueNames(){return sm.unique(this.names)}get uniqueColumns(){return this.colType==="key"?this.uniqueKeys:this.uniqueNames}toPayload(){return{series:this.series.map(t=>kO(t)),keys:[...this.keys]}}get isVertical(){return this.uniqueColumns.length===this.columns.length}get isHorizontal(){return this.uniqueColumns.length===1}get isSquare(){return this.isHorizontal&&this.isVertical}get isWeaklyAligned(){if(this.columns.length<=1)return!0;const t=this.timeRanges;return t.every(r=>r.equals(t[0]))}timeRange(t){if(t==null){if(this.columns.length===0)return Me.ZERO;const i=q.min(...this.series.map(s=>s.timeRange.start)),n=q.max(...this.series.map(s=>s.timeRange.end));return new Me(i,n)}const r=this.get(t);return r==null?Me.ZERO:r.timeRange}latest(){return this.at(-1)}get timeRanges(){return this.uniqueColumns.map(t=>this.timeRange(t))}get(t){return Array.isArray(t)?this.filter(r=>t.includes(r)):new yN(this.series.filter((r,i)=>this.columns[i]===t))}push(t,...r){if(t instanceof He){if(this.colType!==null&&t.colType!==this.colType)throw new Ae("keyVariant must match");this.series.push(...t.series),this.columns.push(...t.columns)}else{if(this.series.push(...r),typeof t=="string"&&this.colType==="key")throw new Ae("keyVariant must match");if(typeof t!="string"&&this.colType==="name")throw new Ae("keyVariant must match");this.columns.push(...Array.from({length:r.length},()=>t))}}concat(t){return new He([...this.columns,...t.columns],[...this.series,...t.series])}has(t){return typeof t=="string"&&this.colType==="key"||typeof t=="number"&&this.colType==="name"?!1:this.columns.includes(t)}map(t){const r=new He;return this.forEach((i,n,s)=>r.push(...t(i,n,s))),r}forEach(t){this.columns.forEach((r,i)=>{const n=this.series[i];t(r,n,i)})}at(t,r=!1){const i={};return this.uniqueColumns.forEach(n=>{i[n]=this.get(n).at(t,r)}),i}filter(t){const r=new He;return this.columns.forEach((i,n)=>{const s=this.series[n];t(i,s,n)&&r.push(i,s)}),r}get byteLength(){return new or(this.series.reduce((t,r)=>t.add(r.byteLength),or.ZERO))}get digest(){const t={};return this.keys.forEach((r,i)=>{const n=this.series[i].digest;r in t?t[r].push(n):t[r]=[n]}),t}get length(){return this.series.reduce((t,r)=>t+r.length,0)}toString(){let t=`Frame{
133
+ `;return this.uniqueColumns.forEach(r=>{t+=` ${r}: ${this.get(r).series.map(i=>i.toString()).join(",")}
134
+ `}),t+="}",t}}const Xa=b({keys:mn([Ii().transform(()=>[]),le().array().optional().default([])]),series:mn([Ii().transform(()=>[]),un.crudeZ.array().optional().default([])])}),_O=e=>{const{dataType:t,data:r,timeRange:i,alignment:n}=e;return new un({data:r,dataType:t,timeRange:i,glBufferUsage:"static",alignment:n})},kO=e=>({timeRange:e.timeRange,dataType:e.dataType,data:new Uint8Array(e.data.buffer),alignment:e.alignment}),Rn=WR(),IO=b({key:Rn,variant:Sa.variantZ.or(Oh("").transform(()=>"info")),message:O(),lastReceived:q.z}),Nh=b({key:Rn,name:O(),state:Pb.nullToUndefined(IO)}),A2=Nh.partial({key:!0}),OO="rack",Th=e=>e?Tn.JSON_CODEC.decodeString(e,St):{},Ha=O(),SO=b({key:Ha,variant:Sa.variantZ.or(Oh("").transform(()=>"info")),details:St.or(O().transform(Th))}),Qa=b({key:Ha,rack:Rn,name:O(),make:O(),model:O(),location:O(),configured:re().optional(),properties:St.or(O().transform(Th)),state:Pb.nullToUndefined(SO)}),P2=Qa.extend({properties:Dt().transform(e=>Tn.JSON_CODEC.encodeString(e))}),zO="device",Bt=e=>e?JSON.parse(e):{},Ln=mn([O(),YR().transform(e=>e.toString()),le().transform(e=>e.toString())]),ra=b({task:Ln,variant:Sa.variantZ.or(Oh("").transform(()=>"info")),key:O().optional(),details:St.or(O().transform(Bt)).or(xr(Dt())).or(Ii())}),eo=b({key:Ln,name:O(),type:O(),internal:re().optional(),config:St.or(O().transform(Th)),state:ra.optional().nullable(),snapshot:re().optional()}),Z2=eo.omit({key:!0}).extend({key:Ln.transform(e=>e.toString()).optional(),config:Dt().transform(e=>Tn.JSON_CODEC.encodeString(e))}),xO=b({task:Ln,type:O(),key:O(),args:St.or(O().transform(Bt)).or(xr(Dt())).or(Ii()).optional()}),Uh="task",Nr=O().uuid(),to=b({key:Nr,name:O().min(1),color:O()}),NO="label",ft=O().uuid(),Eh=O().min(1),Tr=b({key:ft,name:Eh,timeRange:Me.z,color:O().optional()}),TO=Tr.partial({key:!0}),UO=e=>{const t=D.toArray(e),r=t.length===0;let i=!1;return r||(i=ft.safeParse(t[0]).success),{single:!Array.isArray(e),variant:i?"keys":"names",normalized:t,actual:e,empty:r}},jh="range",Ah="range-alias",Ur=O().uuid(),no=b({key:Ur,username:O().min(1),firstName:O().default(""),lastName:O().default(""),rootUser:re().default(!0)}),D2=no.partial({key:!0,firstName:!0,lastName:!0}).omit({rootUser:!0}).extend({password:O().min(1)}),C2="user",Gi=O().uuid(),Ph=b({key:Gi,name:O(),data:St.or(O().transform(Bt))}),R2=Ph.partial({key:!0}).transform(e=>({...e,data:JSON.stringify(e.data)})),L2="lineplot",Yi=O().uuid(),Zh=b({key:Yi,name:O(),data:St.or(O().transform(Bt))}),M2=Zh.partial({key:!0}).transform(e=>({...e,data:JSON.stringify(e.data)})),B2="log",Ht=O().uuid(),Dh=b({key:Ht,name:O(),layout:St.or(O().transform(Bt))}),EO="workspace",F2=Dh.partial({key:!0}).transform(e=>({...e,layout:JSON.stringify(e.layout)})),J2=Dh.omit({layout:!0}).extend({layout:O().transform(Bt)}),Er=O().uuid(),Ch=b({key:Er,name:O(),data:St.or(O().transform(Bt)),snapshot:re()}),V2=Ch.partial({key:!0,snapshot:!0}).transform(e=>({...e,data:JSON.stringify(e.data)})),jO=Ch.extend({data:O().transform(Bt)}),W2="schematic",Ki=O().uuid(),AO=b({key:Ki,name:O(),data:St.or(O().transform(Bt))}),q2=AO.partial({key:!0}).transform(e=>({...e,data:JSON.stringify(e.data)})),PO=AO.extend({data:O().transform(Bt)}),G2="table",ZO="builtin",Y2="cluster",K2="node",ro=Ct([NO,B2,tw,ZO,Y2,Ka,K2,wO,jh,xh,Ah,C2,EO,W2,L2,OO,zO,Uh,nE,G2]),pt=b({type:ro,key:O()}),X2=O().transform(e=>{const[t,r]=e.split(":");return{type:ro.parse(t),key:r??""}}),ei=mn([X2,pt]),Ss=class DO{constructor(t){if(h(this,"type"),h(this,"key"),t instanceof DO){this.type=t.type,this.key=t.key;return}if(typeof t=="string"){const[r,i]=t.split(":");this.type=r,this.key=i??"";return}this.type=t.type,this.key=t.key}toString(){return`${this.type}:${this.key}`}isType(){return this.key===""}matchesType(t){return this.type===t&&this.isType()}get payload(){return{type:this.type,key:this.key}}};h(Ss,"z",mn([Sh(Ss),ei.transform(e=>new Ss(e))]));let se=Ss;new se({type:ZO,key:"root"});const H2=b({type:le()}),Q2=b({type:ro,fields:Ga(O(),H2)}),eL=b({id:se.z,name:O(),schema:Q2.optional().nullable(),data:St.optional().nullable()}).transform(e=>({key:e.id.toString(),...e}));b({from:se.z,type:O(),to:se.z});const Rf=e=>{const[t,r,i]=e.split("->");return{from:new se(t),type:r,to:new se(i)}};class CO{constructor(t,r){h(this,"key"),h(this,"name"),this.key=r,this.name=t}get ontologyID(){return tL(this.key)}}const tL=e=>new se({type:wO,key:e}),nL=b({group:bO}),rL=b({parent:pt,key:Ya.optional(),name:zh}),iL=b({key:Ya,name:zh}),sL=b({keys:xr(Ya)});var tn;let aL=(tn=class{constructor(e){h(this,"client"),this.client=e}async create(e,t,r){return(await j(this.client,tn.CREATE_ENDPOINT,{parent:e,name:t,key:r},rL,nL)).group}async rename(e,t){await j(this.client,tn.RENAME_ENDPOINT,{key:e,name:t},iL,b({}))}async delete(e){await j(this.client,tn.DELETE_ENDPOINT,{keys:e},sL,b({}))}},h(tn,"CREATE_ENDPOINT","/ontology/create-group"),h(tn,"RENAME_ENDPOINT","/ontology/rename-group"),h(tn,"DELETE_ENDPOINT","/ontology/delete-group"),tn),oL=class{constructor(e){h(this,"creator"),this.creator=new aL(e)}async create(e,t,r){return this.sugar(await this.creator.create(e,t,r))}async rename(e,t){return await this.creator.rename(e,t)}async delete(...e){return await this.creator.delete(e)}sugar(e){return new CO(e.name,e.key)}};const uL="/ontology/add-children",cL="/ontology/remove-children",lL="/ontology/move-children",Lf=b({id:pt,children:pt.array()}),dL=b({from:pt,to:pt,children:pt.array()}),ko=b({});let hL=class{constructor(e){h(this,"client"),this.client=e}async addChildren(e,...t){await j(this.client,uL,{id:new se(e).payload,children:t.map(r=>new se(r).payload)},Lf,ko)}async removeChildren(e,...t){await j(this.client,cL,{id:new se(e).payload,children:t.map(r=>new se(r).payload)},Lf,ko)}async moveChildren(e,t,...r){const i={from:new se(e).payload,to:new se(t).payload,children:r.map(n=>new se(n).payload)};await j(this.client,lL,i,dL,ko)}};const mL="/ontology/retrieve",fL=b({ids:pt.array().optional(),children:re().optional(),parents:re().optional(),includeSchema:re().optional(),excludeFieldData:re().optional(),term:O().optional(),limit:le().optional(),offset:le().optional(),types:ro.array().optional()}),pL=b({resources:eL.array()}),Io=e=>D.toArray(e).map(t=>new se(t).payload);let vL=class{constructor(e,t){h(this,"type","ontology"),h(this,"groups"),h(this,"client"),h(this,"writer"),h(this,"framer"),this.client=e,this.writer=new hL(e),this.groups=new oL(e),this.framer=t}async search(e,t){return await this.execRetrieve({term:e,...t})}async retrieve(e,t){const r=await this.execRetrieve({ids:Io(e),...t});if(Array.isArray(e))return r;if(r.length===0)throw new Yt(`No resource found with ID ${tE.naturalLanguageJoin(D.toArray(e).map(i=>new se(i).toString()))}`);return r[0]}async page(e,t,r){return await this.execRetrieve({offset:e,limit:t,...r})}async retrieveChildren(e,t){return await this.execRetrieve({ids:Io(e),children:!0,...t})}async retrieveParents(e,t){return await this.execRetrieve({ids:Io(e),parents:!0,...t})}async addChildren(e,...t){return await this.writer.addChildren(e,...t)}async removeChildren(e,...t){return await this.writer.removeChildren(e,...t)}async moveChildren(e,t,...r){return await this.writer.moveChildren(e,t,...r)}async openChangeTracker(){return await io.open(this.framer,this)}async openDependentTracker(e){return await Rh.open(e,this.framer,this)}newSearcherWithOptions(e){return{type:this.type,search:t=>this.search(t,e),retrieve:t=>this.retrieve(t,e),page:(t,r)=>this.page(t,r,e)}}async execRetrieve(e){const{resources:t}=await j(this.client,mL,e,fL,pL);return t}};const Mf="sy_ontology_resource_set",Bf="sy_ontology_resource_delete",Ff="sy_ontology_relationship_set",Jf="sy_ontology_relationship_delete";class io{constructor(t,r){h(this,"relationships"),h(this,"resources"),h(this,"resourceObs"),h(this,"relationshipObs"),h(this,"streamer"),h(this,"client"),h(this,"closePromise"),this.relationshipObs=new _n.Observer,this.relationships=this.relationshipObs,this.resourceObs=new _n.Observer,this.resources=this.resourceObs,this.client=r,this.streamer=t,this.closePromise=this.start()}async close(){this.streamer.close(),await this.closePromise}async start(){for await(const t of this.streamer)await this.update(t)}async update(t){const r=await this.parseResourceSets(t),i=this.parseResourceDeletes(t);r.concat(i).length>0&&this.resourceObs.notify(r.concat(i));const n=this.parseRelationshipSets(t),s=this.parseRelationshipDeletes(t);n.concat(s).length>0&&this.relationshipObs.notify(n.concat(s))}parseRelationshipSets(t){const r=t.get(Ff);return r.length===0?[]:Array.from(r.as("string")).map(i=>({variant:"set",key:Rf(i),value:void 0}))}parseRelationshipDeletes(t){const r=t.get(Jf);return r.length===0?[]:Array.from(r.as("string")).map(i=>({variant:"delete",key:Rf(i)}))}async parseResourceSets(t){const r=t.get(Mf);if(r.length===0)return[];const i=Array.from(r.as("string")).map(n=>new se(n));try{return(await this.client.retrieve(i)).map(n=>({variant:"set",key:n.id,value:n}))}catch(n){if(n instanceof Yt)return[];throw n}}parseResourceDeletes(t){const r=t.get(Bf);return r.length===0?[]:Array.from(r.as("string")).map(i=>({variant:"delete",key:new se(i)}))}static async open(t,r){const i=await t.openStreamer([Mf,Bf,Ff,Jf]);return new io(i,r)}}const Vf=e=>e==="from"?"to":"from";class Rh extends _n.Observer{constructor({target:t,dependents:r,relationshipType:i="parent",relationshipDirection:n="from",resourceType:s},a,o){super(),h(this,"internal"),h(this,"target"),h(this,"relDir"),h(this,"resourceType"),h(this,"dependents"),h(this,"client"),h(this,"relType"),h(this,"handleResourceChange",u=>{this.dependents=this.dependents.map(c=>{const l=u.find(d=>d.key.toString()==c.id.toString());return l==null||l.variant==="delete"?c:l.value}),this.notify(this.dependents)}),h(this,"handleRelationshipChange",u=>{const c=u.filter(d=>d.variant==="delete"&&d.key[this.relDir].toString()===this.target.toString()&&(this.resourceType==null||d.key[Vf(this.relDir)].type===this.resourceType));this.dependents=this.dependents.filter(d=>!c.some(m=>m.key.to.toString()===d.id.toString()&&m.key.type===this.relType));const l=u.filter(d=>d.variant==="set"&&d.key.type===this.relType&&d.key[this.relDir].toString()===this.target.toString()&&(this.resourceType==null||d.key[Vf(this.relDir)].type===this.resourceType));if(l.length===0)return this.notify(this.dependents);this.client.retrieve(l.map(d=>d.key.to)).then(d=>{this.dependents=this.dependents.concat(d),this.notify(this.dependents)}).catch(console.error)}),this.resourceType=s,this.internal=a,this.target=t,this.dependents=r,this.resourceType!=null&&(this.dependents=this.dependents.filter(u=>u.id.type===this.resourceType)),this.client=o,this.relType=i,this.relDir=n,this.internal.resources.onChange(this.handleResourceChange),this.internal.relationships.onChange(this.handleRelationshipChange)}static async open(t,r,i){const n=await io.open(r,i);return new Rh(t,n,i)}async close(){await this.internal.close()}}const so=O().uuid(),Lh=b({key:so,subjects:at(pt),objects:at(pt),actions:at(xu)}),gL=b({key:so.optional(),subjects:ei.array().or(ei),objects:ei.array().or(ei),actions:xu.array().or(xu)}),yL=b({keys:so.array().optional(),subjects:pt.array().optional()}),bL=b({policies:at(Lh)}),wL="/access/policy/retrieve";let $L=class{constructor(e){h(this,"client"),this.client=e}async retrieve(e){return(await j(this.client,wL,e,yL,bL)).policies}};const _L=b({policies:Lh.partial({key:!0}).array()}),kL=b({policies:Lh.array()}),IL=b({keys:so.array()}),OL=b({}),SL="/access/policy/create",zL="/access/policy/delete";let xL=class{constructor(e){h(this,"client"),this.client=e}async create(e){const t=gL.array().parse(D.toArray(e)).map(r=>({objects:D.toArray(r.objects),actions:D.toArray(r.actions),subjects:D.toArray(r.subjects)}));return(await j(this.client,SL,{policies:t},_L,kL)).policies}async delete(e){await j(this.client,zL,{keys:D.toArray(e)},IL,OL)}},NL=class{constructor(e){h(this,"retriever"),h(this,"writer"),this.retriever=new $L(e),this.writer=new xL(e)}async create(e){const t=Array.isArray(e),r=await this.writer.create(e);return t?r:r[0]}async retrieve(e){const t=Array.isArray(e),r=await this.retriever.retrieve({keys:D.toArray(e)});return t?r:r[0]}async retrieveFor(e){const t=D.toArray(e).map(r=>new se(r).payload);return await this.retriever.retrieve({subjects:t})}async delete(e){await this.writer.delete(e)}};new se({type:tw,key:""});let TL=class{constructor(e){h(this,"policy"),this.policy=new NL(e)}};const UL=new Error("request for lock canceled");var EL=function(e,t,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(l){try{c(i.next(l))}catch(d){a(d)}}function u(l){try{c(i.throw(l))}catch(d){a(d)}}function c(l){l.done?s(l.value):n(l.value).then(o,u)}c((i=i.apply(e,t||[])).next())})};class jL{constructor(t,r=UL){this._value=t,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(t=1,r=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((i,n)=>{const s={resolve:i,reject:n,weight:t,priority:r},a=RO(this._queue,o=>r<=o.priority);a===-1&&t<=this._value?this._dispatchItem(s):this._queue.splice(a+1,0,s)})}runExclusive(t){return EL(this,arguments,void 0,function*(r,i=1,n=0){const[s,a]=yield this.acquire(i,n);try{return yield r(s)}finally{a()}})}waitForUnlock(t=1,r=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,r)?Promise.resolve():new Promise(i=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),AL(this._weightedWaiters[t-1],{resolve:i,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){const r=this._value;this._value-=t.weight,t.resolve([r,this._newReleaser(t.weight)])}_newReleaser(t){let r=!1;return()=>{r||(r=!0,this.release(t))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let t=this._value;t>0;t--){const r=this._weightedWaiters[t-1];r&&(r.forEach(i=>i.resolve()),this._weightedWaiters[t-1]=[])}else{const t=this._queue[0].priority;for(let r=this._value;r>0;r--){const i=this._weightedWaiters[r-1];if(!i)continue;const n=i.findIndex(s=>s.priority<=t);(n===-1?i:i.splice(0,n)).forEach(s=>s.resolve())}}}_couldLockImmediately(t,r){return(this._queue.length===0||this._queue[0].priority<r)&&t<=this._value}}function AL(e,t){const r=RO(e,i=>t.priority<=i.priority);e.splice(r+1,0,t)}function RO(e,t){for(let r=e.length-1;r>=0;r--)if(t(e[r]))return r;return-1}var PL=function(e,t,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(l){try{c(i.next(l))}catch(d){a(d)}}function u(l){try{c(i.throw(l))}catch(d){a(d)}}function c(l){l.done?s(l.value):n(l.value).then(o,u)}c((i=i.apply(e,t||[])).next())})};class ZL{constructor(t){this._semaphore=new jL(1,t)}acquire(){return PL(this,arguments,void 0,function*(t=0){const[,r]=yield this._semaphore.acquire(1,t);return r})}runExclusive(t,r=0){return this._semaphore.runExclusive(()=>t(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const Mh=(e,t,{convertNumericStrings:r=!0}={})=>{const i=!Array.isArray(e);let n=D.toArray(e);const s=n[0],a=typeof s;let o;return a==="string"&&r&&!isNaN(parseInt(s))&&"number"in t?(o=t.number,n=n.map(u=>parseInt(u))):o=t[a],{single:i,variant:o,normalized:n,actual:e}},ao=(e,t,r,i)=>{if(i){if(r.length===0)throw new Nn(`${e} not found matching ${JSON.stringify(t)}`);if(r.length>1)throw new pr(`Expected one ${e} matching ${JSON.stringify(t)}, but found ${r.length}`)}},DL=b({leaseholder:le().optional(),keys:Ye.array().optional(),names:O().array().optional(),search:O().optional(),rangeKey:O().optional(),limit:le().optional(),offset:le().optional(),dataTypes:ce.z.array().optional(),notDataTypes:ce.z.array().optional(),virtual:re().optional(),isIndex:re().optional(),internal:re().optional()}),CL=b({channels:at(qi)}),Rt=e=>(Array.isArray(e)&&e.length>0&&typeof e[0]=="object"?e=e.map(t=>t.key):typeof e=="object"&&"key"in e&&(e=[e.key]),Mh(e,{number:"keys",string:"names"})),LO=class MO{constructor(t){h(this,"client"),this.client=t}async search(t,r){return await this.execute({search:t,...r})}async retrieve(t,r){const i=Rt(t),{variant:n}=i;let{normalized:s}=i;return n==="keys"&&s.indexOf(0)!==-1&&(s=s.filter(a=>a!==0)),s.length===0?[]:await this.execute({[n]:s,...r})}async page(t,r,i){return await this.execute({offset:t,limit:r,...i})}async execute(t){const[r,i]=await this.client.send(MO.ENDPOINT,t,DL,CL);if(i!=null)throw i;return r.channels}};h(LO,"ENDPOINT","/channel/retrieve");let Bh=LO;class Fh{constructor(t){h(this,"cache"),h(this,"namesToKeys"),h(this,"wrapped"),this.cache=new Map,this.namesToKeys=new Map,this.wrapped=t}async search(t,r){return await this.wrapped.search(t,r)}async page(t,r,i){return await this.wrapped.page(t,r,i)}async retrieve(t,r){const{normalized:i}=Rt(t),n=[],s=[];if(i.forEach(o=>{const u=this.get(o);u!=null?n.push(...u):s.push(o)}),s.length===0)return n;const a=await this.wrapped.retrieve(s,r);return this.set(a),n.concat(a)}delete(t){const{variant:r,normalized:i}=Rt(t);r==="names"?i.forEach(n=>{const s=this.namesToKeys.get(n);s!=null&&(s.forEach(a=>this.cache.delete(a)),this.namesToKeys.delete(n))}):i.forEach(n=>{const s=this.cache.get(n);s!=null&&(this.cache.delete(n),this.namesToKeys.delete(s.name))})}rename(t,r){t.forEach((i,n)=>{const s=r[n],a=this.cache.get(i);if(a==null)return;this.cache.delete(i);const o=this.namesToKeys.get(a.name);o!=null&&(o.delete(i),o.size===0&&this.namesToKeys.delete(a.name)),a.name=s,this.cache.set(i,a);const u=this.namesToKeys.get(s);u==null?this.namesToKeys.set(s,new Set([i])):u.add(i)})}set(t){t.forEach(r=>{this.cache.set(r.key,r);const i=this.namesToKeys.get(r.name);i==null?this.namesToKeys.set(r.name,new Set([r.key])):i.add(r.key)})}get(t){if(typeof t=="number"){const n=this.cache.get(t);return n==null?void 0:[n]}const r=this.namesToKeys.get(t);if(r==null)return;const i=[];if(r.forEach(n=>{const s=this.cache.get(n);s!=null&&i.push(s)}),i.length!==0)return i}}class BO{constructor(t,r){h(this,"mu",new ZL),h(this,"requests",new Map),h(this,"wrapped"),h(this,"debouncedRun"),this.wrapped=t,this.debouncedRun=wN(()=>{this.run()},r)}async search(t,r){return await this.wrapped.search(t,r)}async page(t,r,i){return await this.wrapped.page(t,r,i)}async retrieve(t){const{normalized:r,variant:i}=Rt(t);return i==="names"?await this.wrapped.retrieve(r):await new Promise((n,s)=>{this.mu.runExclusive(()=>{this.requests.set(r,{resolve:n,reject:s}),this.debouncedRun()})})}async run(){await this.mu.runExclusive(async()=>{const t=new Set;this.requests.forEach((r,i)=>i.forEach(n=>t.add(n)));try{const r=await this.wrapped.retrieve(Array.from(t));this.requests.forEach((i,n)=>i.resolve(r.filter(s=>n.includes(s.key))))}catch(r){this.requests.forEach(i=>i.reject(r))}finally{this.requests.clear()}})}}const FO=async(e,t)=>{const{normalized:r}=Rt(t),i=await e.retrieve(r),n=[];if(r.forEach(s=>{i.find(a=>a.name===s||a.key===s)==null&&n.push(s)}),n.length>0)throw new Yt(`Could not find channels: ${JSON.stringify(n)}`);return i};class JO{constructor({dataType:t,name:r,leaseholder:i=0,key:n=0,isIndex:s=!1,index:a=0,internal:o=!1,virtual:u=!1,frameClient:c,alias:l,expression:d="",requires:m=[]}){h(this,"_frameClient"),h(this,"key"),h(this,"name"),h(this,"dataType"),h(this,"leaseholder"),h(this,"index"),h(this,"isIndex"),h(this,"internal"),h(this,"alias"),h(this,"virtual"),h(this,"expression"),h(this,"requires"),this.key=n,this.name=r,this.dataType=new ce(t),this.leaseholder=i,this.index=a,this.isIndex=s,this.internal=o,this.alias=l,this.virtual=u,this.expression=d,this.requires=m??[],this._frameClient=c??null}get framer(){if(this._frameClient==null)throw new Ae("cannot read from a channel that has not been created");return this._frameClient}get payload(){return qi.parse({key:this.key,name:this.name,dataType:this.dataType.valueOf(),leaseholder:this.leaseholder,index:this.index,isIndex:this.isIndex,internal:this.internal,virtual:this.virtual,expression:this.expression,requires:this.requires})}get isCalculated(){return ia(this.payload)}get ontologyID(){return qO(this.key)}async read(t){return await this.framer.read(t,this.key)}async write(t,r){return await this.framer.write(t,this.key,r)}}const RL="sy_calculation_state",LL="/channel/retrieve-group",ML=b({}),BL=b({group:bO});let VO=class{constructor(e,t,r,i){h(this,"type",Ka),h(this,"frameClient"),h(this,"client"),h(this,"retriever"),h(this,"writer"),this.frameClient=e,this.retriever=t,this.client=r,this.writer=i}async create(e,t={}){const{retrieveIfNameExists:r=!1}=t,i=!Array.isArray(e);let n=D.toArray(e),s=[];if(r){const a=await this.retriever.retrieve(n.map(u=>u.name)),o=new Set(a.map(u=>u.name));n=n.filter(u=>!o.has(u.name)),s=this.sugar(a)}return s=s.concat(this.sugar(await this.writer.create(n))),i?s[0]:s}async retrieve(e,t){const r=!Array.isArray(e),i=this.sugar(await this.retriever.retrieve(e,t));return ao("channel",e,i,r),r?i[0]:i}async search(e,t){return this.sugar(await this.retriever.search(e,t))}async delete(e){const{normalized:t,variant:r}=Rt(e);return r==="keys"?await this.writer.delete({keys:t}):await this.writer.delete({names:t})}async rename(e,t){return await this.writer.rename(D.toArray(e),D.toArray(t))}newSearcherWithOptions(e){return{type:this.type,search:async t=>await this.search(t,e),retrieve:async t=>await this.retrieve(t,e),page:async(t,r)=>await this.page(t,r,e)}}async page(e,t,r){return this.sugar(await this.retriever.page(e,t,r))}createDebouncedBatchRetriever(e=10){return new Fh(new BO(new Bh(this.client),e))}sugar(e){const{frameClient:t}=this;return e.map(r=>new JO({...r,frameClient:t}))}async retrieveGroup(){const e=await j(this.client,LL,{},ML,BL);return new CO(e.group.name,e.group.key)}};const ia=({virtual:e,expression:t})=>e&&t!=="",WO=async(e,t)=>{if(!ia(t))return t.index;for(const r of t.requires){const i=await e(r);if(i==null)return null;if(!i.virtual)return i.index}for(const r of t.requires){const i=await e(r);if(i==null)return null;if(ia(i)){const n=await WO(e,i);if(n!=null)return n}}return null},qO=e=>new se({type:Ka,key:e.toString()}),FL=b({channels:$O.array()}),JL=b({channels:qi.array()}),VL=b({keys:Ye.array().optional(),names:Wi.array().optional()}),WL=b({}),qL=b({keys:Ye.array(),names:Wi.array()}),GL=b({}),YL="/channel/create",KL="/channel/delete",XL="/channel/rename";let GO=class{constructor(e,t){h(this,"client"),h(this,"cache"),this.client=e,this.cache=t}async create(e){const{channels:t}=await j(this.client,YL,{channels:e.map(r=>({...r,dataType:r.dataType}))},FL,JL);return this.cache.set(t),t}async delete(e){await j(this.client,KL,e,VL,WL),e.keys!=null&&this.cache.delete(e.keys),e.names!=null&&this.cache.delete(e.names)}async rename(e,t){await j(this.client,XL,{keys:e,names:t},qL,GL),this.cache.rename(e,t)}};const HL=Object.freeze(Object.defineProperty({__proto__:null,CALCULATION_STATE_CHANNEL_NAME:RL,CacheRetriever:Fh,Channel:JO,Client:VO,ClusterRetriever:Bh,DebouncedBatchRetriever:BO,ONTOLOGY_TYPE:Ka,Writer:GO,analyzeParams:Rt,calculationStateZ:j2,channelZ:qi,isCalculated:ia,keyZ:Ye,nameZ:Wi,newZ:$O,ontologyID:qO,resolveCalculatedIndex:WO,retrieveRequired:FO},Symbol.toStringTag,{value:"Module"})),QL=b({keys:Ur.array().optional(),usernames:O().array().optional()}),eM=b({users:at(no)}),tM="/user/retrieve";let nM=class{constructor(e){h(this,"client"),this.client=e}async retrieve(e){return(await j(this.client,tM,e,QL,eM)).users}};const rM=b({users:D2.array()}),iM=b({users:no.array()}),sM=b({key:Ur,username:O().min(1)}),aM=b({}),oM=b({key:Ur,firstName:O().optional(),lastName:O().optional()}),uM=b({}),cM=b({keys:Ur.array()}),lM=b({}),dM="/user/create",hM="/user/change-username",mM="/user/rename",fM="/user/delete";let pM=class{constructor(e){h(this,"client"),this.client=e}async create(e){return(await j(this.client,dM,{users:D.toArray(e)},rM,iM)).users}async changeUsername(e,t){await j(this.client,hM,{key:e,username:t},sM,aM)}async rename(e,t,r){await j(this.client,mM,{key:e,firstName:t,lastName:r},oM,uM)}async delete(e){await j(this.client,fM,{keys:D.toArray(e)},cM,lM)}},vM=class{constructor(e){h(this,"reader"),h(this,"writer"),this.writer=new pM(e),this.reader=new nM(e)}async create(e){const t=Array.isArray(e),r=await this.writer.create(e);return t?r:r[0]}async changeUsername(e,t){await this.writer.changeUsername(e,t)}async retrieve(e){const t=Array.isArray(e),r=await this.reader.retrieve({keys:D.toArray(e)});if(t)return r;if(r.length===0)throw new Nn(`No user with key ${e} found`);if(r.length>1)throw new pr(`Multiple users found with key ${e}`);return r[0]}async retrieveByName(e){const t=Array.isArray(e),r=await this.reader.retrieve({usernames:D.toArray(e)});if(t)return r;if(r.length===0)throw new Nn(`No user with username ${e} found`);if(r.length>1)throw new pr(`Multiple users found with username ${e}`);return r[0]}async rename(e,t,r){await this.writer.rename(e,t,r)}async delete(e){await this.writer.delete(e)}};const gM=b({username:O(),password:O()}),yM=b({token:O(),user:no}),Wf="/auth/login",bM=3,wM="/auth/change-password",$M=b({username:O(),password:O(),newPassword:O().min(1)}),_M=b({}),kM=[Nu,Tu];let IM=class{constructor(e,t){h(this,"token"),h(this,"client"),h(this,"credentials"),h(this,"authenticating"),h(this,"authenticated"),h(this,"user"),h(this,"retryCount"),this.client=e,this.authenticated=!1,this.credentials=t,this.retryCount=0}async changePassword(e){if(!this.authenticated)throw new Error("Not authenticated");await j(this.client,wM,{username:this.credentials.username,password:this.credentials.password,newPassword:e},$M,_M),this.credentials.password=e}middleware(){const e=async(t,r)=>{if(!this.authenticated&&!t.target.endsWith(Wf)){this.authenticating??(this.authenticating=new Promise((a,o)=>{this.client.send(Wf,this.credentials,gM,yM).then(([u,c])=>{if(c!=null)return a(c);this.token=u==null?void 0:u.token,this.user=u==null?void 0:u.user,this.authenticated=!0,a(null)}).catch(o)}));const s=await this.authenticating;if(s!=null)return[t,s]}t.params.Authorization=`Bearer ${this.token}`;const[i,n]=await r(t);return kM.some(s=>s.matches(n))&&this.retryCount<bM?(this.authenticated=!1,this.authenticating=void 0,this.retryCount+=1,e(t,r)):(this.retryCount=0,[i,n])};return e}};const OM=Ct(["disconnected","connecting","connected","failed"]),SM=b({status:OM,error:Sh(Error).optional(),message:O().optional(),clusterKey:O(),clientVersion:O(),clientServerCompatible:re(),nodeVersion:O().optional()}),zM=b({clusterKey:O(),nodeVersion:O().optional()}),YO={clusterKey:"",status:"disconnected",error:void 0,message:"Disconnected",clientServerCompatible:!1,clientVersion:"0.43.1"},qf=(e,t,r)=>{const i=r?"cluster":"client";return`Synnax cluster node version ${e!=null?`${e} `:""}is too ${r?"old":"new"} for client version ${t}.
135
+ This may cause compatibility issues. We recommend updating the ${i}. For more information, see
136
+ https://docs.synnaxlabs.com/reference/typescript-client/troubleshooting#old-${i}-version`},zs=class KO{constructor(t,r=F.seconds(30),i,n){h(this,"_state"),h(this,"pollFrequency",F.seconds(30)),h(this,"client"),h(this,"name"),h(this,"interval"),h(this,"clientVersion"),h(this,"onChangeHandlers",[]),h(this,"versionWarned",!1),this._state={...YO},this.client=t,this.pollFrequency=r,this.clientVersion=i,this.name=n,this.check(),this.startChecking()}stopChecking(){this.interval!=null&&clearInterval(this.interval)}async check(){var t;const r=this._state.status;try{const[i,n]=await this.client.send(KO.ENDPOINT,{},b({}),zM);if(n!=null)throw n;const s=i.nodeVersion,a=this.clientVersion,o=this.versionWarned;s==null?(this._state.clientServerCompatible=!1,o||(console.warn(qf(null,a,!0)),this.versionWarned=!0)):Um.versionsEqual(a,s,{checkMajor:!0,checkMinor:!0,checkPatch:!1})?this._state.clientServerCompatible=!0:(this._state.clientServerCompatible=!1,o||(console.warn(qf(s,a,Um.semVerNewer(a,s))),this.versionWarned=!0)),this._state.status="connected",this._state.message=`Connected to ${this.name??"cluster"}`,this._state.clusterKey=i.clusterKey,this._state.nodeVersion=i.nodeVersion,this._state.clientVersion=this.clientVersion}catch(i){this._state.status="failed",this._state.error=i,this._state.message=(t=this.state.error)==null?void 0:t.message}return this.onChangeHandlers.length>0&&r!==this._state.status&&this.onChangeHandlers.forEach(i=>i(this.state)),this.state}get state(){return{...this._state}}onChange(t){this.onChangeHandlers.push(t)}startChecking(){this.interval=setInterval(()=>{this.check()},this.pollFrequency.milliseconds)}};h(zs,"ENDPOINT","/connectivity/check"),h(zs,"DEFAULT",YO),h(zs,"connectionStateZ",SM);let XO=zs;const xM=b({keys:Ye.array().optional(),bounds:Me.z,names:Wi.array().optional()}),NM=b({}),TM="/frame/delete";class UM{constructor(t){h(this,"client"),this.client=t}async delete(t){await j(this.client,TM,t,xM,NM)}}var vr=(e=>(e[e.Open=0]="Open",e[e.Write=1]="Write",e[e.Commit=2]="Commit",e[e.SetAuthority=3]="SetAuthority",e))(vr||{}),gr=(e=>(e[e.PersistStream=1]="PersistStream",e[e.Persist=2]="Persist",e[e.Stream=3]="Stream",e))(gr||{});const EM=e=>{switch(e){case"persist":return 2;case"stream":return 3;case"persistStream":return 1;default:if(typeof e=="number"&&e in gr)return e;throw new Error(`invalid writer mode: ${e}`)}},jM=new F(-1);class Eu extends Xt.sub("writer_closed"){constructor(){super("WriterClosed")}}const AM=b({start:q.z.optional(),controlSubject:kn.subjectZ.optional(),keys:Ye.array().optional(),authorities:kn.authorityZ.array().optional(),mode:Ct(gr).optional(),errOnUnauthorized:re().optional(),enableAutoCommit:re().optional(),autoIndexPersistInterval:F.z.optional()}),PM=b({command:Ct(vr),config:AM.optional(),frame:Xa.optional(),buffer:Sh(Uint8Array).optional()}),ZM=b({command:Ct(vr),end:q.z,err:ur.payloadZ.optional()});var Lr;let HO=(Lr=class{constructor(e,t){h(this,"stream"),h(this,"adapter"),h(this,"closeErr",null),this.stream=e,this.adapter=t}static async _open(e,t,{channels:r,start:i=q.now(),authorities:n=kn.ABSOLUTE_AUTHORITY,controlSubject:s,mode:a=1,errOnUnauthorized:o=!1,enableAutoCommit:u=!1,autoIndexPersistInterval:c=F.SECOND,useExperimentalCodec:l=!0}){const d=await Vh.open(e,r);l&&(t=t.withCodec(new BM(d.codec)));const m=await t.stream(Lr.ENDPOINT,PM,ZM),y=new Lr(m,d);return await y.execute({command:0,config:{start:new q(i),keys:d.keys,controlSubject:s,authorities:D.toArray(n),mode:EM(a),errOnUnauthorized:o,enableAutoCommit:u,autoIndexPersistInterval:c}}),y}async write(e,t){if(this.closeErr!=null)throw this.closeErr;if(this.stream.received())return await this.close();const r=await this.adapter.adapt(e,t);this.stream.send({command:1,frame:r.toPayload()})}async setAuthority(e,t){if(this.closeErr!=null)throw this.closeErr;let r;if(typeof e=="number"&&t==null)r={keys:[],authorities:[e]};else{let i;typeof e=="string"||typeof e=="number"?i={[e]:t}:i=e,i=await this.adapter.adaptObjectKeys(i),r={keys:Object.keys(i).map(n=>Number(n)),authorities:Object.values(i)}}await this.execute({command:3,config:r})}async commit(){if(this.closeErr!=null)throw this.closeErr;return this.stream.received()?(await this.closeInternal(null),q.ZERO):(await this.execute({command:2})).end}async close(){await this.closeInternal(null)}async closeInternal(e){if(this.closeErr!=null)throw this.closeErr;for(this.closeErr=e,this.stream.closeSend();;){if(this.closeErr!=null){if(Eu.matches(this.closeErr))return null;throw this.closeErr}const[t,r]=await this.stream.receive();r!=null?this.closeErr=Ut.matches(r)?new Eu:r:this.closeErr=ur.decode(t==null?void 0:t.err)}}async execute(e){const t=this.stream.send(e);for(t!=null&&await this.closeInternal(t);;){const[r,i]=await this.stream.receive();i!=null&&await this.closeInternal(i);const n=ur.decode(r==null?void 0:r.err);if(n!=null&&await this.closeInternal(n),(r==null?void 0:r.command)==e.command)return r}}},h(Lr,"ENDPOINT","/frame/write"),Lr);const Gf=e=>e.data.byteLength/e.dataType.density.valueOf(),DM=e=>{const{keys:t,series:r}=e;t.forEach((i,n)=>{r[n].key=i}),r.sort((i,n)=>i.key-n.key),t.sort((i,n)=>i-n),r.forEach(i=>delete i.key)},Yf=5,Kf=4,Xf=3,Hf=2,Qf=1,ep=0,Et=ce.TIMESTAMP.density.valueOf(),nn=8,rn=4,Oo=4,So=4,CM=1;class QO{constructor(t=[],r=[]){h(this,"contentType","application/sy-framer"),h(this,"states",new Map),h(this,"currState"),h(this,"seqNum",0),(t.length>0||r.length>0)&&this.update(t,r)}update(t,r){this.seqNum++;const i={keys:t,keyDataTypes:new Map,hasVariableDataTypes:!1};t.forEach((n,s)=>{const a=r[s];i.keyDataTypes.set(n,a),a.isVariable&&(i.hasVariableDataTypes=!0)}),i.keys.sort(),this.states.set(this.seqNum,i),this.currState=i}throwIfNotUpdated(t){if(this.seqNum<1)throw new Ae(`
137
+ The codec has not been updated with a list of channels and data types.
138
+ Please call the update method before calling ${t}.
139
+ `)}encode(t,r=0){var i,n;this.throwIfNotUpdated("encode");let s=t;t!=null&&typeof t=="object"&&"toPayload"in t&&(s=t.toPayload()),DM(s);let a=-1,o,u,c,l=r+CM+So,d=!((i=this.currState)!=null&&i.hasVariableDataTypes),m=!0,y=!0,k=!0,v=!0,f=!0;s.keys.length!==((n=this.currState)==null?void 0:n.keys.length)&&(k=!1,l+=s.keys.length*Oo),s.series.forEach((x,C)=>{var ne,ke,gt,Hi,Qi;const nm=Gf(x),co=s.keys[C],lo=(ne=this.currState)==null?void 0:ne.keyDataTypes.get(co);if(lo==null)throw new Ae(`Channel ${co} was not provided in the list of channels when opening the writer`);if(!lo.equals(x.dataType))throw new Ae(`Series data type of ${x.dataType.toString()} does not match the data type of ${lo.toString()} for channel ${co}`);if(l+=x.data.byteLength,a===-1){a=nm,o=(ke=x.timeRange)==null?void 0:ke.start,u=(gt=x.timeRange)==null?void 0:gt.end,c=BigInt(x.alignment??0n);return}a!==nm&&(d=!1),((o==null?void 0:o.valueOf())!==((Hi=x.timeRange)==null?void 0:Hi.start.valueOf())||(u==null?void 0:u.valueOf())!==((Qi=x.timeRange)==null?void 0:Qi.end.valueOf()))&&(m=!1),c!==BigInt(x.alignment??0)&&(v=!1)}),y=m&&o==null&&u==null,f=v&&(c===void 0||c===0n),d?l+=rn:l+=s.keys.length*rn,y||(m?l+=Et*2:l+=s.keys.length*Et*2),f||(v?l+=nn:l+=s.keys.length*nn);const p=new Uint8Array(l),g=new DataView(p.buffer);let w=r;return p[w]=Number(f)<<Yf|Number(v)<<Kf|Number(d)<<Xf|Number(m)<<Hf|Number(y)<<Qf|Number(k)<<ep,w++,g.setUint32(w,this.seqNum,!0),w+=So,d&&(g.setUint32(w,a,!0),w+=rn),m&&!y&&(g.setBigUint64(w,(o==null?void 0:o.valueOf())??0n,!0),g.setBigUint64(w,(u==null?void 0:u.valueOf())??0n,!0),w+=Et*2),v&&!f&&(g.setBigUint64(w,c??0n,!0),w+=nn),s.series.forEach((x,C)=>{var ne,ke;if(k||(g.setUint32(w,s.keys[C],!0),w+=Oo),!d){let gt=x.data.byteLength;x.dataType.isVariable||(gt=Gf(x)),g.setUint32(w,gt,!0),w+=rn}p.set(new Uint8Array(x.data),w),w+=x.data.byteLength,!m&&!y&&(g.setBigUint64(w,((ne=x.timeRange)==null?void 0:ne.start.valueOf())??0n,!0),g.setBigUint64(w,((ke=x.timeRange)==null?void 0:ke.end.valueOf())??0n,!0),w+=Et*2),!v&&!f&&(g.setBigUint64(w,x.alignment??0n,!0),w+=nn)}),p}decode(t,r=0){this.throwIfNotUpdated("decode");const i=t instanceof Uint8Array?t:new Uint8Array(t),n={keys:[],series:[]};let s=r,a=0,o=0,u,c,l;const d=new DataView(i.buffer,i.byteOffset,i.byteLength),m=!!(i[s]>>Yf&1),y=!!(i[s]>>Kf&1),k=!!(i[s]>>Xf&1),v=!!(i[s]>>Hf&1),f=!!(i[s]>>Qf&1),p=!!(i[s]>>ep&1);s++;const g=d.getUint32(s,!0);s+=So;const w=this.states.get(g);if(w==null)return n;if(k){if(s+rn>d.byteLength)return n;a=d.getUint32(s,!0),s+=rn}if(v&&!f){if(s+Et>d.byteLength)return n;u=new q(d.getBigUint64(s,!0)),s+=Et,c=new q(d.getBigUint64(s,!0)),s+=Et}if(y&&!m){if(s+nn>d.byteLength)return n;l=d.getBigUint64(s,!0),s+=nn}return p&&(n.keys=[...w.keys]),w.keys.forEach((x,C)=>{if(!p){if(s>=d.byteLength||d.getUint32(s,!0)!==x)return;s+=Oo,n.keys.push(x)}const ne=w.keyDataTypes.get(x);if(o=0,k)o=a;else{if(s+rn>d.byteLength)return;o=d.getUint32(s,!0),s+=rn}let ke=o;if(ne.isVariable||(ke*=ne.density.valueOf()),s+ke>d.byteLength){n.keys.splice(C,1);return}const gt={dataType:ne,data:i.slice(s,s+ke).buffer};if(s+=ke,!v&&!f){if(s+Et*2>d.byteLength)return;const Hi=d.getBigUint64(s,!0);s+=Et;const Qi=d.getBigUint64(s,!0);s+=Et,gt.timeRange=new Me({start:Hi,end:Qi})}else f?gt.timeRange=new Me({start:0n,end:0n}):gt.timeRange=new Me({start:(u==null?void 0:u.valueOf())??0n,end:(c==null?void 0:c.valueOf())??0n});if(!y&&!m){if(s+nn>d.byteLength)return;l=d.getBigUint64(s,!0),s+=nn,gt.alignment=l}else m?gt.alignment=0n:gt.alignment=l;n.series.push(gt)}),n}}const Jh=254,RM=new Uint8Array([Jh]),LM=255,MM=new Uint8Array([LM]),eS="application/sy-framer";class BM{constructor(t){h(this,"contentType",eS),h(this,"base"),h(this,"lowPerfCodec"),this.base=t,this.lowPerfCodec=Tn.JSON_CODEC}encode(t){var r,i;const n=t;if(n.type=="close"||((r=n.payload)==null?void 0:r.command)!=vr.Write){const a=this.lowPerfCodec.encode(n),o=new Uint8Array({length:a.byteLength+1});return o.set(RM,0),o.set(new Uint8Array(a),1),o}const s=this.base.encode((i=n.payload)==null?void 0:i.frame,1);return s.set(MM,0),s}decode(t,r){if(new DataView(t instanceof Uint8Array?t.buffer:t).getUint8(0)===Jh)return this.lowPerfCodec.decode(t.slice(1),r);const i={type:"data"},n=this.base.decode(t,1);return i.payload={command:vr.Write,frame:n},i}}class FM{constructor(t){h(this,"contentType",eS),h(this,"base"),h(this,"lowPerfCodec"),this.base=t,this.lowPerfCodec=Tn.JSON_CODEC}encode(t){return this.lowPerfCodec.encode(t)}decode(t,r){return new DataView(t instanceof Uint8Array?t.buffer:t).getUint8(0)===Jh?this.lowPerfCodec.decode(t.slice(1),r):{type:"data",payload:{frame:this.base.decode(t,1)}}}}class oo{constructor(t){h(this,"adapter"),h(this,"retriever"),h(this,"keys"),h(this,"codec"),this.retriever=t,this.adapter=null,this.keys=[],this.codec=new QO}static async open(t,r){const i=new oo(t);return await i.update(r),i}async update(t){const{variant:r,normalized:i}=Rt(t),n=await this.retriever.retrieve(i);if(this.codec.update(n.map(a=>a.key),n.map(a=>a.dataType)),r==="keys"){this.adapter=null,this.keys=i;return}const s=new Map;this.adapter=s,i.forEach(a=>{const o=n.find(u=>u.name===a);if(o==null)throw new Error(`Channel ${a} not found`);s.set(o.key,o.name)}),this.keys=Array.from(this.adapter.keys())}adapt(t){if(this.adapter==null)return t;const r=this.adapter;return t.map((i,n)=>{if(typeof i=="number"){const s=r.get(i);if(s==null)throw new Error(`Channel ${i} not found`);return[s,n]}return[i,n]})}}class Vh{constructor(t){h(this,"adapter"),h(this,"retriever"),h(this,"keys"),h(this,"codec"),this.retriever=t,this.adapter=null,this.keys=[],this.codec=new QO}static async open(t,r){const i=new Vh(t);return await i.update(r),i}async adaptObjectKeys(t){const r={};for(const[i,n]of Object.entries(t))r[await this.adaptToKey(i)]=n;return r}async update(t){const r=await FO(this.retriever,t);this.adapter=new Map(r.map(i=>[i.name,i.key])),this.keys=r.map(i=>i.key),this.codec.update(this.keys,r.map(i=>i.dataType))}async fetchChannel(t){const r=await this.retriever.retrieve(t);if(r.length===0)throw new Error(`Channel ${JSON.stringify(t)} not found`);return r[0]}async adaptToKey(t){return typeof t=="number"?t:(await this.fetchChannel(t)).key}encode(t){return this.codec.encode(t.toPayload())}async adapt(t,r){if(typeof t=="string"||typeof t=="number"){if(r==null)throw new Ae(`
140
+ Received a single channel name or key but no series.
141
+ `);if(Array.isArray(r)){if(r.some(u=>u instanceof un||Array.isArray(u)))throw new Ae(`
142
+ Received a single channel name or key but multiple series.
143
+ `);r=r}const a=await this.fetchChannel(t),o=new un({data:r,dataType:a.dataType});return new He(a.key,o)}if(Array.isArray(t)){if(r==null)throw new Ae(`
144
+ Received an array of channel names or keys but no series.
145
+ `);if(!Array.isArray(r))throw new Ae(`
146
+ Received an array of channel names or keys but no array of series.
147
+ `);const a=[],o=[];for(let u=0;u<t.length;u++){const c=await this.fetchChannel(t[u]);if(u>=r.length)throw new Ae(`
148
+ Received an array of channel names or keys but not enough series.
149
+ `);const l=new un({data:r[u],dataType:c.dataType});a.push(c.key),o.push(l)}return new He(a,o)}if(t instanceof He||t instanceof Map){const a=new He(t);if(this.adapter==null)return a;const o=a.columns.map(u=>{var c;const l=typeof u=="string"?(c=this.adapter)==null?void 0:c.get(u):u;if(l==null)throw new Ae(`
150
+ Channel ${u} was not provided in the list of channels when opening the writer
151
+ `);return l});return new He(o,a.series)}const i=[],n=[],s=Object.entries(t);for(let a=0;a<s.length;a++){const[o,u]=s[a],c=await this.fetchChannel(o),l=new un({data:u,dataType:c.dataType});i.push(c.key),n.push(l)}return new He(i,n)}}class tS{constructor(t,r){h(this,"name"),h(this,"stream"),this.stream=r,this.name=t}async receive(){const[t,r]=await this.stream.receive();if(r!=null)throw r;return t}received(){return this.stream.received()}async closeAndAck(){for(this.stream.closeSend();;){const[t,r]=await this.stream.receive();if(t!=null&&console.warn(`${this.name} received unexpected response on ${JSON.stringify(t)} closure.
152
+ Please report this error to the Synnax team.`),r!=null){if(Ut.matches(r))return;throw r}}}closeSend(){this.stream.closeSend()}send(t){const r=this.stream.send(t);if(r!=null)throw r}}const ju=new F(-1);var Wh=(e=>(e[e.Open=0]="Open",e[e.Next=1]="Next",e[e.Prev=2]="Prev",e[e.SeekFirst=3]="SeekFirst",e[e.SeekLast=4]="SeekLast",e[e.SeekLE=5]="SeekLE",e[e.SeekGE=6]="SeekGE",e[e.Valid=7]="Valid",e[e.Error=8]="Error",e))(Wh||{}),nS=(e=>(e[e.None=0]="None",e[e.Ack=1]="Ack",e[e.Data=2]="Data",e))(nS||{});const JM=b({command:Ct(Wh),span:F.z.optional(),bounds:Me.z.optional(),stamp:q.z.optional(),keys:Ye.array().optional(),chunkSize:le().optional()}),VM=b({variant:Ct(nS),ack:re(),command:Ct(Wh),error:ur.payloadZ.optional().nullable(),frame:Xa.optional()}),rS=class Au{constructor(t,r){h(this,"stream"),h(this,"adapter"),h(this,"value"),this.stream=new tS("Iterator",t),this.value=new He,this.adapter=r}static async _open(t,r,i,n,s={}){const a=await oo.open(i,r),o=await n.stream(Au.ENDPOINT,JM,VM),u=new Au(o,a);return await u.execute({command:0,keys:a.keys,bounds:new Me(t),chunkSize:s.chunkSize??1e5}),u}async next(t=ju){return await this.execute({command:1,span:new F(t)})}async prev(t=ju){return await this.execute({command:2,span:new F(t)})}async seekFirst(){return await this.execute({command:3})}async seekLast(){return await this.execute({command:4})}async seekLE(t){return await this.execute({command:5,stamp:new q(t)})}async seekGE(t){return await this.execute({command:6,stamp:new q(t)})}async valid(){return await this.execute({command:7})}async close(){await this.stream.closeAndAck()}[Symbol.asyncIterator](){return new WM(this)}async execute(t){for(this.stream.send(t),this.value=new He;;){const r=await this.stream.receive();if(r.variant===1)return r.ack;this.value.push(this.adapter.adapt(new He(r.frame)))}}};h(rS,"ENDPOINT","/frame/iterate");let iS=rS;class WM{constructor(t){h(this,"iter"),h(this,"open",!1),this.iter=t}async next(){try{let t=!0;return this.open||(await this.iter.seekFirst()||(t=!1),this.open=!0),await this.iter.next()||(t=!1),t||await this.iter.close(),{done:!t,value:this.iter.value}}catch(t){throw await this.iter.close(),t}}}const qM=b({keys:le().array(),downsampleFactor:le()}),GM=b({frame:Xa}),YM="/frame/stream",qh=e=>{if(Array.isArray(e))return typeof e[0]=="object"?{channels:e.map(r=>r.key),downsampleFactor:1}:{channels:e,downsampleFactor:1};const t=Tr.safeParse(e);return t.success?{channels:[t.data.key],downsampleFactor:1}:e},sS=(e,t)=>async r=>{const i=qh(r),n=await oo.open(e,i.channels);i.useExperimentalCodec&&(t=t.withCodec(new FM(n.codec)));const s=await t.stream(YM,qM,GM),a=new KM(s,n);s.send({keys:n.keys,downsampleFactor:i.downsampleFactor??1});const[,o]=await s.receive();if(o!=null)throw o;return a},aS=async(e,t,r)=>await sS(e,t)(r);class KM{constructor(t,r){h(this,"stream"),h(this,"adapter"),h(this,"downsampleFactor"),this.stream=new tS("Streamer",t),this.adapter=r,this.downsampleFactor=1}get keys(){return this.adapter.keys}async next(){try{return{done:!1,value:await this.read()}}catch(t){if(Ut.matches(t))return{done:!0,value:void 0};throw t}}async read(){return this.adapter.adapt(new He((await this.stream.receive()).frame))}async update(t){await this.adapter.update(t),this.stream.send({keys:this.adapter.keys,downsampleFactor:this.downsampleFactor})}close(){this.stream.closeSend()}[Symbol.asyncIterator](){return this}}class uo{constructor(t,r,i={}){h(this,"wrapped_",null),h(this,"breaker"),h(this,"opener"),h(this,"config"),this.opener=t,this.config=qh(r);const{maxRetries:n=5e3,baseInterval:s=F.seconds(1),scale:a=1}=i??{};this.breaker=new Mb.Breaker({maxRetries:n,baseInterval:s,scale:a})}static async open(t,r,i){const n=new uo(t,r,i);return await n.runStreamer(),n}async runStreamer(){for(;;)try{this.wrapped_!=null&&this.wrapped_.close(),this.wrapped_=await this.opener(this.config),this.breaker.reset();return}catch(t){if(this.wrapped_=null,!await this.breaker.wait())throw t;console.error("failed to open streamer",t);continue}}get wrapped(){if(this.wrapped_==null)throw new Error("stream closed");return this.wrapped_}async update(t){this.config.channels=t;try{await this.wrapped.update(t)}catch{return await this.runStreamer(),await this.update(t)}}async next(){try{return{done:!1,value:await this.read()}}catch(t){if(Ut.matches(t))return{done:!0,value:void 0};throw t}}async read(){try{const t=await this.wrapped.read();return this.breaker.reset(),t}catch(t){if(Ut.matches(t))throw t;return await this.runStreamer(),await this.read()}}close(){this.wrapped.close()}get keys(){return this.wrapped.keys}[Symbol.asyncIterator](){return this}}class Kt extends _n.Observer{constructor(t,r){super(r),h(this,"streamer"),h(this,"closePromise"),this.streamer=t,this.closePromise=this.stream()}async close(){this.streamer.close(),await this.closePromise}async stream(){for await(const t of this.streamer)this.notify(t)}}const XM=e=>new se({type:xh,key:e.toString()}),tp=e=>Array.isArray(e)||typeof e!="object"||typeof e=="object"&&"key"in e?{channels:e}:e;let oS=class{constructor(e,t,r){h(this,"streamClient"),h(this,"retriever"),h(this,"deleter"),this.streamClient=e,this.retriever=r,this.deleter=new UM(t)}async openIterator(e,t,r){return await iS._open(e,t,this.retriever,this.streamClient,r)}async openWriter(e){return await HO._open(this.retriever,this.streamClient,tp(e))}async openStreamer(e){return await aS(this.retriever,this.streamClient,tp(e))}async write(e,t,r){if(r==null){const n=t,s=await this.openWriter({start:e,channels:Object.keys(n),mode:gr.Persist,errOnUnauthorized:!0,enableAutoCommit:!0,autoIndexPersistInterval:F.MAX});return await s.write(n),await s.close()}const i=await this.openWriter({start:e,channels:t,mode:gr.Persist,errOnUnauthorized:!0,enableAutoCommit:!0,autoIndexPersistInterval:F.MAX});await i.write(t,r),await i.close()}async read(e,t){const{single:r}=Rt(t),i=await this.readFrame(e,t);return r?i.get(t):i}async readFrame(e,t){const r=await this.openIterator(e,t),i=new He;try{for await(const n of r)i.push(n)}finally{await r.close()}return i}async delete(e,t){const{normalized:r,variant:i}=Rt(e);return i==="keys"?await this.deleter.delete({keys:r,bounds:t}):await this.deleter.delete({names:r,bounds:t})}};const HM=Object.freeze(Object.defineProperty({__proto__:null,ALWAYS_INDEX_PERSIST_ON_AUTO_COMMIT:jM,AUTO_SPAN:ju,Client:oS,Frame:He,HardenedStreamer:uo,Iterator:iS,ONTOLOGY_TYPE:xh,ObservableStreamer:Kt,Writer:HO,WriterClosedError:Eu,WriterCommand:vr,WriterMode:gr,createStreamOpener:sS,frameZ:Xa,ontologyID:XM,openStreamer:aS,parseStreamerConfig:qh,seriesFromPayload:_O,seriesToPayload:kO},Symbol.toStringTag,{value:"Module"})),QM=kn.ABSOLUTE_AUTHORITY,eB=kn.ZERO_AUTHORITY,tB=kn.stateZ(le()),nB=e=>{var t,r;return e.to==null?`${(t=e.from)==null?void 0:t.resource} - ${(r=e.from)==null?void 0:r.subject.name} -> released`:e.from==null?`${e.to.resource} - released -> ${e.to.subject.name} (${e.to.authority.toString()})`:`${e.to.resource} - ${e.from.subject.name} -> ${e.to.subject.name} (${e.to.authority.toString()})`},rB=b({transfers:xr(kn.transferZ(Ye))});class uS extends Kt{constructor(t){super(t,r=>{const i=this.codec.decode(r.series[0].buffer,rB);return this.merge(i),[i.transfers,!0]}),h(this,"states"),h(this,"codec"),this.states=new Map,this.codec=new Tn.JSONCodec}subjects(){const t=new Map;return this.states.forEach(r=>t.set(r.subject.key,r.subject)),Array.from(t.values())}merge(t){t.transfers.forEach(r=>{r.from==null&&r.to==null&&console.warn("Invalid transfer: ",r),r.to==null?this.states.delete(r.from.resource):this.states.set(r.to.resource,r.to)})}}const iB="sy_node_1_control";let cS=class{constructor(e){h(this,"framer"),this.framer=e}async openStateTracker(){const e=await uo.open(async t=>await this.framer.openStreamer(t),iB);return new uS(e)}};const sB=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:QM,Client:cS,StateTracker:uS,ZERO_AUTHORITY:eB,stateZ:tB,transferString:nB},Symbol.toStringTag,{value:"Module"}));let aB=class{constructor(e,t,r){h(this,"tasks"),h(this,"racks"),h(this,"devices"),this.tasks=e,this.racks=t,this.devices=r}};const jr=async(e,t,r,i)=>{const n=await e.openStreamer([t,r]),s=a=>{const o=[];return r!=null&&o.push(...a.get(r).series.flatMap(u=>i("delete",u))),t!=null&&o.push(...a.get(t).series.flatMap(u=>i("set",u))),[o,o.length>0]};return new Kt(n,s)},oB="sy_device_set",uB="sy_device_delete",np="sy_device_state",zo="/hardware/device/retrieve",cB="/hardware/device/create",lB="/hardware/device/delete",dB=b({devices:P2.array()}),hB=b({devices:Qa.array()}),mB=b({keys:Ha.array()}),fB=b({}),xo=b({keys:Ha.array().optional(),names:O().array().optional(),makes:O().array().optional(),models:O().array().optional(),locations:O().array().optional(),racks:Rn.array().optional(),search:O().optional(),limit:le().optional(),offset:le().optional(),ignoreNotFound:re().optional(),includeState:re().optional()}),No=b({devices:at(Qa)});let pB=class{constructor(e,t){h(this,"type",zO),h(this,"client"),h(this,"frameClient"),this.client=e,this.frameClient=t}async retrieve(e,t){const r=!Array.isArray(e),i=await j(this.client,zo,{keys:D.toArray(e),...t},xo,No);return ao("Device",e,i.devices,r),r?i.devices[0]:i.devices}async search(e,t){return(await j(this.client,zo,{search:e,...t},xo,No)).devices}async page(e,t,r){return(await j(this.client,zo,{offset:e,limit:t,...r},xo,No)).devices}async create(e){const t=!Array.isArray(e),r=await j(this.client,cB,{devices:D.toArray(e)},dB,hB);return t?r.devices[0]:r.devices}async delete(e){await j(this.client,lB,{keys:D.toArray(e)},mB,fB)}async openDeviceTracker(){return await jr(this.frameClient,oB,uB,vB)}async openStateObserver(){return new Kt(await this.frameClient.openStreamer(np),e=>{const t=e.get(np);return t.length===0?[null,!1]:[t.parseJSON(SO),!0]})}newSearcherWithOptions(e){return{type:this.type,search:async t=>await this.search(t,e),retrieve:async t=>await this.retrieve(t,e),page:async(t,r)=>await this.page(t,r,e)}}};const vB=(e,t)=>e==="delete"?t.toStrings().map(r=>({variant:e,key:r,value:void 0})):t.parseJSON(Qa).map(r=>({variant:e,key:r.key,value:r})),To="/hardware/rack/retrieve",gB="/hardware/rack/create",yB="/hardware/rack/delete",rp="sy_rack_state",Uo=b({keys:Rn.array().optional(),names:O().array().optional(),search:O().optional(),embedded:re().optional(),hostIsNode:re().optional(),limit:le().optional(),offset:le().optional(),includeState:re().optional()}),Eo=b({racks:at(Nh)}),bB=b({racks:A2.array()}),wB=b({racks:Nh.array()}),$B=b({keys:Rn.array()}),_B=b({});let kB=class{constructor(e,t,r){h(this,"type",OO),h(this,"client"),h(this,"tasks"),h(this,"frameClient"),this.client=e,this.tasks=t,this.frameClient=r}async delete(e){await j(this.client,yB,{keys:D.toArray(e)},$B,_B)}async create(e){const t=!Array.isArray(e),r=await j(this.client,gB,{racks:D.toArray(e)},bB,wB),i=this.sugar(r.racks);return t?i[0]:i}async search(e){const t=await j(this.client,To,{search:e},Uo,Eo);return this.sugar(t.racks)}async page(e,t){const r=await j(this.client,To,{offset:e,limit:t},Uo,Eo);return this.sugar(r.racks)}async retrieve(e,t){const{variant:r,normalized:i,single:n}=Mh(e,{string:"names",number:"keys"}),s=await j(this.client,To,{[r]:i,includeState:t==null?void 0:t.includeState},Uo,Eo),a=this.sugar(s.racks);return ao("Rack",e,a,n),n?a[0]:a}async openStateObserver(){return new Kt(await this.frameClient.openStreamer(rp),e=>{const t=e.get(rp);return t.length===0?[[],!1]:[t.parseJSON(IO),!0]})}sugar(e){return e.map(({key:t,name:r,state:i})=>new IB(t,r,this.tasks,i))}};class IB{constructor(t,r,i,n){h(this,"key"),h(this,"name"),h(this,"state"),h(this,"tasks"),this.key=t,this.name=r,this.tasks=i,this.state=n}async listTasks(){return await this.tasks.retrieve(this.key)}async retrieveTaskByName(t){return await this.tasks.retrieveByName(t,this.key)}async retrieveTaskByType(t){return await this.tasks.retrieveByType(t,this.key)}async createTask(t){return t.key=((BigInt(this.key)<<32n)+(BigInt(t.key??0)&0xffffffffn)).toString(),await this.tasks.create(t)}async deleteTask(t){await this.tasks.delete([t])}}const ui="sy_task_state",Kn="sy_task_cmd",OB="sy_task_set",SB="sy_task_delete",Yn=new Error("Task not created"),lS=async(e,t)=>{const r=await t.retrieveParents(e);return r.length===0?null:r[0]};class zB{constructor(t,r,i,n,s=!1,a=!1,o,u=null,c=null,l=null){h(this,"key"),h(this,"name"),h(this,"internal"),h(this,"type"),h(this,"config"),h(this,"snapshot"),h(this,"state"),h(this,"frameClient"),h(this,"ontologyClient"),h(this,"rangeClient"),this.key=t,this.name=r,this.type=i,this.config=n,this.internal=s,this.snapshot=a,o!==null&&(this.state=o),this.frameClient=u,this.ontologyClient=c,this.rangeClient=l}get payload(){return{key:this.key,name:this.name,type:this.type,config:this.config,state:this.state,internal:this.internal}}get ontologyID(){return MB(this.key)}async executeCommand(t,r){if(this.frameClient==null)throw Yn;const i=await this.frameClient.openWriter(Kn),n=nN.create();return await i.write(Kn,[{task:this.key,type:t,key:n,args:r}]),await i.close(),n}async executeCommandSync(t,r,i){if(this.frameClient==null)throw Yn;const n=await this.frameClient.openStreamer(ui),s=await this.executeCommand(t,r);let a;const o=new Promise(u=>setTimeout(()=>u(!1),new F(i).milliseconds));for(;;){const u=await Promise.any([n.read(),o]);if(u===!1)throw new Error("Command timed out");const c=ra.safeParse(u.at(-1).sy_task_state);if(c.success){if(a=c.data,a.key===s)break}else throw c.error}return n.close(),a}async openStateObserver(){if(this.frameClient==null)throw Yn;return new Kt(await this.frameClient.openStreamer(ui),t=>{const r=t.get(ui);if(r.length===0)return[null,!1];const i=ra.safeParse(r.at(-1));if(!i.success)return console.error(i.error),[null,!1];const n=i.data;return n.task!==this.key?[null,!1]:[n,!0]})}async openCommandObserver(){if(this.frameClient==null)throw Yn;return new Kt(await this.frameClient.openStreamer(Kn),t=>{const r=t.get(Kn);if(r.length===0)return[null,!1];const i=xO.safeParse(r.at(-1));if(!i.success)return console.error(i.error),[null,!1];const n=i.data;return n.task!==this.key?[null,!1]:[n,!0]})}async snapshottedTo(){if(this.ontologyClient==null||this.rangeClient==null)throw Yn;return this.snapshot?await lS(this.key,this.ontologyClient):null}}const xB=b({rack:Rn.optional(),keys:Ln.array().optional(),names:O().array().optional(),types:O().array().optional(),includeState:re().optional(),offset:le().optional(),limit:le().optional()}),NB=b({tasks:at(eo)}),TB="/hardware/task/retrieve",UB="/hardware/task/create",EB="/hardware/task/delete",jB="/hardware/task/copy",AB=b({tasks:Z2.array()}),PB=b({tasks:eo.array()}),ZB=b({keys:Ln.array()}),DB=b({}),CB=b({key:Ln,name:O(),snapshot:re()}),RB=b({task:eo});let LB=class{constructor(e,t,r,i){h(this,"type",Uh),h(this,"client"),h(this,"frameClient"),h(this,"ontologyClient"),h(this,"rangeClient"),this.client=e,this.frameClient=t,this.ontologyClient=r,this.rangeClient=i}async create(e){const t=!Array.isArray(e),r=await j(this.client,UB,{tasks:D.toArray(e)},AB,PB),i=this.sugar(r.tasks);return t?i[0]:i}async delete(e){await j(this.client,EB,{keys:D.toArray(e)},ZB,DB)}async search(e){return await this.execRetrieve({keys:[e]})}async page(e,t){return await this.execRetrieve({offset:e,limit:t})}async list(e={}){return this.sugar(await this.execRetrieve(e))}async retrieve(e,t){const{single:r,normalized:i,variant:n}=Mh(e,{number:"rack",string:"keys"},{convertNumericStrings:!1}),s={...t};n==="rack"?s.rack=e:s.keys=i;const a=await this.execRetrieve(s),o=this.sugar(a);return r&&n!=="rack"?o[0]:o}async copy(e,t,r){const i=await j(this.client,jB,{key:e,name:t,snapshot:r},CB,RB);return this.sugar([i.task])[0]}async retrieveByName(e,t){const r=await this.execRetrieve({names:[e],rack:t});return ao("Task",e,r,!0),this.sugar(r)[0]}async retrieveByType(e,t){const r=await this.execRetrieve({types:[e],rack:t});return this.sugar(r)}async retrieveSnapshottedTo(e){if(this.ontologyClient==null)throw Yn;return await lS(e,this.ontologyClient)}async execRetrieve(e){return(await j(this.client,TB,e,xB,NB)).tasks}sugar(e){const t=!Array.isArray(e),r=D.toArray(e).map(({key:i,name:n,type:s,config:a,state:o,internal:u,snapshot:c})=>new zB(i,n,s,a,u,c,o,this.frameClient,this.ontologyClient,this.rangeClient));return t?r[0]:r}async openTracker(){return await jr(this.frameClient,OB,SB,(e,t)=>Array.from(t).map(r=>({variant:e,key:r.toString(),value:r.toString()})))}async openStateObserver(){return new Kt(await this.frameClient.openStreamer(ui),e=>{const t=e.get(ui);if(t.length===0)return[null,!1];const r=ra.safeParse(t.at(-1));return r.success?[r.data,!0]:(console.error(r.error),[null,!1])})}async openCommandObserver(){return new Kt(await this.frameClient.openStreamer(Kn),e=>{const t=e.get(Kn);if(t.length===0)return[null,!1];const r=xO.safeParse(t.at(-1));return r.success?[r.data,!0]:(console.error(r.error),[null,!1])})}};const MB=e=>new se({type:Uh,key:e}),BB=b({keys:Nr.array().optional(),for:pt.optional(),search:O().optional(),offset:le().optional(),limit:le().optional()}),FB=b({labels:at(to)}),dS=class hS{constructor(t){h(this,"client"),this.client=t}async retrieve(t){return await this.execute({keys:D.toArray(t)})}async retrieveFor(t){return await this.execute({for:t})}async search(t){return await this.execute({search:t})}async page(t,r){return await this.execute({offset:t,limit:r})}async execute(t){const[r,i]=await this.client.send(hS.ENDPOINT,t,BB,FB);if(i!=null)throw i;return r.labels}};h(dS,"ENDPOINT","/label/retrieve");let JB=dS;const VB=to.extend({key:Nr.optional()}),WB=b({labels:VB.array()}),qB=b({labels:to.array()}),GB=b({keys:Nr.array()}),mS=b({id:pt,labels:Nr.array(),replace:re().optional()}),YB=mS.omit({replace:!0}),jo=b({}),KB="/label/create",XB="/label/delete",HB="/label/set",QB="/label/remove";let eF=class{constructor(e){h(this,"client"),this.client=e}async create(e){return(await j(this.client,KB,{labels:D.toArray(e)},WB,qB)).labels}async delete(e){await j(this.client,XB,{keys:D.toArray(e)},GB,jo)}async set(e,t,{replace:r}={}){await j(this.client,HB,{id:e,labels:t,replace:r},mS,jo)}async remove(e,t){await j(this.client,QB,{id:e,labels:t},YB,jo)}};const tF="sy_label_set",nF="sy_label_delete";let rF=class{constructor(e,t,r){h(this,"type","label"),h(this,"retriever"),h(this,"writer"),h(this,"frameClient"),h(this,"ontology"),this.writer=new eF(e),this.retriever=new JB(e),this.frameClient=t,this.ontology=r}async search(e){return await this.retriever.search(e)}async retrieve(e){const t=Array.isArray(e),r=await this.retriever.retrieve(e);return t?r:r[0]}async retrieveFor(e){return await this.retriever.retrieveFor(new se(e))}async label(e,t,r={}){await this.writer.set(new se(e),t,r)}async removeLabels(e,t){await this.writer.remove(new se(e),t)}async page(e,t){return await this.retriever.page(e,t)}async create(e){const t=Array.isArray(e),r=await this.writer.create(e);return t?r:r[0]}async delete(e){await this.writer.delete(e)}async openChangeTracker(){return await jr(this.frameClient,tF,nF,iF)}async trackLabelsOf(e){const t=new _n.Observer,r=(await this.retrieveFor(e)).map(i=>({id:sF(i.key),key:i.key,name:i.name,data:i}));return(await this.ontology.openDependentTracker({target:new se(e),dependents:r,relationshipType:"labeled_by"})).onChange(i=>t.notify(i.map(n=>{var s,a;return{key:n.id.key,color:(s=n.data)==null?void 0:s.color,name:(a=n.data)==null?void 0:a.name}}))),t}};const iF=(e,t)=>e==="delete"?t.toUUIDs().map(r=>({variant:e,key:r})):t.parseJSON(to).map(r=>({variant:e,key:r.key,value:r})),sF=e=>new se({type:NO,key:e}),aF="sy_range_alias_set",oF="sy_range_alias_delete",uF=b({range:ft,aliases:O().array()}),cF=b({aliases:Ga(O(),Ye)}),lF=b({range:ft,aliases:Ga(Ye.or(O()),O())}),dF=Dt(),hF=b({range:ft,channels:Ye.array()}),mF=Dt(),fF=b({range:ft}),pF=b({aliases:Ga(O(),O())}),ti=class ni{constructor(t,r,i){h(this,"frameClient"),h(this,"cache",new Map),h(this,"client"),h(this,"rangeKey"),this.rangeKey=t,this.cache=new Map,this.client=i,this.frameClient=r}async resolve(t){const r=[],i=typeof t=="string",n={};if(i){const a=this.cache.get(t);if(a!=null)return a;r.push(t)}else t.forEach(a=>{const o=this.cache.get(a);o!=null?n[a]=o:r.push(a)});if(r.length===0)return n;const s=await j(this.client,ni.RESOLVE_ENDPOINT,{range:this.rangeKey,aliases:r},uF,cF);return Object.entries(s.aliases).forEach(([a,o])=>this.cache.set(a,o)),i?s.aliases[r[0]]:{...n,...s.aliases}}async set(t){await j(this.client,ni.SET_ENDPOINT,{range:this.rangeKey,aliases:t},lF,dF)}async list(){return(await j(this.client,ni.LIST_ENDPOINT,{range:this.rangeKey},fF,pF)).aliases}async delete(t){await j(this.client,ni.DELETE_ENDPOINT,{range:this.rangeKey,channels:t},hF,mF)}async openChangeTracker(){return await jr(this.frameClient,aF,oF,bF(this.rangeKey))}};h(ti,"SET_ENDPOINT","/range/alias/set"),h(ti,"RESOLVE_ENDPOINT","/range/alias/resolve"),h(ti,"LIST_ENDPOINT","/range/alias/list"),h(ti,"DELETE_ENDPOINT","/range/alias/delete");let vF=ti;const gF=b({range:ft,channel:Ye,alias:O()}),yF="---",bF=e=>(t,r)=>t==="delete"?r.toStrings().filter(i=>i.split(yF)[0]===e).map(i=>({variant:t,key:i,value:void 0})):r.parseJSON(gF).map(i=>({variant:t,key:i.alias,value:i})),Gh=b({range:ft,key:O(),value:O()}),wF=b({range:ft,keys:O().array()}),$F=b({pairs:at(Gh)}),_F=b({range:ft,pairs:Gh.array()}),kF=b({range:ft,keys:O().array()}),xs=class Ns{constructor(t,r,i){h(this,"rangeKey"),h(this,"client"),h(this,"frameClient"),this.rangeKey=t,this.client=r,this.frameClient=i}async get(t){const r=await j(this.client,Ns.GET_ENDPOINT,{range:this.rangeKey,keys:D.toArray(t)},wF,$F);return typeof t=="string"?r.pairs[0].value:Object.fromEntries(r.pairs.map(i=>[i.key,i.value]))}async list(){return this.get([])}async set(t,r=""){let i;dp(t)?i=Object.entries(t).map(([n,s])=>({range:this.rangeKey,key:n,value:s})):i=[{range:this.rangeKey,key:t,value:r}],await j(this.client,Ns.SET_ENDPOINT,{range:this.rangeKey,pairs:i},_F,Dt())}async delete(t){await j(this.client,Ns.DELETE_ENDPOINT,{range:this.rangeKey,keys:D.toArray(t)},kF,Dt())}async openTracker(){return await jr(this.frameClient,"sy_range_kv_set","sy_range_kv_delete",(t,r)=>t==="delete"?r.toStrings().map(i=>{const[n,s]=i.split("<--->",2);return{variant:t,key:i,value:{range:n,key:s,value:""}}}):r.parseJSON(Gh).map(i=>({variant:t,key:`${i.range}${i.key}`,value:i})))}};h(xs,"GET_ENDPOINT","/range/kv/get"),h(xs,"SET_ENDPOINT","/range/kv/set"),h(xs,"DELETE_ENDPOINT","/range/kv/delete");let Pu=xs;class fS{constructor(t,r=Me.ZERO,i,n,s,a,o,u,c,l,d){h(this,"key"),h(this,"name"),h(this,"kv"),h(this,"timeRange"),h(this,"color"),h(this,"channels"),h(this,"aliaser"),h(this,"frameClient"),h(this,"labelClient"),h(this,"ontologyClient"),h(this,"rangeClient"),this.key=i,this.name=t,this.timeRange=r,this.frameClient=s,this.color=n,this.kv=a,this.aliaser=o,this.channels=u,this.labelClient=c,this.ontologyClient=l,this.rangeClient=d}get ontologyID(){return sn(this.key)}get payload(){return{key:this.key,name:this.name,timeRange:this.timeRange,color:this.color}}async setAlias(t,r){const i=await this.channels.retrieve(t);if(i.length===0)throw new Yt(`Channel ${t} does not exist`);await this.aliaser.set({[i[0].key]:r})}async deleteAlias(...t){await this.aliaser.delete(t)}async listAliases(){return await this.aliaser.list()}async resolveAlias(t){return await this.aliaser.resolve(t)}async openAliasTracker(){return await this.aliaser.openChangeTracker()}async retrieveParent(){return this.rangeClient.retrieveParent(this.key)}async retrieveChildren(){const t=(await this.ontologyClient.retrieveChildren(this.ontologyID,{excludeFieldData:!0,types:["range"]})).map(r=>r.id.key);return await this.rangeClient.retrieve(t)}async read(t){return await this.frameClient.read(this.timeRange,t)}async labels(){return await this.labelClient.retrieveFor(sn(this.key))}async addLabel(...t){await this.labelClient.label(sn(this.key),t)}async removeLabel(...t){await this.labelClient.removeLabels(sn(this.key),t)}async openChildRangeTracker(){const t=new _n.Observer,r=(await this.retrieveChildren()).map(n=>{const s=sn(n.key);return{id:s,key:s.toString(),name:n.name,data:n.payload}}),i=await this.ontologyClient.openDependentTracker({target:this.ontologyID,dependents:r,resourceType:"range"});return i.onChange(n=>t.notify(this.rangeClient.resourcesToRanges(n))),t.setCloser(async()=>await i.close()),t}async openParentRangeTracker(){const t=new _n.Observer,r=await this.retrieveParent();if(r==null)return null;const i=sn(r.key),n={id:i,key:i.toString(),name:r.name,data:r.payload},s=await this.ontologyClient.openDependentTracker({target:this.ontologyID,dependents:[n],relationshipDirection:"to"});return s.onChange(a=>{const o=this.rangeClient.resourcesToRanges(a);if(o.length===0)return;const u=o[0];t.notify(u)}),t.setCloser(async()=>await s.close()),t}}const IF=(e,t)=>sN(e.timeRange,t.timeRange),OF=b({keys:ft.array().optional(),names:xr(O()).optional(),term:O().optional(),overlapsWith:Me.z.optional(),limit:le().int().optional(),offset:le().int().optional(),hasLabels:Nr.array().optional()}),SF="/range/retrieve",zF=b({ranges:at(Tr)});let pS=class{constructor(e,t,r,i,n,s){h(this,"type","range"),h(this,"frameClient"),h(this,"writer"),h(this,"unaryClient"),h(this,"channels"),h(this,"labelClient"),h(this,"ontologyClient"),this.frameClient=e,this.writer=t,this.unaryClient=r,this.channels=i,this.labelClient=n,this.ontologyClient=s}async create(e,t){const r=!Array.isArray(e),i=this.sugarMany(await this.writer.create(D.toArray(e),t));return r?i[0]:i}async rename(e,t){await this.writer.rename(e,t)}async delete(e){await this.writer.delete(D.toArray(e))}async search(e){return this.sugarMany(await this.execRetrieve({term:e}))}async page(e,t){return this.sugarMany(await this.execRetrieve({offset:e,limit:t}))}async retrieve(e){if(typeof e=="object"&&"start"in e)return await this.execRetrieve({overlapsWith:new Me(e)});const{single:t,actual:r,variant:i,normalized:n,empty:s}=UO(e);if(s)return[];const a=await this.execRetrieve({[i]:n});if(!t)return a;if(a.length===0)throw new Nn(`range matching ${r} not found`);if(a.length>1)throw new pr(`multiple ranges matching ${r} found`);return a[0]}getKV(e){return new Pu(e,this.unaryClient,this.frameClient)}async execRetrieve(e){const{ranges:t}=await j(this.unaryClient,SF,e,OF,zF);return this.sugarMany(t)}async retrieveParent(e){const t=await this.ontologyClient.retrieveParents(sn(e));if(t.length===0)return null;const r=t[0];return r.id.type!=="range"?null:await this.retrieve(r.id.key)}sugarOne(e){return new fS(e.name,e.timeRange,e.key,e.color,this.frameClient,new Pu(e.key,this.unaryClient,this.frameClient),new vF(e.key,this.frameClient,this.unaryClient),this.channels,this.labelClient,this.ontologyClient,this)}sugarMany(e){return e.map(t=>this.sugarOne(t))}async openTracker(){return await jr(this.frameClient,"sy_range_set","sy_range_delete",(e,t)=>e==="delete"?t.toUUIDs().map(r=>({variant:e,key:r,value:void 0})):this.sugarMany(t.parseJSON(Tr)).map(r=>({variant:e,key:r.key,value:r})))}resourcesToRanges(e){return e.map(t=>this.resourceToRange(t))}resourceToRange(e){var t,r,i;return this.sugarOne({key:e.id.key,name:(t=e.data)==null?void 0:t.name,timeRange:new Me((r=e.data)==null?void 0:r.timeRange),color:(i=e.data)==null?void 0:i.color})}};const sn=e=>new se({type:jh,key:e}),xF=e=>new se({type:Ah,key:e}),NF=b({ranges:Tr.array()}),TF=b({parent:pt.optional(),ranges:TO.array()}),UF=b({keys:ft.array()}),EF=b({}),jF=b({key:ft,name:Eh}),AF=b({}),PF="/range/create",ZF="/range/delete",DF="/range/rename";class vS{constructor(t){h(this,"client"),this.client=t}async rename(t,r){await j(this.client,DF,{key:t,name:r},jF,AF)}async create(t,r){return(await j(this.client,PF,{ranges:t,...r},TF,NF)).ranges}async delete(t){await j(this.client,ZF,{keys:t},UF,EF)}}const CF=Object.freeze(Object.defineProperty({__proto__:null,ALIAS_ONTOLOGY_TYPE:Ah,Client:pS,KV:Pu,ONTOLOGY_TYPE:jh,Range:fS,Writer:vS,aliasOntologyID:xF,analyzeParams:UO,keyZ:ft,nameZ:Eh,newZ:TO,ontologyID:sn,payloadZ:Tr,sort:IF},Symbol.toStringTag,{value:"Module"})),RF="/api/v1/";class LF{constructor(t,r={},i=!1){h(this,"url"),h(this,"unary"),h(this,"stream"),h(this,"secure"),this.secure=i,this.url=t.child(RF);const n=new Tn.JSONCodec;this.unary=AP(new jP(this.url,n,this.secure),r),this.stream=new pZ(this.url,n,this.secure)}use(...t){this.unary.use(...t),this.stream.use(...t)}}const MF="/workspace/lineplot/retrieve",BF="/workspace/lineplot/create",FF="/workspace/lineplot/rename",JF="/workspace/lineplot/set-data",VF="/workspace/lineplot/delete",WF=b({keys:Gi.array()}),qF=b({workspace:Ht,linePlots:R2.array()}),GF=b({key:Gi,name:O()}),YF=b({key:Gi,data:O()}),KF=b({keys:Gi.array()}),XF=b({linePlots:at(Ph)}),HF=b({linePlots:Ph.array()}),Ao=b({});let QF=class{constructor(e){h(this,"client"),this.client=e}async create(e,t){const r=Array.isArray(t),i=await j(this.client,BF,{workspace:e,linePlots:D.toArray(t)},qF,HF);return r?i.linePlots:i.linePlots[0]}async rename(e,t){await j(this.client,FF,{key:e,name:t},GF,Ao)}async setData(e,t){await j(this.client,JF,{key:e,data:JSON.stringify(t)},YF,Ao)}async retrieve(e){const t=Array.isArray(e),r=await j(this.client,MF,{keys:D.toArray(e)},WF,XF);return t?r.linePlots:r.linePlots[0]}async delete(e){await j(this.client,VF,{keys:D.toArray(e)},KF,Ao)}};const eJ="/workspace/log/retrieve",tJ="/workspace/log/create",nJ="/workspace/log/rename",rJ="/workspace/log/set-data",iJ="/workspace/log/delete",sJ=b({keys:Yi.array()}),aJ=b({workspace:Ht,logs:M2.array()}),oJ=b({key:Yi,name:O()}),uJ=b({key:Yi,data:O()}),cJ=b({keys:Yi.array()}),lJ=b({logs:Zh.array()}),dJ=b({logs:Zh.array()}),Po=b({});let hJ=class{constructor(e){h(this,"client"),this.client=e}async create(e,t){const r=Array.isArray(t),i=await j(this.client,tJ,{workspace:e,logs:D.toArray(t)},aJ,dJ);return r?i.logs:i.logs[0]}async rename(e,t){await j(this.client,nJ,{key:e,name:t},oJ,Po)}async setData(e,t){await j(this.client,rJ,{key:e,data:JSON.stringify(t)},uJ,Po)}async retrieve(e){const t=Array.isArray(e),r=await j(this.client,eJ,{keys:D.toArray(e)},sJ,lJ);return t?r.logs:r.logs[0]}async delete(e){await j(this.client,iJ,{keys:D.toArray(e)},cJ,Po)}};const mJ="/workspace/schematic/retrieve",fJ="/workspace/schematic/create",pJ="/workspace/schematic/rename",vJ="/workspace/schematic/set-data",gJ="/workspace/schematic/delete",yJ="/workspace/schematic/copy",bJ=b({keys:Er.array()}),wJ=b({workspace:Ht,schematics:V2.array()}),$J=b({key:Er,name:O()}),_J=b({key:Er,data:O()}),kJ=b({keys:Er.array()}),IJ=b({key:Er,name:O(),snapshot:re()}),OJ=b({schematics:at(jO)}),SJ=b({schematics:jO.array()}),zJ=b({schematic:Ch}),Zo=b({});let xJ=class{constructor(e){h(this,"client"),this.client=e}async create(e,t){const r=Array.isArray(t),i=await j(this.client,fJ,{workspace:e,schematics:D.toArray(t)},wJ,SJ);return r?i.schematics:i.schematics[0]}async rename(e,t){await j(this.client,pJ,{key:e,name:t},$J,Zo)}async setData(e,t){await j(this.client,vJ,{key:e,data:JSON.stringify(t)},_J,Zo)}async retrieve(e){const t=Array.isArray(e),r=await j(this.client,mJ,{keys:D.toArray(e)},bJ,OJ);return t?r.schematics:r.schematics[0]}async delete(e){await j(this.client,gJ,{keys:D.toArray(e)},kJ,Zo)}async copy(e,t,r){return(await j(this.client,yJ,{key:e,name:t,snapshot:r},IJ,zJ)).schematic}};const NJ="/workspace/table/retrieve",TJ="/workspace/table/create",UJ="/workspace/table/rename",EJ="/workspace/table/set-data",jJ="/workspace/table/delete",AJ=b({keys:Ki.array()}),PJ=b({workspace:Ht,tables:q2.array()}),ZJ=b({key:Ki,name:O()}),DJ=b({key:Ki,data:O()}),CJ=b({keys:Ki.array()}),RJ=b({tables:PO.array()}),LJ=b({tables:PO.array()}),Do=b({});let MJ=class{constructor(e){h(this,"client"),this.client=e}async create(e,t){const r=Array.isArray(t),i=await j(this.client,TJ,{workspace:e,tables:D.toArray(t)},PJ,LJ);return r?i.tables:i.tables[0]}async rename(e,t){await j(this.client,UJ,{key:e,name:t},ZJ,Do)}async setData(e,t){await j(this.client,EJ,{key:e,data:JSON.stringify(t)},DJ,Do)}async retrieve(e){const t=Array.isArray(e),r=await j(this.client,NJ,{keys:D.toArray(e)},AJ,RJ);return t?r.tables:r.tables[0]}async delete(e){await j(this.client,jJ,{keys:D.toArray(e)},CJ,Do)}};const gs="/workspace/retrieve",BJ="/workspace/create",FJ="/workspace/rename",JJ="/workspace/set-layout",VJ="/workspace/delete",ys=b({keys:Ht.array().optional(),search:O().optional(),author:Ur.optional(),offset:le().optional(),limit:le().optional()}),WJ=b({workspaces:F2.array()}),qJ=b({key:Ht,name:O()}),GJ=b({key:Ht,layout:O()}),YJ=b({keys:Ht.array()}),bs=b({workspaces:at(Dh)}),KJ=b({workspaces:J2.array()}),Co=b({});class XJ{constructor(t){h(this,"type",EO),h(this,"schematic"),h(this,"linePlot"),h(this,"log"),h(this,"table"),h(this,"client"),this.client=t,this.schematic=new xJ(t),this.linePlot=new QF(t),this.log=new hJ(t),this.table=new MJ(t)}async create(t){const r=Array.isArray(t),i=await j(this.client,BJ,{workspaces:D.toArray(t)},WJ,KJ);return r?i.workspaces:i.workspaces[0]}async rename(t,r){await j(this.client,FJ,{key:t,name:r},qJ,Co)}async setLayout(t,r){await j(this.client,JJ,{key:t,layout:JSON.stringify(r)},GJ,Co)}async retrieve(t){const r=Array.isArray(t),i=await j(this.client,gs,{keys:D.toArray(t)},ys,bs);return r?i.workspaces:i.workspaces[0]}async retrieveByAuthor(t){return(await j(this.client,gs,{author:t},ys,bs)).workspaces}async search(t){return(await j(this.client,gs,{search:t},ys,bs)).workspaces}async page(t,r){return(await j(this.client,gs,{offset:t,limit:r},ys,bs)).workspaces}async delete(t){await j(this.client,VJ,{keys:D.toArray(t)},YJ,Co)}}const gS=b({host:O({error:"Host is required"}).min(1,"Host is required"),port:le({error:"Port is required"}).or(O({error:"Port is required"})),username:O().min(1,"Username is required"),password:O().min(1,"Password is required"),connectivityPollFrequency:F.z.default(F.seconds(30)),secure:re().optional().default(!1),name:O().optional(),retry:Mb.breakerConfigZ.optional()});class yS extends oS{constructor(t){const r=gS.parse(t),{host:i,port:n,username:s,password:a,connectivityPollFrequency:o,secure:u,retry:c}=r,l=new LF(new PN({host:i,port:Number(n)}),c,u);l.use(E2);let d;s!=null&&a!=null&&(d=new IM(l.unary,{username:s,password:a}),l.use(d.middleware()));const m=new Fh(new Bh(l.unary)),y=new GO(l.unary,m);super(l.stream,l.unary,m),h(this,"createdAt"),h(this,"props"),h(this,"ranges"),h(this,"channels"),h(this,"auth"),h(this,"user"),h(this,"access"),h(this,"connectivity"),h(this,"ontology"),h(this,"workspaces"),h(this,"labels"),h(this,"hardware"),h(this,"control"),h(this,"transport"),h(this,"clientVersion","0.43.1"),this.createdAt=q.now(),this.props=r,this.auth=d,this.transport=l,this.channels=new VO(this,m,l.unary,y),this.connectivity=new XO(l.unary,o,this.clientVersion,r.name),this.control=new cS(this),this.ontology=new vL(l.unary,this);const k=new vS(this.transport.unary);this.labels=new rF(this.transport.unary,this,this.ontology),this.ranges=new pS(this,k,this.transport.unary,m,this.labels,this.ontology),this.access=new TL(this.transport.unary),this.user=new vM(this.transport.unary),this.workspaces=new XJ(this.transport.unary);const v=new pB(this.transport.unary,this),f=new LB(this.transport.unary,this,this.ontology,this.ranges),p=new kB(this.transport.unary,f,this);this.hardware=new aB(f,p,v)}get key(){return this.createdAt.valueOf().toString()}close(){this.connectivity.stopChecking()}}h(yS,"connectivity",XO);const Zu=(e,t,r="")=>{try{return e.parse(t)}catch(i){if(i instanceof B.ZodError){const n=i.issues.map(s=>s.path.length===0?s.message:`${s.path.join(".")}: ${s.message}`);throw new Error(`${r} - ${n.join(`
153
+ `)}`)}else throw i}};var HJ=Object.defineProperty,QJ=(e,t,r)=>t in e?HJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ge=(e,t,r)=>QJ(e,typeof t!="symbol"?t+"":t,r);const Du=class bS{constructor(t,r,i="",n=!1){Ge(this,"_noop",!1),Ge(this,"key"),Ge(this,"path"),Ge(this,"serviceName"),this.key=t,this.path=r,this.serviceName=i,this._noop=n}child(t){return new bS(t,this.extendPath(t),this.serviceName,this.noop)}extendPath(t){return`${this.path}.${t}`}get noop(){return this._noop}};Ge(Du,"NOOP",new Du("","",""));let Yh=Du;const Cu=["debug","info","warn","error"],wS=e=>{const t=Cu.indexOf(e);return({level:r})=>Cu.indexOf(r)>=t},eV=e=>{const{include:t,exclude:r}=e;return({path:i})=>!(t!=null&&!t.some(n=>i.startsWith(n))||r!=null&&r.some(n=>i.startsWith(n)))},Ru=class $S{constructor(t={}){Ge(this,"meta",Yh.NOOP),Ge(this,"filters");const{filters:r=[]}=t;this.filters=r}filter(t){return!this.meta.noop&&this.filters.every(r=>r({key:this.meta.key,path:this.meta.path,level:t}))}child(t){const r=new $S({filters:this.filters});return r.meta=t,r}debug(t,r,i=!1){!this.filter("debug")&&!i||(r==null?console.log("%cDEBUG","color: #8c00f0;",this.meta.path,t):console.log("%cDEBUG","color: #8c00f0;",this.meta.path,t,ws(r)))}info(t,r,i=!1){!this.filter("info")&&!i||(r==null?console.log("%cINFO","color: #005eff;",this.meta.path,t):console.log("%cINFO","color: #005eff;",this.meta.path,t,ws(r)))}warn(t,r,i=!1){!this.filter("warn")&&!i||(r==null?console.warn("WARN",this.meta.path,t):console.warn("WARN",this.meta.path,t,ws(r)))}error(t,r,i=!1){!this.filter("error")&&!i||(r==null?console.error("ERROR",this.meta.path,t):console.error("ERROR",this.meta.path,t,ws(r)))}};Ge(Ru,"NOOP",new Ru);let Kh=Ru;const ws=e=>typeof e=="function"?e():e;var tV=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},gn="1.9.0",ip=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function nV(e){var t=new Set([e]),r=new Set,i=e.match(ip);if(!i)return function(){return!1};var n={major:+i[1],minor:+i[2],patch:+i[3],prerelease:i[4]};if(n.prerelease!=null)return function(o){return o===e};function s(o){return r.add(o),!1}function a(o){return t.add(o),!0}return function(o){if(t.has(o))return!0;if(r.has(o))return!1;var u=o.match(ip);if(!u)return s(o);var c={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return c.prerelease!=null||n.major!==c.major?s(o):n.major===0?n.minor===c.minor&&n.patch<=c.patch?a(o):s(o):n.minor<=c.minor?a(o):s(o)}}var rV=nV(gn),iV=gn.split(".")[0],Oi=Symbol.for("opentelemetry.js.api."+iV),Si=tV;function Xh(e,t,r,i){var n;i===void 0&&(i=!1);var s=Si[Oi]=(n=Si[Oi])!==null&&n!==void 0?n:{version:gn};if(!i&&s[e]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(a.stack||a.message),!1}if(s.version!==gn){var a=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+gn);return r.error(a.stack||a.message),!1}return s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+gn+"."),!0}function zi(e){var t,r,i=(t=Si[Oi])===null||t===void 0?void 0:t.version;if(!(!i||!rV(i)))return(r=Si[Oi])===null||r===void 0?void 0:r[e]}function Hh(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+gn+".");var r=Si[Oi];r&&delete r[e]}var sV=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,s=[],a;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(o){a={error:o}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s},aV=function(e,t,r){if(arguments.length===2)for(var i=0,n=t.length,s;i<n;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},oV=function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Mr("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Mr("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Mr("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Mr("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Mr("verbose",this._namespace,t)},e}();function Mr(e,t,r){var i=zi("diag");if(i)return r.unshift(t),i[e].apply(i,aV([],sV(r),!1))}var yt;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(yt||(yt={}));function uV(e,t){e<yt.NONE?e=yt.NONE:e>yt.ALL&&(e=yt.ALL),t=t||{};function r(i,n){var s=t[i];return typeof s=="function"&&e>=n?s.bind(t):function(){}}return{error:r("error",yt.ERROR),warn:r("warn",yt.WARN),info:r("info",yt.INFO),debug:r("debug",yt.DEBUG),verbose:r("verbose",yt.VERBOSE)}}var cV=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,s=[],a;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(o){a={error:o}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s},lV=function(e,t,r){if(arguments.length===2)for(var i=0,n=t.length,s;i<n;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},dV="diag",xi=function(){function e(){function t(n){return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];var o=zi("diag");if(o)return o[n].apply(o,lV([],cV(s),!1))}}var r=this,i=function(n,s){var a,o,u;if(s===void 0&&(s={logLevel:yt.INFO}),n===r){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((a=c.stack)!==null&&a!==void 0?a:c.message),!1}typeof s=="number"&&(s={logLevel:s});var l=zi("diag"),d=uV((o=s.logLevel)!==null&&o!==void 0?o:yt.INFO,n);if(l&&!s.suppressOverrideMessage){var m=(u=new Error().stack)!==null&&u!==void 0?u:"<failed to generate stacktrace>";l.warn("Current logger will be overwritten from "+m),d.warn("Current logger will overwrite one already registered from "+m)}return Xh("diag",d,r,!0)};r.setLogger=i,r.disable=function(){Hh(dV,r)},r.createComponentLogger=function(n){return new oV(n)},r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),hV=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,s=[],a;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(o){a={error:o}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s},mV=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fV=function(){function e(t){this._entries=t?new Map(t):new Map}return e.prototype.getEntry=function(t){var r=this._entries.get(t);if(r)return Object.assign({},r)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(t){var r=hV(t,2),i=r[0],n=r[1];return[i,n]})},e.prototype.setEntry=function(t,r){var i=new e(this._entries);return i._entries.set(t,r),i},e.prototype.removeEntry=function(t){var r=new e(this._entries);return r._entries.delete(t),r},e.prototype.removeEntries=function(){for(var t,r,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var s=new e(this._entries);try{for(var a=mV(i),o=a.next();!o.done;o=a.next()){var u=o.value;s._entries.delete(u)}}catch(c){t={error:c}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return s},e.prototype.clear=function(){return new e},e}();xi.instance();function pV(e){return e===void 0&&(e={}),new fV(new Map(Object.entries(e)))}function vV(e){return Symbol.for(e)}var gV=function(){function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(i){return r._currentContext.get(i)},r.setValue=function(i,n){var s=new e(r._currentContext);return s._currentContext.set(i,n),s},r.deleteValue=function(i){var n=new e(r._currentContext);return n._currentContext.delete(i),n}}return e}(),yV=new gV,bV={get:function(e,t){if(e!=null)return e[t]},keys:function(e){return e==null?[]:Object.keys(e)}},wV={set:function(e,t,r){e!=null&&(e[t]=r)}},$V=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,s=[],a;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(o){a={error:o}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s},_V=function(e,t,r){if(arguments.length===2)for(var i=0,n=t.length,s;i<n;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},kV=function(){function e(){}return e.prototype.active=function(){return yV},e.prototype.with=function(t,r,i){for(var n=[],s=3;s<arguments.length;s++)n[s-3]=arguments[s];return r.call.apply(r,_V([i],$V(n),!1))},e.prototype.bind=function(t,r){return r},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),IV=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,s=[],a;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(o){a={error:o}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s},OV=function(e,t,r){if(arguments.length===2)for(var i=0,n=t.length,s;i<n;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},Ro="context",SV=new kV,_S=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return Xh(Ro,t,xi.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,r,i){for(var n,s=[],a=3;a<arguments.length;a++)s[a-3]=arguments[a];return(n=this._getContextManager()).with.apply(n,OV([t,r,i],IV(s),!1))},e.prototype.bind=function(t,r){return this._getContextManager().bind(t,r)},e.prototype._getContextManager=function(){return zi(Ro)||SV},e.prototype.disable=function(){this._getContextManager().disable(),Hh(Ro,xi.instance())},e}(),Lu;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(Lu||(Lu={}));var zV=_S.getInstance(),xV=function(){function e(){}return e.prototype.inject=function(t,r){},e.prototype.extract=function(t,r){return t},e.prototype.fields=function(){return[]},e}(),Qh=vV("OpenTelemetry Baggage Key");function kS(e){return e.getValue(Qh)||void 0}function NV(){return kS(_S.getInstance().active())}function TV(e,t){return e.setValue(Qh,t)}function UV(e){return e.deleteValue(Qh)}var Lo="propagation",EV=new xV,jV=function(){function e(){this.createBaggage=pV,this.getBaggage=kS,this.getActiveBaggage=NV,this.setBaggage=TV,this.deleteBaggage=UV}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(t){return Xh(Lo,t,xi.instance())},e.prototype.inject=function(t,r,i){return i===void 0&&(i=wV),this._getGlobalPropagator().inject(t,r,i)},e.prototype.extract=function(t,r,i){return i===void 0&&(i=bV),this._getGlobalPropagator().extract(t,r,i)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){Hh(Lo,xi.instance())},e.prototype._getGlobalPropagator=function(){return zi(Lo)||EV},e}(),AV=jV.getInstance();const sp=["bench","debug","prod"],PV=e=>t=>sp.indexOf(t)>=sp.indexOf(e),Mu=class IS{constructor(t,r=PV("debug")){Ge(this,"meta",Yh.NOOP),Ge(this,"otelTracer"),Ge(this,"filter"),this.otelTracer=t,this.filter=r}child(t){const r=new IS(this.otelTracer,this.filter);return r.meta=t,r}debug(t,r){return this.trace(t,"debug",r)}bench(t,r){return this.trace(t,"bench",r)}prod(t,r){return this.trace(t,"prod",r)}trace(t,r,i){const n=this.meta.noop||!this.filter(r)||this.otelTracer==null;if(i==null){if(n)return()=>{};const s=new Bu(t,this.otelTracer.startSpan(t));return s.start(),()=>s.end()}return n?i(new SS(t)):this.otelTracer.startActiveSpan(t,s=>{const a=new Bu(t,s);return i(a)})}propagate(t){if(this.meta.noop)return;const r=zV.active();AV.inject(r,t,{set:(i,n,s)=>{i[n]=s}})}};Ge(Mu,"NOOP",new Mu);let OS=Mu;class Bu{constructor(t,r){Ge(this,"key"),Ge(this,"otel"),this.key=t,this.otel=r}set(t,r){this.otel.setAttribute(t,r)}recordError(t){t!=null&&(this.otel.recordException(t),this.otel.setStatus({code:Lu.ERROR}))}start(){performance.mark(`alamos.trace.start.${this.key}`)}end(){try{performance.mark(`alamos.trace.end.${this.key}`);const t=performance.measure(`alamos.trace.duration.${this.key}`,`alamos.trace.start.${this.key}`,`alamos.trace.end.${this.key}`);this.set("duration",t.duration),this.otel.end()}catch(t){console.error(t)}}}class SS{constructor(t){Ge(this,"key"),this.key=t}set(){}recordError(t){}}const Fu=class zS{constructor({key:t="",serviceName:r="",logger:i=Kh.NOOP,tracer:n=OS.NOOP,noop:s=!1,__meta:a}){Ge(this,"meta"),Ge(this,"T"),Ge(this,"L"),this.meta=a??new Yh(t,t,r,s),this.T=n.child(this.meta),this.L=i.child(this.meta)}child(t){const r=this.meta.child(t);return new zS({__meta:r,tracer:this.T,logger:this.L})}};Ge(Fu,"NOOP",new Fu({noop:!0}));let em=Fu;const ZV=em.NOOP,xS=Object.freeze(Object.defineProperty({__proto__:null,Instrumentation:em,LOG_LEVELS:Cu,Logger:Kh,NOOP:ZV,NoopSpan:SS,Tracer:OS,_Span:Bu,logLevelKeyFiler:eV,logThresholdFilter:wS},Symbol.toStringTag,{value:"Module"})),Mo=(e,t)=>e instanceof Error?(e.message=`[${t}] - ${e.message}`,e):new Error(t??"unknown error",{cause:e});class tm{constructor({key:t,type:r,sender:i,instrumentation:n,parentCtxValues:s}){Ie(this,"type");Ie(this,"key");Ie(this,"sender");Ie(this,"_internalState");Ie(this,"_state");Ie(this,"_prevState");Ie(this,"_deleted",!1);Ie(this,"parentCtxValues");Ie(this,"childCtxValues");Ie(this,"childCtxChangedKeys");Ie(this,"instrumentation");Ie(this,"schema");this.type=r,this.key=t,this.sender=i,this._internalState={},this.instrumentation=n.child(`${this.type}(${this.key})`),this.parentCtxValues=new Map,s==null||s.forEach((a,o)=>this.parentCtxValues.set(o,a)),this.childCtxValues=new Map,this.childCtxChangedKeys=new Set}get _schema(){if(this.schema==null)throw new Ae(`[AetherLeaf] - expected subclass to define component schema, but none was found.
154
+ Make sure to define a property 'schema' on the class.`);return this.schema}setState(t){const r=B.executeSetter(t,this.state);this._prevState=M.vd(this._state),this._state=Zu(this._schema,r,`${this.type}:${this.key}`),this.sender.send({variant:"update",key:this.key,state:this._state})}get state(){if(this._state==null)throw new $t(`[AetherLeaf] - state not defined in ${this.type}:${this.key}`);return this._state}get internal(){return this._internalState}get prevState(){if(this._prevState===void 0)throw new Error("prevState not defined");return this._prevState}get deleted(){return this._deleted}get ctx(){return{get:t=>this.parentCtxValues.get(t),getOptional:t=>this.parentCtxValues.get(t),has:t=>this.parentCtxValues.has(t),wasSetPreviously:t=>this.childCtxValues.has(t),set:(t,r,i=!0)=>{this.childCtxValues.set(t,r),i&&this.childCtxChangedKeys.add(t)}}}_updateState(t,r,i){if(!this.deleted)try{const n=this.instrumentation.T.debug(`${this.type}:${this.key}:updateState`);this.validatePath(t);const s=Zu(this._schema,r,`${this.type}:${this.key}`);this._state!=null?this.instrumentation.L.debug("updating state",()=>({diff:CS.J.difference(this.state,s)})):this.instrumentation.L.debug("setting initial state",{state:r}),this._prevState=this._state??s,this._state=s,this.afterUpdate(this.ctx),n()}catch(n){throw Mo(n,`${this.type}.${this.key}.updateState`)}}_updateContext(t){try{const r=this.instrumentation.T.debug(`${this.type}:${this.key}:updateContext`);t.forEach((i,n)=>this.parentCtxValues.set(n,i)),this.afterUpdate(this.ctx),r()}catch(r){throw Mo(r,`${this.type}.${this.key}.updateContext`)}}_delete(t){try{const r=this.instrumentation.T.debug(`${this.type}:${this.key}:delete`);this.validatePath(t),this._deleted=!0,this.afterDelete(this.ctx),r()}catch(r){throw Mo(r,`[${this.type}:${this.key}:delete]`)}}afterUpdate(t){}afterDelete(t){}validatePath(t){if(t.length===0)throw new $t(`[Leaf.setState] - ${this.type}:${this.key} received an empty path`);const r=t[t.length-1];if(t.length>1)throw new $t(`[Leaf.setState] - ${this.type}:${this.key} received a subPath ${t.join(".")} but is a leaf`);if(r!==this.key)throw new $t(`[Leaf.setState] - ${this.type}:${this.key} received a key ${r} but expected ${this.key}`)}}class Xi extends tm{constructor(){super(...arguments);Ie(this,"_children",new Map)}get children(){return Array.from(this._children.values())}getChild(r){return this._children.get(r)??null}childrenOfType(...r){return this.children.filter(i=>r.includes(i.type))}_updateState(r,i,n){if(this.deleted)return;const s=this.parsePath(r);if(s.length===0){if(this.childCtxChangedKeys.clear(),super._updateState(r,i,n),this.childCtxChangedKeys.size==0)return;this.updateChildContexts();return}const o=s[0],u=this.getChild(o);if(u!=null)return u._updateState(s,i,n);if(s.length>1)throw new $t(`[Composite.update] - ${this.type}:${this.key} received a subPath ${s.join(".")} but found now child with key ${o}`);const c=n(this.childCtx());c._updateState(s,i,n),this._children.set(o,c)}_updateContext(r){super._updateContext(r),this.updateChildContexts()}childCtx(){return{get:r=>this.childCtxValues.get(r)??this.parentCtxValues.get(r),forEach:r=>{this.childCtxValues.forEach((i,n)=>r(i,n,this.childCtxValues)),this.parentCtxValues.forEach((i,n)=>{this.childCtxValues.has(n)||r(i,n,this.parentCtxValues)})}}}updateChildContexts(){const r=this.childCtx();this.children.forEach(i=>i._updateContext(r))}_delete(r){const i=this.parsePath(r);if(i.length===0){for(const s of this.children)s._delete([s.key]);this._children.clear(),super._delete([this.key])}const n=this.getChild(i[0]);if(n!=null){if(i.length>1)return n._delete(i);this._children.delete(n.key),n._delete(i)}}parsePath(r,i){const[n,...s]=r;if(n==null)throw new Error(`Composite ${this.type}:${this.key} received an empty path${i!=null?` for ${i}`:""}`);if(n!==this.key)throw new $t(`[Composite.getRequiredKey] - ${this.type}:${this.key} received a key ${n} but expected ${this.key}`);return s}}const DV=B.object({}),CV=()=>{throw new Error("should not call create")},an=class an extends Xi{constructor({comms:r,instrumentation:i=xS.Instrumentation.NOOP,registry:n}){super({key:an.KEY,type:an.TYPE,sender:r,instrumentation:i,parentCtxValues:null});Ie(this,"comms");Ie(this,"registry");Ie(this,"schema",DV);this.comms=r,this.registry=n}static render(r){const i=new an(r);return i._updateState([an.KEY],{},CV),i.comms.handle(n=>{try{i.handle(n)}catch(s){const a={name:"unknown",message:JSON.stringify(s),stack:"unknown"};s instanceof Error&&(a.name=s.name,a.message=s.message,a.stack=s.stack),i.comms.send({variant:"error",error:a})}}),i}handle(r){try{const{path:i,variant:n,type:s}=r;if(n==="delete"){this._delete(i);return}this._updateState(i,r.state,a=>{const o=i[i.length-1];return this.create({key:o,type:s,parentCtxValues:a})})}catch(i){console.error("failed to handle message",{error:i,msg:r})}}create({key:r,type:i,parentCtxValues:n}){const s=this.registry[i];if(s==null)throw new $t(`[Root.create] - ${i} not found in registry`);return new s({key:r,type:i,sender:this.comms,instrumentation:this.instrumentation,parentCtxValues:n})}};Ie(an,"TYPE","root"),Ie(an,"KEY","root");let Ni=an;const NS=Ni.render.bind(Ni),RV=Object.freeze(Object.defineProperty({__proto__:null,Composite:Xi,Leaf:tm,Root:Ni,render:NS},Symbol.toStringTag,{value:"Module"})),TS=B.object({key:B.string(),variant:M.gd.variantZ,message:B.string(),description:B.string().optional(),time:M.d.z,data:M.p.optional()}),US=B.object({statuses:TS.array()}),sa="status.aggregator";class aa extends Xi{constructor(){super(...arguments);Ie(this,"schema",US)}afterUpdate(r){r.wasSetPreviously(sa)||r.set(sa,{add:this.add.bind(this),parse:this.parse.bind(this)})}parse(r){return{time:M.d.now(),key:M.we.create(),...r}}add(r){this.setState(i=>({...i,statuses:[...i.statuses,this.parse(r)]}))}}Ie(aa,"TYPE","status.Aggregator");const ES=e=>e.get(sa).add,LV=e=>{const t=e.getOptional(sa);return t!=null?t.add:()=>{}},Ju=(e,t)=>{if(!(e instanceof Error))throw e;return{variant:"error",message:t??e.message,description:t!=null?e.message:void 0}},jS=e=>(t,r)=>{if(typeof t!="function")return e(Ju(t,r));(async()=>{try{await t()}catch(i){e(Ju(i,r))}})()},AS=e=>jS(ES(e)),MV={[aa.TYPE]:aa},Vu="pluto-theming-context",PS=B.object({name:B.string(),url:B.string()}),BV=B.object({theme:ap,fontURLs:B.array(PS)}),ci=class ci extends Xi{constructor(){super(...arguments);Ie(this,"schema",ci.z)}afterUpdate(r){if(r.getOptional(Vu)!=null&&this.state.theme.key===this.prevState.theme.key)return;r.set(Vu,this.state.theme),AS(r)(async()=>{await this.loadFonts()},"failed to load theme fonts")}async loadFonts(){await Promise.all(this.state.fontURLs.map(async({name:r,url:i})=>{const n=new FontFace(r,`url(${i})`);try{await n.load(),self.fonts.add(n)}catch(s){console.error(s)}}))}};Ie(ci,"TYPE","theming.Provider"),Ie(ci,"z",BV);let Ti=ci;const FV=e=>e.get(Vu),JV={[Ti.TYPE]:Ti};exports.$F=gS;exports.Aggregator=aa;exports.C=em;exports.Composite=Xi;exports.Le=Ae;exports.Leaf=tm;exports.M=F;exports.P=Kh;exports.Pe=wS;exports.Provider=Ti;exports.REGISTRY=JV;exports.REGISTRY$1=MV;exports.SYNNAX_DARK=up;exports.SYNNAX_LIGHT=op;exports.SYNNAX_THEMES=QS;exports.Tq=CF;exports.Y=q;exports.aether=RV;exports.aggregatorStateZ=US;exports.bF=yS;exports.createErrorHandler=jS;exports.fontSpecZ=PS;exports.fromException=Ju;exports.g=xS;exports.hq=sB;exports.iq=HL;exports.isComponentSize=n0;exports.l=MS;exports.mq=HM;exports.pr=Nn;exports.prettyParse=Zu;exports.render=NS;exports.specZ=TS;exports.themeZ=ap;exports.ti=$t;exports.un=Yt;exports.use=FV;exports.useAdder=ES;exports.useErrorHandler=AS;exports.useOptionalAdder=LV;