@openclaw/discord 2026.7.2-beta.1 → 2026.7.2-beta.3

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 (1710) hide show
  1. package/dist/account-inspect-api.js +1 -1
  2. package/dist/{account-inspect-DDZtT5C8.js → account-inspect-dFV0JrnR.js} +2 -2
  3. package/dist/{accounts-P19jm1lf.js → accounts-CMd4nzLB.js} +8 -4
  4. package/dist/action-runtime-api.js +1 -1
  5. package/dist/activities-api-DS1L7KRY.js +765 -0
  6. package/dist/activities-api.js +2 -0
  7. package/dist/{allow-list-B7qOH5xu.js → allow-list-DzKrtfah.js} +18 -7
  8. package/dist/{api--f62GFaS.js → api-C43z8vUm.js} +6 -4
  9. package/dist/api.js +27 -18
  10. package/dist/{approval-handler.runtime-DeyIiw5I.js → approval-handler.runtime-BbkfPoGc.js} +7 -8
  11. package/dist/{conversation-identity-BpkAzklg.js → approval-message-safety-DrLlgIPz.js} +49 -3
  12. package/dist/assets/embedded-app-sdk.mjs +1 -0
  13. package/dist/{audit-Df2w046a.js → audit-BC6bgPMX.js} +4 -4
  14. package/dist/{channel-nYmJ7FKQ.js → channel-5MfaC2IE.js} +55 -44
  15. package/dist/{channel-actions-ChpBSRcu.js → channel-actions-DicWTbYH.js} +5 -5
  16. package/dist/{channel-actions.runtime-D8V8tyCq.js → channel-actions.runtime-D9Qadn-l.js} +50 -50
  17. package/dist/channel-config-api.js +1 -1
  18. package/dist/channel-plugin-api.js +1 -1
  19. package/dist/{channel.setup-DyihrqHH.js → channel.setup-CJXfFclP.js} +17 -20
  20. package/dist/{send.receipt-aegk69an.js → chunk-CWzmeWf_.js} +312 -401
  21. package/dist/command-deploy-store-DFkBTViB.js +12 -0
  22. package/dist/{config-schema-_bUKcWRm.js → config-schema-BxrgfSMD.js} +31 -2
  23. package/dist/{directory-config-BUe-qq_C.js → directory-config-CmukHSms.js} +2 -2
  24. package/dist/directory-contract-api.js +1 -1
  25. package/dist/{directory-live-DZByMdPO.js → directory-live-BYlCRO__.js} +11 -9
  26. package/dist/{doctor-bMaWXFKu.js → doctor-Ci7USQAW.js} +4 -4
  27. package/dist/{handle-action.guild-admin-C_PQcBEV.js → handle-action.guild-admin-Bsk2YBPs.js} +2 -2
  28. package/dist/index.js +3 -1
  29. package/dist/legacy-state-migrations-api.js +17 -2
  30. package/dist/{manager.runtime-3RVMVkyx.js → manager.runtime-Cc8vS-M7.js} +191 -192
  31. package/dist/message-handler-CWJ-mQvH.js +590 -0
  32. package/dist/{message-handler.preflight-BI86IbHz.js → message-handler.preflight-DK46_qbS.js} +19 -18
  33. package/dist/{message-handler.process-bPS_9_tb.js → message-handler.process-BK0mjFJH.js} +88 -86
  34. package/dist/{message-utils-D4j07taS.js → message-utils-Cfe6CZ6N.js} +9 -7
  35. package/dist/{outbound-adapter-Czny0Fae.js → outbound-adapter-B2_oa-zV.js} +38 -7
  36. package/dist/{outbound-components-oJKLj62G.js → outbound-components-BGhk6HI3.js} +3 -3
  37. package/dist/{components-BVrfRS-F.js → outbound-session-route-M2bEY9tI.js} +171 -53
  38. package/dist/{pluralkit-UXq1OyUI.js → pluralkit-CT0VRsZd.js} +2 -2
  39. package/dist/{probe-DxjMBeVG.js → probe-C3SCKyYU.js} +35 -12
  40. package/dist/{probe.runtime-Bc8Oo6e8.js → probe.runtime-D55QqC9u.js} +1 -1
  41. package/dist/{provider-DWvDNb4J.js → provider-HW0G-2l6.js} +1810 -1513
  42. package/dist/{provider-session.runtime-D5pCGibh.js → provider-session.runtime-cCfGMsF_.js} +3 -3
  43. package/dist/provider.runtime-BWCRsVoT.js +2 -0
  44. package/dist/{resolve-allowlist-common-B9S8LLBd.js → resolve-allowlist-common-CJlqw_nC.js} +3 -3
  45. package/dist/{resolve-channels-BrkWOKdG.js → resolve-channels-9KcG3mLg.js} +4 -4
  46. package/dist/{resolve-users-OjrXXvJP.js → resolve-users-GCGf3oV0.js} +3 -3
  47. package/dist/retry-after-DdLPmPoa.js +12 -0
  48. package/dist/runtime-CD5MRZkD.js +83 -0
  49. package/dist/{runtime-C618lis9.js → runtime-Z2qkKakn.js} +64 -43
  50. package/dist/runtime-api.actions.js +2 -2
  51. package/dist/runtime-api.js +26 -25
  52. package/dist/runtime-api.lookup.js +5 -5
  53. package/dist/runtime-api.monitor-C3EDYJqk.js +6 -0
  54. package/dist/runtime-api.monitor.js +8 -8
  55. package/dist/runtime-api.send.js +6 -5
  56. package/dist/runtime-api.threads.js +6 -6
  57. package/dist/{secret-config-contract-BDNrRWvd.js → secret-config-contract-B1akrlyY.js} +1 -0
  58. package/dist/secret-contract-api.js +1 -1
  59. package/dist/{security-audit-Bh_65L5C.js → security-audit-DtT0SIns.js} +1 -1
  60. package/dist/security-audit-contract-api.js +1 -1
  61. package/dist/{security-audit.runtime-CpPdDNEt.js → security-audit.runtime-DEEywczv.js} +1 -1
  62. package/dist/security-doctor-nGgPm65L.js +5 -0
  63. package/dist/{send-BFpa_DHn.js → send-CSRxNNgq.js} +16 -95
  64. package/dist/{send.components-BaXQJKWT.js → send.components-DLqzOEPJ.js} +47 -38
  65. package/dist/{send.outbound-BlA6VzSE.js → send.outbound-C1SfX20w.js} +7 -6
  66. package/dist/send.reactions-Cj4ugX3F.js +85 -0
  67. package/dist/send.receipt-CuwRrpFz.js +48 -0
  68. package/dist/{send.shared-Xz7IMVpu.js → send.shared-Dber6X57.js} +78 -74
  69. package/dist/{sender-identity-C62lBe18.js → sender-identity-mG_zsdox.js} +1 -1
  70. package/dist/session-binding-contract-api.js +1 -1
  71. package/dist/setup-plugin-api.js +1 -1
  72. package/dist/{shared-BLYBt5SA.js → shared-BEhmAdMY.js} +9 -9
  73. package/dist/{subagent-hooks-DKJ4p-Oy.js → subagent-hooks-Wrk61DwY.js} +3 -3
  74. package/dist/subagent-hooks-api.js +10 -1
  75. package/dist/subagent-progress-B2fpHe3m.js +662 -0
  76. package/dist/{system-events-DKwfE-2z.js → system-events-AhfcKRRb.js} +2 -2
  77. package/dist/{target-resolver-BQyEHyeS.js → target-resolver-vqLA450R.js} +3 -3
  78. package/dist/targets-BjEMIe8t.js +3 -0
  79. package/dist/{thread-bindings-BbzjUuNB.js → thread-bindings-CJQoXuWY.js} +7 -7
  80. package/dist/{thread-bindings.discord-api-DJD3qwIN.js → thread-bindings.discord-api-mNCWlgvM.js} +5 -5
  81. package/dist/{thread-bindings.manager-BIBm6bQd.js → thread-bindings.manager-D1z8mK4b.js} +5 -5
  82. package/dist/{thread-bindings.session-updates-eRcJlzIU.js → thread-bindings.session-updates-DnTpkroM.js} +1 -1
  83. package/dist/{timeouts-ZRc9Lw4y.js → timeouts-B9cy6RvQ.js} +1 -5
  84. package/dist/{transcripts-source-CLZ5X8fh.js → transcripts-source-DjDbt14x.js} +1 -1
  85. package/dist/transcripts-source-api.js +1 -1
  86. package/dist/{typing-BnYT7Szq.js → typing-wxtm1NlF.js} +2 -2
  87. package/node_modules/@discord/embedded-app-sdk/LICENSE.md +9 -0
  88. package/node_modules/@discord/embedded-app-sdk/README.md +74 -0
  89. package/node_modules/@discord/embedded-app-sdk/output/Constants.cjs +100 -0
  90. package/node_modules/@discord/embedded-app-sdk/output/Constants.d.ts +88 -0
  91. package/node_modules/@discord/embedded-app-sdk/output/Constants.mjs +96 -0
  92. package/node_modules/@discord/embedded-app-sdk/output/Discord.cjs +286 -0
  93. package/node_modules/@discord/embedded-app-sdk/output/Discord.d.ts +603 -0
  94. package/node_modules/@discord/embedded-app-sdk/output/Discord.mjs +284 -0
  95. package/node_modules/@discord/embedded-app-sdk/output/_virtual/BigInteger.cjs +11 -0
  96. package/node_modules/@discord/embedded-app-sdk/output/_virtual/BigInteger.mjs +7 -0
  97. package/node_modules/@discord/embedded-app-sdk/output/_virtual/BigInteger2.cjs +5 -0
  98. package/node_modules/@discord/embedded-app-sdk/output/_virtual/BigInteger2.mjs +3 -0
  99. package/node_modules/@discord/embedded-app-sdk/output/_virtual/_commonjsHelpers.cjs +10 -0
  100. package/node_modules/@discord/embedded-app-sdk/output/_virtual/_commonjsHelpers.mjs +7 -0
  101. package/node_modules/@discord/embedded-app-sdk/output/_virtual/index.cjs +11 -0
  102. package/node_modules/@discord/embedded-app-sdk/output/_virtual/index.mjs +7 -0
  103. package/node_modules/@discord/embedded-app-sdk/output/_virtual/index2.cjs +11 -0
  104. package/node_modules/@discord/embedded-app-sdk/output/_virtual/index2.mjs +7 -0
  105. package/node_modules/@discord/embedded-app-sdk/output/_virtual/index3.cjs +5 -0
  106. package/node_modules/@discord/embedded-app-sdk/output/_virtual/index3.mjs +3 -0
  107. package/node_modules/@discord/embedded-app-sdk/output/_virtual/index4.cjs +5 -0
  108. package/node_modules/@discord/embedded-app-sdk/output/_virtual/index4.mjs +3 -0
  109. package/node_modules/@discord/embedded-app-sdk/output/commands/authenticate.cjs +11 -0
  110. package/node_modules/@discord/embedded-app-sdk/output/commands/authenticate.d.ts +25 -0
  111. package/node_modules/@discord/embedded-app-sdk/output/commands/authenticate.mjs +9 -0
  112. package/node_modules/@discord/embedded-app-sdk/output/commands/authorize.cjs +16 -0
  113. package/node_modules/@discord/embedded-app-sdk/output/commands/authorize.d.ts +20 -0
  114. package/node_modules/@discord/embedded-app-sdk/output/commands/authorize.mjs +14 -0
  115. package/node_modules/@discord/embedded-app-sdk/output/commands/captureLog.cjs +12 -0
  116. package/node_modules/@discord/embedded-app-sdk/output/commands/captureLog.d.ts +10 -0
  117. package/node_modules/@discord/embedded-app-sdk/output/commands/captureLog.mjs +10 -0
  118. package/node_modules/@discord/embedded-app-sdk/output/commands/encourageHardwareAcceleration.cjs +12 -0
  119. package/node_modules/@discord/embedded-app-sdk/output/commands/encourageHardwareAcceleration.d.ts +7 -0
  120. package/node_modules/@discord/embedded-app-sdk/output/commands/encourageHardwareAcceleration.mjs +10 -0
  121. package/node_modules/@discord/embedded-app-sdk/output/commands/getActivityInstanceConnectedParticipants.cjs +8 -0
  122. package/node_modules/@discord/embedded-app-sdk/output/commands/getActivityInstanceConnectedParticipants.d.ts +18 -0
  123. package/node_modules/@discord/embedded-app-sdk/output/commands/getActivityInstanceConnectedParticipants.mjs +6 -0
  124. package/node_modules/@discord/embedded-app-sdk/output/commands/getChannel.cjs +29 -0
  125. package/node_modules/@discord/embedded-app-sdk/output/commands/getChannel.d.ts +230 -0
  126. package/node_modules/@discord/embedded-app-sdk/output/commands/getChannel.mjs +27 -0
  127. package/node_modules/@discord/embedded-app-sdk/output/commands/getChannelPermissions.cjs +13 -0
  128. package/node_modules/@discord/embedded-app-sdk/output/commands/getChannelPermissions.d.ts +8 -0
  129. package/node_modules/@discord/embedded-app-sdk/output/commands/getChannelPermissions.mjs +11 -0
  130. package/node_modules/@discord/embedded-app-sdk/output/commands/getEntitlements.cjs +12 -0
  131. package/node_modules/@discord/embedded-app-sdk/output/commands/getEntitlements.d.ts +22 -0
  132. package/node_modules/@discord/embedded-app-sdk/output/commands/getEntitlements.mjs +10 -0
  133. package/node_modules/@discord/embedded-app-sdk/output/commands/getPlatformBehaviors.cjs +16 -0
  134. package/node_modules/@discord/embedded-app-sdk/output/commands/getPlatformBehaviors.d.ts +11 -0
  135. package/node_modules/@discord/embedded-app-sdk/output/commands/getPlatformBehaviors.mjs +14 -0
  136. package/node_modules/@discord/embedded-app-sdk/output/commands/getQuest.cjs +8 -0
  137. package/node_modules/@discord/embedded-app-sdk/output/commands/getQuest.d.ts +6 -0
  138. package/node_modules/@discord/embedded-app-sdk/output/commands/getQuest.mjs +6 -0
  139. package/node_modules/@discord/embedded-app-sdk/output/commands/getQuestEnrollmentStatus.cjs +8 -0
  140. package/node_modules/@discord/embedded-app-sdk/output/commands/getQuestEnrollmentStatus.d.ts +7 -0
  141. package/node_modules/@discord/embedded-app-sdk/output/commands/getQuestEnrollmentStatus.mjs +6 -0
  142. package/node_modules/@discord/embedded-app-sdk/output/commands/getRelationships.cjs +8 -0
  143. package/node_modules/@discord/embedded-app-sdk/output/commands/getRelationships.d.ts +70 -0
  144. package/node_modules/@discord/embedded-app-sdk/output/commands/getRelationships.mjs +6 -0
  145. package/node_modules/@discord/embedded-app-sdk/output/commands/getSkus.cjs +12 -0
  146. package/node_modules/@discord/embedded-app-sdk/output/commands/getSkus.d.ts +15 -0
  147. package/node_modules/@discord/embedded-app-sdk/output/commands/getSkus.mjs +10 -0
  148. package/node_modules/@discord/embedded-app-sdk/output/commands/getUser.cjs +8 -0
  149. package/node_modules/@discord/embedded-app-sdk/output/commands/getUser.d.ts +17 -0
  150. package/node_modules/@discord/embedded-app-sdk/output/commands/getUser.mjs +6 -0
  151. package/node_modules/@discord/embedded-app-sdk/output/commands/index.cjs +76 -0
  152. package/node_modules/@discord/embedded-app-sdk/output/commands/index.d.ts +562 -0
  153. package/node_modules/@discord/embedded-app-sdk/output/commands/index.mjs +68 -0
  154. package/node_modules/@discord/embedded-app-sdk/output/commands/initiateImageUpload.cjs +17 -0
  155. package/node_modules/@discord/embedded-app-sdk/output/commands/initiateImageUpload.d.ts +12 -0
  156. package/node_modules/@discord/embedded-app-sdk/output/commands/initiateImageUpload.mjs +15 -0
  157. package/node_modules/@discord/embedded-app-sdk/output/commands/inviteUserEmbedded.cjs +8 -0
  158. package/node_modules/@discord/embedded-app-sdk/output/commands/inviteUserEmbedded.d.ts +4 -0
  159. package/node_modules/@discord/embedded-app-sdk/output/commands/inviteUserEmbedded.mjs +6 -0
  160. package/node_modules/@discord/embedded-app-sdk/output/commands/openExternalLink.cjs +12 -0
  161. package/node_modules/@discord/embedded-app-sdk/output/commands/openExternalLink.d.ts +10 -0
  162. package/node_modules/@discord/embedded-app-sdk/output/commands/openExternalLink.mjs +10 -0
  163. package/node_modules/@discord/embedded-app-sdk/output/commands/openInviteDialog.cjs +14 -0
  164. package/node_modules/@discord/embedded-app-sdk/output/commands/openInviteDialog.d.ts +7 -0
  165. package/node_modules/@discord/embedded-app-sdk/output/commands/openInviteDialog.mjs +12 -0
  166. package/node_modules/@discord/embedded-app-sdk/output/commands/openShareMomentDialog.cjs +14 -0
  167. package/node_modules/@discord/embedded-app-sdk/output/commands/openShareMomentDialog.d.ts +9 -0
  168. package/node_modules/@discord/embedded-app-sdk/output/commands/openShareMomentDialog.mjs +12 -0
  169. package/node_modules/@discord/embedded-app-sdk/output/commands/questStartTimer.cjs +8 -0
  170. package/node_modules/@discord/embedded-app-sdk/output/commands/questStartTimer.d.ts +5 -0
  171. package/node_modules/@discord/embedded-app-sdk/output/commands/questStartTimer.mjs +6 -0
  172. package/node_modules/@discord/embedded-app-sdk/output/commands/requestProxyTicketRefresh.cjs +8 -0
  173. package/node_modules/@discord/embedded-app-sdk/output/commands/requestProxyTicketRefresh.d.ts +3 -0
  174. package/node_modules/@discord/embedded-app-sdk/output/commands/requestProxyTicketRefresh.mjs +6 -0
  175. package/node_modules/@discord/embedded-app-sdk/output/commands/setActivity.cjs +48 -0
  176. package/node_modules/@discord/embedded-app-sdk/output/commands/setActivity.d.ts +304 -0
  177. package/node_modules/@discord/embedded-app-sdk/output/commands/setActivity.mjs +46 -0
  178. package/node_modules/@discord/embedded-app-sdk/output/commands/setConfig.cjs +12 -0
  179. package/node_modules/@discord/embedded-app-sdk/output/commands/setConfig.d.ts +10 -0
  180. package/node_modules/@discord/embedded-app-sdk/output/commands/setConfig.mjs +10 -0
  181. package/node_modules/@discord/embedded-app-sdk/output/commands/setOrientationLockState.cjs +20 -0
  182. package/node_modules/@discord/embedded-app-sdk/output/commands/setOrientationLockState.d.ts +11 -0
  183. package/node_modules/@discord/embedded-app-sdk/output/commands/setOrientationLockState.mjs +18 -0
  184. package/node_modules/@discord/embedded-app-sdk/output/commands/shareInteraction.cjs +8 -0
  185. package/node_modules/@discord/embedded-app-sdk/output/commands/shareInteraction.d.ts +26 -0
  186. package/node_modules/@discord/embedded-app-sdk/output/commands/shareInteraction.mjs +6 -0
  187. package/node_modules/@discord/embedded-app-sdk/output/commands/shareLink.cjs +16 -0
  188. package/node_modules/@discord/embedded-app-sdk/output/commands/shareLink.d.ts +17 -0
  189. package/node_modules/@discord/embedded-app-sdk/output/commands/shareLink.mjs +14 -0
  190. package/node_modules/@discord/embedded-app-sdk/output/commands/startPurchase.cjs +12 -0
  191. package/node_modules/@discord/embedded-app-sdk/output/commands/startPurchase.d.ts +24 -0
  192. package/node_modules/@discord/embedded-app-sdk/output/commands/startPurchase.mjs +10 -0
  193. package/node_modules/@discord/embedded-app-sdk/output/commands/userSettingsGetLocale.cjs +12 -0
  194. package/node_modules/@discord/embedded-app-sdk/output/commands/userSettingsGetLocale.d.ts +7 -0
  195. package/node_modules/@discord/embedded-app-sdk/output/commands/userSettingsGetLocale.mjs +10 -0
  196. package/node_modules/@discord/embedded-app-sdk/output/error.cjs +12 -0
  197. package/node_modules/@discord/embedded-app-sdk/output/error.d.ts +10 -0
  198. package/node_modules/@discord/embedded-app-sdk/output/error.mjs +10 -0
  199. package/node_modules/@discord/embedded-app-sdk/output/generated/schemas.cjs +408 -0
  200. package/node_modules/@discord/embedded-app-sdk/output/generated/schemas.d.ts +2227 -0
  201. package/node_modules/@discord/embedded-app-sdk/output/generated/schemas.mjs +387 -0
  202. package/node_modules/@discord/embedded-app-sdk/output/index.cjs +44 -0
  203. package/node_modules/@discord/embedded-app-sdk/output/index.d.ts +17 -0
  204. package/node_modules/@discord/embedded-app-sdk/output/index.mjs +14 -0
  205. package/node_modules/@discord/embedded-app-sdk/output/interface.d.ts +35 -0
  206. package/node_modules/@discord/embedded-app-sdk/output/lib/big-integer/BigInteger.cjs +1460 -0
  207. package/node_modules/@discord/embedded-app-sdk/output/lib/big-integer/BigInteger.mjs +1458 -0
  208. package/node_modules/@discord/embedded-app-sdk/output/lib/decimal.js-light/decimal.cjs +1991 -0
  209. package/node_modules/@discord/embedded-app-sdk/output/lib/decimal.js-light/decimal.mjs +1987 -0
  210. package/node_modules/@discord/embedded-app-sdk/output/lib/eventemitter3/index.cjs +10 -0
  211. package/node_modules/@discord/embedded-app-sdk/output/lib/eventemitter3/index.mjs +5 -0
  212. package/node_modules/@discord/embedded-app-sdk/output/lib/eventemitter3/index2.cjs +350 -0
  213. package/node_modules/@discord/embedded-app-sdk/output/lib/eventemitter3/index2.mjs +348 -0
  214. package/node_modules/@discord/embedded-app-sdk/output/lib/lodash.transform/index.cjs +2343 -0
  215. package/node_modules/@discord/embedded-app-sdk/output/lib/lodash.transform/index.mjs +2341 -0
  216. package/node_modules/@discord/embedded-app-sdk/output/lib/tslib/tslib.es6.cjs +37 -0
  217. package/node_modules/@discord/embedded-app-sdk/output/lib/tslib/tslib.es6.mjs +35 -0
  218. package/node_modules/@discord/embedded-app-sdk/output/lib/uuid/dist/esm-browser/native.cjs +8 -0
  219. package/node_modules/@discord/embedded-app-sdk/output/lib/uuid/dist/esm-browser/native.mjs +4 -0
  220. package/node_modules/@discord/embedded-app-sdk/output/lib/uuid/dist/esm-browser/rng.cjs +17 -0
  221. package/node_modules/@discord/embedded-app-sdk/output/lib/uuid/dist/esm-browser/rng.mjs +13 -0
  222. package/node_modules/@discord/embedded-app-sdk/output/lib/uuid/dist/esm-browser/stringify.cjs +30 -0
  223. package/node_modules/@discord/embedded-app-sdk/output/lib/uuid/dist/esm-browser/stringify.mjs +28 -0
  224. package/node_modules/@discord/embedded-app-sdk/output/lib/uuid/dist/esm-browser/v4.cjs +23 -0
  225. package/node_modules/@discord/embedded-app-sdk/output/lib/uuid/dist/esm-browser/v4.mjs +19 -0
  226. package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +4342 -0
  227. package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +4233 -0
  228. package/node_modules/@discord/embedded-app-sdk/output/mock.cjs +181 -0
  229. package/node_modules/@discord/embedded-app-sdk/output/mock.d.ts +579 -0
  230. package/node_modules/@discord/embedded-app-sdk/output/mock.mjs +178 -0
  231. package/node_modules/@discord/embedded-app-sdk/output/package.json.cjs +5 -0
  232. package/node_modules/@discord/embedded-app-sdk/output/package.json.mjs +3 -0
  233. package/node_modules/@discord/embedded-app-sdk/output/schema/common.cjs +587 -0
  234. package/node_modules/@discord/embedded-app-sdk/output/schema/common.d.ts +5141 -0
  235. package/node_modules/@discord/embedded-app-sdk/output/schema/common.mjs +531 -0
  236. package/node_modules/@discord/embedded-app-sdk/output/schema/events.cjs +221 -0
  237. package/node_modules/@discord/embedded-app-sdk/output/schema/events.d.ts +3832 -0
  238. package/node_modules/@discord/embedded-app-sdk/output/schema/events.mjs +213 -0
  239. package/node_modules/@discord/embedded-app-sdk/output/schema/index.cjs +47 -0
  240. package/node_modules/@discord/embedded-app-sdk/output/schema/index.d.ts +59 -0
  241. package/node_modules/@discord/embedded-app-sdk/output/schema/index.mjs +44 -0
  242. package/node_modules/@discord/embedded-app-sdk/output/schema/responses.cjs +189 -0
  243. package/node_modules/@discord/embedded-app-sdk/output/schema/responses.d.ts +7224 -0
  244. package/node_modules/@discord/embedded-app-sdk/output/schema/responses.mjs +163 -0
  245. package/node_modules/@discord/embedded-app-sdk/output/schema/types.d.ts +61 -0
  246. package/node_modules/@discord/embedded-app-sdk/output/utils/BigFlagUtils.cjs +235 -0
  247. package/node_modules/@discord/embedded-app-sdk/output/utils/BigFlagUtils.d.ts +59 -0
  248. package/node_modules/@discord/embedded-app-sdk/output/utils/BigFlagUtils.mjs +231 -0
  249. package/node_modules/@discord/embedded-app-sdk/output/utils/PermissionUtils.cjs +14 -0
  250. package/node_modules/@discord/embedded-app-sdk/output/utils/PermissionUtils.d.ts +6 -0
  251. package/node_modules/@discord/embedded-app-sdk/output/utils/PermissionUtils.mjs +10 -0
  252. package/node_modules/@discord/embedded-app-sdk/output/utils/PriceConstants.cjs +373 -0
  253. package/node_modules/@discord/embedded-app-sdk/output/utils/PriceConstants.d.ts +368 -0
  254. package/node_modules/@discord/embedded-app-sdk/output/utils/PriceConstants.mjs +371 -0
  255. package/node_modules/@discord/embedded-app-sdk/output/utils/PriceUtils.cjs +26 -0
  256. package/node_modules/@discord/embedded-app-sdk/output/utils/PriceUtils.d.ts +8 -0
  257. package/node_modules/@discord/embedded-app-sdk/output/utils/PriceUtils.mjs +22 -0
  258. package/node_modules/@discord/embedded-app-sdk/output/utils/assertUnreachable.cjs +13 -0
  259. package/node_modules/@discord/embedded-app-sdk/output/utils/assertUnreachable.d.ts +5 -0
  260. package/node_modules/@discord/embedded-app-sdk/output/utils/assertUnreachable.mjs +9 -0
  261. package/node_modules/@discord/embedded-app-sdk/output/utils/commandFactory.cjs +37 -0
  262. package/node_modules/@discord/embedded-app-sdk/output/utils/commandFactory.d.ts +9 -0
  263. package/node_modules/@discord/embedded-app-sdk/output/utils/commandFactory.mjs +34 -0
  264. package/node_modules/@discord/embedded-app-sdk/output/utils/compatCommandFactory.cjs +39 -0
  265. package/node_modules/@discord/embedded-app-sdk/output/utils/compatCommandFactory.d.ts +15 -0
  266. package/node_modules/@discord/embedded-app-sdk/output/utils/compatCommandFactory.mjs +35 -0
  267. package/node_modules/@discord/embedded-app-sdk/output/utils/console.cjs +19 -0
  268. package/node_modules/@discord/embedded-app-sdk/output/utils/console.d.ts +3 -0
  269. package/node_modules/@discord/embedded-app-sdk/output/utils/console.mjs +16 -0
  270. package/node_modules/@discord/embedded-app-sdk/output/utils/getDefaultSdkConfiguration.cjs +11 -0
  271. package/node_modules/@discord/embedded-app-sdk/output/utils/getDefaultSdkConfiguration.d.ts +2 -0
  272. package/node_modules/@discord/embedded-app-sdk/output/utils/getDefaultSdkConfiguration.mjs +7 -0
  273. package/node_modules/@discord/embedded-app-sdk/output/utils/patchUrlMappings.cjs +153 -0
  274. package/node_modules/@discord/embedded-app-sdk/output/utils/patchUrlMappings.d.ts +17 -0
  275. package/node_modules/@discord/embedded-app-sdk/output/utils/patchUrlMappings.mjs +150 -0
  276. package/node_modules/@discord/embedded-app-sdk/output/utils/url.cjs +62 -0
  277. package/node_modules/@discord/embedded-app-sdk/output/utils/url.d.ts +17 -0
  278. package/node_modules/@discord/embedded-app-sdk/output/utils/url.mjs +59 -0
  279. package/node_modules/@discord/embedded-app-sdk/output/utils/zodUtils.cjs +44 -0
  280. package/node_modules/@discord/embedded-app-sdk/output/utils/zodUtils.d.ts +28 -0
  281. package/node_modules/@discord/embedded-app-sdk/output/utils/zodUtils.mjs +41 -0
  282. package/node_modules/@discord/embedded-app-sdk/package.json +88 -0
  283. package/node_modules/@types/lodash/LICENSE +21 -0
  284. package/node_modules/@types/lodash/README.md +15 -0
  285. package/node_modules/@types/lodash/add.d.ts +2 -0
  286. package/node_modules/@types/lodash/after.d.ts +2 -0
  287. package/node_modules/@types/lodash/ary.d.ts +2 -0
  288. package/node_modules/@types/lodash/assign.d.ts +2 -0
  289. package/node_modules/@types/lodash/assignIn.d.ts +2 -0
  290. package/node_modules/@types/lodash/assignInWith.d.ts +2 -0
  291. package/node_modules/@types/lodash/assignWith.d.ts +2 -0
  292. package/node_modules/@types/lodash/at.d.ts +2 -0
  293. package/node_modules/@types/lodash/attempt.d.ts +2 -0
  294. package/node_modules/@types/lodash/before.d.ts +2 -0
  295. package/node_modules/@types/lodash/bind.d.ts +2 -0
  296. package/node_modules/@types/lodash/bindAll.d.ts +2 -0
  297. package/node_modules/@types/lodash/bindKey.d.ts +2 -0
  298. package/node_modules/@types/lodash/camelCase.d.ts +2 -0
  299. package/node_modules/@types/lodash/capitalize.d.ts +2 -0
  300. package/node_modules/@types/lodash/castArray.d.ts +2 -0
  301. package/node_modules/@types/lodash/ceil.d.ts +2 -0
  302. package/node_modules/@types/lodash/chain.d.ts +2 -0
  303. package/node_modules/@types/lodash/chunk.d.ts +2 -0
  304. package/node_modules/@types/lodash/clamp.d.ts +2 -0
  305. package/node_modules/@types/lodash/clone.d.ts +2 -0
  306. package/node_modules/@types/lodash/cloneDeep.d.ts +2 -0
  307. package/node_modules/@types/lodash/cloneDeepWith.d.ts +2 -0
  308. package/node_modules/@types/lodash/cloneWith.d.ts +2 -0
  309. package/node_modules/@types/lodash/common/array.d.ts +2160 -0
  310. package/node_modules/@types/lodash/common/collection.d.ts +1938 -0
  311. package/node_modules/@types/lodash/common/common.d.ts +287 -0
  312. package/node_modules/@types/lodash/common/date.d.ts +23 -0
  313. package/node_modules/@types/lodash/common/function.d.ts +1455 -0
  314. package/node_modules/@types/lodash/common/lang.d.ts +1696 -0
  315. package/node_modules/@types/lodash/common/math.d.ts +407 -0
  316. package/node_modules/@types/lodash/common/number.d.ts +131 -0
  317. package/node_modules/@types/lodash/common/object.d.ts +2643 -0
  318. package/node_modules/@types/lodash/common/seq.d.ts +210 -0
  319. package/node_modules/@types/lodash/common/string.d.ts +788 -0
  320. package/node_modules/@types/lodash/common/util.d.ts +1220 -0
  321. package/node_modules/@types/lodash/compact.d.ts +2 -0
  322. package/node_modules/@types/lodash/concat.d.ts +2 -0
  323. package/node_modules/@types/lodash/cond.d.ts +2 -0
  324. package/node_modules/@types/lodash/conformsTo.d.ts +2 -0
  325. package/node_modules/@types/lodash/constant.d.ts +2 -0
  326. package/node_modules/@types/lodash/countBy.d.ts +2 -0
  327. package/node_modules/@types/lodash/create.d.ts +2 -0
  328. package/node_modules/@types/lodash/curry.d.ts +2 -0
  329. package/node_modules/@types/lodash/curryRight.d.ts +2 -0
  330. package/node_modules/@types/lodash/debounce.d.ts +2 -0
  331. package/node_modules/@types/lodash/deburr.d.ts +2 -0
  332. package/node_modules/@types/lodash/defaultTo.d.ts +2 -0
  333. package/node_modules/@types/lodash/defaults.d.ts +2 -0
  334. package/node_modules/@types/lodash/defaultsDeep.d.ts +2 -0
  335. package/node_modules/@types/lodash/defer.d.ts +2 -0
  336. package/node_modules/@types/lodash/delay.d.ts +2 -0
  337. package/node_modules/@types/lodash/difference.d.ts +2 -0
  338. package/node_modules/@types/lodash/differenceBy.d.ts +2 -0
  339. package/node_modules/@types/lodash/differenceWith.d.ts +2 -0
  340. package/node_modules/@types/lodash/divide.d.ts +2 -0
  341. package/node_modules/@types/lodash/drop.d.ts +2 -0
  342. package/node_modules/@types/lodash/dropRight.d.ts +2 -0
  343. package/node_modules/@types/lodash/dropRightWhile.d.ts +2 -0
  344. package/node_modules/@types/lodash/dropWhile.d.ts +2 -0
  345. package/node_modules/@types/lodash/each.d.ts +2 -0
  346. package/node_modules/@types/lodash/eachRight.d.ts +2 -0
  347. package/node_modules/@types/lodash/endsWith.d.ts +2 -0
  348. package/node_modules/@types/lodash/entries.d.ts +2 -0
  349. package/node_modules/@types/lodash/entriesIn.d.ts +2 -0
  350. package/node_modules/@types/lodash/eq.d.ts +2 -0
  351. package/node_modules/@types/lodash/escape.d.ts +2 -0
  352. package/node_modules/@types/lodash/escapeRegExp.d.ts +2 -0
  353. package/node_modules/@types/lodash/every.d.ts +2 -0
  354. package/node_modules/@types/lodash/extend.d.ts +2 -0
  355. package/node_modules/@types/lodash/extendWith.d.ts +2 -0
  356. package/node_modules/@types/lodash/fill.d.ts +2 -0
  357. package/node_modules/@types/lodash/filter.d.ts +2 -0
  358. package/node_modules/@types/lodash/find.d.ts +2 -0
  359. package/node_modules/@types/lodash/findIndex.d.ts +2 -0
  360. package/node_modules/@types/lodash/findKey.d.ts +2 -0
  361. package/node_modules/@types/lodash/findLast.d.ts +2 -0
  362. package/node_modules/@types/lodash/findLastIndex.d.ts +2 -0
  363. package/node_modules/@types/lodash/findLastKey.d.ts +2 -0
  364. package/node_modules/@types/lodash/first.d.ts +2 -0
  365. package/node_modules/@types/lodash/flatMap.d.ts +2 -0
  366. package/node_modules/@types/lodash/flatMapDeep.d.ts +2 -0
  367. package/node_modules/@types/lodash/flatMapDepth.d.ts +2 -0
  368. package/node_modules/@types/lodash/flatten.d.ts +2 -0
  369. package/node_modules/@types/lodash/flattenDeep.d.ts +2 -0
  370. package/node_modules/@types/lodash/flattenDepth.d.ts +2 -0
  371. package/node_modules/@types/lodash/flip.d.ts +2 -0
  372. package/node_modules/@types/lodash/floor.d.ts +2 -0
  373. package/node_modules/@types/lodash/flow.d.ts +2 -0
  374. package/node_modules/@types/lodash/flowRight.d.ts +2 -0
  375. package/node_modules/@types/lodash/forEach.d.ts +2 -0
  376. package/node_modules/@types/lodash/forEachRight.d.ts +2 -0
  377. package/node_modules/@types/lodash/forIn.d.ts +2 -0
  378. package/node_modules/@types/lodash/forInRight.d.ts +2 -0
  379. package/node_modules/@types/lodash/forOwn.d.ts +2 -0
  380. package/node_modules/@types/lodash/forOwnRight.d.ts +2 -0
  381. package/node_modules/@types/lodash/fp/F.d.ts +2 -0
  382. package/node_modules/@types/lodash/fp/T.d.ts +2 -0
  383. package/node_modules/@types/lodash/fp/__.d.ts +3 -0
  384. package/node_modules/@types/lodash/fp/add.d.ts +2 -0
  385. package/node_modules/@types/lodash/fp/after.d.ts +2 -0
  386. package/node_modules/@types/lodash/fp/all.d.ts +2 -0
  387. package/node_modules/@types/lodash/fp/allPass.d.ts +2 -0
  388. package/node_modules/@types/lodash/fp/always.d.ts +2 -0
  389. package/node_modules/@types/lodash/fp/any.d.ts +2 -0
  390. package/node_modules/@types/lodash/fp/anyPass.d.ts +2 -0
  391. package/node_modules/@types/lodash/fp/apply.d.ts +2 -0
  392. package/node_modules/@types/lodash/fp/ary.d.ts +2 -0
  393. package/node_modules/@types/lodash/fp/assign.d.ts +2 -0
  394. package/node_modules/@types/lodash/fp/assignAll.d.ts +2 -0
  395. package/node_modules/@types/lodash/fp/assignAllWith.d.ts +2 -0
  396. package/node_modules/@types/lodash/fp/assignIn.d.ts +2 -0
  397. package/node_modules/@types/lodash/fp/assignInAll.d.ts +2 -0
  398. package/node_modules/@types/lodash/fp/assignInAllWith.d.ts +2 -0
  399. package/node_modules/@types/lodash/fp/assignInWith.d.ts +2 -0
  400. package/node_modules/@types/lodash/fp/assignWith.d.ts +2 -0
  401. package/node_modules/@types/lodash/fp/assoc.d.ts +2 -0
  402. package/node_modules/@types/lodash/fp/assocPath.d.ts +2 -0
  403. package/node_modules/@types/lodash/fp/at.d.ts +2 -0
  404. package/node_modules/@types/lodash/fp/attempt.d.ts +2 -0
  405. package/node_modules/@types/lodash/fp/before.d.ts +2 -0
  406. package/node_modules/@types/lodash/fp/bind.d.ts +2 -0
  407. package/node_modules/@types/lodash/fp/bindAll.d.ts +2 -0
  408. package/node_modules/@types/lodash/fp/bindKey.d.ts +2 -0
  409. package/node_modules/@types/lodash/fp/camelCase.d.ts +2 -0
  410. package/node_modules/@types/lodash/fp/capitalize.d.ts +2 -0
  411. package/node_modules/@types/lodash/fp/castArray.d.ts +2 -0
  412. package/node_modules/@types/lodash/fp/ceil.d.ts +2 -0
  413. package/node_modules/@types/lodash/fp/chunk.d.ts +2 -0
  414. package/node_modules/@types/lodash/fp/clamp.d.ts +2 -0
  415. package/node_modules/@types/lodash/fp/clone.d.ts +2 -0
  416. package/node_modules/@types/lodash/fp/cloneDeep.d.ts +2 -0
  417. package/node_modules/@types/lodash/fp/cloneDeepWith.d.ts +2 -0
  418. package/node_modules/@types/lodash/fp/cloneWith.d.ts +2 -0
  419. package/node_modules/@types/lodash/fp/compact.d.ts +2 -0
  420. package/node_modules/@types/lodash/fp/complement.d.ts +2 -0
  421. package/node_modules/@types/lodash/fp/compose.d.ts +2 -0
  422. package/node_modules/@types/lodash/fp/concat.d.ts +2 -0
  423. package/node_modules/@types/lodash/fp/cond.d.ts +2 -0
  424. package/node_modules/@types/lodash/fp/conforms.d.ts +2 -0
  425. package/node_modules/@types/lodash/fp/conformsTo.d.ts +2 -0
  426. package/node_modules/@types/lodash/fp/constant.d.ts +2 -0
  427. package/node_modules/@types/lodash/fp/contains.d.ts +2 -0
  428. package/node_modules/@types/lodash/fp/convert.d.ts +15 -0
  429. package/node_modules/@types/lodash/fp/countBy.d.ts +2 -0
  430. package/node_modules/@types/lodash/fp/create.d.ts +2 -0
  431. package/node_modules/@types/lodash/fp/curry.d.ts +2 -0
  432. package/node_modules/@types/lodash/fp/curryN.d.ts +2 -0
  433. package/node_modules/@types/lodash/fp/curryRight.d.ts +2 -0
  434. package/node_modules/@types/lodash/fp/curryRightN.d.ts +2 -0
  435. package/node_modules/@types/lodash/fp/debounce.d.ts +2 -0
  436. package/node_modules/@types/lodash/fp/deburr.d.ts +2 -0
  437. package/node_modules/@types/lodash/fp/defaultTo.d.ts +2 -0
  438. package/node_modules/@types/lodash/fp/defaults.d.ts +2 -0
  439. package/node_modules/@types/lodash/fp/defaultsAll.d.ts +2 -0
  440. package/node_modules/@types/lodash/fp/defaultsDeep.d.ts +2 -0
  441. package/node_modules/@types/lodash/fp/defaultsDeepAll.d.ts +2 -0
  442. package/node_modules/@types/lodash/fp/defer.d.ts +2 -0
  443. package/node_modules/@types/lodash/fp/delay.d.ts +2 -0
  444. package/node_modules/@types/lodash/fp/difference.d.ts +2 -0
  445. package/node_modules/@types/lodash/fp/differenceBy.d.ts +2 -0
  446. package/node_modules/@types/lodash/fp/differenceWith.d.ts +2 -0
  447. package/node_modules/@types/lodash/fp/dissoc.d.ts +2 -0
  448. package/node_modules/@types/lodash/fp/dissocPath.d.ts +2 -0
  449. package/node_modules/@types/lodash/fp/divide.d.ts +2 -0
  450. package/node_modules/@types/lodash/fp/drop.d.ts +2 -0
  451. package/node_modules/@types/lodash/fp/dropLast.d.ts +2 -0
  452. package/node_modules/@types/lodash/fp/dropLastWhile.d.ts +2 -0
  453. package/node_modules/@types/lodash/fp/dropRight.d.ts +2 -0
  454. package/node_modules/@types/lodash/fp/dropRightWhile.d.ts +2 -0
  455. package/node_modules/@types/lodash/fp/dropWhile.d.ts +2 -0
  456. package/node_modules/@types/lodash/fp/each.d.ts +2 -0
  457. package/node_modules/@types/lodash/fp/eachRight.d.ts +2 -0
  458. package/node_modules/@types/lodash/fp/endsWith.d.ts +2 -0
  459. package/node_modules/@types/lodash/fp/entries.d.ts +2 -0
  460. package/node_modules/@types/lodash/fp/entriesIn.d.ts +2 -0
  461. package/node_modules/@types/lodash/fp/eq.d.ts +2 -0
  462. package/node_modules/@types/lodash/fp/equals.d.ts +2 -0
  463. package/node_modules/@types/lodash/fp/escape.d.ts +2 -0
  464. package/node_modules/@types/lodash/fp/escapeRegExp.d.ts +2 -0
  465. package/node_modules/@types/lodash/fp/every.d.ts +2 -0
  466. package/node_modules/@types/lodash/fp/extend.d.ts +2 -0
  467. package/node_modules/@types/lodash/fp/extendAll.d.ts +2 -0
  468. package/node_modules/@types/lodash/fp/extendAllWith.d.ts +2 -0
  469. package/node_modules/@types/lodash/fp/extendWith.d.ts +2 -0
  470. package/node_modules/@types/lodash/fp/fill.d.ts +2 -0
  471. package/node_modules/@types/lodash/fp/filter.d.ts +2 -0
  472. package/node_modules/@types/lodash/fp/find.d.ts +2 -0
  473. package/node_modules/@types/lodash/fp/findFrom.d.ts +2 -0
  474. package/node_modules/@types/lodash/fp/findIndex.d.ts +2 -0
  475. package/node_modules/@types/lodash/fp/findIndexFrom.d.ts +2 -0
  476. package/node_modules/@types/lodash/fp/findKey.d.ts +2 -0
  477. package/node_modules/@types/lodash/fp/findLast.d.ts +2 -0
  478. package/node_modules/@types/lodash/fp/findLastFrom.d.ts +2 -0
  479. package/node_modules/@types/lodash/fp/findLastIndex.d.ts +2 -0
  480. package/node_modules/@types/lodash/fp/findLastIndexFrom.d.ts +2 -0
  481. package/node_modules/@types/lodash/fp/findLastKey.d.ts +2 -0
  482. package/node_modules/@types/lodash/fp/first.d.ts +2 -0
  483. package/node_modules/@types/lodash/fp/flatMap.d.ts +2 -0
  484. package/node_modules/@types/lodash/fp/flatMapDeep.d.ts +2 -0
  485. package/node_modules/@types/lodash/fp/flatMapDepth.d.ts +2 -0
  486. package/node_modules/@types/lodash/fp/flatten.d.ts +2 -0
  487. package/node_modules/@types/lodash/fp/flattenDeep.d.ts +2 -0
  488. package/node_modules/@types/lodash/fp/flattenDepth.d.ts +2 -0
  489. package/node_modules/@types/lodash/fp/flip.d.ts +2 -0
  490. package/node_modules/@types/lodash/fp/floor.d.ts +2 -0
  491. package/node_modules/@types/lodash/fp/flow.d.ts +2 -0
  492. package/node_modules/@types/lodash/fp/flowRight.d.ts +2 -0
  493. package/node_modules/@types/lodash/fp/forEach.d.ts +2 -0
  494. package/node_modules/@types/lodash/fp/forEachRight.d.ts +2 -0
  495. package/node_modules/@types/lodash/fp/forIn.d.ts +2 -0
  496. package/node_modules/@types/lodash/fp/forInRight.d.ts +2 -0
  497. package/node_modules/@types/lodash/fp/forOwn.d.ts +2 -0
  498. package/node_modules/@types/lodash/fp/forOwnRight.d.ts +2 -0
  499. package/node_modules/@types/lodash/fp/fromPairs.d.ts +2 -0
  500. package/node_modules/@types/lodash/fp/functions.d.ts +2 -0
  501. package/node_modules/@types/lodash/fp/functionsIn.d.ts +2 -0
  502. package/node_modules/@types/lodash/fp/get.d.ts +2 -0
  503. package/node_modules/@types/lodash/fp/getOr.d.ts +2 -0
  504. package/node_modules/@types/lodash/fp/groupBy.d.ts +2 -0
  505. package/node_modules/@types/lodash/fp/gt.d.ts +2 -0
  506. package/node_modules/@types/lodash/fp/gte.d.ts +2 -0
  507. package/node_modules/@types/lodash/fp/has.d.ts +2 -0
  508. package/node_modules/@types/lodash/fp/hasIn.d.ts +2 -0
  509. package/node_modules/@types/lodash/fp/head.d.ts +2 -0
  510. package/node_modules/@types/lodash/fp/identical.d.ts +2 -0
  511. package/node_modules/@types/lodash/fp/identity.d.ts +2 -0
  512. package/node_modules/@types/lodash/fp/inRange.d.ts +2 -0
  513. package/node_modules/@types/lodash/fp/includes.d.ts +2 -0
  514. package/node_modules/@types/lodash/fp/includesFrom.d.ts +2 -0
  515. package/node_modules/@types/lodash/fp/indexBy.d.ts +2 -0
  516. package/node_modules/@types/lodash/fp/indexOf.d.ts +2 -0
  517. package/node_modules/@types/lodash/fp/indexOfFrom.d.ts +2 -0
  518. package/node_modules/@types/lodash/fp/init.d.ts +2 -0
  519. package/node_modules/@types/lodash/fp/initial.d.ts +2 -0
  520. package/node_modules/@types/lodash/fp/intersection.d.ts +2 -0
  521. package/node_modules/@types/lodash/fp/intersectionBy.d.ts +2 -0
  522. package/node_modules/@types/lodash/fp/intersectionWith.d.ts +2 -0
  523. package/node_modules/@types/lodash/fp/invert.d.ts +2 -0
  524. package/node_modules/@types/lodash/fp/invertBy.d.ts +2 -0
  525. package/node_modules/@types/lodash/fp/invertObj.d.ts +2 -0
  526. package/node_modules/@types/lodash/fp/invoke.d.ts +2 -0
  527. package/node_modules/@types/lodash/fp/invokeArgs.d.ts +2 -0
  528. package/node_modules/@types/lodash/fp/invokeArgsMap.d.ts +2 -0
  529. package/node_modules/@types/lodash/fp/invokeMap.d.ts +2 -0
  530. package/node_modules/@types/lodash/fp/isArguments.d.ts +2 -0
  531. package/node_modules/@types/lodash/fp/isArray.d.ts +2 -0
  532. package/node_modules/@types/lodash/fp/isArrayBuffer.d.ts +2 -0
  533. package/node_modules/@types/lodash/fp/isArrayLike.d.ts +2 -0
  534. package/node_modules/@types/lodash/fp/isArrayLikeObject.d.ts +2 -0
  535. package/node_modules/@types/lodash/fp/isBoolean.d.ts +2 -0
  536. package/node_modules/@types/lodash/fp/isBuffer.d.ts +2 -0
  537. package/node_modules/@types/lodash/fp/isDate.d.ts +2 -0
  538. package/node_modules/@types/lodash/fp/isElement.d.ts +2 -0
  539. package/node_modules/@types/lodash/fp/isEmpty.d.ts +2 -0
  540. package/node_modules/@types/lodash/fp/isEqual.d.ts +2 -0
  541. package/node_modules/@types/lodash/fp/isEqualWith.d.ts +2 -0
  542. package/node_modules/@types/lodash/fp/isError.d.ts +2 -0
  543. package/node_modules/@types/lodash/fp/isFinite.d.ts +2 -0
  544. package/node_modules/@types/lodash/fp/isFunction.d.ts +2 -0
  545. package/node_modules/@types/lodash/fp/isInteger.d.ts +2 -0
  546. package/node_modules/@types/lodash/fp/isLength.d.ts +2 -0
  547. package/node_modules/@types/lodash/fp/isMap.d.ts +2 -0
  548. package/node_modules/@types/lodash/fp/isMatch.d.ts +2 -0
  549. package/node_modules/@types/lodash/fp/isMatchWith.d.ts +2 -0
  550. package/node_modules/@types/lodash/fp/isNaN.d.ts +2 -0
  551. package/node_modules/@types/lodash/fp/isNative.d.ts +2 -0
  552. package/node_modules/@types/lodash/fp/isNil.d.ts +2 -0
  553. package/node_modules/@types/lodash/fp/isNull.d.ts +2 -0
  554. package/node_modules/@types/lodash/fp/isNumber.d.ts +2 -0
  555. package/node_modules/@types/lodash/fp/isObject.d.ts +2 -0
  556. package/node_modules/@types/lodash/fp/isObjectLike.d.ts +2 -0
  557. package/node_modules/@types/lodash/fp/isPlainObject.d.ts +2 -0
  558. package/node_modules/@types/lodash/fp/isRegExp.d.ts +2 -0
  559. package/node_modules/@types/lodash/fp/isSafeInteger.d.ts +2 -0
  560. package/node_modules/@types/lodash/fp/isSet.d.ts +2 -0
  561. package/node_modules/@types/lodash/fp/isString.d.ts +2 -0
  562. package/node_modules/@types/lodash/fp/isSymbol.d.ts +2 -0
  563. package/node_modules/@types/lodash/fp/isTypedArray.d.ts +2 -0
  564. package/node_modules/@types/lodash/fp/isUndefined.d.ts +2 -0
  565. package/node_modules/@types/lodash/fp/isWeakMap.d.ts +2 -0
  566. package/node_modules/@types/lodash/fp/isWeakSet.d.ts +2 -0
  567. package/node_modules/@types/lodash/fp/iteratee.d.ts +2 -0
  568. package/node_modules/@types/lodash/fp/join.d.ts +2 -0
  569. package/node_modules/@types/lodash/fp/juxt.d.ts +2 -0
  570. package/node_modules/@types/lodash/fp/kebabCase.d.ts +2 -0
  571. package/node_modules/@types/lodash/fp/keyBy.d.ts +2 -0
  572. package/node_modules/@types/lodash/fp/keys.d.ts +2 -0
  573. package/node_modules/@types/lodash/fp/keysIn.d.ts +2 -0
  574. package/node_modules/@types/lodash/fp/last.d.ts +2 -0
  575. package/node_modules/@types/lodash/fp/lastIndexOf.d.ts +2 -0
  576. package/node_modules/@types/lodash/fp/lastIndexOfFrom.d.ts +2 -0
  577. package/node_modules/@types/lodash/fp/lowerCase.d.ts +2 -0
  578. package/node_modules/@types/lodash/fp/lowerFirst.d.ts +2 -0
  579. package/node_modules/@types/lodash/fp/lt.d.ts +2 -0
  580. package/node_modules/@types/lodash/fp/lte.d.ts +2 -0
  581. package/node_modules/@types/lodash/fp/map.d.ts +2 -0
  582. package/node_modules/@types/lodash/fp/mapKeys.d.ts +2 -0
  583. package/node_modules/@types/lodash/fp/mapValues.d.ts +2 -0
  584. package/node_modules/@types/lodash/fp/matches.d.ts +2 -0
  585. package/node_modules/@types/lodash/fp/matchesProperty.d.ts +2 -0
  586. package/node_modules/@types/lodash/fp/max.d.ts +2 -0
  587. package/node_modules/@types/lodash/fp/maxBy.d.ts +2 -0
  588. package/node_modules/@types/lodash/fp/mean.d.ts +2 -0
  589. package/node_modules/@types/lodash/fp/meanBy.d.ts +2 -0
  590. package/node_modules/@types/lodash/fp/memoize.d.ts +2 -0
  591. package/node_modules/@types/lodash/fp/merge.d.ts +2 -0
  592. package/node_modules/@types/lodash/fp/mergeAll.d.ts +2 -0
  593. package/node_modules/@types/lodash/fp/mergeAllWith.d.ts +2 -0
  594. package/node_modules/@types/lodash/fp/mergeWith.d.ts +2 -0
  595. package/node_modules/@types/lodash/fp/method.d.ts +2 -0
  596. package/node_modules/@types/lodash/fp/methodOf.d.ts +2 -0
  597. package/node_modules/@types/lodash/fp/min.d.ts +2 -0
  598. package/node_modules/@types/lodash/fp/minBy.d.ts +2 -0
  599. package/node_modules/@types/lodash/fp/multiply.d.ts +2 -0
  600. package/node_modules/@types/lodash/fp/nAry.d.ts +2 -0
  601. package/node_modules/@types/lodash/fp/negate.d.ts +2 -0
  602. package/node_modules/@types/lodash/fp/noConflict.d.ts +2 -0
  603. package/node_modules/@types/lodash/fp/noop.d.ts +2 -0
  604. package/node_modules/@types/lodash/fp/now.d.ts +2 -0
  605. package/node_modules/@types/lodash/fp/nth.d.ts +2 -0
  606. package/node_modules/@types/lodash/fp/nthArg.d.ts +2 -0
  607. package/node_modules/@types/lodash/fp/omit.d.ts +2 -0
  608. package/node_modules/@types/lodash/fp/omitAll.d.ts +2 -0
  609. package/node_modules/@types/lodash/fp/omitBy.d.ts +2 -0
  610. package/node_modules/@types/lodash/fp/once.d.ts +2 -0
  611. package/node_modules/@types/lodash/fp/orderBy.d.ts +2 -0
  612. package/node_modules/@types/lodash/fp/over.d.ts +2 -0
  613. package/node_modules/@types/lodash/fp/overArgs.d.ts +2 -0
  614. package/node_modules/@types/lodash/fp/overEvery.d.ts +2 -0
  615. package/node_modules/@types/lodash/fp/overSome.d.ts +2 -0
  616. package/node_modules/@types/lodash/fp/pad.d.ts +2 -0
  617. package/node_modules/@types/lodash/fp/padChars.d.ts +2 -0
  618. package/node_modules/@types/lodash/fp/padCharsEnd.d.ts +2 -0
  619. package/node_modules/@types/lodash/fp/padCharsStart.d.ts +2 -0
  620. package/node_modules/@types/lodash/fp/padEnd.d.ts +2 -0
  621. package/node_modules/@types/lodash/fp/padStart.d.ts +2 -0
  622. package/node_modules/@types/lodash/fp/parseInt.d.ts +2 -0
  623. package/node_modules/@types/lodash/fp/partial.d.ts +2 -0
  624. package/node_modules/@types/lodash/fp/partialRight.d.ts +2 -0
  625. package/node_modules/@types/lodash/fp/partition.d.ts +2 -0
  626. package/node_modules/@types/lodash/fp/path.d.ts +2 -0
  627. package/node_modules/@types/lodash/fp/pathEq.d.ts +2 -0
  628. package/node_modules/@types/lodash/fp/pathOr.d.ts +2 -0
  629. package/node_modules/@types/lodash/fp/paths.d.ts +2 -0
  630. package/node_modules/@types/lodash/fp/pick.d.ts +2 -0
  631. package/node_modules/@types/lodash/fp/pickAll.d.ts +2 -0
  632. package/node_modules/@types/lodash/fp/pickBy.d.ts +2 -0
  633. package/node_modules/@types/lodash/fp/pipe.d.ts +2 -0
  634. package/node_modules/@types/lodash/fp/placeholder.d.ts +3 -0
  635. package/node_modules/@types/lodash/fp/pluck.d.ts +2 -0
  636. package/node_modules/@types/lodash/fp/prop.d.ts +2 -0
  637. package/node_modules/@types/lodash/fp/propEq.d.ts +2 -0
  638. package/node_modules/@types/lodash/fp/propOr.d.ts +2 -0
  639. package/node_modules/@types/lodash/fp/property.d.ts +2 -0
  640. package/node_modules/@types/lodash/fp/propertyOf.d.ts +2 -0
  641. package/node_modules/@types/lodash/fp/props.d.ts +2 -0
  642. package/node_modules/@types/lodash/fp/pull.d.ts +2 -0
  643. package/node_modules/@types/lodash/fp/pullAll.d.ts +2 -0
  644. package/node_modules/@types/lodash/fp/pullAllBy.d.ts +2 -0
  645. package/node_modules/@types/lodash/fp/pullAllWith.d.ts +2 -0
  646. package/node_modules/@types/lodash/fp/pullAt.d.ts +2 -0
  647. package/node_modules/@types/lodash/fp/random.d.ts +2 -0
  648. package/node_modules/@types/lodash/fp/range.d.ts +2 -0
  649. package/node_modules/@types/lodash/fp/rangeRight.d.ts +2 -0
  650. package/node_modules/@types/lodash/fp/rangeStep.d.ts +2 -0
  651. package/node_modules/@types/lodash/fp/rangeStepRight.d.ts +2 -0
  652. package/node_modules/@types/lodash/fp/rearg.d.ts +2 -0
  653. package/node_modules/@types/lodash/fp/reduce.d.ts +2 -0
  654. package/node_modules/@types/lodash/fp/reduceRight.d.ts +2 -0
  655. package/node_modules/@types/lodash/fp/reject.d.ts +2 -0
  656. package/node_modules/@types/lodash/fp/remove.d.ts +2 -0
  657. package/node_modules/@types/lodash/fp/repeat.d.ts +2 -0
  658. package/node_modules/@types/lodash/fp/replace.d.ts +2 -0
  659. package/node_modules/@types/lodash/fp/rest.d.ts +2 -0
  660. package/node_modules/@types/lodash/fp/restFrom.d.ts +2 -0
  661. package/node_modules/@types/lodash/fp/result.d.ts +2 -0
  662. package/node_modules/@types/lodash/fp/reverse.d.ts +2 -0
  663. package/node_modules/@types/lodash/fp/round.d.ts +2 -0
  664. package/node_modules/@types/lodash/fp/runInContext.d.ts +2 -0
  665. package/node_modules/@types/lodash/fp/sample.d.ts +2 -0
  666. package/node_modules/@types/lodash/fp/sampleSize.d.ts +2 -0
  667. package/node_modules/@types/lodash/fp/set.d.ts +2 -0
  668. package/node_modules/@types/lodash/fp/setWith.d.ts +2 -0
  669. package/node_modules/@types/lodash/fp/shuffle.d.ts +2 -0
  670. package/node_modules/@types/lodash/fp/size.d.ts +2 -0
  671. package/node_modules/@types/lodash/fp/slice.d.ts +2 -0
  672. package/node_modules/@types/lodash/fp/snakeCase.d.ts +2 -0
  673. package/node_modules/@types/lodash/fp/some.d.ts +2 -0
  674. package/node_modules/@types/lodash/fp/sortBy.d.ts +2 -0
  675. package/node_modules/@types/lodash/fp/sortedIndex.d.ts +2 -0
  676. package/node_modules/@types/lodash/fp/sortedIndexBy.d.ts +2 -0
  677. package/node_modules/@types/lodash/fp/sortedIndexOf.d.ts +2 -0
  678. package/node_modules/@types/lodash/fp/sortedLastIndex.d.ts +2 -0
  679. package/node_modules/@types/lodash/fp/sortedLastIndexBy.d.ts +2 -0
  680. package/node_modules/@types/lodash/fp/sortedLastIndexOf.d.ts +2 -0
  681. package/node_modules/@types/lodash/fp/sortedUniq.d.ts +2 -0
  682. package/node_modules/@types/lodash/fp/sortedUniqBy.d.ts +2 -0
  683. package/node_modules/@types/lodash/fp/split.d.ts +2 -0
  684. package/node_modules/@types/lodash/fp/spread.d.ts +2 -0
  685. package/node_modules/@types/lodash/fp/spreadFrom.d.ts +2 -0
  686. package/node_modules/@types/lodash/fp/startCase.d.ts +2 -0
  687. package/node_modules/@types/lodash/fp/startsWith.d.ts +2 -0
  688. package/node_modules/@types/lodash/fp/stubArray.d.ts +2 -0
  689. package/node_modules/@types/lodash/fp/stubFalse.d.ts +2 -0
  690. package/node_modules/@types/lodash/fp/stubObject.d.ts +2 -0
  691. package/node_modules/@types/lodash/fp/stubString.d.ts +2 -0
  692. package/node_modules/@types/lodash/fp/stubTrue.d.ts +2 -0
  693. package/node_modules/@types/lodash/fp/subtract.d.ts +2 -0
  694. package/node_modules/@types/lodash/fp/sum.d.ts +2 -0
  695. package/node_modules/@types/lodash/fp/sumBy.d.ts +2 -0
  696. package/node_modules/@types/lodash/fp/symmetricDifference.d.ts +2 -0
  697. package/node_modules/@types/lodash/fp/symmetricDifferenceBy.d.ts +2 -0
  698. package/node_modules/@types/lodash/fp/symmetricDifferenceWith.d.ts +2 -0
  699. package/node_modules/@types/lodash/fp/tail.d.ts +2 -0
  700. package/node_modules/@types/lodash/fp/take.d.ts +2 -0
  701. package/node_modules/@types/lodash/fp/takeLast.d.ts +2 -0
  702. package/node_modules/@types/lodash/fp/takeLastWhile.d.ts +2 -0
  703. package/node_modules/@types/lodash/fp/takeRight.d.ts +2 -0
  704. package/node_modules/@types/lodash/fp/takeRightWhile.d.ts +2 -0
  705. package/node_modules/@types/lodash/fp/takeWhile.d.ts +2 -0
  706. package/node_modules/@types/lodash/fp/tap.d.ts +2 -0
  707. package/node_modules/@types/lodash/fp/template.d.ts +2 -0
  708. package/node_modules/@types/lodash/fp/throttle.d.ts +2 -0
  709. package/node_modules/@types/lodash/fp/thru.d.ts +2 -0
  710. package/node_modules/@types/lodash/fp/times.d.ts +2 -0
  711. package/node_modules/@types/lodash/fp/toArray.d.ts +2 -0
  712. package/node_modules/@types/lodash/fp/toFinite.d.ts +2 -0
  713. package/node_modules/@types/lodash/fp/toInteger.d.ts +2 -0
  714. package/node_modules/@types/lodash/fp/toLength.d.ts +2 -0
  715. package/node_modules/@types/lodash/fp/toLower.d.ts +2 -0
  716. package/node_modules/@types/lodash/fp/toNumber.d.ts +2 -0
  717. package/node_modules/@types/lodash/fp/toPairs.d.ts +2 -0
  718. package/node_modules/@types/lodash/fp/toPairsIn.d.ts +2 -0
  719. package/node_modules/@types/lodash/fp/toPath.d.ts +2 -0
  720. package/node_modules/@types/lodash/fp/toPlainObject.d.ts +2 -0
  721. package/node_modules/@types/lodash/fp/toSafeInteger.d.ts +2 -0
  722. package/node_modules/@types/lodash/fp/toString.d.ts +2 -0
  723. package/node_modules/@types/lodash/fp/toUpper.d.ts +2 -0
  724. package/node_modules/@types/lodash/fp/transform.d.ts +2 -0
  725. package/node_modules/@types/lodash/fp/trim.d.ts +2 -0
  726. package/node_modules/@types/lodash/fp/trimChars.d.ts +2 -0
  727. package/node_modules/@types/lodash/fp/trimCharsEnd.d.ts +2 -0
  728. package/node_modules/@types/lodash/fp/trimCharsStart.d.ts +2 -0
  729. package/node_modules/@types/lodash/fp/trimEnd.d.ts +2 -0
  730. package/node_modules/@types/lodash/fp/trimStart.d.ts +2 -0
  731. package/node_modules/@types/lodash/fp/truncate.d.ts +2 -0
  732. package/node_modules/@types/lodash/fp/unapply.d.ts +2 -0
  733. package/node_modules/@types/lodash/fp/unary.d.ts +2 -0
  734. package/node_modules/@types/lodash/fp/unescape.d.ts +2 -0
  735. package/node_modules/@types/lodash/fp/union.d.ts +2 -0
  736. package/node_modules/@types/lodash/fp/unionBy.d.ts +2 -0
  737. package/node_modules/@types/lodash/fp/unionWith.d.ts +2 -0
  738. package/node_modules/@types/lodash/fp/uniq.d.ts +2 -0
  739. package/node_modules/@types/lodash/fp/uniqBy.d.ts +2 -0
  740. package/node_modules/@types/lodash/fp/uniqWith.d.ts +2 -0
  741. package/node_modules/@types/lodash/fp/uniqueId.d.ts +2 -0
  742. package/node_modules/@types/lodash/fp/unnest.d.ts +2 -0
  743. package/node_modules/@types/lodash/fp/unset.d.ts +2 -0
  744. package/node_modules/@types/lodash/fp/unzip.d.ts +2 -0
  745. package/node_modules/@types/lodash/fp/unzipWith.d.ts +2 -0
  746. package/node_modules/@types/lodash/fp/update.d.ts +2 -0
  747. package/node_modules/@types/lodash/fp/updateWith.d.ts +2 -0
  748. package/node_modules/@types/lodash/fp/upperCase.d.ts +2 -0
  749. package/node_modules/@types/lodash/fp/upperFirst.d.ts +2 -0
  750. package/node_modules/@types/lodash/fp/useWith.d.ts +2 -0
  751. package/node_modules/@types/lodash/fp/values.d.ts +2 -0
  752. package/node_modules/@types/lodash/fp/valuesIn.d.ts +2 -0
  753. package/node_modules/@types/lodash/fp/where.d.ts +2 -0
  754. package/node_modules/@types/lodash/fp/whereEq.d.ts +2 -0
  755. package/node_modules/@types/lodash/fp/without.d.ts +2 -0
  756. package/node_modules/@types/lodash/fp/words.d.ts +2 -0
  757. package/node_modules/@types/lodash/fp/wrap.d.ts +2 -0
  758. package/node_modules/@types/lodash/fp/xor.d.ts +2 -0
  759. package/node_modules/@types/lodash/fp/xorBy.d.ts +2 -0
  760. package/node_modules/@types/lodash/fp/xorWith.d.ts +2 -0
  761. package/node_modules/@types/lodash/fp/zip.d.ts +2 -0
  762. package/node_modules/@types/lodash/fp/zipAll.d.ts +2 -0
  763. package/node_modules/@types/lodash/fp/zipObj.d.ts +2 -0
  764. package/node_modules/@types/lodash/fp/zipObject.d.ts +2 -0
  765. package/node_modules/@types/lodash/fp/zipObjectDeep.d.ts +2 -0
  766. package/node_modules/@types/lodash/fp/zipWith.d.ts +2 -0
  767. package/node_modules/@types/lodash/fp.d.ts +4962 -0
  768. package/node_modules/@types/lodash/fromPairs.d.ts +2 -0
  769. package/node_modules/@types/lodash/functions.d.ts +2 -0
  770. package/node_modules/@types/lodash/functionsIn.d.ts +2 -0
  771. package/node_modules/@types/lodash/get.d.ts +2 -0
  772. package/node_modules/@types/lodash/groupBy.d.ts +2 -0
  773. package/node_modules/@types/lodash/gt.d.ts +2 -0
  774. package/node_modules/@types/lodash/gte.d.ts +2 -0
  775. package/node_modules/@types/lodash/has.d.ts +2 -0
  776. package/node_modules/@types/lodash/hasIn.d.ts +2 -0
  777. package/node_modules/@types/lodash/head.d.ts +2 -0
  778. package/node_modules/@types/lodash/identity.d.ts +2 -0
  779. package/node_modules/@types/lodash/inRange.d.ts +2 -0
  780. package/node_modules/@types/lodash/includes.d.ts +2 -0
  781. package/node_modules/@types/lodash/index.d.ts +21 -0
  782. package/node_modules/@types/lodash/indexOf.d.ts +2 -0
  783. package/node_modules/@types/lodash/initial.d.ts +2 -0
  784. package/node_modules/@types/lodash/intersection.d.ts +2 -0
  785. package/node_modules/@types/lodash/intersectionBy.d.ts +2 -0
  786. package/node_modules/@types/lodash/intersectionWith.d.ts +2 -0
  787. package/node_modules/@types/lodash/invert.d.ts +2 -0
  788. package/node_modules/@types/lodash/invertBy.d.ts +2 -0
  789. package/node_modules/@types/lodash/invoke.d.ts +2 -0
  790. package/node_modules/@types/lodash/invokeMap.d.ts +2 -0
  791. package/node_modules/@types/lodash/isArguments.d.ts +2 -0
  792. package/node_modules/@types/lodash/isArray.d.ts +2 -0
  793. package/node_modules/@types/lodash/isArrayBuffer.d.ts +2 -0
  794. package/node_modules/@types/lodash/isArrayLike.d.ts +2 -0
  795. package/node_modules/@types/lodash/isArrayLikeObject.d.ts +2 -0
  796. package/node_modules/@types/lodash/isBoolean.d.ts +2 -0
  797. package/node_modules/@types/lodash/isBuffer.d.ts +2 -0
  798. package/node_modules/@types/lodash/isDate.d.ts +2 -0
  799. package/node_modules/@types/lodash/isElement.d.ts +2 -0
  800. package/node_modules/@types/lodash/isEmpty.d.ts +2 -0
  801. package/node_modules/@types/lodash/isEqual.d.ts +2 -0
  802. package/node_modules/@types/lodash/isEqualWith.d.ts +2 -0
  803. package/node_modules/@types/lodash/isError.d.ts +2 -0
  804. package/node_modules/@types/lodash/isFinite.d.ts +2 -0
  805. package/node_modules/@types/lodash/isFunction.d.ts +2 -0
  806. package/node_modules/@types/lodash/isInteger.d.ts +2 -0
  807. package/node_modules/@types/lodash/isLength.d.ts +2 -0
  808. package/node_modules/@types/lodash/isMap.d.ts +2 -0
  809. package/node_modules/@types/lodash/isMatch.d.ts +2 -0
  810. package/node_modules/@types/lodash/isMatchWith.d.ts +2 -0
  811. package/node_modules/@types/lodash/isNaN.d.ts +2 -0
  812. package/node_modules/@types/lodash/isNative.d.ts +2 -0
  813. package/node_modules/@types/lodash/isNil.d.ts +2 -0
  814. package/node_modules/@types/lodash/isNull.d.ts +2 -0
  815. package/node_modules/@types/lodash/isNumber.d.ts +2 -0
  816. package/node_modules/@types/lodash/isObject.d.ts +2 -0
  817. package/node_modules/@types/lodash/isObjectLike.d.ts +2 -0
  818. package/node_modules/@types/lodash/isPlainObject.d.ts +2 -0
  819. package/node_modules/@types/lodash/isRegExp.d.ts +2 -0
  820. package/node_modules/@types/lodash/isSafeInteger.d.ts +2 -0
  821. package/node_modules/@types/lodash/isSet.d.ts +2 -0
  822. package/node_modules/@types/lodash/isString.d.ts +2 -0
  823. package/node_modules/@types/lodash/isSymbol.d.ts +2 -0
  824. package/node_modules/@types/lodash/isTypedArray.d.ts +2 -0
  825. package/node_modules/@types/lodash/isUndefined.d.ts +2 -0
  826. package/node_modules/@types/lodash/isWeakMap.d.ts +2 -0
  827. package/node_modules/@types/lodash/isWeakSet.d.ts +2 -0
  828. package/node_modules/@types/lodash/iteratee.d.ts +2 -0
  829. package/node_modules/@types/lodash/join.d.ts +2 -0
  830. package/node_modules/@types/lodash/kebabCase.d.ts +2 -0
  831. package/node_modules/@types/lodash/keyBy.d.ts +2 -0
  832. package/node_modules/@types/lodash/keys.d.ts +2 -0
  833. package/node_modules/@types/lodash/keysIn.d.ts +2 -0
  834. package/node_modules/@types/lodash/last.d.ts +2 -0
  835. package/node_modules/@types/lodash/lastIndexOf.d.ts +2 -0
  836. package/node_modules/@types/lodash/lowerCase.d.ts +2 -0
  837. package/node_modules/@types/lodash/lowerFirst.d.ts +2 -0
  838. package/node_modules/@types/lodash/lt.d.ts +2 -0
  839. package/node_modules/@types/lodash/lte.d.ts +2 -0
  840. package/node_modules/@types/lodash/map.d.ts +2 -0
  841. package/node_modules/@types/lodash/mapKeys.d.ts +2 -0
  842. package/node_modules/@types/lodash/mapValues.d.ts +2 -0
  843. package/node_modules/@types/lodash/matches.d.ts +2 -0
  844. package/node_modules/@types/lodash/matchesProperty.d.ts +2 -0
  845. package/node_modules/@types/lodash/max.d.ts +2 -0
  846. package/node_modules/@types/lodash/maxBy.d.ts +2 -0
  847. package/node_modules/@types/lodash/mean.d.ts +2 -0
  848. package/node_modules/@types/lodash/meanBy.d.ts +2 -0
  849. package/node_modules/@types/lodash/memoize.d.ts +2 -0
  850. package/node_modules/@types/lodash/merge.d.ts +2 -0
  851. package/node_modules/@types/lodash/mergeWith.d.ts +2 -0
  852. package/node_modules/@types/lodash/method.d.ts +2 -0
  853. package/node_modules/@types/lodash/methodOf.d.ts +2 -0
  854. package/node_modules/@types/lodash/min.d.ts +2 -0
  855. package/node_modules/@types/lodash/minBy.d.ts +2 -0
  856. package/node_modules/@types/lodash/mixin.d.ts +2 -0
  857. package/node_modules/@types/lodash/multiply.d.ts +2 -0
  858. package/node_modules/@types/lodash/negate.d.ts +2 -0
  859. package/node_modules/@types/lodash/noConflict.d.ts +2 -0
  860. package/node_modules/@types/lodash/noop.d.ts +2 -0
  861. package/node_modules/@types/lodash/now.d.ts +2 -0
  862. package/node_modules/@types/lodash/nth.d.ts +2 -0
  863. package/node_modules/@types/lodash/nthArg.d.ts +2 -0
  864. package/node_modules/@types/lodash/omit.d.ts +2 -0
  865. package/node_modules/@types/lodash/omitBy.d.ts +2 -0
  866. package/node_modules/@types/lodash/once.d.ts +2 -0
  867. package/node_modules/@types/lodash/orderBy.d.ts +2 -0
  868. package/node_modules/@types/lodash/over.d.ts +2 -0
  869. package/node_modules/@types/lodash/overArgs.d.ts +2 -0
  870. package/node_modules/@types/lodash/overEvery.d.ts +2 -0
  871. package/node_modules/@types/lodash/overSome.d.ts +2 -0
  872. package/node_modules/@types/lodash/package.json +56 -0
  873. package/node_modules/@types/lodash/pad.d.ts +2 -0
  874. package/node_modules/@types/lodash/padEnd.d.ts +2 -0
  875. package/node_modules/@types/lodash/padStart.d.ts +2 -0
  876. package/node_modules/@types/lodash/parseInt.d.ts +2 -0
  877. package/node_modules/@types/lodash/partial.d.ts +2 -0
  878. package/node_modules/@types/lodash/partialRight.d.ts +2 -0
  879. package/node_modules/@types/lodash/partition.d.ts +2 -0
  880. package/node_modules/@types/lodash/pick.d.ts +2 -0
  881. package/node_modules/@types/lodash/pickBy.d.ts +2 -0
  882. package/node_modules/@types/lodash/property.d.ts +2 -0
  883. package/node_modules/@types/lodash/propertyOf.d.ts +2 -0
  884. package/node_modules/@types/lodash/pull.d.ts +2 -0
  885. package/node_modules/@types/lodash/pullAll.d.ts +2 -0
  886. package/node_modules/@types/lodash/pullAllBy.d.ts +2 -0
  887. package/node_modules/@types/lodash/pullAllWith.d.ts +2 -0
  888. package/node_modules/@types/lodash/pullAt.d.ts +2 -0
  889. package/node_modules/@types/lodash/random.d.ts +2 -0
  890. package/node_modules/@types/lodash/range.d.ts +2 -0
  891. package/node_modules/@types/lodash/rangeRight.d.ts +2 -0
  892. package/node_modules/@types/lodash/rearg.d.ts +2 -0
  893. package/node_modules/@types/lodash/reduce.d.ts +2 -0
  894. package/node_modules/@types/lodash/reduceRight.d.ts +2 -0
  895. package/node_modules/@types/lodash/reject.d.ts +2 -0
  896. package/node_modules/@types/lodash/remove.d.ts +2 -0
  897. package/node_modules/@types/lodash/repeat.d.ts +2 -0
  898. package/node_modules/@types/lodash/replace.d.ts +2 -0
  899. package/node_modules/@types/lodash/rest.d.ts +2 -0
  900. package/node_modules/@types/lodash/result.d.ts +2 -0
  901. package/node_modules/@types/lodash/reverse.d.ts +2 -0
  902. package/node_modules/@types/lodash/round.d.ts +2 -0
  903. package/node_modules/@types/lodash/runInContext.d.ts +2 -0
  904. package/node_modules/@types/lodash/sample.d.ts +2 -0
  905. package/node_modules/@types/lodash/sampleSize.d.ts +2 -0
  906. package/node_modules/@types/lodash/set.d.ts +2 -0
  907. package/node_modules/@types/lodash/setWith.d.ts +2 -0
  908. package/node_modules/@types/lodash/shuffle.d.ts +2 -0
  909. package/node_modules/@types/lodash/size.d.ts +2 -0
  910. package/node_modules/@types/lodash/slice.d.ts +2 -0
  911. package/node_modules/@types/lodash/snakeCase.d.ts +2 -0
  912. package/node_modules/@types/lodash/some.d.ts +2 -0
  913. package/node_modules/@types/lodash/sortBy.d.ts +2 -0
  914. package/node_modules/@types/lodash/sortedIndex.d.ts +2 -0
  915. package/node_modules/@types/lodash/sortedIndexBy.d.ts +2 -0
  916. package/node_modules/@types/lodash/sortedIndexOf.d.ts +2 -0
  917. package/node_modules/@types/lodash/sortedLastIndex.d.ts +2 -0
  918. package/node_modules/@types/lodash/sortedLastIndexBy.d.ts +2 -0
  919. package/node_modules/@types/lodash/sortedLastIndexOf.d.ts +2 -0
  920. package/node_modules/@types/lodash/sortedUniq.d.ts +2 -0
  921. package/node_modules/@types/lodash/sortedUniqBy.d.ts +2 -0
  922. package/node_modules/@types/lodash/split.d.ts +2 -0
  923. package/node_modules/@types/lodash/spread.d.ts +2 -0
  924. package/node_modules/@types/lodash/startCase.d.ts +2 -0
  925. package/node_modules/@types/lodash/startsWith.d.ts +2 -0
  926. package/node_modules/@types/lodash/stubFalse.d.ts +2 -0
  927. package/node_modules/@types/lodash/stubTrue.d.ts +2 -0
  928. package/node_modules/@types/lodash/subtract.d.ts +2 -0
  929. package/node_modules/@types/lodash/sum.d.ts +2 -0
  930. package/node_modules/@types/lodash/sumBy.d.ts +2 -0
  931. package/node_modules/@types/lodash/tail.d.ts +2 -0
  932. package/node_modules/@types/lodash/take.d.ts +2 -0
  933. package/node_modules/@types/lodash/takeRight.d.ts +2 -0
  934. package/node_modules/@types/lodash/takeRightWhile.d.ts +2 -0
  935. package/node_modules/@types/lodash/takeWhile.d.ts +2 -0
  936. package/node_modules/@types/lodash/tap.d.ts +2 -0
  937. package/node_modules/@types/lodash/template.d.ts +2 -0
  938. package/node_modules/@types/lodash/throttle.d.ts +2 -0
  939. package/node_modules/@types/lodash/thru.d.ts +2 -0
  940. package/node_modules/@types/lodash/times.d.ts +2 -0
  941. package/node_modules/@types/lodash/toArray.d.ts +2 -0
  942. package/node_modules/@types/lodash/toFinite.d.ts +2 -0
  943. package/node_modules/@types/lodash/toInteger.d.ts +2 -0
  944. package/node_modules/@types/lodash/toLength.d.ts +2 -0
  945. package/node_modules/@types/lodash/toLower.d.ts +2 -0
  946. package/node_modules/@types/lodash/toNumber.d.ts +2 -0
  947. package/node_modules/@types/lodash/toPairs.d.ts +2 -0
  948. package/node_modules/@types/lodash/toPairsIn.d.ts +2 -0
  949. package/node_modules/@types/lodash/toPath.d.ts +2 -0
  950. package/node_modules/@types/lodash/toPlainObject.d.ts +2 -0
  951. package/node_modules/@types/lodash/toSafeInteger.d.ts +2 -0
  952. package/node_modules/@types/lodash/toString.d.ts +2 -0
  953. package/node_modules/@types/lodash/toUpper.d.ts +2 -0
  954. package/node_modules/@types/lodash/transform.d.ts +2 -0
  955. package/node_modules/@types/lodash/trim.d.ts +2 -0
  956. package/node_modules/@types/lodash/trimEnd.d.ts +2 -0
  957. package/node_modules/@types/lodash/trimStart.d.ts +2 -0
  958. package/node_modules/@types/lodash/truncate.d.ts +2 -0
  959. package/node_modules/@types/lodash/unary.d.ts +2 -0
  960. package/node_modules/@types/lodash/unescape.d.ts +2 -0
  961. package/node_modules/@types/lodash/union.d.ts +2 -0
  962. package/node_modules/@types/lodash/unionBy.d.ts +2 -0
  963. package/node_modules/@types/lodash/unionWith.d.ts +2 -0
  964. package/node_modules/@types/lodash/uniq.d.ts +2 -0
  965. package/node_modules/@types/lodash/uniqBy.d.ts +2 -0
  966. package/node_modules/@types/lodash/uniqWith.d.ts +2 -0
  967. package/node_modules/@types/lodash/uniqueId.d.ts +2 -0
  968. package/node_modules/@types/lodash/unset.d.ts +2 -0
  969. package/node_modules/@types/lodash/unzip.d.ts +2 -0
  970. package/node_modules/@types/lodash/unzipWith.d.ts +2 -0
  971. package/node_modules/@types/lodash/update.d.ts +2 -0
  972. package/node_modules/@types/lodash/updateWith.d.ts +2 -0
  973. package/node_modules/@types/lodash/upperCase.d.ts +2 -0
  974. package/node_modules/@types/lodash/upperFirst.d.ts +2 -0
  975. package/node_modules/@types/lodash/values.d.ts +2 -0
  976. package/node_modules/@types/lodash/valuesIn.d.ts +2 -0
  977. package/node_modules/@types/lodash/without.d.ts +2 -0
  978. package/node_modules/@types/lodash/words.d.ts +2 -0
  979. package/node_modules/@types/lodash/wrap.d.ts +2 -0
  980. package/node_modules/@types/lodash/xor.d.ts +2 -0
  981. package/node_modules/@types/lodash/xorBy.d.ts +2 -0
  982. package/node_modules/@types/lodash/xorWith.d.ts +2 -0
  983. package/node_modules/@types/lodash/zip.d.ts +2 -0
  984. package/node_modules/@types/lodash/zipObject.d.ts +2 -0
  985. package/node_modules/@types/lodash/zipObjectDeep.d.ts +2 -0
  986. package/node_modules/@types/lodash/zipWith.d.ts +2 -0
  987. package/node_modules/@types/lodash.transform/LICENSE +21 -0
  988. package/node_modules/@types/lodash.transform/README.md +23 -0
  989. package/node_modules/@types/lodash.transform/index.d.ts +4 -0
  990. package/node_modules/@types/lodash.transform/package.json +32 -0
  991. package/node_modules/@types/uuid/LICENSE +21 -0
  992. package/node_modules/@types/uuid/README.md +15 -0
  993. package/node_modules/@types/uuid/index.d.mts +19 -0
  994. package/node_modules/@types/uuid/index.d.ts +113 -0
  995. package/node_modules/@types/uuid/package.json +54 -0
  996. package/node_modules/big-integer/BigInteger.d.ts +2393 -0
  997. package/node_modules/big-integer/BigInteger.js +1453 -0
  998. package/node_modules/big-integer/BigInteger.min.js +1 -0
  999. package/node_modules/big-integer/LICENSE +24 -0
  1000. package/node_modules/big-integer/README.md +589 -0
  1001. package/node_modules/big-integer/bower.json +29 -0
  1002. package/node_modules/big-integer/package.json +48 -0
  1003. package/node_modules/big-integer/tsconfig.json +24 -0
  1004. package/node_modules/decimal.js-light/CHANGELOG.md +87 -0
  1005. package/node_modules/decimal.js-light/LICENCE.md +23 -0
  1006. package/node_modules/decimal.js-light/README.md +92 -0
  1007. package/node_modules/decimal.js-light/decimal.d.ts +570 -0
  1008. package/node_modules/decimal.js-light/decimal.js +2014 -0
  1009. package/node_modules/decimal.js-light/decimal.min.js +3 -0
  1010. package/node_modules/decimal.js-light/decimal.mjs +1985 -0
  1011. package/node_modules/decimal.js-light/doc/API.html +1312 -0
  1012. package/node_modules/decimal.js-light/doc/decimal.js.map +1 -0
  1013. package/node_modules/decimal.js-light/package.json +36 -0
  1014. package/node_modules/eventemitter3/LICENSE +21 -0
  1015. package/node_modules/eventemitter3/README.md +85 -0
  1016. package/node_modules/eventemitter3/dist/eventemitter3.esm.js +355 -0
  1017. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +1 -0
  1018. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +1 -0
  1019. package/node_modules/eventemitter3/dist/eventemitter3.umd.js +363 -0
  1020. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +1 -0
  1021. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +1 -0
  1022. package/node_modules/eventemitter3/index.d.ts +135 -0
  1023. package/node_modules/eventemitter3/index.js +336 -0
  1024. package/node_modules/eventemitter3/index.mjs +4 -0
  1025. package/node_modules/eventemitter3/package.json +62 -0
  1026. package/node_modules/lodash.transform/LICENSE +47 -0
  1027. package/node_modules/lodash.transform/README.md +18 -0
  1028. package/node_modules/lodash.transform/index.js +2329 -0
  1029. package/node_modules/lodash.transform/package.json +17 -0
  1030. package/node_modules/uuid/LICENSE.md +9 -0
  1031. package/node_modules/uuid/README.md +491 -0
  1032. package/node_modules/uuid/dist/index.d.ts +15 -0
  1033. package/node_modules/uuid/dist/index.js +14 -0
  1034. package/node_modules/uuid/dist/max.d.ts +2 -0
  1035. package/node_modules/uuid/dist/max.js +1 -0
  1036. package/node_modules/uuid/dist/md5.d.ts +2 -0
  1037. package/node_modules/uuid/dist/md5.js +135 -0
  1038. package/node_modules/uuid/dist/nil.d.ts +2 -0
  1039. package/node_modules/uuid/dist/nil.js +1 -0
  1040. package/node_modules/uuid/dist/parse.d.ts +3 -0
  1041. package/node_modules/uuid/dist/parse.js +9 -0
  1042. package/node_modules/uuid/dist/regex.d.ts +2 -0
  1043. package/node_modules/uuid/dist/regex.js +1 -0
  1044. package/node_modules/uuid/dist/rng.d.ts +1 -0
  1045. package/node_modules/uuid/dist/rng.js +4 -0
  1046. package/node_modules/uuid/dist/sha1.d.ts +2 -0
  1047. package/node_modules/uuid/dist/sha1.js +70 -0
  1048. package/node_modules/uuid/dist/stringify.d.ts +3 -0
  1049. package/node_modules/uuid/dist/stringify.js +35 -0
  1050. package/node_modules/uuid/dist/types.d.ts +22 -0
  1051. package/node_modules/uuid/dist/types.js +1 -0
  1052. package/node_modules/uuid/dist/uuid-bin.d.ts +1 -0
  1053. package/node_modules/uuid/dist/uuid-bin.js +70 -0
  1054. package/node_modules/uuid/dist/v1.d.ts +11 -0
  1055. package/node_modules/uuid/dist/v1.js +83 -0
  1056. package/node_modules/uuid/dist/v1ToV6.d.ts +3 -0
  1057. package/node_modules/uuid/dist/v1ToV6.js +10 -0
  1058. package/node_modules/uuid/dist/v3.d.ts +9 -0
  1059. package/node_modules/uuid/dist/v3.js +9 -0
  1060. package/node_modules/uuid/dist/v35.d.ts +7 -0
  1061. package/node_modules/uuid/dist/v35.js +39 -0
  1062. package/node_modules/uuid/dist/v4.d.ts +4 -0
  1063. package/node_modules/uuid/dist/v4.js +29 -0
  1064. package/node_modules/uuid/dist/v5.d.ts +9 -0
  1065. package/node_modules/uuid/dist/v5.js +9 -0
  1066. package/node_modules/uuid/dist/v6.d.ts +4 -0
  1067. package/node_modules/uuid/dist/v6.js +20 -0
  1068. package/node_modules/uuid/dist/v6ToV1.d.ts +2 -0
  1069. package/node_modules/uuid/dist/v6ToV1.js +10 -0
  1070. package/node_modules/uuid/dist/v7.d.ts +9 -0
  1071. package/node_modules/uuid/dist/v7.js +65 -0
  1072. package/node_modules/uuid/dist/validate.d.ts +2 -0
  1073. package/node_modules/uuid/dist/validate.js +5 -0
  1074. package/node_modules/uuid/dist/version.d.ts +2 -0
  1075. package/node_modules/uuid/dist/version.js +8 -0
  1076. package/node_modules/uuid/dist-node/bin/uuid +2 -0
  1077. package/node_modules/uuid/dist-node/index.js +14 -0
  1078. package/node_modules/uuid/dist-node/max.js +1 -0
  1079. package/node_modules/uuid/dist-node/md5.js +11 -0
  1080. package/node_modules/uuid/dist-node/nil.js +1 -0
  1081. package/node_modules/uuid/dist-node/parse.js +9 -0
  1082. package/node_modules/uuid/dist-node/regex.js +1 -0
  1083. package/node_modules/uuid/dist-node/rng.js +4 -0
  1084. package/node_modules/uuid/dist-node/sha1.js +11 -0
  1085. package/node_modules/uuid/dist-node/stringify.js +35 -0
  1086. package/node_modules/uuid/dist-node/types.js +1 -0
  1087. package/node_modules/uuid/dist-node/uuid-bin.js +70 -0
  1088. package/node_modules/uuid/dist-node/v1.js +83 -0
  1089. package/node_modules/uuid/dist-node/v1ToV6.js +10 -0
  1090. package/node_modules/uuid/dist-node/v3.js +9 -0
  1091. package/node_modules/uuid/dist-node/v35.js +39 -0
  1092. package/node_modules/uuid/dist-node/v4.js +29 -0
  1093. package/node_modules/uuid/dist-node/v5.js +9 -0
  1094. package/node_modules/uuid/dist-node/v6.js +20 -0
  1095. package/node_modules/uuid/dist-node/v6ToV1.js +10 -0
  1096. package/node_modules/uuid/dist-node/v7.js +65 -0
  1097. package/node_modules/uuid/dist-node/validate.js +5 -0
  1098. package/node_modules/uuid/dist-node/version.js +8 -0
  1099. package/node_modules/uuid/package.json +110 -0
  1100. package/node_modules/zod/LICENSE +21 -0
  1101. package/node_modules/zod/README.md +208 -0
  1102. package/node_modules/zod/index.cjs +33 -0
  1103. package/node_modules/zod/index.d.cts +4 -0
  1104. package/node_modules/zod/index.d.ts +4 -0
  1105. package/node_modules/zod/index.js +4 -0
  1106. package/node_modules/zod/package.json +118 -0
  1107. package/node_modules/zod/src/index.ts +4 -0
  1108. package/node_modules/zod/src/v3/ZodError.ts +330 -0
  1109. package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  1110. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  1111. package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  1112. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  1113. package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  1114. package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  1115. package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  1116. package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  1117. package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  1118. package/node_modules/zod/src/v3/errors.ts +13 -0
  1119. package/node_modules/zod/src/v3/external.ts +6 -0
  1120. package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  1121. package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  1122. package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  1123. package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  1124. package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  1125. package/node_modules/zod/src/v3/helpers/util.ts +224 -0
  1126. package/node_modules/zod/src/v3/index.ts +4 -0
  1127. package/node_modules/zod/src/v3/locales/en.ts +124 -0
  1128. package/node_modules/zod/src/v3/standard-schema.ts +113 -0
  1129. package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  1130. package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  1131. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  1132. package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  1133. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  1134. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  1135. package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  1136. package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  1137. package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  1138. package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  1139. package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  1140. package/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
  1141. package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  1142. package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  1143. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  1144. package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  1145. package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  1146. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  1147. package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  1148. package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
  1149. package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  1150. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  1151. package/node_modules/zod/src/v3/tests/function.test.ts +257 -0
  1152. package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  1153. package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  1154. package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
  1155. package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  1156. package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
  1157. package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  1158. package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  1159. package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  1160. package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  1161. package/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
  1162. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  1163. package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  1164. package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  1165. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  1166. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  1167. package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
  1168. package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  1169. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  1170. package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  1171. package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  1172. package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  1173. package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  1174. package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  1175. package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  1176. package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  1177. package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
  1178. package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  1179. package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  1180. package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  1181. package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  1182. package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  1183. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  1184. package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
  1185. package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  1186. package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  1187. package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  1188. package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  1189. package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  1190. package/node_modules/zod/src/v3/types.ts +5136 -0
  1191. package/node_modules/zod/src/v4/classic/checks.ts +30 -0
  1192. package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  1193. package/node_modules/zod/src/v4/classic/compat.ts +66 -0
  1194. package/node_modules/zod/src/v4/classic/errors.ts +75 -0
  1195. package/node_modules/zod/src/v4/classic/external.ts +50 -0
  1196. package/node_modules/zod/src/v4/classic/index.ts +5 -0
  1197. package/node_modules/zod/src/v4/classic/iso.ts +90 -0
  1198. package/node_modules/zod/src/v4/classic/parse.ts +33 -0
  1199. package/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
  1200. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  1201. package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  1202. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
  1203. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  1204. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  1205. package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  1206. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
  1207. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
  1208. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
  1209. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  1210. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  1211. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
  1212. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  1213. package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
  1214. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
  1215. package/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
  1216. package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  1217. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
  1218. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
  1219. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
  1220. package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
  1221. package/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
  1222. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
  1223. package/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
  1224. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  1225. package/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
  1226. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
  1227. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
  1228. package/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
  1229. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
  1230. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
  1231. package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
  1232. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  1233. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  1234. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
  1235. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  1236. package/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
  1237. package/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
  1238. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
  1239. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
  1240. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
  1241. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
  1242. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
  1243. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
  1244. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  1245. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  1246. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  1247. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
  1248. package/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
  1249. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
  1250. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
  1251. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
  1252. package/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
  1253. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
  1254. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
  1255. package/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
  1256. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
  1257. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
  1258. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
  1259. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
  1260. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
  1261. package/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
  1262. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  1263. package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  1264. package/node_modules/zod/src/v4/core/api.ts +1594 -0
  1265. package/node_modules/zod/src/v4/core/checks.ts +1283 -0
  1266. package/node_modules/zod/src/v4/core/config.ts +15 -0
  1267. package/node_modules/zod/src/v4/core/core.ts +134 -0
  1268. package/node_modules/zod/src/v4/core/doc.ts +44 -0
  1269. package/node_modules/zod/src/v4/core/errors.ts +424 -0
  1270. package/node_modules/zod/src/v4/core/function.ts +176 -0
  1271. package/node_modules/zod/src/v4/core/index.ts +15 -0
  1272. package/node_modules/zod/src/v4/core/json-schema.ts +143 -0
  1273. package/node_modules/zod/src/v4/core/parse.ts +94 -0
  1274. package/node_modules/zod/src/v4/core/regexes.ts +135 -0
  1275. package/node_modules/zod/src/v4/core/registries.ts +96 -0
  1276. package/node_modules/zod/src/v4/core/schemas.ts +3842 -0
  1277. package/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
  1278. package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  1279. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  1280. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  1281. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  1282. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  1283. package/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
  1284. package/node_modules/zod/src/v4/core/util.ts +775 -0
  1285. package/node_modules/zod/src/v4/core/versions.ts +5 -0
  1286. package/node_modules/zod/src/v4/core/zsf.ts +323 -0
  1287. package/node_modules/zod/src/v4/index.ts +4 -0
  1288. package/node_modules/zod/src/v4/locales/ar.ts +125 -0
  1289. package/node_modules/zod/src/v4/locales/az.ts +121 -0
  1290. package/node_modules/zod/src/v4/locales/be.ts +184 -0
  1291. package/node_modules/zod/src/v4/locales/ca.ts +127 -0
  1292. package/node_modules/zod/src/v4/locales/cs.ts +142 -0
  1293. package/node_modules/zod/src/v4/locales/de.ts +124 -0
  1294. package/node_modules/zod/src/v4/locales/en.ts +127 -0
  1295. package/node_modules/zod/src/v4/locales/eo.ts +125 -0
  1296. package/node_modules/zod/src/v4/locales/es.ts +125 -0
  1297. package/node_modules/zod/src/v4/locales/fa.ts +134 -0
  1298. package/node_modules/zod/src/v4/locales/fi.ts +131 -0
  1299. package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
  1300. package/node_modules/zod/src/v4/locales/fr.ts +124 -0
  1301. package/node_modules/zod/src/v4/locales/he.ts +125 -0
  1302. package/node_modules/zod/src/v4/locales/hu.ts +126 -0
  1303. package/node_modules/zod/src/v4/locales/id.ts +125 -0
  1304. package/node_modules/zod/src/v4/locales/index.ts +39 -0
  1305. package/node_modules/zod/src/v4/locales/it.ts +125 -0
  1306. package/node_modules/zod/src/v4/locales/ja.ts +122 -0
  1307. package/node_modules/zod/src/v4/locales/kh.ts +126 -0
  1308. package/node_modules/zod/src/v4/locales/ko.ts +131 -0
  1309. package/node_modules/zod/src/v4/locales/mk.ts +127 -0
  1310. package/node_modules/zod/src/v4/locales/ms.ts +124 -0
  1311. package/node_modules/zod/src/v4/locales/nl.ts +126 -0
  1312. package/node_modules/zod/src/v4/locales/no.ts +124 -0
  1313. package/node_modules/zod/src/v4/locales/ota.ts +125 -0
  1314. package/node_modules/zod/src/v4/locales/pl.ts +126 -0
  1315. package/node_modules/zod/src/v4/locales/ps.ts +133 -0
  1316. package/node_modules/zod/src/v4/locales/pt.ts +123 -0
  1317. package/node_modules/zod/src/v4/locales/ru.ts +184 -0
  1318. package/node_modules/zod/src/v4/locales/sl.ts +126 -0
  1319. package/node_modules/zod/src/v4/locales/sv.ts +127 -0
  1320. package/node_modules/zod/src/v4/locales/ta.ts +125 -0
  1321. package/node_modules/zod/src/v4/locales/th.ts +126 -0
  1322. package/node_modules/zod/src/v4/locales/tr.ts +121 -0
  1323. package/node_modules/zod/src/v4/locales/ua.ts +126 -0
  1324. package/node_modules/zod/src/v4/locales/ur.ts +126 -0
  1325. package/node_modules/zod/src/v4/locales/vi.ts +125 -0
  1326. package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
  1327. package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
  1328. package/node_modules/zod/src/v4/mini/checks.ts +32 -0
  1329. package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
  1330. package/node_modules/zod/src/v4/mini/external.ts +40 -0
  1331. package/node_modules/zod/src/v4/mini/index.ts +3 -0
  1332. package/node_modules/zod/src/v4/mini/iso.ts +62 -0
  1333. package/node_modules/zod/src/v4/mini/parse.ts +1 -0
  1334. package/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
  1335. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
  1336. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
  1337. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
  1338. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
  1339. package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
  1340. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
  1341. package/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
  1342. package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
  1343. package/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
  1344. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  1345. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
  1346. package/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
  1347. package/node_modules/zod/src/v4-mini/index.ts +1 -0
  1348. package/node_modules/zod/v3/ZodError.cjs +138 -0
  1349. package/node_modules/zod/v3/ZodError.d.cts +164 -0
  1350. package/node_modules/zod/v3/ZodError.d.ts +164 -0
  1351. package/node_modules/zod/v3/ZodError.js +133 -0
  1352. package/node_modules/zod/v3/errors.cjs +17 -0
  1353. package/node_modules/zod/v3/errors.d.cts +5 -0
  1354. package/node_modules/zod/v3/errors.d.ts +5 -0
  1355. package/node_modules/zod/v3/errors.js +9 -0
  1356. package/node_modules/zod/v3/external.cjs +22 -0
  1357. package/node_modules/zod/v3/external.d.cts +6 -0
  1358. package/node_modules/zod/v3/external.d.ts +6 -0
  1359. package/node_modules/zod/v3/external.js +6 -0
  1360. package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
  1361. package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  1362. package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  1363. package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  1364. package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
  1365. package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  1366. package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  1367. package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  1368. package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
  1369. package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  1370. package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  1371. package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  1372. package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
  1373. package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  1374. package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  1375. package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  1376. package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
  1377. package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  1378. package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  1379. package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  1380. package/node_modules/zod/v3/helpers/util.cjs +137 -0
  1381. package/node_modules/zod/v3/helpers/util.d.cts +85 -0
  1382. package/node_modules/zod/v3/helpers/util.d.ts +85 -0
  1383. package/node_modules/zod/v3/helpers/util.js +133 -0
  1384. package/node_modules/zod/v3/index.cjs +33 -0
  1385. package/node_modules/zod/v3/index.d.cts +4 -0
  1386. package/node_modules/zod/v3/index.d.ts +4 -0
  1387. package/node_modules/zod/v3/index.js +4 -0
  1388. package/node_modules/zod/v3/locales/en.cjs +111 -0
  1389. package/node_modules/zod/v3/locales/en.d.cts +3 -0
  1390. package/node_modules/zod/v3/locales/en.d.ts +3 -0
  1391. package/node_modules/zod/v3/locales/en.js +109 -0
  1392. package/node_modules/zod/v3/standard-schema.cjs +2 -0
  1393. package/node_modules/zod/v3/standard-schema.d.cts +102 -0
  1394. package/node_modules/zod/v3/standard-schema.d.ts +102 -0
  1395. package/node_modules/zod/v3/standard-schema.js +1 -0
  1396. package/node_modules/zod/v3/types.cjs +3775 -0
  1397. package/node_modules/zod/v3/types.d.cts +1031 -0
  1398. package/node_modules/zod/v3/types.d.ts +1031 -0
  1399. package/node_modules/zod/v3/types.js +3693 -0
  1400. package/node_modules/zod/v4/classic/checks.cjs +32 -0
  1401. package/node_modules/zod/v4/classic/checks.d.cts +1 -0
  1402. package/node_modules/zod/v4/classic/checks.d.ts +1 -0
  1403. package/node_modules/zod/v4/classic/checks.js +1 -0
  1404. package/node_modules/zod/v4/classic/coerce.cjs +47 -0
  1405. package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  1406. package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  1407. package/node_modules/zod/v4/classic/coerce.js +17 -0
  1408. package/node_modules/zod/v4/classic/compat.cjs +57 -0
  1409. package/node_modules/zod/v4/classic/compat.d.cts +46 -0
  1410. package/node_modules/zod/v4/classic/compat.d.ts +46 -0
  1411. package/node_modules/zod/v4/classic/compat.js +27 -0
  1412. package/node_modules/zod/v4/classic/errors.cjs +67 -0
  1413. package/node_modules/zod/v4/classic/errors.d.cts +30 -0
  1414. package/node_modules/zod/v4/classic/errors.d.ts +30 -0
  1415. package/node_modules/zod/v4/classic/errors.js +41 -0
  1416. package/node_modules/zod/v4/classic/external.cjs +70 -0
  1417. package/node_modules/zod/v4/classic/external.d.cts +13 -0
  1418. package/node_modules/zod/v4/classic/external.d.ts +13 -0
  1419. package/node_modules/zod/v4/classic/external.js +18 -0
  1420. package/node_modules/zod/v4/classic/index.cjs +33 -0
  1421. package/node_modules/zod/v4/classic/index.d.cts +4 -0
  1422. package/node_modules/zod/v4/classic/index.d.ts +4 -0
  1423. package/node_modules/zod/v4/classic/index.js +4 -0
  1424. package/node_modules/zod/v4/classic/iso.cjs +60 -0
  1425. package/node_modules/zod/v4/classic/iso.d.cts +22 -0
  1426. package/node_modules/zod/v4/classic/iso.d.ts +22 -0
  1427. package/node_modules/zod/v4/classic/iso.js +30 -0
  1428. package/node_modules/zod/v4/classic/parse.cjs +32 -0
  1429. package/node_modules/zod/v4/classic/parse.d.cts +23 -0
  1430. package/node_modules/zod/v4/classic/parse.d.ts +23 -0
  1431. package/node_modules/zod/v4/classic/parse.js +6 -0
  1432. package/node_modules/zod/v4/classic/schemas.cjs +1109 -0
  1433. package/node_modules/zod/v4/classic/schemas.d.cts +630 -0
  1434. package/node_modules/zod/v4/classic/schemas.d.ts +630 -0
  1435. package/node_modules/zod/v4/classic/schemas.js +1006 -0
  1436. package/node_modules/zod/v4/core/api.cjs +1039 -0
  1437. package/node_modules/zod/v4/core/api.d.cts +284 -0
  1438. package/node_modules/zod/v4/core/api.d.ts +284 -0
  1439. package/node_modules/zod/v4/core/api.js +906 -0
  1440. package/node_modules/zod/v4/core/checks.cjs +591 -0
  1441. package/node_modules/zod/v4/core/checks.d.cts +278 -0
  1442. package/node_modules/zod/v4/core/checks.d.ts +278 -0
  1443. package/node_modules/zod/v4/core/checks.js +565 -0
  1444. package/node_modules/zod/v4/core/core.cjs +67 -0
  1445. package/node_modules/zod/v4/core/core.d.cts +49 -0
  1446. package/node_modules/zod/v4/core/core.d.ts +49 -0
  1447. package/node_modules/zod/v4/core/core.js +61 -0
  1448. package/node_modules/zod/v4/core/doc.cjs +39 -0
  1449. package/node_modules/zod/v4/core/doc.d.cts +14 -0
  1450. package/node_modules/zod/v4/core/doc.d.ts +14 -0
  1451. package/node_modules/zod/v4/core/doc.js +35 -0
  1452. package/node_modules/zod/v4/core/errors.cjs +226 -0
  1453. package/node_modules/zod/v4/core/errors.d.cts +208 -0
  1454. package/node_modules/zod/v4/core/errors.d.ts +208 -0
  1455. package/node_modules/zod/v4/core/errors.js +195 -0
  1456. package/node_modules/zod/v4/core/function.cjs +102 -0
  1457. package/node_modules/zod/v4/core/function.d.cts +52 -0
  1458. package/node_modules/zod/v4/core/function.d.ts +52 -0
  1459. package/node_modules/zod/v4/core/function.js +75 -0
  1460. package/node_modules/zod/v4/core/index.cjs +44 -0
  1461. package/node_modules/zod/v4/core/index.d.cts +15 -0
  1462. package/node_modules/zod/v4/core/index.d.ts +15 -0
  1463. package/node_modules/zod/v4/core/index.js +15 -0
  1464. package/node_modules/zod/v4/core/json-schema.cjs +2 -0
  1465. package/node_modules/zod/v4/core/json-schema.d.cts +87 -0
  1466. package/node_modules/zod/v4/core/json-schema.d.ts +87 -0
  1467. package/node_modules/zod/v4/core/json-schema.js +1 -0
  1468. package/node_modules/zod/v4/core/parse.cjs +87 -0
  1469. package/node_modules/zod/v4/core/parse.d.cts +25 -0
  1470. package/node_modules/zod/v4/core/parse.d.ts +25 -0
  1471. package/node_modules/zod/v4/core/parse.js +57 -0
  1472. package/node_modules/zod/v4/core/regexes.cjs +103 -0
  1473. package/node_modules/zod/v4/core/regexes.d.cts +62 -0
  1474. package/node_modules/zod/v4/core/regexes.d.ts +62 -0
  1475. package/node_modules/zod/v4/core/regexes.js +95 -0
  1476. package/node_modules/zod/v4/core/registries.cjs +56 -0
  1477. package/node_modules/zod/v4/core/registries.d.cts +35 -0
  1478. package/node_modules/zod/v4/core/registries.d.ts +35 -0
  1479. package/node_modules/zod/v4/core/registries.js +51 -0
  1480. package/node_modules/zod/v4/core/schemas.cjs +1748 -0
  1481. package/node_modules/zod/v4/core/schemas.d.cts +1041 -0
  1482. package/node_modules/zod/v4/core/schemas.d.ts +1041 -0
  1483. package/node_modules/zod/v4/core/schemas.js +1717 -0
  1484. package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
  1485. package/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
  1486. package/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
  1487. package/node_modules/zod/v4/core/standard-schema.js +1 -0
  1488. package/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
  1489. package/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
  1490. package/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
  1491. package/node_modules/zod/v4/core/to-json-schema.js +849 -0
  1492. package/node_modules/zod/v4/core/util.cjs +539 -0
  1493. package/node_modules/zod/v4/core/util.d.cts +183 -0
  1494. package/node_modules/zod/v4/core/util.d.ts +183 -0
  1495. package/node_modules/zod/v4/core/util.js +493 -0
  1496. package/node_modules/zod/v4/core/versions.cjs +8 -0
  1497. package/node_modules/zod/v4/core/versions.d.cts +5 -0
  1498. package/node_modules/zod/v4/core/versions.d.ts +5 -0
  1499. package/node_modules/zod/v4/core/versions.js +5 -0
  1500. package/node_modules/zod/v4/index.cjs +22 -0
  1501. package/node_modules/zod/v4/index.d.cts +3 -0
  1502. package/node_modules/zod/v4/index.d.ts +3 -0
  1503. package/node_modules/zod/v4/index.js +3 -0
  1504. package/node_modules/zod/v4/locales/ar.cjs +142 -0
  1505. package/node_modules/zod/v4/locales/ar.d.cts +4 -0
  1506. package/node_modules/zod/v4/locales/ar.d.ts +4 -0
  1507. package/node_modules/zod/v4/locales/ar.js +116 -0
  1508. package/node_modules/zod/v4/locales/az.cjs +141 -0
  1509. package/node_modules/zod/v4/locales/az.d.cts +4 -0
  1510. package/node_modules/zod/v4/locales/az.d.ts +4 -0
  1511. package/node_modules/zod/v4/locales/az.js +115 -0
  1512. package/node_modules/zod/v4/locales/be.cjs +190 -0
  1513. package/node_modules/zod/v4/locales/be.d.cts +4 -0
  1514. package/node_modules/zod/v4/locales/be.d.ts +4 -0
  1515. package/node_modules/zod/v4/locales/be.js +164 -0
  1516. package/node_modules/zod/v4/locales/ca.cjs +144 -0
  1517. package/node_modules/zod/v4/locales/ca.d.cts +4 -0
  1518. package/node_modules/zod/v4/locales/ca.d.ts +4 -0
  1519. package/node_modules/zod/v4/locales/ca.js +118 -0
  1520. package/node_modules/zod/v4/locales/cs.cjs +161 -0
  1521. package/node_modules/zod/v4/locales/cs.d.cts +4 -0
  1522. package/node_modules/zod/v4/locales/cs.d.ts +4 -0
  1523. package/node_modules/zod/v4/locales/cs.js +135 -0
  1524. package/node_modules/zod/v4/locales/de.cjs +142 -0
  1525. package/node_modules/zod/v4/locales/de.d.cts +4 -0
  1526. package/node_modules/zod/v4/locales/de.d.ts +4 -0
  1527. package/node_modules/zod/v4/locales/de.js +116 -0
  1528. package/node_modules/zod/v4/locales/en.cjs +145 -0
  1529. package/node_modules/zod/v4/locales/en.d.cts +5 -0
  1530. package/node_modules/zod/v4/locales/en.d.ts +5 -0
  1531. package/node_modules/zod/v4/locales/en.js +117 -0
  1532. package/node_modules/zod/v4/locales/eo.cjs +144 -0
  1533. package/node_modules/zod/v4/locales/eo.d.cts +5 -0
  1534. package/node_modules/zod/v4/locales/eo.d.ts +5 -0
  1535. package/node_modules/zod/v4/locales/eo.js +116 -0
  1536. package/node_modules/zod/v4/locales/es.cjs +143 -0
  1537. package/node_modules/zod/v4/locales/es.d.cts +4 -0
  1538. package/node_modules/zod/v4/locales/es.d.ts +4 -0
  1539. package/node_modules/zod/v4/locales/es.js +117 -0
  1540. package/node_modules/zod/v4/locales/fa.cjs +148 -0
  1541. package/node_modules/zod/v4/locales/fa.d.cts +4 -0
  1542. package/node_modules/zod/v4/locales/fa.d.ts +4 -0
  1543. package/node_modules/zod/v4/locales/fa.js +122 -0
  1544. package/node_modules/zod/v4/locales/fi.cjs +148 -0
  1545. package/node_modules/zod/v4/locales/fi.d.cts +4 -0
  1546. package/node_modules/zod/v4/locales/fi.d.ts +4 -0
  1547. package/node_modules/zod/v4/locales/fi.js +122 -0
  1548. package/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
  1549. package/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
  1550. package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  1551. package/node_modules/zod/v4/locales/fr-CA.js +117 -0
  1552. package/node_modules/zod/v4/locales/fr.cjs +142 -0
  1553. package/node_modules/zod/v4/locales/fr.d.cts +4 -0
  1554. package/node_modules/zod/v4/locales/fr.d.ts +4 -0
  1555. package/node_modules/zod/v4/locales/fr.js +116 -0
  1556. package/node_modules/zod/v4/locales/he.cjs +143 -0
  1557. package/node_modules/zod/v4/locales/he.d.cts +4 -0
  1558. package/node_modules/zod/v4/locales/he.d.ts +4 -0
  1559. package/node_modules/zod/v4/locales/he.js +117 -0
  1560. package/node_modules/zod/v4/locales/hu.cjs +143 -0
  1561. package/node_modules/zod/v4/locales/hu.d.cts +4 -0
  1562. package/node_modules/zod/v4/locales/hu.d.ts +4 -0
  1563. package/node_modules/zod/v4/locales/hu.js +117 -0
  1564. package/node_modules/zod/v4/locales/id.cjs +142 -0
  1565. package/node_modules/zod/v4/locales/id.d.cts +4 -0
  1566. package/node_modules/zod/v4/locales/id.d.ts +4 -0
  1567. package/node_modules/zod/v4/locales/id.js +116 -0
  1568. package/node_modules/zod/v4/locales/index.cjs +84 -0
  1569. package/node_modules/zod/v4/locales/index.d.cts +39 -0
  1570. package/node_modules/zod/v4/locales/index.d.ts +39 -0
  1571. package/node_modules/zod/v4/locales/index.js +39 -0
  1572. package/node_modules/zod/v4/locales/it.cjs +143 -0
  1573. package/node_modules/zod/v4/locales/it.d.cts +4 -0
  1574. package/node_modules/zod/v4/locales/it.d.ts +4 -0
  1575. package/node_modules/zod/v4/locales/it.js +117 -0
  1576. package/node_modules/zod/v4/locales/ja.cjs +141 -0
  1577. package/node_modules/zod/v4/locales/ja.d.cts +4 -0
  1578. package/node_modules/zod/v4/locales/ja.d.ts +4 -0
  1579. package/node_modules/zod/v4/locales/ja.js +115 -0
  1580. package/node_modules/zod/v4/locales/kh.cjs +143 -0
  1581. package/node_modules/zod/v4/locales/kh.d.cts +4 -0
  1582. package/node_modules/zod/v4/locales/kh.d.ts +4 -0
  1583. package/node_modules/zod/v4/locales/kh.js +117 -0
  1584. package/node_modules/zod/v4/locales/ko.cjs +147 -0
  1585. package/node_modules/zod/v4/locales/ko.d.cts +4 -0
  1586. package/node_modules/zod/v4/locales/ko.d.ts +4 -0
  1587. package/node_modules/zod/v4/locales/ko.js +121 -0
  1588. package/node_modules/zod/v4/locales/mk.cjs +144 -0
  1589. package/node_modules/zod/v4/locales/mk.d.cts +4 -0
  1590. package/node_modules/zod/v4/locales/mk.d.ts +4 -0
  1591. package/node_modules/zod/v4/locales/mk.js +118 -0
  1592. package/node_modules/zod/v4/locales/ms.cjs +142 -0
  1593. package/node_modules/zod/v4/locales/ms.d.cts +4 -0
  1594. package/node_modules/zod/v4/locales/ms.d.ts +4 -0
  1595. package/node_modules/zod/v4/locales/ms.js +116 -0
  1596. package/node_modules/zod/v4/locales/nl.cjs +143 -0
  1597. package/node_modules/zod/v4/locales/nl.d.cts +4 -0
  1598. package/node_modules/zod/v4/locales/nl.d.ts +4 -0
  1599. package/node_modules/zod/v4/locales/nl.js +117 -0
  1600. package/node_modules/zod/v4/locales/no.cjs +142 -0
  1601. package/node_modules/zod/v4/locales/no.d.cts +4 -0
  1602. package/node_modules/zod/v4/locales/no.d.ts +4 -0
  1603. package/node_modules/zod/v4/locales/no.js +116 -0
  1604. package/node_modules/zod/v4/locales/ota.cjs +143 -0
  1605. package/node_modules/zod/v4/locales/ota.d.cts +4 -0
  1606. package/node_modules/zod/v4/locales/ota.d.ts +4 -0
  1607. package/node_modules/zod/v4/locales/ota.js +117 -0
  1608. package/node_modules/zod/v4/locales/pl.cjs +143 -0
  1609. package/node_modules/zod/v4/locales/pl.d.cts +4 -0
  1610. package/node_modules/zod/v4/locales/pl.d.ts +4 -0
  1611. package/node_modules/zod/v4/locales/pl.js +117 -0
  1612. package/node_modules/zod/v4/locales/ps.cjs +148 -0
  1613. package/node_modules/zod/v4/locales/ps.d.cts +4 -0
  1614. package/node_modules/zod/v4/locales/ps.d.ts +4 -0
  1615. package/node_modules/zod/v4/locales/ps.js +122 -0
  1616. package/node_modules/zod/v4/locales/pt.cjs +142 -0
  1617. package/node_modules/zod/v4/locales/pt.d.cts +4 -0
  1618. package/node_modules/zod/v4/locales/pt.d.ts +4 -0
  1619. package/node_modules/zod/v4/locales/pt.js +116 -0
  1620. package/node_modules/zod/v4/locales/ru.cjs +190 -0
  1621. package/node_modules/zod/v4/locales/ru.d.cts +4 -0
  1622. package/node_modules/zod/v4/locales/ru.d.ts +4 -0
  1623. package/node_modules/zod/v4/locales/ru.js +164 -0
  1624. package/node_modules/zod/v4/locales/sl.cjs +143 -0
  1625. package/node_modules/zod/v4/locales/sl.d.cts +4 -0
  1626. package/node_modules/zod/v4/locales/sl.d.ts +4 -0
  1627. package/node_modules/zod/v4/locales/sl.js +117 -0
  1628. package/node_modules/zod/v4/locales/sv.cjs +144 -0
  1629. package/node_modules/zod/v4/locales/sv.d.cts +4 -0
  1630. package/node_modules/zod/v4/locales/sv.d.ts +4 -0
  1631. package/node_modules/zod/v4/locales/sv.js +118 -0
  1632. package/node_modules/zod/v4/locales/ta.cjs +143 -0
  1633. package/node_modules/zod/v4/locales/ta.d.cts +4 -0
  1634. package/node_modules/zod/v4/locales/ta.d.ts +4 -0
  1635. package/node_modules/zod/v4/locales/ta.js +117 -0
  1636. package/node_modules/zod/v4/locales/th.cjs +143 -0
  1637. package/node_modules/zod/v4/locales/th.d.cts +4 -0
  1638. package/node_modules/zod/v4/locales/th.d.ts +4 -0
  1639. package/node_modules/zod/v4/locales/th.js +117 -0
  1640. package/node_modules/zod/v4/locales/tr.cjs +143 -0
  1641. package/node_modules/zod/v4/locales/tr.d.cts +5 -0
  1642. package/node_modules/zod/v4/locales/tr.d.ts +5 -0
  1643. package/node_modules/zod/v4/locales/tr.js +115 -0
  1644. package/node_modules/zod/v4/locales/ua.cjs +143 -0
  1645. package/node_modules/zod/v4/locales/ua.d.cts +4 -0
  1646. package/node_modules/zod/v4/locales/ua.d.ts +4 -0
  1647. package/node_modules/zod/v4/locales/ua.js +117 -0
  1648. package/node_modules/zod/v4/locales/ur.cjs +143 -0
  1649. package/node_modules/zod/v4/locales/ur.d.cts +4 -0
  1650. package/node_modules/zod/v4/locales/ur.d.ts +4 -0
  1651. package/node_modules/zod/v4/locales/ur.js +117 -0
  1652. package/node_modules/zod/v4/locales/vi.cjs +142 -0
  1653. package/node_modules/zod/v4/locales/vi.d.cts +4 -0
  1654. package/node_modules/zod/v4/locales/vi.d.ts +4 -0
  1655. package/node_modules/zod/v4/locales/vi.js +116 -0
  1656. package/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
  1657. package/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
  1658. package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  1659. package/node_modules/zod/v4/locales/zh-CN.js +116 -0
  1660. package/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
  1661. package/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
  1662. package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  1663. package/node_modules/zod/v4/locales/zh-TW.js +117 -0
  1664. package/node_modules/zod/v4/mini/checks.cjs +34 -0
  1665. package/node_modules/zod/v4/mini/checks.d.cts +1 -0
  1666. package/node_modules/zod/v4/mini/checks.d.ts +1 -0
  1667. package/node_modules/zod/v4/mini/checks.js +1 -0
  1668. package/node_modules/zod/v4/mini/coerce.cjs +47 -0
  1669. package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  1670. package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  1671. package/node_modules/zod/v4/mini/coerce.js +17 -0
  1672. package/node_modules/zod/v4/mini/external.cjs +62 -0
  1673. package/node_modules/zod/v4/mini/external.d.cts +11 -0
  1674. package/node_modules/zod/v4/mini/external.d.ts +11 -0
  1675. package/node_modules/zod/v4/mini/external.js +13 -0
  1676. package/node_modules/zod/v4/mini/index.cjs +32 -0
  1677. package/node_modules/zod/v4/mini/index.d.cts +3 -0
  1678. package/node_modules/zod/v4/mini/index.d.ts +3 -0
  1679. package/node_modules/zod/v4/mini/index.js +3 -0
  1680. package/node_modules/zod/v4/mini/iso.cjs +60 -0
  1681. package/node_modules/zod/v4/mini/iso.d.cts +22 -0
  1682. package/node_modules/zod/v4/mini/iso.d.ts +22 -0
  1683. package/node_modules/zod/v4/mini/iso.js +30 -0
  1684. package/node_modules/zod/v4/mini/parse.cjs +8 -0
  1685. package/node_modules/zod/v4/mini/parse.d.cts +1 -0
  1686. package/node_modules/zod/v4/mini/parse.d.ts +1 -0
  1687. package/node_modules/zod/v4/mini/parse.js +1 -0
  1688. package/node_modules/zod/v4/mini/schemas.cjs +839 -0
  1689. package/node_modules/zod/v4/mini/schemas.d.cts +356 -0
  1690. package/node_modules/zod/v4/mini/schemas.d.ts +356 -0
  1691. package/node_modules/zod/v4/mini/schemas.js +732 -0
  1692. package/node_modules/zod/v4-mini/index.cjs +17 -0
  1693. package/node_modules/zod/v4-mini/index.d.cts +1 -0
  1694. package/node_modules/zod/v4-mini/index.d.ts +1 -0
  1695. package/node_modules/zod/v4-mini/index.js +1 -0
  1696. package/npm-shrinkwrap.json +90 -3
  1697. package/openclaw.plugin.json +99 -2
  1698. package/package.json +16 -7
  1699. package/dist/approval-custom-id-NYPYj9Po.js +0 -58
  1700. package/dist/approval-message-safety-C-8BL6Kv.js +0 -47
  1701. package/dist/configured-state.js +0 -6
  1702. package/dist/message-handler-CIxWq5Yh.js +0 -532
  1703. package/dist/provider.runtime-C2iIfbTs.js +0 -2
  1704. package/dist/retry-after-D5_VmM-_.js +0 -25
  1705. package/dist/runtime-api.monitor-DSbfGnzS.js +0 -6
  1706. package/dist/security-doctor-uUo8hTD5.js +0 -18
  1707. package/dist/targets-DvItNIvP.js +0 -3
  1708. package/dist/timeouts.js +0 -2
  1709. package/dist/{preflight-audio-DYL2ABgA.js → preflight-audio-DDSZna4F.js} +1 -1
  1710. package/dist/{thread-bindings.state-9VAxhVf6.js → thread-bindings.state-C5afR9TD.js} +1 -1
@@ -0,0 +1,4233 @@
1
+ var util;
2
+ (function (util) {
3
+ util.assertEqual = (val) => val;
4
+ function assertIs(_arg) { }
5
+ util.assertIs = assertIs;
6
+ function assertNever(_x) {
7
+ throw new Error();
8
+ }
9
+ util.assertNever = assertNever;
10
+ util.arrayToEnum = (items) => {
11
+ const obj = {};
12
+ for (const item of items) {
13
+ obj[item] = item;
14
+ }
15
+ return obj;
16
+ };
17
+ util.getValidEnumValues = (obj) => {
18
+ const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
19
+ const filtered = {};
20
+ for (const k of validKeys) {
21
+ filtered[k] = obj[k];
22
+ }
23
+ return util.objectValues(filtered);
24
+ };
25
+ util.objectValues = (obj) => {
26
+ return util.objectKeys(obj).map(function (e) {
27
+ return obj[e];
28
+ });
29
+ };
30
+ util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban
31
+ ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban
32
+ : (object) => {
33
+ const keys = [];
34
+ for (const key in object) {
35
+ if (Object.prototype.hasOwnProperty.call(object, key)) {
36
+ keys.push(key);
37
+ }
38
+ }
39
+ return keys;
40
+ };
41
+ util.find = (arr, checker) => {
42
+ for (const item of arr) {
43
+ if (checker(item))
44
+ return item;
45
+ }
46
+ return undefined;
47
+ };
48
+ util.isInteger = typeof Number.isInteger === "function"
49
+ ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
50
+ : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
51
+ function joinValues(array, separator = " | ") {
52
+ return array
53
+ .map((val) => (typeof val === "string" ? `'${val}'` : val))
54
+ .join(separator);
55
+ }
56
+ util.joinValues = joinValues;
57
+ util.jsonStringifyReplacer = (_, value) => {
58
+ if (typeof value === "bigint") {
59
+ return value.toString();
60
+ }
61
+ return value;
62
+ };
63
+ })(util || (util = {}));
64
+ var objectUtil;
65
+ (function (objectUtil) {
66
+ objectUtil.mergeShapes = (first, second) => {
67
+ return {
68
+ ...first,
69
+ ...second, // second overwrites first
70
+ };
71
+ };
72
+ })(objectUtil || (objectUtil = {}));
73
+ const ZodParsedType = util.arrayToEnum([
74
+ "string",
75
+ "nan",
76
+ "number",
77
+ "integer",
78
+ "float",
79
+ "boolean",
80
+ "date",
81
+ "bigint",
82
+ "symbol",
83
+ "function",
84
+ "undefined",
85
+ "null",
86
+ "array",
87
+ "object",
88
+ "unknown",
89
+ "promise",
90
+ "void",
91
+ "never",
92
+ "map",
93
+ "set",
94
+ ]);
95
+ const getParsedType = (data) => {
96
+ const t = typeof data;
97
+ switch (t) {
98
+ case "undefined":
99
+ return ZodParsedType.undefined;
100
+ case "string":
101
+ return ZodParsedType.string;
102
+ case "number":
103
+ return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
104
+ case "boolean":
105
+ return ZodParsedType.boolean;
106
+ case "function":
107
+ return ZodParsedType.function;
108
+ case "bigint":
109
+ return ZodParsedType.bigint;
110
+ case "symbol":
111
+ return ZodParsedType.symbol;
112
+ case "object":
113
+ if (Array.isArray(data)) {
114
+ return ZodParsedType.array;
115
+ }
116
+ if (data === null) {
117
+ return ZodParsedType.null;
118
+ }
119
+ if (data.then &&
120
+ typeof data.then === "function" &&
121
+ data.catch &&
122
+ typeof data.catch === "function") {
123
+ return ZodParsedType.promise;
124
+ }
125
+ if (typeof Map !== "undefined" && data instanceof Map) {
126
+ return ZodParsedType.map;
127
+ }
128
+ if (typeof Set !== "undefined" && data instanceof Set) {
129
+ return ZodParsedType.set;
130
+ }
131
+ if (typeof Date !== "undefined" && data instanceof Date) {
132
+ return ZodParsedType.date;
133
+ }
134
+ return ZodParsedType.object;
135
+ default:
136
+ return ZodParsedType.unknown;
137
+ }
138
+ };
139
+
140
+ const ZodIssueCode = util.arrayToEnum([
141
+ "invalid_type",
142
+ "invalid_literal",
143
+ "custom",
144
+ "invalid_union",
145
+ "invalid_union_discriminator",
146
+ "invalid_enum_value",
147
+ "unrecognized_keys",
148
+ "invalid_arguments",
149
+ "invalid_return_type",
150
+ "invalid_date",
151
+ "invalid_string",
152
+ "too_small",
153
+ "too_big",
154
+ "invalid_intersection_types",
155
+ "not_multiple_of",
156
+ "not_finite",
157
+ ]);
158
+ const quotelessJson = (obj) => {
159
+ const json = JSON.stringify(obj, null, 2);
160
+ return json.replace(/"([^"]+)":/g, "$1:");
161
+ };
162
+ class ZodError extends Error {
163
+ constructor(issues) {
164
+ super();
165
+ this.issues = [];
166
+ this.addIssue = (sub) => {
167
+ this.issues = [...this.issues, sub];
168
+ };
169
+ this.addIssues = (subs = []) => {
170
+ this.issues = [...this.issues, ...subs];
171
+ };
172
+ const actualProto = new.target.prototype;
173
+ if (Object.setPrototypeOf) {
174
+ // eslint-disable-next-line ban/ban
175
+ Object.setPrototypeOf(this, actualProto);
176
+ }
177
+ else {
178
+ this.__proto__ = actualProto;
179
+ }
180
+ this.name = "ZodError";
181
+ this.issues = issues;
182
+ }
183
+ get errors() {
184
+ return this.issues;
185
+ }
186
+ format(_mapper) {
187
+ const mapper = _mapper ||
188
+ function (issue) {
189
+ return issue.message;
190
+ };
191
+ const fieldErrors = { _errors: [] };
192
+ const processError = (error) => {
193
+ for (const issue of error.issues) {
194
+ if (issue.code === "invalid_union") {
195
+ issue.unionErrors.map(processError);
196
+ }
197
+ else if (issue.code === "invalid_return_type") {
198
+ processError(issue.returnTypeError);
199
+ }
200
+ else if (issue.code === "invalid_arguments") {
201
+ processError(issue.argumentsError);
202
+ }
203
+ else if (issue.path.length === 0) {
204
+ fieldErrors._errors.push(mapper(issue));
205
+ }
206
+ else {
207
+ let curr = fieldErrors;
208
+ let i = 0;
209
+ while (i < issue.path.length) {
210
+ const el = issue.path[i];
211
+ const terminal = i === issue.path.length - 1;
212
+ if (!terminal) {
213
+ curr[el] = curr[el] || { _errors: [] };
214
+ // if (typeof el === "string") {
215
+ // curr[el] = curr[el] || { _errors: [] };
216
+ // } else if (typeof el === "number") {
217
+ // const errorArray: any = [];
218
+ // errorArray._errors = [];
219
+ // curr[el] = curr[el] || errorArray;
220
+ // }
221
+ }
222
+ else {
223
+ curr[el] = curr[el] || { _errors: [] };
224
+ curr[el]._errors.push(mapper(issue));
225
+ }
226
+ curr = curr[el];
227
+ i++;
228
+ }
229
+ }
230
+ }
231
+ };
232
+ processError(this);
233
+ return fieldErrors;
234
+ }
235
+ static assert(value) {
236
+ if (!(value instanceof ZodError)) {
237
+ throw new Error(`Not a ZodError: ${value}`);
238
+ }
239
+ }
240
+ toString() {
241
+ return this.message;
242
+ }
243
+ get message() {
244
+ return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
245
+ }
246
+ get isEmpty() {
247
+ return this.issues.length === 0;
248
+ }
249
+ flatten(mapper = (issue) => issue.message) {
250
+ const fieldErrors = {};
251
+ const formErrors = [];
252
+ for (const sub of this.issues) {
253
+ if (sub.path.length > 0) {
254
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
255
+ fieldErrors[sub.path[0]].push(mapper(sub));
256
+ }
257
+ else {
258
+ formErrors.push(mapper(sub));
259
+ }
260
+ }
261
+ return { formErrors, fieldErrors };
262
+ }
263
+ get formErrors() {
264
+ return this.flatten();
265
+ }
266
+ }
267
+ ZodError.create = (issues) => {
268
+ const error = new ZodError(issues);
269
+ return error;
270
+ };
271
+
272
+ const errorMap = (issue, _ctx) => {
273
+ let message;
274
+ switch (issue.code) {
275
+ case ZodIssueCode.invalid_type:
276
+ if (issue.received === ZodParsedType.undefined) {
277
+ message = "Required";
278
+ }
279
+ else {
280
+ message = `Expected ${issue.expected}, received ${issue.received}`;
281
+ }
282
+ break;
283
+ case ZodIssueCode.invalid_literal:
284
+ message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
285
+ break;
286
+ case ZodIssueCode.unrecognized_keys:
287
+ message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
288
+ break;
289
+ case ZodIssueCode.invalid_union:
290
+ message = `Invalid input`;
291
+ break;
292
+ case ZodIssueCode.invalid_union_discriminator:
293
+ message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
294
+ break;
295
+ case ZodIssueCode.invalid_enum_value:
296
+ message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
297
+ break;
298
+ case ZodIssueCode.invalid_arguments:
299
+ message = `Invalid function arguments`;
300
+ break;
301
+ case ZodIssueCode.invalid_return_type:
302
+ message = `Invalid function return type`;
303
+ break;
304
+ case ZodIssueCode.invalid_date:
305
+ message = `Invalid date`;
306
+ break;
307
+ case ZodIssueCode.invalid_string:
308
+ if (typeof issue.validation === "object") {
309
+ if ("includes" in issue.validation) {
310
+ message = `Invalid input: must include "${issue.validation.includes}"`;
311
+ if (typeof issue.validation.position === "number") {
312
+ message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
313
+ }
314
+ }
315
+ else if ("startsWith" in issue.validation) {
316
+ message = `Invalid input: must start with "${issue.validation.startsWith}"`;
317
+ }
318
+ else if ("endsWith" in issue.validation) {
319
+ message = `Invalid input: must end with "${issue.validation.endsWith}"`;
320
+ }
321
+ else {
322
+ util.assertNever(issue.validation);
323
+ }
324
+ }
325
+ else if (issue.validation !== "regex") {
326
+ message = `Invalid ${issue.validation}`;
327
+ }
328
+ else {
329
+ message = "Invalid";
330
+ }
331
+ break;
332
+ case ZodIssueCode.too_small:
333
+ if (issue.type === "array")
334
+ message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
335
+ else if (issue.type === "string")
336
+ message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
337
+ else if (issue.type === "number")
338
+ message = `Number must be ${issue.exact
339
+ ? `exactly equal to `
340
+ : issue.inclusive
341
+ ? `greater than or equal to `
342
+ : `greater than `}${issue.minimum}`;
343
+ else if (issue.type === "date")
344
+ message = `Date must be ${issue.exact
345
+ ? `exactly equal to `
346
+ : issue.inclusive
347
+ ? `greater than or equal to `
348
+ : `greater than `}${new Date(Number(issue.minimum))}`;
349
+ else
350
+ message = "Invalid input";
351
+ break;
352
+ case ZodIssueCode.too_big:
353
+ if (issue.type === "array")
354
+ message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
355
+ else if (issue.type === "string")
356
+ message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
357
+ else if (issue.type === "number")
358
+ message = `Number must be ${issue.exact
359
+ ? `exactly`
360
+ : issue.inclusive
361
+ ? `less than or equal to`
362
+ : `less than`} ${issue.maximum}`;
363
+ else if (issue.type === "bigint")
364
+ message = `BigInt must be ${issue.exact
365
+ ? `exactly`
366
+ : issue.inclusive
367
+ ? `less than or equal to`
368
+ : `less than`} ${issue.maximum}`;
369
+ else if (issue.type === "date")
370
+ message = `Date must be ${issue.exact
371
+ ? `exactly`
372
+ : issue.inclusive
373
+ ? `smaller than or equal to`
374
+ : `smaller than`} ${new Date(Number(issue.maximum))}`;
375
+ else
376
+ message = "Invalid input";
377
+ break;
378
+ case ZodIssueCode.custom:
379
+ message = `Invalid input`;
380
+ break;
381
+ case ZodIssueCode.invalid_intersection_types:
382
+ message = `Intersection results could not be merged`;
383
+ break;
384
+ case ZodIssueCode.not_multiple_of:
385
+ message = `Number must be a multiple of ${issue.multipleOf}`;
386
+ break;
387
+ case ZodIssueCode.not_finite:
388
+ message = "Number must be finite";
389
+ break;
390
+ default:
391
+ message = _ctx.defaultError;
392
+ util.assertNever(issue);
393
+ }
394
+ return { message };
395
+ };
396
+
397
+ let overrideErrorMap = errorMap;
398
+ function setErrorMap(map) {
399
+ overrideErrorMap = map;
400
+ }
401
+ function getErrorMap() {
402
+ return overrideErrorMap;
403
+ }
404
+
405
+ const makeIssue = (params) => {
406
+ const { data, path, errorMaps, issueData } = params;
407
+ const fullPath = [...path, ...(issueData.path || [])];
408
+ const fullIssue = {
409
+ ...issueData,
410
+ path: fullPath,
411
+ };
412
+ if (issueData.message !== undefined) {
413
+ return {
414
+ ...issueData,
415
+ path: fullPath,
416
+ message: issueData.message,
417
+ };
418
+ }
419
+ let errorMessage = "";
420
+ const maps = errorMaps
421
+ .filter((m) => !!m)
422
+ .slice()
423
+ .reverse();
424
+ for (const map of maps) {
425
+ errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
426
+ }
427
+ return {
428
+ ...issueData,
429
+ path: fullPath,
430
+ message: errorMessage,
431
+ };
432
+ };
433
+ const EMPTY_PATH = [];
434
+ function addIssueToContext(ctx, issueData) {
435
+ const overrideMap = getErrorMap();
436
+ const issue = makeIssue({
437
+ issueData: issueData,
438
+ data: ctx.data,
439
+ path: ctx.path,
440
+ errorMaps: [
441
+ ctx.common.contextualErrorMap,
442
+ ctx.schemaErrorMap,
443
+ overrideMap,
444
+ overrideMap === errorMap ? undefined : errorMap, // then global default map
445
+ ].filter((x) => !!x),
446
+ });
447
+ ctx.common.issues.push(issue);
448
+ }
449
+ class ParseStatus {
450
+ constructor() {
451
+ this.value = "valid";
452
+ }
453
+ dirty() {
454
+ if (this.value === "valid")
455
+ this.value = "dirty";
456
+ }
457
+ abort() {
458
+ if (this.value !== "aborted")
459
+ this.value = "aborted";
460
+ }
461
+ static mergeArray(status, results) {
462
+ const arrayValue = [];
463
+ for (const s of results) {
464
+ if (s.status === "aborted")
465
+ return INVALID;
466
+ if (s.status === "dirty")
467
+ status.dirty();
468
+ arrayValue.push(s.value);
469
+ }
470
+ return { status: status.value, value: arrayValue };
471
+ }
472
+ static async mergeObjectAsync(status, pairs) {
473
+ const syncPairs = [];
474
+ for (const pair of pairs) {
475
+ const key = await pair.key;
476
+ const value = await pair.value;
477
+ syncPairs.push({
478
+ key,
479
+ value,
480
+ });
481
+ }
482
+ return ParseStatus.mergeObjectSync(status, syncPairs);
483
+ }
484
+ static mergeObjectSync(status, pairs) {
485
+ const finalObject = {};
486
+ for (const pair of pairs) {
487
+ const { key, value } = pair;
488
+ if (key.status === "aborted")
489
+ return INVALID;
490
+ if (value.status === "aborted")
491
+ return INVALID;
492
+ if (key.status === "dirty")
493
+ status.dirty();
494
+ if (value.status === "dirty")
495
+ status.dirty();
496
+ if (key.value !== "__proto__" &&
497
+ (typeof value.value !== "undefined" || pair.alwaysSet)) {
498
+ finalObject[key.value] = value.value;
499
+ }
500
+ }
501
+ return { status: status.value, value: finalObject };
502
+ }
503
+ }
504
+ const INVALID = Object.freeze({
505
+ status: "aborted",
506
+ });
507
+ const DIRTY = (value) => ({ status: "dirty", value });
508
+ const OK = (value) => ({ status: "valid", value });
509
+ const isAborted = (x) => x.status === "aborted";
510
+ const isDirty = (x) => x.status === "dirty";
511
+ const isValid = (x) => x.status === "valid";
512
+ const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
513
+
514
+ /******************************************************************************
515
+ Copyright (c) Microsoft Corporation.
516
+
517
+ Permission to use, copy, modify, and/or distribute this software for any
518
+ purpose with or without fee is hereby granted.
519
+
520
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
521
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
522
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
523
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
524
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
525
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
526
+ PERFORMANCE OF THIS SOFTWARE.
527
+ ***************************************************************************** */
528
+
529
+ function __classPrivateFieldGet(receiver, state, kind, f) {
530
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
531
+ return state.get(receiver);
532
+ }
533
+
534
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
535
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
536
+ return (state.set(receiver, value)), value;
537
+ }
538
+
539
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
540
+ var e = new Error(message);
541
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
542
+ };
543
+
544
+ var errorUtil;
545
+ (function (errorUtil) {
546
+ errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
547
+ errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
548
+ })(errorUtil || (errorUtil = {}));
549
+
550
+ var _ZodEnum_cache, _ZodNativeEnum_cache;
551
+ class ParseInputLazyPath {
552
+ constructor(parent, value, path, key) {
553
+ this._cachedPath = [];
554
+ this.parent = parent;
555
+ this.data = value;
556
+ this._path = path;
557
+ this._key = key;
558
+ }
559
+ get path() {
560
+ if (!this._cachedPath.length) {
561
+ if (this._key instanceof Array) {
562
+ this._cachedPath.push(...this._path, ...this._key);
563
+ }
564
+ else {
565
+ this._cachedPath.push(...this._path, this._key);
566
+ }
567
+ }
568
+ return this._cachedPath;
569
+ }
570
+ }
571
+ const handleResult = (ctx, result) => {
572
+ if (isValid(result)) {
573
+ return { success: true, data: result.value };
574
+ }
575
+ else {
576
+ if (!ctx.common.issues.length) {
577
+ throw new Error("Validation failed but no issues detected.");
578
+ }
579
+ return {
580
+ success: false,
581
+ get error() {
582
+ if (this._error)
583
+ return this._error;
584
+ const error = new ZodError(ctx.common.issues);
585
+ this._error = error;
586
+ return this._error;
587
+ },
588
+ };
589
+ }
590
+ };
591
+ function processCreateParams(params) {
592
+ if (!params)
593
+ return {};
594
+ const { errorMap, invalid_type_error, required_error, description } = params;
595
+ if (errorMap && (invalid_type_error || required_error)) {
596
+ throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
597
+ }
598
+ if (errorMap)
599
+ return { errorMap: errorMap, description };
600
+ const customMap = (iss, ctx) => {
601
+ var _a, _b;
602
+ const { message } = params;
603
+ if (iss.code === "invalid_enum_value") {
604
+ return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
605
+ }
606
+ if (typeof ctx.data === "undefined") {
607
+ return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
608
+ }
609
+ if (iss.code !== "invalid_type")
610
+ return { message: ctx.defaultError };
611
+ return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
612
+ };
613
+ return { errorMap: customMap, description };
614
+ }
615
+ class ZodType {
616
+ constructor(def) {
617
+ /** Alias of safeParseAsync */
618
+ this.spa = this.safeParseAsync;
619
+ this._def = def;
620
+ this.parse = this.parse.bind(this);
621
+ this.safeParse = this.safeParse.bind(this);
622
+ this.parseAsync = this.parseAsync.bind(this);
623
+ this.safeParseAsync = this.safeParseAsync.bind(this);
624
+ this.spa = this.spa.bind(this);
625
+ this.refine = this.refine.bind(this);
626
+ this.refinement = this.refinement.bind(this);
627
+ this.superRefine = this.superRefine.bind(this);
628
+ this.optional = this.optional.bind(this);
629
+ this.nullable = this.nullable.bind(this);
630
+ this.nullish = this.nullish.bind(this);
631
+ this.array = this.array.bind(this);
632
+ this.promise = this.promise.bind(this);
633
+ this.or = this.or.bind(this);
634
+ this.and = this.and.bind(this);
635
+ this.transform = this.transform.bind(this);
636
+ this.brand = this.brand.bind(this);
637
+ this.default = this.default.bind(this);
638
+ this.catch = this.catch.bind(this);
639
+ this.describe = this.describe.bind(this);
640
+ this.pipe = this.pipe.bind(this);
641
+ this.readonly = this.readonly.bind(this);
642
+ this.isNullable = this.isNullable.bind(this);
643
+ this.isOptional = this.isOptional.bind(this);
644
+ }
645
+ get description() {
646
+ return this._def.description;
647
+ }
648
+ _getType(input) {
649
+ return getParsedType(input.data);
650
+ }
651
+ _getOrReturnCtx(input, ctx) {
652
+ return (ctx || {
653
+ common: input.parent.common,
654
+ data: input.data,
655
+ parsedType: getParsedType(input.data),
656
+ schemaErrorMap: this._def.errorMap,
657
+ path: input.path,
658
+ parent: input.parent,
659
+ });
660
+ }
661
+ _processInputParams(input) {
662
+ return {
663
+ status: new ParseStatus(),
664
+ ctx: {
665
+ common: input.parent.common,
666
+ data: input.data,
667
+ parsedType: getParsedType(input.data),
668
+ schemaErrorMap: this._def.errorMap,
669
+ path: input.path,
670
+ parent: input.parent,
671
+ },
672
+ };
673
+ }
674
+ _parseSync(input) {
675
+ const result = this._parse(input);
676
+ if (isAsync(result)) {
677
+ throw new Error("Synchronous parse encountered promise.");
678
+ }
679
+ return result;
680
+ }
681
+ _parseAsync(input) {
682
+ const result = this._parse(input);
683
+ return Promise.resolve(result);
684
+ }
685
+ parse(data, params) {
686
+ const result = this.safeParse(data, params);
687
+ if (result.success)
688
+ return result.data;
689
+ throw result.error;
690
+ }
691
+ safeParse(data, params) {
692
+ var _a;
693
+ const ctx = {
694
+ common: {
695
+ issues: [],
696
+ async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
697
+ contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
698
+ },
699
+ path: (params === null || params === void 0 ? void 0 : params.path) || [],
700
+ schemaErrorMap: this._def.errorMap,
701
+ parent: null,
702
+ data,
703
+ parsedType: getParsedType(data),
704
+ };
705
+ const result = this._parseSync({ data, path: ctx.path, parent: ctx });
706
+ return handleResult(ctx, result);
707
+ }
708
+ async parseAsync(data, params) {
709
+ const result = await this.safeParseAsync(data, params);
710
+ if (result.success)
711
+ return result.data;
712
+ throw result.error;
713
+ }
714
+ async safeParseAsync(data, params) {
715
+ const ctx = {
716
+ common: {
717
+ issues: [],
718
+ contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
719
+ async: true,
720
+ },
721
+ path: (params === null || params === void 0 ? void 0 : params.path) || [],
722
+ schemaErrorMap: this._def.errorMap,
723
+ parent: null,
724
+ data,
725
+ parsedType: getParsedType(data),
726
+ };
727
+ const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
728
+ const result = await (isAsync(maybeAsyncResult)
729
+ ? maybeAsyncResult
730
+ : Promise.resolve(maybeAsyncResult));
731
+ return handleResult(ctx, result);
732
+ }
733
+ refine(check, message) {
734
+ const getIssueProperties = (val) => {
735
+ if (typeof message === "string" || typeof message === "undefined") {
736
+ return { message };
737
+ }
738
+ else if (typeof message === "function") {
739
+ return message(val);
740
+ }
741
+ else {
742
+ return message;
743
+ }
744
+ };
745
+ return this._refinement((val, ctx) => {
746
+ const result = check(val);
747
+ const setError = () => ctx.addIssue({
748
+ code: ZodIssueCode.custom,
749
+ ...getIssueProperties(val),
750
+ });
751
+ if (typeof Promise !== "undefined" && result instanceof Promise) {
752
+ return result.then((data) => {
753
+ if (!data) {
754
+ setError();
755
+ return false;
756
+ }
757
+ else {
758
+ return true;
759
+ }
760
+ });
761
+ }
762
+ if (!result) {
763
+ setError();
764
+ return false;
765
+ }
766
+ else {
767
+ return true;
768
+ }
769
+ });
770
+ }
771
+ refinement(check, refinementData) {
772
+ return this._refinement((val, ctx) => {
773
+ if (!check(val)) {
774
+ ctx.addIssue(typeof refinementData === "function"
775
+ ? refinementData(val, ctx)
776
+ : refinementData);
777
+ return false;
778
+ }
779
+ else {
780
+ return true;
781
+ }
782
+ });
783
+ }
784
+ _refinement(refinement) {
785
+ return new ZodEffects({
786
+ schema: this,
787
+ typeName: ZodFirstPartyTypeKind.ZodEffects,
788
+ effect: { type: "refinement", refinement },
789
+ });
790
+ }
791
+ superRefine(refinement) {
792
+ return this._refinement(refinement);
793
+ }
794
+ optional() {
795
+ return ZodOptional.create(this, this._def);
796
+ }
797
+ nullable() {
798
+ return ZodNullable.create(this, this._def);
799
+ }
800
+ nullish() {
801
+ return this.nullable().optional();
802
+ }
803
+ array() {
804
+ return ZodArray.create(this, this._def);
805
+ }
806
+ promise() {
807
+ return ZodPromise.create(this, this._def);
808
+ }
809
+ or(option) {
810
+ return ZodUnion.create([this, option], this._def);
811
+ }
812
+ and(incoming) {
813
+ return ZodIntersection.create(this, incoming, this._def);
814
+ }
815
+ transform(transform) {
816
+ return new ZodEffects({
817
+ ...processCreateParams(this._def),
818
+ schema: this,
819
+ typeName: ZodFirstPartyTypeKind.ZodEffects,
820
+ effect: { type: "transform", transform },
821
+ });
822
+ }
823
+ default(def) {
824
+ const defaultValueFunc = typeof def === "function" ? def : () => def;
825
+ return new ZodDefault({
826
+ ...processCreateParams(this._def),
827
+ innerType: this,
828
+ defaultValue: defaultValueFunc,
829
+ typeName: ZodFirstPartyTypeKind.ZodDefault,
830
+ });
831
+ }
832
+ brand() {
833
+ return new ZodBranded({
834
+ typeName: ZodFirstPartyTypeKind.ZodBranded,
835
+ type: this,
836
+ ...processCreateParams(this._def),
837
+ });
838
+ }
839
+ catch(def) {
840
+ const catchValueFunc = typeof def === "function" ? def : () => def;
841
+ return new ZodCatch({
842
+ ...processCreateParams(this._def),
843
+ innerType: this,
844
+ catchValue: catchValueFunc,
845
+ typeName: ZodFirstPartyTypeKind.ZodCatch,
846
+ });
847
+ }
848
+ describe(description) {
849
+ const This = this.constructor;
850
+ return new This({
851
+ ...this._def,
852
+ description,
853
+ });
854
+ }
855
+ pipe(target) {
856
+ return ZodPipeline.create(this, target);
857
+ }
858
+ readonly() {
859
+ return ZodReadonly.create(this);
860
+ }
861
+ isOptional() {
862
+ return this.safeParse(undefined).success;
863
+ }
864
+ isNullable() {
865
+ return this.safeParse(null).success;
866
+ }
867
+ }
868
+ const cuidRegex = /^c[^\s-]{8,}$/i;
869
+ const cuid2Regex = /^[0-9a-z]+$/;
870
+ const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
871
+ // const uuidRegex =
872
+ // /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
873
+ const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
874
+ const nanoidRegex = /^[a-z0-9_-]{21}$/i;
875
+ const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
876
+ // from https://stackoverflow.com/a/46181/1550155
877
+ // old version: too slow, didn't support unicode
878
+ // const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
879
+ //old email regex
880
+ // const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i;
881
+ // eslint-disable-next-line
882
+ // const emailRegex =
883
+ // /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/;
884
+ // const emailRegex =
885
+ // /^[a-zA-Z0-9\.\!\#\$\%\&\'\*\+\/\=\?\^\_\`\{\|\}\~\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
886
+ // const emailRegex =
887
+ // /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
888
+ const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
889
+ // const emailRegex =
890
+ // /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i;
891
+ // from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
892
+ const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
893
+ let emojiRegex;
894
+ // faster, simpler, safer
895
+ const ipv4Regex = /^(?:(?: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])$/;
896
+ const ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
897
+ // https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
898
+ const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
899
+ // simple
900
+ // const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`;
901
+ // no leap year validation
902
+ // const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`;
903
+ // with leap year validation
904
+ const dateRegexSource = `((\\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])))`;
905
+ const dateRegex = new RegExp(`^${dateRegexSource}$`);
906
+ function timeRegexSource(args) {
907
+ // let regex = `\\d{2}:\\d{2}:\\d{2}`;
908
+ let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
909
+ if (args.precision) {
910
+ regex = `${regex}\\.\\d{${args.precision}}`;
911
+ }
912
+ else if (args.precision == null) {
913
+ regex = `${regex}(\\.\\d+)?`;
914
+ }
915
+ return regex;
916
+ }
917
+ function timeRegex(args) {
918
+ return new RegExp(`^${timeRegexSource(args)}$`);
919
+ }
920
+ // Adapted from https://stackoverflow.com/a/3143231
921
+ function datetimeRegex(args) {
922
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
923
+ const opts = [];
924
+ opts.push(args.local ? `Z?` : `Z`);
925
+ if (args.offset)
926
+ opts.push(`([+-]\\d{2}:?\\d{2})`);
927
+ regex = `${regex}(${opts.join("|")})`;
928
+ return new RegExp(`^${regex}$`);
929
+ }
930
+ function isValidIP(ip, version) {
931
+ if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
932
+ return true;
933
+ }
934
+ if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
935
+ return true;
936
+ }
937
+ return false;
938
+ }
939
+ class ZodString extends ZodType {
940
+ _parse(input) {
941
+ if (this._def.coerce) {
942
+ input.data = String(input.data);
943
+ }
944
+ const parsedType = this._getType(input);
945
+ if (parsedType !== ZodParsedType.string) {
946
+ const ctx = this._getOrReturnCtx(input);
947
+ addIssueToContext(ctx, {
948
+ code: ZodIssueCode.invalid_type,
949
+ expected: ZodParsedType.string,
950
+ received: ctx.parsedType,
951
+ });
952
+ return INVALID;
953
+ }
954
+ const status = new ParseStatus();
955
+ let ctx = undefined;
956
+ for (const check of this._def.checks) {
957
+ if (check.kind === "min") {
958
+ if (input.data.length < check.value) {
959
+ ctx = this._getOrReturnCtx(input, ctx);
960
+ addIssueToContext(ctx, {
961
+ code: ZodIssueCode.too_small,
962
+ minimum: check.value,
963
+ type: "string",
964
+ inclusive: true,
965
+ exact: false,
966
+ message: check.message,
967
+ });
968
+ status.dirty();
969
+ }
970
+ }
971
+ else if (check.kind === "max") {
972
+ if (input.data.length > check.value) {
973
+ ctx = this._getOrReturnCtx(input, ctx);
974
+ addIssueToContext(ctx, {
975
+ code: ZodIssueCode.too_big,
976
+ maximum: check.value,
977
+ type: "string",
978
+ inclusive: true,
979
+ exact: false,
980
+ message: check.message,
981
+ });
982
+ status.dirty();
983
+ }
984
+ }
985
+ else if (check.kind === "length") {
986
+ const tooBig = input.data.length > check.value;
987
+ const tooSmall = input.data.length < check.value;
988
+ if (tooBig || tooSmall) {
989
+ ctx = this._getOrReturnCtx(input, ctx);
990
+ if (tooBig) {
991
+ addIssueToContext(ctx, {
992
+ code: ZodIssueCode.too_big,
993
+ maximum: check.value,
994
+ type: "string",
995
+ inclusive: true,
996
+ exact: true,
997
+ message: check.message,
998
+ });
999
+ }
1000
+ else if (tooSmall) {
1001
+ addIssueToContext(ctx, {
1002
+ code: ZodIssueCode.too_small,
1003
+ minimum: check.value,
1004
+ type: "string",
1005
+ inclusive: true,
1006
+ exact: true,
1007
+ message: check.message,
1008
+ });
1009
+ }
1010
+ status.dirty();
1011
+ }
1012
+ }
1013
+ else if (check.kind === "email") {
1014
+ if (!emailRegex.test(input.data)) {
1015
+ ctx = this._getOrReturnCtx(input, ctx);
1016
+ addIssueToContext(ctx, {
1017
+ validation: "email",
1018
+ code: ZodIssueCode.invalid_string,
1019
+ message: check.message,
1020
+ });
1021
+ status.dirty();
1022
+ }
1023
+ }
1024
+ else if (check.kind === "emoji") {
1025
+ if (!emojiRegex) {
1026
+ emojiRegex = new RegExp(_emojiRegex, "u");
1027
+ }
1028
+ if (!emojiRegex.test(input.data)) {
1029
+ ctx = this._getOrReturnCtx(input, ctx);
1030
+ addIssueToContext(ctx, {
1031
+ validation: "emoji",
1032
+ code: ZodIssueCode.invalid_string,
1033
+ message: check.message,
1034
+ });
1035
+ status.dirty();
1036
+ }
1037
+ }
1038
+ else if (check.kind === "uuid") {
1039
+ if (!uuidRegex.test(input.data)) {
1040
+ ctx = this._getOrReturnCtx(input, ctx);
1041
+ addIssueToContext(ctx, {
1042
+ validation: "uuid",
1043
+ code: ZodIssueCode.invalid_string,
1044
+ message: check.message,
1045
+ });
1046
+ status.dirty();
1047
+ }
1048
+ }
1049
+ else if (check.kind === "nanoid") {
1050
+ if (!nanoidRegex.test(input.data)) {
1051
+ ctx = this._getOrReturnCtx(input, ctx);
1052
+ addIssueToContext(ctx, {
1053
+ validation: "nanoid",
1054
+ code: ZodIssueCode.invalid_string,
1055
+ message: check.message,
1056
+ });
1057
+ status.dirty();
1058
+ }
1059
+ }
1060
+ else if (check.kind === "cuid") {
1061
+ if (!cuidRegex.test(input.data)) {
1062
+ ctx = this._getOrReturnCtx(input, ctx);
1063
+ addIssueToContext(ctx, {
1064
+ validation: "cuid",
1065
+ code: ZodIssueCode.invalid_string,
1066
+ message: check.message,
1067
+ });
1068
+ status.dirty();
1069
+ }
1070
+ }
1071
+ else if (check.kind === "cuid2") {
1072
+ if (!cuid2Regex.test(input.data)) {
1073
+ ctx = this._getOrReturnCtx(input, ctx);
1074
+ addIssueToContext(ctx, {
1075
+ validation: "cuid2",
1076
+ code: ZodIssueCode.invalid_string,
1077
+ message: check.message,
1078
+ });
1079
+ status.dirty();
1080
+ }
1081
+ }
1082
+ else if (check.kind === "ulid") {
1083
+ if (!ulidRegex.test(input.data)) {
1084
+ ctx = this._getOrReturnCtx(input, ctx);
1085
+ addIssueToContext(ctx, {
1086
+ validation: "ulid",
1087
+ code: ZodIssueCode.invalid_string,
1088
+ message: check.message,
1089
+ });
1090
+ status.dirty();
1091
+ }
1092
+ }
1093
+ else if (check.kind === "url") {
1094
+ try {
1095
+ new URL(input.data);
1096
+ }
1097
+ catch (_a) {
1098
+ ctx = this._getOrReturnCtx(input, ctx);
1099
+ addIssueToContext(ctx, {
1100
+ validation: "url",
1101
+ code: ZodIssueCode.invalid_string,
1102
+ message: check.message,
1103
+ });
1104
+ status.dirty();
1105
+ }
1106
+ }
1107
+ else if (check.kind === "regex") {
1108
+ check.regex.lastIndex = 0;
1109
+ const testResult = check.regex.test(input.data);
1110
+ if (!testResult) {
1111
+ ctx = this._getOrReturnCtx(input, ctx);
1112
+ addIssueToContext(ctx, {
1113
+ validation: "regex",
1114
+ code: ZodIssueCode.invalid_string,
1115
+ message: check.message,
1116
+ });
1117
+ status.dirty();
1118
+ }
1119
+ }
1120
+ else if (check.kind === "trim") {
1121
+ input.data = input.data.trim();
1122
+ }
1123
+ else if (check.kind === "includes") {
1124
+ if (!input.data.includes(check.value, check.position)) {
1125
+ ctx = this._getOrReturnCtx(input, ctx);
1126
+ addIssueToContext(ctx, {
1127
+ code: ZodIssueCode.invalid_string,
1128
+ validation: { includes: check.value, position: check.position },
1129
+ message: check.message,
1130
+ });
1131
+ status.dirty();
1132
+ }
1133
+ }
1134
+ else if (check.kind === "toLowerCase") {
1135
+ input.data = input.data.toLowerCase();
1136
+ }
1137
+ else if (check.kind === "toUpperCase") {
1138
+ input.data = input.data.toUpperCase();
1139
+ }
1140
+ else if (check.kind === "startsWith") {
1141
+ if (!input.data.startsWith(check.value)) {
1142
+ ctx = this._getOrReturnCtx(input, ctx);
1143
+ addIssueToContext(ctx, {
1144
+ code: ZodIssueCode.invalid_string,
1145
+ validation: { startsWith: check.value },
1146
+ message: check.message,
1147
+ });
1148
+ status.dirty();
1149
+ }
1150
+ }
1151
+ else if (check.kind === "endsWith") {
1152
+ if (!input.data.endsWith(check.value)) {
1153
+ ctx = this._getOrReturnCtx(input, ctx);
1154
+ addIssueToContext(ctx, {
1155
+ code: ZodIssueCode.invalid_string,
1156
+ validation: { endsWith: check.value },
1157
+ message: check.message,
1158
+ });
1159
+ status.dirty();
1160
+ }
1161
+ }
1162
+ else if (check.kind === "datetime") {
1163
+ const regex = datetimeRegex(check);
1164
+ if (!regex.test(input.data)) {
1165
+ ctx = this._getOrReturnCtx(input, ctx);
1166
+ addIssueToContext(ctx, {
1167
+ code: ZodIssueCode.invalid_string,
1168
+ validation: "datetime",
1169
+ message: check.message,
1170
+ });
1171
+ status.dirty();
1172
+ }
1173
+ }
1174
+ else if (check.kind === "date") {
1175
+ const regex = dateRegex;
1176
+ if (!regex.test(input.data)) {
1177
+ ctx = this._getOrReturnCtx(input, ctx);
1178
+ addIssueToContext(ctx, {
1179
+ code: ZodIssueCode.invalid_string,
1180
+ validation: "date",
1181
+ message: check.message,
1182
+ });
1183
+ status.dirty();
1184
+ }
1185
+ }
1186
+ else if (check.kind === "time") {
1187
+ const regex = timeRegex(check);
1188
+ if (!regex.test(input.data)) {
1189
+ ctx = this._getOrReturnCtx(input, ctx);
1190
+ addIssueToContext(ctx, {
1191
+ code: ZodIssueCode.invalid_string,
1192
+ validation: "time",
1193
+ message: check.message,
1194
+ });
1195
+ status.dirty();
1196
+ }
1197
+ }
1198
+ else if (check.kind === "duration") {
1199
+ if (!durationRegex.test(input.data)) {
1200
+ ctx = this._getOrReturnCtx(input, ctx);
1201
+ addIssueToContext(ctx, {
1202
+ validation: "duration",
1203
+ code: ZodIssueCode.invalid_string,
1204
+ message: check.message,
1205
+ });
1206
+ status.dirty();
1207
+ }
1208
+ }
1209
+ else if (check.kind === "ip") {
1210
+ if (!isValidIP(input.data, check.version)) {
1211
+ ctx = this._getOrReturnCtx(input, ctx);
1212
+ addIssueToContext(ctx, {
1213
+ validation: "ip",
1214
+ code: ZodIssueCode.invalid_string,
1215
+ message: check.message,
1216
+ });
1217
+ status.dirty();
1218
+ }
1219
+ }
1220
+ else if (check.kind === "base64") {
1221
+ if (!base64Regex.test(input.data)) {
1222
+ ctx = this._getOrReturnCtx(input, ctx);
1223
+ addIssueToContext(ctx, {
1224
+ validation: "base64",
1225
+ code: ZodIssueCode.invalid_string,
1226
+ message: check.message,
1227
+ });
1228
+ status.dirty();
1229
+ }
1230
+ }
1231
+ else {
1232
+ util.assertNever(check);
1233
+ }
1234
+ }
1235
+ return { status: status.value, value: input.data };
1236
+ }
1237
+ _regex(regex, validation, message) {
1238
+ return this.refinement((data) => regex.test(data), {
1239
+ validation,
1240
+ code: ZodIssueCode.invalid_string,
1241
+ ...errorUtil.errToObj(message),
1242
+ });
1243
+ }
1244
+ _addCheck(check) {
1245
+ return new ZodString({
1246
+ ...this._def,
1247
+ checks: [...this._def.checks, check],
1248
+ });
1249
+ }
1250
+ email(message) {
1251
+ return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) });
1252
+ }
1253
+ url(message) {
1254
+ return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
1255
+ }
1256
+ emoji(message) {
1257
+ return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
1258
+ }
1259
+ uuid(message) {
1260
+ return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
1261
+ }
1262
+ nanoid(message) {
1263
+ return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
1264
+ }
1265
+ cuid(message) {
1266
+ return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
1267
+ }
1268
+ cuid2(message) {
1269
+ return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
1270
+ }
1271
+ ulid(message) {
1272
+ return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
1273
+ }
1274
+ base64(message) {
1275
+ return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
1276
+ }
1277
+ ip(options) {
1278
+ return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
1279
+ }
1280
+ datetime(options) {
1281
+ var _a, _b;
1282
+ if (typeof options === "string") {
1283
+ return this._addCheck({
1284
+ kind: "datetime",
1285
+ precision: null,
1286
+ offset: false,
1287
+ local: false,
1288
+ message: options,
1289
+ });
1290
+ }
1291
+ return this._addCheck({
1292
+ kind: "datetime",
1293
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1294
+ offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
1295
+ local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
1296
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
1297
+ });
1298
+ }
1299
+ date(message) {
1300
+ return this._addCheck({ kind: "date", message });
1301
+ }
1302
+ time(options) {
1303
+ if (typeof options === "string") {
1304
+ return this._addCheck({
1305
+ kind: "time",
1306
+ precision: null,
1307
+ message: options,
1308
+ });
1309
+ }
1310
+ return this._addCheck({
1311
+ kind: "time",
1312
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1313
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
1314
+ });
1315
+ }
1316
+ duration(message) {
1317
+ return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
1318
+ }
1319
+ regex(regex, message) {
1320
+ return this._addCheck({
1321
+ kind: "regex",
1322
+ regex: regex,
1323
+ ...errorUtil.errToObj(message),
1324
+ });
1325
+ }
1326
+ includes(value, options) {
1327
+ return this._addCheck({
1328
+ kind: "includes",
1329
+ value: value,
1330
+ position: options === null || options === void 0 ? void 0 : options.position,
1331
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
1332
+ });
1333
+ }
1334
+ startsWith(value, message) {
1335
+ return this._addCheck({
1336
+ kind: "startsWith",
1337
+ value: value,
1338
+ ...errorUtil.errToObj(message),
1339
+ });
1340
+ }
1341
+ endsWith(value, message) {
1342
+ return this._addCheck({
1343
+ kind: "endsWith",
1344
+ value: value,
1345
+ ...errorUtil.errToObj(message),
1346
+ });
1347
+ }
1348
+ min(minLength, message) {
1349
+ return this._addCheck({
1350
+ kind: "min",
1351
+ value: minLength,
1352
+ ...errorUtil.errToObj(message),
1353
+ });
1354
+ }
1355
+ max(maxLength, message) {
1356
+ return this._addCheck({
1357
+ kind: "max",
1358
+ value: maxLength,
1359
+ ...errorUtil.errToObj(message),
1360
+ });
1361
+ }
1362
+ length(len, message) {
1363
+ return this._addCheck({
1364
+ kind: "length",
1365
+ value: len,
1366
+ ...errorUtil.errToObj(message),
1367
+ });
1368
+ }
1369
+ /**
1370
+ * @deprecated Use z.string().min(1) instead.
1371
+ * @see {@link ZodString.min}
1372
+ */
1373
+ nonempty(message) {
1374
+ return this.min(1, errorUtil.errToObj(message));
1375
+ }
1376
+ trim() {
1377
+ return new ZodString({
1378
+ ...this._def,
1379
+ checks: [...this._def.checks, { kind: "trim" }],
1380
+ });
1381
+ }
1382
+ toLowerCase() {
1383
+ return new ZodString({
1384
+ ...this._def,
1385
+ checks: [...this._def.checks, { kind: "toLowerCase" }],
1386
+ });
1387
+ }
1388
+ toUpperCase() {
1389
+ return new ZodString({
1390
+ ...this._def,
1391
+ checks: [...this._def.checks, { kind: "toUpperCase" }],
1392
+ });
1393
+ }
1394
+ get isDatetime() {
1395
+ return !!this._def.checks.find((ch) => ch.kind === "datetime");
1396
+ }
1397
+ get isDate() {
1398
+ return !!this._def.checks.find((ch) => ch.kind === "date");
1399
+ }
1400
+ get isTime() {
1401
+ return !!this._def.checks.find((ch) => ch.kind === "time");
1402
+ }
1403
+ get isDuration() {
1404
+ return !!this._def.checks.find((ch) => ch.kind === "duration");
1405
+ }
1406
+ get isEmail() {
1407
+ return !!this._def.checks.find((ch) => ch.kind === "email");
1408
+ }
1409
+ get isURL() {
1410
+ return !!this._def.checks.find((ch) => ch.kind === "url");
1411
+ }
1412
+ get isEmoji() {
1413
+ return !!this._def.checks.find((ch) => ch.kind === "emoji");
1414
+ }
1415
+ get isUUID() {
1416
+ return !!this._def.checks.find((ch) => ch.kind === "uuid");
1417
+ }
1418
+ get isNANOID() {
1419
+ return !!this._def.checks.find((ch) => ch.kind === "nanoid");
1420
+ }
1421
+ get isCUID() {
1422
+ return !!this._def.checks.find((ch) => ch.kind === "cuid");
1423
+ }
1424
+ get isCUID2() {
1425
+ return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1426
+ }
1427
+ get isULID() {
1428
+ return !!this._def.checks.find((ch) => ch.kind === "ulid");
1429
+ }
1430
+ get isIP() {
1431
+ return !!this._def.checks.find((ch) => ch.kind === "ip");
1432
+ }
1433
+ get isBase64() {
1434
+ return !!this._def.checks.find((ch) => ch.kind === "base64");
1435
+ }
1436
+ get minLength() {
1437
+ let min = null;
1438
+ for (const ch of this._def.checks) {
1439
+ if (ch.kind === "min") {
1440
+ if (min === null || ch.value > min)
1441
+ min = ch.value;
1442
+ }
1443
+ }
1444
+ return min;
1445
+ }
1446
+ get maxLength() {
1447
+ let max = null;
1448
+ for (const ch of this._def.checks) {
1449
+ if (ch.kind === "max") {
1450
+ if (max === null || ch.value < max)
1451
+ max = ch.value;
1452
+ }
1453
+ }
1454
+ return max;
1455
+ }
1456
+ }
1457
+ ZodString.create = (params) => {
1458
+ var _a;
1459
+ return new ZodString({
1460
+ checks: [],
1461
+ typeName: ZodFirstPartyTypeKind.ZodString,
1462
+ coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
1463
+ ...processCreateParams(params),
1464
+ });
1465
+ };
1466
+ // https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034
1467
+ function floatSafeRemainder(val, step) {
1468
+ const valDecCount = (val.toString().split(".")[1] || "").length;
1469
+ const stepDecCount = (step.toString().split(".")[1] || "").length;
1470
+ const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
1471
+ const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
1472
+ const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
1473
+ return (valInt % stepInt) / Math.pow(10, decCount);
1474
+ }
1475
+ class ZodNumber extends ZodType {
1476
+ constructor() {
1477
+ super(...arguments);
1478
+ this.min = this.gte;
1479
+ this.max = this.lte;
1480
+ this.step = this.multipleOf;
1481
+ }
1482
+ _parse(input) {
1483
+ if (this._def.coerce) {
1484
+ input.data = Number(input.data);
1485
+ }
1486
+ const parsedType = this._getType(input);
1487
+ if (parsedType !== ZodParsedType.number) {
1488
+ const ctx = this._getOrReturnCtx(input);
1489
+ addIssueToContext(ctx, {
1490
+ code: ZodIssueCode.invalid_type,
1491
+ expected: ZodParsedType.number,
1492
+ received: ctx.parsedType,
1493
+ });
1494
+ return INVALID;
1495
+ }
1496
+ let ctx = undefined;
1497
+ const status = new ParseStatus();
1498
+ for (const check of this._def.checks) {
1499
+ if (check.kind === "int") {
1500
+ if (!util.isInteger(input.data)) {
1501
+ ctx = this._getOrReturnCtx(input, ctx);
1502
+ addIssueToContext(ctx, {
1503
+ code: ZodIssueCode.invalid_type,
1504
+ expected: "integer",
1505
+ received: "float",
1506
+ message: check.message,
1507
+ });
1508
+ status.dirty();
1509
+ }
1510
+ }
1511
+ else if (check.kind === "min") {
1512
+ const tooSmall = check.inclusive
1513
+ ? input.data < check.value
1514
+ : input.data <= check.value;
1515
+ if (tooSmall) {
1516
+ ctx = this._getOrReturnCtx(input, ctx);
1517
+ addIssueToContext(ctx, {
1518
+ code: ZodIssueCode.too_small,
1519
+ minimum: check.value,
1520
+ type: "number",
1521
+ inclusive: check.inclusive,
1522
+ exact: false,
1523
+ message: check.message,
1524
+ });
1525
+ status.dirty();
1526
+ }
1527
+ }
1528
+ else if (check.kind === "max") {
1529
+ const tooBig = check.inclusive
1530
+ ? input.data > check.value
1531
+ : input.data >= check.value;
1532
+ if (tooBig) {
1533
+ ctx = this._getOrReturnCtx(input, ctx);
1534
+ addIssueToContext(ctx, {
1535
+ code: ZodIssueCode.too_big,
1536
+ maximum: check.value,
1537
+ type: "number",
1538
+ inclusive: check.inclusive,
1539
+ exact: false,
1540
+ message: check.message,
1541
+ });
1542
+ status.dirty();
1543
+ }
1544
+ }
1545
+ else if (check.kind === "multipleOf") {
1546
+ if (floatSafeRemainder(input.data, check.value) !== 0) {
1547
+ ctx = this._getOrReturnCtx(input, ctx);
1548
+ addIssueToContext(ctx, {
1549
+ code: ZodIssueCode.not_multiple_of,
1550
+ multipleOf: check.value,
1551
+ message: check.message,
1552
+ });
1553
+ status.dirty();
1554
+ }
1555
+ }
1556
+ else if (check.kind === "finite") {
1557
+ if (!Number.isFinite(input.data)) {
1558
+ ctx = this._getOrReturnCtx(input, ctx);
1559
+ addIssueToContext(ctx, {
1560
+ code: ZodIssueCode.not_finite,
1561
+ message: check.message,
1562
+ });
1563
+ status.dirty();
1564
+ }
1565
+ }
1566
+ else {
1567
+ util.assertNever(check);
1568
+ }
1569
+ }
1570
+ return { status: status.value, value: input.data };
1571
+ }
1572
+ gte(value, message) {
1573
+ return this.setLimit("min", value, true, errorUtil.toString(message));
1574
+ }
1575
+ gt(value, message) {
1576
+ return this.setLimit("min", value, false, errorUtil.toString(message));
1577
+ }
1578
+ lte(value, message) {
1579
+ return this.setLimit("max", value, true, errorUtil.toString(message));
1580
+ }
1581
+ lt(value, message) {
1582
+ return this.setLimit("max", value, false, errorUtil.toString(message));
1583
+ }
1584
+ setLimit(kind, value, inclusive, message) {
1585
+ return new ZodNumber({
1586
+ ...this._def,
1587
+ checks: [
1588
+ ...this._def.checks,
1589
+ {
1590
+ kind,
1591
+ value,
1592
+ inclusive,
1593
+ message: errorUtil.toString(message),
1594
+ },
1595
+ ],
1596
+ });
1597
+ }
1598
+ _addCheck(check) {
1599
+ return new ZodNumber({
1600
+ ...this._def,
1601
+ checks: [...this._def.checks, check],
1602
+ });
1603
+ }
1604
+ int(message) {
1605
+ return this._addCheck({
1606
+ kind: "int",
1607
+ message: errorUtil.toString(message),
1608
+ });
1609
+ }
1610
+ positive(message) {
1611
+ return this._addCheck({
1612
+ kind: "min",
1613
+ value: 0,
1614
+ inclusive: false,
1615
+ message: errorUtil.toString(message),
1616
+ });
1617
+ }
1618
+ negative(message) {
1619
+ return this._addCheck({
1620
+ kind: "max",
1621
+ value: 0,
1622
+ inclusive: false,
1623
+ message: errorUtil.toString(message),
1624
+ });
1625
+ }
1626
+ nonpositive(message) {
1627
+ return this._addCheck({
1628
+ kind: "max",
1629
+ value: 0,
1630
+ inclusive: true,
1631
+ message: errorUtil.toString(message),
1632
+ });
1633
+ }
1634
+ nonnegative(message) {
1635
+ return this._addCheck({
1636
+ kind: "min",
1637
+ value: 0,
1638
+ inclusive: true,
1639
+ message: errorUtil.toString(message),
1640
+ });
1641
+ }
1642
+ multipleOf(value, message) {
1643
+ return this._addCheck({
1644
+ kind: "multipleOf",
1645
+ value: value,
1646
+ message: errorUtil.toString(message),
1647
+ });
1648
+ }
1649
+ finite(message) {
1650
+ return this._addCheck({
1651
+ kind: "finite",
1652
+ message: errorUtil.toString(message),
1653
+ });
1654
+ }
1655
+ safe(message) {
1656
+ return this._addCheck({
1657
+ kind: "min",
1658
+ inclusive: true,
1659
+ value: Number.MIN_SAFE_INTEGER,
1660
+ message: errorUtil.toString(message),
1661
+ })._addCheck({
1662
+ kind: "max",
1663
+ inclusive: true,
1664
+ value: Number.MAX_SAFE_INTEGER,
1665
+ message: errorUtil.toString(message),
1666
+ });
1667
+ }
1668
+ get minValue() {
1669
+ let min = null;
1670
+ for (const ch of this._def.checks) {
1671
+ if (ch.kind === "min") {
1672
+ if (min === null || ch.value > min)
1673
+ min = ch.value;
1674
+ }
1675
+ }
1676
+ return min;
1677
+ }
1678
+ get maxValue() {
1679
+ let max = null;
1680
+ for (const ch of this._def.checks) {
1681
+ if (ch.kind === "max") {
1682
+ if (max === null || ch.value < max)
1683
+ max = ch.value;
1684
+ }
1685
+ }
1686
+ return max;
1687
+ }
1688
+ get isInt() {
1689
+ return !!this._def.checks.find((ch) => ch.kind === "int" ||
1690
+ (ch.kind === "multipleOf" && util.isInteger(ch.value)));
1691
+ }
1692
+ get isFinite() {
1693
+ let max = null, min = null;
1694
+ for (const ch of this._def.checks) {
1695
+ if (ch.kind === "finite" ||
1696
+ ch.kind === "int" ||
1697
+ ch.kind === "multipleOf") {
1698
+ return true;
1699
+ }
1700
+ else if (ch.kind === "min") {
1701
+ if (min === null || ch.value > min)
1702
+ min = ch.value;
1703
+ }
1704
+ else if (ch.kind === "max") {
1705
+ if (max === null || ch.value < max)
1706
+ max = ch.value;
1707
+ }
1708
+ }
1709
+ return Number.isFinite(min) && Number.isFinite(max);
1710
+ }
1711
+ }
1712
+ ZodNumber.create = (params) => {
1713
+ return new ZodNumber({
1714
+ checks: [],
1715
+ typeName: ZodFirstPartyTypeKind.ZodNumber,
1716
+ coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
1717
+ ...processCreateParams(params),
1718
+ });
1719
+ };
1720
+ class ZodBigInt extends ZodType {
1721
+ constructor() {
1722
+ super(...arguments);
1723
+ this.min = this.gte;
1724
+ this.max = this.lte;
1725
+ }
1726
+ _parse(input) {
1727
+ if (this._def.coerce) {
1728
+ input.data = BigInt(input.data);
1729
+ }
1730
+ const parsedType = this._getType(input);
1731
+ if (parsedType !== ZodParsedType.bigint) {
1732
+ const ctx = this._getOrReturnCtx(input);
1733
+ addIssueToContext(ctx, {
1734
+ code: ZodIssueCode.invalid_type,
1735
+ expected: ZodParsedType.bigint,
1736
+ received: ctx.parsedType,
1737
+ });
1738
+ return INVALID;
1739
+ }
1740
+ let ctx = undefined;
1741
+ const status = new ParseStatus();
1742
+ for (const check of this._def.checks) {
1743
+ if (check.kind === "min") {
1744
+ const tooSmall = check.inclusive
1745
+ ? input.data < check.value
1746
+ : input.data <= check.value;
1747
+ if (tooSmall) {
1748
+ ctx = this._getOrReturnCtx(input, ctx);
1749
+ addIssueToContext(ctx, {
1750
+ code: ZodIssueCode.too_small,
1751
+ type: "bigint",
1752
+ minimum: check.value,
1753
+ inclusive: check.inclusive,
1754
+ message: check.message,
1755
+ });
1756
+ status.dirty();
1757
+ }
1758
+ }
1759
+ else if (check.kind === "max") {
1760
+ const tooBig = check.inclusive
1761
+ ? input.data > check.value
1762
+ : input.data >= check.value;
1763
+ if (tooBig) {
1764
+ ctx = this._getOrReturnCtx(input, ctx);
1765
+ addIssueToContext(ctx, {
1766
+ code: ZodIssueCode.too_big,
1767
+ type: "bigint",
1768
+ maximum: check.value,
1769
+ inclusive: check.inclusive,
1770
+ message: check.message,
1771
+ });
1772
+ status.dirty();
1773
+ }
1774
+ }
1775
+ else if (check.kind === "multipleOf") {
1776
+ if (input.data % check.value !== BigInt(0)) {
1777
+ ctx = this._getOrReturnCtx(input, ctx);
1778
+ addIssueToContext(ctx, {
1779
+ code: ZodIssueCode.not_multiple_of,
1780
+ multipleOf: check.value,
1781
+ message: check.message,
1782
+ });
1783
+ status.dirty();
1784
+ }
1785
+ }
1786
+ else {
1787
+ util.assertNever(check);
1788
+ }
1789
+ }
1790
+ return { status: status.value, value: input.data };
1791
+ }
1792
+ gte(value, message) {
1793
+ return this.setLimit("min", value, true, errorUtil.toString(message));
1794
+ }
1795
+ gt(value, message) {
1796
+ return this.setLimit("min", value, false, errorUtil.toString(message));
1797
+ }
1798
+ lte(value, message) {
1799
+ return this.setLimit("max", value, true, errorUtil.toString(message));
1800
+ }
1801
+ lt(value, message) {
1802
+ return this.setLimit("max", value, false, errorUtil.toString(message));
1803
+ }
1804
+ setLimit(kind, value, inclusive, message) {
1805
+ return new ZodBigInt({
1806
+ ...this._def,
1807
+ checks: [
1808
+ ...this._def.checks,
1809
+ {
1810
+ kind,
1811
+ value,
1812
+ inclusive,
1813
+ message: errorUtil.toString(message),
1814
+ },
1815
+ ],
1816
+ });
1817
+ }
1818
+ _addCheck(check) {
1819
+ return new ZodBigInt({
1820
+ ...this._def,
1821
+ checks: [...this._def.checks, check],
1822
+ });
1823
+ }
1824
+ positive(message) {
1825
+ return this._addCheck({
1826
+ kind: "min",
1827
+ value: BigInt(0),
1828
+ inclusive: false,
1829
+ message: errorUtil.toString(message),
1830
+ });
1831
+ }
1832
+ negative(message) {
1833
+ return this._addCheck({
1834
+ kind: "max",
1835
+ value: BigInt(0),
1836
+ inclusive: false,
1837
+ message: errorUtil.toString(message),
1838
+ });
1839
+ }
1840
+ nonpositive(message) {
1841
+ return this._addCheck({
1842
+ kind: "max",
1843
+ value: BigInt(0),
1844
+ inclusive: true,
1845
+ message: errorUtil.toString(message),
1846
+ });
1847
+ }
1848
+ nonnegative(message) {
1849
+ return this._addCheck({
1850
+ kind: "min",
1851
+ value: BigInt(0),
1852
+ inclusive: true,
1853
+ message: errorUtil.toString(message),
1854
+ });
1855
+ }
1856
+ multipleOf(value, message) {
1857
+ return this._addCheck({
1858
+ kind: "multipleOf",
1859
+ value,
1860
+ message: errorUtil.toString(message),
1861
+ });
1862
+ }
1863
+ get minValue() {
1864
+ let min = null;
1865
+ for (const ch of this._def.checks) {
1866
+ if (ch.kind === "min") {
1867
+ if (min === null || ch.value > min)
1868
+ min = ch.value;
1869
+ }
1870
+ }
1871
+ return min;
1872
+ }
1873
+ get maxValue() {
1874
+ let max = null;
1875
+ for (const ch of this._def.checks) {
1876
+ if (ch.kind === "max") {
1877
+ if (max === null || ch.value < max)
1878
+ max = ch.value;
1879
+ }
1880
+ }
1881
+ return max;
1882
+ }
1883
+ }
1884
+ ZodBigInt.create = (params) => {
1885
+ var _a;
1886
+ return new ZodBigInt({
1887
+ checks: [],
1888
+ typeName: ZodFirstPartyTypeKind.ZodBigInt,
1889
+ coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
1890
+ ...processCreateParams(params),
1891
+ });
1892
+ };
1893
+ class ZodBoolean extends ZodType {
1894
+ _parse(input) {
1895
+ if (this._def.coerce) {
1896
+ input.data = Boolean(input.data);
1897
+ }
1898
+ const parsedType = this._getType(input);
1899
+ if (parsedType !== ZodParsedType.boolean) {
1900
+ const ctx = this._getOrReturnCtx(input);
1901
+ addIssueToContext(ctx, {
1902
+ code: ZodIssueCode.invalid_type,
1903
+ expected: ZodParsedType.boolean,
1904
+ received: ctx.parsedType,
1905
+ });
1906
+ return INVALID;
1907
+ }
1908
+ return OK(input.data);
1909
+ }
1910
+ }
1911
+ ZodBoolean.create = (params) => {
1912
+ return new ZodBoolean({
1913
+ typeName: ZodFirstPartyTypeKind.ZodBoolean,
1914
+ coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
1915
+ ...processCreateParams(params),
1916
+ });
1917
+ };
1918
+ class ZodDate extends ZodType {
1919
+ _parse(input) {
1920
+ if (this._def.coerce) {
1921
+ input.data = new Date(input.data);
1922
+ }
1923
+ const parsedType = this._getType(input);
1924
+ if (parsedType !== ZodParsedType.date) {
1925
+ const ctx = this._getOrReturnCtx(input);
1926
+ addIssueToContext(ctx, {
1927
+ code: ZodIssueCode.invalid_type,
1928
+ expected: ZodParsedType.date,
1929
+ received: ctx.parsedType,
1930
+ });
1931
+ return INVALID;
1932
+ }
1933
+ if (isNaN(input.data.getTime())) {
1934
+ const ctx = this._getOrReturnCtx(input);
1935
+ addIssueToContext(ctx, {
1936
+ code: ZodIssueCode.invalid_date,
1937
+ });
1938
+ return INVALID;
1939
+ }
1940
+ const status = new ParseStatus();
1941
+ let ctx = undefined;
1942
+ for (const check of this._def.checks) {
1943
+ if (check.kind === "min") {
1944
+ if (input.data.getTime() < check.value) {
1945
+ ctx = this._getOrReturnCtx(input, ctx);
1946
+ addIssueToContext(ctx, {
1947
+ code: ZodIssueCode.too_small,
1948
+ message: check.message,
1949
+ inclusive: true,
1950
+ exact: false,
1951
+ minimum: check.value,
1952
+ type: "date",
1953
+ });
1954
+ status.dirty();
1955
+ }
1956
+ }
1957
+ else if (check.kind === "max") {
1958
+ if (input.data.getTime() > check.value) {
1959
+ ctx = this._getOrReturnCtx(input, ctx);
1960
+ addIssueToContext(ctx, {
1961
+ code: ZodIssueCode.too_big,
1962
+ message: check.message,
1963
+ inclusive: true,
1964
+ exact: false,
1965
+ maximum: check.value,
1966
+ type: "date",
1967
+ });
1968
+ status.dirty();
1969
+ }
1970
+ }
1971
+ else {
1972
+ util.assertNever(check);
1973
+ }
1974
+ }
1975
+ return {
1976
+ status: status.value,
1977
+ value: new Date(input.data.getTime()),
1978
+ };
1979
+ }
1980
+ _addCheck(check) {
1981
+ return new ZodDate({
1982
+ ...this._def,
1983
+ checks: [...this._def.checks, check],
1984
+ });
1985
+ }
1986
+ min(minDate, message) {
1987
+ return this._addCheck({
1988
+ kind: "min",
1989
+ value: minDate.getTime(),
1990
+ message: errorUtil.toString(message),
1991
+ });
1992
+ }
1993
+ max(maxDate, message) {
1994
+ return this._addCheck({
1995
+ kind: "max",
1996
+ value: maxDate.getTime(),
1997
+ message: errorUtil.toString(message),
1998
+ });
1999
+ }
2000
+ get minDate() {
2001
+ let min = null;
2002
+ for (const ch of this._def.checks) {
2003
+ if (ch.kind === "min") {
2004
+ if (min === null || ch.value > min)
2005
+ min = ch.value;
2006
+ }
2007
+ }
2008
+ return min != null ? new Date(min) : null;
2009
+ }
2010
+ get maxDate() {
2011
+ let max = null;
2012
+ for (const ch of this._def.checks) {
2013
+ if (ch.kind === "max") {
2014
+ if (max === null || ch.value < max)
2015
+ max = ch.value;
2016
+ }
2017
+ }
2018
+ return max != null ? new Date(max) : null;
2019
+ }
2020
+ }
2021
+ ZodDate.create = (params) => {
2022
+ return new ZodDate({
2023
+ checks: [],
2024
+ coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2025
+ typeName: ZodFirstPartyTypeKind.ZodDate,
2026
+ ...processCreateParams(params),
2027
+ });
2028
+ };
2029
+ class ZodSymbol extends ZodType {
2030
+ _parse(input) {
2031
+ const parsedType = this._getType(input);
2032
+ if (parsedType !== ZodParsedType.symbol) {
2033
+ const ctx = this._getOrReturnCtx(input);
2034
+ addIssueToContext(ctx, {
2035
+ code: ZodIssueCode.invalid_type,
2036
+ expected: ZodParsedType.symbol,
2037
+ received: ctx.parsedType,
2038
+ });
2039
+ return INVALID;
2040
+ }
2041
+ return OK(input.data);
2042
+ }
2043
+ }
2044
+ ZodSymbol.create = (params) => {
2045
+ return new ZodSymbol({
2046
+ typeName: ZodFirstPartyTypeKind.ZodSymbol,
2047
+ ...processCreateParams(params),
2048
+ });
2049
+ };
2050
+ class ZodUndefined extends ZodType {
2051
+ _parse(input) {
2052
+ const parsedType = this._getType(input);
2053
+ if (parsedType !== ZodParsedType.undefined) {
2054
+ const ctx = this._getOrReturnCtx(input);
2055
+ addIssueToContext(ctx, {
2056
+ code: ZodIssueCode.invalid_type,
2057
+ expected: ZodParsedType.undefined,
2058
+ received: ctx.parsedType,
2059
+ });
2060
+ return INVALID;
2061
+ }
2062
+ return OK(input.data);
2063
+ }
2064
+ }
2065
+ ZodUndefined.create = (params) => {
2066
+ return new ZodUndefined({
2067
+ typeName: ZodFirstPartyTypeKind.ZodUndefined,
2068
+ ...processCreateParams(params),
2069
+ });
2070
+ };
2071
+ class ZodNull extends ZodType {
2072
+ _parse(input) {
2073
+ const parsedType = this._getType(input);
2074
+ if (parsedType !== ZodParsedType.null) {
2075
+ const ctx = this._getOrReturnCtx(input);
2076
+ addIssueToContext(ctx, {
2077
+ code: ZodIssueCode.invalid_type,
2078
+ expected: ZodParsedType.null,
2079
+ received: ctx.parsedType,
2080
+ });
2081
+ return INVALID;
2082
+ }
2083
+ return OK(input.data);
2084
+ }
2085
+ }
2086
+ ZodNull.create = (params) => {
2087
+ return new ZodNull({
2088
+ typeName: ZodFirstPartyTypeKind.ZodNull,
2089
+ ...processCreateParams(params),
2090
+ });
2091
+ };
2092
+ class ZodAny extends ZodType {
2093
+ constructor() {
2094
+ super(...arguments);
2095
+ // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.
2096
+ this._any = true;
2097
+ }
2098
+ _parse(input) {
2099
+ return OK(input.data);
2100
+ }
2101
+ }
2102
+ ZodAny.create = (params) => {
2103
+ return new ZodAny({
2104
+ typeName: ZodFirstPartyTypeKind.ZodAny,
2105
+ ...processCreateParams(params),
2106
+ });
2107
+ };
2108
+ class ZodUnknown extends ZodType {
2109
+ constructor() {
2110
+ super(...arguments);
2111
+ // required
2112
+ this._unknown = true;
2113
+ }
2114
+ _parse(input) {
2115
+ return OK(input.data);
2116
+ }
2117
+ }
2118
+ ZodUnknown.create = (params) => {
2119
+ return new ZodUnknown({
2120
+ typeName: ZodFirstPartyTypeKind.ZodUnknown,
2121
+ ...processCreateParams(params),
2122
+ });
2123
+ };
2124
+ class ZodNever extends ZodType {
2125
+ _parse(input) {
2126
+ const ctx = this._getOrReturnCtx(input);
2127
+ addIssueToContext(ctx, {
2128
+ code: ZodIssueCode.invalid_type,
2129
+ expected: ZodParsedType.never,
2130
+ received: ctx.parsedType,
2131
+ });
2132
+ return INVALID;
2133
+ }
2134
+ }
2135
+ ZodNever.create = (params) => {
2136
+ return new ZodNever({
2137
+ typeName: ZodFirstPartyTypeKind.ZodNever,
2138
+ ...processCreateParams(params),
2139
+ });
2140
+ };
2141
+ class ZodVoid extends ZodType {
2142
+ _parse(input) {
2143
+ const parsedType = this._getType(input);
2144
+ if (parsedType !== ZodParsedType.undefined) {
2145
+ const ctx = this._getOrReturnCtx(input);
2146
+ addIssueToContext(ctx, {
2147
+ code: ZodIssueCode.invalid_type,
2148
+ expected: ZodParsedType.void,
2149
+ received: ctx.parsedType,
2150
+ });
2151
+ return INVALID;
2152
+ }
2153
+ return OK(input.data);
2154
+ }
2155
+ }
2156
+ ZodVoid.create = (params) => {
2157
+ return new ZodVoid({
2158
+ typeName: ZodFirstPartyTypeKind.ZodVoid,
2159
+ ...processCreateParams(params),
2160
+ });
2161
+ };
2162
+ class ZodArray extends ZodType {
2163
+ _parse(input) {
2164
+ const { ctx, status } = this._processInputParams(input);
2165
+ const def = this._def;
2166
+ if (ctx.parsedType !== ZodParsedType.array) {
2167
+ addIssueToContext(ctx, {
2168
+ code: ZodIssueCode.invalid_type,
2169
+ expected: ZodParsedType.array,
2170
+ received: ctx.parsedType,
2171
+ });
2172
+ return INVALID;
2173
+ }
2174
+ if (def.exactLength !== null) {
2175
+ const tooBig = ctx.data.length > def.exactLength.value;
2176
+ const tooSmall = ctx.data.length < def.exactLength.value;
2177
+ if (tooBig || tooSmall) {
2178
+ addIssueToContext(ctx, {
2179
+ code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
2180
+ minimum: (tooSmall ? def.exactLength.value : undefined),
2181
+ maximum: (tooBig ? def.exactLength.value : undefined),
2182
+ type: "array",
2183
+ inclusive: true,
2184
+ exact: true,
2185
+ message: def.exactLength.message,
2186
+ });
2187
+ status.dirty();
2188
+ }
2189
+ }
2190
+ if (def.minLength !== null) {
2191
+ if (ctx.data.length < def.minLength.value) {
2192
+ addIssueToContext(ctx, {
2193
+ code: ZodIssueCode.too_small,
2194
+ minimum: def.minLength.value,
2195
+ type: "array",
2196
+ inclusive: true,
2197
+ exact: false,
2198
+ message: def.minLength.message,
2199
+ });
2200
+ status.dirty();
2201
+ }
2202
+ }
2203
+ if (def.maxLength !== null) {
2204
+ if (ctx.data.length > def.maxLength.value) {
2205
+ addIssueToContext(ctx, {
2206
+ code: ZodIssueCode.too_big,
2207
+ maximum: def.maxLength.value,
2208
+ type: "array",
2209
+ inclusive: true,
2210
+ exact: false,
2211
+ message: def.maxLength.message,
2212
+ });
2213
+ status.dirty();
2214
+ }
2215
+ }
2216
+ if (ctx.common.async) {
2217
+ return Promise.all([...ctx.data].map((item, i) => {
2218
+ return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2219
+ })).then((result) => {
2220
+ return ParseStatus.mergeArray(status, result);
2221
+ });
2222
+ }
2223
+ const result = [...ctx.data].map((item, i) => {
2224
+ return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2225
+ });
2226
+ return ParseStatus.mergeArray(status, result);
2227
+ }
2228
+ get element() {
2229
+ return this._def.type;
2230
+ }
2231
+ min(minLength, message) {
2232
+ return new ZodArray({
2233
+ ...this._def,
2234
+ minLength: { value: minLength, message: errorUtil.toString(message) },
2235
+ });
2236
+ }
2237
+ max(maxLength, message) {
2238
+ return new ZodArray({
2239
+ ...this._def,
2240
+ maxLength: { value: maxLength, message: errorUtil.toString(message) },
2241
+ });
2242
+ }
2243
+ length(len, message) {
2244
+ return new ZodArray({
2245
+ ...this._def,
2246
+ exactLength: { value: len, message: errorUtil.toString(message) },
2247
+ });
2248
+ }
2249
+ nonempty(message) {
2250
+ return this.min(1, message);
2251
+ }
2252
+ }
2253
+ ZodArray.create = (schema, params) => {
2254
+ return new ZodArray({
2255
+ type: schema,
2256
+ minLength: null,
2257
+ maxLength: null,
2258
+ exactLength: null,
2259
+ typeName: ZodFirstPartyTypeKind.ZodArray,
2260
+ ...processCreateParams(params),
2261
+ });
2262
+ };
2263
+ function deepPartialify(schema) {
2264
+ if (schema instanceof ZodObject) {
2265
+ const newShape = {};
2266
+ for (const key in schema.shape) {
2267
+ const fieldSchema = schema.shape[key];
2268
+ newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
2269
+ }
2270
+ return new ZodObject({
2271
+ ...schema._def,
2272
+ shape: () => newShape,
2273
+ });
2274
+ }
2275
+ else if (schema instanceof ZodArray) {
2276
+ return new ZodArray({
2277
+ ...schema._def,
2278
+ type: deepPartialify(schema.element),
2279
+ });
2280
+ }
2281
+ else if (schema instanceof ZodOptional) {
2282
+ return ZodOptional.create(deepPartialify(schema.unwrap()));
2283
+ }
2284
+ else if (schema instanceof ZodNullable) {
2285
+ return ZodNullable.create(deepPartialify(schema.unwrap()));
2286
+ }
2287
+ else if (schema instanceof ZodTuple) {
2288
+ return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
2289
+ }
2290
+ else {
2291
+ return schema;
2292
+ }
2293
+ }
2294
+ class ZodObject extends ZodType {
2295
+ constructor() {
2296
+ super(...arguments);
2297
+ this._cached = null;
2298
+ /**
2299
+ * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
2300
+ * If you want to pass through unknown properties, use `.passthrough()` instead.
2301
+ */
2302
+ this.nonstrict = this.passthrough;
2303
+ // extend<
2304
+ // Augmentation extends ZodRawShape,
2305
+ // NewOutput extends util.flatten<{
2306
+ // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
2307
+ // ? Augmentation[k]["_output"]
2308
+ // : k extends keyof Output
2309
+ // ? Output[k]
2310
+ // : never;
2311
+ // }>,
2312
+ // NewInput extends util.flatten<{
2313
+ // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
2314
+ // ? Augmentation[k]["_input"]
2315
+ // : k extends keyof Input
2316
+ // ? Input[k]
2317
+ // : never;
2318
+ // }>
2319
+ // >(
2320
+ // augmentation: Augmentation
2321
+ // ): ZodObject<
2322
+ // extendShape<T, Augmentation>,
2323
+ // UnknownKeys,
2324
+ // Catchall,
2325
+ // NewOutput,
2326
+ // NewInput
2327
+ // > {
2328
+ // return new ZodObject({
2329
+ // ...this._def,
2330
+ // shape: () => ({
2331
+ // ...this._def.shape(),
2332
+ // ...augmentation,
2333
+ // }),
2334
+ // }) as any;
2335
+ // }
2336
+ /**
2337
+ * @deprecated Use `.extend` instead
2338
+ * */
2339
+ this.augment = this.extend;
2340
+ }
2341
+ _getCached() {
2342
+ if (this._cached !== null)
2343
+ return this._cached;
2344
+ const shape = this._def.shape();
2345
+ const keys = util.objectKeys(shape);
2346
+ return (this._cached = { shape, keys });
2347
+ }
2348
+ _parse(input) {
2349
+ const parsedType = this._getType(input);
2350
+ if (parsedType !== ZodParsedType.object) {
2351
+ const ctx = this._getOrReturnCtx(input);
2352
+ addIssueToContext(ctx, {
2353
+ code: ZodIssueCode.invalid_type,
2354
+ expected: ZodParsedType.object,
2355
+ received: ctx.parsedType,
2356
+ });
2357
+ return INVALID;
2358
+ }
2359
+ const { status, ctx } = this._processInputParams(input);
2360
+ const { shape, keys: shapeKeys } = this._getCached();
2361
+ const extraKeys = [];
2362
+ if (!(this._def.catchall instanceof ZodNever &&
2363
+ this._def.unknownKeys === "strip")) {
2364
+ for (const key in ctx.data) {
2365
+ if (!shapeKeys.includes(key)) {
2366
+ extraKeys.push(key);
2367
+ }
2368
+ }
2369
+ }
2370
+ const pairs = [];
2371
+ for (const key of shapeKeys) {
2372
+ const keyValidator = shape[key];
2373
+ const value = ctx.data[key];
2374
+ pairs.push({
2375
+ key: { status: "valid", value: key },
2376
+ value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
2377
+ alwaysSet: key in ctx.data,
2378
+ });
2379
+ }
2380
+ if (this._def.catchall instanceof ZodNever) {
2381
+ const unknownKeys = this._def.unknownKeys;
2382
+ if (unknownKeys === "passthrough") {
2383
+ for (const key of extraKeys) {
2384
+ pairs.push({
2385
+ key: { status: "valid", value: key },
2386
+ value: { status: "valid", value: ctx.data[key] },
2387
+ });
2388
+ }
2389
+ }
2390
+ else if (unknownKeys === "strict") {
2391
+ if (extraKeys.length > 0) {
2392
+ addIssueToContext(ctx, {
2393
+ code: ZodIssueCode.unrecognized_keys,
2394
+ keys: extraKeys,
2395
+ });
2396
+ status.dirty();
2397
+ }
2398
+ }
2399
+ else if (unknownKeys === "strip") ;
2400
+ else {
2401
+ throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
2402
+ }
2403
+ }
2404
+ else {
2405
+ // run catchall validation
2406
+ const catchall = this._def.catchall;
2407
+ for (const key of extraKeys) {
2408
+ const value = ctx.data[key];
2409
+ pairs.push({
2410
+ key: { status: "valid", value: key },
2411
+ value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)
2412
+ ),
2413
+ alwaysSet: key in ctx.data,
2414
+ });
2415
+ }
2416
+ }
2417
+ if (ctx.common.async) {
2418
+ return Promise.resolve()
2419
+ .then(async () => {
2420
+ const syncPairs = [];
2421
+ for (const pair of pairs) {
2422
+ const key = await pair.key;
2423
+ const value = await pair.value;
2424
+ syncPairs.push({
2425
+ key,
2426
+ value,
2427
+ alwaysSet: pair.alwaysSet,
2428
+ });
2429
+ }
2430
+ return syncPairs;
2431
+ })
2432
+ .then((syncPairs) => {
2433
+ return ParseStatus.mergeObjectSync(status, syncPairs);
2434
+ });
2435
+ }
2436
+ else {
2437
+ return ParseStatus.mergeObjectSync(status, pairs);
2438
+ }
2439
+ }
2440
+ get shape() {
2441
+ return this._def.shape();
2442
+ }
2443
+ strict(message) {
2444
+ errorUtil.errToObj;
2445
+ return new ZodObject({
2446
+ ...this._def,
2447
+ unknownKeys: "strict",
2448
+ ...(message !== undefined
2449
+ ? {
2450
+ errorMap: (issue, ctx) => {
2451
+ var _a, _b, _c, _d;
2452
+ const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
2453
+ if (issue.code === "unrecognized_keys")
2454
+ return {
2455
+ message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,
2456
+ };
2457
+ return {
2458
+ message: defaultError,
2459
+ };
2460
+ },
2461
+ }
2462
+ : {}),
2463
+ });
2464
+ }
2465
+ strip() {
2466
+ return new ZodObject({
2467
+ ...this._def,
2468
+ unknownKeys: "strip",
2469
+ });
2470
+ }
2471
+ passthrough() {
2472
+ return new ZodObject({
2473
+ ...this._def,
2474
+ unknownKeys: "passthrough",
2475
+ });
2476
+ }
2477
+ // const AugmentFactory =
2478
+ // <Def extends ZodObjectDef>(def: Def) =>
2479
+ // <Augmentation extends ZodRawShape>(
2480
+ // augmentation: Augmentation
2481
+ // ): ZodObject<
2482
+ // extendShape<ReturnType<Def["shape"]>, Augmentation>,
2483
+ // Def["unknownKeys"],
2484
+ // Def["catchall"]
2485
+ // > => {
2486
+ // return new ZodObject({
2487
+ // ...def,
2488
+ // shape: () => ({
2489
+ // ...def.shape(),
2490
+ // ...augmentation,
2491
+ // }),
2492
+ // }) as any;
2493
+ // };
2494
+ extend(augmentation) {
2495
+ return new ZodObject({
2496
+ ...this._def,
2497
+ shape: () => ({
2498
+ ...this._def.shape(),
2499
+ ...augmentation,
2500
+ }),
2501
+ });
2502
+ }
2503
+ /**
2504
+ * Prior to zod@1.0.12 there was a bug in the
2505
+ * inferred type of merged objects. Please
2506
+ * upgrade if you are experiencing issues.
2507
+ */
2508
+ merge(merging) {
2509
+ const merged = new ZodObject({
2510
+ unknownKeys: merging._def.unknownKeys,
2511
+ catchall: merging._def.catchall,
2512
+ shape: () => ({
2513
+ ...this._def.shape(),
2514
+ ...merging._def.shape(),
2515
+ }),
2516
+ typeName: ZodFirstPartyTypeKind.ZodObject,
2517
+ });
2518
+ return merged;
2519
+ }
2520
+ // merge<
2521
+ // Incoming extends AnyZodObject,
2522
+ // Augmentation extends Incoming["shape"],
2523
+ // NewOutput extends {
2524
+ // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
2525
+ // ? Augmentation[k]["_output"]
2526
+ // : k extends keyof Output
2527
+ // ? Output[k]
2528
+ // : never;
2529
+ // },
2530
+ // NewInput extends {
2531
+ // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
2532
+ // ? Augmentation[k]["_input"]
2533
+ // : k extends keyof Input
2534
+ // ? Input[k]
2535
+ // : never;
2536
+ // }
2537
+ // >(
2538
+ // merging: Incoming
2539
+ // ): ZodObject<
2540
+ // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2541
+ // Incoming["_def"]["unknownKeys"],
2542
+ // Incoming["_def"]["catchall"],
2543
+ // NewOutput,
2544
+ // NewInput
2545
+ // > {
2546
+ // const merged: any = new ZodObject({
2547
+ // unknownKeys: merging._def.unknownKeys,
2548
+ // catchall: merging._def.catchall,
2549
+ // shape: () =>
2550
+ // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2551
+ // typeName: ZodFirstPartyTypeKind.ZodObject,
2552
+ // }) as any;
2553
+ // return merged;
2554
+ // }
2555
+ setKey(key, schema) {
2556
+ return this.augment({ [key]: schema });
2557
+ }
2558
+ // merge<Incoming extends AnyZodObject>(
2559
+ // merging: Incoming
2560
+ // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
2561
+ // ZodObject<
2562
+ // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2563
+ // Incoming["_def"]["unknownKeys"],
2564
+ // Incoming["_def"]["catchall"]
2565
+ // > {
2566
+ // // const mergedShape = objectUtil.mergeShapes(
2567
+ // // this._def.shape(),
2568
+ // // merging._def.shape()
2569
+ // // );
2570
+ // const merged: any = new ZodObject({
2571
+ // unknownKeys: merging._def.unknownKeys,
2572
+ // catchall: merging._def.catchall,
2573
+ // shape: () =>
2574
+ // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2575
+ // typeName: ZodFirstPartyTypeKind.ZodObject,
2576
+ // }) as any;
2577
+ // return merged;
2578
+ // }
2579
+ catchall(index) {
2580
+ return new ZodObject({
2581
+ ...this._def,
2582
+ catchall: index,
2583
+ });
2584
+ }
2585
+ pick(mask) {
2586
+ const shape = {};
2587
+ util.objectKeys(mask).forEach((key) => {
2588
+ if (mask[key] && this.shape[key]) {
2589
+ shape[key] = this.shape[key];
2590
+ }
2591
+ });
2592
+ return new ZodObject({
2593
+ ...this._def,
2594
+ shape: () => shape,
2595
+ });
2596
+ }
2597
+ omit(mask) {
2598
+ const shape = {};
2599
+ util.objectKeys(this.shape).forEach((key) => {
2600
+ if (!mask[key]) {
2601
+ shape[key] = this.shape[key];
2602
+ }
2603
+ });
2604
+ return new ZodObject({
2605
+ ...this._def,
2606
+ shape: () => shape,
2607
+ });
2608
+ }
2609
+ /**
2610
+ * @deprecated
2611
+ */
2612
+ deepPartial() {
2613
+ return deepPartialify(this);
2614
+ }
2615
+ partial(mask) {
2616
+ const newShape = {};
2617
+ util.objectKeys(this.shape).forEach((key) => {
2618
+ const fieldSchema = this.shape[key];
2619
+ if (mask && !mask[key]) {
2620
+ newShape[key] = fieldSchema;
2621
+ }
2622
+ else {
2623
+ newShape[key] = fieldSchema.optional();
2624
+ }
2625
+ });
2626
+ return new ZodObject({
2627
+ ...this._def,
2628
+ shape: () => newShape,
2629
+ });
2630
+ }
2631
+ required(mask) {
2632
+ const newShape = {};
2633
+ util.objectKeys(this.shape).forEach((key) => {
2634
+ if (mask && !mask[key]) {
2635
+ newShape[key] = this.shape[key];
2636
+ }
2637
+ else {
2638
+ const fieldSchema = this.shape[key];
2639
+ let newField = fieldSchema;
2640
+ while (newField instanceof ZodOptional) {
2641
+ newField = newField._def.innerType;
2642
+ }
2643
+ newShape[key] = newField;
2644
+ }
2645
+ });
2646
+ return new ZodObject({
2647
+ ...this._def,
2648
+ shape: () => newShape,
2649
+ });
2650
+ }
2651
+ keyof() {
2652
+ return createZodEnum(util.objectKeys(this.shape));
2653
+ }
2654
+ }
2655
+ ZodObject.create = (shape, params) => {
2656
+ return new ZodObject({
2657
+ shape: () => shape,
2658
+ unknownKeys: "strip",
2659
+ catchall: ZodNever.create(),
2660
+ typeName: ZodFirstPartyTypeKind.ZodObject,
2661
+ ...processCreateParams(params),
2662
+ });
2663
+ };
2664
+ ZodObject.strictCreate = (shape, params) => {
2665
+ return new ZodObject({
2666
+ shape: () => shape,
2667
+ unknownKeys: "strict",
2668
+ catchall: ZodNever.create(),
2669
+ typeName: ZodFirstPartyTypeKind.ZodObject,
2670
+ ...processCreateParams(params),
2671
+ });
2672
+ };
2673
+ ZodObject.lazycreate = (shape, params) => {
2674
+ return new ZodObject({
2675
+ shape,
2676
+ unknownKeys: "strip",
2677
+ catchall: ZodNever.create(),
2678
+ typeName: ZodFirstPartyTypeKind.ZodObject,
2679
+ ...processCreateParams(params),
2680
+ });
2681
+ };
2682
+ class ZodUnion extends ZodType {
2683
+ _parse(input) {
2684
+ const { ctx } = this._processInputParams(input);
2685
+ const options = this._def.options;
2686
+ function handleResults(results) {
2687
+ // return first issue-free validation if it exists
2688
+ for (const result of results) {
2689
+ if (result.result.status === "valid") {
2690
+ return result.result;
2691
+ }
2692
+ }
2693
+ for (const result of results) {
2694
+ if (result.result.status === "dirty") {
2695
+ // add issues from dirty option
2696
+ ctx.common.issues.push(...result.ctx.common.issues);
2697
+ return result.result;
2698
+ }
2699
+ }
2700
+ // return invalid
2701
+ const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
2702
+ addIssueToContext(ctx, {
2703
+ code: ZodIssueCode.invalid_union,
2704
+ unionErrors,
2705
+ });
2706
+ return INVALID;
2707
+ }
2708
+ if (ctx.common.async) {
2709
+ return Promise.all(options.map(async (option) => {
2710
+ const childCtx = {
2711
+ ...ctx,
2712
+ common: {
2713
+ ...ctx.common,
2714
+ issues: [],
2715
+ },
2716
+ parent: null,
2717
+ };
2718
+ return {
2719
+ result: await option._parseAsync({
2720
+ data: ctx.data,
2721
+ path: ctx.path,
2722
+ parent: childCtx,
2723
+ }),
2724
+ ctx: childCtx,
2725
+ };
2726
+ })).then(handleResults);
2727
+ }
2728
+ else {
2729
+ let dirty = undefined;
2730
+ const issues = [];
2731
+ for (const option of options) {
2732
+ const childCtx = {
2733
+ ...ctx,
2734
+ common: {
2735
+ ...ctx.common,
2736
+ issues: [],
2737
+ },
2738
+ parent: null,
2739
+ };
2740
+ const result = option._parseSync({
2741
+ data: ctx.data,
2742
+ path: ctx.path,
2743
+ parent: childCtx,
2744
+ });
2745
+ if (result.status === "valid") {
2746
+ return result;
2747
+ }
2748
+ else if (result.status === "dirty" && !dirty) {
2749
+ dirty = { result, ctx: childCtx };
2750
+ }
2751
+ if (childCtx.common.issues.length) {
2752
+ issues.push(childCtx.common.issues);
2753
+ }
2754
+ }
2755
+ if (dirty) {
2756
+ ctx.common.issues.push(...dirty.ctx.common.issues);
2757
+ return dirty.result;
2758
+ }
2759
+ const unionErrors = issues.map((issues) => new ZodError(issues));
2760
+ addIssueToContext(ctx, {
2761
+ code: ZodIssueCode.invalid_union,
2762
+ unionErrors,
2763
+ });
2764
+ return INVALID;
2765
+ }
2766
+ }
2767
+ get options() {
2768
+ return this._def.options;
2769
+ }
2770
+ }
2771
+ ZodUnion.create = (types, params) => {
2772
+ return new ZodUnion({
2773
+ options: types,
2774
+ typeName: ZodFirstPartyTypeKind.ZodUnion,
2775
+ ...processCreateParams(params),
2776
+ });
2777
+ };
2778
+ /////////////////////////////////////////////////////
2779
+ /////////////////////////////////////////////////////
2780
+ ////////// //////////
2781
+ ////////// ZodDiscriminatedUnion //////////
2782
+ ////////// //////////
2783
+ /////////////////////////////////////////////////////
2784
+ /////////////////////////////////////////////////////
2785
+ const getDiscriminator = (type) => {
2786
+ if (type instanceof ZodLazy) {
2787
+ return getDiscriminator(type.schema);
2788
+ }
2789
+ else if (type instanceof ZodEffects) {
2790
+ return getDiscriminator(type.innerType());
2791
+ }
2792
+ else if (type instanceof ZodLiteral) {
2793
+ return [type.value];
2794
+ }
2795
+ else if (type instanceof ZodEnum) {
2796
+ return type.options;
2797
+ }
2798
+ else if (type instanceof ZodNativeEnum) {
2799
+ // eslint-disable-next-line ban/ban
2800
+ return util.objectValues(type.enum);
2801
+ }
2802
+ else if (type instanceof ZodDefault) {
2803
+ return getDiscriminator(type._def.innerType);
2804
+ }
2805
+ else if (type instanceof ZodUndefined) {
2806
+ return [undefined];
2807
+ }
2808
+ else if (type instanceof ZodNull) {
2809
+ return [null];
2810
+ }
2811
+ else if (type instanceof ZodOptional) {
2812
+ return [undefined, ...getDiscriminator(type.unwrap())];
2813
+ }
2814
+ else if (type instanceof ZodNullable) {
2815
+ return [null, ...getDiscriminator(type.unwrap())];
2816
+ }
2817
+ else if (type instanceof ZodBranded) {
2818
+ return getDiscriminator(type.unwrap());
2819
+ }
2820
+ else if (type instanceof ZodReadonly) {
2821
+ return getDiscriminator(type.unwrap());
2822
+ }
2823
+ else if (type instanceof ZodCatch) {
2824
+ return getDiscriminator(type._def.innerType);
2825
+ }
2826
+ else {
2827
+ return [];
2828
+ }
2829
+ };
2830
+ class ZodDiscriminatedUnion extends ZodType {
2831
+ _parse(input) {
2832
+ const { ctx } = this._processInputParams(input);
2833
+ if (ctx.parsedType !== ZodParsedType.object) {
2834
+ addIssueToContext(ctx, {
2835
+ code: ZodIssueCode.invalid_type,
2836
+ expected: ZodParsedType.object,
2837
+ received: ctx.parsedType,
2838
+ });
2839
+ return INVALID;
2840
+ }
2841
+ const discriminator = this.discriminator;
2842
+ const discriminatorValue = ctx.data[discriminator];
2843
+ const option = this.optionsMap.get(discriminatorValue);
2844
+ if (!option) {
2845
+ addIssueToContext(ctx, {
2846
+ code: ZodIssueCode.invalid_union_discriminator,
2847
+ options: Array.from(this.optionsMap.keys()),
2848
+ path: [discriminator],
2849
+ });
2850
+ return INVALID;
2851
+ }
2852
+ if (ctx.common.async) {
2853
+ return option._parseAsync({
2854
+ data: ctx.data,
2855
+ path: ctx.path,
2856
+ parent: ctx,
2857
+ });
2858
+ }
2859
+ else {
2860
+ return option._parseSync({
2861
+ data: ctx.data,
2862
+ path: ctx.path,
2863
+ parent: ctx,
2864
+ });
2865
+ }
2866
+ }
2867
+ get discriminator() {
2868
+ return this._def.discriminator;
2869
+ }
2870
+ get options() {
2871
+ return this._def.options;
2872
+ }
2873
+ get optionsMap() {
2874
+ return this._def.optionsMap;
2875
+ }
2876
+ /**
2877
+ * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
2878
+ * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
2879
+ * have a different value for each object in the union.
2880
+ * @param discriminator the name of the discriminator property
2881
+ * @param types an array of object schemas
2882
+ * @param params
2883
+ */
2884
+ static create(discriminator, options, params) {
2885
+ // Get all the valid discriminator values
2886
+ const optionsMap = new Map();
2887
+ // try {
2888
+ for (const type of options) {
2889
+ const discriminatorValues = getDiscriminator(type.shape[discriminator]);
2890
+ if (!discriminatorValues.length) {
2891
+ throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
2892
+ }
2893
+ for (const value of discriminatorValues) {
2894
+ if (optionsMap.has(value)) {
2895
+ throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
2896
+ }
2897
+ optionsMap.set(value, type);
2898
+ }
2899
+ }
2900
+ return new ZodDiscriminatedUnion({
2901
+ typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
2902
+ discriminator,
2903
+ options,
2904
+ optionsMap,
2905
+ ...processCreateParams(params),
2906
+ });
2907
+ }
2908
+ }
2909
+ function mergeValues(a, b) {
2910
+ const aType = getParsedType(a);
2911
+ const bType = getParsedType(b);
2912
+ if (a === b) {
2913
+ return { valid: true, data: a };
2914
+ }
2915
+ else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
2916
+ const bKeys = util.objectKeys(b);
2917
+ const sharedKeys = util
2918
+ .objectKeys(a)
2919
+ .filter((key) => bKeys.indexOf(key) !== -1);
2920
+ const newObj = { ...a, ...b };
2921
+ for (const key of sharedKeys) {
2922
+ const sharedValue = mergeValues(a[key], b[key]);
2923
+ if (!sharedValue.valid) {
2924
+ return { valid: false };
2925
+ }
2926
+ newObj[key] = sharedValue.data;
2927
+ }
2928
+ return { valid: true, data: newObj };
2929
+ }
2930
+ else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
2931
+ if (a.length !== b.length) {
2932
+ return { valid: false };
2933
+ }
2934
+ const newArray = [];
2935
+ for (let index = 0; index < a.length; index++) {
2936
+ const itemA = a[index];
2937
+ const itemB = b[index];
2938
+ const sharedValue = mergeValues(itemA, itemB);
2939
+ if (!sharedValue.valid) {
2940
+ return { valid: false };
2941
+ }
2942
+ newArray.push(sharedValue.data);
2943
+ }
2944
+ return { valid: true, data: newArray };
2945
+ }
2946
+ else if (aType === ZodParsedType.date &&
2947
+ bType === ZodParsedType.date &&
2948
+ +a === +b) {
2949
+ return { valid: true, data: a };
2950
+ }
2951
+ else {
2952
+ return { valid: false };
2953
+ }
2954
+ }
2955
+ class ZodIntersection extends ZodType {
2956
+ _parse(input) {
2957
+ const { status, ctx } = this._processInputParams(input);
2958
+ const handleParsed = (parsedLeft, parsedRight) => {
2959
+ if (isAborted(parsedLeft) || isAborted(parsedRight)) {
2960
+ return INVALID;
2961
+ }
2962
+ const merged = mergeValues(parsedLeft.value, parsedRight.value);
2963
+ if (!merged.valid) {
2964
+ addIssueToContext(ctx, {
2965
+ code: ZodIssueCode.invalid_intersection_types,
2966
+ });
2967
+ return INVALID;
2968
+ }
2969
+ if (isDirty(parsedLeft) || isDirty(parsedRight)) {
2970
+ status.dirty();
2971
+ }
2972
+ return { status: status.value, value: merged.data };
2973
+ };
2974
+ if (ctx.common.async) {
2975
+ return Promise.all([
2976
+ this._def.left._parseAsync({
2977
+ data: ctx.data,
2978
+ path: ctx.path,
2979
+ parent: ctx,
2980
+ }),
2981
+ this._def.right._parseAsync({
2982
+ data: ctx.data,
2983
+ path: ctx.path,
2984
+ parent: ctx,
2985
+ }),
2986
+ ]).then(([left, right]) => handleParsed(left, right));
2987
+ }
2988
+ else {
2989
+ return handleParsed(this._def.left._parseSync({
2990
+ data: ctx.data,
2991
+ path: ctx.path,
2992
+ parent: ctx,
2993
+ }), this._def.right._parseSync({
2994
+ data: ctx.data,
2995
+ path: ctx.path,
2996
+ parent: ctx,
2997
+ }));
2998
+ }
2999
+ }
3000
+ }
3001
+ ZodIntersection.create = (left, right, params) => {
3002
+ return new ZodIntersection({
3003
+ left: left,
3004
+ right: right,
3005
+ typeName: ZodFirstPartyTypeKind.ZodIntersection,
3006
+ ...processCreateParams(params),
3007
+ });
3008
+ };
3009
+ class ZodTuple extends ZodType {
3010
+ _parse(input) {
3011
+ const { status, ctx } = this._processInputParams(input);
3012
+ if (ctx.parsedType !== ZodParsedType.array) {
3013
+ addIssueToContext(ctx, {
3014
+ code: ZodIssueCode.invalid_type,
3015
+ expected: ZodParsedType.array,
3016
+ received: ctx.parsedType,
3017
+ });
3018
+ return INVALID;
3019
+ }
3020
+ if (ctx.data.length < this._def.items.length) {
3021
+ addIssueToContext(ctx, {
3022
+ code: ZodIssueCode.too_small,
3023
+ minimum: this._def.items.length,
3024
+ inclusive: true,
3025
+ exact: false,
3026
+ type: "array",
3027
+ });
3028
+ return INVALID;
3029
+ }
3030
+ const rest = this._def.rest;
3031
+ if (!rest && ctx.data.length > this._def.items.length) {
3032
+ addIssueToContext(ctx, {
3033
+ code: ZodIssueCode.too_big,
3034
+ maximum: this._def.items.length,
3035
+ inclusive: true,
3036
+ exact: false,
3037
+ type: "array",
3038
+ });
3039
+ status.dirty();
3040
+ }
3041
+ const items = [...ctx.data]
3042
+ .map((item, itemIndex) => {
3043
+ const schema = this._def.items[itemIndex] || this._def.rest;
3044
+ if (!schema)
3045
+ return null;
3046
+ return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
3047
+ })
3048
+ .filter((x) => !!x); // filter nulls
3049
+ if (ctx.common.async) {
3050
+ return Promise.all(items).then((results) => {
3051
+ return ParseStatus.mergeArray(status, results);
3052
+ });
3053
+ }
3054
+ else {
3055
+ return ParseStatus.mergeArray(status, items);
3056
+ }
3057
+ }
3058
+ get items() {
3059
+ return this._def.items;
3060
+ }
3061
+ rest(rest) {
3062
+ return new ZodTuple({
3063
+ ...this._def,
3064
+ rest,
3065
+ });
3066
+ }
3067
+ }
3068
+ ZodTuple.create = (schemas, params) => {
3069
+ if (!Array.isArray(schemas)) {
3070
+ throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
3071
+ }
3072
+ return new ZodTuple({
3073
+ items: schemas,
3074
+ typeName: ZodFirstPartyTypeKind.ZodTuple,
3075
+ rest: null,
3076
+ ...processCreateParams(params),
3077
+ });
3078
+ };
3079
+ class ZodRecord extends ZodType {
3080
+ get keySchema() {
3081
+ return this._def.keyType;
3082
+ }
3083
+ get valueSchema() {
3084
+ return this._def.valueType;
3085
+ }
3086
+ _parse(input) {
3087
+ const { status, ctx } = this._processInputParams(input);
3088
+ if (ctx.parsedType !== ZodParsedType.object) {
3089
+ addIssueToContext(ctx, {
3090
+ code: ZodIssueCode.invalid_type,
3091
+ expected: ZodParsedType.object,
3092
+ received: ctx.parsedType,
3093
+ });
3094
+ return INVALID;
3095
+ }
3096
+ const pairs = [];
3097
+ const keyType = this._def.keyType;
3098
+ const valueType = this._def.valueType;
3099
+ for (const key in ctx.data) {
3100
+ pairs.push({
3101
+ key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
3102
+ value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
3103
+ alwaysSet: key in ctx.data,
3104
+ });
3105
+ }
3106
+ if (ctx.common.async) {
3107
+ return ParseStatus.mergeObjectAsync(status, pairs);
3108
+ }
3109
+ else {
3110
+ return ParseStatus.mergeObjectSync(status, pairs);
3111
+ }
3112
+ }
3113
+ get element() {
3114
+ return this._def.valueType;
3115
+ }
3116
+ static create(first, second, third) {
3117
+ if (second instanceof ZodType) {
3118
+ return new ZodRecord({
3119
+ keyType: first,
3120
+ valueType: second,
3121
+ typeName: ZodFirstPartyTypeKind.ZodRecord,
3122
+ ...processCreateParams(third),
3123
+ });
3124
+ }
3125
+ return new ZodRecord({
3126
+ keyType: ZodString.create(),
3127
+ valueType: first,
3128
+ typeName: ZodFirstPartyTypeKind.ZodRecord,
3129
+ ...processCreateParams(second),
3130
+ });
3131
+ }
3132
+ }
3133
+ class ZodMap extends ZodType {
3134
+ get keySchema() {
3135
+ return this._def.keyType;
3136
+ }
3137
+ get valueSchema() {
3138
+ return this._def.valueType;
3139
+ }
3140
+ _parse(input) {
3141
+ const { status, ctx } = this._processInputParams(input);
3142
+ if (ctx.parsedType !== ZodParsedType.map) {
3143
+ addIssueToContext(ctx, {
3144
+ code: ZodIssueCode.invalid_type,
3145
+ expected: ZodParsedType.map,
3146
+ received: ctx.parsedType,
3147
+ });
3148
+ return INVALID;
3149
+ }
3150
+ const keyType = this._def.keyType;
3151
+ const valueType = this._def.valueType;
3152
+ const pairs = [...ctx.data.entries()].map(([key, value], index) => {
3153
+ return {
3154
+ key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
3155
+ value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])),
3156
+ };
3157
+ });
3158
+ if (ctx.common.async) {
3159
+ const finalMap = new Map();
3160
+ return Promise.resolve().then(async () => {
3161
+ for (const pair of pairs) {
3162
+ const key = await pair.key;
3163
+ const value = await pair.value;
3164
+ if (key.status === "aborted" || value.status === "aborted") {
3165
+ return INVALID;
3166
+ }
3167
+ if (key.status === "dirty" || value.status === "dirty") {
3168
+ status.dirty();
3169
+ }
3170
+ finalMap.set(key.value, value.value);
3171
+ }
3172
+ return { status: status.value, value: finalMap };
3173
+ });
3174
+ }
3175
+ else {
3176
+ const finalMap = new Map();
3177
+ for (const pair of pairs) {
3178
+ const key = pair.key;
3179
+ const value = pair.value;
3180
+ if (key.status === "aborted" || value.status === "aborted") {
3181
+ return INVALID;
3182
+ }
3183
+ if (key.status === "dirty" || value.status === "dirty") {
3184
+ status.dirty();
3185
+ }
3186
+ finalMap.set(key.value, value.value);
3187
+ }
3188
+ return { status: status.value, value: finalMap };
3189
+ }
3190
+ }
3191
+ }
3192
+ ZodMap.create = (keyType, valueType, params) => {
3193
+ return new ZodMap({
3194
+ valueType,
3195
+ keyType,
3196
+ typeName: ZodFirstPartyTypeKind.ZodMap,
3197
+ ...processCreateParams(params),
3198
+ });
3199
+ };
3200
+ class ZodSet extends ZodType {
3201
+ _parse(input) {
3202
+ const { status, ctx } = this._processInputParams(input);
3203
+ if (ctx.parsedType !== ZodParsedType.set) {
3204
+ addIssueToContext(ctx, {
3205
+ code: ZodIssueCode.invalid_type,
3206
+ expected: ZodParsedType.set,
3207
+ received: ctx.parsedType,
3208
+ });
3209
+ return INVALID;
3210
+ }
3211
+ const def = this._def;
3212
+ if (def.minSize !== null) {
3213
+ if (ctx.data.size < def.minSize.value) {
3214
+ addIssueToContext(ctx, {
3215
+ code: ZodIssueCode.too_small,
3216
+ minimum: def.minSize.value,
3217
+ type: "set",
3218
+ inclusive: true,
3219
+ exact: false,
3220
+ message: def.minSize.message,
3221
+ });
3222
+ status.dirty();
3223
+ }
3224
+ }
3225
+ if (def.maxSize !== null) {
3226
+ if (ctx.data.size > def.maxSize.value) {
3227
+ addIssueToContext(ctx, {
3228
+ code: ZodIssueCode.too_big,
3229
+ maximum: def.maxSize.value,
3230
+ type: "set",
3231
+ inclusive: true,
3232
+ exact: false,
3233
+ message: def.maxSize.message,
3234
+ });
3235
+ status.dirty();
3236
+ }
3237
+ }
3238
+ const valueType = this._def.valueType;
3239
+ function finalizeSet(elements) {
3240
+ const parsedSet = new Set();
3241
+ for (const element of elements) {
3242
+ if (element.status === "aborted")
3243
+ return INVALID;
3244
+ if (element.status === "dirty")
3245
+ status.dirty();
3246
+ parsedSet.add(element.value);
3247
+ }
3248
+ return { status: status.value, value: parsedSet };
3249
+ }
3250
+ const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
3251
+ if (ctx.common.async) {
3252
+ return Promise.all(elements).then((elements) => finalizeSet(elements));
3253
+ }
3254
+ else {
3255
+ return finalizeSet(elements);
3256
+ }
3257
+ }
3258
+ min(minSize, message) {
3259
+ return new ZodSet({
3260
+ ...this._def,
3261
+ minSize: { value: minSize, message: errorUtil.toString(message) },
3262
+ });
3263
+ }
3264
+ max(maxSize, message) {
3265
+ return new ZodSet({
3266
+ ...this._def,
3267
+ maxSize: { value: maxSize, message: errorUtil.toString(message) },
3268
+ });
3269
+ }
3270
+ size(size, message) {
3271
+ return this.min(size, message).max(size, message);
3272
+ }
3273
+ nonempty(message) {
3274
+ return this.min(1, message);
3275
+ }
3276
+ }
3277
+ ZodSet.create = (valueType, params) => {
3278
+ return new ZodSet({
3279
+ valueType,
3280
+ minSize: null,
3281
+ maxSize: null,
3282
+ typeName: ZodFirstPartyTypeKind.ZodSet,
3283
+ ...processCreateParams(params),
3284
+ });
3285
+ };
3286
+ class ZodFunction extends ZodType {
3287
+ constructor() {
3288
+ super(...arguments);
3289
+ this.validate = this.implement;
3290
+ }
3291
+ _parse(input) {
3292
+ const { ctx } = this._processInputParams(input);
3293
+ if (ctx.parsedType !== ZodParsedType.function) {
3294
+ addIssueToContext(ctx, {
3295
+ code: ZodIssueCode.invalid_type,
3296
+ expected: ZodParsedType.function,
3297
+ received: ctx.parsedType,
3298
+ });
3299
+ return INVALID;
3300
+ }
3301
+ function makeArgsIssue(args, error) {
3302
+ return makeIssue({
3303
+ data: args,
3304
+ path: ctx.path,
3305
+ errorMaps: [
3306
+ ctx.common.contextualErrorMap,
3307
+ ctx.schemaErrorMap,
3308
+ getErrorMap(),
3309
+ errorMap,
3310
+ ].filter((x) => !!x),
3311
+ issueData: {
3312
+ code: ZodIssueCode.invalid_arguments,
3313
+ argumentsError: error,
3314
+ },
3315
+ });
3316
+ }
3317
+ function makeReturnsIssue(returns, error) {
3318
+ return makeIssue({
3319
+ data: returns,
3320
+ path: ctx.path,
3321
+ errorMaps: [
3322
+ ctx.common.contextualErrorMap,
3323
+ ctx.schemaErrorMap,
3324
+ getErrorMap(),
3325
+ errorMap,
3326
+ ].filter((x) => !!x),
3327
+ issueData: {
3328
+ code: ZodIssueCode.invalid_return_type,
3329
+ returnTypeError: error,
3330
+ },
3331
+ });
3332
+ }
3333
+ const params = { errorMap: ctx.common.contextualErrorMap };
3334
+ const fn = ctx.data;
3335
+ if (this._def.returns instanceof ZodPromise) {
3336
+ // Would love a way to avoid disabling this rule, but we need
3337
+ // an alias (using an arrow function was what caused 2651).
3338
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
3339
+ const me = this;
3340
+ return OK(async function (...args) {
3341
+ const error = new ZodError([]);
3342
+ const parsedArgs = await me._def.args
3343
+ .parseAsync(args, params)
3344
+ .catch((e) => {
3345
+ error.addIssue(makeArgsIssue(args, e));
3346
+ throw error;
3347
+ });
3348
+ const result = await Reflect.apply(fn, this, parsedArgs);
3349
+ const parsedReturns = await me._def.returns._def.type
3350
+ .parseAsync(result, params)
3351
+ .catch((e) => {
3352
+ error.addIssue(makeReturnsIssue(result, e));
3353
+ throw error;
3354
+ });
3355
+ return parsedReturns;
3356
+ });
3357
+ }
3358
+ else {
3359
+ // Would love a way to avoid disabling this rule, but we need
3360
+ // an alias (using an arrow function was what caused 2651).
3361
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
3362
+ const me = this;
3363
+ return OK(function (...args) {
3364
+ const parsedArgs = me._def.args.safeParse(args, params);
3365
+ if (!parsedArgs.success) {
3366
+ throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3367
+ }
3368
+ const result = Reflect.apply(fn, this, parsedArgs.data);
3369
+ const parsedReturns = me._def.returns.safeParse(result, params);
3370
+ if (!parsedReturns.success) {
3371
+ throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3372
+ }
3373
+ return parsedReturns.data;
3374
+ });
3375
+ }
3376
+ }
3377
+ parameters() {
3378
+ return this._def.args;
3379
+ }
3380
+ returnType() {
3381
+ return this._def.returns;
3382
+ }
3383
+ args(...items) {
3384
+ return new ZodFunction({
3385
+ ...this._def,
3386
+ args: ZodTuple.create(items).rest(ZodUnknown.create()),
3387
+ });
3388
+ }
3389
+ returns(returnType) {
3390
+ return new ZodFunction({
3391
+ ...this._def,
3392
+ returns: returnType,
3393
+ });
3394
+ }
3395
+ implement(func) {
3396
+ const validatedFunc = this.parse(func);
3397
+ return validatedFunc;
3398
+ }
3399
+ strictImplement(func) {
3400
+ const validatedFunc = this.parse(func);
3401
+ return validatedFunc;
3402
+ }
3403
+ static create(args, returns, params) {
3404
+ return new ZodFunction({
3405
+ args: (args
3406
+ ? args
3407
+ : ZodTuple.create([]).rest(ZodUnknown.create())),
3408
+ returns: returns || ZodUnknown.create(),
3409
+ typeName: ZodFirstPartyTypeKind.ZodFunction,
3410
+ ...processCreateParams(params),
3411
+ });
3412
+ }
3413
+ }
3414
+ class ZodLazy extends ZodType {
3415
+ get schema() {
3416
+ return this._def.getter();
3417
+ }
3418
+ _parse(input) {
3419
+ const { ctx } = this._processInputParams(input);
3420
+ const lazySchema = this._def.getter();
3421
+ return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
3422
+ }
3423
+ }
3424
+ ZodLazy.create = (getter, params) => {
3425
+ return new ZodLazy({
3426
+ getter: getter,
3427
+ typeName: ZodFirstPartyTypeKind.ZodLazy,
3428
+ ...processCreateParams(params),
3429
+ });
3430
+ };
3431
+ class ZodLiteral extends ZodType {
3432
+ _parse(input) {
3433
+ if (input.data !== this._def.value) {
3434
+ const ctx = this._getOrReturnCtx(input);
3435
+ addIssueToContext(ctx, {
3436
+ received: ctx.data,
3437
+ code: ZodIssueCode.invalid_literal,
3438
+ expected: this._def.value,
3439
+ });
3440
+ return INVALID;
3441
+ }
3442
+ return { status: "valid", value: input.data };
3443
+ }
3444
+ get value() {
3445
+ return this._def.value;
3446
+ }
3447
+ }
3448
+ ZodLiteral.create = (value, params) => {
3449
+ return new ZodLiteral({
3450
+ value: value,
3451
+ typeName: ZodFirstPartyTypeKind.ZodLiteral,
3452
+ ...processCreateParams(params),
3453
+ });
3454
+ };
3455
+ function createZodEnum(values, params) {
3456
+ return new ZodEnum({
3457
+ values,
3458
+ typeName: ZodFirstPartyTypeKind.ZodEnum,
3459
+ ...processCreateParams(params),
3460
+ });
3461
+ }
3462
+ class ZodEnum extends ZodType {
3463
+ constructor() {
3464
+ super(...arguments);
3465
+ _ZodEnum_cache.set(this, void 0);
3466
+ }
3467
+ _parse(input) {
3468
+ if (typeof input.data !== "string") {
3469
+ const ctx = this._getOrReturnCtx(input);
3470
+ const expectedValues = this._def.values;
3471
+ addIssueToContext(ctx, {
3472
+ expected: util.joinValues(expectedValues),
3473
+ received: ctx.parsedType,
3474
+ code: ZodIssueCode.invalid_type,
3475
+ });
3476
+ return INVALID;
3477
+ }
3478
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache)) {
3479
+ __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values));
3480
+ }
3481
+ if (!__classPrivateFieldGet(this, _ZodEnum_cache).has(input.data)) {
3482
+ const ctx = this._getOrReturnCtx(input);
3483
+ const expectedValues = this._def.values;
3484
+ addIssueToContext(ctx, {
3485
+ received: ctx.data,
3486
+ code: ZodIssueCode.invalid_enum_value,
3487
+ options: expectedValues,
3488
+ });
3489
+ return INVALID;
3490
+ }
3491
+ return OK(input.data);
3492
+ }
3493
+ get options() {
3494
+ return this._def.values;
3495
+ }
3496
+ get enum() {
3497
+ const enumValues = {};
3498
+ for (const val of this._def.values) {
3499
+ enumValues[val] = val;
3500
+ }
3501
+ return enumValues;
3502
+ }
3503
+ get Values() {
3504
+ const enumValues = {};
3505
+ for (const val of this._def.values) {
3506
+ enumValues[val] = val;
3507
+ }
3508
+ return enumValues;
3509
+ }
3510
+ get Enum() {
3511
+ const enumValues = {};
3512
+ for (const val of this._def.values) {
3513
+ enumValues[val] = val;
3514
+ }
3515
+ return enumValues;
3516
+ }
3517
+ extract(values, newDef = this._def) {
3518
+ return ZodEnum.create(values, {
3519
+ ...this._def,
3520
+ ...newDef,
3521
+ });
3522
+ }
3523
+ exclude(values, newDef = this._def) {
3524
+ return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
3525
+ ...this._def,
3526
+ ...newDef,
3527
+ });
3528
+ }
3529
+ }
3530
+ _ZodEnum_cache = new WeakMap();
3531
+ ZodEnum.create = createZodEnum;
3532
+ class ZodNativeEnum extends ZodType {
3533
+ constructor() {
3534
+ super(...arguments);
3535
+ _ZodNativeEnum_cache.set(this, void 0);
3536
+ }
3537
+ _parse(input) {
3538
+ const nativeEnumValues = util.getValidEnumValues(this._def.values);
3539
+ const ctx = this._getOrReturnCtx(input);
3540
+ if (ctx.parsedType !== ZodParsedType.string &&
3541
+ ctx.parsedType !== ZodParsedType.number) {
3542
+ const expectedValues = util.objectValues(nativeEnumValues);
3543
+ addIssueToContext(ctx, {
3544
+ expected: util.joinValues(expectedValues),
3545
+ received: ctx.parsedType,
3546
+ code: ZodIssueCode.invalid_type,
3547
+ });
3548
+ return INVALID;
3549
+ }
3550
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache)) {
3551
+ __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)));
3552
+ }
3553
+ if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache).has(input.data)) {
3554
+ const expectedValues = util.objectValues(nativeEnumValues);
3555
+ addIssueToContext(ctx, {
3556
+ received: ctx.data,
3557
+ code: ZodIssueCode.invalid_enum_value,
3558
+ options: expectedValues,
3559
+ });
3560
+ return INVALID;
3561
+ }
3562
+ return OK(input.data);
3563
+ }
3564
+ get enum() {
3565
+ return this._def.values;
3566
+ }
3567
+ }
3568
+ _ZodNativeEnum_cache = new WeakMap();
3569
+ ZodNativeEnum.create = (values, params) => {
3570
+ return new ZodNativeEnum({
3571
+ values: values,
3572
+ typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
3573
+ ...processCreateParams(params),
3574
+ });
3575
+ };
3576
+ class ZodPromise extends ZodType {
3577
+ unwrap() {
3578
+ return this._def.type;
3579
+ }
3580
+ _parse(input) {
3581
+ const { ctx } = this._processInputParams(input);
3582
+ if (ctx.parsedType !== ZodParsedType.promise &&
3583
+ ctx.common.async === false) {
3584
+ addIssueToContext(ctx, {
3585
+ code: ZodIssueCode.invalid_type,
3586
+ expected: ZodParsedType.promise,
3587
+ received: ctx.parsedType,
3588
+ });
3589
+ return INVALID;
3590
+ }
3591
+ const promisified = ctx.parsedType === ZodParsedType.promise
3592
+ ? ctx.data
3593
+ : Promise.resolve(ctx.data);
3594
+ return OK(promisified.then((data) => {
3595
+ return this._def.type.parseAsync(data, {
3596
+ path: ctx.path,
3597
+ errorMap: ctx.common.contextualErrorMap,
3598
+ });
3599
+ }));
3600
+ }
3601
+ }
3602
+ ZodPromise.create = (schema, params) => {
3603
+ return new ZodPromise({
3604
+ type: schema,
3605
+ typeName: ZodFirstPartyTypeKind.ZodPromise,
3606
+ ...processCreateParams(params),
3607
+ });
3608
+ };
3609
+ class ZodEffects extends ZodType {
3610
+ innerType() {
3611
+ return this._def.schema;
3612
+ }
3613
+ sourceType() {
3614
+ return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
3615
+ ? this._def.schema.sourceType()
3616
+ : this._def.schema;
3617
+ }
3618
+ _parse(input) {
3619
+ const { status, ctx } = this._processInputParams(input);
3620
+ const effect = this._def.effect || null;
3621
+ const checkCtx = {
3622
+ addIssue: (arg) => {
3623
+ addIssueToContext(ctx, arg);
3624
+ if (arg.fatal) {
3625
+ status.abort();
3626
+ }
3627
+ else {
3628
+ status.dirty();
3629
+ }
3630
+ },
3631
+ get path() {
3632
+ return ctx.path;
3633
+ },
3634
+ };
3635
+ checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
3636
+ if (effect.type === "preprocess") {
3637
+ const processed = effect.transform(ctx.data, checkCtx);
3638
+ if (ctx.common.async) {
3639
+ return Promise.resolve(processed).then(async (processed) => {
3640
+ if (status.value === "aborted")
3641
+ return INVALID;
3642
+ const result = await this._def.schema._parseAsync({
3643
+ data: processed,
3644
+ path: ctx.path,
3645
+ parent: ctx,
3646
+ });
3647
+ if (result.status === "aborted")
3648
+ return INVALID;
3649
+ if (result.status === "dirty")
3650
+ return DIRTY(result.value);
3651
+ if (status.value === "dirty")
3652
+ return DIRTY(result.value);
3653
+ return result;
3654
+ });
3655
+ }
3656
+ else {
3657
+ if (status.value === "aborted")
3658
+ return INVALID;
3659
+ const result = this._def.schema._parseSync({
3660
+ data: processed,
3661
+ path: ctx.path,
3662
+ parent: ctx,
3663
+ });
3664
+ if (result.status === "aborted")
3665
+ return INVALID;
3666
+ if (result.status === "dirty")
3667
+ return DIRTY(result.value);
3668
+ if (status.value === "dirty")
3669
+ return DIRTY(result.value);
3670
+ return result;
3671
+ }
3672
+ }
3673
+ if (effect.type === "refinement") {
3674
+ const executeRefinement = (acc) => {
3675
+ const result = effect.refinement(acc, checkCtx);
3676
+ if (ctx.common.async) {
3677
+ return Promise.resolve(result);
3678
+ }
3679
+ if (result instanceof Promise) {
3680
+ throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
3681
+ }
3682
+ return acc;
3683
+ };
3684
+ if (ctx.common.async === false) {
3685
+ const inner = this._def.schema._parseSync({
3686
+ data: ctx.data,
3687
+ path: ctx.path,
3688
+ parent: ctx,
3689
+ });
3690
+ if (inner.status === "aborted")
3691
+ return INVALID;
3692
+ if (inner.status === "dirty")
3693
+ status.dirty();
3694
+ // return value is ignored
3695
+ executeRefinement(inner.value);
3696
+ return { status: status.value, value: inner.value };
3697
+ }
3698
+ else {
3699
+ return this._def.schema
3700
+ ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
3701
+ .then((inner) => {
3702
+ if (inner.status === "aborted")
3703
+ return INVALID;
3704
+ if (inner.status === "dirty")
3705
+ status.dirty();
3706
+ return executeRefinement(inner.value).then(() => {
3707
+ return { status: status.value, value: inner.value };
3708
+ });
3709
+ });
3710
+ }
3711
+ }
3712
+ if (effect.type === "transform") {
3713
+ if (ctx.common.async === false) {
3714
+ const base = this._def.schema._parseSync({
3715
+ data: ctx.data,
3716
+ path: ctx.path,
3717
+ parent: ctx,
3718
+ });
3719
+ if (!isValid(base))
3720
+ return base;
3721
+ const result = effect.transform(base.value, checkCtx);
3722
+ if (result instanceof Promise) {
3723
+ throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
3724
+ }
3725
+ return { status: status.value, value: result };
3726
+ }
3727
+ else {
3728
+ return this._def.schema
3729
+ ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })
3730
+ .then((base) => {
3731
+ if (!isValid(base))
3732
+ return base;
3733
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
3734
+ });
3735
+ }
3736
+ }
3737
+ util.assertNever(effect);
3738
+ }
3739
+ }
3740
+ ZodEffects.create = (schema, effect, params) => {
3741
+ return new ZodEffects({
3742
+ schema,
3743
+ typeName: ZodFirstPartyTypeKind.ZodEffects,
3744
+ effect,
3745
+ ...processCreateParams(params),
3746
+ });
3747
+ };
3748
+ ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
3749
+ return new ZodEffects({
3750
+ schema,
3751
+ effect: { type: "preprocess", transform: preprocess },
3752
+ typeName: ZodFirstPartyTypeKind.ZodEffects,
3753
+ ...processCreateParams(params),
3754
+ });
3755
+ };
3756
+ class ZodOptional extends ZodType {
3757
+ _parse(input) {
3758
+ const parsedType = this._getType(input);
3759
+ if (parsedType === ZodParsedType.undefined) {
3760
+ return OK(undefined);
3761
+ }
3762
+ return this._def.innerType._parse(input);
3763
+ }
3764
+ unwrap() {
3765
+ return this._def.innerType;
3766
+ }
3767
+ }
3768
+ ZodOptional.create = (type, params) => {
3769
+ return new ZodOptional({
3770
+ innerType: type,
3771
+ typeName: ZodFirstPartyTypeKind.ZodOptional,
3772
+ ...processCreateParams(params),
3773
+ });
3774
+ };
3775
+ class ZodNullable extends ZodType {
3776
+ _parse(input) {
3777
+ const parsedType = this._getType(input);
3778
+ if (parsedType === ZodParsedType.null) {
3779
+ return OK(null);
3780
+ }
3781
+ return this._def.innerType._parse(input);
3782
+ }
3783
+ unwrap() {
3784
+ return this._def.innerType;
3785
+ }
3786
+ }
3787
+ ZodNullable.create = (type, params) => {
3788
+ return new ZodNullable({
3789
+ innerType: type,
3790
+ typeName: ZodFirstPartyTypeKind.ZodNullable,
3791
+ ...processCreateParams(params),
3792
+ });
3793
+ };
3794
+ class ZodDefault extends ZodType {
3795
+ _parse(input) {
3796
+ const { ctx } = this._processInputParams(input);
3797
+ let data = ctx.data;
3798
+ if (ctx.parsedType === ZodParsedType.undefined) {
3799
+ data = this._def.defaultValue();
3800
+ }
3801
+ return this._def.innerType._parse({
3802
+ data,
3803
+ path: ctx.path,
3804
+ parent: ctx,
3805
+ });
3806
+ }
3807
+ removeDefault() {
3808
+ return this._def.innerType;
3809
+ }
3810
+ }
3811
+ ZodDefault.create = (type, params) => {
3812
+ return new ZodDefault({
3813
+ innerType: type,
3814
+ typeName: ZodFirstPartyTypeKind.ZodDefault,
3815
+ defaultValue: typeof params.default === "function"
3816
+ ? params.default
3817
+ : () => params.default,
3818
+ ...processCreateParams(params),
3819
+ });
3820
+ };
3821
+ class ZodCatch extends ZodType {
3822
+ _parse(input) {
3823
+ const { ctx } = this._processInputParams(input);
3824
+ // newCtx is used to not collect issues from inner types in ctx
3825
+ const newCtx = {
3826
+ ...ctx,
3827
+ common: {
3828
+ ...ctx.common,
3829
+ issues: [],
3830
+ },
3831
+ };
3832
+ const result = this._def.innerType._parse({
3833
+ data: newCtx.data,
3834
+ path: newCtx.path,
3835
+ parent: {
3836
+ ...newCtx,
3837
+ },
3838
+ });
3839
+ if (isAsync(result)) {
3840
+ return result.then((result) => {
3841
+ return {
3842
+ status: "valid",
3843
+ value: result.status === "valid"
3844
+ ? result.value
3845
+ : this._def.catchValue({
3846
+ get error() {
3847
+ return new ZodError(newCtx.common.issues);
3848
+ },
3849
+ input: newCtx.data,
3850
+ }),
3851
+ };
3852
+ });
3853
+ }
3854
+ else {
3855
+ return {
3856
+ status: "valid",
3857
+ value: result.status === "valid"
3858
+ ? result.value
3859
+ : this._def.catchValue({
3860
+ get error() {
3861
+ return new ZodError(newCtx.common.issues);
3862
+ },
3863
+ input: newCtx.data,
3864
+ }),
3865
+ };
3866
+ }
3867
+ }
3868
+ removeCatch() {
3869
+ return this._def.innerType;
3870
+ }
3871
+ }
3872
+ ZodCatch.create = (type, params) => {
3873
+ return new ZodCatch({
3874
+ innerType: type,
3875
+ typeName: ZodFirstPartyTypeKind.ZodCatch,
3876
+ catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
3877
+ ...processCreateParams(params),
3878
+ });
3879
+ };
3880
+ class ZodNaN extends ZodType {
3881
+ _parse(input) {
3882
+ const parsedType = this._getType(input);
3883
+ if (parsedType !== ZodParsedType.nan) {
3884
+ const ctx = this._getOrReturnCtx(input);
3885
+ addIssueToContext(ctx, {
3886
+ code: ZodIssueCode.invalid_type,
3887
+ expected: ZodParsedType.nan,
3888
+ received: ctx.parsedType,
3889
+ });
3890
+ return INVALID;
3891
+ }
3892
+ return { status: "valid", value: input.data };
3893
+ }
3894
+ }
3895
+ ZodNaN.create = (params) => {
3896
+ return new ZodNaN({
3897
+ typeName: ZodFirstPartyTypeKind.ZodNaN,
3898
+ ...processCreateParams(params),
3899
+ });
3900
+ };
3901
+ const BRAND = Symbol("zod_brand");
3902
+ class ZodBranded extends ZodType {
3903
+ _parse(input) {
3904
+ const { ctx } = this._processInputParams(input);
3905
+ const data = ctx.data;
3906
+ return this._def.type._parse({
3907
+ data,
3908
+ path: ctx.path,
3909
+ parent: ctx,
3910
+ });
3911
+ }
3912
+ unwrap() {
3913
+ return this._def.type;
3914
+ }
3915
+ }
3916
+ class ZodPipeline extends ZodType {
3917
+ _parse(input) {
3918
+ const { status, ctx } = this._processInputParams(input);
3919
+ if (ctx.common.async) {
3920
+ const handleAsync = async () => {
3921
+ const inResult = await this._def.in._parseAsync({
3922
+ data: ctx.data,
3923
+ path: ctx.path,
3924
+ parent: ctx,
3925
+ });
3926
+ if (inResult.status === "aborted")
3927
+ return INVALID;
3928
+ if (inResult.status === "dirty") {
3929
+ status.dirty();
3930
+ return DIRTY(inResult.value);
3931
+ }
3932
+ else {
3933
+ return this._def.out._parseAsync({
3934
+ data: inResult.value,
3935
+ path: ctx.path,
3936
+ parent: ctx,
3937
+ });
3938
+ }
3939
+ };
3940
+ return handleAsync();
3941
+ }
3942
+ else {
3943
+ const inResult = this._def.in._parseSync({
3944
+ data: ctx.data,
3945
+ path: ctx.path,
3946
+ parent: ctx,
3947
+ });
3948
+ if (inResult.status === "aborted")
3949
+ return INVALID;
3950
+ if (inResult.status === "dirty") {
3951
+ status.dirty();
3952
+ return {
3953
+ status: "dirty",
3954
+ value: inResult.value,
3955
+ };
3956
+ }
3957
+ else {
3958
+ return this._def.out._parseSync({
3959
+ data: inResult.value,
3960
+ path: ctx.path,
3961
+ parent: ctx,
3962
+ });
3963
+ }
3964
+ }
3965
+ }
3966
+ static create(a, b) {
3967
+ return new ZodPipeline({
3968
+ in: a,
3969
+ out: b,
3970
+ typeName: ZodFirstPartyTypeKind.ZodPipeline,
3971
+ });
3972
+ }
3973
+ }
3974
+ class ZodReadonly extends ZodType {
3975
+ _parse(input) {
3976
+ const result = this._def.innerType._parse(input);
3977
+ const freeze = (data) => {
3978
+ if (isValid(data)) {
3979
+ data.value = Object.freeze(data.value);
3980
+ }
3981
+ return data;
3982
+ };
3983
+ return isAsync(result)
3984
+ ? result.then((data) => freeze(data))
3985
+ : freeze(result);
3986
+ }
3987
+ unwrap() {
3988
+ return this._def.innerType;
3989
+ }
3990
+ }
3991
+ ZodReadonly.create = (type, params) => {
3992
+ return new ZodReadonly({
3993
+ innerType: type,
3994
+ typeName: ZodFirstPartyTypeKind.ZodReadonly,
3995
+ ...processCreateParams(params),
3996
+ });
3997
+ };
3998
+ function custom(check, params = {},
3999
+ /**
4000
+ * @deprecated
4001
+ *
4002
+ * Pass `fatal` into the params object instead:
4003
+ *
4004
+ * ```ts
4005
+ * z.string().custom((val) => val.length > 5, { fatal: false })
4006
+ * ```
4007
+ *
4008
+ */
4009
+ fatal) {
4010
+ if (check)
4011
+ return ZodAny.create().superRefine((data, ctx) => {
4012
+ var _a, _b;
4013
+ if (!check(data)) {
4014
+ const p = typeof params === "function"
4015
+ ? params(data)
4016
+ : typeof params === "string"
4017
+ ? { message: params }
4018
+ : params;
4019
+ const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
4020
+ const p2 = typeof p === "string" ? { message: p } : p;
4021
+ ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
4022
+ }
4023
+ });
4024
+ return ZodAny.create();
4025
+ }
4026
+ const late = {
4027
+ object: ZodObject.lazycreate,
4028
+ };
4029
+ var ZodFirstPartyTypeKind;
4030
+ (function (ZodFirstPartyTypeKind) {
4031
+ ZodFirstPartyTypeKind["ZodString"] = "ZodString";
4032
+ ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
4033
+ ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
4034
+ ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
4035
+ ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
4036
+ ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
4037
+ ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
4038
+ ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
4039
+ ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
4040
+ ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
4041
+ ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
4042
+ ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
4043
+ ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
4044
+ ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
4045
+ ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
4046
+ ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
4047
+ ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
4048
+ ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
4049
+ ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
4050
+ ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
4051
+ ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
4052
+ ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
4053
+ ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
4054
+ ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
4055
+ ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
4056
+ ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
4057
+ ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
4058
+ ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
4059
+ ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
4060
+ ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
4061
+ ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
4062
+ ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
4063
+ ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
4064
+ ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
4065
+ ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
4066
+ ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
4067
+ })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
4068
+ const instanceOfType = (
4069
+ // const instanceOfType = <T extends new (...args: any[]) => any>(
4070
+ cls, params = {
4071
+ message: `Input not instance of ${cls.name}`,
4072
+ }) => custom((data) => data instanceof cls, params);
4073
+ const stringType = ZodString.create;
4074
+ const numberType = ZodNumber.create;
4075
+ const nanType = ZodNaN.create;
4076
+ const bigIntType = ZodBigInt.create;
4077
+ const booleanType = ZodBoolean.create;
4078
+ const dateType = ZodDate.create;
4079
+ const symbolType = ZodSymbol.create;
4080
+ const undefinedType = ZodUndefined.create;
4081
+ const nullType = ZodNull.create;
4082
+ const anyType = ZodAny.create;
4083
+ const unknownType = ZodUnknown.create;
4084
+ const neverType = ZodNever.create;
4085
+ const voidType = ZodVoid.create;
4086
+ const arrayType = ZodArray.create;
4087
+ const objectType = ZodObject.create;
4088
+ const strictObjectType = ZodObject.strictCreate;
4089
+ const unionType = ZodUnion.create;
4090
+ const discriminatedUnionType = ZodDiscriminatedUnion.create;
4091
+ const intersectionType = ZodIntersection.create;
4092
+ const tupleType = ZodTuple.create;
4093
+ const recordType = ZodRecord.create;
4094
+ const mapType = ZodMap.create;
4095
+ const setType = ZodSet.create;
4096
+ const functionType = ZodFunction.create;
4097
+ const lazyType = ZodLazy.create;
4098
+ const literalType = ZodLiteral.create;
4099
+ const enumType = ZodEnum.create;
4100
+ const nativeEnumType = ZodNativeEnum.create;
4101
+ const promiseType = ZodPromise.create;
4102
+ const effectsType = ZodEffects.create;
4103
+ const optionalType = ZodOptional.create;
4104
+ const nullableType = ZodNullable.create;
4105
+ const preprocessType = ZodEffects.createWithPreprocess;
4106
+ const pipelineType = ZodPipeline.create;
4107
+ const ostring = () => stringType().optional();
4108
+ const onumber = () => numberType().optional();
4109
+ const oboolean = () => booleanType().optional();
4110
+ const coerce = {
4111
+ string: ((arg) => ZodString.create({ ...arg, coerce: true })),
4112
+ number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
4113
+ boolean: ((arg) => ZodBoolean.create({
4114
+ ...arg,
4115
+ coerce: true,
4116
+ })),
4117
+ bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
4118
+ date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
4119
+ };
4120
+ const NEVER = INVALID;
4121
+
4122
+ var z = /*#__PURE__*/Object.freeze({
4123
+ __proto__: null,
4124
+ defaultErrorMap: errorMap,
4125
+ setErrorMap: setErrorMap,
4126
+ getErrorMap: getErrorMap,
4127
+ makeIssue: makeIssue,
4128
+ EMPTY_PATH: EMPTY_PATH,
4129
+ addIssueToContext: addIssueToContext,
4130
+ ParseStatus: ParseStatus,
4131
+ INVALID: INVALID,
4132
+ DIRTY: DIRTY,
4133
+ OK: OK,
4134
+ isAborted: isAborted,
4135
+ isDirty: isDirty,
4136
+ isValid: isValid,
4137
+ isAsync: isAsync,
4138
+ get util () { return util; },
4139
+ get objectUtil () { return objectUtil; },
4140
+ ZodParsedType: ZodParsedType,
4141
+ getParsedType: getParsedType,
4142
+ ZodType: ZodType,
4143
+ datetimeRegex: datetimeRegex,
4144
+ ZodString: ZodString,
4145
+ ZodNumber: ZodNumber,
4146
+ ZodBigInt: ZodBigInt,
4147
+ ZodBoolean: ZodBoolean,
4148
+ ZodDate: ZodDate,
4149
+ ZodSymbol: ZodSymbol,
4150
+ ZodUndefined: ZodUndefined,
4151
+ ZodNull: ZodNull,
4152
+ ZodAny: ZodAny,
4153
+ ZodUnknown: ZodUnknown,
4154
+ ZodNever: ZodNever,
4155
+ ZodVoid: ZodVoid,
4156
+ ZodArray: ZodArray,
4157
+ ZodObject: ZodObject,
4158
+ ZodUnion: ZodUnion,
4159
+ ZodDiscriminatedUnion: ZodDiscriminatedUnion,
4160
+ ZodIntersection: ZodIntersection,
4161
+ ZodTuple: ZodTuple,
4162
+ ZodRecord: ZodRecord,
4163
+ ZodMap: ZodMap,
4164
+ ZodSet: ZodSet,
4165
+ ZodFunction: ZodFunction,
4166
+ ZodLazy: ZodLazy,
4167
+ ZodLiteral: ZodLiteral,
4168
+ ZodEnum: ZodEnum,
4169
+ ZodNativeEnum: ZodNativeEnum,
4170
+ ZodPromise: ZodPromise,
4171
+ ZodEffects: ZodEffects,
4172
+ ZodTransformer: ZodEffects,
4173
+ ZodOptional: ZodOptional,
4174
+ ZodNullable: ZodNullable,
4175
+ ZodDefault: ZodDefault,
4176
+ ZodCatch: ZodCatch,
4177
+ ZodNaN: ZodNaN,
4178
+ BRAND: BRAND,
4179
+ ZodBranded: ZodBranded,
4180
+ ZodPipeline: ZodPipeline,
4181
+ ZodReadonly: ZodReadonly,
4182
+ custom: custom,
4183
+ Schema: ZodType,
4184
+ ZodSchema: ZodType,
4185
+ late: late,
4186
+ get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },
4187
+ coerce: coerce,
4188
+ any: anyType,
4189
+ array: arrayType,
4190
+ bigint: bigIntType,
4191
+ boolean: booleanType,
4192
+ date: dateType,
4193
+ discriminatedUnion: discriminatedUnionType,
4194
+ effect: effectsType,
4195
+ 'enum': enumType,
4196
+ 'function': functionType,
4197
+ 'instanceof': instanceOfType,
4198
+ intersection: intersectionType,
4199
+ lazy: lazyType,
4200
+ literal: literalType,
4201
+ map: mapType,
4202
+ nan: nanType,
4203
+ nativeEnum: nativeEnumType,
4204
+ never: neverType,
4205
+ 'null': nullType,
4206
+ nullable: nullableType,
4207
+ number: numberType,
4208
+ object: objectType,
4209
+ oboolean: oboolean,
4210
+ onumber: onumber,
4211
+ optional: optionalType,
4212
+ ostring: ostring,
4213
+ pipeline: pipelineType,
4214
+ preprocess: preprocessType,
4215
+ promise: promiseType,
4216
+ record: recordType,
4217
+ set: setType,
4218
+ strictObject: strictObjectType,
4219
+ string: stringType,
4220
+ symbol: symbolType,
4221
+ transformer: effectsType,
4222
+ tuple: tupleType,
4223
+ 'undefined': undefinedType,
4224
+ union: unionType,
4225
+ unknown: unknownType,
4226
+ 'void': voidType,
4227
+ NEVER: NEVER,
4228
+ ZodIssueCode: ZodIssueCode,
4229
+ quotelessJson: quotelessJson,
4230
+ ZodError: ZodError
4231
+ });
4232
+
4233
+ export { BRAND, DIRTY, EMPTY_PATH, INVALID, NEVER, OK, ParseStatus, ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodError, ZodFirstPartyTypeKind, ZodFunction, ZodIntersection, ZodIssueCode, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodParsedType, ZodPipeline, ZodPromise, ZodReadonly, ZodRecord, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, datetimeRegex, z as default, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, getErrorMap, getParsedType, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setType as set, setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void, z };