@chrona-city/ugc-kit 0.0.0-stage → 1.5.9

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 (1657) hide show
  1. package/README.md +110 -2
  2. package/bin/chrona.mjs +4 -0
  3. package/chrona.contract.lock.json +432 -0
  4. package/chrona.controlled-presentation.lock.json +100 -0
  5. package/chrona.core.lock.json +44 -0
  6. package/chrona.ecs.lock.json +40 -0
  7. package/chrona.gameplay-tests.lock.json +64 -0
  8. package/chrona.ground-rules.lock.json +48 -0
  9. package/chrona.pipeline.lock.json +100 -0
  10. package/chrona.private-event-view.lock.json +56 -0
  11. package/chrona.private-events.lock.json +64 -0
  12. package/chrona.private-state-view.lock.json +64 -0
  13. package/chrona.private-state.lock.json +56 -0
  14. package/chrona.registry.lock.json +72 -0
  15. package/chrona.resource-bindings.lock.json +68 -0
  16. package/chrona.sandbox.lock.json +60 -0
  17. package/chrona.scene-interaction.lock.json +60 -0
  18. package/chrona.scene-presentation.lock.json +60 -0
  19. package/chrona.wiring.lock.json +48 -0
  20. package/chrona.world-scene-runtime.lock.json +164 -0
  21. package/chrona.world-scene.lock.json +180 -0
  22. package/compiler/local-builder.lock.json +1 -0
  23. package/compiler/source/contracts/ugc/creator-source/v1/tool-package.schema.json +11 -0
  24. package/compiler/source/contracts/ugc/document-presentation/v1/document.mjs +165 -0
  25. package/compiler/source/contracts/ugc/document-presentation/v1/profile.json +24 -0
  26. package/compiler/source/contracts/ugc/ground-rules/v1/contract-set.json +9 -0
  27. package/compiler/source/contracts/ugc/ground-rules/v1/ground-rules.mjs +98 -0
  28. package/compiler/source/contracts/ugc/ground-rules/v2/ground-rules.mjs +138 -0
  29. package/compiler/source/contracts/ugc/ground-rules/v2/heightfield.mjs +89 -0
  30. package/compiler/source/contracts/ugc/ground-rules/v2/movement.mjs +12 -0
  31. package/compiler/source/contracts/ugc/ground-rules/v2/spatial-source.mjs +193 -0
  32. package/compiler/source/contracts/ugc/ground-rules/v2.2/center-band.mjs +142 -0
  33. package/compiler/source/contracts/ugc/ground-rules/v2.2/spatial-source.mjs +77 -0
  34. package/compiler/source/contracts/ugc/local-content/v1/document-snapshot.mjs +114 -0
  35. package/compiler/source/contracts/ugc/local-content/v1/snapshot.mjs +171 -0
  36. package/compiler/source/contracts/ugc/personal-state/v1/declaration.mjs +86 -0
  37. package/compiler/source/contracts/ugc/personal-state/v1/node-plan.mjs +51 -0
  38. package/compiler/source/contracts/ugc/pipeline/v1/conformance/js/pipeline-validator.mjs +196 -0
  39. package/compiler/source/contracts/ugc/private-events/v1/declaration.mjs +25 -0
  40. package/compiler/source/contracts/ugc/private-events/v1/events.mjs +189 -0
  41. package/compiler/source/contracts/ugc/registry/v1/conformance/js/capability-resolver.mjs +191 -0
  42. package/compiler/source/contracts/ugc/registry/v1/registry.json +1 -0
  43. package/compiler/source/contracts/ugc/registry/v1/resolution-policy.json +70 -0
  44. package/compiler/source/contracts/ugc/resource-bindings/v1/authored-avatar.mjs +183 -0
  45. package/compiler/source/contracts/ugc/resource-bindings/v1/bindings.mjs +133 -0
  46. package/compiler/source/contracts/ugc/resource-bindings/v1/contract-set.json +9 -0
  47. package/compiler/source/contracts/ugc/scene-interaction/v1/contract-set.json +26 -0
  48. package/compiler/source/contracts/ugc/scene-interaction/v1/interaction.mjs +83 -0
  49. package/compiler/source/contracts/ugc/scene-interaction/v1/scene-model.mjs +39 -0
  50. package/compiler/source/contracts/ugc/scene-interaction/v2/interaction.mjs +80 -0
  51. package/compiler/source/contracts/ugc/scene-interaction/v2/scene-model.mjs +56 -0
  52. package/compiler/source/contracts/ugc/scene-presentation/v1/ink-math.mjs +70 -0
  53. package/compiler/source/contracts/ugc/scene-presentation/v1/render-policy.mjs +108 -0
  54. package/compiler/source/contracts/ugc/scene-presentation/v1/render-policy.schema.json +27 -0
  55. package/compiler/source/contracts/ugc/scene-presentation/v1/scene.mjs +147 -0
  56. package/compiler/source/contracts/ugc/scene-presentation/v1/scene.schema.json +66 -0
  57. package/compiler/source/contracts/ugc/v1/conformance/js/cover.mjs +23 -0
  58. package/compiler/source/contracts/ugc/v1/conformance/js/package-validator.mjs +333 -0
  59. package/compiler/source/contracts/ugc/world-scene/v1/collision-artifacts.mjs +134 -0
  60. package/compiler/source/contracts/ugc/world-scene/v1/collision-identity.mjs +73 -0
  61. package/compiler/source/contracts/ugc/world-scene/v1/collision-target.schema.json +18 -0
  62. package/compiler/source/contracts/ugc/world-scene/v1/coordinates.schema.json +16 -0
  63. package/compiler/source/contracts/ugc/world-scene/v1/flight-avatar-actions.mjs +3 -0
  64. package/compiler/source/contracts/ugc/world-scene/v1/flight-avatar-sample.schema.json +14 -0
  65. package/compiler/source/contracts/ugc/world-scene/v1/scene-declaration.mjs +99 -0
  66. package/compiler/source/contracts/ugc/world-scene/v1/scene-declaration.schema.json +40 -0
  67. package/compiler/source/contracts/ugc/world-scene/v1/visual-tileset.mjs +112 -0
  68. package/compiler/source/contracts/ugc/world-scene/v1/visual-tileset.schema.json +35 -0
  69. package/compiler/source/contracts/ugc/world-scene/v2/asset-graph.mjs +169 -0
  70. package/compiler/source/contracts/ugc/world-scene/v2/collision-index.mjs +83 -0
  71. package/compiler/source/contracts/ugc/world-scene/v2/collision-index.schema.json +29 -0
  72. package/compiler/source/contracts/ugc/world-scene/v2/collision-partition.mjs +122 -0
  73. package/compiler/source/contracts/ugc/world-scene/v2/collision-partition.schema.json +37 -0
  74. package/compiler/source/contracts/ugc/world-scene/v2/contract-set.json +50 -0
  75. package/compiler/source/contracts/ugc/world-scene/v2/encoded-resource.mjs +98 -0
  76. package/compiler/source/contracts/ugc/world-scene/v2/encoded-resource.schema.json +17 -0
  77. package/compiler/source/contracts/ugc/world-scene/v2/scene-declaration.mjs +56 -0
  78. package/compiler/source/contracts/ugc/world-scene/v2/scene-declaration.schema.json +21 -0
  79. package/compiler/source/contracts/ugc/world-scene/v2/vendor/pako-raw-inflate.mjs +45 -0
  80. package/compiler/source/contracts/ugc/world-scene/v2/vendor/pako-raw-inflate.provenance.json +43 -0
  81. package/compiler/source/contracts/ugc/world-scene/v2/visual-tileset.mjs +107 -0
  82. package/compiler/source/contracts/ugc/world-scene/v2/visual-tileset.schema.json +33 -0
  83. package/compiler/source/contracts/ugc/world-scene-runtime/v1/runtime-plan.schema.json +660 -0
  84. package/compiler/source/contracts/ugc/world-scene-runtime/v1/runtime-policy.mjs +81 -0
  85. package/compiler/source/contracts/ugc/world-scene-runtime/v2/collision-capacity.mjs +87 -0
  86. package/compiler/source/contracts/ugc/world-scene-runtime/v2/collision-capacity.schema.json +62 -0
  87. package/compiler/source/contracts/ugc/world-scene-runtime/v2/contract-set.json +45 -0
  88. package/compiler/source/contracts/ugc/world-scene-runtime/v2/report.mjs +184 -0
  89. package/compiler/source/contracts/ugc/world-scene-runtime/v2/runtime-plan.schema.json +38 -0
  90. package/compiler/source/contracts/ugc/world-scene-runtime/v2/runtime-policy.mjs +144 -0
  91. package/compiler/source/contracts/ugc/world-scene-runtime/v2/visual-work-policy.mjs +59 -0
  92. package/compiler/source/services/game-worker/src/protocol/flight.js +123 -0
  93. package/compiler/source/services/game-worker/src/protocol/realtime-error.js +9 -0
  94. package/compiler/source/services/game-worker/src/runtime/content/flight-collision-files.js +122 -0
  95. package/compiler/source/services/game-worker/src/runtime/content/flight-collision-store.js +252 -0
  96. package/compiler/source/services/game-worker/src/runtime/content/flight-runtime.js +56 -0
  97. package/compiler/source/services/game-worker/src/runtime/rooms/flight-collision.js +224 -0
  98. package/compiler/source/services/game-worker/src/runtime/rooms/flight-motion.js +56 -0
  99. package/compiler/source/services/game-worker/src/runtime/rooms/flight-preparation.js +166 -0
  100. package/compiler/source/services/game-worker/src/runtime/rooms/flight-room-controller.js +255 -0
  101. package/compiler/source/services/ugc-pipeline/src/asset-inspection-worker.mjs +72 -0
  102. package/compiler/source/services/ugc-pipeline/src/asset-inspection.mjs +230 -0
  103. package/compiler/source/services/ugc-pipeline/src/avatar-envelope.mjs +70 -0
  104. package/compiler/source/services/ugc-pipeline/src/cover-inspection-worker.mjs +15 -0
  105. package/compiler/source/services/ugc-pipeline/src/cover-inspection.mjs +94 -0
  106. package/compiler/source/services/ugc-pipeline/src/cover-png.mjs +74 -0
  107. package/compiler/source/services/ugc-pipeline/src/document-presentation-model.mjs +79 -0
  108. package/compiler/source/services/ugc-pipeline/src/flight-avatar-envelope.mjs +27 -0
  109. package/compiler/source/services/ugc-pipeline/src/ground-rules-model.mjs +99 -0
  110. package/compiler/source/services/ugc-pipeline/src/local-content.mjs +182 -0
  111. package/compiler/source/services/ugc-pipeline/src/personal-state-model.mjs +25 -0
  112. package/compiler/source/services/ugc-pipeline/src/registry-release.mjs +59 -0
  113. package/compiler/source/services/ugc-pipeline/src/resource-bindings-model.mjs +77 -0
  114. package/compiler/source/services/ugc-pipeline/src/scene-interaction-model.mjs +110 -0
  115. package/compiler/source/services/ugc-pipeline/src/scene-presentation-model.mjs +79 -0
  116. package/compiler/source/services/ugc-pipeline/src/scene-presentation-source.mjs +26 -0
  117. package/compiler/source/services/ugc-pipeline/src/scene-render-policies.json +25 -0
  118. package/compiler/source/services/ugc-pipeline/src/scene-surface-inspection.mjs +57 -0
  119. package/compiler/source/services/ugc-pipeline/src/static-scene-geometry.mjs +100 -0
  120. package/compiler/source/services/ugc-pipeline/src/visual-closure-v2.mjs +111 -0
  121. package/compiler/source/services/ugc-pipeline/src/world-scene-model.mjs +133 -0
  122. package/compiler/source/services/ugc-pipeline/src/world-scene-policies.json +71 -0
  123. package/compiler/source/services/ugc-pipeline/src/world-scene-runtime.mjs +186 -0
  124. package/contracts/ugc/capability-wiring/v1/capability-proposal.schema.json +82 -0
  125. package/contracts/ugc/capability-wiring/v1/conformance/js/wiring-validator.mjs +95 -0
  126. package/contracts/ugc/capability-wiring/v1/conformance/web/index.html +5 -0
  127. package/contracts/ugc/capability-wiring/v1/conformance/web/runner.mjs +32 -0
  128. package/contracts/ugc/capability-wiring/v1/contract-set.json +8 -0
  129. package/contracts/ugc/capability-wiring/v1/error-codes.json +15 -0
  130. package/contracts/ugc/capability-wiring/v1/needs-capability.schema.json +18 -0
  131. package/contracts/ugc/capability-wiring/v1/testdata/vectors.json +128 -0
  132. package/contracts/ugc/capability-wiring/v1/wiring-release.schema.json +66 -0
  133. package/contracts/ugc/controlled-presentation/v1/README.md +175 -0
  134. package/contracts/ugc/controlled-presentation/v1/approval.schema.json +53 -0
  135. package/contracts/ugc/controlled-presentation/v1/command.schema.json +243 -0
  136. package/contracts/ugc/controlled-presentation/v1/conformance/run-vectors.mjs +39 -0
  137. package/contracts/ugc/controlled-presentation/v1/conformance/run-view-vectors.mjs +54 -0
  138. package/contracts/ugc/controlled-presentation/v1/conformance/web/index.html +1 -0
  139. package/contracts/ugc/controlled-presentation/v1/conformance/web/runner.mjs +4 -0
  140. package/contracts/ugc/controlled-presentation/v1/conformance/web/view-runner.mjs +5 -0
  141. package/contracts/ugc/controlled-presentation/v1/conformance/web/view.html +1 -0
  142. package/contracts/ugc/controlled-presentation/v1/context.schema.json +19 -0
  143. package/contracts/ugc/controlled-presentation/v1/contract-set.json +33 -0
  144. package/contracts/ugc/controlled-presentation/v1/export-view.mjs +44 -0
  145. package/contracts/ugc/controlled-presentation/v1/grant.schema.json +120 -0
  146. package/contracts/ugc/controlled-presentation/v1/presentation.mjs +180 -0
  147. package/contracts/ugc/controlled-presentation/v1/testdata/vectors.json +565 -0
  148. package/contracts/ugc/controlled-presentation/v1/view.mjs +46 -0
  149. package/contracts/ugc/controlled-presentation/v1/view.schema.json +90 -0
  150. package/contracts/ugc/core-ecs/v1/README.md +13 -0
  151. package/contracts/ugc/core-ecs/v1/api.json +28 -0
  152. package/contracts/ugc/core-ecs/v1/conformance/run-vectors.mjs +33 -0
  153. package/contracts/ugc/core-ecs/v1/conformance/web/index.html +1 -0
  154. package/contracts/ugc/core-ecs/v1/conformance/web/runner.mjs +4 -0
  155. package/contracts/ugc/core-ecs/v1/core-view.mjs +138 -0
  156. package/contracts/ugc/core-ecs/v1/test-fixture.schema.json +169 -0
  157. package/contracts/ugc/core-ecs/v1/testdata/vectors.json +57 -0
  158. package/contracts/ugc/creator-source/v1/SOURCE-PACKAGE.md +19 -0
  159. package/contracts/ugc/creator-source/v1/source-package.mjs +87 -0
  160. package/contracts/ugc/creator-source/v1/source-package.schema.json +42 -0
  161. package/contracts/ugc/creator-source/v1/source-package.test.mjs +69 -0
  162. package/contracts/ugc/creator-source/v1/tool-package.schema.json +11 -0
  163. package/contracts/ugc/document-presentation/v1/README.md +167 -0
  164. package/contracts/ugc/document-presentation/v1/contract-set.json +18 -0
  165. package/contracts/ugc/document-presentation/v1/document.mjs +165 -0
  166. package/contracts/ugc/document-presentation/v1/document.schema.json +161 -0
  167. package/contracts/ugc/document-presentation/v1/document.test.mjs +138 -0
  168. package/contracts/ugc/document-presentation/v1/profile.json +24 -0
  169. package/contracts/ugc/document-presentation/v1/source.schema.json +88 -0
  170. package/contracts/ugc/ecs-runtime/v1/README.md +25 -0
  171. package/contracts/ugc/ecs-runtime/v1/api.json +46 -0
  172. package/contracts/ugc/ecs-runtime/v1/conformance/run-vectors.mjs +41 -0
  173. package/contracts/ugc/ecs-runtime/v1/conformance/web/index.html +3 -0
  174. package/contracts/ugc/ecs-runtime/v1/conformance/web/runner.mjs +5 -0
  175. package/contracts/ugc/ecs-runtime/v1/private-world.mjs +299 -0
  176. package/contracts/ugc/ecs-runtime/v1/testdata/vectors.json +1318 -0
  177. package/contracts/ugc/gameplay-tests/v1/README.md +78 -0
  178. package/contracts/ugc/gameplay-tests/v1/cases.mjs +70 -0
  179. package/contracts/ugc/gameplay-tests/v1/cases.schema.json +262 -0
  180. package/contracts/ugc/gameplay-tests/v1/conformance/run-vectors.mjs +21 -0
  181. package/contracts/ugc/gameplay-tests/v1/conformance/web/index.html +1 -0
  182. package/contracts/ugc/gameplay-tests/v1/conformance/web/runner.mjs +4 -0
  183. package/contracts/ugc/gameplay-tests/v1/contract-set.json +9 -0
  184. package/contracts/ugc/gameplay-tests/v1/scene-step.mjs +49 -0
  185. package/contracts/ugc/gameplay-tests/v1/testdata/vectors.json +1504 -0
  186. package/contracts/ugc/ground-rules/v1/README.md +44 -0
  187. package/contracts/ugc/ground-rules/v1/conformance/run-vectors.mjs +31 -0
  188. package/contracts/ugc/ground-rules/v1/conformance/web/index.html +1 -0
  189. package/contracts/ugc/ground-rules/v1/conformance/web/runner.mjs +4 -0
  190. package/contracts/ugc/ground-rules/v1/contract-set.json +9 -0
  191. package/contracts/ugc/ground-rules/v1/effective-ground-rules.schema.json +27 -0
  192. package/contracts/ugc/ground-rules/v1/ground-rules.mjs +98 -0
  193. package/contracts/ugc/ground-rules/v1/ground-rules.schema.json +33 -0
  194. package/contracts/ugc/ground-rules/v1/testdata/vectors.json +57 -0
  195. package/contracts/ugc/ground-rules/v2/README.md +88 -0
  196. package/contracts/ugc/ground-rules/v2/contract-set.json +20 -0
  197. package/contracts/ugc/ground-rules/v2/ground-rules.mjs +138 -0
  198. package/contracts/ugc/ground-rules/v2/ground-rules.schema.json +373 -0
  199. package/contracts/ugc/ground-rules/v2/heightfield.mjs +89 -0
  200. package/contracts/ugc/ground-rules/v2/movement.mjs +12 -0
  201. package/contracts/ugc/ground-rules/v2/spaces.test.mjs +58 -0
  202. package/contracts/ugc/ground-rules/v2/spatial-source.mjs +193 -0
  203. package/contracts/ugc/ground-rules/v2/spatial-source.schema.json +788 -0
  204. package/contracts/ugc/ground-rules/v2/spatial.test.mjs +142 -0
  205. package/contracts/ugc/ground-rules/v2.2/README.md +73 -0
  206. package/contracts/ugc/ground-rules/v2.2/center-band.mjs +142 -0
  207. package/contracts/ugc/ground-rules/v2.2/center-band.test.mjs +149 -0
  208. package/contracts/ugc/ground-rules/v2.2/contract-set.json +8 -0
  209. package/contracts/ugc/ground-rules/v2.2/spatial-source.mjs +77 -0
  210. package/contracts/ugc/ground-rules/v2.2/spatial-source.schema.json +1049 -0
  211. package/contracts/ugc/local-content/v1/LOCAL-LAUNCH.md +11 -0
  212. package/contracts/ugc/local-content/v1/README.md +45 -0
  213. package/contracts/ugc/local-content/v1/conformance.test.mjs +67 -0
  214. package/contracts/ugc/local-content/v1/document-local-content-snapshot.schema.json +306 -0
  215. package/contracts/ugc/local-content/v1/document-snapshot.mjs +114 -0
  216. package/contracts/ugc/local-content/v1/local-content-snapshot.schema.json +54 -0
  217. package/contracts/ugc/local-content/v1/local-launch.test.mjs +51 -0
  218. package/contracts/ugc/local-content/v1/presentation-vectors.json +18 -0
  219. package/contracts/ugc/local-content/v1/snapshot.mjs +171 -0
  220. package/contracts/ugc/local-content/v1/tool-version-vectors.json +28 -0
  221. package/contracts/ugc/personal-state/v1/README.md +181 -0
  222. package/contracts/ugc/personal-state/v1/declaration.mjs +86 -0
  223. package/contracts/ugc/personal-state/v1/declaration.schema.json +295 -0
  224. package/contracts/ugc/personal-state/v1/declaration.test.mjs +26 -0
  225. package/contracts/ugc/personal-state/v1/marker.schema.json +9 -0
  226. package/contracts/ugc/personal-state/v1/node-plan.mjs +51 -0
  227. package/contracts/ugc/personal-state/v1/node-plan.test.mjs +65 -0
  228. package/contracts/ugc/pipeline/v1/PLATFORM-SOURCE.md +54 -0
  229. package/contracts/ugc/pipeline/v1/PRESENTATION.md +13 -0
  230. package/contracts/ugc/pipeline/v1/build-record.schema.json +93 -0
  231. package/contracts/ugc/pipeline/v1/conformance/js/pipeline-validator.mjs +196 -0
  232. package/contracts/ugc/pipeline/v1/conformance/js/platform-release-validator.mjs +78 -0
  233. package/contracts/ugc/pipeline/v1/conformance/web/index.html +5 -0
  234. package/contracts/ugc/pipeline/v1/conformance/web/runner.mjs +30 -0
  235. package/contracts/ugc/pipeline/v1/contract-set.json +30 -0
  236. package/contracts/ugc/pipeline/v1/error-codes.json +95 -0
  237. package/contracts/ugc/pipeline/v1/platform-publication-binding.schema.json +56 -0
  238. package/contracts/ugc/pipeline/v1/public-release-descriptor.schema.json +264 -0
  239. package/contracts/ugc/pipeline/v1/publication-operation.schema.json +97 -0
  240. package/contracts/ugc/pipeline/v1/release-index.schema.json +192 -0
  241. package/contracts/ugc/pipeline/v1/review-decision.schema.json +212 -0
  242. package/contracts/ugc/pipeline/v1/submission-receipt.schema.json +15 -0
  243. package/contracts/ugc/pipeline/v1/testdata/vectors.json +1713 -0
  244. package/contracts/ugc/private-event-view/v1/README.md +83 -0
  245. package/contracts/ugc/private-event-view/v1/conformance/run-vectors.mjs +65 -0
  246. package/contracts/ugc/private-event-view/v1/conformance/web/index.html +1 -0
  247. package/contracts/ugc/private-event-view/v1/conformance/web/runner.mjs +5 -0
  248. package/contracts/ugc/private-event-view/v1/contract-set.json +9 -0
  249. package/contracts/ugc/private-event-view/v1/export.mjs +22 -0
  250. package/contracts/ugc/private-event-view/v1/testdata/vectors.json +22 -0
  251. package/contracts/ugc/private-event-view/v1/view.mjs +130 -0
  252. package/contracts/ugc/private-event-view/v1/view.schema.json +204 -0
  253. package/contracts/ugc/private-events/v1/README.md +102 -0
  254. package/contracts/ugc/private-events/v1/conformance/run-vectors.mjs +52 -0
  255. package/contracts/ugc/private-events/v1/conformance/web/index.html +1 -0
  256. package/contracts/ugc/private-events/v1/conformance/web/runner.mjs +4 -0
  257. package/contracts/ugc/private-events/v1/contract-set.json +9 -0
  258. package/contracts/ugc/private-events/v1/declaration.mjs +25 -0
  259. package/contracts/ugc/private-events/v1/events.mjs +189 -0
  260. package/contracts/ugc/private-events/v1/events.schema.json +19 -0
  261. package/contracts/ugc/private-events/v1/grant.schema.json +15 -0
  262. package/contracts/ugc/private-events/v1/output.schema.json +15 -0
  263. package/contracts/ugc/private-events/v1/testdata/vectors.json +55 -0
  264. package/contracts/ugc/private-state/v1/README.md +95 -0
  265. package/contracts/ugc/private-state/v1/conformance/run-vectors.mjs +40 -0
  266. package/contracts/ugc/private-state/v1/conformance/web/index.html +1 -0
  267. package/contracts/ugc/private-state/v1/conformance/web/runner.mjs +4 -0
  268. package/contracts/ugc/private-state/v1/contract-set.json +9 -0
  269. package/contracts/ugc/private-state/v1/field-table.schema.json +136 -0
  270. package/contracts/ugc/private-state/v1/projection.mjs +178 -0
  271. package/contracts/ugc/private-state/v1/projection.schema.json +515 -0
  272. package/contracts/ugc/private-state/v1/testdata/vectors.json +76 -0
  273. package/contracts/ugc/private-state-view/v1/README.md +91 -0
  274. package/contracts/ugc/private-state-view/v1/conformance/run-vectors.mjs +52 -0
  275. package/contracts/ugc/private-state-view/v1/conformance/web/index.html +1 -0
  276. package/contracts/ugc/private-state-view/v1/conformance/web/runner.mjs +5 -0
  277. package/contracts/ugc/private-state-view/v1/contract-set.json +24 -0
  278. package/contracts/ugc/private-state-view/v1/export.mjs +29 -0
  279. package/contracts/ugc/private-state-view/v1/publication.schema.json +82 -0
  280. package/contracts/ugc/private-state-view/v1/testdata/vectors.json +21 -0
  281. package/contracts/ugc/private-state-view/v1/view.mjs +199 -0
  282. package/contracts/ugc/private-state-view/v1/view.schema.json +255 -0
  283. package/contracts/ugc/public-runtime/v1/README.md +136 -0
  284. package/contracts/ugc/public-runtime/v1/archive.mjs +52 -0
  285. package/contracts/ugc/public-runtime/v1/document-runtime.test.mjs +118 -0
  286. package/contracts/ugc/public-runtime/v1/format-fixture.mjs +28 -0
  287. package/contracts/ugc/public-runtime/v1/golden.json +11 -0
  288. package/contracts/ugc/public-runtime/v1/manifest.mjs +167 -0
  289. package/contracts/ugc/public-runtime/v1/runtime-lock.schema.json +85 -0
  290. package/contracts/ugc/public-runtime/v1/runtime-manifest.schema.json +751 -0
  291. package/contracts/ugc/public-runtime/v1/runtime.test.mjs +155 -0
  292. package/contracts/ugc/public-runtime/v1/vectors.json +157 -0
  293. package/contracts/ugc/registry/v1/capabilities-lock.schema.json +110 -0
  294. package/contracts/ugc/registry/v1/capability-query-result.schema.json +33 -0
  295. package/contracts/ugc/registry/v1/capability-query.schema.json +14 -0
  296. package/contracts/ugc/registry/v1/capability-registry.schema.json +83 -0
  297. package/contracts/ugc/registry/v1/conformance/js/capability-resolver.mjs +191 -0
  298. package/contracts/ugc/registry/v1/conformance/web/index.html +5 -0
  299. package/contracts/ugc/registry/v1/conformance/web/runner.mjs +68 -0
  300. package/contracts/ugc/registry/v1/contract-set.json +23 -0
  301. package/contracts/ugc/registry/v1/effective-budgets.schema.json +34 -0
  302. package/contracts/ugc/registry/v1/error-codes.json +11 -0
  303. package/contracts/ugc/registry/v1/network-profile-lock.schema.json +26 -0
  304. package/contracts/ugc/registry/v1/registry.json +1 -0
  305. package/contracts/ugc/registry/v1/resolution-policy.json +70 -0
  306. package/contracts/ugc/registry/v1/resolution-result.schema.json +49 -0
  307. package/contracts/ugc/registry/v1/testdata/vectors.json +405 -0
  308. package/contracts/ugc/resource-bindings/v1/AUTHORED-AVATAR.md +133 -0
  309. package/contracts/ugc/resource-bindings/v1/README.md +61 -0
  310. package/contracts/ugc/resource-bindings/v1/authored-avatar.mjs +183 -0
  311. package/contracts/ugc/resource-bindings/v1/authored-avatar.schema.json +48 -0
  312. package/contracts/ugc/resource-bindings/v1/bindings.mjs +133 -0
  313. package/contracts/ugc/resource-bindings/v1/bindings.schema.json +45 -0
  314. package/contracts/ugc/resource-bindings/v1/conformance/authored-avatar-vectors.mjs +26 -0
  315. package/contracts/ugc/resource-bindings/v1/conformance/run-vectors.mjs +32 -0
  316. package/contracts/ugc/resource-bindings/v1/conformance/web/index.html +1 -0
  317. package/contracts/ugc/resource-bindings/v1/conformance/web/runner.mjs +13 -0
  318. package/contracts/ugc/resource-bindings/v1/contract-set.json +9 -0
  319. package/contracts/ugc/resource-bindings/v1/testdata/authored-avatar-vectors.json +146 -0
  320. package/contracts/ugc/resource-bindings/v1/testdata/authored-avatar.json +13 -0
  321. package/contracts/ugc/resource-bindings/v1/testdata/vectors.json +68 -0
  322. package/contracts/ugc/sandbox/v1/conformance/js/sandbox-validator.mjs +152 -0
  323. package/contracts/ugc/sandbox/v1/conformance/web/index.html +5 -0
  324. package/contracts/ugc/sandbox/v1/conformance/web/runner.mjs +26 -0
  325. package/contracts/ugc/sandbox/v1/contract-set.json +19 -0
  326. package/contracts/ugc/sandbox/v1/error-codes.json +25 -0
  327. package/contracts/ugc/sandbox/v1/execution-result.schema.json +80 -0
  328. package/contracts/ugc/sandbox/v1/launch-request.schema.json +96 -0
  329. package/contracts/ugc/sandbox/v1/lifecycle-message.schema.json +18 -0
  330. package/contracts/ugc/sandbox/v1/local-launch-request.schema.json +34 -0
  331. package/contracts/ugc/sandbox/v1/private-ecs-grant.schema.json +32 -0
  332. package/contracts/ugc/sandbox/v1/sandbox-profile.schema.json +70 -0
  333. package/contracts/ugc/sandbox/v1/testdata/vectors.json +89 -0
  334. package/contracts/ugc/scene-interaction/v1/README.md +63 -0
  335. package/contracts/ugc/scene-interaction/v1/conformance/run-vectors.mjs +26 -0
  336. package/contracts/ugc/scene-interaction/v1/conformance/web/index.html +1 -0
  337. package/contracts/ugc/scene-interaction/v1/conformance/web/runner.mjs +4 -0
  338. package/contracts/ugc/scene-interaction/v1/contract-set.json +26 -0
  339. package/contracts/ugc/scene-interaction/v1/effective-targets.schema.json +76 -0
  340. package/contracts/ugc/scene-interaction/v1/interaction.mjs +83 -0
  341. package/contracts/ugc/scene-interaction/v1/request.schema.json +30 -0
  342. package/contracts/ugc/scene-interaction/v1/result.schema.json +88 -0
  343. package/contracts/ugc/scene-interaction/v1/scene-model.mjs +39 -0
  344. package/contracts/ugc/scene-interaction/v1/targets.schema.json +49 -0
  345. package/contracts/ugc/scene-interaction/v1/testdata/vectors.json +732 -0
  346. package/contracts/ugc/scene-interaction/v2/README.md +63 -0
  347. package/contracts/ugc/scene-interaction/v2/contract-set.json +19 -0
  348. package/contracts/ugc/scene-interaction/v2/interaction.mjs +80 -0
  349. package/contracts/ugc/scene-interaction/v2/metric.test.mjs +99 -0
  350. package/contracts/ugc/scene-interaction/v2/scene-model.mjs +56 -0
  351. package/contracts/ugc/scene-interaction/v2/targets.schema.json +229 -0
  352. package/contracts/ugc/scene-presentation/v1/INK-MATH.md +64 -0
  353. package/contracts/ugc/scene-presentation/v1/README.md +126 -0
  354. package/contracts/ugc/scene-presentation/v1/RENDER-POLICY.md +63 -0
  355. package/contracts/ugc/scene-presentation/v1/conformance/ink-vectors.mjs +34 -0
  356. package/contracts/ugc/scene-presentation/v1/conformance/render-policy-vectors.mjs +62 -0
  357. package/contracts/ugc/scene-presentation/v1/conformance/vectors.mjs +128 -0
  358. package/contracts/ugc/scene-presentation/v1/contract-set.json +6 -0
  359. package/contracts/ugc/scene-presentation/v1/ink-math.mjs +70 -0
  360. package/contracts/ugc/scene-presentation/v1/render-policy.mjs +108 -0
  361. package/contracts/ugc/scene-presentation/v1/render-policy.schema.json +27 -0
  362. package/contracts/ugc/scene-presentation/v1/scene.mjs +147 -0
  363. package/contracts/ugc/scene-presentation/v1/scene.schema.json +66 -0
  364. package/contracts/ugc/v1/COVER.md +38 -0
  365. package/contracts/ugc/v1/SCENE-PROVENANCE.md +54 -0
  366. package/contracts/ugc/v1/candidate-submission.schema.json +16 -0
  367. package/contracts/ugc/v1/capability-request.schema.json +29 -0
  368. package/contracts/ugc/v1/compatibility.json +32 -0
  369. package/contracts/ugc/v1/components.schema.json +77 -0
  370. package/contracts/ugc/v1/conformance/js/capability-operations.mjs +13 -0
  371. package/contracts/ugc/v1/conformance/js/cover.mjs +23 -0
  372. package/contracts/ugc/v1/conformance/js/package-validator.mjs +333 -0
  373. package/contracts/ugc/v1/conformance/js/scene-provenance.mjs +121 -0
  374. package/contracts/ugc/v1/conformance/js/source-validator.mjs +99 -0
  375. package/contracts/ugc/v1/conformance/web/index.html +5 -0
  376. package/contracts/ugc/v1/conformance/web/runner.mjs +82 -0
  377. package/contracts/ugc/v1/contract-set.json +38 -0
  378. package/contracts/ugc/v1/creator-sdk.json +84 -0
  379. package/contracts/ugc/v1/error-codes.json +53 -0
  380. package/contracts/ugc/v1/manifest.schema.json +215 -0
  381. package/contracts/ugc/v1/network-intent.schema.json +15 -0
  382. package/contracts/ugc/v1/prefabs.schema.json +29 -0
  383. package/contracts/ugc/v1/provenance.schema.json +160 -0
  384. package/contracts/ugc/v1/scene.schema.json +37 -0
  385. package/contracts/ugc/v1/testdata/capability-operation-vectors.json +243 -0
  386. package/contracts/ugc/v1/testdata/cover-vectors.json +25 -0
  387. package/contracts/ugc/v1/testdata/invalid/authored-avatar-missing-capability.json +44 -0
  388. package/contracts/ugc/v1/testdata/invalid/authored-avatar-wrong-capability.json +51 -0
  389. package/contracts/ugc/v1/testdata/invalid/budget-overflow.json +1 -0
  390. package/contracts/ugc/v1/testdata/invalid/build-field-override.json +1 -0
  391. package/contracts/ugc/v1/testdata/invalid/creator-server-entrypoint.json +5 -0
  392. package/contracts/ugc/v1/testdata/invalid/forbidden-network-control.json +1 -0
  393. package/contracts/ugc/v1/testdata/invalid/ground-authority.json +57 -0
  394. package/contracts/ugc/v1/testdata/invalid/ground-budget.json +56 -0
  395. package/contracts/ugc/v1/testdata/invalid/ground-dependency.json +49 -0
  396. package/contracts/ugc/v1/testdata/invalid/ground-identity.json +56 -0
  397. package/contracts/ugc/v1/testdata/invalid/ground-missing.json +13 -0
  398. package/contracts/ugc/v1/testdata/invalid/ground-optional.json +60 -0
  399. package/contracts/ugc/v1/testdata/invalid/ground-path.json +56 -0
  400. package/contracts/ugc/v1/testdata/invalid/ground-run-dependency.json +56 -0
  401. package/contracts/ugc/v1/testdata/invalid/ground-version.json +56 -0
  402. package/contracts/ugc/v1/testdata/invalid/missing-required-field.json +1 -0
  403. package/contracts/ugc/v1/testdata/invalid/missing-shared-entrypoint.json +5 -0
  404. package/contracts/ugc/v1/testdata/invalid/path-escape.json +1 -0
  405. package/contracts/ugc/v1/testdata/invalid/private-events-authority.json +35 -0
  406. package/contracts/ugc/v1/testdata/invalid/private-events-budget.json +35 -0
  407. package/contracts/ugc/v1/testdata/invalid/private-events-dependency.json +27 -0
  408. package/contracts/ugc/v1/testdata/invalid/private-events-empty.json +20 -0
  409. package/contracts/ugc/v1/testdata/invalid/private-events-identity.json +34 -0
  410. package/contracts/ugc/v1/testdata/invalid/private-events-missing.json +13 -0
  411. package/contracts/ugc/v1/testdata/invalid/private-events-optional.json +38 -0
  412. package/contracts/ugc/v1/testdata/invalid/private-events-path.json +34 -0
  413. package/contracts/ugc/v1/testdata/invalid/private-events-type.json +34 -0
  414. package/contracts/ugc/v1/testdata/invalid/private-events-unknown-ref.json +34 -0
  415. package/contracts/ugc/v1/testdata/invalid/private-events-version.json +34 -0
  416. package/contracts/ugc/v1/testdata/invalid/resource-bindings-identity.json +18 -0
  417. package/contracts/ugc/v1/testdata/invalid/resource-bindings-kind.json +19 -0
  418. package/contracts/ugc/v1/testdata/invalid/resource-bindings-missing.json +6 -0
  419. package/contracts/ugc/v1/testdata/invalid/resource-bindings-path.json +6 -0
  420. package/contracts/ugc/v1/testdata/invalid/resource-bindings-type.json +8 -0
  421. package/contracts/ugc/v1/testdata/invalid/resource-bindings-unknown.json +18 -0
  422. package/contracts/ugc/v1/testdata/invalid/scene-interactions-authority.json +61 -0
  423. package/contracts/ugc/v1/testdata/invalid/scene-interactions-core-unknown.json +61 -0
  424. package/contracts/ugc/v1/testdata/invalid/scene-interactions-dependency.json +53 -0
  425. package/contracts/ugc/v1/testdata/invalid/scene-interactions-identity.json +60 -0
  426. package/contracts/ugc/v1/testdata/invalid/scene-interactions-missing-transform.json +50 -0
  427. package/contracts/ugc/v1/testdata/invalid/scene-interactions-missing.json +49 -0
  428. package/contracts/ugc/v1/testdata/invalid/scene-interactions-optional.json +64 -0
  429. package/contracts/ugc/v1/testdata/invalid/scene-interactions-partial-transform.json +59 -0
  430. package/contracts/ugc/v1/testdata/invalid/scene-interactions-path.json +60 -0
  431. package/contracts/ugc/v1/testdata/invalid/scene-interactions-radius.json +60 -0
  432. package/contracts/ugc/v1/testdata/invalid/scene-interactions-unknown-target.json +60 -0
  433. package/contracts/ugc/v1/testdata/invalid/scene-interactions-version.json +60 -0
  434. package/contracts/ugc/v1/testdata/invalid/scene-presentation-authority.json +166 -0
  435. package/contracts/ugc/v1/testdata/invalid/scene-presentation-capability.json +158 -0
  436. package/contracts/ugc/v1/testdata/invalid/scene-presentation-identity.json +165 -0
  437. package/contracts/ugc/v1/testdata/invalid/scene-presentation-missing.json +13 -0
  438. package/contracts/ugc/v1/testdata/invalid/scene-presentation-optional.json +169 -0
  439. package/contracts/ugc/v1/testdata/invalid/scene-presentation-path.json +165 -0
  440. package/contracts/ugc/v1/testdata/invalid/scene-presentation-undeclared.json +163 -0
  441. package/contracts/ugc/v1/testdata/invalid/scene-presentation-unknown-material.json +165 -0
  442. package/contracts/ugc/v1/testdata/invalid/schema-incompatible.json +1 -0
  443. package/contracts/ugc/v1/testdata/invalid/unknown-required-component.json +1 -0
  444. package/contracts/ugc/v1/testdata/invalid/world-scene-dual-motion.json +7 -0
  445. package/contracts/ugc/v1/testdata/invalid/world-scene-identity.json +90 -0
  446. package/contracts/ugc/v1/testdata/invalid/world-scene-missing-capability.json +85 -0
  447. package/contracts/ugc/v1/testdata/invalid/world-scene-missing.json +28 -0
  448. package/contracts/ugc/v1/testdata/invalid/world-scene-optional-capability.json +94 -0
  449. package/contracts/ugc/v1/testdata/invalid/world-scene-path.json +6 -0
  450. package/contracts/ugc/v1/testdata/invalid/world-scene-version.json +90 -0
  451. package/contracts/ugc/v1/testdata/scene-provenance-vectors.json +56 -0
  452. package/contracts/ugc/v1/testdata/source-vectors.json +83 -0
  453. package/contracts/ugc/v1/testdata/valid/authored-avatar.json +51 -0
  454. package/contracts/ugc/v1/testdata/valid/boundary.json +1 -0
  455. package/contracts/ugc/v1/testdata/valid/components.json +15 -0
  456. package/contracts/ugc/v1/testdata/valid/cosmetic.json +9 -0
  457. package/contracts/ugc/v1/testdata/valid/ground-rules.json +56 -0
  458. package/contracts/ugc/v1/testdata/valid/minimal.json +15 -0
  459. package/contracts/ugc/v1/testdata/valid/prefabs.json +11 -0
  460. package/contracts/ugc/v1/testdata/valid/private-events.json +34 -0
  461. package/contracts/ugc/v1/testdata/valid/resource-bindings.json +18 -0
  462. package/contracts/ugc/v1/testdata/valid/scene-interactions.json +60 -0
  463. package/contracts/ugc/v1/testdata/valid/scene-presentation.json +165 -0
  464. package/contracts/ugc/v1/testdata/valid/scene.json +6 -0
  465. package/contracts/ugc/v1/testdata/valid/unknown-optional-component.json +1 -0
  466. package/contracts/ugc/v1/testdata/valid/world-scene.json +90 -0
  467. package/contracts/ugc/v1/testdata/vectors.json +555 -0
  468. package/contracts/ugc/v1/validation-report.schema.json +61 -0
  469. package/contracts/ugc/world-scene/v1/ASSET-GRAPH.md +33 -0
  470. package/contracts/ugc/world-scene/v1/COLLISION-ARTIFACTS.md +124 -0
  471. package/contracts/ugc/world-scene/v1/FLIGHT-AVATAR-ACTIONS.md +92 -0
  472. package/contracts/ugc/world-scene/v1/README.md +117 -0
  473. package/contracts/ugc/world-scene/v1/SCENE-DECLARATION.md +135 -0
  474. package/contracts/ugc/world-scene/v1/VISUAL-TILESET.md +125 -0
  475. package/contracts/ugc/world-scene/v1/asset-graph.mjs +126 -0
  476. package/contracts/ugc/world-scene/v1/collision-artifacts.mjs +134 -0
  477. package/contracts/ugc/world-scene/v1/collision-identity.mjs +73 -0
  478. package/contracts/ugc/world-scene/v1/collision-index.schema.json +34 -0
  479. package/contracts/ugc/world-scene/v1/collision-target.schema.json +18 -0
  480. package/contracts/ugc/world-scene/v1/conformance/artifact-vectors.mjs +15 -0
  481. package/contracts/ugc/world-scene/v1/conformance/flight-avatar-vectors.mjs +27 -0
  482. package/contracts/ugc/world-scene/v1/conformance/run-vectors.mjs +29 -0
  483. package/contracts/ugc/world-scene/v1/conformance/scene-declaration-vectors.mjs +28 -0
  484. package/contracts/ugc/world-scene/v1/conformance/visual-tileset-vectors.mjs +24 -0
  485. package/contracts/ugc/world-scene/v1/conformance/web/index.html +8 -0
  486. package/contracts/ugc/world-scene/v1/conformance/web/runner.mjs +53 -0
  487. package/contracts/ugc/world-scene/v1/contract-set.json +40 -0
  488. package/contracts/ugc/world-scene/v1/coordinates.schema.json +16 -0
  489. package/contracts/ugc/world-scene/v1/flight-avatar-actions.mjs +3 -0
  490. package/contracts/ugc/world-scene/v1/flight-avatar-sample.schema.json +14 -0
  491. package/contracts/ugc/world-scene/v1/scene-declaration.mjs +99 -0
  492. package/contracts/ugc/world-scene/v1/scene-declaration.schema.json +40 -0
  493. package/contracts/ugc/world-scene/v1/testdata/artifact-vectors.json +18 -0
  494. package/contracts/ugc/world-scene/v1/testdata/flight-avatar-actions.json +48 -0
  495. package/contracts/ugc/world-scene/v1/testdata/scene-declaration-vectors.json +103 -0
  496. package/contracts/ugc/world-scene/v1/testdata/vectors.json +55 -0
  497. package/contracts/ugc/world-scene/v1/testdata/visual-tileset-vectors.json +27 -0
  498. package/contracts/ugc/world-scene/v1/visual-tileset.mjs +112 -0
  499. package/contracts/ugc/world-scene/v1/visual-tileset.schema.json +35 -0
  500. package/contracts/ugc/world-scene/v2/ASSET-GRAPH.md +13 -0
  501. package/contracts/ugc/world-scene/v2/ENCODED-RESOURCES.md +117 -0
  502. package/contracts/ugc/world-scene/v2/PARTITION.md +59 -0
  503. package/contracts/ugc/world-scene/v2/VISUAL-TILESET.md +80 -0
  504. package/contracts/ugc/world-scene/v2/asset-graph.mjs +169 -0
  505. package/contracts/ugc/world-scene/v2/collision-index.mjs +83 -0
  506. package/contracts/ugc/world-scene/v2/collision-index.schema.json +29 -0
  507. package/contracts/ugc/world-scene/v2/collision-partition.mjs +122 -0
  508. package/contracts/ugc/world-scene/v2/collision-partition.schema.json +37 -0
  509. package/contracts/ugc/world-scene/v2/conformance/asset-graph-vectors.mjs +52 -0
  510. package/contracts/ugc/world-scene/v2/conformance/collision-index-vectors.mjs +29 -0
  511. package/contracts/ugc/world-scene/v2/conformance/encoded-resource-vectors.mjs +17 -0
  512. package/contracts/ugc/world-scene/v2/conformance/partition-vectors.mjs +74 -0
  513. package/contracts/ugc/world-scene/v2/conformance/visual-vectors.mjs +24 -0
  514. package/contracts/ugc/world-scene/v2/contract-set.json +50 -0
  515. package/contracts/ugc/world-scene/v2/encoded-resource.mjs +98 -0
  516. package/contracts/ugc/world-scene/v2/encoded-resource.schema.json +17 -0
  517. package/contracts/ugc/world-scene/v2/scene-declaration.mjs +56 -0
  518. package/contracts/ugc/world-scene/v2/scene-declaration.schema.json +21 -0
  519. package/contracts/ugc/world-scene/v2/testdata/asset-graph-vectors.json +3354 -0
  520. package/contracts/ugc/world-scene/v2/testdata/collision-index-vectors.json +103 -0
  521. package/contracts/ugc/world-scene/v2/testdata/encoded-resource-vectors.json +372 -0
  522. package/contracts/ugc/world-scene/v2/testdata/visual-vectors.json +43 -0
  523. package/contracts/ugc/world-scene/v2/vendor/pako-raw-inflate.mjs +45 -0
  524. package/contracts/ugc/world-scene/v2/vendor/pako-raw-inflate.provenance.json +43 -0
  525. package/contracts/ugc/world-scene/v2/visual-tileset.mjs +107 -0
  526. package/contracts/ugc/world-scene/v2/visual-tileset.schema.json +33 -0
  527. package/contracts/ugc/world-scene-runtime/v1/README.md +127 -0
  528. package/contracts/ugc/world-scene-runtime/v1/REPORT.md +87 -0
  529. package/contracts/ugc/world-scene-runtime/v1/conformance/report-vectors.mjs +104 -0
  530. package/contracts/ugc/world-scene-runtime/v1/conformance/run-vectors.mjs +22 -0
  531. package/contracts/ugc/world-scene-runtime/v1/report.mjs +151 -0
  532. package/contracts/ugc/world-scene-runtime/v1/runtime-plan.schema.json +660 -0
  533. package/contracts/ugc/world-scene-runtime/v1/runtime-policy.mjs +81 -0
  534. package/contracts/ugc/world-scene-runtime/v1/testdata/policy-vectors.json +40 -0
  535. package/contracts/ugc/world-scene-runtime/v1/testdata/report-fixture.json +236 -0
  536. package/contracts/ugc/world-scene-runtime/v2/COLLISION-CAPACITY.md +74 -0
  537. package/contracts/ugc/world-scene-runtime/v2/REPORT.md +91 -0
  538. package/contracts/ugc/world-scene-runtime/v2/RUNTIME-PROJECTION.md +110 -0
  539. package/contracts/ugc/world-scene-runtime/v2/VISUAL-WORK.md +72 -0
  540. package/contracts/ugc/world-scene-runtime/v2/collision-capacity.mjs +87 -0
  541. package/contracts/ugc/world-scene-runtime/v2/collision-capacity.schema.json +62 -0
  542. package/contracts/ugc/world-scene-runtime/v2/conformance/capacity-vectors.mjs +25 -0
  543. package/contracts/ugc/world-scene-runtime/v2/conformance/report-vectors.mjs +141 -0
  544. package/contracts/ugc/world-scene-runtime/v2/conformance/runtime-vectors.mjs +41 -0
  545. package/contracts/ugc/world-scene-runtime/v2/conformance/visual-work-vectors.mjs +21 -0
  546. package/contracts/ugc/world-scene-runtime/v2/contract-set.json +45 -0
  547. package/contracts/ugc/world-scene-runtime/v2/report.mjs +184 -0
  548. package/contracts/ugc/world-scene-runtime/v2/runtime-plan.schema.json +38 -0
  549. package/contracts/ugc/world-scene-runtime/v2/runtime-policy.mjs +144 -0
  550. package/contracts/ugc/world-scene-runtime/v2/testdata/capacity-vectors.json +30 -0
  551. package/contracts/ugc/world-scene-runtime/v2/testdata/report-fixture.json +250 -0
  552. package/contracts/ugc/world-scene-runtime/v2/testdata/runtime-vectors.json +39 -0
  553. package/contracts/ugc/world-scene-runtime/v2/testdata/visual-work-vectors.json +28 -0
  554. package/contracts/ugc/world-scene-runtime/v2/visual-work-policy.mjs +59 -0
  555. package/creator-release.json +6 -0
  556. package/docs/assets-3d-spec.md +112 -0
  557. package/docs/harness-onboarding.md +171 -0
  558. package/docs/meshy.md +75 -0
  559. package/docs/npm-creator.md +908 -0
  560. package/docs/runtime-download.md +178 -0
  561. package/document-action-result.source-lock.json +22 -0
  562. package/document-presentation.snapshot.lock.json +40 -0
  563. package/ground-endpoint.snapshot.lock.json +36 -0
  564. package/ground-spaces.snapshot.lock.json +57 -0
  565. package/lib/capability-harness.mjs +26 -0
  566. package/lib/creator-agent-studio.mjs +57 -0
  567. package/lib/creator-agent.mjs +7 -0
  568. package/lib/creator-api.mjs +637 -0
  569. package/lib/creator-cli.mjs +545 -0
  570. package/lib/creator-contribution.mjs +263 -0
  571. package/lib/creator-discovery.mjs +35 -0
  572. package/lib/creator-init-paths.mjs +56 -0
  573. package/lib/creator-init.mjs +132 -0
  574. package/lib/creator-install.mjs +323 -0
  575. package/lib/creator-materials.mjs +32 -0
  576. package/lib/creator-mcp.mjs +198 -0
  577. package/lib/creator-onboarding.mjs +27 -0
  578. package/lib/creator-package-identity.mjs +23 -0
  579. package/lib/creator-platform.mjs +138 -0
  580. package/lib/creator-project-snapshot.mjs +151 -0
  581. package/lib/creator-project-update.mjs +200 -0
  582. package/lib/creator-project.mjs +424 -0
  583. package/lib/creator-provenance.mjs +90 -0
  584. package/lib/creator-session.mjs +256 -0
  585. package/lib/creator-source-archive.mjs +182 -0
  586. package/lib/creator-source-download.mjs +160 -0
  587. package/lib/creator-source-git.mjs +72 -0
  588. package/lib/creator-source-package.mjs +47 -0
  589. package/lib/creator-submit.mjs +289 -0
  590. package/lib/creator-toolchain-compat.mjs +89 -0
  591. package/lib/creator-upgrade.mjs +195 -0
  592. package/lib/creator-upload-state.mjs +107 -0
  593. package/lib/document-action-result.mjs +21 -0
  594. package/lib/document-presentation.mjs +110 -0
  595. package/lib/host-ipc/distribution-document-tool-package-contract/contracts/ugc/creator-source/v1/tool-package.schema.json +11 -0
  596. package/lib/host-ipc/host-ipc.schema.json +1186 -0
  597. package/lib/host-ipc/runtime-contract.mjs +70 -0
  598. package/lib/host-ipc/source-lock.json +22 -0
  599. package/lib/local-builder.mjs +73 -0
  600. package/lib/local-content.mjs +37 -0
  601. package/lib/local-development.mjs +176 -0
  602. package/lib/meshy-api.mjs +270 -0
  603. package/lib/meshy-cli.mjs +80 -0
  604. package/lib/meshy-store.mjs +161 -0
  605. package/lib/personal-state-bridge.mjs +77 -0
  606. package/lib/presentation-project-update.mjs +89 -0
  607. package/lib/presentation-resources.mjs +109 -0
  608. package/lib/private-ecs-harness.mjs +54 -0
  609. package/lib/private-event-harness.mjs +35 -0
  610. package/lib/project-validation.mjs +763 -0
  611. package/lib/release-version.mjs +20 -0
  612. package/lib/runtime-download.mjs +115 -0
  613. package/lib/runtime-host-client.mjs +127 -0
  614. package/lib/runtime-host.mjs +117 -0
  615. package/lib/runtime-install.mjs +225 -0
  616. package/lib/runtime-snapshot.mjs +132 -0
  617. package/lib/runtime-source.mjs +39 -0
  618. package/lib/scene-assets.mjs +54 -0
  619. package/local-builder.snapshot.lock.json +7 -0
  620. package/local-content.snapshot.lock.json +190 -0
  621. package/node_modules/@esbuild/darwin-arm64/README.md +3 -0
  622. package/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
  623. package/node_modules/@esbuild/darwin-arm64/package.json +20 -0
  624. package/node_modules/@esbuild/linux-arm64/README.md +3 -0
  625. package/node_modules/@esbuild/linux-arm64/bin/esbuild +0 -0
  626. package/node_modules/@esbuild/linux-arm64/package.json +20 -0
  627. package/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
  628. package/node_modules/@modelcontextprotocol/core/README.md +40 -0
  629. package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts +8501 -0
  630. package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts.map +1 -0
  631. package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +1678 -0
  632. package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +1 -0
  633. package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +2899 -0
  634. package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +1 -0
  635. package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts +8501 -0
  636. package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts.map +1 -0
  637. package/node_modules/@modelcontextprotocol/core/dist/index.cjs +175 -0
  638. package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
  639. package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
  640. package/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
  641. package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +201 -0
  642. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +99 -0
  643. package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
  644. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +99 -0
  645. package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
  646. package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
  647. package/node_modules/@modelcontextprotocol/core/package.json +85 -0
  648. package/node_modules/@modelcontextprotocol/server/LICENSE +216 -0
  649. package/node_modules/@modelcontextprotocol/server/README.md +30 -0
  650. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs +7514 -0
  651. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs.map +1 -0
  652. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts +1071 -0
  653. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts.map +1 -0
  654. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
  655. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
  656. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs +7531 -0
  657. package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs.map +1 -0
  658. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs +986 -0
  659. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs.map +1 -0
  660. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts +74 -0
  661. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts.map +1 -0
  662. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
  663. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
  664. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs +981 -0
  665. package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs.map +1 -0
  666. package/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +60 -0
  667. package/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +42 -0
  668. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts +4043 -0
  669. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts.map +1 -0
  670. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts +4045 -0
  671. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts.map +1 -0
  672. package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +46 -0
  673. package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +1 -0
  674. package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs +34 -0
  675. package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs.map +1 -0
  676. package/node_modules/@modelcontextprotocol/server/dist/index.cjs +2055 -0
  677. package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -0
  678. package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +739 -0
  679. package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -0
  680. package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +739 -0
  681. package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -0
  682. package/node_modules/@modelcontextprotocol/server/dist/index.mjs +1870 -0
  683. package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -0
  684. package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs +2022 -0
  685. package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs.map +1 -0
  686. package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs +1931 -0
  687. package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs.map +1 -0
  688. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +23 -0
  689. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +1 -0
  690. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +11 -0
  691. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +1 -0
  692. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +11 -0
  693. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +1 -0
  694. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +22 -0
  695. package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +1 -0
  696. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +12 -0
  697. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +3 -0
  698. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +3 -0
  699. package/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +4 -0
  700. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +30 -0
  701. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +1 -0
  702. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +10 -0
  703. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +1 -0
  704. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +10 -0
  705. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +1 -0
  706. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +29 -0
  707. package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +1 -0
  708. package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs +7606 -0
  709. package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs.map +1 -0
  710. package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs +8104 -0
  711. package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs.map +1 -0
  712. package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +564 -0
  713. package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -0
  714. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +107 -0
  715. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -0
  716. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +107 -0
  717. package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -0
  718. package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +562 -0
  719. package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -0
  720. package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts +1099 -0
  721. package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts.map +1 -0
  722. package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +1099 -0
  723. package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +1 -0
  724. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +5 -0
  725. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +2 -0
  726. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +2 -0
  727. package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +3 -0
  728. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +3 -0
  729. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +2 -0
  730. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +2 -0
  731. package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +3 -0
  732. package/node_modules/@modelcontextprotocol/server/package.json +160 -0
  733. package/node_modules/esbuild/LICENSE.md +21 -0
  734. package/node_modules/esbuild/README.md +3 -0
  735. package/node_modules/esbuild/bin/esbuild +223 -0
  736. package/node_modules/esbuild/install.js +289 -0
  737. package/node_modules/esbuild/lib/main.d.ts +716 -0
  738. package/node_modules/esbuild/lib/main.js +2242 -0
  739. package/node_modules/esbuild/package.json +49 -0
  740. package/node_modules/gltf-validator/ISSUES.md +188 -0
  741. package/node_modules/gltf-validator/LICENSE +202 -0
  742. package/node_modules/gltf-validator/NOTICES +435 -0
  743. package/node_modules/gltf-validator/README.md +153 -0
  744. package/node_modules/gltf-validator/gltf_validator.dart.js +10996 -0
  745. package/node_modules/gltf-validator/index.js +63 -0
  746. package/node_modules/gltf-validator/module.mjs +63 -0
  747. package/node_modules/gltf-validator/package.json +22 -0
  748. package/node_modules/gltf-validator/validation.schema.json +266 -0
  749. package/node_modules/pngjs/LICENSE +20 -0
  750. package/node_modules/pngjs/README.md +287 -0
  751. package/node_modules/pngjs/browser.js +18985 -0
  752. package/node_modules/pngjs/lib/bitmapper.js +267 -0
  753. package/node_modules/pngjs/lib/bitpacker.js +158 -0
  754. package/node_modules/pngjs/lib/chunkstream.js +189 -0
  755. package/node_modules/pngjs/lib/constants.js +32 -0
  756. package/node_modules/pngjs/lib/crc.js +40 -0
  757. package/node_modules/pngjs/lib/filter-pack.js +171 -0
  758. package/node_modules/pngjs/lib/filter-parse-async.js +24 -0
  759. package/node_modules/pngjs/lib/filter-parse-sync.js +21 -0
  760. package/node_modules/pngjs/lib/filter-parse.js +177 -0
  761. package/node_modules/pngjs/lib/format-normaliser.js +93 -0
  762. package/node_modules/pngjs/lib/interlace.js +95 -0
  763. package/node_modules/pngjs/lib/packer-async.js +50 -0
  764. package/node_modules/pngjs/lib/packer-sync.js +56 -0
  765. package/node_modules/pngjs/lib/packer.js +129 -0
  766. package/node_modules/pngjs/lib/paeth-predictor.js +16 -0
  767. package/node_modules/pngjs/lib/parser-async.js +169 -0
  768. package/node_modules/pngjs/lib/parser-sync.js +112 -0
  769. package/node_modules/pngjs/lib/parser.js +290 -0
  770. package/node_modules/pngjs/lib/png-sync.js +12 -0
  771. package/node_modules/pngjs/lib/png.js +194 -0
  772. package/node_modules/pngjs/lib/sync-inflate.js +168 -0
  773. package/node_modules/pngjs/lib/sync-reader.js +45 -0
  774. package/node_modules/pngjs/package.json +76 -0
  775. package/node_modules/smol-toml/LICENSE +24 -0
  776. package/node_modules/smol-toml/README.md +236 -0
  777. package/node_modules/smol-toml/dist/date.d.ts +41 -0
  778. package/node_modules/smol-toml/dist/date.js +127 -0
  779. package/node_modules/smol-toml/dist/error.d.ts +38 -0
  780. package/node_modules/smol-toml/dist/error.js +63 -0
  781. package/node_modules/smol-toml/dist/extract.d.ts +30 -0
  782. package/node_modules/smol-toml/dist/extract.js +109 -0
  783. package/node_modules/smol-toml/dist/index.cjs +906 -0
  784. package/node_modules/smol-toml/dist/index.d.ts +43 -0
  785. package/node_modules/smol-toml/dist/index.js +33 -0
  786. package/node_modules/smol-toml/dist/parse.d.ts +37 -0
  787. package/node_modules/smol-toml/dist/parse.js +148 -0
  788. package/node_modules/smol-toml/dist/primitive.d.ts +31 -0
  789. package/node_modules/smol-toml/dist/primitive.js +178 -0
  790. package/node_modules/smol-toml/dist/stringify.d.ts +31 -0
  791. package/node_modules/smol-toml/dist/stringify.js +163 -0
  792. package/node_modules/smol-toml/dist/struct.d.ts +32 -0
  793. package/node_modules/smol-toml/dist/struct.js +194 -0
  794. package/node_modules/smol-toml/dist/util.d.ts +42 -0
  795. package/node_modules/smol-toml/dist/util.js +106 -0
  796. package/node_modules/smol-toml/package.json +54 -0
  797. package/node_modules/zod/LICENSE +21 -0
  798. package/node_modules/zod/README.md +218 -0
  799. package/node_modules/zod/compile.cjs +77 -0
  800. package/node_modules/zod/compile.d.cts +1 -0
  801. package/node_modules/zod/compile.d.ts +1 -0
  802. package/node_modules/zod/compile.js +52 -0
  803. package/node_modules/zod/index.cjs +33 -0
  804. package/node_modules/zod/index.d.cts +3 -0
  805. package/node_modules/zod/index.d.ts +3 -0
  806. package/node_modules/zod/index.js +7 -0
  807. package/node_modules/zod/locales/index.cjs +17 -0
  808. package/node_modules/zod/locales/index.d.cts +1 -0
  809. package/node_modules/zod/locales/index.d.ts +1 -0
  810. package/node_modules/zod/locales/index.js +1 -0
  811. package/node_modules/zod/locales/package.json +7 -0
  812. package/node_modules/zod/mini/index.cjs +32 -0
  813. package/node_modules/zod/mini/index.d.cts +3 -0
  814. package/node_modules/zod/mini/index.d.ts +3 -0
  815. package/node_modules/zod/mini/index.js +3 -0
  816. package/node_modules/zod/mini/package.json +7 -0
  817. package/node_modules/zod/package.json +146 -0
  818. package/node_modules/zod/src/compile.ts +56 -0
  819. package/node_modules/zod/src/index.ts +7 -0
  820. package/node_modules/zod/src/locales/index.ts +1 -0
  821. package/node_modules/zod/src/mini/index.ts +3 -0
  822. package/node_modules/zod/src/v3/ZodError.ts +340 -0
  823. package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  824. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  825. package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  826. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  827. package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  828. package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  829. package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  830. package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  831. package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  832. package/node_modules/zod/src/v3/errors.ts +13 -0
  833. package/node_modules/zod/src/v3/external.ts +6 -0
  834. package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  835. package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  836. package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  837. package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  838. package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  839. package/node_modules/zod/src/v3/helpers/util.ts +224 -0
  840. package/node_modules/zod/src/v3/index.ts +4 -0
  841. package/node_modules/zod/src/v3/locales/en.ts +124 -0
  842. package/node_modules/zod/src/v3/standard-schema.ts +113 -0
  843. package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  844. package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  845. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  846. package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  847. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  848. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  849. package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  850. package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  851. package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  852. package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  853. package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  854. package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
  855. package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  856. package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  857. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  858. package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  859. package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  860. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  861. package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  862. package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
  863. package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  864. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  865. package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
  866. package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  867. package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  868. package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
  869. package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  870. package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
  871. package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  872. package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  873. package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  874. package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  875. package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
  876. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  877. package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  878. package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  879. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  880. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  881. package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
  882. package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  883. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  884. package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  885. package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  886. package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  887. package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  888. package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  889. package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  890. package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  891. package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
  892. package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  893. package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  894. package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  895. package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  896. package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  897. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  898. package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
  899. package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  900. package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  901. package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  902. package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  903. package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  904. package/node_modules/zod/src/v3/types.ts +5138 -0
  905. package/node_modules/zod/src/v4/classic/checks.ts +33 -0
  906. package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  907. package/node_modules/zod/src/v4/classic/compat.ts +78 -0
  908. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  909. package/node_modules/zod/src/v4/classic/errors.ts +97 -0
  910. package/node_modules/zod/src/v4/classic/external.ts +55 -0
  911. package/node_modules/zod/src/v4/classic/from-json-schema.ts +721 -0
  912. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  913. package/node_modules/zod/src/v4/classic/index.ts +5 -0
  914. package/node_modules/zod/src/v4/classic/iso.ts +20 -0
  915. package/node_modules/zod/src/v4/classic/parse.ts +88 -0
  916. package/node_modules/zod/src/v4/classic/schemas.ts +2862 -0
  917. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  918. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
  919. package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  920. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +351 -0
  921. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  922. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  923. package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  924. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +83 -0
  925. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
  926. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
  927. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  928. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
  929. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
  930. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  931. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
  932. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  933. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  934. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +720 -0
  935. package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
  936. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
  937. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  938. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  939. package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
  940. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  941. package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  942. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
  943. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +836 -0
  944. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +296 -0
  945. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
  946. package/node_modules/zod/src/v4/classic/tests/error.test.ts +979 -0
  947. package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  948. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  949. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  950. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1310 -0
  951. package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
  952. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  953. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
  954. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
  955. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  956. package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
  957. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +281 -0
  958. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +107 -0
  959. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
  960. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +183 -0
  961. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
  962. package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
  963. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
  964. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
  965. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  966. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  967. package/node_modules/zod/src/v4/classic/tests/map.test.ts +342 -0
  968. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  969. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  970. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  971. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  972. package/node_modules/zod/src/v4/classic/tests/number.test.ts +362 -0
  973. package/node_modules/zod/src/v4/classic/tests/object.test.ts +950 -0
  974. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +234 -0
  975. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
  976. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
  977. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
  978. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  979. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
  980. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
  981. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
  982. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  983. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  984. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  985. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
  986. package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
  987. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +662 -0
  988. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  989. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
  990. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
  991. package/node_modules/zod/src/v4/classic/tests/set.test.ts +190 -0
  992. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
  993. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  994. package/node_modules/zod/src/v4/classic/tests/string.test.ts +1346 -0
  995. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
  996. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +780 -0
  997. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  998. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4537 -0
  999. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
  1000. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
  1001. package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
  1002. package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  1003. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +76 -0
  1004. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  1005. package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  1006. package/node_modules/zod/src/v4/core/api.ts +1859 -0
  1007. package/node_modules/zod/src/v4/core/checks.ts +1306 -0
  1008. package/node_modules/zod/src/v4/core/compile.ts +2188 -0
  1009. package/node_modules/zod/src/v4/core/core.ts +232 -0
  1010. package/node_modules/zod/src/v4/core/doc.ts +48 -0
  1011. package/node_modules/zod/src/v4/core/errors.ts +546 -0
  1012. package/node_modules/zod/src/v4/core/index.ts +19 -0
  1013. package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
  1014. package/node_modules/zod/src/v4/core/json-schema-processors.ts +830 -0
  1015. package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
  1016. package/node_modules/zod/src/v4/core/memoizer.ts +284 -0
  1017. package/node_modules/zod/src/v4/core/parse.ts +288 -0
  1018. package/node_modules/zod/src/v4/core/regexes.ts +207 -0
  1019. package/node_modules/zod/src/v4/core/registries.ts +105 -0
  1020. package/node_modules/zod/src/v4/core/schemas.ts +5028 -0
  1021. package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
  1022. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
  1023. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  1024. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  1025. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  1026. package/node_modules/zod/src/v4/core/tests/compile.test.ts +1639 -0
  1027. package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  1028. package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  1029. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  1030. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
  1031. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  1032. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
  1033. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  1034. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  1035. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  1036. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  1037. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  1038. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  1039. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  1040. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  1041. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
  1042. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
  1043. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  1044. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  1045. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
  1046. package/node_modules/zod/src/v4/core/to-json-schema.ts +855 -0
  1047. package/node_modules/zod/src/v4/core/util.ts +1209 -0
  1048. package/node_modules/zod/src/v4/core/versions.ts +5 -0
  1049. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  1050. package/node_modules/zod/src/v4/core/zsf.ts +323 -0
  1051. package/node_modules/zod/src/v4/index.ts +4 -0
  1052. package/node_modules/zod/src/v4/locales/ar.ts +118 -0
  1053. package/node_modules/zod/src/v4/locales/az.ts +114 -0
  1054. package/node_modules/zod/src/v4/locales/be.ts +186 -0
  1055. package/node_modules/zod/src/v4/locales/bg.ts +131 -0
  1056. package/node_modules/zod/src/v4/locales/bn.ts +121 -0
  1057. package/node_modules/zod/src/v4/locales/ca.ts +119 -0
  1058. package/node_modules/zod/src/v4/locales/ckb.ts +138 -0
  1059. package/node_modules/zod/src/v4/locales/cs.ts +121 -0
  1060. package/node_modules/zod/src/v4/locales/da.ts +126 -0
  1061. package/node_modules/zod/src/v4/locales/de.ts +119 -0
  1062. package/node_modules/zod/src/v4/locales/el.ts +122 -0
  1063. package/node_modules/zod/src/v4/locales/en.ts +134 -0
  1064. package/node_modules/zod/src/v4/locales/eo.ts +121 -0
  1065. package/node_modules/zod/src/v4/locales/es.ts +143 -0
  1066. package/node_modules/zod/src/v4/locales/fa.ts +129 -0
  1067. package/node_modules/zod/src/v4/locales/fi.ts +124 -0
  1068. package/node_modules/zod/src/v4/locales/fr-CA.ts +119 -0
  1069. package/node_modules/zod/src/v4/locales/fr.ts +137 -0
  1070. package/node_modules/zod/src/v4/locales/gu.ts +121 -0
  1071. package/node_modules/zod/src/v4/locales/he.ts +251 -0
  1072. package/node_modules/zod/src/v4/locales/hi.ts +124 -0
  1073. package/node_modules/zod/src/v4/locales/hr.ts +133 -0
  1074. package/node_modules/zod/src/v4/locales/hu.ts +120 -0
  1075. package/node_modules/zod/src/v4/locales/hy.ts +173 -0
  1076. package/node_modules/zod/src/v4/locales/id.ts +118 -0
  1077. package/node_modules/zod/src/v4/locales/index.ts +62 -0
  1078. package/node_modules/zod/src/v4/locales/is.ts +122 -0
  1079. package/node_modules/zod/src/v4/locales/it.ts +119 -0
  1080. package/node_modules/zod/src/v4/locales/ja.ts +117 -0
  1081. package/node_modules/zod/src/v4/locales/ka.ts +126 -0
  1082. package/node_modules/zod/src/v4/locales/kh.ts +7 -0
  1083. package/node_modules/zod/src/v4/locales/km.ts +122 -0
  1084. package/node_modules/zod/src/v4/locales/kn.ts +124 -0
  1085. package/node_modules/zod/src/v4/locales/ko.ts +124 -0
  1086. package/node_modules/zod/src/v4/locales/lt.ts +241 -0
  1087. package/node_modules/zod/src/v4/locales/mk.ts +121 -0
  1088. package/node_modules/zod/src/v4/locales/ms.ts +118 -0
  1089. package/node_modules/zod/src/v4/locales/ne.ts +126 -0
  1090. package/node_modules/zod/src/v4/locales/nl.ts +124 -0
  1091. package/node_modules/zod/src/v4/locales/nn.ts +119 -0
  1092. package/node_modules/zod/src/v4/locales/no.ts +119 -0
  1093. package/node_modules/zod/src/v4/locales/ota.ts +120 -0
  1094. package/node_modules/zod/src/v4/locales/pl.ts +121 -0
  1095. package/node_modules/zod/src/v4/locales/ps.ts +129 -0
  1096. package/node_modules/zod/src/v4/locales/pt-BR.ts +159 -0
  1097. package/node_modules/zod/src/v4/locales/pt.ts +157 -0
  1098. package/node_modules/zod/src/v4/locales/ro.ts +130 -0
  1099. package/node_modules/zod/src/v4/locales/ru.ts +186 -0
  1100. package/node_modules/zod/src/v4/locales/sk.ts +121 -0
  1101. package/node_modules/zod/src/v4/locales/sl.ts +121 -0
  1102. package/node_modules/zod/src/v4/locales/sv.ts +122 -0
  1103. package/node_modules/zod/src/v4/locales/ta.ts +121 -0
  1104. package/node_modules/zod/src/v4/locales/th.ts +122 -0
  1105. package/node_modules/zod/src/v4/locales/tk.ts +111 -0
  1106. package/node_modules/zod/src/v4/locales/tr.ts +114 -0
  1107. package/node_modules/zod/src/v4/locales/ua.ts +7 -0
  1108. package/node_modules/zod/src/v4/locales/uk.ts +120 -0
  1109. package/node_modules/zod/src/v4/locales/ur.ts +122 -0
  1110. package/node_modules/zod/src/v4/locales/uz.ts +118 -0
  1111. package/node_modules/zod/src/v4/locales/vi.ts +120 -0
  1112. package/node_modules/zod/src/v4/locales/yo.ts +127 -0
  1113. package/node_modules/zod/src/v4/locales/zh-CN.ts +119 -0
  1114. package/node_modules/zod/src/v4/locales/zh-TW.ts +118 -0
  1115. package/node_modules/zod/src/v4/mini/checks.ts +33 -0
  1116. package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
  1117. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  1118. package/node_modules/zod/src/v4/mini/external.ts +50 -0
  1119. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  1120. package/node_modules/zod/src/v4/mini/index.ts +3 -0
  1121. package/node_modules/zod/src/v4/mini/iso.ts +66 -0
  1122. package/node_modules/zod/src/v4/mini/parse.ts +16 -0
  1123. package/node_modules/zod/src/v4/mini/schemas.ts +2026 -0
  1124. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
  1125. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
  1126. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
  1127. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
  1128. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
  1129. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
  1130. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  1131. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  1132. package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
  1133. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
  1134. package/node_modules/zod/src/v4/mini/tests/index.test.ts +1060 -0
  1135. package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
  1136. package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
  1137. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  1138. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
  1139. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
  1140. package/node_modules/zod/src/v4/mini/tests/string.test.ts +373 -0
  1141. package/node_modules/zod/src/v4-mini/index.ts +3 -0
  1142. package/node_modules/zod/v3/ZodError.cjs +148 -0
  1143. package/node_modules/zod/v3/ZodError.d.cts +164 -0
  1144. package/node_modules/zod/v3/ZodError.d.ts +164 -0
  1145. package/node_modules/zod/v3/ZodError.js +143 -0
  1146. package/node_modules/zod/v3/errors.cjs +17 -0
  1147. package/node_modules/zod/v3/errors.d.cts +5 -0
  1148. package/node_modules/zod/v3/errors.d.ts +5 -0
  1149. package/node_modules/zod/v3/errors.js +9 -0
  1150. package/node_modules/zod/v3/external.cjs +22 -0
  1151. package/node_modules/zod/v3/external.d.cts +6 -0
  1152. package/node_modules/zod/v3/external.d.ts +6 -0
  1153. package/node_modules/zod/v3/external.js +6 -0
  1154. package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
  1155. package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  1156. package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  1157. package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  1158. package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
  1159. package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  1160. package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  1161. package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  1162. package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
  1163. package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  1164. package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  1165. package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  1166. package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
  1167. package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  1168. package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  1169. package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  1170. package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
  1171. package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  1172. package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  1173. package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  1174. package/node_modules/zod/v3/helpers/util.cjs +137 -0
  1175. package/node_modules/zod/v3/helpers/util.d.cts +85 -0
  1176. package/node_modules/zod/v3/helpers/util.d.ts +85 -0
  1177. package/node_modules/zod/v3/helpers/util.js +133 -0
  1178. package/node_modules/zod/v3/index.cjs +33 -0
  1179. package/node_modules/zod/v3/index.d.cts +4 -0
  1180. package/node_modules/zod/v3/index.d.ts +4 -0
  1181. package/node_modules/zod/v3/index.js +4 -0
  1182. package/node_modules/zod/v3/locales/en.cjs +112 -0
  1183. package/node_modules/zod/v3/locales/en.d.cts +3 -0
  1184. package/node_modules/zod/v3/locales/en.d.ts +3 -0
  1185. package/node_modules/zod/v3/locales/en.js +109 -0
  1186. package/node_modules/zod/v3/package.json +7 -0
  1187. package/node_modules/zod/v3/standard-schema.cjs +2 -0
  1188. package/node_modules/zod/v3/standard-schema.d.cts +102 -0
  1189. package/node_modules/zod/v3/standard-schema.d.ts +102 -0
  1190. package/node_modules/zod/v3/standard-schema.js +1 -0
  1191. package/node_modules/zod/v3/types.cjs +3779 -0
  1192. package/node_modules/zod/v3/types.d.cts +1034 -0
  1193. package/node_modules/zod/v3/types.d.ts +1034 -0
  1194. package/node_modules/zod/v3/types.js +3697 -0
  1195. package/node_modules/zod/v4/classic/checks.cjs +34 -0
  1196. package/node_modules/zod/v4/classic/checks.d.cts +1 -0
  1197. package/node_modules/zod/v4/classic/checks.d.ts +1 -0
  1198. package/node_modules/zod/v4/classic/checks.js +1 -0
  1199. package/node_modules/zod/v4/classic/coerce.cjs +47 -0
  1200. package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  1201. package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  1202. package/node_modules/zod/v4/classic/coerce.js +17 -0
  1203. package/node_modules/zod/v4/classic/compat.cjs +61 -0
  1204. package/node_modules/zod/v4/classic/compat.d.cts +48 -0
  1205. package/node_modules/zod/v4/classic/compat.d.ts +48 -0
  1206. package/node_modules/zod/v4/classic/compat.js +31 -0
  1207. package/node_modules/zod/v4/classic/deep-partial.cjs +39 -0
  1208. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  1209. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  1210. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  1211. package/node_modules/zod/v4/classic/errors.cjs +83 -0
  1212. package/node_modules/zod/v4/classic/errors.d.cts +29 -0
  1213. package/node_modules/zod/v4/classic/errors.d.ts +29 -0
  1214. package/node_modules/zod/v4/classic/errors.js +57 -0
  1215. package/node_modules/zod/v4/classic/external.cjs +76 -0
  1216. package/node_modules/zod/v4/classic/external.d.cts +19 -0
  1217. package/node_modules/zod/v4/classic/external.d.ts +19 -0
  1218. package/node_modules/zod/v4/classic/external.js +17 -0
  1219. package/node_modules/zod/v4/classic/from-json-schema.cjs +686 -0
  1220. package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
  1221. package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
  1222. package/node_modules/zod/v4/classic/from-json-schema.js +660 -0
  1223. package/node_modules/zod/v4/classic/in-out.cjs +63 -0
  1224. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  1225. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  1226. package/node_modules/zod/v4/classic/in-out.js +36 -0
  1227. package/node_modules/zod/v4/classic/index.cjs +33 -0
  1228. package/node_modules/zod/v4/classic/index.d.cts +3 -0
  1229. package/node_modules/zod/v4/classic/index.d.ts +3 -0
  1230. package/node_modules/zod/v4/classic/index.js +4 -0
  1231. package/node_modules/zod/v4/classic/iso.cjs +49 -0
  1232. package/node_modules/zod/v4/classic/iso.d.cts +7 -0
  1233. package/node_modules/zod/v4/classic/iso.d.ts +7 -0
  1234. package/node_modules/zod/v4/classic/iso.js +15 -0
  1235. package/node_modules/zod/v4/classic/package.json +7 -0
  1236. package/node_modules/zod/v4/classic/parse.cjs +44 -0
  1237. package/node_modules/zod/v4/classic/parse.d.cts +44 -0
  1238. package/node_modules/zod/v4/classic/parse.d.ts +44 -0
  1239. package/node_modules/zod/v4/classic/parse.js +16 -0
  1240. package/node_modules/zod/v4/classic/schemas.cjs +1611 -0
  1241. package/node_modules/zod/v4/classic/schemas.d.cts +802 -0
  1242. package/node_modules/zod/v4/classic/schemas.d.ts +802 -0
  1243. package/node_modules/zod/v4/classic/schemas.js +1491 -0
  1244. package/node_modules/zod/v4/core/api.cjs +1246 -0
  1245. package/node_modules/zod/v4/core/api.d.cts +329 -0
  1246. package/node_modules/zod/v4/core/api.d.ts +329 -0
  1247. package/node_modules/zod/v4/core/api.js +1104 -0
  1248. package/node_modules/zod/v4/core/checks.cjs +607 -0
  1249. package/node_modules/zod/v4/core/checks.d.cts +278 -0
  1250. package/node_modules/zod/v4/core/checks.d.ts +278 -0
  1251. package/node_modules/zod/v4/core/checks.js +581 -0
  1252. package/node_modules/zod/v4/core/compile.cjs +1813 -0
  1253. package/node_modules/zod/v4/core/compile.d.cts +51 -0
  1254. package/node_modules/zod/v4/core/compile.d.ts +51 -0
  1255. package/node_modules/zod/v4/core/compile.js +1783 -0
  1256. package/node_modules/zod/v4/core/core.cjs +148 -0
  1257. package/node_modules/zod/v4/core/core.d.cts +82 -0
  1258. package/node_modules/zod/v4/core/core.d.ts +82 -0
  1259. package/node_modules/zod/v4/core/core.js +141 -0
  1260. package/node_modules/zod/v4/core/doc.cjs +37 -0
  1261. package/node_modules/zod/v4/core/doc.d.cts +16 -0
  1262. package/node_modules/zod/v4/core/doc.d.ts +16 -0
  1263. package/node_modules/zod/v4/core/doc.js +33 -0
  1264. package/node_modules/zod/v4/core/errors.cjs +301 -0
  1265. package/node_modules/zod/v4/core/errors.d.cts +225 -0
  1266. package/node_modules/zod/v4/core/errors.d.ts +225 -0
  1267. package/node_modules/zod/v4/core/errors.js +270 -0
  1268. package/node_modules/zod/v4/core/index.cjs +51 -0
  1269. package/node_modules/zod/v4/core/index.d.cts +19 -0
  1270. package/node_modules/zod/v4/core/index.d.ts +19 -0
  1271. package/node_modules/zod/v4/core/index.js +19 -0
  1272. package/node_modules/zod/v4/core/json-schema-generator.cjs +103 -0
  1273. package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
  1274. package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
  1275. package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
  1276. package/node_modules/zod/v4/core/json-schema-processors.cjs +813 -0
  1277. package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
  1278. package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
  1279. package/node_modules/zod/v4/core/json-schema-processors.js +747 -0
  1280. package/node_modules/zod/v4/core/json-schema.cjs +2 -0
  1281. package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
  1282. package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
  1283. package/node_modules/zod/v4/core/json-schema.js +1 -0
  1284. package/node_modules/zod/v4/core/memoizer.cjs +272 -0
  1285. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  1286. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  1287. package/node_modules/zod/v4/core/memoizer.js +265 -0
  1288. package/node_modules/zod/v4/core/package.json +7 -0
  1289. package/node_modules/zod/v4/core/parse.cjs +193 -0
  1290. package/node_modules/zod/v4/core/parse.d.cts +52 -0
  1291. package/node_modules/zod/v4/core/parse.d.ts +52 -0
  1292. package/node_modules/zod/v4/core/parse.js +154 -0
  1293. package/node_modules/zod/v4/core/regexes.cjs +184 -0
  1294. package/node_modules/zod/v4/core/regexes.d.cts +87 -0
  1295. package/node_modules/zod/v4/core/regexes.d.ts +87 -0
  1296. package/node_modules/zod/v4/core/regexes.js +150 -0
  1297. package/node_modules/zod/v4/core/registries.cjs +56 -0
  1298. package/node_modules/zod/v4/core/registries.d.cts +35 -0
  1299. package/node_modules/zod/v4/core/registries.d.ts +35 -0
  1300. package/node_modules/zod/v4/core/registries.js +51 -0
  1301. package/node_modules/zod/v4/core/schemas.cjs +2481 -0
  1302. package/node_modules/zod/v4/core/schemas.d.cts +1253 -0
  1303. package/node_modules/zod/v4/core/schemas.d.ts +1253 -0
  1304. package/node_modules/zod/v4/core/schemas.js +2440 -0
  1305. package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
  1306. package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
  1307. package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
  1308. package/node_modules/zod/v4/core/standard-schema.js +1 -0
  1309. package/node_modules/zod/v4/core/to-json-schema.cjs +660 -0
  1310. package/node_modules/zod/v4/core/to-json-schema.d.cts +153 -0
  1311. package/node_modules/zod/v4/core/to-json-schema.d.ts +153 -0
  1312. package/node_modules/zod/v4/core/to-json-schema.js +650 -0
  1313. package/node_modules/zod/v4/core/util.cjs +915 -0
  1314. package/node_modules/zod/v4/core/util.d.cts +257 -0
  1315. package/node_modules/zod/v4/core/util.d.ts +257 -0
  1316. package/node_modules/zod/v4/core/util.js +846 -0
  1317. package/node_modules/zod/v4/core/versions.cjs +8 -0
  1318. package/node_modules/zod/v4/core/versions.d.cts +5 -0
  1319. package/node_modules/zod/v4/core/versions.d.ts +5 -0
  1320. package/node_modules/zod/v4/core/versions.js +5 -0
  1321. package/node_modules/zod/v4/core/visit.cjs +195 -0
  1322. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  1323. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  1324. package/node_modules/zod/v4/core/visit.js +169 -0
  1325. package/node_modules/zod/v4/index.cjs +32 -0
  1326. package/node_modules/zod/v4/index.d.cts +3 -0
  1327. package/node_modules/zod/v4/index.d.ts +3 -0
  1328. package/node_modules/zod/v4/index.js +4 -0
  1329. package/node_modules/zod/v4/locales/ar.cjs +136 -0
  1330. package/node_modules/zod/v4/locales/ar.d.cts +5 -0
  1331. package/node_modules/zod/v4/locales/ar.d.ts +4 -0
  1332. package/node_modules/zod/v4/locales/ar.js +109 -0
  1333. package/node_modules/zod/v4/locales/az.cjs +135 -0
  1334. package/node_modules/zod/v4/locales/az.d.cts +5 -0
  1335. package/node_modules/zod/v4/locales/az.d.ts +4 -0
  1336. package/node_modules/zod/v4/locales/az.js +108 -0
  1337. package/node_modules/zod/v4/locales/be.cjs +193 -0
  1338. package/node_modules/zod/v4/locales/be.d.cts +5 -0
  1339. package/node_modules/zod/v4/locales/be.d.ts +4 -0
  1340. package/node_modules/zod/v4/locales/be.js +166 -0
  1341. package/node_modules/zod/v4/locales/bg.cjs +150 -0
  1342. package/node_modules/zod/v4/locales/bg.d.cts +5 -0
  1343. package/node_modules/zod/v4/locales/bg.d.ts +4 -0
  1344. package/node_modules/zod/v4/locales/bg.js +123 -0
  1345. package/node_modules/zod/v4/locales/bn.cjs +138 -0
  1346. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  1347. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  1348. package/node_modules/zod/v4/locales/bn.js +111 -0
  1349. package/node_modules/zod/v4/locales/ca.cjs +137 -0
  1350. package/node_modules/zod/v4/locales/ca.d.cts +5 -0
  1351. package/node_modules/zod/v4/locales/ca.d.ts +4 -0
  1352. package/node_modules/zod/v4/locales/ca.js +110 -0
  1353. package/node_modules/zod/v4/locales/ckb.cjs +158 -0
  1354. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  1355. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  1356. package/node_modules/zod/v4/locales/ckb.js +131 -0
  1357. package/node_modules/zod/v4/locales/cs.cjs +141 -0
  1358. package/node_modules/zod/v4/locales/cs.d.cts +5 -0
  1359. package/node_modules/zod/v4/locales/cs.d.ts +4 -0
  1360. package/node_modules/zod/v4/locales/cs.js +114 -0
  1361. package/node_modules/zod/v4/locales/da.cjs +145 -0
  1362. package/node_modules/zod/v4/locales/da.d.cts +5 -0
  1363. package/node_modules/zod/v4/locales/da.d.ts +4 -0
  1364. package/node_modules/zod/v4/locales/da.js +118 -0
  1365. package/node_modules/zod/v4/locales/de.cjs +138 -0
  1366. package/node_modules/zod/v4/locales/de.d.cts +5 -0
  1367. package/node_modules/zod/v4/locales/de.d.ts +4 -0
  1368. package/node_modules/zod/v4/locales/de.js +111 -0
  1369. package/node_modules/zod/v4/locales/el.cjs +137 -0
  1370. package/node_modules/zod/v4/locales/el.d.cts +5 -0
  1371. package/node_modules/zod/v4/locales/el.d.ts +4 -0
  1372. package/node_modules/zod/v4/locales/el.js +110 -0
  1373. package/node_modules/zod/v4/locales/en.cjs +150 -0
  1374. package/node_modules/zod/v4/locales/en.d.cts +5 -0
  1375. package/node_modules/zod/v4/locales/en.d.ts +4 -0
  1376. package/node_modules/zod/v4/locales/en.js +123 -0
  1377. package/node_modules/zod/v4/locales/eo.cjs +139 -0
  1378. package/node_modules/zod/v4/locales/eo.d.cts +5 -0
  1379. package/node_modules/zod/v4/locales/eo.d.ts +4 -0
  1380. package/node_modules/zod/v4/locales/eo.js +112 -0
  1381. package/node_modules/zod/v4/locales/es.cjs +161 -0
  1382. package/node_modules/zod/v4/locales/es.d.cts +5 -0
  1383. package/node_modules/zod/v4/locales/es.d.ts +4 -0
  1384. package/node_modules/zod/v4/locales/es.js +134 -0
  1385. package/node_modules/zod/v4/locales/fa.cjs +144 -0
  1386. package/node_modules/zod/v4/locales/fa.d.cts +5 -0
  1387. package/node_modules/zod/v4/locales/fa.d.ts +4 -0
  1388. package/node_modules/zod/v4/locales/fa.js +117 -0
  1389. package/node_modules/zod/v4/locales/fi.cjs +142 -0
  1390. package/node_modules/zod/v4/locales/fi.d.cts +5 -0
  1391. package/node_modules/zod/v4/locales/fi.d.ts +4 -0
  1392. package/node_modules/zod/v4/locales/fi.js +115 -0
  1393. package/node_modules/zod/v4/locales/fr-CA.cjs +137 -0
  1394. package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  1395. package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  1396. package/node_modules/zod/v4/locales/fr-CA.js +110 -0
  1397. package/node_modules/zod/v4/locales/fr.cjs +154 -0
  1398. package/node_modules/zod/v4/locales/fr.d.cts +5 -0
  1399. package/node_modules/zod/v4/locales/fr.d.ts +4 -0
  1400. package/node_modules/zod/v4/locales/fr.js +127 -0
  1401. package/node_modules/zod/v4/locales/gu.cjs +138 -0
  1402. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  1403. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  1404. package/node_modules/zod/v4/locales/gu.js +111 -0
  1405. package/node_modules/zod/v4/locales/he.cjs +246 -0
  1406. package/node_modules/zod/v4/locales/he.d.cts +5 -0
  1407. package/node_modules/zod/v4/locales/he.d.ts +4 -0
  1408. package/node_modules/zod/v4/locales/he.js +219 -0
  1409. package/node_modules/zod/v4/locales/hi.cjs +136 -0
  1410. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  1411. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  1412. package/node_modules/zod/v4/locales/hi.js +109 -0
  1413. package/node_modules/zod/v4/locales/hr.cjs +151 -0
  1414. package/node_modules/zod/v4/locales/hr.d.cts +5 -0
  1415. package/node_modules/zod/v4/locales/hr.d.ts +4 -0
  1416. package/node_modules/zod/v4/locales/hr.js +124 -0
  1417. package/node_modules/zod/v4/locales/hu.cjs +138 -0
  1418. package/node_modules/zod/v4/locales/hu.d.cts +5 -0
  1419. package/node_modules/zod/v4/locales/hu.d.ts +4 -0
  1420. package/node_modules/zod/v4/locales/hu.js +111 -0
  1421. package/node_modules/zod/v4/locales/hy.cjs +183 -0
  1422. package/node_modules/zod/v4/locales/hy.d.cts +5 -0
  1423. package/node_modules/zod/v4/locales/hy.d.ts +4 -0
  1424. package/node_modules/zod/v4/locales/hy.js +156 -0
  1425. package/node_modules/zod/v4/locales/id.cjs +136 -0
  1426. package/node_modules/zod/v4/locales/id.d.cts +5 -0
  1427. package/node_modules/zod/v4/locales/id.d.ts +4 -0
  1428. package/node_modules/zod/v4/locales/id.js +109 -0
  1429. package/node_modules/zod/v4/locales/index.cjs +131 -0
  1430. package/node_modules/zod/v4/locales/index.d.cts +62 -0
  1431. package/node_modules/zod/v4/locales/index.d.ts +62 -0
  1432. package/node_modules/zod/v4/locales/index.js +62 -0
  1433. package/node_modules/zod/v4/locales/is.cjs +139 -0
  1434. package/node_modules/zod/v4/locales/is.d.cts +5 -0
  1435. package/node_modules/zod/v4/locales/is.d.ts +4 -0
  1436. package/node_modules/zod/v4/locales/is.js +112 -0
  1437. package/node_modules/zod/v4/locales/it.cjs +138 -0
  1438. package/node_modules/zod/v4/locales/it.d.cts +5 -0
  1439. package/node_modules/zod/v4/locales/it.d.ts +4 -0
  1440. package/node_modules/zod/v4/locales/it.js +111 -0
  1441. package/node_modules/zod/v4/locales/ja.cjs +137 -0
  1442. package/node_modules/zod/v4/locales/ja.d.cts +5 -0
  1443. package/node_modules/zod/v4/locales/ja.d.ts +4 -0
  1444. package/node_modules/zod/v4/locales/ja.js +110 -0
  1445. package/node_modules/zod/v4/locales/ka.cjs +142 -0
  1446. package/node_modules/zod/v4/locales/ka.d.cts +5 -0
  1447. package/node_modules/zod/v4/locales/ka.d.ts +4 -0
  1448. package/node_modules/zod/v4/locales/ka.js +115 -0
  1449. package/node_modules/zod/v4/locales/kh.cjs +12 -0
  1450. package/node_modules/zod/v4/locales/kh.d.cts +5 -0
  1451. package/node_modules/zod/v4/locales/kh.d.ts +5 -0
  1452. package/node_modules/zod/v4/locales/kh.js +5 -0
  1453. package/node_modules/zod/v4/locales/km.cjs +140 -0
  1454. package/node_modules/zod/v4/locales/km.d.cts +5 -0
  1455. package/node_modules/zod/v4/locales/km.d.ts +4 -0
  1456. package/node_modules/zod/v4/locales/km.js +113 -0
  1457. package/node_modules/zod/v4/locales/kn.cjs +141 -0
  1458. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  1459. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  1460. package/node_modules/zod/v4/locales/kn.js +114 -0
  1461. package/node_modules/zod/v4/locales/ko.cjs +141 -0
  1462. package/node_modules/zod/v4/locales/ko.d.cts +5 -0
  1463. package/node_modules/zod/v4/locales/ko.d.ts +4 -0
  1464. package/node_modules/zod/v4/locales/ko.js +114 -0
  1465. package/node_modules/zod/v4/locales/lt.cjs +232 -0
  1466. package/node_modules/zod/v4/locales/lt.d.cts +5 -0
  1467. package/node_modules/zod/v4/locales/lt.d.ts +4 -0
  1468. package/node_modules/zod/v4/locales/lt.js +205 -0
  1469. package/node_modules/zod/v4/locales/mk.cjs +139 -0
  1470. package/node_modules/zod/v4/locales/mk.d.cts +5 -0
  1471. package/node_modules/zod/v4/locales/mk.d.ts +4 -0
  1472. package/node_modules/zod/v4/locales/mk.js +112 -0
  1473. package/node_modules/zod/v4/locales/ms.cjs +137 -0
  1474. package/node_modules/zod/v4/locales/ms.d.cts +5 -0
  1475. package/node_modules/zod/v4/locales/ms.d.ts +4 -0
  1476. package/node_modules/zod/v4/locales/ms.js +110 -0
  1477. package/node_modules/zod/v4/locales/ne.cjs +136 -0
  1478. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  1479. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  1480. package/node_modules/zod/v4/locales/ne.js +109 -0
  1481. package/node_modules/zod/v4/locales/nl.cjs +140 -0
  1482. package/node_modules/zod/v4/locales/nl.d.cts +5 -0
  1483. package/node_modules/zod/v4/locales/nl.d.ts +4 -0
  1484. package/node_modules/zod/v4/locales/nl.js +113 -0
  1485. package/node_modules/zod/v4/locales/nn.cjs +138 -0
  1486. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  1487. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  1488. package/node_modules/zod/v4/locales/nn.js +111 -0
  1489. package/node_modules/zod/v4/locales/no.cjs +138 -0
  1490. package/node_modules/zod/v4/locales/no.d.cts +5 -0
  1491. package/node_modules/zod/v4/locales/no.d.ts +4 -0
  1492. package/node_modules/zod/v4/locales/no.js +111 -0
  1493. package/node_modules/zod/v4/locales/ota.cjs +139 -0
  1494. package/node_modules/zod/v4/locales/ota.d.cts +5 -0
  1495. package/node_modules/zod/v4/locales/ota.d.ts +4 -0
  1496. package/node_modules/zod/v4/locales/ota.js +112 -0
  1497. package/node_modules/zod/v4/locales/package.json +7 -0
  1498. package/node_modules/zod/v4/locales/pl.cjs +139 -0
  1499. package/node_modules/zod/v4/locales/pl.d.cts +5 -0
  1500. package/node_modules/zod/v4/locales/pl.d.ts +4 -0
  1501. package/node_modules/zod/v4/locales/pl.js +112 -0
  1502. package/node_modules/zod/v4/locales/ps.cjs +144 -0
  1503. package/node_modules/zod/v4/locales/ps.d.cts +5 -0
  1504. package/node_modules/zod/v4/locales/ps.d.ts +4 -0
  1505. package/node_modules/zod/v4/locales/ps.js +117 -0
  1506. package/node_modules/zod/v4/locales/pt-BR.cjs +168 -0
  1507. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  1508. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  1509. package/node_modules/zod/v4/locales/pt-BR.js +141 -0
  1510. package/node_modules/zod/v4/locales/pt.cjs +167 -0
  1511. package/node_modules/zod/v4/locales/pt.d.cts +5 -0
  1512. package/node_modules/zod/v4/locales/pt.d.ts +4 -0
  1513. package/node_modules/zod/v4/locales/pt.js +140 -0
  1514. package/node_modules/zod/v4/locales/ro.cjs +147 -0
  1515. package/node_modules/zod/v4/locales/ro.d.cts +5 -0
  1516. package/node_modules/zod/v4/locales/ro.d.ts +4 -0
  1517. package/node_modules/zod/v4/locales/ro.js +120 -0
  1518. package/node_modules/zod/v4/locales/ru.cjs +193 -0
  1519. package/node_modules/zod/v4/locales/ru.d.cts +5 -0
  1520. package/node_modules/zod/v4/locales/ru.d.ts +4 -0
  1521. package/node_modules/zod/v4/locales/ru.js +166 -0
  1522. package/node_modules/zod/v4/locales/sk.cjs +141 -0
  1523. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  1524. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  1525. package/node_modules/zod/v4/locales/sk.js +114 -0
  1526. package/node_modules/zod/v4/locales/sl.cjs +139 -0
  1527. package/node_modules/zod/v4/locales/sl.d.cts +5 -0
  1528. package/node_modules/zod/v4/locales/sl.d.ts +4 -0
  1529. package/node_modules/zod/v4/locales/sl.js +112 -0
  1530. package/node_modules/zod/v4/locales/sv.cjs +140 -0
  1531. package/node_modules/zod/v4/locales/sv.d.cts +5 -0
  1532. package/node_modules/zod/v4/locales/sv.d.ts +4 -0
  1533. package/node_modules/zod/v4/locales/sv.js +113 -0
  1534. package/node_modules/zod/v4/locales/ta.cjs +140 -0
  1535. package/node_modules/zod/v4/locales/ta.d.cts +5 -0
  1536. package/node_modules/zod/v4/locales/ta.d.ts +4 -0
  1537. package/node_modules/zod/v4/locales/ta.js +113 -0
  1538. package/node_modules/zod/v4/locales/th.cjs +140 -0
  1539. package/node_modules/zod/v4/locales/th.d.cts +5 -0
  1540. package/node_modules/zod/v4/locales/th.d.ts +4 -0
  1541. package/node_modules/zod/v4/locales/th.js +113 -0
  1542. package/node_modules/zod/v4/locales/tk.cjs +132 -0
  1543. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  1544. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  1545. package/node_modules/zod/v4/locales/tk.js +105 -0
  1546. package/node_modules/zod/v4/locales/tr.cjs +135 -0
  1547. package/node_modules/zod/v4/locales/tr.d.cts +5 -0
  1548. package/node_modules/zod/v4/locales/tr.d.ts +4 -0
  1549. package/node_modules/zod/v4/locales/tr.js +108 -0
  1550. package/node_modules/zod/v4/locales/ua.cjs +12 -0
  1551. package/node_modules/zod/v4/locales/ua.d.cts +5 -0
  1552. package/node_modules/zod/v4/locales/ua.d.ts +5 -0
  1553. package/node_modules/zod/v4/locales/ua.js +5 -0
  1554. package/node_modules/zod/v4/locales/uk.cjs +138 -0
  1555. package/node_modules/zod/v4/locales/uk.d.cts +5 -0
  1556. package/node_modules/zod/v4/locales/uk.d.ts +4 -0
  1557. package/node_modules/zod/v4/locales/uk.js +111 -0
  1558. package/node_modules/zod/v4/locales/ur.cjs +140 -0
  1559. package/node_modules/zod/v4/locales/ur.d.cts +5 -0
  1560. package/node_modules/zod/v4/locales/ur.d.ts +4 -0
  1561. package/node_modules/zod/v4/locales/ur.js +113 -0
  1562. package/node_modules/zod/v4/locales/uz.cjs +138 -0
  1563. package/node_modules/zod/v4/locales/uz.d.cts +5 -0
  1564. package/node_modules/zod/v4/locales/uz.d.ts +4 -0
  1565. package/node_modules/zod/v4/locales/uz.js +111 -0
  1566. package/node_modules/zod/v4/locales/vi.cjs +138 -0
  1567. package/node_modules/zod/v4/locales/vi.d.cts +5 -0
  1568. package/node_modules/zod/v4/locales/vi.d.ts +4 -0
  1569. package/node_modules/zod/v4/locales/vi.js +111 -0
  1570. package/node_modules/zod/v4/locales/yo.cjs +137 -0
  1571. package/node_modules/zod/v4/locales/yo.d.cts +5 -0
  1572. package/node_modules/zod/v4/locales/yo.d.ts +4 -0
  1573. package/node_modules/zod/v4/locales/yo.js +110 -0
  1574. package/node_modules/zod/v4/locales/zh-CN.cjs +139 -0
  1575. package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  1576. package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  1577. package/node_modules/zod/v4/locales/zh-CN.js +112 -0
  1578. package/node_modules/zod/v4/locales/zh-TW.cjs +137 -0
  1579. package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  1580. package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  1581. package/node_modules/zod/v4/locales/zh-TW.js +110 -0
  1582. package/node_modules/zod/v4/mini/checks.cjs +35 -0
  1583. package/node_modules/zod/v4/mini/checks.d.cts +1 -0
  1584. package/node_modules/zod/v4/mini/checks.d.ts +1 -0
  1585. package/node_modules/zod/v4/mini/checks.js +1 -0
  1586. package/node_modules/zod/v4/mini/coerce.cjs +52 -0
  1587. package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  1588. package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  1589. package/node_modules/zod/v4/mini/coerce.js +22 -0
  1590. package/node_modules/zod/v4/mini/deep-partial.cjs +39 -0
  1591. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  1592. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  1593. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  1594. package/node_modules/zod/v4/mini/external.cjs +74 -0
  1595. package/node_modules/zod/v4/mini/external.d.cts +16 -0
  1596. package/node_modules/zod/v4/mini/external.d.ts +16 -0
  1597. package/node_modules/zod/v4/mini/external.js +16 -0
  1598. package/node_modules/zod/v4/mini/in-out.cjs +63 -0
  1599. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  1600. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  1601. package/node_modules/zod/v4/mini/in-out.js +36 -0
  1602. package/node_modules/zod/v4/mini/index.cjs +32 -0
  1603. package/node_modules/zod/v4/mini/index.d.cts +3 -0
  1604. package/node_modules/zod/v4/mini/index.d.ts +3 -0
  1605. package/node_modules/zod/v4/mini/index.js +3 -0
  1606. package/node_modules/zod/v4/mini/iso.cjs +64 -0
  1607. package/node_modules/zod/v4/mini/iso.d.cts +22 -0
  1608. package/node_modules/zod/v4/mini/iso.d.ts +22 -0
  1609. package/node_modules/zod/v4/mini/iso.js +34 -0
  1610. package/node_modules/zod/v4/mini/package.json +7 -0
  1611. package/node_modules/zod/v4/mini/parse.cjs +18 -0
  1612. package/node_modules/zod/v4/mini/parse.d.cts +1 -0
  1613. package/node_modules/zod/v4/mini/parse.d.ts +1 -0
  1614. package/node_modules/zod/v4/mini/parse.js +1 -0
  1615. package/node_modules/zod/v4/mini/schemas.cjs +1111 -0
  1616. package/node_modules/zod/v4/mini/schemas.d.cts +475 -0
  1617. package/node_modules/zod/v4/mini/schemas.d.ts +475 -0
  1618. package/node_modules/zod/v4/mini/schemas.js +987 -0
  1619. package/node_modules/zod/v4/package.json +7 -0
  1620. package/node_modules/zod/v4-mini/index.cjs +32 -0
  1621. package/node_modules/zod/v4-mini/index.d.cts +3 -0
  1622. package/node_modules/zod/v4-mini/index.d.ts +3 -0
  1623. package/node_modules/zod/v4-mini/index.js +3 -0
  1624. package/node_modules/zod/v4-mini/package.json +7 -0
  1625. package/package.json +171 -4
  1626. package/personal-state-bridge.source-lock.json +42 -0
  1627. package/personal-state.snapshot.lock.json +40 -0
  1628. package/public-runtime.snapshot.lock.json +54 -0
  1629. package/runtime-catalog.json +38 -0
  1630. package/scene-interaction-v2.snapshot.lock.json +36 -0
  1631. package/sdk/client/index.js +20 -0
  1632. package/sdk/shared/index.js +20 -0
  1633. package/source-package.snapshot.lock.json +26 -0
  1634. package/templates/document-presentation/assets.js +73 -0
  1635. package/templates/document-presentation/authority.js +31 -0
  1636. package/templates/document-presentation/journey-actions.js +36 -0
  1637. package/templates/document-presentation/journey-note-bridge.js +34 -0
  1638. package/templates/document-presentation/journey-presentation.js +96 -0
  1639. package/templates/document-presentation/journey-view.js +43 -0
  1640. package/templates/document-presentation/motion.js +11 -0
  1641. package/templates/document-presentation/peer-presentation.js +160 -0
  1642. package/templates/document-presentation/personal-story.js +75 -0
  1643. package/templates/document-presentation/space-projection.js +54 -0
  1644. package/templates/npm-project/AGENTS.md +11 -0
  1645. package/templates/project.gitignore +9 -0
  1646. package/templates/public-untrusted/chrona.project.json +7 -0
  1647. package/templates/public-untrusted/content/assets/runtime/template-triangle.gltf +50 -0
  1648. package/templates/public-untrusted/content/ecs/components.json +30 -0
  1649. package/templates/public-untrusted/content/ecs/prefabs.json +14 -0
  1650. package/templates/public-untrusted/content/ecs/scene.json +9 -0
  1651. package/templates/public-untrusted/content/gameplay/client/presentation.js +8 -0
  1652. package/templates/public-untrusted/content/gameplay/shared/rules.js +17 -0
  1653. package/templates/public-untrusted/content/manifest.json +75 -0
  1654. package/templates/public-untrusted/content/provenance.json +15 -0
  1655. package/templates/public-untrusted/content/tests/budgets.json +5 -0
  1656. package/templates/public-untrusted/content/tests/rules.json +10 -0
  1657. package/templates/public-untrusted/content/tests/scenarios.json +45 -0
@@ -0,0 +1,2481 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.$ZodXor = exports.$ZodUnion = exports.$ZodObjectJIT = exports.$ZodObject = exports.$ZodArray = exports.$ZodDate = exports.$ZodVoid = exports.$ZodNever = exports.$ZodUnknown = exports.$ZodAny = exports.$ZodNull = exports.$ZodUndefined = exports.$ZodSymbol = exports.$ZodBigIntFormat = exports.$ZodBigInt = exports.$ZodBoolean = exports.$ZodNumberFormat = exports.$ZodNumber = exports.$ZodCustomStringFormat = exports.$ZodJWT = exports.$ZodCreditCard = exports.$ZodE164 = exports.$ZodBase64URL = exports.$ZodBase64 = exports.$ZodCIDRv6 = exports.$ZodCIDRv4 = exports.$ZodMAC = exports.$ZodIPv6 = exports.$ZodIPv4 = exports.$ZodISODuration = exports.$ZodISOTime = exports.$ZodISODate = exports.$ZodISODateTime = exports.$ZodKSUID = exports.$ZodXID = exports.$ZodULID = exports.$ZodCUID2 = exports.$ZodCUID = exports.$ZodNanoID = exports.$ZodEmoji = exports.$ZodURL = exports.URL_UNPARSEABLE = exports.URL_BAD_FORMAT = exports.$ZodEmail = exports.$ZodUUID = exports.$ZodGUID = exports.$ZodStringFormat = exports.$ZodString = exports.clone = exports.$ZodType = void 0;
27
+ exports.$ZodCustom = exports.$ZodLazy = exports.$ZodPromise = exports.$ZodFunction = exports.$ZodTemplateLiteral = exports.$ZodReadonly = exports.$ZodPreprocess = exports.$ZodCodec = exports.$ZodPipe = exports.$ZodNaN = exports.$ZodCatch = exports.$ZodSuccess = exports.$ZodNonOptional = exports.$ZodPrefault = exports.$ZodDefault = exports.$ZodNullable = exports.$ZodExactOptional = exports.$ZodOptional = exports.$ZodTransform = exports.$ZodFile = exports.$ZodLiteral = exports.$ZodEnum = exports.$ZodSet = exports.$ZodMap = exports.$ZodRecord = exports.$ZodTuple = exports.$ZodIntersection = exports.$ZodDiscriminatedUnion = void 0;
28
+ exports.standardProps = standardProps;
29
+ exports.parseURLObject = parseURLObject;
30
+ exports.stripTabAndNewline = stripTabAndNewline;
31
+ exports.urlHostnameOk = urlHostnameOk;
32
+ exports.urlProtocolOk = urlProtocolOk;
33
+ exports.isValidIPv6 = isValidIPv6;
34
+ exports.isValidCIDRv6 = isValidCIDRv6;
35
+ exports.isValidBase64 = isValidBase64;
36
+ exports.isValidBase64URL = isValidBase64URL;
37
+ exports.isValidCreditCard = isValidCreditCard;
38
+ exports.isValidJWT = isValidJWT;
39
+ exports.getDiscriminatedOption = getDiscriminatedOption;
40
+ exports.mergeValues = mergeValues;
41
+ const checks = __importStar(require("./checks.cjs"));
42
+ const core = __importStar(require("./core.cjs"));
43
+ const doc_js_1 = require("./doc.cjs");
44
+ const parse_js_1 = require("./parse.cjs");
45
+ const regexes = __importStar(require("./regexes.cjs"));
46
+ const util = __importStar(require("./util.cjs"));
47
+ const versions_js_1 = require("./versions.cjs");
48
+ exports.$ZodType = core.$constructor("$ZodType", (inst, def) => {
49
+ var _a;
50
+ inst ?? (inst = {});
51
+ inst._zod.def = def; // set _def property
52
+ inst._zod.bag = inst._zod.bag || {}; // initialize _bag object
53
+ inst._zod.version = versions_js_1.version;
54
+ const defChecks = inst._zod.def.checks;
55
+ // if inst is itself a checks.$ZodCheck, run it as a check
56
+ const checks = inst._zod.traits.has("$ZodCheck")
57
+ ? [inst, ...(defChecks ?? [])]
58
+ : defChecks?.length
59
+ ? [...defChecks]
60
+ : [];
61
+ for (const ch of checks) {
62
+ for (const fn of ch._zod.onattach) {
63
+ fn(inst);
64
+ }
65
+ }
66
+ if (checks.length === 0) {
67
+ // deferred initializer inst._zod.parse is not yet defined
68
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
69
+ inst._zod.deferred?.push(() => {
70
+ inst._zod.run = inst._zod.parse;
71
+ });
72
+ }
73
+ else {
74
+ const runChecks = (payload, checks, ctx) => {
75
+ if (payload.memo)
76
+ return payload;
77
+ let isAborted = util.aborted(payload);
78
+ let asyncResult;
79
+ for (const ch of checks) {
80
+ if (ch._zod.def.when) {
81
+ if (util.explicitlyAborted(payload))
82
+ continue;
83
+ const shouldRun = ch._zod.def.when(payload);
84
+ if (!shouldRun)
85
+ continue;
86
+ }
87
+ else if (isAborted) {
88
+ continue;
89
+ }
90
+ const currLen = payload.issues.length;
91
+ const _ = ch._zod.check(payload);
92
+ if (_ instanceof Promise && ctx?.async === false) {
93
+ throw new core.$ZodAsyncError();
94
+ }
95
+ if (asyncResult || _ instanceof Promise) {
96
+ asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
97
+ await _;
98
+ const nextLen = payload.issues.length;
99
+ if (nextLen === currLen)
100
+ return;
101
+ util.attachSchema(payload.issues, currLen, inst);
102
+ if (!isAborted)
103
+ isAborted = util.aborted(payload, currLen);
104
+ });
105
+ }
106
+ else {
107
+ const nextLen = payload.issues.length;
108
+ if (nextLen === currLen)
109
+ continue;
110
+ util.attachSchema(payload.issues, currLen, inst);
111
+ if (!isAborted)
112
+ isAborted = util.aborted(payload, currLen);
113
+ }
114
+ }
115
+ if (asyncResult) {
116
+ return asyncResult.then(() => {
117
+ return payload;
118
+ });
119
+ }
120
+ return payload;
121
+ };
122
+ const handleCanaryResult = (canary, payload, ctx) => {
123
+ // abort if the canary is aborted
124
+ if (util.aborted(canary)) {
125
+ canary.aborted = true;
126
+ return canary;
127
+ }
128
+ // run checks first, then
129
+ const checkResult = runChecks(payload, checks, ctx);
130
+ if (checkResult instanceof Promise) {
131
+ if (ctx.async === false)
132
+ throw new core.$ZodAsyncError();
133
+ return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
134
+ }
135
+ return inst._zod.parse(checkResult, ctx);
136
+ };
137
+ inst._zod.run = (payload, ctx) => {
138
+ if (ctx.skipChecks) {
139
+ return inst._zod.parse(payload, ctx);
140
+ }
141
+ if (ctx.direction === "backward") {
142
+ // run canary initial pass (no checks)
143
+ const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });
144
+ if (canary instanceof Promise) {
145
+ return canary.then((canary) => {
146
+ return handleCanaryResult(canary, payload, ctx);
147
+ });
148
+ }
149
+ return handleCanaryResult(canary, payload, ctx);
150
+ }
151
+ // forward
152
+ const result = inst._zod.parse(payload, ctx);
153
+ if (result instanceof Promise) {
154
+ if (ctx.async === false)
155
+ throw new core.$ZodAsyncError();
156
+ return result.then((result) => runChecks(result, checks, ctx));
157
+ }
158
+ return runChecks(result, checks, ctx);
159
+ };
160
+ }
161
+ }, {
162
+ // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.
163
+ get "~standard"() {
164
+ return util.hide(this, "~standard", standardProps(this));
165
+ },
166
+ set "~standard"(value) {
167
+ util.own(this, "~standard", value);
168
+ },
169
+ });
170
+ /** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
171
+ const toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues };
172
+ function standardProps(inst) {
173
+ return {
174
+ validate: (value) => {
175
+ try {
176
+ return toStandardResult((0, parse_js_1.safeParse)(inst, value));
177
+ }
178
+ catch (_) {
179
+ return (0, parse_js_1.safeParseAsync)(inst, value).then(toStandardResult);
180
+ }
181
+ },
182
+ vendor: "zod",
183
+ version: 1,
184
+ };
185
+ }
186
+ var util_js_1 = require("./util.cjs");
187
+ Object.defineProperty(exports, "clone", { enumerable: true, get: function () { return util_js_1.clone; } });
188
+ exports.$ZodString = core.$constructor("$ZodString", (inst, def) => {
189
+ exports.$ZodType.init(inst, def);
190
+ inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);
191
+ inst._zod.parse = (payload, _) => {
192
+ if (def.coerce)
193
+ try {
194
+ payload.value = String(payload.value);
195
+ }
196
+ catch (_) { }
197
+ if (typeof payload.value === "string")
198
+ return payload;
199
+ payload.issues.push({
200
+ expected: "string",
201
+ code: "invalid_type",
202
+ input: payload.value,
203
+ inst,
204
+ });
205
+ return payload;
206
+ };
207
+ });
208
+ exports.$ZodStringFormat = core.$constructor("$ZodStringFormat", (inst, def) => {
209
+ // check initialization must come first
210
+ checks.$ZodCheckStringFormat.init(inst, def);
211
+ exports.$ZodString.init(inst, def);
212
+ });
213
+ exports.$ZodGUID = core.$constructor("$ZodGUID", (inst, def) => {
214
+ def.pattern ?? (def.pattern = regexes.guid);
215
+ exports.$ZodStringFormat.init(inst, def);
216
+ });
217
+ exports.$ZodUUID = core.$constructor("$ZodUUID", (inst, def) => {
218
+ if (def.version) {
219
+ const versionMap = {
220
+ v1: 1,
221
+ v2: 2,
222
+ v3: 3,
223
+ v4: 4,
224
+ v5: 5,
225
+ v6: 6,
226
+ v7: 7,
227
+ v8: 8,
228
+ };
229
+ const v = versionMap[def.version];
230
+ if (v === undefined)
231
+ throw new Error(`Invalid UUID version: "${def.version}"`);
232
+ def.pattern ?? (def.pattern = regexes.uuid(v));
233
+ }
234
+ else
235
+ def.pattern ?? (def.pattern = regexes.uuid());
236
+ exports.$ZodStringFormat.init(inst, def);
237
+ });
238
+ exports.$ZodEmail = core.$constructor("$ZodEmail", (inst, def) => {
239
+ def.pattern ?? (def.pattern = regexes.email);
240
+ exports.$ZodStringFormat.init(inst, def);
241
+ });
242
+ /** The `://` guard rejected the input before the URL constructor saw it. */
243
+ exports.URL_BAD_FORMAT = 1;
244
+ /** The URL constructor rejected the input. */
245
+ exports.URL_UNPARSEABLE = 2;
246
+ /** 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. */
247
+ function parseURLObject(trimmed, def) {
248
+ // When normalize is off, require :// for http/https URLs. This prevents strings like "http:example.com" or "https:/path" from being silently accepted
249
+ if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source && !/^https?:\/\//i.test(trimmed)) {
250
+ return exports.URL_BAD_FORMAT;
251
+ }
252
+ try {
253
+ // @ts-ignore
254
+ return new URL(trimmed);
255
+ }
256
+ catch {
257
+ return exports.URL_UNPARSEABLE;
258
+ }
259
+ }
260
+ const asciiTabOrNewline = /[\t\n\r]/g;
261
+ /** 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. */
262
+ function stripTabAndNewline(value) {
263
+ return value.replace(asciiTabOrNewline, "");
264
+ }
265
+ function urlHostnameOk(url, hostname) {
266
+ hostname.lastIndex = 0;
267
+ return hostname.test(url.hostname);
268
+ }
269
+ function urlProtocolOk(url, protocol) {
270
+ protocol.lastIndex = 0;
271
+ return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
272
+ }
273
+ exports.$ZodURL = core.$constructor("$ZodURL", (inst, def) => {
274
+ exports.$ZodStringFormat.init(inst, def);
275
+ inst._zod.check = (payload) => {
276
+ try {
277
+ // Trim whitespace from input
278
+ const trimmed = payload.value.trim();
279
+ const url = parseURLObject(trimmed, def);
280
+ if (url === exports.URL_BAD_FORMAT) {
281
+ payload.issues.push({
282
+ code: "invalid_format",
283
+ format: "url",
284
+ note: "Invalid URL format",
285
+ input: payload.value,
286
+ inst,
287
+ continue: !def.abort,
288
+ });
289
+ return;
290
+ }
291
+ if (url === exports.URL_UNPARSEABLE) {
292
+ payload.issues.push({
293
+ code: "invalid_format",
294
+ format: "url",
295
+ input: payload.value,
296
+ inst,
297
+ continue: !def.abort,
298
+ });
299
+ return;
300
+ }
301
+ if (def.hostname && !urlHostnameOk(url, def.hostname)) {
302
+ payload.issues.push({
303
+ code: "invalid_format",
304
+ format: "url",
305
+ note: "Invalid hostname",
306
+ pattern: def.hostname.source,
307
+ input: payload.value,
308
+ inst,
309
+ continue: !def.abort,
310
+ });
311
+ }
312
+ if (def.protocol && !urlProtocolOk(url, def.protocol)) {
313
+ payload.issues.push({
314
+ code: "invalid_format",
315
+ format: "url",
316
+ note: "Invalid protocol",
317
+ pattern: def.protocol.source,
318
+ input: payload.value,
319
+ inst,
320
+ continue: !def.abort,
321
+ });
322
+ }
323
+ // Set the output value based on normalize flag
324
+ payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
325
+ return;
326
+ }
327
+ catch (_) {
328
+ payload.issues.push({
329
+ code: "invalid_format",
330
+ format: "url",
331
+ input: payload.value,
332
+ inst,
333
+ continue: !def.abort,
334
+ });
335
+ }
336
+ };
337
+ });
338
+ exports.$ZodEmoji = core.$constructor("$ZodEmoji", (inst, def) => {
339
+ def.pattern ?? (def.pattern = regexes.emoji());
340
+ exports.$ZodStringFormat.init(inst, def);
341
+ });
342
+ exports.$ZodNanoID = core.$constructor("$ZodNanoID", (inst, def) => {
343
+ if (def.length !== undefined && (!Number.isInteger(def.length) || def.length < 1))
344
+ throw new Error(`Invalid nanoid length: ${def.length}`);
345
+ def.pattern ?? (def.pattern = def.length === undefined ? regexes.nanoid : regexes.nanoidOfLength(def.length));
346
+ exports.$ZodStringFormat.init(inst, def);
347
+ });
348
+ /**
349
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
350
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
351
+ * See https://github.com/paralleldrive/cuid.
352
+ */
353
+ exports.$ZodCUID = core.$constructor("$ZodCUID", (inst, def) => {
354
+ def.pattern ?? (def.pattern = regexes.cuid);
355
+ exports.$ZodStringFormat.init(inst, def);
356
+ });
357
+ exports.$ZodCUID2 = core.$constructor("$ZodCUID2", (inst, def) => {
358
+ def.pattern ?? (def.pattern = regexes.cuid2);
359
+ exports.$ZodStringFormat.init(inst, def);
360
+ });
361
+ exports.$ZodULID = core.$constructor("$ZodULID", (inst, def) => {
362
+ def.pattern ?? (def.pattern = regexes.ulid);
363
+ exports.$ZodStringFormat.init(inst, def);
364
+ });
365
+ exports.$ZodXID = core.$constructor("$ZodXID", (inst, def) => {
366
+ def.pattern ?? (def.pattern = regexes.xid);
367
+ exports.$ZodStringFormat.init(inst, def);
368
+ });
369
+ exports.$ZodKSUID = core.$constructor("$ZodKSUID", (inst, def) => {
370
+ def.pattern ?? (def.pattern = regexes.ksuid);
371
+ exports.$ZodStringFormat.init(inst, def);
372
+ });
373
+ exports.$ZodISODateTime = core.$constructor("$ZodISODateTime", (inst, def) => {
374
+ def.pattern ?? (def.pattern = regexes.datetime(def));
375
+ exports.$ZodStringFormat.init(inst, def);
376
+ // these two drop the offset or seconds `date-time` requires — on the bag not the def, since `z.string().check(...)` lands the format on a different schema
377
+ if (def.local || def.precision === -1) {
378
+ inst._zod.bag.laxFormat = true;
379
+ inst._zod.onattach.push((s) => {
380
+ s._zod.bag.laxFormat = true;
381
+ });
382
+ }
383
+ });
384
+ exports.$ZodISODate = core.$constructor("$ZodISODate", (inst, def) => {
385
+ def.pattern ?? (def.pattern = regexes.date);
386
+ exports.$ZodStringFormat.init(inst, def);
387
+ });
388
+ exports.$ZodISOTime = core.$constructor("$ZodISOTime", (inst, def) => {
389
+ def.pattern ?? (def.pattern = regexes.time(def));
390
+ exports.$ZodStringFormat.init(inst, def);
391
+ });
392
+ exports.$ZodISODuration = core.$constructor("$ZodISODuration", (inst, def) => {
393
+ def.pattern ?? (def.pattern = regexes.duration);
394
+ exports.$ZodStringFormat.init(inst, def);
395
+ });
396
+ exports.$ZodIPv4 = core.$constructor("$ZodIPv4", (inst, def) => {
397
+ def.pattern ?? (def.pattern = regexes.ipv4);
398
+ exports.$ZodStringFormat.init(inst, def);
399
+ inst._zod.bag.format = `ipv4`;
400
+ });
401
+ /** 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`. */
402
+ const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
403
+ function isValidIPv6(value) {
404
+ if (!ipv6Alphabet.test(value))
405
+ return false;
406
+ try {
407
+ // @ts-ignore
408
+ new URL(`http://[${value}]`);
409
+ return true;
410
+ }
411
+ catch {
412
+ return false;
413
+ }
414
+ }
415
+ exports.$ZodIPv6 = core.$constructor("$ZodIPv6", (inst, def) => {
416
+ def.pattern ?? (def.pattern = regexes.ipv6);
417
+ exports.$ZodStringFormat.init(inst, def);
418
+ inst._zod.bag.format = `ipv6`;
419
+ inst._zod.check = (payload) => {
420
+ if (!isValidIPv6(payload.value)) {
421
+ payload.issues.push({
422
+ code: "invalid_format",
423
+ format: "ipv6",
424
+ input: payload.value,
425
+ inst,
426
+ continue: !def.abort,
427
+ });
428
+ }
429
+ };
430
+ });
431
+ exports.$ZodMAC = core.$constructor("$ZodMAC", (inst, def) => {
432
+ def.pattern ?? (def.pattern = regexes.mac(def.delimiter));
433
+ exports.$ZodStringFormat.init(inst, def);
434
+ inst._zod.bag.format = `mac`;
435
+ });
436
+ exports.$ZodCIDRv4 = core.$constructor("$ZodCIDRv4", (inst, def) => {
437
+ def.pattern ?? (def.pattern = regexes.cidrv4);
438
+ exports.$ZodStringFormat.init(inst, def);
439
+ });
440
+ function isValidCIDRv6(value) {
441
+ const parts = value.split("/");
442
+ if (parts.length !== 2)
443
+ return false;
444
+ const [address, prefix] = parts;
445
+ if (!prefix)
446
+ return false;
447
+ const prefixNum = Number(prefix);
448
+ if (`${prefixNum}` !== prefix)
449
+ return false;
450
+ if (prefixNum < 0 || prefixNum > 128)
451
+ return false;
452
+ return isValidIPv6(address);
453
+ }
454
+ exports.$ZodCIDRv6 = core.$constructor("$ZodCIDRv6", (inst, def) => {
455
+ def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation
456
+ exports.$ZodStringFormat.init(inst, def);
457
+ inst._zod.check = (payload) => {
458
+ if (!isValidCIDRv6(payload.value)) {
459
+ payload.issues.push({
460
+ code: "invalid_format",
461
+ format: "cidrv6",
462
+ input: payload.value,
463
+ inst,
464
+ continue: !def.abort,
465
+ });
466
+ }
467
+ };
468
+ });
469
+ ////////////////////////////// ZodBase64 //////////////////////////////
470
+ function isValidBase64(data) {
471
+ if (data === "")
472
+ return true;
473
+ // atob ignores whitespace, so reject it up front.
474
+ if (/\s/.test(data))
475
+ return false;
476
+ if (data.length % 4 !== 0)
477
+ return false;
478
+ try {
479
+ // @ts-ignore
480
+ atob(data);
481
+ return true;
482
+ }
483
+ catch {
484
+ return false;
485
+ }
486
+ }
487
+ exports.$ZodBase64 = core.$constructor("$ZodBase64", (inst, def) => {
488
+ def.pattern ?? (def.pattern = regexes.base64);
489
+ exports.$ZodStringFormat.init(inst, def);
490
+ inst._zod.bag.contentEncoding = "base64";
491
+ inst._zod.check = (payload) => {
492
+ if (isValidBase64(payload.value))
493
+ return;
494
+ payload.issues.push({
495
+ code: "invalid_format",
496
+ format: "base64",
497
+ input: payload.value,
498
+ inst,
499
+ continue: !def.abort,
500
+ });
501
+ };
502
+ });
503
+ ////////////////////////////// ZodBase64 //////////////////////////////
504
+ function isValidBase64URL(data) {
505
+ if (!regexes.base64url.test(data))
506
+ return false;
507
+ const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
508
+ const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
509
+ return isValidBase64(padded);
510
+ }
511
+ exports.$ZodBase64URL = core.$constructor("$ZodBase64URL", (inst, def) => {
512
+ def.pattern ?? (def.pattern = regexes.base64url);
513
+ exports.$ZodStringFormat.init(inst, def);
514
+ inst._zod.bag.contentEncoding = "base64url";
515
+ inst._zod.check = (payload) => {
516
+ if (isValidBase64URL(payload.value))
517
+ return;
518
+ payload.issues.push({
519
+ code: "invalid_format",
520
+ format: "base64url",
521
+ input: payload.value,
522
+ inst,
523
+ continue: !def.abort,
524
+ });
525
+ };
526
+ });
527
+ exports.$ZodE164 = core.$constructor("$ZodE164", (inst, def) => {
528
+ def.pattern ?? (def.pattern = regexes.e164);
529
+ exports.$ZodStringFormat.init(inst, def);
530
+ });
531
+ ////////////////////////////// ZodCreditCard //////////////////////////////
532
+ const CC_SANITIZE = /[- ]/g;
533
+ /** Luhn checksum on a digit-only string. Adapted from valibot (MIT). */
534
+ function isLuhnAlgo(digits) {
535
+ let length = digits.length;
536
+ let bit = 1;
537
+ let sum = 0;
538
+ while (length) {
539
+ const value = +digits[--length];
540
+ bit ^= 1;
541
+ sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;
542
+ }
543
+ return sum % 10 === 0;
544
+ }
545
+ function isValidCreditCard(input) {
546
+ if (!regexes.creditCard.test(input))
547
+ return false;
548
+ return isLuhnAlgo(input.replace(CC_SANITIZE, ""));
549
+ }
550
+ exports.$ZodCreditCard = core.$constructor("$ZodCreditCard", (inst, def) => {
551
+ // 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.
552
+ def.pattern ?? (def.pattern = regexes.creditCard);
553
+ exports.$ZodStringFormat.init(inst, def);
554
+ inst._zod.check = (payload) => {
555
+ if (isValidCreditCard(payload.value))
556
+ return;
557
+ payload.issues.push({
558
+ code: "invalid_format",
559
+ format: "credit_card",
560
+ input: payload.value,
561
+ inst,
562
+ continue: !def.abort,
563
+ });
564
+ };
565
+ });
566
+ ////////////////////////////// ZodJWT //////////////////////////////
567
+ function isValidJWT(token, algorithm = null) {
568
+ try {
569
+ const tokensParts = token.split(".");
570
+ if (tokensParts.length !== 3)
571
+ return false;
572
+ const [header] = tokensParts;
573
+ if (!header)
574
+ return false;
575
+ // @ts-ignore
576
+ const parsedHeader = JSON.parse(atob(header));
577
+ if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
578
+ return false;
579
+ if (!parsedHeader.alg)
580
+ return false;
581
+ if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
582
+ return false;
583
+ return true;
584
+ }
585
+ catch {
586
+ return false;
587
+ }
588
+ }
589
+ exports.$ZodJWT = core.$constructor("$ZodJWT", (inst, def) => {
590
+ exports.$ZodStringFormat.init(inst, def);
591
+ inst._zod.check = (payload) => {
592
+ if (isValidJWT(payload.value, def.alg))
593
+ return;
594
+ payload.issues.push({
595
+ code: "invalid_format",
596
+ format: "jwt",
597
+ input: payload.value,
598
+ inst,
599
+ continue: !def.abort,
600
+ });
601
+ };
602
+ });
603
+ exports.$ZodCustomStringFormat = core.$constructor("$ZodCustomStringFormat", (inst, def) => {
604
+ exports.$ZodStringFormat.init(inst, def);
605
+ inst._zod.check = (payload) => {
606
+ if (def.fn(payload.value))
607
+ return;
608
+ payload.issues.push({
609
+ code: "invalid_format",
610
+ format: def.format,
611
+ input: payload.value,
612
+ inst,
613
+ continue: !def.abort,
614
+ });
615
+ };
616
+ });
617
+ exports.$ZodNumber = core.$constructor("$ZodNumber", (inst, def) => {
618
+ exports.$ZodType.init(inst, def);
619
+ inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;
620
+ inst._zod.parse = (payload, _ctx) => {
621
+ if (def.coerce)
622
+ try {
623
+ payload.value = Number(payload.value);
624
+ }
625
+ catch (_) { }
626
+ const input = payload.value;
627
+ if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
628
+ return payload;
629
+ }
630
+ const received = typeof input === "number"
631
+ ? Number.isNaN(input)
632
+ ? "NaN"
633
+ : !Number.isFinite(input)
634
+ ? String(input)
635
+ : undefined
636
+ : undefined;
637
+ payload.issues.push({
638
+ expected: "number",
639
+ code: "invalid_type",
640
+ input,
641
+ inst,
642
+ ...(received ? { received } : {}),
643
+ });
644
+ return payload;
645
+ };
646
+ });
647
+ exports.$ZodNumberFormat = core.$constructor("$ZodNumberFormat", (inst, def) => {
648
+ checks.$ZodCheckNumberFormat.init(inst, def);
649
+ exports.$ZodNumber.init(inst, def); // no format checks
650
+ });
651
+ exports.$ZodBoolean = core.$constructor("$ZodBoolean", (inst, def) => {
652
+ exports.$ZodType.init(inst, def);
653
+ inst._zod.pattern = regexes.boolean;
654
+ inst._zod.parse = (payload, _ctx) => {
655
+ if (def.coerce)
656
+ try {
657
+ payload.value = Boolean(payload.value);
658
+ }
659
+ catch (_) { }
660
+ const input = payload.value;
661
+ if (typeof input === "boolean")
662
+ return payload;
663
+ payload.issues.push({
664
+ expected: "boolean",
665
+ code: "invalid_type",
666
+ input,
667
+ inst,
668
+ });
669
+ return payload;
670
+ };
671
+ });
672
+ exports.$ZodBigInt = core.$constructor("$ZodBigInt", (inst, def) => {
673
+ exports.$ZodType.init(inst, def);
674
+ inst._zod.pattern = regexes.bigint;
675
+ inst._zod.parse = (payload, _ctx) => {
676
+ if (def.coerce)
677
+ try {
678
+ payload.value = BigInt(payload.value);
679
+ }
680
+ catch (_) { }
681
+ if (typeof payload.value === "bigint")
682
+ return payload;
683
+ payload.issues.push({
684
+ expected: "bigint",
685
+ code: "invalid_type",
686
+ input: payload.value,
687
+ inst,
688
+ });
689
+ return payload;
690
+ };
691
+ });
692
+ exports.$ZodBigIntFormat = core.$constructor("$ZodBigIntFormat", (inst, def) => {
693
+ checks.$ZodCheckBigIntFormat.init(inst, def);
694
+ exports.$ZodBigInt.init(inst, def); // no format checks
695
+ });
696
+ exports.$ZodSymbol = core.$constructor("$ZodSymbol", (inst, def) => {
697
+ exports.$ZodType.init(inst, def);
698
+ inst._zod.parse = (payload, _ctx) => {
699
+ const input = payload.value;
700
+ if (typeof input === "symbol")
701
+ return payload;
702
+ payload.issues.push({
703
+ expected: "symbol",
704
+ code: "invalid_type",
705
+ input,
706
+ inst,
707
+ });
708
+ return payload;
709
+ };
710
+ });
711
+ exports.$ZodUndefined = core.$constructor("$ZodUndefined", (inst, def) => {
712
+ exports.$ZodType.init(inst, def);
713
+ inst._zod.pattern = regexes.undefined;
714
+ inst._zod.values = new Set([undefined]);
715
+ inst._zod.parse = (payload, _ctx) => {
716
+ const input = payload.value;
717
+ if (typeof input === "undefined")
718
+ return payload;
719
+ payload.issues.push({
720
+ expected: "undefined",
721
+ code: "invalid_type",
722
+ input,
723
+ inst,
724
+ });
725
+ return payload;
726
+ };
727
+ });
728
+ exports.$ZodNull = core.$constructor("$ZodNull", (inst, def) => {
729
+ exports.$ZodType.init(inst, def);
730
+ inst._zod.pattern = regexes.null;
731
+ inst._zod.values = new Set([null]);
732
+ inst._zod.parse = (payload, _ctx) => {
733
+ const input = payload.value;
734
+ if (input === null)
735
+ return payload;
736
+ payload.issues.push({
737
+ expected: "null",
738
+ code: "invalid_type",
739
+ input,
740
+ inst,
741
+ });
742
+ return payload;
743
+ };
744
+ });
745
+ exports.$ZodAny = core.$constructor("$ZodAny", (inst, def) => {
746
+ exports.$ZodType.init(inst, def);
747
+ inst._zod.parse = (payload) => payload;
748
+ });
749
+ exports.$ZodUnknown = core.$constructor("$ZodUnknown", (inst, def) => {
750
+ exports.$ZodType.init(inst, def);
751
+ inst._zod.parse = (payload) => payload;
752
+ });
753
+ exports.$ZodNever = core.$constructor("$ZodNever", (inst, def) => {
754
+ exports.$ZodType.init(inst, def);
755
+ inst._zod.parse = (payload, _ctx) => {
756
+ payload.issues.push({
757
+ expected: "never",
758
+ code: "invalid_type",
759
+ input: payload.value,
760
+ inst,
761
+ });
762
+ return payload;
763
+ };
764
+ });
765
+ exports.$ZodVoid = core.$constructor("$ZodVoid", (inst, def) => {
766
+ exports.$ZodType.init(inst, def);
767
+ inst._zod.parse = (payload, _ctx) => {
768
+ const input = payload.value;
769
+ if (typeof input === "undefined")
770
+ return payload;
771
+ payload.issues.push({
772
+ expected: "void",
773
+ code: "invalid_type",
774
+ input,
775
+ inst,
776
+ });
777
+ return payload;
778
+ };
779
+ });
780
+ exports.$ZodDate = core.$constructor("$ZodDate", (inst, def) => {
781
+ exports.$ZodType.init(inst, def);
782
+ inst._zod.parse = (payload, _ctx) => {
783
+ if (def.coerce) {
784
+ try {
785
+ payload.value = new Date(payload.value);
786
+ }
787
+ catch (_err) { }
788
+ }
789
+ const input = payload.value;
790
+ const isDate = input instanceof Date;
791
+ const isValidDate = isDate && !Number.isNaN(input.getTime());
792
+ if (isValidDate)
793
+ return payload;
794
+ payload.issues.push({
795
+ expected: "date",
796
+ code: "invalid_type",
797
+ input,
798
+ ...(isDate ? { received: "Invalid Date" } : {}),
799
+ inst,
800
+ });
801
+ return payload;
802
+ };
803
+ });
804
+ function handleArrayResult(result, final, index) {
805
+ if (result.issues.length) {
806
+ final.issues.push(...util.prefixIssues(index, result.issues));
807
+ }
808
+ final.value[index] = result.value;
809
+ }
810
+ exports.$ZodArray = core.$constructor("$ZodArray", (inst, def) => {
811
+ exports.$ZodType.init(inst, def);
812
+ const memo = core.globalConfig.memoizer;
813
+ memo?.attach(inst);
814
+ inst._zod.parse = (payload, ctx) => {
815
+ const input = payload.value;
816
+ if (!Array.isArray(input)) {
817
+ payload.issues.push({
818
+ expected: "array",
819
+ code: "invalid_type",
820
+ input,
821
+ inst,
822
+ });
823
+ return payload;
824
+ }
825
+ payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
826
+ const proms = [];
827
+ for (let i = 0; i < input.length; i++) {
828
+ const item = input[i];
829
+ const result = def.element._zod.run({
830
+ value: item,
831
+ issues: [],
832
+ }, ctx);
833
+ if (result instanceof Promise) {
834
+ proms.push(result.then((result) => handleArrayResult(result, payload, i)));
835
+ }
836
+ else {
837
+ handleArrayResult(result, payload, i);
838
+ }
839
+ }
840
+ if (proms.length) {
841
+ return Promise.all(proms).then(() => payload);
842
+ }
843
+ return payload; //handleArrayResultsAsync(parseResults, final);
844
+ };
845
+ });
846
+ function handlePropertyResult(result, final, key, input, optin, optout) {
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
+ }
853
+ if (result.issues.length) {
854
+ // For optional-in/out schemas, ignore errors on absent keys.
855
+ if (optin !== undefined && isOptionalOut && !isPresent) {
856
+ return;
857
+ }
858
+ final.issues.push(...util.prefixIssues(key, result.issues));
859
+ }
860
+ if (!isPresent && optin === undefined) {
861
+ if (!result.issues.length) {
862
+ final.issues.push({
863
+ code: "invalid_type",
864
+ expected: "nonoptional",
865
+ input: undefined,
866
+ path: [key],
867
+ });
868
+ }
869
+ return;
870
+ }
871
+ if (result.value === undefined) {
872
+ if (isPresent) {
873
+ final.value[key] = undefined;
874
+ }
875
+ }
876
+ else {
877
+ final.value[key] = result.value;
878
+ }
879
+ }
880
+ // one shared instance; a fresh [] per schema cost 56 bytes retained
881
+ const NO_SYMBOL_KEYS = [];
882
+ function normalizeDef(def) {
883
+ const keys = Object.keys(def.shape);
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) {
889
+ if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) {
890
+ throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
891
+ }
892
+ }
893
+ const okeys = util.optionalKeys(def.shape);
894
+ return {
895
+ ...def,
896
+ allKeys,
897
+ symbolKeys,
898
+ // string-only: handleCatchall matches it against `for...in`, which never yields a symbol
899
+ keySet: new Set(keys),
900
+ numKeys: keys.length,
901
+ optionalKeys: new Set(okeys),
902
+ };
903
+ }
904
+ function handleCatchall(proms, input, payload, ctx, def, inst) {
905
+ const unrecognized = [];
906
+ const keySet = def.keySet;
907
+ const _catchall = def.catchall._zod;
908
+ const t = _catchall.def.type;
909
+ const optin = _catchall.optin;
910
+ const optout = _catchall.optout;
911
+ for (const key in input) {
912
+ // Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.
913
+ if (keySet.has(key))
914
+ continue;
915
+ // 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.
916
+ if (key === "__proto__") {
917
+ if (t === "never")
918
+ unrecognized.push(key);
919
+ continue;
920
+ }
921
+ if (t === "never") {
922
+ unrecognized.push(key);
923
+ continue;
924
+ }
925
+ const r = _catchall.run({ value: input[key], issues: [] }, ctx);
926
+ if (r instanceof Promise) {
927
+ proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
928
+ }
929
+ else {
930
+ handlePropertyResult(r, payload, key, input, optin, optout);
931
+ }
932
+ }
933
+ if (unrecognized.length) {
934
+ payload.issues.push({
935
+ code: "unrecognized_keys",
936
+ keys: unrecognized,
937
+ input,
938
+ inst,
939
+ // 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.
940
+ continue: true,
941
+ });
942
+ }
943
+ if (!proms.length)
944
+ return payload;
945
+ return Promise.all(proms).then(() => {
946
+ return payload;
947
+ });
948
+ }
949
+ // Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it. Keyed by def, so a def rebuilt by a builder is simply absent rather than inheriting the source's. Read its keys with `Object.keys`, which does not invoke them — that is what lets a discriminated union check its discriminator without resolving an option whose getters reference the union being constructed.
950
+ const propShapes = new WeakMap();
951
+ exports.$ZodObject = core.$constructor("$ZodObject", (inst, def) => {
952
+ // requires cast because technically $ZodObject doesn't extend
953
+ exports.$ZodType.init(inst, def);
954
+ // const sh = def.shape;
955
+ const desc = Object.getOwnPropertyDescriptor(def, "shape");
956
+ if (!desc?.get) {
957
+ const sh = def.shape;
958
+ propShapes.set(def, sh);
959
+ Object.defineProperty(def, "shape", {
960
+ get: () => {
961
+ const newSh = { ...sh };
962
+ Object.defineProperty(def, "shape", {
963
+ value: newSh,
964
+ });
965
+ propShapes.set(def, newSh);
966
+ return newSh;
967
+ },
968
+ });
969
+ }
970
+ const _normalized = util.cached(() => normalizeDef(def));
971
+ util.defineLazyInternal(inst, "propValues", (zod) => {
972
+ const shape = zod.def.shape;
973
+ const propValues = {};
974
+ for (const key in shape) {
975
+ const field = shape[key]._zod;
976
+ if (field.values) {
977
+ if (!Object.prototype.hasOwnProperty.call(propValues, key)) {
978
+ util.assignProp(propValues, key, new Set());
979
+ }
980
+ for (const v of field.values)
981
+ propValues[key].add(v);
982
+ // 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.
983
+ if (field.optin !== undefined)
984
+ propValues[key].add(undefined);
985
+ }
986
+ }
987
+ return propValues;
988
+ });
989
+ const isObject = util.isObject;
990
+ const catchall = def.catchall;
991
+ let value;
992
+ const memo = core.globalConfig.memoizer;
993
+ memo?.attach(inst);
994
+ inst._zod.parse = (payload, ctx) => {
995
+ value ?? (value = _normalized.value);
996
+ const input = payload.value;
997
+ if (!isObject(input)) {
998
+ payload.issues.push({
999
+ expected: "object",
1000
+ code: "invalid_type",
1001
+ input,
1002
+ inst,
1003
+ });
1004
+ return payload;
1005
+ }
1006
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1007
+ const proms = [];
1008
+ const shape = value.shape;
1009
+ for (const key of value.allKeys) {
1010
+ if (key === "__proto__")
1011
+ continue;
1012
+ const el = shape[key];
1013
+ const optin = el._zod.optin;
1014
+ const optout = el._zod.optout;
1015
+ const r = el._zod.run({ value: input[key], issues: [] }, ctx);
1016
+ if (r instanceof Promise) {
1017
+ proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
1018
+ }
1019
+ else {
1020
+ handlePropertyResult(r, payload, key, input, optin, optout);
1021
+ }
1022
+ }
1023
+ if (!catchall) {
1024
+ return proms.length ? Promise.all(proms).then(() => payload) : payload;
1025
+ }
1026
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
1027
+ };
1028
+ });
1029
+ exports.$ZodObjectJIT = core.$constructor("$ZodObjectJIT", (inst, def) => {
1030
+ // requires cast because technically $ZodObject doesn't extend
1031
+ exports.$ZodObject.init(inst, def);
1032
+ const superParse = inst._zod.parse;
1033
+ const _normalized = util.cached(() => normalizeDef(def));
1034
+ const memo = core.globalConfig.memoizer;
1035
+ const generateFastpass = (shape) => {
1036
+ const normalized = _normalized.value;
1037
+ const syms = normalized.symbolKeys;
1038
+ // a symbol has no source literal, so it is read as `syms[i]` off the closed-over scope
1039
+ const doc = new doc_js_1.Doc(["payload", "ctx"], { shape, inst, memo, syms });
1040
+ const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1041
+ // Prefixes in place, like util.prefixIssues does for every interpreted path.
1042
+ const prefixStr = (id, k) => `
1043
+ for (let i = 0; i < ${id}.issues.length; i++) {
1044
+ const iss = ${id}.issues[i];
1045
+ iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
1046
+ payload.issues.push(iss);
1047
+ }`;
1048
+ doc.write(`const input = payload.value;`);
1049
+ const ids = Object.create(null);
1050
+ let counter = 0;
1051
+ for (const key of normalized.allKeys) {
1052
+ ids[key] = `key_${counter++}`;
1053
+ }
1054
+ // A: preserve key order {
1055
+ doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
1056
+ for (const key of normalized.allKeys) {
1057
+ if (key === "__proto__")
1058
+ continue;
1059
+ const id = ids[key];
1060
+ const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : util.esc(key);
1061
+ const isPresent = `${k} in input`;
1062
+ const schema = shape[key];
1063
+ const optin = schema?._zod?.optin;
1064
+ const isOptionalIn = optin !== undefined;
1065
+ const isOptionalOut = schema?._zod?.optout === "optional";
1066
+ doc.write(`const ${id} = ${parseStr(k)};`);
1067
+ if (isOptionalIn && isOptionalOut) {
1068
+ // 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.
1069
+ const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
1070
+ doc.write(`
1071
+ const ${id}_present = ${isPresent};
1072
+ if (!${id}.issues.length || ${id}_present) {
1073
+ if (${id}.issues.length) {${prefixStr(id, k)}
1074
+ }
1075
+
1076
+ if (${assign}) {
1077
+ newResult[${k}] = ${id}.value;
1078
+ }
1079
+ }
1080
+
1081
+ `);
1082
+ }
1083
+ else if (!isOptionalIn) {
1084
+ doc.write(`
1085
+ const ${id}_present = ${isPresent};
1086
+ if (${id}.issues.length) {${prefixStr(id, k)}
1087
+ }
1088
+ if (!${id}_present && !${id}.issues.length) {
1089
+ payload.issues.push({
1090
+ code: "invalid_type",
1091
+ expected: "nonoptional",
1092
+ input: undefined,
1093
+ path: [${k}]
1094
+ });
1095
+ }
1096
+
1097
+ if (${id}_present) {
1098
+ newResult[${k}] = ${id}.value;
1099
+ }
1100
+
1101
+ `);
1102
+ }
1103
+ else {
1104
+ doc.write(`
1105
+ if (${id}.issues.length) {${prefixStr(id, k)}
1106
+ }
1107
+
1108
+ if (${id}.value === undefined) {
1109
+ if (${isPresent}) {
1110
+ newResult[${k}] = undefined;
1111
+ }
1112
+ } else {
1113
+ newResult[${k}] = ${id}.value;
1114
+ }
1115
+
1116
+ `);
1117
+ }
1118
+ }
1119
+ doc.write(`payload.value = newResult;`);
1120
+ doc.write(`return payload;`);
1121
+ // 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
1122
+ return doc.compile();
1123
+ };
1124
+ let fastpass;
1125
+ const isObject = util.isObject;
1126
+ const jit = !core.globalConfig.jitless;
1127
+ const allowsEval = util.allowsEval;
1128
+ const fastEnabled = jit && allowsEval.value; // && !def.catchall;
1129
+ const catchall = def.catchall;
1130
+ let value;
1131
+ inst._zod.parse = (payload, ctx) => {
1132
+ value ?? (value = _normalized.value);
1133
+ const input = payload.value;
1134
+ if (!isObject(input)) {
1135
+ payload.issues.push({
1136
+ expected: "object",
1137
+ code: "invalid_type",
1138
+ input,
1139
+ inst,
1140
+ });
1141
+ return payload;
1142
+ }
1143
+ if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
1144
+ // always synchronous
1145
+ if (!fastpass)
1146
+ fastpass = generateFastpass(def.shape);
1147
+ payload = fastpass(payload, ctx);
1148
+ if (!catchall)
1149
+ return payload;
1150
+ return handleCatchall([], input, payload, ctx, value, inst);
1151
+ }
1152
+ return superParse(payload, ctx);
1153
+ };
1154
+ });
1155
+ function handleUnionResults(results, final, inst, ctx) {
1156
+ for (const result of results) {
1157
+ if (result.issues.length === 0) {
1158
+ final.value = result.value;
1159
+ return final;
1160
+ }
1161
+ }
1162
+ const nonaborted = results.filter((r) => !util.aborted(r));
1163
+ if (nonaborted.length === 1) {
1164
+ final.value = nonaborted[0].value;
1165
+ return nonaborted[0];
1166
+ }
1167
+ final.issues.push({
1168
+ code: "invalid_union",
1169
+ input: final.value,
1170
+ inst,
1171
+ errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
1172
+ });
1173
+ return final;
1174
+ }
1175
+ exports.$ZodUnion = core.$constructor("$ZodUnion", (inst, def) => {
1176
+ exports.$ZodType.init(inst, def);
1177
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted")
1178
+ ? "defaulted"
1179
+ : zod.def.options.some((o) => o._zod.optin !== undefined)
1180
+ ? "optional"
1181
+ : undefined);
1182
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
1183
+ util.defineLazyInternal(inst, "values", (zod) => {
1184
+ if (zod.def.options.every((o) => o._zod.values)) {
1185
+ return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
1186
+ }
1187
+ return undefined;
1188
+ });
1189
+ util.defineLazyInternal(inst, "pattern", (zod) => {
1190
+ if (zod.def.options.every((o) => o._zod.pattern)) {
1191
+ const patterns = zod.def.options.map((o) => o._zod.pattern);
1192
+ return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join("|")})$`);
1193
+ }
1194
+ return undefined;
1195
+ });
1196
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
1197
+ inst._zod.parse = (payload, ctx) => {
1198
+ if (first) {
1199
+ return first(payload, ctx);
1200
+ }
1201
+ let async = false;
1202
+ const results = [];
1203
+ for (const option of def.options) {
1204
+ const result = option._zod.run({
1205
+ value: payload.value,
1206
+ issues: [],
1207
+ }, ctx);
1208
+ if (result instanceof Promise) {
1209
+ results.push(result);
1210
+ async = true;
1211
+ }
1212
+ else {
1213
+ if (result.issues.length === 0)
1214
+ return result;
1215
+ results.push(result);
1216
+ }
1217
+ }
1218
+ if (!async)
1219
+ return handleUnionResults(results, payload, inst, ctx);
1220
+ return Promise.all(results).then((results) => {
1221
+ return handleUnionResults(results, payload, inst, ctx);
1222
+ });
1223
+ };
1224
+ });
1225
+ function handleExclusiveUnionResults(results, final, inst, ctx) {
1226
+ const matches = [];
1227
+ for (let i = 0; i < results.length; i++) {
1228
+ if (results[i].issues.length === 0)
1229
+ matches.push(i);
1230
+ }
1231
+ if (matches.length === 1) {
1232
+ final.value = results[matches[0]].value;
1233
+ return final;
1234
+ }
1235
+ if (matches.length === 0) {
1236
+ // No matches - same as regular union
1237
+ final.issues.push({
1238
+ code: "invalid_union",
1239
+ input: final.value,
1240
+ inst,
1241
+ errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
1242
+ });
1243
+ }
1244
+ else {
1245
+ // Multiple matches - exclusive union failure
1246
+ final.issues.push({
1247
+ code: "invalid_union",
1248
+ input: final.value,
1249
+ inst,
1250
+ errors: [],
1251
+ inclusive: false,
1252
+ matches,
1253
+ });
1254
+ }
1255
+ return final;
1256
+ }
1257
+ exports.$ZodXor = core.$constructor("$ZodXor", (inst, def) => {
1258
+ exports.$ZodUnion.init(inst, def);
1259
+ def.inclusive = false;
1260
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
1261
+ inst._zod.parse = (payload, ctx) => {
1262
+ if (first) {
1263
+ return first(payload, ctx);
1264
+ }
1265
+ let async = false;
1266
+ const results = [];
1267
+ for (const option of def.options) {
1268
+ const result = option._zod.run({
1269
+ value: payload.value,
1270
+ issues: [],
1271
+ }, ctx);
1272
+ if (result instanceof Promise) {
1273
+ results.push(result);
1274
+ async = true;
1275
+ }
1276
+ else {
1277
+ results.push(result);
1278
+ }
1279
+ }
1280
+ if (!async)
1281
+ return handleExclusiveUnionResults(results, payload, inst, ctx);
1282
+ return Promise.all(results).then((results) => {
1283
+ return handleExclusiveUnionResults(results, payload, inst, ctx);
1284
+ });
1285
+ };
1286
+ });
1287
+ /** Returns the option of `union` whose discriminator claims `value`. */
1288
+ function getDiscriminatedOption(union, value) {
1289
+ const internals = union._zod;
1290
+ let map = internals.bag.optionsMap;
1291
+ if (!map) {
1292
+ map = new Map();
1293
+ const { options, discriminator } = internals.def;
1294
+ for (const option of options) {
1295
+ // First declaration wins, matching the order the parse path resolves a duplicate in.
1296
+ for (const v of option._zod.propValues?.[discriminator] ?? [])
1297
+ if (!map.has(v))
1298
+ map.set(v, option);
1299
+ }
1300
+ internals.bag.optionsMap = map;
1301
+ }
1302
+ return map.get(value);
1303
+ }
1304
+ exports.$ZodDiscriminatedUnion =
1305
+ /*@__PURE__*/
1306
+ core.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
1307
+ def.inclusive = false;
1308
+ exports.$ZodUnion.init(inst, def);
1309
+ const _super = inst._zod.parse;
1310
+ util.defineLazyInternal(inst, "propValues", (zod) => {
1311
+ const propValues = {};
1312
+ for (const option of zod.def.options) {
1313
+ const pv = option._zod.propValues;
1314
+ if (!pv || Object.keys(pv).length === 0)
1315
+ throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
1316
+ for (const [k, v] of Object.entries(pv)) {
1317
+ if (!Object.prototype.hasOwnProperty.call(propValues, k)) {
1318
+ util.assignProp(propValues, k, new Set());
1319
+ }
1320
+ for (const val of v) {
1321
+ propValues[k].add(val);
1322
+ }
1323
+ }
1324
+ }
1325
+ return propValues;
1326
+ });
1327
+ // 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, lazies, and objects rebuilt by a builder such as `.extend()` — are left to the map.
1328
+ def.options.forEach((option, i) => {
1329
+ const propShape = propShapes.get(option._zod.def);
1330
+ if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {
1331
+ throw new Error(`Invalid discriminated union option at index "${i}"`);
1332
+ }
1333
+ });
1334
+ const disc = util.cached(() => {
1335
+ const opts = def.options;
1336
+ const map = new Map();
1337
+ for (const o of opts) {
1338
+ const values = o._zod.propValues?.[def.discriminator];
1339
+ if (!values || values.size === 0)
1340
+ throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
1341
+ for (const v of values) {
1342
+ if (map.has(v)) {
1343
+ throw new Error(`Duplicate discriminator value "${String(v)}"`);
1344
+ }
1345
+ map.set(v, o);
1346
+ }
1347
+ }
1348
+ return map;
1349
+ });
1350
+ inst._zod.parse = (payload, ctx) => {
1351
+ const input = payload.value;
1352
+ if (!util.isObject(input)) {
1353
+ payload.issues.push({
1354
+ code: "invalid_type",
1355
+ expected: "object",
1356
+ input,
1357
+ inst,
1358
+ });
1359
+ return payload;
1360
+ }
1361
+ const opt = disc.value.get(input?.[def.discriminator]);
1362
+ if (opt) {
1363
+ return opt._zod.run(payload, ctx);
1364
+ }
1365
+ // Fall back to union matching when the fast discriminator path fails:
1366
+ // - explicitly enabled via unionFallback, or
1367
+ // - during backward direction (encode), since codec-based discriminators have different values in forward vs backward directions
1368
+ if (def.unionFallback || ctx.direction === "backward") {
1369
+ return _super(payload, ctx);
1370
+ }
1371
+ // no matching discriminator
1372
+ payload.issues.push({
1373
+ code: "invalid_union",
1374
+ errors: [],
1375
+ note: "No matching discriminator",
1376
+ discriminator: def.discriminator,
1377
+ options: Array.from(disc.value.keys()),
1378
+ input,
1379
+ path: [def.discriminator],
1380
+ inst,
1381
+ });
1382
+ return payload;
1383
+ };
1384
+ });
1385
+ exports.$ZodIntersection = core.$constructor("$ZodIntersection", (inst, def) => {
1386
+ exports.$ZodType.init(inst, def);
1387
+ inst._zod.parse = (payload, ctx) => {
1388
+ const input = payload.value;
1389
+ const left = def.left._zod.run({ value: input, issues: [] }, ctx);
1390
+ const right = def.right._zod.run({ value: input, issues: [] }, ctx);
1391
+ const async = left instanceof Promise || right instanceof Promise;
1392
+ if (async) {
1393
+ return Promise.all([left, right]).then(([left, right]) => {
1394
+ return handleIntersectionResults(payload, left, right);
1395
+ });
1396
+ }
1397
+ return handleIntersectionResults(payload, left, right);
1398
+ };
1399
+ });
1400
+ function mergeValues(a, b) {
1401
+ // const aType = parse.t(a);
1402
+ // const bType = parse.t(b);
1403
+ if (a === b) {
1404
+ return { valid: true, data: a };
1405
+ }
1406
+ if (a instanceof Date && b instanceof Date && +a === +b) {
1407
+ return { valid: true, data: a };
1408
+ }
1409
+ if (util.isPlainObject(a) && util.isPlainObject(b)) {
1410
+ const bKeys = Object.keys(b);
1411
+ const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1412
+ const newObj = { ...a, ...b };
1413
+ if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
1414
+ delete newObj.__proto__;
1415
+ for (const key of sharedKeys) {
1416
+ if (key === "__proto__")
1417
+ continue;
1418
+ const sharedValue = mergeValues(a[key], b[key]);
1419
+ if (!sharedValue.valid) {
1420
+ return {
1421
+ valid: false,
1422
+ mergeErrorPath: [key, ...sharedValue.mergeErrorPath],
1423
+ };
1424
+ }
1425
+ newObj[key] = sharedValue.data;
1426
+ }
1427
+ return { valid: true, data: newObj };
1428
+ }
1429
+ if (Array.isArray(a) && Array.isArray(b)) {
1430
+ if (a.length !== b.length) {
1431
+ return { valid: false, mergeErrorPath: [] };
1432
+ }
1433
+ const newArray = [];
1434
+ for (let index = 0; index < a.length; index++) {
1435
+ const itemA = a[index];
1436
+ const itemB = b[index];
1437
+ const sharedValue = mergeValues(itemA, itemB);
1438
+ if (!sharedValue.valid) {
1439
+ return {
1440
+ valid: false,
1441
+ mergeErrorPath: [index, ...sharedValue.mergeErrorPath],
1442
+ };
1443
+ }
1444
+ newArray.push(sharedValue.data);
1445
+ }
1446
+ return { valid: true, data: newArray };
1447
+ }
1448
+ return { valid: false, mergeErrorPath: [] };
1449
+ }
1450
+ function handleIntersectionResults(result, left, right) {
1451
+ // 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.
1452
+ const unrecKeys = new Map();
1453
+ let unrecIssue;
1454
+ const keyIssues = new Map();
1455
+ const collect = (iss, side) => {
1456
+ let keys;
1457
+ if (iss.code === "unrecognized_keys" && !iss.path?.length) {
1458
+ unrecIssue ?? (unrecIssue = iss);
1459
+ keys = iss.keys;
1460
+ }
1461
+ else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
1462
+ const k = String(iss.path[0]);
1463
+ if (!keyIssues.has(k))
1464
+ keyIssues.set(k, iss);
1465
+ keys = [k];
1466
+ }
1467
+ else {
1468
+ return false;
1469
+ }
1470
+ for (const k of keys) {
1471
+ if (!unrecKeys.has(k))
1472
+ unrecKeys.set(k, {});
1473
+ unrecKeys.get(k)[side] = true;
1474
+ }
1475
+ return true;
1476
+ };
1477
+ for (const iss of left.issues) {
1478
+ if (!collect(iss, "l"))
1479
+ result.issues.push(iss);
1480
+ }
1481
+ for (const iss of right.issues) {
1482
+ if (!collect(iss, "r"))
1483
+ result.issues.push(iss);
1484
+ }
1485
+ // Report only keys rejected by BOTH sides
1486
+ const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1487
+ if (bothKeys.length) {
1488
+ const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
1489
+ if (aggregated.length)
1490
+ result.issues.push({ ...unrecIssue, keys: aggregated });
1491
+ for (const k of bothKeys) {
1492
+ if (!aggregated.includes(k) && keyIssues.has(k))
1493
+ result.issues.push(keyIssues.get(k));
1494
+ }
1495
+ }
1496
+ const merged = mergeValues(left.value, right.value);
1497
+ if (!merged.valid) {
1498
+ if (util.aborted(result))
1499
+ return result;
1500
+ throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
1501
+ }
1502
+ result.value = merged.data;
1503
+ return result;
1504
+ }
1505
+ exports.$ZodTuple = core.$constructor("$ZodTuple", (inst, def) => {
1506
+ exports.$ZodType.init(inst, def);
1507
+ const items = def.items;
1508
+ const memo = core.globalConfig.memoizer;
1509
+ memo?.attach(inst);
1510
+ inst._zod.parse = (payload, ctx) => {
1511
+ const input = payload.value;
1512
+ if (!Array.isArray(input)) {
1513
+ payload.issues.push({
1514
+ input,
1515
+ inst,
1516
+ expected: "tuple",
1517
+ code: "invalid_type",
1518
+ });
1519
+ return payload;
1520
+ }
1521
+ payload.value = memo ? memo.alloc(inst, payload, [], ctx) : [];
1522
+ const proms = [];
1523
+ const optinStart = getTupleOptStart(items, "optin");
1524
+ const optoutStart = getTupleOptStart(items, "optout");
1525
+ if (!def.rest) {
1526
+ if (input.length < optinStart) {
1527
+ payload.issues.push({
1528
+ code: "too_small",
1529
+ minimum: optinStart,
1530
+ inclusive: true,
1531
+ input,
1532
+ inst,
1533
+ origin: "array",
1534
+ });
1535
+ return payload;
1536
+ }
1537
+ if (input.length > items.length) {
1538
+ payload.issues.push({
1539
+ code: "too_big",
1540
+ maximum: items.length,
1541
+ inclusive: true,
1542
+ input,
1543
+ inst,
1544
+ origin: "array",
1545
+ });
1546
+ }
1547
+ }
1548
+ // 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.
1549
+ const itemResults = new Array(items.length);
1550
+ for (let i = 0; i < items.length; i++) {
1551
+ const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
1552
+ if (r instanceof Promise) {
1553
+ proms.push(r.then((rr) => {
1554
+ itemResults[i] = rr;
1555
+ }));
1556
+ }
1557
+ else {
1558
+ itemResults[i] = r;
1559
+ }
1560
+ }
1561
+ if (def.rest) {
1562
+ let i = items.length - 1;
1563
+ const rest = input.slice(items.length);
1564
+ for (const el of rest) {
1565
+ i++;
1566
+ const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
1567
+ if (result instanceof Promise) {
1568
+ proms.push(result.then((r) => handleTupleResult(r, payload, i)));
1569
+ }
1570
+ else {
1571
+ handleTupleResult(result, payload, i);
1572
+ }
1573
+ }
1574
+ }
1575
+ if (proms.length) {
1576
+ return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
1577
+ }
1578
+ return handleTupleResults(itemResults, payload, items, input, optoutStart);
1579
+ };
1580
+ });
1581
+ function getTupleOptStart(items, key) {
1582
+ for (let i = items.length - 1; i >= 0; i--) {
1583
+ // optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.
1584
+ const omittable = key === "optin" ? items[i]._zod.optin !== undefined : items[i]._zod.optout === "optional";
1585
+ if (!omittable)
1586
+ return i + 1;
1587
+ }
1588
+ return 0;
1589
+ }
1590
+ function handleTupleResult(result, final, index) {
1591
+ if (result.issues.length) {
1592
+ final.issues.push(...util.prefixIssues(index, result.issues));
1593
+ }
1594
+ final.value[index] = result.value;
1595
+ }
1596
+ function handleTupleResults(itemResults, final, items, input, optoutStart) {
1597
+ // 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.
1598
+ for (let i = 0; i < items.length; i++) {
1599
+ const r = itemResults[i];
1600
+ const isPresent = i < input.length;
1601
+ // 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`.
1602
+ if (!isPresent && i >= optoutStart && items[i]._zod.optin === "optional") {
1603
+ final.value.length = i;
1604
+ break;
1605
+ }
1606
+ if (r.issues.length) {
1607
+ if (!isPresent && i >= optoutStart) {
1608
+ final.value.length = i;
1609
+ break;
1610
+ }
1611
+ final.issues.push(...util.prefixIssues(i, r.issues));
1612
+ }
1613
+ final.value[i] = r.value;
1614
+ }
1615
+ // Drop trailing slots that produced `undefined` for absent input
1616
+ // (the array analog of an absent optional key on an object). The
1617
+ // `i >= input.length` floor is critical: an explicit `undefined`
1618
+ // *inside* the input must be preserved even when the schema is
1619
+ // optional-out (e.g. `z.string().or(z.undefined())` accepting an
1620
+ // explicit undefined value).
1621
+ for (let i = final.value.length - 1; i >= input.length; i--) {
1622
+ if (items[i]._zod.optout === "optional" && final.value[i] === undefined) {
1623
+ final.value.length = i;
1624
+ }
1625
+ else {
1626
+ break;
1627
+ }
1628
+ }
1629
+ return final;
1630
+ }
1631
+ exports.$ZodRecord = core.$constructor("$ZodRecord", (inst, def) => {
1632
+ exports.$ZodType.init(inst, def);
1633
+ const memo = core.globalConfig.memoizer;
1634
+ memo?.attach(inst);
1635
+ inst._zod.parse = (payload, ctx) => {
1636
+ const input = payload.value;
1637
+ if (!util.isPlainObject(input)) {
1638
+ payload.issues.push({
1639
+ expected: "record",
1640
+ code: "invalid_type",
1641
+ input,
1642
+ inst,
1643
+ });
1644
+ return payload;
1645
+ }
1646
+ const proms = [];
1647
+ const values = def.keyType._zod.values;
1648
+ if (values && !def.partial) {
1649
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1650
+ const recordKeys = new Set();
1651
+ for (const key of values) {
1652
+ if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
1653
+ recordKeys.add(typeof key === "number" ? key.toString() : key);
1654
+ // A declared __proto__ is stripped but is not an unrecognized key.
1655
+ if (key === "__proto__")
1656
+ continue;
1657
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1658
+ if (keyResult instanceof Promise) {
1659
+ throw new Error("Async schemas not supported in object keys currently");
1660
+ }
1661
+ if (keyResult.issues.length) {
1662
+ payload.issues.push({
1663
+ code: "invalid_key",
1664
+ origin: "record",
1665
+ issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1666
+ input: key,
1667
+ path: [key],
1668
+ inst,
1669
+ });
1670
+ continue;
1671
+ }
1672
+ const outKey = keyResult.value;
1673
+ if (outKey === "__proto__")
1674
+ continue;
1675
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1676
+ if (result instanceof Promise) {
1677
+ proms.push(result.then((result) => {
1678
+ if (result.issues.length) {
1679
+ payload.issues.push(...util.prefixIssues(key, result.issues));
1680
+ }
1681
+ payload.value[outKey] = result.value;
1682
+ }));
1683
+ }
1684
+ else {
1685
+ if (result.issues.length) {
1686
+ payload.issues.push(...util.prefixIssues(key, result.issues));
1687
+ }
1688
+ payload.value[outKey] = result.value;
1689
+ }
1690
+ }
1691
+ }
1692
+ let unrecognized;
1693
+ for (const key in input) {
1694
+ if (!recordKeys.has(key)) {
1695
+ if (def.mode === "loose") {
1696
+ // skip __proto__ so it can't replace the result prototype via the assignment setter on the plain {} we build into
1697
+ if (key === "__proto__")
1698
+ continue;
1699
+ payload.value[key] = input[key];
1700
+ }
1701
+ else {
1702
+ unrecognized = unrecognized ?? [];
1703
+ unrecognized.push(key);
1704
+ }
1705
+ }
1706
+ }
1707
+ if (unrecognized && unrecognized.length > 0) {
1708
+ payload.issues.push({
1709
+ code: "unrecognized_keys",
1710
+ input,
1711
+ inst,
1712
+ keys: unrecognized,
1713
+ continue: true,
1714
+ });
1715
+ }
1716
+ }
1717
+ else {
1718
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1719
+ // 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.
1720
+ let unrecognized;
1721
+ // Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()
1722
+ for (const key of Reflect.ownKeys(input)) {
1723
+ if (key === "__proto__")
1724
+ continue;
1725
+ if (!Object.prototype.propertyIsEnumerable.call(input, key))
1726
+ continue;
1727
+ let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1728
+ if (keyResult instanceof Promise) {
1729
+ throw new Error("Async schemas not supported in object keys currently");
1730
+ }
1731
+ // 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
1732
+ const checkNumericKey = typeof key === "string" && regexes.number.test(key) && keyResult.issues.length;
1733
+ if (checkNumericKey) {
1734
+ const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
1735
+ if (retryResult instanceof Promise) {
1736
+ throw new Error("Async schemas not supported in object keys currently");
1737
+ }
1738
+ if (retryResult.issues.length === 0) {
1739
+ keyResult = retryResult;
1740
+ }
1741
+ }
1742
+ if (keyResult.issues.length) {
1743
+ if (def.mode === "loose") {
1744
+ // Pass through unchanged
1745
+ payload.value[key] = input[key];
1746
+ }
1747
+ else if (values) {
1748
+ unrecognized = unrecognized ?? [];
1749
+ unrecognized.push(key);
1750
+ }
1751
+ else {
1752
+ // Default "strict" behavior: error on invalid key
1753
+ payload.issues.push({
1754
+ code: "invalid_key",
1755
+ origin: "record",
1756
+ issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1757
+ input: key,
1758
+ path: [key],
1759
+ inst,
1760
+ });
1761
+ }
1762
+ continue;
1763
+ }
1764
+ // 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
1765
+ const outKey = keyResult.value;
1766
+ if (outKey === "__proto__")
1767
+ continue;
1768
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1769
+ if (result instanceof Promise) {
1770
+ proms.push(result.then((result) => {
1771
+ if (result.issues.length) {
1772
+ payload.issues.push(...util.prefixIssues(key, result.issues));
1773
+ }
1774
+ payload.value[outKey] = result.value;
1775
+ }));
1776
+ }
1777
+ else {
1778
+ if (result.issues.length) {
1779
+ payload.issues.push(...util.prefixIssues(key, result.issues));
1780
+ }
1781
+ payload.value[outKey] = result.value;
1782
+ }
1783
+ }
1784
+ if (unrecognized && unrecognized.length > 0) {
1785
+ payload.issues.push({
1786
+ code: "unrecognized_keys",
1787
+ input,
1788
+ inst,
1789
+ keys: unrecognized,
1790
+ continue: true,
1791
+ });
1792
+ }
1793
+ }
1794
+ if (proms.length) {
1795
+ return Promise.all(proms).then(() => payload);
1796
+ }
1797
+ return payload;
1798
+ };
1799
+ });
1800
+ exports.$ZodMap = core.$constructor("$ZodMap", (inst, def) => {
1801
+ exports.$ZodType.init(inst, def);
1802
+ const memo = core.globalConfig.memoizer;
1803
+ memo?.attach(inst);
1804
+ inst._zod.parse = (payload, ctx) => {
1805
+ const input = payload.value;
1806
+ if (!(input instanceof Map)) {
1807
+ payload.issues.push({
1808
+ expected: "map",
1809
+ code: "invalid_type",
1810
+ input,
1811
+ inst,
1812
+ });
1813
+ return payload;
1814
+ }
1815
+ const proms = [];
1816
+ payload.value = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();
1817
+ for (const [key, value] of input) {
1818
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
1819
+ const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);
1820
+ if (keyResult instanceof Promise || valueResult instanceof Promise) {
1821
+ proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {
1822
+ handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
1823
+ }));
1824
+ }
1825
+ else {
1826
+ handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
1827
+ }
1828
+ }
1829
+ if (proms.length)
1830
+ return Promise.all(proms).then(() => payload);
1831
+ return payload;
1832
+ };
1833
+ });
1834
+ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
1835
+ if (keyResult.issues.length) {
1836
+ if (util.propertyKeyTypes.has(typeof key)) {
1837
+ final.issues.push(...util.prefixIssues(key, keyResult.issues));
1838
+ }
1839
+ else {
1840
+ final.issues.push({
1841
+ code: "invalid_key",
1842
+ origin: "map",
1843
+ input,
1844
+ inst,
1845
+ issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1846
+ });
1847
+ }
1848
+ }
1849
+ if (valueResult.issues.length) {
1850
+ if (util.propertyKeyTypes.has(typeof key)) {
1851
+ final.issues.push(...util.prefixIssues(key, valueResult.issues));
1852
+ }
1853
+ else {
1854
+ final.issues.push({
1855
+ origin: "map",
1856
+ code: "invalid_element",
1857
+ input,
1858
+ inst,
1859
+ key: key,
1860
+ issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
1861
+ });
1862
+ }
1863
+ }
1864
+ final.value.set(keyResult.value, valueResult.value);
1865
+ }
1866
+ exports.$ZodSet = core.$constructor("$ZodSet", (inst, def) => {
1867
+ exports.$ZodType.init(inst, def);
1868
+ const memo = core.globalConfig.memoizer;
1869
+ memo?.attach(inst);
1870
+ inst._zod.parse = (payload, ctx) => {
1871
+ const input = payload.value;
1872
+ if (!(input instanceof Set)) {
1873
+ payload.issues.push({
1874
+ input,
1875
+ inst,
1876
+ expected: "set",
1877
+ code: "invalid_type",
1878
+ });
1879
+ return payload;
1880
+ }
1881
+ const proms = [];
1882
+ payload.value = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();
1883
+ for (const item of input) {
1884
+ const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
1885
+ if (result instanceof Promise) {
1886
+ proms.push(result.then((result) => handleSetResult(result, payload)));
1887
+ }
1888
+ else
1889
+ handleSetResult(result, payload);
1890
+ }
1891
+ if (proms.length)
1892
+ return Promise.all(proms).then(() => payload);
1893
+ return payload;
1894
+ };
1895
+ });
1896
+ function handleSetResult(result, final) {
1897
+ if (result.issues.length) {
1898
+ final.issues.push(...result.issues);
1899
+ }
1900
+ final.value.add(result.value);
1901
+ }
1902
+ exports.$ZodEnum = core.$constructor("$ZodEnum", (inst, def) => {
1903
+ exports.$ZodType.init(inst, def);
1904
+ const values = util.getEnumValues(def.entries);
1905
+ const valuesSet = new Set(values);
1906
+ inst._zod.values = valuesSet;
1907
+ const patternValues = values.filter((k) => util.propertyKeyTypes.has(typeof k));
1908
+ // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
1909
+ inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
1910
+ inst._zod.parse = (payload, _ctx) => {
1911
+ const input = payload.value;
1912
+ if (valuesSet.has(input)) {
1913
+ return payload;
1914
+ }
1915
+ payload.issues.push({
1916
+ code: "invalid_value",
1917
+ values,
1918
+ input,
1919
+ inst,
1920
+ });
1921
+ return payload;
1922
+ };
1923
+ });
1924
+ exports.$ZodLiteral = core.$constructor("$ZodLiteral", (inst, def) => {
1925
+ exports.$ZodType.init(inst, def);
1926
+ const values = new Set(def.values);
1927
+ inst._zod.values = values;
1928
+ // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches ""
1929
+ inst._zod.pattern = new RegExp(def.values.length
1930
+ ? `^(${def.values
1931
+ .map((o) => (typeof o === "string" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))
1932
+ .join("|")})$`
1933
+ : "^[^\\s\\S]$");
1934
+ inst._zod.parse = (payload, _ctx) => {
1935
+ const input = payload.value;
1936
+ if (values.has(input)) {
1937
+ return payload;
1938
+ }
1939
+ payload.issues.push({
1940
+ code: "invalid_value",
1941
+ values: def.values,
1942
+ input,
1943
+ inst,
1944
+ });
1945
+ return payload;
1946
+ };
1947
+ });
1948
+ exports.$ZodFile = core.$constructor("$ZodFile", (inst, def) => {
1949
+ exports.$ZodType.init(inst, def);
1950
+ inst._zod.parse = (payload, _ctx) => {
1951
+ const input = payload.value;
1952
+ // @ts-ignore
1953
+ if (input instanceof File)
1954
+ return payload;
1955
+ payload.issues.push({
1956
+ expected: "file",
1957
+ code: "invalid_type",
1958
+ input,
1959
+ inst,
1960
+ });
1961
+ return payload;
1962
+ };
1963
+ });
1964
+ exports.$ZodTransform = core.$constructor("$ZodTransform", (inst, def) => {
1965
+ exports.$ZodType.init(inst, def);
1966
+ inst._zod.optin = "optional";
1967
+ core.globalConfig.memoizer?.guard(inst);
1968
+ inst._zod.parse = (payload, ctx) => {
1969
+ if (ctx.direction === "backward") {
1970
+ throw new core.$ZodEncodeError(inst.constructor.name);
1971
+ }
1972
+ const _out = def.transform(payload.value, payload);
1973
+ if (ctx.async) {
1974
+ const output = _out instanceof Promise ? _out : Promise.resolve(_out);
1975
+ return output.then((output) => {
1976
+ payload.value = output;
1977
+ return payload;
1978
+ });
1979
+ }
1980
+ if (_out instanceof Promise) {
1981
+ throw new core.$ZodAsyncError();
1982
+ }
1983
+ payload.value = _out;
1984
+ return payload;
1985
+ };
1986
+ });
1987
+ function handleOptionalResult(payload, result) {
1988
+ // 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.
1989
+ payload.value = result.issues.length ? undefined : result.value;
1990
+ return payload;
1991
+ }
1992
+ exports.$ZodOptional = core.$constructor("$ZodOptional", (inst, def) => {
1993
+ exports.$ZodType.init(inst, def);
1994
+ // .optional() propagates absence rather than substituting for it, so a defaulted inner keeps its rung.
1995
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
1996
+ inst._zod.optout = "optional";
1997
+ util.defineLazyInternal(inst, "values", (zod) => {
1998
+ const values = zod.def.innerType._zod.values;
1999
+ return values ? new Set([...values, undefined]) : undefined;
2000
+ });
2001
+ util.defineLazyInternal(inst, "pattern", (zod) => {
2002
+ const pattern = zod.def.innerType._zod.pattern;
2003
+ return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;
2004
+ });
2005
+ inst._zod.parse = (payload, ctx) => {
2006
+ if (payload.value === undefined) {
2007
+ // Only the top rung substitutes a value for absence; everything else leaves it intact, which is what .optional() means.
2008
+ if (def.innerType._zod.optin !== "defaulted")
2009
+ return payload;
2010
+ // 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.
2011
+ const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
2012
+ if (result instanceof Promise)
2013
+ return result.then((result) => handleOptionalResult(payload, result));
2014
+ return handleOptionalResult(payload, result);
2015
+ }
2016
+ return def.innerType._zod.run(payload, ctx);
2017
+ };
2018
+ });
2019
+ exports.$ZodExactOptional = core.$constructor("$ZodExactOptional", (inst, def) => {
2020
+ // Call parent init - inherits optin/optout = "optional"
2021
+ exports.$ZodOptional.init(inst, def);
2022
+ // Override values/pattern to NOT add undefined
2023
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2024
+ util.defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
2025
+ // Override parse to just delegate (no undefined handling)
2026
+ inst._zod.parse = (payload, ctx) => {
2027
+ return def.innerType._zod.run(payload, ctx);
2028
+ };
2029
+ });
2030
+ exports.$ZodNullable = core.$constructor("$ZodNullable", (inst, def) => {
2031
+ exports.$ZodType.init(inst, def);
2032
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
2033
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2034
+ util.defineLazyInternal(inst, "pattern", (zod) => {
2035
+ const pattern = zod.def.innerType._zod.pattern;
2036
+ return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;
2037
+ });
2038
+ util.defineLazyInternal(inst, "values", (zod) => {
2039
+ return zod.def.innerType._zod.values ? new Set([...zod.def.innerType._zod.values, null]) : undefined;
2040
+ });
2041
+ inst._zod.parse = (payload, ctx) => {
2042
+ // Forward direction (decode): allow null to pass through
2043
+ if (payload.value === null)
2044
+ return payload;
2045
+ return def.innerType._zod.run(payload, ctx);
2046
+ };
2047
+ });
2048
+ exports.$ZodDefault = core.$constructor("$ZodDefault", (inst, def) => {
2049
+ exports.$ZodType.init(inst, def);
2050
+ // inst._zod.qin = "true";
2051
+ inst._zod.optin = "defaulted";
2052
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2053
+ inst._zod.parse = (payload, ctx) => {
2054
+ if (ctx.direction === "backward") {
2055
+ return def.innerType._zod.run(payload, ctx);
2056
+ }
2057
+ // Forward direction (decode): apply defaults for undefined input
2058
+ if (payload.value === undefined) {
2059
+ payload.value = def.defaultValue;
2060
+ /**
2061
+ * $ZodDefault returns the default value immediately in forward direction.
2062
+ * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
2063
+ return payload;
2064
+ }
2065
+ // Forward direction: continue with default handling
2066
+ const result = def.innerType._zod.run(payload, ctx);
2067
+ if (result instanceof Promise) {
2068
+ return result.then((result) => handleDefaultResult(result, def));
2069
+ }
2070
+ return handleDefaultResult(result, def);
2071
+ };
2072
+ });
2073
+ function handleDefaultResult(payload, def) {
2074
+ if (payload.value === undefined) {
2075
+ payload.value = def.defaultValue;
2076
+ }
2077
+ return payload;
2078
+ }
2079
+ exports.$ZodPrefault = core.$constructor("$ZodPrefault", (inst, def) => {
2080
+ exports.$ZodType.init(inst, def);
2081
+ inst._zod.optin = "defaulted";
2082
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2083
+ inst._zod.parse = (payload, ctx) => {
2084
+ if (ctx.direction === "backward") {
2085
+ return def.innerType._zod.run(payload, ctx);
2086
+ }
2087
+ // Forward direction (decode): apply prefault for undefined input
2088
+ if (payload.value === undefined) {
2089
+ payload.value = def.defaultValue;
2090
+ }
2091
+ return def.innerType._zod.run(payload, ctx);
2092
+ };
2093
+ });
2094
+ exports.$ZodNonOptional = core.$constructor("$ZodNonOptional", (inst, def) => {
2095
+ exports.$ZodType.init(inst, def);
2096
+ util.defineLazyInternal(inst, "values", (zod) => {
2097
+ const v = zod.def.innerType._zod.values;
2098
+ return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
2099
+ });
2100
+ inst._zod.parse = (payload, ctx) => {
2101
+ const result = def.innerType._zod.run(payload, ctx);
2102
+ if (result instanceof Promise) {
2103
+ return result.then((result) => handleNonOptionalResult(result, inst));
2104
+ }
2105
+ return handleNonOptionalResult(result, inst);
2106
+ };
2107
+ });
2108
+ function handleNonOptionalResult(payload, inst) {
2109
+ if (!payload.issues.length && payload.value === undefined) {
2110
+ payload.issues.push({
2111
+ code: "invalid_type",
2112
+ expected: "nonoptional",
2113
+ input: payload.value,
2114
+ inst,
2115
+ });
2116
+ }
2117
+ return payload;
2118
+ }
2119
+ exports.$ZodSuccess = core.$constructor("$ZodSuccess", (inst, def) => {
2120
+ exports.$ZodType.init(inst, def);
2121
+ inst._zod.parse = (payload, ctx) => {
2122
+ if (ctx.direction === "backward") {
2123
+ throw new core.$ZodEncodeError("ZodSuccess");
2124
+ }
2125
+ const result = def.innerType._zod.run(payload, ctx);
2126
+ if (result instanceof Promise) {
2127
+ return result.then((result) => {
2128
+ payload.value = result.issues.length === 0;
2129
+ return payload;
2130
+ });
2131
+ }
2132
+ payload.value = result.issues.length === 0;
2133
+ return payload;
2134
+ };
2135
+ });
2136
+ function handleCatchResult(payload, result, def, ctx) {
2137
+ if (!result.issues.length) {
2138
+ payload.value = result.value;
2139
+ // 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.
2140
+ if (result.memo)
2141
+ payload.memo = true;
2142
+ return payload;
2143
+ }
2144
+ // 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.
2145
+ payload.value = def.catchValue({
2146
+ ...result,
2147
+ value: payload.value,
2148
+ error: {
2149
+ issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),
2150
+ },
2151
+ input: payload.value,
2152
+ });
2153
+ return payload;
2154
+ }
2155
+ exports.$ZodCatch = core.$constructor("$ZodCatch", (inst, def) => {
2156
+ exports.$ZodType.init(inst, def);
2157
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
2158
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2159
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2160
+ inst._zod.parse = (payload, ctx) => {
2161
+ if (ctx.direction === "backward") {
2162
+ return def.innerType._zod.run(payload, ctx);
2163
+ }
2164
+ // Forward direction (decode): apply catch logic
2165
+ const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);
2166
+ if (result instanceof Promise) {
2167
+ return result.then((result) => handleCatchResult(payload, result, def, ctx));
2168
+ }
2169
+ return handleCatchResult(payload, result, def, ctx);
2170
+ };
2171
+ });
2172
+ exports.$ZodNaN = core.$constructor("$ZodNaN", (inst, def) => {
2173
+ exports.$ZodType.init(inst, def);
2174
+ inst._zod.parse = (payload, _ctx) => {
2175
+ if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) {
2176
+ payload.issues.push({
2177
+ input: payload.value,
2178
+ inst,
2179
+ expected: "nan",
2180
+ code: "invalid_type",
2181
+ });
2182
+ return payload;
2183
+ }
2184
+ return payload;
2185
+ };
2186
+ });
2187
+ exports.$ZodPipe = core.$constructor("$ZodPipe", (inst, def) => {
2188
+ exports.$ZodType.init(inst, def);
2189
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
2190
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
2191
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
2192
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
2193
+ inst._zod.parse = (payload, ctx) => {
2194
+ if (ctx.direction === "backward") {
2195
+ const right = def.out._zod.run(payload, ctx);
2196
+ if (right instanceof Promise) {
2197
+ return right.then((right) => handlePipeResult(right, def.in, ctx));
2198
+ }
2199
+ return handlePipeResult(right, def.in, ctx);
2200
+ }
2201
+ const left = def.in._zod.run(payload, ctx);
2202
+ if (left instanceof Promise) {
2203
+ return left.then((left) => handlePipeResult(left, def.out, ctx));
2204
+ }
2205
+ return handlePipeResult(left, def.out, ctx);
2206
+ };
2207
+ });
2208
+ function handlePipeResult(left, next, ctx) {
2209
+ // 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.
2210
+ if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
2211
+ // prevent further checks
2212
+ left.aborted = true;
2213
+ return left;
2214
+ }
2215
+ return next._zod.run({ value: left.value, issues: left.issues }, ctx);
2216
+ }
2217
+ exports.$ZodCodec = core.$constructor("$ZodCodec", (inst, def) => {
2218
+ exports.$ZodType.init(inst, def);
2219
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
2220
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
2221
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
2222
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
2223
+ inst._zod.parse = (payload, ctx) => {
2224
+ const direction = ctx.direction || "forward";
2225
+ if (direction === "forward") {
2226
+ const left = def.in._zod.run(payload, ctx);
2227
+ if (left instanceof Promise) {
2228
+ return left.then((left) => handleCodecAResult(left, def, ctx));
2229
+ }
2230
+ return handleCodecAResult(left, def, ctx);
2231
+ }
2232
+ else {
2233
+ const right = def.out._zod.run(payload, ctx);
2234
+ if (right instanceof Promise) {
2235
+ return right.then((right) => handleCodecAResult(right, def, ctx));
2236
+ }
2237
+ return handleCodecAResult(right, def, ctx);
2238
+ }
2239
+ };
2240
+ });
2241
+ function handleCodecAResult(result, def, ctx) {
2242
+ if (result.issues.length) {
2243
+ // prevent further checks
2244
+ result.aborted = true;
2245
+ return result;
2246
+ }
2247
+ const direction = ctx.direction || "forward";
2248
+ if (direction === "forward") {
2249
+ const transformed = def.transform(result.value, result);
2250
+ if (transformed instanceof Promise) {
2251
+ return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
2252
+ }
2253
+ return handleCodecTxResult(result, transformed, def.out, ctx);
2254
+ }
2255
+ else {
2256
+ const transformed = def.reverseTransform(result.value, result);
2257
+ if (transformed instanceof Promise) {
2258
+ return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
2259
+ }
2260
+ return handleCodecTxResult(result, transformed, def.in, ctx);
2261
+ }
2262
+ }
2263
+ function handleCodecTxResult(left, value, nextSchema, ctx) {
2264
+ // Check if transform added any issues
2265
+ if (left.issues.length) {
2266
+ left.aborted = true;
2267
+ return left;
2268
+ }
2269
+ return nextSchema._zod.run({ value, issues: left.issues }, ctx);
2270
+ }
2271
+ exports.$ZodPreprocess = core.$constructor("$ZodPreprocess", (inst, def) => {
2272
+ exports.$ZodPipe.init(inst, def);
2273
+ });
2274
+ exports.$ZodReadonly = core.$constructor("$ZodReadonly", (inst, def) => {
2275
+ exports.$ZodType.init(inst, def);
2276
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
2277
+ util.defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2278
+ util.defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
2279
+ util.defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
2280
+ inst._zod.parse = (payload, ctx) => {
2281
+ if (ctx.direction === "backward") {
2282
+ return def.innerType._zod.run(payload, ctx);
2283
+ }
2284
+ const result = def.innerType._zod.run(payload, ctx);
2285
+ if (result instanceof Promise) {
2286
+ return result.then(handleReadonlyResult);
2287
+ }
2288
+ return handleReadonlyResult(result);
2289
+ };
2290
+ });
2291
+ function handleReadonlyResult(payload) {
2292
+ // 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.
2293
+ if (!payload.memo)
2294
+ payload.value = Object.freeze(payload.value);
2295
+ return payload;
2296
+ }
2297
+ exports.$ZodTemplateLiteral = core.$constructor("$ZodTemplateLiteral", (inst, def) => {
2298
+ exports.$ZodType.init(inst, def);
2299
+ const regexParts = [];
2300
+ for (const part of def.parts) {
2301
+ if (typeof part === "object" && part !== null) {
2302
+ // is Zod schema
2303
+ if (!part._zod.pattern) {
2304
+ // if (!source)
2305
+ throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
2306
+ }
2307
+ const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
2308
+ if (!source)
2309
+ throw new Error(`Invalid template literal part: ${part._zod.traits}`);
2310
+ const start = source.startsWith("^") ? 1 : 0;
2311
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
2312
+ regexParts.push(source.slice(start, end));
2313
+ }
2314
+ else if (part === null || util.primitiveTypes.has(typeof part)) {
2315
+ regexParts.push(util.escapeRegex(`${part}`));
2316
+ }
2317
+ else {
2318
+ throw new Error(`Invalid template literal part: ${part}`);
2319
+ }
2320
+ }
2321
+ inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
2322
+ inst._zod.parse = (payload, _ctx) => {
2323
+ if (typeof payload.value !== "string") {
2324
+ payload.issues.push({
2325
+ input: payload.value,
2326
+ inst,
2327
+ expected: "string",
2328
+ code: "invalid_type",
2329
+ });
2330
+ return payload;
2331
+ }
2332
+ inst._zod.pattern.lastIndex = 0;
2333
+ if (!inst._zod.pattern.test(payload.value)) {
2334
+ payload.issues.push({
2335
+ input: payload.value,
2336
+ inst,
2337
+ code: "invalid_format",
2338
+ format: def.format ?? "template_literal",
2339
+ pattern: inst._zod.pattern.source,
2340
+ });
2341
+ return payload;
2342
+ }
2343
+ return payload;
2344
+ };
2345
+ });
2346
+ exports.$ZodFunction = core.$constructor("$ZodFunction", (inst, def) => {
2347
+ exports.$ZodType.init(inst, def);
2348
+ // Defined, not assigned: the classic prototype exposes `_def` as a getter with no setter.
2349
+ Object.defineProperty(inst, "_def", { value: def });
2350
+ inst._zod.def = def;
2351
+ inst.implement = (func) => {
2352
+ if (typeof func !== "function") {
2353
+ throw new Error("implement() must be called with a function");
2354
+ }
2355
+ // Defined inline so the closure stays anonymous: binding it to a `const` first names it, which costs 256 bytes per implemented function.
2356
+ return Object.defineProperty(function (...args) {
2357
+ const parsedArgs = inst._def.input ? (0, parse_js_1.parse)(inst._def.input, args) : args;
2358
+ const result = Reflect.apply(func, this, parsedArgs);
2359
+ if (inst._def.output) {
2360
+ return (0, parse_js_1.parse)(inst._def.output, result);
2361
+ }
2362
+ return result;
2363
+ }, "_zod", { value: inst._zod, enumerable: false });
2364
+ };
2365
+ inst.implementAsync = (func) => {
2366
+ if (typeof func !== "function") {
2367
+ throw new Error("implementAsync() must be called with a function");
2368
+ }
2369
+ return Object.defineProperty(async function (...args) {
2370
+ const parsedArgs = inst._def.input ? await (0, parse_js_1.parseAsync)(inst._def.input, args) : args;
2371
+ const result = await Reflect.apply(func, this, parsedArgs);
2372
+ if (inst._def.output) {
2373
+ return await (0, parse_js_1.parseAsync)(inst._def.output, result);
2374
+ }
2375
+ return result;
2376
+ }, "_zod", { value: inst._zod, enumerable: false });
2377
+ };
2378
+ inst._zod.parse = (payload, _ctx) => {
2379
+ if (typeof payload.value !== "function") {
2380
+ payload.issues.push({
2381
+ code: "invalid_type",
2382
+ expected: "function",
2383
+ input: payload.value,
2384
+ inst,
2385
+ });
2386
+ return payload;
2387
+ }
2388
+ // Check if output is a promise type to determine if we should use async implementation
2389
+ const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === "promise";
2390
+ if (hasPromiseOutput) {
2391
+ payload.value = inst.implementAsync(payload.value);
2392
+ }
2393
+ else {
2394
+ payload.value = inst.implement(payload.value);
2395
+ }
2396
+ return payload;
2397
+ };
2398
+ inst.input = (...args) => {
2399
+ const F = inst.constructor;
2400
+ if (Array.isArray(args[0])) {
2401
+ return new F({
2402
+ type: "function",
2403
+ input: new exports.$ZodTuple({
2404
+ type: "tuple",
2405
+ items: args[0],
2406
+ rest: args[1],
2407
+ }),
2408
+ output: inst._def.output,
2409
+ });
2410
+ }
2411
+ return new F({
2412
+ type: "function",
2413
+ input: args[0],
2414
+ output: inst._def.output,
2415
+ });
2416
+ };
2417
+ inst.output = (output) => {
2418
+ const F = inst.constructor;
2419
+ return new F({
2420
+ type: "function",
2421
+ input: inst._def.input,
2422
+ output,
2423
+ });
2424
+ };
2425
+ return inst;
2426
+ });
2427
+ exports.$ZodPromise = core.$constructor("$ZodPromise", (inst, def) => {
2428
+ exports.$ZodType.init(inst, def);
2429
+ inst._zod.parse = (payload, ctx) => {
2430
+ return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));
2431
+ };
2432
+ });
2433
+ exports.$ZodLazy = core.$constructor("$ZodLazy", (inst, def) => {
2434
+ exports.$ZodType.init(inst, def);
2435
+ // 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.
2436
+ util.defineLazy(inst._zod, "innerType", () => {
2437
+ const d = def;
2438
+ if (!d._cachedInner)
2439
+ d._cachedInner = def.getter();
2440
+ return d._cachedInner;
2441
+ });
2442
+ util.defineLazyInternal(inst, "pattern", (zod) => zod.innerType?._zod?.pattern);
2443
+ util.defineLazyInternal(inst, "propValues", (zod) => zod.innerType?._zod?.propValues);
2444
+ util.defineLazyInternal(inst, "optin", (zod) => zod.innerType?._zod?.optin ?? undefined);
2445
+ util.defineLazyInternal(inst, "optout", (zod) => zod.innerType?._zod?.optout ?? undefined);
2446
+ inst._zod.parse = (payload, ctx) => {
2447
+ const inner = inst._zod.innerType;
2448
+ return inner._zod.run(payload, ctx);
2449
+ };
2450
+ });
2451
+ exports.$ZodCustom = core.$constructor("$ZodCustom", (inst, def) => {
2452
+ checks.$ZodCheck.init(inst, def);
2453
+ exports.$ZodType.init(inst, def);
2454
+ inst._zod.parse = (payload, _) => {
2455
+ return payload;
2456
+ };
2457
+ inst._zod.check = (payload) => {
2458
+ const input = payload.value;
2459
+ const r = def.fn(input);
2460
+ if (r instanceof Promise) {
2461
+ return r.then((r) => handleRefineResult(r, payload, input, inst));
2462
+ }
2463
+ handleRefineResult(r, payload, input, inst);
2464
+ return;
2465
+ };
2466
+ });
2467
+ function handleRefineResult(result, payload, input, inst) {
2468
+ if (!result) {
2469
+ const _iss = {
2470
+ code: "custom",
2471
+ input,
2472
+ inst, // incorporates params.error into issue reporting
2473
+ path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting
2474
+ continue: !inst._zod.def.abort,
2475
+ // params: inst._zod.def.params,
2476
+ };
2477
+ if (inst._zod.def.params)
2478
+ _iss.params = inst._zod.def.params;
2479
+ payload.issues.push(util.issue(_iss));
2480
+ }
2481
+ }