0sec-cli 0.18.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/{0sec.js → 0.js} +90 -82
  2. package/LICENSE +1 -1
  3. package/README.md +62 -46
  4. package/chunks/adapt-loop-7I57LXXR.js +18 -0
  5. package/chunks/{adgraph-JLGA6RYI.js → adgraph-AUDQTBYA.js} +5 -5
  6. package/chunks/agent/skills/frameworks/entra-id.yaml +2 -2
  7. package/chunks/agent/skills/techniques/assumption-mining.yaml +2 -2
  8. package/chunks/agent/skills/techniques/cve-poc-adaptation.yaml +2 -2
  9. package/chunks/agent/skills/techniques/entra-attack-paths.yaml +1 -1
  10. package/chunks/agent/skills/techniques/kernel-weaponization.yaml +1 -1
  11. package/chunks/agent/skills/techniques/llm-prompt-injection.yaml +2 -2
  12. package/chunks/agent/skills/techniques/npm-ecosystem.yaml +1 -1
  13. package/chunks/agent/skills/techniques/poc-verification.yaml +1 -1
  14. package/chunks/agent/skills/techniques/seedless-depth-review.yaml +20 -38
  15. package/chunks/{artifact-scraper-HQ7HLP6V.js → artifact-scraper-PYZ3RU3O.js} +6 -6
  16. package/chunks/{assumption-mining-5SNIVVDN.js → assumption-mining-MFLF43IR.js} +24 -26
  17. package/chunks/{chunk-7DQEV5QI.js → chunk-23DG5YKS.js} +4 -4
  18. package/chunks/{chunk-UR4ELX2Y.js → chunk-2GV4HQKE.js} +340 -703
  19. package/chunks/{chunk-P6WKNFWX.js → chunk-2OQOQ2FZ.js} +8 -8
  20. package/chunks/{chunk-5G3ZXFBW.js → chunk-2WNCI664.js} +3 -3
  21. package/chunks/{chunk-DW5UWPFY.js → chunk-4VGLO2YS.js} +6 -5
  22. package/chunks/{chunk-KLTNTE2Z.js → chunk-5IBCBQEH.js} +13 -14
  23. package/chunks/{chunk-N7BOUYEV.js → chunk-5MWAG3FT.js} +14 -14
  24. package/chunks/{chunk-OEFNRYI2.js → chunk-6GHSR47F.js} +3 -6
  25. package/chunks/chunk-6YNKRUMC.js +4474 -0
  26. package/chunks/{chunk-6L26OBWI.js → chunk-76KSBWOQ.js} +255 -35
  27. package/chunks/chunk-7DEHG7YT.js +2143 -0
  28. package/chunks/{chunk-AD7WXDH6.js → chunk-7UFUALR2.js} +288 -22
  29. package/chunks/{chunk-53G27VPS.js → chunk-AZ7L3HFD.js} +7 -2
  30. package/chunks/{chunk-TSK2AG6J.js → chunk-CAYANSH6.js} +173 -1757
  31. package/chunks/{chunk-SAFFWQW4.js → chunk-DKSCN2AB.js} +7 -7
  32. package/chunks/{chunk-2JCCA2JL.js → chunk-DM5C5L5D.js} +3 -3
  33. package/chunks/{chunk-RWONANDA.js → chunk-DQTNI3KY.js} +5 -5
  34. package/chunks/{chunk-5JI7L7KV.js → chunk-EGZGZFAH.js} +10036 -12938
  35. package/chunks/{chunk-6LKRLK2R.js → chunk-FHC2B7LN.js} +3 -3
  36. package/chunks/{chunk-MYVT64FN.js → chunk-GHWODZMR.js} +2 -2
  37. package/chunks/{chunk-2RMLOJVB.js → chunk-GVD6SJGH.js} +2 -2
  38. package/chunks/{chunk-SF4KZ4O3.js → chunk-HLFS6WV2.js} +2 -2
  39. package/chunks/chunk-HR2TU42B.js +1228 -0
  40. package/chunks/{chunk-BFRB6HB2.js → chunk-HUNAPTKV.js} +3 -3
  41. package/chunks/chunk-IO7R7WBM.js +114 -0
  42. package/chunks/{chunk-WEBMRWEG.js → chunk-IXT64DV5.js} +656 -1868
  43. package/chunks/{chunk-3MOLBTLS.js → chunk-K2PWUPUI.js} +2 -2
  44. package/chunks/{chunk-WXQ6BJ6A.js → chunk-LCRTAQN2.js} +7 -7
  45. package/chunks/{chunk-SVJEDVYK.js → chunk-LPTRPRZR.js} +5 -5
  46. package/chunks/{chunk-CMKXP5RR.js → chunk-LYUAM3TG.js} +3 -3
  47. package/chunks/{chunk-BVAZO4WA.js → chunk-MICHDTBK.js} +3 -3
  48. package/chunks/{chunk-UCYRA73C.js → chunk-OAYUPGF6.js} +4 -4
  49. package/chunks/{chunk-XM5NLHYU.js → chunk-OWLJYJ5O.js} +14 -14
  50. package/chunks/{chunk-BKZFDZ23.js → chunk-QCUFBVIZ.js} +3 -3
  51. package/chunks/chunk-RE5EZDG2.js +5523 -0
  52. package/chunks/{chunk-ASUR522M.js → chunk-RRD4XXPU.js} +9 -9
  53. package/chunks/{chunk-AHTBZC3E.js → chunk-RSIUX3RW.js} +4 -4
  54. package/chunks/{chunk-BZNEY2ZS.js → chunk-SJBCK2EI.js} +15268 -16053
  55. package/chunks/{chunk-IOL7D5YV.js → chunk-SQCBHFWN.js} +3 -3
  56. package/chunks/chunk-TH2LW437.js +7829 -0
  57. package/chunks/{chunk-WVTBZEQO.js → chunk-TM74SSHC.js} +8 -8
  58. package/chunks/{chunk-U5FLXGHT.js → chunk-TO35Y326.js} +13 -729
  59. package/chunks/chunk-TRH2PJSN.js +547 -0
  60. package/chunks/{chunk-YYRBQVFE.js → chunk-TZFIAMWZ.js} +70 -16
  61. package/chunks/chunk-UELXHK2Y.js +1950 -0
  62. package/chunks/{chunk-RJWOYEOG.js → chunk-UEX7PFSE.js} +5 -5
  63. package/chunks/{chunk-VQG4FT5D.js → chunk-UFHN6RIU.js} +2 -2
  64. package/chunks/{chunk-JQHOLLTD.js → chunk-UU7PQP6N.js} +9 -9
  65. package/chunks/{chunk-BFR2CDV5.js → chunk-UV5QWZGE.js} +283 -153
  66. package/chunks/{chunk-WU6AFRAZ.js → chunk-V36HVTUL.js} +12 -12
  67. package/chunks/{chunk-IR537GON.js → chunk-VCSFCHAJ.js} +2 -2
  68. package/chunks/{chunk-YLMN3N25.js → chunk-VIT5ALXF.js} +3 -3
  69. package/chunks/{chunk-BATRQBOR.js → chunk-VMRRNRMR.js} +41 -41
  70. package/chunks/{chunk-72CISA2D.js → chunk-VNRY6AWF.js} +89 -41
  71. package/chunks/chunk-W6UWZFKL.js +298 -0
  72. package/chunks/{chunk-3KPWWJCI.js → chunk-XFCTUKXR.js} +88 -88
  73. package/chunks/{chunk-GMT2AZKM.js → chunk-YIQSGNAA.js} +897 -130
  74. package/chunks/codex-models-7TLJSY3L.js +17 -0
  75. package/chunks/{commands-TBC2F5CE.js → commands-NEI7L3QA.js} +2836 -1424
  76. package/chunks/corpus-v1.json +2 -2
  77. package/chunks/data/appsec-archetypes.json +2 -2
  78. package/chunks/data/chromium-archetypes.json +1 -1
  79. package/chunks/data/freebsd-archetypes.json +1 -1
  80. package/chunks/data/kernel-archetypes.json +2 -2
  81. package/chunks/db-5AP3JB4W.js +16 -0
  82. package/chunks/{disclose-EKTWSCGW.js → disclose-LDNKAVRH.js} +13 -11
  83. package/chunks/{dist-4YICS2J2.js → dist-3FNZIBB4.js} +394 -404
  84. package/chunks/{dist-4MAW5X6L.js → dist-5YHYNLI3.js} +6 -6
  85. package/chunks/{dist-FMGSR3DW.js → dist-DD4H6HMQ.js} +13 -5
  86. package/chunks/dist-KEULE5IQ.js +21914 -0
  87. package/chunks/dist-XZB53PS5.js +53 -0
  88. package/chunks/eval-runner-43BO2C4T.js +26 -0
  89. package/chunks/example-manifest.json +2 -2
  90. package/chunks/{exploit-agent-45YQOHPJ.js → exploit-agent-N4A5ELBK.js} +4 -4
  91. package/chunks/{exploit-autoclimb-UZGEMGYT.js → exploit-autoclimb-N7P6KIF5.js} +6 -6
  92. package/chunks/{exploit-climb-SG23KB2G.js → exploit-climb-WNEJUB5W.js} +12 -12
  93. package/chunks/fix-Z452M4EC.js +26 -0
  94. package/chunks/{github-issues-MJ6OYOOU.js → github-issues-IGTTWM7V.js} +7 -7
  95. package/chunks/harness-QJJJVSG4.js +22 -0
  96. package/chunks/http-conformance-U5F6GKYG.js +11 -0
  97. package/chunks/http-sender-I5XFFY35.js +10 -0
  98. package/chunks/hunt-scan-K6D2V3PX.js +36 -0
  99. package/chunks/{identity-6ZAIIWOR.js → identity-62SVRW4H.js} +5 -5
  100. package/chunks/{kernel-primitive-7U6CWHXD.js → kernel-primitive-TKUACPKD.js} +6 -6
  101. package/chunks/{kernel-vm-runner-3JAU4O6J.js → kernel-vm-runner-RAAO2PGT.js} +6 -6
  102. package/chunks/memsafety-scan-FCPAXIZE.js +16 -0
  103. package/chunks/{native-loop-RJCJPOUS.js → native-loop-2ZRJENZ3.js} +17 -18
  104. package/chunks/{npm-detectors-KB5Y5ZFX.js → npm-detectors-Z2ZIQCN4.js} +6 -6
  105. package/chunks/npm-dynamic-discovery-5J7FT3XM.js +13 -0
  106. package/chunks/orchestrate-2GWGNTBF.js +58 -0
  107. package/chunks/{pre-recon-cve-66EB6G4M.js → pre-recon-cve-X2K2P5YQ.js} +4 -4
  108. package/chunks/prepare-KYHGFWCJ.js +13 -0
  109. package/chunks/process-N245QIQG.js +12 -0
  110. package/chunks/{run-D56MPDKY.js → run-U3XU4CTC.js} +11507 -13632
  111. package/chunks/{runtime-G7YWIO3B.js → runtime-G75TEWQY.js} +10 -11
  112. package/chunks/runtime-XFWJTBUO.js +12 -0
  113. package/chunks/{scan-stream-FHI2FYZE.js → scan-stream-BMOCPKQX.js} +7 -7
  114. package/chunks/scope-WXI46UHJ.js +21 -0
  115. package/chunks/{session-store-GZ4A4KYT.js → session-store-27L3ZU73.js} +6 -6
  116. package/chunks/source-files-REHOM44I.js +12 -0
  117. package/chunks/{specdrift-WCLH6TTQ.js → specdrift-AFS54WEJ.js} +5 -5
  118. package/chunks/token-KRWP5JYA.js +72 -0
  119. package/chunks/token-util-DWTL33S3.js +8 -0
  120. package/chunks/variant-candidates-YWZORZMK.js +13 -0
  121. package/chunks/{web-recon-prepass-JJGPEOLE.js → web-recon-prepass-YVMFXCIK.js} +9 -9
  122. package/cli-path-traversal-fixture.js +352 -0
  123. package/dashboard/assets/bot-Bg1Tp9_d.js +1 -0
  124. package/dashboard/assets/dist-B_dDCPbu.js +1 -0
  125. package/dashboard/assets/findings-page-mayGhNx6.js +5 -0
  126. package/dashboard/assets/format--susmHX7.js +1 -0
  127. package/dashboard/assets/input-TuVPR3Zl.js +1 -0
  128. package/dashboard/assets/jsx-runtime-MGseXjj5.js +3 -0
  129. package/dashboard/assets/live-page-HWWHX99U.js +1 -0
  130. package/dashboard/assets/meta-tile-ckHo-w7k.js +1 -0
  131. package/dashboard/assets/operations-BxZ0OoXO.js +10 -0
  132. package/dashboard/assets/operations-CMFVrXEe.css +2 -0
  133. package/dashboard/assets/operations-app-D3d35rgo.js +46 -0
  134. package/dashboard/assets/overview-page-W_4IteEr.js +1 -0
  135. package/dashboard/assets/page-header-Bw9AJgBV.js +1 -0
  136. package/dashboard/assets/scans-page-CgzVXHnn.js +1 -0
  137. package/dashboard/assets/siren-KQj8QAnJ.js +1 -0
  138. package/dashboard/assets/table-8EDklulN.js +1 -0
  139. package/dashboard/assets/tabs-CFHPOwg8.js +1 -0
  140. package/dashboard/index.html +4 -5
  141. package/node_modules/node-addon-api/LICENSE.md +9 -0
  142. package/node_modules/node-addon-api/README.md +95 -0
  143. package/node_modules/node-addon-api/common.gypi +21 -0
  144. package/node_modules/node-addon-api/except.gypi +25 -0
  145. package/node_modules/node-addon-api/index.js +14 -0
  146. package/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
  147. package/node_modules/node-addon-api/napi-inl.h +7250 -0
  148. package/node_modules/node-addon-api/napi.h +3463 -0
  149. package/node_modules/node-addon-api/node_addon_api.gyp +42 -0
  150. package/node_modules/node-addon-api/node_api.gyp +9 -0
  151. package/node_modules/node-addon-api/noexcept.gypi +26 -0
  152. package/node_modules/node-addon-api/nothing.c +0 -0
  153. package/node_modules/node-addon-api/package-support.json +21 -0
  154. package/node_modules/node-addon-api/package.json +481 -0
  155. package/node_modules/node-addon-api/tools/README.md +73 -0
  156. package/node_modules/node-addon-api/tools/check-napi.js +99 -0
  157. package/node_modules/node-addon-api/tools/clang-format.js +71 -0
  158. package/node_modules/node-addon-api/tools/conversion.js +301 -0
  159. package/node_modules/node-gyp-build/LICENSE +21 -0
  160. package/node_modules/node-gyp-build/README.md +58 -0
  161. package/node_modules/node-gyp-build/SECURITY.md +5 -0
  162. package/node_modules/node-gyp-build/bin.js +84 -0
  163. package/node_modules/node-gyp-build/build-test.js +19 -0
  164. package/node_modules/node-gyp-build/index.js +6 -0
  165. package/node_modules/node-gyp-build/node-gyp-build.js +207 -0
  166. package/node_modules/node-gyp-build/optional.js +7 -0
  167. package/node_modules/node-gyp-build/package.json +43 -0
  168. package/node_modules/tree-sitter/LICENSE +21 -0
  169. package/node_modules/tree-sitter/README.md +90 -0
  170. package/node_modules/tree-sitter/binding.gyp +76 -0
  171. package/node_modules/tree-sitter/index.js +895 -0
  172. package/node_modules/tree-sitter/package.json +62 -0
  173. package/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
  174. package/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
  175. package/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
  176. package/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
  177. package/node_modules/tree-sitter/src/addon_data.h +47 -0
  178. package/node_modules/tree-sitter/src/binding.cc +35 -0
  179. package/node_modules/tree-sitter/src/conversions.cc +140 -0
  180. package/node_modules/tree-sitter/src/conversions.h +22 -0
  181. package/node_modules/tree-sitter/src/language.cc +106 -0
  182. package/node_modules/tree-sitter/src/language.h +17 -0
  183. package/node_modules/tree-sitter/src/logger.cc +70 -0
  184. package/node_modules/tree-sitter/src/logger.h +19 -0
  185. package/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
  186. package/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
  187. package/node_modules/tree-sitter/src/node.cc +1056 -0
  188. package/node_modules/tree-sitter/src/node.h +30 -0
  189. package/node_modules/tree-sitter/src/parser.cc +298 -0
  190. package/node_modules/tree-sitter/src/parser.h +35 -0
  191. package/node_modules/tree-sitter/src/query.cc +383 -0
  192. package/node_modules/tree-sitter/src/query.h +39 -0
  193. package/node_modules/tree-sitter/src/tree.cc +307 -0
  194. package/node_modules/tree-sitter/src/tree.h +45 -0
  195. package/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
  196. package/node_modules/tree-sitter/src/tree_cursor.h +52 -0
  197. package/node_modules/tree-sitter/tree-sitter.d.ts +211 -0
  198. package/node_modules/tree-sitter/vendor/tree-sitter/LICENSE +21 -0
  199. package/node_modules/tree-sitter/vendor/tree-sitter/README.md +21 -0
  200. package/node_modules/tree-sitter/vendor/tree-sitter/lib/README.md +6 -0
  201. package/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1266 -0
  202. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
  203. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
  204. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +290 -0
  205. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
  206. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
  207. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
  208. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +501 -0
  209. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
  210. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
  211. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +221 -0
  212. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +299 -0
  213. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
  214. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +419 -0
  215. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +49 -0
  216. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +14 -0
  217. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +774 -0
  218. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2151 -0
  219. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +230 -0
  220. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +62 -0
  221. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4134 -0
  222. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
  223. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
  224. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +899 -0
  225. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +133 -0
  226. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1060 -0
  227. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +382 -0
  228. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +165 -0
  229. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
  230. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +714 -0
  231. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
  232. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
  233. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
  234. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
  235. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
  236. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
  237. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
  238. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
  239. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
  240. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
  241. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +50 -0
  242. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +23 -0
  243. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +109 -0
  244. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1294 -0
  245. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1823 -0
  246. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
  247. package/node_modules/tree-sitter/vendor/tree-sitter/test/fixtures/grammars/.gitkeep +0 -0
  248. package/node_modules/tree-sitter-c/LICENSE +21 -0
  249. package/node_modules/tree-sitter-c/README.md +18 -0
  250. package/node_modules/tree-sitter-c/binding.gyp +20 -0
  251. package/node_modules/tree-sitter-c/bindings/node/binding.cc +20 -0
  252. package/node_modules/tree-sitter-c/bindings/node/index.d.ts +28 -0
  253. package/node_modules/tree-sitter-c/bindings/node/index.js +7 -0
  254. package/node_modules/tree-sitter-c/grammar.js +1463 -0
  255. package/node_modules/tree-sitter-c/package.json +108 -0
  256. package/node_modules/tree-sitter-c/prebuilds/darwin-arm64/tree-sitter-c.node +0 -0
  257. package/node_modules/tree-sitter-c/prebuilds/darwin-x64/tree-sitter-c.node +0 -0
  258. package/node_modules/tree-sitter-c/prebuilds/linux-x64/tree-sitter-c.node +0 -0
  259. package/node_modules/tree-sitter-c/prebuilds/win32-x64/tree-sitter-c.node +0 -0
  260. package/node_modules/tree-sitter-c/queries/highlights.scm +81 -0
  261. package/node_modules/tree-sitter-c/queries/tags.scm +9 -0
  262. package/node_modules/tree-sitter-c/src/grammar.json +9682 -0
  263. package/node_modules/tree-sitter-c/src/node-types.json +4556 -0
  264. package/node_modules/tree-sitter-c/src/parser.c +113852 -0
  265. package/node_modules/tree-sitter-c/src/tree_sitter/alloc.h +54 -0
  266. package/node_modules/tree-sitter-c/src/tree_sitter/array.h +290 -0
  267. package/node_modules/tree-sitter-c/src/tree_sitter/parser.h +265 -0
  268. package/package.json +20 -13
  269. package/vendor/tree-sitter-0.21.1-node24.json +16 -0
  270. package/vendor/tree-sitter-0.21.1-node24.tgz +0 -0
  271. package/chunks/adapt-loop-SMH6V4PD.js +0 -18
  272. package/chunks/appsec-catalog-CBWHGTEL.js +0 -24
  273. package/chunks/chunk-242TMK6G.js +0 -110
  274. package/chunks/chunk-57ZENEX2.js +0 -169
  275. package/chunks/chunk-ADOLI6DT.js +0 -102
  276. package/chunks/chunk-ATATQACO.js +0 -471
  277. package/chunks/chunk-C2WXWFBB.js +0 -1070
  278. package/chunks/chunk-F3WBKITT.js +0 -687
  279. package/chunks/chunk-H2FFLZNK.js +0 -3
  280. package/chunks/chunk-LP3HHYQU.js +0 -245
  281. package/chunks/chunk-QI233I24.js +0 -333
  282. package/chunks/chunk-RRMJC3ZE.js +0 -105
  283. package/chunks/chunk-Z5FA2XOX.js +0 -2798
  284. package/chunks/cost-ledger-NU63MYZM.js +0 -13
  285. package/chunks/db-KFWOAUUB.js +0 -16
  286. package/chunks/eval-runner-7ZF472KV.js +0 -27
  287. package/chunks/fix-IG7LYXH3.js +0 -12
  288. package/chunks/harness-7ODOLOWU.js +0 -22
  289. package/chunks/http-conformance-DU66MZIU.js +0 -11
  290. package/chunks/http-sender-GWH2IYEA.js +0 -10
  291. package/chunks/hunt-scan-MMKUOETU.js +0 -38
  292. package/chunks/memsafety-scan-J7SECV5W.js +0 -16
  293. package/chunks/npm-dynamic-discovery-AHROOZDB.js +0 -13
  294. package/chunks/orchestrate-OC2VZN2X.js +0 -62
  295. package/chunks/pipeline-BZK5BLJR.js +0 -14
  296. package/chunks/prepare-MYY743TK.js +0 -13
  297. package/chunks/process-LQRCS5OY.js +0 -13
  298. package/chunks/replay-runner-45G3VU7X.js +0 -39
  299. package/chunks/runtime-J7PLXZNM.js +0 -12
  300. package/chunks/scope-BI7BF4ZY.js +0 -18
  301. package/chunks/source-files-PWRQR6LY.js +0 -12
  302. package/chunks/variant-candidates-YERCYMPD.js +0 -13
  303. package/dashboard/assets/0sec-icon-66SreztZ.gif +0 -0
  304. package/dashboard/assets/bot-yILPnRgD.js +0 -1
  305. package/dashboard/assets/chevron-down-BeDJ-Vka.js +0 -1
  306. package/dashboard/assets/circle-alert-BEnMBMT-.js +0 -1
  307. package/dashboard/assets/client-DRYsuOGl.js +0 -9
  308. package/dashboard/assets/copy-Bi5vzoF9.js +0 -1
  309. package/dashboard/assets/desktop-CXTQonNm.js +0 -32
  310. package/dashboard/assets/desktop-NOekk4QS.css +0 -1
  311. package/dashboard/assets/dist-CmX-h7a4.js +0 -1
  312. package/dashboard/assets/dist-DAwYQmf_.js +0 -45
  313. package/dashboard/assets/findings-page-CACW9nw2.js +0 -5
  314. package/dashboard/assets/format-PoISqsES.js +0 -1
  315. package/dashboard/assets/jsx-runtime-C7oxC63R.js +0 -1
  316. package/dashboard/assets/live-page-DrgQqQK5.js +0 -1
  317. package/dashboard/assets/meta-tile-CcskIV_o.js +0 -1
  318. package/dashboard/assets/operations-BKE8T-vY.css +0 -2
  319. package/dashboard/assets/operations-D8nUP5_m.js +0 -4
  320. package/dashboard/assets/operations-app-CQQhG54n.js +0 -2
  321. package/dashboard/assets/overview-page-DTGS8dPo.js +0 -1
  322. package/dashboard/assets/page-header-MFVvEtZW.js +0 -1
  323. package/dashboard/assets/play-Dwo-9xt6.js +0 -1
  324. package/dashboard/assets/scans-page-ChVtq8Us.js +0 -1
  325. package/dashboard/assets/search-CiooTLck.js +0 -1
  326. package/dashboard/assets/siren-CCBwTSuk.js +0 -1
  327. package/dashboard/assets/table-BYS-nIVA.js +0 -1
  328. package/dashboard/assets/tabs-DivxbhQy.js +0 -1
  329. package/dashboard/desktop.html +0 -21
@@ -0,0 +1,4474 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __0CreateRequire } from "node:module";
3
+ const require = __0CreateRequire(import.meta.url);
4
+ import {
5
+ __export
6
+ } from "./chunk-VCSFCHAJ.js";
7
+
8
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js
9
+ var NEVER = Object.freeze({
10
+ status: "aborted"
11
+ });
12
+ // @__NO_SIDE_EFFECTS__
13
+ function $constructor(name, initializer3, params) {
14
+ function init(inst, def) {
15
+ var _a;
16
+ Object.defineProperty(inst, "_zod", {
17
+ value: inst._zod ?? {},
18
+ enumerable: false
19
+ });
20
+ (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
21
+ inst._zod.traits.add(name);
22
+ initializer3(inst, def);
23
+ for (const k in _.prototype) {
24
+ if (!(k in inst))
25
+ Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
26
+ }
27
+ inst._zod.constr = _;
28
+ inst._zod.def = def;
29
+ }
30
+ const Parent = params?.Parent ?? Object;
31
+ class Definition extends Parent {
32
+ }
33
+ Object.defineProperty(Definition, "name", { value: name });
34
+ function _(def) {
35
+ var _a;
36
+ const inst = params?.Parent ? new Definition() : this;
37
+ init(inst, def);
38
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
39
+ for (const fn of inst._zod.deferred) {
40
+ fn();
41
+ }
42
+ return inst;
43
+ }
44
+ Object.defineProperty(_, "init", { value: init });
45
+ Object.defineProperty(_, Symbol.hasInstance, {
46
+ value: (inst) => {
47
+ if (params?.Parent && inst instanceof params.Parent)
48
+ return true;
49
+ return inst?._zod?.traits?.has(name);
50
+ }
51
+ });
52
+ Object.defineProperty(_, "name", { value: name });
53
+ return _;
54
+ }
55
+ var $ZodAsyncError = class extends Error {
56
+ constructor() {
57
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
58
+ }
59
+ };
60
+ var globalConfig = {};
61
+ function config(newConfig) {
62
+ if (newConfig)
63
+ Object.assign(globalConfig, newConfig);
64
+ return globalConfig;
65
+ }
66
+
67
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/util.js
68
+ var util_exports = {};
69
+ __export(util_exports, {
70
+ BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
71
+ Class: () => Class,
72
+ NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
73
+ aborted: () => aborted,
74
+ allowsEval: () => allowsEval,
75
+ assert: () => assert,
76
+ assertEqual: () => assertEqual,
77
+ assertIs: () => assertIs,
78
+ assertNever: () => assertNever,
79
+ assertNotEqual: () => assertNotEqual,
80
+ assignProp: () => assignProp,
81
+ cached: () => cached,
82
+ captureStackTrace: () => captureStackTrace,
83
+ cleanEnum: () => cleanEnum,
84
+ cleanRegex: () => cleanRegex,
85
+ clone: () => clone,
86
+ createTransparentProxy: () => createTransparentProxy,
87
+ defineLazy: () => defineLazy,
88
+ esc: () => esc,
89
+ escapeRegex: () => escapeRegex,
90
+ extend: () => extend,
91
+ finalizeIssue: () => finalizeIssue,
92
+ floatSafeRemainder: () => floatSafeRemainder,
93
+ getElementAtPath: () => getElementAtPath,
94
+ getEnumValues: () => getEnumValues,
95
+ getLengthableOrigin: () => getLengthableOrigin,
96
+ getParsedType: () => getParsedType,
97
+ getSizableOrigin: () => getSizableOrigin,
98
+ isObject: () => isObject,
99
+ isPlainObject: () => isPlainObject,
100
+ issue: () => issue,
101
+ joinValues: () => joinValues,
102
+ jsonStringifyReplacer: () => jsonStringifyReplacer,
103
+ merge: () => merge,
104
+ normalizeParams: () => normalizeParams,
105
+ nullish: () => nullish,
106
+ numKeys: () => numKeys,
107
+ omit: () => omit,
108
+ optionalKeys: () => optionalKeys,
109
+ partial: () => partial,
110
+ pick: () => pick,
111
+ prefixIssues: () => prefixIssues,
112
+ primitiveTypes: () => primitiveTypes,
113
+ promiseAllObject: () => promiseAllObject,
114
+ propertyKeyTypes: () => propertyKeyTypes,
115
+ randomString: () => randomString,
116
+ required: () => required,
117
+ stringifyPrimitive: () => stringifyPrimitive,
118
+ unwrapMessage: () => unwrapMessage
119
+ });
120
+ function assertEqual(val) {
121
+ return val;
122
+ }
123
+ function assertNotEqual(val) {
124
+ return val;
125
+ }
126
+ function assertIs(_arg) {
127
+ }
128
+ function assertNever(_x) {
129
+ throw new Error();
130
+ }
131
+ function assert(_) {
132
+ }
133
+ function getEnumValues(entries) {
134
+ const numericValues = Object.values(entries).filter((v) => typeof v === "number");
135
+ const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
136
+ return values;
137
+ }
138
+ function joinValues(array2, separator = "|") {
139
+ return array2.map((val) => stringifyPrimitive(val)).join(separator);
140
+ }
141
+ function jsonStringifyReplacer(_, value) {
142
+ if (typeof value === "bigint")
143
+ return value.toString();
144
+ return value;
145
+ }
146
+ function cached(getter) {
147
+ const set = false;
148
+ return {
149
+ get value() {
150
+ if (!set) {
151
+ const value = getter();
152
+ Object.defineProperty(this, "value", { value });
153
+ return value;
154
+ }
155
+ throw new Error("cached value already set");
156
+ }
157
+ };
158
+ }
159
+ function nullish(input) {
160
+ return input === null || input === void 0;
161
+ }
162
+ function cleanRegex(source) {
163
+ const start = source.startsWith("^") ? 1 : 0;
164
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
165
+ return source.slice(start, end);
166
+ }
167
+ function floatSafeRemainder(val, step) {
168
+ const valDecCount = (val.toString().split(".")[1] || "").length;
169
+ const stepDecCount = (step.toString().split(".")[1] || "").length;
170
+ const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
171
+ const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
172
+ const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
173
+ return valInt % stepInt / 10 ** decCount;
174
+ }
175
+ function defineLazy(object2, key, getter) {
176
+ const set = false;
177
+ Object.defineProperty(object2, key, {
178
+ get() {
179
+ if (!set) {
180
+ const value = getter();
181
+ object2[key] = value;
182
+ return value;
183
+ }
184
+ throw new Error("cached value already set");
185
+ },
186
+ set(v) {
187
+ Object.defineProperty(object2, key, {
188
+ value: v
189
+ // configurable: true,
190
+ });
191
+ },
192
+ configurable: true
193
+ });
194
+ }
195
+ function assignProp(target, prop, value) {
196
+ Object.defineProperty(target, prop, {
197
+ value,
198
+ writable: true,
199
+ enumerable: true,
200
+ configurable: true
201
+ });
202
+ }
203
+ function getElementAtPath(obj, path) {
204
+ if (!path)
205
+ return obj;
206
+ return path.reduce((acc, key) => acc?.[key], obj);
207
+ }
208
+ function promiseAllObject(promisesObj) {
209
+ const keys = Object.keys(promisesObj);
210
+ const promises = keys.map((key) => promisesObj[key]);
211
+ return Promise.all(promises).then((results) => {
212
+ const resolvedObj = {};
213
+ for (let i = 0; i < keys.length; i++) {
214
+ resolvedObj[keys[i]] = results[i];
215
+ }
216
+ return resolvedObj;
217
+ });
218
+ }
219
+ function randomString(length = 10) {
220
+ const chars = "abcdefghijklmnopqrstuvwxyz";
221
+ let str = "";
222
+ for (let i = 0; i < length; i++) {
223
+ str += chars[Math.floor(Math.random() * chars.length)];
224
+ }
225
+ return str;
226
+ }
227
+ function esc(str) {
228
+ return JSON.stringify(str);
229
+ }
230
+ var captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {
231
+ };
232
+ function isObject(data) {
233
+ return typeof data === "object" && data !== null && !Array.isArray(data);
234
+ }
235
+ var allowsEval = cached(() => {
236
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
237
+ return false;
238
+ }
239
+ try {
240
+ const F = Function;
241
+ new F("");
242
+ return true;
243
+ } catch (_) {
244
+ return false;
245
+ }
246
+ });
247
+ function isPlainObject(o) {
248
+ if (isObject(o) === false)
249
+ return false;
250
+ const ctor = o.constructor;
251
+ if (ctor === void 0)
252
+ return true;
253
+ const prot = ctor.prototype;
254
+ if (isObject(prot) === false)
255
+ return false;
256
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
257
+ return false;
258
+ }
259
+ return true;
260
+ }
261
+ function numKeys(data) {
262
+ let keyCount = 0;
263
+ for (const key in data) {
264
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
265
+ keyCount++;
266
+ }
267
+ }
268
+ return keyCount;
269
+ }
270
+ var getParsedType = (data) => {
271
+ const t = typeof data;
272
+ switch (t) {
273
+ case "undefined":
274
+ return "undefined";
275
+ case "string":
276
+ return "string";
277
+ case "number":
278
+ return Number.isNaN(data) ? "nan" : "number";
279
+ case "boolean":
280
+ return "boolean";
281
+ case "function":
282
+ return "function";
283
+ case "bigint":
284
+ return "bigint";
285
+ case "symbol":
286
+ return "symbol";
287
+ case "object":
288
+ if (Array.isArray(data)) {
289
+ return "array";
290
+ }
291
+ if (data === null) {
292
+ return "null";
293
+ }
294
+ if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
295
+ return "promise";
296
+ }
297
+ if (typeof Map !== "undefined" && data instanceof Map) {
298
+ return "map";
299
+ }
300
+ if (typeof Set !== "undefined" && data instanceof Set) {
301
+ return "set";
302
+ }
303
+ if (typeof Date !== "undefined" && data instanceof Date) {
304
+ return "date";
305
+ }
306
+ if (typeof File !== "undefined" && data instanceof File) {
307
+ return "file";
308
+ }
309
+ return "object";
310
+ default:
311
+ throw new Error(`Unknown data type: ${t}`);
312
+ }
313
+ };
314
+ var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
315
+ var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
316
+ function escapeRegex(str) {
317
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
318
+ }
319
+ function clone(inst, def, params) {
320
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
321
+ if (!def || params?.parent)
322
+ cl._zod.parent = inst;
323
+ return cl;
324
+ }
325
+ function normalizeParams(_params) {
326
+ const params = _params;
327
+ if (!params)
328
+ return {};
329
+ if (typeof params === "string")
330
+ return { error: () => params };
331
+ if (params?.message !== void 0) {
332
+ if (params?.error !== void 0)
333
+ throw new Error("Cannot specify both `message` and `error` params");
334
+ params.error = params.message;
335
+ }
336
+ delete params.message;
337
+ if (typeof params.error === "string")
338
+ return { ...params, error: () => params.error };
339
+ return params;
340
+ }
341
+ function createTransparentProxy(getter) {
342
+ let target;
343
+ return new Proxy({}, {
344
+ get(_, prop, receiver) {
345
+ target ?? (target = getter());
346
+ return Reflect.get(target, prop, receiver);
347
+ },
348
+ set(_, prop, value, receiver) {
349
+ target ?? (target = getter());
350
+ return Reflect.set(target, prop, value, receiver);
351
+ },
352
+ has(_, prop) {
353
+ target ?? (target = getter());
354
+ return Reflect.has(target, prop);
355
+ },
356
+ deleteProperty(_, prop) {
357
+ target ?? (target = getter());
358
+ return Reflect.deleteProperty(target, prop);
359
+ },
360
+ ownKeys(_) {
361
+ target ?? (target = getter());
362
+ return Reflect.ownKeys(target);
363
+ },
364
+ getOwnPropertyDescriptor(_, prop) {
365
+ target ?? (target = getter());
366
+ return Reflect.getOwnPropertyDescriptor(target, prop);
367
+ },
368
+ defineProperty(_, prop, descriptor) {
369
+ target ?? (target = getter());
370
+ return Reflect.defineProperty(target, prop, descriptor);
371
+ }
372
+ });
373
+ }
374
+ function stringifyPrimitive(value) {
375
+ if (typeof value === "bigint")
376
+ return value.toString() + "n";
377
+ if (typeof value === "string")
378
+ return `"${value}"`;
379
+ return `${value}`;
380
+ }
381
+ function optionalKeys(shape) {
382
+ return Object.keys(shape).filter((k) => {
383
+ return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
384
+ });
385
+ }
386
+ var NUMBER_FORMAT_RANGES = {
387
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
388
+ int32: [-2147483648, 2147483647],
389
+ uint32: [0, 4294967295],
390
+ float32: [-34028234663852886e22, 34028234663852886e22],
391
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
392
+ };
393
+ var BIGINT_FORMAT_RANGES = {
394
+ int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
395
+ uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
396
+ };
397
+ function pick(schema, mask) {
398
+ const newShape = {};
399
+ const currDef = schema._zod.def;
400
+ for (const key in mask) {
401
+ if (!(key in currDef.shape)) {
402
+ throw new Error(`Unrecognized key: "${key}"`);
403
+ }
404
+ if (!mask[key])
405
+ continue;
406
+ newShape[key] = currDef.shape[key];
407
+ }
408
+ return clone(schema, {
409
+ ...schema._zod.def,
410
+ shape: newShape,
411
+ checks: []
412
+ });
413
+ }
414
+ function omit(schema, mask) {
415
+ const newShape = { ...schema._zod.def.shape };
416
+ const currDef = schema._zod.def;
417
+ for (const key in mask) {
418
+ if (!(key in currDef.shape)) {
419
+ throw new Error(`Unrecognized key: "${key}"`);
420
+ }
421
+ if (!mask[key])
422
+ continue;
423
+ delete newShape[key];
424
+ }
425
+ return clone(schema, {
426
+ ...schema._zod.def,
427
+ shape: newShape,
428
+ checks: []
429
+ });
430
+ }
431
+ function extend(schema, shape) {
432
+ if (!isPlainObject(shape)) {
433
+ throw new Error("Invalid input to extend: expected a plain object");
434
+ }
435
+ const def = {
436
+ ...schema._zod.def,
437
+ get shape() {
438
+ const _shape = { ...schema._zod.def.shape, ...shape };
439
+ assignProp(this, "shape", _shape);
440
+ return _shape;
441
+ },
442
+ checks: []
443
+ // delete existing checks
444
+ };
445
+ return clone(schema, def);
446
+ }
447
+ function merge(a, b) {
448
+ return clone(a, {
449
+ ...a._zod.def,
450
+ get shape() {
451
+ const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
452
+ assignProp(this, "shape", _shape);
453
+ return _shape;
454
+ },
455
+ catchall: b._zod.def.catchall,
456
+ checks: []
457
+ // delete existing checks
458
+ });
459
+ }
460
+ function partial(Class2, schema, mask) {
461
+ const oldShape = schema._zod.def.shape;
462
+ const shape = { ...oldShape };
463
+ if (mask) {
464
+ for (const key in mask) {
465
+ if (!(key in oldShape)) {
466
+ throw new Error(`Unrecognized key: "${key}"`);
467
+ }
468
+ if (!mask[key])
469
+ continue;
470
+ shape[key] = Class2 ? new Class2({
471
+ type: "optional",
472
+ innerType: oldShape[key]
473
+ }) : oldShape[key];
474
+ }
475
+ } else {
476
+ for (const key in oldShape) {
477
+ shape[key] = Class2 ? new Class2({
478
+ type: "optional",
479
+ innerType: oldShape[key]
480
+ }) : oldShape[key];
481
+ }
482
+ }
483
+ return clone(schema, {
484
+ ...schema._zod.def,
485
+ shape,
486
+ checks: []
487
+ });
488
+ }
489
+ function required(Class2, schema, mask) {
490
+ const oldShape = schema._zod.def.shape;
491
+ const shape = { ...oldShape };
492
+ if (mask) {
493
+ for (const key in mask) {
494
+ if (!(key in shape)) {
495
+ throw new Error(`Unrecognized key: "${key}"`);
496
+ }
497
+ if (!mask[key])
498
+ continue;
499
+ shape[key] = new Class2({
500
+ type: "nonoptional",
501
+ innerType: oldShape[key]
502
+ });
503
+ }
504
+ } else {
505
+ for (const key in oldShape) {
506
+ shape[key] = new Class2({
507
+ type: "nonoptional",
508
+ innerType: oldShape[key]
509
+ });
510
+ }
511
+ }
512
+ return clone(schema, {
513
+ ...schema._zod.def,
514
+ shape,
515
+ // optional: [],
516
+ checks: []
517
+ });
518
+ }
519
+ function aborted(x, startIndex = 0) {
520
+ for (let i = startIndex; i < x.issues.length; i++) {
521
+ if (x.issues[i]?.continue !== true)
522
+ return true;
523
+ }
524
+ return false;
525
+ }
526
+ function prefixIssues(path, issues) {
527
+ return issues.map((iss) => {
528
+ var _a;
529
+ (_a = iss).path ?? (_a.path = []);
530
+ iss.path.unshift(path);
531
+ return iss;
532
+ });
533
+ }
534
+ function unwrapMessage(message) {
535
+ return typeof message === "string" ? message : message?.message;
536
+ }
537
+ function finalizeIssue(iss, ctx, config2) {
538
+ const full = { ...iss, path: iss.path ?? [] };
539
+ if (!iss.message) {
540
+ const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
541
+ full.message = message;
542
+ }
543
+ delete full.inst;
544
+ delete full.continue;
545
+ if (!ctx?.reportInput) {
546
+ delete full.input;
547
+ }
548
+ return full;
549
+ }
550
+ function getSizableOrigin(input) {
551
+ if (input instanceof Set)
552
+ return "set";
553
+ if (input instanceof Map)
554
+ return "map";
555
+ if (input instanceof File)
556
+ return "file";
557
+ return "unknown";
558
+ }
559
+ function getLengthableOrigin(input) {
560
+ if (Array.isArray(input))
561
+ return "array";
562
+ if (typeof input === "string")
563
+ return "string";
564
+ return "unknown";
565
+ }
566
+ function issue(...args) {
567
+ const [iss, input, inst] = args;
568
+ if (typeof iss === "string") {
569
+ return {
570
+ message: iss,
571
+ code: "custom",
572
+ input,
573
+ inst
574
+ };
575
+ }
576
+ return { ...iss };
577
+ }
578
+ function cleanEnum(obj) {
579
+ return Object.entries(obj).filter(([k, _]) => {
580
+ return Number.isNaN(Number.parseInt(k, 10));
581
+ }).map((el) => el[1]);
582
+ }
583
+ var Class = class {
584
+ constructor(..._args) {
585
+ }
586
+ };
587
+
588
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/errors.js
589
+ var initializer = (inst, def) => {
590
+ inst.name = "$ZodError";
591
+ Object.defineProperty(inst, "_zod", {
592
+ value: inst._zod,
593
+ enumerable: false
594
+ });
595
+ Object.defineProperty(inst, "issues", {
596
+ value: def,
597
+ enumerable: false
598
+ });
599
+ Object.defineProperty(inst, "message", {
600
+ get() {
601
+ return JSON.stringify(def, jsonStringifyReplacer, 2);
602
+ },
603
+ enumerable: true
604
+ // configurable: false,
605
+ });
606
+ Object.defineProperty(inst, "toString", {
607
+ value: () => inst.message,
608
+ enumerable: false
609
+ });
610
+ };
611
+ var $ZodError = $constructor("$ZodError", initializer);
612
+ var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
613
+ function flattenError(error, mapper = (issue2) => issue2.message) {
614
+ const fieldErrors = {};
615
+ const formErrors = [];
616
+ for (const sub of error.issues) {
617
+ if (sub.path.length > 0) {
618
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
619
+ fieldErrors[sub.path[0]].push(mapper(sub));
620
+ } else {
621
+ formErrors.push(mapper(sub));
622
+ }
623
+ }
624
+ return { formErrors, fieldErrors };
625
+ }
626
+ function formatError(error, _mapper) {
627
+ const mapper = _mapper || function(issue2) {
628
+ return issue2.message;
629
+ };
630
+ const fieldErrors = { _errors: [] };
631
+ const processError = (error2) => {
632
+ for (const issue2 of error2.issues) {
633
+ if (issue2.code === "invalid_union" && issue2.errors.length) {
634
+ issue2.errors.map((issues) => processError({ issues }));
635
+ } else if (issue2.code === "invalid_key") {
636
+ processError({ issues: issue2.issues });
637
+ } else if (issue2.code === "invalid_element") {
638
+ processError({ issues: issue2.issues });
639
+ } else if (issue2.path.length === 0) {
640
+ fieldErrors._errors.push(mapper(issue2));
641
+ } else {
642
+ let curr = fieldErrors;
643
+ let i = 0;
644
+ while (i < issue2.path.length) {
645
+ const el = issue2.path[i];
646
+ const terminal = i === issue2.path.length - 1;
647
+ if (!terminal) {
648
+ curr[el] = curr[el] || { _errors: [] };
649
+ } else {
650
+ curr[el] = curr[el] || { _errors: [] };
651
+ curr[el]._errors.push(mapper(issue2));
652
+ }
653
+ curr = curr[el];
654
+ i++;
655
+ }
656
+ }
657
+ }
658
+ };
659
+ processError(error);
660
+ return fieldErrors;
661
+ }
662
+
663
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js
664
+ var _parse = (_Err) => (schema, value, _ctx, _params) => {
665
+ const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
666
+ const result = schema._zod.run({ value, issues: [] }, ctx);
667
+ if (result instanceof Promise) {
668
+ throw new $ZodAsyncError();
669
+ }
670
+ if (result.issues.length) {
671
+ const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
672
+ captureStackTrace(e, _params?.callee);
673
+ throw e;
674
+ }
675
+ return result.value;
676
+ };
677
+ var parse = /* @__PURE__ */ _parse($ZodRealError);
678
+ var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
679
+ const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
680
+ let result = schema._zod.run({ value, issues: [] }, ctx);
681
+ if (result instanceof Promise)
682
+ result = await result;
683
+ if (result.issues.length) {
684
+ const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
685
+ captureStackTrace(e, params?.callee);
686
+ throw e;
687
+ }
688
+ return result.value;
689
+ };
690
+ var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
691
+ var _safeParse = (_Err) => (schema, value, _ctx) => {
692
+ const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
693
+ const result = schema._zod.run({ value, issues: [] }, ctx);
694
+ if (result instanceof Promise) {
695
+ throw new $ZodAsyncError();
696
+ }
697
+ return result.issues.length ? {
698
+ success: false,
699
+ error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
700
+ } : { success: true, data: result.value };
701
+ };
702
+ var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
703
+ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
704
+ const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
705
+ let result = schema._zod.run({ value, issues: [] }, ctx);
706
+ if (result instanceof Promise)
707
+ result = await result;
708
+ return result.issues.length ? {
709
+ success: false,
710
+ error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
711
+ } : { success: true, data: result.value };
712
+ };
713
+ var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
714
+
715
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/regexes.js
716
+ var cuid = /^[cC][^\s-]{8,}$/;
717
+ var cuid2 = /^[0-9a-z]+$/;
718
+ var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
719
+ var xid = /^[0-9a-vA-V]{20}$/;
720
+ var ksuid = /^[A-Za-z0-9]{27}$/;
721
+ var nanoid = /^[a-zA-Z0-9_-]{21}$/;
722
+ var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
723
+ var guid = /^([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})$/;
724
+ var uuid = (version2) => {
725
+ if (!version2)
726
+ return /^([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)$/;
727
+ return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version2}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
728
+ };
729
+ var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
730
+ var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
731
+ function emoji() {
732
+ return new RegExp(_emoji, "u");
733
+ }
734
+ var ipv4 = /^(?:(?: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])$/;
735
+ var ipv6 = /^(([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})$/;
736
+ var cidrv4 = /^((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])$/;
737
+ var cidrv6 = /^(([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])$/;
738
+ var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
739
+ var base64url = /^[A-Za-z0-9_-]*$/;
740
+ var hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
741
+ var e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
742
+ var dateSource = `(?:(?:\\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])))`;
743
+ var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
744
+ function timeSource(args) {
745
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
746
+ const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
747
+ return regex;
748
+ }
749
+ function time(args) {
750
+ return new RegExp(`^${timeSource(args)}$`);
751
+ }
752
+ function datetime(args) {
753
+ const time3 = timeSource({ precision: args.precision });
754
+ const opts = ["Z"];
755
+ if (args.local)
756
+ opts.push("");
757
+ if (args.offset)
758
+ opts.push(`([+-]\\d{2}:\\d{2})`);
759
+ const timeRegex = `${time3}(?:${opts.join("|")})`;
760
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
761
+ }
762
+ var string = (params) => {
763
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
764
+ return new RegExp(`^${regex}$`);
765
+ };
766
+ var integer = /^\d+$/;
767
+ var number = /^-?\d+(?:\.\d+)?/i;
768
+ var boolean = /true|false/i;
769
+ var _null = /null/i;
770
+ var lowercase = /^[^A-Z]*$/;
771
+ var uppercase = /^[^a-z]*$/;
772
+
773
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/checks.js
774
+ var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
775
+ var _a;
776
+ inst._zod ?? (inst._zod = {});
777
+ inst._zod.def = def;
778
+ (_a = inst._zod).onattach ?? (_a.onattach = []);
779
+ });
780
+ var numericOriginMap = {
781
+ number: "number",
782
+ bigint: "bigint",
783
+ object: "date"
784
+ };
785
+ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
786
+ $ZodCheck.init(inst, def);
787
+ const origin = numericOriginMap[typeof def.value];
788
+ inst._zod.onattach.push((inst2) => {
789
+ const bag = inst2._zod.bag;
790
+ const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
791
+ if (def.value < curr) {
792
+ if (def.inclusive)
793
+ bag.maximum = def.value;
794
+ else
795
+ bag.exclusiveMaximum = def.value;
796
+ }
797
+ });
798
+ inst._zod.check = (payload) => {
799
+ if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
800
+ return;
801
+ }
802
+ payload.issues.push({
803
+ origin,
804
+ code: "too_big",
805
+ maximum: def.value,
806
+ input: payload.value,
807
+ inclusive: def.inclusive,
808
+ inst,
809
+ continue: !def.abort
810
+ });
811
+ };
812
+ });
813
+ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
814
+ $ZodCheck.init(inst, def);
815
+ const origin = numericOriginMap[typeof def.value];
816
+ inst._zod.onattach.push((inst2) => {
817
+ const bag = inst2._zod.bag;
818
+ const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
819
+ if (def.value > curr) {
820
+ if (def.inclusive)
821
+ bag.minimum = def.value;
822
+ else
823
+ bag.exclusiveMinimum = def.value;
824
+ }
825
+ });
826
+ inst._zod.check = (payload) => {
827
+ if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
828
+ return;
829
+ }
830
+ payload.issues.push({
831
+ origin,
832
+ code: "too_small",
833
+ minimum: def.value,
834
+ input: payload.value,
835
+ inclusive: def.inclusive,
836
+ inst,
837
+ continue: !def.abort
838
+ });
839
+ };
840
+ });
841
+ var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
842
+ $ZodCheck.init(inst, def);
843
+ inst._zod.onattach.push((inst2) => {
844
+ var _a;
845
+ (_a = inst2._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
846
+ });
847
+ inst._zod.check = (payload) => {
848
+ if (typeof payload.value !== typeof def.value)
849
+ throw new Error("Cannot mix number and bigint in multiple_of check.");
850
+ const isMultiple = typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0;
851
+ if (isMultiple)
852
+ return;
853
+ payload.issues.push({
854
+ origin: typeof payload.value,
855
+ code: "not_multiple_of",
856
+ divisor: def.value,
857
+ input: payload.value,
858
+ inst,
859
+ continue: !def.abort
860
+ });
861
+ };
862
+ });
863
+ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
864
+ $ZodCheck.init(inst, def);
865
+ def.format = def.format || "float64";
866
+ const isInt = def.format?.includes("int");
867
+ const origin = isInt ? "int" : "number";
868
+ const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
869
+ inst._zod.onattach.push((inst2) => {
870
+ const bag = inst2._zod.bag;
871
+ bag.format = def.format;
872
+ bag.minimum = minimum;
873
+ bag.maximum = maximum;
874
+ if (isInt)
875
+ bag.pattern = integer;
876
+ });
877
+ inst._zod.check = (payload) => {
878
+ const input = payload.value;
879
+ if (isInt) {
880
+ if (!Number.isInteger(input)) {
881
+ payload.issues.push({
882
+ expected: origin,
883
+ format: def.format,
884
+ code: "invalid_type",
885
+ input,
886
+ inst
887
+ });
888
+ return;
889
+ }
890
+ if (!Number.isSafeInteger(input)) {
891
+ if (input > 0) {
892
+ payload.issues.push({
893
+ input,
894
+ code: "too_big",
895
+ maximum: Number.MAX_SAFE_INTEGER,
896
+ note: "Integers must be within the safe integer range.",
897
+ inst,
898
+ origin,
899
+ continue: !def.abort
900
+ });
901
+ } else {
902
+ payload.issues.push({
903
+ input,
904
+ code: "too_small",
905
+ minimum: Number.MIN_SAFE_INTEGER,
906
+ note: "Integers must be within the safe integer range.",
907
+ inst,
908
+ origin,
909
+ continue: !def.abort
910
+ });
911
+ }
912
+ return;
913
+ }
914
+ }
915
+ if (input < minimum) {
916
+ payload.issues.push({
917
+ origin: "number",
918
+ input,
919
+ code: "too_small",
920
+ minimum,
921
+ inclusive: true,
922
+ inst,
923
+ continue: !def.abort
924
+ });
925
+ }
926
+ if (input > maximum) {
927
+ payload.issues.push({
928
+ origin: "number",
929
+ input,
930
+ code: "too_big",
931
+ maximum,
932
+ inst
933
+ });
934
+ }
935
+ };
936
+ });
937
+ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
938
+ var _a;
939
+ $ZodCheck.init(inst, def);
940
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
941
+ const val = payload.value;
942
+ return !nullish(val) && val.length !== void 0;
943
+ });
944
+ inst._zod.onattach.push((inst2) => {
945
+ const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
946
+ if (def.maximum < curr)
947
+ inst2._zod.bag.maximum = def.maximum;
948
+ });
949
+ inst._zod.check = (payload) => {
950
+ const input = payload.value;
951
+ const length = input.length;
952
+ if (length <= def.maximum)
953
+ return;
954
+ const origin = getLengthableOrigin(input);
955
+ payload.issues.push({
956
+ origin,
957
+ code: "too_big",
958
+ maximum: def.maximum,
959
+ inclusive: true,
960
+ input,
961
+ inst,
962
+ continue: !def.abort
963
+ });
964
+ };
965
+ });
966
+ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
967
+ var _a;
968
+ $ZodCheck.init(inst, def);
969
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
970
+ const val = payload.value;
971
+ return !nullish(val) && val.length !== void 0;
972
+ });
973
+ inst._zod.onattach.push((inst2) => {
974
+ const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
975
+ if (def.minimum > curr)
976
+ inst2._zod.bag.minimum = def.minimum;
977
+ });
978
+ inst._zod.check = (payload) => {
979
+ const input = payload.value;
980
+ const length = input.length;
981
+ if (length >= def.minimum)
982
+ return;
983
+ const origin = getLengthableOrigin(input);
984
+ payload.issues.push({
985
+ origin,
986
+ code: "too_small",
987
+ minimum: def.minimum,
988
+ inclusive: true,
989
+ input,
990
+ inst,
991
+ continue: !def.abort
992
+ });
993
+ };
994
+ });
995
+ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
996
+ var _a;
997
+ $ZodCheck.init(inst, def);
998
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
999
+ const val = payload.value;
1000
+ return !nullish(val) && val.length !== void 0;
1001
+ });
1002
+ inst._zod.onattach.push((inst2) => {
1003
+ const bag = inst2._zod.bag;
1004
+ bag.minimum = def.length;
1005
+ bag.maximum = def.length;
1006
+ bag.length = def.length;
1007
+ });
1008
+ inst._zod.check = (payload) => {
1009
+ const input = payload.value;
1010
+ const length = input.length;
1011
+ if (length === def.length)
1012
+ return;
1013
+ const origin = getLengthableOrigin(input);
1014
+ const tooBig = length > def.length;
1015
+ payload.issues.push({
1016
+ origin,
1017
+ ...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length },
1018
+ inclusive: true,
1019
+ exact: true,
1020
+ input: payload.value,
1021
+ inst,
1022
+ continue: !def.abort
1023
+ });
1024
+ };
1025
+ });
1026
+ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
1027
+ var _a, _b;
1028
+ $ZodCheck.init(inst, def);
1029
+ inst._zod.onattach.push((inst2) => {
1030
+ const bag = inst2._zod.bag;
1031
+ bag.format = def.format;
1032
+ if (def.pattern) {
1033
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
1034
+ bag.patterns.add(def.pattern);
1035
+ }
1036
+ });
1037
+ if (def.pattern)
1038
+ (_a = inst._zod).check ?? (_a.check = (payload) => {
1039
+ def.pattern.lastIndex = 0;
1040
+ if (def.pattern.test(payload.value))
1041
+ return;
1042
+ payload.issues.push({
1043
+ origin: "string",
1044
+ code: "invalid_format",
1045
+ format: def.format,
1046
+ input: payload.value,
1047
+ ...def.pattern ? { pattern: def.pattern.toString() } : {},
1048
+ inst,
1049
+ continue: !def.abort
1050
+ });
1051
+ });
1052
+ else
1053
+ (_b = inst._zod).check ?? (_b.check = () => {
1054
+ });
1055
+ });
1056
+ var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
1057
+ $ZodCheckStringFormat.init(inst, def);
1058
+ inst._zod.check = (payload) => {
1059
+ def.pattern.lastIndex = 0;
1060
+ if (def.pattern.test(payload.value))
1061
+ return;
1062
+ payload.issues.push({
1063
+ origin: "string",
1064
+ code: "invalid_format",
1065
+ format: "regex",
1066
+ input: payload.value,
1067
+ pattern: def.pattern.toString(),
1068
+ inst,
1069
+ continue: !def.abort
1070
+ });
1071
+ };
1072
+ });
1073
+ var $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => {
1074
+ def.pattern ?? (def.pattern = lowercase);
1075
+ $ZodCheckStringFormat.init(inst, def);
1076
+ });
1077
+ var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => {
1078
+ def.pattern ?? (def.pattern = uppercase);
1079
+ $ZodCheckStringFormat.init(inst, def);
1080
+ });
1081
+ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
1082
+ $ZodCheck.init(inst, def);
1083
+ const escapedRegex = escapeRegex(def.includes);
1084
+ const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
1085
+ def.pattern = pattern;
1086
+ inst._zod.onattach.push((inst2) => {
1087
+ const bag = inst2._zod.bag;
1088
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
1089
+ bag.patterns.add(pattern);
1090
+ });
1091
+ inst._zod.check = (payload) => {
1092
+ if (payload.value.includes(def.includes, def.position))
1093
+ return;
1094
+ payload.issues.push({
1095
+ origin: "string",
1096
+ code: "invalid_format",
1097
+ format: "includes",
1098
+ includes: def.includes,
1099
+ input: payload.value,
1100
+ inst,
1101
+ continue: !def.abort
1102
+ });
1103
+ };
1104
+ });
1105
+ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => {
1106
+ $ZodCheck.init(inst, def);
1107
+ const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
1108
+ def.pattern ?? (def.pattern = pattern);
1109
+ inst._zod.onattach.push((inst2) => {
1110
+ const bag = inst2._zod.bag;
1111
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
1112
+ bag.patterns.add(pattern);
1113
+ });
1114
+ inst._zod.check = (payload) => {
1115
+ if (payload.value.startsWith(def.prefix))
1116
+ return;
1117
+ payload.issues.push({
1118
+ origin: "string",
1119
+ code: "invalid_format",
1120
+ format: "starts_with",
1121
+ prefix: def.prefix,
1122
+ input: payload.value,
1123
+ inst,
1124
+ continue: !def.abort
1125
+ });
1126
+ };
1127
+ });
1128
+ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => {
1129
+ $ZodCheck.init(inst, def);
1130
+ const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
1131
+ def.pattern ?? (def.pattern = pattern);
1132
+ inst._zod.onattach.push((inst2) => {
1133
+ const bag = inst2._zod.bag;
1134
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
1135
+ bag.patterns.add(pattern);
1136
+ });
1137
+ inst._zod.check = (payload) => {
1138
+ if (payload.value.endsWith(def.suffix))
1139
+ return;
1140
+ payload.issues.push({
1141
+ origin: "string",
1142
+ code: "invalid_format",
1143
+ format: "ends_with",
1144
+ suffix: def.suffix,
1145
+ input: payload.value,
1146
+ inst,
1147
+ continue: !def.abort
1148
+ });
1149
+ };
1150
+ });
1151
+ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => {
1152
+ $ZodCheck.init(inst, def);
1153
+ inst._zod.check = (payload) => {
1154
+ payload.value = def.tx(payload.value);
1155
+ };
1156
+ });
1157
+
1158
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/doc.js
1159
+ var Doc = class {
1160
+ constructor(args = []) {
1161
+ this.content = [];
1162
+ this.indent = 0;
1163
+ if (this)
1164
+ this.args = args;
1165
+ }
1166
+ indented(fn) {
1167
+ this.indent += 1;
1168
+ fn(this);
1169
+ this.indent -= 1;
1170
+ }
1171
+ write(arg) {
1172
+ if (typeof arg === "function") {
1173
+ arg(this, { execution: "sync" });
1174
+ arg(this, { execution: "async" });
1175
+ return;
1176
+ }
1177
+ const content = arg;
1178
+ const lines = content.split("\n").filter((x) => x);
1179
+ const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
1180
+ const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
1181
+ for (const line of dedented) {
1182
+ this.content.push(line);
1183
+ }
1184
+ }
1185
+ compile() {
1186
+ const F = Function;
1187
+ const args = this?.args;
1188
+ const content = this?.content ?? [``];
1189
+ const lines = [...content.map((x) => ` ${x}`)];
1190
+ return new F(...args, lines.join("\n"));
1191
+ }
1192
+ };
1193
+
1194
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/versions.js
1195
+ var version = {
1196
+ major: 4,
1197
+ minor: 0,
1198
+ patch: 0
1199
+ };
1200
+
1201
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/schemas.js
1202
+ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1203
+ var _a;
1204
+ inst ?? (inst = {});
1205
+ inst._zod.def = def;
1206
+ inst._zod.bag = inst._zod.bag || {};
1207
+ inst._zod.version = version;
1208
+ const checks = [...inst._zod.def.checks ?? []];
1209
+ if (inst._zod.traits.has("$ZodCheck")) {
1210
+ checks.unshift(inst);
1211
+ }
1212
+ for (const ch of checks) {
1213
+ for (const fn of ch._zod.onattach) {
1214
+ fn(inst);
1215
+ }
1216
+ }
1217
+ if (checks.length === 0) {
1218
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
1219
+ inst._zod.deferred?.push(() => {
1220
+ inst._zod.run = inst._zod.parse;
1221
+ });
1222
+ } else {
1223
+ const runChecks = (payload, checks2, ctx) => {
1224
+ let isAborted = aborted(payload);
1225
+ let asyncResult;
1226
+ for (const ch of checks2) {
1227
+ if (ch._zod.def.when) {
1228
+ const shouldRun = ch._zod.def.when(payload);
1229
+ if (!shouldRun)
1230
+ continue;
1231
+ } else if (isAborted) {
1232
+ continue;
1233
+ }
1234
+ const currLen = payload.issues.length;
1235
+ const _ = ch._zod.check(payload);
1236
+ if (_ instanceof Promise && ctx?.async === false) {
1237
+ throw new $ZodAsyncError();
1238
+ }
1239
+ if (asyncResult || _ instanceof Promise) {
1240
+ asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
1241
+ await _;
1242
+ const nextLen = payload.issues.length;
1243
+ if (nextLen === currLen)
1244
+ return;
1245
+ if (!isAborted)
1246
+ isAborted = aborted(payload, currLen);
1247
+ });
1248
+ } else {
1249
+ const nextLen = payload.issues.length;
1250
+ if (nextLen === currLen)
1251
+ continue;
1252
+ if (!isAborted)
1253
+ isAborted = aborted(payload, currLen);
1254
+ }
1255
+ }
1256
+ if (asyncResult) {
1257
+ return asyncResult.then(() => {
1258
+ return payload;
1259
+ });
1260
+ }
1261
+ return payload;
1262
+ };
1263
+ inst._zod.run = (payload, ctx) => {
1264
+ const result = inst._zod.parse(payload, ctx);
1265
+ if (result instanceof Promise) {
1266
+ if (ctx.async === false)
1267
+ throw new $ZodAsyncError();
1268
+ return result.then((result2) => runChecks(result2, checks, ctx));
1269
+ }
1270
+ return runChecks(result, checks, ctx);
1271
+ };
1272
+ }
1273
+ inst["~standard"] = {
1274
+ validate: (value) => {
1275
+ try {
1276
+ const r = safeParse(inst, value);
1277
+ return r.success ? { value: r.data } : { issues: r.error?.issues };
1278
+ } catch (_) {
1279
+ return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
1280
+ }
1281
+ },
1282
+ vendor: "zod",
1283
+ version: 1
1284
+ };
1285
+ });
1286
+ var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
1287
+ $ZodType.init(inst, def);
1288
+ inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
1289
+ inst._zod.parse = (payload, _) => {
1290
+ if (def.coerce)
1291
+ try {
1292
+ payload.value = String(payload.value);
1293
+ } catch (_2) {
1294
+ }
1295
+ if (typeof payload.value === "string")
1296
+ return payload;
1297
+ payload.issues.push({
1298
+ expected: "string",
1299
+ code: "invalid_type",
1300
+ input: payload.value,
1301
+ inst
1302
+ });
1303
+ return payload;
1304
+ };
1305
+ });
1306
+ var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
1307
+ $ZodCheckStringFormat.init(inst, def);
1308
+ $ZodString.init(inst, def);
1309
+ });
1310
+ var $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => {
1311
+ def.pattern ?? (def.pattern = guid);
1312
+ $ZodStringFormat.init(inst, def);
1313
+ });
1314
+ var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
1315
+ if (def.version) {
1316
+ const versionMap = {
1317
+ v1: 1,
1318
+ v2: 2,
1319
+ v3: 3,
1320
+ v4: 4,
1321
+ v5: 5,
1322
+ v6: 6,
1323
+ v7: 7,
1324
+ v8: 8
1325
+ };
1326
+ const v = versionMap[def.version];
1327
+ if (v === void 0)
1328
+ throw new Error(`Invalid UUID version: "${def.version}"`);
1329
+ def.pattern ?? (def.pattern = uuid(v));
1330
+ } else
1331
+ def.pattern ?? (def.pattern = uuid());
1332
+ $ZodStringFormat.init(inst, def);
1333
+ });
1334
+ var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
1335
+ def.pattern ?? (def.pattern = email);
1336
+ $ZodStringFormat.init(inst, def);
1337
+ });
1338
+ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1339
+ $ZodStringFormat.init(inst, def);
1340
+ inst._zod.check = (payload) => {
1341
+ try {
1342
+ const orig = payload.value;
1343
+ const url = new URL(orig);
1344
+ const href = url.href;
1345
+ if (def.hostname) {
1346
+ def.hostname.lastIndex = 0;
1347
+ if (!def.hostname.test(url.hostname)) {
1348
+ payload.issues.push({
1349
+ code: "invalid_format",
1350
+ format: "url",
1351
+ note: "Invalid hostname",
1352
+ pattern: hostname.source,
1353
+ input: payload.value,
1354
+ inst,
1355
+ continue: !def.abort
1356
+ });
1357
+ }
1358
+ }
1359
+ if (def.protocol) {
1360
+ def.protocol.lastIndex = 0;
1361
+ if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
1362
+ payload.issues.push({
1363
+ code: "invalid_format",
1364
+ format: "url",
1365
+ note: "Invalid protocol",
1366
+ pattern: def.protocol.source,
1367
+ input: payload.value,
1368
+ inst,
1369
+ continue: !def.abort
1370
+ });
1371
+ }
1372
+ }
1373
+ if (!orig.endsWith("/") && href.endsWith("/")) {
1374
+ payload.value = href.slice(0, -1);
1375
+ } else {
1376
+ payload.value = href;
1377
+ }
1378
+ return;
1379
+ } catch (_) {
1380
+ payload.issues.push({
1381
+ code: "invalid_format",
1382
+ format: "url",
1383
+ input: payload.value,
1384
+ inst,
1385
+ continue: !def.abort
1386
+ });
1387
+ }
1388
+ };
1389
+ });
1390
+ var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
1391
+ def.pattern ?? (def.pattern = emoji());
1392
+ $ZodStringFormat.init(inst, def);
1393
+ });
1394
+ var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
1395
+ def.pattern ?? (def.pattern = nanoid);
1396
+ $ZodStringFormat.init(inst, def);
1397
+ });
1398
+ var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
1399
+ def.pattern ?? (def.pattern = cuid);
1400
+ $ZodStringFormat.init(inst, def);
1401
+ });
1402
+ var $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => {
1403
+ def.pattern ?? (def.pattern = cuid2);
1404
+ $ZodStringFormat.init(inst, def);
1405
+ });
1406
+ var $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => {
1407
+ def.pattern ?? (def.pattern = ulid);
1408
+ $ZodStringFormat.init(inst, def);
1409
+ });
1410
+ var $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => {
1411
+ def.pattern ?? (def.pattern = xid);
1412
+ $ZodStringFormat.init(inst, def);
1413
+ });
1414
+ var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
1415
+ def.pattern ?? (def.pattern = ksuid);
1416
+ $ZodStringFormat.init(inst, def);
1417
+ });
1418
+ var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
1419
+ def.pattern ?? (def.pattern = datetime(def));
1420
+ $ZodStringFormat.init(inst, def);
1421
+ });
1422
+ var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
1423
+ def.pattern ?? (def.pattern = date);
1424
+ $ZodStringFormat.init(inst, def);
1425
+ });
1426
+ var $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
1427
+ def.pattern ?? (def.pattern = time(def));
1428
+ $ZodStringFormat.init(inst, def);
1429
+ });
1430
+ var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => {
1431
+ def.pattern ?? (def.pattern = duration);
1432
+ $ZodStringFormat.init(inst, def);
1433
+ });
1434
+ var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
1435
+ def.pattern ?? (def.pattern = ipv4);
1436
+ $ZodStringFormat.init(inst, def);
1437
+ inst._zod.onattach.push((inst2) => {
1438
+ const bag = inst2._zod.bag;
1439
+ bag.format = `ipv4`;
1440
+ });
1441
+ });
1442
+ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
1443
+ def.pattern ?? (def.pattern = ipv6);
1444
+ $ZodStringFormat.init(inst, def);
1445
+ inst._zod.onattach.push((inst2) => {
1446
+ const bag = inst2._zod.bag;
1447
+ bag.format = `ipv6`;
1448
+ });
1449
+ inst._zod.check = (payload) => {
1450
+ try {
1451
+ new URL(`http://[${payload.value}]`);
1452
+ } catch {
1453
+ payload.issues.push({
1454
+ code: "invalid_format",
1455
+ format: "ipv6",
1456
+ input: payload.value,
1457
+ inst,
1458
+ continue: !def.abort
1459
+ });
1460
+ }
1461
+ };
1462
+ });
1463
+ var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
1464
+ def.pattern ?? (def.pattern = cidrv4);
1465
+ $ZodStringFormat.init(inst, def);
1466
+ });
1467
+ var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
1468
+ def.pattern ?? (def.pattern = cidrv6);
1469
+ $ZodStringFormat.init(inst, def);
1470
+ inst._zod.check = (payload) => {
1471
+ const [address, prefix] = payload.value.split("/");
1472
+ try {
1473
+ if (!prefix)
1474
+ throw new Error();
1475
+ const prefixNum = Number(prefix);
1476
+ if (`${prefixNum}` !== prefix)
1477
+ throw new Error();
1478
+ if (prefixNum < 0 || prefixNum > 128)
1479
+ throw new Error();
1480
+ new URL(`http://[${address}]`);
1481
+ } catch {
1482
+ payload.issues.push({
1483
+ code: "invalid_format",
1484
+ format: "cidrv6",
1485
+ input: payload.value,
1486
+ inst,
1487
+ continue: !def.abort
1488
+ });
1489
+ }
1490
+ };
1491
+ });
1492
+ function isValidBase64(data) {
1493
+ if (data === "")
1494
+ return true;
1495
+ if (data.length % 4 !== 0)
1496
+ return false;
1497
+ try {
1498
+ atob(data);
1499
+ return true;
1500
+ } catch {
1501
+ return false;
1502
+ }
1503
+ }
1504
+ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
1505
+ def.pattern ?? (def.pattern = base64);
1506
+ $ZodStringFormat.init(inst, def);
1507
+ inst._zod.onattach.push((inst2) => {
1508
+ inst2._zod.bag.contentEncoding = "base64";
1509
+ });
1510
+ inst._zod.check = (payload) => {
1511
+ if (isValidBase64(payload.value))
1512
+ return;
1513
+ payload.issues.push({
1514
+ code: "invalid_format",
1515
+ format: "base64",
1516
+ input: payload.value,
1517
+ inst,
1518
+ continue: !def.abort
1519
+ });
1520
+ };
1521
+ });
1522
+ function isValidBase64URL(data) {
1523
+ if (!base64url.test(data))
1524
+ return false;
1525
+ const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
1526
+ const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "=");
1527
+ return isValidBase64(padded);
1528
+ }
1529
+ var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
1530
+ def.pattern ?? (def.pattern = base64url);
1531
+ $ZodStringFormat.init(inst, def);
1532
+ inst._zod.onattach.push((inst2) => {
1533
+ inst2._zod.bag.contentEncoding = "base64url";
1534
+ });
1535
+ inst._zod.check = (payload) => {
1536
+ if (isValidBase64URL(payload.value))
1537
+ return;
1538
+ payload.issues.push({
1539
+ code: "invalid_format",
1540
+ format: "base64url",
1541
+ input: payload.value,
1542
+ inst,
1543
+ continue: !def.abort
1544
+ });
1545
+ };
1546
+ });
1547
+ var $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => {
1548
+ def.pattern ?? (def.pattern = e164);
1549
+ $ZodStringFormat.init(inst, def);
1550
+ });
1551
+ function isValidJWT(token, algorithm = null) {
1552
+ try {
1553
+ const tokensParts = token.split(".");
1554
+ if (tokensParts.length !== 3)
1555
+ return false;
1556
+ const [header] = tokensParts;
1557
+ if (!header)
1558
+ return false;
1559
+ const parsedHeader = JSON.parse(atob(header));
1560
+ if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
1561
+ return false;
1562
+ if (!parsedHeader.alg)
1563
+ return false;
1564
+ if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
1565
+ return false;
1566
+ return true;
1567
+ } catch {
1568
+ return false;
1569
+ }
1570
+ }
1571
+ var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1572
+ $ZodStringFormat.init(inst, def);
1573
+ inst._zod.check = (payload) => {
1574
+ if (isValidJWT(payload.value, def.alg))
1575
+ return;
1576
+ payload.issues.push({
1577
+ code: "invalid_format",
1578
+ format: "jwt",
1579
+ input: payload.value,
1580
+ inst,
1581
+ continue: !def.abort
1582
+ });
1583
+ };
1584
+ });
1585
+ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1586
+ $ZodType.init(inst, def);
1587
+ inst._zod.pattern = inst._zod.bag.pattern ?? number;
1588
+ inst._zod.parse = (payload, _ctx) => {
1589
+ if (def.coerce)
1590
+ try {
1591
+ payload.value = Number(payload.value);
1592
+ } catch (_) {
1593
+ }
1594
+ const input = payload.value;
1595
+ if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
1596
+ return payload;
1597
+ }
1598
+ const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
1599
+ payload.issues.push({
1600
+ expected: "number",
1601
+ code: "invalid_type",
1602
+ input,
1603
+ inst,
1604
+ ...received ? { received } : {}
1605
+ });
1606
+ return payload;
1607
+ };
1608
+ });
1609
+ var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1610
+ $ZodCheckNumberFormat.init(inst, def);
1611
+ $ZodNumber.init(inst, def);
1612
+ });
1613
+ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
1614
+ $ZodType.init(inst, def);
1615
+ inst._zod.pattern = boolean;
1616
+ inst._zod.parse = (payload, _ctx) => {
1617
+ if (def.coerce)
1618
+ try {
1619
+ payload.value = Boolean(payload.value);
1620
+ } catch (_) {
1621
+ }
1622
+ const input = payload.value;
1623
+ if (typeof input === "boolean")
1624
+ return payload;
1625
+ payload.issues.push({
1626
+ expected: "boolean",
1627
+ code: "invalid_type",
1628
+ input,
1629
+ inst
1630
+ });
1631
+ return payload;
1632
+ };
1633
+ });
1634
+ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1635
+ $ZodType.init(inst, def);
1636
+ inst._zod.pattern = _null;
1637
+ inst._zod.values = /* @__PURE__ */ new Set([null]);
1638
+ inst._zod.parse = (payload, _ctx) => {
1639
+ const input = payload.value;
1640
+ if (input === null)
1641
+ return payload;
1642
+ payload.issues.push({
1643
+ expected: "null",
1644
+ code: "invalid_type",
1645
+ input,
1646
+ inst
1647
+ });
1648
+ return payload;
1649
+ };
1650
+ });
1651
+ var $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => {
1652
+ $ZodType.init(inst, def);
1653
+ inst._zod.parse = (payload) => payload;
1654
+ });
1655
+ var $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
1656
+ $ZodType.init(inst, def);
1657
+ inst._zod.parse = (payload) => payload;
1658
+ });
1659
+ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
1660
+ $ZodType.init(inst, def);
1661
+ inst._zod.parse = (payload, _ctx) => {
1662
+ payload.issues.push({
1663
+ expected: "never",
1664
+ code: "invalid_type",
1665
+ input: payload.value,
1666
+ inst
1667
+ });
1668
+ return payload;
1669
+ };
1670
+ });
1671
+ function handleArrayResult(result, final, index) {
1672
+ if (result.issues.length) {
1673
+ final.issues.push(...prefixIssues(index, result.issues));
1674
+ }
1675
+ final.value[index] = result.value;
1676
+ }
1677
+ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1678
+ $ZodType.init(inst, def);
1679
+ inst._zod.parse = (payload, ctx) => {
1680
+ const input = payload.value;
1681
+ if (!Array.isArray(input)) {
1682
+ payload.issues.push({
1683
+ expected: "array",
1684
+ code: "invalid_type",
1685
+ input,
1686
+ inst
1687
+ });
1688
+ return payload;
1689
+ }
1690
+ payload.value = Array(input.length);
1691
+ const proms = [];
1692
+ for (let i = 0; i < input.length; i++) {
1693
+ const item = input[i];
1694
+ const result = def.element._zod.run({
1695
+ value: item,
1696
+ issues: []
1697
+ }, ctx);
1698
+ if (result instanceof Promise) {
1699
+ proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
1700
+ } else {
1701
+ handleArrayResult(result, payload, i);
1702
+ }
1703
+ }
1704
+ if (proms.length) {
1705
+ return Promise.all(proms).then(() => payload);
1706
+ }
1707
+ return payload;
1708
+ };
1709
+ });
1710
+ function handleObjectResult(result, final, key) {
1711
+ if (result.issues.length) {
1712
+ final.issues.push(...prefixIssues(key, result.issues));
1713
+ }
1714
+ final.value[key] = result.value;
1715
+ }
1716
+ function handleOptionalObjectResult(result, final, key, input) {
1717
+ if (result.issues.length) {
1718
+ if (input[key] === void 0) {
1719
+ if (key in input) {
1720
+ final.value[key] = void 0;
1721
+ } else {
1722
+ final.value[key] = result.value;
1723
+ }
1724
+ } else {
1725
+ final.issues.push(...prefixIssues(key, result.issues));
1726
+ }
1727
+ } else if (result.value === void 0) {
1728
+ if (key in input)
1729
+ final.value[key] = void 0;
1730
+ } else {
1731
+ final.value[key] = result.value;
1732
+ }
1733
+ }
1734
+ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1735
+ $ZodType.init(inst, def);
1736
+ const _normalized = cached(() => {
1737
+ const keys = Object.keys(def.shape);
1738
+ for (const k of keys) {
1739
+ if (!(def.shape[k] instanceof $ZodType)) {
1740
+ throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
1741
+ }
1742
+ }
1743
+ const okeys = optionalKeys(def.shape);
1744
+ return {
1745
+ shape: def.shape,
1746
+ keys,
1747
+ keySet: new Set(keys),
1748
+ numKeys: keys.length,
1749
+ optionalKeys: new Set(okeys)
1750
+ };
1751
+ });
1752
+ defineLazy(inst._zod, "propValues", () => {
1753
+ const shape = def.shape;
1754
+ const propValues = {};
1755
+ for (const key in shape) {
1756
+ const field = shape[key]._zod;
1757
+ if (field.values) {
1758
+ propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
1759
+ for (const v of field.values)
1760
+ propValues[key].add(v);
1761
+ }
1762
+ }
1763
+ return propValues;
1764
+ });
1765
+ const generateFastpass = (shape) => {
1766
+ const doc = new Doc(["shape", "payload", "ctx"]);
1767
+ const normalized = _normalized.value;
1768
+ const parseStr = (key) => {
1769
+ const k = esc(key);
1770
+ return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1771
+ };
1772
+ doc.write(`const input = payload.value;`);
1773
+ const ids = /* @__PURE__ */ Object.create(null);
1774
+ let counter = 0;
1775
+ for (const key of normalized.keys) {
1776
+ ids[key] = `key_${counter++}`;
1777
+ }
1778
+ doc.write(`const newResult = {}`);
1779
+ for (const key of normalized.keys) {
1780
+ if (normalized.optionalKeys.has(key)) {
1781
+ const id = ids[key];
1782
+ doc.write(`const ${id} = ${parseStr(key)};`);
1783
+ const k = esc(key);
1784
+ doc.write(`
1785
+ if (${id}.issues.length) {
1786
+ if (input[${k}] === undefined) {
1787
+ if (${k} in input) {
1788
+ newResult[${k}] = undefined;
1789
+ }
1790
+ } else {
1791
+ payload.issues = payload.issues.concat(
1792
+ ${id}.issues.map((iss) => ({
1793
+ ...iss,
1794
+ path: iss.path ? [${k}, ...iss.path] : [${k}],
1795
+ }))
1796
+ );
1797
+ }
1798
+ } else if (${id}.value === undefined) {
1799
+ if (${k} in input) newResult[${k}] = undefined;
1800
+ } else {
1801
+ newResult[${k}] = ${id}.value;
1802
+ }
1803
+ `);
1804
+ } else {
1805
+ const id = ids[key];
1806
+ doc.write(`const ${id} = ${parseStr(key)};`);
1807
+ doc.write(`
1808
+ if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1809
+ ...iss,
1810
+ path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
1811
+ })));`);
1812
+ doc.write(`newResult[${esc(key)}] = ${id}.value`);
1813
+ }
1814
+ }
1815
+ doc.write(`payload.value = newResult;`);
1816
+ doc.write(`return payload;`);
1817
+ const fn = doc.compile();
1818
+ return (payload, ctx) => fn(shape, payload, ctx);
1819
+ };
1820
+ let fastpass;
1821
+ const isObject2 = isObject;
1822
+ const jit = !globalConfig.jitless;
1823
+ const allowsEval2 = allowsEval;
1824
+ const fastEnabled = jit && allowsEval2.value;
1825
+ const catchall = def.catchall;
1826
+ let value;
1827
+ inst._zod.parse = (payload, ctx) => {
1828
+ value ?? (value = _normalized.value);
1829
+ const input = payload.value;
1830
+ if (!isObject2(input)) {
1831
+ payload.issues.push({
1832
+ expected: "object",
1833
+ code: "invalid_type",
1834
+ input,
1835
+ inst
1836
+ });
1837
+ return payload;
1838
+ }
1839
+ const proms = [];
1840
+ if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
1841
+ if (!fastpass)
1842
+ fastpass = generateFastpass(def.shape);
1843
+ payload = fastpass(payload, ctx);
1844
+ } else {
1845
+ payload.value = {};
1846
+ const shape = value.shape;
1847
+ for (const key of value.keys) {
1848
+ const el = shape[key];
1849
+ const r = el._zod.run({ value: input[key], issues: [] }, ctx);
1850
+ const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
1851
+ if (r instanceof Promise) {
1852
+ proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult(r2, payload, key, input) : handleObjectResult(r2, payload, key)));
1853
+ } else if (isOptional) {
1854
+ handleOptionalObjectResult(r, payload, key, input);
1855
+ } else {
1856
+ handleObjectResult(r, payload, key);
1857
+ }
1858
+ }
1859
+ }
1860
+ if (!catchall) {
1861
+ return proms.length ? Promise.all(proms).then(() => payload) : payload;
1862
+ }
1863
+ const unrecognized = [];
1864
+ const keySet = value.keySet;
1865
+ const _catchall = catchall._zod;
1866
+ const t = _catchall.def.type;
1867
+ for (const key of Object.keys(input)) {
1868
+ if (keySet.has(key))
1869
+ continue;
1870
+ if (t === "never") {
1871
+ unrecognized.push(key);
1872
+ continue;
1873
+ }
1874
+ const r = _catchall.run({ value: input[key], issues: [] }, ctx);
1875
+ if (r instanceof Promise) {
1876
+ proms.push(r.then((r2) => handleObjectResult(r2, payload, key)));
1877
+ } else {
1878
+ handleObjectResult(r, payload, key);
1879
+ }
1880
+ }
1881
+ if (unrecognized.length) {
1882
+ payload.issues.push({
1883
+ code: "unrecognized_keys",
1884
+ keys: unrecognized,
1885
+ input,
1886
+ inst
1887
+ });
1888
+ }
1889
+ if (!proms.length)
1890
+ return payload;
1891
+ return Promise.all(proms).then(() => {
1892
+ return payload;
1893
+ });
1894
+ };
1895
+ });
1896
+ function handleUnionResults(results, final, inst, ctx) {
1897
+ for (const result of results) {
1898
+ if (result.issues.length === 0) {
1899
+ final.value = result.value;
1900
+ return final;
1901
+ }
1902
+ }
1903
+ final.issues.push({
1904
+ code: "invalid_union",
1905
+ input: final.value,
1906
+ inst,
1907
+ errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1908
+ });
1909
+ return final;
1910
+ }
1911
+ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
1912
+ $ZodType.init(inst, def);
1913
+ defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
1914
+ defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
1915
+ defineLazy(inst._zod, "values", () => {
1916
+ if (def.options.every((o) => o._zod.values)) {
1917
+ return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
1918
+ }
1919
+ return void 0;
1920
+ });
1921
+ defineLazy(inst._zod, "pattern", () => {
1922
+ if (def.options.every((o) => o._zod.pattern)) {
1923
+ const patterns = def.options.map((o) => o._zod.pattern);
1924
+ return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
1925
+ }
1926
+ return void 0;
1927
+ });
1928
+ inst._zod.parse = (payload, ctx) => {
1929
+ let async = false;
1930
+ const results = [];
1931
+ for (const option of def.options) {
1932
+ const result = option._zod.run({
1933
+ value: payload.value,
1934
+ issues: []
1935
+ }, ctx);
1936
+ if (result instanceof Promise) {
1937
+ results.push(result);
1938
+ async = true;
1939
+ } else {
1940
+ if (result.issues.length === 0)
1941
+ return result;
1942
+ results.push(result);
1943
+ }
1944
+ }
1945
+ if (!async)
1946
+ return handleUnionResults(results, payload, inst, ctx);
1947
+ return Promise.all(results).then((results2) => {
1948
+ return handleUnionResults(results2, payload, inst, ctx);
1949
+ });
1950
+ };
1951
+ });
1952
+ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => {
1953
+ $ZodUnion.init(inst, def);
1954
+ const _super = inst._zod.parse;
1955
+ defineLazy(inst._zod, "propValues", () => {
1956
+ const propValues = {};
1957
+ for (const option of def.options) {
1958
+ const pv = option._zod.propValues;
1959
+ if (!pv || Object.keys(pv).length === 0)
1960
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
1961
+ for (const [k, v] of Object.entries(pv)) {
1962
+ if (!propValues[k])
1963
+ propValues[k] = /* @__PURE__ */ new Set();
1964
+ for (const val of v) {
1965
+ propValues[k].add(val);
1966
+ }
1967
+ }
1968
+ }
1969
+ return propValues;
1970
+ });
1971
+ const disc = cached(() => {
1972
+ const opts = def.options;
1973
+ const map = /* @__PURE__ */ new Map();
1974
+ for (const o of opts) {
1975
+ const values = o._zod.propValues[def.discriminator];
1976
+ if (!values || values.size === 0)
1977
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
1978
+ for (const v of values) {
1979
+ if (map.has(v)) {
1980
+ throw new Error(`Duplicate discriminator value "${String(v)}"`);
1981
+ }
1982
+ map.set(v, o);
1983
+ }
1984
+ }
1985
+ return map;
1986
+ });
1987
+ inst._zod.parse = (payload, ctx) => {
1988
+ const input = payload.value;
1989
+ if (!isObject(input)) {
1990
+ payload.issues.push({
1991
+ code: "invalid_type",
1992
+ expected: "object",
1993
+ input,
1994
+ inst
1995
+ });
1996
+ return payload;
1997
+ }
1998
+ const opt = disc.value.get(input?.[def.discriminator]);
1999
+ if (opt) {
2000
+ return opt._zod.run(payload, ctx);
2001
+ }
2002
+ if (def.unionFallback) {
2003
+ return _super(payload, ctx);
2004
+ }
2005
+ payload.issues.push({
2006
+ code: "invalid_union",
2007
+ errors: [],
2008
+ note: "No matching discriminator",
2009
+ input,
2010
+ path: [def.discriminator],
2011
+ inst
2012
+ });
2013
+ return payload;
2014
+ };
2015
+ });
2016
+ var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
2017
+ $ZodType.init(inst, def);
2018
+ inst._zod.parse = (payload, ctx) => {
2019
+ const input = payload.value;
2020
+ const left = def.left._zod.run({ value: input, issues: [] }, ctx);
2021
+ const right = def.right._zod.run({ value: input, issues: [] }, ctx);
2022
+ const async = left instanceof Promise || right instanceof Promise;
2023
+ if (async) {
2024
+ return Promise.all([left, right]).then(([left2, right2]) => {
2025
+ return handleIntersectionResults(payload, left2, right2);
2026
+ });
2027
+ }
2028
+ return handleIntersectionResults(payload, left, right);
2029
+ };
2030
+ });
2031
+ function mergeValues(a, b) {
2032
+ if (a === b) {
2033
+ return { valid: true, data: a };
2034
+ }
2035
+ if (a instanceof Date && b instanceof Date && +a === +b) {
2036
+ return { valid: true, data: a };
2037
+ }
2038
+ if (isPlainObject(a) && isPlainObject(b)) {
2039
+ const bKeys = Object.keys(b);
2040
+ const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
2041
+ const newObj = { ...a, ...b };
2042
+ for (const key of sharedKeys) {
2043
+ const sharedValue = mergeValues(a[key], b[key]);
2044
+ if (!sharedValue.valid) {
2045
+ return {
2046
+ valid: false,
2047
+ mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
2048
+ };
2049
+ }
2050
+ newObj[key] = sharedValue.data;
2051
+ }
2052
+ return { valid: true, data: newObj };
2053
+ }
2054
+ if (Array.isArray(a) && Array.isArray(b)) {
2055
+ if (a.length !== b.length) {
2056
+ return { valid: false, mergeErrorPath: [] };
2057
+ }
2058
+ const newArray = [];
2059
+ for (let index = 0; index < a.length; index++) {
2060
+ const itemA = a[index];
2061
+ const itemB = b[index];
2062
+ const sharedValue = mergeValues(itemA, itemB);
2063
+ if (!sharedValue.valid) {
2064
+ return {
2065
+ valid: false,
2066
+ mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
2067
+ };
2068
+ }
2069
+ newArray.push(sharedValue.data);
2070
+ }
2071
+ return { valid: true, data: newArray };
2072
+ }
2073
+ return { valid: false, mergeErrorPath: [] };
2074
+ }
2075
+ function handleIntersectionResults(result, left, right) {
2076
+ if (left.issues.length) {
2077
+ result.issues.push(...left.issues);
2078
+ }
2079
+ if (right.issues.length) {
2080
+ result.issues.push(...right.issues);
2081
+ }
2082
+ if (aborted(result))
2083
+ return result;
2084
+ const merged = mergeValues(left.value, right.value);
2085
+ if (!merged.valid) {
2086
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
2087
+ }
2088
+ result.value = merged.data;
2089
+ return result;
2090
+ }
2091
+ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
2092
+ $ZodType.init(inst, def);
2093
+ inst._zod.parse = (payload, ctx) => {
2094
+ const input = payload.value;
2095
+ if (!isPlainObject(input)) {
2096
+ payload.issues.push({
2097
+ expected: "record",
2098
+ code: "invalid_type",
2099
+ input,
2100
+ inst
2101
+ });
2102
+ return payload;
2103
+ }
2104
+ const proms = [];
2105
+ if (def.keyType._zod.values) {
2106
+ const values = def.keyType._zod.values;
2107
+ payload.value = {};
2108
+ for (const key of values) {
2109
+ if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
2110
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
2111
+ if (result instanceof Promise) {
2112
+ proms.push(result.then((result2) => {
2113
+ if (result2.issues.length) {
2114
+ payload.issues.push(...prefixIssues(key, result2.issues));
2115
+ }
2116
+ payload.value[key] = result2.value;
2117
+ }));
2118
+ } else {
2119
+ if (result.issues.length) {
2120
+ payload.issues.push(...prefixIssues(key, result.issues));
2121
+ }
2122
+ payload.value[key] = result.value;
2123
+ }
2124
+ }
2125
+ }
2126
+ let unrecognized;
2127
+ for (const key in input) {
2128
+ if (!values.has(key)) {
2129
+ unrecognized = unrecognized ?? [];
2130
+ unrecognized.push(key);
2131
+ }
2132
+ }
2133
+ if (unrecognized && unrecognized.length > 0) {
2134
+ payload.issues.push({
2135
+ code: "unrecognized_keys",
2136
+ input,
2137
+ inst,
2138
+ keys: unrecognized
2139
+ });
2140
+ }
2141
+ } else {
2142
+ payload.value = {};
2143
+ for (const key of Reflect.ownKeys(input)) {
2144
+ if (key === "__proto__")
2145
+ continue;
2146
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
2147
+ if (keyResult instanceof Promise) {
2148
+ throw new Error("Async schemas not supported in object keys currently");
2149
+ }
2150
+ if (keyResult.issues.length) {
2151
+ payload.issues.push({
2152
+ origin: "record",
2153
+ code: "invalid_key",
2154
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
2155
+ input: key,
2156
+ path: [key],
2157
+ inst
2158
+ });
2159
+ payload.value[keyResult.value] = keyResult.value;
2160
+ continue;
2161
+ }
2162
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
2163
+ if (result instanceof Promise) {
2164
+ proms.push(result.then((result2) => {
2165
+ if (result2.issues.length) {
2166
+ payload.issues.push(...prefixIssues(key, result2.issues));
2167
+ }
2168
+ payload.value[keyResult.value] = result2.value;
2169
+ }));
2170
+ } else {
2171
+ if (result.issues.length) {
2172
+ payload.issues.push(...prefixIssues(key, result.issues));
2173
+ }
2174
+ payload.value[keyResult.value] = result.value;
2175
+ }
2176
+ }
2177
+ }
2178
+ if (proms.length) {
2179
+ return Promise.all(proms).then(() => payload);
2180
+ }
2181
+ return payload;
2182
+ };
2183
+ });
2184
+ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
2185
+ $ZodType.init(inst, def);
2186
+ const values = getEnumValues(def.entries);
2187
+ inst._zod.values = new Set(values);
2188
+ inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
2189
+ inst._zod.parse = (payload, _ctx) => {
2190
+ const input = payload.value;
2191
+ if (inst._zod.values.has(input)) {
2192
+ return payload;
2193
+ }
2194
+ payload.issues.push({
2195
+ code: "invalid_value",
2196
+ values,
2197
+ input,
2198
+ inst
2199
+ });
2200
+ return payload;
2201
+ };
2202
+ });
2203
+ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
2204
+ $ZodType.init(inst, def);
2205
+ inst._zod.values = new Set(def.values);
2206
+ inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? o.toString() : String(o)).join("|")})$`);
2207
+ inst._zod.parse = (payload, _ctx) => {
2208
+ const input = payload.value;
2209
+ if (inst._zod.values.has(input)) {
2210
+ return payload;
2211
+ }
2212
+ payload.issues.push({
2213
+ code: "invalid_value",
2214
+ values: def.values,
2215
+ input,
2216
+ inst
2217
+ });
2218
+ return payload;
2219
+ };
2220
+ });
2221
+ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
2222
+ $ZodType.init(inst, def);
2223
+ inst._zod.parse = (payload, _ctx) => {
2224
+ const _out = def.transform(payload.value, payload);
2225
+ if (_ctx.async) {
2226
+ const output = _out instanceof Promise ? _out : Promise.resolve(_out);
2227
+ return output.then((output2) => {
2228
+ payload.value = output2;
2229
+ return payload;
2230
+ });
2231
+ }
2232
+ if (_out instanceof Promise) {
2233
+ throw new $ZodAsyncError();
2234
+ }
2235
+ payload.value = _out;
2236
+ return payload;
2237
+ };
2238
+ });
2239
+ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
2240
+ $ZodType.init(inst, def);
2241
+ inst._zod.optin = "optional";
2242
+ inst._zod.optout = "optional";
2243
+ defineLazy(inst._zod, "values", () => {
2244
+ return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
2245
+ });
2246
+ defineLazy(inst._zod, "pattern", () => {
2247
+ const pattern = def.innerType._zod.pattern;
2248
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
2249
+ });
2250
+ inst._zod.parse = (payload, ctx) => {
2251
+ if (def.innerType._zod.optin === "optional") {
2252
+ return def.innerType._zod.run(payload, ctx);
2253
+ }
2254
+ if (payload.value === void 0) {
2255
+ return payload;
2256
+ }
2257
+ return def.innerType._zod.run(payload, ctx);
2258
+ };
2259
+ });
2260
+ var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
2261
+ $ZodType.init(inst, def);
2262
+ defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2263
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2264
+ defineLazy(inst._zod, "pattern", () => {
2265
+ const pattern = def.innerType._zod.pattern;
2266
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
2267
+ });
2268
+ defineLazy(inst._zod, "values", () => {
2269
+ return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
2270
+ });
2271
+ inst._zod.parse = (payload, ctx) => {
2272
+ if (payload.value === null)
2273
+ return payload;
2274
+ return def.innerType._zod.run(payload, ctx);
2275
+ };
2276
+ });
2277
+ var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
2278
+ $ZodType.init(inst, def);
2279
+ inst._zod.optin = "optional";
2280
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2281
+ inst._zod.parse = (payload, ctx) => {
2282
+ if (payload.value === void 0) {
2283
+ payload.value = def.defaultValue;
2284
+ return payload;
2285
+ }
2286
+ const result = def.innerType._zod.run(payload, ctx);
2287
+ if (result instanceof Promise) {
2288
+ return result.then((result2) => handleDefaultResult(result2, def));
2289
+ }
2290
+ return handleDefaultResult(result, def);
2291
+ };
2292
+ });
2293
+ function handleDefaultResult(payload, def) {
2294
+ if (payload.value === void 0) {
2295
+ payload.value = def.defaultValue;
2296
+ }
2297
+ return payload;
2298
+ }
2299
+ var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
2300
+ $ZodType.init(inst, def);
2301
+ inst._zod.optin = "optional";
2302
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2303
+ inst._zod.parse = (payload, ctx) => {
2304
+ if (payload.value === void 0) {
2305
+ payload.value = def.defaultValue;
2306
+ }
2307
+ return def.innerType._zod.run(payload, ctx);
2308
+ };
2309
+ });
2310
+ var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
2311
+ $ZodType.init(inst, def);
2312
+ defineLazy(inst._zod, "values", () => {
2313
+ const v = def.innerType._zod.values;
2314
+ return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
2315
+ });
2316
+ inst._zod.parse = (payload, ctx) => {
2317
+ const result = def.innerType._zod.run(payload, ctx);
2318
+ if (result instanceof Promise) {
2319
+ return result.then((result2) => handleNonOptionalResult(result2, inst));
2320
+ }
2321
+ return handleNonOptionalResult(result, inst);
2322
+ };
2323
+ });
2324
+ function handleNonOptionalResult(payload, inst) {
2325
+ if (!payload.issues.length && payload.value === void 0) {
2326
+ payload.issues.push({
2327
+ code: "invalid_type",
2328
+ expected: "nonoptional",
2329
+ input: payload.value,
2330
+ inst
2331
+ });
2332
+ }
2333
+ return payload;
2334
+ }
2335
+ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2336
+ $ZodType.init(inst, def);
2337
+ inst._zod.optin = "optional";
2338
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2339
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2340
+ inst._zod.parse = (payload, ctx) => {
2341
+ const result = def.innerType._zod.run(payload, ctx);
2342
+ if (result instanceof Promise) {
2343
+ return result.then((result2) => {
2344
+ payload.value = result2.value;
2345
+ if (result2.issues.length) {
2346
+ payload.value = def.catchValue({
2347
+ ...payload,
2348
+ error: {
2349
+ issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
2350
+ },
2351
+ input: payload.value
2352
+ });
2353
+ payload.issues = [];
2354
+ }
2355
+ return payload;
2356
+ });
2357
+ }
2358
+ payload.value = result.value;
2359
+ if (result.issues.length) {
2360
+ payload.value = def.catchValue({
2361
+ ...payload,
2362
+ error: {
2363
+ issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
2364
+ },
2365
+ input: payload.value
2366
+ });
2367
+ payload.issues = [];
2368
+ }
2369
+ return payload;
2370
+ };
2371
+ });
2372
+ var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
2373
+ $ZodType.init(inst, def);
2374
+ defineLazy(inst._zod, "values", () => def.in._zod.values);
2375
+ defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2376
+ defineLazy(inst._zod, "optout", () => def.out._zod.optout);
2377
+ inst._zod.parse = (payload, ctx) => {
2378
+ const left = def.in._zod.run(payload, ctx);
2379
+ if (left instanceof Promise) {
2380
+ return left.then((left2) => handlePipeResult(left2, def, ctx));
2381
+ }
2382
+ return handlePipeResult(left, def, ctx);
2383
+ };
2384
+ });
2385
+ function handlePipeResult(left, def, ctx) {
2386
+ if (aborted(left)) {
2387
+ return left;
2388
+ }
2389
+ return def.out._zod.run({ value: left.value, issues: left.issues }, ctx);
2390
+ }
2391
+ var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
2392
+ $ZodType.init(inst, def);
2393
+ defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
2394
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2395
+ defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2396
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2397
+ inst._zod.parse = (payload, ctx) => {
2398
+ const result = def.innerType._zod.run(payload, ctx);
2399
+ if (result instanceof Promise) {
2400
+ return result.then(handleReadonlyResult);
2401
+ }
2402
+ return handleReadonlyResult(result);
2403
+ };
2404
+ });
2405
+ function handleReadonlyResult(payload) {
2406
+ payload.value = Object.freeze(payload.value);
2407
+ return payload;
2408
+ }
2409
+ var $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
2410
+ $ZodType.init(inst, def);
2411
+ defineLazy(inst._zod, "innerType", () => def.getter());
2412
+ defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern);
2413
+ defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues);
2414
+ defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin);
2415
+ defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout);
2416
+ inst._zod.parse = (payload, ctx) => {
2417
+ const inner = inst._zod.innerType;
2418
+ return inner._zod.run(payload, ctx);
2419
+ };
2420
+ });
2421
+ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
2422
+ $ZodCheck.init(inst, def);
2423
+ $ZodType.init(inst, def);
2424
+ inst._zod.parse = (payload, _) => {
2425
+ return payload;
2426
+ };
2427
+ inst._zod.check = (payload) => {
2428
+ const input = payload.value;
2429
+ const r = def.fn(input);
2430
+ if (r instanceof Promise) {
2431
+ return r.then((r2) => handleRefineResult(r2, payload, input, inst));
2432
+ }
2433
+ handleRefineResult(r, payload, input, inst);
2434
+ return;
2435
+ };
2436
+ });
2437
+ function handleRefineResult(result, payload, input, inst) {
2438
+ if (!result) {
2439
+ const _iss = {
2440
+ code: "custom",
2441
+ input,
2442
+ inst,
2443
+ // incorporates params.error into issue reporting
2444
+ path: [...inst._zod.def.path ?? []],
2445
+ // incorporates params.error into issue reporting
2446
+ continue: !inst._zod.def.abort
2447
+ // params: inst._zod.def.params,
2448
+ };
2449
+ if (inst._zod.def.params)
2450
+ _iss.params = inst._zod.def.params;
2451
+ payload.issues.push(issue(_iss));
2452
+ }
2453
+ }
2454
+
2455
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/registries.js
2456
+ var $ZodRegistry = class {
2457
+ constructor() {
2458
+ this._map = /* @__PURE__ */ new Map();
2459
+ this._idmap = /* @__PURE__ */ new Map();
2460
+ }
2461
+ add(schema, ..._meta) {
2462
+ const meta = _meta[0];
2463
+ this._map.set(schema, meta);
2464
+ if (meta && typeof meta === "object" && "id" in meta) {
2465
+ if (this._idmap.has(meta.id)) {
2466
+ throw new Error(`ID ${meta.id} already exists in the registry`);
2467
+ }
2468
+ this._idmap.set(meta.id, schema);
2469
+ }
2470
+ return this;
2471
+ }
2472
+ clear() {
2473
+ this._map = /* @__PURE__ */ new Map();
2474
+ this._idmap = /* @__PURE__ */ new Map();
2475
+ return this;
2476
+ }
2477
+ remove(schema) {
2478
+ const meta = this._map.get(schema);
2479
+ if (meta && typeof meta === "object" && "id" in meta) {
2480
+ this._idmap.delete(meta.id);
2481
+ }
2482
+ this._map.delete(schema);
2483
+ return this;
2484
+ }
2485
+ get(schema) {
2486
+ const p = schema._zod.parent;
2487
+ if (p) {
2488
+ const pm = { ...this.get(p) ?? {} };
2489
+ delete pm.id;
2490
+ return { ...pm, ...this._map.get(schema) };
2491
+ }
2492
+ return this._map.get(schema);
2493
+ }
2494
+ has(schema) {
2495
+ return this._map.has(schema);
2496
+ }
2497
+ };
2498
+ function registry() {
2499
+ return new $ZodRegistry();
2500
+ }
2501
+ var globalRegistry = /* @__PURE__ */ registry();
2502
+
2503
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/api.js
2504
+ function _string(Class2, params) {
2505
+ return new Class2({
2506
+ type: "string",
2507
+ ...normalizeParams(params)
2508
+ });
2509
+ }
2510
+ function _email(Class2, params) {
2511
+ return new Class2({
2512
+ type: "string",
2513
+ format: "email",
2514
+ check: "string_format",
2515
+ abort: false,
2516
+ ...normalizeParams(params)
2517
+ });
2518
+ }
2519
+ function _guid(Class2, params) {
2520
+ return new Class2({
2521
+ type: "string",
2522
+ format: "guid",
2523
+ check: "string_format",
2524
+ abort: false,
2525
+ ...normalizeParams(params)
2526
+ });
2527
+ }
2528
+ function _uuid(Class2, params) {
2529
+ return new Class2({
2530
+ type: "string",
2531
+ format: "uuid",
2532
+ check: "string_format",
2533
+ abort: false,
2534
+ ...normalizeParams(params)
2535
+ });
2536
+ }
2537
+ function _uuidv4(Class2, params) {
2538
+ return new Class2({
2539
+ type: "string",
2540
+ format: "uuid",
2541
+ check: "string_format",
2542
+ abort: false,
2543
+ version: "v4",
2544
+ ...normalizeParams(params)
2545
+ });
2546
+ }
2547
+ function _uuidv6(Class2, params) {
2548
+ return new Class2({
2549
+ type: "string",
2550
+ format: "uuid",
2551
+ check: "string_format",
2552
+ abort: false,
2553
+ version: "v6",
2554
+ ...normalizeParams(params)
2555
+ });
2556
+ }
2557
+ function _uuidv7(Class2, params) {
2558
+ return new Class2({
2559
+ type: "string",
2560
+ format: "uuid",
2561
+ check: "string_format",
2562
+ abort: false,
2563
+ version: "v7",
2564
+ ...normalizeParams(params)
2565
+ });
2566
+ }
2567
+ function _url(Class2, params) {
2568
+ return new Class2({
2569
+ type: "string",
2570
+ format: "url",
2571
+ check: "string_format",
2572
+ abort: false,
2573
+ ...normalizeParams(params)
2574
+ });
2575
+ }
2576
+ function _emoji2(Class2, params) {
2577
+ return new Class2({
2578
+ type: "string",
2579
+ format: "emoji",
2580
+ check: "string_format",
2581
+ abort: false,
2582
+ ...normalizeParams(params)
2583
+ });
2584
+ }
2585
+ function _nanoid(Class2, params) {
2586
+ return new Class2({
2587
+ type: "string",
2588
+ format: "nanoid",
2589
+ check: "string_format",
2590
+ abort: false,
2591
+ ...normalizeParams(params)
2592
+ });
2593
+ }
2594
+ function _cuid(Class2, params) {
2595
+ return new Class2({
2596
+ type: "string",
2597
+ format: "cuid",
2598
+ check: "string_format",
2599
+ abort: false,
2600
+ ...normalizeParams(params)
2601
+ });
2602
+ }
2603
+ function _cuid2(Class2, params) {
2604
+ return new Class2({
2605
+ type: "string",
2606
+ format: "cuid2",
2607
+ check: "string_format",
2608
+ abort: false,
2609
+ ...normalizeParams(params)
2610
+ });
2611
+ }
2612
+ function _ulid(Class2, params) {
2613
+ return new Class2({
2614
+ type: "string",
2615
+ format: "ulid",
2616
+ check: "string_format",
2617
+ abort: false,
2618
+ ...normalizeParams(params)
2619
+ });
2620
+ }
2621
+ function _xid(Class2, params) {
2622
+ return new Class2({
2623
+ type: "string",
2624
+ format: "xid",
2625
+ check: "string_format",
2626
+ abort: false,
2627
+ ...normalizeParams(params)
2628
+ });
2629
+ }
2630
+ function _ksuid(Class2, params) {
2631
+ return new Class2({
2632
+ type: "string",
2633
+ format: "ksuid",
2634
+ check: "string_format",
2635
+ abort: false,
2636
+ ...normalizeParams(params)
2637
+ });
2638
+ }
2639
+ function _ipv4(Class2, params) {
2640
+ return new Class2({
2641
+ type: "string",
2642
+ format: "ipv4",
2643
+ check: "string_format",
2644
+ abort: false,
2645
+ ...normalizeParams(params)
2646
+ });
2647
+ }
2648
+ function _ipv6(Class2, params) {
2649
+ return new Class2({
2650
+ type: "string",
2651
+ format: "ipv6",
2652
+ check: "string_format",
2653
+ abort: false,
2654
+ ...normalizeParams(params)
2655
+ });
2656
+ }
2657
+ function _cidrv4(Class2, params) {
2658
+ return new Class2({
2659
+ type: "string",
2660
+ format: "cidrv4",
2661
+ check: "string_format",
2662
+ abort: false,
2663
+ ...normalizeParams(params)
2664
+ });
2665
+ }
2666
+ function _cidrv6(Class2, params) {
2667
+ return new Class2({
2668
+ type: "string",
2669
+ format: "cidrv6",
2670
+ check: "string_format",
2671
+ abort: false,
2672
+ ...normalizeParams(params)
2673
+ });
2674
+ }
2675
+ function _base64(Class2, params) {
2676
+ return new Class2({
2677
+ type: "string",
2678
+ format: "base64",
2679
+ check: "string_format",
2680
+ abort: false,
2681
+ ...normalizeParams(params)
2682
+ });
2683
+ }
2684
+ function _base64url(Class2, params) {
2685
+ return new Class2({
2686
+ type: "string",
2687
+ format: "base64url",
2688
+ check: "string_format",
2689
+ abort: false,
2690
+ ...normalizeParams(params)
2691
+ });
2692
+ }
2693
+ function _e164(Class2, params) {
2694
+ return new Class2({
2695
+ type: "string",
2696
+ format: "e164",
2697
+ check: "string_format",
2698
+ abort: false,
2699
+ ...normalizeParams(params)
2700
+ });
2701
+ }
2702
+ function _jwt(Class2, params) {
2703
+ return new Class2({
2704
+ type: "string",
2705
+ format: "jwt",
2706
+ check: "string_format",
2707
+ abort: false,
2708
+ ...normalizeParams(params)
2709
+ });
2710
+ }
2711
+ function _isoDateTime(Class2, params) {
2712
+ return new Class2({
2713
+ type: "string",
2714
+ format: "datetime",
2715
+ check: "string_format",
2716
+ offset: false,
2717
+ local: false,
2718
+ precision: null,
2719
+ ...normalizeParams(params)
2720
+ });
2721
+ }
2722
+ function _isoDate(Class2, params) {
2723
+ return new Class2({
2724
+ type: "string",
2725
+ format: "date",
2726
+ check: "string_format",
2727
+ ...normalizeParams(params)
2728
+ });
2729
+ }
2730
+ function _isoTime(Class2, params) {
2731
+ return new Class2({
2732
+ type: "string",
2733
+ format: "time",
2734
+ check: "string_format",
2735
+ precision: null,
2736
+ ...normalizeParams(params)
2737
+ });
2738
+ }
2739
+ function _isoDuration(Class2, params) {
2740
+ return new Class2({
2741
+ type: "string",
2742
+ format: "duration",
2743
+ check: "string_format",
2744
+ ...normalizeParams(params)
2745
+ });
2746
+ }
2747
+ function _number(Class2, params) {
2748
+ return new Class2({
2749
+ type: "number",
2750
+ checks: [],
2751
+ ...normalizeParams(params)
2752
+ });
2753
+ }
2754
+ function _int(Class2, params) {
2755
+ return new Class2({
2756
+ type: "number",
2757
+ check: "number_format",
2758
+ abort: false,
2759
+ format: "safeint",
2760
+ ...normalizeParams(params)
2761
+ });
2762
+ }
2763
+ function _boolean(Class2, params) {
2764
+ return new Class2({
2765
+ type: "boolean",
2766
+ ...normalizeParams(params)
2767
+ });
2768
+ }
2769
+ function _null2(Class2, params) {
2770
+ return new Class2({
2771
+ type: "null",
2772
+ ...normalizeParams(params)
2773
+ });
2774
+ }
2775
+ function _any(Class2) {
2776
+ return new Class2({
2777
+ type: "any"
2778
+ });
2779
+ }
2780
+ function _unknown(Class2) {
2781
+ return new Class2({
2782
+ type: "unknown"
2783
+ });
2784
+ }
2785
+ function _never(Class2, params) {
2786
+ return new Class2({
2787
+ type: "never",
2788
+ ...normalizeParams(params)
2789
+ });
2790
+ }
2791
+ function _lt(value, params) {
2792
+ return new $ZodCheckLessThan({
2793
+ check: "less_than",
2794
+ ...normalizeParams(params),
2795
+ value,
2796
+ inclusive: false
2797
+ });
2798
+ }
2799
+ function _lte(value, params) {
2800
+ return new $ZodCheckLessThan({
2801
+ check: "less_than",
2802
+ ...normalizeParams(params),
2803
+ value,
2804
+ inclusive: true
2805
+ });
2806
+ }
2807
+ function _gt(value, params) {
2808
+ return new $ZodCheckGreaterThan({
2809
+ check: "greater_than",
2810
+ ...normalizeParams(params),
2811
+ value,
2812
+ inclusive: false
2813
+ });
2814
+ }
2815
+ function _gte(value, params) {
2816
+ return new $ZodCheckGreaterThan({
2817
+ check: "greater_than",
2818
+ ...normalizeParams(params),
2819
+ value,
2820
+ inclusive: true
2821
+ });
2822
+ }
2823
+ function _multipleOf(value, params) {
2824
+ return new $ZodCheckMultipleOf({
2825
+ check: "multiple_of",
2826
+ ...normalizeParams(params),
2827
+ value
2828
+ });
2829
+ }
2830
+ function _maxLength(maximum, params) {
2831
+ const ch = new $ZodCheckMaxLength({
2832
+ check: "max_length",
2833
+ ...normalizeParams(params),
2834
+ maximum
2835
+ });
2836
+ return ch;
2837
+ }
2838
+ function _minLength(minimum, params) {
2839
+ return new $ZodCheckMinLength({
2840
+ check: "min_length",
2841
+ ...normalizeParams(params),
2842
+ minimum
2843
+ });
2844
+ }
2845
+ function _length(length, params) {
2846
+ return new $ZodCheckLengthEquals({
2847
+ check: "length_equals",
2848
+ ...normalizeParams(params),
2849
+ length
2850
+ });
2851
+ }
2852
+ function _regex(pattern, params) {
2853
+ return new $ZodCheckRegex({
2854
+ check: "string_format",
2855
+ format: "regex",
2856
+ ...normalizeParams(params),
2857
+ pattern
2858
+ });
2859
+ }
2860
+ function _lowercase(params) {
2861
+ return new $ZodCheckLowerCase({
2862
+ check: "string_format",
2863
+ format: "lowercase",
2864
+ ...normalizeParams(params)
2865
+ });
2866
+ }
2867
+ function _uppercase(params) {
2868
+ return new $ZodCheckUpperCase({
2869
+ check: "string_format",
2870
+ format: "uppercase",
2871
+ ...normalizeParams(params)
2872
+ });
2873
+ }
2874
+ function _includes(includes, params) {
2875
+ return new $ZodCheckIncludes({
2876
+ check: "string_format",
2877
+ format: "includes",
2878
+ ...normalizeParams(params),
2879
+ includes
2880
+ });
2881
+ }
2882
+ function _startsWith(prefix, params) {
2883
+ return new $ZodCheckStartsWith({
2884
+ check: "string_format",
2885
+ format: "starts_with",
2886
+ ...normalizeParams(params),
2887
+ prefix
2888
+ });
2889
+ }
2890
+ function _endsWith(suffix, params) {
2891
+ return new $ZodCheckEndsWith({
2892
+ check: "string_format",
2893
+ format: "ends_with",
2894
+ ...normalizeParams(params),
2895
+ suffix
2896
+ });
2897
+ }
2898
+ function _overwrite(tx) {
2899
+ return new $ZodCheckOverwrite({
2900
+ check: "overwrite",
2901
+ tx
2902
+ });
2903
+ }
2904
+ function _normalize(form) {
2905
+ return _overwrite((input) => input.normalize(form));
2906
+ }
2907
+ function _trim() {
2908
+ return _overwrite((input) => input.trim());
2909
+ }
2910
+ function _toLowerCase() {
2911
+ return _overwrite((input) => input.toLowerCase());
2912
+ }
2913
+ function _toUpperCase() {
2914
+ return _overwrite((input) => input.toUpperCase());
2915
+ }
2916
+ function _array(Class2, element, params) {
2917
+ return new Class2({
2918
+ type: "array",
2919
+ element,
2920
+ // get element() {
2921
+ // return element;
2922
+ // },
2923
+ ...normalizeParams(params)
2924
+ });
2925
+ }
2926
+ function _custom(Class2, fn, _params) {
2927
+ const norm = normalizeParams(_params);
2928
+ norm.abort ?? (norm.abort = true);
2929
+ const schema = new Class2({
2930
+ type: "custom",
2931
+ check: "custom",
2932
+ fn,
2933
+ ...norm
2934
+ });
2935
+ return schema;
2936
+ }
2937
+ function _refine(Class2, fn, _params) {
2938
+ const schema = new Class2({
2939
+ type: "custom",
2940
+ check: "custom",
2941
+ fn,
2942
+ ...normalizeParams(_params)
2943
+ });
2944
+ return schema;
2945
+ }
2946
+
2947
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/to-json-schema.js
2948
+ var JSONSchemaGenerator = class {
2949
+ constructor(params) {
2950
+ this.counter = 0;
2951
+ this.metadataRegistry = params?.metadata ?? globalRegistry;
2952
+ this.target = params?.target ?? "draft-2020-12";
2953
+ this.unrepresentable = params?.unrepresentable ?? "throw";
2954
+ this.override = params?.override ?? (() => {
2955
+ });
2956
+ this.io = params?.io ?? "output";
2957
+ this.seen = /* @__PURE__ */ new Map();
2958
+ }
2959
+ process(schema, _params = { path: [], schemaPath: [] }) {
2960
+ var _a;
2961
+ const def = schema._zod.def;
2962
+ const formatMap = {
2963
+ guid: "uuid",
2964
+ url: "uri",
2965
+ datetime: "date-time",
2966
+ json_string: "json-string",
2967
+ regex: ""
2968
+ // do not set
2969
+ };
2970
+ const seen = this.seen.get(schema);
2971
+ if (seen) {
2972
+ seen.count++;
2973
+ const isCycle = _params.schemaPath.includes(schema);
2974
+ if (isCycle) {
2975
+ seen.cycle = _params.path;
2976
+ }
2977
+ return seen.schema;
2978
+ }
2979
+ const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
2980
+ this.seen.set(schema, result);
2981
+ const overrideSchema = schema._zod.toJSONSchema?.();
2982
+ if (overrideSchema) {
2983
+ result.schema = overrideSchema;
2984
+ } else {
2985
+ const params = {
2986
+ ..._params,
2987
+ schemaPath: [..._params.schemaPath, schema],
2988
+ path: _params.path
2989
+ };
2990
+ const parent = schema._zod.parent;
2991
+ if (parent) {
2992
+ result.ref = parent;
2993
+ this.process(parent, params);
2994
+ this.seen.get(parent).isParent = true;
2995
+ } else {
2996
+ const _json = result.schema;
2997
+ switch (def.type) {
2998
+ case "string": {
2999
+ const json = _json;
3000
+ json.type = "string";
3001
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
3002
+ if (typeof minimum === "number")
3003
+ json.minLength = minimum;
3004
+ if (typeof maximum === "number")
3005
+ json.maxLength = maximum;
3006
+ if (format) {
3007
+ json.format = formatMap[format] ?? format;
3008
+ if (json.format === "")
3009
+ delete json.format;
3010
+ }
3011
+ if (contentEncoding)
3012
+ json.contentEncoding = contentEncoding;
3013
+ if (patterns && patterns.size > 0) {
3014
+ const regexes = [...patterns];
3015
+ if (regexes.length === 1)
3016
+ json.pattern = regexes[0].source;
3017
+ else if (regexes.length > 1) {
3018
+ result.schema.allOf = [
3019
+ ...regexes.map((regex) => ({
3020
+ ...this.target === "draft-7" ? { type: "string" } : {},
3021
+ pattern: regex.source
3022
+ }))
3023
+ ];
3024
+ }
3025
+ }
3026
+ break;
3027
+ }
3028
+ case "number": {
3029
+ const json = _json;
3030
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
3031
+ if (typeof format === "string" && format.includes("int"))
3032
+ json.type = "integer";
3033
+ else
3034
+ json.type = "number";
3035
+ if (typeof exclusiveMinimum === "number")
3036
+ json.exclusiveMinimum = exclusiveMinimum;
3037
+ if (typeof minimum === "number") {
3038
+ json.minimum = minimum;
3039
+ if (typeof exclusiveMinimum === "number") {
3040
+ if (exclusiveMinimum >= minimum)
3041
+ delete json.minimum;
3042
+ else
3043
+ delete json.exclusiveMinimum;
3044
+ }
3045
+ }
3046
+ if (typeof exclusiveMaximum === "number")
3047
+ json.exclusiveMaximum = exclusiveMaximum;
3048
+ if (typeof maximum === "number") {
3049
+ json.maximum = maximum;
3050
+ if (typeof exclusiveMaximum === "number") {
3051
+ if (exclusiveMaximum <= maximum)
3052
+ delete json.maximum;
3053
+ else
3054
+ delete json.exclusiveMaximum;
3055
+ }
3056
+ }
3057
+ if (typeof multipleOf === "number")
3058
+ json.multipleOf = multipleOf;
3059
+ break;
3060
+ }
3061
+ case "boolean": {
3062
+ const json = _json;
3063
+ json.type = "boolean";
3064
+ break;
3065
+ }
3066
+ case "bigint": {
3067
+ if (this.unrepresentable === "throw") {
3068
+ throw new Error("BigInt cannot be represented in JSON Schema");
3069
+ }
3070
+ break;
3071
+ }
3072
+ case "symbol": {
3073
+ if (this.unrepresentable === "throw") {
3074
+ throw new Error("Symbols cannot be represented in JSON Schema");
3075
+ }
3076
+ break;
3077
+ }
3078
+ case "null": {
3079
+ _json.type = "null";
3080
+ break;
3081
+ }
3082
+ case "any": {
3083
+ break;
3084
+ }
3085
+ case "unknown": {
3086
+ break;
3087
+ }
3088
+ case "undefined": {
3089
+ if (this.unrepresentable === "throw") {
3090
+ throw new Error("Undefined cannot be represented in JSON Schema");
3091
+ }
3092
+ break;
3093
+ }
3094
+ case "void": {
3095
+ if (this.unrepresentable === "throw") {
3096
+ throw new Error("Void cannot be represented in JSON Schema");
3097
+ }
3098
+ break;
3099
+ }
3100
+ case "never": {
3101
+ _json.not = {};
3102
+ break;
3103
+ }
3104
+ case "date": {
3105
+ if (this.unrepresentable === "throw") {
3106
+ throw new Error("Date cannot be represented in JSON Schema");
3107
+ }
3108
+ break;
3109
+ }
3110
+ case "array": {
3111
+ const json = _json;
3112
+ const { minimum, maximum } = schema._zod.bag;
3113
+ if (typeof minimum === "number")
3114
+ json.minItems = minimum;
3115
+ if (typeof maximum === "number")
3116
+ json.maxItems = maximum;
3117
+ json.type = "array";
3118
+ json.items = this.process(def.element, { ...params, path: [...params.path, "items"] });
3119
+ break;
3120
+ }
3121
+ case "object": {
3122
+ const json = _json;
3123
+ json.type = "object";
3124
+ json.properties = {};
3125
+ const shape = def.shape;
3126
+ for (const key in shape) {
3127
+ json.properties[key] = this.process(shape[key], {
3128
+ ...params,
3129
+ path: [...params.path, "properties", key]
3130
+ });
3131
+ }
3132
+ const allKeys = new Set(Object.keys(shape));
3133
+ const requiredKeys = new Set([...allKeys].filter((key) => {
3134
+ const v = def.shape[key]._zod;
3135
+ if (this.io === "input") {
3136
+ return v.optin === void 0;
3137
+ } else {
3138
+ return v.optout === void 0;
3139
+ }
3140
+ }));
3141
+ if (requiredKeys.size > 0) {
3142
+ json.required = Array.from(requiredKeys);
3143
+ }
3144
+ if (def.catchall?._zod.def.type === "never") {
3145
+ json.additionalProperties = false;
3146
+ } else if (!def.catchall) {
3147
+ if (this.io === "output")
3148
+ json.additionalProperties = false;
3149
+ } else if (def.catchall) {
3150
+ json.additionalProperties = this.process(def.catchall, {
3151
+ ...params,
3152
+ path: [...params.path, "additionalProperties"]
3153
+ });
3154
+ }
3155
+ break;
3156
+ }
3157
+ case "union": {
3158
+ const json = _json;
3159
+ json.anyOf = def.options.map((x, i) => this.process(x, {
3160
+ ...params,
3161
+ path: [...params.path, "anyOf", i]
3162
+ }));
3163
+ break;
3164
+ }
3165
+ case "intersection": {
3166
+ const json = _json;
3167
+ const a = this.process(def.left, {
3168
+ ...params,
3169
+ path: [...params.path, "allOf", 0]
3170
+ });
3171
+ const b = this.process(def.right, {
3172
+ ...params,
3173
+ path: [...params.path, "allOf", 1]
3174
+ });
3175
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
3176
+ const allOf = [
3177
+ ...isSimpleIntersection(a) ? a.allOf : [a],
3178
+ ...isSimpleIntersection(b) ? b.allOf : [b]
3179
+ ];
3180
+ json.allOf = allOf;
3181
+ break;
3182
+ }
3183
+ case "tuple": {
3184
+ const json = _json;
3185
+ json.type = "array";
3186
+ const prefixItems = def.items.map((x, i) => this.process(x, { ...params, path: [...params.path, "prefixItems", i] }));
3187
+ if (this.target === "draft-2020-12") {
3188
+ json.prefixItems = prefixItems;
3189
+ } else {
3190
+ json.items = prefixItems;
3191
+ }
3192
+ if (def.rest) {
3193
+ const rest = this.process(def.rest, {
3194
+ ...params,
3195
+ path: [...params.path, "items"]
3196
+ });
3197
+ if (this.target === "draft-2020-12") {
3198
+ json.items = rest;
3199
+ } else {
3200
+ json.additionalItems = rest;
3201
+ }
3202
+ }
3203
+ if (def.rest) {
3204
+ json.items = this.process(def.rest, {
3205
+ ...params,
3206
+ path: [...params.path, "items"]
3207
+ });
3208
+ }
3209
+ const { minimum, maximum } = schema._zod.bag;
3210
+ if (typeof minimum === "number")
3211
+ json.minItems = minimum;
3212
+ if (typeof maximum === "number")
3213
+ json.maxItems = maximum;
3214
+ break;
3215
+ }
3216
+ case "record": {
3217
+ const json = _json;
3218
+ json.type = "object";
3219
+ json.propertyNames = this.process(def.keyType, { ...params, path: [...params.path, "propertyNames"] });
3220
+ json.additionalProperties = this.process(def.valueType, {
3221
+ ...params,
3222
+ path: [...params.path, "additionalProperties"]
3223
+ });
3224
+ break;
3225
+ }
3226
+ case "map": {
3227
+ if (this.unrepresentable === "throw") {
3228
+ throw new Error("Map cannot be represented in JSON Schema");
3229
+ }
3230
+ break;
3231
+ }
3232
+ case "set": {
3233
+ if (this.unrepresentable === "throw") {
3234
+ throw new Error("Set cannot be represented in JSON Schema");
3235
+ }
3236
+ break;
3237
+ }
3238
+ case "enum": {
3239
+ const json = _json;
3240
+ const values = getEnumValues(def.entries);
3241
+ if (values.every((v) => typeof v === "number"))
3242
+ json.type = "number";
3243
+ if (values.every((v) => typeof v === "string"))
3244
+ json.type = "string";
3245
+ json.enum = values;
3246
+ break;
3247
+ }
3248
+ case "literal": {
3249
+ const json = _json;
3250
+ const vals = [];
3251
+ for (const val of def.values) {
3252
+ if (val === void 0) {
3253
+ if (this.unrepresentable === "throw") {
3254
+ throw new Error("Literal `undefined` cannot be represented in JSON Schema");
3255
+ } else {
3256
+ }
3257
+ } else if (typeof val === "bigint") {
3258
+ if (this.unrepresentable === "throw") {
3259
+ throw new Error("BigInt literals cannot be represented in JSON Schema");
3260
+ } else {
3261
+ vals.push(Number(val));
3262
+ }
3263
+ } else {
3264
+ vals.push(val);
3265
+ }
3266
+ }
3267
+ if (vals.length === 0) {
3268
+ } else if (vals.length === 1) {
3269
+ const val = vals[0];
3270
+ json.type = val === null ? "null" : typeof val;
3271
+ json.const = val;
3272
+ } else {
3273
+ if (vals.every((v) => typeof v === "number"))
3274
+ json.type = "number";
3275
+ if (vals.every((v) => typeof v === "string"))
3276
+ json.type = "string";
3277
+ if (vals.every((v) => typeof v === "boolean"))
3278
+ json.type = "string";
3279
+ if (vals.every((v) => v === null))
3280
+ json.type = "null";
3281
+ json.enum = vals;
3282
+ }
3283
+ break;
3284
+ }
3285
+ case "file": {
3286
+ const json = _json;
3287
+ const file = {
3288
+ type: "string",
3289
+ format: "binary",
3290
+ contentEncoding: "binary"
3291
+ };
3292
+ const { minimum, maximum, mime } = schema._zod.bag;
3293
+ if (minimum !== void 0)
3294
+ file.minLength = minimum;
3295
+ if (maximum !== void 0)
3296
+ file.maxLength = maximum;
3297
+ if (mime) {
3298
+ if (mime.length === 1) {
3299
+ file.contentMediaType = mime[0];
3300
+ Object.assign(json, file);
3301
+ } else {
3302
+ json.anyOf = mime.map((m) => {
3303
+ const mFile = { ...file, contentMediaType: m };
3304
+ return mFile;
3305
+ });
3306
+ }
3307
+ } else {
3308
+ Object.assign(json, file);
3309
+ }
3310
+ break;
3311
+ }
3312
+ case "transform": {
3313
+ if (this.unrepresentable === "throw") {
3314
+ throw new Error("Transforms cannot be represented in JSON Schema");
3315
+ }
3316
+ break;
3317
+ }
3318
+ case "nullable": {
3319
+ const inner = this.process(def.innerType, params);
3320
+ _json.anyOf = [inner, { type: "null" }];
3321
+ break;
3322
+ }
3323
+ case "nonoptional": {
3324
+ this.process(def.innerType, params);
3325
+ result.ref = def.innerType;
3326
+ break;
3327
+ }
3328
+ case "success": {
3329
+ const json = _json;
3330
+ json.type = "boolean";
3331
+ break;
3332
+ }
3333
+ case "default": {
3334
+ this.process(def.innerType, params);
3335
+ result.ref = def.innerType;
3336
+ _json.default = JSON.parse(JSON.stringify(def.defaultValue));
3337
+ break;
3338
+ }
3339
+ case "prefault": {
3340
+ this.process(def.innerType, params);
3341
+ result.ref = def.innerType;
3342
+ if (this.io === "input")
3343
+ _json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
3344
+ break;
3345
+ }
3346
+ case "catch": {
3347
+ this.process(def.innerType, params);
3348
+ result.ref = def.innerType;
3349
+ let catchValue;
3350
+ try {
3351
+ catchValue = def.catchValue(void 0);
3352
+ } catch {
3353
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
3354
+ }
3355
+ _json.default = catchValue;
3356
+ break;
3357
+ }
3358
+ case "nan": {
3359
+ if (this.unrepresentable === "throw") {
3360
+ throw new Error("NaN cannot be represented in JSON Schema");
3361
+ }
3362
+ break;
3363
+ }
3364
+ case "template_literal": {
3365
+ const json = _json;
3366
+ const pattern = schema._zod.pattern;
3367
+ if (!pattern)
3368
+ throw new Error("Pattern not found in template literal");
3369
+ json.type = "string";
3370
+ json.pattern = pattern.source;
3371
+ break;
3372
+ }
3373
+ case "pipe": {
3374
+ const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
3375
+ this.process(innerType, params);
3376
+ result.ref = innerType;
3377
+ break;
3378
+ }
3379
+ case "readonly": {
3380
+ this.process(def.innerType, params);
3381
+ result.ref = def.innerType;
3382
+ _json.readOnly = true;
3383
+ break;
3384
+ }
3385
+ // passthrough types
3386
+ case "promise": {
3387
+ this.process(def.innerType, params);
3388
+ result.ref = def.innerType;
3389
+ break;
3390
+ }
3391
+ case "optional": {
3392
+ this.process(def.innerType, params);
3393
+ result.ref = def.innerType;
3394
+ break;
3395
+ }
3396
+ case "lazy": {
3397
+ const innerType = schema._zod.innerType;
3398
+ this.process(innerType, params);
3399
+ result.ref = innerType;
3400
+ break;
3401
+ }
3402
+ case "custom": {
3403
+ if (this.unrepresentable === "throw") {
3404
+ throw new Error("Custom types cannot be represented in JSON Schema");
3405
+ }
3406
+ break;
3407
+ }
3408
+ default: {
3409
+ def;
3410
+ }
3411
+ }
3412
+ }
3413
+ }
3414
+ const meta = this.metadataRegistry.get(schema);
3415
+ if (meta)
3416
+ Object.assign(result.schema, meta);
3417
+ if (this.io === "input" && isTransforming(schema)) {
3418
+ delete result.schema.examples;
3419
+ delete result.schema.default;
3420
+ }
3421
+ if (this.io === "input" && result.schema._prefault)
3422
+ (_a = result.schema).default ?? (_a.default = result.schema._prefault);
3423
+ delete result.schema._prefault;
3424
+ const _result = this.seen.get(schema);
3425
+ return _result.schema;
3426
+ }
3427
+ emit(schema, _params) {
3428
+ const params = {
3429
+ cycles: _params?.cycles ?? "ref",
3430
+ reused: _params?.reused ?? "inline",
3431
+ // unrepresentable: _params?.unrepresentable ?? "throw",
3432
+ // uri: _params?.uri ?? ((id) => `${id}`),
3433
+ external: _params?.external ?? void 0
3434
+ };
3435
+ const root = this.seen.get(schema);
3436
+ if (!root)
3437
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
3438
+ const makeURI = (entry) => {
3439
+ const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
3440
+ if (params.external) {
3441
+ const externalId = params.external.registry.get(entry[0])?.id;
3442
+ const uriGenerator = params.external.uri ?? ((id2) => id2);
3443
+ if (externalId) {
3444
+ return { ref: uriGenerator(externalId) };
3445
+ }
3446
+ const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`;
3447
+ entry[1].defId = id;
3448
+ return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
3449
+ }
3450
+ if (entry[1] === root) {
3451
+ return { ref: "#" };
3452
+ }
3453
+ const uriPrefix = `#`;
3454
+ const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
3455
+ const defId = entry[1].schema.id ?? `__schema${this.counter++}`;
3456
+ return { defId, ref: defUriPrefix + defId };
3457
+ };
3458
+ const extractToDef = (entry) => {
3459
+ if (entry[1].schema.$ref) {
3460
+ return;
3461
+ }
3462
+ const seen = entry[1];
3463
+ const { ref, defId } = makeURI(entry);
3464
+ seen.def = { ...seen.schema };
3465
+ if (defId)
3466
+ seen.defId = defId;
3467
+ const schema2 = seen.schema;
3468
+ for (const key in schema2) {
3469
+ delete schema2[key];
3470
+ }
3471
+ schema2.$ref = ref;
3472
+ };
3473
+ if (params.cycles === "throw") {
3474
+ for (const entry of this.seen.entries()) {
3475
+ const seen = entry[1];
3476
+ if (seen.cycle) {
3477
+ throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
3478
+
3479
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
3480
+ }
3481
+ }
3482
+ }
3483
+ for (const entry of this.seen.entries()) {
3484
+ const seen = entry[1];
3485
+ if (schema === entry[0]) {
3486
+ extractToDef(entry);
3487
+ continue;
3488
+ }
3489
+ if (params.external) {
3490
+ const ext = params.external.registry.get(entry[0])?.id;
3491
+ if (schema !== entry[0] && ext) {
3492
+ extractToDef(entry);
3493
+ continue;
3494
+ }
3495
+ }
3496
+ const id = this.metadataRegistry.get(entry[0])?.id;
3497
+ if (id) {
3498
+ extractToDef(entry);
3499
+ continue;
3500
+ }
3501
+ if (seen.cycle) {
3502
+ extractToDef(entry);
3503
+ continue;
3504
+ }
3505
+ if (seen.count > 1) {
3506
+ if (params.reused === "ref") {
3507
+ extractToDef(entry);
3508
+ continue;
3509
+ }
3510
+ }
3511
+ }
3512
+ const flattenRef = (zodSchema, params2) => {
3513
+ const seen = this.seen.get(zodSchema);
3514
+ const schema2 = seen.def ?? seen.schema;
3515
+ const _cached = { ...schema2 };
3516
+ if (seen.ref === null) {
3517
+ return;
3518
+ }
3519
+ const ref = seen.ref;
3520
+ seen.ref = null;
3521
+ if (ref) {
3522
+ flattenRef(ref, params2);
3523
+ const refSchema = this.seen.get(ref).schema;
3524
+ if (refSchema.$ref && params2.target === "draft-7") {
3525
+ schema2.allOf = schema2.allOf ?? [];
3526
+ schema2.allOf.push(refSchema);
3527
+ } else {
3528
+ Object.assign(schema2, refSchema);
3529
+ Object.assign(schema2, _cached);
3530
+ }
3531
+ }
3532
+ if (!seen.isParent)
3533
+ this.override({
3534
+ zodSchema,
3535
+ jsonSchema: schema2,
3536
+ path: seen.path ?? []
3537
+ });
3538
+ };
3539
+ for (const entry of [...this.seen.entries()].reverse()) {
3540
+ flattenRef(entry[0], { target: this.target });
3541
+ }
3542
+ const result = {};
3543
+ if (this.target === "draft-2020-12") {
3544
+ result.$schema = "https://json-schema.org/draft/2020-12/schema";
3545
+ } else if (this.target === "draft-7") {
3546
+ result.$schema = "http://json-schema.org/draft-07/schema#";
3547
+ } else {
3548
+ console.warn(`Invalid target: ${this.target}`);
3549
+ }
3550
+ if (params.external?.uri) {
3551
+ const id = params.external.registry.get(schema)?.id;
3552
+ if (!id)
3553
+ throw new Error("Schema is missing an `id` property");
3554
+ result.$id = params.external.uri(id);
3555
+ }
3556
+ Object.assign(result, root.def);
3557
+ const defs = params.external?.defs ?? {};
3558
+ for (const entry of this.seen.entries()) {
3559
+ const seen = entry[1];
3560
+ if (seen.def && seen.defId) {
3561
+ defs[seen.defId] = seen.def;
3562
+ }
3563
+ }
3564
+ if (params.external) {
3565
+ } else {
3566
+ if (Object.keys(defs).length > 0) {
3567
+ if (this.target === "draft-2020-12") {
3568
+ result.$defs = defs;
3569
+ } else {
3570
+ result.definitions = defs;
3571
+ }
3572
+ }
3573
+ }
3574
+ try {
3575
+ return JSON.parse(JSON.stringify(result));
3576
+ } catch (_err) {
3577
+ throw new Error("Error converting schema to JSON.");
3578
+ }
3579
+ }
3580
+ };
3581
+ function toJSONSchema(input, _params) {
3582
+ if (input instanceof $ZodRegistry) {
3583
+ const gen2 = new JSONSchemaGenerator(_params);
3584
+ const defs = {};
3585
+ for (const entry of input._idmap.entries()) {
3586
+ const [_, schema] = entry;
3587
+ gen2.process(schema);
3588
+ }
3589
+ const schemas = {};
3590
+ const external = {
3591
+ registry: input,
3592
+ uri: _params?.uri,
3593
+ defs
3594
+ };
3595
+ for (const entry of input._idmap.entries()) {
3596
+ const [key, schema] = entry;
3597
+ schemas[key] = gen2.emit(schema, {
3598
+ ..._params,
3599
+ external
3600
+ });
3601
+ }
3602
+ if (Object.keys(defs).length > 0) {
3603
+ const defsSegment = gen2.target === "draft-2020-12" ? "$defs" : "definitions";
3604
+ schemas.__shared = {
3605
+ [defsSegment]: defs
3606
+ };
3607
+ }
3608
+ return { schemas };
3609
+ }
3610
+ const gen = new JSONSchemaGenerator(_params);
3611
+ gen.process(input);
3612
+ return gen.emit(input, _params);
3613
+ }
3614
+ function isTransforming(_schema, _ctx) {
3615
+ const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
3616
+ if (ctx.seen.has(_schema))
3617
+ return false;
3618
+ ctx.seen.add(_schema);
3619
+ const schema = _schema;
3620
+ const def = schema._zod.def;
3621
+ switch (def.type) {
3622
+ case "string":
3623
+ case "number":
3624
+ case "bigint":
3625
+ case "boolean":
3626
+ case "date":
3627
+ case "symbol":
3628
+ case "undefined":
3629
+ case "null":
3630
+ case "any":
3631
+ case "unknown":
3632
+ case "never":
3633
+ case "void":
3634
+ case "literal":
3635
+ case "enum":
3636
+ case "nan":
3637
+ case "file":
3638
+ case "template_literal":
3639
+ return false;
3640
+ case "array": {
3641
+ return isTransforming(def.element, ctx);
3642
+ }
3643
+ case "object": {
3644
+ for (const key in def.shape) {
3645
+ if (isTransforming(def.shape[key], ctx))
3646
+ return true;
3647
+ }
3648
+ return false;
3649
+ }
3650
+ case "union": {
3651
+ for (const option of def.options) {
3652
+ if (isTransforming(option, ctx))
3653
+ return true;
3654
+ }
3655
+ return false;
3656
+ }
3657
+ case "intersection": {
3658
+ return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
3659
+ }
3660
+ case "tuple": {
3661
+ for (const item of def.items) {
3662
+ if (isTransforming(item, ctx))
3663
+ return true;
3664
+ }
3665
+ if (def.rest && isTransforming(def.rest, ctx))
3666
+ return true;
3667
+ return false;
3668
+ }
3669
+ case "record": {
3670
+ return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
3671
+ }
3672
+ case "map": {
3673
+ return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
3674
+ }
3675
+ case "set": {
3676
+ return isTransforming(def.valueType, ctx);
3677
+ }
3678
+ // inner types
3679
+ case "promise":
3680
+ case "optional":
3681
+ case "nonoptional":
3682
+ case "nullable":
3683
+ case "readonly":
3684
+ return isTransforming(def.innerType, ctx);
3685
+ case "lazy":
3686
+ return isTransforming(def.getter(), ctx);
3687
+ case "default": {
3688
+ return isTransforming(def.innerType, ctx);
3689
+ }
3690
+ case "prefault": {
3691
+ return isTransforming(def.innerType, ctx);
3692
+ }
3693
+ case "custom": {
3694
+ return false;
3695
+ }
3696
+ case "transform": {
3697
+ return true;
3698
+ }
3699
+ case "pipe": {
3700
+ return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
3701
+ }
3702
+ case "success": {
3703
+ return false;
3704
+ }
3705
+ case "catch": {
3706
+ return false;
3707
+ }
3708
+ default:
3709
+ def;
3710
+ }
3711
+ throw new Error(`Unknown schema type: ${def.type}`);
3712
+ }
3713
+
3714
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/iso.js
3715
+ var iso_exports = {};
3716
+ __export(iso_exports, {
3717
+ ZodISODate: () => ZodISODate,
3718
+ ZodISODateTime: () => ZodISODateTime,
3719
+ ZodISODuration: () => ZodISODuration,
3720
+ ZodISOTime: () => ZodISOTime,
3721
+ date: () => date2,
3722
+ datetime: () => datetime2,
3723
+ duration: () => duration2,
3724
+ time: () => time2
3725
+ });
3726
+ var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
3727
+ $ZodISODateTime.init(inst, def);
3728
+ ZodStringFormat.init(inst, def);
3729
+ });
3730
+ function datetime2(params) {
3731
+ return _isoDateTime(ZodISODateTime, params);
3732
+ }
3733
+ var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
3734
+ $ZodISODate.init(inst, def);
3735
+ ZodStringFormat.init(inst, def);
3736
+ });
3737
+ function date2(params) {
3738
+ return _isoDate(ZodISODate, params);
3739
+ }
3740
+ var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
3741
+ $ZodISOTime.init(inst, def);
3742
+ ZodStringFormat.init(inst, def);
3743
+ });
3744
+ function time2(params) {
3745
+ return _isoTime(ZodISOTime, params);
3746
+ }
3747
+ var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
3748
+ $ZodISODuration.init(inst, def);
3749
+ ZodStringFormat.init(inst, def);
3750
+ });
3751
+ function duration2(params) {
3752
+ return _isoDuration(ZodISODuration, params);
3753
+ }
3754
+
3755
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/errors.js
3756
+ var initializer2 = (inst, issues) => {
3757
+ $ZodError.init(inst, issues);
3758
+ inst.name = "ZodError";
3759
+ Object.defineProperties(inst, {
3760
+ format: {
3761
+ value: (mapper) => formatError(inst, mapper)
3762
+ // enumerable: false,
3763
+ },
3764
+ flatten: {
3765
+ value: (mapper) => flattenError(inst, mapper)
3766
+ // enumerable: false,
3767
+ },
3768
+ addIssue: {
3769
+ value: (issue2) => inst.issues.push(issue2)
3770
+ // enumerable: false,
3771
+ },
3772
+ addIssues: {
3773
+ value: (issues2) => inst.issues.push(...issues2)
3774
+ // enumerable: false,
3775
+ },
3776
+ isEmpty: {
3777
+ get() {
3778
+ return inst.issues.length === 0;
3779
+ }
3780
+ // enumerable: false,
3781
+ }
3782
+ });
3783
+ };
3784
+ var ZodError = $constructor("ZodError", initializer2);
3785
+ var ZodRealError = $constructor("ZodError", initializer2, {
3786
+ Parent: Error
3787
+ });
3788
+
3789
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/parse.js
3790
+ var parse2 = /* @__PURE__ */ _parse(ZodRealError);
3791
+ var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
3792
+ var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
3793
+ var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
3794
+
3795
+ // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/classic/schemas.js
3796
+ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3797
+ $ZodType.init(inst, def);
3798
+ inst.def = def;
3799
+ Object.defineProperty(inst, "_def", { value: def });
3800
+ inst.check = (...checks) => {
3801
+ return inst.clone(
3802
+ {
3803
+ ...def,
3804
+ checks: [
3805
+ ...def.checks ?? [],
3806
+ ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
3807
+ ]
3808
+ }
3809
+ // { parent: true }
3810
+ );
3811
+ };
3812
+ inst.clone = (def2, params) => clone(inst, def2, params);
3813
+ inst.brand = () => inst;
3814
+ inst.register = ((reg, meta) => {
3815
+ reg.add(inst, meta);
3816
+ return inst;
3817
+ });
3818
+ inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
3819
+ inst.safeParse = (data, params) => safeParse2(inst, data, params);
3820
+ inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
3821
+ inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
3822
+ inst.spa = inst.safeParseAsync;
3823
+ inst.refine = (check2, params) => inst.check(refine(check2, params));
3824
+ inst.superRefine = (refinement) => inst.check(superRefine(refinement));
3825
+ inst.overwrite = (fn) => inst.check(_overwrite(fn));
3826
+ inst.optional = () => optional(inst);
3827
+ inst.nullable = () => nullable(inst);
3828
+ inst.nullish = () => optional(nullable(inst));
3829
+ inst.nonoptional = (params) => nonoptional(inst, params);
3830
+ inst.array = () => array(inst);
3831
+ inst.or = (arg) => union([inst, arg]);
3832
+ inst.and = (arg) => intersection(inst, arg);
3833
+ inst.transform = (tx) => pipe(inst, transform(tx));
3834
+ inst.default = (def2) => _default(inst, def2);
3835
+ inst.prefault = (def2) => prefault(inst, def2);
3836
+ inst.catch = (params) => _catch(inst, params);
3837
+ inst.pipe = (target) => pipe(inst, target);
3838
+ inst.readonly = () => readonly(inst);
3839
+ inst.describe = (description) => {
3840
+ const cl = inst.clone();
3841
+ globalRegistry.add(cl, { description });
3842
+ return cl;
3843
+ };
3844
+ Object.defineProperty(inst, "description", {
3845
+ get() {
3846
+ return globalRegistry.get(inst)?.description;
3847
+ },
3848
+ configurable: true
3849
+ });
3850
+ inst.meta = (...args) => {
3851
+ if (args.length === 0) {
3852
+ return globalRegistry.get(inst);
3853
+ }
3854
+ const cl = inst.clone();
3855
+ globalRegistry.add(cl, args[0]);
3856
+ return cl;
3857
+ };
3858
+ inst.isOptional = () => inst.safeParse(void 0).success;
3859
+ inst.isNullable = () => inst.safeParse(null).success;
3860
+ return inst;
3861
+ });
3862
+ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
3863
+ $ZodString.init(inst, def);
3864
+ ZodType.init(inst, def);
3865
+ const bag = inst._zod.bag;
3866
+ inst.format = bag.format ?? null;
3867
+ inst.minLength = bag.minimum ?? null;
3868
+ inst.maxLength = bag.maximum ?? null;
3869
+ inst.regex = (...args) => inst.check(_regex(...args));
3870
+ inst.includes = (...args) => inst.check(_includes(...args));
3871
+ inst.startsWith = (...args) => inst.check(_startsWith(...args));
3872
+ inst.endsWith = (...args) => inst.check(_endsWith(...args));
3873
+ inst.min = (...args) => inst.check(_minLength(...args));
3874
+ inst.max = (...args) => inst.check(_maxLength(...args));
3875
+ inst.length = (...args) => inst.check(_length(...args));
3876
+ inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
3877
+ inst.lowercase = (params) => inst.check(_lowercase(params));
3878
+ inst.uppercase = (params) => inst.check(_uppercase(params));
3879
+ inst.trim = () => inst.check(_trim());
3880
+ inst.normalize = (...args) => inst.check(_normalize(...args));
3881
+ inst.toLowerCase = () => inst.check(_toLowerCase());
3882
+ inst.toUpperCase = () => inst.check(_toUpperCase());
3883
+ });
3884
+ var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
3885
+ $ZodString.init(inst, def);
3886
+ _ZodString.init(inst, def);
3887
+ inst.email = (params) => inst.check(_email(ZodEmail, params));
3888
+ inst.url = (params) => inst.check(_url(ZodURL, params));
3889
+ inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
3890
+ inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params));
3891
+ inst.guid = (params) => inst.check(_guid(ZodGUID, params));
3892
+ inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
3893
+ inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
3894
+ inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
3895
+ inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
3896
+ inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
3897
+ inst.guid = (params) => inst.check(_guid(ZodGUID, params));
3898
+ inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
3899
+ inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
3900
+ inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
3901
+ inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
3902
+ inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
3903
+ inst.xid = (params) => inst.check(_xid(ZodXID, params));
3904
+ inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
3905
+ inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
3906
+ inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
3907
+ inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
3908
+ inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
3909
+ inst.e164 = (params) => inst.check(_e164(ZodE164, params));
3910
+ inst.datetime = (params) => inst.check(datetime2(params));
3911
+ inst.date = (params) => inst.check(date2(params));
3912
+ inst.time = (params) => inst.check(time2(params));
3913
+ inst.duration = (params) => inst.check(duration2(params));
3914
+ });
3915
+ function string2(params) {
3916
+ return _string(ZodString, params);
3917
+ }
3918
+ var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
3919
+ $ZodStringFormat.init(inst, def);
3920
+ _ZodString.init(inst, def);
3921
+ });
3922
+ var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
3923
+ $ZodEmail.init(inst, def);
3924
+ ZodStringFormat.init(inst, def);
3925
+ });
3926
+ var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
3927
+ $ZodGUID.init(inst, def);
3928
+ ZodStringFormat.init(inst, def);
3929
+ });
3930
+ var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
3931
+ $ZodUUID.init(inst, def);
3932
+ ZodStringFormat.init(inst, def);
3933
+ });
3934
+ var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
3935
+ $ZodURL.init(inst, def);
3936
+ ZodStringFormat.init(inst, def);
3937
+ });
3938
+ var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
3939
+ $ZodEmoji.init(inst, def);
3940
+ ZodStringFormat.init(inst, def);
3941
+ });
3942
+ var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
3943
+ $ZodNanoID.init(inst, def);
3944
+ ZodStringFormat.init(inst, def);
3945
+ });
3946
+ var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
3947
+ $ZodCUID.init(inst, def);
3948
+ ZodStringFormat.init(inst, def);
3949
+ });
3950
+ var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
3951
+ $ZodCUID2.init(inst, def);
3952
+ ZodStringFormat.init(inst, def);
3953
+ });
3954
+ var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
3955
+ $ZodULID.init(inst, def);
3956
+ ZodStringFormat.init(inst, def);
3957
+ });
3958
+ var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
3959
+ $ZodXID.init(inst, def);
3960
+ ZodStringFormat.init(inst, def);
3961
+ });
3962
+ var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
3963
+ $ZodKSUID.init(inst, def);
3964
+ ZodStringFormat.init(inst, def);
3965
+ });
3966
+ var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
3967
+ $ZodIPv4.init(inst, def);
3968
+ ZodStringFormat.init(inst, def);
3969
+ });
3970
+ var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
3971
+ $ZodIPv6.init(inst, def);
3972
+ ZodStringFormat.init(inst, def);
3973
+ });
3974
+ var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
3975
+ $ZodCIDRv4.init(inst, def);
3976
+ ZodStringFormat.init(inst, def);
3977
+ });
3978
+ var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
3979
+ $ZodCIDRv6.init(inst, def);
3980
+ ZodStringFormat.init(inst, def);
3981
+ });
3982
+ var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
3983
+ $ZodBase64.init(inst, def);
3984
+ ZodStringFormat.init(inst, def);
3985
+ });
3986
+ var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
3987
+ $ZodBase64URL.init(inst, def);
3988
+ ZodStringFormat.init(inst, def);
3989
+ });
3990
+ var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
3991
+ $ZodE164.init(inst, def);
3992
+ ZodStringFormat.init(inst, def);
3993
+ });
3994
+ var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
3995
+ $ZodJWT.init(inst, def);
3996
+ ZodStringFormat.init(inst, def);
3997
+ });
3998
+ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
3999
+ $ZodNumber.init(inst, def);
4000
+ ZodType.init(inst, def);
4001
+ inst.gt = (value, params) => inst.check(_gt(value, params));
4002
+ inst.gte = (value, params) => inst.check(_gte(value, params));
4003
+ inst.min = (value, params) => inst.check(_gte(value, params));
4004
+ inst.lt = (value, params) => inst.check(_lt(value, params));
4005
+ inst.lte = (value, params) => inst.check(_lte(value, params));
4006
+ inst.max = (value, params) => inst.check(_lte(value, params));
4007
+ inst.int = (params) => inst.check(int(params));
4008
+ inst.safe = (params) => inst.check(int(params));
4009
+ inst.positive = (params) => inst.check(_gt(0, params));
4010
+ inst.nonnegative = (params) => inst.check(_gte(0, params));
4011
+ inst.negative = (params) => inst.check(_lt(0, params));
4012
+ inst.nonpositive = (params) => inst.check(_lte(0, params));
4013
+ inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
4014
+ inst.step = (value, params) => inst.check(_multipleOf(value, params));
4015
+ inst.finite = () => inst;
4016
+ const bag = inst._zod.bag;
4017
+ inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
4018
+ inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
4019
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
4020
+ inst.isFinite = true;
4021
+ inst.format = bag.format ?? null;
4022
+ });
4023
+ function number2(params) {
4024
+ return _number(ZodNumber, params);
4025
+ }
4026
+ var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
4027
+ $ZodNumberFormat.init(inst, def);
4028
+ ZodNumber.init(inst, def);
4029
+ });
4030
+ function int(params) {
4031
+ return _int(ZodNumberFormat, params);
4032
+ }
4033
+ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
4034
+ $ZodBoolean.init(inst, def);
4035
+ ZodType.init(inst, def);
4036
+ });
4037
+ function boolean2(params) {
4038
+ return _boolean(ZodBoolean, params);
4039
+ }
4040
+ var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
4041
+ $ZodNull.init(inst, def);
4042
+ ZodType.init(inst, def);
4043
+ });
4044
+ function _null3(params) {
4045
+ return _null2(ZodNull, params);
4046
+ }
4047
+ var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
4048
+ $ZodAny.init(inst, def);
4049
+ ZodType.init(inst, def);
4050
+ });
4051
+ function any() {
4052
+ return _any(ZodAny);
4053
+ }
4054
+ var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
4055
+ $ZodUnknown.init(inst, def);
4056
+ ZodType.init(inst, def);
4057
+ });
4058
+ function unknown() {
4059
+ return _unknown(ZodUnknown);
4060
+ }
4061
+ var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
4062
+ $ZodNever.init(inst, def);
4063
+ ZodType.init(inst, def);
4064
+ });
4065
+ function never(params) {
4066
+ return _never(ZodNever, params);
4067
+ }
4068
+ var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
4069
+ $ZodArray.init(inst, def);
4070
+ ZodType.init(inst, def);
4071
+ inst.element = def.element;
4072
+ inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
4073
+ inst.nonempty = (params) => inst.check(_minLength(1, params));
4074
+ inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
4075
+ inst.length = (len, params) => inst.check(_length(len, params));
4076
+ inst.unwrap = () => inst.element;
4077
+ });
4078
+ function array(element, params) {
4079
+ return _array(ZodArray, element, params);
4080
+ }
4081
+ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
4082
+ $ZodObject.init(inst, def);
4083
+ ZodType.init(inst, def);
4084
+ util_exports.defineLazy(inst, "shape", () => def.shape);
4085
+ inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
4086
+ inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall });
4087
+ inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
4088
+ inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
4089
+ inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
4090
+ inst.strip = () => inst.clone({ ...inst._zod.def, catchall: void 0 });
4091
+ inst.extend = (incoming) => {
4092
+ return util_exports.extend(inst, incoming);
4093
+ };
4094
+ inst.merge = (other) => util_exports.merge(inst, other);
4095
+ inst.pick = (mask) => util_exports.pick(inst, mask);
4096
+ inst.omit = (mask) => util_exports.omit(inst, mask);
4097
+ inst.partial = (...args) => util_exports.partial(ZodOptional, inst, args[0]);
4098
+ inst.required = (...args) => util_exports.required(ZodNonOptional, inst, args[0]);
4099
+ });
4100
+ function object(shape, params) {
4101
+ const def = {
4102
+ type: "object",
4103
+ get shape() {
4104
+ util_exports.assignProp(this, "shape", { ...shape });
4105
+ return this.shape;
4106
+ },
4107
+ ...util_exports.normalizeParams(params)
4108
+ };
4109
+ return new ZodObject(def);
4110
+ }
4111
+ function looseObject(shape, params) {
4112
+ return new ZodObject({
4113
+ type: "object",
4114
+ get shape() {
4115
+ util_exports.assignProp(this, "shape", { ...shape });
4116
+ return this.shape;
4117
+ },
4118
+ catchall: unknown(),
4119
+ ...util_exports.normalizeParams(params)
4120
+ });
4121
+ }
4122
+ var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
4123
+ $ZodUnion.init(inst, def);
4124
+ ZodType.init(inst, def);
4125
+ inst.options = def.options;
4126
+ });
4127
+ function union(options, params) {
4128
+ return new ZodUnion({
4129
+ type: "union",
4130
+ options,
4131
+ ...util_exports.normalizeParams(params)
4132
+ });
4133
+ }
4134
+ var ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
4135
+ ZodUnion.init(inst, def);
4136
+ $ZodDiscriminatedUnion.init(inst, def);
4137
+ });
4138
+ function discriminatedUnion(discriminator, options, params) {
4139
+ return new ZodDiscriminatedUnion({
4140
+ type: "union",
4141
+ options,
4142
+ discriminator,
4143
+ ...util_exports.normalizeParams(params)
4144
+ });
4145
+ }
4146
+ var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
4147
+ $ZodIntersection.init(inst, def);
4148
+ ZodType.init(inst, def);
4149
+ });
4150
+ function intersection(left, right) {
4151
+ return new ZodIntersection({
4152
+ type: "intersection",
4153
+ left,
4154
+ right
4155
+ });
4156
+ }
4157
+ var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
4158
+ $ZodRecord.init(inst, def);
4159
+ ZodType.init(inst, def);
4160
+ inst.keyType = def.keyType;
4161
+ inst.valueType = def.valueType;
4162
+ });
4163
+ function record(keyType, valueType, params) {
4164
+ return new ZodRecord({
4165
+ type: "record",
4166
+ keyType,
4167
+ valueType,
4168
+ ...util_exports.normalizeParams(params)
4169
+ });
4170
+ }
4171
+ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
4172
+ $ZodEnum.init(inst, def);
4173
+ ZodType.init(inst, def);
4174
+ inst.enum = def.entries;
4175
+ inst.options = Object.values(def.entries);
4176
+ const keys = new Set(Object.keys(def.entries));
4177
+ inst.extract = (values, params) => {
4178
+ const newEntries = {};
4179
+ for (const value of values) {
4180
+ if (keys.has(value)) {
4181
+ newEntries[value] = def.entries[value];
4182
+ } else
4183
+ throw new Error(`Key ${value} not found in enum`);
4184
+ }
4185
+ return new ZodEnum({
4186
+ ...def,
4187
+ checks: [],
4188
+ ...util_exports.normalizeParams(params),
4189
+ entries: newEntries
4190
+ });
4191
+ };
4192
+ inst.exclude = (values, params) => {
4193
+ const newEntries = { ...def.entries };
4194
+ for (const value of values) {
4195
+ if (keys.has(value)) {
4196
+ delete newEntries[value];
4197
+ } else
4198
+ throw new Error(`Key ${value} not found in enum`);
4199
+ }
4200
+ return new ZodEnum({
4201
+ ...def,
4202
+ checks: [],
4203
+ ...util_exports.normalizeParams(params),
4204
+ entries: newEntries
4205
+ });
4206
+ };
4207
+ });
4208
+ function _enum(values, params) {
4209
+ const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
4210
+ return new ZodEnum({
4211
+ type: "enum",
4212
+ entries,
4213
+ ...util_exports.normalizeParams(params)
4214
+ });
4215
+ }
4216
+ var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
4217
+ $ZodLiteral.init(inst, def);
4218
+ ZodType.init(inst, def);
4219
+ inst.values = new Set(def.values);
4220
+ Object.defineProperty(inst, "value", {
4221
+ get() {
4222
+ if (def.values.length > 1) {
4223
+ throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
4224
+ }
4225
+ return def.values[0];
4226
+ }
4227
+ });
4228
+ });
4229
+ function literal(value, params) {
4230
+ return new ZodLiteral({
4231
+ type: "literal",
4232
+ values: Array.isArray(value) ? value : [value],
4233
+ ...util_exports.normalizeParams(params)
4234
+ });
4235
+ }
4236
+ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
4237
+ $ZodTransform.init(inst, def);
4238
+ ZodType.init(inst, def);
4239
+ inst._zod.parse = (payload, _ctx) => {
4240
+ payload.addIssue = (issue2) => {
4241
+ if (typeof issue2 === "string") {
4242
+ payload.issues.push(util_exports.issue(issue2, payload.value, def));
4243
+ } else {
4244
+ const _issue = issue2;
4245
+ if (_issue.fatal)
4246
+ _issue.continue = false;
4247
+ _issue.code ?? (_issue.code = "custom");
4248
+ _issue.input ?? (_issue.input = payload.value);
4249
+ _issue.inst ?? (_issue.inst = inst);
4250
+ _issue.continue ?? (_issue.continue = true);
4251
+ payload.issues.push(util_exports.issue(_issue));
4252
+ }
4253
+ };
4254
+ const output = def.transform(payload.value, payload);
4255
+ if (output instanceof Promise) {
4256
+ return output.then((output2) => {
4257
+ payload.value = output2;
4258
+ return payload;
4259
+ });
4260
+ }
4261
+ payload.value = output;
4262
+ return payload;
4263
+ };
4264
+ });
4265
+ function transform(fn) {
4266
+ return new ZodTransform({
4267
+ type: "transform",
4268
+ transform: fn
4269
+ });
4270
+ }
4271
+ var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
4272
+ $ZodOptional.init(inst, def);
4273
+ ZodType.init(inst, def);
4274
+ inst.unwrap = () => inst._zod.def.innerType;
4275
+ });
4276
+ function optional(innerType) {
4277
+ return new ZodOptional({
4278
+ type: "optional",
4279
+ innerType
4280
+ });
4281
+ }
4282
+ var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
4283
+ $ZodNullable.init(inst, def);
4284
+ ZodType.init(inst, def);
4285
+ inst.unwrap = () => inst._zod.def.innerType;
4286
+ });
4287
+ function nullable(innerType) {
4288
+ return new ZodNullable({
4289
+ type: "nullable",
4290
+ innerType
4291
+ });
4292
+ }
4293
+ var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
4294
+ $ZodDefault.init(inst, def);
4295
+ ZodType.init(inst, def);
4296
+ inst.unwrap = () => inst._zod.def.innerType;
4297
+ inst.removeDefault = inst.unwrap;
4298
+ });
4299
+ function _default(innerType, defaultValue) {
4300
+ return new ZodDefault({
4301
+ type: "default",
4302
+ innerType,
4303
+ get defaultValue() {
4304
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
4305
+ }
4306
+ });
4307
+ }
4308
+ var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
4309
+ $ZodPrefault.init(inst, def);
4310
+ ZodType.init(inst, def);
4311
+ inst.unwrap = () => inst._zod.def.innerType;
4312
+ });
4313
+ function prefault(innerType, defaultValue) {
4314
+ return new ZodPrefault({
4315
+ type: "prefault",
4316
+ innerType,
4317
+ get defaultValue() {
4318
+ return typeof defaultValue === "function" ? defaultValue() : defaultValue;
4319
+ }
4320
+ });
4321
+ }
4322
+ var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
4323
+ $ZodNonOptional.init(inst, def);
4324
+ ZodType.init(inst, def);
4325
+ inst.unwrap = () => inst._zod.def.innerType;
4326
+ });
4327
+ function nonoptional(innerType, params) {
4328
+ return new ZodNonOptional({
4329
+ type: "nonoptional",
4330
+ innerType,
4331
+ ...util_exports.normalizeParams(params)
4332
+ });
4333
+ }
4334
+ var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
4335
+ $ZodCatch.init(inst, def);
4336
+ ZodType.init(inst, def);
4337
+ inst.unwrap = () => inst._zod.def.innerType;
4338
+ inst.removeCatch = inst.unwrap;
4339
+ });
4340
+ function _catch(innerType, catchValue) {
4341
+ return new ZodCatch({
4342
+ type: "catch",
4343
+ innerType,
4344
+ catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
4345
+ });
4346
+ }
4347
+ var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
4348
+ $ZodPipe.init(inst, def);
4349
+ ZodType.init(inst, def);
4350
+ inst.in = def.in;
4351
+ inst.out = def.out;
4352
+ });
4353
+ function pipe(in_, out) {
4354
+ return new ZodPipe({
4355
+ type: "pipe",
4356
+ in: in_,
4357
+ out
4358
+ // ...util.normalizeParams(params),
4359
+ });
4360
+ }
4361
+ var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
4362
+ $ZodReadonly.init(inst, def);
4363
+ ZodType.init(inst, def);
4364
+ });
4365
+ function readonly(innerType) {
4366
+ return new ZodReadonly({
4367
+ type: "readonly",
4368
+ innerType
4369
+ });
4370
+ }
4371
+ var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
4372
+ $ZodLazy.init(inst, def);
4373
+ ZodType.init(inst, def);
4374
+ inst.unwrap = () => inst._zod.def.getter();
4375
+ });
4376
+ function lazy(getter) {
4377
+ return new ZodLazy({
4378
+ type: "lazy",
4379
+ getter
4380
+ });
4381
+ }
4382
+ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
4383
+ $ZodCustom.init(inst, def);
4384
+ ZodType.init(inst, def);
4385
+ });
4386
+ function check(fn) {
4387
+ const ch = new $ZodCheck({
4388
+ check: "custom"
4389
+ // ...util.normalizeParams(params),
4390
+ });
4391
+ ch._zod.check = fn;
4392
+ return ch;
4393
+ }
4394
+ function custom(fn, _params) {
4395
+ return _custom(ZodCustom, fn ?? (() => true), _params);
4396
+ }
4397
+ function refine(fn, _params = {}) {
4398
+ return _refine(ZodCustom, fn, _params);
4399
+ }
4400
+ function superRefine(fn) {
4401
+ const ch = check((payload) => {
4402
+ payload.addIssue = (issue2) => {
4403
+ if (typeof issue2 === "string") {
4404
+ payload.issues.push(util_exports.issue(issue2, payload.value, ch._zod.def));
4405
+ } else {
4406
+ const _issue = issue2;
4407
+ if (_issue.fatal)
4408
+ _issue.continue = false;
4409
+ _issue.code ?? (_issue.code = "custom");
4410
+ _issue.input ?? (_issue.input = payload.value);
4411
+ _issue.inst ?? (_issue.inst = ch);
4412
+ _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
4413
+ payload.issues.push(util_exports.issue(_issue));
4414
+ }
4415
+ };
4416
+ return fn(payload.value, payload);
4417
+ });
4418
+ return ch;
4419
+ }
4420
+ function _instanceof(cls, params = {
4421
+ error: `Input not instance of ${cls.name}`
4422
+ }) {
4423
+ const inst = new ZodCustom({
4424
+ type: "custom",
4425
+ check: "custom",
4426
+ fn: (data) => data instanceof cls,
4427
+ abort: true,
4428
+ ...util_exports.normalizeParams(params)
4429
+ });
4430
+ inst._zod.bag.Class = cls;
4431
+ return inst;
4432
+ }
4433
+ function preprocess(fn, schema) {
4434
+ return pipe(transform(fn), schema);
4435
+ }
4436
+
4437
+ export {
4438
+ $constructor,
4439
+ config,
4440
+ joinValues,
4441
+ clone,
4442
+ stringifyPrimitive,
4443
+ util_exports,
4444
+ parse,
4445
+ parseAsync,
4446
+ safeParse,
4447
+ safeParseAsync,
4448
+ $ZodType,
4449
+ $ZodObject,
4450
+ toJSONSchema,
4451
+ iso_exports,
4452
+ safeParseAsync2,
4453
+ string2 as string,
4454
+ number2 as number,
4455
+ boolean2 as boolean,
4456
+ _null3 as _null,
4457
+ any,
4458
+ unknown,
4459
+ never,
4460
+ array,
4461
+ object,
4462
+ looseObject,
4463
+ union,
4464
+ discriminatedUnion,
4465
+ intersection,
4466
+ record,
4467
+ _enum,
4468
+ literal,
4469
+ optional,
4470
+ lazy,
4471
+ custom,
4472
+ _instanceof,
4473
+ preprocess
4474
+ };