@powerhousedao/ph-clint-app 0.1.0-dev.73 → 0.1.0-dev.75
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.
- package/dist/browser/document-models/index.js +1 -1
- package/dist/browser/document-models/ph-clint-project/index.js +3 -3
- package/dist/browser/{editor-DL0W2XOS.js → editor-Z7QJIYOp.js} +988 -450
- package/dist/browser/{editor-DL0W2XOS.js.map → editor-Z7QJIYOp.js.map} +1 -1
- package/dist/browser/editors/ph-clint-project-editor/module.js +1 -1
- package/dist/browser/index.js +3 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/{module-DoAlHsjp.js → module-BZ6W31hV.js} +1943 -1012
- package/dist/browser/module-BZ6W31hV.js.map +1 -0
- package/dist/browser/{ph-clint-project-D634z5c5.js → ph-clint-project-3b5ZHznW.js} +4 -6
- package/dist/browser/ph-clint-project-3b5ZHznW.js.map +1 -0
- package/dist/connect/assets/editor-CEMUd4Ju.js +2 -0
- package/dist/connect/assets/editor-CEMUd4Ju.js.map +1 -0
- package/dist/connect/assets/{index-BXAErAWR.js → index-BxEnFQyj.js} +20 -20
- package/dist/connect/assets/index-BxEnFQyj.js.map +1 -0
- package/dist/connect/assets/index-cjUwUwMU.css +2 -0
- package/dist/connect/assets/ph-clint-project-C_SSQ38p.js +1112 -0
- package/dist/connect/assets/ph-clint-project-C_SSQ38p.js.map +1 -0
- package/dist/connect/index.html +3 -3
- package/dist/connect/ph-packages.json +1 -1
- package/dist/document-models/document-models.d.ts +1 -1
- package/dist/document-models/index.d.ts +1 -1
- package/dist/document-models/ph-clint-project/index.d.ts +2 -2
- package/dist/document-models/ph-clint-project/upgrades/index.d.ts +2 -2
- package/dist/document-models/ph-clint-project/upgrades/upgrade-manifest.d.ts +2 -2
- package/dist/document-models/ph-clint-project/upgrades/upgrade-manifest.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/actions.d.ts +27 -16
- package/dist/document-models/ph-clint-project/v1/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/actions.d.ts +29 -19
- package/dist/document-models/ph-clint-project/v1/gen/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/controller.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/controller.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/creators.d.ts +28 -18
- package/dist/document-models/ph-clint-project/v1/gen/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/actions.d.ts +6 -6
- package/dist/document-models/ph-clint-project/v1/gen/deployment/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/deployment/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/deployment/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/deployment/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/document-model.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/document-schema.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/actions.d.ts +6 -6
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/external-skills/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/actions.d.ts +6 -54
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/creators.d.ts +2 -14
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/error.d.ts +1 -78
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/operations.d.ts +3 -15
- package/dist/document-models/ph-clint-project/v1/gen/features-mastra/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/actions.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/features-powerhouse/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/actions.d.ts +4 -4
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/features-routine/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/actions.d.ts +5 -5
- package/dist/document-models/ph-clint-project/v1/gen/identity/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/identity/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/identity/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/identity/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/index.d.ts +25 -20
- package/dist/document-models/ph-clint-project/v1/gen/index.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/actions.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/error.d.ts +13 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/lifecycle/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/actions.d.ts +40 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/actions.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/creators.d.ts +11 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/creators.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/error.d.ts +79 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/error.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/operations.d.ts +18 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-agent-bindings/operations.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/actions.d.ts +28 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/actions.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/creators.d.ts +8 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/creators.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/error.d.ts +36 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/error.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/operations.d.ts +15 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-main-agent/operations.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/actions.d.ts +16 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/actions.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/creators.d.ts +5 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/creators.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/error.d.ts +37 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/error.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/operations.d.ts +12 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-models/operations.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/actions.d.ts +24 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/actions.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/creators.d.ts +7 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/creators.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/error.d.ts +46 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/error.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/operations.d.ts +14 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-profiles/operations.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/actions.d.ts +24 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/actions.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/creators.d.ts +7 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/creators.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/error.d.ts +51 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/error.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/operations.d.ts +14 -0
- package/dist/document-models/ph-clint-project/v1/gen/mastra-sub-agents/operations.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/gen/ph-factories.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/actions.d.ts +7 -7
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/error.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/powerhouse-packages/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/actions.d.ts +7 -7
- package/dist/document-models/ph-clint-project/v1/gen/publishing/actions.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/creators.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/publishing/creators.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/error.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/publishing/operations.d.ts +3 -3
- package/dist/document-models/ph-clint-project/v1/gen/publishing/operations.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/reducer.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/schema/index.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/schema/types.d.ts +210 -131
- package/dist/document-models/ph-clint-project/v1/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/schema/zod.d.ts +23 -8
- package/dist/document-models/ph-clint-project/v1/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/types.d.ts +5 -5
- package/dist/document-models/ph-clint-project/v1/gen/types.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/gen/utils.d.ts +2 -2
- package/dist/document-models/ph-clint-project/v1/gen/utils.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/hooks.d.ts +6 -3
- package/dist/document-models/ph-clint-project/v1/hooks.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/index.d.ts +6 -6
- package/dist/document-models/ph-clint-project/v1/module.d.ts +27 -16
- package/dist/document-models/ph-clint-project/v1/module.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/index.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/deployment.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/deployment.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/external-skills.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/external-skills.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-mastra.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-powerhouse.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-powerhouse.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-routine.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/features-routine.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/identity.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/identity.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/lifecycle.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-agent-bindings.d.ts +3 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-agent-bindings.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-main-agent.d.ts +3 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-main-agent.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-models.d.ts +3 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-models.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-profiles.d.ts +3 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-profiles.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-sub-agents.d.ts +3 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/mastra-sub-agents.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/publishing.d.ts +1 -1
- package/dist/document-models/ph-clint-project/v1/src/reducers/publishing.d.ts.map +1 -1
- package/dist/document-models/ph-clint-project/v1/tests/mastra-agent-bindings.test.d.ts +2 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-agent-bindings.test.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-main-agent.test.d.ts +2 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-main-agent.test.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-models.test.d.ts +2 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-models.test.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-profiles.test.d.ts +2 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-profiles.test.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-sub-agents.test.d.ts +2 -0
- package/dist/document-models/ph-clint-project/v1/tests/mastra-sub-agents.test.d.ts.map +1 -0
- package/dist/document-models/ph-clint-project/v1/utils.d.ts +2 -2
- package/dist/document-models/upgrade-manifests.d.ts +1 -1
- package/dist/document-models/upgrade-manifests.d.ts.map +1 -1
- package/dist/editors/ph-clint-project-editor/editor.d.ts.map +1 -1
- package/dist/node/document-models/index.mjs +1 -1
- package/dist/node/document-models/ph-clint-project/index.mjs +3 -3
- package/dist/node/{editor-mM5FSNXc.mjs → editor-C82Trmk4.mjs} +988 -450
- package/dist/node/{editor-mM5FSNXc.mjs.map → editor-C82Trmk4.mjs.map} +1 -1
- package/dist/node/editors/ph-clint-project-editor/module.mjs +1 -1
- package/dist/node/index.mjs +3 -3
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/{module-DayL4J7r.mjs → module-ZwrJ5kaI.mjs} +1943 -1012
- package/dist/node/module-ZwrJ5kaI.mjs.map +1 -0
- package/dist/node/{ph-clint-project-Btx_kiiQ.mjs → ph-clint-project-YqV6kGMs.mjs} +4 -6
- package/dist/node/ph-clint-project-YqV6kGMs.mjs.map +1 -0
- package/dist/style.css +33 -29
- package/package.json +1 -1
- package/dist/browser/module-DoAlHsjp.js.map +0 -1
- package/dist/browser/ph-clint-project-D634z5c5.js.map +0 -1
- package/dist/connect/assets/editor-DgkuaKuV.js +0 -2
- package/dist/connect/assets/editor-DgkuaKuV.js.map +0 -1
- package/dist/connect/assets/index-BSq-9kCR.css +0 -2
- package/dist/connect/assets/index-BXAErAWR.js.map +0 -1
- package/dist/connect/assets/ph-clint-project-BRYYVNTj.js +0 -758
- package/dist/connect/assets/ph-clint-project-BRYYVNTj.js.map +0 -1
- package/dist/node/module-DayL4J7r.mjs.map +0 -1
- package/dist/node/ph-clint-project-Btx_kiiQ.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-DayL4J7r.mjs","names":["cjsModule","initializer","util.jsonStringifyReplacer","core.$ZodAsyncError","util.finalizeIssue","core.config","parse","errors.$ZodRealError","parseAsync","errors.$ZodError","safeParse","safeParseAsync","encode","decode","encodeAsync","decodeAsync","safeEncode","safeDecode","safeEncodeAsync","safeDecodeAsync","duration","_emoji","date","time","datetime","string","number","boolean","util.floatSafeRemainder","util.NUMBER_FORMAT_RANGES","regexes.integer","util.nullish","util.getLengthableOrigin","regexes.lowercase","regexes.uppercase","util.escapeRegex","util.aborted","core.$ZodAsyncError","safeParse","safeParseAsync","regexes.string","regexes.guid","regexes.uuid","regexes.email","regexes.emoji","regexes.nanoid","regexes.cuid","regexes.cuid2","regexes.ulid","regexes.xid","regexes.ksuid","regexes.datetime","regexes.date","regexes.time","regexes.duration","regexes.ipv4","regexes.ipv6","regexes.cidrv4","regexes.cidrv6","regexes.base64","regexes.base64url","regexes.e164","regexes.number","regexes.boolean","util.prefixIssues","util.optionalKeys","util.cached","isObject","util.isObject","util.esc","allowsEval","util.allowsEval","util.finalizeIssue","core.config","util.cleanRegex","util.isPlainObject","util.getEnumValues","util.escapeRegex","core.$ZodEncodeError","util.issue","util.normalizeParams","checks.$ZodCheckLessThan","checks.$ZodCheckGreaterThan","checks.$ZodCheckMultipleOf","checks.$ZodCheckMaxLength","checks.$ZodCheckMinLength","checks.$ZodCheckLengthEquals","checks.$ZodCheckRegex","checks.$ZodCheckLowerCase","checks.$ZodCheckUpperCase","checks.$ZodCheckIncludes","checks.$ZodCheckStartsWith","checks.$ZodCheckEndsWith","checks.$ZodCheckOverwrite","util.slugify","issue","util.issue","checks.$ZodCheck","describe","meta","core._isoDateTime","core._isoDate","core._isoTime","core._isoDuration","core.formatError","core.flattenError","util.jsonStringifyReplacer","core.$constructor","util.mergeDefs","core.clone","parse.parse","parse.safeParse","parse.parseAsync","parse.safeParseAsync","parse.encode","parse.decode","parse.encodeAsync","parse.decodeAsync","parse.safeEncode","parse.safeDecode","parse.safeEncodeAsync","parse.safeDecodeAsync","checks.overwrite","processors.stringProcessor","checks.regex","checks.includes","checks.startsWith","checks.endsWith","checks.minLength","checks.maxLength","checks.length","checks.lowercase","checks.uppercase","checks.trim","checks.normalize","checks.toLowerCase","checks.toUpperCase","checks.slugify","core._email","core._url","core._jwt","core._emoji","core._guid","core._uuid","core._uuidv4","core._uuidv6","core._uuidv7","core._nanoid","core._cuid","core._cuid2","core._ulid","core._base64","core._base64url","core._xid","core._ksuid","core._ipv4","core._ipv6","core._cidrv4","core._cidrv6","core._e164","iso.datetime","iso.date","iso.time","iso.duration","core._string","processors.numberProcessor","checks.gt","checks.gte","checks.lt","checks.lte","checks.multipleOf","core._number","core._int","processors.booleanProcessor","core._boolean","processors.anyProcessor","core._any","processors.unknownProcessor","core._unknown","processors.neverProcessor","core._never","processors.arrayProcessor","core._array","processors.objectProcessor","util.extend","util.safeExtend","util.merge","util.pick","util.omit","util.partial","util.required","util.normalizeParams","processors.unionProcessor","processors.intersectionProcessor","processors.enumProcessor","processors.literalProcessor","processors.transformProcessor","core.$ZodEncodeError","issue","util.issue","processors.optionalProcessor","processors.nullableProcessor","processors.defaultProcessor","util.shallowClone","processors.prefaultProcessor","processors.nonoptionalProcessor","processors.catchProcessor","processors.pipeProcessor","processors.readonlyProcessor","processors.lazyProcessor","processors.customProcessor","core._refine","core._superRefine","core.describe","core.meta","isDefinedNonNullAny","definedNonNullAnySchema","z.any","z.enum","z.string","z.union","z.object","z.lazy","z.number","z.unknown","z.literal","z.array","z.boolean","actions","utils","#tags","#tagString","#level","z.any","z.enum","z.object","z.url","z.string","z.boolean","z.literal","z.array","z.lazy","z.iso.datetime","phClintProjectIdentityActions","phClintProjectFeaturesPowerhouseActions","phClintProjectFeaturesMastraActions","phClintProjectFeaturesRoutineActions","phClintProjectPowerhousePackagesActions","phClintProjectExternalSkillsActions","phClintProjectPublishingActions","phClintProjectLifecycleActions","phClintProjectDeploymentActions","InvalidVersionError","InvalidVersionError","InvalidVersionError","InvalidVersionError","z.literal","z.object","utils","genUtils","customUtils"],"sources":["../../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js","../../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/esm/wrapper.js","../../../../node_modules/.pnpm/sha1-uint8array@0.10.7/node_modules/sha1-uint8array/dist/sha1-uint8array.mjs","../../../../node_modules/.pnpm/@powerhousedao+shared@6.0.0-dev.216_@emnapi+core@1.10.0_@emnapi+runtime@1.10.0/node_modules/@powerhousedao/shared/dist/utils-bCWnsmtD.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js","../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js","../../../../node_modules/.pnpm/mutative@1.3.0/node_modules/mutative/dist/mutative.esm.mjs","../../../../node_modules/.pnpm/change-case@5.4.4/node_modules/change-case/dist/index.js","../../../../node_modules/.pnpm/@powerhousedao+shared@6.0.0-dev.216_@emnapi+core@1.10.0_@emnapi+runtime@1.10.0/node_modules/@powerhousedao/shared/dist/document-model/index.js","../../../../node_modules/.pnpm/document-model@6.0.0-dev.216_@emnapi+core@1.10.0_@emnapi+runtime@1.10.0_@tsdown+css@0.2_528d9c6a4e262c2d2c4903ad476bacd8/node_modules/document-model/dist/index.js","../../document-models/ph-clint-project/v1/gen/schema/zod.ts","../../document-models/ph-clint-project/v1/gen/deployment/creators.ts","../../document-models/ph-clint-project/v1/gen/external-skills/creators.ts","../../document-models/ph-clint-project/v1/gen/features-mastra/creators.ts","../../document-models/ph-clint-project/v1/gen/features-powerhouse/creators.ts","../../document-models/ph-clint-project/v1/gen/features-routine/creators.ts","../../document-models/ph-clint-project/v1/gen/identity/creators.ts","../../document-models/ph-clint-project/v1/gen/lifecycle/creators.ts","../../document-models/ph-clint-project/v1/gen/powerhouse-packages/creators.ts","../../document-models/ph-clint-project/v1/gen/publishing/creators.ts","../../document-models/ph-clint-project/v1/actions.ts","../../document-models/ph-clint-project/v1/gen/document-model.ts","../../document-models/ph-clint-project/v1/gen/deployment/error.ts","../../document-models/ph-clint-project/v1/src/reducers/deployment.ts","../../document-models/ph-clint-project/v1/gen/external-skills/error.ts","../../document-models/ph-clint-project/v1/src/reducers/external-skills.ts","../../document-models/ph-clint-project/v1/gen/features-mastra/error.ts","../../document-models/ph-clint-project/v1/src/reducers/features-mastra.ts","../../document-models/ph-clint-project/v1/gen/features-powerhouse/error.ts","../../document-models/ph-clint-project/v1/src/reducers/features-powerhouse.ts","../../document-models/ph-clint-project/v1/src/reducers/features-routine.ts","../../document-models/ph-clint-project/v1/gen/identity/error.ts","../../document-models/ph-clint-project/v1/src/reducers/identity.ts","../../document-models/ph-clint-project/v1/src/reducers/lifecycle.ts","../../document-models/ph-clint-project/v1/gen/powerhouse-packages/error.ts","../../document-models/ph-clint-project/v1/src/reducers/powerhouse-packages.ts","../../document-models/ph-clint-project/v1/gen/publishing/error.ts","../../document-models/ph-clint-project/v1/src/reducers/publishing.ts","../../document-models/ph-clint-project/v1/gen/reducer.ts","../../document-models/ph-clint-project/v1/gen/document-type.ts","../../document-models/ph-clint-project/v1/gen/document-schema.ts","../../document-models/ph-clint-project/v1/gen/utils.ts","../../document-models/ph-clint-project/v1/src/utils.ts","../../document-models/ph-clint-project/v1/utils.ts","../../document-models/ph-clint-project/v1/module.ts"],"sourcesContent":["'use strict'\n\nconst { hasOwnProperty } = Object.prototype\n\nconst stringify = configure()\n\n// @ts-expect-error\nstringify.configure = configure\n// @ts-expect-error\nstringify.stringify = stringify\n\n// @ts-expect-error\nstringify.default = stringify\n\n// @ts-expect-error used for named export\nexports.stringify = stringify\n// @ts-expect-error used for named export\nexports.configure = configure\n\nmodule.exports = stringify\n\n// eslint-disable-next-line no-control-regex\nconst strEscapeSequencesRegExp = /[\\u0000-\\u001f\\u0022\\u005c\\ud800-\\udfff]/\n\n// Escape C0 control characters, double quotes, the backslash and every code\n// unit with a numeric value in the inclusive range 0xD800 to 0xDFFF.\nfunction strEscape (str) {\n // Some magic numbers that worked out fine while benchmarking with v8 8.0\n if (str.length < 5000 && !strEscapeSequencesRegExp.test(str)) {\n return `\"${str}\"`\n }\n return JSON.stringify(str)\n}\n\nfunction sort (array, comparator) {\n // Insertion sort is very efficient for small input sizes, but it has a bad\n // worst case complexity. Thus, use native array sort for bigger values.\n if (array.length > 2e2 || comparator) {\n return array.sort(comparator)\n }\n for (let i = 1; i < array.length; i++) {\n const currentValue = array[i]\n let position = i\n while (position !== 0 && array[position - 1] > currentValue) {\n array[position] = array[position - 1]\n position--\n }\n array[position] = currentValue\n }\n return array\n}\n\nconst typedArrayPrototypeGetSymbolToStringTag =\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(\n Object.getPrototypeOf(\n new Int8Array()\n )\n ),\n Symbol.toStringTag\n ).get\n\nfunction isTypedArrayWithEntries (value) {\n return typedArrayPrototypeGetSymbolToStringTag.call(value) !== undefined && value.length !== 0\n}\n\nfunction stringifyTypedArray (array, separator, maximumBreadth) {\n if (array.length < maximumBreadth) {\n maximumBreadth = array.length\n }\n const whitespace = separator === ',' ? '' : ' '\n let res = `\"0\":${whitespace}${array[0]}`\n for (let i = 1; i < maximumBreadth; i++) {\n res += `${separator}\"${i}\":${whitespace}${array[i]}`\n }\n return res\n}\n\nfunction getCircularValueOption (options) {\n if (hasOwnProperty.call(options, 'circularValue')) {\n const circularValue = options.circularValue\n if (typeof circularValue === 'string') {\n return `\"${circularValue}\"`\n }\n if (circularValue == null) {\n return circularValue\n }\n if (circularValue === Error || circularValue === TypeError) {\n return {\n toString () {\n throw new TypeError('Converting circular structure to JSON')\n }\n }\n }\n throw new TypeError('The \"circularValue\" argument must be of type string or the value null or undefined')\n }\n return '\"[Circular]\"'\n}\n\nfunction getDeterministicOption (options) {\n let value\n if (hasOwnProperty.call(options, 'deterministic')) {\n value = options.deterministic\n if (typeof value !== 'boolean' && typeof value !== 'function') {\n throw new TypeError('The \"deterministic\" argument must be of type boolean or comparator function')\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getBooleanOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'boolean') {\n throw new TypeError(`The \"${key}\" argument must be of type boolean`)\n }\n }\n return value === undefined ? true : value\n}\n\nfunction getPositiveIntegerOption (options, key) {\n let value\n if (hasOwnProperty.call(options, key)) {\n value = options[key]\n if (typeof value !== 'number') {\n throw new TypeError(`The \"${key}\" argument must be of type number`)\n }\n if (!Number.isInteger(value)) {\n throw new TypeError(`The \"${key}\" argument must be an integer`)\n }\n if (value < 1) {\n throw new RangeError(`The \"${key}\" argument must be >= 1`)\n }\n }\n return value === undefined ? Infinity : value\n}\n\nfunction getItemCount (number) {\n if (number === 1) {\n return '1 item'\n }\n return `${number} items`\n}\n\nfunction getUniqueReplacerSet (replacerArray) {\n const replacerSet = new Set()\n for (const value of replacerArray) {\n if (typeof value === 'string' || typeof value === 'number') {\n replacerSet.add(String(value))\n }\n }\n return replacerSet\n}\n\nfunction getStrictOption (options) {\n if (hasOwnProperty.call(options, 'strict')) {\n const value = options.strict\n if (typeof value !== 'boolean') {\n throw new TypeError('The \"strict\" argument must be of type boolean')\n }\n if (value) {\n return (value) => {\n let message = `Object can not safely be stringified. Received type ${typeof value}`\n if (typeof value !== 'function') message += ` (${value.toString()})`\n throw new Error(message)\n }\n }\n }\n}\n\nfunction configure (options) {\n options = { ...options }\n const fail = getStrictOption(options)\n if (fail) {\n if (options.bigint === undefined) {\n options.bigint = false\n }\n if (!('circularValue' in options)) {\n options.circularValue = Error\n }\n }\n const circularValue = getCircularValueOption(options)\n const bigint = getBooleanOption(options, 'bigint')\n const deterministic = getDeterministicOption(options)\n const comparator = typeof deterministic === 'function' ? deterministic : undefined\n const maximumDepth = getPositiveIntegerOption(options, 'maximumDepth')\n const maximumBreadth = getPositiveIntegerOption(options, 'maximumBreadth')\n\n function stringifyFnReplacer (key, parent, stack, replacer, spacer, indentation) {\n let value = parent[key]\n\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n value = replacer.call(parent, key, value)\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n let join = ','\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let whitespace = ''\n let separator = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (deterministic && !isTypedArrayWithEntries(value)) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyFnReplacer(key, value, stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":${whitespace}\"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyArrayReplacer (key, value, stack, replacer, spacer, indentation) {\n if (typeof value === 'object' && value !== null && typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n }\n\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n const originalIndentation = indentation\n let res = ''\n let join = ','\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n if (spacer !== '') {\n indentation += spacer\n res += `\\n${indentation}`\n join = `,\\n${indentation}`\n }\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n if (spacer !== '') {\n res += `\\n${originalIndentation}`\n }\n stack.pop()\n return `[${res}]`\n }\n stack.push(value)\n let whitespace = ''\n if (spacer !== '') {\n indentation += spacer\n join = `,\\n${indentation}`\n whitespace = ' '\n }\n let separator = ''\n for (const key of replacer) {\n const tmp = stringifyArrayReplacer(key, value[key], stack, replacer, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${whitespace}${tmp}`\n separator = join\n }\n }\n if (spacer !== '' && separator.length > 1) {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifyIndent (key, value, stack, spacer, indentation) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again.\n if (typeof value !== 'object') {\n return stringifyIndent(key, value, stack, spacer, indentation)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n const originalIndentation = indentation\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n indentation += spacer\n let res = `\\n${indentation}`\n const join = `,\\n${indentation}`\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n res += join\n }\n const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `${join}\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n res += `\\n${originalIndentation}`\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n indentation += spacer\n const join = `,\\n${indentation}`\n let res = ''\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, join, maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = join\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifyIndent(key, value[key], stack, spacer, indentation)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}: ${tmp}`\n separator = join\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\": \"${getItemCount(removedKeys)} not stringified\"`\n separator = join\n }\n if (separator !== '') {\n res = `\\n${indentation}${res}\\n${originalIndentation}`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringifySimple (key, value, stack) {\n switch (typeof value) {\n case 'string':\n return strEscape(value)\n case 'object': {\n if (value === null) {\n return 'null'\n }\n if (typeof value.toJSON === 'function') {\n value = value.toJSON(key)\n // Prevent calling `toJSON` again\n if (typeof value !== 'object') {\n return stringifySimple(key, value, stack)\n }\n if (value === null) {\n return 'null'\n }\n }\n if (stack.indexOf(value) !== -1) {\n return circularValue\n }\n\n let res = ''\n\n const hasLength = value.length !== undefined\n if (hasLength && Array.isArray(value)) {\n if (value.length === 0) {\n return '[]'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Array]\"'\n }\n stack.push(value)\n const maximumValuesToStringify = Math.min(value.length, maximumBreadth)\n let i = 0\n for (; i < maximumValuesToStringify - 1; i++) {\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n res += ','\n }\n const tmp = stringifySimple(String(i), value[i], stack)\n res += tmp !== undefined ? tmp : 'null'\n if (value.length - 1 > maximumBreadth) {\n const removedKeys = value.length - maximumBreadth - 1\n res += `,\"... ${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `[${res}]`\n }\n\n let keys = Object.keys(value)\n const keyLength = keys.length\n if (keyLength === 0) {\n return '{}'\n }\n if (maximumDepth < stack.length + 1) {\n return '\"[Object]\"'\n }\n let separator = ''\n let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth)\n if (hasLength && isTypedArrayWithEntries(value)) {\n res += stringifyTypedArray(value, ',', maximumBreadth)\n keys = keys.slice(value.length)\n maximumPropertiesToStringify -= value.length\n separator = ','\n }\n if (deterministic) {\n keys = sort(keys, comparator)\n }\n stack.push(value)\n for (let i = 0; i < maximumPropertiesToStringify; i++) {\n const key = keys[i]\n const tmp = stringifySimple(key, value[key], stack)\n if (tmp !== undefined) {\n res += `${separator}${strEscape(key)}:${tmp}`\n separator = ','\n }\n }\n if (keyLength > maximumBreadth) {\n const removedKeys = keyLength - maximumBreadth\n res += `${separator}\"...\":\"${getItemCount(removedKeys)} not stringified\"`\n }\n stack.pop()\n return `{${res}}`\n }\n case 'number':\n return isFinite(value) ? String(value) : fail ? fail(value) : 'null'\n case 'boolean':\n return value === true ? 'true' : 'false'\n case 'undefined':\n return undefined\n case 'bigint':\n if (bigint) {\n return String(value)\n }\n // fallthrough\n default:\n return fail ? fail(value) : undefined\n }\n }\n\n function stringify (value, replacer, space) {\n if (arguments.length > 1) {\n let spacer = ''\n if (typeof space === 'number') {\n spacer = ' '.repeat(Math.min(space, 10))\n } else if (typeof space === 'string') {\n spacer = space.slice(0, 10)\n }\n if (replacer != null) {\n if (typeof replacer === 'function') {\n return stringifyFnReplacer('', { '': value }, [], replacer, spacer, '')\n }\n if (Array.isArray(replacer)) {\n return stringifyArrayReplacer('', value, [], getUniqueReplacerSet(replacer), spacer, '')\n }\n }\n if (spacer.length !== 0) {\n return stringifyIndent('', value, [], spacer, '')\n }\n }\n return stringifySimple('', value, [])\n }\n\n return stringify\n}\n","import cjsModule from '../index.js'\n\nexport const configure = cjsModule.configure\n\nexport const stringify = cjsModule\nexport default cjsModule\n","/**\n * sha1-uint8array.ts\n */\nconst K = [\n 0x5a827999 | 0,\n 0x6ed9eba1 | 0,\n 0x8f1bbcdc | 0,\n 0xca62c1d6 | 0,\n];\nconst algorithms = {\n sha1: 1,\n};\nexport function createHash(algorithm) {\n if (algorithm && !algorithms[algorithm] && !algorithms[algorithm.toLowerCase()]) {\n throw new Error(\"Digest method not supported\");\n }\n return new Hash();\n}\nclass Hash {\n constructor() {\n this.A = 0x67452301 | 0;\n this.B = 0xefcdab89 | 0;\n this.C = 0x98badcfe | 0;\n this.D = 0x10325476 | 0;\n this.E = 0xc3d2e1f0 | 0;\n this._size = 0;\n this._sp = 0; // surrogate pair\n if (!sharedBuffer || sharedOffset >= 8000 /* N.allocTotal */) {\n sharedBuffer = new ArrayBuffer(8000 /* N.allocTotal */);\n sharedOffset = 0;\n }\n this._byte = new Uint8Array(sharedBuffer, sharedOffset, 80 /* N.allocBytes */);\n this._word = new Int32Array(sharedBuffer, sharedOffset, 20 /* N.allocWords */);\n sharedOffset += 80 /* N.allocBytes */;\n }\n update(data) {\n // data: string\n if (\"string\" === typeof data) {\n return this._utf8(data);\n }\n // data: undefined\n if (data == null) {\n throw new TypeError(\"Invalid type: \" + typeof data);\n }\n const byteOffset = data.byteOffset;\n const length = data.byteLength;\n let blocks = (length / 64 /* N.inputBytes */) | 0;\n let offset = 0;\n // longer than 1 block\n if (blocks && !(byteOffset & 3) && !(this._size % 64 /* N.inputBytes */)) {\n const block = new Int32Array(data.buffer, byteOffset, blocks * 16 /* N.inputWords */);\n while (blocks--) {\n this._int32(block, offset >> 2);\n offset += 64 /* N.inputBytes */;\n }\n this._size += offset;\n }\n // data: TypedArray | DataView\n const BYTES_PER_ELEMENT = data.BYTES_PER_ELEMENT;\n if (BYTES_PER_ELEMENT !== 1 && data.buffer) {\n const rest = new Uint8Array(data.buffer, byteOffset + offset, length - offset);\n return this._uint8(rest);\n }\n // no more bytes\n if (offset === length)\n return this;\n // data: Uint8Array | Int8Array\n return this._uint8(data, offset);\n }\n _uint8(data, offset) {\n const { _byte, _word } = this;\n const length = data.length;\n offset = offset | 0;\n while (offset < length) {\n const start = this._size % 64 /* N.inputBytes */;\n let index = start;\n while (offset < length && index < 64 /* N.inputBytes */) {\n _byte[index++] = data[offset++];\n }\n if (index >= 64 /* N.inputBytes */) {\n this._int32(_word);\n }\n this._size += index - start;\n }\n return this;\n }\n _utf8(text) {\n const { _byte, _word } = this;\n const length = text.length;\n let surrogate = this._sp;\n for (let offset = 0; offset < length;) {\n const start = this._size % 64 /* N.inputBytes */;\n let index = start;\n while (offset < length && index < 64 /* N.inputBytes */) {\n let code = text.charCodeAt(offset++) | 0;\n if (code < 0x80) {\n // ASCII characters\n _byte[index++] = code;\n }\n else if (code < 0x800) {\n // 2 bytes\n _byte[index++] = 0xC0 | (code >>> 6);\n _byte[index++] = 0x80 | (code & 0x3F);\n }\n else if (code < 0xD800 || code > 0xDFFF) {\n // 3 bytes\n _byte[index++] = 0xE0 | (code >>> 12);\n _byte[index++] = 0x80 | ((code >>> 6) & 0x3F);\n _byte[index++] = 0x80 | (code & 0x3F);\n }\n else if (surrogate) {\n // 4 bytes - surrogate pair\n code = ((surrogate & 0x3FF) << 10) + (code & 0x3FF) + 0x10000;\n _byte[index++] = 0xF0 | (code >>> 18);\n _byte[index++] = 0x80 | ((code >>> 12) & 0x3F);\n _byte[index++] = 0x80 | ((code >>> 6) & 0x3F);\n _byte[index++] = 0x80 | (code & 0x3F);\n surrogate = 0;\n }\n else {\n surrogate = code;\n }\n }\n if (index >= 64 /* N.inputBytes */) {\n this._int32(_word);\n _word[0] = _word[16 /* N.inputWords */];\n }\n this._size += index - start;\n }\n this._sp = surrogate;\n return this;\n }\n _int32(data, offset) {\n let { A, B, C, D, E } = this;\n let i = 0;\n offset = offset | 0;\n while (i < 16 /* N.inputWords */) {\n W[i++] = swap32(data[offset++]);\n }\n for (i = 16 /* N.inputWords */; i < 80 /* N.workWords */; i++) {\n W[i] = rotate1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]);\n }\n for (i = 0; i < 80 /* N.workWords */; i++) {\n const S = (i / 20) | 0;\n const T = (rotate5(A) + ft(S, B, C, D) + E + W[i] + K[S]) | 0;\n E = D;\n D = C;\n C = rotate30(B);\n B = A;\n A = T;\n }\n this.A = (A + this.A) | 0;\n this.B = (B + this.B) | 0;\n this.C = (C + this.C) | 0;\n this.D = (D + this.D) | 0;\n this.E = (E + this.E) | 0;\n }\n digest(encoding) {\n const { _byte, _word } = this;\n let i = (this._size % 64 /* N.inputBytes */) | 0;\n _byte[i++] = 0x80;\n // pad 0 for current word\n while (i & 3) {\n _byte[i++] = 0;\n }\n i >>= 2;\n if (i > 14 /* N.highIndex */) {\n while (i < 16 /* N.inputWords */) {\n _word[i++] = 0;\n }\n i = 0;\n this._int32(_word);\n }\n // pad 0 for rest words\n while (i < 16 /* N.inputWords */) {\n _word[i++] = 0;\n }\n // input size\n const bits64 = this._size * 8;\n const low32 = (bits64 & 0xffffffff) >>> 0;\n const high32 = (bits64 - low32) / 0x100000000;\n if (high32)\n _word[14 /* N.highIndex */] = swap32(high32);\n if (low32)\n _word[15 /* N.lowIndex */] = swap32(low32);\n this._int32(_word);\n return (encoding === \"hex\") ? this._hex() : this._bin();\n }\n _hex() {\n const { A, B, C, D, E } = this;\n return hex32(A) + hex32(B) + hex32(C) + hex32(D) + hex32(E);\n }\n _bin() {\n const { A, B, C, D, E, _byte, _word } = this;\n _word[0] = swap32(A);\n _word[1] = swap32(B);\n _word[2] = swap32(C);\n _word[3] = swap32(D);\n _word[4] = swap32(E);\n return _byte.slice(0, 20);\n }\n}\nconst W = new Int32Array(80 /* N.workWords */);\nlet sharedBuffer;\nlet sharedOffset = 0;\nconst hex32 = num => (num + 0x100000000).toString(16).substr(-8);\nconst swapLE = (c => (((c << 24) & 0xff000000) | ((c << 8) & 0xff0000) | ((c >> 8) & 0xff00) | ((c >> 24) & 0xff)));\nconst swapBE = (c => c);\nconst swap32 = isBE() ? swapBE : swapLE;\nconst rotate1 = num => (num << 1) | (num >>> 31);\nconst rotate5 = num => (num << 5) | (num >>> 27);\nconst rotate30 = num => (num << 30) | (num >>> 2);\nfunction ft(s, b, c, d) {\n if (s === 0)\n return (b & c) | ((~b) & d);\n if (s === 2)\n return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n}\nfunction isBE() {\n const buf = new Uint8Array(new Uint16Array([0xFEFF]).buffer); // BOM\n return (buf[0] === 0xFE);\n}\n","import { stringify } from \"safe-stable-stringify\";\nimport { createHash } from \"sha1-uint8array\";\n//#region document-model/crypto.ts\nconst hashBrowser = (data, algorithm = \"sha1\", encoding = \"base64\", _params) => {\n\tif (![\"sha1\"].includes(algorithm)) throw new Error(`Hashing algorithm not supported: \"${algorithm}\". Available: sha1`);\n\tif (![\"base64\", \"hex\"].includes(encoding)) throw new Error(`Hash encoding not supported: \"${encoding}\". Available: base64, hex`);\n\tconst hash = hashUIntArray(data, algorithm);\n\tif (encoding === \"hex\") return uint8ArrayToHex(hash);\n\treturn uint8ArrayToBase64(hash);\n};\nfunction uint8ArrayToBase64(uint8Array) {\n\tlet binaryString = \"\";\n\tfor (let i = 0; i < uint8Array.length; i++) binaryString += String.fromCharCode(uint8Array[i]);\n\treturn btoa(binaryString);\n}\nfunction uint8ArrayToHex(uint8Array) {\n\treturn Array.from(uint8Array).map((byte) => byte.toString(16).padStart(2, \"0\")).join(\"\");\n}\nfunction hashUIntArray(data, algorithm = \"sha1\") {\n\tif (![\"sha1\"].includes(algorithm)) throw new Error(\"Hashing algorithm not supported: Available: sha1\");\n\treturn createHash(\"sha1\").update(data).digest();\n}\nfunction getUnixTimestamp(date) {\n\treturn (new Date(date).getTime() / 1e3).toFixed(0);\n}\nfunction buildOperationSignatureParams({ documentId, signer, action, previousStateHash }) {\n\tconst { scope, type } = action;\n\treturn [\n\t\tgetUnixTimestamp(/* @__PURE__ */ new Date()),\n\t\tsigner.app.key,\n\t\thashBrowser([\n\t\t\tdocumentId,\n\t\t\tscope,\n\t\t\ttype,\n\t\t\tstringify(action.input)\n\t\t].join(\"\")),\n\t\tpreviousStateHash\n\t];\n}\nconst textEncode = new TextEncoder();\nfunction buildOperationSignatureMessage(params) {\n\tconst message = params.join(\"\");\n\tconst prefix = \"\u0019Signed Operation:\\n\" + message.length.toString();\n\treturn textEncode.encode(prefix + message);\n}\nfunction ab2hex(ab) {\n\tconst view = ArrayBuffer.isView(ab) ? ab : new Uint8Array(ab);\n\treturn Array.prototype.map.call(view, (x) => (\"00\" + x.toString(16)).slice(-2)).join(\"\");\n}\nfunction hex2ab(hex) {\n\treturn new Uint8Array(hex.match(/[\\da-f]{2}/gi)?.map(function(h) {\n\t\treturn parseInt(h, 16);\n\t}) ?? []);\n}\n//#endregion\n//#region document-model/utils.ts\nfunction generateId(method) {\n\tif (method && method.toString() !== \"UUIDv4\") throw new Error(`Id generation method not supported: \"${method.toString()}\"`);\n\treturn globalThis.crypto.randomUUID();\n}\n/**\n* Derives a deterministic operation ID from stable properties.\n*/\nfunction deriveOperationId(documentId, scope, branch, actionId) {\n\treturn hashBrowser(`${documentId}:${scope}:${branch}:${actionId}`, \"sha1\", \"hex\").slice(0, 32);\n}\n//#endregion\nexport { buildOperationSignatureParams as a, hex2ab as c, buildOperationSignatureMessage as i, generateId as n, getUnixTimestamp as o, ab2hex as r, hashBrowser as s, deriveOperationId as t };\n\n//# sourceMappingURL=utils-bCWnsmtD.js.map","/** A special constant with type `never` */\nexport const NEVER = Object.freeze({\n status: \"aborted\",\n});\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {\n function init(inst, def) {\n if (!inst._zod) {\n Object.defineProperty(inst, \"_zod\", {\n value: {\n def,\n constr: _,\n traits: new Set(),\n },\n enumerable: false,\n });\n }\n if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n // support prototype modifications\n const proto = _.prototype;\n const keys = Object.keys(proto);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n if (!(k in inst)) {\n inst[k] = proto[k].bind(inst);\n }\n }\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n var _a;\n const inst = params?.Parent ? new Definition() : this;\n init(inst, def);\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n for (const fn of inst._zod.deferred) {\n fn();\n }\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport class $ZodEncodeError extends Error {\n constructor(name) {\n super(`Encountered unidirectional transform during encode: ${name}`);\n this.name = \"ZodEncodeError\";\n }\n}\nexport const globalConfig = {};\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error(\"Unexpected value in exhaustive check\");\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepString = step.toString();\n let stepDecCount = (stepString.split(\".\")[1] || \"\").length;\n if (stepDecCount === 0 && /\\d?e-\\d?/.test(stepString)) {\n const match = stepString.match(/\\d?e-(\\d?)/);\n if (match?.[1]) {\n stepDecCount = Number.parseInt(match[1]);\n }\n }\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nconst EVALUATING = Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n let value = undefined;\n Object.defineProperty(object, key, {\n get() {\n if (value === EVALUATING) {\n // Circular reference detected, return undefined to break the cycle\n return undefined;\n }\n if (value === undefined) {\n value = EVALUATING;\n value = getter();\n }\n return value;\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function objectClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function mergeDefs(...defs) {\n const mergedDescriptors = {};\n for (const def of defs) {\n const descriptors = Object.getOwnPropertyDescriptors(def);\n Object.assign(mergedDescriptors, descriptors);\n }\n return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function slugify(input) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = cached(() => {\n // @ts-ignore\n if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n return false;\n }\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(o) {\n if (isObject(o) === false)\n return false;\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined)\n return true;\n if (typeof ctor !== \"function\")\n return true;\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false)\n return false;\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nexport function shallowClone(o) {\n if (isPlainObject(o))\n return { ...o };\n if (Array.isArray(o))\n return [...o];\n return o;\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n // @ts-ignore\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = new Set([\"string\", \"number\", \"bigint\", \"boolean\", \"symbol\", \"undefined\"]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = {};\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n newShape[key] = currDef.shape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function omit(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".omit() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = { ...schema._zod.def.shape };\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function extend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to extend: expected a plain object\");\n }\n const checks = schema._zod.def.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n // Only throw if new shape overlaps with existing shape\n // Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = schema._zod.def.shape;\n for (const key in shape) {\n if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {\n throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\");\n }\n }\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function merge(a, b) {\n const def = mergeDefs(a._zod.def, {\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: [], // delete existing checks\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".partial() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function required(Class, schema, mask) {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n });\n return clone(schema, def);\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue !== true) {\n return true;\n }\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const full = { ...iss, path: iss.path ?? [] };\n // for backwards compatibility\n if (!iss.message) {\n const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\";\n full.message = message;\n }\n // delete (full as any).def;\n delete full.inst;\n delete full.continue;\n if (!ctx?.reportInput) {\n delete full.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n // @ts-ignore\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function parsedType(data) {\n const t = typeof data;\n switch (t) {\n case \"number\": {\n return Number.isNaN(data) ? \"nan\" : \"number\";\n }\n case \"object\": {\n if (data === null) {\n return \"null\";\n }\n if (Array.isArray(data)) {\n return \"array\";\n }\n const obj = data;\n if (obj && Object.getPrototypeOf(obj) !== Object.prototype && \"constructor\" in obj && obj.constructor) {\n return obj.constructor.name;\n }\n }\n }\n return t;\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n let binaryString = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binaryString += String.fromCharCode(bytes[i]);\n }\n return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n const cleanHex = hex.replace(/^0x/, \"\");\n if (cleanHex.length % 2 !== 0) {\n throw new Error(\"Invalid hex string length\");\n }\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < cleanHex.length; i += 2) {\n bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod,\n enumerable: false,\n });\n Object.defineProperty(inst, \"issues\", {\n value: def,\n enumerable: false,\n });\n inst.message = JSON.stringify(def, util.jsonStringifyReplacer, 2);\n Object.defineProperty(inst, \"toString\", {\n value: () => inst.message,\n enumerable: false,\n });\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, { Parent: Error });\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues });\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues });\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a, _b;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, issue.path));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_b = curr.items)[el] ?? (_b[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n const segs = [];\n const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n","import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\nexport const _parse = (_Err) => (schema, value, _ctx, _params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, _params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length\n ? {\n success: false,\n error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length\n ? {\n success: false,\n error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\nexport const _encode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parse(_Err)(schema, value, ctx);\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => (schema, value, _ctx) => {\n return _parse(_Err)(schema, value, _ctx);\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parseAsync(_Err)(schema, value, ctx);\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _parseAsync(_Err)(schema, value, _ctx);\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParse(_Err)(schema, value, ctx);\n};\nexport const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);\nexport const _safeDecode = (_Err) => (schema, value, _ctx) => {\n return _safeParse(_Err)(schema, value, _ctx);\n};\nexport const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);\nexport const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParseAsync(_Err)(schema, value, ctx);\n};\nexport const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);\nexport const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _safeParseAsync(_Err)(schema, value, _ctx);\n};\nexport const safeDecodeAsync = /* @__PURE__*/ _safeDecodeAsync(errors.$ZodRealError);\n","import * as util from \"./util.js\";\nexport const cuid = /^[cC][^\\s-]{8,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 9562/4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const idnEmail = unicodeEmail;\nexport const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emoji = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;\nexport const mac = (delimiter) => {\n const escapedDelim = util.escapeRegex(delimiter ?? \":\");\n return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);\n};\nexport const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const hostname = /^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/;\nexport const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)\n// E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15\nexport const e164 = /^\\+[1-9]\\d{6,14}$/;\n// const dateSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateSource = `(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`;\nexport const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);\nfunction timeSource(args) {\n const hhmm = `(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;\n const regex = typeof args.precision === \"number\"\n ? args.precision === -1\n ? `${hhmm}`\n : args.precision === 0\n ? `${hhmm}:[0-5]\\\\d`\n : `${hhmm}:[0-5]\\\\d\\\\.\\\\d{${args.precision}}`\n : `${hhmm}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`;\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n const time = timeSource({ precision: args.precision });\n const opts = [\"Z\"];\n if (args.local)\n opts.push(\"\");\n // if (args.offset) opts.push(`([+-]\\\\d{2}:\\\\d{2})`);\n if (args.offset)\n opts.push(`([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)`);\n const timeRegex = `${time}(?:${opts.join(\"|\")})`;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^-?\\d+n?$/;\nexport const integer = /^-?\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?$/;\nexport const boolean = /^(?:true|false)$/i;\nconst _null = /^null$/i;\nexport { _null as null };\nconst _undefined = /^undefined$/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n// regex for hexadecimal strings (any length)\nexport const hex = /^[0-9a-fA-F]*$/;\n// Hash regexes for different algorithms and encodings\n// Helper function to create base64 regex with exact length and padding\nfunction fixedBase64(bodyLength, padding) {\n return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);\n}\n// Helper function to create base64url regex with exact length (no padding)\nfunction fixedBase64url(length) {\n return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);\n}\n// MD5 (16 bytes): base64 = 24 chars total (22 + \"==\")\nexport const md5_hex = /^[0-9a-fA-F]{32}$/;\nexport const md5_base64 = /*@__PURE__*/ fixedBase64(22, \"==\");\nexport const md5_base64url = /*@__PURE__*/ fixedBase64url(22);\n// SHA1 (20 bytes): base64 = 28 chars total (27 + \"=\")\nexport const sha1_hex = /^[0-9a-fA-F]{40}$/;\nexport const sha1_base64 = /*@__PURE__*/ fixedBase64(27, \"=\");\nexport const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);\n// SHA256 (32 bytes): base64 = 44 chars total (43 + \"=\")\nexport const sha256_hex = /^[0-9a-fA-F]{64}$/;\nexport const sha256_base64 = /*@__PURE__*/ fixedBase64(43, \"=\");\nexport const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);\n// SHA384 (48 bytes): base64 = 64 chars total (no padding)\nexport const sha384_hex = /^[0-9a-fA-F]{96}$/;\nexport const sha384_base64 = /*@__PURE__*/ fixedBase64(64, \"\");\nexport const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);\n// SHA512 (64 bytes): base64 = 88 chars total (86 + \"==\")\nexport const sha512_hex = /^[0-9a-fA-F]{128}$/;\nexport const sha512_base64 = /*@__PURE__*/ fixedBase64(86, \"==\");\nexport const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);\n","// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n var _a;\n inst._zod ?? (inst._zod = {});\n inst._zod.def = def;\n (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\nconst numericOriginMap = {\n number: \"number\",\n bigint: \"bigint\",\n object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;\n if (def.value < curr) {\n if (def.inclusive)\n bag.maximum = def.value;\n else\n bag.exclusiveMaximum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n return;\n }\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;\n if (def.value > curr) {\n if (def.inclusive)\n bag.minimum = def.value;\n else\n bag.exclusiveMinimum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n return;\n }\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n var _a;\n (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);\n });\n inst._zod.check = (payload) => {\n if (typeof payload.value !== typeof def.value)\n throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n const isMultiple = typeof payload.value === \"bigint\"\n ? payload.value % def.value === BigInt(0)\n : util.floatSafeRemainder(payload.value, def.value) === 0;\n if (isMultiple)\n return;\n payload.issues.push({\n origin: typeof payload.value,\n code: \"not_multiple_of\",\n divisor: def.value,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n def.format = def.format || \"float64\";\n const isInt = def.format?.includes(\"int\");\n const origin = isInt ? \"int\" : \"number\";\n const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n if (isInt)\n bag.pattern = regexes.integer;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (isInt) {\n if (!Number.isInteger(input)) {\n // invalid_format issue\n // payload.issues.push({\n // expected: def.format,\n // format: def.format,\n // code: \"invalid_format\",\n // input,\n // inst,\n // });\n // invalid_type issue\n payload.issues.push({\n expected: origin,\n format: def.format,\n code: \"invalid_type\",\n continue: false,\n input,\n inst,\n });\n return;\n // not_multiple_of issue\n // payload.issues.push({\n // code: \"not_multiple_of\",\n // origin: \"number\",\n // input,\n // inst,\n // divisor: 1,\n // });\n }\n if (!Number.isSafeInteger(input)) {\n if (input > 0) {\n // too_big\n payload.issues.push({\n input,\n code: \"too_big\",\n maximum: Number.MAX_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n else {\n // too_small\n payload.issues.push({\n input,\n code: \"too_small\",\n minimum: Number.MIN_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n return;\n }\n }\n if (input < minimum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_small\",\n minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (input < minimum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size <= def.maximum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size >= def.minimum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.size;\n bag.maximum = def.size;\n bag.size = def.size;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size === def.size)\n return;\n const tooBig = size > def.size;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length <= def.maximum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length >= def.minimum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.length;\n bag.maximum = def.length;\n bag.length = def.length;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length === def.length)\n return;\n const origin = util.getLengthableOrigin(input);\n const tooBig = length > def.length;\n payload.issues.push({\n origin,\n ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n var _a, _b;\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n if (def.pattern) {\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(def.pattern);\n }\n });\n if (def.pattern)\n (_a = inst._zod).check ?? (_a.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n inst,\n continue: !def.abort,\n });\n });\n else\n (_b = inst._zod).check ?? (_b.check = () => { });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n $ZodCheckStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"regex\",\n input: payload.value,\n pattern: def.pattern.toString(),\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.lowercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.uppercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const escapedRegex = util.escapeRegex(def.includes);\n const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);\n def.pattern = pattern;\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.includes(def.includes, def.position))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"includes\",\n includes: def.includes,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.startsWith(def.prefix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"starts_with\",\n prefix: def.prefix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.endsWith(def.suffix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"ends_with\",\n suffix: def.suffix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n///////////////////////////////////\n///// $ZodCheckProperty /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(property, result.issues));\n }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n const result = def.schema._zod.run({\n value: payload.value[def.property],\n issues: [],\n }, {});\n if (result instanceof Promise) {\n return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n }\n handleCheckPropertyResult(result, payload, def.property);\n return;\n };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const mimeSet = new Set(def.mime);\n inst._zod.onattach.push((inst) => {\n inst._zod.bag.mime = def.mime;\n });\n inst._zod.check = (payload) => {\n if (mimeSet.has(payload.value.type))\n return;\n payload.issues.push({\n code: \"invalid_value\",\n values: def.mime,\n input: payload.value.type,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n payload.value = def.tx(payload.value);\n };\n});\n","export class Doc {\n constructor(args = []) {\n this.content = [];\n this.indent = 0;\n if (this)\n this.args = args;\n }\n indented(fn) {\n this.indent += 1;\n fn(this);\n this.indent -= 1;\n }\n write(arg) {\n if (typeof arg === \"function\") {\n arg(this, { execution: \"sync\" });\n arg(this, { execution: \"async\" });\n return;\n }\n const content = arg;\n const lines = content.split(\"\\n\").filter((x) => x);\n const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));\n const dedented = lines.map((x) => x.slice(minIndent)).map((x) => \" \".repeat(this.indent * 2) + x);\n for (const line of dedented) {\n this.content.push(line);\n }\n }\n compile() {\n const F = Function;\n const args = this?.args;\n const content = this?.content ?? [``];\n const lines = [...content.map((x) => ` ${x}`)];\n // console.log(lines.join(\"\\n\"));\n return new F(...args, lines.join(\"\\n\"));\n }\n}\n","export const version = {\n major: 4,\n minor: 3,\n patch: 6,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync, safeParse, safeParseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n var _a;\n inst ?? (inst = {});\n inst._zod.def = def; // set _def property\n inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n inst._zod.version = version;\n const checks = [...(inst._zod.def.checks ?? [])];\n // if inst is itself a checks.$ZodCheck, run it as a check\n if (inst._zod.traits.has(\"$ZodCheck\")) {\n checks.unshift(inst);\n }\n for (const ch of checks) {\n for (const fn of ch._zod.onattach) {\n fn(inst);\n }\n }\n if (checks.length === 0) {\n // deferred initializer\n // inst._zod.parse is not yet defined\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred?.push(() => {\n inst._zod.run = inst._zod.parse;\n });\n }\n else {\n const runChecks = (payload, checks, ctx) => {\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.def.when) {\n const shouldRun = ch._zod.def.when(payload);\n if (!shouldRun)\n continue;\n }\n else if (isAborted) {\n continue;\n }\n const currLen = payload.issues.length;\n const _ = ch._zod.check(payload);\n if (_ instanceof Promise && ctx?.async === false) {\n throw new core.$ZodAsyncError();\n }\n if (asyncResult || _ instanceof Promise) {\n asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n await _;\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n return;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n });\n }\n else {\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n continue;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n }\n }\n if (asyncResult) {\n return asyncResult.then(() => {\n return payload;\n });\n }\n return payload;\n };\n const handleCanaryResult = (canary, payload, ctx) => {\n // abort if the canary is aborted\n if (util.aborted(canary)) {\n canary.aborted = true;\n return canary;\n }\n // run checks first, then\n const checkResult = runChecks(payload, checks, ctx);\n if (checkResult instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));\n }\n return inst._zod.parse(checkResult, ctx);\n };\n inst._zod.run = (payload, ctx) => {\n if (ctx.skipChecks) {\n return inst._zod.parse(payload, ctx);\n }\n if (ctx.direction === \"backward\") {\n // run canary\n // initial pass (no checks)\n const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });\n if (canary instanceof Promise) {\n return canary.then((canary) => {\n return handleCanaryResult(canary, payload, ctx);\n });\n }\n return handleCanaryResult(canary, payload, ctx);\n }\n // forward\n const result = inst._zod.parse(payload, ctx);\n if (result instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return result.then((result) => runChecks(result, checks, ctx));\n }\n return runChecks(result, checks, ctx);\n };\n }\n // Lazy initialize ~standard to avoid creating objects for every schema\n util.defineLazy(inst, \"~standard\", () => ({\n validate: (value) => {\n try {\n const r = safeParse(inst, value);\n return r.success ? { value: r.data } : { issues: r.error?.issues };\n }\n catch (_) {\n return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));\n }\n },\n vendor: \"zod\",\n version: 1,\n }));\n});\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);\n inst._zod.parse = (payload, _) => {\n if (def.coerce)\n try {\n payload.value = String(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"string\")\n return payload;\n payload.issues.push({\n expected: \"string\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n // check initialization must come first\n checks.$ZodCheckStringFormat.init(inst, def);\n $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.guid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n if (def.version) {\n const versionMap = {\n v1: 1,\n v2: 2,\n v3: 3,\n v4: 4,\n v5: 5,\n v6: 6,\n v7: 7,\n v8: 8,\n };\n const v = versionMap[def.version];\n if (v === undefined)\n throw new Error(`Invalid UUID version: \"${def.version}\"`);\n def.pattern ?? (def.pattern = regexes.uuid(v));\n }\n else\n def.pattern ?? (def.pattern = regexes.uuid());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.email);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n try {\n // Trim whitespace from input\n const trimmed = payload.value.trim();\n // @ts-ignore\n const url = new URL(trimmed);\n if (def.hostname) {\n def.hostname.lastIndex = 0;\n if (!def.hostname.test(url.hostname)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid hostname\",\n pattern: def.hostname.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n if (def.protocol) {\n def.protocol.lastIndex = 0;\n if (!def.protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid protocol\",\n pattern: def.protocol.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n // Set the output value based on normalize flag\n if (def.normalize) {\n // Use normalized URL\n payload.value = url.href;\n }\n else {\n // Preserve the original input (trimmed)\n payload.value = trimmed;\n }\n return;\n }\n catch (_) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.emoji());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.nanoid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid2);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ulid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.xid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ksuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.datetime(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.date);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.time(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.duration);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv4);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv4`;\n});\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv6);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv6`;\n inst._zod.check = (payload) => {\n try {\n // @ts-ignore\n new URL(`http://[${payload.value}]`);\n // return;\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"ipv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodMAC = /*@__PURE__*/ core.$constructor(\"$ZodMAC\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.mac(def.delimiter));\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `mac`;\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n const parts = payload.value.split(\"/\");\n try {\n if (parts.length !== 2)\n throw new Error();\n const [address, prefix] = parts;\n if (!prefix)\n throw new Error();\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n throw new Error();\n if (prefixNum < 0 || prefixNum > 128)\n throw new Error();\n // @ts-ignore\n new URL(`http://[${address}]`);\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"cidrv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64(data) {\n if (data === \"\")\n return true;\n if (data.length % 4 !== 0)\n return false;\n try {\n // @ts-ignore\n atob(data);\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64\";\n inst._zod.check = (payload) => {\n if (isValidBase64(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64URL(data) {\n if (!regexes.base64url.test(data))\n return false;\n const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64url);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64url\";\n inst._zod.check = (payload) => {\n if (isValidBase64URL(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.e164);\n $ZodStringFormat.init(inst, def);\n});\n////////////////////////////// ZodJWT //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n try {\n const tokensParts = token.split(\".\");\n if (tokensParts.length !== 3)\n return false;\n const [header] = tokensParts;\n if (!header)\n return false;\n // @ts-ignore\n const parsedHeader = JSON.parse(atob(header));\n if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n return false;\n if (!parsedHeader.alg)\n return false;\n if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidJWT(payload.value, def.alg))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"jwt\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCustomStringFormat\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (def.fn(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Number(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n return payload;\n }\n const received = typeof input === \"number\"\n ? Number.isNaN(input)\n ? \"NaN\"\n : !Number.isFinite(input)\n ? \"Infinity\"\n : undefined\n : undefined;\n payload.issues.push({\n expected: \"number\",\n code: \"invalid_type\",\n input,\n inst,\n ...(received ? { received } : {}),\n });\n return payload;\n };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumberFormat\", (inst, def) => {\n checks.$ZodCheckNumberFormat.init(inst, def);\n $ZodNumber.init(inst, def); // no format checks\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.boolean;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Boolean(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"boolean\")\n return payload;\n payload.issues.push({\n expected: \"boolean\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.bigint;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = BigInt(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"bigint\")\n return payload;\n payload.issues.push({\n expected: \"bigint\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigIntFormat\", (inst, def) => {\n checks.$ZodCheckBigIntFormat.init(inst, def);\n $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"symbol\")\n return payload;\n payload.issues.push({\n expected: \"symbol\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.undefined;\n inst._zod.values = new Set([undefined]);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"undefined\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.null;\n inst._zod.values = new Set([null]);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (input === null)\n return payload;\n payload.issues.push({\n expected: \"null\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.issues.push({\n expected: \"never\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"void\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce) {\n try {\n payload.value = new Date(payload.value);\n }\n catch (_err) { }\n }\n const input = payload.value;\n const isDate = input instanceof Date;\n const isValidDate = isDate && !Number.isNaN(input.getTime());\n if (isValidDate)\n return payload;\n payload.issues.push({\n expected: \"date\",\n code: \"invalid_type\",\n input,\n ...(isDate ? { received: \"Invalid Date\" } : {}),\n inst,\n });\n return payload;\n };\n});\nfunction handleArrayResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n expected: \"array\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = Array(input.length);\n const proms = [];\n for (let i = 0; i < input.length; i++) {\n const item = input[i];\n const result = def.element._zod.run({\n value: item,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n }\n else {\n handleArrayResult(result, payload, i);\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n});\nfunction handlePropertyResult(result, final, key, input, isOptionalOut) {\n if (result.issues.length) {\n // For optional-out schemas, ignore errors on absent keys\n if (isOptionalOut && !(key in input)) {\n return;\n }\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n if (result.value === undefined) {\n if (key in input) {\n final.value[key] = undefined;\n }\n }\n else {\n final.value[key] = result.value;\n }\n}\nfunction normalizeDef(def) {\n const keys = Object.keys(def.shape);\n for (const k of keys) {\n if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n throw new Error(`Invalid element at key \"${k}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n ...def,\n keys,\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst) {\n const unrecognized = [];\n // iterate over input keys\n const keySet = def.keySet;\n const _catchall = def.catchall._zod;\n const t = _catchall.def.type;\n const isOptionalOut = _catchall.optout === \"optional\";\n for (const key in input) {\n if (keySet.has(key))\n continue;\n if (t === \"never\") {\n unrecognized.push(key);\n continue;\n }\n const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalOut);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n });\n }\n if (!proms.length)\n return payload;\n return Promise.all(proms).then(() => {\n return payload;\n });\n}\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodType.init(inst, def);\n // const sh = def.shape;\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n if (!desc?.get) {\n const sh = def.shape;\n Object.defineProperty(def, \"shape\", {\n get: () => {\n const newSh = { ...sh };\n Object.defineProperty(def, \"shape\", {\n value: newSh,\n });\n return newSh;\n },\n });\n }\n const _normalized = util.cached(() => normalizeDef(def));\n util.defineLazy(inst._zod, \"propValues\", () => {\n const shape = def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n propValues[key] ?? (propValues[key] = new Set());\n for (const v of field.values)\n propValues[key].add(v);\n }\n }\n return propValues;\n });\n const isObject = util.isObject;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = {};\n const proms = [];\n const shape = value.shape;\n for (const key of value.keys) {\n const el = shape[key];\n const isOptionalOut = el._zod.optout === \"optional\";\n const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalOut);\n }\n }\n if (!catchall) {\n return proms.length ? Promise.all(proms).then(() => payload) : payload;\n }\n return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);\n };\n});\nexport const $ZodObjectJIT = /*@__PURE__*/ core.$constructor(\"$ZodObjectJIT\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodObject.init(inst, def);\n const superParse = inst._zod.parse;\n const _normalized = util.cached(() => normalizeDef(def));\n const generateFastpass = (shape) => {\n const doc = new Doc([\"shape\", \"payload\", \"ctx\"]);\n const normalized = _normalized.value;\n const parseStr = (key) => {\n const k = util.esc(key);\n return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n };\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n let counter = 0;\n for (const key of normalized.keys) {\n ids[key] = `key_${counter++}`;\n }\n // A: preserve key order {\n doc.write(`const newResult = {};`);\n for (const key of normalized.keys) {\n const id = ids[key];\n const k = util.esc(key);\n const schema = shape[key];\n const isOptionalOut = schema?._zod?.optout === \"optional\";\n doc.write(`const ${id} = ${parseStr(key)};`);\n if (isOptionalOut) {\n // For optional-out schemas, ignore errors on absent keys\n doc.write(`\n if (${id}.issues.length) {\n if (${k} in input) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n else {\n doc.write(`\n if (${id}.issues.length) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n const fn = doc.compile();\n return (payload, ctx) => fn(shape, payload, ctx);\n };\n let fastpass;\n const isObject = util.isObject;\n const jit = !core.globalConfig.jitless;\n const allowsEval = util.allowsEval;\n const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n // always synchronous\n if (!fastpass)\n fastpass = generateFastpass(def.shape);\n payload = fastpass(payload, ctx);\n if (!catchall)\n return payload;\n return handleCatchall([], input, payload, ctx, value, inst);\n }\n return superParse(payload, ctx);\n };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n for (const result of results) {\n if (result.issues.length === 0) {\n final.value = result.value;\n return final;\n }\n }\n const nonaborted = results.filter((r) => !util.aborted(r));\n if (nonaborted.length === 1) {\n final.value = nonaborted[0].value;\n return nonaborted[0];\n }\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.options.some((o) => o._zod.optin === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"optout\", () => def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"values\", () => {\n if (def.options.every((o) => o._zod.values)) {\n return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n if (def.options.every((o) => o._zod.pattern)) {\n const patterns = def.options.map((o) => o._zod.pattern);\n return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n }\n return undefined;\n });\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n if (result.issues.length === 0)\n return result;\n results.push(result);\n }\n }\n if (!async)\n return handleUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleUnionResults(results, payload, inst, ctx);\n });\n };\n});\nfunction handleExclusiveUnionResults(results, final, inst, ctx) {\n const successes = results.filter((r) => r.issues.length === 0);\n if (successes.length === 1) {\n final.value = successes[0].value;\n return final;\n }\n if (successes.length === 0) {\n // No matches - same as regular union\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n }\n else {\n // Multiple matches - exclusive union failure\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: [],\n inclusive: false,\n });\n }\n return final;\n}\nexport const $ZodXor = /*@__PURE__*/ core.$constructor(\"$ZodXor\", (inst, def) => {\n $ZodUnion.init(inst, def);\n def.inclusive = false;\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n results.push(result);\n }\n }\n if (!async)\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n });\n };\n});\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n def.inclusive = false;\n $ZodUnion.init(inst, def);\n const _super = inst._zod.parse;\n util.defineLazy(inst._zod, \"propValues\", () => {\n const propValues = {};\n for (const option of def.options) {\n const pv = option._zod.propValues;\n if (!pv || Object.keys(pv).length === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const [k, v] of Object.entries(pv)) {\n if (!propValues[k])\n propValues[k] = new Set();\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n return propValues;\n });\n const disc = util.cached(() => {\n const opts = def.options;\n const map = new Map();\n for (const o of opts) {\n const values = o._zod.propValues?.[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(o)}\"`);\n for (const v of values) {\n if (map.has(v)) {\n throw new Error(`Duplicate discriminator value \"${String(v)}\"`);\n }\n map.set(v, o);\n }\n }\n return map;\n });\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isObject(input)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"object\",\n input,\n inst,\n });\n return payload;\n }\n const opt = disc.value.get(input?.[def.discriminator]);\n if (opt) {\n return opt._zod.run(payload, ctx);\n }\n if (def.unionFallback) {\n return _super(payload, ctx);\n }\n // no matching discriminator\n payload.issues.push({\n code: \"invalid_union\",\n errors: [],\n note: \"No matching discriminator\",\n discriminator: def.discriminator,\n input,\n path: [def.discriminator],\n inst,\n });\n return payload;\n };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n const async = left instanceof Promise || right instanceof Promise;\n if (async) {\n return Promise.all([left, right]).then(([left, right]) => {\n return handleIntersectionResults(payload, left, right);\n });\n }\n return handleIntersectionResults(payload, left, right);\n };\n});\nfunction mergeValues(a, b) {\n // const aType = parse.t(a);\n // const bType = parse.t(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n if (a instanceof Date && b instanceof Date && +a === +b) {\n return { valid: true, data: a };\n }\n if (util.isPlainObject(a) && util.isPlainObject(b)) {\n const bKeys = Object.keys(b);\n const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return { valid: false, mergeErrorPath: [] };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n // Track which side(s) report each key as unrecognized\n const unrecKeys = new Map();\n let unrecIssue;\n for (const iss of left.issues) {\n if (iss.code === \"unrecognized_keys\") {\n unrecIssue ?? (unrecIssue = iss);\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).l = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n for (const iss of right.issues) {\n if (iss.code === \"unrecognized_keys\") {\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).r = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n // Report only keys unrecognized by BOTH sides\n const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);\n if (bothKeys.length && unrecIssue) {\n result.issues.push({ ...unrecIssue, keys: bothKeys });\n }\n if (util.aborted(result))\n return result;\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n }\n result.value = merged.data;\n return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n $ZodType.init(inst, def);\n const items = def.items;\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n input,\n inst,\n expected: \"tuple\",\n code: \"invalid_type\",\n });\n return payload;\n }\n payload.value = [];\n const proms = [];\n const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== \"optional\");\n const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;\n if (!def.rest) {\n const tooBig = input.length > items.length;\n const tooSmall = input.length < optStart - 1;\n if (tooBig || tooSmall) {\n payload.issues.push({\n ...(tooBig\n ? { code: \"too_big\", maximum: items.length, inclusive: true }\n : { code: \"too_small\", minimum: items.length }),\n input,\n inst,\n origin: \"array\",\n });\n return payload;\n }\n }\n let i = -1;\n for (const item of items) {\n i++;\n if (i >= input.length)\n if (i >= optStart)\n continue;\n const result = item._zod.run({\n value: input[i],\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n if (def.rest) {\n const rest = input.slice(items.length);\n for (const el of rest) {\n i++;\n const result = def.rest._zod.run({\n value: el,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleTupleResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isPlainObject(input)) {\n payload.issues.push({\n expected: \"record\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n const values = def.keyType._zod.values;\n if (values) {\n payload.value = {};\n const recordKeys = new Set();\n for (const key of values) {\n if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n recordKeys.add(typeof key === \"number\" ? key.toString() : key);\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!recordKeys.has(key)) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n });\n }\n }\n else {\n payload.value = {};\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n // Numeric string fallback: if key is a numeric string and failed, retry with Number(key)\n // This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals\n const checkNumericKey = typeof key === \"string\" && regexes.number.test(key) && keyResult.issues.length;\n if (checkNumericKey) {\n const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);\n if (retryResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (retryResult.issues.length === 0) {\n keyResult = retryResult;\n }\n }\n if (keyResult.issues.length) {\n if (def.mode === \"loose\") {\n // Pass through unchanged\n payload.value[key] = input[key];\n }\n else {\n // Default \"strict\" behavior: error on invalid key\n payload.issues.push({\n code: \"invalid_key\",\n origin: \"record\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n }\n continue;\n }\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload;\n };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Map)) {\n payload.issues.push({\n expected: \"map\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n payload.value = new Map();\n for (const [key, value] of input) {\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n if (keyResult instanceof Promise || valueResult instanceof Promise) {\n proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }));\n }\n else {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n if (keyResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, keyResult.issues));\n }\n else {\n final.issues.push({\n code: \"invalid_key\",\n origin: \"map\",\n input,\n inst,\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n if (valueResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, valueResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_element\",\n input,\n inst,\n key: key,\n issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Set)) {\n payload.issues.push({\n input,\n inst,\n expected: \"set\",\n code: \"invalid_type\",\n });\n return payload;\n }\n const proms = [];\n payload.value = new Set();\n for (const item of input) {\n const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleSetResult(result, payload)));\n }\n else\n handleSetResult(result, payload);\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleSetResult(result, final) {\n if (result.issues.length) {\n final.issues.push(...result.issues);\n }\n final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = util.getEnumValues(def.entries);\n const valuesSet = new Set(values);\n inst._zod.values = valuesSet;\n inst._zod.pattern = new RegExp(`^(${values\n .filter((k) => util.propertyKeyTypes.has(typeof k))\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o.toString()))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (valuesSet.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n if (def.values.length === 0) {\n throw new Error(\"Cannot create literal schema with no valid values\");\n }\n const values = new Set(def.values);\n inst._zod.values = values;\n inst._zod.pattern = new RegExp(`^(${def.values\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values: def.values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n // @ts-ignore\n if (input instanceof File)\n return payload;\n payload.issues.push({\n expected: \"file\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n const _out = def.transform(payload.value, payload);\n if (ctx.async) {\n const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n if (_out instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n payload.value = _out;\n return payload;\n };\n});\nfunction handleOptionalResult(result, input) {\n if (result.issues.length && input === undefined) {\n return { issues: [], value: undefined };\n }\n return result;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (def.innerType._zod.optin === \"optional\") {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise)\n return result.then((r) => handleOptionalResult(r, payload.value));\n return handleOptionalResult(result, payload.value);\n }\n if (payload.value === undefined) {\n return payload;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodExactOptional = /*@__PURE__*/ core.$constructor(\"$ZodExactOptional\", (inst, def) => {\n // Call parent init - inherits optin/optout = \"optional\"\n $ZodOptional.init(inst, def);\n // Override values/pattern to NOT add undefined\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"pattern\", () => def.innerType._zod.pattern);\n // Override parse to just delegate (no undefined handling)\n inst._zod.parse = (payload, ctx) => {\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n // Forward direction (decode): allow null to pass through\n if (payload.value === null)\n return payload;\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n $ZodType.init(inst, def);\n // inst._zod.qin = \"true\";\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply defaults for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n /**\n * $ZodDefault returns the default value immediately in forward direction.\n * 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. */\n return payload;\n }\n // Forward direction: continue with default handling\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleDefaultResult(result, def));\n }\n return handleDefaultResult(result, def);\n };\n});\nfunction handleDefaultResult(payload, def) {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply prefault for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n const v = def.innerType._zod.values;\n return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleNonOptionalResult(result, inst));\n }\n return handleNonOptionalResult(result, inst);\n };\n});\nfunction handleNonOptionalResult(payload, inst) {\n if (!payload.issues.length && payload.value === undefined) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: payload.value,\n inst,\n });\n }\n return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(\"ZodSuccess\");\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.issues.length === 0;\n return payload;\n });\n }\n payload.value = result.issues.length === 0;\n return payload;\n };\n});\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply catch logic\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n });\n }\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"nan\",\n code: \"invalid_type\",\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handlePipeResult(right, def.in, ctx));\n }\n return handlePipeResult(right, def.in, ctx);\n }\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handlePipeResult(left, def.out, ctx));\n }\n return handlePipeResult(left, def.out, ctx);\n };\n});\nfunction handlePipeResult(left, next, ctx) {\n if (left.issues.length) {\n // prevent further checks\n left.aborted = true;\n return left;\n }\n return next._zod.run({ value: left.value, issues: left.issues }, ctx);\n}\nexport const $ZodCodec = /*@__PURE__*/ core.$constructor(\"$ZodCodec\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handleCodecAResult(left, def, ctx));\n }\n return handleCodecAResult(left, def, ctx);\n }\n else {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handleCodecAResult(right, def, ctx));\n }\n return handleCodecAResult(right, def, ctx);\n }\n };\n});\nfunction handleCodecAResult(result, def, ctx) {\n if (result.issues.length) {\n // prevent further checks\n result.aborted = true;\n return result;\n }\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const transformed = def.transform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));\n }\n return handleCodecTxResult(result, transformed, def.out, ctx);\n }\n else {\n const transformed = def.reverseTransform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));\n }\n return handleCodecTxResult(result, transformed, def.in, ctx);\n }\n}\nfunction handleCodecTxResult(left, value, nextSchema, ctx) {\n // Check if transform added any issues\n if (left.issues.length) {\n left.aborted = true;\n return left;\n }\n return nextSchema._zod.run({ value, issues: left.issues }, ctx);\n}\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"propValues\", () => def.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType?._zod?.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType?._zod?.optout);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then(handleReadonlyResult);\n }\n return handleReadonlyResult(result);\n };\n});\nfunction handleReadonlyResult(payload) {\n payload.value = Object.freeze(payload.value);\n return payload;\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const regexParts = [];\n for (const part of def.parts) {\n if (typeof part === \"object\" && part !== null) {\n // is Zod schema\n if (!part._zod.pattern) {\n // if (!source)\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;\n if (!source)\n throw new Error(`Invalid template literal part: ${part._zod.traits}`);\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n regexParts.push(source.slice(start, end));\n }\n else if (part === null || util.primitiveTypes.has(typeof part)) {\n regexParts.push(util.escapeRegex(`${part}`));\n }\n else {\n throw new Error(`Invalid template literal part: ${part}`);\n }\n }\n inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"string\") {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"string\",\n code: \"invalid_type\",\n });\n return payload;\n }\n inst._zod.pattern.lastIndex = 0;\n if (!inst._zod.pattern.test(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n code: \"invalid_format\",\n format: def.format ?? \"template_literal\",\n pattern: inst._zod.pattern.source,\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodFunction = /*@__PURE__*/ core.$constructor(\"$ZodFunction\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._def = def;\n inst._zod.def = def;\n inst.implement = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implement() must be called with a function\");\n }\n return function (...args) {\n const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;\n const result = Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return parse(inst._def.output, result);\n }\n return result;\n };\n };\n inst.implementAsync = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implementAsync() must be called with a function\");\n }\n return async function (...args) {\n const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;\n const result = await Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return await parseAsync(inst._def.output, result);\n }\n return result;\n };\n };\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"function\") {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"function\",\n input: payload.value,\n inst,\n });\n return payload;\n }\n // Check if output is a promise type to determine if we should use async implementation\n const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === \"promise\";\n if (hasPromiseOutput) {\n payload.value = inst.implementAsync(payload.value);\n }\n else {\n payload.value = inst.implement(payload.value);\n }\n return payload;\n };\n inst.input = (...args) => {\n const F = inst.constructor;\n if (Array.isArray(args[0])) {\n return new F({\n type: \"function\",\n input: new $ZodTuple({\n type: \"tuple\",\n items: args[0],\n rest: args[1],\n }),\n output: inst._def.output,\n });\n }\n return new F({\n type: \"function\",\n input: args[0],\n output: inst._def.output,\n });\n };\n inst.output = (output) => {\n const F = inst.constructor;\n return new F({\n type: \"function\",\n input: inst._def.input,\n output,\n });\n };\n return inst;\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n $ZodType.init(inst, def);\n // let _innerType!: any;\n // util.defineLazy(def, \"getter\", () => {\n // if (!_innerType) {\n // _innerType = def.getter();\n // }\n // return () => _innerType;\n // });\n util.defineLazy(inst._zod, \"innerType\", () => def.getter());\n util.defineLazy(inst._zod, \"pattern\", () => inst._zod.innerType?._zod?.pattern);\n util.defineLazy(inst._zod, \"propValues\", () => inst._zod.innerType?._zod?.propValues);\n util.defineLazy(inst._zod, \"optin\", () => inst._zod.innerType?._zod?.optin ?? undefined);\n util.defineLazy(inst._zod, \"optout\", () => inst._zod.innerType?._zod?.optout ?? undefined);\n inst._zod.parse = (payload, ctx) => {\n const inner = inst._zod.innerType;\n return inner._zod.run(payload, ctx);\n };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n checks.$ZodCheck.init(inst, def);\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _) => {\n return payload;\n };\n inst._zod.check = (payload) => {\n const input = payload.value;\n const r = def.fn(input);\n if (r instanceof Promise) {\n return r.then((r) => handleRefineResult(r, payload, input, inst));\n }\n handleRefineResult(r, payload, input, inst);\n return;\n };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n if (!result) {\n const _iss = {\n code: \"custom\",\n input,\n inst, // incorporates params.error into issue reporting\n path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n continue: !inst._zod.def.abort,\n // params: inst._zod.def.params,\n };\n if (inst._zod.def.params)\n _iss.params = inst._zod.def.params;\n payload.issues.push(util.issue(_iss));\n }\n}\n","var _a;\nexport const $output = Symbol(\"ZodOutput\");\nexport const $input = Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n constructor() {\n this._map = new WeakMap();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n clear() {\n this._map = new WeakMap();\n this._idmap = new Map();\n return this;\n }\n remove(schema) {\n const meta = this._map.get(schema);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.delete(meta.id);\n }\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n const f = { ...pm, ...this._map.get(schema) };\n return Object.keys(f).length ? f : undefined;\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nexport function registry() {\n return new $ZodRegistry();\n}\n(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());\nexport const globalRegistry = globalThis.__zod_globalRegistry;\n","import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mac(Class, params) {\n return new Class({\n type: \"string\",\n format: \"mac\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport const TimePrecision = {\n Any: null,\n Minute: -1,\n Second: 0,\n Millisecond: 3,\n Microsecond: 6,\n};\n// @__NO_SIDE_EFFECTS__\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\n// @__NO_SIDE_EFFECTS__\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\n// @__NO_SIDE_EFFECTS__\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\n// @__NO_SIDE_EFFECTS__\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\n// @__NO_SIDE_EFFECTS__\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\n// @__NO_SIDE_EFFECTS__\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\n// @__NO_SIDE_EFFECTS__\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\n// @__NO_SIDE_EFFECTS__\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\n// @__NO_SIDE_EFFECTS__\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\n// @__NO_SIDE_EFFECTS__\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\n// slugify\n// @__NO_SIDE_EFFECTS__\nexport function _slugify() {\n return _overwrite((input) => util.slugify(input));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _xor(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\n// @__NO_SIDE_EFFECTS__\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// same as _custom but defaults to abort:false\n// @__NO_SIDE_EFFECTS__\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _superRefine(fn) {\n const ch = _check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _check(fn, params) {\n const ch = new checks.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function describe(description) {\n const ch = new checks.$ZodCheck({ check: \"describe\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, description });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function meta(metadata) {\n const ch = new checks.$ZodCheck({ check: \"meta\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, ...metadata });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringbool(Classes, _params) {\n const params = util.normalizeParams(_params);\n let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n if (params.case !== \"sensitive\") {\n truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n }\n const truthySet = new Set(truthyArray);\n const falsySet = new Set(falsyArray);\n const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _String = Classes.String ?? schemas.$ZodString;\n const stringSchema = new _String({ type: \"string\", error: params.error });\n const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n const codec = new _Codec({\n type: \"pipe\",\n in: stringSchema,\n out: booleanSchema,\n transform: ((input, payload) => {\n let data = input;\n if (params.case !== \"sensitive\")\n data = data.toLowerCase();\n if (truthySet.has(data)) {\n return true;\n }\n else if (falsySet.has(data)) {\n return false;\n }\n else {\n payload.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...truthySet, ...falsySet],\n input: payload.value,\n inst: codec,\n continue: false,\n });\n return {};\n }\n }),\n reverseTransform: ((input, _payload) => {\n if (input === true) {\n return truthyArray[0] || \"true\";\n }\n else {\n return falsyArray[0] || \"false\";\n }\n }),\n error: params.error,\n });\n return codec;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n const params = util.normalizeParams(_params);\n const def = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n const inst = new Class(def);\n return inst;\n}\n","import { globalRegistry } from \"./registries.js\";\n// function initializeContext<T extends schemas.$ZodType>(inputs: JSONSchemaGeneratorParams<T>): ToJSONSchemaContext<T> {\n// return {\n// processor: inputs.processor,\n// metadataRegistry: inputs.metadata ?? globalRegistry,\n// target: inputs.target ?? \"draft-2020-12\",\n// unrepresentable: inputs.unrepresentable ?? \"throw\",\n// };\n// }\nexport function initializeContext(params) {\n // Normalize target: convert old non-hyphenated versions to hyphenated versions\n let target = params?.target ?? \"draft-2020-12\";\n if (target === \"draft-4\")\n target = \"draft-04\";\n if (target === \"draft-7\")\n target = \"draft-07\";\n return {\n processors: params.processors ?? {},\n metadataRegistry: params?.metadata ?? globalRegistry,\n target,\n unrepresentable: params?.unrepresentable ?? \"throw\",\n override: params?.override ?? (() => { }),\n io: params?.io ?? \"output\",\n counter: 0,\n seen: new Map(),\n cycles: params?.cycles ?? \"ref\",\n reused: params?.reused ?? \"inline\",\n external: params?.external ?? undefined,\n };\n}\nexport function process(schema, ctx, _params = { path: [], schemaPath: [] }) {\n var _a;\n const def = schema._zod.def;\n // check for schema in seens\n const seen = ctx.seen.get(schema);\n if (seen) {\n seen.count++;\n // check if cycle\n const isCycle = _params.schemaPath.includes(schema);\n if (isCycle) {\n seen.cycle = _params.path;\n }\n return seen.schema;\n }\n // initialize\n const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };\n ctx.seen.set(schema, result);\n // custom method overrides default behavior\n const overrideSchema = schema._zod.toJSONSchema?.();\n if (overrideSchema) {\n result.schema = overrideSchema;\n }\n else {\n const params = {\n ..._params,\n schemaPath: [..._params.schemaPath, schema],\n path: _params.path,\n };\n if (schema._zod.processJSONSchema) {\n schema._zod.processJSONSchema(ctx, result.schema, params);\n }\n else {\n const _json = result.schema;\n const processor = ctx.processors[def.type];\n if (!processor) {\n throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);\n }\n processor(schema, ctx, _json, params);\n }\n const parent = schema._zod.parent;\n if (parent) {\n // Also set ref if processor didn't (for inheritance)\n if (!result.ref)\n result.ref = parent;\n process(parent, ctx, params);\n ctx.seen.get(parent).isParent = true;\n }\n }\n // metadata\n const meta = ctx.metadataRegistry.get(schema);\n if (meta)\n Object.assign(result.schema, meta);\n if (ctx.io === \"input\" && isTransforming(schema)) {\n // examples/defaults only apply to output type of pipe\n delete result.schema.examples;\n delete result.schema.default;\n }\n // set prefault as default\n if (ctx.io === \"input\" && result.schema._prefault)\n (_a = result.schema).default ?? (_a.default = result.schema._prefault);\n delete result.schema._prefault;\n // pulling fresh from ctx.seen in case it was overwritten\n const _result = ctx.seen.get(schema);\n return _result.schema;\n}\nexport function extractDefs(ctx, schema\n// params: EmitParams\n) {\n // iterate over seen map;\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // Track ids to detect duplicates across different schemas\n const idToSchema = new Map();\n for (const entry of ctx.seen.entries()) {\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n const existing = idToSchema.get(id);\n if (existing && existing !== entry[0]) {\n throw new Error(`Duplicate schema id \"${id}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);\n }\n idToSchema.set(id, entry[0]);\n }\n }\n // returns a ref to the schema\n // defId will be empty if the ref points to an external schema (or #)\n const makeURI = (entry) => {\n // comparing the seen objects because sometimes\n // multiple schemas map to the same seen object.\n // e.g. lazy\n // external is configured\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n if (ctx.external) {\n const externalId = ctx.external.registry.get(entry[0])?.id; // ?? \"__shared\";// `__schema${ctx.counter++}`;\n // check if schema is in the external registry\n const uriGenerator = ctx.external.uri ?? ((id) => id);\n if (externalId) {\n return { ref: uriGenerator(externalId) };\n }\n // otherwise, add to __shared\n const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;\n entry[1].defId = id; // set defId so it will be reused if needed\n return { defId: id, ref: `${uriGenerator(\"__shared\")}#/${defsSegment}/${id}` };\n }\n if (entry[1] === root) {\n return { ref: \"#\" };\n }\n // self-contained schema\n const uriPrefix = `#`;\n const defUriPrefix = `${uriPrefix}/${defsSegment}/`;\n const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;\n return { defId, ref: defUriPrefix + defId };\n };\n // stored cached version in `def` property\n // remove all properties, set $ref\n const extractToDef = (entry) => {\n // if the schema is already a reference, do not extract it\n if (entry[1].schema.$ref) {\n return;\n }\n const seen = entry[1];\n const { ref, defId } = makeURI(entry);\n seen.def = { ...seen.schema };\n // defId won't be set if the schema is a reference to an external schema\n // or if the schema is the root schema\n if (defId)\n seen.defId = defId;\n // wipe away all properties except $ref\n const schema = seen.schema;\n for (const key in schema) {\n delete schema[key];\n }\n schema.$ref = ref;\n };\n // throw on cycles\n // break cycles\n if (ctx.cycles === \"throw\") {\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.cycle) {\n throw new Error(\"Cycle detected: \" +\n `#/${seen.cycle?.join(\"/\")}/<root>` +\n '\\n\\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.');\n }\n }\n }\n // extract schemas into $defs\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n // convert root schema to # $ref\n if (schema === entry[0]) {\n extractToDef(entry); // this has special handling for the root schema\n continue;\n }\n // extract schemas that are in the external registry\n if (ctx.external) {\n const ext = ctx.external.registry.get(entry[0])?.id;\n if (schema !== entry[0] && ext) {\n extractToDef(entry);\n continue;\n }\n }\n // extract schemas with `id` meta\n const id = ctx.metadataRegistry.get(entry[0])?.id;\n if (id) {\n extractToDef(entry);\n continue;\n }\n // break cycles\n if (seen.cycle) {\n // any\n extractToDef(entry);\n continue;\n }\n // extract reused schemas\n if (seen.count > 1) {\n if (ctx.reused === \"ref\") {\n extractToDef(entry);\n // biome-ignore lint:\n continue;\n }\n }\n }\n}\nexport function finalize(ctx, schema) {\n const root = ctx.seen.get(schema);\n if (!root)\n throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n // flatten refs - inherit properties from parent schemas\n const flattenRef = (zodSchema) => {\n const seen = ctx.seen.get(zodSchema);\n // already processed\n if (seen.ref === null)\n return;\n const schema = seen.def ?? seen.schema;\n const _cached = { ...schema };\n const ref = seen.ref;\n seen.ref = null; // prevent infinite recursion\n if (ref) {\n flattenRef(ref);\n const refSeen = ctx.seen.get(ref);\n const refSchema = refSeen.schema;\n // merge referenced schema into current\n if (refSchema.$ref && (ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\")) {\n // older drafts can't combine $ref with other properties\n schema.allOf = schema.allOf ?? [];\n schema.allOf.push(refSchema);\n }\n else {\n Object.assign(schema, refSchema);\n }\n // restore child's own properties (child wins)\n Object.assign(schema, _cached);\n const isParentRef = zodSchema._zod.parent === ref;\n // For parent chain, child is a refinement - remove parent-only properties\n if (isParentRef) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (!(key in _cached)) {\n delete schema[key];\n }\n }\n }\n // When ref was extracted to $defs, remove properties that match the definition\n if (refSchema.$ref && refSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n // If parent was extracted (has $ref), propagate $ref to this schema\n // This handles cases like: readonly().meta({id}).describe()\n // where processor sets ref to innerType but parent should be referenced\n const parent = zodSchema._zod.parent;\n if (parent && parent !== ref) {\n // Ensure parent is processed first so its def has inherited properties\n flattenRef(parent);\n const parentSeen = ctx.seen.get(parent);\n if (parentSeen?.schema.$ref) {\n schema.$ref = parentSeen.schema.$ref;\n // De-duplicate with parent's definition\n if (parentSeen.def) {\n for (const key in schema) {\n if (key === \"$ref\" || key === \"allOf\")\n continue;\n if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) {\n delete schema[key];\n }\n }\n }\n }\n }\n // execute overrides\n ctx.override({\n zodSchema: zodSchema,\n jsonSchema: schema,\n path: seen.path ?? [],\n });\n };\n for (const entry of [...ctx.seen.entries()].reverse()) {\n flattenRef(entry[0]);\n }\n const result = {};\n if (ctx.target === \"draft-2020-12\") {\n result.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n }\n else if (ctx.target === \"draft-07\") {\n result.$schema = \"http://json-schema.org/draft-07/schema#\";\n }\n else if (ctx.target === \"draft-04\") {\n result.$schema = \"http://json-schema.org/draft-04/schema#\";\n }\n else if (ctx.target === \"openapi-3.0\") {\n // OpenAPI 3.0 schema objects should not include a $schema property\n }\n else {\n // Arbitrary string values are allowed but won't have a $schema property set\n }\n if (ctx.external?.uri) {\n const id = ctx.external.registry.get(schema)?.id;\n if (!id)\n throw new Error(\"Schema is missing an `id` property\");\n result.$id = ctx.external.uri(id);\n }\n Object.assign(result, root.def ?? root.schema);\n // build defs object\n const defs = ctx.external?.defs ?? {};\n for (const entry of ctx.seen.entries()) {\n const seen = entry[1];\n if (seen.def && seen.defId) {\n defs[seen.defId] = seen.def;\n }\n }\n // set definitions in result\n if (ctx.external) {\n }\n else {\n if (Object.keys(defs).length > 0) {\n if (ctx.target === \"draft-2020-12\") {\n result.$defs = defs;\n }\n else {\n result.definitions = defs;\n }\n }\n }\n try {\n // this \"finalizes\" this schema and ensures all cycles are removed\n // each call to finalize() is functionally independent\n // though the seen map is shared\n const finalized = JSON.parse(JSON.stringify(result));\n Object.defineProperty(finalized, \"~standard\", {\n value: {\n ...schema[\"~standard\"],\n jsonSchema: {\n input: createStandardJSONSchemaMethod(schema, \"input\", ctx.processors),\n output: createStandardJSONSchemaMethod(schema, \"output\", ctx.processors),\n },\n },\n enumerable: false,\n writable: false,\n });\n return finalized;\n }\n catch (_err) {\n throw new Error(\"Error converting schema to JSON.\");\n }\n}\nfunction isTransforming(_schema, _ctx) {\n const ctx = _ctx ?? { seen: new Set() };\n if (ctx.seen.has(_schema))\n return false;\n ctx.seen.add(_schema);\n const def = _schema._zod.def;\n if (def.type === \"transform\")\n return true;\n if (def.type === \"array\")\n return isTransforming(def.element, ctx);\n if (def.type === \"set\")\n return isTransforming(def.valueType, ctx);\n if (def.type === \"lazy\")\n return isTransforming(def.getter(), ctx);\n if (def.type === \"promise\" ||\n def.type === \"optional\" ||\n def.type === \"nonoptional\" ||\n def.type === \"nullable\" ||\n def.type === \"readonly\" ||\n def.type === \"default\" ||\n def.type === \"prefault\") {\n return isTransforming(def.innerType, ctx);\n }\n if (def.type === \"intersection\") {\n return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);\n }\n if (def.type === \"record\" || def.type === \"map\") {\n return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);\n }\n if (def.type === \"pipe\") {\n return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);\n }\n if (def.type === \"object\") {\n for (const key in def.shape) {\n if (isTransforming(def.shape[key], ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"union\") {\n for (const option of def.options) {\n if (isTransforming(option, ctx))\n return true;\n }\n return false;\n }\n if (def.type === \"tuple\") {\n for (const item of def.items) {\n if (isTransforming(item, ctx))\n return true;\n }\n if (def.rest && isTransforming(def.rest, ctx))\n return true;\n return false;\n }\n return false;\n}\n/**\n * Creates a toJSONSchema method for a schema instance.\n * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.\n */\nexport const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {\n const ctx = initializeContext({ ...params, processors });\n process(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\nexport const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {\n const { libraryOptions, target } = params ?? {};\n const ctx = initializeContext({ ...(libraryOptions ?? {}), target, io, processors });\n process(schema, ctx);\n extractDefs(ctx, schema);\n return finalize(ctx, schema);\n};\n","import { extractDefs, finalize, initializeContext, process, } from \"./to-json-schema.js\";\nimport { getEnumValues } from \"./util.js\";\nconst formatMap = {\n guid: \"uuid\",\n url: \"uri\",\n datetime: \"date-time\",\n json_string: \"json-string\",\n regex: \"\", // do not set\n};\n// ==================== SIMPLE TYPE PROCESSORS ====================\nexport const stringProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n json.type = \"string\";\n const { minimum, maximum, format, patterns, contentEncoding } = schema._zod\n .bag;\n if (typeof minimum === \"number\")\n json.minLength = minimum;\n if (typeof maximum === \"number\")\n json.maxLength = maximum;\n // custom pattern overrides format\n if (format) {\n json.format = formatMap[format] ?? format;\n if (json.format === \"\")\n delete json.format; // empty format is not valid\n // JSON Schema format: \"time\" requires a full time with offset or Z\n // z.iso.time() does not include timezone information, so format: \"time\" should never be used\n if (format === \"time\") {\n delete json.format;\n }\n }\n if (contentEncoding)\n json.contentEncoding = contentEncoding;\n if (patterns && patterns.size > 0) {\n const regexes = [...patterns];\n if (regexes.length === 1)\n json.pattern = regexes[0].source;\n else if (regexes.length > 1) {\n json.allOf = [\n ...regexes.map((regex) => ({\n ...(ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\"\n ? { type: \"string\" }\n : {}),\n pattern: regex.source,\n })),\n ];\n }\n }\n};\nexport const numberProcessor = (schema, ctx, _json, _params) => {\n const json = _json;\n const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;\n if (typeof format === \"string\" && format.includes(\"int\"))\n json.type = \"integer\";\n else\n json.type = \"number\";\n if (typeof exclusiveMinimum === \"number\") {\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.minimum = exclusiveMinimum;\n json.exclusiveMinimum = true;\n }\n else {\n json.exclusiveMinimum = exclusiveMinimum;\n }\n }\n if (typeof minimum === \"number\") {\n json.minimum = minimum;\n if (typeof exclusiveMinimum === \"number\" && ctx.target !== \"draft-04\") {\n if (exclusiveMinimum >= minimum)\n delete json.minimum;\n else\n delete json.exclusiveMinimum;\n }\n }\n if (typeof exclusiveMaximum === \"number\") {\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.maximum = exclusiveMaximum;\n json.exclusiveMaximum = true;\n }\n else {\n json.exclusiveMaximum = exclusiveMaximum;\n }\n }\n if (typeof maximum === \"number\") {\n json.maximum = maximum;\n if (typeof exclusiveMaximum === \"number\" && ctx.target !== \"draft-04\") {\n if (exclusiveMaximum <= maximum)\n delete json.maximum;\n else\n delete json.exclusiveMaximum;\n }\n }\n if (typeof multipleOf === \"number\")\n json.multipleOf = multipleOf;\n};\nexport const booleanProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const bigintProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"BigInt cannot be represented in JSON Schema\");\n }\n};\nexport const symbolProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Symbols cannot be represented in JSON Schema\");\n }\n};\nexport const nullProcessor = (_schema, ctx, json, _params) => {\n if (ctx.target === \"openapi-3.0\") {\n json.type = \"string\";\n json.nullable = true;\n json.enum = [null];\n }\n else {\n json.type = \"null\";\n }\n};\nexport const undefinedProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Undefined cannot be represented in JSON Schema\");\n }\n};\nexport const voidProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Void cannot be represented in JSON Schema\");\n }\n};\nexport const neverProcessor = (_schema, _ctx, json, _params) => {\n json.not = {};\n};\nexport const anyProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const unknownProcessor = (_schema, _ctx, _json, _params) => {\n // empty schema accepts anything\n};\nexport const dateProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Date cannot be represented in JSON Schema\");\n }\n};\nexport const enumProcessor = (schema, _ctx, json, _params) => {\n const def = schema._zod.def;\n const values = getEnumValues(def.entries);\n // Number enums can have both string and number values\n if (values.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (values.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n json.enum = values;\n};\nexport const literalProcessor = (schema, ctx, json, _params) => {\n const def = schema._zod.def;\n const vals = [];\n for (const val of def.values) {\n if (val === undefined) {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Literal `undefined` cannot be represented in JSON Schema\");\n }\n else {\n // do not add to vals\n }\n }\n else if (typeof val === \"bigint\") {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"BigInt literals cannot be represented in JSON Schema\");\n }\n else {\n vals.push(Number(val));\n }\n }\n else {\n vals.push(val);\n }\n }\n if (vals.length === 0) {\n // do nothing (an undefined literal was stripped)\n }\n else if (vals.length === 1) {\n const val = vals[0];\n json.type = val === null ? \"null\" : typeof val;\n if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n json.enum = [val];\n }\n else {\n json.const = val;\n }\n }\n else {\n if (vals.every((v) => typeof v === \"number\"))\n json.type = \"number\";\n if (vals.every((v) => typeof v === \"string\"))\n json.type = \"string\";\n if (vals.every((v) => typeof v === \"boolean\"))\n json.type = \"boolean\";\n if (vals.every((v) => v === null))\n json.type = \"null\";\n json.enum = vals;\n }\n};\nexport const nanProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"NaN cannot be represented in JSON Schema\");\n }\n};\nexport const templateLiteralProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const pattern = schema._zod.pattern;\n if (!pattern)\n throw new Error(\"Pattern not found in template literal\");\n _json.type = \"string\";\n _json.pattern = pattern.source;\n};\nexport const fileProcessor = (schema, _ctx, json, _params) => {\n const _json = json;\n const file = {\n type: \"string\",\n format: \"binary\",\n contentEncoding: \"binary\",\n };\n const { minimum, maximum, mime } = schema._zod.bag;\n if (minimum !== undefined)\n file.minLength = minimum;\n if (maximum !== undefined)\n file.maxLength = maximum;\n if (mime) {\n if (mime.length === 1) {\n file.contentMediaType = mime[0];\n Object.assign(_json, file);\n }\n else {\n Object.assign(_json, file); // shared props at root\n _json.anyOf = mime.map((m) => ({ contentMediaType: m })); // only contentMediaType differs\n }\n }\n else {\n Object.assign(_json, file);\n }\n};\nexport const successProcessor = (_schema, _ctx, json, _params) => {\n json.type = \"boolean\";\n};\nexport const customProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Custom types cannot be represented in JSON Schema\");\n }\n};\nexport const functionProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Function types cannot be represented in JSON Schema\");\n }\n};\nexport const transformProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Transforms cannot be represented in JSON Schema\");\n }\n};\nexport const mapProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Map cannot be represented in JSON Schema\");\n }\n};\nexport const setProcessor = (_schema, ctx, _json, _params) => {\n if (ctx.unrepresentable === \"throw\") {\n throw new Error(\"Set cannot be represented in JSON Schema\");\n }\n};\n// ==================== COMPOSITE TYPE PROCESSORS ====================\nexport const arrayProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n const { minimum, maximum } = schema._zod.bag;\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n json.type = \"array\";\n json.items = process(def.element, ctx, { ...params, path: [...params.path, \"items\"] });\n};\nexport const objectProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n json.properties = {};\n const shape = def.shape;\n for (const key in shape) {\n json.properties[key] = process(shape[key], ctx, {\n ...params,\n path: [...params.path, \"properties\", key],\n });\n }\n // required keys\n const allKeys = new Set(Object.keys(shape));\n const requiredKeys = new Set([...allKeys].filter((key) => {\n const v = def.shape[key]._zod;\n if (ctx.io === \"input\") {\n return v.optin === undefined;\n }\n else {\n return v.optout === undefined;\n }\n }));\n if (requiredKeys.size > 0) {\n json.required = Array.from(requiredKeys);\n }\n // catchall\n if (def.catchall?._zod.def.type === \"never\") {\n // strict\n json.additionalProperties = false;\n }\n else if (!def.catchall) {\n // regular\n if (ctx.io === \"output\")\n json.additionalProperties = false;\n }\n else if (def.catchall) {\n json.additionalProperties = process(def.catchall, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n};\nexport const unionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n // Exclusive unions (inclusive === false) use oneOf (exactly one match) instead of anyOf (one or more matches)\n // This includes both z.xor() and discriminated unions\n const isExclusive = def.inclusive === false;\n const options = def.options.map((x, i) => process(x, ctx, {\n ...params,\n path: [...params.path, isExclusive ? \"oneOf\" : \"anyOf\", i],\n }));\n if (isExclusive) {\n json.oneOf = options;\n }\n else {\n json.anyOf = options;\n }\n};\nexport const intersectionProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const a = process(def.left, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 0],\n });\n const b = process(def.right, ctx, {\n ...params,\n path: [...params.path, \"allOf\", 1],\n });\n const isSimpleIntersection = (val) => \"allOf\" in val && Object.keys(val).length === 1;\n const allOf = [\n ...(isSimpleIntersection(a) ? a.allOf : [a]),\n ...(isSimpleIntersection(b) ? b.allOf : [b]),\n ];\n json.allOf = allOf;\n};\nexport const tupleProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"array\";\n const prefixPath = ctx.target === \"draft-2020-12\" ? \"prefixItems\" : \"items\";\n const restPath = ctx.target === \"draft-2020-12\" ? \"items\" : ctx.target === \"openapi-3.0\" ? \"items\" : \"additionalItems\";\n const prefixItems = def.items.map((x, i) => process(x, ctx, {\n ...params,\n path: [...params.path, prefixPath, i],\n }));\n const rest = def.rest\n ? process(def.rest, ctx, {\n ...params,\n path: [...params.path, restPath, ...(ctx.target === \"openapi-3.0\" ? [def.items.length] : [])],\n })\n : null;\n if (ctx.target === \"draft-2020-12\") {\n json.prefixItems = prefixItems;\n if (rest) {\n json.items = rest;\n }\n }\n else if (ctx.target === \"openapi-3.0\") {\n json.items = {\n anyOf: prefixItems,\n };\n if (rest) {\n json.items.anyOf.push(rest);\n }\n json.minItems = prefixItems.length;\n if (!rest) {\n json.maxItems = prefixItems.length;\n }\n }\n else {\n json.items = prefixItems;\n if (rest) {\n json.additionalItems = rest;\n }\n }\n // length\n const { minimum, maximum } = schema._zod.bag;\n if (typeof minimum === \"number\")\n json.minItems = minimum;\n if (typeof maximum === \"number\")\n json.maxItems = maximum;\n};\nexport const recordProcessor = (schema, ctx, _json, params) => {\n const json = _json;\n const def = schema._zod.def;\n json.type = \"object\";\n // For looseRecord with regex patterns, use patternProperties\n // This correctly represents \"only validate keys matching the pattern\" semantics\n // and composes well with allOf (intersections)\n const keyType = def.keyType;\n const keyBag = keyType._zod.bag;\n const patterns = keyBag?.patterns;\n if (def.mode === \"loose\" && patterns && patterns.size > 0) {\n // Use patternProperties for looseRecord with regex patterns\n const valueSchema = process(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"patternProperties\", \"*\"],\n });\n json.patternProperties = {};\n for (const pattern of patterns) {\n json.patternProperties[pattern.source] = valueSchema;\n }\n }\n else {\n // Default behavior: use propertyNames + additionalProperties\n if (ctx.target === \"draft-07\" || ctx.target === \"draft-2020-12\") {\n json.propertyNames = process(def.keyType, ctx, {\n ...params,\n path: [...params.path, \"propertyNames\"],\n });\n }\n json.additionalProperties = process(def.valueType, ctx, {\n ...params,\n path: [...params.path, \"additionalProperties\"],\n });\n }\n // Add required for keys with discrete values (enum, literal, etc.)\n const keyValues = keyType._zod.values;\n if (keyValues) {\n const validKeyValues = [...keyValues].filter((v) => typeof v === \"string\" || typeof v === \"number\");\n if (validKeyValues.length > 0) {\n json.required = validKeyValues;\n }\n }\n};\nexport const nullableProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n const inner = process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n if (ctx.target === \"openapi-3.0\") {\n seen.ref = def.innerType;\n json.nullable = true;\n }\n else {\n json.anyOf = [inner, { type: \"null\" }];\n }\n};\nexport const nonoptionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const defaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.default = JSON.parse(JSON.stringify(def.defaultValue));\n};\nexport const prefaultProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n if (ctx.io === \"input\")\n json._prefault = JSON.parse(JSON.stringify(def.defaultValue));\n};\nexport const catchProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n let catchValue;\n try {\n catchValue = def.catchValue(undefined);\n }\n catch {\n throw new Error(\"Dynamic catch values are not supported in JSON Schema\");\n }\n json.default = catchValue;\n};\nexport const pipeProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n const innerType = ctx.io === \"input\" ? (def.in._zod.def.type === \"transform\" ? def.out : def.in) : def.out;\n process(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\nexport const readonlyProcessor = (schema, ctx, json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n json.readOnly = true;\n};\nexport const promiseProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const optionalProcessor = (schema, ctx, _json, params) => {\n const def = schema._zod.def;\n process(def.innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = def.innerType;\n};\nexport const lazyProcessor = (schema, ctx, _json, params) => {\n const innerType = schema._zod.innerType;\n process(innerType, ctx, params);\n const seen = ctx.seen.get(schema);\n seen.ref = innerType;\n};\n// ==================== ALL PROCESSORS ====================\nexport const allProcessors = {\n string: stringProcessor,\n number: numberProcessor,\n boolean: booleanProcessor,\n bigint: bigintProcessor,\n symbol: symbolProcessor,\n null: nullProcessor,\n undefined: undefinedProcessor,\n void: voidProcessor,\n never: neverProcessor,\n any: anyProcessor,\n unknown: unknownProcessor,\n date: dateProcessor,\n enum: enumProcessor,\n literal: literalProcessor,\n nan: nanProcessor,\n template_literal: templateLiteralProcessor,\n file: fileProcessor,\n success: successProcessor,\n custom: customProcessor,\n function: functionProcessor,\n transform: transformProcessor,\n map: mapProcessor,\n set: setProcessor,\n array: arrayProcessor,\n object: objectProcessor,\n union: unionProcessor,\n intersection: intersectionProcessor,\n tuple: tupleProcessor,\n record: recordProcessor,\n nullable: nullableProcessor,\n nonoptional: nonoptionalProcessor,\n default: defaultProcessor,\n prefault: prefaultProcessor,\n catch: catchProcessor,\n pipe: pipeProcessor,\n readonly: readonlyProcessor,\n promise: promiseProcessor,\n optional: optionalProcessor,\n lazy: lazyProcessor,\n};\nexport function toJSONSchema(input, params) {\n if (\"_idmap\" in input) {\n // Registry case\n const registry = input;\n const ctx = initializeContext({ ...params, processors: allProcessors });\n const defs = {};\n // First pass: process all schemas to build the seen map\n for (const entry of registry._idmap.entries()) {\n const [_, schema] = entry;\n process(schema, ctx);\n }\n const schemas = {};\n const external = {\n registry,\n uri: params?.uri,\n defs,\n };\n // Update the context with external configuration\n ctx.external = external;\n // Second pass: emit each schema\n for (const entry of registry._idmap.entries()) {\n const [key, schema] = entry;\n extractDefs(ctx, schema);\n schemas[key] = finalize(ctx, schema);\n }\n if (Object.keys(defs).length > 0) {\n const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n schemas.__shared = {\n [defsSegment]: defs,\n };\n }\n return { schemas };\n }\n // Single schema case\n const ctx = initializeContext({ ...params, processors: allProcessors });\n process(input, ctx);\n extractDefs(ctx, input);\n return finalize(ctx, input);\n}\n","import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport const ZodISODateTime = /*@__PURE__*/ core.$constructor(\"ZodISODateTime\", (inst, def) => {\n core.$ZodISODateTime.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function datetime(params) {\n return core._isoDateTime(ZodISODateTime, params);\n}\nexport const ZodISODate = /*@__PURE__*/ core.$constructor(\"ZodISODate\", (inst, def) => {\n core.$ZodISODate.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function date(params) {\n return core._isoDate(ZodISODate, params);\n}\nexport const ZodISOTime = /*@__PURE__*/ core.$constructor(\"ZodISOTime\", (inst, def) => {\n core.$ZodISOTime.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function time(params) {\n return core._isoTime(ZodISOTime, params);\n}\nexport const ZodISODuration = /*@__PURE__*/ core.$constructor(\"ZodISODuration\", (inst, def) => {\n core.$ZodISODuration.init(inst, def);\n schemas.ZodStringFormat.init(inst, def);\n});\nexport function duration(params) {\n return core._isoDuration(ZodISODuration, params);\n}\n","import * as core from \"../core/index.js\";\nimport { $ZodError } from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\nconst initializer = (inst, issues) => {\n $ZodError.init(inst, issues);\n inst.name = \"ZodError\";\n Object.defineProperties(inst, {\n format: {\n value: (mapper) => core.formatError(inst, mapper),\n // enumerable: false,\n },\n flatten: {\n value: (mapper) => core.flattenError(inst, mapper),\n // enumerable: false,\n },\n addIssue: {\n value: (issue) => {\n inst.issues.push(issue);\n inst.message = JSON.stringify(inst.issues, util.jsonStringifyReplacer, 2);\n },\n // enumerable: false,\n },\n addIssues: {\n value: (issues) => {\n inst.issues.push(...issues);\n inst.message = JSON.stringify(inst.issues, util.jsonStringifyReplacer, 2);\n },\n // enumerable: false,\n },\n isEmpty: {\n get() {\n return inst.issues.length === 0;\n },\n // enumerable: false,\n },\n });\n // Object.defineProperty(inst, \"isEmpty\", {\n // get() {\n // return inst.issues.length === 0;\n // },\n // });\n};\nexport const ZodError = core.$constructor(\"ZodError\", initializer);\nexport const ZodRealError = core.$constructor(\"ZodError\", initializer, {\n Parent: Error,\n});\n// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */\n// export type ErrorMapCtx = core.$ZodErrorMapCtx;\n","import * as core from \"../core/index.js\";\nimport { ZodRealError } from \"./errors.js\";\nexport const parse = /* @__PURE__ */ core._parse(ZodRealError);\nexport const parseAsync = /* @__PURE__ */ core._parseAsync(ZodRealError);\nexport const safeParse = /* @__PURE__ */ core._safeParse(ZodRealError);\nexport const safeParseAsync = /* @__PURE__ */ core._safeParseAsync(ZodRealError);\n// Codec functions\nexport const encode = /* @__PURE__ */ core._encode(ZodRealError);\nexport const decode = /* @__PURE__ */ core._decode(ZodRealError);\nexport const encodeAsync = /* @__PURE__ */ core._encodeAsync(ZodRealError);\nexport const decodeAsync = /* @__PURE__ */ core._decodeAsync(ZodRealError);\nexport const safeEncode = /* @__PURE__ */ core._safeEncode(ZodRealError);\nexport const safeDecode = /* @__PURE__ */ core._safeDecode(ZodRealError);\nexport const safeEncodeAsync = /* @__PURE__ */ core._safeEncodeAsync(ZodRealError);\nexport const safeDecodeAsync = /* @__PURE__ */ core._safeDecodeAsync(ZodRealError);\n","import * as core from \"../core/index.js\";\nimport { util } from \"../core/index.js\";\nimport * as processors from \"../core/json-schema-processors.js\";\nimport { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from \"../core/to-json-schema.js\";\nimport * as checks from \"./checks.js\";\nimport * as iso from \"./iso.js\";\nimport * as parse from \"./parse.js\";\nexport const ZodType = /*@__PURE__*/ core.$constructor(\"ZodType\", (inst, def) => {\n core.$ZodType.init(inst, def);\n Object.assign(inst[\"~standard\"], {\n jsonSchema: {\n input: createStandardJSONSchemaMethod(inst, \"input\"),\n output: createStandardJSONSchemaMethod(inst, \"output\"),\n },\n });\n inst.toJSONSchema = createToJSONSchemaMethod(inst, {});\n inst.def = def;\n inst.type = def.type;\n Object.defineProperty(inst, \"_def\", { value: def });\n // base methods\n inst.check = (...checks) => {\n return inst.clone(util.mergeDefs(def, {\n checks: [\n ...(def.checks ?? []),\n ...checks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }), {\n parent: true,\n });\n };\n inst.with = inst.check;\n inst.clone = (def, params) => core.clone(inst, def, params);\n inst.brand = () => inst;\n inst.register = ((reg, meta) => {\n reg.add(inst, meta);\n return inst;\n });\n // parsing\n inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });\n inst.safeParse = (data, params) => parse.safeParse(inst, data, params);\n inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });\n inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);\n inst.spa = inst.safeParseAsync;\n // encoding/decoding\n inst.encode = (data, params) => parse.encode(inst, data, params);\n inst.decode = (data, params) => parse.decode(inst, data, params);\n inst.encodeAsync = async (data, params) => parse.encodeAsync(inst, data, params);\n inst.decodeAsync = async (data, params) => parse.decodeAsync(inst, data, params);\n inst.safeEncode = (data, params) => parse.safeEncode(inst, data, params);\n inst.safeDecode = (data, params) => parse.safeDecode(inst, data, params);\n inst.safeEncodeAsync = async (data, params) => parse.safeEncodeAsync(inst, data, params);\n inst.safeDecodeAsync = async (data, params) => parse.safeDecodeAsync(inst, data, params);\n // refinements\n inst.refine = (check, params) => inst.check(refine(check, params));\n inst.superRefine = (refinement) => inst.check(superRefine(refinement));\n inst.overwrite = (fn) => inst.check(checks.overwrite(fn));\n // wrappers\n inst.optional = () => optional(inst);\n inst.exactOptional = () => exactOptional(inst);\n inst.nullable = () => nullable(inst);\n inst.nullish = () => optional(nullable(inst));\n inst.nonoptional = (params) => nonoptional(inst, params);\n inst.array = () => array(inst);\n inst.or = (arg) => union([inst, arg]);\n inst.and = (arg) => intersection(inst, arg);\n inst.transform = (tx) => pipe(inst, transform(tx));\n inst.default = (def) => _default(inst, def);\n inst.prefault = (def) => prefault(inst, def);\n // inst.coalesce = (def, params) => coalesce(inst, def, params);\n inst.catch = (params) => _catch(inst, params);\n inst.pipe = (target) => pipe(inst, target);\n inst.readonly = () => readonly(inst);\n // meta\n inst.describe = (description) => {\n const cl = inst.clone();\n core.globalRegistry.add(cl, { description });\n return cl;\n };\n Object.defineProperty(inst, \"description\", {\n get() {\n return core.globalRegistry.get(inst)?.description;\n },\n configurable: true,\n });\n inst.meta = (...args) => {\n if (args.length === 0) {\n return core.globalRegistry.get(inst);\n }\n const cl = inst.clone();\n core.globalRegistry.add(cl, args[0]);\n return cl;\n };\n // helpers\n inst.isOptional = () => inst.safeParse(undefined).success;\n inst.isNullable = () => inst.safeParse(null).success;\n inst.apply = (fn) => fn(inst);\n return inst;\n});\n/** @internal */\nexport const _ZodString = /*@__PURE__*/ core.$constructor(\"_ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);\n const bag = inst._zod.bag;\n inst.format = bag.format ?? null;\n inst.minLength = bag.minimum ?? null;\n inst.maxLength = bag.maximum ?? null;\n // validations\n inst.regex = (...args) => inst.check(checks.regex(...args));\n inst.includes = (...args) => inst.check(checks.includes(...args));\n inst.startsWith = (...args) => inst.check(checks.startsWith(...args));\n inst.endsWith = (...args) => inst.check(checks.endsWith(...args));\n inst.min = (...args) => inst.check(checks.minLength(...args));\n inst.max = (...args) => inst.check(checks.maxLength(...args));\n inst.length = (...args) => inst.check(checks.length(...args));\n inst.nonempty = (...args) => inst.check(checks.minLength(1, ...args));\n inst.lowercase = (params) => inst.check(checks.lowercase(params));\n inst.uppercase = (params) => inst.check(checks.uppercase(params));\n // transforms\n inst.trim = () => inst.check(checks.trim());\n inst.normalize = (...args) => inst.check(checks.normalize(...args));\n inst.toLowerCase = () => inst.check(checks.toLowerCase());\n inst.toUpperCase = () => inst.check(checks.toUpperCase());\n inst.slugify = () => inst.check(checks.slugify());\n});\nexport const ZodString = /*@__PURE__*/ core.$constructor(\"ZodString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n _ZodString.init(inst, def);\n inst.email = (params) => inst.check(core._email(ZodEmail, params));\n inst.url = (params) => inst.check(core._url(ZodURL, params));\n inst.jwt = (params) => inst.check(core._jwt(ZodJWT, params));\n inst.emoji = (params) => inst.check(core._emoji(ZodEmoji, params));\n inst.guid = (params) => inst.check(core._guid(ZodGUID, params));\n inst.uuid = (params) => inst.check(core._uuid(ZodUUID, params));\n inst.uuidv4 = (params) => inst.check(core._uuidv4(ZodUUID, params));\n inst.uuidv6 = (params) => inst.check(core._uuidv6(ZodUUID, params));\n inst.uuidv7 = (params) => inst.check(core._uuidv7(ZodUUID, params));\n inst.nanoid = (params) => inst.check(core._nanoid(ZodNanoID, params));\n inst.guid = (params) => inst.check(core._guid(ZodGUID, params));\n inst.cuid = (params) => inst.check(core._cuid(ZodCUID, params));\n inst.cuid2 = (params) => inst.check(core._cuid2(ZodCUID2, params));\n inst.ulid = (params) => inst.check(core._ulid(ZodULID, params));\n inst.base64 = (params) => inst.check(core._base64(ZodBase64, params));\n inst.base64url = (params) => inst.check(core._base64url(ZodBase64URL, params));\n inst.xid = (params) => inst.check(core._xid(ZodXID, params));\n inst.ksuid = (params) => inst.check(core._ksuid(ZodKSUID, params));\n inst.ipv4 = (params) => inst.check(core._ipv4(ZodIPv4, params));\n inst.ipv6 = (params) => inst.check(core._ipv6(ZodIPv6, params));\n inst.cidrv4 = (params) => inst.check(core._cidrv4(ZodCIDRv4, params));\n inst.cidrv6 = (params) => inst.check(core._cidrv6(ZodCIDRv6, params));\n inst.e164 = (params) => inst.check(core._e164(ZodE164, params));\n // iso\n inst.datetime = (params) => inst.check(iso.datetime(params));\n inst.date = (params) => inst.check(iso.date(params));\n inst.time = (params) => inst.check(iso.time(params));\n inst.duration = (params) => inst.check(iso.duration(params));\n});\nexport function string(params) {\n return core._string(ZodString, params);\n}\nexport const ZodStringFormat = /*@__PURE__*/ core.$constructor(\"ZodStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n _ZodString.init(inst, def);\n});\nexport const ZodEmail = /*@__PURE__*/ core.$constructor(\"ZodEmail\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmail.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function email(params) {\n return core._email(ZodEmail, params);\n}\nexport const ZodGUID = /*@__PURE__*/ core.$constructor(\"ZodGUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodGUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function guid(params) {\n return core._guid(ZodGUID, params);\n}\nexport const ZodUUID = /*@__PURE__*/ core.$constructor(\"ZodUUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodUUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function uuid(params) {\n return core._uuid(ZodUUID, params);\n}\nexport function uuidv4(params) {\n return core._uuidv4(ZodUUID, params);\n}\n// ZodUUIDv6\nexport function uuidv6(params) {\n return core._uuidv6(ZodUUID, params);\n}\n// ZodUUIDv7\nexport function uuidv7(params) {\n return core._uuidv7(ZodUUID, params);\n}\nexport const ZodURL = /*@__PURE__*/ core.$constructor(\"ZodURL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodURL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function url(params) {\n return core._url(ZodURL, params);\n}\nexport function httpUrl(params) {\n return core._url(ZodURL, {\n protocol: /^https?$/,\n hostname: core.regexes.domain,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEmoji = /*@__PURE__*/ core.$constructor(\"ZodEmoji\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodEmoji.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function emoji(params) {\n return core._emoji(ZodEmoji, params);\n}\nexport const ZodNanoID = /*@__PURE__*/ core.$constructor(\"ZodNanoID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodNanoID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function nanoid(params) {\n return core._nanoid(ZodNanoID, params);\n}\nexport const ZodCUID = /*@__PURE__*/ core.$constructor(\"ZodCUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid(params) {\n return core._cuid(ZodCUID, params);\n}\nexport const ZodCUID2 = /*@__PURE__*/ core.$constructor(\"ZodCUID2\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCUID2.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cuid2(params) {\n return core._cuid2(ZodCUID2, params);\n}\nexport const ZodULID = /*@__PURE__*/ core.$constructor(\"ZodULID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodULID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ulid(params) {\n return core._ulid(ZodULID, params);\n}\nexport const ZodXID = /*@__PURE__*/ core.$constructor(\"ZodXID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodXID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function xid(params) {\n return core._xid(ZodXID, params);\n}\nexport const ZodKSUID = /*@__PURE__*/ core.$constructor(\"ZodKSUID\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodKSUID.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ksuid(params) {\n return core._ksuid(ZodKSUID, params);\n}\nexport const ZodIPv4 = /*@__PURE__*/ core.$constructor(\"ZodIPv4\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv4(params) {\n return core._ipv4(ZodIPv4, params);\n}\nexport const ZodMAC = /*@__PURE__*/ core.$constructor(\"ZodMAC\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodMAC.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function mac(params) {\n return core._mac(ZodMAC, params);\n}\nexport const ZodIPv6 = /*@__PURE__*/ core.$constructor(\"ZodIPv6\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodIPv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function ipv6(params) {\n return core._ipv6(ZodIPv6, params);\n}\nexport const ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv4(params) {\n return core._cidrv4(ZodCIDRv4, params);\n}\nexport const ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function cidrv6(params) {\n return core._cidrv6(ZodCIDRv6, params);\n}\nexport const ZodBase64 = /*@__PURE__*/ core.$constructor(\"ZodBase64\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64(params) {\n return core._base64(ZodBase64, params);\n}\nexport const ZodBase64URL = /*@__PURE__*/ core.$constructor(\"ZodBase64URL\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodBase64URL.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function base64url(params) {\n return core._base64url(ZodBase64URL, params);\n}\nexport const ZodE164 = /*@__PURE__*/ core.$constructor(\"ZodE164\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodE164.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function e164(params) {\n return core._e164(ZodE164, params);\n}\nexport const ZodJWT = /*@__PURE__*/ core.$constructor(\"ZodJWT\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodJWT.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function jwt(params) {\n return core._jwt(ZodJWT, params);\n}\nexport const ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodCustomStringFormat\", (inst, def) => {\n // ZodStringFormat.init(inst, def);\n core.$ZodCustomStringFormat.init(inst, def);\n ZodStringFormat.init(inst, def);\n});\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);\n}\nexport function hostname(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hostname\", core.regexes.hostname, _params);\n}\nexport function hex(_params) {\n return core._stringFormat(ZodCustomStringFormat, \"hex\", core.regexes.hex, _params);\n}\nexport function hash(alg, params) {\n const enc = params?.enc ?? \"hex\";\n const format = `${alg}_${enc}`;\n const regex = core.regexes[format];\n if (!regex)\n throw new Error(`Unrecognized hash format: ${format}`);\n return core._stringFormat(ZodCustomStringFormat, format, regex, params);\n}\nexport const ZodNumber = /*@__PURE__*/ core.$constructor(\"ZodNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);\n inst.gt = (value, params) => inst.check(checks.gt(value, params));\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.lt = (value, params) => inst.check(checks.lt(value, params));\n inst.lte = (value, params) => inst.check(checks.lte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n inst.int = (params) => inst.check(int(params));\n inst.safe = (params) => inst.check(int(params));\n inst.positive = (params) => inst.check(checks.gt(0, params));\n inst.nonnegative = (params) => inst.check(checks.gte(0, params));\n inst.negative = (params) => inst.check(checks.lt(0, params));\n inst.nonpositive = (params) => inst.check(checks.lte(0, params));\n inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));\n inst.step = (value, params) => inst.check(checks.multipleOf(value, params));\n // inst.finite = (params) => inst.check(core.finite(params));\n inst.finite = () => inst;\n const bag = inst._zod.bag;\n inst.minValue =\n Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;\n inst.maxValue =\n Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;\n inst.isInt = (bag.format ?? \"\").includes(\"int\") || Number.isSafeInteger(bag.multipleOf ?? 0.5);\n inst.isFinite = true;\n inst.format = bag.format ?? null;\n});\nexport function number(params) {\n return core._number(ZodNumber, params);\n}\nexport const ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodNumber.init(inst, def);\n});\nexport function int(params) {\n return core._int(ZodNumberFormat, params);\n}\nexport function float32(params) {\n return core._float32(ZodNumberFormat, params);\n}\nexport function float64(params) {\n return core._float64(ZodNumberFormat, params);\n}\nexport function int32(params) {\n return core._int32(ZodNumberFormat, params);\n}\nexport function uint32(params) {\n return core._uint32(ZodNumberFormat, params);\n}\nexport const ZodBoolean = /*@__PURE__*/ core.$constructor(\"ZodBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.booleanProcessor(inst, ctx, json, params);\n});\nexport function boolean(params) {\n return core._boolean(ZodBoolean, params);\n}\nexport const ZodBigInt = /*@__PURE__*/ core.$constructor(\"ZodBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.gt = (value, params) => inst.check(checks.gt(value, params));\n inst.gte = (value, params) => inst.check(checks.gte(value, params));\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.lt = (value, params) => inst.check(checks.lt(value, params));\n inst.lte = (value, params) => inst.check(checks.lte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n inst.positive = (params) => inst.check(checks.gt(BigInt(0), params));\n inst.negative = (params) => inst.check(checks.lt(BigInt(0), params));\n inst.nonpositive = (params) => inst.check(checks.lte(BigInt(0), params));\n inst.nonnegative = (params) => inst.check(checks.gte(BigInt(0), params));\n inst.multipleOf = (value, params) => inst.check(checks.multipleOf(value, params));\n const bag = inst._zod.bag;\n inst.minValue = bag.minimum ?? null;\n inst.maxValue = bag.maximum ?? null;\n inst.format = bag.format ?? null;\n});\nexport function bigint(params) {\n return core._bigint(ZodBigInt, params);\n}\nexport const ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodBigInt.init(inst, def);\n});\n// int64\nexport function int64(params) {\n return core._int64(ZodBigIntFormat, params);\n}\n// uint64\nexport function uint64(params) {\n return core._uint64(ZodBigIntFormat, params);\n}\nexport const ZodSymbol = /*@__PURE__*/ core.$constructor(\"ZodSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.symbolProcessor(inst, ctx, json, params);\n});\nexport function symbol(params) {\n return core._symbol(ZodSymbol, params);\n}\nexport const ZodUndefined = /*@__PURE__*/ core.$constructor(\"ZodUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.undefinedProcessor(inst, ctx, json, params);\n});\nfunction _undefined(params) {\n return core._undefined(ZodUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodNull = /*@__PURE__*/ core.$constructor(\"ZodNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullProcessor(inst, ctx, json, params);\n});\nfunction _null(params) {\n return core._null(ZodNull, params);\n}\nexport { _null as null };\nexport const ZodAny = /*@__PURE__*/ core.$constructor(\"ZodAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.anyProcessor(inst, ctx, json, params);\n});\nexport function any() {\n return core._any(ZodAny);\n}\nexport const ZodUnknown = /*@__PURE__*/ core.$constructor(\"ZodUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unknownProcessor(inst, ctx, json, params);\n});\nexport function unknown() {\n return core._unknown(ZodUnknown);\n}\nexport const ZodNever = /*@__PURE__*/ core.$constructor(\"ZodNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.neverProcessor(inst, ctx, json, params);\n});\nexport function never(params) {\n return core._never(ZodNever, params);\n}\nexport const ZodVoid = /*@__PURE__*/ core.$constructor(\"ZodVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.voidProcessor(inst, ctx, json, params);\n});\nfunction _void(params) {\n return core._void(ZodVoid, params);\n}\nexport { _void as void };\nexport const ZodDate = /*@__PURE__*/ core.$constructor(\"ZodDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);\n inst.min = (value, params) => inst.check(checks.gte(value, params));\n inst.max = (value, params) => inst.check(checks.lte(value, params));\n const c = inst._zod.bag;\n inst.minDate = c.minimum ? new Date(c.minimum) : null;\n inst.maxDate = c.maximum ? new Date(c.maximum) : null;\n});\nexport function date(params) {\n return core._date(ZodDate, params);\n}\nexport const ZodArray = /*@__PURE__*/ core.$constructor(\"ZodArray\", (inst, def) => {\n core.$ZodArray.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);\n inst.element = def.element;\n inst.min = (minLength, params) => inst.check(checks.minLength(minLength, params));\n inst.nonempty = (params) => inst.check(checks.minLength(1, params));\n inst.max = (maxLength, params) => inst.check(checks.maxLength(maxLength, params));\n inst.length = (len, params) => inst.check(checks.length(len, params));\n inst.unwrap = () => inst.element;\n});\nexport function array(element, params) {\n return core._array(ZodArray, element, params);\n}\n// .keyof\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return _enum(Object.keys(shape));\n}\nexport const ZodObject = /*@__PURE__*/ core.$constructor(\"ZodObject\", (inst, def) => {\n core.$ZodObjectJIT.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);\n util.defineLazy(inst, \"shape\", () => {\n return def.shape;\n });\n inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));\n inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall: catchall });\n inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });\n inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });\n inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });\n inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });\n inst.extend = (incoming) => {\n return util.extend(inst, incoming);\n };\n inst.safeExtend = (incoming) => {\n return util.safeExtend(inst, incoming);\n };\n inst.merge = (other) => util.merge(inst, other);\n inst.pick = (mask) => util.pick(inst, mask);\n inst.omit = (mask) => util.omit(inst, mask);\n inst.partial = (...args) => util.partial(ZodOptional, inst, args[0]);\n inst.required = (...args) => util.required(ZodNonOptional, inst, args[0]);\n});\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n shape: shape ?? {},\n ...util.normalizeParams(params),\n };\n return new ZodObject(def);\n}\n// strictObject\nexport function strictObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\nexport function looseObject(shape, params) {\n return new ZodObject({\n type: \"object\",\n shape,\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\nexport const ZodUnion = /*@__PURE__*/ core.$constructor(\"ZodUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\n});\nexport function union(options, params) {\n return new ZodUnion({\n type: \"union\",\n options: options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodXor = /*@__PURE__*/ core.$constructor(\"ZodXor\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodXor.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n inst.options = def.options;\n});\n/** Creates an exclusive union (XOR) where exactly one option must match.\n * Unlike regular unions that succeed when any option matches, xor fails if\n * zero or more than one option matches the input. */\nexport function xor(options, params) {\n return new ZodXor({\n type: \"union\",\n options: options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodDiscriminatedUnion\", (inst, def) => {\n ZodUnion.init(inst, def);\n core.$ZodDiscriminatedUnion.init(inst, def);\n});\nexport function discriminatedUnion(discriminator, options, params) {\n // const [options, params] = args;\n return new ZodDiscriminatedUnion({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodIntersection = /*@__PURE__*/ core.$constructor(\"ZodIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.intersectionProcessor(inst, ctx, json, params);\n});\nexport function intersection(left, right) {\n return new ZodIntersection({\n type: \"intersection\",\n left: left,\n right: right,\n });\n}\nexport const ZodTuple = /*@__PURE__*/ core.$constructor(\"ZodTuple\", (inst, def) => {\n core.$ZodTuple.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);\n inst.rest = (rest) => inst.clone({\n ...inst._zod.def,\n rest: rest,\n });\n});\nexport function tuple(items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof core.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new ZodTuple({\n type: \"tuple\",\n items: items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodRecord = /*@__PURE__*/ core.$constructor(\"ZodRecord\", (inst, def) => {\n core.$ZodRecord.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n});\nexport function record(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\n// type alksjf = core.output<core.$ZodRecordKey>;\nexport function partialRecord(keyType, valueType, params) {\n const k = core.clone(keyType);\n k._zod.values = undefined;\n return new ZodRecord({\n type: \"record\",\n keyType: k,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function looseRecord(keyType, valueType, params) {\n return new ZodRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n mode: \"loose\",\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMap = /*@__PURE__*/ core.$constructor(\"ZodMap\", (inst, def) => {\n core.$ZodMap.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);\n inst.keyType = def.keyType;\n inst.valueType = def.valueType;\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function map(keyType, valueType, params) {\n return new ZodMap({\n type: \"map\",\n keyType: keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSet = /*@__PURE__*/ core.$constructor(\"ZodSet\", (inst, def) => {\n core.$ZodSet.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);\n inst.min = (...args) => inst.check(core._minSize(...args));\n inst.nonempty = (params) => inst.check(core._minSize(1, params));\n inst.max = (...args) => inst.check(core._maxSize(...args));\n inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function set(valueType, params) {\n return new ZodSet({\n type: \"set\",\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodEnum = /*@__PURE__*/ core.$constructor(\"ZodEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);\n inst.enum = def.entries;\n inst.options = Object.values(def.entries);\n const keys = new Set(Object.keys(def.entries));\n inst.extract = (values, params) => {\n const newEntries = {};\n for (const value of values) {\n if (keys.has(value)) {\n newEntries[value] = def.entries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n inst.exclude = (values, params) => {\n const newEntries = { ...def.entries };\n for (const value of values) {\n if (keys.has(value)) {\n delete newEntries[value];\n }\n else\n throw new Error(`Key ${value} not found in enum`);\n }\n return new ZodEnum({\n ...def,\n checks: [],\n ...util.normalizeParams(params),\n entries: newEntries,\n });\n };\n});\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport { _enum as enum };\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n return new ZodEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLiteral = /*@__PURE__*/ core.$constructor(\"ZodLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.literalProcessor(inst, ctx, json, params);\n inst.values = new Set(def.values);\n Object.defineProperty(inst, \"value\", {\n get() {\n if (def.values.length > 1) {\n throw new Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");\n }\n return def.values[0];\n },\n });\n});\nexport function literal(value, params) {\n return new ZodLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodFile = /*@__PURE__*/ core.$constructor(\"ZodFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.fileProcessor(inst, ctx, json, params);\n inst.min = (size, params) => inst.check(core._minSize(size, params));\n inst.max = (size, params) => inst.check(core._maxSize(size, params));\n inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));\n});\nexport function file(params) {\n return core._file(ZodFile, params);\n}\nexport const ZodTransform = /*@__PURE__*/ core.$constructor(\"ZodTransform\", (inst, def) => {\n core.$ZodTransform.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);\n inst._zod.parse = (payload, _ctx) => {\n if (_ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = inst);\n // _issue.continue ??= true;\n payload.issues.push(util.issue(_issue));\n }\n };\n const output = def.transform(payload.value, payload);\n if (output instanceof Promise) {\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n payload.value = output;\n return payload;\n };\n});\nexport function transform(fn) {\n return new ZodTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodOptional = /*@__PURE__*/ core.$constructor(\"ZodOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function optional(innerType) {\n return new ZodOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodExactOptional = /*@__PURE__*/ core.$constructor(\"ZodExactOptional\", (inst, def) => {\n core.$ZodExactOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function exactOptional(innerType) {\n return new ZodExactOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodNullable = /*@__PURE__*/ core.$constructor(\"ZodNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nullableProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nullable(innerType) {\n return new ZodNullable({\n type: \"nullable\",\n innerType: innerType,\n });\n}\n// nullish\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodDefault = /*@__PURE__*/ core.$constructor(\"ZodDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.defaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeDefault = inst.unwrap;\n});\nexport function _default(innerType, defaultValue) {\n return new ZodDefault({\n type: \"default\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodPrefault = /*@__PURE__*/ core.$constructor(\"ZodPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.prefaultProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function prefault(innerType, defaultValue) {\n return new ZodPrefault({\n type: \"prefault\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodNonOptional = /*@__PURE__*/ core.$constructor(\"ZodNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nonoptionalProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nonoptional(innerType, params) {\n return new ZodNonOptional({\n type: \"nonoptional\",\n innerType: innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodSuccess = /*@__PURE__*/ core.$constructor(\"ZodSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.successProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function success(innerType) {\n return new ZodSuccess({\n type: \"success\",\n innerType: innerType,\n });\n}\nexport const ZodCatch = /*@__PURE__*/ core.$constructor(\"ZodCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.catchProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n inst.removeCatch = inst.unwrap;\n});\nfunction _catch(innerType, catchValue) {\n return new ZodCatch({\n type: \"catch\",\n innerType: innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport { _catch as catch };\nexport const ZodNaN = /*@__PURE__*/ core.$constructor(\"ZodNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.nanProcessor(inst, ctx, json, params);\n});\nexport function nan(params) {\n return core._nan(ZodNaN, params);\n}\nexport const ZodPipe = /*@__PURE__*/ core.$constructor(\"ZodPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.pipeProcessor(inst, ctx, json, params);\n inst.in = def.in;\n inst.out = def.out;\n});\nexport function pipe(in_, out) {\n return new ZodPipe({\n type: \"pipe\",\n in: in_,\n out: out,\n // ...util.normalizeParams(params),\n });\n}\nexport const ZodCodec = /*@__PURE__*/ core.$constructor(\"ZodCodec\", (inst, def) => {\n ZodPipe.init(inst, def);\n core.$ZodCodec.init(inst, def);\n});\nexport function codec(in_, out, params) {\n return new ZodCodec({\n type: \"pipe\",\n in: in_,\n out: out,\n transform: params.decode,\n reverseTransform: params.encode,\n });\n}\nexport const ZodReadonly = /*@__PURE__*/ core.$constructor(\"ZodReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.readonlyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function readonly(innerType) {\n return new ZodReadonly({\n type: \"readonly\",\n innerType: innerType,\n });\n}\nexport const ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.templateLiteralProcessor(inst, ctx, json, params);\n});\nexport function templateLiteral(parts, params) {\n return new ZodTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodLazy = /*@__PURE__*/ core.$constructor(\"ZodLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.lazyProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.getter();\n});\nexport function lazy(getter) {\n return new ZodLazy({\n type: \"lazy\",\n getter: getter,\n });\n}\nexport const ZodPromise = /*@__PURE__*/ core.$constructor(\"ZodPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.promiseProcessor(inst, ctx, json, params);\n inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function promise(innerType) {\n return new ZodPromise({\n type: \"promise\",\n innerType: innerType,\n });\n}\nexport const ZodFunction = /*@__PURE__*/ core.$constructor(\"ZodFunction\", (inst, def) => {\n core.$ZodFunction.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.functionProcessor(inst, ctx, json, params);\n});\nexport function _function(params) {\n return new ZodFunction({\n type: \"function\",\n input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),\n output: params?.output ?? unknown(),\n });\n}\nexport { _function as function };\nexport const ZodCustom = /*@__PURE__*/ core.$constructor(\"ZodCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodType.init(inst, def);\n inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);\n});\n// custom checks\nexport function check(fn) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n // ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\nexport function custom(fn, _params) {\n return core._custom(ZodCustom, fn ?? (() => true), _params);\n}\nexport function refine(fn, _params = {}) {\n return core._refine(ZodCustom, fn, _params);\n}\n// superRefine\nexport function superRefine(fn) {\n return core._superRefine(fn);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\nfunction _instanceof(cls, params = {}) {\n const inst = new ZodCustom({\n type: \"custom\",\n check: \"custom\",\n fn: (data) => data instanceof cls,\n abort: true,\n ...util.normalizeParams(params),\n });\n inst._zod.bag.Class = cls;\n // Override check to emit invalid_type instead of custom\n inst._zod.check = (payload) => {\n if (!(payload.value instanceof cls)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: cls.name,\n input: payload.value,\n inst,\n path: [...(inst._zod.def.path ?? [])],\n });\n }\n };\n return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n Codec: ZodCodec,\n Boolean: ZodBoolean,\n String: ZodString,\n}, ...args);\nexport function json(params) {\n const jsonSchema = lazy(() => {\n return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\n// preprocess\n// /** @deprecated Use `z.pipe()` and `z.transform()` instead. */\nexport function preprocess(fn, schema) {\n return pipe(transform(fn), schema);\n}\n","const Operation = {\n Remove: 'remove',\n Replace: 'replace',\n Add: 'add',\n};\n\n// Don't use `Symbol()` just for 3rd party access the draft\nconst PROXY_DRAFT = Symbol.for('__MUTATIVE_PROXY_DRAFT__');\nconst RAW_RETURN_SYMBOL = Symbol('__MUTATIVE_RAW_RETURN_SYMBOL__');\nconst iteratorSymbol = Symbol.iterator;\nconst dataTypes = {\n mutable: 'mutable',\n immutable: 'immutable',\n};\n\nconst internal = {};\n\nfunction has(target, key) {\n return target instanceof Map\n ? target.has(key)\n : Object.prototype.hasOwnProperty.call(target, key);\n}\nfunction getDescriptor(target, key) {\n if (key in target) {\n let prototype = Reflect.getPrototypeOf(target);\n while (prototype) {\n const descriptor = Reflect.getOwnPropertyDescriptor(prototype, key);\n if (descriptor)\n return descriptor;\n prototype = Reflect.getPrototypeOf(prototype);\n }\n }\n return;\n}\nfunction isBaseSetInstance(obj) {\n return Object.getPrototypeOf(obj) === Set.prototype;\n}\nfunction isBaseMapInstance(obj) {\n return Object.getPrototypeOf(obj) === Map.prototype;\n}\n\nfunction latest(proxyDraft) {\n var _a;\n return (_a = proxyDraft.copy) !== null && _a !== void 0 ? _a : proxyDraft.original;\n}\n/**\n * Check if the value is a draft\n */\nfunction isDraft(target) {\n return !!getProxyDraft(target);\n}\nfunction getProxyDraft(value) {\n if (typeof value !== 'object')\n return null;\n return value === null || value === void 0 ? void 0 : value[PROXY_DRAFT];\n}\nfunction getValue(value) {\n var _a;\n const proxyDraft = getProxyDraft(value);\n return proxyDraft ? ((_a = proxyDraft.copy) !== null && _a !== void 0 ? _a : proxyDraft.original) : value;\n}\n/**\n * Check if a value is draftable\n */\nfunction isDraftable(value, options) {\n if (!value || typeof value !== 'object')\n return false;\n let markResult;\n return (Object.getPrototypeOf(value) === Object.prototype ||\n Array.isArray(value) ||\n value instanceof Map ||\n value instanceof Set ||\n (!!(options === null || options === void 0 ? void 0 : options.mark) &&\n ((markResult = options.mark(value, dataTypes)) === dataTypes.immutable ||\n typeof markResult === 'function')));\n}\nfunction getPath(target, path = []) {\n if (Object.hasOwnProperty.call(target, 'key')) {\n // check if the parent is a draft and the original value is not equal to the current value\n const parentCopy = target.parent.copy;\n const proxyDraft = getProxyDraft(get(parentCopy, target.key));\n if (proxyDraft !== null && (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== target.original) {\n return null;\n }\n const isSet = target.parent.type === 3 /* DraftType.Set */;\n const key = isSet\n ? Array.from(target.parent.setMap.keys()).indexOf(target.key)\n : target.key;\n // check if the key is still in the next state parent\n if (!((isSet && parentCopy.size > key) || has(parentCopy, key)))\n return null;\n path.push(key);\n }\n if (target.parent) {\n return getPath(target.parent, path);\n }\n // `target` is root draft.\n path.reverse();\n try {\n // check if the path is valid\n resolvePath(target.copy, path);\n }\n catch (e) {\n return null;\n }\n return path;\n}\nfunction getType(target) {\n if (Array.isArray(target))\n return 1 /* DraftType.Array */;\n if (target instanceof Map)\n return 2 /* DraftType.Map */;\n if (target instanceof Set)\n return 3 /* DraftType.Set */;\n return 0 /* DraftType.Object */;\n}\nfunction get(target, key) {\n return getType(target) === 2 /* DraftType.Map */ ? target.get(key) : target[key];\n}\nfunction set(target, key, value) {\n const type = getType(target);\n if (type === 2 /* DraftType.Map */) {\n target.set(key, value);\n }\n else {\n target[key] = value;\n }\n}\nfunction peek(target, key) {\n const state = getProxyDraft(target);\n const source = state ? latest(state) : target;\n return source[key];\n}\nfunction isEqual(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n }\n else {\n return x !== x && y !== y;\n }\n}\nfunction revokeProxy(proxyDraft) {\n if (!proxyDraft)\n return;\n while (proxyDraft.finalities.revoke.length > 0) {\n const revoke = proxyDraft.finalities.revoke.pop();\n revoke();\n }\n}\n// handle JSON Pointer path with spec https://www.rfc-editor.org/rfc/rfc6901\nfunction escapePath(path, pathAsArray) {\n return pathAsArray\n ? path\n : ['']\n .concat(path)\n .map((_item) => {\n const item = `${_item}`;\n if (item.indexOf('/') === -1 && item.indexOf('~') === -1)\n return item;\n return item.replace(/~/g, '~0').replace(/\\//g, '~1');\n })\n .join('/');\n}\nfunction unescapePath(path) {\n if (Array.isArray(path))\n return path;\n return path\n .split('/')\n .map((_item) => _item.replace(/~1/g, '/').replace(/~0/g, '~'))\n .slice(1);\n}\nfunction resolvePath(base, path) {\n for (let index = 0; index < path.length - 1; index += 1) {\n const key = path[index];\n // use `index` in Set draft\n base = get(getType(base) === 3 /* DraftType.Set */ ? Array.from(base) : base, key);\n if (typeof base !== 'object') {\n throw new Error(`Cannot resolve patch at '${path.join('/')}'.`);\n }\n }\n return base;\n}\n\nfunction strictCopy(target) {\n const copy = Object.create(Object.getPrototypeOf(target));\n Reflect.ownKeys(target).forEach((key) => {\n let desc = Reflect.getOwnPropertyDescriptor(target, key);\n if (desc.enumerable && desc.configurable && desc.writable) {\n copy[key] = target[key];\n return;\n }\n // for freeze\n if (!desc.writable) {\n desc.writable = true;\n desc.configurable = true;\n }\n if (desc.get || desc.set)\n desc = {\n configurable: true,\n writable: true,\n enumerable: desc.enumerable,\n value: target[key],\n };\n Reflect.defineProperty(copy, key, desc);\n });\n return copy;\n}\nconst propIsEnum = Object.prototype.propertyIsEnumerable;\nfunction shallowCopy(original, options) {\n let markResult;\n if (Array.isArray(original)) {\n return Array.prototype.concat.call(original);\n }\n else if (original instanceof Set) {\n if (!isBaseSetInstance(original)) {\n const SubClass = Object.getPrototypeOf(original).constructor;\n return new SubClass(original.values());\n }\n return Set.prototype.difference\n ? Set.prototype.difference.call(original, new Set())\n : new Set(original.values());\n }\n else if (original instanceof Map) {\n if (!isBaseMapInstance(original)) {\n const SubClass = Object.getPrototypeOf(original).constructor;\n return new SubClass(original);\n }\n return new Map(original);\n }\n else if ((options === null || options === void 0 ? void 0 : options.mark) &&\n ((markResult = options.mark(original, dataTypes)),\n markResult !== undefined) &&\n markResult !== dataTypes.mutable) {\n if (markResult === dataTypes.immutable) {\n return strictCopy(original);\n }\n else if (typeof markResult === 'function') {\n if ((options.enablePatches || options.enableAutoFreeze)) {\n throw new Error(`You can't use mark and patches or auto freeze together.`);\n }\n return markResult();\n }\n throw new Error(`Unsupported mark result: ${markResult}`);\n }\n else if (typeof original === 'object' &&\n Object.getPrototypeOf(original) === Object.prototype) {\n // For best performance with shallow copies,\n // don't use `Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));` by default.\n const copy = {};\n Object.keys(original).forEach((key) => {\n copy[key] = original[key];\n });\n Object.getOwnPropertySymbols(original).forEach((key) => {\n if (propIsEnum.call(original, key)) {\n copy[key] = original[key];\n }\n });\n return copy;\n }\n else {\n throw new Error(`Please check mark() to ensure that it is a stable marker draftable function.`);\n }\n}\nfunction ensureShallowCopy(target) {\n if (target.copy)\n return;\n target.copy = shallowCopy(target.original, target.options);\n}\nfunction deepClone(target) {\n if (!isDraftable(target))\n return getValue(target);\n if (Array.isArray(target))\n return target.map(deepClone);\n if (target instanceof Map) {\n const iterable = Array.from(target.entries()).map(([k, v]) => [\n k,\n deepClone(v),\n ]);\n if (!isBaseMapInstance(target)) {\n const SubClass = Object.getPrototypeOf(target).constructor;\n return new SubClass(iterable);\n }\n return new Map(iterable);\n }\n if (target instanceof Set) {\n const iterable = Array.from(target).map(deepClone);\n if (!isBaseSetInstance(target)) {\n const SubClass = Object.getPrototypeOf(target).constructor;\n return new SubClass(iterable);\n }\n return new Set(iterable);\n }\n const copy = Object.create(Object.getPrototypeOf(target));\n for (const key in target)\n copy[key] = deepClone(target[key]);\n return copy;\n}\nfunction cloneIfNeeded(target) {\n return isDraft(target) ? deepClone(target) : target;\n}\n\nfunction markChanged(proxyDraft) {\n var _a;\n proxyDraft.assignedMap = (_a = proxyDraft.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n if (!proxyDraft.operated) {\n proxyDraft.operated = true;\n if (proxyDraft.parent) {\n markChanged(proxyDraft.parent);\n }\n }\n}\n\nfunction throwFrozenError() {\n throw new Error('Cannot modify frozen object');\n}\nfunction deepFreeze(target, subKey, updatedValues, stack, keys) {\n {\n updatedValues = updatedValues !== null && updatedValues !== void 0 ? updatedValues : new WeakMap();\n stack = stack !== null && stack !== void 0 ? stack : [];\n keys = keys !== null && keys !== void 0 ? keys : [];\n const value = updatedValues.has(target)\n ? updatedValues.get(target)\n : target;\n if (stack.length > 0) {\n const index = stack.indexOf(value);\n if (value && typeof value === 'object' && index !== -1) {\n if (stack[0] === value) {\n throw new Error(`Forbids circular reference`);\n }\n throw new Error(`Forbids circular reference: ~/${keys\n .slice(0, index)\n .map((key, index) => {\n if (typeof key === 'symbol')\n return `[${key.toString()}]`;\n const parent = stack[index];\n if (typeof key === 'object' &&\n (parent instanceof Map || parent instanceof Set))\n return Array.from(parent.keys()).indexOf(key);\n return key;\n })\n .join('/')}`);\n }\n stack.push(value);\n keys.push(subKey);\n }\n else {\n stack.push(value);\n }\n }\n if (Object.isFrozen(target) || isDraft(target)) {\n {\n stack.pop();\n keys.pop();\n }\n return;\n }\n const type = getType(target);\n switch (type) {\n case 2 /* DraftType.Map */:\n for (const [key, value] of target) {\n deepFreeze(key, key, updatedValues, stack, keys);\n deepFreeze(value, key, updatedValues, stack, keys);\n }\n target.set = target.clear = target.delete = throwFrozenError;\n break;\n case 3 /* DraftType.Set */:\n for (const value of target) {\n deepFreeze(value, value, updatedValues, stack, keys);\n }\n target.add = target.clear = target.delete = throwFrozenError;\n break;\n case 1 /* DraftType.Array */:\n Object.freeze(target);\n let index = 0;\n for (const value of target) {\n deepFreeze(value, index, updatedValues, stack, keys);\n index += 1;\n }\n break;\n default:\n Object.freeze(target);\n // ignore non-enumerable or symbol properties\n Object.keys(target).forEach((name) => {\n const value = target[name];\n deepFreeze(value, name, updatedValues, stack, keys);\n });\n }\n {\n stack.pop();\n keys.pop();\n }\n}\n\nfunction forEach(target, iter) {\n const type = getType(target);\n if (type === 0 /* DraftType.Object */) {\n Reflect.ownKeys(target).forEach((key) => {\n iter(key, target[key], target);\n });\n }\n else if (type === 1 /* DraftType.Array */) {\n let index = 0;\n for (const entry of target) {\n iter(index, entry, target);\n index += 1;\n }\n }\n else {\n target.forEach((entry, index) => iter(index, entry, target));\n }\n}\n\nfunction handleValue(target, handledSet, options) {\n if (isDraft(target) ||\n !isDraftable(target, options) ||\n handledSet.has(target) ||\n Object.isFrozen(target))\n return;\n const isSet = target instanceof Set;\n const setMap = isSet ? new Map() : undefined;\n handledSet.add(target);\n forEach(target, (key, value) => {\n var _a;\n if (isDraft(value)) {\n const proxyDraft = getProxyDraft(value);\n ensureShallowCopy(proxyDraft);\n // A draft where a child node has been changed, or assigned a value\n const updatedValue = ((_a = proxyDraft.assignedMap) === null || _a === void 0 ? void 0 : _a.size) || proxyDraft.operated\n ? proxyDraft.copy\n : proxyDraft.original;\n // final update value\n set(isSet ? setMap : target, key, updatedValue);\n }\n else {\n handleValue(value, handledSet, options);\n }\n });\n if (setMap) {\n const set = target;\n const values = Array.from(set);\n set.clear();\n values.forEach((value) => {\n set.add(setMap.has(value) ? setMap.get(value) : value);\n });\n }\n}\nfunction finalizeAssigned(proxyDraft, key) {\n // handle the draftable assigned values, and the value is not a draft\n const copy = proxyDraft.type === 3 /* DraftType.Set */ ? proxyDraft.setMap : proxyDraft.copy;\n if (proxyDraft.finalities.revoke.length > 1 &&\n proxyDraft.assignedMap.get(key) &&\n copy) {\n handleValue(get(copy, key), proxyDraft.finalities.handledSet, proxyDraft.options);\n }\n}\nfunction finalizeSetValue(target) {\n if (target.type === 3 /* DraftType.Set */ && target.copy) {\n target.copy.clear();\n target.setMap.forEach((value) => {\n target.copy.add(getValue(value));\n });\n }\n}\nfunction finalizePatches(target, generatePatches, patches, inversePatches) {\n const shouldFinalize = target.operated &&\n target.assignedMap &&\n target.assignedMap.size > 0 &&\n !target.finalized;\n if (shouldFinalize) {\n if (patches && inversePatches) {\n const basePath = getPath(target);\n if (basePath) {\n generatePatches(target, basePath, patches, inversePatches);\n }\n }\n target.finalized = true;\n }\n}\nfunction markFinalization(target, key, value, generatePatches) {\n const proxyDraft = getProxyDraft(value);\n if (proxyDraft) {\n // !case: assign the draft value\n if (!proxyDraft.callbacks) {\n proxyDraft.callbacks = [];\n }\n proxyDraft.callbacks.push((patches, inversePatches) => {\n var _a;\n const copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n if (isEqual(get(copy, key), value)) {\n let updatedValue = proxyDraft.original;\n if (proxyDraft.copy) {\n updatedValue = proxyDraft.copy;\n }\n finalizeSetValue(target);\n finalizePatches(target, generatePatches, patches, inversePatches);\n if (target.options.enableAutoFreeze) {\n target.options.updatedValues =\n (_a = target.options.updatedValues) !== null && _a !== void 0 ? _a : new WeakMap();\n target.options.updatedValues.set(updatedValue, proxyDraft.original);\n }\n // final update value\n set(copy, key, updatedValue);\n }\n });\n if (target.options.enableAutoFreeze) {\n // !case: assign the draft value in cross draft tree\n if (proxyDraft.finalities !== target.finalities) {\n target.options.enableAutoFreeze = false;\n }\n }\n }\n if (isDraftable(value, target.options)) {\n // !case: assign the non-draft value\n target.finalities.draft.push(() => {\n const copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n if (isEqual(get(copy, key), value)) {\n finalizeAssigned(target, key);\n }\n });\n }\n}\n\nfunction generateArrayPatches(proxyState, basePath, patches, inversePatches, pathAsArray) {\n let { original, assignedMap, options } = proxyState;\n let copy = proxyState.copy;\n if (copy.length < original.length) {\n [original, copy] = [copy, original];\n [patches, inversePatches] = [inversePatches, patches];\n }\n for (let index = 0; index < original.length; index += 1) {\n if (assignedMap.get(index.toString()) && copy[index] !== original[index]) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Replace,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(copy[index]),\n });\n inversePatches.push({\n op: Operation.Replace,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(original[index]),\n });\n }\n }\n for (let index = original.length; index < copy.length; index += 1) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Add,\n path,\n // If it is a draft, it needs to be deep cloned, and it may also be non-draft.\n value: cloneIfNeeded(copy[index]),\n });\n }\n if (original.length < copy.length) {\n // https://www.rfc-editor.org/rfc/rfc6902#appendix-A.4\n // For performance, here we only generate an operation that replaces the length of the array,\n // which is inconsistent with JSON Patch specification\n const { arrayLengthAssignment = true } = options.enablePatches;\n if (arrayLengthAssignment) {\n const _path = basePath.concat(['length']);\n const path = escapePath(_path, pathAsArray);\n inversePatches.push({\n op: Operation.Replace,\n path,\n value: original.length,\n });\n }\n else {\n for (let index = copy.length; original.length < index; index -= 1) {\n const _path = basePath.concat([index - 1]);\n const path = escapePath(_path, pathAsArray);\n inversePatches.push({\n op: Operation.Remove,\n path,\n });\n }\n }\n }\n}\nfunction generatePatchesFromAssigned({ original, copy, assignedMap }, basePath, patches, inversePatches, pathAsArray) {\n assignedMap.forEach((assignedValue, key) => {\n const originalValue = get(original, key);\n const value = cloneIfNeeded(get(copy, key));\n const op = !assignedValue\n ? Operation.Remove\n : has(original, key)\n ? Operation.Replace\n : Operation.Add;\n if (isEqual(originalValue, value) && op === Operation.Replace)\n return;\n const _path = basePath.concat(key);\n const path = escapePath(_path, pathAsArray);\n patches.push(op === Operation.Remove ? { op, path } : { op, path, value });\n inversePatches.push(op === Operation.Add\n ? { op: Operation.Remove, path }\n : op === Operation.Remove\n ? { op: Operation.Add, path, value: originalValue }\n : { op: Operation.Replace, path, value: originalValue });\n });\n}\nfunction generateSetPatches({ original, copy }, basePath, patches, inversePatches, pathAsArray) {\n let index = 0;\n original.forEach((value) => {\n if (!copy.has(value)) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Remove,\n path,\n value,\n });\n inversePatches.unshift({\n op: Operation.Add,\n path,\n value,\n });\n }\n index += 1;\n });\n index = 0;\n copy.forEach((value) => {\n if (!original.has(value)) {\n const _path = basePath.concat([index]);\n const path = escapePath(_path, pathAsArray);\n patches.push({\n op: Operation.Add,\n path,\n value,\n });\n inversePatches.unshift({\n op: Operation.Remove,\n path,\n value,\n });\n }\n index += 1;\n });\n}\nfunction generatePatches(proxyState, basePath, patches, inversePatches) {\n const { pathAsArray = true } = proxyState.options.enablePatches;\n switch (proxyState.type) {\n case 0 /* DraftType.Object */:\n case 2 /* DraftType.Map */:\n return generatePatchesFromAssigned(proxyState, basePath, patches, inversePatches, pathAsArray);\n case 1 /* DraftType.Array */:\n return generateArrayPatches(proxyState, basePath, patches, inversePatches, pathAsArray);\n case 3 /* DraftType.Set */:\n return generateSetPatches(proxyState, basePath, patches, inversePatches, pathAsArray);\n }\n}\n\nlet readable = false;\nconst checkReadable = (value, options, ignoreCheckDraftable = false) => {\n if (typeof value === 'object' &&\n value !== null &&\n (!isDraftable(value, options) || ignoreCheckDraftable) &&\n !readable) {\n throw new Error(`Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.`);\n }\n};\n/**\n * `unsafe(callback)` to access mutable data directly in strict mode.\n *\n * ## Example\n *\n * ```ts\n * import { create, unsafe } from '../index';\n *\n * class Foobar {\n * bar = 1;\n * }\n *\n * const baseState = { foobar: new Foobar() };\n * const state = create(\n * baseState,\n * (draft) => {\n * unsafe(() => {\n * draft.foobar.bar = 2;\n * });\n * },\n * {\n * strict: true,\n * }\n * );\n *\n * expect(state).toBe(baseState);\n * expect(state.foobar).toBe(baseState.foobar);\n * expect(state.foobar.bar).toBe(2);\n * ```\n */\nfunction unsafe(callback) {\n readable = true;\n let result;\n try {\n result = callback();\n }\n finally {\n readable = false;\n }\n return result;\n}\n\nconst mapHandler = {\n get size() {\n const current = latest(getProxyDraft(this));\n return current.size;\n },\n has(key) {\n return latest(getProxyDraft(this)).has(key);\n },\n set(key, value) {\n const target = getProxyDraft(this);\n const source = latest(target);\n if (!source.has(key) || !isEqual(source.get(key), value)) {\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(key, true);\n target.copy.set(key, value);\n markFinalization(target, key, value, generatePatches);\n }\n return this;\n },\n delete(key) {\n if (!this.has(key)) {\n return false;\n }\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n if (target.original.has(key)) {\n target.assignedMap.set(key, false);\n }\n else {\n target.assignedMap.delete(key);\n }\n target.copy.delete(key);\n return true;\n },\n clear() {\n const target = getProxyDraft(this);\n if (!this.size)\n return;\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap = new Map();\n for (const [key] of target.original) {\n target.assignedMap.set(key, false);\n }\n target.copy.clear();\n },\n forEach(callback, thisArg) {\n const target = getProxyDraft(this);\n latest(target).forEach((_value, _key) => {\n callback.call(thisArg, this.get(_key), _key, this);\n });\n },\n get(key) {\n var _a, _b;\n const target = getProxyDraft(this);\n const value = latest(target).get(key);\n const mutable = ((_b = (_a = target.options).mark) === null || _b === void 0 ? void 0 : _b.call(_a, value, dataTypes)) === dataTypes.mutable;\n if (target.options.strict) {\n checkReadable(value, target.options, mutable);\n }\n if (mutable) {\n return value;\n }\n if (target.finalized || !isDraftable(value, target.options)) {\n return value;\n }\n // drafted or reassigned\n if (value !== target.original.get(key)) {\n return value;\n }\n const draft = internal.createDraft({\n original: value,\n parentDraft: target,\n key,\n finalities: target.finalities,\n options: target.options,\n });\n ensureShallowCopy(target);\n target.copy.set(key, draft);\n return draft;\n },\n keys() {\n return latest(getProxyDraft(this)).keys();\n },\n values() {\n const iterator = this.keys();\n return {\n [iteratorSymbol]: () => this.values(),\n next: () => {\n const result = iterator.next();\n if (result.done)\n return result;\n const value = this.get(result.value);\n return {\n done: false,\n value,\n };\n },\n };\n },\n entries() {\n const iterator = this.keys();\n return {\n [iteratorSymbol]: () => this.entries(),\n next: () => {\n const result = iterator.next();\n if (result.done)\n return result;\n const value = this.get(result.value);\n return {\n done: false,\n value: [result.value, value],\n };\n },\n };\n },\n [iteratorSymbol]() {\n return this.entries();\n },\n};\nconst mapHandlerKeys = Reflect.ownKeys(mapHandler);\n\nconst getNextIterator = (target, iterator, { isValuesIterator }) => () => {\n var _a, _b;\n const result = iterator.next();\n if (result.done)\n return result;\n const key = result.value;\n let value = target.setMap.get(key);\n const currentDraft = getProxyDraft(value);\n const mutable = ((_b = (_a = target.options).mark) === null || _b === void 0 ? void 0 : _b.call(_a, value, dataTypes)) === dataTypes.mutable;\n if (target.options.strict) {\n checkReadable(key, target.options, mutable);\n }\n if (!mutable &&\n !currentDraft &&\n isDraftable(key, target.options) &&\n !target.finalized &&\n target.original.has(key)) {\n // draft a draftable original set item\n const proxy = internal.createDraft({\n original: key,\n parentDraft: target,\n key,\n finalities: target.finalities,\n options: target.options,\n });\n target.setMap.set(key, proxy);\n value = proxy;\n }\n else if (currentDraft) {\n // drafted\n value = currentDraft.proxy;\n }\n return {\n done: false,\n value: isValuesIterator ? value : [value, value],\n };\n};\nconst setHandler = {\n get size() {\n const target = getProxyDraft(this);\n return target.setMap.size;\n },\n has(value) {\n const target = getProxyDraft(this);\n // reassigned or non-draftable values\n if (target.setMap.has(value))\n return true;\n ensureShallowCopy(target);\n const valueProxyDraft = getProxyDraft(value);\n // drafted\n if (valueProxyDraft && target.setMap.has(valueProxyDraft.original))\n return true;\n return false;\n },\n add(value) {\n const target = getProxyDraft(this);\n if (!this.has(value)) {\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(value, true);\n target.setMap.set(value, value);\n markFinalization(target, value, value, generatePatches);\n }\n return this;\n },\n delete(value) {\n if (!this.has(value)) {\n return false;\n }\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n const valueProxyDraft = getProxyDraft(value);\n if (valueProxyDraft && target.setMap.has(valueProxyDraft.original)) {\n // delete drafted\n target.assignedMap.set(valueProxyDraft.original, false);\n return target.setMap.delete(valueProxyDraft.original);\n }\n if (!valueProxyDraft && target.setMap.has(value)) {\n // non-draftable values\n target.assignedMap.set(value, false);\n }\n else {\n // reassigned\n target.assignedMap.delete(value);\n }\n // delete reassigned or non-draftable values\n return target.setMap.delete(value);\n },\n clear() {\n if (!this.size)\n return;\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n markChanged(target);\n for (const value of target.original) {\n target.assignedMap.set(value, false);\n }\n target.setMap.clear();\n },\n values() {\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n const iterator = target.setMap.keys();\n return {\n [Symbol.iterator]: () => this.values(),\n next: getNextIterator(target, iterator, { isValuesIterator: true }),\n };\n },\n entries() {\n const target = getProxyDraft(this);\n ensureShallowCopy(target);\n const iterator = target.setMap.keys();\n return {\n [Symbol.iterator]: () => this.entries(),\n next: getNextIterator(target, iterator, {\n isValuesIterator: false,\n }),\n };\n },\n keys() {\n return this.values();\n },\n [iteratorSymbol]() {\n return this.values();\n },\n forEach(callback, thisArg) {\n const iterator = this.values();\n let result = iterator.next();\n while (!result.done) {\n callback.call(thisArg, result.value, result.value, this);\n result = iterator.next();\n }\n },\n};\nif (Set.prototype.difference) {\n // for compatibility with new Set methods\n // https://github.com/tc39/proposal-set-methods\n // And `https://github.com/tc39/proposal-set-methods/blob/main/details.md#symbolspecies` has some details about the `@@species` symbol.\n // So we can't use SubSet instance constructor to get the constructor of the SubSet instance.\n Object.assign(setHandler, {\n intersection(other) {\n return Set.prototype.intersection.call(new Set(this.values()), other);\n },\n union(other) {\n return Set.prototype.union.call(new Set(this.values()), other);\n },\n difference(other) {\n return Set.prototype.difference.call(new Set(this.values()), other);\n },\n symmetricDifference(other) {\n return Set.prototype.symmetricDifference.call(new Set(this.values()), other);\n },\n isSubsetOf(other) {\n return Set.prototype.isSubsetOf.call(new Set(this.values()), other);\n },\n isSupersetOf(other) {\n return Set.prototype.isSupersetOf.call(new Set(this.values()), other);\n },\n isDisjointFrom(other) {\n return Set.prototype.isDisjointFrom.call(new Set(this.values()), other);\n },\n });\n}\nconst setHandlerKeys = Reflect.ownKeys(setHandler);\n\nconst proxyHandler = {\n get(target, key, receiver) {\n var _a, _b;\n const copy = (_a = target.copy) === null || _a === void 0 ? void 0 : _a[key];\n // Improve draft reading performance by caching the draft copy.\n if (copy && target.finalities.draftsCache.has(copy)) {\n return copy;\n }\n if (key === PROXY_DRAFT)\n return target;\n let markResult;\n if (target.options.mark) {\n // handle `Uncaught TypeError: Method get Map.prototype.size called on incompatible receiver #<Map>`\n // or `Uncaught TypeError: Method get Set.prototype.size called on incompatible receiver #<Set>`\n const value = key === 'size' &&\n (target.original instanceof Map || target.original instanceof Set)\n ? Reflect.get(target.original, key)\n : Reflect.get(target.original, key, receiver);\n markResult = target.options.mark(value, dataTypes);\n if (markResult === dataTypes.mutable) {\n if (target.options.strict) {\n checkReadable(value, target.options, true);\n }\n return value;\n }\n }\n const source = latest(target);\n if (source instanceof Map && mapHandlerKeys.includes(key)) {\n if (key === 'size') {\n return Object.getOwnPropertyDescriptor(mapHandler, 'size').get.call(target.proxy);\n }\n const handle = mapHandler[key];\n return handle.bind(target.proxy);\n }\n if (source instanceof Set && setHandlerKeys.includes(key)) {\n if (key === 'size') {\n return Object.getOwnPropertyDescriptor(setHandler, 'size').get.call(target.proxy);\n }\n const handle = setHandler[key];\n return handle.bind(target.proxy);\n }\n if (!has(source, key)) {\n const desc = getDescriptor(source, key);\n return desc\n ? `value` in desc\n ? desc.value\n : // !case: support for getter\n (_b = desc.get) === null || _b === void 0 ? void 0 : _b.call(target.proxy)\n : undefined;\n }\n const value = source[key];\n if (target.options.strict) {\n checkReadable(value, target.options);\n }\n if (target.finalized || !isDraftable(value, target.options)) {\n return value;\n }\n // Ensure that the assigned values are not drafted\n if (value === peek(target.original, key)) {\n ensureShallowCopy(target);\n target.copy[key] = createDraft({\n original: target.original[key],\n parentDraft: target,\n key: target.type === 1 /* DraftType.Array */ ? Number(key) : key,\n finalities: target.finalities,\n options: target.options,\n });\n // !case: support for custom shallow copy function\n if (typeof markResult === 'function') {\n const subProxyDraft = getProxyDraft(target.copy[key]);\n ensureShallowCopy(subProxyDraft);\n // Trigger a custom shallow copy to update to a new copy\n markChanged(subProxyDraft);\n return subProxyDraft.copy;\n }\n return target.copy[key];\n }\n if (isDraft(value)) {\n target.finalities.draftsCache.add(value);\n }\n return value;\n },\n set(target, key, value) {\n var _a;\n if (target.type === 3 /* DraftType.Set */ || target.type === 2 /* DraftType.Map */) {\n throw new Error(`Map/Set draft does not support any property assignment.`);\n }\n let _key;\n if (target.type === 1 /* DraftType.Array */ &&\n key !== 'length' &&\n !(Number.isInteger((_key = Number(key))) &&\n _key >= 0 &&\n (key === 0 || _key === 0 || String(_key) === String(key)))) {\n throw new Error(`Only supports setting array indices and the 'length' property.`);\n }\n const desc = getDescriptor(latest(target), key);\n if (desc === null || desc === void 0 ? void 0 : desc.set) {\n // !case: cover the case of setter\n desc.set.call(target.proxy, value);\n return true;\n }\n const current = peek(latest(target), key);\n const currentProxyDraft = getProxyDraft(current);\n if (currentProxyDraft && isEqual(currentProxyDraft.original, value)) {\n // !case: ignore the case of assigning the original draftable value to a draft\n target.copy[key] = value;\n target.assignedMap = (_a = target.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n target.assignedMap.set(key, false);\n return true;\n }\n // !case: handle new props with value 'undefined'\n if (isEqual(value, current) &&\n (value !== undefined || has(target.original, key)))\n return true;\n ensureShallowCopy(target);\n markChanged(target);\n if (has(target.original, key) && isEqual(value, target.original[key])) {\n // !case: handle the case of assigning the original non-draftable value to a draft\n target.assignedMap.delete(key);\n }\n else {\n target.assignedMap.set(key, true);\n }\n target.copy[key] = value;\n markFinalization(target, key, value, generatePatches);\n return true;\n },\n has(target, key) {\n return key in latest(target);\n },\n ownKeys(target) {\n return Reflect.ownKeys(latest(target));\n },\n getOwnPropertyDescriptor(target, key) {\n const source = latest(target);\n const descriptor = Reflect.getOwnPropertyDescriptor(source, key);\n if (!descriptor)\n return descriptor;\n return {\n writable: true,\n configurable: target.type !== 1 /* DraftType.Array */ || key !== 'length',\n enumerable: descriptor.enumerable,\n value: source[key],\n };\n },\n getPrototypeOf(target) {\n return Reflect.getPrototypeOf(target.original);\n },\n setPrototypeOf() {\n throw new Error(`Cannot call 'setPrototypeOf()' on drafts`);\n },\n defineProperty() {\n throw new Error(`Cannot call 'defineProperty()' on drafts`);\n },\n deleteProperty(target, key) {\n var _a;\n if (target.type === 1 /* DraftType.Array */) {\n return proxyHandler.set.call(this, target, key, undefined, target.proxy);\n }\n if (peek(target.original, key) !== undefined || key in target.original) {\n // !case: delete an existing key\n ensureShallowCopy(target);\n markChanged(target);\n target.assignedMap.set(key, false);\n }\n else {\n target.assignedMap = (_a = target.assignedMap) !== null && _a !== void 0 ? _a : new Map();\n // The original non-existent key has been deleted\n target.assignedMap.delete(key);\n }\n if (target.copy)\n delete target.copy[key];\n return true;\n },\n};\nfunction createDraft(createDraftOptions) {\n const { original, parentDraft, key, finalities, options } = createDraftOptions;\n const type = getType(original);\n const proxyDraft = {\n type,\n finalized: false,\n parent: parentDraft,\n original,\n copy: null,\n proxy: null,\n finalities,\n options,\n // Mapping of draft Set items to their corresponding draft values.\n setMap: type === 3 /* DraftType.Set */\n ? new Map(original.entries())\n : undefined,\n };\n // !case: undefined as a draft map key\n if (key || 'key' in createDraftOptions) {\n proxyDraft.key = key;\n }\n const { proxy, revoke } = Proxy.revocable(type === 1 /* DraftType.Array */ ? Object.assign([], proxyDraft) : proxyDraft, proxyHandler);\n finalities.revoke.push(revoke);\n proxyDraft.proxy = proxy;\n if (parentDraft) {\n const target = parentDraft;\n target.finalities.draft.push((patches, inversePatches) => {\n var _a, _b;\n const oldProxyDraft = getProxyDraft(proxy);\n // if target is a Set draft, `setMap` is the real Set copies proxy mapping.\n let copy = target.type === 3 /* DraftType.Set */ ? target.setMap : target.copy;\n const draft = get(copy, key);\n const proxyDraft = getProxyDraft(draft);\n if (proxyDraft) {\n // assign the updated value to the copy object\n let updatedValue = proxyDraft.original;\n if (proxyDraft.operated) {\n updatedValue = getValue(draft);\n }\n finalizeSetValue(proxyDraft);\n finalizePatches(proxyDraft, generatePatches, patches, inversePatches);\n if (target.options.enableAutoFreeze) {\n target.options.updatedValues =\n (_a = target.options.updatedValues) !== null && _a !== void 0 ? _a : new WeakMap();\n target.options.updatedValues.set(updatedValue, proxyDraft.original);\n }\n // final update value\n set(copy, key, updatedValue);\n }\n // !case: handle the deleted key\n (_b = oldProxyDraft.callbacks) === null || _b === void 0 ? void 0 : _b.forEach((callback) => {\n callback(patches, inversePatches);\n });\n });\n }\n else {\n // !case: handle the root draft\n const target = getProxyDraft(proxy);\n target.finalities.draft.push((patches, inversePatches) => {\n finalizeSetValue(target);\n finalizePatches(target, generatePatches, patches, inversePatches);\n });\n }\n return proxy;\n}\ninternal.createDraft = createDraft;\nfunction finalizeDraft(result, returnedValue, patches, inversePatches, enableAutoFreeze) {\n var _a;\n const proxyDraft = getProxyDraft(result);\n const original = (_a = proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== null && _a !== void 0 ? _a : result;\n const hasReturnedValue = !!returnedValue.length;\n if (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.operated) {\n while (proxyDraft.finalities.draft.length > 0) {\n const finalize = proxyDraft.finalities.draft.pop();\n finalize(patches, inversePatches);\n }\n }\n const state = hasReturnedValue\n ? returnedValue[0]\n : proxyDraft\n ? proxyDraft.operated\n ? proxyDraft.copy\n : proxyDraft.original\n : result;\n if (proxyDraft)\n revokeProxy(proxyDraft);\n if (enableAutoFreeze) {\n deepFreeze(state, state, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options.updatedValues);\n }\n return [\n state,\n patches && hasReturnedValue\n ? [{ op: Operation.Replace, path: [], value: returnedValue[0] }]\n : patches,\n inversePatches && hasReturnedValue\n ? [{ op: Operation.Replace, path: [], value: original }]\n : inversePatches,\n ];\n}\n\nfunction draftify(baseState, options) {\n var _a;\n const finalities = {\n draft: [],\n revoke: [],\n handledSet: new WeakSet(),\n draftsCache: new WeakSet(),\n };\n let patches;\n let inversePatches;\n if (options.enablePatches) {\n patches = [];\n inversePatches = [];\n }\n const isMutable = ((_a = options.mark) === null || _a === void 0 ? void 0 : _a.call(options, baseState, dataTypes)) === dataTypes.mutable ||\n !isDraftable(baseState, options);\n const draft = isMutable\n ? baseState\n : createDraft({\n original: baseState,\n parentDraft: null,\n finalities,\n options,\n });\n return [\n draft,\n (returnedValue = []) => {\n const [finalizedState, finalizedPatches, finalizedInversePatches] = finalizeDraft(draft, returnedValue, patches, inversePatches, options.enableAutoFreeze);\n return (options.enablePatches\n ? [finalizedState, finalizedPatches, finalizedInversePatches]\n : finalizedState);\n },\n ];\n}\n\nfunction handleReturnValue(options) {\n const { rootDraft, value, useRawReturn = false, isRoot = true } = options;\n forEach(value, (key, item, source) => {\n const proxyDraft = getProxyDraft(item);\n // just handle the draft which is created by the same rootDraft\n if (proxyDraft &&\n rootDraft &&\n proxyDraft.finalities === rootDraft.finalities) {\n options.isContainDraft = true;\n const currentValue = proxyDraft.original;\n // final update value, but just handle return value\n if (source instanceof Set) {\n const arr = Array.from(source);\n source.clear();\n arr.forEach((_item) => source.add(key === _item ? currentValue : _item));\n }\n else {\n set(source, key, currentValue);\n }\n }\n else if (typeof item === 'object' && item !== null) {\n options.value = item;\n options.isRoot = false;\n handleReturnValue(options);\n }\n });\n if (isRoot) {\n if (!options.isContainDraft)\n console.warn(`The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance.`);\n if (useRawReturn) {\n console.warn(`The return value contains drafts, please don't use 'rawReturn()' to wrap the return value.`);\n }\n }\n}\nfunction getCurrent(target) {\n var _a;\n const proxyDraft = getProxyDraft(target);\n if (!isDraftable(target, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options))\n return target;\n const type = getType(target);\n if (proxyDraft && !proxyDraft.operated)\n return proxyDraft.original;\n let currentValue;\n function ensureShallowCopy() {\n currentValue =\n type === 2 /* DraftType.Map */\n ? !isBaseMapInstance(target)\n ? new (Object.getPrototypeOf(target).constructor)(target)\n : new Map(target)\n : type === 3 /* DraftType.Set */\n ? Array.from(proxyDraft.setMap.values())\n : shallowCopy(target, proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.options);\n }\n if (proxyDraft) {\n // It's a proxy draft, let's create a shallow copy eagerly\n proxyDraft.finalized = true;\n try {\n ensureShallowCopy();\n }\n finally {\n proxyDraft.finalized = false;\n }\n }\n else {\n // It's not a proxy draft, let's use the target directly and let's see\n // lazily if we need to create a shallow copy\n currentValue = target;\n }\n forEach(currentValue, (key, value) => {\n if (proxyDraft && isEqual(get(proxyDraft.original, key), value))\n return;\n const newValue = getCurrent(value);\n if (newValue !== value) {\n if (currentValue === target)\n ensureShallowCopy();\n set(currentValue, key, newValue);\n }\n });\n if (type === 3 /* DraftType.Set */) {\n const value = (_a = proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.original) !== null && _a !== void 0 ? _a : currentValue;\n return !isBaseSetInstance(value)\n ? new (Object.getPrototypeOf(value).constructor)(currentValue)\n : new Set(currentValue);\n }\n return currentValue;\n}\nfunction current(target) {\n if (!isDraft(target)) {\n throw new Error(`current() is only used for Draft, parameter: ${target}`);\n }\n return getCurrent(target);\n}\n\n/**\n * `makeCreator(options)` to make a creator function.\n *\n * ## Example\n *\n * ```ts\n * import { makeCreator } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const create = makeCreator({ enableAutoFreeze: true });\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * );\n *\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(state).not.toBe(baseState);\n * expect(state.foo).not.toBe(baseState.foo);\n * expect(state.arr).toBe(baseState.arr);\n * expect(Object.isFrozen(state)).toBeTruthy();\n * ```\n */\nconst makeCreator = (arg) => {\n if (arg !== undefined &&\n Object.prototype.toString.call(arg) !== '[object Object]') {\n throw new Error(`Invalid options: ${String(arg)}, 'options' should be an object.`);\n }\n return function create(arg0, arg1, arg2) {\n var _a, _b, _c;\n if (typeof arg0 === 'function' && typeof arg1 !== 'function') {\n return function (base, ...args) {\n return create(base, (draft) => arg0.call(this, draft, ...args), arg1);\n };\n }\n const base = arg0;\n const mutate = arg1;\n let options = arg2;\n if (typeof arg1 !== 'function') {\n options = arg1;\n }\n if (options !== undefined &&\n Object.prototype.toString.call(options) !== '[object Object]') {\n throw new Error(`Invalid options: ${options}, 'options' should be an object.`);\n }\n options = Object.assign(Object.assign({}, arg), options);\n const state = isDraft(base) ? current(base) : base;\n const mark = Array.isArray(options.mark)\n ? ((value, types) => {\n for (const mark of options.mark) {\n if (typeof mark !== 'function') {\n throw new Error(`Invalid mark: ${mark}, 'mark' should be a function.`);\n }\n const result = mark(value, types);\n if (result) {\n return result;\n }\n }\n return;\n })\n : options.mark;\n const enablePatches = (_a = options.enablePatches) !== null && _a !== void 0 ? _a : false;\n const strict = (_b = options.strict) !== null && _b !== void 0 ? _b : false;\n const enableAutoFreeze = (_c = options.enableAutoFreeze) !== null && _c !== void 0 ? _c : false;\n const _options = {\n enableAutoFreeze,\n mark,\n strict,\n enablePatches,\n };\n if (!isDraftable(state, _options) &&\n typeof state === 'object' &&\n state !== null) {\n throw new Error(`Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.`);\n }\n const [draft, finalize] = draftify(state, _options);\n if (typeof arg1 !== 'function') {\n if (!isDraftable(state, _options)) {\n throw new Error(`Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.`);\n }\n return [draft, finalize];\n }\n let result;\n try {\n result = mutate(draft);\n }\n catch (error) {\n revokeProxy(getProxyDraft(draft));\n throw error;\n }\n const returnValue = (value) => {\n const proxyDraft = getProxyDraft(draft);\n if (!isDraft(value)) {\n if (value !== undefined &&\n !isEqual(value, draft) &&\n (proxyDraft === null || proxyDraft === void 0 ? void 0 : proxyDraft.operated)) {\n throw new Error(`Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.`);\n }\n const rawReturnValue = value === null || value === void 0 ? void 0 : value[RAW_RETURN_SYMBOL];\n if (rawReturnValue) {\n const _value = rawReturnValue[0];\n if (_options.strict && typeof value === 'object' && value !== null) {\n handleReturnValue({\n rootDraft: proxyDraft,\n value,\n useRawReturn: true,\n });\n }\n return finalize([_value]);\n }\n if (value !== undefined) {\n if (typeof value === 'object' && value !== null) {\n handleReturnValue({ rootDraft: proxyDraft, value });\n }\n return finalize([value]);\n }\n }\n if (value === draft || value === undefined) {\n return finalize([]);\n }\n const returnedProxyDraft = getProxyDraft(value);\n if (_options === returnedProxyDraft.options) {\n if (returnedProxyDraft.operated) {\n throw new Error(`Cannot return a modified child draft.`);\n }\n return finalize([current(value)]);\n }\n return finalize([value]);\n };\n if (result instanceof Promise) {\n return result.then(returnValue, (error) => {\n revokeProxy(getProxyDraft(draft));\n throw error;\n });\n }\n return returnValue(result);\n };\n};\n\n/**\n * `create(baseState, callback, options)` to create the next state\n *\n * ## Example\n *\n * ```ts\n * import { create } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * );\n *\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(state).not.toBe(baseState);\n * expect(state.foo).not.toBe(baseState.foo);\n * expect(state.arr).toBe(baseState.arr);\n * ```\n */\nconst create = makeCreator();\n\n/**\n * `apply(state, patches)` to apply patches to state\n *\n * ## Example\n *\n * ```ts\n * import { create, apply } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const [state, patches] = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * },\n * { enablePatches: true }\n * );\n * expect(state).toEqual({ foo: { bar: 'str2' }, arr: [] });\n * expect(patches).toEqual([{ op: 'replace', path: ['foo', 'bar'], value: 'str2' }]);\n * expect(state).toEqual(apply(baseState, patches));\n * ```\n */\nfunction apply(state, patches, applyOptions) {\n let i;\n for (i = patches.length - 1; i >= 0; i -= 1) {\n const { value, op, path } = patches[i];\n if ((!path.length && op === Operation.Replace) ||\n (path === '' && op === Operation.Add)) {\n state = value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const mutate = (draft) => {\n patches.forEach((patch) => {\n const { path: _path, op } = patch;\n const path = unescapePath(_path);\n let base = draft;\n for (let index = 0; index < path.length - 1; index += 1) {\n const parentType = getType(base);\n let key = path[index];\n if (typeof key !== 'string' && typeof key !== 'number') {\n key = String(key);\n }\n if (((parentType === 0 /* DraftType.Object */ ||\n parentType === 1 /* DraftType.Array */) &&\n (key === '__proto__' || key === 'constructor')) ||\n (typeof base === 'function' && key === 'prototype')) {\n throw new Error(`Patching reserved attributes like __proto__ and constructor is not allowed.`);\n }\n // use `index` in Set draft\n base = get(parentType === 3 /* DraftType.Set */ ? Array.from(base) : base, key);\n if (typeof base !== 'object') {\n throw new Error(`Cannot apply patch at '${path.join('/')}'.`);\n }\n }\n const type = getType(base);\n // ensure the original patch is not modified.\n const value = deepClone(patch.value);\n const key = path[path.length - 1];\n switch (op) {\n case Operation.Replace:\n switch (type) {\n case 2 /* DraftType.Map */:\n return base.set(key, value);\n case 3 /* DraftType.Set */:\n throw new Error(`Cannot apply replace patch to set.`);\n default:\n return (base[key] = value);\n }\n case Operation.Add:\n switch (type) {\n case 1 /* DraftType.Array */:\n // If the \"-\" character is used to\n // index the end of the array (see [RFC6901](https://datatracker.ietf.org/doc/html/rfc6902)),\n // this has the effect of appending the value to the array.\n return key === '-'\n ? base.push(value)\n : base.splice(key, 0, value);\n case 2 /* DraftType.Map */:\n return base.set(key, value);\n case 3 /* DraftType.Set */:\n return base.add(value);\n default:\n return (base[key] = value);\n }\n case Operation.Remove:\n switch (type) {\n case 1 /* DraftType.Array */:\n return base.splice(key, 1);\n case 2 /* DraftType.Map */:\n return base.delete(key);\n case 3 /* DraftType.Set */:\n return base.delete(patch.value);\n default:\n return delete base[key];\n }\n default:\n throw new Error(`Unsupported patch operation: ${op}.`);\n }\n });\n };\n if (applyOptions === null || applyOptions === void 0 ? void 0 : applyOptions.mutable) {\n {\n if (Object.keys(applyOptions).filter((key) => key !== 'mutable').length) {\n console.warn('The \"mutable\" option is not allowed to be used with other options.');\n }\n }\n mutate(state);\n return undefined;\n }\n if (isDraft(state)) {\n if (applyOptions !== undefined) {\n throw new Error(`Cannot apply patches with options to a draft.`);\n }\n mutate(state);\n return state;\n }\n return create(state, mutate, Object.assign(Object.assign({}, applyOptions), { enablePatches: false }));\n}\n\n/**\n * `original(draft)` to get original state in the draft mutation function.\n *\n * ## Example\n *\n * ```ts\n * import { create, original } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * draft.foo.bar = 'str2';\n * expect(original(draft.foo)).toEqual({ bar: 'str' });\n * }\n * );\n * ```\n */\nfunction original(target) {\n const proxyDraft = getProxyDraft(target);\n if (!proxyDraft) {\n throw new Error(`original() is only used for a draft, parameter: ${target}`);\n }\n return proxyDraft.original;\n}\n\n/**\n * Use rawReturn() to wrap the return value to skip the draft check and thus improve performance.\n *\n * ## Example\n *\n * ```ts\n * import { create, rawReturn } from '../index';\n *\n * const baseState = { foo: { bar: 'str' }, arr: [] };\n * const state = create(\n * baseState,\n * (draft) => {\n * return rawReturn(baseState);\n * },\n * );\n * expect(state).toBe(baseState);\n * ```\n */\nfunction rawReturn(value) {\n if (arguments.length === 0) {\n throw new Error('rawReturn() must be called with a value.');\n }\n if (arguments.length > 1) {\n throw new Error('rawReturn() must be called with one argument.');\n }\n if (value !== undefined &&\n (typeof value !== 'object' || value === null)) {\n console.warn('rawReturn() must be called with an object(including plain object, arrays, Set, Map, etc.) or `undefined`, other types do not need to be returned via rawReturn().');\n }\n return {\n [RAW_RETURN_SYMBOL]: [value],\n };\n}\n\nconst constructorString = Object.prototype.constructor.toString();\n/**\n * Check if the value is a simple object(No prototype chain object or iframe same-origin object),\n * support case: https://github.com/unadlib/mutative/issues/17\n */\nconst isSimpleObject = (value) => {\n if (!value || typeof value !== 'object')\n return false;\n const prototype = Object.getPrototypeOf(value);\n if (prototype === null) {\n return true;\n }\n const constructor = Object.hasOwnProperty.call(prototype, 'constructor') &&\n prototype.constructor;\n if (constructor === Object)\n return true;\n return (typeof constructor === 'function' &&\n Function.toString.call(constructor) === constructorString);\n};\nconst markSimpleObject = (value) => {\n if (isSimpleObject(value)) {\n return dataTypes.immutable;\n }\n return;\n};\n\n/**\n * Cast a value to an Draft type value.\n */\nfunction castDraft(value) {\n return value;\n}\n/**\n * Cast a value to an Immutable type value.\n */\nfunction castImmutable(value) {\n return value;\n}\n/**\n * Cast a value to an Mutable type value.\n */\nfunction castMutable(draft) {\n return draft;\n}\n\nexport { apply, castDraft, castImmutable, castMutable, create, current, isDraft, isDraftable, makeCreator, markSimpleObject, original, rawReturn, unsafe };\n//# sourceMappingURL=mutative.esm.mjs.map\n","// Regexps involved with splitting words in various case formats.\nconst SPLIT_LOWER_UPPER_RE = /([\\p{Ll}\\d])(\\p{Lu})/gu;\nconst SPLIT_UPPER_UPPER_RE = /(\\p{Lu})([\\p{Lu}][\\p{Ll}])/gu;\n// Used to iterate over the initial split result and separate numbers.\nconst SPLIT_SEPARATE_NUMBER_RE = /(\\d)\\p{Ll}|(\\p{L})\\d/u;\n// Regexp involved with stripping non-word characters from the result.\nconst DEFAULT_STRIP_REGEXP = /[^\\p{L}\\d]+/giu;\n// The replacement value for splits.\nconst SPLIT_REPLACE_VALUE = \"$1\\0$2\";\n// The default characters to keep after transforming case.\nconst DEFAULT_PREFIX_SUFFIX_CHARACTERS = \"\";\n/**\n * Split any cased input strings into an array of words.\n */\nexport function split(value) {\n let result = value.trim();\n result = result\n .replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE)\n .replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);\n result = result.replace(DEFAULT_STRIP_REGEXP, \"\\0\");\n let start = 0;\n let end = result.length;\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\")\n start++;\n if (start === end)\n return [];\n while (result.charAt(end - 1) === \"\\0\")\n end--;\n return result.slice(start, end).split(/\\0/g);\n}\n/**\n * Split the input string into an array of words, separating numbers.\n */\nexport function splitSeparateNumbers(value) {\n const words = split(value);\n for (let i = 0; i < words.length; i++) {\n const word = words[i];\n const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);\n if (match) {\n const offset = match.index + (match[1] ?? match[2]).length;\n words.splice(i, 1, word.slice(0, offset), word.slice(offset));\n }\n }\n return words;\n}\n/**\n * Convert a string to space separated lower case (`foo bar`).\n */\nexport function noCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n return (prefix +\n words.map(lowerFactory(options?.locale)).join(options?.delimiter ?? \" \") +\n suffix);\n}\n/**\n * Convert a string to camel case (`fooBar`).\n */\nexport function camelCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return (prefix +\n words\n .map((word, index) => {\n if (index === 0)\n return lower(word);\n return transform(word, index);\n })\n .join(options?.delimiter ?? \"\") +\n suffix);\n}\n/**\n * Convert a string to pascal case (`FooBar`).\n */\nexport function pascalCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return prefix + words.map(transform).join(options?.delimiter ?? \"\") + suffix;\n}\n/**\n * Convert a string to pascal snake case (`Foo_Bar`).\n */\nexport function pascalSnakeCase(input, options) {\n return capitalCase(input, { delimiter: \"_\", ...options });\n}\n/**\n * Convert a string to capital case (`Foo Bar`).\n */\nexport function capitalCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n return (prefix +\n words\n .map(capitalCaseTransformFactory(lower, upper))\n .join(options?.delimiter ?? \" \") +\n suffix);\n}\n/**\n * Convert a string to constant case (`FOO_BAR`).\n */\nexport function constantCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n return (prefix +\n words.map(upperFactory(options?.locale)).join(options?.delimiter ?? \"_\") +\n suffix);\n}\n/**\n * Convert a string to dot case (`foo.bar`).\n */\nexport function dotCase(input, options) {\n return noCase(input, { delimiter: \".\", ...options });\n}\n/**\n * Convert a string to kebab case (`foo-bar`).\n */\nexport function kebabCase(input, options) {\n return noCase(input, { delimiter: \"-\", ...options });\n}\n/**\n * Convert a string to path case (`foo/bar`).\n */\nexport function pathCase(input, options) {\n return noCase(input, { delimiter: \"/\", ...options });\n}\n/**\n * Convert a string to path case (`Foo bar`).\n */\nexport function sentenceCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = capitalCaseTransformFactory(lower, upper);\n return (prefix +\n words\n .map((word, index) => {\n if (index === 0)\n return transform(word);\n return lower(word);\n })\n .join(options?.delimiter ?? \" \") +\n suffix);\n}\n/**\n * Convert a string to snake case (`foo_bar`).\n */\nexport function snakeCase(input, options) {\n return noCase(input, { delimiter: \"_\", ...options });\n}\n/**\n * Convert a string to header case (`Foo-Bar`).\n */\nexport function trainCase(input, options) {\n return capitalCase(input, { delimiter: \"-\", ...options });\n}\nfunction lowerFactory(locale) {\n return locale === false\n ? (input) => input.toLowerCase()\n : (input) => input.toLocaleLowerCase(locale);\n}\nfunction upperFactory(locale) {\n return locale === false\n ? (input) => input.toUpperCase()\n : (input) => input.toLocaleUpperCase(locale);\n}\nfunction capitalCaseTransformFactory(lower, upper) {\n return (word) => `${upper(word[0])}${lower(word.slice(1))}`;\n}\nfunction pascalCaseTransformFactory(lower, upper) {\n return (word, index) => {\n const char0 = word[0];\n const initial = index > 0 && char0 >= \"0\" && char0 <= \"9\" ? \"_\" + char0 : upper(char0);\n return initial + lower(word.slice(1));\n };\n}\nfunction splitPrefixSuffix(input, options = {}) {\n const splitFn = options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);\n const prefixCharacters = options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n const suffixCharacters = options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n let prefixIndex = 0;\n let suffixIndex = input.length;\n while (prefixIndex < input.length) {\n const char = input.charAt(prefixIndex);\n if (!prefixCharacters.includes(char))\n break;\n prefixIndex++;\n }\n while (suffixIndex > prefixIndex) {\n const index = suffixIndex - 1;\n const char = input.charAt(index);\n if (!suffixCharacters.includes(char))\n break;\n suffixIndex = index;\n }\n return [\n input.slice(0, prefixIndex),\n splitFn(input.slice(prefixIndex, suffixIndex)),\n input.slice(suffixIndex),\n ];\n}\n//# sourceMappingURL=index.js.map","import { a as buildOperationSignatureParams, c as hex2ab, i as buildOperationSignatureMessage, n as generateId, o as getUnixTimestamp, r as ab2hex, s as hashBrowser, t as deriveOperationId } from \"../utils-bCWnsmtD.js\";\nimport { generateMock } from \"./mock.js\";\nimport { ZodError, z } from \"zod\";\nimport { stringify } from \"safe-stable-stringify\";\nimport { castDraft, create, unsafe } from \"mutative\";\nimport { pascalCase } from \"change-case\";\n//#region document-model/errors.ts\nconst FileSystemError = /* @__PURE__ */ new Error(\"File system not available.\");\nvar InvalidActionInputError = class extends Error {\n\tdata;\n\tconstructor(data) {\n\t\tsuper();\n\t\tthis.name = \"InvalidActionInputError\";\n\t\tthis.data = data;\n\t\tthis.message = this.message || `Invalid action input: ${JSON.stringify(data, null, 2)}`;\n\t}\n};\nvar InvalidActionInputZodError = class extends InvalidActionInputError {\n\tissues;\n\tconstructor(issues) {\n\t\tsuper(issues);\n\t\tthis.issues = issues;\n\t\tthis.name = \"InvalidActionInputZodError\";\n\t}\n};\nvar HashMismatchError = class extends Error {\n\t_scope;\n\t_document;\n\t_operation;\n\tconstructor(scope, document, operation) {\n\t\tsuper();\n\t\tthis.name = \"HashMismatchError\";\n\t\tthis._document = document;\n\t\tthis._scope = scope;\n\t\tthis._operation = operation;\n\t\tthis.message = JSON.stringify({\n\t\t\terror: `Hash mismatch on document ${document.header.id}, scope ${scope}, index ${operation.index}`,\n\t\t\tdocument,\n\t\t\toperation\n\t\t}, null, 1);\n\t}\n\tget document() {\n\t\treturn this._document;\n\t}\n\tget scope() {\n\t\treturn this._scope;\n\t}\n\tget operation() {\n\t\treturn this._operation;\n\t}\n};\n//#endregion\n//#region document-model/schemas.ts\nconst isDefinedNonNullAny = (v) => v !== void 0 && v !== null;\nconst definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));\nconst Load_StateSchema = z.enum([\"LOAD_STATE\"]);\nconst PruneSchema = z.enum([\"PRUNE\"]);\nconst RedoSchema = z.enum([\"REDO\"]);\nconst Set_NameSchema = z.enum([\"SET_NAME\"]);\nconst UndoSchema = z.enum([\"UNDO\"]);\nfunction OperationScopeSchema() {\n\treturn z.string();\n}\nfunction DocumentActionSchema() {\n\treturn z.union([\n\t\tLoadStateActionSchema(),\n\t\tPruneActionSchema(),\n\t\tRedoActionSchema(),\n\t\tSetNameActionSchema(),\n\t\tUndoActionSchema()\n\t]);\n}\nfunction DocumentFileSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentFile\").optional(),\n\t\tdata: z.string(),\n\t\textension: z.string().nullable(),\n\t\tfileName: z.string().nullable(),\n\t\tmimeType: z.string()\n\t});\n}\nfunction LoadStateActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string(),\n\t\tinput: z.lazy(() => LoadStateActionInputSchema()),\n\t\ttype: Load_StateSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction LoadStateActionInputSchema() {\n\treturn z.object({\n\t\toperations: z.number(),\n\t\tstate: z.lazy(() => LoadStateActionStateInputSchema())\n\t});\n}\nfunction LoadStateActionStateInputSchema() {\n\treturn z.object({\n\t\tdata: z.unknown().nullish(),\n\t\tname: z.string()\n\t});\n}\nfunction PruneActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string(),\n\t\tinput: z.lazy(() => PruneActionInputSchema()),\n\t\ttype: PruneSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction PruneActionInputSchema() {\n\treturn z.object({\n\t\tend: z.number().nullish(),\n\t\tstart: z.number().nullish()\n\t});\n}\nfunction RedoActionInputSchema() {\n\treturn z.object({ count: z.number() });\n}\nfunction RedoActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: RedoActionInputSchema(),\n\t\ttype: RedoSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction SetNameActionInputSchema() {\n\treturn z.object({ name: z.string() });\n}\nfunction SetNameActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: SetNameActionInputSchema(),\n\t\ttype: Set_NameSchema,\n\t\tscope: z.literal(\"global\")\n\t});\n}\nfunction UndoActionInputSchema() {\n\treturn z.object({ count: z.number() });\n}\nfunction UndoActionSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttimestampUtcMs: z.string().datetime(),\n\t\tinput: UndoActionInputSchema(),\n\t\ttype: UndoSchema,\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction AddChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"AddChangeLogItemInput\").optional(),\n\t\tcontent: z.string(),\n\t\tid: z.string(),\n\t\tinsertBefore: z.string().nullable()\n\t});\n}\nfunction AddModuleInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string(),\n\t\tname: z.string()\n\t});\n}\nfunction AddOperationErrorInputSchema() {\n\treturn z.object({\n\t\terrorCode: z.string().nullish(),\n\t\terrorDescription: z.string().nullish(),\n\t\terrorName: z.string().nullish(),\n\t\terrorTemplate: z.string().nullish(),\n\t\tid: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction AddOperationExampleInputSchema() {\n\treturn z.object({\n\t\texample: z.string(),\n\t\tid: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction AddOperationInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string(),\n\t\tmoduleId: z.string(),\n\t\tname: z.string(),\n\t\treducer: z.string().nullish(),\n\t\tschema: z.string().nullish(),\n\t\ttemplate: z.string().nullish(),\n\t\tscope: OperationScopeSchema().nullish()\n\t});\n}\nfunction AddStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\texample: z.string(),\n\t\tid: z.string(),\n\t\tinsertBefore: z.string().nullish()\n\t});\n}\nfunction AuthorSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"Author\").optional(),\n\t\tname: z.string(),\n\t\twebsite: z.string().nullable()\n\t});\n}\nfunction CodeExampleSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"CodeExample\").optional(),\n\t\tid: z.string(),\n\t\tvalue: z.string()\n\t});\n}\nfunction DeleteChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DeleteChangeLogItemInput\").optional(),\n\t\tid: z.string()\n\t});\n}\nfunction DeleteModuleInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationErrorInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationExampleInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteOperationInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction DeleteStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tid: z.string()\n\t});\n}\nfunction DocumentModelInputSchema() {\n\treturn z.union([\n\t\tAddChangeLogItemInputSchema(),\n\t\tAddModuleInputSchema(),\n\t\tAddOperationErrorInputSchema(),\n\t\tAddOperationExampleInputSchema(),\n\t\tAddOperationInputSchema(),\n\t\tAddStateExampleInputSchema(),\n\t\tDeleteChangeLogItemInputSchema(),\n\t\tDeleteModuleInputSchema(),\n\t\tDeleteOperationErrorInputSchema(),\n\t\tDeleteOperationExampleInputSchema(),\n\t\tDeleteOperationInputSchema(),\n\t\tDeleteStateExampleInputSchema(),\n\t\tMoveOperationInputSchema(),\n\t\tReorderChangeLogItemsInputSchema(),\n\t\tReorderModuleOperationsInputSchema(),\n\t\tReorderModulesInputSchema(),\n\t\tReorderOperationErrorsInputSchema(),\n\t\tReorderOperationExamplesInputSchema(),\n\t\tReorderStateExamplesInputSchema(),\n\t\tSetAuthorNameInputSchema(),\n\t\tSetAuthorWebsiteInputSchema(),\n\t\tSetInitialStateInputSchema(),\n\t\tSetModelDescriptionInputSchema(),\n\t\tSetModelExtensionInputSchema(),\n\t\tSetModelIdInputSchema(),\n\t\tSetModelNameInputSchema(),\n\t\tSetModuleDescriptionInputSchema(),\n\t\tSetModuleNameInputSchema(),\n\t\tSetOperationDescriptionInputSchema(),\n\t\tSetOperationErrorCodeInputSchema(),\n\t\tSetOperationErrorDescriptionInputSchema(),\n\t\tSetOperationErrorNameInputSchema(),\n\t\tSetOperationErrorTemplateInputSchema(),\n\t\tSetOperationNameInputSchema(),\n\t\tSetOperationReducerInputSchema(),\n\t\tSetOperationSchemaInputSchema(),\n\t\tSetOperationTemplateInputSchema(),\n\t\tSetStateSchemaInputSchema(),\n\t\tUpdateChangeLogItemInputSchema(),\n\t\tUpdateOperationExampleInputSchema(),\n\t\tUpdateStateExampleInputSchema()\n\t]);\n}\nfunction DocumentModelGlobalStateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentModelGlobalState\").optional(),\n\t\tauthor: AuthorSchema(),\n\t\tdescription: z.string(),\n\t\textension: z.string(),\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tspecifications: z.array(DocumentSpecificationSchema())\n\t});\n}\nfunction DocumentSpecificationSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"DocumentSpecification\").optional(),\n\t\tchangeLog: z.array(z.string()),\n\t\tmodules: z.array(ModuleSchema()),\n\t\tstate: ScopeStateSchema(),\n\t\tversion: z.number().int()\n\t});\n}\nfunction ModuleSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ModuleSpecification\").optional(),\n\t\tdescription: z.string().nullable(),\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\toperations: z.array(OperationSpecificationSchema())\n\t});\n}\nfunction MoveOperationInputSchema() {\n\treturn z.object({\n\t\tnewModuleId: z.string(),\n\t\toperationId: z.string()\n\t});\n}\nfunction OperationSpecificationSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"OperationSpecification\").optional(),\n\t\tdescription: z.string().nullable(),\n\t\terrors: z.array(OperationErrorSchema()),\n\t\texamples: z.array(CodeExampleSchema()),\n\t\tid: z.string(),\n\t\tname: z.string().nullable(),\n\t\treducer: z.string().nullable(),\n\t\tschema: z.string().nullable(),\n\t\ttemplate: z.string().nullable(),\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction OperationErrorSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"OperationErrorSpecification\").optional(),\n\t\tcode: z.string().nullable(),\n\t\tdescription: z.string().nullable(),\n\t\tid: z.string(),\n\t\tname: z.string().nullable(),\n\t\ttemplate: z.string().nullable()\n\t});\n}\nfunction ReorderChangeLogItemsInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"ReorderChangeLogItemsInput\").optional(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderModuleOperationsInputSchema() {\n\treturn z.object({\n\t\tmoduleId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderModulesInputSchema() {\n\treturn z.object({ order: z.array(z.string()) });\n}\nfunction ReorderOperationErrorsInputSchema() {\n\treturn z.object({\n\t\toperationId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderOperationExamplesInputSchema() {\n\treturn z.object({\n\t\toperationId: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction ReorderStateExamplesInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\torder: z.array(z.string())\n\t});\n}\nfunction SetAuthorNameInputSchema() {\n\treturn z.object({ authorName: z.string() });\n}\nfunction SetAuthorWebsiteInputSchema() {\n\treturn z.object({ authorWebsite: z.string() });\n}\nfunction SetInitialStateInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tinitialValue: z.string()\n\t});\n}\nfunction SetModelDescriptionInputSchema() {\n\treturn z.object({ description: z.string() });\n}\nfunction SetModelExtensionInputSchema() {\n\treturn z.object({ extension: z.string() });\n}\nfunction SetModelIdInputSchema() {\n\treturn z.object({ id: z.string() });\n}\nfunction SetModelNameInputSchema() {\n\treturn z.object({ name: z.string() });\n}\nfunction SetModuleDescriptionInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetModuleNameInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullish()\n\t});\n}\nfunction SetOperationDescriptionInputSchema() {\n\treturn z.object({\n\t\tdescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorCodeInputSchema() {\n\treturn z.object({\n\t\terrorCode: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorDescriptionInputSchema() {\n\treturn z.object({\n\t\terrorDescription: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorNameInputSchema() {\n\treturn z.object({\n\t\terrorName: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationErrorTemplateInputSchema() {\n\treturn z.object({\n\t\terrorTemplate: z.string().nullish(),\n\t\tid: z.string()\n\t});\n}\nfunction SetOperationNameInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullish()\n\t});\n}\nfunction SetOperationScopeInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tscope: OperationScopeSchema()\n\t});\n}\nfunction SetOperationReducerInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\treducer: z.string().nullish()\n\t});\n}\nfunction SetOperationSchemaInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\tschema: z.string().nullish()\n\t});\n}\nfunction SetOperationTemplateInputSchema() {\n\treturn z.object({\n\t\tid: z.string(),\n\t\ttemplate: z.string().nullish()\n\t});\n}\nfunction SetStateSchemaInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tschema: z.string()\n\t});\n}\nfunction StateSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"State\").optional(),\n\t\texamples: z.array(CodeExampleSchema()),\n\t\tinitialValue: z.string(),\n\t\tschema: z.string()\n\t});\n}\nfunction ScopeStateSchema() {\n\treturn z.object({\n\t\tglobal: StateSchema(),\n\t\tlocal: StateSchema()\n\t});\n}\nfunction UpdateChangeLogItemInputSchema() {\n\treturn z.object({\n\t\t__typename: z.literal(\"UpdateChangeLogItemInput\").optional(),\n\t\tid: z.string(),\n\t\tnewContent: z.string()\n\t});\n}\nfunction UpdateOperationExampleInputSchema() {\n\treturn z.object({\n\t\texample: z.string(),\n\t\tid: z.string()\n\t});\n}\nfunction UpdateStateExampleInputSchema() {\n\treturn z.object({\n\t\tscope: z.string(),\n\t\tid: z.string(),\n\t\tnewExample: z.string()\n\t});\n}\nconst PowerhouseModuleSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tdocumentTypes: z.array(z.string()).optional()\n});\nconst PowerhouseModulesSchema = z.array(PowerhouseModuleSchema).optional();\nconst PublisherSchema = z.object({\n\tname: z.string().optional(),\n\turl: z.string().optional()\n});\nconst ConfigEntryTypeSchema = z.union([z.literal(\"var\"), z.literal(\"secret\")]);\nconst ConfigEntrySchema = z.object({\n\tname: z.string(),\n\ttype: ConfigEntryTypeSchema,\n\tdescription: z.string().optional(),\n\trequired: z.boolean().optional(),\n\tdefault: z.boolean().optional()\n});\nconst ManifestSchema = z.object({\n\tname: z.string(),\n\tdescription: z.string().optional(),\n\tcategory: z.string().optional(),\n\tpublisher: PublisherSchema.optional(),\n\tdocumentModels: PowerhouseModulesSchema,\n\tapps: PowerhouseModulesSchema,\n\teditors: PowerhouseModulesSchema,\n\tprocessors: PowerhouseModulesSchema,\n\tsubgraphs: PowerhouseModulesSchema,\n\tconfig: z.array(ConfigEntrySchema).optional()\n});\n//#endregion\n//#region document-model/actions.ts\n/**\n* Cancels the last `count` operations.\n*\n* @param count - Number of operations to cancel\n* @category Actions\n*/\nconst undo = (count = 1, scope = \"global\") => createAction(\"UNDO\", { count }, void 0, UndoActionInputSchema, scope);\n/**\n* Cancels the last `count` {@link undo | UNDO} operations.\n*\n* @param count - Number of UNDO operations to cancel\n* @category Actions\n*/\nconst redo = (count = 1, scope = \"global\") => createAction(\"REDO\", { count }, void 0, RedoActionInputSchema, scope);\n/**\n* Joins multiple operations into a single {@link loadState | LOAD_STATE} operation.\n*\n* @remarks\n* Useful to keep operations history smaller. Operations to prune are selected by index,\n* similar to the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | slice} method in Arrays.\n*\n* @param start - Index of the first operation to prune\n* @param end - Index of the last operation to prune\n* @category Actions\n*/\nconst prune = (start, end, scope = \"global\") => createAction(\"PRUNE\", {\n\tstart,\n\tend\n}, void 0, PruneActionInputSchema, scope);\n/**\n* Replaces the state of the document.\n*\n* @remarks\n* This action shouldn't be used directly. It is dispatched by the {@link prune} action.\n*\n* @param state - State to be set in the document.\n* @param operations - Number of operations that were removed from the previous state.\n* @category Actions\n*/\nconst loadState = (state, operations) => createAction(\"LOAD_STATE\", {\n\tstate,\n\toperations\n}, void 0, LoadStateActionInputSchema);\nconst noop = (scope = \"global\") => createAction(\"NOOP\", {}, void 0, void 0, scope);\n/**\n* Helper function to be used by action creators.\n*\n* @remarks\n* Creates an action with the given type and input properties. The input\n* properties default to an empty object.\n*\n* @typeParam A - Type of the action to be returned.\n*\n* @param type - The type of the action.\n* @param input - The input properties of the action.\n* @param attachments - The attachments included in the action.\n* @param validator - The validator to use for the input properties.\n* @param scope - The scope of the action, can either be 'global' or 'local'.\n* @param skip - The number of operations to skip before this new action is applied.\n*\n* @throws Error if the type is empty or not a string.\n*\n* @returns The new action.\n*/\nfunction createAction(type, input, attachments, validator, scope = \"global\") {\n\tif (!type) throw new Error(\"Empty action type\");\n\tif (typeof type !== \"string\") throw new Error(`Invalid action type: ${JSON.stringify(type)}`);\n\tconst action = {\n\t\tid: generateId(),\n\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\ttype,\n\t\tinput,\n\t\tscope\n\t};\n\tif (attachments) action.attachments = attachments;\n\ttry {\n\t\tvalidator?.().parse(action.input);\n\t} catch (error) {\n\t\tif (error instanceof ZodError) throw new InvalidActionInputZodError(error.issues);\n\t\tthrow new InvalidActionInputError(error);\n\t}\n\treturn action;\n}\n/**\n* This function should be used instead of { ...action } to ensure\n* that extra properties are not included in the action.\n*/\nconst actionFromAction = (action) => {\n\treturn {\n\t\tid: action.id,\n\t\ttimestampUtcMs: action.timestampUtcMs,\n\t\ttype: action.type,\n\t\tinput: action.input,\n\t\tscope: action.scope,\n\t\tcontext: action.context,\n\t\tattachments: action.attachments\n\t};\n};\nconst operationFromAction = (action, index, skip, context) => {\n\treturn {\n\t\t...action,\n\t\taction,\n\t\tid: deriveOperationId(context.documentId, context.scope, context.branch, action.id),\n\t\ttimestampUtcMs: action.timestampUtcMs,\n\t\thash: \"\",\n\t\terror: void 0,\n\t\tindex,\n\t\tskip\n\t};\n};\nconst operationFromOperation = (operation, index, skip, context) => {\n\tconst id = deriveOperationId(context.documentId, context.scope, context.branch, operation.action.id);\n\treturn {\n\t\t...operation,\n\t\thash: \"\",\n\t\terror: void 0,\n\t\tindex,\n\t\tskip,\n\t\tid\n\t};\n};\nconst operationWithContext = (operation, context) => {\n\tif (!operation.action) throw new Error(\"Operation has no action\");\n\treturn {\n\t\t...operation,\n\t\taction: {\n\t\t\t...operation.action,\n\t\t\tcontext\n\t\t}\n\t};\n};\nconst actionContext = () => ({});\nconst actionSigner = (user, app, signatures = []) => ({\n\tuser,\n\tapp,\n\tsignatures\n});\nasync function buildOperationSignature(context, signMethod) {\n\tconst params = buildOperationSignatureParams(context);\n\tconst signature = await signMethod(buildOperationSignatureMessage(params));\n\treturn [...params, `0x${ab2hex(signature)}`];\n}\nasync function buildSignedAction(action, reducer, document, signer, signHandler) {\n\tconst scopeOperations = reducer(document, action, void 0, { reuseOperationResultingState: true }).operations[action.scope];\n\tif (!scopeOperations) throw new Error(`No operations found for scope: ${action.scope}`);\n\tconst operation = scopeOperations.at(-1);\n\tif (!operation) throw new Error(\"Action was not applied\");\n\tconst previousStateHash = scopeOperations.at(-2)?.hash ?? \"\";\n\tconst signature = await buildOperationSignature({\n\t\tdocumentId: document.header.id,\n\t\tsigner,\n\t\taction,\n\t\tpreviousStateHash\n\t}, signHandler);\n\treturn operationWithContext(operation, { signer: actionSigner(signer.user, signer.app, [...signer.signatures, signature]) });\n}\nasync function verifyOperationSignature(signature, signer, verifyHandler) {\n\tconst publicKey = signer.app.key;\n\tconst params = signature.slice(0, 4);\n\treturn verifyHandler(publicKey, hex2ab(signature[4]), buildOperationSignatureMessage(params));\n}\n/**\n* Changes the name of the document.\n*\n* @param name - The name to be set in the document.\n* @category Actions\n*/\nconst setName = (name) => createAction(\"SET_NAME\", typeof name === \"string\" ? { name } : name, void 0, SetNameActionInputSchema, \"global\");\nconst setModelName = (input) => createAction(\"SET_MODEL_NAME\", { ...input }, void 0, SetModelNameInputSchema, \"global\");\nconst setModelId = (input) => createAction(\"SET_MODEL_ID\", { ...input }, void 0, SetModelIdInputSchema, \"global\");\nconst setModelExtension = (input) => createAction(\"SET_MODEL_EXTENSION\", { ...input }, void 0, SetModelExtensionInputSchema, \"global\");\nconst setModelDescription = (input) => createAction(\"SET_MODEL_DESCRIPTION\", { ...input }, void 0, SetModelDescriptionInputSchema, \"global\");\nconst setAuthorName = (input) => createAction(\"SET_AUTHOR_NAME\", { ...input }, void 0, SetAuthorNameInputSchema, \"global\");\nconst setAuthorWebsite = (input) => createAction(\"SET_AUTHOR_WEBSITE\", { ...input }, void 0, SetAuthorWebsiteInputSchema, \"global\");\nconst addModule = (input) => createAction(\"ADD_MODULE\", { ...input }, void 0, AddModuleInputSchema, \"global\");\nconst setModuleName = (input) => createAction(\"SET_MODULE_NAME\", { ...input }, void 0, SetModuleNameInputSchema, \"global\");\nconst setModuleDescription = (input) => createAction(\"SET_MODULE_DESCRIPTION\", { ...input }, void 0, SetModuleDescriptionInputSchema, \"global\");\nconst deleteModule = (input) => createAction(\"DELETE_MODULE\", { ...input }, void 0, DeleteModuleInputSchema, \"global\");\nconst reorderModules = (input) => createAction(\"REORDER_MODULES\", { ...input }, void 0, ReorderModulesInputSchema, \"global\");\nconst addOperation = (input) => createAction(\"ADD_OPERATION\", { ...input }, void 0, AddOperationInputSchema, \"global\");\nconst setOperationName = (input) => createAction(\"SET_OPERATION_NAME\", { ...input }, void 0, SetOperationNameInputSchema, \"global\");\nconst setOperationScope = (input) => createAction(\"SET_OPERATION_SCOPE\", { ...input }, void 0, SetOperationScopeInputSchema, \"global\");\nconst setOperationSchema = (input) => createAction(\"SET_OPERATION_SCHEMA\", { ...input }, void 0, SetOperationSchemaInputSchema, \"global\");\nconst setOperationDescription = (input) => createAction(\"SET_OPERATION_DESCRIPTION\", { ...input }, void 0, SetOperationDescriptionInputSchema, \"global\");\nconst setOperationTemplate = (input) => createAction(\"SET_OPERATION_TEMPLATE\", { ...input }, void 0, SetOperationTemplateInputSchema, \"global\");\nconst setOperationReducer = (input) => createAction(\"SET_OPERATION_REDUCER\", { ...input }, void 0, SetOperationReducerInputSchema, \"global\");\nconst moveOperation = (input) => createAction(\"MOVE_OPERATION\", { ...input }, void 0, MoveOperationInputSchema, \"global\");\nconst deleteOperation = (input) => createAction(\"DELETE_OPERATION\", { ...input }, void 0, DeleteOperationInputSchema, \"global\");\nconst reorderModuleOperations = (input) => createAction(\"REORDER_MODULE_OPERATIONS\", { ...input }, void 0, ReorderModuleOperationsInputSchema, \"global\");\nconst addOperationError = (input) => createAction(\"ADD_OPERATION_ERROR\", { ...input }, void 0, AddOperationErrorInputSchema, \"global\");\nconst setOperationErrorCode = (input) => createAction(\"SET_OPERATION_ERROR_CODE\", { ...input }, void 0, SetOperationErrorCodeInputSchema, \"global\");\nconst setOperationErrorName = (input) => createAction(\"SET_OPERATION_ERROR_NAME\", { ...input }, void 0, SetOperationErrorNameInputSchema, \"global\");\nconst setOperationErrorDescription = (input) => createAction(\"SET_OPERATION_ERROR_DESCRIPTION\", { ...input }, void 0, SetOperationErrorDescriptionInputSchema, \"global\");\nconst setOperationErrorTemplate = (input) => createAction(\"SET_OPERATION_ERROR_TEMPLATE\", { ...input }, void 0, SetOperationErrorTemplateInputSchema, \"global\");\nconst deleteOperationError = (input) => createAction(\"DELETE_OPERATION_ERROR\", { ...input }, void 0, DeleteOperationErrorInputSchema, \"global\");\nconst reorderOperationErrors = (input) => createAction(\"REORDER_OPERATION_ERRORS\", { ...input }, void 0, ReorderOperationErrorsInputSchema, \"global\");\nconst addOperationExample = (input) => createAction(\"ADD_OPERATION_EXAMPLE\", { ...input }, void 0, AddOperationExampleInputSchema, \"global\");\nconst updateOperationExample = (input) => createAction(\"UPDATE_OPERATION_EXAMPLE\", { ...input }, void 0, UpdateOperationExampleInputSchema, \"global\");\nconst deleteOperationExample = (input) => createAction(\"DELETE_OPERATION_EXAMPLE\", { ...input }, void 0, DeleteOperationExampleInputSchema, \"global\");\nconst reorderOperationExamples = (input) => createAction(\"REORDER_OPERATION_EXAMPLES\", { ...input }, void 0, ReorderOperationExamplesInputSchema, \"global\");\nconst operationExampleCreators = {\n\taddOperationExample,\n\tupdateOperationExample,\n\tdeleteOperationExample,\n\treorderOperationExamples\n};\nconst setStateSchema = (input) => createAction(\"SET_STATE_SCHEMA\", { ...input }, void 0, SetStateSchemaInputSchema, \"global\");\nconst setInitialState = (input) => createAction(\"SET_INITIAL_STATE\", { ...input }, void 0, SetInitialStateInputSchema, \"global\");\nconst addStateExample = (input) => createAction(\"ADD_STATE_EXAMPLE\", { ...input }, void 0, AddStateExampleInputSchema, \"global\");\nconst updateStateExample = (input) => createAction(\"UPDATE_STATE_EXAMPLE\", { ...input }, void 0, UpdateStateExampleInputSchema, \"global\");\nconst deleteStateExample = (input) => createAction(\"DELETE_STATE_EXAMPLE\", { ...input }, void 0, DeleteStateExampleInputSchema, \"global\");\nconst reorderStateExamples = (input) => createAction(\"REORDER_STATE_EXAMPLES\", { ...input }, void 0, ReorderStateExamplesInputSchema, \"global\");\nconst addChangeLogItem = (input) => createAction(\"ADD_CHANGE_LOG_ITEM\", { ...input }, void 0, AddChangeLogItemInputSchema, \"global\");\nconst updateChangeLogItem = (input) => createAction(\"UPDATE_CHANGE_LOG_ITEM\", { ...input }, void 0, UpdateChangeLogItemInputSchema, \"global\");\nconst deleteChangeLogItem = (input) => createAction(\"DELETE_CHANGE_LOG_ITEM\", { ...input }, void 0, DeleteChangeLogItemInputSchema, \"global\");\nconst reorderChangeLogItems = (input) => createAction(\"REORDER_CHANGE_LOG_ITEMS\", { ...input }, void 0, ReorderChangeLogItemsInputSchema, \"global\");\nconst releaseNewVersion = () => createAction(\"RELEASE_NEW_VERSION\", {}, void 0, void 0, \"global\");\nconst baseActions = {\n\tsetName,\n\tundo,\n\tredo,\n\tprune,\n\tloadState,\n\tnoop\n};\nconst documentModelActions = {\n\tsetModelName,\n\tsetModelId,\n\tsetModelExtension,\n\tsetModelDescription,\n\tsetAuthorName,\n\tsetAuthorWebsite,\n\taddModule,\n\tsetModuleName,\n\tsetModuleDescription,\n\tdeleteModule,\n\treorderModules,\n\taddOperation,\n\tsetOperationName,\n\tsetOperationScope,\n\tsetOperationSchema,\n\tsetOperationDescription,\n\tsetOperationTemplate,\n\tsetOperationReducer,\n\tmoveOperation,\n\tdeleteOperation,\n\treorderModuleOperations,\n\taddOperationError,\n\tsetOperationErrorCode,\n\tsetOperationErrorName,\n\tsetOperationErrorDescription,\n\tsetOperationErrorTemplate,\n\tdeleteOperationError,\n\treorderOperationErrors,\n\taddOperationExample,\n\tupdateOperationExample,\n\tdeleteOperationExample,\n\treorderOperationExamples,\n\tsetStateSchema,\n\tsetInitialState,\n\taddStateExample,\n\tupdateStateExample,\n\tdeleteStateExample,\n\treorderStateExamples,\n\taddChangeLogItem,\n\tupdateChangeLogItem,\n\tdeleteChangeLogItem,\n\treorderChangeLogItems,\n\treleaseNewVersion\n};\nconst actions = {\n\t...baseActions,\n\t...documentModelActions\n};\n//#endregion\n//#region document-model/constants.ts\nconst documentModelFileExtension = \"phdm\";\nconst documentModelInitialLocalState = {};\nconst documentModelInitialGlobalState = {\n\tid: \"\",\n\tname: \"\",\n\textension: \"\",\n\tdescription: \"\",\n\tauthor: {\n\t\tname: \"\",\n\t\twebsite: \"\"\n\t},\n\tspecifications: [{\n\t\tversion: 1,\n\t\tchangeLog: [],\n\t\tstate: {\n\t\t\tglobal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t}\n\t\t},\n\t\tmodules: []\n\t}]\n};\nconst documentModelGlobalState = {\n\tid: \"powerhouse/document-model\",\n\tname: \"DocumentModel\",\n\textension: \"phdm\",\n\tdescription: \"The Powerhouse Document Model describes the state and operations of a document type.\",\n\tauthor: {\n\t\tname: \"Powerhouse\",\n\t\twebsite: \"https://www.powerhouse.inc/\"\n\t},\n\tspecifications: [{\n\t\tversion: 1,\n\t\tchangeLog: [],\n\t\tstate: {\n\t\t\tglobal: {\n\t\t\t\tschema: \"type CodeExample {\\n id: ID!\\n value: String!\\n}\\n\\ntype OperationError {\\n id: ID!\\n code: String\\n name: String\\n description: String\\n template: String\\n}\\n\\ntype Operation {\\n id: ID!\\n name: String\\n schema: String\\n description: String\\n template: String\\n errors: [OperationError!]!\\n examples: [CodeExample!]!\\n reducer: String\\n scope: String\\n}\\n\\ntype Module {\\n id: ID!\\n name: String!\\n description: String\\n operations: [Operation!]!\\n}\\n\\ntype State {\\n schema: String!\\n initialValue: String!\\n examples: [CodeExample!]!\\n}\\n\\ntype ScopeState {\\n global: State!\\n local: State!\\n}\\n\\ntype Author {\\n name: String!\\n website: String\\n}\\n\\ntype DocumentSpecification {\\n version: Int!\\n state: ScopeState!\\n modules: [Module!]!\\n changeLog: [String!]!\\n}\\n\\ntype DocumentModelGlobalState {\\n name: String!\\n id: String!\\n extension: String!\\n description: String!\\n author: Author!\\n specifications: [DocumentSpecification!]!\\n}\",\n\t\t\t\tinitialValue: \"{\\n \\\"id\\\": \\\"\\\",\\n \\\"name\\\": \\\"\\\",\\n \\\"extension\\\": \\\"\\\",\\n \\\"description\\\": \\\"\\\",\\n \\\"author\\\": {\\n \\\"name\\\": \\\"\\\",\\n \\\"website\\\": \\\"\\\"\\n },\\n \\\"specifications\\\": [\\n {\\n \\\"version\\\": 1,\\n \\\"changeLog\\\": [],\\n \\\"state\\\": {\\n \\\"global\\\": {\\n \\\"schema\\\": \\\"\\\",\\n \\\"initialValue\\\": \\\"\\\",\\n \\\"examples\\\": []\\n },\\n \\\"local\\\": {\\n \\\"schema\\\": \\\"\\\",\\n \\\"initialValue\\\": \\\"\\\",\\n \\\"examples\\\": []\\n }\\n },\\n \\\"modules\\\": []\\n }\\n ]\\n}\",\n\t\t\t\texamples: []\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\tschema: \"\",\n\t\t\t\tinitialValue: \"\",\n\t\t\t\texamples: []\n\t\t\t}\n\t\t},\n\t\tmodules: [\n\t\t\t{\n\t\t\t\tname: \"header\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of the document model\",\n\t\t\t\t\t\tschema: \"input SetModelNameInput {\\n name: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_ID\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the unique identifier for the document model\",\n\t\t\t\t\t\tschema: \"input SetModelIdInput {\\n id: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_EXTENSION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the file extension associated with this document model\",\n\t\t\t\t\t\tschema: \"input SetModelExtensionInput {\\n extension: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODEL_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description text for the document model\",\n\t\t\t\t\t\tschema: \"input SetModelDescriptionInput {\\n description: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_AUTHOR_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of the document model author\",\n\t\t\t\t\t\tschema: \"input SetAuthorNameInput {\\n authorName: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_AUTHOR_WEBSITE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the website URL of the document model author\",\n\t\t\t\t\t\tschema: \"input SetAuthorWebsiteInput {\\n authorWebsite: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"versioning\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new item to the document model changelog\",\n\t\t\t\t\t\tschema: \"input AddChangeLogItemInput {\\n id: ID!\\n insertBefore: ID\\n content: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing changelog item\",\n\t\t\t\t\t\tschema: \"input UpdateChangeLogItemInput {\\n id: ID!\\n newContent: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_CHANGE_LOG_ITEM\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an item from the document model changelog\",\n\t\t\t\t\t\tschema: \"input DeleteChangeLogItemInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_CHANGE_LOG_ITEMS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of changelog items\",\n\t\t\t\t\t\tschema: \"input ReorderChangeLogItemsInput {\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"RELEASE_NEW_VERSION\",\n\t\t\t\t\t\tschema: null,\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Creates a new version of the document model specification\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"module\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_MODULE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new module to the document model specification\",\n\t\t\t\t\t\tschema: \"input AddModuleInput {\\n id: ID!\\n name: String!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODULE_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an existing module\",\n\t\t\t\t\t\tschema: \"input SetModuleNameInput {\\n id: ID!\\n name: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_MODULE_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an existing module\",\n\t\t\t\t\t\tschema: \"input SetModuleDescriptionInput {\\n id: ID!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_MODULE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a module from the document model specification\",\n\t\t\t\t\t\tschema: \"input DeleteModuleInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_MODULES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of modules in the document model specification\",\n\t\t\t\t\t\tschema: \"input ReorderModulesInput {\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation-error\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION_ERROR\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new error definition to an operation\",\n\t\t\t\t\t\tschema: \"input AddOperationErrorInput {\\n operationId: ID!\\n id: ID!\\n errorCode: String\\n errorName: String\\n errorDescription: String\\n errorTemplate: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_CODE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the error code for an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorCodeInput {\\n id: ID!\\n errorCode: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorNameInput {\\n id: ID!\\n errorName: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorDescriptionInput {\\n id: ID!\\n errorDescription: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_ERROR_TEMPLATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the template for an operation error\",\n\t\t\t\t\t\tschema: \"input SetOperationErrorTemplateInput {\\n id: ID!\\n errorTemplate: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION_ERROR\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an error definition from an operation\",\n\t\t\t\t\t\tschema: \"input DeleteOperationErrorInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_OPERATION_ERRORS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of error definitions for an operation\",\n\t\t\t\t\t\tschema: \"input ReorderOperationErrorsInput {\\n operationId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation-example\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new code example to an operation\",\n\t\t\t\t\t\tschema: \"input AddOperationExampleInput {\\n operationId: ID!\\n id: ID!\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing code example for an operation\",\n\t\t\t\t\t\tschema: \"input UpdateOperationExampleInput {\\n id: ID!\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a code example from an operation\",\n\t\t\t\t\t\tschema: \"input DeleteOperationExampleInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_OPERATION_EXAMPLES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of code examples for an operation\",\n\t\t\t\t\t\tschema: \"input ReorderOperationExamplesInput {\\n operationId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"operation\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new operation to a module\",\n\t\t\t\t\t\tschema: \"input AddOperationInput {\\n moduleId: ID!\\n id: ID!\\n name: String!\\n schema: String\\n description: String\\n template: String\\n reducer: String\\n scope: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_NAME\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the name of an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationNameInput {\\n id: ID!\\n name: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_SCHEMA\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the GraphQL schema definition for an operation's input\",\n\t\t\t\t\t\tschema: \"input SetOperationSchemaInput {\\n id: ID!\\n schema: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_DESCRIPTION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the description of an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationDescriptionInput {\\n id: ID!\\n description: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_TEMPLATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the template code for an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationTemplateInput {\\n id: ID!\\n template: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_REDUCER\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the reducer function code for an operation\",\n\t\t\t\t\t\tschema: \"input SetOperationReducerInput {\\n id: ID!\\n reducer: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_OPERATION_SCOPE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the scope of an operation (global or local)\",\n\t\t\t\t\t\tschema: \"input SetOperationScopeInput {\\n id: ID!\\n scope: String\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"MOVE_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Moves an operation from one module to another\",\n\t\t\t\t\t\tschema: \"input MoveOperationInput {\\n operationId: ID!\\n newModuleId: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_OPERATION\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes an operation from a module\",\n\t\t\t\t\t\tschema: \"input DeleteOperationInput {\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_MODULE_OPERATIONS\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of operations within a module\",\n\t\t\t\t\t\tschema: \"input ReorderModuleOperationsInput {\\n moduleId: ID!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"state\",\n\t\t\t\toperations: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_STATE_SCHEMA\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the GraphQL schema definition for document state\",\n\t\t\t\t\t\tschema: \"input SetStateSchemaInput {\\n scope: String!\\n schema: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"SET_INITIAL_STATE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Sets the initial state value for a document scope\",\n\t\t\t\t\t\tschema: \"input SetInitialStateInput {\\n scope: String!\\n initialValue: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"ADD_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Adds a new state example to a document scope\",\n\t\t\t\t\t\tschema: \"input AddStateExampleInput {\\n scope: String!\\n id: ID!\\n insertBefore: ID\\n example: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"UPDATE_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Updates an existing state example for a document scope\",\n\t\t\t\t\t\tschema: \"input UpdateStateExampleInput {\\n scope: String!\\n id: ID!\\n newExample: String!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"DELETE_STATE_EXAMPLE\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Removes a state example from a document scope\",\n\t\t\t\t\t\tschema: \"input DeleteStateExampleInput {\\n scope: String!\\n id: ID!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"REORDER_STATE_EXAMPLES\",\n\t\t\t\t\t\tid: \"\",\n\t\t\t\t\t\tdescription: \"Changes the order of state examples for a document scope\",\n\t\t\t\t\t\tschema: \"input ReorderStateExamplesInput {\\n scope: String!\\n order: [ID!]!\\n}\",\n\t\t\t\t\t\ttemplate: \"\",\n\t\t\t\t\t\treducer: \"\",\n\t\t\t\t\t\texamples: [],\n\t\t\t\t\t\terrors: [],\n\t\t\t\t\t\tscope: \"global\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tid: \"\",\n\t\t\t\tdescription: \"\"\n\t\t\t}\n\t\t]\n\t}]\n};\nconst HASH_ALGORITHM_SHA1 = \"sha1\";\nconst HASH_ALGORITHM_SHA256 = \"sha256\";\nconst HASH_ALGORITHM_SHA512 = \"sha512\";\nconst HASH_ENCODING_BASE64 = \"base64\";\nconst HASH_ENCODING_HEX = \"hex\";\n//#endregion\n//#region document-model/document-type.ts\nconst documentModelDocumentType = \"powerhouse/document-model\";\n//#endregion\n//#region document-model/document-schema.ts\nconst BaseDocumentHeaderSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tcreatedAtUtcIso: z.string(),\n\tlastModifiedAtUtcIso: z.string(),\n\tdocumentType: z.string()\n});\nconst BaseDocumentStateSchema = z.object({ global: z.unknown() });\n/** Schema for validating the header object of a DocumentModel document */\nconst DocumentModelHeaderSchema = BaseDocumentHeaderSchema.extend({ documentType: z.literal(documentModelDocumentType) });\n/** Schema for validating the state object of a DocumentModel document */\nconst DocumentModelPHStateSchema = BaseDocumentStateSchema.extend({ global: DocumentModelGlobalStateSchema() });\nconst DocumentModelSchema = z.object({\n\theader: DocumentModelHeaderSchema,\n\tstate: DocumentModelPHStateSchema,\n\tinitialState: DocumentModelPHStateSchema\n});\n/** Simple helper function to check if a state object is a DocumentModel document state object */\nfunction isDocumentModelState(state) {\n\treturn DocumentModelPHStateSchema.safeParse(state).success;\n}\n/** Simple helper function to assert that a document state object is a DocumentModel document state object */\nfunction assertIsDocumentModelState(state) {\n\tDocumentModelPHStateSchema.parse(state);\n}\n/** Simple helper function to check if a document is a DocumentModel document */\nfunction isDocumentModelDocument(document) {\n\treturn DocumentModelSchema.safeParse(document).success;\n}\n/** Simple helper function to assert that a document is a DocumentModel document */\nfunction assertIsDocumentModelDocument(document) {\n\tDocumentModelSchema.parse(document);\n}\n//#endregion\n//#region document-model/header.ts\n/**\n* Generates a deterministic payload from signing parameters\n*/\nconst generateStablePayload = (parameters) => `${parameters.documentType}:${parameters.createdAtUtcIso}:${parameters.nonce}`;\n/**\n* Creates a verification-only signer from a public key.\n* This signer can only verify signatures, not sign data.\n*\n* @param pubKey - The public key to use for verification.\n* @returns An ISigner that can only verify signatures.\n*/\nasync function createVerificationSigner(pubKey) {\n\tconst cryptoKey = await crypto.subtle.importKey(\"jwk\", pubKey, {\n\t\tname: \"ECDSA\",\n\t\tnamedCurve: \"P-256\"\n\t}, true, [\"verify\"]);\n\treturn {\n\t\tpublicKey: cryptoKey,\n\t\tasync sign(_data) {\n\t\t\tthrow new Error(\"verification-only signer cannot sign data\");\n\t\t},\n\t\tasync signAction(_action, _abortSignal) {\n\t\t\tthrow new Error(\"verification-only signer cannot sign actions\");\n\t\t},\n\t\tasync verify(data, signature) {\n\t\t\tlet isValid;\n\t\t\ttry {\n\t\t\t\tisValid = await crypto.subtle.verify({\n\t\t\t\t\tname: \"ECDSA\",\n\t\t\t\t\thash: \"SHA-256\"\n\t\t\t\t}, cryptoKey, new Uint8Array(signature), new Uint8Array(data));\n\t\t\t} catch {\n\t\t\t\tthrow new Error(\"invalid signature\");\n\t\t\t}\n\t\t\tif (!isValid) throw new Error(\"invalid signature\");\n\t\t}\n\t};\n}\n/**\n* Creates a verification-only signer from a header.\n*\n* @param header - The header to create a signer from.\n* @returns A signer that can verify the header's signature.\n*/\nconst createSignerFromHeader = async (header) => {\n\treturn createVerificationSigner(header.sig.publicKey);\n};\n/**\n* Signs a header. Generally, this is not called directly, but rather through\n* {@link createSignedHeader}.\n*\n* @param parameters - The parameters used to sign the header.\n* @param signer - The signer of the document.\n*\n* @returns The signature of the header.\n*/\nconst sign = async (parameters, signer) => {\n\tconst payload = generateStablePayload(parameters);\n\tconst data = new TextEncoder().encode(payload);\n\tconst signature = await signer.sign(data);\n\tconst signatureArray = new Uint8Array(signature);\n\treturn btoa(String.fromCharCode(...signatureArray));\n};\n/**\n* Verifies a header signature. Generally, this is not called directly, but\n* rather through {@link validateHeader}.\n*\n* @param parameters - The parameters used to sign the header.\n* @param signature - The signature to verify.\n* @param signer - The signer of the document.\n*/\nconst verify = async (parameters, signature, signer) => {\n\tconst payload = generateStablePayload(parameters);\n\tconst data = new TextEncoder().encode(payload);\n\tconst signatureBytes = Uint8Array.from(atob(signature), (c) => c.charCodeAt(0));\n\tawait signer.verify(data, signatureBytes);\n};\n/**\n* Validates a header signature.\n*/\nconst validateHeader = async (header) => {\n\tconst signer = await createSignerFromHeader(header);\n\treturn verify({\n\t\tdocumentType: header.documentType,\n\t\tcreatedAtUtcIso: header.createdAtUtcIso,\n\t\tnonce: header.sig.nonce\n\t}, header.id, signer);\n};\n/**\n* Creates a header that has yet to be signed. This header is not valid, but\n* can be input into {@link createSignedHeader} to create a signed header.\n*\n* @returns An unsigned header for a document.\n*/\nconst createPresignedHeader = (id = generateId(), documentType = \"\") => {\n\treturn {\n\t\tid,\n\t\tsig: {\n\t\t\tpublicKey: {},\n\t\t\tnonce: \"\"\n\t\t},\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tslug: \"\",\n\t\tname: \"\",\n\t\tbranch: \"main\",\n\t\trevision: { document: 0 },\n\t\tlastModifiedAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tmeta: {}\n\t};\n};\n/**\n* Creates a new, signed header for a document. This will replace the id of the\n* document.\n*\n* @param unsignedHeader - The unsigned header to created the signed header from.\n* @param signer - The signer of the document.\n*\n* @returns A new signed header for a document. Some fields are mutable and\n* some are not. See the PHDocumentHeader type for more information.\n*/\nconst createSignedHeader = async (unsignedHeader, documentType, signer) => {\n\tconst parameters = {\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: unsignedHeader.createdAtUtcIso,\n\t\tnonce: generateId()\n\t};\n\treturn {\n\t\tid: await sign(parameters, signer),\n\t\tsig: {\n\t\t\tpublicKey: await crypto.subtle.exportKey(\"jwk\", signer.publicKey),\n\t\t\tnonce: parameters.nonce\n\t\t},\n\t\tdocumentType,\n\t\tcreatedAtUtcIso: unsignedHeader.createdAtUtcIso,\n\t\tslug: unsignedHeader.slug,\n\t\tname: unsignedHeader.name,\n\t\tbranch: unsignedHeader.branch,\n\t\trevision: unsignedHeader.revision,\n\t\tlastModifiedAtUtcIso: unsignedHeader.lastModifiedAtUtcIso,\n\t\tmeta: unsignedHeader.meta\n\t};\n};\n/**\n* Creates a signed header for a document. The document header requires a signer\n* as the document id is a cryptographic signature.\n*\n* @param documentType - The type of the document.\n* @param signer - The signer of the document.\n*\n* @returns The signed header for a document. Some fields are mutable and\n* some are not. See the PHDocumentHeader type for more information.\n*/\nconst createSignedHeaderForSigner = async (documentType, signer) => {\n\treturn await createSignedHeader(createPresignedHeader(), documentType, signer);\n};\n//#endregion\n//#region document-model/documents.ts\nfunction isNoopOperation(op) {\n\treturn op.type === \"NOOP\" && op.skip !== void 0 && op.skip > 0 && op.hash !== void 0;\n}\nfunction isUndoRedo(action) {\n\treturn [\"UNDO\", \"REDO\"].includes(action.type);\n}\nfunction isUndo(action) {\n\treturn action.type === \"UNDO\";\n}\nfunction isDocumentAction(action) {\n\treturn [\n\t\t\"SET_NAME\",\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\",\n\t\t\"LOAD_STATE\"\n\t].includes(action.type);\n}\n/**\n* Important note: it is the responsibility of the caller to set the document type\n* on the header.\n*/\nfunction baseCreateDocument(createState, initialState) {\n\tconst state = createState(initialState);\n\treturn {\n\t\theader: createPresignedHeader(),\n\t\tstate,\n\t\tinitialState: state,\n\t\toperations: {\n\t\t\tglobal: [],\n\t\t\tlocal: []\n\t\t},\n\t\tclipboard: []\n\t};\n}\nfunction hashDocumentStateForScope(document, scope = \"global\") {\n\treturn hashBrowser(stringify(document.state[scope] || \"\"));\n}\nfunction readOnly(value) {\n\treturn Object.freeze(value);\n}\n/**\n* Maps skipped operations in an array of operations.\n* Skipped operations are operations that are ignored during processing.\n* @param operations - The array of operations to map.\n* @param skippedHeadOperations - The number of operations to skip at the head of the array of operations.\n* @returns An array of mapped operations with ignore flag indicating if the operation is skipped.\n* @throws Error if the operation index is invalid and there are missing operations.\n*/\nfunction mapSkippedOperations(operations, skippedHeadOperations) {\n\tconst ops = [...operations];\n\tlet skipped = skippedHeadOperations || 0;\n\tlet latestOpIndex = ops.length > 0 ? ops[ops.length - 1].index : 0;\n\tconst scopeOpsWithIgnore = [];\n\tfor (const operation of ops.reverse()) {\n\t\tif (skipped > 0) {\n\t\t\tconst operationsDiff = latestOpIndex - operation.index;\n\t\t\tskipped -= operationsDiff;\n\t\t}\n\t\tif (skipped < 0) throw new Error(\"Invalid operation index, missing operations\");\n\t\tconst mappedOp = {\n\t\t\tignore: skipped > 0,\n\t\t\toperation\n\t\t};\n\t\tconst operationSkip = operation.skip > 0 ? operation.skip + 1 : 0;\n\t\tif (operationSkip > 0 && operationSkip > skipped) {\n\t\t\tconst skipDiff = operationSkip - skipped;\n\t\t\tskipped = skipped + skipDiff;\n\t\t}\n\t\tlatestOpIndex = operation.index;\n\t\tscopeOpsWithIgnore.push(mappedOp);\n\t}\n\treturn scopeOpsWithIgnore.reverse();\n}\n/**\n* V2 version of mapSkippedOperations for protocol version 2+.\n* In V2, all NOOPs have skip=1 and consecutive NOOPs form chains.\n* N consecutive NOOPs at any point skip N preceding content operations.\n*\n* Algorithm: Process from end to start\n* - When hitting a NOOP: increment chain length, mark as ignored\n* - When hitting a non-NOOP:\n* - If chain > 0: decrement chain, mark as ignored (this op was undone)\n* - If chain == 0: mark as not ignored (apply this op)\n*/\nfunction mapSkippedOperationsV2(operations) {\n\tconst ops = [...operations];\n\tconst result = [];\n\tlet noopChainLength = 0;\n\tfor (let i = ops.length - 1; i >= 0; i--) {\n\t\tconst operation = ops[i];\n\t\tif (operation.action.type === \"NOOP\") {\n\t\t\tnoopChainLength++;\n\t\t\tresult.unshift({\n\t\t\t\tignore: true,\n\t\t\t\toperation\n\t\t\t});\n\t\t} else if (noopChainLength > 0) {\n\t\t\tnoopChainLength--;\n\t\t\tresult.unshift({\n\t\t\t\tignore: true,\n\t\t\t\toperation\n\t\t\t});\n\t\t} else result.unshift({\n\t\t\tignore: false,\n\t\t\toperation\n\t\t});\n\t}\n\treturn result;\n}\n/**\n* V2 garbage collect that returns only operations that should be applied for state.\n* Uses the V2 model where consecutive NOOPs form chains.\n* Unlike V1 garbageCollect, this preserves ALL operations but marks which to apply.\n*/\nfunction garbageCollectV2(sortedOperations) {\n\tconst result = [];\n\tlet noopChainLength = 0;\n\tfor (let i = sortedOperations.length - 1; i >= 0; i--) {\n\t\tconst op = sortedOperations[i];\n\t\tif (\"action\" in op && op.action.type === \"NOOP\" && op.skip > 0) {\n\t\t\tnoopChainLength++;\n\t\t\tresult.unshift(op);\n\t\t} else if (noopChainLength > 0) noopChainLength--;\n\t\telse result.unshift(op);\n\t}\n\treturn result;\n}\nfunction sortMappedOperations(operations) {\n\treturn Object.values(operations).flatMap((array) => array).sort((a, b) => new Date(a.operation.timestampUtcMs).getTime() - new Date(b.operation.timestampUtcMs).getTime());\n}\nconst defaultCreateState = (state) => {\n\treturn state;\n};\nfunction replayDocument(initialState, operations, reducer, header, dispatch, skipHeaderOperations = {}, options) {\n\tconst { checkHashes = true, reuseOperationResultingState, operationResultingStateParser = parseResultingState, skipIndexValidation } = options || {};\n\tlet documentState = initialState;\n\tconst operationsToReplay = [];\n\tconst allScopes = new Set([\n\t\t...Object.keys(operations),\n\t\t\"global\",\n\t\t\"local\"\n\t]);\n\tconst initialOperations = {};\n\tfor (const scope of allScopes) initialOperations[scope] = [];\n\tif (reuseOperationResultingState) for (const [scope, scopeOperations] of Object.entries(operations)) {\n\t\tif (!scopeOperations) continue;\n\t\tconst index = scopeOperations.findLastIndex((s) => !!s.resultingState);\n\t\tif (index < 0) {\n\t\t\toperationsToReplay.push(...scopeOperations);\n\t\t\tcontinue;\n\t\t}\n\t\tconst opWithState = scopeOperations[index];\n\t\tif (!opWithState || !opWithState.resultingState) continue;\n\t\ttry {\n\t\t\tconst scopeState = operationResultingStateParser(opWithState.resultingState);\n\t\t\tdocumentState = {\n\t\t\t\t...documentState,\n\t\t\t\t[scope]: scopeState\n\t\t\t};\n\t\t\tconst scopeInitialOps = initialOperations[scope];\n\t\t\tif (scopeInitialOps) scopeInitialOps.push(...scopeOperations.slice(0, index + 1));\n\t\t\toperationsToReplay.push(...scopeOperations.slice(index + 1));\n\t\t} catch {\n\t\t\toperationsToReplay.push(...scopeOperations);\n\t\t}\n\t}\n\telse operationsToReplay.push(...Object.values(operations).flatMap((ops) => ops || []));\n\tconst document = {\n\t\theader,\n\t\tstate: defaultCreateState(documentState),\n\t\tinitialState,\n\t\toperations: initialOperations,\n\t\tclipboard: []\n\t};\n\tlet result = document;\n\tif (operationsToReplay.length) result = operationsToReplay.reduce((document, operation) => {\n\t\treturn reducer(document, operation.action, dispatch, {\n\t\t\tignoreSkipOperations: true,\n\t\t\tcheckHashes,\n\t\t\tskipIndexValidation,\n\t\t\treplayOptions: { operation }\n\t\t});\n\t}, document);\n\telse for (const scopeOperations of Object.values(initialOperations)) {\n\t\tif (!scopeOperations) continue;\n\t\tconst lastOperation = scopeOperations.at(-1);\n\t\tif (lastOperation) result = updateHeaderRevision(result, lastOperation.action.scope, lastOperation.timestampUtcMs);\n\t}\n\tif (!checkHashes) for (const scope of Object.keys(result.state)) for (let i = operationsToReplay.length - 1; i >= 0; i--) {\n\t\tconst operation = operationsToReplay[i];\n\t\tif (operation.action.scope !== scope) continue;\n\t\tif (operation.hash !== hashDocumentStateForScope(result, scope)) throw new HashMismatchError(scope, result, operation);\n\t\telse break;\n\t}\n\tconst allResultScopes = new Set([\n\t\t...Object.keys(result.operations),\n\t\t...Object.keys(operations),\n\t\t\"global\",\n\t\t\"local\"\n\t]);\n\tconst initialResultOperations = {};\n\tfor (const scope of allResultScopes) initialResultOperations[scope] = [];\n\tconst resultOperations = Array.from(allResultScopes).reduce((acc, scope) => {\n\t\tconst scopeOps = result.operations[scope] || [];\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: [...scopeOps.map((operation, index) => {\n\t\t\t\treturn {\n\t\t\t\t\t...operation,\n\t\t\t\t\ttimestamp: operations[scope]?.[index]?.timestampUtcMs ?? operation.timestampUtcMs\n\t\t\t\t};\n\t\t\t})]\n\t\t};\n\t}, initialResultOperations);\n\tconst lastModified = header ? header.lastModifiedAtUtcIso : Object.values(resultOperations).reduce((acc, curr) => {\n\t\tif (!curr) return acc;\n\t\tconst operation = curr.at(-1);\n\t\tif (operation) {\n\t\t\tif (operation.timestampUtcMs > acc) return operation.timestampUtcMs;\n\t\t}\n\t\treturn acc;\n\t}, document.header.lastModifiedAtUtcIso);\n\tif (header) result.header = {\n\t\t...header,\n\t\trevision: result.header.revision,\n\t\tlastModifiedAtUtcIso: lastModified\n\t};\n\treturn {\n\t\t...result,\n\t\toperations: resultOperations\n\t};\n}\nfunction parseResultingState(state) {\n\tconst stateType = typeof state;\n\tif (stateType === \"string\") return JSON.parse(state);\n\telse if (stateType === \"object\") return state;\n\telse throw new Error(`Providing resulting state is of type: ${stateType}`);\n}\nlet IntegrityIssueType = /* @__PURE__ */ function(IntegrityIssueType) {\n\tIntegrityIssueType[\"UNEXPECTED_INDEX\"] = \"UNEXPECTED_INDEX\";\n\treturn IntegrityIssueType;\n}({});\nlet IntegrityIssueSubType = /* @__PURE__ */ function(IntegrityIssueSubType) {\n\tIntegrityIssueSubType[\"DUPLICATED_INDEX\"] = \"DUPLICATED_INDEX\";\n\tIntegrityIssueSubType[\"MISSING_INDEX\"] = \"MISSING_INDEX\";\n\treturn IntegrityIssueSubType;\n}({});\nfunction checkCleanedOperationsIntegrity(sortedOperations) {\n\tconst result = [];\n\tlet currentIndex = -1;\n\tfor (const nextOperation of sortedOperations) {\n\t\tconst nextIndex = nextOperation.index - nextOperation.skip;\n\t\tif (nextIndex !== currentIndex + 1) result.push({\n\t\t\toperation: {\n\t\t\t\tindex: nextOperation.index,\n\t\t\t\tskip: nextOperation.skip\n\t\t\t},\n\t\t\tissue: IntegrityIssueType.UNEXPECTED_INDEX,\n\t\t\tcategory: nextIndex > currentIndex + 1 ? IntegrityIssueSubType.MISSING_INDEX : IntegrityIssueSubType.DUPLICATED_INDEX,\n\t\t\tmessage: `Expected index ${currentIndex + 1} with skip 0 or equivalent, got index ${nextOperation.index} with skip ${nextOperation.skip}`\n\t\t});\n\t\tcurrentIndex = nextOperation.index;\n\t}\n\treturn result;\n}\nfunction garbageCollect(sortedOperations) {\n\tconst result = [];\n\tlet i = sortedOperations.length - 1;\n\twhile (i > -1) {\n\t\tresult.unshift(sortedOperations[i]);\n\t\tconst skipUntil = (sortedOperations[i]?.index || 0) - (sortedOperations[i]?.skip || 0) - 1;\n\t\tlet j = i - 1;\n\t\twhile (j > -1 && (sortedOperations[j]?.index || 0) > skipUntil) j--;\n\t\ti = j;\n\t}\n\treturn result;\n}\nfunction addUndo(sortedOperations) {\n\tconst operationsCopy = [...sortedOperations];\n\tconst latestOperation = operationsCopy[operationsCopy.length - 1];\n\tif (!latestOperation) return operationsCopy;\n\tif (latestOperation.action.type === \"NOOP\") operationsCopy.push({\n\t\t...latestOperation,\n\t\tindex: latestOperation.index,\n\t\tskip: nextSkipNumber(sortedOperations),\n\t\taction: {\n\t\t\t...latestOperation.action,\n\t\t\tid: generateId(),\n\t\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\ttype: \"NOOP\"\n\t\t}\n\t});\n\telse operationsCopy.push({\n\t\tid: generateId(),\n\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\tindex: latestOperation.index + 1,\n\t\tskip: 1,\n\t\thash: latestOperation.hash,\n\t\taction: {\n\t\t\tid: generateId(),\n\t\t\ttimestampUtcMs: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\ttype: \"NOOP\",\n\t\t\tinput: {},\n\t\t\tscope: latestOperation.action.scope\n\t\t}\n\t});\n\treturn operationsCopy;\n}\nfunction sortOperations(operations) {\n\treturn operations.slice().sort((a, b) => a.skip - b.skip).sort((a, b) => a.index - b.index);\n}\nfunction reshuffleByTimestamp(startIndex, opsA, opsB) {\n\treturn [...opsA, ...opsB].sort((a, b) => {\n\t\tconst timestampDiff = new Date(a.timestampUtcMs || \"\").getTime() - new Date(b.timestampUtcMs || \"\").getTime();\n\t\tif (timestampDiff !== 0) return timestampDiff;\n\t\treturn (a.id || \"\").localeCompare(b.id || \"\");\n\t}).map((op, i) => ({\n\t\t...op,\n\t\tindex: startIndex.index + i,\n\t\tskip: i === 0 ? startIndex.skip : 0\n\t}));\n}\nfunction reshuffleByTimestampAndIndex(startIndex, opsA, opsB) {\n\treturn [...opsA, ...opsB].sort((a, b) => {\n\t\tconst indexDiff = a.index - b.index;\n\t\tif (indexDiff !== 0) return indexDiff;\n\t\tconst timestampDiff = new Date(a.timestampUtcMs || \"\").getTime() - new Date(b.timestampUtcMs || \"\").getTime();\n\t\tif (timestampDiff !== 0) return timestampDiff;\n\t\treturn (a.id || \"\").localeCompare(b.id || \"\");\n\t}).map((op, i) => ({\n\t\t...op,\n\t\tindex: startIndex.index + i,\n\t\tskip: i === 0 ? startIndex.skip : 0\n\t}));\n}\nfunction operationsAreEqual(op1, op2) {\n\tconst a = op1;\n\tconst b = op2;\n\tconst aComparable = {\n\t\tindex: a.index,\n\t\tskip: a.skip,\n\t\ttype: a.type ?? null,\n\t\tscope: a.scope ?? null,\n\t\tinput: a.input ?? null\n\t};\n\tconst bComparable = {\n\t\tindex: b.index,\n\t\tskip: b.skip,\n\t\ttype: b.type ?? null,\n\t\tscope: b.scope ?? null,\n\t\tinput: b.input ?? null\n\t};\n\treturn stringify(aComparable) === stringify(bComparable);\n}\nfunction attachBranch(trunk, newBranch) {\n\tconst trunkCopy = garbageCollect(sortOperations(trunk.slice()));\n\tconst newOperations = garbageCollect(sortOperations(newBranch.slice()));\n\tif (trunkCopy.length < 1) return [newOperations, []];\n\tconst result = [];\n\tlet enteredBranch = false;\n\twhile (newOperations.length > 0) {\n\t\tconst newOperationCandidate = newOperations[0];\n\t\tlet nextTrunkOperation = trunkCopy.shift();\n\t\twhile (nextTrunkOperation && precedes(nextTrunkOperation, newOperationCandidate)) {\n\t\t\tresult.push(nextTrunkOperation);\n\t\t\tnextTrunkOperation = trunkCopy.shift();\n\t\t}\n\t\tif (!nextTrunkOperation) enteredBranch = true;\n\t\telse if (!enteredBranch) if (operationsAreEqual(nextTrunkOperation, newOperationCandidate)) {\n\t\t\tnewOperations.shift();\n\t\t\tresult.push(nextTrunkOperation);\n\t\t} else {\n\t\t\ttrunkCopy.unshift(nextTrunkOperation);\n\t\t\tenteredBranch = true;\n\t\t}\n\t\tif (enteredBranch) {\n\t\t\tlet nextAppend = newOperations.shift();\n\t\t\twhile (nextAppend) {\n\t\t\t\tresult.push(nextAppend);\n\t\t\t\tnextAppend = newOperations.shift();\n\t\t\t}\n\t\t}\n\t}\n\tif (!enteredBranch) {\n\t\tlet nextAppend = trunkCopy.shift();\n\t\twhile (nextAppend) {\n\t\t\tresult.push(nextAppend);\n\t\t\tnextAppend = trunkCopy.shift();\n\t\t}\n\t}\n\treturn [garbageCollect(result), trunkCopy];\n}\nfunction precedes(op1, op2) {\n\treturn op1.index < op2.index || op1.index === op2.index && op1.id === op2.id && op1.skip < op2.skip;\n}\nfunction split(sortedTargetOperations, sortedMergeOperations) {\n\tconst commonOperations = [];\n\tconst targetDiffOperations = [];\n\tconst mergeDiffOperations = [];\n\tconst maxLength = Math.max(sortedTargetOperations.length, sortedMergeOperations.length);\n\tlet splitHappened = false;\n\tfor (let i = 0; i < maxLength; i++) {\n\t\tconst targetOperation = sortedTargetOperations[i];\n\t\tconst mergeOperation = sortedMergeOperations[i];\n\t\tif (targetOperation && mergeOperation) if (!splitHappened && operationsAreEqual(targetOperation, mergeOperation)) commonOperations.push(targetOperation);\n\t\telse {\n\t\t\tsplitHappened = true;\n\t\t\ttargetDiffOperations.push(targetOperation);\n\t\t\tmergeDiffOperations.push(mergeOperation);\n\t\t}\n\t\telse if (targetOperation) targetDiffOperations.push(targetOperation);\n\t\telse if (mergeOperation) mergeDiffOperations.push(mergeOperation);\n\t}\n\treturn [\n\t\tcommonOperations,\n\t\ttargetDiffOperations,\n\t\tmergeDiffOperations\n\t];\n}\nfunction merge(sortedTargetOperations, sortedMergeOperations, reshuffle) {\n\tconst [_commonOperations, _targetOperations, _mergeOperations] = split(garbageCollect(sortedTargetOperations), garbageCollect(sortedMergeOperations));\n\tconst maxCommonIndex = getMaxIndex(_commonOperations);\n\tconst nextIndex = 1 + Math.max(maxCommonIndex, getMaxIndex(_targetOperations), getMaxIndex(_mergeOperations));\n\tconst filteredMergeOperations = filterDuplicatedOperations(_mergeOperations, _targetOperations);\n\tconst newOperationHistory = reshuffle({\n\t\tindex: nextIndex,\n\t\tskip: nextIndex - (maxCommonIndex + 1)\n\t}, _targetOperations, filteredMergeOperations);\n\treturn _commonOperations.concat(newOperationHistory);\n}\nfunction getMaxIndex(sortedOperations) {\n\tconst lastElement = sortedOperations[sortedOperations.length - 1];\n\tif (!lastElement) return -1;\n\treturn lastElement.index;\n}\nfunction nextSkipNumber(sortedOperations) {\n\tif (sortedOperations.length < 1) return -1;\n\tconst cleanedOperations = garbageCollect(sortedOperations);\n\tlet nextSkip = (cleanedOperations[cleanedOperations.length - 1]?.skip || 0) + 1;\n\tif (cleanedOperations.length > 1) nextSkip += cleanedOperations[cleanedOperations.length - 2]?.skip || 0;\n\treturn (cleanedOperations[cleanedOperations.length - 1]?.index || -1) < nextSkip ? -1 : nextSkip;\n}\nfunction checkOperationsIntegrity(operations) {\n\treturn checkCleanedOperationsIntegrity(garbageCollect(sortOperations(operations)));\n}\nfunction groupOperationsByScope(operations) {\n\treturn operations.reduce((acc, operation) => {\n\t\tif (!acc[operation.action.scope]) acc[operation.action.scope] = [];\n\t\tacc[operation.action.scope]?.push(operation);\n\t\treturn acc;\n\t}, {});\n}\nfunction prepareOperations(operationsHistory, newOperations) {\n\tconst result = {\n\t\tintegrityIssues: [],\n\t\tvalidOperations: [],\n\t\tinvalidOperations: [],\n\t\tduplicatedOperations: []\n\t};\n\tconst sortedOperationsHistory = sortOperations(operationsHistory);\n\tconst sortedOperations = sortOperations(newOperations);\n\tconst integrityErrors = checkCleanedOperationsIntegrity([...sortedOperationsHistory, ...sortedOperations]);\n\tconst firstMissingIndexOperation = [...integrityErrors.filter((integrityIssue) => integrityIssue.category === IntegrityIssueSubType.MISSING_INDEX)].sort((a, b) => b.operation.index - a.operation.index).pop()?.operation;\n\tfor (const newOperation of sortedOperations) {\n\t\tif (firstMissingIndexOperation && newOperation.index >= firstMissingIndexOperation.index) {\n\t\t\tresult.invalidOperations.push(newOperation);\n\t\t\tcontinue;\n\t\t}\n\t\tif (integrityErrors.some((integrityError) => {\n\t\t\treturn integrityError.operation.index === newOperation.index && integrityError.operation.skip === newOperation.skip && integrityError.category === IntegrityIssueSubType.DUPLICATED_INDEX;\n\t\t})) {\n\t\t\tresult.duplicatedOperations.push(newOperation);\n\t\t\tcontinue;\n\t\t}\n\t\tresult.validOperations.push(newOperation);\n\t}\n\tresult.integrityIssues.push(...integrityErrors);\n\treturn result;\n}\nfunction removeExistingOperations(newOperations, operationsHistory) {\n\treturn newOperations.filter((newOperation) => {\n\t\treturn !operationsHistory.some((historyOperation) => {\n\t\t\treturn newOperation.action.type === \"NOOP\" && newOperation.skip === 0 && newOperation.index === historyOperation.index || newOperation.index === historyOperation.index && newOperation.skip === historyOperation.skip && newOperation.action.scope === historyOperation.action.scope && newOperation.hash === historyOperation.hash && newOperation.action.type === historyOperation.action.type;\n\t\t});\n\t});\n}\n/**\n* Skips header operations and returns the remaining operations.\n*\n* @param operations - The array of operations.\n* @param skipHeaderOperation - The skip header operation index.\n* @returns The remaining operations after skipping header operations.\n*/\nfunction skipHeaderOperations(operations, skipHeaderOperation) {\n\tconst lastIndex = sortOperations(operations).at(-1)?.index ?? -1;\n\tconst nextIndex = lastIndex + 1;\n\tconst skipOperationIndex = {\n\t\t...skipHeaderOperation,\n\t\tindex: skipHeaderOperation.index ?? nextIndex\n\t};\n\tif (skipOperationIndex.index < lastIndex) throw new Error(`The skip header operation index must be greater than or equal to ${lastIndex}`);\n\treturn garbageCollect(sortOperations([...operations, skipOperationIndex])).slice(0, -1);\n}\nfunction garbageCollectDocumentOperations(documentOperations) {\n\treturn Object.entries(documentOperations).reduce((acc, entry) => {\n\t\tconst [scope, ops] = entry;\n\t\tif (!ops) return acc;\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: garbageCollect(sortOperations(ops))\n\t\t};\n\t}, {});\n}\n/**\n* Filters out duplicated operations from the target operations array based on their IDs.\n* If an operation has an ID, it is considered duplicated if there is another operation in the source operations array with the same ID.\n* If an operation does not have an ID, it is considered unique and will not be filtered out.\n* @param targetOperations - The array of target operations to filter.\n* @param sourceOperations - The array of source operations to compare against.\n* @returns An array of operations with duplicates filtered out.\n*/\nfunction filterDuplicatedOperations(targetOperations, sourceOperations) {\n\treturn targetOperations.filter((op) => {\n\t\tif (op.id) return !sourceOperations.some((targetOp) => targetOp.id === op.id);\n\t\treturn true;\n\t});\n}\nfunction filterDocumentOperationsResultingState(documentOperations) {\n\tif (!documentOperations) return {};\n\treturn Object.entries(documentOperations).reduce((acc, [scope, operations]) => {\n\t\tif (!operations) return acc;\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[scope]: operations.map((op) => {\n\t\t\t\tconst { resultingState, ...restProps } = op;\n\t\t\t\treturn restProps;\n\t\t\t})\n\t\t};\n\t}, {});\n}\n/**\n* Calculates the difference between two arrays of operations.\n* Returns an array of operations that are present in `clearedOperationsA` but not in `clearedOperationsB`.\n*\n* @template TOp - The type of the operations.\n* @param {TOp[]} clearedOperationsA - The first array of operations.\n* @param {TOp[]} clearedOperationsB - The second array of operations.\n* @returns {TOp[]} - The difference between the two arrays of operations.\n*/\nfunction diffOperations(clearedOperationsA, clearedOperationsB) {\n\treturn clearedOperationsA.filter((operationA) => !clearedOperationsB.some((operationB) => operationA.index === operationB.index));\n}\nfunction getDocumentLastModified(document) {\n\tlet latest;\n\tfor (const ops of Object.values(document.operations)) {\n\t\tif (!ops) continue;\n\t\tfor (const op of ops) if (!latest || op.index > latest.index || op.index === latest.index && op.skip > latest.skip) latest = op;\n\t}\n\treturn latest?.timestampUtcMs || document.header.lastModifiedAtUtcIso;\n}\n/**\n* Gets the next revision number based on the provided scope.\n*\n* @param state The current state of the document.\n* @param scope The scope of the operation.\n* @returns The next revision number.\n*/\nfunction getNextRevision(document, scope) {\n\treturn (document.operations[scope]?.at(-1)?.index ?? -1) + 1;\n}\n/**\n* Updates the document header with the latest revision number and\n* date of last modification.\n*\n* @param document The current state of the document.\n* @param scope The scope of the operation.\n* @param lastModifiedTimestamp Optional timestamp to use directly, avoiding a scan of all operations.\n* @returns The updated document state.\n*/\nfunction updateHeaderRevision(document, scope, lastModifiedTimestamp) {\n\tconst newTimestamp = lastModifiedTimestamp ?? getDocumentLastModified(document);\n\tconst currentTimestamp = document.header.lastModifiedAtUtcIso;\n\tconst header = {\n\t\t...document.header,\n\t\trevision: {\n\t\t\t...document.header.revision,\n\t\t\t[scope]: getNextRevision(document, scope)\n\t\t},\n\t\tlastModifiedAtUtcIso: !currentTimestamp || newTimestamp > currentTimestamp ? newTimestamp : currentTimestamp\n\t};\n\treturn {\n\t\t...document,\n\t\theader\n\t};\n}\n//#endregion\n//#region document-model/operations.ts\nfunction setNameOperation(document, input) {\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tname: input.name\n\t\t}\n\t};\n}\nfunction undoOperation(document, action, skip) {\n\tconst { scope } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tconst sortedOperations = sortOperations([...document.operations[scope]]);\n\t\tdraft.action = noop(scope);\n\t\tconst lastOperation = sortedOperations.at(-1);\n\t\tlet nextIndex = lastOperation?.index ?? -1;\n\t\tconst isNewNoop = lastOperation?.action.type !== \"NOOP\";\n\t\tif (isNewNoop) nextIndex = nextIndex + 1;\n\t\telse draft.reuseLastOperationIndex = true;\n\t\tdraft.skip = nextSkipNumber(isNewNoop ? [...sortedOperations, {\n\t\t\tindex: nextIndex,\n\t\t\tskip: 0\n\t\t}] : sortedOperations);\n\t\tif (lastOperation && draft.skip > lastOperation.skip + 1) draft.skip = draft.skip + 1;\n\t\tif (draft.skip < 0) throw new Error(`Cannot undo: you can't undo more operations than the ones in the scope history`);\n\t});\n}\n/**\n* V2 of undoOperation for protocol version 2+.\n* Key differences from undoOperation:\n* - Never reuses operation index (always increments)\n* - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)\n* - No complex skip calculation - simpler model where each UNDO is independent\n*/\nfunction undoOperationV2(document, action, skip) {\n\tconst { scope } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tconst sortedOperations = sortOperations([...document.operations[scope] || []]);\n\t\tconst nonNoopOps = sortedOperations.filter((op) => op.action.type !== \"NOOP\");\n\t\tlet noopChainLength = 0;\n\t\tfor (let i = sortedOperations.length - 1; i >= 0; i--) if (sortedOperations[i].action.type === \"NOOP\") noopChainLength++;\n\t\telse break;\n\t\tif (nonNoopOps.length <= noopChainLength) throw new Error(`Cannot undo: no more operations to undo in scope history`);\n\t\tdraft.action = noop(scope);\n\t\tdraft.skip = 1;\n\t});\n}\nfunction redoOperation(document, action, skip) {\n\tconst { scope, input } = action;\n\treturn create({\n\t\tdocument,\n\t\taction,\n\t\tskip,\n\t\treuseLastOperationIndex: false\n\t}, (draft) => {\n\t\tif (draft.skip > 0) throw new Error(`Cannot redo: skip value from reducer cannot be used with REDO action`);\n\t\tconst count = typeof input === \"object\" && input !== null && \"count\" in input ? input.count : input;\n\t\tif (typeof count !== \"number\" || count > 1) throw new Error(`Cannot redo: you can only redo one operation at a time`);\n\t\tif (typeof count !== \"number\" || count < 1) throw new Error(`Invalid REDO action: invalid redo input value`);\n\t\tif (draft.document.clipboard.length < 1) throw new Error(`Cannot redo: no operations in the clipboard`);\n\t\tconst operationIndex = draft.document.clipboard.findLastIndex((op) => op.action.scope === scope);\n\t\tif (operationIndex < 0) throw new Error(`Cannot redo: no operations in clipboard for scope \"${scope}\"`);\n\t\tconst operation = draft.document.clipboard.splice(operationIndex, 1)[0];\n\t\tdraft.action = castDraft({\n\t\t\ttype: operation.action.type,\n\t\t\tscope: operation.action.scope,\n\t\t\tinput: operation.action.input\n\t\t});\n\t});\n}\nfunction loadStateOperation(document, action) {\n\treturn {\n\t\t...document,\n\t\theader: {\n\t\t\t...document.header,\n\t\t\tname: action.state.name\n\t\t},\n\t\tstate: action.state.data\n\t};\n}\n//#endregion\n//#region document-model/reducer.ts\nfunction replayOperations(initialState, clearedOperations, stateReducer, header, dispatch, documentReducer = baseReducer, skipHeaderOperations = {}, options) {\n\treturn replayDocument(initialState, clearedOperations, createReducer(stateReducer, documentReducer), header, dispatch, skipHeaderOperations, options);\n}\n/**\n* Updates the operations history of the document based on the provided action.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param index The index of the operation to update.\n* @param skip The number of operations to skip before applying the action.\n* @param reuseLastOperationIndex Whether to reuse the last operation index (used when a an UNDO operation is performed after an existing one).\n* @param context The operation context for deterministic ID generation.\n* @returns The updated document state.\n*/\nfunction updateOperationsForAction(document, action, reuseLastOperationIndex, skip, context) {\n\tif ([\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\"\n\t].includes(action.type)) return document;\n\tconst scope = action.scope;\n\tconst existing = document.operations[scope];\n\tconst lastOperationIndex = existing?.at(-1)?.index ?? -1;\n\tconst newOperation = operationFromAction(action, reuseLastOperationIndex ? lastOperationIndex : lastOperationIndex + 1, skip, context);\n\tconst operations = [...existing ?? [], newOperation];\n\treturn {\n\t\t...document,\n\t\toperations: {\n\t\t\t...document.operations,\n\t\t\t[scope]: operations\n\t\t}\n\t};\n}\nfunction updateOperationsForOperation(document, operation, reuseLastOperationIndex, skip, context, skipIndexValidation) {\n\tconst scope = operation.action.scope;\n\tconst existing = document.operations[scope];\n\tconst lastOperationIndex = existing?.at(-1)?.index ?? -1;\n\tconst nextIndex = reuseLastOperationIndex ? lastOperationIndex : lastOperationIndex + 1;\n\tif (!skipIndexValidation && operation.index - skip > nextIndex) throw new Error(`Missing operations: expected ${nextIndex} with skip 0 or equivalent, got index ${operation.index} with skip ${skip}`);\n\tconst newOperation = operationFromOperation(operation, operation.index, skip, context);\n\tconst operations = [...existing ?? [], newOperation];\n\treturn {\n\t\t...document,\n\t\toperations: {\n\t\t\t...document.operations,\n\t\t\t[scope]: operations\n\t\t}\n\t};\n}\n/**\n* Updates the document state based on the provided action.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param skip The number of operations to skip before applying the action.\n* @param reuseLastOperationIndex Whether to reuse the last operation index (used when a an UNDO operation is performed after an existing one).\n* @param context The operation context for deterministic ID generation.\n* @returns The updated document state.\n*/\nfunction updateDocument(document, action, reuseLastOperationIndex, skip, context, operation, skipIndexValidation) {\n\tlet newDocument;\n\tif (operation) newDocument = updateOperationsForOperation(document, operation, reuseLastOperationIndex, skip, context, skipIndexValidation);\n\telse newDocument = updateOperationsForAction(document, action, reuseLastOperationIndex, skip, context);\n\tnewDocument = updateHeaderRevision(newDocument, action.scope, action.timestampUtcMs);\n\treturn newDocument;\n}\n/**\n* The base document reducer function that wraps a custom reducer function.\n*\n* @param state The current state of the document.\n* @param action The action being applied to the document.\n* @param wrappedReducer The custom reducer function being wrapped by the base reducer.\n* @returns The updated document state.\n*/\nfunction _baseReducer(document, action, wrappedReducer) {\n\tconst parsedAction = DocumentActionSchema().parse(action);\n\tswitch (parsedAction.type) {\n\t\tcase \"SET_NAME\": return setNameOperation(document, parsedAction.input);\n\t\tcase \"PRUNE\": return pruneOperation(document, parsedAction.input, wrappedReducer);\n\t\tcase \"LOAD_STATE\": return loadStateOperation(document, parsedAction.input);\n\t\tdefault: return document;\n\t}\n}\n/**\n* Processes an UNDO or REDO action.\n*\n* @param document The current state of the document.\n* @param action The action being applied to the document.\n* @param skip The number of operations to skip before applying the action.\n* @returns The updated document, calculated skip value and transformed action (if applied).\n*/\nfunction processUndoRedo(document, action, skip, protocolVersion = 1) {\n\tswitch (action.type) {\n\t\tcase \"UNDO\":\n\t\t\tif (protocolVersion >= 2) return undoOperationV2(document, action, skip);\n\t\t\treturn undoOperation(document, action, skip);\n\t\tcase \"REDO\": return redoOperation(document, action, skip);\n\t\tdefault: return {\n\t\t\tdocument,\n\t\t\taction,\n\t\t\tskip,\n\t\t\treuseLastOperationIndex: false\n\t\t};\n\t}\n}\nfunction processSkipOperation(document, action, customReducer, skipValue, reuseOperationResultingState = false, resultingStateParser = parseResultingState) {\n\tconst scope = action.scope;\n\tconst scopeOperations = document.operations[scope];\n\tif (!scopeOperations) return document;\n\tconst latestOperation = scopeOperations.at(-1);\n\tif (!latestOperation) return document;\n\tconst documentOperations = garbageCollectDocumentOperations({\n\t\t...document.operations,\n\t\t[scope]: skipHeaderOperations(scopeOperations, latestOperation)\n\t});\n\tlet scopeState = void 0;\n\tconst lastRemainingOperation = documentOperations[scope]?.at(-1);\n\tif (reuseOperationResultingState && lastRemainingOperation?.resultingState) scopeState = resultingStateParser(lastRemainingOperation.resultingState);\n\telse {\n\t\tconst { state } = replayOperations(document.initialState, documentOperations, customReducer, document.header, void 0, void 0, void 0, {\n\t\t\treuseOperationResultingState,\n\t\t\toperationResultingStateParser: resultingStateParser,\n\t\t\tskipIndexValidation: true\n\t\t});\n\t\tscopeState = state[scope];\n\t}\n\treturn {\n\t\t...document,\n\t\tstate: {\n\t\t\t...document.state,\n\t\t\t[scope]: scopeState\n\t\t},\n\t\toperations: garbageCollectDocumentOperations({ ...document.operations })\n\t};\n}\nfunction processUndoOperation(document, scope, customReducer, reuseOperationResultingState = false, resultingStateParser = parseResultingState) {\n\tconst scopeOperations = document.operations[scope];\n\tif (!scopeOperations) return document;\n\tconst sortedOperations = sortOperations([...scopeOperations]);\n\tsortedOperations.pop();\n\tconst documentOperations = garbageCollectDocumentOperations({ ...document.operations });\n\tconst documentScopeOps = documentOperations[scope];\n\tif (!documentScopeOps) return document;\n\tconst clearedOperations = [...documentScopeOps];\n\tconst diff = diffOperations(garbageCollect(sortedOperations), clearedOperations);\n\tconst doc = replayOperations(document.initialState, documentOperations, customReducer, document.header, void 0, void 0, void 0, {\n\t\treuseOperationResultingState,\n\t\toperationResultingStateParser: resultingStateParser\n\t});\n\tconst clipboard = sortOperations([...document.clipboard, ...diff].filter((op) => op.action.type !== \"NOOP\")).reverse();\n\treturn {\n\t\t...doc,\n\t\tclipboard\n\t};\n}\n/**\n* Base document reducer that wraps a custom document reducer and handles\n* document-level actions such as undo, redo, prune, and set name.\n*\n* @template TGlobalState - The type of the state of the custom reducer.\n* @template TAction - The type of the actions of the custom reducer.\n* @param state - The current state of the document.\n* @param action - The action object to apply to the state.\n* @param customReducer - The custom reducer that implements the application logic\n* specific to the document's state.\n* @returns The new state of the document.\n*/\nfunction baseReducer(document, action, customReducer, dispatch, options = {}) {\n\tconst { skip, ignoreSkipOperations = false, reuseOperationResultingState = false, operationResultingStateParser, pruneOnSkip = true, branch = \"main\" } = options;\n\tlet _action = actionFromAction(action);\n\tlet skipValue = skip ?? options.replayOptions?.operation.skip ?? 0;\n\tlet newDocument = { ...document };\n\tlet reuseLastOperationIndex = false;\n\tconst shouldProcessSkipOperation = !ignoreSkipOperations && skipValue > 0;\n\tif (isUndoRedo(_action)) {\n\t\tconst { skip: calculatedSkip, action: transformedAction, document: processedDocument, reuseLastOperationIndex: reuseIndex } = processUndoRedo(document, _action, skipValue, options.protocolVersion ?? 1);\n\t\t_action = transformedAction;\n\t\tskipValue = calculatedSkip;\n\t\tnewDocument = processedDocument;\n\t\treuseLastOperationIndex = reuseIndex;\n\t} else newDocument = {\n\t\t...newDocument,\n\t\tclipboard: []\n\t};\n\tif (isDocumentAction(_action)) newDocument = _baseReducer(newDocument, _action, customReducer);\n\tconst operationContext = {\n\t\tdocumentId: document.header.id,\n\t\tscope: _action.scope,\n\t\tbranch\n\t};\n\tnewDocument = updateDocument(newDocument, _action, reuseLastOperationIndex, skipValue, operationContext, options.replayOptions?.operation, options.skipIndexValidation);\n\tconst protocolVersion = options.protocolVersion ?? 1;\n\tif (isUndo(action) && protocolVersion < 2) return processUndoOperation(newDocument, action.scope, customReducer);\n\tconst isNoopWithSkip = _action.type === \"NOOP\" && skipValue > 0;\n\tif ((isUndo(action) || isNoopWithSkip) && protocolVersion >= 2) {\n\t\tconst scope = _action.scope;\n\t\tconst opsToReplay = garbageCollectV2(sortOperations([...newDocument.operations[scope] || []])).filter((op) => op.action.type !== \"NOOP\");\n\t\tconst replayOps = {\n\t\t\t...newDocument.operations,\n\t\t\t[scope]: opsToReplay\n\t\t};\n\t\treturn {\n\t\t\t...replayOperations(newDocument.initialState, replayOps, customReducer, newDocument.header, dispatch, baseReducer, {}, { skipIndexValidation: true }),\n\t\t\toperations: newDocument.operations,\n\t\t\tclipboard: []\n\t\t};\n\t}\n\tif (shouldProcessSkipOperation) {\n\t\tconst processed = processSkipOperation(newDocument, _action, customReducer, skipValue, reuseOperationResultingState, operationResultingStateParser);\n\t\tif (!pruneOnSkip) newDocument = {\n\t\t\t...processed,\n\t\t\toperations: newDocument.operations\n\t\t};\n\t\telse newDocument = processed;\n\t}\n\tnewDocument = create(newDocument, (draft) => {\n\t\ttry {\n\t\t\tconst newState = customReducer(draft.state, _action, dispatch);\n\t\t\tif (newState) unsafe(() => {\n\t\t\t\tdraft.state = castDraft(newState);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst actionScopeOps = newDocument.operations[_action.scope];\n\t\t\tif (!actionScopeOps) throw new Error(`No operations found for scope: ${_action.scope}`);\n\t\t\tconst lastOperationIndex = actionScopeOps.length - 1;\n\t\t\tconst draftScopeOps = draft.operations[_action.scope];\n\t\t\tif (!draftScopeOps) throw new Error(`No operations found in draft for scope: ${_action.scope}`);\n\t\t\tdraftScopeOps[lastOperationIndex].error = error.message;\n\t\t\tdraftScopeOps[lastOperationIndex].skip = 0;\n\t\t\tif (shouldProcessSkipOperation) {\n\t\t\t\tdraft.state = castDraft({ ...document.state });\n\t\t\t\tconst documentScopeOps = document.operations[_action.scope];\n\t\t\t\tif (!documentScopeOps) throw new Error(`No operations found for scope: ${_action.scope}`);\n\t\t\t\tdraft.operations = castDraft({\n\t\t\t\t\t...document.operations,\n\t\t\t\t\t[_action.scope]: [...documentScopeOps, { ...draftScopeOps[lastOperationIndex] }]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n\tif ([\n\t\t\"UNDO\",\n\t\t\"REDO\",\n\t\t\"PRUNE\"\n\t].includes(_action.type)) return newDocument;\n\tconst scope = _action.scope || \"global\";\n\tlet hash = hashDocumentStateForScope(newDocument, scope);\n\tif (options.replayOptions?.operation.hash && options.replayOptions.operation.hash !== \"\") hash = options.replayOptions.operation.hash;\n\tconst lastOperation = newDocument.operations[scope]?.at(-1);\n\tif (lastOperation) {\n\t\tlastOperation.hash = hash;\n\t\tif (reuseOperationResultingState) lastOperation.resultingState = JSON.stringify(newDocument.state[scope]);\n\t}\n\treturn newDocument;\n}\n/**\n* Helper function to create a document model reducer.\n*\n* @remarks\n* This function creates a new reducer that wraps the provided `reducer` with\n* `documentReducer`, adding support for document actions:\n* - `SET_NAME`\n* - `UNDO`\n* - `REDO`\n* - `PRUNE`\n*\n* It also updates the document-related attributes on every operation.\n*\n* @param reducer - The custom reducer to wrap.\n* @param documentReducer - The document reducer to use.\n*\n* @returns The new reducer.\n*/\nfunction createReducer(stateReducer, documentReducer = baseReducer) {\n\tconst reducer = (document, action, dispatch, options) => {\n\t\treturn documentReducer(document, action, stateReducer, dispatch, options);\n\t};\n\treturn reducer;\n}\nfunction pruneOperation(document, input, wrappedReducer) {\n\tconst operations = document.operations.global;\n\tif (!operations) throw new Error(\"No global operations found\");\n\tlet { start, end } = input;\n\tstart = start || 0;\n\tend = end || operations.length;\n\tconst actionsToPrune = operations.slice(start, end);\n\tconst actionsToKeepStart = operations.slice(0, start);\n\tconst actionsToKeepEnd = operations.slice(end);\n\tconst newDocument = replayOperations(document.initialState, {\n\t\t...document.operations,\n\t\tglobal: actionsToKeepStart.concat(actionsToPrune)\n\t}, wrappedReducer, document.header);\n\tconst newState = newDocument.state;\n\tconst name = newDocument.header.name;\n\tconst loadStateIndex = actionsToKeepStart.length;\n\tconst loadStateTimestamp = actionsToKeepStart.length ? actionsToKeepStart[actionsToKeepStart.length - 1].timestampUtcMs : actionsToKeepEnd.length ? actionsToKeepEnd[0].timestampUtcMs : (/* @__PURE__ */ new Date()).toISOString();\n\tconst action = loadState({\n\t\tname,\n\t\t...newState\n\t}, actionsToPrune.length);\n\treturn replayOperations(document.initialState, {\n\t\t...document.operations,\n\t\tglobal: [\n\t\t\t...actionsToKeepStart,\n\t\t\t{\n\t\t\t\tskip: 0,\n\t\t\t\t...action,\n\t\t\t\taction,\n\t\t\t\ttimestampUtcMs: loadStateTimestamp,\n\t\t\t\tindex: loadStateIndex,\n\t\t\t\thash: hashDocumentStateForScope({ state: newState }, \"global\")\n\t\t\t},\n\t\t\t...actionsToKeepEnd.map((action, index) => ({\n\t\t\t\t...action,\n\t\t\t\tindex: loadStateIndex + index + 1\n\t\t\t}))\n\t\t]\n\t}, wrappedReducer, document.header);\n}\n//#endregion\n//#region document-model/validation.ts\n/**\n* Reserved operation names from base reducer (core/actions.ts).\n* These names cannot be used for custom operations.\n*/\nconst RESERVED_OPERATION_NAMES = [\n\t\"UNDO\",\n\t\"REDO\",\n\t\"PRUNE\",\n\t\"LOAD_STATE\",\n\t\"SET_NAME\",\n\t\"NOOP\"\n];\n/**\n* Check if name conflicts with base reducer actions (case-insensitive).\n*/\nfunction isReservedOperationName(name) {\n\treturn RESERVED_OPERATION_NAMES.includes(name.toUpperCase());\n}\n/**\n* Get all operation names from all modules in the latest specification.\n* Returns names in uppercase for case-insensitive comparison.\n*/\nfunction getAllOperationNames(state, excludeOperationId) {\n\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\tif (!latestSpec) return [];\n\tconst names = [];\n\tfor (const module of latestSpec.modules) for (const operation of module.operations) {\n\t\tif (excludeOperationId && operation.id === excludeOperationId) continue;\n\t\tif (operation.name) names.push(operation.name.toUpperCase());\n\t}\n\treturn names;\n}\n/**\n* Validate operation name is not reserved or duplicate. Throws on failure.\n*\n* @param name - The operation name to validate\n* @param state - The document model global state\n* @param excludeOperationId - Optional operation ID to exclude (for rename validation)\n* @throws Error if the name is reserved or a duplicate\n*/\nfunction validateOperationName(name, state, excludeOperationId) {\n\tif (!name) return;\n\tconst upperName = name.toUpperCase();\n\tif (isReservedOperationName(name)) throw new Error(`Operation name \"${name}\" is reserved. Please use a different name.`);\n\tif (getAllOperationNames(state, excludeOperationId).includes(upperName)) throw new Error(`Operation name \"${name}\" is already used by another operation. Operation names must be unique across all modules.`);\n}\nfunction validateInitialState(initialState, allowEmptyState = false) {\n\tconst errors = [];\n\tif (allowEmptyState && initialState === \"\") return errors;\n\ttry {\n\t\tconst state = JSON.parse(initialState);\n\t\tif (!allowEmptyState && !Object.keys(state).length) errors.push({\n\t\t\tmessage: \"Initial state cannot be empty\",\n\t\t\tdetails: { initialState }\n\t\t});\n\t} catch {\n\t\terrors.push({\n\t\t\tmessage: \"Invalid initial state\",\n\t\t\tdetails: { initialState }\n\t\t});\n\t}\n\treturn errors;\n}\nfunction validateStateSchemaName(schema, documentName, scope = \"\", allowEmptySchema = true) {\n\tconst errors = [];\n\tif (!allowEmptySchema && !schema) {\n\t\terrors.push({\n\t\t\tmessage: \"State schema is required\",\n\t\t\tdetails: { schema }\n\t\t});\n\t\treturn errors;\n\t}\n\tif (allowEmptySchema && !schema) return errors;\n\tconst expectedTypeName = `${pascalCase(documentName)}${pascalCase(scope)}State`;\n\tif (!new RegExp(`\\\\btype\\\\s+${expectedTypeName}(?:\\\\s|\\\\{|@|$)`).test(schema)) errors.push({\n\t\tmessage: `Invalid state schema name. Expected type ${expectedTypeName}`,\n\t\tdetails: { schema }\n\t});\n\treturn errors;\n}\nfunction validateModules(modules) {\n\tconst errors = [];\n\tif (!modules.length) errors.push({\n\t\tmessage: \"Modules are required\",\n\t\tdetails: { modules }\n\t});\n\tconst modulesError = modules.reduce((acc, mod) => [...acc, ...validateModule(mod)], []);\n\treturn [...errors, ...modulesError];\n}\nfunction validateModule(mod) {\n\tconst errors = [];\n\tif (!mod.name) errors.push({\n\t\tmessage: \"Module name is required\",\n\t\tdetails: { module: mod }\n\t});\n\tif (!mod.operations.length) errors.push({\n\t\tmessage: \"Module operations are required\",\n\t\tdetails: { module: mod }\n\t});\n\tconst operationErrors = mod.operations.reduce((acc, operation) => [...acc, ...validateModuleOperation(operation)], []);\n\treturn [...errors, ...operationErrors];\n}\nfunction validateModuleOperation(operation) {\n\tconst errors = [];\n\tif (!operation.name) errors.push({\n\t\tmessage: \"Operation name is required\",\n\t\tdetails: { operation }\n\t});\n\tif (!operation.schema) errors.push({\n\t\tmessage: \"Operation schema is required\",\n\t\tdetails: { operation }\n\t});\n\treturn errors;\n}\nfunction validateOperations(operations) {\n\tconst errors = [];\n\tconst scopes = Object.keys(operations);\n\tfor (const scope of scopes) {\n\t\tconst scopeOperations = operations[scope];\n\t\tif (!scopeOperations) continue;\n\t\tconst ops = scopeOperations.sort((a, b) => a.index - b.index);\n\t\tlet opIndex = -1;\n\t\tfor (let i = 0; i < ops.length; i++) {\n\t\t\topIndex = opIndex + 1 + ops[i].skip;\n\t\t\tif (ops[i].index !== opIndex) errors.push({\n\t\t\t\tmessage: `Invalid operation index ${ops[i].index} at position ${i}`,\n\t\t\t\tdetails: {\n\t\t\t\t\tposition: i,\n\t\t\t\t\toperation: ops[i],\n\t\t\t\t\tscope: ops[i].action.scope\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\treturn errors;\n}\n//#endregion\n//#region document-model/reducers.ts\nfunction sorter(order) {\n\tconst mapping = {};\n\torder.forEach((key, index) => mapping[key] = index);\n\treturn (a, b) => (mapping[b.id] || 999999) - (mapping[a.id] || 999999);\n}\nconst documentModelHeaderReducer = {\n\tsetModelNameOperation(state, action) {\n\t\tstate.name = action.input.name;\n\t},\n\tsetModelIdOperation(state, action) {\n\t\tstate.id = action.input.id;\n\t},\n\tsetModelExtensionOperation(state, action) {\n\t\tstate.extension = action.input.extension;\n\t},\n\tsetModelDescriptionOperation(state, action) {\n\t\tstate.description = action.input.description;\n\t},\n\tsetAuthorNameOperation(state, action) {\n\t\tstate.author = state.author || {\n\t\t\tname: \"\",\n\t\t\twebsite: null\n\t\t};\n\t\tstate.author.name = action.input.authorName;\n\t},\n\tsetAuthorWebsiteOperation(state, action) {\n\t\tstate.author = state.author || {\n\t\t\tname: \"\",\n\t\t\twebsite: null\n\t\t};\n\t\tstate.author.website = action.input.authorWebsite;\n\t}\n};\nconst documentModelModuleReducer = {\n\taddModuleOperation(state, action) {\n\t\tstate.specifications[state.specifications.length - 1].modules.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.name,\n\t\t\tdescription: action.input.description || \"\",\n\t\t\toperations: []\n\t\t});\n\t},\n\tsetModuleNameOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) if (latestSpec.modules[i].id === action.input.id) latestSpec.modules[i].name = action.input.name || \"\";\n\t},\n\tsetModuleDescriptionOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) if (latestSpec.modules[i].id === action.input.id) latestSpec.modules[i].description = action.input.description || \"\";\n\t},\n\tdeleteModuleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tlatestSpec.modules = latestSpec.modules.filter((m) => m.id != action.input.id);\n\t},\n\treorderModulesOperation(state, action) {\n\t\tstate.specifications[state.specifications.length - 1].modules.sort(sorter(action.input.order));\n\t}\n};\nconst documentModelOperationErrorReducer = {\n\taddOperationErrorOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.operationId) latestSpec.modules[i].operations[j].errors.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.errorName || \"\",\n\t\t\tcode: action.input.errorCode || \"\",\n\t\t\tdescription: action.input.errorDescription || \"\",\n\t\t\ttemplate: action.input.errorTemplate || \"\"\n\t\t});\n\t},\n\tsetOperationErrorCodeOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) latestSpec.modules[i].operations[j].errors[k].code = action.input.errorCode || \"\";\n\t},\n\tsetOperationErrorNameOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) latestSpec.modules[i].operations[j].errors[k].name = action.input.errorName || \"\";\n\t},\n\tsetOperationErrorDescriptionOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) latestSpec.modules[i].operations[j].errors[k].description = action.input.errorDescription || \"\";\n\t},\n\tsetOperationErrorTemplateOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) latestSpec.modules[i].operations[j].errors[k].template = action.input.errorTemplate || \"\";\n\t},\n\tdeleteOperationErrorOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) latestSpec.modules[i].operations[j].errors = latestSpec.modules[i].operations[j].errors.filter((e) => e.id != action.input.id);\n\t},\n\treorderOperationErrorsOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.operationId) latestSpec.modules[i].operations[j].errors.sort(sorter(action.input.order));\n\t}\n};\nconst documentModelOperationExampleReducer = {\n\taddOperationExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.operationId) latestSpec.modules[i].operations[j].examples.push({\n\t\t\tid: action.input.id,\n\t\t\tvalue: action.input.example\n\t\t});\n\t},\n\tupdateOperationExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) for (let k = 0; k < latestSpec.modules[i].operations[j].examples.length; k++) if (latestSpec.modules[i].operations[j].examples[k].id == action.input.id) latestSpec.modules[i].operations[j].examples[k].value = action.input.example;\n\t},\n\tdeleteOperationExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) latestSpec.modules[i].operations[j].examples = latestSpec.modules[i].operations[j].examples.filter((e) => e.id != action.input.id);\n\t},\n\treorderOperationExamplesOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.operationId) latestSpec.modules[i].operations[j].examples.sort(sorter(action.input.order));\n\t}\n};\nconst documentModelOperationReducer = {\n\taddOperationOperation(state, action) {\n\t\tvalidateOperationName(action.input.name, state);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) if (latestSpec.modules[i].id == action.input.moduleId) latestSpec.modules[i].operations.push({\n\t\t\tid: action.input.id,\n\t\t\tname: action.input.name,\n\t\t\tdescription: action.input.description || \"\",\n\t\t\tschema: action.input.schema || \"\",\n\t\t\ttemplate: action.input.template || action.input.description || \"\",\n\t\t\treducer: action.input.reducer || \"\",\n\t\t\terrors: [],\n\t\t\texamples: [],\n\t\t\tscope: action.input.scope || \"global\"\n\t\t});\n\t},\n\tsetOperationNameOperation(state, action) {\n\t\tif (action.input.name) validateOperationName(action.input.name, state, action.input.id);\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].name = action.input.name || \"\";\n\t},\n\tsetOperationScopeOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].scope = action.input.scope || \"global\";\n\t},\n\tsetOperationSchemaOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].schema = action.input.schema || \"\";\n\t},\n\tsetOperationDescriptionOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].description = action.input.description || \"\";\n\t},\n\tsetOperationTemplateOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].template = action.input.template || \"\";\n\t},\n\tsetOperationReducerOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) for (let j = 0; j < latestSpec.modules[i].operations.length; j++) if (latestSpec.modules[i].operations[j].id == action.input.id) latestSpec.modules[i].operations[j].reducer = action.input.reducer || \"\";\n\t},\n\tmoveOperationOperation(state, action) {\n\t\tconst moveOperations = [];\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) latestSpec.modules[i].operations = latestSpec.modules[i].operations.filter((operation) => {\n\t\t\tif (operation.id == action.input.operationId) {\n\t\t\t\tmoveOperations.push(operation);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) if (latestSpec.modules[i].id == action.input.newModuleId) latestSpec.modules[i].operations.push(...moveOperations);\n\t},\n\tdeleteOperationOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) latestSpec.modules[i].operations = latestSpec.modules[i].operations.filter((operation) => operation.id != action.input.id);\n\t},\n\treorderModuleOperationsOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tfor (let i = 0; i < latestSpec.modules.length; i++) if (latestSpec.modules[i].id == action.input.moduleId) latestSpec.modules[i].operations.sort(sorter(action.input.order));\n\t}\n};\nconst documentModelStateSchemaReducer = {\n\tsetStateSchemaOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].schema = action.input.schema;\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\tsetInitialStateOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].initialValue = action.input.initialValue;\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\taddStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].examples.push({\n\t\t\tid: action.input.id,\n\t\t\tvalue: action.input.example\n\t\t});\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\tupdateStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (!Object.keys(latestSpec.state).includes(action.input.scope)) throw new Error(`Invalid scope: ${action.input.scope}`);\n\t\tconst examples = latestSpec.state[action.input.scope].examples;\n\t\tfor (let i = 0; i < examples.length; i++) if (examples[i].id == action.input.id) examples[i].value = action.input.newExample;\n\t},\n\tdeleteStateExampleOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].examples = latestSpec.state[action.input.scope].examples.filter((e) => e.id != action.input.id);\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t},\n\treorderStateExamplesOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tif (Object.keys(latestSpec.state).includes(action.input.scope)) latestSpec.state[action.input.scope].examples.sort(sorter(action.input.order));\n\t\telse throw new Error(`Invalid scope: ${action.input.scope}`);\n\t}\n};\nconst documentModelVersioningReducer = {\n\taddChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"addChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\tupdateChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"updateChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\tdeleteChangeLogItemOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"deleteChangeLogItemOperation\\\" not yet implemented\");\n\t},\n\treorderChangeLogItemsOperation(state, action) {\n\t\tthrow new Error(\"Reducer \\\"reorderChangeLogItemsOperation\\\" not yet implemented\");\n\t},\n\treleaseNewVersionOperation(state, action) {\n\t\tconst latestSpec = state.specifications[state.specifications.length - 1];\n\t\tconst copiedModules = latestSpec.modules.map((module) => ({\n\t\t\t...module,\n\t\t\toperations: module.operations.map((op) => ({\n\t\t\t\t...op,\n\t\t\t\terrors: op.errors.map((err) => ({ ...err })),\n\t\t\t\texamples: op.examples.map((ex) => ({ ...ex }))\n\t\t\t}))\n\t\t}));\n\t\tconst copiedState = {\n\t\t\tglobal: {\n\t\t\t\t...latestSpec.state.global,\n\t\t\t\texamples: latestSpec.state.global.examples.map((ex) => ({ ...ex }))\n\t\t\t},\n\t\t\tlocal: {\n\t\t\t\t...latestSpec.state.local,\n\t\t\t\texamples: latestSpec.state.local.examples.map((ex) => ({ ...ex }))\n\t\t\t}\n\t\t};\n\t\tconst newSpec = {\n\t\t\tversion: latestSpec.version + 1,\n\t\t\tchangeLog: [],\n\t\t\tstate: copiedState,\n\t\t\tmodules: copiedModules\n\t\t};\n\t\tstate.specifications.push(newSpec);\n\t}\n};\nconst documentModelStateReducer = (state, action) => {\n\tif (isDocumentAction(action)) return state;\n\tswitch (action.type) {\n\t\tcase \"SET_MODEL_NAME\":\n\t\t\tSetModelNameInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_ID\":\n\t\t\tSetModelIdInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelIdOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_EXTENSION\":\n\t\t\tSetModelExtensionInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelExtensionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODEL_DESCRIPTION\":\n\t\t\tSetModelDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setModelDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_AUTHOR_NAME\":\n\t\t\tSetAuthorNameInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setAuthorNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_AUTHOR_WEBSITE\":\n\t\t\tSetAuthorWebsiteInputSchema().parse(action.input);\n\t\t\tdocumentModelHeaderReducer.setAuthorWebsiteOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_CHANGE_LOG_ITEM\":\n\t\t\tAddChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.addChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_CHANGE_LOG_ITEM\":\n\t\t\tUpdateChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.updateChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_CHANGE_LOG_ITEM\":\n\t\t\tDeleteChangeLogItemInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.deleteChangeLogItemOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_CHANGE_LOG_ITEMS\":\n\t\t\tReorderChangeLogItemsInputSchema().parse(action.input);\n\t\t\tdocumentModelVersioningReducer.reorderChangeLogItemsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"RELEASE_NEW_VERSION\":\n\t\t\tif (Object.keys(action.input).length > 0) throw new Error(\"Expected empty input for action RELEASE_NEW_VERSION\");\n\t\t\tdocumentModelVersioningReducer.releaseNewVersionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_MODULE\":\n\t\t\tAddModuleInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.addModuleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODULE_NAME\":\n\t\t\tSetModuleNameInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.setModuleNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_MODULE_DESCRIPTION\":\n\t\t\tSetModuleDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.setModuleDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_MODULE\":\n\t\t\tDeleteModuleInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.deleteModuleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_MODULES\":\n\t\t\tReorderModulesInputSchema().parse(action.input);\n\t\t\tdocumentModelModuleReducer.reorderModulesOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION_ERROR\":\n\t\t\tAddOperationErrorInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.addOperationErrorOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_CODE\":\n\t\t\tSetOperationErrorCodeInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorCodeOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_NAME\":\n\t\t\tSetOperationErrorNameInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_DESCRIPTION\":\n\t\t\tSetOperationErrorDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_ERROR_TEMPLATE\":\n\t\t\tSetOperationErrorTemplateInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.setOperationErrorTemplateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION_ERROR\":\n\t\t\tDeleteOperationErrorInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.deleteOperationErrorOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_OPERATION_ERRORS\":\n\t\t\tReorderOperationErrorsInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationErrorReducer.reorderOperationErrorsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION_EXAMPLE\":\n\t\t\tAddOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.addOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_OPERATION_EXAMPLE\":\n\t\t\tUpdateOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.updateOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION_EXAMPLE\":\n\t\t\tDeleteOperationExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.deleteOperationExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_OPERATION_EXAMPLES\":\n\t\t\tReorderOperationExamplesInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationExampleReducer.reorderOperationExamplesOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_OPERATION\":\n\t\t\tAddOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.addOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_NAME\":\n\t\t\tSetOperationNameInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationNameOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_SCOPE\":\n\t\t\tSetOperationScopeInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationScopeOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_SCHEMA\":\n\t\t\tSetOperationSchemaInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationSchemaOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_DESCRIPTION\":\n\t\t\tSetOperationDescriptionInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationDescriptionOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_TEMPLATE\":\n\t\t\tSetOperationTemplateInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationTemplateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_OPERATION_REDUCER\":\n\t\t\tSetOperationReducerInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.setOperationReducerOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"MOVE_OPERATION\":\n\t\t\tMoveOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.moveOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_OPERATION\":\n\t\t\tDeleteOperationInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.deleteOperationOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_MODULE_OPERATIONS\":\n\t\t\tReorderModuleOperationsInputSchema().parse(action.input);\n\t\t\tdocumentModelOperationReducer.reorderModuleOperationsOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_STATE_SCHEMA\":\n\t\t\tSetStateSchemaInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.setStateSchemaOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"SET_INITIAL_STATE\":\n\t\t\tSetInitialStateInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.setInitialStateOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"ADD_STATE_EXAMPLE\":\n\t\t\tAddStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.addStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"UPDATE_STATE_EXAMPLE\":\n\t\t\tUpdateStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.updateStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"DELETE_STATE_EXAMPLE\":\n\t\t\tDeleteStateExampleInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.deleteStateExampleOperation(state.global, action);\n\t\t\tbreak;\n\t\tcase \"REORDER_STATE_EXAMPLES\":\n\t\t\tReorderStateExamplesInputSchema().parse(action.input);\n\t\t\tdocumentModelStateSchemaReducer.reorderStateExamplesOperation(state.global, action);\n\t\t\tbreak;\n\t\tdefault: return state;\n\t}\n};\nconst documentModelReducer = createReducer(documentModelStateReducer);\n//#endregion\n//#region document-model/files.ts\nconst NON_DOMAIN_SCOPES = new Set([\"auth\", \"document\"]);\nasync function loadJSZip() {\n\tconst { default: JSZip } = await import(\"jszip\");\n\treturn JSZip;\n}\nasync function createZip(document) {\n\tconst zip = new (await (loadJSZip()))();\n\tconst header = document.header;\n\tzip.file(\"header.json\", JSON.stringify(header, null, 2));\n\tzip.file(\"state.json\", JSON.stringify(document.initialState || {}, null, 2));\n\tzip.file(\"current-state.json\", JSON.stringify(document.state || {}, null, 2));\n\tzip.file(\"operations.json\", JSON.stringify(filterDocumentOperationsResultingState(document.operations), null, 2));\n\treturn zip;\n}\n/**\n* Creates a minimal ZIP backup from strand data.\n* Used when the full document is not available (e.g., in onOperations handler).\n* Creates a ZIP with minimal header and empty operations.\n*/\nasync function createMinimalZip(data) {\n\tconst JSZip = await loadJSZip();\n\tconst now = (/* @__PURE__ */ new Date()).toISOString();\n\tconst header = {\n\t\tid: data.documentId,\n\t\tsig: {\n\t\t\tpublicKey: {},\n\t\t\tnonce: \"\"\n\t\t},\n\t\tdocumentType: data.documentType,\n\t\tcreatedAtUtcIso: now,\n\t\tslug: data.name,\n\t\tname: data.name,\n\t\tbranch: data.branch,\n\t\trevision: {},\n\t\tlastModifiedAtUtcIso: now\n\t};\n\tconst zip = new JSZip();\n\tzip.file(\"header.json\", JSON.stringify(header, null, 2));\n\tzip.file(\"state.json\", JSON.stringify(data.state, null, 2));\n\tzip.file(\"current-state.json\", JSON.stringify(data.state, null, 2));\n\tzip.file(\"operations.json\", JSON.stringify({}, null, 2));\n\treturn zip;\n}\nasync function baseSaveToFileHandle(document, input) {\n\tconst blob = await (await createZip(document)).generateAsync({ type: \"blob\" });\n\tconst writable = await input.createWritable();\n\tawait writable.write(blob);\n\tawait writable.close();\n}\nasync function loadFromZip(zip, reducer, options) {\n\tconst initialStateZip = zip.file(\"state.json\");\n\tif (!initialStateZip) throw new Error(\"Initial state not found\");\n\tconst initialStateStr = await initialStateZip.async(\"string\");\n\tconst initialState = JSON.parse(initialStateStr);\n\tconst headerZip = zip.file(\"header.json\");\n\tif (!headerZip) throw new Error(\"Document header not found - file format may be outdated\");\n\tconst header = JSON.parse(await headerZip.async(\"string\"));\n\tconst operationsZip = zip.file(\"operations.json\");\n\tif (!operationsZip) throw new Error(\"Operations history not found\");\n\tconst clearedOperations = garbageCollectDocumentOperations(JSON.parse(await operationsZip.async(\"string\")));\n\tconst operationsError = validateOperations(clearedOperations);\n\tif (operationsError.length) {\n\t\tconst errorMessages = operationsError.map((err) => err.message);\n\t\tthrow new Error(errorMessages.join(\"\\n\"));\n\t}\n\treturn {\n\t\t...replayDocument(initialState, Object.fromEntries(Object.entries(clearedOperations).filter(([scope]) => !NON_DOMAIN_SCOPES.has(scope))), reducer, header, void 0, {}, options),\n\t\toperations: clearedOperations\n\t};\n}\nasync function baseLoadFromInput(input, reducer, options) {\n\tconst zip = new (await (loadJSZip()))();\n\tawait zip.loadAsync(input);\n\treturn loadFromZip(zip, reducer, options);\n}\nconst documentModelLoadFromInput = (input) => {\n\treturn baseLoadFromInput(input, documentModelReducer);\n};\nconst documentModelSaveToFileHandle = (document, input) => {\n\treturn baseSaveToFileHandle(document, input);\n};\nfunction writeFileBrowser(path, name, stream) {\n\tthrow FileSystemError;\n}\nfunction readFileBrowser(path) {\n\tthrow FileSystemError;\n}\nfunction fetchFileBrowser(url) {\n\tthrow FileSystemError;\n}\nconst getFileBrowser = async (file) => {\n\treturn readFileBrowser(file);\n};\n//#endregion\n//#region document-model/state.ts\n/**\n* Creates a default PHAuthState\n*/\nfunction defaultAuthState() {\n\treturn {};\n}\n/**\n* Creates a default PHDocumentState\n*/\nfunction defaultDocumentState() {\n\treturn {\n\t\tversion: 0,\n\t\thash: {\n\t\t\talgorithm: HASH_ALGORITHM_SHA1,\n\t\t\tencoding: HASH_ENCODING_BASE64\n\t\t}\n\t};\n}\n/**\n* Creates a default PHBaseState with auth and document properties\n*/\nfunction defaultBaseState() {\n\treturn {\n\t\tauth: defaultAuthState(),\n\t\tdocument: defaultDocumentState()\n\t};\n}\n/**\n* Creates a PHAuthState with the given properties\n*/\nfunction createAuthState(auth) {\n\treturn {\n\t\t...defaultAuthState(),\n\t\t...auth\n\t};\n}\n/**\n* Creates a PHDocumentState with the given properties\n*/\nfunction createDocumentState(document) {\n\treturn {\n\t\t...defaultDocumentState(),\n\t\t...document\n\t};\n}\n/**\n* Creates a PHBaseState with the given auth and document properties\n*/\nfunction createBaseState(auth, document) {\n\treturn {\n\t\tauth: createAuthState(auth),\n\t\tdocument: createDocumentState(document)\n\t};\n}\nfunction defaultGlobalState() {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tauthor: {\n\t\t\tname: \"\",\n\t\t\twebsite: \"\"\n\t\t},\n\t\tdescription: \"\",\n\t\textension: \"\",\n\t\tid: \"\",\n\t\tname: \"\",\n\t\tspecifications: []\n\t};\n}\nfunction defaultLocalState() {\n\treturn {};\n}\nfunction defaultPHState() {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: defaultGlobalState(),\n\t\tlocal: defaultLocalState()\n\t};\n}\nfunction createGlobalState(state) {\n\treturn {\n\t\t...defaultGlobalState(),\n\t\t...state || {}\n\t};\n}\nfunction createLocalState(state) {\n\treturn {\n\t\t...defaultLocalState(),\n\t\t...state || {}\n\t};\n}\nfunction createState(baseState, globalState, localState) {\n\treturn {\n\t\t...createBaseState(baseState?.auth, baseState?.document),\n\t\tglobal: createGlobalState(globalState),\n\t\tlocal: createLocalState(localState)\n\t};\n}\n//#endregion\nexport { AddChangeLogItemInputSchema, AddModuleInputSchema, AddOperationErrorInputSchema, AddOperationExampleInputSchema, AddOperationInputSchema, AddStateExampleInputSchema, AuthorSchema, BaseDocumentHeaderSchema, BaseDocumentStateSchema, CodeExampleSchema, ConfigEntrySchema, ConfigEntryTypeSchema, DeleteChangeLogItemInputSchema, DeleteModuleInputSchema, DeleteOperationErrorInputSchema, DeleteOperationExampleInputSchema, DeleteOperationInputSchema, DeleteStateExampleInputSchema, DocumentActionSchema, DocumentFileSchema, DocumentModelGlobalStateSchema, DocumentModelHeaderSchema, DocumentModelInputSchema, DocumentModelPHStateSchema, DocumentModelSchema, DocumentSpecificationSchema, FileSystemError, HASH_ALGORITHM_SHA1, HASH_ALGORITHM_SHA256, HASH_ALGORITHM_SHA512, HASH_ENCODING_BASE64, HASH_ENCODING_HEX, HashMismatchError, IntegrityIssueSubType, IntegrityIssueType, InvalidActionInputError, InvalidActionInputZodError, LoadStateActionInputSchema, LoadStateActionSchema, LoadStateActionStateInputSchema, Load_StateSchema, ManifestSchema, ModuleSchema, MoveOperationInputSchema, OperationErrorSchema, OperationScopeSchema, OperationSpecificationSchema, PowerhouseModuleSchema, PowerhouseModulesSchema, PruneActionInputSchema, PruneActionSchema, PruneSchema, PublisherSchema, RESERVED_OPERATION_NAMES, RedoActionInputSchema, RedoActionSchema, RedoSchema, ReorderChangeLogItemsInputSchema, ReorderModuleOperationsInputSchema, ReorderModulesInputSchema, ReorderOperationErrorsInputSchema, ReorderOperationExamplesInputSchema, ReorderStateExamplesInputSchema, ScopeStateSchema, SetAuthorNameInputSchema, SetAuthorWebsiteInputSchema, SetInitialStateInputSchema, SetModelDescriptionInputSchema, SetModelExtensionInputSchema, SetModelIdInputSchema, SetModelNameInputSchema, SetModuleDescriptionInputSchema, SetModuleNameInputSchema, SetNameActionInputSchema, SetNameActionSchema, SetOperationDescriptionInputSchema, SetOperationErrorCodeInputSchema, SetOperationErrorDescriptionInputSchema, SetOperationErrorNameInputSchema, SetOperationErrorTemplateInputSchema, SetOperationNameInputSchema, SetOperationReducerInputSchema, SetOperationSchemaInputSchema, SetOperationScopeInputSchema, SetOperationTemplateInputSchema, SetStateSchemaInputSchema, Set_NameSchema, StateSchema, UndoActionInputSchema, UndoActionSchema, UndoSchema, UpdateChangeLogItemInputSchema, UpdateOperationExampleInputSchema, UpdateStateExampleInputSchema, ab2hex, actionContext, actionFromAction, actionSigner, actions, addChangeLogItem, addModule, addOperation, addOperationError, addOperationExample, addStateExample, addUndo, assertIsDocumentModelDocument, assertIsDocumentModelState, attachBranch, baseActions, baseCreateDocument, baseLoadFromInput, baseReducer, baseSaveToFileHandle, buildOperationSignature, buildOperationSignatureMessage, buildOperationSignatureParams, buildSignedAction, checkCleanedOperationsIntegrity, checkOperationsIntegrity, createAction, createAuthState, createBaseState, createDocumentState, createGlobalState, createLocalState, createMinimalZip, createPresignedHeader, createReducer, createSignedHeader, createSignedHeaderForSigner, createState, createVerificationSigner, createZip, defaultAuthState, defaultBaseState, defaultDocumentState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, deleteChangeLogItem, deleteModule, deleteOperation, deleteOperationError, deleteOperationExample, deleteStateExample, deriveOperationId, diffOperations, documentModelActions, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelHeaderReducer, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelModuleReducer, documentModelOperationErrorReducer, documentModelOperationExampleReducer, documentModelOperationReducer, documentModelReducer, documentModelSaveToFileHandle, documentModelStateReducer, documentModelStateSchemaReducer, documentModelVersioningReducer, fetchFileBrowser, filterDocumentOperationsResultingState, filterDuplicatedOperations, garbageCollect, garbageCollectDocumentOperations, garbageCollectV2, generateId, generateMock, getAllOperationNames, getDocumentLastModified, getFileBrowser, getUnixTimestamp, groupOperationsByScope, hashBrowser, hashDocumentStateForScope, hex2ab, isDefinedNonNullAny, isDocumentAction, isDocumentModelDocument, isDocumentModelState, isNoopOperation, isReservedOperationName, isUndo, isUndoRedo, loadState, loadStateOperation, mapSkippedOperations, mapSkippedOperationsV2, merge, moveOperation, nextSkipNumber, noop, operationExampleCreators, operationFromAction, operationFromOperation, operationWithContext, operationsAreEqual, parseResultingState, precedes, prepareOperations, processUndoRedo, prune, pruneOperation, readFileBrowser, readOnly, redo, redoOperation, releaseNewVersion, removeExistingOperations, reorderChangeLogItems, reorderModuleOperations, reorderModules, reorderOperationErrors, reorderOperationExamples, reorderStateExamples, replayDocument, replayOperations, reshuffleByTimestamp, reshuffleByTimestampAndIndex, setAuthorName, setAuthorWebsite, setInitialState, setModelDescription, setModelExtension, setModelId, setModelName, setModuleDescription, setModuleName, setName, setNameOperation, setOperationDescription, setOperationErrorCode, setOperationErrorDescription, setOperationErrorName, setOperationErrorTemplate, setOperationName, setOperationReducer, setOperationSchema, setOperationScope, setOperationTemplate, setStateSchema, sign, skipHeaderOperations, sortMappedOperations, sortOperations, split, undo, undoOperation, undoOperationV2, updateChangeLogItem, updateDocument, updateHeaderRevision, updateOperationExample, updateStateExample, validateHeader, validateInitialState, validateModule, validateModuleOperation, validateModules, validateOperationName, validateOperations, validateStateSchemaName, verify, verifyOperationSignature, writeFileBrowser };\n\n//# sourceMappingURL=index.js.map","import { actions, assertIsDocumentModelDocument, assertIsDocumentModelState, baseCreateDocument, createState, defaultBaseState, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelReducer, documentModelSaveToFileHandle, isDocumentModelDocument, isDocumentModelState } from \"@powerhousedao/shared/document-model\";\nexport * from \"@powerhousedao/shared/document-model\";\n//#region src/state.ts\nconst isStateOfType = (state) => {\n\treturn isDocumentModelState(state);\n};\nconst assertIsStateOfType = (state) => {\n\tassertIsDocumentModelState(state);\n};\nconst isDocumentOfType = (document) => {\n\treturn isDocumentModelDocument(document);\n};\nconst assertIsDocumentOfType = (document) => {\n\tassertIsDocumentModelDocument(document);\n};\nconst documentModelCreateState = (state) => {\n\treturn {\n\t\t...defaultBaseState(),\n\t\tglobal: {\n\t\t\t...documentModelInitialGlobalState,\n\t\t\t...state?.global ?? {}\n\t\t},\n\t\tlocal: {\n\t\t\t...documentModelInitialLocalState,\n\t\t\t...state?.local ?? {}\n\t\t}\n\t};\n};\nfunction documentModelCreateDocument(state) {\n\tconst document = baseCreateDocument(documentModelCreateState, state);\n\tdocument.header.documentType = documentModelDocumentType;\n\treturn document;\n}\n//#endregion\n//#region src/module.ts\nconst utils = {\n\tfileExtension: documentModelFileExtension,\n\tcreateState: documentModelCreateState,\n\tcreateDocument: documentModelCreateDocument,\n\tloadFromInput: documentModelLoadFromInput,\n\tsaveToFileHandle: documentModelSaveToFileHandle,\n\tisStateOfType,\n\tassertIsStateOfType,\n\tisDocumentOfType,\n\tassertIsDocumentOfType\n};\nconst documentModelDocumentModelModule = {\n\treducer: documentModelReducer,\n\tdocumentModel: createState(defaultBaseState(), documentModelGlobalState),\n\tactions,\n\tutils\n};\n//#endregion\n//#region src/controller.ts\nvar PHDocumentController = class PHDocumentController {\n\tmodule;\n\t_document;\n\tlisteners = [];\n\tconstructor(module, initialDocument) {\n\t\tthis.module = module;\n\t\tthis._document = initialDocument ?? module.utils.createDocument();\n\t\tfor (const actionType in this.module.actions) Object.defineProperty(this, actionType, { value: (input) => {\n\t\t\tconst action = this.module.actions[actionType](input);\n\t\t\tthis._document = this.module.reducer(this._document, action);\n\t\t\tthis.notifyListeners();\n\t\t\treturn this;\n\t\t} });\n\t}\n\tget document() {\n\t\treturn this._document;\n\t}\n\tget header() {\n\t\treturn this.document.header;\n\t}\n\tget state() {\n\t\treturn this.document.state;\n\t}\n\tget initialState() {\n\t\treturn this.document.initialState;\n\t}\n\tget operations() {\n\t\treturn this.document.operations;\n\t}\n\tget clipboard() {\n\t\treturn this.document.clipboard;\n\t}\n\tonChange(listener) {\n\t\tthis.listeners.push(listener);\n\t\treturn () => {\n\t\t\tthis.listeners = this.listeners.filter((l) => l !== listener);\n\t\t};\n\t}\n\tnotifyListeners() {\n\t\tif (this.listeners.length === 0) return;\n\t\tconst event = { document: this._document };\n\t\tfor (const listener of this.listeners) listener(event);\n\t}\n\tstatic forDocumentModel(module) {\n\t\treturn class extends PHDocumentController {\n\t\t\tconstructor(initialDocument) {\n\t\t\t\tsuper(module, initialDocument);\n\t\t\t}\n\t\t};\n\t}\n};\nconst DocumentModelController = PHDocumentController.forDocumentModel(documentModelDocumentModelModule);\n//#endregion\n//#region src/logger.ts\nconst tokenSub = /@([a-zA-Z0-9_]+)/g;\nconst dtf = new Intl.DateTimeFormat(void 0, {\n\thour12: false,\n\thour: \"2-digit\",\n\tminute: \"2-digit\",\n\tsecond: \"2-digit\",\n\tfractionalSecondDigits: 2\n});\nconst formatMessage = (tagString, message, replacements) => {\n\tconst meta = {};\n\tconst uniqueTokens = [];\n\tlet results;\n\twhile ((results = tokenSub.exec(message)) !== null) {\n\t\tconst tokenName = results[1];\n\t\tif (uniqueTokens.indexOf(tokenName) === -1) {\n\t\t\tuniqueTokens.push(tokenName);\n\t\t\tmeta[tokenName] = replacements[uniqueTokens.length - 1];\n\t\t}\n\t}\n\tfor (const [key, value] of Object.entries(meta)) {\n\t\tlet stringValue;\n\t\tif (!value) stringValue = \"null\";\n\t\telse if (typeof value === \"string\") stringValue = value;\n\t\telse if (typeof value === \"object\") stringValue = JSON.stringify(value);\n\t\telse if (typeof value === \"function\") {\n\t\t\tconst name = value.name;\n\t\t\tstringValue = name ? `${name}()` : \"anonymous()\";\n\t\t} else stringValue = String(value);\n\t\tmessage = message.replaceAll(`@${key}`, stringValue);\n\t}\n\tif (tagString.length > 0) message = `${tagString} ${message}`;\n\tconst now = /* @__PURE__ */ new Date();\n\tmeta[\"timestamp\"] = dtf.format(now);\n\treturn [message, meta];\n};\nconst LOG_LEVELS = {\n\tverbose: 0,\n\tdebug: 1,\n\tinfo: 2,\n\twarn: 3,\n\terror: 4\n};\nvar ConsoleLogger = class ConsoleLogger {\n\t#tags;\n\t#tagString;\n\t#level = LOG_LEVELS.info;\n\terrorHandler;\n\tconstructor(tags, handler) {\n\t\tthis.#tags = tags || [];\n\t\tthis.#tagString = this.#tags.map((tag) => `[${tag}]`).join(\"\");\n\t\tthis.errorHandler = handler ?? (() => {});\n\t}\n\tget level() {\n\t\treturn Object.keys(LOG_LEVELS).find((key) => LOG_LEVELS[key] === this.#level);\n\t}\n\tset level(value) {\n\t\tthis.#level = LOG_LEVELS[value];\n\t}\n\tchild(tags) {\n\t\tconst logger = new ConsoleLogger([...this.#tags, ...tags], this.errorHandler);\n\t\tlogger.level = this.level;\n\t\treturn logger;\n\t}\n\tverbose(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.verbose) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements);\n\t\t\tconsole.debug(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\tdebug(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.debug) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements);\n\t\t\tconsole.debug(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\tinfo(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.info) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements);\n\t\t\tconsole.info(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\twarn(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.warn) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements);\n\t\t\tconsole.warn(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n\terror(message, ...replacements) {\n\t\tif (this.#level <= LOG_LEVELS.error) {\n\t\t\tconst [formattedMessage, meta] = formatMessage(this.#tagString, message, replacements);\n\t\t\tconsole.error(`[${meta[\"timestamp\"]}] ${formattedMessage}`);\n\t\t}\n\t}\n};\nconst logger = new ConsoleLogger();\nconst setLogLevel = (level) => {\n\tlogger.level = level;\n};\nconst setErrorHandler = (handler) => {\n\tlogger.errorHandler = handler;\n};\nconst childLogger = (tags) => {\n\treturn logger.child(tags);\n};\n//#endregion\nexport { ConsoleLogger, DocumentModelController, PHDocumentController, assertIsDocumentOfType, assertIsStateOfType, childLogger, documentModelCreateDocument, documentModelCreateState, documentModelDocumentModelModule, isDocumentOfType, isStateOfType, logger, setErrorHandler, setLogLevel };\n\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-empty-object-type */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport * as z from 'zod';\nimport type {\n AddExternalSkillInput,\n AddModelInput,\n AddPackageDocumentTypeInput,\n AddPowerhousePackageInput,\n AddProfileInput,\n AddSupportedResourceInput,\n BumpVersionInput,\n ClearAgentImageInput,\n DisableMastraInput,\n DisableRoutineInput,\n EnableMastraInput,\n EnableRoutineInput,\n ExternalSkill,\n ImportModelInput,\n ImportPackageInput,\n ImportProfileInput,\n ImportSkillInput,\n ImportSpecInput,\n PhClintAgentModel,\n PhClintAgentProfile,\n PhClintDeployment,\n PhClintFeatures,\n PhClintMastraCommon,\n PhClintMastraFeature,\n PhClintProjectState,\n PhClintRoutineFeature,\n PowerhouseLevel,\n PowerhousePackage,\n PublishDevInput,\n PublishProductionInput,\n PublishRecord,\n PublishStagingInput,\n PublishStatus,\n PublishTag,\n RemoveExternalSkillInput,\n RemoveModelInput,\n RemovePackageDocumentTypeInput,\n RemovePowerhousePackageInput,\n RemoveProfileInput,\n RemoveSupportedResourceInput,\n ReorderProfilesInput,\n SetAgentDescriptionInput,\n SetAgentIdInput,\n SetAgentImageInput,\n SetAgentNameInput,\n SetDefaultModelInput,\n SetDescriptionInput,\n SetEnableChatInput,\n SetExternalSkillGithubUrlInput,\n SetExternalSkillNameInput,\n SetObservabilityEnabledInput,\n SetPackageIdentifierInput,\n SetPackageVersionInput,\n SetPowerhouseLevelInput,\n SetProxyEnabledInput,\n SetPublishStatusInput,\n SetVersionInput,\n UpdateProfileInput,\n} from './types.js';\n\ntype Properties<T> = Required<{\n [K in keyof T]: z.ZodType<T[K]>;\n}>;\n\ntype definedNonNullAny = {};\n\nexport const isDefinedNonNullAny = (v: any): v is definedNonNullAny => v !== undefined && v !== null;\n\nexport const definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));\n\nexport const PowerhouseLevelSchema = z.enum(['Connect', 'Disabled', 'Reactor', 'Switchboard']);\n\nexport const PublishStatusSchema = z.enum(['Failed', 'InProgress', 'Pending', 'Succeeded']);\n\nexport const PublishTagSchema = z.enum(['Dev', 'Production', 'Staging']);\n\nexport function AddExternalSkillInputSchema(): z.ZodObject<Properties<AddExternalSkillInput>> {\n return z.object({\n githubUrl: z.url(),\n id: z.string(),\n name: z.string(),\n });\n}\n\nexport function AddModelInputSchema(): z.ZodObject<Properties<AddModelInput>> {\n return z.object({\n id: z.string(),\n isDefault: z.boolean().nullish(),\n });\n}\n\nexport function AddPackageDocumentTypeInputSchema(): z.ZodObject<Properties<AddPackageDocumentTypeInput>> {\n return z.object({\n documentType: z.string(),\n packageId: z.string(),\n });\n}\n\nexport function AddPowerhousePackageInputSchema(): z.ZodObject<Properties<AddPowerhousePackageInput>> {\n return z.object({\n id: z.string(),\n packageName: z.string(),\n });\n}\n\nexport function AddProfileInputSchema(): z.ZodObject<Properties<AddProfileInput>> {\n return z.object({\n content: z.string(),\n id: z.string(),\n insertBefore: z.string().nullish(),\n title: z.string(),\n });\n}\n\nexport function AddSupportedResourceInputSchema(): z.ZodObject<Properties<AddSupportedResourceInput>> {\n return z.object({\n resource: z.string(),\n });\n}\n\nexport function BumpVersionInputSchema(): z.ZodObject<Properties<BumpVersionInput>> {\n return z.object({\n version: z.string(),\n });\n}\n\nexport function ClearAgentImageInputSchema(): z.ZodObject<Properties<ClearAgentImageInput>> {\n return z.object({\n _: z.boolean().nullish(),\n });\n}\n\nexport function DisableMastraInputSchema(): z.ZodObject<Properties<DisableMastraInput>> {\n return z.object({\n _: z.boolean().nullish(),\n });\n}\n\nexport function DisableRoutineInputSchema(): z.ZodObject<Properties<DisableRoutineInput>> {\n return z.object({\n _: z.boolean().nullish(),\n });\n}\n\nexport function EnableMastraInputSchema(): z.ZodObject<Properties<EnableMastraInput>> {\n return z.object({\n agentId: z.string(),\n agentName: z.string(),\n });\n}\n\nexport function EnableRoutineInputSchema(): z.ZodObject<Properties<EnableRoutineInput>> {\n return z.object({\n _: z.boolean().nullish(),\n });\n}\n\nexport function ExternalSkillSchema(): z.ZodObject<Properties<ExternalSkill>> {\n return z.object({\n __typename: z.literal('ExternalSkill').optional(),\n githubUrl: z.url(),\n id: z.string(),\n name: z.string(),\n });\n}\n\nexport function ImportModelInputSchema(): z.ZodObject<Properties<ImportModelInput>> {\n return z.object({\n id: z.string(),\n isDefault: z.boolean(),\n });\n}\n\nexport function ImportPackageInputSchema(): z.ZodObject<Properties<ImportPackageInput>> {\n return z.object({\n documentTypes: z.array(z.string()),\n id: z.string(),\n packageName: z.string(),\n version: z.string().nullish(),\n });\n}\n\nexport function ImportProfileInputSchema(): z.ZodObject<Properties<ImportProfileInput>> {\n return z.object({\n content: z.string(),\n id: z.string(),\n title: z.string(),\n });\n}\n\nexport function ImportSkillInputSchema(): z.ZodObject<Properties<ImportSkillInput>> {\n return z.object({\n githubUrl: z.url(),\n id: z.string(),\n name: z.string(),\n });\n}\n\nexport function ImportSpecInputSchema(): z.ZodObject<Properties<ImportSpecInput>> {\n return z.object({\n agentDescription: z.string().nullish(),\n agentId: z.string().nullish(),\n agentImage: z.string().nullish(),\n agentName: z.string().nullish(),\n description: z.string(),\n enableChat: z.boolean().nullish(),\n externalSkills: z.array(z.lazy(() => ImportSkillInputSchema())),\n mastraEnabled: z.boolean(),\n models: z.array(z.lazy(() => ImportModelInputSchema())).nullish(),\n name: z.string(),\n observabilityEnabled: z.boolean().nullish(),\n packages: z.array(z.lazy(() => ImportPackageInputSchema())),\n powerhouse: PowerhouseLevelSchema,\n profiles: z.array(z.lazy(() => ImportProfileInputSchema())).nullish(),\n proxyEnabled: z.boolean().nullish(),\n routineEnabled: z.boolean(),\n scope: z.string().nullish(),\n supportedResources: z.array(z.string()).nullish(),\n version: z.string(),\n });\n}\n\nexport function PhClintAgentModelSchema(): z.ZodObject<Properties<PhClintAgentModel>> {\n return z.object({\n __typename: z.literal('PhClintAgentModel').optional(),\n id: z.string(),\n isDefault: z.boolean(),\n });\n}\n\nexport function PhClintAgentProfileSchema(): z.ZodObject<Properties<PhClintAgentProfile>> {\n return z.object({\n __typename: z.literal('PhClintAgentProfile').optional(),\n content: z.string(),\n id: z.string(),\n title: z.string(),\n });\n}\n\nexport function PhClintDeploymentSchema(): z.ZodObject<Properties<PhClintDeployment>> {\n return z.object({\n __typename: z.literal('PhClintDeployment').optional(),\n observabilityEnabled: z.boolean(),\n proxyEnabled: z.boolean(),\n supportedResources: z.array(z.string()),\n });\n}\n\nexport function PhClintFeaturesSchema(): z.ZodObject<Properties<PhClintFeatures>> {\n return z.object({\n __typename: z.literal('PhClintFeatures').optional(),\n mastra: z.lazy(() => PhClintMastraFeatureSchema()),\n powerhouse: PowerhouseLevelSchema,\n routine: z.lazy(() => PhClintRoutineFeatureSchema()),\n });\n}\n\nexport function PhClintMastraCommonSchema(): z.ZodObject<Properties<PhClintMastraCommon>> {\n return z.object({\n __typename: z.literal('PhClintMastraCommon').optional(),\n enableChat: z.boolean(),\n });\n}\n\nexport function PhClintMastraFeatureSchema(): z.ZodObject<Properties<PhClintMastraFeature>> {\n return z.object({\n __typename: z.literal('PhClintMastraFeature').optional(),\n agentDescription: z.string().nullish(),\n agentId: z.string().nullish(),\n agentImage: z.string().nullish(),\n agentName: z.string().nullish(),\n common: z.lazy(() => PhClintMastraCommonSchema()),\n enabled: z.boolean(),\n models: z.array(z.lazy(() => PhClintAgentModelSchema())),\n profiles: z.array(z.lazy(() => PhClintAgentProfileSchema())),\n });\n}\n\nexport function PhClintProjectStateSchema(): z.ZodObject<Properties<PhClintProjectState>> {\n return z.object({\n __typename: z.literal('PhClintProjectState').optional(),\n deployment: z.lazy(() => PhClintDeploymentSchema()),\n description: z.string(),\n externalSkills: z.array(z.lazy(() => ExternalSkillSchema())),\n features: z.lazy(() => PhClintFeaturesSchema()),\n name: z.string().nullish(),\n packages: z.array(z.lazy(() => PowerhousePackageSchema())),\n publishHistory: z.array(z.lazy(() => PublishRecordSchema())),\n scope: z.string().nullish(),\n version: z.string(),\n });\n}\n\nexport function PhClintRoutineFeatureSchema(): z.ZodObject<Properties<PhClintRoutineFeature>> {\n return z.object({\n __typename: z.literal('PhClintRoutineFeature').optional(),\n enabled: z.boolean(),\n });\n}\n\nexport function PowerhousePackageSchema(): z.ZodObject<Properties<PowerhousePackage>> {\n return z.object({\n __typename: z.literal('PowerhousePackage').optional(),\n documentTypes: z.array(z.string()),\n id: z.string(),\n managed: z.boolean(),\n packageName: z.string(),\n version: z.string().nullish(),\n });\n}\n\nexport function PublishDevInputSchema(): z.ZodObject<Properties<PublishDevInput>> {\n return z.object({\n id: z.string(),\n timestamp: z.iso.datetime(),\n });\n}\n\nexport function PublishProductionInputSchema(): z.ZodObject<Properties<PublishProductionInput>> {\n return z.object({\n id: z.string(),\n timestamp: z.iso.datetime(),\n });\n}\n\nexport function PublishRecordSchema(): z.ZodObject<Properties<PublishRecord>> {\n return z.object({\n __typename: z.literal('PublishRecord').optional(),\n id: z.string(),\n status: PublishStatusSchema,\n tag: PublishTagSchema,\n timestamp: z.iso.datetime(),\n version: z.string(),\n });\n}\n\nexport function PublishStagingInputSchema(): z.ZodObject<Properties<PublishStagingInput>> {\n return z.object({\n id: z.string(),\n timestamp: z.iso.datetime(),\n });\n}\n\nexport function RemoveExternalSkillInputSchema(): z.ZodObject<Properties<RemoveExternalSkillInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function RemoveModelInputSchema(): z.ZodObject<Properties<RemoveModelInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function RemovePackageDocumentTypeInputSchema(): z.ZodObject<Properties<RemovePackageDocumentTypeInput>> {\n return z.object({\n documentType: z.string(),\n packageId: z.string(),\n });\n}\n\nexport function RemovePowerhousePackageInputSchema(): z.ZodObject<Properties<RemovePowerhousePackageInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function RemoveProfileInputSchema(): z.ZodObject<Properties<RemoveProfileInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function RemoveSupportedResourceInputSchema(): z.ZodObject<Properties<RemoveSupportedResourceInput>> {\n return z.object({\n resource: z.string(),\n });\n}\n\nexport function ReorderProfilesInputSchema(): z.ZodObject<Properties<ReorderProfilesInput>> {\n return z.object({\n ids: z.array(z.string()),\n insertBefore: z.string().nullish(),\n });\n}\n\nexport function SetAgentDescriptionInputSchema(): z.ZodObject<Properties<SetAgentDescriptionInput>> {\n return z.object({\n description: z.string(),\n });\n}\n\nexport function SetAgentIdInputSchema(): z.ZodObject<Properties<SetAgentIdInput>> {\n return z.object({\n agentId: z.string(),\n });\n}\n\nexport function SetAgentImageInputSchema(): z.ZodObject<Properties<SetAgentImageInput>> {\n return z.object({\n image: z.string(),\n });\n}\n\nexport function SetAgentNameInputSchema(): z.ZodObject<Properties<SetAgentNameInput>> {\n return z.object({\n agentName: z.string(),\n });\n}\n\nexport function SetDefaultModelInputSchema(): z.ZodObject<Properties<SetDefaultModelInput>> {\n return z.object({\n id: z.string(),\n });\n}\n\nexport function SetDescriptionInputSchema(): z.ZodObject<Properties<SetDescriptionInput>> {\n return z.object({\n description: z.string(),\n });\n}\n\nexport function SetEnableChatInputSchema(): z.ZodObject<Properties<SetEnableChatInput>> {\n return z.object({\n enabled: z.boolean(),\n });\n}\n\nexport function SetExternalSkillGithubUrlInputSchema(): z.ZodObject<Properties<SetExternalSkillGithubUrlInput>> {\n return z.object({\n githubUrl: z.url(),\n id: z.string(),\n });\n}\n\nexport function SetExternalSkillNameInputSchema(): z.ZodObject<Properties<SetExternalSkillNameInput>> {\n return z.object({\n id: z.string(),\n name: z.string(),\n });\n}\n\nexport function SetObservabilityEnabledInputSchema(): z.ZodObject<Properties<SetObservabilityEnabledInput>> {\n return z.object({\n enabled: z.boolean(),\n });\n}\n\nexport function SetPackageIdentifierInputSchema(): z.ZodObject<Properties<SetPackageIdentifierInput>> {\n return z.object({\n identifier: z.string(),\n });\n}\n\nexport function SetPackageVersionInputSchema(): z.ZodObject<Properties<SetPackageVersionInput>> {\n return z.object({\n packageId: z.string(),\n version: z.string().nullish(),\n });\n}\n\nexport function SetPowerhouseLevelInputSchema(): z.ZodObject<Properties<SetPowerhouseLevelInput>> {\n return z.object({\n level: PowerhouseLevelSchema,\n skipAutoProxy: z.boolean().nullish(),\n });\n}\n\nexport function SetProxyEnabledInputSchema(): z.ZodObject<Properties<SetProxyEnabledInput>> {\n return z.object({\n enabled: z.boolean(),\n });\n}\n\nexport function SetPublishStatusInputSchema(): z.ZodObject<Properties<SetPublishStatusInput>> {\n return z.object({\n id: z.string(),\n status: PublishStatusSchema,\n });\n}\n\nexport function SetVersionInputSchema(): z.ZodObject<Properties<SetVersionInput>> {\n return z.object({\n version: z.string(),\n });\n}\n\nexport function UpdateProfileInputSchema(): z.ZodObject<Properties<UpdateProfileInput>> {\n return z.object({\n content: z.string().nullish(),\n id: z.string(),\n title: z.string().nullish(),\n });\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { AddSupportedResourceInputSchema, RemoveSupportedResourceInputSchema, SetObservabilityEnabledInputSchema, SetProxyEnabledInputSchema } from '../schema/zod.js';\nimport type { AddSupportedResourceInput, RemoveSupportedResourceInput, SetObservabilityEnabledInput, SetProxyEnabledInput } from '../types.js';\nimport type { AddSupportedResourceAction, RemoveSupportedResourceAction, SetObservabilityEnabledAction, SetProxyEnabledAction } from './actions.js';\n\nexport const addSupportedResource = (input: AddSupportedResourceInput) => createAction<AddSupportedResourceAction>('ADD_SUPPORTED_RESOURCE', { ...input }, undefined, AddSupportedResourceInputSchema, 'global');\n\nexport const removeSupportedResource = (input: RemoveSupportedResourceInput) => createAction<RemoveSupportedResourceAction>('REMOVE_SUPPORTED_RESOURCE', { ...input }, undefined, RemoveSupportedResourceInputSchema, 'global');\n\nexport const setProxyEnabled = (input: SetProxyEnabledInput) => createAction<SetProxyEnabledAction>('SET_PROXY_ENABLED', { ...input }, undefined, SetProxyEnabledInputSchema, 'global');\n\nexport const setObservabilityEnabled = (input: SetObservabilityEnabledInput) => createAction<SetObservabilityEnabledAction>('SET_OBSERVABILITY_ENABLED', { ...input }, undefined, SetObservabilityEnabledInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { AddExternalSkillInputSchema, RemoveExternalSkillInputSchema, SetExternalSkillGithubUrlInputSchema, SetExternalSkillNameInputSchema } from '../schema/zod.js';\nimport type { AddExternalSkillInput, RemoveExternalSkillInput, SetExternalSkillGithubUrlInput, SetExternalSkillNameInput } from '../types.js';\nimport type { AddExternalSkillAction, RemoveExternalSkillAction, SetExternalSkillGithubUrlAction, SetExternalSkillNameAction } from './actions.js';\n\nexport const addExternalSkill = (input: AddExternalSkillInput) => createAction<AddExternalSkillAction>('ADD_EXTERNAL_SKILL', { ...input }, undefined, AddExternalSkillInputSchema, 'global');\n\nexport const removeExternalSkill = (input: RemoveExternalSkillInput) => createAction<RemoveExternalSkillAction>('REMOVE_EXTERNAL_SKILL', { ...input }, undefined, RemoveExternalSkillInputSchema, 'global');\n\nexport const setExternalSkillName = (input: SetExternalSkillNameInput) => createAction<SetExternalSkillNameAction>('SET_EXTERNAL_SKILL_NAME', { ...input }, undefined, SetExternalSkillNameInputSchema, 'global');\n\nexport const setExternalSkillGithubUrl = (input: SetExternalSkillGithubUrlInput) => createAction<SetExternalSkillGithubUrlAction>('SET_EXTERNAL_SKILL_GITHUB_URL', { ...input }, undefined, SetExternalSkillGithubUrlInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport {\n AddModelInputSchema,\n AddProfileInputSchema,\n ClearAgentImageInputSchema,\n DisableMastraInputSchema,\n EnableMastraInputSchema,\n RemoveModelInputSchema,\n RemoveProfileInputSchema,\n ReorderProfilesInputSchema,\n SetAgentDescriptionInputSchema,\n SetAgentIdInputSchema,\n SetAgentImageInputSchema,\n SetAgentNameInputSchema,\n SetDefaultModelInputSchema,\n SetEnableChatInputSchema,\n UpdateProfileInputSchema,\n} from '../schema/zod.js';\nimport type {\n AddModelInput,\n AddProfileInput,\n ClearAgentImageInput,\n DisableMastraInput,\n EnableMastraInput,\n RemoveModelInput,\n RemoveProfileInput,\n ReorderProfilesInput,\n SetAgentDescriptionInput,\n SetAgentIdInput,\n SetAgentImageInput,\n SetAgentNameInput,\n SetDefaultModelInput,\n SetEnableChatInput,\n UpdateProfileInput,\n} from '../types.js';\nimport type {\n AddModelAction,\n AddProfileAction,\n ClearAgentImageAction,\n DisableMastraAction,\n EnableMastraAction,\n RemoveModelAction,\n RemoveProfileAction,\n ReorderProfilesAction,\n SetAgentDescriptionAction,\n SetAgentIdAction,\n SetAgentImageAction,\n SetAgentNameAction,\n SetDefaultModelAction,\n SetEnableChatAction,\n UpdateProfileAction,\n} from './actions.js';\n\nexport const enableMastra = (input: EnableMastraInput) => createAction<EnableMastraAction>('ENABLE_MASTRA', { ...input }, undefined, EnableMastraInputSchema, 'global');\n\nexport const disableMastra = (input: DisableMastraInput) => createAction<DisableMastraAction>('DISABLE_MASTRA', { ...input }, undefined, DisableMastraInputSchema, 'global');\n\nexport const setAgentId = (input: SetAgentIdInput) => createAction<SetAgentIdAction>('SET_AGENT_ID', { ...input }, undefined, SetAgentIdInputSchema, 'global');\n\nexport const setAgentName = (input: SetAgentNameInput) => createAction<SetAgentNameAction>('SET_AGENT_NAME', { ...input }, undefined, SetAgentNameInputSchema, 'global');\n\nexport const addModel = (input: AddModelInput) => createAction<AddModelAction>('ADD_MODEL', { ...input }, undefined, AddModelInputSchema, 'global');\n\nexport const removeModel = (input: RemoveModelInput) => createAction<RemoveModelAction>('REMOVE_MODEL', { ...input }, undefined, RemoveModelInputSchema, 'global');\n\nexport const setDefaultModel = (input: SetDefaultModelInput) => createAction<SetDefaultModelAction>('SET_DEFAULT_MODEL', { ...input }, undefined, SetDefaultModelInputSchema, 'global');\n\nexport const addProfile = (input: AddProfileInput) => createAction<AddProfileAction>('ADD_PROFILE', { ...input }, undefined, AddProfileInputSchema, 'global');\n\nexport const updateProfile = (input: UpdateProfileInput) => createAction<UpdateProfileAction>('UPDATE_PROFILE', { ...input }, undefined, UpdateProfileInputSchema, 'global');\n\nexport const removeProfile = (input: RemoveProfileInput) => createAction<RemoveProfileAction>('REMOVE_PROFILE', { ...input }, undefined, RemoveProfileInputSchema, 'global');\n\nexport const reorderProfiles = (input: ReorderProfilesInput) => createAction<ReorderProfilesAction>('REORDER_PROFILES', { ...input }, undefined, ReorderProfilesInputSchema, 'global');\n\nexport const setAgentDescription = (input: SetAgentDescriptionInput) => createAction<SetAgentDescriptionAction>('SET_AGENT_DESCRIPTION', { ...input }, undefined, SetAgentDescriptionInputSchema, 'global');\n\nexport const setAgentImage = (input: SetAgentImageInput) => createAction<SetAgentImageAction>('SET_AGENT_IMAGE', { ...input }, undefined, SetAgentImageInputSchema, 'global');\n\nexport const clearAgentImage = (input: ClearAgentImageInput) => createAction<ClearAgentImageAction>('CLEAR_AGENT_IMAGE', { ...input }, undefined, ClearAgentImageInputSchema, 'global');\n\nexport const setEnableChat = (input: SetEnableChatInput) => createAction<SetEnableChatAction>('SET_ENABLE_CHAT', { ...input }, undefined, SetEnableChatInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { SetPowerhouseLevelInputSchema } from '../schema/zod.js';\nimport type { SetPowerhouseLevelInput } from '../types.js';\nimport type { SetPowerhouseLevelAction } from './actions.js';\n\nexport const setPowerhouseLevel = (input: SetPowerhouseLevelInput) => createAction<SetPowerhouseLevelAction>('SET_POWERHOUSE_LEVEL', { ...input }, undefined, SetPowerhouseLevelInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { DisableRoutineInputSchema, EnableRoutineInputSchema } from '../schema/zod.js';\nimport type { DisableRoutineInput, EnableRoutineInput } from '../types.js';\nimport type { DisableRoutineAction, EnableRoutineAction } from './actions.js';\n\nexport const enableRoutine = (input: EnableRoutineInput) => createAction<EnableRoutineAction>('ENABLE_ROUTINE', { ...input }, undefined, EnableRoutineInputSchema, 'global');\n\nexport const disableRoutine = (input: DisableRoutineInput) => createAction<DisableRoutineAction>('DISABLE_ROUTINE', { ...input }, undefined, DisableRoutineInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { SetDescriptionInputSchema, SetPackageIdentifierInputSchema, SetVersionInputSchema } from '../schema/zod.js';\nimport type { SetDescriptionInput, SetPackageIdentifierInput, SetVersionInput } from '../types.js';\nimport type { SetDescriptionAction, SetPackageIdentifierAction, SetVersionAction } from './actions.js';\n\nexport const setDescription = (input: SetDescriptionInput) => createAction<SetDescriptionAction>('SET_DESCRIPTION', { ...input }, undefined, SetDescriptionInputSchema, 'global');\n\nexport const setVersion = (input: SetVersionInput) => createAction<SetVersionAction>('SET_VERSION', { ...input }, undefined, SetVersionInputSchema, 'global');\n\nexport const setPackageIdentifier = (input: SetPackageIdentifierInput) => createAction<SetPackageIdentifierAction>('SET_PACKAGE_IDENTIFIER', { ...input }, undefined, SetPackageIdentifierInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { ImportSpecInputSchema } from '../schema/zod.js';\nimport type { ImportSpecInput } from '../types.js';\nimport type { ImportSpecAction } from './actions.js';\n\nexport const importSpec = (input: ImportSpecInput) => createAction<ImportSpecAction>('IMPORT_SPEC', { ...input }, undefined, ImportSpecInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { AddPackageDocumentTypeInputSchema, AddPowerhousePackageInputSchema, RemovePackageDocumentTypeInputSchema, RemovePowerhousePackageInputSchema, SetPackageVersionInputSchema } from '../schema/zod.js';\nimport type { AddPackageDocumentTypeInput, AddPowerhousePackageInput, RemovePackageDocumentTypeInput, RemovePowerhousePackageInput, SetPackageVersionInput } from '../types.js';\nimport type { AddPackageDocumentTypeAction, AddPowerhousePackageAction, RemovePackageDocumentTypeAction, RemovePowerhousePackageAction, SetPackageVersionAction } from './actions.js';\n\nexport const addPowerhousePackage = (input: AddPowerhousePackageInput) => createAction<AddPowerhousePackageAction>('ADD_POWERHOUSE_PACKAGE', { ...input }, undefined, AddPowerhousePackageInputSchema, 'global');\n\nexport const removePowerhousePackage = (input: RemovePowerhousePackageInput) => createAction<RemovePowerhousePackageAction>('REMOVE_POWERHOUSE_PACKAGE', { ...input }, undefined, RemovePowerhousePackageInputSchema, 'global');\n\nexport const addPackageDocumentType = (input: AddPackageDocumentTypeInput) => createAction<AddPackageDocumentTypeAction>('ADD_PACKAGE_DOCUMENT_TYPE', { ...input }, undefined, AddPackageDocumentTypeInputSchema, 'global');\n\nexport const removePackageDocumentType = (input: RemovePackageDocumentTypeInput) => createAction<RemovePackageDocumentTypeAction>('REMOVE_PACKAGE_DOCUMENT_TYPE', { ...input }, undefined, RemovePackageDocumentTypeInputSchema, 'global');\n\nexport const setPackageVersion = (input: SetPackageVersionInput) => createAction<SetPackageVersionAction>('SET_PACKAGE_VERSION', { ...input }, undefined, SetPackageVersionInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { createAction } from 'document-model';\nimport { BumpVersionInputSchema, PublishDevInputSchema, PublishProductionInputSchema, PublishStagingInputSchema, SetPublishStatusInputSchema } from '../schema/zod.js';\nimport type { BumpVersionInput, PublishDevInput, PublishProductionInput, PublishStagingInput, SetPublishStatusInput } from '../types.js';\nimport type { BumpVersionAction, PublishDevAction, PublishProductionAction, PublishStagingAction, SetPublishStatusAction } from './actions.js';\n\nexport const bumpVersion = (input: BumpVersionInput) => createAction<BumpVersionAction>('BUMP_VERSION', { ...input }, undefined, BumpVersionInputSchema, 'global');\n\nexport const publishDev = (input: PublishDevInput) => createAction<PublishDevAction>('PUBLISH_DEV', { ...input }, undefined, PublishDevInputSchema, 'global');\n\nexport const publishStaging = (input: PublishStagingInput) => createAction<PublishStagingAction>('PUBLISH_STAGING', { ...input }, undefined, PublishStagingInputSchema, 'global');\n\nexport const publishProduction = (input: PublishProductionInput) => createAction<PublishProductionAction>('PUBLISH_PRODUCTION', { ...input }, undefined, PublishProductionInputSchema, 'global');\n\nexport const setPublishStatus = (input: SetPublishStatusInput) => createAction<SetPublishStatusAction>('SET_PUBLISH_STATUS', { ...input }, undefined, SetPublishStatusInputSchema, 'global');\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { baseActions } from 'document-model';\nimport {\n phClintProjectDeploymentActions,\n phClintProjectExternalSkillsActions,\n phClintProjectFeaturesMastraActions,\n phClintProjectFeaturesPowerhouseActions,\n phClintProjectFeaturesRoutineActions,\n phClintProjectIdentityActions,\n phClintProjectLifecycleActions,\n phClintProjectPowerhousePackagesActions,\n phClintProjectPublishingActions,\n} from './gen/creators.js';\n\n/** Actions for the PhClintProject document model */\n\nexport const actions = {\n ...baseActions,\n ...phClintProjectIdentityActions,\n ...phClintProjectFeaturesPowerhouseActions,\n ...phClintProjectFeaturesMastraActions,\n ...phClintProjectFeaturesRoutineActions,\n ...phClintProjectPowerhousePackagesActions,\n ...phClintProjectExternalSkillsActions,\n ...phClintProjectPublishingActions,\n ...phClintProjectLifecycleActions,\n ...phClintProjectDeploymentActions,\n};\n","import type { DocumentModelGlobalState } from 'document-model';\n\nexport const documentModel: DocumentModelGlobalState = {\n id: 'powerhouse/ph-clint-project',\n name: 'PhClintProject',\n author: {\n name: 'Powerhouse Inc.',\n website: 'https://powerhouse.inc',\n },\n extension: 'pcp',\n description:\n 'A ph-clint implementation project specification. Drives code generation of a ph-clint CLI project: identity fields (name, scope, version, description, bin) plus three feature toggles (Powerhouse, Mastra, Routine). Enabling Powerhouse is irreversible; enabling Mastra auto-enables Routine; disabling Routine is blocked while Mastra is on.',\n specifications: [\n {\n state: {\n local: {\n schema: '',\n examples: [],\n initialValue: '',\n },\n global: {\n schema:\n 'type PhClintProjectState {\\n name: String\\n scope: String\\n version: String!\\n description: String!\\n features: PhClintFeatures!\\n packages: [PowerhousePackage!]!\\n externalSkills: [ExternalSkill!]!\\n publishHistory: [PublishRecord!]!\\n deployment: PhClintDeployment!\\n}\\n\\ntype PhClintFeatures {\\n powerhouse: PowerhouseLevel!\\n mastra: PhClintMastraFeature!\\n routine: PhClintRoutineFeature!\\n}\\n\\nenum PowerhouseLevel {\\n Disabled\\n Reactor\\n Switchboard\\n Connect\\n}\\n\\ntype PhClintMastraFeature {\\n enabled: Boolean!\\n agentId: String\\n agentName: String\\n agentDescription: String\\n agentImage: String\\n models: [PhClintAgentModel!]!\\n profiles: [PhClintAgentProfile!]!\\n common: PhClintMastraCommon!\\n}\\n\\ntype PhClintMastraCommon {\\n enableChat: Boolean!\\n}\\n\\ntype PhClintAgentModel {\\n id: String!\\n isDefault: Boolean!\\n}\\n\\ntype PhClintAgentProfile {\\n id: String!\\n title: String!\\n content: String!\\n}\\n\\ntype PhClintRoutineFeature {\\n enabled: Boolean!\\n}\\n\\ntype PowerhousePackage {\\n id: OID!\\n packageName: String!\\n documentTypes: [String!]!\\n version: String\\n managed: Boolean!\\n}\\n\\ntype ExternalSkill {\\n id: OID!\\n name: String!\\n githubUrl: URL!\\n}\\n\\nenum PublishTag {\\n Dev\\n Staging\\n Production\\n}\\n\\nenum PublishStatus {\\n Pending\\n InProgress\\n Succeeded\\n Failed\\n}\\n\\ntype PublishRecord {\\n id: OID!\\n tag: PublishTag!\\n version: String!\\n timestamp: DateTime!\\n status: PublishStatus!\\n}\\n\\ntype PhClintDeployment {\\n proxyEnabled: Boolean!\\n observabilityEnabled: Boolean!\\n supportedResources: [String!]!\\n}',\n examples: [],\n initialValue:\n '{\\n \"name\": null,\\n \"scope\": null,\\n \"version\": \"0.1.0\",\\n \"description\": \"\",\\n \"features\": {\\n \"powerhouse\": \"Disabled\",\\n \"mastra\": {\\n \"enabled\": false,\\n \"agentId\": null,\\n \"agentName\": null,\\n \"agentDescription\": null,\\n \"agentImage\": null,\\n \"models\": [],\\n \"profiles\": [],\\n \"common\": { \"enableChat\": false }\\n },\\n \"routine\": { \"enabled\": false }\\n },\\n \"packages\": [],\\n \"externalSkills\": [],\\n \"publishHistory\": [],\\n \"deployment\": {\\n \"proxyEnabled\": false,\\n \"observabilityEnabled\": false,\\n \"supportedResources\": [\\n \"vetra-agent-s\",\\n \"vetra-agent-m\",\\n \"vetra-agent-l\",\\n \"vetra-agent-xl\",\\n \"vetra-agent-xxl\"\\n ]\\n }\\n}',\n },\n },\n modules: [\n {\n id: 'm-identity',\n name: 'identity',\n description: 'Package identity fields: name, scope, version, description, bin',\n operations: [\n {\n id: 'o-set-description',\n name: 'SET_DESCRIPTION',\n description: 'Set the package description.',\n schema: 'input SetDescriptionInput {\\n description: String!\\n}',\n template: 'Set the package description.',\n reducer: 'state.description = action.input.description;',\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-version',\n name: 'SET_VERSION',\n description: 'Set the package version. Must be a valid semver string.',\n schema: 'input SetVersionInput {\\n version: String!\\n}',\n template: 'Set the package version. Must be a valid semver string.',\n reducer: 'if (!/^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[0-9A-Za-z.-]+)?(?:\\\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {\\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\\n}\\nstate.version = action.input.version;',\n errors: [\n {\n id: 'e-set-version-invalid',\n name: 'InvalidVersionError',\n code: 'INVALID_VERSION',\n description: 'The version must be a valid semver string (major.minor.patch, optionally with prerelease/build metadata).',\n template: 'Invalid version: {{version}}',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-package-identifier',\n name: 'SET_PACKAGE_IDENTIFIER',\n description: \"Set the package identifier. Parses scope and name from a string like '@scope/name-cli' or just 'name-cli'. Auto-adds '-cli' suffix if missing, stores scope with '@' prefix.\",\n schema: 'input SetPackageIdentifierInput {\\n identifier: String!\\n}',\n template: \"Set the package identifier. Parses scope and name from a string like '@scope/name-cli' or just 'name-cli'.\",\n reducer:\n \"const trimmed = action.input.identifier.trim();\\nif (!trimmed) {\\n throw new InvalidPackageIdentifierError('Package identifier must not be empty');\\n}\\nlet scopePart = null;\\nlet namePart = trimmed;\\nif (trimmed.includes('/')) {\\n const parts = trimmed.split('/');\\n if (parts.length !== 2 || !parts[0] || !parts[1]) {\\n throw new InvalidPackageIdentifierError(`Invalid package identifier: ${trimmed}`);\\n }\\n scopePart = parts[0].replace(/^@/, '');\\n namePart = parts[1];\\n}\\nif (scopePart !== null) {\\n if (!/^[a-z][a-z0-9-]*$/.test(scopePart)) {\\n throw new InvalidPackageIdentifierError(`Invalid scope: ${scopePart}`);\\n }\\n}\\nif (!namePart.endsWith('-cli')) {\\n namePart = namePart + '-cli';\\n}\\nif (!/^[a-z][a-z0-9-]*$/.test(namePart)) {\\n throw new InvalidPackageIdentifierError(`Invalid package name: ${namePart}`);\\n}\\nstate.scope = scopePart ? `@${scopePart}` : null;\\nstate.name = namePart;\\nconst managed = state.packages.find((p) => p.managed);\\nif (managed) {\\n const appBase = namePart.replace(/-cli$/, '-app');\\n managed.packageName = scopePart ? `@${scopePart}/${appBase}` : appBase;\\n managed.id = `app-${namePart}`;\\n}\",\n errors: [\n {\n id: 'e-invalid-package-identifier',\n name: 'InvalidPackageIdentifierError',\n code: 'INVALID_PACKAGE_IDENTIFIER',\n description: 'The package identifier is invalid. Must be a valid npm package name with optional scope.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-features-powerhouse',\n name: 'features_powerhouse',\n description: 'Powerhouse integration level. Ordered enum: Disabled < Reactor < Switchboard < Connect. Once above Disabled, cannot go back to Disabled (irreversible migration).',\n operations: [\n {\n id: 'o-set-powerhouse-level',\n name: 'SET_POWERHOUSE_LEVEL',\n description: 'Set the Powerhouse integration level. Ordered: Disabled < Reactor < Switchboard < Connect. Lowering below Reactor once above Disabled is not allowed (irreversible migration).',\n schema: 'input SetPowerhouseLevelInput {\\n level: PowerhouseLevel!\\n skipAutoProxy: Boolean\\n}',\n template: 'Set the Powerhouse integration level. Ordered: Disabled < Reactor < Switchboard < Connect. Lowering below Reactor once above Disabled is not allowed (irreversible migration).',\n reducer:\n \"const LEVELS = ['Disabled', 'Reactor', 'Switchboard', 'Connect'];\\nconst current = LEVELS.indexOf(state.features.powerhouse);\\nconst next = LEVELS.indexOf(action.input.level);\\nif (current >= 1 && next < 1) {\\n throw new CannotLowerPowerhouseError(\\n 'Cannot lower Powerhouse level below Reactor once enabled',\\n );\\n}\\nstate.features.powerhouse = action.input.level;\\nif (current === 0 && next >= 1) {\\n const hasManaged = state.packages.some((p) => p.managed);\\n if (!hasManaged) {\\n const baseName = state.name\\n ? state.name.replace(/-cli$/, '-app')\\n : 'app';\\n const appName =\\n state.scope && state.name\\n ? `${state.scope}/${baseName}`\\n : baseName;\\n state.packages.push({\\n id: `app-${state.name || 'managed'}`,\\n packageName: appName,\\n documentTypes: ['*/*'],\\n version: null,\\n managed: true,\\n });\\n }\\n}\\nif (next >= 2 && !action.input.skipAutoProxy) {\\n state.deployment.proxyEnabled = true;\\n}\",\n errors: [\n {\n id: 'e-cannot-lower-powerhouse',\n name: 'CannotLowerPowerhouseError',\n code: 'CANNOT_LOWER_POWERHOUSE',\n description: 'Cannot lower the Powerhouse level below Reactor once it has been set above Disabled.',\n template: 'Cannot lower Powerhouse level below Reactor once enabled',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-features-mastra',\n name: 'features_mastra',\n description: 'Mastra agent feature toggle. Orthogonal to Routine.',\n operations: [\n {\n id: 'o-enable-mastra',\n name: 'ENABLE_MASTRA',\n description: 'Enable the Mastra agent feature. Mastra and Routine are orthogonal \\u2014 enable Routine separately if needed. Idempotent.',\n schema: 'input EnableMastraInput {\\n agentId: String!\\n agentName: String!\\n}',\n template: 'Enable the Mastra agent feature. Mastra and Routine are orthogonal \\u2014 enable Routine separately if needed. Idempotent.',\n reducer:\n \"if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {\\n throw new InvalidAgentIdError(\\n `Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`,\\n );\\n}\\nconst trimmedName = action.input.agentName.trim();\\nif (!trimmedName) {\\n throw new InvalidAgentNameError('Agent name must not be empty.');\\n}\\nstate.features.mastra.enabled = true;\\nstate.features.mastra.agentId = action.input.agentId;\\nstate.features.mastra.agentName = trimmedName;\\n// Auto-add default model and profile\\nif (state.features.mastra.models.length === 0) {\\n state.features.mastra.models.push({ id: 'clint/demo-agent', isDefault: true });\\n}\\nif (state.features.mastra.profiles.length === 0) {\\n state.features.mastra.profiles.push({ id: 'base', title: 'Base Profile', content: 'You are a helpful assistant.' });\\n}\",\n errors: [\n {\n id: 'e-enable-mastra-invalid-id',\n name: 'InvalidAgentIdError',\n code: 'INVALID_AGENT_ID',\n description: 'The agent ID must match /^[a-z][a-z0-9-]*$/ \\u2014 lowercase kebab-case.',\n template: '',\n },\n {\n id: 'e-enable-mastra-invalid-name',\n name: 'InvalidAgentNameError',\n code: 'INVALID_AGENT_NAME',\n description: 'The agent name must not be empty after trimming.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-disable-mastra',\n name: 'DISABLE_MASTRA',\n description: 'Disable the Mastra agent feature. Does not affect Routine \\u2014 disable that separately if desired.',\n schema: 'input DisableMastraInput {\\n _: Boolean\\n}',\n template: 'Disable the Mastra agent feature. Does not affect Routine \\u2014 disable that separately if desired.',\n reducer:\n \"state.features.mastra.enabled = false;\\nstate.features.mastra.agentId = null;\\nstate.features.mastra.agentName = null;\\nstate.features.mastra.agentDescription = null;\\nstate.features.mastra.agentImage = null;\\nstate.features.mastra.models = [];\\nstate.features.mastra.profiles = [];\\nstate.features.mastra.common.enableChat = false;\\n// Remove auto-added clint-common package if managed\\nconst ccIdx = state.packages.findIndex(\\n (p) => p.packageName === '@powerhousedao/clint-common' && p.managed,\\n);\\nif (ccIdx !== -1) {\\n state.packages.splice(ccIdx, 1);\\n}\",\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-agent-id',\n name: 'SET_AGENT_ID',\n description: 'Set the agent ID. Must be lowercase kebab-case. Only valid when mastra is enabled.',\n schema: 'input SetAgentIdInput {\\n agentId: String!\\n}',\n template: 'Set the agent ID. Must be lowercase kebab-case. Only valid when mastra is enabled.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot set agent ID when Mastra is disabled.');\\n}\\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {\\n throw new InvalidAgentIdError(`Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`);\\n}\\nstate.features.mastra.agentId = action.input.agentId;\",\n errors: [\n {\n id: 'e-set-agent-id-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before setting agent identity.',\n template: '',\n },\n {\n id: 'e-set-agent-id-invalid',\n name: 'InvalidAgentIdError',\n code: 'INVALID_AGENT_ID',\n description: 'The agent ID must match /^[a-z][a-z0-9-]*$/ \\u2014 lowercase kebab-case.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-agent-name',\n name: 'SET_AGENT_NAME',\n description: 'Set the agent display name. Must be non-empty after trim. Only valid when mastra is enabled.',\n schema: 'input SetAgentNameInput {\\n agentName: String!\\n}',\n template: 'Set the agent display name. Must be non-empty after trim. Only valid when mastra is enabled.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot set agent name when Mastra is disabled.');\\n}\\nconst trimmedName = action.input.agentName.trim();\\nif (!trimmedName) {\\n throw new InvalidAgentNameError('Agent name must not be empty.');\\n}\\nstate.features.mastra.agentName = trimmedName;\",\n errors: [\n {\n id: 'e-set-agent-name-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before setting agent identity.',\n template: '',\n },\n {\n id: 'e-set-agent-name-invalid',\n name: 'InvalidAgentNameError',\n code: 'INVALID_AGENT_NAME',\n description: 'The agent name must not be empty after trimming.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-add-model',\n name: 'ADD_MODEL',\n description: 'Add a model to the agent. ID must be provider/model-name format. First model is forced default. If isDefault is true, previous default is unset.',\n schema: 'input AddModelInput {\\n id: String!\\n isDefault: Boolean\\n}',\n template: 'Add a model to the agent. ID must be provider/model-name format. First model is forced default. If isDefault is true, previous default is unset.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot add model when Mastra is disabled.');\\n}\\nif (!/^[a-z0-9-]+\\\\/[a-z0-9._-]+$/.test(action.input.id)) {\\n throw new InvalidModelIdError(`Invalid model ID: ${action.input.id}. Must be provider/model-name format.`);\\n}\\nif (state.features.mastra.models.find(m => m.id === action.input.id)) {\\n throw new DuplicateModelError(`Model already exists: ${action.input.id}`);\\n}\\nconst isFirst = state.features.mastra.models.length === 0;\\nconst makeDefault = isFirst || action.input.isDefault === true;\\nif (makeDefault) {\\n for (const m of state.features.mastra.models) {\\n m.isDefault = false;\\n }\\n}\\nstate.features.mastra.models.push({\\n id: action.input.id,\\n isDefault: makeDefault,\\n});\",\n errors: [\n {\n id: 'e-add-model-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing models.',\n template: '',\n },\n {\n id: 'e-add-model-invalid-id',\n name: 'InvalidModelIdError',\n code: 'INVALID_MODEL_ID',\n description: 'Model ID must match provider/model-name format.',\n template: '',\n },\n {\n id: 'e-add-model-duplicate',\n name: 'DuplicateModelError',\n code: 'DUPLICATE_MODEL',\n description: 'A model with this ID already exists.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-model',\n name: 'REMOVE_MODEL',\n description: 'Remove a model. If removing the default and others remain, promotes first remaining to default.',\n schema: 'input RemoveModelInput {\\n id: String!\\n}',\n template: 'Remove a model. If removing the default and others remain, promotes first remaining to default.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot remove model when Mastra is disabled.');\\n}\\nconst idx = state.features.mastra.models.findIndex(m => m.id === action.input.id);\\nif (idx === -1) {\\n throw new ModelNotFoundError(`Model not found: ${action.input.id}`);\\n}\\nconst wasDefault = state.features.mastra.models[idx].isDefault;\\nstate.features.mastra.models.splice(idx, 1);\\nif (wasDefault && state.features.mastra.models.length > 0) {\\n state.features.mastra.models[0].isDefault = true;\\n}\",\n errors: [\n {\n id: 'e-remove-model-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing models.',\n template: '',\n },\n {\n id: 'e-remove-model-not-found',\n name: 'ModelNotFoundError',\n code: 'MODEL_NOT_FOUND',\n description: 'The specified model was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-default-model',\n name: 'SET_DEFAULT_MODEL',\n description: 'Set a model as the default. Unsets the previous default.',\n schema: 'input SetDefaultModelInput {\\n id: String!\\n}',\n template: 'Set a model as the default. Unsets the previous default.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot set default model when Mastra is disabled.');\\n}\\nconst model = state.features.mastra.models.find(m => m.id === action.input.id);\\nif (!model) {\\n throw new ModelNotFoundError(`Model not found: ${action.input.id}`);\\n}\\nfor (const m of state.features.mastra.models) {\\n m.isDefault = false;\\n}\\nmodel.isDefault = true;\",\n errors: [\n {\n id: 'e-set-default-model-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing models.',\n template: '',\n },\n {\n id: 'e-set-default-model-not-found',\n name: 'ModelNotFoundError',\n code: 'MODEL_NOT_FOUND',\n description: 'The specified model was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-add-profile',\n name: 'ADD_PROFILE',\n description: 'Add an agent profile section. Inserted before insertBefore if provided, otherwise appended to end.',\n schema: 'input AddProfileInput {\\n id: String!\\n title: String!\\n content: String!\\n insertBefore: String\\n}',\n template: 'Add an agent profile section. Inserted before insertBefore if provided, otherwise appended to end.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot add profile when Mastra is disabled.');\\n}\\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {\\n throw new InvalidProfileIdError(`Invalid profile ID: ${action.input.id}. Must be lowercase kebab-case.`);\\n}\\nif (state.features.mastra.profiles.find(p => p.id === action.input.id)) {\\n throw new DuplicateProfileError(`Profile already exists: ${action.input.id}`);\\n}\\nconst profile = {\\n id: action.input.id,\\n title: action.input.title,\\n content: action.input.content,\\n};\\nif (action.input.insertBefore) {\\n const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);\\n if (beforeIdx === -1) {\\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\\n }\\n state.features.mastra.profiles.splice(beforeIdx, 0, profile);\\n} else {\\n state.features.mastra.profiles.push(profile);\\n}\",\n errors: [\n {\n id: 'e-add-profile-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing profiles.',\n template: '',\n },\n {\n id: 'e-add-profile-invalid-id',\n name: 'InvalidProfileIdError',\n code: 'INVALID_PROFILE_ID',\n description: 'Profile ID must match /^[a-z][a-z0-9-]*$/ \\u2014 lowercase kebab-case.',\n template: '',\n },\n {\n id: 'e-add-profile-duplicate',\n name: 'DuplicateProfileError',\n code: 'DUPLICATE_PROFILE',\n description: 'A profile with this ID already exists.',\n template: '',\n },\n {\n id: 'e-add-profile-not-found',\n name: 'ProfileNotFoundError',\n code: 'PROFILE_NOT_FOUND',\n description: 'The insertBefore profile was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-update-profile',\n name: 'UPDATE_PROFILE',\n description: \"Update an existing profile's title and/or content. Only updates provided fields.\",\n schema: 'input UpdateProfileInput {\\n id: String!\\n title: String\\n content: String\\n}',\n template: \"Update an existing profile's title and/or content. Only updates provided fields.\",\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot update profile when Mastra is disabled.');\\n}\\nconst profile = state.features.mastra.profiles.find(p => p.id === action.input.id);\\nif (!profile) {\\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\\n}\\nif (action.input.title) profile.title = action.input.title;\\nif (action.input.content) profile.content = action.input.content;\",\n errors: [\n {\n id: 'e-update-profile-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing profiles.',\n template: '',\n },\n {\n id: 'e-update-profile-not-found',\n name: 'ProfileNotFoundError',\n code: 'PROFILE_NOT_FOUND',\n description: 'The specified profile was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-profile',\n name: 'REMOVE_PROFILE',\n description: 'Remove an agent profile section.',\n schema: 'input RemoveProfileInput {\\n id: String!\\n}',\n template: 'Remove an agent profile section.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot remove profile when Mastra is disabled.');\\n}\\nconst idx = state.features.mastra.profiles.findIndex(p => p.id === action.input.id);\\nif (idx === -1) {\\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\\n}\\nstate.features.mastra.profiles.splice(idx, 1);\",\n errors: [\n {\n id: 'e-remove-profile-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing profiles.',\n template: '',\n },\n {\n id: 'e-remove-profile-not-found',\n name: 'ProfileNotFoundError',\n code: 'PROFILE_NOT_FOUND',\n description: 'The specified profile was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-reorder-profiles',\n name: 'REORDER_PROFILES',\n description: 'Move one or more profiles before another profile, or to the end if insertBefore is null.',\n schema: 'input ReorderProfilesInput {\\n ids: [String!]!\\n insertBefore: String\\n}',\n template: 'Move one or more profiles before another profile, or to the end if insertBefore is null.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot reorder profiles when Mastra is disabled.');\\n}\\nconst moving = [];\\nfor (const id of action.input.ids) {\\n const profile = state.features.mastra.profiles.find(p => p.id === id);\\n if (!profile) {\\n throw new ProfileNotFoundError(`Profile not found: ${id}`);\\n }\\n moving.push(profile);\\n}\\n// Remove moved profiles\\nstate.features.mastra.profiles = state.features.mastra.profiles.filter(p => !action.input.ids.includes(p.id));\\n// Insert at target position\\nif (action.input.insertBefore) {\\n const beforeIdx = state.features.mastra.profiles.findIndex(p => p.id === action.input.insertBefore);\\n if (beforeIdx === -1) {\\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\\n }\\n state.features.mastra.profiles.splice(beforeIdx, 0, ...moving);\\n} else {\\n state.features.mastra.profiles.push(...moving);\\n}\",\n errors: [\n {\n id: 'e-reorder-profiles-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before managing profiles.',\n template: '',\n },\n {\n id: 'e-reorder-profiles-not-found',\n name: 'ProfileNotFoundError',\n code: 'PROFILE_NOT_FOUND',\n description: 'A referenced profile was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-agent-description',\n name: 'SET_AGENT_DESCRIPTION',\n description: 'Set the agent description. Only valid when mastra is enabled.',\n schema: 'input SetAgentDescriptionInput {\\n description: String!\\n}',\n template: 'Set the agent description. Only valid when mastra is enabled.',\n reducer: \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot set agent description when Mastra is disabled.');\\n}\\nstate.features.mastra.agentDescription = action.input.description;\",\n errors: [\n {\n id: 'e-set-agent-desc-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before setting agent description.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-agent-image',\n name: 'SET_AGENT_IMAGE',\n description: 'Set the agent image URL (avatar). Only valid when mastra is enabled.',\n schema: 'input SetAgentImageInput {\\n image: String!\\n}',\n template: 'Set the agent image URL (avatar). Only valid when mastra is enabled.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError(\\n 'Cannot set agent image when Mastra is disabled.',\\n );\\n}\\nif (!/^data:[a-z]+\\\\/[a-z0-9.+-]+;base64,/.test(action.input.image)) {\\n throw new InvalidAgentImageError(\\n 'Agent image must be a data URL (data:image/...;base64,...)',\\n );\\n}\\nstate.features.mastra.agentImage = action.input.image;\",\n errors: [\n {\n id: 'e-set-agent-image-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before setting agent image.',\n template: '',\n },\n {\n id: 'e-invalid-agent-image',\n name: 'InvalidAgentImageError',\n code: 'INVALID_AGENT_IMAGE',\n description: 'Agent image must be a data URL',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-clear-agent-image',\n name: 'CLEAR_AGENT_IMAGE',\n description: '',\n schema: 'input ClearAgentImageInput {\\n _: Boolean\\n}',\n template: '',\n reducer: \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError(\\n 'Cannot clear agent image when Mastra is disabled.',\\n );\\n}\\nstate.features.mastra.agentImage = null;\",\n errors: [\n {\n id: 'e-mastra-not-enabled-clear-img',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-enable-chat',\n name: 'SET_ENABLE_CHAT',\n description: 'Enable or disable the chat integration. When enabled, auto-adds @powerhousedao/clint-common as a managed package with powerhouse/chat-session doc type. When disabled, removes it if it only has that doc type.',\n schema: 'input SetEnableChatInput {\\n enabled: Boolean!\\n}',\n template: 'Toggle the chat integration feature. Requires both Mastra and Powerhouse to be enabled.',\n reducer:\n \"if (!state.features.mastra.enabled) {\\n throw new MastraNotEnabledError('Cannot toggle chat when Mastra is disabled.');\\n}\\nif (state.features.powerhouse === 'Disabled') {\\n throw new PowerhouseNotEnabledError('Cannot toggle chat when Powerhouse is disabled.');\\n}\\nstate.features.mastra.common.enableChat = action.input.enabled;\\nconst CLINT_COMMON_PKG = '@powerhousedao/clint-common';\\nconst CHAT_DOC_TYPE = 'powerhouse/chat-session';\\nif (action.input.enabled) {\\n const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);\\n if (!existing) {\\n state.packages.push({\\n id: 'pkg-clint-common',\\n packageName: CLINT_COMMON_PKG,\\n documentTypes: [CHAT_DOC_TYPE],\\n version: null,\\n managed: true,\\n });\\n } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {\\n existing.documentTypes.push(CHAT_DOC_TYPE);\\n }\\n} else {\\n const idx = state.packages.findIndex(\\n (p) => p.packageName === CLINT_COMMON_PKG && p.managed,\\n );\\n if (idx !== -1) {\\n const pkg = state.packages[idx];\\n if (pkg.documentTypes.length === 1 && pkg.documentTypes[0] === CHAT_DOC_TYPE) {\\n state.packages.splice(idx, 1);\\n } else {\\n const dtIdx = pkg.documentTypes.indexOf(CHAT_DOC_TYPE);\\n if (dtIdx !== -1) pkg.documentTypes.splice(dtIdx, 1);\\n }\\n }\\n}\",\n errors: [\n {\n id: 'e-chat-mastra-not-enabled',\n name: 'MastraNotEnabledError',\n code: 'MASTRA_NOT_ENABLED',\n description: 'Mastra must be enabled before toggling chat.',\n template: '',\n },\n {\n id: 'e-chat-powerhouse-not-enabled',\n name: 'PowerhouseNotEnabledError',\n code: 'POWERHOUSE_NOT_ENABLED',\n description: 'Powerhouse must be enabled (Reactor or above) before toggling chat.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-features-routine',\n name: 'features_routine',\n description: 'Routine loop feature toggle.',\n operations: [\n {\n id: 'o-enable-routine',\n name: 'ENABLE_ROUTINE',\n description: 'Enable the routine loop. Idempotent.',\n schema: 'input EnableRoutineInput {\\n _: Boolean\\n}',\n template: 'Enable the routine loop. Idempotent.',\n reducer: 'state.features.routine.enabled = true;',\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-disable-routine',\n name: 'DISABLE_ROUTINE',\n description: 'Disable the routine loop. Always allowed.',\n schema: 'input DisableRoutineInput {\\n _: Boolean\\n}',\n template: 'Disable the routine loop.',\n reducer: 'state.features.routine.enabled = false;',\n errors: [],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-powerhouse-packages',\n name: 'powerhouse_packages',\n description: 'Manage reactor packages and their document types. The app package is auto-created when Powerhouse level goes above Disabled.',\n operations: [\n {\n id: 'o-add-powerhouse-package',\n name: 'ADD_POWERHOUSE_PACKAGE',\n description: 'Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.',\n schema: 'input AddPowerhousePackageInput {\\n id: OID!\\n packageName: String!\\n}',\n template: 'Add an external reactor package. The app package is auto-managed by SET_POWERHOUSE_LEVEL.',\n reducer:\n 'const exists = state.packages.find(\\n (p) =>\\n p.id === action.input.id ||\\n p.packageName === action.input.packageName,\\n);\\nif (exists) {\\n throw new DuplicatePackageError(\\n `Package already exists: ${action.input.packageName}`,\\n );\\n}\\nstate.packages.push({\\n id: action.input.id,\\n packageName: action.input.packageName,\\n documentTypes: [],\\n version: null,\\n managed: false,\\n});',\n errors: [\n {\n id: 'e-duplicate-package',\n name: 'DuplicatePackageError',\n code: 'DUPLICATE_PACKAGE',\n description: 'A package with the same ID or name already exists.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-powerhouse-package',\n name: 'REMOVE_POWERHOUSE_PACKAGE',\n description: 'Remove a reactor package. Cannot remove the auto-managed app package.',\n schema: 'input RemovePowerhousePackageInput {\\n id: OID!\\n}',\n template: 'Remove a reactor package. Cannot remove the auto-managed app package.',\n reducer:\n 'const idx = state.packages.findIndex((p) => p.id === action.input.id);\\nif (idx === -1) {\\n throw new PackageNotFoundError(`Package not found: ${action.input.id}`);\\n}\\nconst pkg = state.packages[idx];\\nif (pkg.managed) {\\n throw new CannotRemoveManagedPackageError(\\n \"Cannot remove a managed package\",\\n );\\n}\\nstate.packages.splice(idx, 1);',\n errors: [\n {\n id: 'e-package-not-found-remove',\n name: 'PackageNotFoundError',\n code: 'PACKAGE_NOT_FOUND',\n description: 'The specified package ID was not found.',\n template: '',\n },\n {\n id: 'e-cannot-remove-app-package',\n name: 'CannotRemoveAppPackageError',\n code: 'CANNOT_REMOVE_APP_PACKAGE',\n description: 'The auto-managed app package cannot be removed.',\n template: '',\n },\n {\n id: 'e-cannot-remove-managed',\n name: 'CannotRemoveManagedPackageError',\n code: 'CANNOT_REMOVE_MANAGED_PACKAGE',\n description: 'Cannot remove a managed (framework-controlled) package',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-add-package-document-type',\n name: 'ADD_PACKAGE_DOCUMENT_TYPE',\n description: 'Add a document type ID to a package (app or external).',\n schema: 'input AddPackageDocumentTypeInput {\\n packageId: OID!\\n documentType: String!\\n}',\n template: 'Add a document type ID to a package (app or external).',\n reducer:\n \"if (action.input.documentType !== '*/*' && !/^[a-z0-9-]+\\\\/[a-z0-9-]+$/.test(action.input.documentType)) {\\n throw new InvalidDocumentTypeError(\\n `Invalid document type format: ${action.input.documentType}. Expected org/name.`,\\n );\\n}\\nconst pkg = state.packages.find((p) => p.id === action.input.packageId);\\nif (!pkg) {\\n throw new PackageNotFoundError(\\n `Package not found: ${action.input.packageId}`,\\n );\\n}\\nif (action.input.documentType === '*/*') {\\n pkg.documentTypes.length = 0;\\n pkg.documentTypes.push('*/*');\\n return;\\n}\\nif (pkg.documentTypes.includes('*/*')) {\\n return;\\n}\\nif (pkg.documentTypes.includes(action.input.documentType)) {\\n throw new DuplicateDocumentTypeError(\\n `Document type already registered: ${action.input.documentType}`,\\n );\\n}\\npkg.documentTypes.push(action.input.documentType);\",\n errors: [\n {\n id: 'e-invalid-document-type',\n name: 'InvalidDocumentTypeError',\n code: 'INVALID_DOCUMENT_TYPE',\n description: 'Document type must match org/name format (e.g. powerhouse/ph-clint-project).',\n template: '',\n },\n {\n id: 'e-package-not-found-add-dt',\n name: 'PackageNotFoundError',\n code: 'PACKAGE_NOT_FOUND',\n description: 'The specified package ID was not found.',\n template: '',\n },\n {\n id: 'e-duplicate-document-type',\n name: 'DuplicateDocumentTypeError',\n code: 'DUPLICATE_DOCUMENT_TYPE',\n description: 'This document type is already registered in the package.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-package-document-type',\n name: 'REMOVE_PACKAGE_DOCUMENT_TYPE',\n description: 'Remove a document type ID from a package.',\n schema: 'input RemovePackageDocumentTypeInput {\\n packageId: OID!\\n documentType: String!\\n}',\n template: 'Remove a document type ID from a package.',\n reducer:\n 'const pkg = state.packages.find(p => p.id === action.input.packageId);\\nif (!pkg) {\\n throw new PackageNotFoundError(`Package not found: ${action.input.packageId}`);\\n}\\nconst idx = pkg.documentTypes.indexOf(action.input.documentType);\\nif (idx === -1) {\\n throw new DocumentTypeNotFoundError(`Document type not found: ${action.input.documentType}`);\\n}\\npkg.documentTypes.splice(idx, 1);',\n errors: [\n {\n id: 'e-package-not-found-rm-dt',\n name: 'PackageNotFoundError',\n code: 'PACKAGE_NOT_FOUND',\n description: 'The specified package ID was not found.',\n template: '',\n },\n {\n id: 'e-document-type-not-found',\n name: 'DocumentTypeNotFoundError',\n code: 'DOCUMENT_TYPE_NOT_FOUND',\n description: 'The specified document type was not found in this package.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-package-version',\n name: 'SET_PACKAGE_VERSION',\n description: '',\n schema: 'input SetPackageVersionInput {\\n packageId: OID!\\n version: String\\n}',\n template: '',\n reducer:\n 'const pkg = state.packages.find((p) => p.id === action.input.packageId);\\nif (!pkg) {\\n throw new PackageNotFoundError(\\n `Package not found: ${action.input.packageId}`,\\n );\\n}\\nif (action.input.version != null) {\\n const SEMVER = /^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[0-9A-Za-z.-]+)?(?:\\\\+[0-9A-Za-z.-]+)?$/;\\n if (!SEMVER.test(action.input.version)) {\\n throw new InvalidVersionError(\\n `Invalid version: ${action.input.version}`,\\n );\\n }\\n}\\npkg.version = action.input.version || null;',\n errors: [\n {\n id: 'e-pkg-not-found-set-ver',\n name: 'PackageNotFoundError',\n code: 'PACKAGE_NOT_FOUND',\n description: 'Referenced package does not exist',\n template: '',\n },\n {\n id: 'e-invalid-version',\n name: 'InvalidVersionError',\n code: 'INVALID_VERSION',\n description: 'Version string is not valid semver',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-external-skills',\n name: 'external_skills',\n description: 'External skills from the skills.sh ecosystem. Each skill has a name and GitHub URL for installation.',\n operations: [\n {\n id: 'o-add-external-skill',\n name: 'ADD_EXTERNAL_SKILL',\n description: 'Add an external skill. Name must be lowercase kebab-case.',\n schema: 'input AddExternalSkillInput {\\n id: OID!\\n name: String!\\n githubUrl: URL!\\n}',\n template: 'Add an external skill. Name must be lowercase kebab-case.',\n reducer:\n 'if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\\n}\\nconst exists = state.externalSkills.find(s => s.id === action.input.id || s.name === action.input.name);\\nif (exists) {\\n throw new DuplicateSkillError(`Skill already exists: ${action.input.name}`);\\n}\\nstate.externalSkills.push({\\n id: action.input.id,\\n name: action.input.name,\\n githubUrl: action.input.githubUrl,\\n});',\n errors: [\n {\n id: 'e-invalid-skill-name',\n name: 'InvalidSkillNameError',\n code: 'INVALID_SKILL_NAME',\n description: 'Skill name must be lowercase kebab-case (e.g. playwright-cli).',\n template: '',\n },\n {\n id: 'e-duplicate-skill',\n name: 'DuplicateSkillError',\n code: 'DUPLICATE_SKILL',\n description: 'A skill with the same ID or name already exists.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-external-skill',\n name: 'REMOVE_EXTERNAL_SKILL',\n description: 'Remove an external skill by ID.',\n schema: 'input RemoveExternalSkillInput {\\n id: OID!\\n}',\n template: 'Remove an external skill by ID.',\n reducer: 'const idx = state.externalSkills.findIndex(s => s.id === action.input.id);\\nif (idx === -1) {\\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\\n}\\nstate.externalSkills.splice(idx, 1);',\n errors: [\n {\n id: 'e-skill-not-found-remove',\n name: 'SkillNotFoundError',\n code: 'SKILL_NOT_FOUND',\n description: 'The specified skill ID was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-external-skill-name',\n name: 'SET_EXTERNAL_SKILL_NAME',\n description: 'Update the name of an external skill.',\n schema: 'input SetExternalSkillNameInput {\\n id: OID!\\n name: String!\\n}',\n template: 'Update the name of an external skill.',\n reducer:\n 'const skill = state.externalSkills.find(s => s.id === action.input.id);\\nif (!skill) {\\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\\n}\\nif (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\\n}\\nconst duplicate = state.externalSkills.find(s => s.name === action.input.name && s.id !== action.input.id);\\nif (duplicate) {\\n throw new DuplicateSkillError(`Skill name already in use: ${action.input.name}`);\\n}\\nskill.name = action.input.name;',\n errors: [\n {\n id: 'e-skill-not-found-set-name',\n name: 'SkillNotFoundError',\n code: 'SKILL_NOT_FOUND',\n description: 'The specified skill ID was not found.',\n template: '',\n },\n {\n id: 'e-invalid-skill-name-set',\n name: 'InvalidSkillNameError',\n code: 'INVALID_SKILL_NAME',\n description: 'Skill name must be lowercase kebab-case.',\n template: '',\n },\n {\n id: 'e-duplicate-skill-set-name',\n name: 'DuplicateSkillError',\n code: 'DUPLICATE_SKILL',\n description: 'Another skill already uses this name.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-external-skill-github-url',\n name: 'SET_EXTERNAL_SKILL_GITHUB_URL',\n description: 'Update the GitHub URL of an external skill.',\n schema: 'input SetExternalSkillGithubUrlInput {\\n id: OID!\\n githubUrl: URL!\\n}',\n template: 'Update the GitHub URL of an external skill.',\n reducer: 'const skill = state.externalSkills.find(s => s.id === action.input.id);\\nif (!skill) {\\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\\n}\\nskill.githubUrl = action.input.githubUrl;',\n errors: [\n {\n id: 'e-skill-not-found-set-url',\n name: 'SkillNotFoundError',\n code: 'SKILL_NOT_FOUND',\n description: 'The specified skill ID was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-publishing',\n name: 'publishing',\n description: 'Version bumping and publish records. Tracks dev/staging/production publish intents and their status.',\n operations: [\n {\n id: 'o-bump-version',\n name: 'BUMP_VERSION',\n description: 'Bump the project version. Must be a valid semver string greater than the current version.',\n schema: 'input BumpVersionInput {\\n version: String!\\n}',\n template: 'Bump the project version. Must be a valid semver string greater than the current version.',\n reducer: 'if (!/^\\\\d+\\\\.\\\\d+\\\\.\\\\d+(?:-[0-9A-Za-z.-]+)?(?:\\\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {\\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\\n}\\nstate.version = action.input.version;',\n errors: [\n {\n id: 'e-invalid-version-bump',\n name: 'InvalidVersionError',\n code: 'INVALID_VERSION',\n description: 'The version must be a valid semver string.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-publish-dev',\n name: 'PUBLISH_DEV',\n description: 'Record a dev publish intent. Creates a Pending publish record.',\n schema: 'input PublishDevInput {\\n id: OID!\\n timestamp: DateTime!\\n}',\n template: 'Record a dev publish intent. Creates a Pending publish record.',\n reducer: \"state.publishHistory.push({\\n id: action.input.id,\\n tag: 'Dev',\\n version: state.version,\\n timestamp: action.input.timestamp,\\n status: 'Pending',\\n});\",\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-publish-staging',\n name: 'PUBLISH_STAGING',\n description: 'Record a staging publish intent. Creates a Pending publish record.',\n schema: 'input PublishStagingInput {\\n id: OID!\\n timestamp: DateTime!\\n}',\n template: 'Record a staging publish intent. Creates a Pending publish record.',\n reducer: \"state.publishHistory.push({\\n id: action.input.id,\\n tag: 'Staging',\\n version: state.version,\\n timestamp: action.input.timestamp,\\n status: 'Pending',\\n});\",\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-publish-production',\n name: 'PUBLISH_PRODUCTION',\n description: 'Record a production publish intent. Creates a Pending publish record.',\n schema: 'input PublishProductionInput {\\n id: OID!\\n timestamp: DateTime!\\n}',\n template: 'Record a production publish intent. Creates a Pending publish record.',\n reducer: \"state.publishHistory.push({\\n id: action.input.id,\\n tag: 'Production',\\n version: state.version,\\n timestamp: action.input.timestamp,\\n status: 'Pending',\\n});\",\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-publish-status',\n name: 'SET_PUBLISH_STATUS',\n description: 'Update the status of a publish record. Used by the trigger after publish completes.',\n schema: 'input SetPublishStatusInput {\\n id: OID!\\n status: PublishStatus!\\n}',\n template: 'Update the status of a publish record. Used by the trigger after publish completes.',\n reducer: 'const record = state.publishHistory.find(r => r.id === action.input.id);\\nif (!record) {\\n throw new PublishRecordNotFoundError(`Publish record not found: ${action.input.id}`);\\n}\\nrecord.status = action.input.status;',\n errors: [\n {\n id: 'e-publish-record-not-found',\n name: 'PublishRecordNotFoundError',\n code: 'PUBLISH_RECORD_NOT_FOUND',\n description: 'The specified publish record ID was not found.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-lifecycle',\n name: 'lifecycle',\n description: 'Document lifecycle operations. IMPORT_SPEC bulk-imports a full project spec into the document.',\n operations: [\n {\n id: 'o-import-spec',\n name: 'IMPORT_SPEC',\n description: 'Bulk-import a full project spec into the document. Sets all identity fields, features, packages, and skills. Used by the multi-project boot sync.',\n schema:\n 'input ImportSpecInput {\\n name: String!\\n scope: String\\n version: String!\\n description: String!\\n powerhouse: PowerhouseLevel!\\n mastraEnabled: Boolean!\\n routineEnabled: Boolean!\\n packages: [ImportPackageInput!]!\\n externalSkills: [ImportSkillInput!]!\\n agentId: String\\n agentName: String\\n models: [ImportModelInput!]\\n profiles: [ImportProfileInput!]\\n agentDescription: String\\n agentImage: String\\n enableChat: Boolean\\n proxyEnabled: Boolean\\n observabilityEnabled: Boolean\\n supportedResources: [String!]\\n}\\n\\ninput ImportPackageInput {\\n id: OID!\\n packageName: String!\\n documentTypes: [String!]!\\n version: String\\n}\\n\\ninput ImportSkillInput {\\n id: OID!\\n name: String!\\n githubUrl: URL!\\n}\\n\\ninput ImportModelInput {\\n id: String!\\n isDefault: Boolean!\\n}\\n\\ninput ImportProfileInput {\\n id: String!\\n title: String!\\n content: String!\\n}',\n template: 'Bulk-import a full project spec into the document. Sets all identity fields, features, packages, and skills. Used by the multi-project boot sync.',\n reducer:\n \"state.name = action.input.name;\\nstate.scope = action.input.scope || null;\\nstate.version = action.input.version;\\nstate.description = action.input.description;\\nstate.features.powerhouse = action.input.powerhouse;\\nstate.features.mastra.enabled = action.input.mastraEnabled;\\nstate.features.routine.enabled = action.input.routineEnabled;\\n\\n// Derive the expected managed app package name\\nconst appBase = action.input.name.replace(/-cli$/, '-app');\\nconst appPkgName = action.input.scope\\n ? `${action.input.scope}/${appBase}`\\n : appBase;\\nconst phEnabled = action.input.powerhouse !== 'Disabled';\\n\\nstate.packages = action.input.packages.map((p) => ({\\n id: p.id,\\n packageName: p.packageName,\\n documentTypes: [...p.documentTypes],\\n version: p.version || null,\\n managed: phEnabled && p.packageName === appPkgName,\\n}));\\nstate.externalSkills = action.input.externalSkills.map((s) => ({\\n id: s.id,\\n name: s.name,\\n githubUrl: s.githubUrl,\\n}));\\nstate.features.mastra.agentId = action.input.agentId || null;\\nstate.features.mastra.agentName = action.input.agentName || null;\\nstate.features.mastra.models = (action.input.models || []).map((m) => ({\\n id: m.id,\\n isDefault: m.isDefault,\\n}));\\nstate.features.mastra.profiles = (action.input.profiles || []).map((p) => ({\\n id: p.id,\\n title: p.title,\\n content: p.content,\\n}));\\n\\n// agentDescription \\u2014 respects mastra-enabled guard\\nif (action.input.agentDescription && state.features.mastra.enabled) {\\n state.features.mastra.agentDescription = action.input.agentDescription;\\n} else {\\n state.features.mastra.agentDescription = null;\\n}\\n\\n// agentImage \\u2014 validates data URL format (same logic as setAgentImageOperation)\\nif (action.input.agentImage && state.features.mastra.enabled) {\\n if (!/^data:[a-z]+\\\\/[a-z0-9.+-]+;base64,/.test(action.input.agentImage)) {\\n throw new InvalidAgentImageError(\\n 'Invalid image: must be a data URL (data:<mime>;base64,...)',\\n );\\n }\\n state.features.mastra.agentImage = action.input.agentImage;\\n} else {\\n state.features.mastra.agentImage = null;\\n}\\n\\n// enableChat \\u2014 respects mastra+powerhouse guards, manages clint-common package\\nif (\\n action.input.enableChat &&\\n state.features.mastra.enabled &&\\n state.features.powerhouse !== 'Disabled'\\n) {\\n state.features.mastra.common.enableChat = true;\\n const CLINT_COMMON_PKG = '@powerhousedao/clint-common';\\n const CHAT_DOC_TYPE = 'powerhouse/chat-session';\\n const existing = state.packages.find(\\n (p) => p.packageName === CLINT_COMMON_PKG,\\n );\\n if (!existing) {\\n state.packages.push({\\n id: 'pkg-clint-common',\\n packageName: CLINT_COMMON_PKG,\\n documentTypes: [CHAT_DOC_TYPE],\\n version: null,\\n managed: true,\\n });\\n } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {\\n existing.documentTypes.push(CHAT_DOC_TYPE);\\n }\\n} else {\\n state.features.mastra.common.enableChat = false;\\n}\\n\\n// Deployment fields\\nstate.deployment.proxyEnabled = action.input.proxyEnabled ?? false;\\nstate.deployment.observabilityEnabled = action.input.observabilityEnabled ?? false;\\nstate.deployment.supportedResources = action.input.supportedResources\\n ? [...action.input.supportedResources]\\n : [];\",\n errors: [],\n examples: [],\n scope: 'global',\n },\n ],\n },\n {\n id: 'm-deployment',\n name: 'deployment',\n description: 'Deployment settings: service announcement toggle and supported resource tiers.',\n operations: [\n {\n id: 'o-add-supported-resource',\n name: 'ADD_SUPPORTED_RESOURCE',\n description: 'Add a supported resource tier. Guards against duplicates.',\n schema: 'input AddSupportedResourceInput {\\n resource: String!\\n}',\n template: 'Add a supported resource tier. Guards against duplicates.',\n reducer:\n 'if (state.deployment.supportedResources.includes(action.input.resource)) {\\n throw new DuplicateResourceError(`Resource already exists: ${action.input.resource}`);\\n}\\nstate.deployment.supportedResources.push(action.input.resource);',\n errors: [\n {\n id: 'e-duplicate-resource',\n name: 'DuplicateResourceError',\n code: 'DUPLICATE_RESOURCE',\n description: 'This resource is already in the supported resources list.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-remove-supported-resource',\n name: 'REMOVE_SUPPORTED_RESOURCE',\n description: 'Remove a supported resource tier.',\n schema: 'input RemoveSupportedResourceInput {\\n resource: String!\\n}',\n template: 'Remove a supported resource tier.',\n reducer:\n 'const idx = state.deployment.supportedResources.indexOf(action.input.resource);\\nif (idx === -1) {\\n throw new ResourceNotFoundError(`Resource not found: ${action.input.resource}`);\\n}\\nstate.deployment.supportedResources.splice(idx, 1);',\n errors: [\n {\n id: 'e-resource-not-found',\n name: 'ResourceNotFoundError',\n code: 'RESOURCE_NOT_FOUND',\n description: 'The specified resource was not found in the supported resources list.',\n template: '',\n },\n ],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-proxy-enabled',\n name: 'SET_PROXY_ENABLED',\n description: 'Toggle the embedded reverse proxy.',\n schema: 'input SetProxyEnabledInput {\\n enabled: Boolean!\\n}',\n template: 'Toggle the embedded reverse proxy.',\n reducer: 'state.deployment.proxyEnabled = action.input.enabled;',\n errors: [],\n examples: [],\n scope: 'global',\n },\n {\n id: 'o-set-observability-enabled',\n name: 'SET_OBSERVABILITY_ENABLED',\n description: 'Toggle the observability plugin (Sentry + OpenTelemetry).',\n schema: 'input SetObservabilityEnabledInput {\\n enabled: Boolean!\\n}',\n template: 'Toggle the observability plugin (Sentry + OpenTelemetry).',\n reducer: 'state.deployment.observabilityEnabled = action.input.enabled;',\n errors: [],\n examples: [],\n scope: 'global',\n },\n ],\n },\n ],\n version: 1,\n changeLog: [],\n },\n ],\n};\n","export type ErrorCode = 'DuplicateResourceError' | 'ResourceNotFoundError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class DuplicateResourceError extends Error implements ReducerError {\n errorCode = 'DuplicateResourceError' as ErrorCode;\n constructor(message = 'DuplicateResourceError') {\n super(message);\n }\n}\n\nexport class ResourceNotFoundError extends Error implements ReducerError {\n errorCode = 'ResourceNotFoundError' as ErrorCode;\n constructor(message = 'ResourceNotFoundError') {\n super(message);\n }\n}\n\nexport const errors = {\n AddSupportedResource: { DuplicateResourceError },\n RemoveSupportedResource: { ResourceNotFoundError },\n};\n","import type { PhClintProjectDeploymentOperations } from 'document-models/ph-clint-project/v1';\nimport { DuplicateResourceError, ResourceNotFoundError } from '../../gen/deployment/error.js';\n\nexport const phClintProjectDeploymentOperations: PhClintProjectDeploymentOperations = {\n addSupportedResourceOperation(state, action) {\n if (state.deployment.supportedResources.includes(action.input.resource)) {\n throw new DuplicateResourceError(`Resource already exists: ${action.input.resource}`);\n }\n state.deployment.supportedResources.push(action.input.resource);\n },\n removeSupportedResourceOperation(state, action) {\n const idx = state.deployment.supportedResources.indexOf(action.input.resource);\n if (idx === -1) {\n throw new ResourceNotFoundError(`Resource not found: ${action.input.resource}`);\n }\n state.deployment.supportedResources.splice(idx, 1);\n },\n setProxyEnabledOperation(state, action) {\n state.deployment.proxyEnabled = action.input.enabled;\n },\n setObservabilityEnabledOperation(state, action) {\n state.deployment.observabilityEnabled = action.input.enabled;\n },\n};\n","export type ErrorCode = 'InvalidSkillNameError' | 'DuplicateSkillError' | 'SkillNotFoundError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class InvalidSkillNameError extends Error implements ReducerError {\n errorCode = 'InvalidSkillNameError' as ErrorCode;\n constructor(message = 'InvalidSkillNameError') {\n super(message);\n }\n}\n\nexport class DuplicateSkillError extends Error implements ReducerError {\n errorCode = 'DuplicateSkillError' as ErrorCode;\n constructor(message = 'DuplicateSkillError') {\n super(message);\n }\n}\n\nexport class SkillNotFoundError extends Error implements ReducerError {\n errorCode = 'SkillNotFoundError' as ErrorCode;\n constructor(message = 'SkillNotFoundError') {\n super(message);\n }\n}\n\nexport const errors = {\n AddExternalSkill: { InvalidSkillNameError, DuplicateSkillError },\n RemoveExternalSkill: { SkillNotFoundError },\n SetExternalSkillName: {\n SkillNotFoundError,\n InvalidSkillNameError,\n DuplicateSkillError,\n },\n SetExternalSkillGithubUrl: { SkillNotFoundError },\n};\n","import type { PhClintProjectExternalSkillsOperations } from 'document-models/ph-clint-project/v1';\nimport { DuplicateSkillError, InvalidSkillNameError, SkillNotFoundError } from '../../gen/external-skills/error.js';\n\nexport const phClintProjectExternalSkillsOperations: PhClintProjectExternalSkillsOperations = {\n addExternalSkillOperation(state, action) {\n if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\n }\n const exists = state.externalSkills.find((s) => s.id === action.input.id || s.name === action.input.name);\n if (exists) {\n throw new DuplicateSkillError(`Skill already exists: ${action.input.name}`);\n }\n state.externalSkills.push({\n id: action.input.id,\n name: action.input.name,\n githubUrl: action.input.githubUrl,\n });\n },\n removeExternalSkillOperation(state, action) {\n const idx = state.externalSkills.findIndex((s) => s.id === action.input.id);\n if (idx === -1) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n }\n state.externalSkills.splice(idx, 1);\n },\n setExternalSkillNameOperation(state, action) {\n const skill = state.externalSkills.find((s) => s.id === action.input.id);\n if (!skill) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n }\n if (!/^[a-z][a-z0-9-]*$/.test(action.input.name)) {\n throw new InvalidSkillNameError(`Invalid skill name: ${action.input.name}. Must be lowercase kebab-case.`);\n }\n const duplicate = state.externalSkills.find((s) => s.name === action.input.name && s.id !== action.input.id);\n if (duplicate) {\n throw new DuplicateSkillError(`Skill name already in use: ${action.input.name}`);\n }\n skill.name = action.input.name;\n },\n setExternalSkillGithubUrlOperation(state, action) {\n const skill = state.externalSkills.find((s) => s.id === action.input.id);\n if (!skill) {\n throw new SkillNotFoundError(`Skill not found: ${action.input.id}`);\n }\n skill.githubUrl = action.input.githubUrl;\n },\n};\n","export type ErrorCode =\n | 'InvalidAgentIdError'\n | 'InvalidAgentNameError'\n | 'MastraNotEnabledError'\n | 'InvalidModelIdError'\n | 'DuplicateModelError'\n | 'ModelNotFoundError'\n | 'InvalidProfileIdError'\n | 'DuplicateProfileError'\n | 'ProfileNotFoundError'\n | 'InvalidAgentImageError'\n | 'PowerhouseNotEnabledError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class InvalidAgentIdError extends Error implements ReducerError {\n errorCode = 'InvalidAgentIdError' as ErrorCode;\n constructor(message = 'InvalidAgentIdError') {\n super(message);\n }\n}\n\nexport class InvalidAgentNameError extends Error implements ReducerError {\n errorCode = 'InvalidAgentNameError' as ErrorCode;\n constructor(message = 'InvalidAgentNameError') {\n super(message);\n }\n}\n\nexport class MastraNotEnabledError extends Error implements ReducerError {\n errorCode = 'MastraNotEnabledError' as ErrorCode;\n constructor(message = 'MastraNotEnabledError') {\n super(message);\n }\n}\n\nexport class InvalidModelIdError extends Error implements ReducerError {\n errorCode = 'InvalidModelIdError' as ErrorCode;\n constructor(message = 'InvalidModelIdError') {\n super(message);\n }\n}\n\nexport class DuplicateModelError extends Error implements ReducerError {\n errorCode = 'DuplicateModelError' as ErrorCode;\n constructor(message = 'DuplicateModelError') {\n super(message);\n }\n}\n\nexport class ModelNotFoundError extends Error implements ReducerError {\n errorCode = 'ModelNotFoundError' as ErrorCode;\n constructor(message = 'ModelNotFoundError') {\n super(message);\n }\n}\n\nexport class InvalidProfileIdError extends Error implements ReducerError {\n errorCode = 'InvalidProfileIdError' as ErrorCode;\n constructor(message = 'InvalidProfileIdError') {\n super(message);\n }\n}\n\nexport class DuplicateProfileError extends Error implements ReducerError {\n errorCode = 'DuplicateProfileError' as ErrorCode;\n constructor(message = 'DuplicateProfileError') {\n super(message);\n }\n}\n\nexport class ProfileNotFoundError extends Error implements ReducerError {\n errorCode = 'ProfileNotFoundError' as ErrorCode;\n constructor(message = 'ProfileNotFoundError') {\n super(message);\n }\n}\n\nexport class InvalidAgentImageError extends Error implements ReducerError {\n errorCode = 'InvalidAgentImageError' as ErrorCode;\n constructor(message = 'InvalidAgentImageError') {\n super(message);\n }\n}\n\nexport class PowerhouseNotEnabledError extends Error implements ReducerError {\n errorCode = 'PowerhouseNotEnabledError' as ErrorCode;\n constructor(message = 'PowerhouseNotEnabledError') {\n super(message);\n }\n}\n\nexport const errors = {\n EnableMastra: { InvalidAgentIdError, InvalidAgentNameError },\n SetAgentId: { MastraNotEnabledError, InvalidAgentIdError },\n SetAgentName: { MastraNotEnabledError, InvalidAgentNameError },\n AddModel: { MastraNotEnabledError, InvalidModelIdError, DuplicateModelError },\n RemoveModel: { MastraNotEnabledError, ModelNotFoundError },\n SetDefaultModel: { MastraNotEnabledError, ModelNotFoundError },\n AddProfile: {\n MastraNotEnabledError,\n InvalidProfileIdError,\n DuplicateProfileError,\n ProfileNotFoundError,\n },\n UpdateProfile: { MastraNotEnabledError, ProfileNotFoundError },\n RemoveProfile: { MastraNotEnabledError, ProfileNotFoundError },\n ReorderProfiles: { MastraNotEnabledError, ProfileNotFoundError },\n SetAgentDescription: { MastraNotEnabledError },\n SetAgentImage: { MastraNotEnabledError, InvalidAgentImageError },\n ClearAgentImage: { MastraNotEnabledError },\n SetEnableChat: { MastraNotEnabledError, PowerhouseNotEnabledError },\n};\n","import type { PhClintProjectFeaturesMastraOperations } from 'document-models/ph-clint-project/v1';\nimport {\n DuplicateModelError,\n DuplicateProfileError,\n InvalidAgentIdError,\n InvalidAgentImageError,\n InvalidAgentNameError,\n InvalidModelIdError,\n InvalidProfileIdError,\n MastraNotEnabledError,\n ModelNotFoundError,\n PowerhouseNotEnabledError,\n ProfileNotFoundError,\n} from '../../gen/features-mastra/error.js';\n\nexport const phClintProjectFeaturesMastraOperations: PhClintProjectFeaturesMastraOperations = {\n enableMastraOperation(state, action) {\n if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {\n throw new InvalidAgentIdError(`Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`);\n }\n const trimmedName = action.input.agentName.trim();\n if (!trimmedName) {\n throw new InvalidAgentNameError('Agent name must not be empty.');\n }\n state.features.mastra.enabled = true;\n state.features.mastra.agentId = action.input.agentId;\n state.features.mastra.agentName = trimmedName;\n if (state.features.mastra.models.length === 0) {\n state.features.mastra.models.push({\n id: 'clint/demo-agent',\n isDefault: true,\n });\n }\n if (state.features.mastra.profiles.length === 0) {\n state.features.mastra.profiles.push({\n id: 'base',\n title: 'Base Profile',\n content: 'You are a helpful assistant',\n });\n }\n },\n disableMastraOperation(state) {\n state.features.mastra.enabled = false;\n state.features.mastra.agentId = null;\n state.features.mastra.agentName = null;\n state.features.mastra.agentDescription = null;\n state.features.mastra.agentImage = null;\n state.features.mastra.models = [];\n state.features.mastra.profiles = [];\n state.features.mastra.common.enableChat = false;\n // Remove auto-added clint-common package if managed\n const ccIdx = state.packages.findIndex((p) => p.packageName === '@powerhousedao/clint-common' && p.managed);\n if (ccIdx !== -1) {\n state.packages.splice(ccIdx, 1);\n }\n },\n setAgentIdOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set agent ID when Mastra is disabled.');\n }\n if (!/^[a-z][a-z0-9-]*$/.test(action.input.agentId)) {\n throw new InvalidAgentIdError(`Invalid agent ID: ${action.input.agentId}. Must be lowercase kebab-case.`);\n }\n state.features.mastra.agentId = action.input.agentId;\n },\n setAgentNameOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set agent name when Mastra is disabled.');\n }\n const trimmedName = action.input.agentName.trim();\n if (!trimmedName) {\n throw new InvalidAgentNameError('Agent name must not be empty.');\n }\n state.features.mastra.agentName = trimmedName;\n },\n addModelOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add model when Mastra is disabled.');\n }\n if (!/^[a-z0-9-]+\\/[a-z0-9._-]+$/.test(action.input.id)) {\n throw new InvalidModelIdError(`Invalid model ID: ${action.input.id}. Must be provider/model-name format.`);\n }\n if (state.features.mastra.models.find((m) => m.id === action.input.id)) {\n throw new DuplicateModelError(`Model already exists: ${action.input.id}`);\n }\n const isFirst = state.features.mastra.models.length === 0;\n const makeDefault = isFirst || action.input.isDefault === true;\n if (makeDefault) {\n for (const m of state.features.mastra.models) {\n m.isDefault = false;\n }\n }\n state.features.mastra.models.push({\n id: action.input.id,\n isDefault: makeDefault,\n });\n },\n removeModelOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove model when Mastra is disabled.');\n }\n const idx = state.features.mastra.models.findIndex((m) => m.id === action.input.id);\n if (idx === -1) {\n throw new ModelNotFoundError(`Model not found: ${action.input.id}`);\n }\n const wasDefault = state.features.mastra.models[idx].isDefault;\n state.features.mastra.models.splice(idx, 1);\n if (wasDefault && state.features.mastra.models.length > 0) {\n state.features.mastra.models[0].isDefault = true;\n }\n },\n setDefaultModelOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set default model when Mastra is disabled.');\n }\n const model = state.features.mastra.models.find((m) => m.id === action.input.id);\n if (!model) {\n throw new ModelNotFoundError(`Model not found: ${action.input.id}`);\n }\n for (const m of state.features.mastra.models) {\n m.isDefault = false;\n }\n model.isDefault = true;\n },\n addProfileOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot add profile when Mastra is disabled.');\n }\n if (!/^[a-z][a-z0-9-]*$/.test(action.input.id)) {\n throw new InvalidProfileIdError(`Invalid profile ID: ${action.input.id}. Must be lowercase kebab-case.`);\n }\n if (state.features.mastra.profiles.find((p) => p.id === action.input.id)) {\n throw new DuplicateProfileError(`Profile already exists: ${action.input.id}`);\n }\n const profile = {\n id: action.input.id,\n title: action.input.title,\n content: action.input.content,\n };\n if (action.input.insertBefore) {\n const beforeIdx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\n }\n state.features.mastra.profiles.splice(beforeIdx, 0, profile);\n } else {\n state.features.mastra.profiles.push(profile);\n }\n },\n updateProfileOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot update profile when Mastra is disabled.');\n }\n const profile = state.features.mastra.profiles.find((p) => p.id === action.input.id);\n if (!profile) {\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\n }\n if (action.input.title) profile.title = action.input.title;\n if (action.input.content) profile.content = action.input.content;\n },\n removeProfileOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot remove profile when Mastra is disabled.');\n }\n const idx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.id);\n if (idx === -1) {\n throw new ProfileNotFoundError(`Profile not found: ${action.input.id}`);\n }\n state.features.mastra.profiles.splice(idx, 1);\n },\n reorderProfilesOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot reorder profiles when Mastra is disabled.');\n }\n const moving = [];\n for (const id of action.input.ids) {\n const profile = state.features.mastra.profiles.find((p) => p.id === id);\n if (!profile) {\n throw new ProfileNotFoundError(`Profile not found: ${id}`);\n }\n moving.push(profile);\n }\n // Remove moved profiles\n state.features.mastra.profiles = state.features.mastra.profiles.filter((p) => !action.input.ids.includes(p.id));\n // Insert at target position\n if (action.input.insertBefore) {\n const beforeIdx = state.features.mastra.profiles.findIndex((p) => p.id === action.input.insertBefore);\n if (beforeIdx === -1) {\n throw new ProfileNotFoundError(`insertBefore profile not found: ${action.input.insertBefore}`);\n }\n state.features.mastra.profiles.splice(beforeIdx, 0, ...moving);\n } else {\n state.features.mastra.profiles.push(...moving);\n }\n },\n setAgentDescriptionOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set agent description when Mastra is disabled.');\n }\n state.features.mastra.agentDescription = action.input.description;\n },\n setAgentImageOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot set agent image when Mastra is disabled.');\n }\n if (!/^data:[a-z]+\\/[a-z0-9.+-]+;base64,/.test(action.input.image)) {\n throw new InvalidAgentImageError('Invalid image: must be a data URL (data:<mime>;base64,...)');\n }\n state.features.mastra.agentImage = action.input.image;\n },\n clearAgentImageOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot clear agent image when Mastra is disabled.');\n }\n state.features.mastra.agentImage = null;\n },\n setEnableChatOperation(state, action) {\n if (!state.features.mastra.enabled) {\n throw new MastraNotEnabledError('Cannot toggle chat when Mastra is disabled.');\n }\n if (state.features.powerhouse === 'Disabled') {\n throw new PowerhouseNotEnabledError('Cannot toggle chat when Powerhouse is disabled.');\n }\n state.features.mastra.common.enableChat = action.input.enabled;\n const CLINT_COMMON_PKG = '@powerhousedao/clint-common';\n const CHAT_DOC_TYPE = 'powerhouse/chat-session';\n if (action.input.enabled) {\n const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);\n if (!existing) {\n state.packages.push({\n id: 'pkg-clint-common',\n packageName: CLINT_COMMON_PKG,\n documentTypes: [CHAT_DOC_TYPE],\n version: null,\n managed: true,\n });\n } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {\n existing.documentTypes.push(CHAT_DOC_TYPE);\n }\n } else {\n const idx = state.packages.findIndex((p) => p.packageName === CLINT_COMMON_PKG && p.managed);\n if (idx !== -1) {\n const pkg = state.packages[idx];\n if (pkg.documentTypes.length === 1 && pkg.documentTypes[0] === CHAT_DOC_TYPE) {\n state.packages.splice(idx, 1);\n } else {\n const dtIdx = pkg.documentTypes.indexOf(CHAT_DOC_TYPE);\n if (dtIdx !== -1) pkg.documentTypes.splice(dtIdx, 1);\n }\n }\n }\n },\n};\n","export type ErrorCode = 'CannotLowerPowerhouseError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class CannotLowerPowerhouseError extends Error implements ReducerError {\n errorCode = 'CannotLowerPowerhouseError' as ErrorCode;\n constructor(message = 'CannotLowerPowerhouseError') {\n super(message);\n }\n}\n\nexport const errors = {\n SetPowerhouseLevel: { CannotLowerPowerhouseError },\n};\n","import type { PhClintProjectFeaturesPowerhouseOperations } from 'document-models/ph-clint-project/v1';\nimport { CannotLowerPowerhouseError } from '../../gen/features-powerhouse/error.js';\n\nconst LEVELS = ['Disabled', 'Reactor', 'Switchboard', 'Connect'] as const;\n\nexport const phClintProjectFeaturesPowerhouseOperations: PhClintProjectFeaturesPowerhouseOperations = {\n setPowerhouseLevelOperation(state, action) {\n const current = LEVELS.indexOf(state.features.powerhouse);\n const next = LEVELS.indexOf(action.input.level);\n if (current >= 1 && next < 1) {\n throw new CannotLowerPowerhouseError('Cannot lower Powerhouse level below Reactor once enabled');\n }\n state.features.powerhouse = action.input.level;\n // Auto-create managed app package when transitioning from Disabled to enabled\n if (current === 0 && next >= 1) {\n const hasManaged = state.packages.some((p) => p.managed);\n if (!hasManaged) {\n const baseName = state.name ? state.name.replace(/-cli$/, '-app') : 'app';\n const appName = state.scope && state.name ? `${state.scope}/${baseName}` : baseName;\n state.packages.push({\n id: `app-${state.name || 'managed'}`,\n packageName: appName,\n documentTypes: ['*/*'],\n version: null,\n managed: true,\n });\n }\n }\n // Auto-enable proxy when reaching Switchboard or above\n if (next >= 2 && !action.input.skipAutoProxy) {\n state.deployment.proxyEnabled = true;\n }\n },\n};\n","import type { PhClintProjectFeaturesRoutineOperations } from 'document-models/ph-clint-project/v1';\n\nexport const phClintProjectFeaturesRoutineOperations: PhClintProjectFeaturesRoutineOperations = {\n enableRoutineOperation(state) {\n state.features.routine.enabled = true;\n },\n disableRoutineOperation(state) {\n state.features.routine.enabled = false;\n },\n};\n","export type ErrorCode = 'InvalidVersionError' | 'InvalidPackageIdentifierError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class InvalidVersionError extends Error implements ReducerError {\n errorCode = 'InvalidVersionError' as ErrorCode;\n constructor(message = 'InvalidVersionError') {\n super(message);\n }\n}\n\nexport class InvalidPackageIdentifierError extends Error implements ReducerError {\n errorCode = 'InvalidPackageIdentifierError' as ErrorCode;\n constructor(message = 'InvalidPackageIdentifierError') {\n super(message);\n }\n}\n\nexport const errors = {\n SetVersion: { InvalidVersionError },\n SetPackageIdentifier: { InvalidPackageIdentifierError },\n};\n","import type { PhClintProjectIdentityOperations } from 'document-models/ph-clint-project/v1';\nimport { InvalidPackageIdentifierError, InvalidVersionError } from '../../gen/identity/error.js';\n\nconst SEMVER_PATTERN = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/;\nconst NAME_PATTERN = /^[a-z][a-z0-9-]*$/;\n\nexport const phClintProjectIdentityOperations: PhClintProjectIdentityOperations = {\n setVersionOperation(state, action) {\n if (!SEMVER_PATTERN.test(action.input.version)) {\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\n }\n state.version = action.input.version;\n },\n setDescriptionOperation(state, action) {\n state.description = action.input.description;\n },\n setPackageIdentifierOperation(state, action) {\n const trimmed = action.input.identifier.trim();\n if (!trimmed) {\n throw new InvalidPackageIdentifierError('Package identifier must not be empty');\n }\n let scopePart: string | null = null;\n let namePart = trimmed;\n if (trimmed.includes('/')) {\n const parts = trimmed.split('/');\n if (parts.length !== 2 || !parts[0] || !parts[1]) {\n throw new InvalidPackageIdentifierError(`Invalid package identifier: ${trimmed}`);\n }\n scopePart = parts[0].replace(/^@/, '');\n namePart = parts[1];\n }\n if (scopePart !== null) {\n if (!NAME_PATTERN.test(scopePart)) {\n throw new InvalidPackageIdentifierError(`Invalid scope: ${scopePart}`);\n }\n }\n if (!namePart.endsWith('-cli')) {\n namePart = namePart + '-cli';\n }\n if (!NAME_PATTERN.test(namePart)) {\n throw new InvalidPackageIdentifierError(`Invalid package name: ${namePart}`);\n }\n state.scope = scopePart ? `@${scopePart}` : null;\n state.name = namePart;\n // Update managed app package name to match new identity\n const managed = state.packages.find((p) => p.managed);\n if (managed) {\n const appBase = namePart.replace(/-cli$/, '-app');\n managed.packageName = scopePart ? `@${scopePart}/${appBase}` : appBase;\n managed.id = `app-${namePart}`;\n }\n },\n};\n","import type { PhClintProjectLifecycleOperations } from 'document-models/ph-clint-project/v1';\nimport { InvalidAgentImageError } from '../../gen/features-mastra/error.js';\n\nexport const phClintProjectLifecycleOperations: PhClintProjectLifecycleOperations = {\n importSpecOperation(state, action) {\n state.name = action.input.name;\n state.scope = action.input.scope || null;\n state.version = action.input.version;\n state.description = action.input.description;\n state.features.powerhouse = action.input.powerhouse;\n state.features.mastra.enabled = action.input.mastraEnabled;\n state.features.routine.enabled = action.input.routineEnabled;\n // Derive the expected managed app package name\n const appBase = action.input.name.replace(/-cli$/, '-app');\n const appPkgName = action.input.scope ? `${action.input.scope}/${appBase}` : appBase;\n const phEnabled = action.input.powerhouse !== 'Disabled';\n\n state.packages = action.input.packages.map((p) => ({\n id: p.id,\n packageName: p.packageName,\n documentTypes: [...p.documentTypes],\n version: p.version || null,\n managed: phEnabled && p.packageName === appPkgName,\n }));\n state.externalSkills = action.input.externalSkills.map((s) => ({\n id: s.id,\n name: s.name,\n githubUrl: s.githubUrl,\n }));\n state.features.mastra.agentId = action.input.agentId || null;\n state.features.mastra.agentName = action.input.agentName || null;\n state.features.mastra.models = (action.input.models || []).map((m) => ({\n id: m.id,\n isDefault: m.isDefault,\n }));\n state.features.mastra.profiles = (action.input.profiles || []).map((p) => ({\n id: p.id,\n title: p.title,\n content: p.content,\n }));\n\n // agentDescription — respects mastra-enabled guard\n if (action.input.agentDescription && state.features.mastra.enabled) {\n state.features.mastra.agentDescription = action.input.agentDescription;\n } else {\n state.features.mastra.agentDescription = null;\n }\n\n // agentImage — validates data URL format (same logic as setAgentImageOperation)\n if (action.input.agentImage && state.features.mastra.enabled) {\n if (!/^data:[a-z]+\\/[a-z0-9.+-]+;base64,/.test(action.input.agentImage)) {\n throw new InvalidAgentImageError('Invalid image: must be a data URL (data:<mime>;base64,...)');\n }\n state.features.mastra.agentImage = action.input.agentImage;\n } else {\n state.features.mastra.agentImage = null;\n }\n\n // enableChat — respects mastra+powerhouse guards, manages clint-common package\n if (action.input.enableChat && state.features.mastra.enabled && state.features.powerhouse !== 'Disabled') {\n state.features.mastra.common.enableChat = true;\n const CLINT_COMMON_PKG = '@powerhousedao/clint-common';\n const CHAT_DOC_TYPE = 'powerhouse/chat-session';\n const existing = state.packages.find((p) => p.packageName === CLINT_COMMON_PKG);\n if (!existing) {\n state.packages.push({\n id: 'pkg-clint-common',\n packageName: CLINT_COMMON_PKG,\n documentTypes: [CHAT_DOC_TYPE],\n version: null,\n managed: true,\n });\n } else if (!existing.documentTypes.includes(CHAT_DOC_TYPE)) {\n existing.documentTypes.push(CHAT_DOC_TYPE);\n }\n } else {\n state.features.mastra.common.enableChat = false;\n }\n\n // Deployment fields\n state.deployment.proxyEnabled = action.input.proxyEnabled ?? false;\n state.deployment.observabilityEnabled = action.input.observabilityEnabled ?? false;\n state.deployment.supportedResources = action.input.supportedResources ? [...action.input.supportedResources] : [];\n },\n};\n","export type ErrorCode =\n | 'DuplicatePackageError'\n | 'PackageNotFoundError'\n | 'CannotRemoveAppPackageError'\n | 'CannotRemoveManagedPackageError'\n | 'InvalidDocumentTypeError'\n | 'DuplicateDocumentTypeError'\n | 'DocumentTypeNotFoundError'\n | 'InvalidVersionError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class DuplicatePackageError extends Error implements ReducerError {\n errorCode = 'DuplicatePackageError' as ErrorCode;\n constructor(message = 'DuplicatePackageError') {\n super(message);\n }\n}\n\nexport class PackageNotFoundError extends Error implements ReducerError {\n errorCode = 'PackageNotFoundError' as ErrorCode;\n constructor(message = 'PackageNotFoundError') {\n super(message);\n }\n}\n\nexport class CannotRemoveAppPackageError extends Error implements ReducerError {\n errorCode = 'CannotRemoveAppPackageError' as ErrorCode;\n constructor(message = 'CannotRemoveAppPackageError') {\n super(message);\n }\n}\n\nexport class CannotRemoveManagedPackageError extends Error implements ReducerError {\n errorCode = 'CannotRemoveManagedPackageError' as ErrorCode;\n constructor(message = 'CannotRemoveManagedPackageError') {\n super(message);\n }\n}\n\nexport class InvalidDocumentTypeError extends Error implements ReducerError {\n errorCode = 'InvalidDocumentTypeError' as ErrorCode;\n constructor(message = 'InvalidDocumentTypeError') {\n super(message);\n }\n}\n\nexport class DuplicateDocumentTypeError extends Error implements ReducerError {\n errorCode = 'DuplicateDocumentTypeError' as ErrorCode;\n constructor(message = 'DuplicateDocumentTypeError') {\n super(message);\n }\n}\n\nexport class DocumentTypeNotFoundError extends Error implements ReducerError {\n errorCode = 'DocumentTypeNotFoundError' as ErrorCode;\n constructor(message = 'DocumentTypeNotFoundError') {\n super(message);\n }\n}\n\nexport class InvalidVersionError extends Error implements ReducerError {\n errorCode = 'InvalidVersionError' as ErrorCode;\n constructor(message = 'InvalidVersionError') {\n super(message);\n }\n}\n\nexport const errors = {\n AddPowerhousePackage: { DuplicatePackageError },\n RemovePowerhousePackage: {\n PackageNotFoundError,\n CannotRemoveAppPackageError,\n CannotRemoveManagedPackageError,\n },\n AddPackageDocumentType: {\n InvalidDocumentTypeError,\n PackageNotFoundError,\n DuplicateDocumentTypeError,\n },\n RemovePackageDocumentType: {\n PackageNotFoundError,\n DocumentTypeNotFoundError,\n },\n SetPackageVersion: { PackageNotFoundError, InvalidVersionError },\n};\n","import type { PhClintProjectPowerhousePackagesOperations } from 'document-models/ph-clint-project/v1';\nimport { CannotRemoveManagedPackageError, DocumentTypeNotFoundError, DuplicateDocumentTypeError, DuplicatePackageError, InvalidDocumentTypeError, InvalidVersionError, PackageNotFoundError } from '../../gen/powerhouse-packages/error.js';\n\nconst SEMVER = /^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/;\n\nexport const phClintProjectPowerhousePackagesOperations: PhClintProjectPowerhousePackagesOperations = {\n addPowerhousePackageOperation(state, action) {\n const exists = state.packages.find((p) => p.id === action.input.id || p.packageName === action.input.packageName);\n if (exists) {\n throw new DuplicatePackageError(`Package already exists: ${action.input.packageName}`);\n }\n state.packages.push({\n id: action.input.id,\n packageName: action.input.packageName,\n documentTypes: [],\n version: null,\n managed: false,\n });\n },\n removePowerhousePackageOperation(state, action) {\n const idx = state.packages.findIndex((p) => p.id === action.input.id);\n if (idx === -1) {\n throw new PackageNotFoundError(`Package not found: ${action.input.id}`);\n }\n const pkg = state.packages[idx];\n if (pkg.managed) {\n throw new CannotRemoveManagedPackageError('Cannot remove a managed package');\n }\n state.packages.splice(idx, 1);\n },\n addPackageDocumentTypeOperation(state, action) {\n if (action.input.documentType !== '*/*' && !/^[a-z0-9-]+\\/[a-z0-9-]+$/.test(action.input.documentType)) {\n throw new InvalidDocumentTypeError(`Invalid document type format: ${action.input.documentType}. Expected org/name.`);\n }\n const pkg = state.packages.find((p) => p.id === action.input.packageId);\n if (!pkg) {\n throw new PackageNotFoundError(`Package not found: ${action.input.packageId}`);\n }\n if (action.input.documentType === '*/*') {\n pkg.documentTypes.length = 0;\n pkg.documentTypes.push('*/*');\n return;\n }\n if (pkg.documentTypes.includes('*/*')) {\n return;\n }\n if (pkg.documentTypes.includes(action.input.documentType)) {\n throw new DuplicateDocumentTypeError(`Document type already registered: ${action.input.documentType}`);\n }\n pkg.documentTypes.push(action.input.documentType);\n },\n removePackageDocumentTypeOperation(state, action) {\n const pkg = state.packages.find((p) => p.id === action.input.packageId);\n if (!pkg) {\n throw new PackageNotFoundError(`Package not found: ${action.input.packageId}`);\n }\n const idx = pkg.documentTypes.indexOf(action.input.documentType);\n if (idx === -1) {\n throw new DocumentTypeNotFoundError(`Document type not found: ${action.input.documentType}`);\n }\n pkg.documentTypes.splice(idx, 1);\n },\n setPackageVersionOperation(state, action) {\n const pkg = state.packages.find((p) => p.id === action.input.packageId);\n if (!pkg) {\n throw new PackageNotFoundError(`Package not found: ${action.input.packageId}`);\n }\n if (action.input.version != null) {\n if (!SEMVER.test(action.input.version)) {\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\n }\n }\n pkg.version = action.input.version || null;\n },\n};\n","export type ErrorCode = 'InvalidVersionError' | 'PublishRecordNotFoundError';\n\nexport interface ReducerError {\n errorCode: ErrorCode;\n}\n\nexport class InvalidVersionError extends Error implements ReducerError {\n errorCode = 'InvalidVersionError' as ErrorCode;\n constructor(message = 'InvalidVersionError') {\n super(message);\n }\n}\n\nexport class PublishRecordNotFoundError extends Error implements ReducerError {\n errorCode = 'PublishRecordNotFoundError' as ErrorCode;\n constructor(message = 'PublishRecordNotFoundError') {\n super(message);\n }\n}\n\nexport const errors = {\n BumpVersion: { InvalidVersionError },\n SetPublishStatus: { PublishRecordNotFoundError },\n};\n","import type { PhClintProjectPublishingOperations } from 'document-models/ph-clint-project/v1';\nimport { InvalidVersionError, PublishRecordNotFoundError } from '../../gen/publishing/error.js';\n\nexport const phClintProjectPublishingOperations: PhClintProjectPublishingOperations = {\n bumpVersionOperation(state, action) {\n if (!/^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$/.test(action.input.version)) {\n throw new InvalidVersionError(`Invalid version: ${action.input.version}`);\n }\n state.version = action.input.version;\n },\n publishDevOperation(state, action) {\n state.publishHistory.push({\n id: action.input.id,\n tag: 'Dev',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n });\n },\n publishStagingOperation(state, action) {\n state.publishHistory.push({\n id: action.input.id,\n tag: 'Staging',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n });\n },\n publishProductionOperation(state, action) {\n state.publishHistory.push({\n id: action.input.id,\n tag: 'Production',\n version: state.version,\n timestamp: action.input.timestamp,\n status: 'Pending',\n });\n },\n setPublishStatusOperation(state, action) {\n const record = state.publishHistory.find((r) => r.id === action.input.id);\n if (!record) {\n throw new PublishRecordNotFoundError(`Publish record not found: ${action.input.id}`);\n }\n record.status = action.input.status;\n },\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport type { Reducer, StateReducer } from 'document-model';\nimport { createReducer, isDocumentAction } from 'document-model';\nimport type { PhClintProjectPHState } from 'document-models/ph-clint-project/v1';\n\nimport { phClintProjectDeploymentOperations } from '../src/reducers/deployment.js';\nimport { phClintProjectExternalSkillsOperations } from '../src/reducers/external-skills.js';\nimport { phClintProjectFeaturesMastraOperations } from '../src/reducers/features-mastra.js';\nimport { phClintProjectFeaturesPowerhouseOperations } from '../src/reducers/features-powerhouse.js';\nimport { phClintProjectFeaturesRoutineOperations } from '../src/reducers/features-routine.js';\nimport { phClintProjectIdentityOperations } from '../src/reducers/identity.js';\nimport { phClintProjectLifecycleOperations } from '../src/reducers/lifecycle.js';\nimport { phClintProjectPowerhousePackagesOperations } from '../src/reducers/powerhouse-packages.js';\nimport { phClintProjectPublishingOperations } from '../src/reducers/publishing.js';\n\nimport {\n AddExternalSkillInputSchema,\n AddModelInputSchema,\n AddPackageDocumentTypeInputSchema,\n AddPowerhousePackageInputSchema,\n AddProfileInputSchema,\n AddSupportedResourceInputSchema,\n BumpVersionInputSchema,\n ClearAgentImageInputSchema,\n DisableMastraInputSchema,\n DisableRoutineInputSchema,\n EnableMastraInputSchema,\n EnableRoutineInputSchema,\n ImportSpecInputSchema,\n PublishDevInputSchema,\n PublishProductionInputSchema,\n PublishStagingInputSchema,\n RemoveExternalSkillInputSchema,\n RemoveModelInputSchema,\n RemovePackageDocumentTypeInputSchema,\n RemovePowerhousePackageInputSchema,\n RemoveProfileInputSchema,\n RemoveSupportedResourceInputSchema,\n ReorderProfilesInputSchema,\n SetAgentDescriptionInputSchema,\n SetAgentIdInputSchema,\n SetAgentImageInputSchema,\n SetAgentNameInputSchema,\n SetDefaultModelInputSchema,\n SetDescriptionInputSchema,\n SetEnableChatInputSchema,\n SetExternalSkillGithubUrlInputSchema,\n SetExternalSkillNameInputSchema,\n SetObservabilityEnabledInputSchema,\n SetPackageIdentifierInputSchema,\n SetPackageVersionInputSchema,\n SetPowerhouseLevelInputSchema,\n SetProxyEnabledInputSchema,\n SetPublishStatusInputSchema,\n SetVersionInputSchema,\n UpdateProfileInputSchema,\n} from './schema/zod.js';\n\nconst stateReducer: StateReducer<PhClintProjectPHState> = (state, action, dispatch) => {\n if (isDocumentAction(action)) {\n return state;\n }\n switch (action.type) {\n case 'SET_DESCRIPTION': {\n SetDescriptionInputSchema().parse(action.input);\n\n phClintProjectIdentityOperations.setDescriptionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_VERSION': {\n SetVersionInputSchema().parse(action.input);\n\n phClintProjectIdentityOperations.setVersionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_PACKAGE_IDENTIFIER': {\n SetPackageIdentifierInputSchema().parse(action.input);\n\n phClintProjectIdentityOperations.setPackageIdentifierOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_POWERHOUSE_LEVEL': {\n SetPowerhouseLevelInputSchema().parse(action.input);\n\n phClintProjectFeaturesPowerhouseOperations.setPowerhouseLevelOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ENABLE_MASTRA': {\n EnableMastraInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.enableMastraOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'DISABLE_MASTRA': {\n DisableMastraInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.disableMastraOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_AGENT_ID': {\n SetAgentIdInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.setAgentIdOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_AGENT_NAME': {\n SetAgentNameInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.setAgentNameOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_MODEL': {\n AddModelInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.addModelOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_MODEL': {\n RemoveModelInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.removeModelOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_DEFAULT_MODEL': {\n SetDefaultModelInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.setDefaultModelOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_PROFILE': {\n AddProfileInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.addProfileOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'UPDATE_PROFILE': {\n UpdateProfileInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.updateProfileOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_PROFILE': {\n RemoveProfileInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.removeProfileOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REORDER_PROFILES': {\n ReorderProfilesInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.reorderProfilesOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_AGENT_DESCRIPTION': {\n SetAgentDescriptionInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.setAgentDescriptionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_AGENT_IMAGE': {\n SetAgentImageInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.setAgentImageOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'CLEAR_AGENT_IMAGE': {\n ClearAgentImageInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.clearAgentImageOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_ENABLE_CHAT': {\n SetEnableChatInputSchema().parse(action.input);\n\n phClintProjectFeaturesMastraOperations.setEnableChatOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ENABLE_ROUTINE': {\n EnableRoutineInputSchema().parse(action.input);\n\n phClintProjectFeaturesRoutineOperations.enableRoutineOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'DISABLE_ROUTINE': {\n DisableRoutineInputSchema().parse(action.input);\n\n phClintProjectFeaturesRoutineOperations.disableRoutineOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_POWERHOUSE_PACKAGE': {\n AddPowerhousePackageInputSchema().parse(action.input);\n\n phClintProjectPowerhousePackagesOperations.addPowerhousePackageOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_POWERHOUSE_PACKAGE': {\n RemovePowerhousePackageInputSchema().parse(action.input);\n\n phClintProjectPowerhousePackagesOperations.removePowerhousePackageOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_PACKAGE_DOCUMENT_TYPE': {\n AddPackageDocumentTypeInputSchema().parse(action.input);\n\n phClintProjectPowerhousePackagesOperations.addPackageDocumentTypeOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_PACKAGE_DOCUMENT_TYPE': {\n RemovePackageDocumentTypeInputSchema().parse(action.input);\n\n phClintProjectPowerhousePackagesOperations.removePackageDocumentTypeOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_PACKAGE_VERSION': {\n SetPackageVersionInputSchema().parse(action.input);\n\n phClintProjectPowerhousePackagesOperations.setPackageVersionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_EXTERNAL_SKILL': {\n AddExternalSkillInputSchema().parse(action.input);\n\n phClintProjectExternalSkillsOperations.addExternalSkillOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_EXTERNAL_SKILL': {\n RemoveExternalSkillInputSchema().parse(action.input);\n\n phClintProjectExternalSkillsOperations.removeExternalSkillOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_EXTERNAL_SKILL_NAME': {\n SetExternalSkillNameInputSchema().parse(action.input);\n\n phClintProjectExternalSkillsOperations.setExternalSkillNameOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_EXTERNAL_SKILL_GITHUB_URL': {\n SetExternalSkillGithubUrlInputSchema().parse(action.input);\n\n phClintProjectExternalSkillsOperations.setExternalSkillGithubUrlOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'BUMP_VERSION': {\n BumpVersionInputSchema().parse(action.input);\n\n phClintProjectPublishingOperations.bumpVersionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'PUBLISH_DEV': {\n PublishDevInputSchema().parse(action.input);\n\n phClintProjectPublishingOperations.publishDevOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'PUBLISH_STAGING': {\n PublishStagingInputSchema().parse(action.input);\n\n phClintProjectPublishingOperations.publishStagingOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'PUBLISH_PRODUCTION': {\n PublishProductionInputSchema().parse(action.input);\n\n phClintProjectPublishingOperations.publishProductionOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_PUBLISH_STATUS': {\n SetPublishStatusInputSchema().parse(action.input);\n\n phClintProjectPublishingOperations.setPublishStatusOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'IMPORT_SPEC': {\n ImportSpecInputSchema().parse(action.input);\n\n phClintProjectLifecycleOperations.importSpecOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'ADD_SUPPORTED_RESOURCE': {\n AddSupportedResourceInputSchema().parse(action.input);\n\n phClintProjectDeploymentOperations.addSupportedResourceOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'REMOVE_SUPPORTED_RESOURCE': {\n RemoveSupportedResourceInputSchema().parse(action.input);\n\n phClintProjectDeploymentOperations.removeSupportedResourceOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_PROXY_ENABLED': {\n SetProxyEnabledInputSchema().parse(action.input);\n\n phClintProjectDeploymentOperations.setProxyEnabledOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n case 'SET_OBSERVABILITY_ENABLED': {\n SetObservabilityEnabledInputSchema().parse(action.input);\n\n phClintProjectDeploymentOperations.setObservabilityEnabledOperation((state as any)[action.scope], action as any, dispatch);\n\n break;\n }\n\n default:\n return state;\n }\n};\n\nexport const reducer: Reducer<PhClintProjectPHState> = createReducer(stateReducer);\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nexport const phClintProjectDocumentType = 'powerhouse/ph-clint-project';\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { BaseDocumentHeaderSchema, BaseDocumentStateSchema } from 'document-model';\nimport { z } from 'zod';\nimport { phClintProjectDocumentType } from './document-type.js';\nimport { PhClintProjectStateSchema } from './schema/zod.js';\nimport type { PhClintProjectDocument, PhClintProjectPHState } from './types.js';\n\n/** Schema for validating the header object of a PhClintProject document */\nexport const PhClintProjectDocumentHeaderSchema = BaseDocumentHeaderSchema.extend({\n documentType: z.literal(phClintProjectDocumentType),\n});\n\n/** Schema for validating the state object of a PhClintProject document */\nexport const PhClintProjectPHStateSchema = BaseDocumentStateSchema.extend({\n global: PhClintProjectStateSchema(),\n});\n\nexport const PhClintProjectDocumentSchema = z.object({\n header: PhClintProjectDocumentHeaderSchema,\n state: PhClintProjectPHStateSchema,\n initialState: PhClintProjectPHStateSchema,\n});\n\n/** Simple helper function to check if a state object is a PhClintProject document state object */\nexport function isPhClintProjectState(state: unknown): state is PhClintProjectPHState {\n return PhClintProjectPHStateSchema.safeParse(state).success;\n}\n\n/** Simple helper function to assert that a document state object is a PhClintProject document state object */\nexport function assertIsPhClintProjectState(state: unknown): asserts state is PhClintProjectPHState {\n PhClintProjectPHStateSchema.parse(state);\n}\n\n/** Simple helper function to check if a document is a PhClintProject document */\nexport function isPhClintProjectDocument(document: unknown): document is PhClintProjectDocument {\n return PhClintProjectDocumentSchema.safeParse(document).success;\n}\n\n/** Simple helper function to assert that a document is a PhClintProject document */\nexport function assertIsPhClintProjectDocument(document: unknown): asserts document is PhClintProjectDocument {\n PhClintProjectDocumentSchema.parse(document);\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils } from 'document-model';\nimport { baseCreateDocument, baseLoadFromInput, baseSaveToFileHandle, defaultBaseState, generateId } from 'document-model';\nimport { assertIsPhClintProjectDocument, assertIsPhClintProjectState, isPhClintProjectDocument, isPhClintProjectState } from './document-schema.js';\nimport { phClintProjectDocumentType } from './document-type.js';\nimport { reducer } from './reducer.js';\nimport type { PhClintProjectGlobalState, PhClintProjectLocalState, PhClintProjectPHState } from './types.js';\n\nexport const initialGlobalState: PhClintProjectGlobalState = {\n name: null,\n scope: null,\n version: '0.1.0',\n description: '',\n features: {\n powerhouse: 'Disabled',\n mastra: {\n enabled: false,\n agentId: null,\n agentName: null,\n agentDescription: null,\n agentImage: null,\n models: [],\n profiles: [],\n common: { enableChat: false },\n },\n routine: { enabled: false },\n },\n packages: [],\n externalSkills: [],\n publishHistory: [],\n deployment: {\n proxyEnabled: false,\n observabilityEnabled: false,\n supportedResources: ['vetra-agent-s', 'vetra-agent-m', 'vetra-agent-l', 'vetra-agent-xl', 'vetra-agent-xxl'],\n },\n};\nexport const initialLocalState: PhClintProjectLocalState = {};\n\nexport const utils: DocumentModelUtils<PhClintProjectPHState> = {\n fileExtension: 'pcp',\n createState(state) {\n return {\n ...defaultBaseState(),\n global: { ...initialGlobalState, ...state?.global },\n local: { ...initialLocalState, ...state?.local },\n };\n },\n createDocument(state) {\n const document = baseCreateDocument(utils.createState, state);\n\n document.header.documentType = phClintProjectDocumentType;\n\n // for backwards compatibility, but this is NOT a valid signed document id\n document.header.id = generateId();\n\n return document;\n },\n saveToFileHandle(document, input) {\n return baseSaveToFileHandle(document, input);\n },\n loadFromInput(input) {\n return baseLoadFromInput(input, reducer);\n },\n isStateOfType(state) {\n return isPhClintProjectState(state);\n },\n assertIsStateOfType(state) {\n return assertIsPhClintProjectState(state);\n },\n isDocumentOfType(document) {\n return isPhClintProjectDocument(document);\n },\n assertIsDocumentOfType(document) {\n return assertIsPhClintProjectDocument(document);\n },\n};\n","export {};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelUtils } from 'document-model';\nimport type { PhClintProjectPHState } from './gen/types.js';\nimport { utils as genUtils } from './gen/utils.js';\nimport * as customUtils from './src/utils.js';\n\n/** Utils for the PhClintProject document model */\nexport const utils: DocumentModelUtils<PhClintProjectPHState> = {\n ...genUtils,\n ...customUtils,\n};\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentModelModule } from 'document-model';\nimport { createState, defaultBaseState } from 'document-model';\nimport { actions } from './actions.js';\nimport { documentModel } from './gen/document-model.js';\nimport { reducer } from './gen/reducer.js';\nimport type { PhClintProjectPHState } from './gen/types.js';\nimport { utils } from './utils.js';\n\n/** Document model module for the PhClintProject document type */\nexport const PhClintProject = {\n version: 1,\n reducer,\n actions,\n utils,\n documentModel: createState(defaultBaseState(), documentModel),\n} as const satisfies DocumentModelModule<PhClintProjectPHState>;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],"mappings":";;;;CAEA,MAAM,EAAE,mBAAmB,OAAO;CAElC,MAAM,YAAY,WAAW;AAG7B,WAAU,YAAY;AAEtB,WAAU,YAAY;AAGtB,WAAU,UAAU;AAGpB,SAAQ,YAAY;AAEpB,SAAQ,YAAY;AAEpB,QAAO,UAAU;CAGjB,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MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ;OACN;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACD;QACE,IAAI;QACJ,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACX;OACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;MACN,aAAa;MACb,QAAQ;MACR,UAAU;MACV,SACE;MACF,QAAQ,CACN;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,EACD;OACE,IAAI;OACJ,MAAM;OACN,MAAM;OACN,aAAa;OACb,UAAU;OACX,CACF;MACD,UAAU,EAAE;MACZ,OAAO;MACR;KACD;MACE,IAAI;MACJ,MAAM;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