@psnext/slingcli 3.0.20260827-1 → 3.3.20260911-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (976) hide show
  1. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
  2. package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
  3. package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
  4. package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
  5. package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
  6. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
  7. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
  8. package/node_modules/@aws-sdk/core/package.json +1 -1
  9. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  10. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -4
  11. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +1 -0
  12. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -3
  13. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +8 -1
  14. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +2 -2
  15. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  16. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  17. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  18. package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +2 -0
  19. package/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js +2 -0
  20. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  21. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  22. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
  23. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  24. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  25. package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
  26. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  27. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  28. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  29. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  30. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  31. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -4
  32. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +1 -0
  33. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -3
  34. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +8 -1
  35. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +2 -2
  36. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  37. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-PBNSMEG7.js → chunk-VDBOM5UG.js} +9 -9
  38. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js +1 -1
  39. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
  40. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
  41. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +25 -8
  42. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
  43. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EventSource.md +4 -0
  44. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
  45. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
  46. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +33 -43
  47. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
  48. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +16 -2
  49. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +3 -0
  50. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +7 -2
  51. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
  52. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +9 -1
  53. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +221 -12
  54. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +76 -30
  55. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
  56. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
  57. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
  58. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +37 -8
  59. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
  60. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
  61. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
  62. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +106 -22
  63. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +29 -5
  64. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/decorator-handler.js +7 -1
  65. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
  66. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +21 -4
  67. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +155 -32
  68. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +65 -9
  69. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +115 -13
  70. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
  71. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +7 -0
  72. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dump.js +10 -23
  73. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +13 -1
  74. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-utils.js +217 -27
  75. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +43 -3
  76. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/parse.js +150 -147
  77. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
  78. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
  79. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +6 -0
  80. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +2 -3
  81. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +6 -1
  82. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +3 -3
  83. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +1 -1
  84. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  85. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  86. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +22 -0
  87. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +3 -3
  88. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +4 -4
  89. package/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
  90. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  91. package/node_modules/@smithy/core/dist-cjs/submodules/errors/index.js +20 -0
  92. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +11 -10
  93. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +11 -10
  94. package/node_modules/@smithy/core/dist-es/submodules/errors/errors.js +18 -0
  95. package/node_modules/@smithy/core/dist-es/submodules/errors/index.js +1 -0
  96. package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js +11 -10
  97. package/node_modules/@smithy/core/dist-types/submodules/errors/errors.d.ts +44 -0
  98. package/node_modules/@smithy/core/dist-types/submodules/errors/index.d.ts +1 -0
  99. package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
  100. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/errors.d.ts +44 -0
  101. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/index.d.ts +1 -0
  102. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
  103. package/node_modules/@smithy/core/errors.d.ts +5 -0
  104. package/node_modules/@smithy/core/errors.js +5 -0
  105. package/node_modules/@smithy/core/package.json +11 -2
  106. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +2 -1
  107. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +2 -1
  108. package/node_modules/@smithy/fetch-http-handler/package.json +3 -3
  109. package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +14 -0
  110. package/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +14 -0
  111. package/node_modules/@smithy/types/package.json +1 -1
  112. package/node_modules/@types/node/README.md +3 -3
  113. package/node_modules/@types/node/assert/strict.d.ts +56 -13
  114. package/node_modules/@types/node/assert.d.ts +190 -189
  115. package/node_modules/@types/node/async_hooks.d.ts +43 -151
  116. package/node_modules/@types/node/buffer.buffer.d.ts +13 -12
  117. package/node_modules/@types/node/buffer.d.ts +237 -102
  118. package/node_modules/@types/node/child_process.d.ts +154 -39
  119. package/node_modules/@types/node/cluster.d.ts +384 -238
  120. package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  121. package/node_modules/@types/node/compatibility/index.d.ts +9 -0
  122. package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  123. package/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
  124. package/node_modules/@types/node/console.d.ts +404 -45
  125. package/node_modules/@types/node/constants.d.ts +10 -3
  126. package/node_modules/@types/node/crypto.d.ts +1600 -1007
  127. package/node_modules/@types/node/dgram.d.ts +81 -133
  128. package/node_modules/@types/node/diagnostics_channel.d.ts +59 -277
  129. package/node_modules/@types/node/dns/promises.d.ts +15 -9
  130. package/node_modules/@types/node/dns.d.ts +183 -136
  131. package/node_modules/@types/node/domain.d.ts +32 -12
  132. package/node_modules/@types/node/events.d.ts +696 -728
  133. package/node_modules/@types/node/fs/promises.d.ts +85 -256
  134. package/node_modules/@types/node/fs.d.ts +525 -865
  135. package/node_modules/@types/node/globals.d.ts +34 -12
  136. package/node_modules/@types/node/globals.typedarray.d.ts +0 -63
  137. package/node_modules/@types/node/http.d.ts +311 -432
  138. package/node_modules/@types/node/http2.d.ts +891 -545
  139. package/node_modules/@types/node/https.d.ts +243 -64
  140. package/node_modules/@types/node/index.d.ts +7 -25
  141. package/node_modules/@types/node/inspector.d.ts +58 -70
  142. package/node_modules/@types/node/inspector.generated.d.ts +411 -765
  143. package/node_modules/@types/node/module.d.ts +219 -54
  144. package/node_modules/@types/node/net.d.ts +222 -208
  145. package/node_modules/@types/node/os.d.ts +49 -41
  146. package/node_modules/@types/node/package.json +3 -13
  147. package/node_modules/@types/node/path.d.ts +141 -119
  148. package/node_modules/@types/node/perf_hooks.d.ts +673 -310
  149. package/node_modules/@types/node/process.d.ts +205 -389
  150. package/node_modules/@types/node/punycode.d.ts +31 -3
  151. package/node_modules/@types/node/querystring.d.ts +16 -3
  152. package/node_modules/@types/node/readline/promises.d.ts +6 -3
  153. package/node_modules/@types/node/readline.d.ts +152 -66
  154. package/node_modules/@types/node/repl.d.ts +109 -101
  155. package/node_modules/@types/node/sea.d.ts +116 -1
  156. package/node_modules/@types/node/sqlite.d.ts +68 -486
  157. package/node_modules/@types/node/stream/consumers.d.ts +15 -91
  158. package/node_modules/@types/node/stream/promises.d.ts +15 -136
  159. package/node_modules/@types/node/stream/web.d.ts +456 -179
  160. package/node_modules/@types/node/stream.d.ts +491 -603
  161. package/node_modules/@types/node/string_decoder.d.ts +43 -3
  162. package/node_modules/@types/node/test.d.ts +292 -513
  163. package/node_modules/@types/node/timers/promises.d.ts +18 -3
  164. package/node_modules/@types/node/timers.d.ts +141 -3
  165. package/node_modules/@types/node/tls.d.ts +242 -140
  166. package/node_modules/@types/node/trace_events.d.ts +97 -3
  167. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +8 -7
  168. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
  169. package/node_modules/@types/node/ts5.6/index.d.ts +6 -26
  170. package/node_modules/@types/node/tty.d.ts +43 -61
  171. package/node_modules/@types/node/url.d.ts +584 -156
  172. package/node_modules/@types/node/util.d.ts +1110 -181
  173. package/node_modules/@types/node/v8.d.ts +36 -175
  174. package/node_modules/@types/node/vm.d.ts +209 -292
  175. package/node_modules/@types/node/wasi.d.ts +74 -24
  176. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
  177. package/node_modules/@types/node/web-globals/domexception.d.ts +0 -15
  178. package/node_modules/@types/node/web-globals/events.d.ts +0 -9
  179. package/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
  180. package/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
  181. package/node_modules/@types/node/web-globals/streams.d.ts +0 -93
  182. package/node_modules/@types/node/worker_threads.d.ts +407 -257
  183. package/node_modules/@types/node/zlib.d.ts +165 -7
  184. package/node_modules/express-rate-limit/dist/index.cjs +6 -3
  185. package/node_modules/express-rate-limit/dist/index.d.cts +11 -0
  186. package/node_modules/express-rate-limit/dist/index.d.mts +11 -0
  187. package/node_modules/express-rate-limit/dist/index.d.ts +11 -0
  188. package/node_modules/express-rate-limit/dist/index.mjs +6 -3
  189. package/node_modules/express-rate-limit/{license.md → license} +7 -6
  190. package/node_modules/express-rate-limit/package.json +5 -5
  191. package/node_modules/express-rate-limit/readme.md +1 -0
  192. package/node_modules/fast-uri/index.js +20 -5
  193. package/node_modules/fast-uri/lib/utils.js +8 -1
  194. package/node_modules/fast-uri/package.json +1 -1
  195. package/node_modules/fast-uri/test/component-safe-serialization.test.js +58 -0
  196. package/node_modules/fast-uri/test/ipv6-validation.test.js +34 -0
  197. package/node_modules/hono/dist/cjs/client/client.js +4 -4
  198. package/node_modules/hono/dist/cjs/hono-base.js +7 -6
  199. package/node_modules/hono/dist/cjs/jsx/base.js +18 -1
  200. package/node_modules/hono/dist/cjs/jsx/components.js +25 -26
  201. package/node_modules/hono/dist/cjs/jsx/context.js +5 -5
  202. package/node_modules/hono/dist/cjs/jsx/dom/server.js +5 -1
  203. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +2 -2
  204. package/node_modules/hono/dist/cjs/jsx/streaming.js +4 -5
  205. package/node_modules/hono/dist/client/client.js +4 -4
  206. package/node_modules/hono/dist/hono-base.js +7 -6
  207. package/node_modules/hono/dist/jsx/base.js +15 -1
  208. package/node_modules/hono/dist/jsx/components.js +26 -27
  209. package/node_modules/hono/dist/jsx/context.js +6 -6
  210. package/node_modules/hono/dist/jsx/dom/server.js +5 -1
  211. package/node_modules/hono/dist/jsx/intrinsic-element/components.js +3 -3
  212. package/node_modules/hono/dist/jsx/streaming.js +5 -6
  213. package/node_modules/hono/dist/types/context.d.ts +2 -2
  214. package/node_modules/hono/dist/types/jsx/base.d.ts +3 -0
  215. package/node_modules/hono/package.json +2 -2
  216. package/node_modules/ip-address/README.md +92 -82
  217. package/node_modules/ip-address/dist/common.d.ts +20 -0
  218. package/node_modules/ip-address/dist/common.js +36 -0
  219. package/node_modules/ip-address/dist/common.js.map +1 -1
  220. package/node_modules/ip-address/dist/ipv4.d.ts +50 -0
  221. package/node_modules/ip-address/dist/ipv4.js +75 -0
  222. package/node_modules/ip-address/dist/ipv4.js.map +1 -1
  223. package/node_modules/ip-address/dist/ipv6.d.ts +79 -10
  224. package/node_modules/ip-address/dist/ipv6.js +120 -30
  225. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  226. package/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
  227. package/node_modules/ip-address/dist/v4/constants.js +40 -1
  228. package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  229. package/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
  230. package/node_modules/ip-address/dist/v6/constants.js +47 -1
  231. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  232. package/node_modules/ip-address/package.json +1 -1
  233. package/node_modules/jose/dist/types/index.d.ts +1 -2
  234. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +12 -25
  235. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +18 -32
  236. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +12 -25
  237. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +24 -50
  238. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +15 -30
  239. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +29 -52
  240. package/node_modules/jose/dist/types/jwk/embedded.d.ts +5 -8
  241. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +7 -9
  242. package/node_modules/jose/dist/types/jwks/local.d.ts +10 -13
  243. package/node_modules/jose/dist/types/jwks/remote.d.ts +29 -41
  244. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +8 -13
  245. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +14 -26
  246. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +10 -19
  247. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +14 -26
  248. package/node_modules/jose/dist/types/jws/general/sign.d.ts +19 -33
  249. package/node_modules/jose/dist/types/jws/general/verify.d.ts +17 -32
  250. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +20 -27
  251. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +30 -35
  252. package/node_modules/jose/dist/types/jwt/sign.d.ts +8 -13
  253. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +10 -19
  254. package/node_modules/jose/dist/types/jwt/verify.d.ts +19 -22
  255. package/node_modules/jose/dist/types/key/export.d.ts +10 -10
  256. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +15 -22
  257. package/node_modules/jose/dist/types/key/generate_secret.d.ts +12 -19
  258. package/node_modules/jose/dist/types/key/import.d.ts +25 -31
  259. package/node_modules/jose/dist/types/types.d.ts +184 -319
  260. package/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
  261. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +5 -7
  262. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +6 -5
  263. package/node_modules/jose/dist/types/util/errors.d.ts +50 -88
  264. package/node_modules/jose/dist/webapi/index.js +70 -32
  265. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +6 -8
  266. package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +25 -48
  267. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -14
  268. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +34 -64
  269. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
  270. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +100 -172
  271. package/node_modules/jose/dist/webapi/jwk/embedded.js +29 -32
  272. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +51 -70
  273. package/node_modules/jose/dist/webapi/jwks/local.js +53 -64
  274. package/node_modules/jose/dist/webapi/jwks/remote.js +88 -136
  275. package/node_modules/jose/dist/webapi/jws/compact/sign.js +19 -21
  276. package/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
  277. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +22 -31
  278. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +11 -24
  279. package/node_modules/jose/dist/webapi/jws/general/sign.js +55 -73
  280. package/node_modules/jose/dist/webapi/jws/general/verify.js +43 -69
  281. package/node_modules/jose/dist/webapi/jwt/decrypt.js +12 -20
  282. package/node_modules/jose/dist/webapi/jwt/encrypt.js +43 -70
  283. package/node_modules/jose/dist/webapi/jwt/sign.js +17 -16
  284. package/node_modules/jose/dist/webapi/jwt/unsecured.js +31 -40
  285. package/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
  286. package/node_modules/jose/dist/webapi/key/export.js +32 -41
  287. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +32 -49
  288. package/node_modules/jose/dist/webapi/key/generate_secret.js +35 -40
  289. package/node_modules/jose/dist/webapi/key/import.js +48 -56
  290. package/node_modules/jose/dist/webapi/lib/asn1.js +128 -169
  291. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +72 -41
  292. package/node_modules/jose/dist/webapi/lib/content_encryption.js +75 -119
  293. package/node_modules/jose/dist/webapi/lib/deflate.js +35 -47
  294. package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +102 -93
  295. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +178 -234
  296. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +71 -138
  297. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
  298. package/node_modules/jose/dist/webapi/lib/jws_sign.js +43 -82
  299. package/node_modules/jose/dist/webapi/lib/jws_verify.js +78 -131
  300. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +123 -209
  301. package/node_modules/jose/dist/webapi/lib/key.js +147 -139
  302. package/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
  303. package/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
  304. package/node_modules/jose/dist/webapi/lib/key_management.js +169 -235
  305. package/node_modules/jose/dist/webapi/lib/validate.js +122 -0
  306. package/node_modules/jose/dist/webapi/util/base64url.js +14 -37
  307. package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
  308. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
  309. package/node_modules/jose/dist/webapi/util/errors.js +94 -84
  310. package/node_modules/jose/package.json +17 -81
  311. package/node_modules/protobufjs/dist/light/protobuf.js +59 -6
  312. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  313. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  314. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  315. package/node_modules/protobufjs/dist/minimal/protobuf.js +22 -2
  316. package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
  317. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  318. package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
  319. package/node_modules/protobufjs/dist/protobuf.js +59 -6
  320. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  321. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  322. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  323. package/node_modules/protobufjs/package.json +1 -1
  324. package/node_modules/protobufjs/src/decoder.js +32 -3
  325. package/node_modules/protobufjs/src/reader.js +20 -0
  326. package/node_modules/protobufjs/src/wrappers.js +5 -1
  327. package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
  328. package/node_modules/qs/CHANGELOG.md +15 -0
  329. package/node_modules/qs/README.md +19 -1
  330. package/node_modules/qs/dist/qs.js +21 -21
  331. package/node_modules/qs/eslint.config.mjs +1 -1
  332. package/node_modules/qs/lib/parse.js +3 -4
  333. package/node_modules/qs/lib/stringify.js +23 -8
  334. package/node_modules/qs/lib/utils.js +10 -3
  335. package/node_modules/qs/package.json +4 -4
  336. package/node_modules/qs/test/parse.js +192 -3
  337. package/node_modules/qs/test/stringify.js +317 -0
  338. package/node_modules/qs/test/utils.js +12 -0
  339. package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
  340. package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
  341. package/node_modules/undici/lib/dispatcher/client-h2.js +70 -14
  342. package/node_modules/undici/lib/dispatcher/client.js +6 -2
  343. package/node_modules/undici/lib/handler/cache-handler.js +21 -5
  344. package/node_modules/undici/lib/handler/retry-handler.js +42 -7
  345. package/node_modules/undici/lib/interceptor/cache.js +20 -1
  346. package/node_modules/undici/lib/interceptor/decompress.js +146 -14
  347. package/node_modules/undici/lib/interceptor/dump.js +10 -23
  348. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
  349. package/node_modules/undici/lib/web/websocket/connection.js +1 -1
  350. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  351. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  352. package/node_modules/undici/package.json +1 -1
  353. package/node_modules/undici/types/interceptors.d.ts +2 -0
  354. package/node_modules/undici-types/agent.d.ts +13 -12
  355. package/node_modules/undici-types/api.d.ts +26 -26
  356. package/node_modules/undici-types/balanced-pool.d.ts +12 -13
  357. package/node_modules/undici-types/client.d.ts +34 -55
  358. package/node_modules/undici-types/connector.d.ts +2 -4
  359. package/node_modules/undici-types/cookies.d.ts +0 -2
  360. package/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
  361. package/node_modules/undici-types/dispatcher.d.ts +137 -134
  362. package/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
  363. package/node_modules/undici-types/errors.d.ts +54 -82
  364. package/node_modules/undici-types/eventsource.d.ts +4 -9
  365. package/node_modules/undici-types/fetch.d.ts +24 -46
  366. package/node_modules/undici-types/file.d.ts +39 -0
  367. package/node_modules/undici-types/filereader.d.ts +54 -0
  368. package/node_modules/undici-types/formdata.d.ts +7 -7
  369. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  370. package/node_modules/undici-types/global-origin.d.ts +5 -5
  371. package/node_modules/undici-types/handlers.d.ts +9 -8
  372. package/node_modules/undici-types/header.d.ts +1 -162
  373. package/node_modules/undici-types/index.d.ts +47 -69
  374. package/node_modules/undici-types/interceptors.d.ts +9 -72
  375. package/node_modules/undici-types/mock-agent.d.ts +18 -36
  376. package/node_modules/undici-types/mock-client.d.ts +4 -6
  377. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  378. package/node_modules/undici-types/mock-interceptor.d.ts +20 -21
  379. package/node_modules/undici-types/mock-pool.d.ts +4 -6
  380. package/node_modules/undici-types/package.json +1 -1
  381. package/node_modules/undici-types/patch.d.ts +4 -0
  382. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  383. package/node_modules/undici-types/pool.d.ts +14 -14
  384. package/node_modules/undici-types/proxy-agent.d.ts +6 -7
  385. package/node_modules/undici-types/readable.d.ts +16 -19
  386. package/node_modules/undici-types/retry-agent.d.ts +1 -1
  387. package/node_modules/undici-types/retry-handler.d.ts +10 -19
  388. package/node_modules/undici-types/util.d.ts +3 -3
  389. package/node_modules/undici-types/webidl.d.ts +30 -148
  390. package/node_modules/undici-types/websocket.d.ts +10 -48
  391. package/node_modules/zod/README.md +27 -0
  392. package/node_modules/zod/compile.cjs +96 -0
  393. package/node_modules/zod/compile.d.cts +1 -0
  394. package/node_modules/zod/compile.d.ts +1 -0
  395. package/node_modules/zod/compile.js +52 -0
  396. package/node_modules/zod/index.cjs +21 -2
  397. package/node_modules/zod/index.d.cts +1 -2
  398. package/node_modules/zod/index.d.ts +1 -2
  399. package/node_modules/zod/index.js +5 -2
  400. package/node_modules/zod/locales/index.cjs +19 -0
  401. package/node_modules/zod/mini/index.cjs +19 -0
  402. package/node_modules/zod/package.json +20 -8
  403. package/node_modules/zod/src/compile.ts +56 -0
  404. package/node_modules/zod/src/index.ts +5 -2
  405. package/node_modules/zod/src/v3/ZodError.ts +22 -12
  406. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  407. package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
  408. package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
  409. package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
  410. package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
  411. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
  412. package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
  413. package/node_modules/zod/src/v3/types.ts +5 -5
  414. package/node_modules/zod/src/v4/classic/compat.ts +26 -18
  415. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  416. package/node_modules/zod/src/v4/classic/errors.ts +59 -44
  417. package/node_modules/zod/src/v4/classic/external.ts +14 -9
  418. package/node_modules/zod/src/v4/classic/from-json-schema.ts +363 -78
  419. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  420. package/node_modules/zod/src/v4/classic/index.ts +2 -2
  421. package/node_modules/zod/src/v4/classic/iso.ts +2 -72
  422. package/node_modules/zod/src/v4/classic/parse.ts +10 -4
  423. package/node_modules/zod/src/v4/classic/schemas.ts +652 -371
  424. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
  425. package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
  426. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +185 -0
  427. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
  428. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
  429. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
  430. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
  431. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +3 -3
  432. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  433. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +994 -0
  434. package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
  435. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
  436. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  437. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  438. package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
  439. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
  440. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +261 -13
  441. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
  442. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
  443. package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
  444. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +4 -0
  445. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +582 -10
  446. package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
  447. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
  448. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
  449. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  450. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  451. package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
  452. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +297 -0
  453. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +67 -0
  454. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
  455. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  456. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
  457. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
  458. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
  459. package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
  460. package/node_modules/zod/src/v4/classic/tests/number.test.ts +46 -9
  461. package/node_modules/zod/src/v4/classic/tests/object.test.ts +301 -12
  462. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  463. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
  464. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
  465. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  466. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
  467. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +225 -0
  468. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
  469. package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
  470. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +79 -3
  471. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  472. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
  473. package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
  474. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  475. package/node_modules/zod/src/v4/classic/tests/string.test.ts +152 -5
  476. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
  477. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +44 -3
  478. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1758 -202
  479. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
  480. package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
  481. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  482. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
  483. package/node_modules/zod/src/v4/core/api.ts +73 -13
  484. package/node_modules/zod/src/v4/core/checks.ts +58 -145
  485. package/node_modules/zod/src/v4/core/compile.ts +2302 -0
  486. package/node_modules/zod/src/v4/core/core.ts +98 -19
  487. package/node_modules/zod/src/v4/core/doc.ts +17 -9
  488. package/node_modules/zod/src/v4/core/errors.ts +113 -25
  489. package/node_modules/zod/src/v4/core/index.ts +3 -0
  490. package/node_modules/zod/src/v4/core/json-schema-generator.ts +8 -3
  491. package/node_modules/zod/src/v4/core/json-schema-processors.ts +468 -146
  492. package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
  493. package/node_modules/zod/src/v4/core/memoizer.ts +334 -0
  494. package/node_modules/zod/src/v4/core/parse.ts +164 -50
  495. package/node_modules/zod/src/v4/core/regexes.ts +38 -15
  496. package/node_modules/zod/src/v4/core/registries.ts +2 -2
  497. package/node_modules/zod/src/v4/core/schemas.ts +1073 -538
  498. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  499. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
  500. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  501. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  502. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  503. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  504. package/node_modules/zod/src/v4/core/tests/compile.test.ts +1859 -0
  505. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  506. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
  507. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
  508. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
  509. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  510. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  511. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  512. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  513. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  514. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
  515. package/node_modules/zod/src/v4/core/to-json-schema.ts +284 -49
  516. package/node_modules/zod/src/v4/core/util.ts +458 -157
  517. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  518. package/node_modules/zod/src/v4/core/visit.ts +204 -0
  519. package/node_modules/zod/src/v4/index.ts +3 -3
  520. package/node_modules/zod/src/v4/locales/ar.ts +4 -0
  521. package/node_modules/zod/src/v4/locales/az.ts +4 -0
  522. package/node_modules/zod/src/v4/locales/be.ts +11 -0
  523. package/node_modules/zod/src/v4/locales/bg.ts +4 -0
  524. package/node_modules/zod/src/v4/locales/bn.ts +122 -0
  525. package/node_modules/zod/src/v4/locales/ca.ts +4 -0
  526. package/node_modules/zod/src/v4/locales/ckb.ts +139 -0
  527. package/node_modules/zod/src/v4/locales/cs.ts +4 -0
  528. package/node_modules/zod/src/v4/locales/da.ts +6 -2
  529. package/node_modules/zod/src/v4/locales/de.ts +4 -0
  530. package/node_modules/zod/src/v4/locales/el.ts +2 -0
  531. package/node_modules/zod/src/v4/locales/en.ts +16 -4
  532. package/node_modules/zod/src/v4/locales/eo.ts +4 -0
  533. package/node_modules/zod/src/v4/locales/es.ts +3 -0
  534. package/node_modules/zod/src/v4/locales/fa.ts +4 -0
  535. package/node_modules/zod/src/v4/locales/fi.ts +4 -0
  536. package/node_modules/zod/src/v4/locales/fr-CA.ts +4 -0
  537. package/node_modules/zod/src/v4/locales/fr.ts +20 -14
  538. package/node_modules/zod/src/v4/locales/gu.ts +122 -0
  539. package/node_modules/zod/src/v4/locales/he.ts +7 -1
  540. package/node_modules/zod/src/v4/locales/hi.ts +125 -0
  541. package/node_modules/zod/src/v4/locales/hr.ts +3 -0
  542. package/node_modules/zod/src/v4/locales/hu.ts +4 -0
  543. package/node_modules/zod/src/v4/locales/hy.ts +10 -0
  544. package/node_modules/zod/src/v4/locales/id.ts +4 -0
  545. package/node_modules/zod/src/v4/locales/index.ts +11 -0
  546. package/node_modules/zod/src/v4/locales/is.ts +4 -0
  547. package/node_modules/zod/src/v4/locales/it.ts +4 -0
  548. package/node_modules/zod/src/v4/locales/ja.ts +4 -0
  549. package/node_modules/zod/src/v4/locales/ka.ts +4 -0
  550. package/node_modules/zod/src/v4/locales/km.ts +4 -0
  551. package/node_modules/zod/src/v4/locales/kn.ts +125 -0
  552. package/node_modules/zod/src/v4/locales/ko.ts +4 -0
  553. package/node_modules/zod/src/v4/locales/lt.ts +3 -0
  554. package/node_modules/zod/src/v4/locales/mk.ts +4 -0
  555. package/node_modules/zod/src/v4/locales/ms.ts +4 -0
  556. package/node_modules/zod/src/v4/locales/ne.ts +127 -0
  557. package/node_modules/zod/src/v4/locales/nl.ts +4 -0
  558. package/node_modules/zod/src/v4/locales/nn.ts +120 -0
  559. package/node_modules/zod/src/v4/locales/no.ts +6 -2
  560. package/node_modules/zod/src/v4/locales/ota.ts +4 -0
  561. package/node_modules/zod/src/v4/locales/pl.ts +4 -0
  562. package/node_modules/zod/src/v4/locales/ps.ts +4 -0
  563. package/node_modules/zod/src/v4/locales/pt-BR.ts +160 -0
  564. package/node_modules/zod/src/v4/locales/pt.ts +100 -58
  565. package/node_modules/zod/src/v4/locales/ro.ts +2 -0
  566. package/node_modules/zod/src/v4/locales/ru.ts +11 -0
  567. package/node_modules/zod/src/v4/locales/sk.ts +122 -0
  568. package/node_modules/zod/src/v4/locales/sl.ts +4 -0
  569. package/node_modules/zod/src/v4/locales/sv.ts +6 -2
  570. package/node_modules/zod/src/v4/locales/ta.ts +4 -0
  571. package/node_modules/zod/src/v4/locales/tg.ts +134 -0
  572. package/node_modules/zod/src/v4/locales/th.ts +4 -0
  573. package/node_modules/zod/src/v4/locales/tk.ts +112 -0
  574. package/node_modules/zod/src/v4/locales/tr.ts +4 -0
  575. package/node_modules/zod/src/v4/locales/uk.ts +4 -0
  576. package/node_modules/zod/src/v4/locales/ur.ts +4 -0
  577. package/node_modules/zod/src/v4/locales/uz.ts +2 -0
  578. package/node_modules/zod/src/v4/locales/vi.ts +4 -0
  579. package/node_modules/zod/src/v4/locales/yo.ts +4 -0
  580. package/node_modules/zod/src/v4/locales/zh-CN.ts +4 -0
  581. package/node_modules/zod/src/v4/locales/zh-TW.ts +4 -0
  582. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  583. package/node_modules/zod/src/v4/mini/external.ts +12 -1
  584. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  585. package/node_modules/zod/src/v4/mini/parse.ts +2 -0
  586. package/node_modules/zod/src/v4/mini/schemas.ts +174 -59
  587. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
  588. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
  589. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
  590. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
  591. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  592. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  593. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  594. package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
  595. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
  596. package/node_modules/zod/src/v4/mini/tests/index.test.ts +102 -5
  597. package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
  598. package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
  599. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  600. package/node_modules/zod/src/v4/mini/tests/string.test.ts +37 -0
  601. package/node_modules/zod/v3/ZodError.cjs +41 -12
  602. package/node_modules/zod/v3/ZodError.d.cts +1 -1
  603. package/node_modules/zod/v3/ZodError.d.ts +1 -1
  604. package/node_modules/zod/v3/ZodError.js +22 -12
  605. package/node_modules/zod/v3/errors.cjs +19 -0
  606. package/node_modules/zod/v3/external.cjs +19 -0
  607. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  608. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  609. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  610. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  611. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  612. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  613. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  614. package/node_modules/zod/v3/index.cjs +19 -0
  615. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  616. package/node_modules/zod/v3/types.cjs +26 -5
  617. package/node_modules/zod/v3/types.js +7 -5
  618. package/node_modules/zod/v4/classic/checks.cjs +19 -0
  619. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  620. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  621. package/node_modules/zod/v4/classic/compat.d.cts +9 -11
  622. package/node_modules/zod/v4/classic/compat.d.ts +9 -11
  623. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  624. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  625. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  626. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  627. package/node_modules/zod/v4/classic/errors.cjs +62 -34
  628. package/node_modules/zod/v4/classic/errors.d.cts +3 -4
  629. package/node_modules/zod/v4/classic/errors.d.ts +3 -4
  630. package/node_modules/zod/v4/classic/errors.js +43 -34
  631. package/node_modules/zod/v4/classic/external.cjs +51 -27
  632. package/node_modules/zod/v4/classic/external.d.cts +5 -2
  633. package/node_modules/zod/v4/classic/external.d.ts +5 -2
  634. package/node_modules/zod/v4/classic/external.js +5 -8
  635. package/node_modules/zod/v4/classic/from-json-schema.cjs +376 -75
  636. package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
  637. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  638. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  639. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  640. package/node_modules/zod/v4/classic/in-out.js +36 -0
  641. package/node_modules/zod/v4/classic/index.cjs +21 -2
  642. package/node_modules/zod/v4/classic/index.d.cts +1 -2
  643. package/node_modules/zod/v4/classic/index.d.ts +1 -2
  644. package/node_modules/zod/v4/classic/index.js +2 -2
  645. package/node_modules/zod/v4/classic/iso.cjs +30 -22
  646. package/node_modules/zod/v4/classic/iso.d.cts +2 -17
  647. package/node_modules/zod/v4/classic/iso.d.ts +2 -17
  648. package/node_modules/zod/v4/classic/iso.js +2 -17
  649. package/node_modules/zod/v4/classic/parse.cjs +23 -1
  650. package/node_modules/zod/v4/classic/parse.d.cts +17 -4
  651. package/node_modules/zod/v4/classic/parse.d.ts +17 -4
  652. package/node_modules/zod/v4/classic/parse.js +1 -0
  653. package/node_modules/zod/v4/classic/schemas.cjs +591 -422
  654. package/node_modules/zod/v4/classic/schemas.d.cts +70 -19
  655. package/node_modules/zod/v4/classic/schemas.d.ts +70 -19
  656. package/node_modules/zod/v4/classic/schemas.js +564 -420
  657. package/node_modules/zod/v4/core/api.cjs +58 -4
  658. package/node_modules/zod/v4/core/api.d.cts +16 -10
  659. package/node_modules/zod/v4/core/api.d.ts +16 -10
  660. package/node_modules/zod/v4/core/api.js +36 -4
  661. package/node_modules/zod/v4/core/checks.cjs +56 -127
  662. package/node_modules/zod/v4/core/checks.d.cts +13 -13
  663. package/node_modules/zod/v4/core/checks.d.ts +13 -13
  664. package/node_modules/zod/v4/core/checks.js +37 -127
  665. package/node_modules/zod/v4/core/compile.cjs +1913 -0
  666. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  667. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  668. package/node_modules/zod/v4/core/compile.js +1863 -0
  669. package/node_modules/zod/v4/core/core.cjs +100 -18
  670. package/node_modules/zod/v4/core/core.d.cts +16 -4
  671. package/node_modules/zod/v4/core/core.d.ts +16 -4
  672. package/node_modules/zod/v4/core/core.js +82 -19
  673. package/node_modules/zod/v4/core/doc.cjs +31 -9
  674. package/node_modules/zod/v4/core/doc.d.cts +3 -1
  675. package/node_modules/zod/v4/core/doc.d.ts +3 -1
  676. package/node_modules/zod/v4/core/doc.js +12 -9
  677. package/node_modules/zod/v4/core/errors.cjs +126 -25
  678. package/node_modules/zod/v4/core/errors.d.cts +4 -0
  679. package/node_modules/zod/v4/core/errors.d.ts +4 -0
  680. package/node_modules/zod/v4/core/errors.js +107 -25
  681. package/node_modules/zod/v4/core/index.cjs +24 -1
  682. package/node_modules/zod/v4/core/index.d.cts +3 -0
  683. package/node_modules/zod/v4/core/index.d.ts +3 -0
  684. package/node_modules/zod/v4/core/index.js +3 -0
  685. package/node_modules/zod/v4/core/json-schema-generator.cjs +24 -1
  686. package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
  687. package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
  688. package/node_modules/zod/v4/core/json-schema-generator.js +6 -2
  689. package/node_modules/zod/v4/core/json-schema-processors.cjs +470 -149
  690. package/node_modules/zod/v4/core/json-schema-processors.d.cts +17 -0
  691. package/node_modules/zod/v4/core/json-schema-processors.d.ts +17 -0
  692. package/node_modules/zod/v4/core/json-schema-processors.js +427 -150
  693. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  694. package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
  695. package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
  696. package/node_modules/zod/v4/core/memoizer.cjs +363 -0
  697. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  698. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  699. package/node_modules/zod/v4/core/memoizer.js +314 -0
  700. package/node_modules/zod/v4/core/parse.cjs +148 -46
  701. package/node_modules/zod/v4/core/parse.d.cts +14 -11
  702. package/node_modules/zod/v4/core/parse.d.ts +14 -11
  703. package/node_modules/zod/v4/core/parse.js +127 -45
  704. package/node_modules/zod/v4/core/regexes.cjs +52 -17
  705. package/node_modules/zod/v4/core/regexes.d.cts +4 -0
  706. package/node_modules/zod/v4/core/regexes.d.ts +4 -0
  707. package/node_modules/zod/v4/core/regexes.js +30 -15
  708. package/node_modules/zod/v4/core/registries.cjs +19 -0
  709. package/node_modules/zod/v4/core/registries.js +2 -2
  710. package/node_modules/zod/v4/core/schemas.cjs +826 -387
  711. package/node_modules/zod/v4/core/schemas.d.cts +140 -36
  712. package/node_modules/zod/v4/core/schemas.d.ts +140 -36
  713. package/node_modules/zod/v4/core/schemas.js +796 -387
  714. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  715. package/node_modules/zod/v4/core/to-json-schema.cjs +270 -45
  716. package/node_modules/zod/v4/core/to-json-schema.d.cts +48 -5
  717. package/node_modules/zod/v4/core/to-json-schema.d.ts +48 -5
  718. package/node_modules/zod/v4/core/to-json-schema.js +248 -45
  719. package/node_modules/zod/v4/core/util.cjs +376 -157
  720. package/node_modules/zod/v4/core/util.d.cts +79 -1
  721. package/node_modules/zod/v4/core/util.d.ts +79 -1
  722. package/node_modules/zod/v4/core/util.js +345 -156
  723. package/node_modules/zod/v4/core/versions.cjs +21 -2
  724. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  725. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  726. package/node_modules/zod/v4/core/versions.js +2 -2
  727. package/node_modules/zod/v4/core/visit.cjs +226 -0
  728. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  729. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  730. package/node_modules/zod/v4/core/visit.js +181 -0
  731. package/node_modules/zod/v4/index.cjs +34 -5
  732. package/node_modules/zod/v4/index.d.cts +2 -2
  733. package/node_modules/zod/v4/index.d.ts +2 -2
  734. package/node_modules/zod/v4/index.js +3 -2
  735. package/node_modules/zod/v4/locales/ar.cjs +4 -0
  736. package/node_modules/zod/v4/locales/ar.js +4 -0
  737. package/node_modules/zod/v4/locales/az.cjs +4 -0
  738. package/node_modules/zod/v4/locales/az.js +4 -0
  739. package/node_modules/zod/v4/locales/be.cjs +11 -0
  740. package/node_modules/zod/v4/locales/be.js +11 -0
  741. package/node_modules/zod/v4/locales/bg.cjs +4 -0
  742. package/node_modules/zod/v4/locales/bg.js +4 -0
  743. package/node_modules/zod/v4/locales/bn.cjs +139 -0
  744. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  745. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  746. package/node_modules/zod/v4/locales/bn.js +112 -0
  747. package/node_modules/zod/v4/locales/ca.cjs +4 -0
  748. package/node_modules/zod/v4/locales/ca.js +4 -0
  749. package/node_modules/zod/v4/locales/ckb.cjs +159 -0
  750. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  751. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  752. package/node_modules/zod/v4/locales/ckb.js +132 -0
  753. package/node_modules/zod/v4/locales/cs.cjs +4 -0
  754. package/node_modules/zod/v4/locales/cs.js +4 -0
  755. package/node_modules/zod/v4/locales/da.cjs +6 -2
  756. package/node_modules/zod/v4/locales/da.js +6 -2
  757. package/node_modules/zod/v4/locales/de.cjs +4 -0
  758. package/node_modules/zod/v4/locales/de.js +4 -0
  759. package/node_modules/zod/v4/locales/el.cjs +2 -0
  760. package/node_modules/zod/v4/locales/el.js +2 -0
  761. package/node_modules/zod/v4/locales/en.cjs +15 -4
  762. package/node_modules/zod/v4/locales/en.js +15 -4
  763. package/node_modules/zod/v4/locales/eo.cjs +4 -0
  764. package/node_modules/zod/v4/locales/eo.js +4 -0
  765. package/node_modules/zod/v4/locales/es.cjs +3 -0
  766. package/node_modules/zod/v4/locales/es.js +3 -0
  767. package/node_modules/zod/v4/locales/fa.cjs +4 -0
  768. package/node_modules/zod/v4/locales/fa.js +4 -0
  769. package/node_modules/zod/v4/locales/fi.cjs +4 -0
  770. package/node_modules/zod/v4/locales/fi.js +4 -0
  771. package/node_modules/zod/v4/locales/fr-CA.cjs +4 -0
  772. package/node_modules/zod/v4/locales/fr-CA.js +4 -0
  773. package/node_modules/zod/v4/locales/fr.cjs +17 -14
  774. package/node_modules/zod/v4/locales/fr.js +17 -14
  775. package/node_modules/zod/v4/locales/gu.cjs +139 -0
  776. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  777. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  778. package/node_modules/zod/v4/locales/gu.js +112 -0
  779. package/node_modules/zod/v4/locales/he.cjs +6 -0
  780. package/node_modules/zod/v4/locales/he.js +6 -0
  781. package/node_modules/zod/v4/locales/hi.cjs +137 -0
  782. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  783. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  784. package/node_modules/zod/v4/locales/hi.js +110 -0
  785. package/node_modules/zod/v4/locales/hr.cjs +3 -0
  786. package/node_modules/zod/v4/locales/hr.js +3 -0
  787. package/node_modules/zod/v4/locales/hu.cjs +4 -0
  788. package/node_modules/zod/v4/locales/hu.js +4 -0
  789. package/node_modules/zod/v4/locales/hy.cjs +10 -0
  790. package/node_modules/zod/v4/locales/hy.js +10 -0
  791. package/node_modules/zod/v4/locales/id.cjs +4 -0
  792. package/node_modules/zod/v4/locales/id.js +4 -0
  793. package/node_modules/zod/v4/locales/index.cjs +43 -2
  794. package/node_modules/zod/v4/locales/index.d.cts +11 -0
  795. package/node_modules/zod/v4/locales/index.d.ts +11 -0
  796. package/node_modules/zod/v4/locales/index.js +11 -0
  797. package/node_modules/zod/v4/locales/is.cjs +4 -0
  798. package/node_modules/zod/v4/locales/is.js +4 -0
  799. package/node_modules/zod/v4/locales/it.cjs +4 -0
  800. package/node_modules/zod/v4/locales/it.js +4 -0
  801. package/node_modules/zod/v4/locales/ja.cjs +4 -0
  802. package/node_modules/zod/v4/locales/ja.js +4 -0
  803. package/node_modules/zod/v4/locales/ka.cjs +4 -0
  804. package/node_modules/zod/v4/locales/ka.js +4 -0
  805. package/node_modules/zod/v4/locales/km.cjs +4 -0
  806. package/node_modules/zod/v4/locales/km.js +4 -0
  807. package/node_modules/zod/v4/locales/kn.cjs +142 -0
  808. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  809. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  810. package/node_modules/zod/v4/locales/kn.js +115 -0
  811. package/node_modules/zod/v4/locales/ko.cjs +4 -0
  812. package/node_modules/zod/v4/locales/ko.js +4 -0
  813. package/node_modules/zod/v4/locales/lt.cjs +3 -0
  814. package/node_modules/zod/v4/locales/lt.js +3 -0
  815. package/node_modules/zod/v4/locales/mk.cjs +4 -0
  816. package/node_modules/zod/v4/locales/mk.js +4 -0
  817. package/node_modules/zod/v4/locales/ms.cjs +4 -0
  818. package/node_modules/zod/v4/locales/ms.js +4 -0
  819. package/node_modules/zod/v4/locales/ne.cjs +137 -0
  820. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  821. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  822. package/node_modules/zod/v4/locales/ne.js +110 -0
  823. package/node_modules/zod/v4/locales/nl.cjs +4 -0
  824. package/node_modules/zod/v4/locales/nl.js +4 -0
  825. package/node_modules/zod/v4/locales/nn.cjs +139 -0
  826. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  827. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  828. package/node_modules/zod/v4/locales/nn.js +112 -0
  829. package/node_modules/zod/v4/locales/no.cjs +6 -2
  830. package/node_modules/zod/v4/locales/no.js +6 -2
  831. package/node_modules/zod/v4/locales/ota.cjs +4 -0
  832. package/node_modules/zod/v4/locales/ota.js +4 -0
  833. package/node_modules/zod/v4/locales/pl.cjs +4 -0
  834. package/node_modules/zod/v4/locales/pl.js +4 -0
  835. package/node_modules/zod/v4/locales/ps.cjs +4 -0
  836. package/node_modules/zod/v4/locales/ps.js +4 -0
  837. package/node_modules/zod/v4/locales/pt-BR.cjs +169 -0
  838. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  839. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  840. package/node_modules/zod/v4/locales/pt-BR.js +142 -0
  841. package/node_modules/zod/v4/locales/pt.cjs +88 -55
  842. package/node_modules/zod/v4/locales/pt.js +88 -55
  843. package/node_modules/zod/v4/locales/ro.cjs +2 -0
  844. package/node_modules/zod/v4/locales/ro.js +2 -0
  845. package/node_modules/zod/v4/locales/ru.cjs +11 -0
  846. package/node_modules/zod/v4/locales/ru.js +11 -0
  847. package/node_modules/zod/v4/locales/sk.cjs +142 -0
  848. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  849. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  850. package/node_modules/zod/v4/locales/sk.js +115 -0
  851. package/node_modules/zod/v4/locales/sl.cjs +4 -0
  852. package/node_modules/zod/v4/locales/sl.js +4 -0
  853. package/node_modules/zod/v4/locales/sv.cjs +6 -2
  854. package/node_modules/zod/v4/locales/sv.js +6 -2
  855. package/node_modules/zod/v4/locales/ta.cjs +4 -0
  856. package/node_modules/zod/v4/locales/ta.js +4 -0
  857. package/node_modules/zod/v4/locales/tg.cjs +143 -0
  858. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  859. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  860. package/node_modules/zod/v4/locales/tg.js +116 -0
  861. package/node_modules/zod/v4/locales/th.cjs +4 -0
  862. package/node_modules/zod/v4/locales/th.js +4 -0
  863. package/node_modules/zod/v4/locales/tk.cjs +133 -0
  864. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  865. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  866. package/node_modules/zod/v4/locales/tk.js +106 -0
  867. package/node_modules/zod/v4/locales/tr.cjs +4 -0
  868. package/node_modules/zod/v4/locales/tr.js +4 -0
  869. package/node_modules/zod/v4/locales/uk.cjs +4 -0
  870. package/node_modules/zod/v4/locales/uk.js +4 -0
  871. package/node_modules/zod/v4/locales/ur.cjs +4 -0
  872. package/node_modules/zod/v4/locales/ur.js +4 -0
  873. package/node_modules/zod/v4/locales/uz.cjs +2 -0
  874. package/node_modules/zod/v4/locales/uz.js +2 -0
  875. package/node_modules/zod/v4/locales/vi.cjs +4 -0
  876. package/node_modules/zod/v4/locales/vi.js +4 -0
  877. package/node_modules/zod/v4/locales/yo.cjs +4 -0
  878. package/node_modules/zod/v4/locales/yo.js +4 -0
  879. package/node_modules/zod/v4/locales/zh-CN.cjs +4 -0
  880. package/node_modules/zod/v4/locales/zh-CN.js +4 -0
  881. package/node_modules/zod/v4/locales/zh-TW.cjs +4 -0
  882. package/node_modules/zod/v4/locales/zh-TW.js +4 -0
  883. package/node_modules/zod/v4/mini/checks.cjs +19 -0
  884. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  885. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  886. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  887. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  888. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  889. package/node_modules/zod/v4/mini/external.cjs +33 -1
  890. package/node_modules/zod/v4/mini/external.d.cts +5 -2
  891. package/node_modules/zod/v4/mini/external.d.ts +5 -2
  892. package/node_modules/zod/v4/mini/external.js +3 -1
  893. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  894. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  895. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  896. package/node_modules/zod/v4/mini/in-out.js +36 -0
  897. package/node_modules/zod/v4/mini/index.cjs +19 -0
  898. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  899. package/node_modules/zod/v4/mini/parse.cjs +22 -1
  900. package/node_modules/zod/v4/mini/parse.d.cts +1 -1
  901. package/node_modules/zod/v4/mini/parse.d.ts +1 -1
  902. package/node_modules/zod/v4/mini/parse.js +1 -1
  903. package/node_modules/zod/v4/mini/schemas.cjs +115 -49
  904. package/node_modules/zod/v4/mini/schemas.d.cts +52 -14
  905. package/node_modules/zod/v4/mini/schemas.d.ts +52 -14
  906. package/node_modules/zod/v4/mini/schemas.js +90 -47
  907. package/node_modules/zod/v4-mini/index.cjs +19 -0
  908. package/package.json +3 -2
  909. package/skills/context-management/SKILL.md +258 -0
  910. package/skills/figma-implement-design/SKILL.md +258 -0
  911. package/skills/orchestrator/SKILL.md +82 -0
  912. package/skills/s-help/SKILL.md +42 -0
  913. package/skills/s-help/resources/README.md +23 -0
  914. package/skills/s-help/resources/commands.json +78 -0
  915. package/skills/s-help/resources/s-acm.md +26 -0
  916. package/skills/s-help/resources/s-bash-mode.md +23 -0
  917. package/skills/s-help/resources/s-bash-reset.md +23 -0
  918. package/skills/s-help/resources/s-context.md +25 -0
  919. package/skills/s-help/resources/s-filechanges-accept.md +25 -0
  920. package/skills/s-help/resources/s-filechanges-decline.md +30 -0
  921. package/skills/s-help/resources/s-filechanges.md +38 -0
  922. package/skills/s-help/resources/s-footer.md +38 -0
  923. package/skills/s-help/resources/s-promptlib.md +28 -0
  924. package/skills/s-help/resources/s-skills-manager.md +31 -0
  925. package/skills/s-help/resources/s-stash-history.md +26 -0
  926. package/skills/screenshot/SKILL.md +267 -0
  927. package/skills/screenshot/scripts/ensure_macos_permissions.sh +54 -0
  928. package/skills/screenshot/scripts/macos_display_info.swift +22 -0
  929. package/skills/screenshot/scripts/macos_permissions.swift +40 -0
  930. package/skills/screenshot/scripts/macos_window_info.swift +126 -0
  931. package/skills/screenshot/scripts/take_screenshot.ps1 +163 -0
  932. package/skills/screenshot/scripts/take_screenshot.py +585 -0
  933. package/slingshot/index.js +232 -230
  934. package/node_modules/@types/node/ffi.d.ts +0 -486
  935. package/node_modules/@types/node/inspector/promises.d.ts +0 -35
  936. package/node_modules/@types/node/path/posix.d.ts +0 -8
  937. package/node_modules/@types/node/path/win32.d.ts +0 -8
  938. package/node_modules/@types/node/quic.d.ts +0 -2151
  939. package/node_modules/@types/node/stream/iter.d.ts +0 -452
  940. package/node_modules/@types/node/test/reporters.d.ts +0 -59
  941. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  942. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  943. package/node_modules/@types/node/ts5.7/index.d.ts +0 -118
  944. package/node_modules/@types/node/util/types.d.ts +0 -558
  945. package/node_modules/@types/node/vfs.d.ts +0 -210
  946. package/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  947. package/node_modules/@types/node/web-globals/console.d.ts +0 -9
  948. package/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  949. package/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  950. package/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  951. package/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  952. package/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  953. package/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  954. package/node_modules/@types/node/web-globals/url.d.ts +0 -24
  955. package/node_modules/@types/node/zlib/iter.d.ts +0 -131
  956. package/node_modules/jose/dist/webapi/lib/base64.js +0 -22
  957. package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -28
  958. package/node_modules/jose/dist/webapi/lib/helpers.js +0 -42
  959. package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -26
  960. package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -17
  961. package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -20
  962. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -17
  963. package/node_modules/jose/dist/webapi/lib/key_options.js +0 -6
  964. package/node_modules/jose/dist/webapi/lib/options.js +0 -74
  965. package/node_modules/jose/dist/webapi/lib/signing.js +0 -26
  966. package/node_modules/jose/dist/webapi/lib/type_checks.js +0 -33
  967. package/node_modules/undici-types/cache-interceptor.d.ts +0 -179
  968. package/node_modules/undici-types/client-stats.d.ts +0 -15
  969. package/node_modules/undici-types/dispatcher1-wrapper.d.ts +0 -7
  970. package/node_modules/undici-types/h2c-client.d.ts +0 -73
  971. package/node_modules/undici-types/mock-call-history.d.ts +0 -111
  972. package/node_modules/undici-types/round-robin-pool.d.ts +0 -39
  973. package/node_modules/undici-types/snapshot-agent.d.ts +0 -113
  974. package/node_modules/undici-types/socks5-proxy-agent.d.ts +0 -25
  975. package/node_modules/undici-types/utility.d.ts +0 -7
  976. package/node_modules/zod/src/v4/core/config.ts +0 -15
@@ -1,7 +1,7 @@
1
1
  import * as checks from "./checks.js";
2
2
  import * as core from "./core.js";
3
3
  import { Doc } from "./doc.js";
4
- import { parse, parseAsync, safeParse, safeParseAsync } from "./parse.js";
4
+ import { parse, parseAsync } from "./parse.js";
5
5
  import * as regexes from "./regexes.js";
6
6
  import * as util from "./util.js";
7
7
  import { version } from "./versions.js";
@@ -11,19 +11,20 @@ export const $ZodType = /*@__PURE__*/ core.$constructor("$ZodType", (inst, def)
11
11
  inst._zod.def = def; // set _def property
12
12
  inst._zod.bag = inst._zod.bag || {}; // initialize _bag object
13
13
  inst._zod.version = version;
14
- const checks = [...(inst._zod.def.checks ?? [])];
14
+ const defChecks = inst._zod.def.checks;
15
15
  // if inst is itself a checks.$ZodCheck, run it as a check
16
- if (inst._zod.traits.has("$ZodCheck")) {
17
- checks.unshift(inst);
18
- }
16
+ const checks = inst._zod.traits.has("$ZodCheck")
17
+ ? [inst, ...(defChecks ?? [])]
18
+ : defChecks?.length
19
+ ? [...defChecks]
20
+ : [];
19
21
  for (const ch of checks) {
20
22
  for (const fn of ch._zod.onattach) {
21
23
  fn(inst);
22
24
  }
23
25
  }
24
26
  if (checks.length === 0) {
25
- // deferred initializer
26
- // inst._zod.parse is not yet defined
27
+ // deferred initializer inst._zod.parse is not yet defined
27
28
  (_a = inst._zod).deferred ?? (_a.deferred = []);
28
29
  inst._zod.deferred?.push(() => {
29
30
  inst._zod.run = inst._zod.parse;
@@ -31,6 +32,8 @@ export const $ZodType = /*@__PURE__*/ core.$constructor("$ZodType", (inst, def)
31
32
  }
32
33
  else {
33
34
  const runChecks = (payload, checks, ctx) => {
35
+ if (payload.memo)
36
+ return payload;
34
37
  let isAborted = util.aborted(payload);
35
38
  let asyncResult;
36
39
  for (const ch of checks) {
@@ -55,6 +58,7 @@ export const $ZodType = /*@__PURE__*/ core.$constructor("$ZodType", (inst, def)
55
58
  const nextLen = payload.issues.length;
56
59
  if (nextLen === currLen)
57
60
  return;
61
+ util.attachSchema(payload.issues, currLen, inst);
58
62
  if (!isAborted)
59
63
  isAborted = util.aborted(payload, currLen);
60
64
  });
@@ -63,6 +67,7 @@ export const $ZodType = /*@__PURE__*/ core.$constructor("$ZodType", (inst, def)
63
67
  const nextLen = payload.issues.length;
64
68
  if (nextLen === currLen)
65
69
  continue;
70
+ util.attachSchema(payload.issues, currLen, inst);
66
71
  if (!isAborted)
67
72
  isAborted = util.aborted(payload, currLen);
68
73
  }
@@ -94,8 +99,7 @@ export const $ZodType = /*@__PURE__*/ core.$constructor("$ZodType", (inst, def)
94
99
  return inst._zod.parse(payload, ctx);
95
100
  }
96
101
  if (ctx.direction === "backward") {
97
- // run canary
98
- // initial pass (no checks)
102
+ // run canary initial pass (no checks)
99
103
  const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
100
104
  if (canary instanceof Promise) {
101
105
  return canary.then((canary) => {
@@ -114,25 +118,44 @@ export const $ZodType = /*@__PURE__*/ core.$constructor("$ZodType", (inst, def)
114
118
  return runChecks(result, checks, ctx);
115
119
  };
116
120
  }
117
- // Lazy initialize ~standard to avoid creating objects for every schema
118
- util.defineLazy(inst, "~standard", () => ({
121
+ }, {
122
+ // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.
123
+ get "~standard"() {
124
+ return util.hide(this, "~standard", standardProps(this));
125
+ },
126
+ set "~standard"(value) {
127
+ util.own(this, "~standard", value);
128
+ },
129
+ });
130
+ /** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
131
+ // a Standard Schema result only reports issues, so a failure finalizes them straight off the raw payload: no ZodError, and no lazy result to read through
132
+ const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())) } : { value: r.value };
133
+ async function validateAsync(inst, value) {
134
+ const ctx = { async: true };
135
+ return toStandardResult((await inst._zod.run({ value, issues: [] }, ctx)), ctx);
136
+ }
137
+ export function standardProps(inst) {
138
+ return {
119
139
  validate: (value) => {
140
+ const ctx = { async: false };
120
141
  try {
121
- const r = safeParse(inst, value);
122
- return r.success ? { value: r.data } : { issues: r.error?.issues };
123
- }
124
- catch (_) {
125
- return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));
142
+ const r = inst._zod.run({ value, issues: [] }, ctx);
143
+ if (!(r instanceof Promise))
144
+ return toStandardResult(r, ctx);
126
145
  }
146
+ catch (_) { }
147
+ // async function so a synchronously throwing check rejects instead of escaping validate
148
+ return validateAsync(inst, value);
127
149
  },
128
150
  vendor: "zod",
129
151
  version: 1,
130
- }));
131
- });
152
+ };
153
+ }
132
154
  export { clone } from "./util.js";
133
155
  export const $ZodString = /*@__PURE__*/ core.$constructor("$ZodString", (inst, def) => {
134
156
  $ZodType.init(inst, def);
135
- inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);
157
+ // a format's own pattern, else unbounded; a template literal derives the check-aware form itself
158
+ inst._zod.pattern = def.pattern ?? regexes.anyString;
136
159
  inst._zod.parse = (payload, _) => {
137
160
  if (def.coerce)
138
161
  try {
@@ -184,66 +207,89 @@ export const $ZodEmail = /*@__PURE__*/ core.$constructor("$ZodEmail", (inst, def
184
207
  def.pattern ?? (def.pattern = regexes.email);
185
208
  $ZodStringFormat.init(inst, def);
186
209
  });
210
+ /** The `://` guard rejected the input before the URL constructor saw it. */
211
+ export const URL_BAD_FORMAT = 1;
212
+ /** The URL constructor rejected the input. */
213
+ export const URL_UNPARSEABLE = 2;
214
+ /** Parses a URL for `$ZodURL`, applying the one guard the URL constructor cannot express. Returns the parsed URL, or a code naming the stage that rejected it — the runtime needs that distinction to pick an issue note, and compiled code only needs to know it is not a URL. */
215
+ export function parseURLObject(trimmed, def) {
216
+ // When normalize is off, require :// for http/https URLs. This prevents strings like "http:example.com" or "https:/path" from being silently accepted
217
+ if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
218
+ return URL_BAD_FORMAT;
219
+ }
220
+ try {
221
+ // @ts-ignore
222
+ return new URL(trimmed);
223
+ }
224
+ catch {
225
+ return URL_UNPARSEABLE;
226
+ }
227
+ }
228
+ const asciiTabOrNewline = /[\t\n\r]/g;
229
+ /** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL("https://exa\nmple.com")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */
230
+ export function stripTabAndNewline(value) {
231
+ return value.replace(asciiTabOrNewline, "");
232
+ }
233
+ export function urlHostnameOk(url, hostname) {
234
+ hostname.lastIndex = 0;
235
+ return hostname.test(url.hostname);
236
+ }
237
+ export function urlProtocolOk(url, protocol) {
238
+ protocol.lastIndex = 0;
239
+ return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
240
+ }
187
241
  export const $ZodURL = /*@__PURE__*/ core.$constructor("$ZodURL", (inst, def) => {
188
242
  $ZodStringFormat.init(inst, def);
189
243
  inst._zod.check = (payload) => {
190
244
  try {
191
245
  // Trim whitespace from input
192
246
  const trimmed = payload.value.trim();
193
- // When normalize is off, require :// for http/https URLs
194
- // This prevents strings like "http:example.com" or "https:/path" from being silently accepted
195
- if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source) {
196
- if (!/^https?:\/\//i.test(trimmed)) {
197
- payload.issues.push({
198
- code: "invalid_format",
199
- format: "url",
200
- note: "Invalid URL format",
201
- input: payload.value,
202
- inst,
203
- continue: !def.abort,
204
- });
205
- return;
206
- }
207
- }
208
- // @ts-ignore
209
- const url = new URL(trimmed);
210
- if (def.hostname) {
211
- def.hostname.lastIndex = 0;
212
- if (!def.hostname.test(url.hostname)) {
213
- payload.issues.push({
214
- code: "invalid_format",
215
- format: "url",
216
- note: "Invalid hostname",
217
- pattern: def.hostname.source,
218
- input: payload.value,
219
- inst,
220
- continue: !def.abort,
221
- });
222
- }
247
+ const url = parseURLObject(trimmed, def);
248
+ if (url === URL_BAD_FORMAT) {
249
+ payload.issues.push({
250
+ code: "invalid_format",
251
+ format: "url",
252
+ note: "Invalid URL format",
253
+ input: payload.value,
254
+ inst,
255
+ continue: !def.abort,
256
+ });
257
+ return;
223
258
  }
224
- if (def.protocol) {
225
- def.protocol.lastIndex = 0;
226
- if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
227
- payload.issues.push({
228
- code: "invalid_format",
229
- format: "url",
230
- note: "Invalid protocol",
231
- pattern: def.protocol.source,
232
- input: payload.value,
233
- inst,
234
- continue: !def.abort,
235
- });
236
- }
259
+ if (url === URL_UNPARSEABLE) {
260
+ payload.issues.push({
261
+ code: "invalid_format",
262
+ format: "url",
263
+ input: payload.value,
264
+ inst,
265
+ continue: !def.abort,
266
+ });
267
+ return;
237
268
  }
238
- // Set the output value based on normalize flag
239
- if (def.normalize) {
240
- // Use normalized URL
241
- payload.value = url.href;
269
+ if (def.hostname && !urlHostnameOk(url, def.hostname)) {
270
+ payload.issues.push({
271
+ code: "invalid_format",
272
+ format: "url",
273
+ note: "Invalid hostname",
274
+ pattern: def.hostname.source,
275
+ input: payload.value,
276
+ inst,
277
+ continue: !def.abort,
278
+ });
242
279
  }
243
- else {
244
- // Preserve the original input (trimmed)
245
- payload.value = trimmed;
280
+ if (def.protocol && !urlProtocolOk(url, def.protocol)) {
281
+ payload.issues.push({
282
+ code: "invalid_format",
283
+ format: "url",
284
+ note: "Invalid protocol",
285
+ pattern: def.protocol.source,
286
+ input: payload.value,
287
+ inst,
288
+ continue: !def.abort,
289
+ });
246
290
  }
291
+ // Set the output value based on normalize flag
292
+ payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
247
293
  return;
248
294
  }
249
295
  catch (_) {
@@ -262,7 +308,9 @@ export const $ZodEmoji = /*@__PURE__*/ core.$constructor("$ZodEmoji", (inst, def
262
308
  $ZodStringFormat.init(inst, def);
263
309
  });
264
310
  export const $ZodNanoID = /*@__PURE__*/ core.$constructor("$ZodNanoID", (inst, def) => {
265
- def.pattern ?? (def.pattern = regexes.nanoid);
311
+ if (def.length !== undefined && (!Number.isInteger(def.length) || def.length < 1))
312
+ throw new Error(`Invalid nanoid length: ${def.length}`);
313
+ def.pattern ?? (def.pattern = def.length === undefined ? regexes.nanoid : regexes.nanoidOfLength(def.length));
266
314
  $ZodStringFormat.init(inst, def);
267
315
  });
268
316
  /**
@@ -309,19 +357,26 @@ export const $ZodISODuration = /*@__PURE__*/ core.$constructor("$ZodISODuration"
309
357
  export const $ZodIPv4 = /*@__PURE__*/ core.$constructor("$ZodIPv4", (inst, def) => {
310
358
  def.pattern ?? (def.pattern = regexes.ipv4);
311
359
  $ZodStringFormat.init(inst, def);
312
- inst._zod.bag.format = `ipv4`;
313
360
  });
361
+ /** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL("http://[...]")` parses an authority, not an address, so `@` and `\` re-delimit it and `"::@1\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `"::1\n"` validated as `::1`. */
362
+ const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
363
+ export function isValidIPv6(value) {
364
+ if (!ipv6Alphabet.test(value))
365
+ return false;
366
+ try {
367
+ // @ts-ignore
368
+ new URL(`http://[${value}]`);
369
+ return true;
370
+ }
371
+ catch {
372
+ return false;
373
+ }
374
+ }
314
375
  export const $ZodIPv6 = /*@__PURE__*/ core.$constructor("$ZodIPv6", (inst, def) => {
315
376
  def.pattern ?? (def.pattern = regexes.ipv6);
316
377
  $ZodStringFormat.init(inst, def);
317
- inst._zod.bag.format = `ipv6`;
318
378
  inst._zod.check = (payload) => {
319
- try {
320
- // @ts-ignore
321
- new URL(`http://[${payload.value}]`);
322
- // return;
323
- }
324
- catch {
379
+ if (!isValidIPv6(payload.value)) {
325
380
  payload.issues.push({
326
381
  code: "invalid_format",
327
382
  format: "ipv6",
@@ -335,32 +390,30 @@ export const $ZodIPv6 = /*@__PURE__*/ core.$constructor("$ZodIPv6", (inst, def)
335
390
  export const $ZodMAC = /*@__PURE__*/ core.$constructor("$ZodMAC", (inst, def) => {
336
391
  def.pattern ?? (def.pattern = regexes.mac(def.delimiter));
337
392
  $ZodStringFormat.init(inst, def);
338
- inst._zod.bag.format = `mac`;
339
393
  });
340
394
  export const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor("$ZodCIDRv4", (inst, def) => {
341
395
  def.pattern ?? (def.pattern = regexes.cidrv4);
342
396
  $ZodStringFormat.init(inst, def);
343
397
  });
398
+ export function isValidCIDRv6(value) {
399
+ const parts = value.split("/");
400
+ if (parts.length !== 2)
401
+ return false;
402
+ const [address, prefix] = parts;
403
+ if (!prefix)
404
+ return false;
405
+ const prefixNum = Number(prefix);
406
+ if (`${prefixNum}` !== prefix)
407
+ return false;
408
+ if (prefixNum < 0 || prefixNum > 128)
409
+ return false;
410
+ return isValidIPv6(address);
411
+ }
344
412
  export const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor("$ZodCIDRv6", (inst, def) => {
345
413
  def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation
346
414
  $ZodStringFormat.init(inst, def);
347
415
  inst._zod.check = (payload) => {
348
- const parts = payload.value.split("/");
349
- try {
350
- if (parts.length !== 2)
351
- throw new Error();
352
- const [address, prefix] = parts;
353
- if (!prefix)
354
- throw new Error();
355
- const prefixNum = Number(prefix);
356
- if (`${prefixNum}` !== prefix)
357
- throw new Error();
358
- if (prefixNum < 0 || prefixNum > 128)
359
- throw new Error();
360
- // @ts-ignore
361
- new URL(`http://[${address}]`);
362
- }
363
- catch {
416
+ if (!isValidCIDRv6(payload.value)) {
364
417
  payload.issues.push({
365
418
  code: "invalid_format",
366
419
  format: "cidrv6",
@@ -389,10 +442,11 @@ export function isValidBase64(data) {
389
442
  return false;
390
443
  }
391
444
  }
445
+ // lax on purpose: the quantified regexes.base64 overflows the regex stack on multi-MB input and its leading ^$| alternation leaks through template-literal composition; isValidBase64 enforces length and padding
446
+ export const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
392
447
  export const $ZodBase64 = /*@__PURE__*/ core.$constructor("$ZodBase64", (inst, def) => {
393
- def.pattern ?? (def.pattern = regexes.base64);
448
+ def.pattern ?? (def.pattern = base64Charset);
394
449
  $ZodStringFormat.init(inst, def);
395
- inst._zod.bag.contentEncoding = "base64";
396
450
  inst._zod.check = (payload) => {
397
451
  if (isValidBase64(payload.value))
398
452
  return;
@@ -405,18 +459,19 @@ export const $ZodBase64 = /*@__PURE__*/ core.$constructor("$ZodBase64", (inst, d
405
459
  });
406
460
  };
407
461
  });
408
- ////////////////////////////// ZodBase64 //////////////////////////////
462
+ ////////////////////////////// ZodBase64URL //////////////////////////////
463
+ // lax on purpose: the quantified regexes.base64url overflows the regex stack on multi-MB input; isValidBase64 enforces length on the padded string
464
+ export const base64urlCharset = /^[A-Za-z0-9_-]*$/;
409
465
  export function isValidBase64URL(data) {
410
- if (!regexes.base64url.test(data))
466
+ if (!base64urlCharset.test(data))
411
467
  return false;
412
468
  const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
413
469
  const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
414
470
  return isValidBase64(padded);
415
471
  }
416
472
  export const $ZodBase64URL = /*@__PURE__*/ core.$constructor("$ZodBase64URL", (inst, def) => {
417
- def.pattern ?? (def.pattern = regexes.base64url);
473
+ def.pattern ?? (def.pattern = base64urlCharset);
418
474
  $ZodStringFormat.init(inst, def);
419
- inst._zod.bag.contentEncoding = "base64url";
420
475
  inst._zod.check = (payload) => {
421
476
  if (isValidBase64URL(payload.value))
422
477
  return;
@@ -433,6 +488,77 @@ export const $ZodE164 = /*@__PURE__*/ core.$constructor("$ZodE164", (inst, def)
433
488
  def.pattern ?? (def.pattern = regexes.e164);
434
489
  $ZodStringFormat.init(inst, def);
435
490
  });
491
+ ////////////////////////////// ZodCreditCard //////////////////////////////
492
+ const CC_SANITIZE = /[- ]/g;
493
+ /** Luhn checksum on a digit-only string. Adapted from valibot (MIT). */
494
+ function isLuhnAlgo(digits) {
495
+ let length = digits.length;
496
+ let bit = 1;
497
+ let sum = 0;
498
+ while (length) {
499
+ const value = digits.charCodeAt(--length) - 48;
500
+ bit ^= 1;
501
+ sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
502
+ }
503
+ return sum % 10 === 0;
504
+ }
505
+ export function isValidCreditCard(input) {
506
+ if (!regexes.creditCard.test(input))
507
+ return false;
508
+ return isLuhnAlgo(input.replace(CC_SANITIZE, ""));
509
+ }
510
+ export const $ZodCreditCard = /*@__PURE__*/ core.$constructor("$ZodCreditCard", (inst, def) => {
511
+ // Shape only — the Luhn check below is not expressible as a pattern, so consumers of `pattern` (JSON Schema, template literals) get the length and separator rules alone.
512
+ def.pattern ?? (def.pattern = regexes.creditCard);
513
+ $ZodStringFormat.init(inst, def);
514
+ inst._zod.check = (payload) => {
515
+ if (isValidCreditCard(payload.value))
516
+ return;
517
+ payload.issues.push({
518
+ code: "invalid_format",
519
+ format: "credit_card",
520
+ input: payload.value,
521
+ inst,
522
+ continue: !def.abort,
523
+ });
524
+ };
525
+ });
526
+ ////////////////////////////// ZodIBAN //////////////////////////////
527
+ // iso 7064 mod 97-10 checksum without BigInt
528
+ function isIso7064Mod97(iban) {
529
+ let remainder = 0;
530
+ const len = iban.length;
531
+ for (let i = 4; i < len; i++) {
532
+ const code = iban.charCodeAt(i);
533
+ remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
534
+ }
535
+ for (let i = 0; i < 4; i++) {
536
+ const code = iban.charCodeAt(i);
537
+ remainder = (code >= 65 ? remainder * 100 + (code - 55) : remainder * 10 + (code - 48)) % 97;
538
+ }
539
+ return remainder === 1;
540
+ }
541
+ export function isValidIBAN(input) {
542
+ if (!regexes.iban.test(input))
543
+ return false;
544
+ return isIso7064Mod97(input);
545
+ }
546
+ export const $ZodIBAN = /*@__PURE__*/ core.$constructor("$ZodIBAN", (inst, def) => {
547
+ // shape only — checksum is not expressible as a pattern
548
+ def.pattern ?? (def.pattern = regexes.iban);
549
+ $ZodStringFormat.init(inst, def);
550
+ inst._zod.check = (payload) => {
551
+ if (isValidIBAN(payload.value))
552
+ return;
553
+ payload.issues.push({
554
+ code: "invalid_format",
555
+ format: "iban",
556
+ input: payload.value,
557
+ inst,
558
+ continue: !def.abort,
559
+ });
560
+ };
561
+ });
436
562
  ////////////////////////////// ZodJWT //////////////////////////////
437
563
  export function isValidJWT(token, algorithm = null) {
438
564
  try {
@@ -486,7 +612,7 @@ export const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor("$ZodCusto
486
612
  });
487
613
  export const $ZodNumber = /*@__PURE__*/ core.$constructor("$ZodNumber", (inst, def) => {
488
614
  $ZodType.init(inst, def);
489
- inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;
615
+ inst._zod.pattern = regexes.number;
490
616
  inst._zod.parse = (payload, _ctx) => {
491
617
  if (def.coerce)
492
618
  try {
@@ -501,7 +627,7 @@ export const $ZodNumber = /*@__PURE__*/ core.$constructor("$ZodNumber", (inst, d
501
627
  ? Number.isNaN(input)
502
628
  ? "NaN"
503
629
  : !Number.isFinite(input)
504
- ? "Infinity"
630
+ ? String(input)
505
631
  : undefined
506
632
  : undefined;
507
633
  payload.issues.push({
@@ -679,6 +805,8 @@ function handleArrayResult(result, final, index) {
679
805
  }
680
806
  export const $ZodArray = /*@__PURE__*/ core.$constructor("$ZodArray", (inst, def) => {
681
807
  $ZodType.init(inst, def);
808
+ const memo = core.globalConfig.memoizer;
809
+ memo?.attach(inst);
682
810
  inst._zod.parse = (payload, ctx) => {
683
811
  const input = payload.value;
684
812
  if (!Array.isArray(input)) {
@@ -690,8 +818,9 @@ export const $ZodArray = /*@__PURE__*/ core.$constructor("$ZodArray", (inst, def
690
818
  });
691
819
  return payload;
692
820
  }
693
- payload.value = Array(input.length);
821
+ payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
694
822
  const proms = [];
823
+ const abortEarly = ctx?.abortEarly;
695
824
  for (let i = 0; i < input.length; i++) {
696
825
  const item = input[i];
697
826
  const result = def.element._zod.run({
@@ -703,6 +832,9 @@ export const $ZodArray = /*@__PURE__*/ core.$constructor("$ZodArray", (inst, def
703
832
  }
704
833
  else {
705
834
  handleArrayResult(result, payload, i);
835
+ // the element's payload is authoritative here, since handleArrayResult forwards every issue; an object's is not, because it drops a failed absent optional
836
+ if (abortEarly && result.issues.length !== 0 && util.aborted(result))
837
+ break;
706
838
  }
707
839
  }
708
840
  if (proms.length) {
@@ -711,16 +843,21 @@ export const $ZodArray = /*@__PURE__*/ core.$constructor("$ZodArray", (inst, def
711
843
  return payload; //handleArrayResultsAsync(parseResults, final);
712
844
  };
713
845
  });
714
- function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
846
+ function handlePropertyResult(result, final, key, input, optin, optout) {
715
847
  const isPresent = key in input;
848
+ const isOptionalOut = optout === "optional";
849
+ // The middle rung means "absence permitted, nothing supplied in its place", so an absent key contributes nothing — whatever the schema made of `undefined` is invented, not substituted. Only `optional` reaches this with a value: `defaulted` substitutes, and a schema that isn't optional-out has to keep the key.
850
+ if (!isPresent && isOptionalOut && optin === "optional") {
851
+ return;
852
+ }
716
853
  if (result.issues.length) {
717
854
  // For optional-in/out schemas, ignore errors on absent keys.
718
- if (isOptionalIn && isOptionalOut && !isPresent) {
855
+ if (optin !== undefined && isOptionalOut && !isPresent) {
719
856
  return;
720
857
  }
721
858
  final.issues.push(...util.prefixIssues(key, result.issues));
722
859
  }
723
- if (!isPresent && !isOptionalIn) {
860
+ if (!isPresent && optin === undefined) {
724
861
  if (!result.issues.length) {
725
862
  final.issues.push({
726
863
  code: "invalid_type",
@@ -732,7 +869,7 @@ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptiona
732
869
  return;
733
870
  }
734
871
  if (result.value === undefined) {
735
- if (isPresent) {
872
+ if (isPresent || (optin === "defaulted" && !isOptionalOut)) {
736
873
  final.value[key] = undefined;
737
874
  }
738
875
  }
@@ -740,46 +877,64 @@ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptiona
740
877
  final.value[key] = result.value;
741
878
  }
742
879
  }
880
+ // one shared instance; a fresh [] per schema cost 56 bytes retained
881
+ const NO_SYMBOL_KEYS = [];
743
882
  function normalizeDef(def) {
744
883
  const keys = Object.keys(def.shape);
745
- for (const k of keys) {
884
+ const ownSymbols = Object.getOwnPropertySymbols(def.shape);
885
+ const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
886
+ // aliases `keys` when there are no symbols, so a string-only shape keeps one array
887
+ const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
888
+ for (const k of allKeys) {
746
889
  if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
747
- throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
890
+ throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
748
891
  }
749
892
  }
750
893
  const okeys = util.optionalKeys(def.shape);
751
894
  return {
752
895
  ...def,
753
- keys,
896
+ allKeys,
897
+ symbolKeys,
898
+ // string-only: handleCatchall matches it against `for...in`, which never yields a symbol
754
899
  keySet: new Set(keys),
755
900
  numKeys: keys.length,
756
901
  optionalKeys: new Set(okeys),
757
902
  };
758
903
  }
759
- function handleCatchall(proms, input, payload, ctx, def, inst) {
904
+ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
760
905
  const unrecognized = [];
761
906
  const keySet = def.keySet;
762
907
  const _catchall = def.catchall._zod;
763
908
  const t = _catchall.def.type;
764
- const isOptionalIn = _catchall.optin === "optional";
765
- const isOptionalOut = _catchall.optout === "optional";
909
+ const optin = _catchall.optin;
910
+ const optout = _catchall.optout;
911
+ // starts at 0, not the current length: the shape phase already ran and may have aborted
912
+ let seen = 0;
766
913
  for (const key in input) {
767
- // skip __proto__ so it can't replace the result prototype via the
768
- // assignment setter on the plain {} we build into
769
- if (key === "__proto__")
770
- continue;
914
+ if (abortEarly && payload.issues.length !== seen) {
915
+ if (util.aborted(payload, seen))
916
+ break;
917
+ seen = payload.issues.length;
918
+ }
919
+ // Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.
771
920
  if (keySet.has(key))
772
921
  continue;
922
+ // Don't copy an undeclared __proto__ into the result; assignment to a plain {} would replace the result prototype. But in strict mode it is still an unknown key, so report it before skipping.
923
+ if (key === "__proto__") {
924
+ if (t === "never")
925
+ unrecognized.push(key);
926
+ continue;
927
+ }
773
928
  if (t === "never") {
774
929
  unrecognized.push(key);
775
930
  continue;
776
931
  }
777
932
  const r = _catchall.run({ value: input[key], issues: [] }, ctx);
778
933
  if (r instanceof Promise) {
779
- proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
934
+ proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
780
935
  }
781
936
  else {
782
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
937
+ handlePropertyResult(r, payload, key, input, optin, optout);
783
938
  }
784
939
  }
785
940
  if (unrecognized.length) {
@@ -788,6 +943,8 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
788
943
  keys: unrecognized,
789
944
  input,
790
945
  inst,
946
+ // Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.
947
+ continue: true,
791
948
  });
792
949
  }
793
950
  if (!proms.length)
@@ -799,30 +956,35 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
799
956
  export const $ZodObject = /*@__PURE__*/ core.$constructor("$ZodObject", (inst, def) => {
800
957
  // requires cast because technically $ZodObject doesn't extend
801
958
  $ZodType.init(inst, def);
802
- // const sh = def.shape;
803
959
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
804
- if (!desc?.get) {
805
- const sh = def.shape;
806
- Object.defineProperty(def, "shape", {
807
- get: () => {
808
- const newSh = { ...sh };
809
- Object.defineProperty(def, "shape", {
810
- value: newSh,
811
- });
812
- return newSh;
813
- },
814
- });
960
+ // a cloned def carries its source's accessor, which knows the shape it answers from; adopting that keeps the clone's keys readable without running it
961
+ const sh = desc?.get ? desc.get.raw : (def.shape ?? {});
962
+ if (sh) {
963
+ // Freezes the shape on first read, so its getters resolve once and every later read sees the same schemas.
964
+ const get = () => {
965
+ const newSh = { ...sh };
966
+ Object.defineProperty(def, "shape", { value: newSh });
967
+ get.raw = newSh;
968
+ return newSh;
969
+ };
970
+ get.raw = sh;
971
+ Object.defineProperty(def, "shape", { get });
815
972
  }
816
973
  const _normalized = util.cached(() => normalizeDef(def));
817
- util.defineLazy(inst._zod, "propValues", () => {
818
- const shape = def.shape;
974
+ util.defineLazyInternal(inst, "propValues", (zod) => {
975
+ const shape = zod.def.shape;
819
976
  const propValues = {};
820
977
  for (const key in shape) {
821
978
  const field = shape[key]._zod;
822
979
  if (field.values) {
823
- propValues[key] ?? (propValues[key] = new Set());
980
+ if (!Object.prototype.hasOwnProperty.call(propValues, key)) {
981
+ util.assignProp(propValues, key, new Set());
982
+ }
824
983
  for (const v of field.values)
825
984
  propValues[key].add(v);
985
+ // An omittable slot reads back as undefined at a discriminator lookup, so it has to claim undefined: two options that can both omit the key are not discriminable on it.
986
+ if (field.optin !== undefined)
987
+ propValues[key].add(undefined);
826
988
  }
827
989
  }
828
990
  return propValues;
@@ -830,6 +992,8 @@ export const $ZodObject = /*@__PURE__*/ core.$constructor("$ZodObject", (inst, d
830
992
  const isObject = util.isObject;
831
993
  const catchall = def.catchall;
832
994
  let value;
995
+ const memo = core.globalConfig.memoizer;
996
+ memo?.attach(inst);
833
997
  inst._zod.parse = (payload, ctx) => {
834
998
  value ?? (value = _normalized.value);
835
999
  const input = payload.value;
@@ -842,25 +1006,34 @@ export const $ZodObject = /*@__PURE__*/ core.$constructor("$ZodObject", (inst, d
842
1006
  });
843
1007
  return payload;
844
1008
  }
845
- payload.value = {};
1009
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
846
1010
  const proms = [];
847
1011
  const shape = value.shape;
848
- for (const key of value.keys) {
1012
+ const abortEarly = ctx?.abortEarly;
1013
+ let seen = payload.issues.length;
1014
+ for (const key of value.allKeys) {
1015
+ if (abortEarly && payload.issues.length !== seen) {
1016
+ if (util.aborted(payload, seen))
1017
+ break;
1018
+ seen = payload.issues.length;
1019
+ }
1020
+ if (key === "__proto__")
1021
+ continue;
849
1022
  const el = shape[key];
850
- const isOptionalIn = el._zod.optin === "optional";
851
- const isOptionalOut = el._zod.optout === "optional";
1023
+ const optin = el._zod.optin;
1024
+ const optout = el._zod.optout;
852
1025
  const r = el._zod.run({ value: input[key], issues: [] }, ctx);
853
1026
  if (r instanceof Promise) {
854
- proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1027
+ proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
855
1028
  }
856
1029
  else {
857
- handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1030
+ handlePropertyResult(r, payload, key, input, optin, optout);
858
1031
  }
859
1032
  }
860
1033
  if (!catchall) {
861
1034
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
862
1035
  }
863
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
1036
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
864
1037
  };
865
1038
  });
866
1039
  export const $ZodObjectJIT = /*@__PURE__*/ core.$constructor("$ZodObjectJIT", (inst, def) => {
@@ -868,58 +1041,65 @@ export const $ZodObjectJIT = /*@__PURE__*/ core.$constructor("$ZodObjectJIT", (i
868
1041
  $ZodObject.init(inst, def);
869
1042
  const superParse = inst._zod.parse;
870
1043
  const _normalized = util.cached(() => normalizeDef(def));
1044
+ const memo = core.globalConfig.memoizer;
871
1045
  const generateFastpass = (shape) => {
872
- const doc = new Doc(["shape", "payload", "ctx"]);
873
1046
  const normalized = _normalized.value;
874
- const parseStr = (key) => {
875
- const k = util.esc(key);
876
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
877
- };
1047
+ const syms = normalized.symbolKeys;
1048
+ // a symbol has no source literal, so it is read as `syms[i]` off the closed-over scope
1049
+ const doc = new Doc(["payload", "ctx"], { shape, inst, memo, syms });
1050
+ const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1051
+ // prefixes in place, like util.prefixIssues. newResult must land before the early return: a catchall runs after this and would otherwise write onto the caller's input
1052
+ const prefixStr = (id, k) => `
1053
+ let ${id}_ab = false;
1054
+ for (let i = 0; i < ${id}.issues.length; i++) {
1055
+ const iss = ${id}.issues[i];
1056
+ iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
1057
+ payload.issues.push(iss);
1058
+ if (iss.continue !== true) ${id}_ab = true;
1059
+ }
1060
+ if (${id}_ab && ctx && ctx.abortEarly) {
1061
+ payload.value = newResult;
1062
+ return payload;
1063
+ }`;
878
1064
  doc.write(`const input = payload.value;`);
879
1065
  const ids = Object.create(null);
880
1066
  let counter = 0;
881
- for (const key of normalized.keys) {
1067
+ for (const key of normalized.allKeys) {
882
1068
  ids[key] = `key_${counter++}`;
883
1069
  }
884
1070
  // A: preserve key order {
885
- doc.write(`const newResult = {};`);
886
- for (const key of normalized.keys) {
1071
+ doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
1072
+ for (const key of normalized.allKeys) {
1073
+ if (key === "__proto__")
1074
+ continue;
887
1075
  const id = ids[key];
888
- const k = util.esc(key);
1076
+ const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : util.esc(key);
1077
+ const isPresent = `${k} in input`;
889
1078
  const schema = shape[key];
890
- const isOptionalIn = schema?._zod?.optin === "optional";
1079
+ const optin = schema?._zod?.optin;
1080
+ const isOptionalIn = optin !== undefined;
891
1081
  const isOptionalOut = schema?._zod?.optout === "optional";
892
- doc.write(`const ${id} = ${parseStr(key)};`);
1082
+ doc.write(`const ${id} = ${parseStr(k)};`);
893
1083
  if (isOptionalIn && isOptionalOut) {
894
- // For optional-in/out schemas, ignore errors on absent keys
1084
+ // For optional-in/out schemas, ignore errors on absent keys — and, like the interpreted path, drop the value produced alongside them. The middle rung goes further: it permits absence without supplying anything in its place, so an absent key contributes nothing at all.
1085
+ const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
895
1086
  doc.write(`
896
- if (${id}.issues.length) {
897
- if (${k} in input) {
898
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
899
- ...iss,
900
- path: iss.path ? [${k}, ...iss.path] : [${k}]
901
- })));
1087
+ const ${id}_present = ${isPresent};
1088
+ if (!${id}.issues.length || ${id}_present) {
1089
+ if (${id}.issues.length) {${prefixStr(id, k)}
902
1090
  }
903
- }
904
-
905
- if (${id}.value === undefined) {
906
- if (${k} in input) {
907
- newResult[${k}] = undefined;
1091
+
1092
+ if (${assign}) {
1093
+ newResult[${k}] = ${id}.value;
908
1094
  }
909
- } else {
910
- newResult[${k}] = ${id}.value;
911
1095
  }
912
-
1096
+
913
1097
  `);
914
1098
  }
915
1099
  else if (!isOptionalIn) {
916
1100
  doc.write(`
917
- const ${id}_present = ${k} in input;
918
- if (${id}.issues.length) {
919
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
920
- ...iss,
921
- path: iss.path ? [${k}, ...iss.path] : [${k}]
922
- })));
1101
+ const ${id}_present = ${isPresent};
1102
+ if (${id}.issues.length) {${prefixStr(id, k)}
923
1103
  }
924
1104
  if (!${id}_present && !${id}.issues.length) {
925
1105
  payload.issues.push({
@@ -928,42 +1108,39 @@ export const $ZodObjectJIT = /*@__PURE__*/ core.$constructor("$ZodObjectJIT", (i
928
1108
  input: undefined,
929
1109
  path: [${k}]
930
1110
  });
1111
+ if (ctx && ctx.abortEarly) {
1112
+ payload.value = newResult;
1113
+ return payload;
1114
+ }
931
1115
  }
932
1116
 
933
1117
  if (${id}_present) {
934
- if (${id}.value === undefined) {
935
- newResult[${k}] = undefined;
936
- } else {
937
- newResult[${k}] = ${id}.value;
938
- }
1118
+ newResult[${k}] = ${id}.value;
939
1119
  }
940
1120
 
941
1121
  `);
942
1122
  }
943
1123
  else {
944
1124
  doc.write(`
945
- if (${id}.issues.length) {
946
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
947
- ...iss,
948
- path: iss.path ? [${k}, ...iss.path] : [${k}]
949
- })));
950
- }
951
-
952
- if (${id}.value === undefined) {
953
- if (${k} in input) {
954
- newResult[${k}] = undefined;
955
- }
956
- } else {
1125
+ if (${id}.issues.length) {${prefixStr(id, k)}
1126
+ }
1127
+ `);
1128
+ if (optin === "defaulted") {
1129
+ doc.write(`newResult[${k}] = ${id}.value;`);
1130
+ }
1131
+ else {
1132
+ doc.write(`
1133
+ if (${id}.value !== undefined || ${isPresent}) {
957
1134
  newResult[${k}] = ${id}.value;
958
1135
  }
959
-
960
1136
  `);
1137
+ }
961
1138
  }
962
1139
  }
963
1140
  doc.write(`payload.value = newResult;`);
964
1141
  doc.write(`return payload;`);
965
- const fn = doc.compile();
966
- return (payload, ctx) => fn(shape, payload, ctx);
1142
+ // closing `shape` in is what pays: turbofan specializes the parser against that one shape object, so every `shape[k]._zod.run` folds to a known callee. as a parameter it stays a generic load and measures 13% slower even with the forwarding frame gone
1143
+ return doc.compile();
967
1144
  };
968
1145
  let fastpass;
969
1146
  const isObject = util.isObject;
@@ -991,7 +1168,7 @@ export const $ZodObjectJIT = /*@__PURE__*/ core.$constructor("$ZodObjectJIT", (i
991
1168
  payload = fastpass(payload, ctx);
992
1169
  if (!catchall)
993
1170
  return payload;
994
- return handleCatchall([], input, payload, ctx, value, inst);
1171
+ return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
995
1172
  }
996
1173
  return superParse(payload, ctx);
997
1174
  };
@@ -1018,17 +1195,21 @@ function handleUnionResults(results, final, inst, ctx) {
1018
1195
  }
1019
1196
  export const $ZodUnion = /*@__PURE__*/ core.$constructor("$ZodUnion", (inst, def) => {
1020
1197
  $ZodType.init(inst, def);
1021
- util.defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
1022
- util.defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
1023
- util.defineLazy(inst._zod, "values", () => {
1024
- if (def.options.every((o) => o._zod.values)) {
1025
- return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
1198
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted")
1199
+ ? "defaulted"
1200
+ : zod.def.options.some((o) => o._zod.optin !== undefined)
1201
+ ? "optional"
1202
+ : undefined);
1203
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
1204
+ util.defineLazyInternal(inst, "values", (zod) => {
1205
+ if (zod.def.options.every((o) => o._zod.values)) {
1206
+ return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
1026
1207
  }
1027
1208
  return undefined;
1028
1209
  });
1029
- util.defineLazy(inst._zod, "pattern", () => {
1030
- if (def.options.every((o) => o._zod.pattern)) {
1031
- const patterns = def.options.map((o) => o._zod.pattern);
1210
+ util.defineLazyInternal(inst, "pattern", (zod) => {
1211
+ if (zod.def.options.every((o) => o._zod.pattern)) {
1212
+ const patterns = zod.def.options.map((o) => o._zod.pattern);
1032
1213
  return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join("|")})$`);
1033
1214
  }
1034
1215
  return undefined;
@@ -1063,12 +1244,16 @@ export const $ZodUnion = /*@__PURE__*/ core.$constructor("$ZodUnion", (inst, def
1063
1244
  };
1064
1245
  });
1065
1246
  function handleExclusiveUnionResults(results, final, inst, ctx) {
1066
- const successes = results.filter((r) => r.issues.length === 0);
1067
- if (successes.length === 1) {
1068
- final.value = successes[0].value;
1247
+ const matches = [];
1248
+ for (let i = 0; i < results.length; i++) {
1249
+ if (results[i].issues.length === 0)
1250
+ matches.push(i);
1251
+ }
1252
+ if (matches.length === 1) {
1253
+ final.value = results[matches[0]].value;
1069
1254
  return final;
1070
1255
  }
1071
- if (successes.length === 0) {
1256
+ if (matches.length === 0) {
1072
1257
  // No matches - same as regular union
1073
1258
  final.issues.push({
1074
1259
  code: "invalid_union",
@@ -1085,6 +1270,7 @@ function handleExclusiveUnionResults(results, final, inst, ctx) {
1085
1270
  inst,
1086
1271
  errors: [],
1087
1272
  inclusive: false,
1273
+ matches,
1088
1274
  });
1089
1275
  }
1090
1276
  return final;
@@ -1119,44 +1305,75 @@ export const $ZodXor = /*@__PURE__*/ core.$constructor("$ZodXor", (inst, def) =>
1119
1305
  });
1120
1306
  };
1121
1307
  });
1308
+ /** Returns the option whose discriminator claims `value`, or throws if ambiguous. */
1309
+ export function getDiscriminatedOption(union, value) {
1310
+ const internals = union._zod;
1311
+ let map = internals.bag.optionsMap;
1312
+ if (!map) {
1313
+ map = discriminatorMap(internals.def);
1314
+ internals.bag.optionsMap = map;
1315
+ }
1316
+ const option = map.get(value);
1317
+ if (option === null)
1318
+ throw new Error(`Ambiguous discriminator value "${String(value)}"`);
1319
+ return option;
1320
+ }
1321
+ function discriminatorMap(def) {
1322
+ const map = new Map();
1323
+ for (const option of def.options) {
1324
+ const values = option._zod.propValues?.[def.discriminator];
1325
+ if (!values || values.size === 0)
1326
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
1327
+ for (const value of values) {
1328
+ if (map.has(value)) {
1329
+ if (value !== undefined)
1330
+ throw new Error(`Duplicate discriminator value "${String(value)}"`);
1331
+ // keep the collision marked so a later member cannot reclaim it
1332
+ map.set(value, null);
1333
+ }
1334
+ else {
1335
+ map.set(value, option);
1336
+ }
1337
+ }
1338
+ }
1339
+ return map;
1340
+ }
1122
1341
  export const $ZodDiscriminatedUnion =
1123
1342
  /*@__PURE__*/
1124
1343
  core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
1125
1344
  def.inclusive = false;
1126
1345
  $ZodUnion.init(inst, def);
1127
1346
  const _super = inst._zod.parse;
1128
- util.defineLazy(inst._zod, "propValues", () => {
1347
+ util.defineLazyInternal(inst, "propValues", (zod) => {
1129
1348
  const propValues = {};
1130
- for (const option of def.options) {
1349
+ let undefinedCount = 0;
1350
+ for (const option of zod.def.options) {
1131
1351
  const pv = option._zod.propValues;
1132
1352
  if (!pv || Object.keys(pv).length === 0)
1133
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
1353
+ throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
1354
+ if (pv[zod.def.discriminator]?.has(undefined))
1355
+ undefinedCount++;
1134
1356
  for (const [k, v] of Object.entries(pv)) {
1135
- if (!propValues[k])
1136
- propValues[k] = new Set();
1357
+ if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
1358
+ util.assignProp(propValues, k, new Set());
1359
+ }
1137
1360
  for (const val of v) {
1138
1361
  propValues[k].add(val);
1139
1362
  }
1140
1363
  }
1141
1364
  }
1365
+ if (!zod.def.unionFallback && undefinedCount > 1)
1366
+ propValues[zod.def.discriminator]?.delete(undefined);
1142
1367
  return propValues;
1143
1368
  });
1144
- const disc = util.cached(() => {
1145
- const opts = def.options;
1146
- const map = new Map();
1147
- for (const o of opts) {
1148
- const values = o._zod.propValues?.[def.discriminator];
1149
- if (!values || values.size === 0)
1150
- throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
1151
- for (const v of values) {
1152
- if (map.has(v)) {
1153
- throw new Error(`Duplicate discriminator value "${String(v)}"`);
1154
- }
1155
- map.set(v, o);
1156
- }
1369
+ // Checked now rather than in the lookup map below, so an option that lacks the discriminator fails at the `discriminatedUnion` call instead of on the first object parsed. Options whose shape cannot be enumerated without resolving it — pipes and lazies — are left to the map.
1370
+ def.options.forEach((option, i) => {
1371
+ const propShape = util.rawShape(option._zod.def);
1372
+ if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
1373
+ throw new Error(`Invalid discriminated union option at index "${i}"`);
1157
1374
  }
1158
- return map;
1159
1375
  });
1376
+ const disc = util.cached(() => discriminatorMap(def));
1160
1377
  inst._zod.parse = (payload, ctx) => {
1161
1378
  const input = payload.value;
1162
1379
  if (!util.isObject(input)) {
@@ -1168,14 +1385,15 @@ core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
1168
1385
  });
1169
1386
  return payload;
1170
1387
  }
1171
- const opt = disc.value.get(input?.[def.discriminator]);
1172
- if (opt) {
1388
+ const value = input?.[def.discriminator];
1389
+ const opt = disc.value.get(value);
1390
+ // forward metadata cannot choose an encoder for an absent tag
1391
+ if (opt && (value !== undefined || ctx.direction !== "backward")) {
1173
1392
  return opt._zod.run(payload, ctx);
1174
1393
  }
1175
1394
  // Fall back to union matching when the fast discriminator path fails:
1176
1395
  // - explicitly enabled via unionFallback, or
1177
- // - during backward direction (encode), since codec-based discriminators
1178
- // have different values in forward vs backward directions
1396
+ // - during backward direction (encode), since codec-based discriminators have different values in forward vs backward directions
1179
1397
  if (def.unionFallback || ctx.direction === "backward") {
1180
1398
  return _super(payload, ctx);
1181
1399
  }
@@ -1185,7 +1403,7 @@ core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
1185
1403
  errors: [],
1186
1404
  note: "No matching discriminator",
1187
1405
  discriminator: def.discriminator,
1188
- options: Array.from(disc.value.keys()),
1406
+ options: Array.from(disc.value.keys()).filter((value) => disc.value.get(value) !== null),
1189
1407
  input,
1190
1408
  path: [def.discriminator],
1191
1409
  inst,
@@ -1208,7 +1426,7 @@ export const $ZodIntersection = /*@__PURE__*/ core.$constructor("$ZodIntersectio
1208
1426
  return handleIntersectionResults(payload, left, right);
1209
1427
  };
1210
1428
  });
1211
- function mergeValues(a, b) {
1429
+ export function mergeValues(a, b) {
1212
1430
  // const aType = parse.t(a);
1213
1431
  // const bType = parse.t(b);
1214
1432
  if (a === b) {
@@ -1221,7 +1439,11 @@ function mergeValues(a, b) {
1221
1439
  const bKeys = Object.keys(b);
1222
1440
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1223
1441
  const newObj = { ...a, ...b };
1442
+ if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
1443
+ delete newObj.__proto__;
1224
1444
  for (const key of sharedKeys) {
1445
+ if (key === "__proto__")
1446
+ continue;
1225
1447
  const sharedValue = mergeValues(a[key], b[key]);
1226
1448
  if (!sharedValue.valid) {
1227
1449
  return {
@@ -1255,43 +1477,55 @@ function mergeValues(a, b) {
1255
1477
  return { valid: false, mergeErrorPath: [] };
1256
1478
  }
1257
1479
  function handleIntersectionResults(result, left, right) {
1258
- // Track which side(s) report each key as unrecognized
1480
+ // Track which side(s) reject each key. A key rejection is reported only when BOTH sides reject it, so a key owned by one branch survives the other's key schema. strictObject reports these as unrecognized_keys; a record with an open key schema reports one invalid_key per key.
1259
1481
  const unrecKeys = new Map();
1260
1482
  let unrecIssue;
1261
- for (const iss of left.issues) {
1262
- if (iss.code === "unrecognized_keys") {
1483
+ const keyIssues = new Map();
1484
+ const collect = (iss, side) => {
1485
+ let keys;
1486
+ if (iss.code === "unrecognized_keys" && !iss.path?.length) {
1263
1487
  unrecIssue ?? (unrecIssue = iss);
1264
- for (const k of iss.keys) {
1265
- if (!unrecKeys.has(k))
1266
- unrecKeys.set(k, {});
1267
- unrecKeys.get(k).l = true;
1268
- }
1488
+ keys = iss.keys;
1489
+ }
1490
+ else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
1491
+ const k = String(iss.path[0]);
1492
+ if (!keyIssues.has(k))
1493
+ keyIssues.set(k, iss);
1494
+ keys = [k];
1269
1495
  }
1270
1496
  else {
1271
- result.issues.push(iss);
1497
+ return false;
1272
1498
  }
1499
+ for (const k of keys) {
1500
+ if (!unrecKeys.has(k))
1501
+ unrecKeys.set(k, {});
1502
+ unrecKeys.get(k)[side] = true;
1503
+ }
1504
+ return true;
1505
+ };
1506
+ for (const iss of left.issues) {
1507
+ if (!collect(iss, "l"))
1508
+ result.issues.push(iss);
1273
1509
  }
1274
1510
  for (const iss of right.issues) {
1275
- if (iss.code === "unrecognized_keys") {
1276
- for (const k of iss.keys) {
1277
- if (!unrecKeys.has(k))
1278
- unrecKeys.set(k, {});
1279
- unrecKeys.get(k).r = true;
1280
- }
1281
- }
1282
- else {
1511
+ if (!collect(iss, "r"))
1283
1512
  result.issues.push(iss);
1284
- }
1285
1513
  }
1286
- // Report only keys unrecognized by BOTH sides
1514
+ // Report only keys rejected by BOTH sides
1287
1515
  const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1288
- if (bothKeys.length && unrecIssue) {
1289
- result.issues.push({ ...unrecIssue, keys: bothKeys });
1516
+ if (bothKeys.length) {
1517
+ const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
1518
+ if (aggregated.length)
1519
+ result.issues.push({ ...unrecIssue, keys: aggregated });
1520
+ for (const k of bothKeys) {
1521
+ if (!aggregated.includes(k) && keyIssues.has(k))
1522
+ result.issues.push(keyIssues.get(k));
1523
+ }
1290
1524
  }
1291
- if (util.aborted(result))
1292
- return result;
1293
1525
  const merged = mergeValues(left.value, right.value);
1294
1526
  if (!merged.valid) {
1527
+ if (util.aborted(result))
1528
+ return result;
1295
1529
  throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
1296
1530
  }
1297
1531
  result.value = merged.data;
@@ -1300,6 +1534,8 @@ function handleIntersectionResults(result, left, right) {
1300
1534
  export const $ZodTuple = /*@__PURE__*/ core.$constructor("$ZodTuple", (inst, def) => {
1301
1535
  $ZodType.init(inst, def);
1302
1536
  const items = def.items;
1537
+ const memo = core.globalConfig.memoizer;
1538
+ memo?.attach(inst);
1303
1539
  inst._zod.parse = (payload, ctx) => {
1304
1540
  const input = payload.value;
1305
1541
  if (!Array.isArray(input)) {
@@ -1311,7 +1547,7 @@ export const $ZodTuple = /*@__PURE__*/ core.$constructor("$ZodTuple", (inst, def
1311
1547
  });
1312
1548
  return payload;
1313
1549
  }
1314
- payload.value = [];
1550
+ payload.value = memo ? memo.alloc(inst, payload, [], ctx) : [];
1315
1551
  const proms = [];
1316
1552
  const optinStart = getTupleOptStart(items, "optin");
1317
1553
  const optoutStart = getTupleOptStart(items, "optout");
@@ -1338,11 +1574,11 @@ export const $ZodTuple = /*@__PURE__*/ core.$constructor("$ZodTuple", (inst, def
1338
1574
  });
1339
1575
  }
1340
1576
  }
1341
- // Run every item in parallel, collecting results into an indexed
1342
- // array. The post-processing in `handleTupleResults` walks them in
1343
- // order so it can decide whether an absent optional-output error can
1344
- // truncate the tail or must be reported to preserve required output.
1577
+ // Run every item in parallel, collecting results into an indexed array. The post-processing in `handleTupleResults` walks them in order so it can decide whether an absent optional-output error can truncate the tail or must be reported to preserve required output.
1345
1578
  const itemResults = new Array(items.length);
1579
+ // only tracked when there is a rest loop to skip
1580
+ const abortEarly = def.rest ? ctx?.abortEarly : undefined;
1581
+ let itemAborted = false;
1346
1582
  for (let i = 0; i < items.length; i++) {
1347
1583
  const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
1348
1584
  if (r instanceof Promise) {
@@ -1352,12 +1588,21 @@ export const $ZodTuple = /*@__PURE__*/ core.$constructor("$ZodTuple", (inst, def
1352
1588
  }
1353
1589
  else {
1354
1590
  itemResults[i] = r;
1591
+ if (abortEarly && !itemAborted && r.issues.length)
1592
+ itemAborted = util.aborted(r);
1355
1593
  }
1356
1594
  }
1357
- if (def.rest) {
1595
+ // sound because rest is non-empty exactly when every fixed index is present, the one case handleTupleResults cannot discard an item's issues
1596
+ if (def.rest && !itemAborted) {
1358
1597
  let i = items.length - 1;
1359
1598
  const rest = input.slice(items.length);
1599
+ let seen = payload.issues.length;
1360
1600
  for (const el of rest) {
1601
+ if (abortEarly && payload.issues.length !== seen) {
1602
+ if (util.aborted(payload, seen))
1603
+ break;
1604
+ seen = payload.issues.length;
1605
+ }
1361
1606
  i++;
1362
1607
  const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
1363
1608
  if (result instanceof Promise) {
@@ -1376,7 +1621,9 @@ export const $ZodTuple = /*@__PURE__*/ core.$constructor("$ZodTuple", (inst, def
1376
1621
  });
1377
1622
  function getTupleOptStart(items, key) {
1378
1623
  for (let i = items.length - 1; i >= 0; i--) {
1379
- if (items[i]._zod[key] !== "optional")
1624
+ // optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.
1625
+ const omittable = key === "optin" ? items[i]._zod.optin !== undefined : items[i]._zod.optout === "optional";
1626
+ if (!omittable)
1380
1627
  return i + 1;
1381
1628
  }
1382
1629
  return 0;
@@ -1388,12 +1635,15 @@ function handleTupleResult(result, final, index) {
1388
1635
  final.value[index] = result.value;
1389
1636
  }
1390
1637
  function handleTupleResults(itemResults, final, items, input, optoutStart) {
1391
- // Walk results in order. Mirror $ZodObject's swallow-on-absent-optional
1392
- // rule, but only after `optoutStart`: the first index where the output
1393
- // tuple tail can be absent.
1638
+ // Walk results in order. Mirror $ZodObject's swallow-on-absent-optional rule, but only after `optoutStart`: the first index where the output tuple tail can be absent.
1394
1639
  for (let i = 0; i < items.length; i++) {
1395
1640
  const r = itemResults[i];
1396
1641
  const isPresent = i < input.length;
1642
+ // The array analog of `handlePropertyResult`'s absent-key early return: the middle rung permits absence without supplying anything in its place, so the tail truncates here instead of materializing whatever the item made of `undefined`.
1643
+ if (!isPresent && i >= optoutStart && items[i]._zod.optin === "optional") {
1644
+ final.value.length = i;
1645
+ break;
1646
+ }
1397
1647
  if (r.issues.length) {
1398
1648
  if (!isPresent && i >= optoutStart) {
1399
1649
  final.value.length = i;
@@ -1421,6 +1671,8 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
1421
1671
  }
1422
1672
  export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, def) => {
1423
1673
  $ZodType.init(inst, def);
1674
+ const memo = core.globalConfig.memoizer;
1675
+ memo?.attach(inst);
1424
1676
  inst._zod.parse = (payload, ctx) => {
1425
1677
  const input = payload.value;
1426
1678
  if (!util.isPlainObject(input)) {
@@ -1432,14 +1684,18 @@ export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, d
1432
1684
  });
1433
1685
  return payload;
1434
1686
  }
1687
+ // no guard in either loop below: a record's invalid_key aborts but an enclosing intersection can reconcile it, so a stopped loop hides keys the sibling does not own and the intersection then rejects nothing
1435
1688
  const proms = [];
1436
1689
  const values = def.keyType._zod.values;
1437
- if (values) {
1438
- payload.value = {};
1690
+ if (values && !def.partial) {
1691
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1439
1692
  const recordKeys = new Set();
1440
1693
  for (const key of values) {
1441
1694
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
1442
1695
  recordKeys.add(typeof key === "number" ? key.toString() : key);
1696
+ // A declared __proto__ is stripped but is not an unrecognized key.
1697
+ if (key === "__proto__")
1698
+ continue;
1443
1699
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1444
1700
  if (keyResult instanceof Promise) {
1445
1701
  throw new Error("Async schemas not supported in object keys currently");
@@ -1456,6 +1712,8 @@ export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, d
1456
1712
  continue;
1457
1713
  }
1458
1714
  const outKey = keyResult.value;
1715
+ if (outKey === "__proto__")
1716
+ continue;
1459
1717
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1460
1718
  if (result instanceof Promise) {
1461
1719
  proms.push(result.then((result) => {
@@ -1476,8 +1734,16 @@ export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, d
1476
1734
  let unrecognized;
1477
1735
  for (const key in input) {
1478
1736
  if (!recordKeys.has(key)) {
1479
- unrecognized = unrecognized ?? [];
1480
- unrecognized.push(key);
1737
+ if (def.mode === "loose") {
1738
+ // skip __proto__ so it can't replace the result prototype via the assignment setter on the plain {} we build into
1739
+ if (key === "__proto__")
1740
+ continue;
1741
+ payload.value[key] = input[key];
1742
+ }
1743
+ else {
1744
+ unrecognized = unrecognized ?? [];
1745
+ unrecognized.push(key);
1746
+ }
1481
1747
  }
1482
1748
  }
1483
1749
  if (unrecognized && unrecognized.length > 0) {
@@ -1486,11 +1752,14 @@ export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, d
1486
1752
  input,
1487
1753
  inst,
1488
1754
  keys: unrecognized,
1755
+ continue: true,
1489
1756
  });
1490
1757
  }
1491
1758
  }
1492
1759
  else {
1493
- payload.value = {};
1760
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1761
+ // An enumerable key schema declares which keys the record owns, so a key outside the set is unrecognized. A non-enumerable one (regex, refine) is a constraint every key must satisfy, so a failing key is invalid. Only the former is reconcilable against the other side of an intersection.
1762
+ let unrecognized;
1494
1763
  // Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()
1495
1764
  for (const key of Reflect.ownKeys(input)) {
1496
1765
  if (key === "__proto__")
@@ -1501,8 +1770,7 @@ export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, d
1501
1770
  if (keyResult instanceof Promise) {
1502
1771
  throw new Error("Async schemas not supported in object keys currently");
1503
1772
  }
1504
- // Numeric string fallback: if key is a numeric string and failed, retry with Number(key)
1505
- // This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals
1773
+ // Numeric string fallback: if key is a numeric string and failed, retry with Number(key). This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals
1506
1774
  const checkNumericKey = typeof key === "string" && regexes.number.test(key) && keyResult.issues.length;
1507
1775
  if (checkNumericKey) {
1508
1776
  const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
@@ -1518,6 +1786,10 @@ export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, d
1518
1786
  // Pass through unchanged
1519
1787
  payload.value[key] = input[key];
1520
1788
  }
1789
+ else if (values) {
1790
+ unrecognized = unrecognized ?? [];
1791
+ unrecognized.push(key);
1792
+ }
1521
1793
  else {
1522
1794
  // Default "strict" behavior: error on invalid key
1523
1795
  payload.issues.push({
@@ -1531,22 +1803,35 @@ export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, d
1531
1803
  }
1532
1804
  continue;
1533
1805
  }
1806
+ // the guard above tests the raw input key, but the key schema can normalize an ordinary key into __proto__; re-check the key we actually write under
1807
+ const outKey = keyResult.value;
1808
+ if (outKey === "__proto__")
1809
+ continue;
1534
1810
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1535
1811
  if (result instanceof Promise) {
1536
1812
  proms.push(result.then((result) => {
1537
1813
  if (result.issues.length) {
1538
1814
  payload.issues.push(...util.prefixIssues(key, result.issues));
1539
1815
  }
1540
- payload.value[keyResult.value] = result.value;
1816
+ payload.value[outKey] = result.value;
1541
1817
  }));
1542
1818
  }
1543
1819
  else {
1544
1820
  if (result.issues.length) {
1545
1821
  payload.issues.push(...util.prefixIssues(key, result.issues));
1546
1822
  }
1547
- payload.value[keyResult.value] = result.value;
1823
+ payload.value[outKey] = result.value;
1548
1824
  }
1549
1825
  }
1826
+ if (unrecognized && unrecognized.length > 0) {
1827
+ payload.issues.push({
1828
+ code: "unrecognized_keys",
1829
+ input,
1830
+ inst,
1831
+ keys: unrecognized,
1832
+ continue: true,
1833
+ });
1834
+ }
1550
1835
  }
1551
1836
  if (proms.length) {
1552
1837
  return Promise.all(proms).then(() => payload);
@@ -1556,6 +1841,8 @@ export const $ZodRecord = /*@__PURE__*/ core.$constructor("$ZodRecord", (inst, d
1556
1841
  });
1557
1842
  export const $ZodMap = /*@__PURE__*/ core.$constructor("$ZodMap", (inst, def) => {
1558
1843
  $ZodType.init(inst, def);
1844
+ const memo = core.globalConfig.memoizer;
1845
+ memo?.attach(inst);
1559
1846
  inst._zod.parse = (payload, ctx) => {
1560
1847
  const input = payload.value;
1561
1848
  if (!(input instanceof Map)) {
@@ -1568,8 +1855,15 @@ export const $ZodMap = /*@__PURE__*/ core.$constructor("$ZodMap", (inst, def) =>
1568
1855
  return payload;
1569
1856
  }
1570
1857
  const proms = [];
1571
- payload.value = new Map();
1858
+ payload.value = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();
1859
+ const abortEarly = ctx?.abortEarly;
1860
+ let seen = payload.issues.length;
1572
1861
  for (const [key, value] of input) {
1862
+ if (abortEarly && payload.issues.length !== seen) {
1863
+ if (util.aborted(payload, seen))
1864
+ break;
1865
+ seen = payload.issues.length;
1866
+ }
1573
1867
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1574
1868
  const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);
1575
1869
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
@@ -1620,6 +1914,8 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
1620
1914
  }
1621
1915
  export const $ZodSet = /*@__PURE__*/ core.$constructor("$ZodSet", (inst, def) => {
1622
1916
  $ZodType.init(inst, def);
1917
+ const memo = core.globalConfig.memoizer;
1918
+ memo?.attach(inst);
1623
1919
  inst._zod.parse = (payload, ctx) => {
1624
1920
  const input = payload.value;
1625
1921
  if (!(input instanceof Set)) {
@@ -1632,8 +1928,15 @@ export const $ZodSet = /*@__PURE__*/ core.$constructor("$ZodSet", (inst, def) =>
1632
1928
  return payload;
1633
1929
  }
1634
1930
  const proms = [];
1635
- payload.value = new Set();
1931
+ payload.value = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();
1932
+ const abortEarly = ctx?.abortEarly;
1933
+ let seen = payload.issues.length;
1636
1934
  for (const item of input) {
1935
+ if (abortEarly && payload.issues.length !== seen) {
1936
+ if (util.aborted(payload, seen))
1937
+ break;
1938
+ seen = payload.issues.length;
1939
+ }
1637
1940
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
1638
1941
  if (result instanceof Promise) {
1639
1942
  proms.push(result.then((result) => handleSetResult(result, payload)));
@@ -1657,10 +1960,11 @@ export const $ZodEnum = /*@__PURE__*/ core.$constructor("$ZodEnum", (inst, def)
1657
1960
  const values = util.getEnumValues(def.entries);
1658
1961
  const valuesSet = new Set(values);
1659
1962
  inst._zod.values = valuesSet;
1660
- inst._zod.pattern = new RegExp(`^(${values
1661
- .filter((k) => util.propertyKeyTypes.has(typeof k))
1662
- .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o.toString()))
1663
- .join("|")})$`);
1963
+ util.defineLazyInternal(inst, "pattern", (zod) => {
1964
+ const patternValues = util.getEnumValues(zod.def.entries).filter((k) => util.propertyKeyTypes.has(typeof k));
1965
+ // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
1966
+ return new RegExp(patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
1967
+ });
1664
1968
  inst._zod.parse = (payload, _ctx) => {
1665
1969
  const input = payload.value;
1666
1970
  if (valuesSet.has(input)) {
@@ -1677,14 +1981,17 @@ export const $ZodEnum = /*@__PURE__*/ core.$constructor("$ZodEnum", (inst, def)
1677
1981
  });
1678
1982
  export const $ZodLiteral = /*@__PURE__*/ core.$constructor("$ZodLiteral", (inst, def) => {
1679
1983
  $ZodType.init(inst, def);
1680
- if (def.values.length === 0) {
1681
- throw new Error("Cannot create literal schema with no valid values");
1682
- }
1683
1984
  const values = new Set(def.values);
1684
1985
  inst._zod.values = values;
1685
- inst._zod.pattern = new RegExp(`^(${def.values
1686
- .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))
1687
- .join("|")})$`);
1986
+ util.defineLazyInternal(inst, "pattern", (zod) => {
1987
+ const vals = zod.def.values;
1988
+ // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
1989
+ return new RegExp(vals.length
1990
+ ? `^(${vals
1991
+ .map((o) => typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o))
1992
+ .join("|")})$`
1993
+ : "^[^\\s\\S]$");
1994
+ });
1688
1995
  inst._zod.parse = (payload, _ctx) => {
1689
1996
  const input = payload.value;
1690
1997
  if (values.has(input)) {
@@ -1718,6 +2025,7 @@ export const $ZodFile = /*@__PURE__*/ core.$constructor("$ZodFile", (inst, def)
1718
2025
  export const $ZodTransform = /*@__PURE__*/ core.$constructor("$ZodTransform", (inst, def) => {
1719
2026
  $ZodType.init(inst, def);
1720
2027
  inst._zod.optin = "optional";
2028
+ core.globalConfig.memoizer?.guard(inst);
1721
2029
  inst._zod.parse = (payload, ctx) => {
1722
2030
  if (ctx.direction === "backward") {
1723
2031
  throw new core.$ZodEncodeError(inst.constructor.name);
@@ -1727,7 +2035,6 @@ export const $ZodTransform = /*@__PURE__*/ core.$constructor("$ZodTransform", (i
1727
2035
  const output = _out instanceof Promise ? _out : Promise.resolve(_out);
1728
2036
  return output.then((output) => {
1729
2037
  payload.value = output;
1730
- payload.fallback = true;
1731
2038
  return payload;
1732
2039
  });
1733
2040
  }
@@ -1735,37 +2042,37 @@ export const $ZodTransform = /*@__PURE__*/ core.$constructor("$ZodTransform", (i
1735
2042
  throw new core.$ZodAsyncError();
1736
2043
  }
1737
2044
  payload.value = _out;
1738
- payload.fallback = true;
1739
2045
  return payload;
1740
2046
  };
1741
2047
  });
1742
- function handleOptionalResult(result, input) {
1743
- if (input === undefined && (result.issues.length || result.fallback)) {
1744
- return { issues: [], value: undefined };
1745
- }
1746
- return result;
2048
+ function handleOptionalResult(payload, result) {
2049
+ // A substituting schema that still failed has no usable answer; yield undefined. Its issues are simply dropped: it ran on a payload of its own, so there is no shared array to truncate and nothing of the caller's to lose with it.
2050
+ payload.value = result.issues.length ? undefined : result.value;
2051
+ return payload;
1747
2052
  }
1748
2053
  export const $ZodOptional = /*@__PURE__*/ core.$constructor("$ZodOptional", (inst, def) => {
1749
2054
  $ZodType.init(inst, def);
1750
- inst._zod.optin = "optional";
2055
+ // .optional() propagates absence rather than substituting for it, so a defaulted inner keeps its rung.
2056
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
1751
2057
  inst._zod.optout = "optional";
1752
- util.defineLazy(inst._zod, "values", () => {
1753
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;
2058
+ util.defineLazyInternal(inst, "values", (zod) => {
2059
+ const values = zod.def.innerType._zod.values;
2060
+ return values ? new Set([...values, undefined]) : undefined;
1754
2061
  });
1755
- util.defineLazy(inst._zod, "pattern", () => {
1756
- const pattern = def.innerType._zod.pattern;
2062
+ util.defineLazyInternal(inst, "pattern", (zod) => {
2063
+ const pattern = zod.def.innerType._zod.pattern;
1757
2064
  return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;
1758
2065
  });
1759
2066
  inst._zod.parse = (payload, ctx) => {
1760
- if (def.innerType._zod.optin === "optional") {
1761
- const input = payload.value;
1762
- const result = def.innerType._zod.run(payload, ctx);
1763
- if (result instanceof Promise)
1764
- return result.then((r) => handleOptionalResult(r, input));
1765
- return handleOptionalResult(result, input);
1766
- }
1767
2067
  if (payload.value === undefined) {
1768
- return payload;
2068
+ // Only the top rung substitutes a value for absence; everything else leaves it intact, which is what .optional() means.
2069
+ if (def.innerType._zod.optin !== "defaulted")
2070
+ return payload;
2071
+ // Its own payload, for the same reason $ZodCatch gets one: a pipe forwards an unrecognized key through the caller's issues array, and this must not read that as the substituting schema failing and drop it.
2072
+ const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
2073
+ if (result instanceof Promise)
2074
+ return result.then((result) => handleOptionalResult(payload, result));
2075
+ return handleOptionalResult(payload, result);
1769
2076
  }
1770
2077
  return def.innerType._zod.run(payload, ctx);
1771
2078
  };
@@ -1774,8 +2081,8 @@ export const $ZodExactOptional = /*@__PURE__*/ core.$constructor("$ZodExactOptio
1774
2081
  // Call parent init - inherits optin/optout = "optional"
1775
2082
  $ZodOptional.init(inst, def);
1776
2083
  // Override values/pattern to NOT add undefined
1777
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1778
- util.defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
2084
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2085
+ util.defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
1779
2086
  // Override parse to just delegate (no undefined handling)
1780
2087
  inst._zod.parse = (payload, ctx) => {
1781
2088
  return def.innerType._zod.run(payload, ctx);
@@ -1783,14 +2090,14 @@ export const $ZodExactOptional = /*@__PURE__*/ core.$constructor("$ZodExactOptio
1783
2090
  });
1784
2091
  export const $ZodNullable = /*@__PURE__*/ core.$constructor("$ZodNullable", (inst, def) => {
1785
2092
  $ZodType.init(inst, def);
1786
- util.defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1787
- util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1788
- util.defineLazy(inst._zod, "pattern", () => {
1789
- const pattern = def.innerType._zod.pattern;
2093
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
2094
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2095
+ util.defineLazyInternal(inst, "pattern", (zod) => {
2096
+ const pattern = zod.def.innerType._zod.pattern;
1790
2097
  return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;
1791
2098
  });
1792
- util.defineLazy(inst._zod, "values", () => {
1793
- return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;
2099
+ util.defineLazyInternal(inst, "values", (zod) => {
2100
+ return zod.def.innerType._zod.values ? new Set([...zod.def.innerType._zod.values, null]) : undefined;
1794
2101
  });
1795
2102
  inst._zod.parse = (payload, ctx) => {
1796
2103
  // Forward direction (decode): allow null to pass through
@@ -1802,8 +2109,8 @@ export const $ZodNullable = /*@__PURE__*/ core.$constructor("$ZodNullable", (ins
1802
2109
  export const $ZodDefault = /*@__PURE__*/ core.$constructor("$ZodDefault", (inst, def) => {
1803
2110
  $ZodType.init(inst, def);
1804
2111
  // inst._zod.qin = "true";
1805
- inst._zod.optin = "optional";
1806
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2112
+ inst._zod.optin = "defaulted";
2113
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
1807
2114
  inst._zod.parse = (payload, ctx) => {
1808
2115
  if (ctx.direction === "backward") {
1809
2116
  return def.innerType._zod.run(payload, ctx);
@@ -1832,8 +2139,8 @@ function handleDefaultResult(payload, def) {
1832
2139
  }
1833
2140
  export const $ZodPrefault = /*@__PURE__*/ core.$constructor("$ZodPrefault", (inst, def) => {
1834
2141
  $ZodType.init(inst, def);
1835
- inst._zod.optin = "optional";
1836
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2142
+ inst._zod.optin = "defaulted";
2143
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
1837
2144
  inst._zod.parse = (payload, ctx) => {
1838
2145
  if (ctx.direction === "backward") {
1839
2146
  return def.innerType._zod.run(payload, ctx);
@@ -1847,8 +2154,8 @@ export const $ZodPrefault = /*@__PURE__*/ core.$constructor("$ZodPrefault", (ins
1847
2154
  });
1848
2155
  export const $ZodNonOptional = /*@__PURE__*/ core.$constructor("$ZodNonOptional", (inst, def) => {
1849
2156
  $ZodType.init(inst, def);
1850
- util.defineLazy(inst._zod, "values", () => {
1851
- const v = def.innerType._zod.values;
2157
+ util.defineLazyInternal(inst, "values", (zod) => {
2158
+ const v = zod.def.innerType._zod.values;
1852
2159
  return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
1853
2160
  });
1854
2161
  inst._zod.parse = (payload, ctx) => {
@@ -1887,47 +2194,40 @@ export const $ZodSuccess = /*@__PURE__*/ core.$constructor("$ZodSuccess", (inst,
1887
2194
  return payload;
1888
2195
  };
1889
2196
  });
2197
+ function handleCatchResult(payload, result, def, ctx) {
2198
+ if (!result.issues.length) {
2199
+ payload.value = result.value;
2200
+ // The value carries up, so the flag describing it has to carry with it: a back-edge into a node still being parsed must not be frozen by an enclosing readonly, and its checks belong to the node itself. Guarded so the ordinary case adds no own property.
2201
+ if (result.memo)
2202
+ payload.memo = true;
2203
+ return payload;
2204
+ }
2205
+ // Spread the inner's own payload, not ours: `value` has to stay the input the catch was handed, and the inner ran on a payload of its own so its issues are already private to this call.
2206
+ payload.value = def.catchValue({
2207
+ ...result,
2208
+ value: payload.value,
2209
+ error: {
2210
+ issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
2211
+ },
2212
+ input: payload.value,
2213
+ });
2214
+ return payload;
2215
+ }
1890
2216
  export const $ZodCatch = /*@__PURE__*/ core.$constructor("$ZodCatch", (inst, def) => {
1891
2217
  $ZodType.init(inst, def);
1892
- inst._zod.optin = "optional";
1893
- util.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1894
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2218
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
2219
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2220
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
1895
2221
  inst._zod.parse = (payload, ctx) => {
1896
2222
  if (ctx.direction === "backward") {
1897
2223
  return def.innerType._zod.run(payload, ctx);
1898
2224
  }
1899
2225
  // Forward direction (decode): apply catch logic
1900
- const result = def.innerType._zod.run(payload, ctx);
2226
+ const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
1901
2227
  if (result instanceof Promise) {
1902
- return result.then((result) => {
1903
- payload.value = result.value;
1904
- if (result.issues.length) {
1905
- payload.value = def.catchValue({
1906
- ...payload,
1907
- error: {
1908
- issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1909
- },
1910
- input: payload.value,
1911
- });
1912
- payload.issues = [];
1913
- payload.fallback = true;
1914
- }
1915
- return payload;
1916
- });
2228
+ return result.then((result) => handleCatchResult(payload, result, def, ctx));
1917
2229
  }
1918
- payload.value = result.value;
1919
- if (result.issues.length) {
1920
- payload.value = def.catchValue({
1921
- ...payload,
1922
- error: {
1923
- issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1924
- },
1925
- input: payload.value,
1926
- });
1927
- payload.issues = [];
1928
- payload.fallback = true;
1929
- }
1930
- return payload;
2230
+ return handleCatchResult(payload, result, def, ctx);
1931
2231
  };
1932
2232
  });
1933
2233
  export const $ZodNaN = /*@__PURE__*/ core.$constructor("$ZodNaN", (inst, def) => {
@@ -1947,10 +2247,10 @@ export const $ZodNaN = /*@__PURE__*/ core.$constructor("$ZodNaN", (inst, def) =>
1947
2247
  });
1948
2248
  export const $ZodPipe = /*@__PURE__*/ core.$constructor("$ZodPipe", (inst, def) => {
1949
2249
  $ZodType.init(inst, def);
1950
- util.defineLazy(inst._zod, "values", () => def.in._zod.values);
1951
- util.defineLazy(inst._zod, "optin", () => def.in._zod.optin);
1952
- util.defineLazy(inst._zod, "optout", () => def.out._zod.optout);
1953
- util.defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2250
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
2251
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
2252
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
2253
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
1954
2254
  inst._zod.parse = (payload, ctx) => {
1955
2255
  if (ctx.direction === "backward") {
1956
2256
  const right = def.out._zod.run(payload, ctx);
@@ -1967,19 +2267,20 @@ export const $ZodPipe = /*@__PURE__*/ core.$constructor("$ZodPipe", (inst, def)
1967
2267
  };
1968
2268
  });
1969
2269
  function handlePipeResult(left, next, ctx) {
1970
- if (left.issues.length) {
2270
+ // Any issue stops the pipe, so a failing refinement never feeds its transform. An unrecognized key is the exception: it describes the input's extra properties, not the value being piped, and an enclosing intersection may yet reconcile it.
2271
+ if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
1971
2272
  // prevent further checks
1972
2273
  left.aborted = true;
1973
2274
  return left;
1974
2275
  }
1975
- return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx);
2276
+ return next._zod.run({ value: left.value, issues: left.issues }, ctx);
1976
2277
  }
1977
2278
  export const $ZodCodec = /*@__PURE__*/ core.$constructor("$ZodCodec", (inst, def) => {
1978
2279
  $ZodType.init(inst, def);
1979
- util.defineLazy(inst._zod, "values", () => def.in._zod.values);
1980
- util.defineLazy(inst._zod, "optin", () => def.in._zod.optin);
1981
- util.defineLazy(inst._zod, "optout", () => def.out._zod.optout);
1982
- util.defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2280
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
2281
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
2282
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
2283
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
1983
2284
  inst._zod.parse = (payload, ctx) => {
1984
2285
  const direction = ctx.direction || "forward";
1985
2286
  if (direction === "forward") {
@@ -2033,10 +2334,10 @@ export const $ZodPreprocess = /*@__PURE__*/ core.$constructor("$ZodPreprocess",
2033
2334
  });
2034
2335
  export const $ZodReadonly = /*@__PURE__*/ core.$constructor("$ZodReadonly", (inst, def) => {
2035
2336
  $ZodType.init(inst, def);
2036
- util.defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
2037
- util.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2038
- util.defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
2039
- util.defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
2337
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
2338
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2339
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
2340
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
2040
2341
  inst._zod.parse = (payload, ctx) => {
2041
2342
  if (ctx.direction === "backward") {
2042
2343
  return def.innerType._zod.run(payload, ctx);
@@ -2049,25 +2350,72 @@ export const $ZodReadonly = /*@__PURE__*/ core.$constructor("$ZodReadonly", (ins
2049
2350
  };
2050
2351
  });
2051
2352
  function handleReadonlyResult(payload) {
2052
- payload.value = Object.freeze(payload.value);
2353
+ // A repeat visit hands back a node that is still being built; freezing it here would make the rest of its keys fail to assign.
2354
+ if (!payload.memo)
2355
+ payload.value = Object.freeze(payload.value);
2053
2356
  return payload;
2054
2357
  }
2358
+ // a leaf's pattern source with its own checks folded in: the last pattern-carrying check wins, else length bounds narrow the catch-all, else an integer format narrows the number form. the fold lives here instead of on `_zod.pattern` so a bundle without template literals never pays for it
2359
+ function leafPattern(schema) {
2360
+ const def = schema._zod.def;
2361
+ let pattern = def.pattern;
2362
+ let isInt = !!def.format?.includes("int");
2363
+ let minimum;
2364
+ let maximum;
2365
+ for (const ch of def.checks ?? []) {
2366
+ const d = ch._zod.def;
2367
+ if (d.pattern)
2368
+ pattern = d.pattern;
2369
+ isInt || (isInt = !!d.format?.includes("int"));
2370
+ const lo = d.minimum ?? d.length;
2371
+ const hi = d.maximum ?? d.length;
2372
+ if (lo !== undefined && (minimum === undefined || lo > minimum))
2373
+ minimum = lo;
2374
+ if (hi !== undefined && (maximum === undefined || hi < maximum))
2375
+ maximum = hi;
2376
+ }
2377
+ if (pattern)
2378
+ return pattern.source;
2379
+ // an empty range matches nothing at runtime, and `{8,5}` is not a legal quantifier
2380
+ if (minimum !== undefined && maximum !== undefined && minimum > maximum)
2381
+ return "(?!)";
2382
+ if (minimum !== undefined || maximum !== undefined)
2383
+ return regexes.string({ minimum, maximum }).source;
2384
+ const own = schema._zod.pattern;
2385
+ return (isInt && own === regexes.number ? regexes.integer : own)?.source;
2386
+ }
2387
+ // a part's pattern source. a wrapper's pattern embeds its inner pattern's source verbatim, so the folded form is substituted in place without knowing the wrapper's own composition; a union's options are joined the way the union builds its own pattern
2388
+ function partPattern(schema) {
2389
+ const def = schema._zod.def;
2390
+ const own = schema._zod.pattern?.source;
2391
+ // lazy resolves its inner on the internals, not the def
2392
+ const inner = def.innerType ?? schema._zod.innerType;
2393
+ if (inner) {
2394
+ const before = inner._zod.pattern?.source;
2395
+ const after = partPattern(inner);
2396
+ if (own && before && after && after !== before) {
2397
+ return own.replace(util.cleanRegex(before), () => util.cleanRegex(after));
2398
+ }
2399
+ return own;
2400
+ }
2401
+ if (def.options) {
2402
+ const sources = def.options.map(partPattern);
2403
+ if (sources.every(Boolean))
2404
+ return `^(${sources.map((s) => util.cleanRegex(s)).join("|")})$`;
2405
+ }
2406
+ return leafPattern(schema);
2407
+ }
2055
2408
  export const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor("$ZodTemplateLiteral", (inst, def) => {
2056
2409
  $ZodType.init(inst, def);
2057
2410
  const regexParts = [];
2058
2411
  for (const part of def.parts) {
2059
2412
  if (typeof part === "object" && part !== null) {
2060
2413
  // is Zod schema
2061
- if (!part._zod.pattern) {
2062
- // if (!source)
2414
+ const source = partPattern(part);
2415
+ if (!source) {
2063
2416
  throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
2064
2417
  }
2065
- const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
2066
- if (!source)
2067
- throw new Error(`Invalid template literal part: ${part._zod.traits}`);
2068
- const start = source.startsWith("^") ? 1 : 0;
2069
- const end = source.endsWith("$") ? source.length - 1 : source.length;
2070
- regexParts.push(source.slice(start, end));
2418
+ regexParts.push(util.cleanRegex(source));
2071
2419
  }
2072
2420
  else if (part === null || util.primitiveTypes.has(typeof part)) {
2073
2421
  regexParts.push(util.escapeRegex(`${part}`));
@@ -2103,33 +2451,35 @@ export const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor("$ZodTemplate
2103
2451
  });
2104
2452
  export const $ZodFunction = /*@__PURE__*/ core.$constructor("$ZodFunction", (inst, def) => {
2105
2453
  $ZodType.init(inst, def);
2106
- inst._def = def;
2454
+ // Defined, not assigned: the classic prototype exposes `_def` as a getter with no setter.
2455
+ Object.defineProperty(inst, "_def", { value: def });
2107
2456
  inst._zod.def = def;
2108
2457
  inst.implement = (func) => {
2109
2458
  if (typeof func !== "function") {
2110
2459
  throw new Error("implement() must be called with a function");
2111
2460
  }
2112
- return function (...args) {
2461
+ // Defined inline so the closure stays anonymous: binding it to a `const` first names it, which costs 256 bytes per implemented function.
2462
+ return Object.defineProperty(function (...args) {
2113
2463
  const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;
2114
2464
  const result = Reflect.apply(func, this, parsedArgs);
2115
2465
  if (inst._def.output) {
2116
2466
  return parse(inst._def.output, result);
2117
2467
  }
2118
2468
  return result;
2119
- };
2469
+ }, "_zod", { value: inst._zod, enumerable: false });
2120
2470
  };
2121
2471
  inst.implementAsync = (func) => {
2122
2472
  if (typeof func !== "function") {
2123
2473
  throw new Error("implementAsync() must be called with a function");
2124
2474
  }
2125
- return async function (...args) {
2475
+ return Object.defineProperty(async function (...args) {
2126
2476
  const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;
2127
2477
  const result = await Reflect.apply(func, this, parsedArgs);
2128
2478
  if (inst._def.output) {
2129
2479
  return await parseAsync(inst._def.output, result);
2130
2480
  }
2131
2481
  return result;
2132
- };
2482
+ }, "_zod", { value: inst._zod, enumerable: false });
2133
2483
  };
2134
2484
  inst._zod.parse = (payload, _ctx) => {
2135
2485
  if (typeof payload.value !== "function") {
@@ -2188,19 +2538,17 @@ export const $ZodPromise = /*@__PURE__*/ core.$constructor("$ZodPromise", (inst,
2188
2538
  });
2189
2539
  export const $ZodLazy = /*@__PURE__*/ core.$constructor("$ZodLazy", (inst, def) => {
2190
2540
  $ZodType.init(inst, def);
2191
- // Cache the resolved inner type on the shared `def` so all clones of this
2192
- // lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance,
2193
- // preserving identity for cycle detection on recursive schemas.
2541
+ // Cache the resolved inner type on the shared `def` so all clones of this lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance, preserving identity for cycle detection on recursive schemas.
2194
2542
  util.defineLazy(inst._zod, "innerType", () => {
2195
2543
  const d = def;
2196
2544
  if (!d._cachedInner)
2197
2545
  d._cachedInner = def.getter();
2198
2546
  return d._cachedInner;
2199
2547
  });
2200
- util.defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
2201
- util.defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
2202
- util.defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? undefined);
2203
- util.defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? undefined);
2548
+ util.defineLazyInternal(inst, "pattern", (zod) => zod.innerType?._zod?.pattern);
2549
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.innerType?._zod?.propValues);
2550
+ util.defineLazyInternal(inst, "optin", (zod) => zod.innerType?._zod?.optin ?? undefined);
2551
+ util.defineLazyInternal(inst, "optout", (zod) => zod.innerType?._zod?.optout ?? undefined);
2204
2552
  inst._zod.parse = (payload, ctx) => {
2205
2553
  const inner = inst._zod.innerType;
2206
2554
  return inner._zod.run(payload, ctx);
@@ -2237,3 +2585,64 @@ function handleRefineResult(result, payload, input, inst) {
2237
2585
  payload.issues.push(util.issue(_iss));
2238
2586
  }
2239
2587
  }
2588
+ // asserts in place: the child result's value is discarded, matching z.property(), because a nested object or array schema rebuilds its output even when nothing transformed
2589
+ function handlePropertiesResult(result, payload, key) {
2590
+ if (result.issues.length) {
2591
+ payload.issues.push(...util.prefixIssues(key, result.issues));
2592
+ }
2593
+ }
2594
+ export const $ZodProperties = /*@__PURE__*/ core.$constructor("$ZodProperties", (inst, def) => {
2595
+ // $ZodType.init prepends an instance that already carries the $ZodCheck trait to its own `checks`, which would run the shape a second time and cost the parse context. Initializing the check trait after it keeps the schema role in `parse`, where the context arrives.
2596
+ $ZodType.init(inst, def);
2597
+ checks.$ZodCheck.init(inst, def);
2598
+ const memo = core.globalConfig.memoizer;
2599
+ memo?.attach(inst);
2600
+ // key and schema snapshotted together: reading one live and the other cached lets a later mutation of the caller's shape object pair a stale key with a missing schema
2601
+ let entries;
2602
+ const runShape = (payload, ctx) => {
2603
+ entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
2604
+ const input = payload.value;
2605
+ let proms;
2606
+ for (const [key, schema] of entries) {
2607
+ const result = schema._zod.run({ value: input[key], issues: [] }, ctx);
2608
+ if (result instanceof Promise) {
2609
+ proms ?? (proms = []);
2610
+ proms.push(result.then((result) => handlePropertiesResult(result, payload, key)));
2611
+ }
2612
+ else {
2613
+ handlePropertiesResult(result, payload, key);
2614
+ }
2615
+ }
2616
+ if (proms)
2617
+ return Promise.all(proms).then(() => undefined);
2618
+ return undefined;
2619
+ };
2620
+ inst._zod.parse = (payload, ctx) => {
2621
+ const input = payload.value;
2622
+ // as a schema this is the type gate, and it infers an object shape, so a primitive is a type error. A function passes: its properties read like any other object's, and z.instanceof allows one.
2623
+ if (input === null || (typeof input !== "object" && typeof input !== "function")) {
2624
+ payload.issues.push({ expected: "object", code: "invalid_type", input, inst });
2625
+ return payload;
2626
+ }
2627
+ // both sides declare the shape's input type, so the assertion runs forward in either direction; encoding the children backward would reject the very type this schema claims to take
2628
+ if (ctx.direction === "backward")
2629
+ ctx = { ...ctx, direction: "forward" };
2630
+ // the input is its own output here, so it registers as its own memo entry: a cycle re-entering this node hits the bucket instead of recursing forever
2631
+ if (memo)
2632
+ memo.alloc(inst, payload, input, ctx);
2633
+ const result = runShape(payload, ctx);
2634
+ return result instanceof Promise ? result.then(() => payload) : payload;
2635
+ };
2636
+ // as a check the base schema already typed the value, so this only asserts the properties — which read on a primitive too, matching z.property() on a string's length. It gets no context of its own, so a cycle through a spread schema is not tracked.
2637
+ inst._zod.check = (payload) => {
2638
+ if (payload.value == null) {
2639
+ payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
2640
+ return undefined;
2641
+ }
2642
+ return runShape(payload, {});
2643
+ };
2644
+ }, {
2645
+ *[Symbol.iterator]() {
2646
+ yield this;
2647
+ },
2648
+ });