@madarco/agentbox 0.27.0 → 0.27.2
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/CHANGELOG.md +25 -0
- package/dist/{_cloud-attach-WDGM6FL5.js → _cloud-attach-FVD5YJCE.js} +6 -4
- package/dist/{chunk-NEF6MDJO.js → chunk-2PCU4OF5.js} +4 -4
- package/dist/{chunk-JE6UI5YR.js → chunk-47BVC7FN.js} +7 -59
- package/dist/chunk-47BVC7FN.js.map +1 -0
- package/dist/chunk-5ZK5MQA2.js +64 -0
- package/dist/chunk-5ZK5MQA2.js.map +1 -0
- package/dist/{chunk-26IKZRTT.js → chunk-A4OVGMVL.js} +23 -16
- package/dist/chunk-A4OVGMVL.js.map +1 -0
- package/dist/{chunk-KWOEUFVA.js → chunk-EZWPCTUO.js} +2 -2
- package/dist/{chunk-IDH5A4RR.js → chunk-F6NQZ4DC.js} +2 -2
- package/dist/chunk-G3H2L3O2.js +0 -0
- package/dist/chunk-IMN62QY5.js +285 -0
- package/dist/chunk-IMN62QY5.js.map +1 -0
- package/dist/chunk-JGZSA5ZI.js +0 -0
- package/dist/{chunk-V5XXJH63.js → chunk-JNFUWQ4N.js} +2 -2
- package/dist/{chunk-UJEH2NJT.js → chunk-JRXNVEV3.js} +2 -271
- package/dist/chunk-JRXNVEV3.js.map +1 -0
- package/dist/{chunk-LL7NCMUU.js → chunk-QAJQXZ3N.js} +3 -3
- package/dist/{chunk-SJ75AIA2.js → chunk-QJT2XOKH.js} +8 -6
- package/dist/{chunk-SJ75AIA2.js.map → chunk-QJT2XOKH.js.map} +1 -1
- package/dist/{chunk-HR7NHH5J.js → chunk-RK2CEABS.js} +205 -5
- package/dist/{chunk-HR7NHH5J.js.map → chunk-RK2CEABS.js.map} +1 -1
- package/dist/chunk-WJFZJZIM.js +0 -0
- package/dist/cloud-backends.js +28 -0
- package/dist/cloud-backends.js.map +1 -0
- package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
- package/dist/{dist-O3LKOIE7.js → dist-2SXD3ITR.js} +6 -5
- package/dist/{dist-O3LKOIE7.js.map → dist-2SXD3ITR.js.map} +1 -1
- package/dist/{dist-FTKS2GI4.js → dist-4KTWNGU6.js} +6 -5
- package/dist/{dist-WVYAURMF.js → dist-6ZOCQZIP.js} +6 -5
- package/dist/{dist-OO52HARR.js → dist-7VCYREHM.js} +22 -20
- package/dist/{dist-KQTMCVME.js → dist-TL4YW7KZ.js} +6 -5
- package/dist/{dist-KQTMCVME.js.map → dist-TL4YW7KZ.js.map} +1 -1
- package/dist/dist-U2SVLJUQ.js +0 -0
- package/dist/{dist-TSFVB7AI.js → dist-UUOX4DBX.js} +6 -5
- package/dist/{dist-TSFVB7AI.js.map → dist-UUOX4DBX.js.map} +1 -1
- package/dist/dist-XSEK7LX3.js +156 -0
- package/dist/{dist-Z6L5MM5D.js → dist-YGXQMN2K.js} +6 -5
- package/dist/index.js +59 -55
- package/dist/index.js.map +1 -1
- package/dist/{prepared-state-75DIZ55S-TNJXWMXV.js → prepared-state-75DIZ55S-B33TDOJZ.js} +3 -2
- package/dist/prepared-state-75DIZ55S-B33TDOJZ.js.map +1 -0
- package/package.json +31 -29
- package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
- package/runtime/_shared/agentbox-dockerd-start +0 -0
- package/runtime/_shared/agentbox-open +0 -0
- package/runtime/_shared/agentbox-portless-trust +0 -0
- package/runtime/_shared/agentbox-vnc-start +0 -0
- package/runtime/_shared/ctl.cjs +186 -172
- package/runtime/_shared/gh-shim +0 -0
- package/runtime/_shared/git-shim +0 -0
- package/runtime/_shared/linear-shim +0 -0
- package/runtime/_shared/ntn-shim +0 -0
- package/runtime/digitalocean/agentbox-checkpoint-cleanup +0 -0
- package/runtime/digitalocean/agentbox-dockerd-start +0 -0
- package/runtime/digitalocean/agentbox-open +0 -0
- package/runtime/digitalocean/agentbox-portless-trust +0 -0
- package/runtime/digitalocean/agentbox-vnc-start +0 -0
- package/runtime/digitalocean/ctl.cjs +186 -172
- package/runtime/digitalocean/gh-shim +0 -0
- package/runtime/digitalocean/git-shim +0 -0
- package/runtime/digitalocean/linear-shim +0 -0
- package/runtime/digitalocean/ntn-shim +0 -0
- package/runtime/digitalocean/scripts/install-box.sh +0 -0
- package/runtime/docker/packages/ctl/dist/bin.cjs +186 -172
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
- package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
- package/runtime/e2b/agentbox-dockerd-start +0 -0
- package/runtime/e2b/agentbox-open +0 -0
- package/runtime/e2b/agentbox-vnc-start +0 -0
- package/runtime/e2b/ctl.cjs +186 -172
- package/runtime/e2b/gh-shim +0 -0
- package/runtime/e2b/git-shim +0 -0
- package/runtime/e2b/linear-shim +0 -0
- package/runtime/e2b/ntn-shim +0 -0
- package/runtime/e2b/scripts/build-template.sh +0 -0
- package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
- package/runtime/hetzner/agentbox-dockerd-start +0 -0
- package/runtime/hetzner/agentbox-open +0 -0
- package/runtime/hetzner/agentbox-portless-trust +0 -0
- package/runtime/hetzner/agentbox-vnc-start +0 -0
- package/runtime/hetzner/ctl.cjs +186 -172
- package/runtime/hetzner/gh-shim +0 -0
- package/runtime/hetzner/git-shim +0 -0
- package/runtime/hetzner/linear-shim +0 -0
- package/runtime/hetzner/ntn-shim +0 -0
- package/runtime/hetzner/scripts/install-box.sh +0 -0
- package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
- package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
- package/runtime/hub/apps/hub/.next/prerender-manifest.json +3 -3
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/server-reference-manifest.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/server-reference-manifest.json +12 -12
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/server-reference-manifest.json +11 -11
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/server-reference-manifest.json +8 -8
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/0zhp_better-auth_dist_adapters_kysely-adapter_index_mjs_1rl4qnh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/151__@better-auth_core_dist_0ecdp_3._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04h15ml._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04jgk9x._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07ednlo._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a7djvw._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +5 -5
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ig1bot._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0szd4sh._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0t7o5ed._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-0flwc._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-9g0ae._.js +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1e4z_-v._.js → [root-of-the-server]__11izd5j._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13ioh5z._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13jwk_k._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16_uteg._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16p2m-g._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1k8g143._.js → [root-of-the-server]__19pc87s._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_gu2yk._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ai-945._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bu2zio._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ctczev._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f2sueq._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f9zctr._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1md9kdw._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mttufy._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pp5oib._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qwhzmi._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thipug._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xeczo7._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20503l7._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +3 -3
- package/runtime/hub/apps/hub/.next/server/chunks/packages_relay_dist_control-plane_03a-9aj.js +3 -3
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/044u_hub__next-internal_server_app_(dashboard)_projects_[id]_page_actions_15f56np.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_0xy-j7z._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_010858m.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_04zwxnx.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_06exuc7.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2ldrt.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2tzep.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_116nh32.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_11dyjcb.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_1_4knli.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__08-1wwu._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0c9mbcn._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0gdfxj4._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0kc-hwp._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0lu73p6._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__10bfmwi._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__18qvdzb._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1l2urlw._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_03s-ah2._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0kpdmm-._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ozyjt1._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r4px38._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_18w2zeh._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_approvals_page_actions_1mi0bpn.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_boxes_[id]_page_actions_0k7kgn2.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_page_actions_1t3u0xy.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_relay_dist_control-plane_0ve-wz4.js +1 -1
- package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
- package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
- package/runtime/hub/apps/hub/.next/server/server-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/server-reference-manifest.json +18 -18
- package/runtime/hub/apps/hub/.next/static/chunks/{44j61g8lm9nvw.js → 1-maeq_pl3z29.js} +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/{3-zanu4ioia5i.js → 1f-pwhlfklk8h.js} +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/{0xdtiy_m2ygv8.js → 1g922r_mc5ciw.js} +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/{26rwu1f2gzemi.js → 2k1tvmngrtdgs.js} +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/{3v6kx35_lwjs8.js → 2omimeqtc8qnp.js} +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/{000a1sa7te1h8.js → 3urpddxa8b_je.js} +1 -1
- package/runtime/hub/apps/hub/{chunk-YJ5MJOXK.js → chunk-5ARPIPV4.js} +194 -171
- package/runtime/hub/apps/hub/{chunk-EHBJKZCL.js → chunk-AEIOQFZ4.js} +245 -2
- package/runtime/hub/apps/hub/dist-2EOAT3PC.js +155 -0
- package/runtime/hub/apps/hub/{dist-LYDHYTP2.js → dist-DQIL673Y.js} +2 -2
- package/runtime/hub/apps/hub/{dist-GTVVXCBP.js → dist-EURE7AUA.js} +2 -2
- package/runtime/hub/apps/hub/{dist-JG45OFT2.js → dist-EYHD64SR.js} +16 -16
- package/runtime/hub/apps/hub/{dist-G6TXUSPZ.js → dist-GFXXCXLS.js} +2 -2
- package/runtime/hub/apps/hub/{dist-DX6IYMAH.js → dist-IVA2PC7N.js} +2 -2
- package/runtime/hub/apps/hub/{dist-6FPPUSWZ.js → dist-MMTT7VYJ.js} +1 -1
- package/runtime/hub/apps/hub/{dist-3I7KUI6W.js → dist-TAWVTJGU.js} +2 -2
- package/runtime/hub/apps/hub/server.js +28 -15
- package/runtime/relay/bin.cjs +37 -3
- package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
- package/runtime/vercel/agentbox-dockerd-start +0 -0
- package/runtime/vercel/agentbox-open +0 -0
- package/runtime/vercel/agentbox-vnc-start +0 -0
- package/runtime/vercel/ctl.cjs +186 -172
- package/runtime/vercel/gh-shim +0 -0
- package/runtime/vercel/git-shim +0 -0
- package/runtime/vercel/linear-shim +0 -0
- package/runtime/vercel/ntn-shim +0 -0
- package/runtime/vercel/scripts/provision.sh +0 -0
- package/LICENSE +0 -21
- package/dist/chunk-26IKZRTT.js.map +0 -1
- package/dist/chunk-JE6UI5YR.js.map +0 -1
- package/dist/chunk-UJEH2NJT.js.map +0 -1
- package/runtime/hub/apps/hub/.next/server/chunks/0-fj_better-auth_dist_adapters_kysely-adapter_index_mjs_0btft52._.js +0 -3
- /package/dist/{_cloud-attach-WDGM6FL5.js.map → _cloud-attach-FVD5YJCE.js.map} +0 -0
- /package/dist/{chunk-NEF6MDJO.js.map → chunk-2PCU4OF5.js.map} +0 -0
- /package/dist/{chunk-KWOEUFVA.js.map → chunk-EZWPCTUO.js.map} +0 -0
- /package/dist/{chunk-IDH5A4RR.js.map → chunk-F6NQZ4DC.js.map} +0 -0
- /package/dist/{chunk-V5XXJH63.js.map → chunk-JNFUWQ4N.js.map} +0 -0
- /package/dist/{chunk-LL7NCMUU.js.map → chunk-QAJQXZ3N.js.map} +0 -0
- /package/dist/{dist-FTKS2GI4.js.map → dist-4KTWNGU6.js.map} +0 -0
- /package/dist/{dist-OO52HARR.js.map → dist-6ZOCQZIP.js.map} +0 -0
- /package/dist/{dist-WVYAURMF.js.map → dist-7VCYREHM.js.map} +0 -0
- /package/dist/{dist-Z6L5MM5D.js.map → dist-XSEK7LX3.js.map} +0 -0
- /package/dist/{prepared-state-75DIZ55S-TNJXWMXV.js.map → dist-YGXQMN2K.js.map} +0 -0
- /package/runtime/hub/apps/hub/.next/static/{S-yw9-SVffiEHRGm85NzP → Wddru2A-5szSWhZWYoMwi}/_buildManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{S-yw9-SVffiEHRGm85NzP → Wddru2A-5szSWhZWYoMwi}/_clientMiddlewareManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{S-yw9-SVffiEHRGm85NzP → Wddru2A-5szSWhZWYoMwi}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[63003,e=>{"use strict";e.i(7876);var s=e.i(
|
|
1
|
+
module.exports=[63003,e=>{"use strict";e.i(7876);var s=e.i(37173);e.i(78737),e.s(["PostgresStore",()=>s.PostgresStore])},6194,e=>{e.v(s=>Promise.all(["server/chunks/[externals]_pg_15jfwkh._.js"].map(s=>e.l(s))).then(()=>s(8844)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__0ig1bot._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[63003,e=>{"use strict";e.i(7876);var s=e.i(
|
|
1
|
+
module.exports=[63003,e=>{"use strict";e.i(7876);var s=e.i(37173);e.i(78737),e.s(["PostgresStore",()=>s.PostgresStore])},6194,e=>{e.v(s=>Promise.all(["server/chunks/[externals]_pg_15jfwkh._.js"].map(s=>e.l(s))).then(()=>s(8844)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__0szd4sh._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[63003,e=>{"use strict";e.i(7876);var s=e.i(
|
|
1
|
+
module.exports=[63003,e=>{"use strict";e.i(7876);var s=e.i(37173);e.i(78737),e.s(["PostgresStore",()=>s.PostgresStore])},6194,e=>{e.v(s=>Promise.all(["server/chunks/[externals]_pg_15jfwkh._.js"].map(s=>e.l(s))).then(()=>s(8844)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__0t7o5ed._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[63003,e=>{"use strict";e.i(7876);var s=e.i(
|
|
1
|
+
module.exports=[63003,e=>{"use strict";e.i(7876);var s=e.i(37173);e.i(78737),e.s(["PostgresStore",()=>s.PostgresStore])},6194,e=>{e.v(s=>Promise.all(["server/chunks/[externals]_pg_15jfwkh._.js"].map(s=>e.l(s))).then(()=>s(8844)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=%5Broot-of-the-server%5D__1-0flwc._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},44733,e=>{"use strict";let t,r,n,i,a,o,s,c,l,d,u;var p,f,h,m,y=e.i(56710),g=e.i(82809),w=e.i(74001),b=e.i(73300),A=e.i(68744),E=e.i(98570),v=e.i(56147),k=e.i(32931),_=e.i(61810),S=e.i(59963),x=e.i(44491),R=e.i(74916),T=e.i(33073),I=e.i(98603),U=e.i(93317),O=e.i(93695);e.i(95533);var P=e.i(75616);function C(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch{return e}}function D(e){if(!e)return[];let t=[],r=0,n=0;for(;n<e.length;){if(","===e[n]){let i=n+1;for(;i<e.length&&" "===e[i];)i++;for(;i<e.length&&"="!==e[i]&&";"!==e[i]&&","!==e[i];)i++;if(i<e.length&&"="===e[i]){let i=e.slice(r,n).trim();for(i&&t.push(i),r=n+1;r<e.length&&" "===e[r];)r++;n=r;continue}}n++}let i=e.slice(r).trim();return i&&t.push(i),t}let L=/^[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E\x5F\x60\x61-\x7A\x7C\x7E]+$/,$=/^[\x20\x21\x23-\x3A\x3C-\x5B\x5D-\x7E]*$/;function z(e){return!(e.length<2)&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function N(e){let t=0,r=e.length;for(;t<r;){let r=e.charCodeAt(t);if(32!==r&&9!==r)break;t++}for(;r>t;){let t=e.charCodeAt(r-1);if(32!==t&&9!==t)break;r--}return 0===t&&r===e.length?e:e.slice(t,r)}function j(e){let t=new Map;if(e.length<2)return t;for(let r of e.split(";")){let e=r.indexOf("=");if(-1===e)continue;let n=N(r.slice(0,e)),i=z(N(r.slice(e+1)));L.test(n)&&$.test(i)&&t.set(n,C(i))}return t}var H=e.i(10469),B=e.i(69772);let q=async()=>{let e=(0,H.__getBetterAuthGlobal)();if(!e.context.requestStateAsyncStorage){let t=await (0,B.getAsyncLocalStorage)();e.context.requestStateAsyncStorage=new t}return e.context.requestStateAsyncStorage};async function M(){return void 0!==(await q()).getStore()}async function V(){let e=(await q()).getStore();if(!e)throw Error("No request state found. Please make sure you are calling this function within a `runWithRequestState` callback.");return e}async function K(e,t){return(await q()).run(e,t)}function W(e){let t=Object.freeze({});return{get ref(){return t},async get(){let r=await V();if(!r.has(t)){let n=await e();return r.set(t,n),n}return r.get(t)},async set(e){(await V()).set(t,e)}}}let{get:F,set:J}=W(()=>!1),Z=async()=>{let e=(0,H.__getBetterAuthGlobal)();if(!e.context.endpointContextAsyncStorage){let t=await (0,B.getAsyncLocalStorage)();e.context.endpointContextAsyncStorage=new t}return e.context.endpointContextAsyncStorage};async function G(){let e=(await Z()).getStore();if(!e)throw Error("No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback.");return e}async function Q(e,t){return(await Z()).run(e,t)}var Y=e.i(36004),X=e.i(58461);let ee=/^application\/([a-z0-9.+-]*\+)?json/i;async function et(e,t){let r=e.headers.get("content-type")||"",n=r.toLowerCase();if(e.body){if(t&&t.length>0&&!t.some(e=>{let t=n.split(";")[0].trim(),r=e.toLowerCase().trim();return t===r||t.includes(r)})){if(!n)throw new X.APIError(415,{message:`Content-Type is required. Allowed types: ${t.join(", ")}`,code:"UNSUPPORTED_MEDIA_TYPE"});throw new X.APIError(415,{message:`Content-Type "${r}" is not allowed. Allowed types: ${t.join(", ")}`,code:"UNSUPPORTED_MEDIA_TYPE"})}if(ee.test(n))try{return await e.json()}catch(e){if(e instanceof SyntaxError)throw new X.APIError(400,{message:"Invalid JSON in request body",code:"BAD_REQUEST"});throw e}if(n.includes("application/x-www-form-urlencoded")){let t=await e.formData(),r={};return t.forEach((e,t)=>{r[t]=e.toString()}),r}if(n.includes("multipart/form-data")){let t=await e.formData(),r={};return t.forEach((e,t)=>{r[t]=e}),r}return n.includes("text/plain")?await e.text():n.includes("application/octet-stream")?await e.arrayBuffer():n.includes("application/pdf")||n.includes("image/")||n.includes("video/")?await e.blob():n.includes("application/stream")||e.body instanceof ReadableStream?e.body:await e.text()}}function er(e){return e instanceof X.APIError||e?.name==="APIError"}async function en(e){try{return{data:await e,error:null}}catch(e){return{data:null,error:e}}}function ei(e){return e instanceof Request||"[object Request]"===Object.prototype.toString.call(e)}let ea=new Set(["host","user-agent","referer","from","expect","authorization","proxy-authorization","cookie","origin","accept-charset","accept-encoding","accept-language","if-match","if-none-match","if-modified-since","if-unmodified-since","if-range","range","max-forwards","connection","keep-alive","transfer-encoding","te","upgrade","trailer","proxy-connection","content-length"]);function eo(e){for(let t of ea)e.delete(t)}function es(e,t){if(t)for(let[r,n]of new Headers(t).entries())"set-cookie"===r.toLowerCase()?e.append(r,n):e.set(r,n)}function ec(e,t){if(e instanceof Response){if(t?.headers){let r=new Headers(t.headers);eo(r),es(e.headers,r)}return e}if(e&&"object"==typeof e&&"_flag"in e&&"json"===e._flag){let r=e.body,n=e.routerResponse;if(n instanceof Response)return n;let i=new Headers;if(es(i,n?.headers),es(i,e.headers),t?.headers){let e=new Headers(t.headers);eo(e),es(i,e)}return i.set("Content-Type","application/json"),new Response(JSON.stringify(r),{...n,headers:i,status:e.status??t?.status??n?.status,statusText:t?.statusText??n?.statusText})}if(er(e))return ec(e.body,{status:t?.status??e.statusCode,statusText:e.status.toString(),headers:t?.headers||e.headers});let r=e,n=new Headers(t?.headers);if(eo(n),e){if("string"==typeof e)r=e,n.set("Content-Type","text/plain");else if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))r=e,n.set("Content-Type","application/octet-stream");else if(e instanceof Blob)r=e,n.set("Content-Type",e.type||"application/octet-stream");else if(e instanceof FormData)r=e;else if(e instanceof URLSearchParams)r=e,n.set("Content-Type","application/x-www-form-urlencoded");else if(e instanceof ReadableStream)r=e,n.set("Content-Type","application/octet-stream");else if(function(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}(e)){let t,i,a;t=new WeakMap,i=new WeakMap,a=0,r=JSON.stringify(e,function(e,r){if("bigint"==typeof r)return r.toString();if("object"==typeof r&&null!==r){if(((e,r)=>{let n=r;for(;n;){if(n===e)return!0;n=t.get(n)}return!1})(r,this))return`[Circular ref-${i.get(r)}]`;t.set(r,this),i.has(r)||i.set(r,a++)}return r}),n.set("Content-Type","application/json")}}else null===e&&(r=JSON.stringify(null)),n.set("content-type","application/json");return new Response(r,{...t,headers:n})}function el(){let e="u">typeof globalThis&&globalThis.crypto;if(e&&"object"==typeof e.subtle&&null!=e.subtle)return e.subtle;throw Error("crypto.subtle must be defined")}let ed={name:"HMAC",hash:"SHA-256"},eu=async e=>{let t="string"==typeof e?new TextEncoder().encode(e):e;return await el().importKey("raw",t,ed,!1,["sign","verify"])},ep=async(e,t,r)=>{try{let n=atob(e),i=new Uint8Array(n.length);for(let e=0,t=n.length;e<t;e++)i[e]=n.charCodeAt(e);return await el().verify(ed,r,i,new TextEncoder().encode(t))}catch(e){return!1}},ef=async(e,t)=>{let r=await eu(t);return btoa(String.fromCharCode(...new Uint8Array(await el().sign(ed.name,r,new TextEncoder().encode(e)))))},eh=async(e,t)=>{let r=await ef(e,t);return encodeURIComponent(e=`${e}.${r}`)},em=(e,t)=>{let r=e;if(t)if("secure"===t)r="__Secure-"+e;else{if("host"!==t)return;r="__Host-"+e}return r},ey=(e,t,r={})=>{let n;if(n=r?.prefix==="secure"?`__Secure-${e}=${t}`:r?.prefix==="host"?`__Host-${e}=${t}`:`${e}=${t}`,e.startsWith("__Secure-")&&!r.secure&&(r.secure=!0),e.startsWith("__Host-")&&(r.secure||(r.secure=!0),"/"!==r.path&&(r.path="/"),r.domain&&(r.domain=void 0)),r&&"number"==typeof r.maxAge&&r.maxAge>=0){if(r.maxAge>3456e4)throw Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");n+=`; Max-Age=${Math.floor(r.maxAge)}`}if(r.domain&&"host"!==r.prefix&&(n+=`; Domain=${r.domain}`),r.path&&(n+=`; Path=${r.path}`),r.expires){if(r.expires.getTime()-Date.now()>3456e7)throw Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");n+=`; Expires=${r.expires.toUTCString()}`}return r.httpOnly&&(n+="; HttpOnly"),r.secure&&(n+="; Secure"),r.sameSite&&(n+=`; SameSite=${r.sameSite.charAt(0).toUpperCase()+r.sameSite.slice(1)}`),r.partitioned&&(r.secure||(r.secure=!0),n+="; Partitioned"),n},eg=(e,t,r)=>ey(e,t=encodeURIComponent(t),r),ew=async(e,t,r,n)=>ey(e,t=await eh(t,r),n);async function eb(e,t={}){let r={body:t.body,query:t.query};if(e.body){let n=await e.body["~standard"].validate(t.body);if(n.issues)return{data:null,error:eA(n.issues,"body")};r.body=n.value}if(e.query){let n=await e.query["~standard"].validate(t.query);if(n.issues)return{data:null,error:eA(n.issues,"query")};r.query=n.value}return e.requireHeaders&&!t.headers?{data:null,error:{message:"Headers is required",issues:[]}}:e.requireRequest&&!t.request?{data:null,error:{message:"Request is required",issues:[]}}:{data:r,error:null}}function eA(e,t){return{message:e.map(e=>`[${e.path?.length?`${t}.`+e.path.map(e=>"object"==typeof e?e.key:e).join("."):t}] ${e.message}`).join("; "),issues:e}}let eE=async(e,{options:t,path:r})=>{let n,i=new Headers,{data:a,error:o}=await eb(t,e);if(o)throw new X.ValidationError(o.message,o.issues);let s="headers"in e?e.headers instanceof Headers?e.headers:new Headers(e.headers):"request"in e&&ei(e.request)?e.request.headers:null,c=s?.get("cookie"),l=c?function(e){if("string"!=typeof e)throw TypeError("argument str must be a string");let t=new Map,r=0;for(;r<e.length;){let n=e.indexOf("=",r);if(-1===n)break;let i=e.indexOf(";",r);if(-1===i)i=e.length;else if(i<n){r=e.lastIndexOf(";",n-1)+1;continue}let a=e.slice(r,n).trim();if(!t.has(a)){let r=e.slice(n+1,i).trim();34===r.codePointAt(0)&&(r=r.slice(1,-1)),t.set(a,function(e){try{return e.includes("%")?decodeURIComponent(e):e}catch{return e}}(r))}r=i+1}return t}(c):void 0,d={...e,body:a.body,query:a.query,path:e.path||r||"virtual:",context:"context"in e&&e.context?e.context:{},returned:void 0,headers:e?.headers,request:e?.request,params:"params"in e?e.params:void 0,method:e.method??(Array.isArray(t.method)?t.method[0]:"*"===t.method?"GET":t.method),setHeader:(e,t)=>{i.set(e,t)},getHeader:e=>s?s.get(e):null,getCookie:(e,t)=>{let r=em(e,t);return r&&l?.get(r)||null},getSignedCookie:async(e,t,r)=>{let n=em(e,r);if(!n)return null;let i=l?.get(n);if(!i)return null;let a=i.lastIndexOf(".");if(a<1)return null;let o=i.substring(0,a),s=i.substring(a+1);return 44===s.length&&s.endsWith("=")?!!await ep(s,o,await eu(t))&&o:null},setCookie:(e,t,r)=>{let n=eg(e,t,r);return i.append("set-cookie",n),n},setSignedCookie:async(e,t,r,n)=>{let a=await ew(e,t,r,n);return i.append("set-cookie",a),a},redirect:e=>(i.set("location",e),new X.APIError("FOUND",void 0,i)),error:(e,t,r)=>new X.APIError(e,t,r),setStatus:e=>{n=e},json:(t,r)=>e.asResponse?{body:r?.body||t,routerResponse:r,_flag:"json"}:t,responseHeaders:i,get responseStatus(){return n}};for(let e of t.use||[]){let t=await e({...d,returnHeaders:!0,asResponse:!1});t.response&&Object.assign(d.context,t.response),t.headers&&t.headers.forEach((e,t)=>{d.responseHeaders.set(t,e)})}return d};function ev(e,t,r){let n="string"==typeof e?e:void 0,i="object"==typeof t?t:e,a="function"==typeof t?t:r;if(("GET"===i.method||"HEAD"===i.method)&&i.body)throw new X.BetterCallError("Body is not allowed with GET or HEAD methods");if(n&&/\/{2,}/.test(n))throw new X.BetterCallError("Path cannot contain consecutive slashes");let o=async(...e)=>{let t=e[0]||{},{data:r,error:o}=await en(eE(t,{options:i,path:n}));if(o){if(!(o instanceof X.ValidationError))throw o;throw i.onValidationError&&await i.onValidationError({message:o.message,issues:o.issues}),new X.APIError(400,{message:o.message,code:"VALIDATION_ERROR"})}let s=await a(r).catch(async e=>{if(er(e)){let r=i.onAPIError;if(r&&await r(e),t.asResponse)return e}throw e}),c=r.responseHeaders,l=r.responseStatus;return t.asResponse?ec(s,{headers:c,status:l}):t.returnHeaders?t.returnStatus?{headers:c,response:s,status:l}:{headers:c,response:s}:t.returnStatus?{response:s,status:l}:s};return o.options=i,o.path=n,o}function ek(e,t){let r=async r=>{let n="function"==typeof e?e:t,i=await eE(r,{options:"function"==typeof e?{}:e,path:"/"});if(!n)throw Error("handler must be defined");try{let e=await n(i),t=i.responseHeaders;return r.returnHeaders?{headers:t,response:e}:e}catch(e){throw er(e)&&Object.defineProperty(e,X.kAPIErrorHeaderSymbol,{enumerable:!1,configurable:!0,get:()=>i.responseHeaders}),e}};return r.options="function"==typeof e?{}:e,r}function e_(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:o,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in r||(r[t]=i[t].bind(r))}}let i=r?.Parent??Object;class a extends i{}function o(e){var t;let i=r?.Parent?new a:this;for(let r of(n(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))r();return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}ev.create=e=>(t,r,n)=>ev(t,{...r,use:[...r?.use||[],...e?.use||[]]},n),ek.create=e=>function(t,r){if("function"==typeof t)return ek({use:e?.use},t);if(!r)throw Error("Middleware handler is required");return ek({...t,method:"*",use:[...e?.use||[],...t.use||[]]},r)},Symbol("zod_brand");class eS extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ex extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(h=globalThis).__zod_globalConfig??(h.__zod_globalConfig={});let eR=globalThis.__zod_globalConfig;function eT(e){return e&&Object.assign(eR,e),eR}function eI(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function eU(e,t){return"bigint"==typeof t?t.toString():t}function eO(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function eP(e){return null==e}function eC(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function eD(e,t){let r=e/t,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}let eL=Symbol("evaluating");function e$(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==eL)return void 0===n&&(n=eL,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ez(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function eN(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function ej(e){return JSON.stringify(e)}function eH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let eB="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eq(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eM=eO(()=>{if(eR.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eV(e){if(!1===eq(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eq(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}let eK=new Set(["string","number","symbol"]),eW=new Set(["string","number","bigint","boolean","symbol","undefined"]);function eF(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eJ(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function eZ(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function eG(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function eQ(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let eY={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eX={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function e0(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function e1(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function e2(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function e5(e){return"string"==typeof e?e:e?.message}function e6(e,t,r){let n=e.message?e.message:e5(e.inst?._zod.def?.error?.(e))??e5(t?.error?.(e))??e5(r.customError?.(e))??e5(r.localeError?.(e))??"Invalid input",{inst:i,continue:a,input:o,...s}=e;return s.path??(s.path=[]),s.message=n,t?.reportInput&&(s.input=o),s}function e4(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function e8(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function e3(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function e9(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function e7(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}e.s(["BIGINT_FORMAT_RANGES",0,eX,"Class",0,class{constructor(...e){}},"NUMBER_FORMAT_RANGES",0,eY,"aborted",0,e0,"allowsEval",0,eM,"assert",0,function(e){},"assertEqual",0,function(e){return e},"assertIs",0,function(e){},"assertNever",0,function(e){throw Error("Unexpected value in exhaustive check")},"assertNotEqual",0,function(e){return e},"assignProp",0,ez,"base64ToUint8Array",0,e9,"base64urlToUint8Array",0,function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return e9(t+r)},"cached",0,eO,"captureStackTrace",0,eB,"cleanEnum",0,function(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])},"cleanRegex",0,eC,"clone",0,eJ,"cloneDef",0,function(e){return eN(e._zod.def)},"createTransparentProxy",0,function(e){let t;return new Proxy({},{get:(r,n,i)=>(t??(t=e()),Reflect.get(t,n,i)),set:(r,n,i,a)=>(t??(t=e()),Reflect.set(t,n,i,a)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,i)=>(t??(t=e()),Reflect.defineProperty(t,n,i))})},"defineLazy",0,e$,"esc",0,ej,"escapeRegex",0,eF,"explicitlyAborted",0,e1,"extend",0,function(e,t){if(!eV(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=eN(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return ez(this,"shape",r),r}});return eJ(e,n)},"finalizeIssue",0,e6,"floatSafeRemainder",0,eD,"getElementAtPath",0,function(e,t){return t?t.reduce((e,t)=>e?.[t],e):e},"getEnumValues",0,eI,"getLengthableOrigin",0,e8,"getParsedType",0,e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},"getSizableOrigin",0,e4,"hexToUint8Array",0,function(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r},"isObject",0,eq,"isPlainObject",0,eV,"issue",0,e3,"joinValues",0,function(e,t="|"){return e.map(e=>eG(e)).join(t)},"jsonStringifyReplacer",0,eU,"merge",0,function(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=eN(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return ez(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return eJ(e,r)},"mergeDefs",0,eN,"normalizeParams",0,eZ,"nullish",0,eP,"numKeys",0,function(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t},"objectClone",0,function(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))},"omit",0,function(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=eN(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return ez(this,"shape",n),n},checks:[]});return eJ(e,i)},"optionalKeys",0,eQ,"parsedType",0,function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t},"partial",0,function(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=eN(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)i[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return ez(this,"shape",i),i},checks:[]});return eJ(t,i)},"pick",0,function(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=eN(e._zod.def,{get shape(){let e={};for(let n in t){if(!(n in r.shape))throw Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return ez(this,"shape",e),e},checks:[]});return eJ(e,i)},"prefixIssues",0,e2,"primitiveTypes",0,eW,"promiseAllObject",0,function(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})},"propertyKeyTypes",0,eK,"randomString",0,function(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r},"required",0,function(e,t,r){let n=eN(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(let t in n)i[t]=new e({type:"nonoptional",innerType:n[t]});return ez(this,"shape",i),i}});return eJ(t,n)},"safeExtend",0,function(e,t){if(!eV(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=eN(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return ez(this,"shape",r),r}});return eJ(e,r)},"shallowClone",0,function(e){return eV(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e},"slugify",0,eH,"stringifyPrimitive",0,eG,"uint8ArrayToBase64",0,e7,"uint8ArrayToBase64url",0,function(e){return e7(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},"uint8ArrayToHex",0,function(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")},"unwrapMessage",0,e5],2721);let te=/^[cC][0-9a-z]{6,}$/,tt=/^[0-9a-z]+$/,tr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tn=/^[0-9a-vA-V]{20}$/,ti=/^[A-Za-z0-9]{27}$/,ta=/^[a-zA-Z0-9_-]{21}$/,to=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ts=/^([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})$/,tc=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,tl=tc(4),td=tc(6),tu=tc(7),tp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function th(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let tm=/^(?:(?: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])$/,ty=/^(([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}|:))$/,tg=e=>{let t=eF(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},tw=/^((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])$/,tb=/^(([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])$/,tA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tE=/^[A-Za-z0-9_-]*$/,tv=/^https?$/,tk=/^\+[1-9]\d{6,14}$/,t_="(?:(?:\\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])))",tS=RegExp(`^${t_}$`);function tx(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tR(e){return RegExp(`^${tx(e)}$`)}function tT(e){let t=tx({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return RegExp(`^${t_}T(?:${n})$`)}let tI=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tU=/^-?\d+n?$/,tO=/^-?\d+$/,tP=/^-?\d+(?:\.\d+)?$/,tC=/^(?:true|false)$/i,tD=/^null$/i,tL=/^undefined$/i,t$=/^[^A-Z]*$/,tz=/^[^a-z]*$/;function tN(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function tj(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let tH=tN(22,"=="),tB=tj(22),tq=tN(27,"="),tM=tj(27),tV=tN(43,"="),tK=tj(43),tW=tN(64,""),tF=tj(64),tJ=tN(86,"=="),tZ=tj(86);e.s(["base64",0,tA,"base64url",0,tE,"bigint",0,tU,"boolean",0,tC,"browserEmail",0,/^[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])?)*$/,"cidrv4",0,tw,"cidrv6",0,tb,"cuid",0,te,"cuid2",0,tt,"date",0,tS,"datetime",0,tT,"domain",0,/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,"duration",0,to,"e164",0,tk,"email",0,tp,"emoji",0,th,"extendedDuration",0,/^[-+]?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)?)??$/,"guid",0,ts,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{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])?)*\.?$/,"html5Email",0,/^[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])?)*$/,"httpProtocol",0,tv,"idnEmail",0,tf,"integer",0,tO,"ipv4",0,tm,"ipv6",0,ty,"ksuid",0,ti,"lowercase",0,t$,"mac",0,tg,"md5_base64",0,tH,"md5_base64url",0,tB,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,ta,"null",0,tD,"number",0,tP,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\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,}))$/,"sha1_base64",0,tq,"sha1_base64url",0,tM,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,tV,"sha256_base64url",0,tK,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,tW,"sha384_base64url",0,tF,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,tJ,"sha512_base64url",0,tZ,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,tI,"time",0,tR,"ulid",0,tr,"undefined",0,tL,"unicodeEmail",0,tf,"uppercase",0,tz,"uuid",0,tc,"uuid4",0,tl,"uuid6",0,td,"uuid7",0,tu,"xid",0,tn],10107);let tG=e_("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tQ={number:"number",bigint:"bigint",object:"date"},tY=e_("$ZodCheckLessThan",(e,t)=>{tG.init(e,t);let r=tQ[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<n&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tX=e_("$ZodCheckGreaterThan",(e,t)=>{tG.init(e,t);let r=tQ[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>n&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),t0=e_("$ZodCheckMultipleOf",(e,t)=>{tG.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===eD(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),t1=e_("$ZodCheckNumberFormat",(e,t)=>{tG.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,a]=eY[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=a,r&&(n.pattern=tO)}),e._zod.check=o=>{let s=o.value;if(r){if(!Number.isInteger(s))return void o.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}s<i&&o.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),t2=e_("$ZodCheckBigIntFormat",(e,t)=>{tG.init(e,t);let[r,n]=eX[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=r,i.maximum=n}),e._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>n&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),t5=e_("$ZodCheckMaxSize",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:e4(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),t6=e_("$ZodCheckMinSize",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:e4(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),t4=e_("$ZodCheckSizeEquals",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let a=i>t.size;r.issues.push({origin:e4(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),t8=e_("$ZodCheckMaxLength",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=e8(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),t3=e_("$ZodCheckMinLength",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=e8(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),t9=e_("$ZodCheckLengthEquals",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let n=r.value,i=n.length;if(i===t.length)return;let a=e8(n),o=i>t.length;r.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),t7=e_("$ZodCheckStringFormat",(e,t)=>{var r,n;tG.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),re=e_("$ZodCheckRegex",(e,t)=>{t7.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rt=e_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=t$),t7.init(e,t)}),rr=e_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tz),t7.init(e,t)}),rn=e_("$ZodCheckIncludes",(e,t)=>{tG.init(e,t);let r=eF(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),ri=e_("$ZodCheckStartsWith",(e,t)=>{tG.init(e,t);let r=RegExp(`^${eF(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ra=e_("$ZodCheckEndsWith",(e,t)=>{tG.init(e,t);let r=RegExp(`.*${eF(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});(e,t)=>{tG.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}};let ro=e_("$ZodCheckOverwrite",(e,t)=>{tG.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class rs{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let rc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,eU,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},rl=e_("$ZodError",rc),rd=e_("$ZodError",rc,{Parent:Error}),ru=e=>(t,r,n,i)=>{let a=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new eS;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>e6(e,a,eT())));throw eB(t,i?.callee),t}return o.value},rp=ru(rd),rf=e=>async(t,r,n,i)=>{let a=n?{...n,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>e6(e,a,eT())));throw eB(t,i?.callee),t}return o.value},rh=rf(rd),rm=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new eS;return a.issues.length?{success:!1,error:new(e??rl)(a.issues.map(e=>e6(e,i,eT())))}:{success:!0,data:a.value}},ry=rm(rd),rg=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>e6(e,i,eT())))}:{success:!0,data:a.value}},rw=rg(rd),rb={major:4,minor:4,patch:3},rA=e_("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rb;let n=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&n.unshift(e),n))for(let r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let n,i=e0(e);for(let a of t){if(a._zod.def.when){if(e1(e)||!a._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&r?.async===!1)throw new eS;if(n||o instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(i||(i=e0(e,t)))});else{if(e.issues.length===t)continue;i||(i=e0(e,t))}}return n?n.then(()=>e):e},r=(r,i,a)=>{if(e0(r))return r.aborted=!0,r;let o=t(i,n,a);if(o instanceof Promise){if(!1===a.async)throw new eS;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if("backward"===a.direction){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,i,a)):r(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(!1===a.async)throw new eS;return o.then(e=>t(e,n,a))}return t(o,n,a)}}e$(e,"~standard",()=>({validate:t=>{try{let r=ry(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return rw(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),rE=e_("$ZodString",(e,t)=>{rA.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??tI(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),rv=e_("$ZodStringFormat",(e,t)=>{t7.init(e,t),rE.init(e,t)}),rk=e_("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ts),rv.init(e,t)}),r_=e_("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tc(e))}else t.pattern??(t.pattern=tc());rv.init(e,t)}),rS=e_("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tp),rv.init(e,t)}),rx=e_("$ZodURL",(e,t)=>{rv.init(e,t),e._zod.check=r=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===tv.source&&!/^https?:\/\//i.test(n))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),rR=e_("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=th()),rv.init(e,t)}),rT=e_("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ta),rv.init(e,t)}),rI=e_("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=te),rv.init(e,t)}),rU=e_("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tt),rv.init(e,t)}),rO=e_("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tr),rv.init(e,t)}),rP=e_("$ZodXID",(e,t)=>{t.pattern??(t.pattern=tn),rv.init(e,t)}),rC=e_("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ti),rv.init(e,t)}),rD=e_("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tT(t)),rv.init(e,t)}),rL=e_("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tS),rv.init(e,t)}),r$=e_("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=tR(t)),rv.init(e,t)}),rz=e_("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=to),rv.init(e,t)}),rN=e_("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tm),rv.init(e,t),e._zod.bag.format="ipv4"}),rj=e_("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ty),rv.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),rH=((e,t)=>{t.pattern??(t.pattern=tg(t.delimiter)),rv.init(e,t),e._zod.bag.format="mac"},e_("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tw),rv.init(e,t)})),rB=e_("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tb),rv.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(2!==n.length)throw Error();let[e,t]=n;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function rq(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let rM=e_("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tA),rv.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{rq(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),rV=e_("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=tE),rv.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{!function(e){if(!tE.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return rq(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),rK=e_("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tk),rv.init(e,t)}),rW=e_("$ZodJWT",(e,t)=>{rv.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),rF=((e,t)=>{rv.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}},e_("$ZodNumber",(e,t)=>{rA.init(e,t),e._zod.pattern=e._zod.bag.pattern??tP,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}})),rJ=e_("$ZodNumberFormat",(e,t)=>{t1.init(e,t),rF.init(e,t)}),rZ=e_("$ZodBoolean",(e,t)=>{rA.init(e,t),e._zod.pattern=tC,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),rG=e_("$ZodBigInt",(e,t)=>{rA.init(e,t),e._zod.pattern=tU,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),rQ=((e,t)=>{t2.init(e,t),rG.init(e,t)},e_("$ZodAny",(e,t)=>{rA.init(e,t),e._zod.parse=e=>e})),rY=e_("$ZodUnknown",(e,t)=>{rA.init(e,t),e._zod.parse=e=>e}),rX=e_("$ZodNever",(e,t)=>{rA.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),r0=((e,t)=>{rA.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}},e_("$ZodDate",(e,t)=>{rA.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),r}}));function r1(e,t,r){e.issues.length&&t.issues.push(...e2(r,e.issues)),t.value[r]=e.value}let r2=e_("$ZodArray",(e,t)=>{rA.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},n);s instanceof Promise?a.push(s.then(t=>r1(t,r,e))):r1(s,r,e)}return a.length?Promise.all(a).then(()=>r):r}});function r5(e,t,r,n,i,a){let o=r in n;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...e2(r,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?o&&(t.value[r]=void 0):t.value[r]=e.value}function r6(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=eQ(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function r4(e,t,r,n,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,d="optional"===c.optin,u="optional"===c.optout;for(let i in t){if("__proto__"===i||s.has(i))continue;if("never"===l){o.push(i);continue}let a=c.run({value:t[i],issues:[]},n);a instanceof Promise?e.push(a.then(e=>r5(e,r,i,t,d,u))):r5(a,r,i,t,d,u)}return(o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length)?Promise.all(e).then(()=>r):r}let r8=e_("$ZodObject",(e,t)=>{let r;rA.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let i=eO(()=>r6(t));e$(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(r[t]??(r[t]=new Set),n.values))r[t].add(e)}return r});let a=t.catchall;e._zod.parse=(t,n)=>{r??(r=i.value);let o=t.value;if(!eq(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};let s=[],c=r.shape;for(let e of r.keys){let r=c[e],i="optional"===r._zod.optin,a="optional"===r._zod.optout,l=r._zod.run({value:o[e],issues:[]},n);l instanceof Promise?s.push(l.then(r=>r5(r,t,e,o,i,a))):r5(l,t,e,o,i,a)}return a?r4(s,o,t,n,i.value,e):s.length?Promise.all(s).then(()=>t):t}}),r3=e_("$ZodObjectJIT",(e,t)=>{let r,n;r8.init(e,t);let i=e._zod.parse,a=eO(()=>r6(t)),o=!eR.jitless,s=o&&eM.value,c=t.catchall;e._zod.parse=(l,d)=>{n??(n=a.value);let u=l.value;return eq(u)?o&&s&&d?.async===!1&&!0!==d.jitless?(r||(r=(e=>{let t=new rs(["shape","payload","ctx"]),r=a.value,n=e=>{let t=ej(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),o=0;for(let e of r.keys)i[e]=`key_${o++}`;for(let a of(t.write("const newResult = {};"),r.keys)){let r=i[a],o=ej(a),s=e[a],c=s?._zod?.optin==="optional",l=s?._zod?.optout==="optional";t.write(`const ${r} = ${n(a)};`),c&&l?t.write(`
|
|
1
|
+
module.exports=[2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},60526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},44733,e=>{"use strict";let t,r,n,i,a,o,s,c,l,d,u;var p,f,h,m,y=e.i(56710),g=e.i(82809),w=e.i(74001),b=e.i(73300),A=e.i(68744),E=e.i(98570),v=e.i(56147),k=e.i(32931),_=e.i(61810),S=e.i(59963),x=e.i(44491),R=e.i(74916),T=e.i(33073),I=e.i(98603),U=e.i(93317),O=e.i(93695);e.i(95533);var P=e.i(75616);function C(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch{return e}}function D(e){if(!e)return[];let t=[],r=0,n=0;for(;n<e.length;){if(","===e[n]){let i=n+1;for(;i<e.length&&" "===e[i];)i++;for(;i<e.length&&"="!==e[i]&&";"!==e[i]&&","!==e[i];)i++;if(i<e.length&&"="===e[i]){let i=e.slice(r,n).trim();for(i&&t.push(i),r=n+1;r<e.length&&" "===e[r];)r++;n=r;continue}}n++}let i=e.slice(r).trim();return i&&t.push(i),t}let L=/^[\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E\x5F\x60\x61-\x7A\x7C\x7E]+$/,$=/^[\x20\x21\x23-\x3A\x3C-\x5B\x5D-\x7E]*$/;function z(e){return!(e.length<2)&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function N(e){let t=0,r=e.length;for(;t<r;){let r=e.charCodeAt(t);if(32!==r&&9!==r)break;t++}for(;r>t;){let t=e.charCodeAt(r-1);if(32!==t&&9!==t)break;r--}return 0===t&&r===e.length?e:e.slice(t,r)}function j(e){let t=new Map;if(e.length<2)return t;for(let r of e.split(";")){let e=r.indexOf("=");if(-1===e)continue;let n=N(r.slice(0,e)),i=z(N(r.slice(e+1)));L.test(n)&&$.test(i)&&t.set(n,C(i))}return t}var H=e.i(10469),B=e.i(15705);let q=async()=>{let e=(0,H.__getBetterAuthGlobal)();if(!e.context.requestStateAsyncStorage){let t=await (0,B.getAsyncLocalStorage)();e.context.requestStateAsyncStorage=new t}return e.context.requestStateAsyncStorage};async function M(){return void 0!==(await q()).getStore()}async function V(){let e=(await q()).getStore();if(!e)throw Error("No request state found. Please make sure you are calling this function within a `runWithRequestState` callback.");return e}async function K(e,t){return(await q()).run(e,t)}function W(e){let t=Object.freeze({});return{get ref(){return t},async get(){let r=await V();if(!r.has(t)){let n=await e();return r.set(t,n),n}return r.get(t)},async set(e){(await V()).set(t,e)}}}let{get:F,set:J}=W(()=>!1),Z=async()=>{let e=(0,H.__getBetterAuthGlobal)();if(!e.context.endpointContextAsyncStorage){let t=await (0,B.getAsyncLocalStorage)();e.context.endpointContextAsyncStorage=new t}return e.context.endpointContextAsyncStorage};async function G(){let e=(await Z()).getStore();if(!e)throw Error("No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback.");return e}async function Q(e,t){return(await Z()).run(e,t)}var Y=e.i(36004),X=e.i(58461);let ee=/^application\/([a-z0-9.+-]*\+)?json/i;async function et(e,t){let r=e.headers.get("content-type")||"",n=r.toLowerCase();if(e.body){if(t&&t.length>0&&!t.some(e=>{let t=n.split(";")[0].trim(),r=e.toLowerCase().trim();return t===r||t.includes(r)})){if(!n)throw new X.APIError(415,{message:`Content-Type is required. Allowed types: ${t.join(", ")}`,code:"UNSUPPORTED_MEDIA_TYPE"});throw new X.APIError(415,{message:`Content-Type "${r}" is not allowed. Allowed types: ${t.join(", ")}`,code:"UNSUPPORTED_MEDIA_TYPE"})}if(ee.test(n))try{return await e.json()}catch(e){if(e instanceof SyntaxError)throw new X.APIError(400,{message:"Invalid JSON in request body",code:"BAD_REQUEST"});throw e}if(n.includes("application/x-www-form-urlencoded")){let t=await e.formData(),r={};return t.forEach((e,t)=>{r[t]=e.toString()}),r}if(n.includes("multipart/form-data")){let t=await e.formData(),r={};return t.forEach((e,t)=>{r[t]=e}),r}return n.includes("text/plain")?await e.text():n.includes("application/octet-stream")?await e.arrayBuffer():n.includes("application/pdf")||n.includes("image/")||n.includes("video/")?await e.blob():n.includes("application/stream")||e.body instanceof ReadableStream?e.body:await e.text()}}function er(e){return e instanceof X.APIError||e?.name==="APIError"}async function en(e){try{return{data:await e,error:null}}catch(e){return{data:null,error:e}}}function ei(e){return e instanceof Request||"[object Request]"===Object.prototype.toString.call(e)}let ea=new Set(["host","user-agent","referer","from","expect","authorization","proxy-authorization","cookie","origin","accept-charset","accept-encoding","accept-language","if-match","if-none-match","if-modified-since","if-unmodified-since","if-range","range","max-forwards","connection","keep-alive","transfer-encoding","te","upgrade","trailer","proxy-connection","content-length"]);function eo(e){for(let t of ea)e.delete(t)}function es(e,t){if(t)for(let[r,n]of new Headers(t).entries())"set-cookie"===r.toLowerCase()?e.append(r,n):e.set(r,n)}function ec(e,t){if(e instanceof Response){if(t?.headers){let r=new Headers(t.headers);eo(r),es(e.headers,r)}return e}if(e&&"object"==typeof e&&"_flag"in e&&"json"===e._flag){let r=e.body,n=e.routerResponse;if(n instanceof Response)return n;let i=new Headers;if(es(i,n?.headers),es(i,e.headers),t?.headers){let e=new Headers(t.headers);eo(e),es(i,e)}return i.set("Content-Type","application/json"),new Response(JSON.stringify(r),{...n,headers:i,status:e.status??t?.status??n?.status,statusText:t?.statusText??n?.statusText})}if(er(e))return ec(e.body,{status:t?.status??e.statusCode,statusText:e.status.toString(),headers:t?.headers||e.headers});let r=e,n=new Headers(t?.headers);if(eo(n),e){if("string"==typeof e)r=e,n.set("Content-Type","text/plain");else if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))r=e,n.set("Content-Type","application/octet-stream");else if(e instanceof Blob)r=e,n.set("Content-Type",e.type||"application/octet-stream");else if(e instanceof FormData)r=e;else if(e instanceof URLSearchParams)r=e,n.set("Content-Type","application/x-www-form-urlencoded");else if(e instanceof ReadableStream)r=e,n.set("Content-Type","application/octet-stream");else if(function(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}(e)){let t,i,a;t=new WeakMap,i=new WeakMap,a=0,r=JSON.stringify(e,function(e,r){if("bigint"==typeof r)return r.toString();if("object"==typeof r&&null!==r){if(((e,r)=>{let n=r;for(;n;){if(n===e)return!0;n=t.get(n)}return!1})(r,this))return`[Circular ref-${i.get(r)}]`;t.set(r,this),i.has(r)||i.set(r,a++)}return r}),n.set("Content-Type","application/json")}}else null===e&&(r=JSON.stringify(null)),n.set("content-type","application/json");return new Response(r,{...t,headers:n})}function el(){let e="u">typeof globalThis&&globalThis.crypto;if(e&&"object"==typeof e.subtle&&null!=e.subtle)return e.subtle;throw Error("crypto.subtle must be defined")}let ed={name:"HMAC",hash:"SHA-256"},eu=async e=>{let t="string"==typeof e?new TextEncoder().encode(e):e;return await el().importKey("raw",t,ed,!1,["sign","verify"])},ep=async(e,t,r)=>{try{let n=atob(e),i=new Uint8Array(n.length);for(let e=0,t=n.length;e<t;e++)i[e]=n.charCodeAt(e);return await el().verify(ed,r,i,new TextEncoder().encode(t))}catch(e){return!1}},ef=async(e,t)=>{let r=await eu(t);return btoa(String.fromCharCode(...new Uint8Array(await el().sign(ed.name,r,new TextEncoder().encode(e)))))},eh=async(e,t)=>{let r=await ef(e,t);return encodeURIComponent(e=`${e}.${r}`)},em=(e,t)=>{let r=e;if(t)if("secure"===t)r="__Secure-"+e;else{if("host"!==t)return;r="__Host-"+e}return r},ey=(e,t,r={})=>{let n;if(n=r?.prefix==="secure"?`__Secure-${e}=${t}`:r?.prefix==="host"?`__Host-${e}=${t}`:`${e}=${t}`,e.startsWith("__Secure-")&&!r.secure&&(r.secure=!0),e.startsWith("__Host-")&&(r.secure||(r.secure=!0),"/"!==r.path&&(r.path="/"),r.domain&&(r.domain=void 0)),r&&"number"==typeof r.maxAge&&r.maxAge>=0){if(r.maxAge>3456e4)throw Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");n+=`; Max-Age=${Math.floor(r.maxAge)}`}if(r.domain&&"host"!==r.prefix&&(n+=`; Domain=${r.domain}`),r.path&&(n+=`; Path=${r.path}`),r.expires){if(r.expires.getTime()-Date.now()>3456e7)throw Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");n+=`; Expires=${r.expires.toUTCString()}`}return r.httpOnly&&(n+="; HttpOnly"),r.secure&&(n+="; Secure"),r.sameSite&&(n+=`; SameSite=${r.sameSite.charAt(0).toUpperCase()+r.sameSite.slice(1)}`),r.partitioned&&(r.secure||(r.secure=!0),n+="; Partitioned"),n},eg=(e,t,r)=>ey(e,t=encodeURIComponent(t),r),ew=async(e,t,r,n)=>ey(e,t=await eh(t,r),n);async function eb(e,t={}){let r={body:t.body,query:t.query};if(e.body){let n=await e.body["~standard"].validate(t.body);if(n.issues)return{data:null,error:eA(n.issues,"body")};r.body=n.value}if(e.query){let n=await e.query["~standard"].validate(t.query);if(n.issues)return{data:null,error:eA(n.issues,"query")};r.query=n.value}return e.requireHeaders&&!t.headers?{data:null,error:{message:"Headers is required",issues:[]}}:e.requireRequest&&!t.request?{data:null,error:{message:"Request is required",issues:[]}}:{data:r,error:null}}function eA(e,t){return{message:e.map(e=>`[${e.path?.length?`${t}.`+e.path.map(e=>"object"==typeof e?e.key:e).join("."):t}] ${e.message}`).join("; "),issues:e}}let eE=async(e,{options:t,path:r})=>{let n,i=new Headers,{data:a,error:o}=await eb(t,e);if(o)throw new X.ValidationError(o.message,o.issues);let s="headers"in e?e.headers instanceof Headers?e.headers:new Headers(e.headers):"request"in e&&ei(e.request)?e.request.headers:null,c=s?.get("cookie"),l=c?function(e){if("string"!=typeof e)throw TypeError("argument str must be a string");let t=new Map,r=0;for(;r<e.length;){let n=e.indexOf("=",r);if(-1===n)break;let i=e.indexOf(";",r);if(-1===i)i=e.length;else if(i<n){r=e.lastIndexOf(";",n-1)+1;continue}let a=e.slice(r,n).trim();if(!t.has(a)){let r=e.slice(n+1,i).trim();34===r.codePointAt(0)&&(r=r.slice(1,-1)),t.set(a,function(e){try{return e.includes("%")?decodeURIComponent(e):e}catch{return e}}(r))}r=i+1}return t}(c):void 0,d={...e,body:a.body,query:a.query,path:e.path||r||"virtual:",context:"context"in e&&e.context?e.context:{},returned:void 0,headers:e?.headers,request:e?.request,params:"params"in e?e.params:void 0,method:e.method??(Array.isArray(t.method)?t.method[0]:"*"===t.method?"GET":t.method),setHeader:(e,t)=>{i.set(e,t)},getHeader:e=>s?s.get(e):null,getCookie:(e,t)=>{let r=em(e,t);return r&&l?.get(r)||null},getSignedCookie:async(e,t,r)=>{let n=em(e,r);if(!n)return null;let i=l?.get(n);if(!i)return null;let a=i.lastIndexOf(".");if(a<1)return null;let o=i.substring(0,a),s=i.substring(a+1);return 44===s.length&&s.endsWith("=")?!!await ep(s,o,await eu(t))&&o:null},setCookie:(e,t,r)=>{let n=eg(e,t,r);return i.append("set-cookie",n),n},setSignedCookie:async(e,t,r,n)=>{let a=await ew(e,t,r,n);return i.append("set-cookie",a),a},redirect:e=>(i.set("location",e),new X.APIError("FOUND",void 0,i)),error:(e,t,r)=>new X.APIError(e,t,r),setStatus:e=>{n=e},json:(t,r)=>e.asResponse?{body:r?.body||t,routerResponse:r,_flag:"json"}:t,responseHeaders:i,get responseStatus(){return n}};for(let e of t.use||[]){let t=await e({...d,returnHeaders:!0,asResponse:!1});t.response&&Object.assign(d.context,t.response),t.headers&&t.headers.forEach((e,t)=>{d.responseHeaders.set(t,e)})}return d};function ev(e,t,r){let n="string"==typeof e?e:void 0,i="object"==typeof t?t:e,a="function"==typeof t?t:r;if(("GET"===i.method||"HEAD"===i.method)&&i.body)throw new X.BetterCallError("Body is not allowed with GET or HEAD methods");if(n&&/\/{2,}/.test(n))throw new X.BetterCallError("Path cannot contain consecutive slashes");let o=async(...e)=>{let t=e[0]||{},{data:r,error:o}=await en(eE(t,{options:i,path:n}));if(o){if(!(o instanceof X.ValidationError))throw o;throw i.onValidationError&&await i.onValidationError({message:o.message,issues:o.issues}),new X.APIError(400,{message:o.message,code:"VALIDATION_ERROR"})}let s=await a(r).catch(async e=>{if(er(e)){let r=i.onAPIError;if(r&&await r(e),t.asResponse)return e}throw e}),c=r.responseHeaders,l=r.responseStatus;return t.asResponse?ec(s,{headers:c,status:l}):t.returnHeaders?t.returnStatus?{headers:c,response:s,status:l}:{headers:c,response:s}:t.returnStatus?{response:s,status:l}:s};return o.options=i,o.path=n,o}function ek(e,t){let r=async r=>{let n="function"==typeof e?e:t,i=await eE(r,{options:"function"==typeof e?{}:e,path:"/"});if(!n)throw Error("handler must be defined");try{let e=await n(i),t=i.responseHeaders;return r.returnHeaders?{headers:t,response:e}:e}catch(e){throw er(e)&&Object.defineProperty(e,X.kAPIErrorHeaderSymbol,{enumerable:!1,configurable:!0,get:()=>i.responseHeaders}),e}};return r.options="function"==typeof e?{}:e,r}function e_(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:o,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in r||(r[t]=i[t].bind(r))}}let i=r?.Parent??Object;class a extends i{}function o(e){var t;let i=r?.Parent?new a:this;for(let r of(n(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))r();return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}ev.create=e=>(t,r,n)=>ev(t,{...r,use:[...r?.use||[],...e?.use||[]]},n),ek.create=e=>function(t,r){if("function"==typeof t)return ek({use:e?.use},t);if(!r)throw Error("Middleware handler is required");return ek({...t,method:"*",use:[...e?.use||[],...t.use||[]]},r)},Symbol("zod_brand");class eS extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ex extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(h=globalThis).__zod_globalConfig??(h.__zod_globalConfig={});let eR=globalThis.__zod_globalConfig;function eT(e){return e&&Object.assign(eR,e),eR}function eI(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function eU(e,t){return"bigint"==typeof t?t.toString():t}function eO(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function eP(e){return null==e}function eC(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function eD(e,t){let r=e/t,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}let eL=Symbol("evaluating");function e$(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==eL)return void 0===n&&(n=eL,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ez(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function eN(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function ej(e){return JSON.stringify(e)}function eH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let eB="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eq(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eM=eO(()=>{if(eR.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eV(e){if(!1===eq(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eq(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}let eK=new Set(["string","number","symbol"]),eW=new Set(["string","number","bigint","boolean","symbol","undefined"]);function eF(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eJ(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function eZ(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function eG(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function eQ(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let eY={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eX={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function e0(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function e1(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function e2(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function e5(e){return"string"==typeof e?e:e?.message}function e6(e,t,r){let n=e.message?e.message:e5(e.inst?._zod.def?.error?.(e))??e5(t?.error?.(e))??e5(r.customError?.(e))??e5(r.localeError?.(e))??"Invalid input",{inst:i,continue:a,input:o,...s}=e;return s.path??(s.path=[]),s.message=n,t?.reportInput&&(s.input=o),s}function e4(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function e8(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function e3(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function e9(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function e7(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}e.s(["BIGINT_FORMAT_RANGES",0,eX,"Class",0,class{constructor(...e){}},"NUMBER_FORMAT_RANGES",0,eY,"aborted",0,e0,"allowsEval",0,eM,"assert",0,function(e){},"assertEqual",0,function(e){return e},"assertIs",0,function(e){},"assertNever",0,function(e){throw Error("Unexpected value in exhaustive check")},"assertNotEqual",0,function(e){return e},"assignProp",0,ez,"base64ToUint8Array",0,e9,"base64urlToUint8Array",0,function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return e9(t+r)},"cached",0,eO,"captureStackTrace",0,eB,"cleanEnum",0,function(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])},"cleanRegex",0,eC,"clone",0,eJ,"cloneDef",0,function(e){return eN(e._zod.def)},"createTransparentProxy",0,function(e){let t;return new Proxy({},{get:(r,n,i)=>(t??(t=e()),Reflect.get(t,n,i)),set:(r,n,i,a)=>(t??(t=e()),Reflect.set(t,n,i,a)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,i)=>(t??(t=e()),Reflect.defineProperty(t,n,i))})},"defineLazy",0,e$,"esc",0,ej,"escapeRegex",0,eF,"explicitlyAborted",0,e1,"extend",0,function(e,t){if(!eV(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=eN(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return ez(this,"shape",r),r}});return eJ(e,n)},"finalizeIssue",0,e6,"floatSafeRemainder",0,eD,"getElementAtPath",0,function(e,t){return t?t.reduce((e,t)=>e?.[t],e):e},"getEnumValues",0,eI,"getLengthableOrigin",0,e8,"getParsedType",0,e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},"getSizableOrigin",0,e4,"hexToUint8Array",0,function(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r},"isObject",0,eq,"isPlainObject",0,eV,"issue",0,e3,"joinValues",0,function(e,t="|"){return e.map(e=>eG(e)).join(t)},"jsonStringifyReplacer",0,eU,"merge",0,function(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=eN(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return ez(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return eJ(e,r)},"mergeDefs",0,eN,"normalizeParams",0,eZ,"nullish",0,eP,"numKeys",0,function(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t},"objectClone",0,function(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))},"omit",0,function(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=eN(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return ez(this,"shape",n),n},checks:[]});return eJ(e,i)},"optionalKeys",0,eQ,"parsedType",0,function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t},"partial",0,function(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=eN(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)i[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return ez(this,"shape",i),i},checks:[]});return eJ(t,i)},"pick",0,function(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=eN(e._zod.def,{get shape(){let e={};for(let n in t){if(!(n in r.shape))throw Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return ez(this,"shape",e),e},checks:[]});return eJ(e,i)},"prefixIssues",0,e2,"primitiveTypes",0,eW,"promiseAllObject",0,function(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})},"propertyKeyTypes",0,eK,"randomString",0,function(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r},"required",0,function(e,t,r){let n=eN(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(let t in n)i[t]=new e({type:"nonoptional",innerType:n[t]});return ez(this,"shape",i),i}});return eJ(t,n)},"safeExtend",0,function(e,t){if(!eV(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=eN(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return ez(this,"shape",r),r}});return eJ(e,r)},"shallowClone",0,function(e){return eV(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e},"slugify",0,eH,"stringifyPrimitive",0,eG,"uint8ArrayToBase64",0,e7,"uint8ArrayToBase64url",0,function(e){return e7(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},"uint8ArrayToHex",0,function(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")},"unwrapMessage",0,e5],2721);let te=/^[cC][0-9a-z]{6,}$/,tt=/^[0-9a-z]+$/,tr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tn=/^[0-9a-vA-V]{20}$/,ti=/^[A-Za-z0-9]{27}$/,ta=/^[a-zA-Z0-9_-]{21}$/,to=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ts=/^([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})$/,tc=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,tl=tc(4),td=tc(6),tu=tc(7),tp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function th(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let tm=/^(?:(?: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])$/,ty=/^(([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}|:))$/,tg=e=>{let t=eF(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},tw=/^((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])$/,tb=/^(([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])$/,tA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tE=/^[A-Za-z0-9_-]*$/,tv=/^https?$/,tk=/^\+[1-9]\d{6,14}$/,t_="(?:(?:\\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])))",tS=RegExp(`^${t_}$`);function tx(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tR(e){return RegExp(`^${tx(e)}$`)}function tT(e){let t=tx({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return RegExp(`^${t_}T(?:${n})$`)}let tI=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tU=/^-?\d+n?$/,tO=/^-?\d+$/,tP=/^-?\d+(?:\.\d+)?$/,tC=/^(?:true|false)$/i,tD=/^null$/i,tL=/^undefined$/i,t$=/^[^A-Z]*$/,tz=/^[^a-z]*$/;function tN(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function tj(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let tH=tN(22,"=="),tB=tj(22),tq=tN(27,"="),tM=tj(27),tV=tN(43,"="),tK=tj(43),tW=tN(64,""),tF=tj(64),tJ=tN(86,"=="),tZ=tj(86);e.s(["base64",0,tA,"base64url",0,tE,"bigint",0,tU,"boolean",0,tC,"browserEmail",0,/^[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])?)*$/,"cidrv4",0,tw,"cidrv6",0,tb,"cuid",0,te,"cuid2",0,tt,"date",0,tS,"datetime",0,tT,"domain",0,/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,"duration",0,to,"e164",0,tk,"email",0,tp,"emoji",0,th,"extendedDuration",0,/^[-+]?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)?)??$/,"guid",0,ts,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{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])?)*\.?$/,"html5Email",0,/^[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])?)*$/,"httpProtocol",0,tv,"idnEmail",0,tf,"integer",0,tO,"ipv4",0,tm,"ipv6",0,ty,"ksuid",0,ti,"lowercase",0,t$,"mac",0,tg,"md5_base64",0,tH,"md5_base64url",0,tB,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,ta,"null",0,tD,"number",0,tP,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\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,}))$/,"sha1_base64",0,tq,"sha1_base64url",0,tM,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,tV,"sha256_base64url",0,tK,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,tW,"sha384_base64url",0,tF,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,tJ,"sha512_base64url",0,tZ,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,tI,"time",0,tR,"ulid",0,tr,"undefined",0,tL,"unicodeEmail",0,tf,"uppercase",0,tz,"uuid",0,tc,"uuid4",0,tl,"uuid6",0,td,"uuid7",0,tu,"xid",0,tn],10107);let tG=e_("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tQ={number:"number",bigint:"bigint",object:"date"},tY=e_("$ZodCheckLessThan",(e,t)=>{tG.init(e,t);let r=tQ[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<n&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tX=e_("$ZodCheckGreaterThan",(e,t)=>{tG.init(e,t);let r=tQ[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>n&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),t0=e_("$ZodCheckMultipleOf",(e,t)=>{tG.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===eD(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),t1=e_("$ZodCheckNumberFormat",(e,t)=>{tG.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,a]=eY[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=a,r&&(n.pattern=tO)}),e._zod.check=o=>{let s=o.value;if(r){if(!Number.isInteger(s))return void o.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}s<i&&o.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),t2=e_("$ZodCheckBigIntFormat",(e,t)=>{tG.init(e,t);let[r,n]=eX[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=r,i.maximum=n}),e._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>n&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),t5=e_("$ZodCheckMaxSize",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:e4(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),t6=e_("$ZodCheckMinSize",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:e4(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),t4=e_("$ZodCheckSizeEquals",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let a=i>t.size;r.issues.push({origin:e4(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),t8=e_("$ZodCheckMaxLength",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=e8(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),t3=e_("$ZodCheckMinLength",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=e8(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),t9=e_("$ZodCheckLengthEquals",(e,t)=>{var r;tG.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!eP(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let n=r.value,i=n.length;if(i===t.length)return;let a=e8(n),o=i>t.length;r.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),t7=e_("$ZodCheckStringFormat",(e,t)=>{var r,n;tG.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),re=e_("$ZodCheckRegex",(e,t)=>{t7.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rt=e_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=t$),t7.init(e,t)}),rr=e_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tz),t7.init(e,t)}),rn=e_("$ZodCheckIncludes",(e,t)=>{tG.init(e,t);let r=eF(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),ri=e_("$ZodCheckStartsWith",(e,t)=>{tG.init(e,t);let r=RegExp(`^${eF(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ra=e_("$ZodCheckEndsWith",(e,t)=>{tG.init(e,t);let r=RegExp(`.*${eF(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});(e,t)=>{tG.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}};let ro=e_("$ZodCheckOverwrite",(e,t)=>{tG.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class rs{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let rc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,eU,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},rl=e_("$ZodError",rc),rd=e_("$ZodError",rc,{Parent:Error}),ru=e=>(t,r,n,i)=>{let a=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new eS;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>e6(e,a,eT())));throw eB(t,i?.callee),t}return o.value},rp=ru(rd),rf=e=>async(t,r,n,i)=>{let a=n?{...n,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>e6(e,a,eT())));throw eB(t,i?.callee),t}return o.value},rh=rf(rd),rm=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new eS;return a.issues.length?{success:!1,error:new(e??rl)(a.issues.map(e=>e6(e,i,eT())))}:{success:!0,data:a.value}},ry=rm(rd),rg=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>e6(e,i,eT())))}:{success:!0,data:a.value}},rw=rg(rd),rb={major:4,minor:4,patch:3},rA=e_("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rb;let n=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&n.unshift(e),n))for(let r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let n,i=e0(e);for(let a of t){if(a._zod.def.when){if(e1(e)||!a._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&r?.async===!1)throw new eS;if(n||o instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(i||(i=e0(e,t)))});else{if(e.issues.length===t)continue;i||(i=e0(e,t))}}return n?n.then(()=>e):e},r=(r,i,a)=>{if(e0(r))return r.aborted=!0,r;let o=t(i,n,a);if(o instanceof Promise){if(!1===a.async)throw new eS;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if("backward"===a.direction){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,i,a)):r(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(!1===a.async)throw new eS;return o.then(e=>t(e,n,a))}return t(o,n,a)}}e$(e,"~standard",()=>({validate:t=>{try{let r=ry(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return rw(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),rE=e_("$ZodString",(e,t)=>{rA.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??tI(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),rv=e_("$ZodStringFormat",(e,t)=>{t7.init(e,t),rE.init(e,t)}),rk=e_("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ts),rv.init(e,t)}),r_=e_("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tc(e))}else t.pattern??(t.pattern=tc());rv.init(e,t)}),rS=e_("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tp),rv.init(e,t)}),rx=e_("$ZodURL",(e,t)=>{rv.init(e,t),e._zod.check=r=>{try{let n=r.value.trim();if(!t.normalize&&t.protocol?.source===tv.source&&!/^https?:\/\//i.test(n))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),rR=e_("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=th()),rv.init(e,t)}),rT=e_("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ta),rv.init(e,t)}),rI=e_("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=te),rv.init(e,t)}),rU=e_("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tt),rv.init(e,t)}),rO=e_("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tr),rv.init(e,t)}),rP=e_("$ZodXID",(e,t)=>{t.pattern??(t.pattern=tn),rv.init(e,t)}),rC=e_("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ti),rv.init(e,t)}),rD=e_("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tT(t)),rv.init(e,t)}),rL=e_("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tS),rv.init(e,t)}),r$=e_("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=tR(t)),rv.init(e,t)}),rz=e_("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=to),rv.init(e,t)}),rN=e_("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tm),rv.init(e,t),e._zod.bag.format="ipv4"}),rj=e_("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ty),rv.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),rH=((e,t)=>{t.pattern??(t.pattern=tg(t.delimiter)),rv.init(e,t),e._zod.bag.format="mac"},e_("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tw),rv.init(e,t)})),rB=e_("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tb),rv.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(2!==n.length)throw Error();let[e,t]=n;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function rq(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let rM=e_("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tA),rv.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{rq(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),rV=e_("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=tE),rv.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{!function(e){if(!tE.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return rq(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),rK=e_("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tk),rv.init(e,t)}),rW=e_("$ZodJWT",(e,t)=>{rv.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),rF=((e,t)=>{rv.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}},e_("$ZodNumber",(e,t)=>{rA.init(e,t),e._zod.pattern=e._zod.bag.pattern??tP,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}})),rJ=e_("$ZodNumberFormat",(e,t)=>{t1.init(e,t),rF.init(e,t)}),rZ=e_("$ZodBoolean",(e,t)=>{rA.init(e,t),e._zod.pattern=tC,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),rG=e_("$ZodBigInt",(e,t)=>{rA.init(e,t),e._zod.pattern=tU,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),rQ=((e,t)=>{t2.init(e,t),rG.init(e,t)},e_("$ZodAny",(e,t)=>{rA.init(e,t),e._zod.parse=e=>e})),rY=e_("$ZodUnknown",(e,t)=>{rA.init(e,t),e._zod.parse=e=>e}),rX=e_("$ZodNever",(e,t)=>{rA.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),r0=((e,t)=>{rA.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}},e_("$ZodDate",(e,t)=>{rA.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),r}}));function r1(e,t,r){e.issues.length&&t.issues.push(...e2(r,e.issues)),t.value[r]=e.value}let r2=e_("$ZodArray",(e,t)=>{rA.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},n);s instanceof Promise?a.push(s.then(t=>r1(t,r,e))):r1(s,r,e)}return a.length?Promise.all(a).then(()=>r):r}});function r5(e,t,r,n,i,a){let o=r in n;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...e2(r,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?o&&(t.value[r]=void 0):t.value[r]=e.value}function r6(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=eQ(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function r4(e,t,r,n,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,d="optional"===c.optin,u="optional"===c.optout;for(let i in t){if("__proto__"===i||s.has(i))continue;if("never"===l){o.push(i);continue}let a=c.run({value:t[i],issues:[]},n);a instanceof Promise?e.push(a.then(e=>r5(e,r,i,t,d,u))):r5(a,r,i,t,d,u)}return(o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length)?Promise.all(e).then(()=>r):r}let r8=e_("$ZodObject",(e,t)=>{let r;rA.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let i=eO(()=>r6(t));e$(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(r[t]??(r[t]=new Set),n.values))r[t].add(e)}return r});let a=t.catchall;e._zod.parse=(t,n)=>{r??(r=i.value);let o=t.value;if(!eq(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};let s=[],c=r.shape;for(let e of r.keys){let r=c[e],i="optional"===r._zod.optin,a="optional"===r._zod.optout,l=r._zod.run({value:o[e],issues:[]},n);l instanceof Promise?s.push(l.then(r=>r5(r,t,e,o,i,a))):r5(l,t,e,o,i,a)}return a?r4(s,o,t,n,i.value,e):s.length?Promise.all(s).then(()=>t):t}}),r3=e_("$ZodObjectJIT",(e,t)=>{let r,n;r8.init(e,t);let i=e._zod.parse,a=eO(()=>r6(t)),o=!eR.jitless,s=o&&eM.value,c=t.catchall;e._zod.parse=(l,d)=>{n??(n=a.value);let u=l.value;return eq(u)?o&&s&&d?.async===!1&&!0!==d.jitless?(r||(r=(e=>{let t=new rs(["shape","payload","ctx"]),r=a.value,n=e=>{let t=ej(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),o=0;for(let e of r.keys)i[e]=`key_${o++}`;for(let a of(t.write("const newResult = {};"),r.keys)){let r=i[a],o=ej(a),s=e[a],c=s?._zod?.optin==="optional",l=s?._zod?.optout==="optional";t.write(`const ${r} = ${n(a)};`),c&&l?t.write(`
|
|
2
2
|
if (${r}.issues.length) {
|
|
3
3
|
if (${o} in input) {
|
|
4
4
|
payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|
|
@@ -59,7 +59,7 @@ module.exports=[2157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},
|
|
|
59
59
|
|
|
60
60
|
`)}t.write("payload.value = newResult;"),t.write("return payload;");let s=t.compile();return(t,r)=>s(e,t,r)})(t.shape)),l=r(l,d),c)?r4([],u,l,d,n,e):l:i(l,d):(l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l)}});function r9(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let i=e.filter(e=>!e0(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>e6(e,n,eT())))}),t)}let r7=e_("$ZodUnion",(e,t)=>{rA.init(e,t),e$(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),e$(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),e$(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),e$(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>eC(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(0===t.issues.length)return t;o.push(t)}}return a?Promise.all(o).then(t=>r9(t,n,e,i)):r9(o,n,e,i)}});function ne(e,t,r,n){let i=e.filter(e=>0===e.issues.length);return 1===i.length?t.value=i[0].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>e6(e,n,eT())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t}(e,t)=>{r7.init(e,t),t.inclusive=!1;let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);t instanceof Promise?(o.push(t),a=!0):o.push(t)}return a?Promise.all(o).then(t=>ne(t,n,e,i)):ne(o,n,e,i)}},(e,t)=>{t.inclusive=!1,r7.init(e,t);let r=e._zod.parse;e$(e._zod,"propValues",()=>{let e={};for(let r of t.options){let n=r._zod.propValues;if(!n||0===Object.keys(n).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(n))for(let n of(e[t]||(e[t]=new Set),r))e[t].add(n)}return e});let n=eO(()=>{let e=t.options,r=new Map;for(let n of e){let e=n._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,n)}}return r});e._zod.parse=(i,a)=>{let o=i.value;if(!eq(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;let s=n.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||"backward"===a.direction?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}};let nt=e_("$ZodIntersection",(e,t)=>{rA.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,i=t.left._zod.run({value:n,issues:[]},r),a=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,r])=>nr(e,t,r)):nr(e,i,a)}});function nr(e,t,r){let n,i=new Map;for(let r of t.issues)if("unrecognized_keys"===r.code)for(let e of(n??(n=r),r.keys))i.has(e)||i.set(e,{}),i.get(e).l=!0;else e.issues.push(r);for(let t of r.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)i.has(e)||i.set(e,{}),i.get(e).r=!0;else e.issues.push(t);let a=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&n&&e.issues.push({...n,keys:a}),e0(e))return e;let o=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(eV(t)&&eV(r)){let n=Object.keys(r),i=Object.keys(t).filter(e=>-1!==n.indexOf(e)),a={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};a[n]=i.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let a=e(t[i],r[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}let nn=e_("$ZodTuple",(e,t)=>{rA.init(e,t);let r=t.items;e._zod.parse=(n,i)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let o=[],s=ni(r,"optin"),c=ni(r,"optout");if(!t.rest){if(a.length<s)return n.issues.push({code:"too_small",minimum:s,inclusive:!0,input:a,inst:e,origin:"array"}),n;a.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:e,origin:"array"})}let l=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=r.length-1;for(let s of a.slice(r.length)){e++;let r=t.rest._zod.run({value:s,issues:[]},i);r instanceof Promise?o.push(r.then(t=>na(t,n,e))):na(r,n,e)}}return o.length?Promise.all(o).then(()=>no(l,n,r,a,c)):no(l,n,r,a,c)}});function ni(e,t){for(let r=e.length-1;r>=0;r--)if("optional"!==e[r]._zod[t])return r+1;return 0}function na(e,t,r){e.issues.length&&t.issues.push(...e2(r,e.issues)),t.value[r]=e.value}function no(e,t,r,n,i){for(let a=0;a<r.length;a++){let r=e[a],o=a<n.length;if(r.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...e2(a,r.issues))}t.value[a]=r.value}for(let e=t.value.length-1;e>=n.length;e--)if("optional"===r[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}let ns=e_("$ZodRecord",(e,t)=>{rA.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!eV(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let a=[],o=t.keyType._zod.values;if(o){let s;r.value={};let c=new Set;for(let s of o)if("string"==typeof s||"number"==typeof s||"symbol"==typeof s){c.add("number"==typeof s?s.toString():s);let o=t.keyType._zod.run({value:s,issues:[]},n);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(o.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(e=>e6(e,n,eT())),input:s,path:[s],inst:e});continue}let l=o.value,d=t.valueType._zod.run({value:i[s],issues:[]},n);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&r.issues.push(...e2(s,e.issues)),r.value[l]=e.value})):(d.issues.length&&r.issues.push(...e2(s,d.issues)),r.value[l]=d.value)}for(let e in i)c.has(e)||(s=s??[]).push(e);s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:s})}else for(let o of(r.value={},Reflect.ownKeys(i))){if("__proto__"===o||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},n);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof o&&tP.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},n);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(s=e)}if(s.issues.length){"loose"===t.mode?r.value[o]=i[o]:r.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>e6(e,n,eT())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},n);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&r.issues.push(...e2(o,e.issues)),r.value[s.value]=e.value})):(c.issues.length&&r.issues.push(...e2(o,c.issues)),r.value[s.value]=c.value)}return a.length?Promise.all(a).then(()=>r):r}});function nc(e,t,r,n,i,a,o){e.issues.length&&(eK.has(typeof n)?r.issues.push(...e2(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:a,issues:e.issues.map(e=>e6(e,o,eT()))})),t.issues.length&&(eK.has(typeof n)?r.issues.push(...e2(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:a,key:n,issues:t.issues.map(e=>e6(e,o,eT()))})),r.value.set(e.value,t.value)}function nl(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{rA.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let a=[];for(let[o,s]of(r.value=new Map,i)){let c=t.keyType._zod.run({value:o,issues:[]},n),l=t.valueType._zod.run({value:s,issues:[]},n);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{nc(t,a,r,o,i,e,n)})):nc(c,l,r,o,i,e,n)}return a.length?Promise.all(a).then(()=>r):r}},(e,t)=>{rA.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let a=[];for(let e of(r.value=new Set,i)){let i=t.valueType._zod.run({value:e,issues:[]},n);i instanceof Promise?a.push(i.then(e=>nl(e,r))):nl(i,r)}return a.length?Promise.all(a).then(()=>r):r}};let nd=e_("$ZodEnum",(e,t)=>{rA.init(e,t);let r=eI(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=RegExp(`^(${r.filter(e=>eK.has(typeof e)).map(e=>"string"==typeof e?eF(e):e.toString()).join("|")})$`),e._zod.parse=(t,i)=>{let a=t.value;return n.has(a)||t.issues.push({code:"invalid_value",values:r,input:a,inst:e}),t}}),nu=((e,t)=>{if(rA.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?eF(e):e?eF(e.toString()):String(e)).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}},e_("$ZodTransform",(e,t)=>{rA.init(e,t),e._zod.optin="optional",e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new ex(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(r.value=e,r.fallback=!0,r));if(i instanceof Promise)throw new eS;return r.value=i,r.fallback=!0,r}}));function np(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let nf=e_("$ZodOptional",(e,t)=>{rA.init(e,t),e._zod.optin="optional",e._zod.optout="optional",e$(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),e$(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eC(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let n=e.value,i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(e=>np(e,n)):np(i,n)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),nh=e_("$ZodExactOptional",(e,t)=>{nf.init(e,t),e$(e._zod,"values",()=>t.innerType._zod.values),e$(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),nm=e_("$ZodNullable",(e,t)=>{rA.init(e,t),e$(e._zod,"optin",()=>t.innerType._zod.optin),e$(e._zod,"optout",()=>t.innerType._zod.optout),e$(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eC(e.source)}|null)$`):void 0}),e$(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),ny=e_("$ZodDefault",(e,t)=>{rA.init(e,t),e._zod.optin="optional",e$(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>ng(e,t)):ng(n,t)}});function ng(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let nw=e_("$ZodPrefault",(e,t)=>{rA.init(e,t),e._zod.optin="optional",e$(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),nb=e_("$ZodNonOptional",(e,t)=>{rA.init(e,t),e$(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(t=>nA(t,e)):nA(i,e)}});function nA(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}(e,t)=>{rA.init(e,t),e._zod.parse=(e,r)=>{if("backward"===r.direction)throw new ex("ZodSuccess");let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===n.issues.length,e)}};let nE=e_("$ZodCatch",(e,t)=>{rA.init(e,t),e._zod.optin="optional",e$(e._zod,"optout",()=>t.innerType._zod.optout),e$(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>e6(e,r,eT()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>e6(e,r,eT()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),nv=((e,t)=>{rA.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},e_("$ZodPipe",(e,t)=>{rA.init(e,t),e$(e._zod,"values",()=>t.in._zod.values),e$(e._zod,"optin",()=>t.in._zod.optin),e$(e._zod,"optout",()=>t.out._zod.optout),e$(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>nk(e,t.in,r)):nk(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>nk(e,t.out,r)):nk(n,t.out,r)}}));function nk(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function n_(e,t,r){if(e.issues.length)return e.aborted=!0,e;if("forward"===(r.direction||"forward")){let n=t.transform(e.value,e);return n instanceof Promise?n.then(n=>nS(e,n,t.out,r)):nS(e,n,t.out,r)}{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(n=>nS(e,n,t.in,r)):nS(e,n,t.in,r)}}function nS(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}(e,t)=>{rA.init(e,t),e$(e._zod,"values",()=>t.in._zod.values),e$(e._zod,"optin",()=>t.in._zod.optin),e$(e._zod,"optout",()=>t.out._zod.optout),e$(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("forward"===(r.direction||"forward")){let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>n_(e,t,r)):n_(n,t,r)}{let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>n_(e,t,r)):n_(n,t,r)}}},(e,t)=>{nv.init(e,t)};let nx=e_("$ZodReadonly",(e,t)=>{rA.init(e,t),e$(e._zod,"propValues",()=>t.innerType._zod.propValues),e$(e._zod,"values",()=>t.innerType._zod.values),e$(e._zod,"optin",()=>t.innerType?._zod?.optin),e$(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(nR):nR(n)}});function nR(e){return e.value=Object.freeze(e.value),e}(e,t)=>{rA.init(e,t);let r=[];for(let e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let n=+!!t.startsWith("^"),i=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(n,i))}else if(null===e||eW.has(typeof e))r.push(eF(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(r,n)=>("string"!=typeof r.value?r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),r)},(e,t)=>{rA.init(e,t),e$(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),e$(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),e$(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),e$(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),e$(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)};let nT=e_("$ZodCustom",(e,t)=>{tG.init(e,t),rA.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(t=>nI(t,r,n,e));nI(i,r,n,e)}});function nI(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(e3(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(m=globalThis).__zod_globalRegistry??(m.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let nU=globalThis.__zod_globalRegistry;function nO(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...eZ(t)})}function nP(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...eZ(t)})}function nC(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...eZ(t)})}function nD(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...eZ(t)})}function nL(e,t){return new tY({check:"less_than",...eZ(t),value:e,inclusive:!1})}function n$(e,t){return new tY({check:"less_than",...eZ(t),value:e,inclusive:!0})}function nz(e,t){return new tX({check:"greater_than",...eZ(t),value:e,inclusive:!1})}function nN(e,t){return new tX({check:"greater_than",...eZ(t),value:e,inclusive:!0})}function nj(e,t){return new t0({check:"multiple_of",...eZ(t),value:e})}function nH(e,t){return new t8({check:"max_length",...eZ(t),maximum:e})}function nB(e,t){return new t3({check:"min_length",...eZ(t),minimum:e})}function nq(e,t){return new t9({check:"length_equals",...eZ(t),length:e})}function nM(e){return new ro({check:"overwrite",tx:e})}e.i(10107);var nV=e.i(2721),nV=nV;function nK(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??nU,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function nW(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,n);else{let r=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,r,n)}let a=e._zod.parent;a&&(o.ref||(o.ref=a),nW(a,t,n),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),"input"===t.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,n);if("set"===i.type)return e(i.valueType,n);if("lazy"===i.type)return e(i.getter(),n);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type)return e(i.innerType,n);if("intersection"===i.type)return e(i.left,n)||e(i.right,n);if("record"===i.type||"map"===i.type)return e(i.keyType,n)||e(i.valueType,n);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,n)||e(i.out,n);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],n))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,n))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,n))return!0;if(i.rest&&e(i.rest,n))return!0}return!1}(e)&&(delete o.schema.examples,delete o.schema.default),"input"===t.io&&"_prefault"in o.schema&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function nF(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=n.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let n=t[1],{ref:i,defId:a}=(t=>{let n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(r)return{ref:i(r)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i("__shared")}#/${n}/${a}`}}if(t[1]===r)return{ref:"#"};let i=`#/${n}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}})(t);n.def={...n.schema},a&&(n.defId=a);let o=n.schema;for(let e in o)delete o[e];o.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
61
61
|
|
|
62
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){i(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){i(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle||n.count>1&&"ref"===e.reused){i(r);continue}}}function nJ(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let i=r.def??r.schema,a={...i},o=r.ref;if(r.ref=null,o){n(o);let r=e.seen.get(o),s=r.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in a||delete i[e]);if(s.$ref&&r.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(i[e])===JSON.stringify(r.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){n(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())n(t[0]);let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(r)}Object.assign(i,r.def??r.schema);let a=e.metadataRegistry.get(t)?.id;void 0!==a&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&("draft-2020-12"===e.target?i.$defs=o:i.definitions=o);try{let r=JSON.parse(JSON.stringify(i));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:nZ(t,"input",e.processors),output:nZ(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let nZ=(e,t,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=nK({...i??{},target:a,io:t,processors:r});return nW(e,o),nF(o,e),nJ(o,e)},nG={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nQ=(e,t,r,n)=>{let i=e._zod.def;nW(i.innerType,t,n),t.seen.get(e).ref=i.innerType},nY=e_("ZodISODateTime",(e,t)=>{rD.init(e,t),ip.init(e,t)}),nX=e_("ZodISODate",(e,t)=>{rL.init(e,t),ip.init(e,t)}),n0=e_("ZodISOTime",(e,t)=>{r$.init(e,t),ip.init(e,t)}),n1=e_("ZodISODuration",(e,t)=>{rz.init(e,t),ip.init(e,t)}),n2=e_("ZodError",(e,t)=>{rl.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>n({issues:e},[...i,...a.path]));else if("invalid_key"===a.code)n({issues:a.issues},[...i,...a.path]);else if("invalid_element"===a.code)n({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(0===e.length)r._errors.push(t(a));else{let n=r,i=0;for(;i<e.length;){let r=e[i];i===e.length-1?(n[r]=n[r]||{_errors:[]},n[r]._errors.push(t(a))):n[r]=n[r]||{_errors:[]},n=n[r],i++}}}};return n(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,eU,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,eU,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),n5=ru(n2),n6=rf(n2),n4=rm(n2),n8=rg(n2),n3=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return ru(n2)(e,t,n)},n9=(e,t,r)=>ru(n2)(e,t,r),n7=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return rf(n2)(e,t,n)},ie=async(e,t,r)=>rf(n2)(e,t,r),it=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return rm(n2)(e,t,n)},ir=(e,t,r)=>rm(n2)(e,t,r),ii=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return rg(n2)(e,t,n)},ia=async(e,t,r)=>rg(n2)(e,t,r),io=new WeakMap;function is(e,t,r){let n=Object.getPrototypeOf(e),i=io.get(n);if(i||(i=new Set,io.set(n,i)),!i.has(t))for(let e in i.add(t),r){let t=r[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,get(){let r=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:r}),r},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let ic=e_("ZodType",(e,t)=>(rA.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nZ(e,"input"),output:nZ(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{let n=nK({...r,processors:t});return nW(e,n),nF(n,e),nJ(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,r)=>n5(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>n4(e,t,r),e.parseAsync=async(t,r)=>n6(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>n8(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>n3(e,t,r),e.decode=(t,r)=>n9(e,t,r),e.encodeAsync=async(t,r)=>n7(e,t,r),e.decodeAsync=async(t,r)=>ie(e,t,r),e.safeEncode=(t,r)=>it(e,t,r),e.safeDecode=(t,r)=>ir(e,t,r),e.safeEncodeAsync=async(t,r)=>ii(e,t,r),e.safeDecodeAsync=async(t,r)=>ia(e,t,r),is(e,"ZodType",{check(...e){let t=this.def;return this.clone(nV.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return eJ(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new aa({type:"custom",check:"custom",fn:e,...eZ(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let n,i;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(e3(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(e3(e)))},e(t.value,t)),(i=new tG({check:"custom",...eZ(t)}))._zod.check=r,n=i}(e,t))},overwrite(e){return this.check(nM(e))},optional(){return i6(this)},exactOptional(){var e;return e=this,new i4({type:"optional",innerType:e})},nullable(){return i3(this)},nullish(){return i6(i3(this))},nonoptional(e){var t,r;return t=this,r=e,new ae({type:"nonoptional",innerType:t,...nV.normalizeParams(r)})},array(){return iF(this)},or(e){return new iG({type:"union",options:[this,e],...nV.normalizeParams(void 0)})},and(e){var t;return t=this,new iQ({type:"intersection",left:t,right:e})},transform(e){return an(this,new i2({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new i9({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():nV.shallowClone(r)}})},prefault(e){var t,r;return t=this,r=e,new i7({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():nV.shallowClone(r)}})},catch(e){var t,r;return t=this,new at({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r})},pipe(e){return an(this,e)},readonly(){var e;return e=this,new ai({type:"readonly",innerType:e})},describe(e){let t=this.clone();return nU.add(t,{description:e}),t},meta(...e){if(0===e.length)return nU.get(this);let t=this.clone();return nU.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>nU.get(e)?.description,configurable:!0}),e)),il=e_("_ZodString",(e,t)=>{rE.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{r.type="string";let{minimum:i,maximum:a,format:o,patterns:s,contentEncoding:c}=e._zod.bag;if("number"==typeof i&&(r.minLength=i),"number"==typeof a&&(r.maxLength=a),o&&(r.format=nG[o]??o,""===r.format&&delete r.format,"time"===o&&delete r.format),c&&(r.contentEncoding=c),s&&s.size>0){let e=[...s];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r,0);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,is(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new re({check:"string_format",format:"regex",...eZ(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new rn({check:"string_format",format:"includes",...eZ(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new ri({check:"string_format",format:"starts_with",...eZ(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new ra({check:"string_format",format:"ends_with",...eZ(t),suffix:e})}(...e))},min(...e){return this.check(nB(...e))},max(...e){return this.check(nH(...e))},length(...e){return this.check(nq(...e))},nonempty(...e){return this.check(nB(1,...e))},lowercase(e){return this.check(new rt({check:"string_format",format:"lowercase",...eZ(e)}))},uppercase(e){return this.check(new rr({check:"string_format",format:"uppercase",...eZ(e)}))},trim(){return this.check(nM(e=>e.trim()))},normalize(...e){return this.check(function(e){return nM(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(nM(e=>e.toLowerCase()))},toUpperCase(){return this.check(nM(e=>e.toUpperCase()))},slugify(){return this.check(nM(e=>eH(e)))}})}),id=e_("ZodString",(e,t)=>{rE.init(e,t),il.init(e,t),e.email=t=>e.check(nO(ih,t)),e.url=t=>e.check(new ig({type:"string",format:"url",check:"string_format",abort:!1,...eZ(t)})),e.jwt=t=>e.check(new iP({type:"string",format:"jwt",check:"string_format",abort:!1,...eZ(t)})),e.emoji=t=>e.check(new iw({type:"string",format:"emoji",check:"string_format",abort:!1,...eZ(t)})),e.guid=t=>e.check(nP(im,t)),e.uuid=t=>e.check(new iy({type:"string",format:"uuid",check:"string_format",abort:!1,...eZ(t)})),e.uuidv4=t=>e.check(new iy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...eZ(t)})),e.uuidv6=t=>e.check(new iy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...eZ(t)})),e.uuidv7=t=>e.check(new iy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...eZ(t)})),e.nanoid=t=>e.check(new ib({type:"string",format:"nanoid",check:"string_format",abort:!1,...eZ(t)})),e.guid=t=>e.check(nP(im,t)),e.cuid=t=>e.check(new iA({type:"string",format:"cuid",check:"string_format",abort:!1,...eZ(t)})),e.cuid2=t=>e.check(new iE({type:"string",format:"cuid2",check:"string_format",abort:!1,...eZ(t)})),e.ulid=t=>e.check(new iv({type:"string",format:"ulid",check:"string_format",abort:!1,...eZ(t)})),e.base64=t=>e.check(new iI({type:"string",format:"base64",check:"string_format",abort:!1,...eZ(t)})),e.base64url=t=>e.check(new iU({type:"string",format:"base64url",check:"string_format",abort:!1,...eZ(t)})),e.xid=t=>e.check(new ik({type:"string",format:"xid",check:"string_format",abort:!1,...eZ(t)})),e.ksuid=t=>e.check(new i_({type:"string",format:"ksuid",check:"string_format",abort:!1,...eZ(t)})),e.ipv4=t=>e.check(nC(iS,t)),e.ipv6=t=>e.check(nD(ix,t)),e.cidrv4=t=>e.check(new iR({type:"string",format:"cidrv4",check:"string_format",abort:!1,...eZ(t)})),e.cidrv6=t=>e.check(new iT({type:"string",format:"cidrv6",check:"string_format",abort:!1,...eZ(t)})),e.e164=t=>e.check(new iO({type:"string",format:"e164",check:"string_format",abort:!1,...eZ(t)})),e.datetime=t=>e.check(new nY({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...eZ(t)})),e.date=t=>e.check(new nX({type:"string",format:"date",check:"string_format",...eZ(t)})),e.time=t=>e.check(new n0({type:"string",format:"time",check:"string_format",precision:null,...eZ(t)})),e.duration=t=>e.check(new n1({type:"string",format:"duration",check:"string_format",...eZ(t)}))});function iu(e){return new id({type:"string",...eZ(e)})}let ip=e_("ZodStringFormat",(e,t)=>{rv.init(e,t),il.init(e,t)}),ih=e_("ZodEmail",(e,t)=>{rS.init(e,t),ip.init(e,t)}),im=e_("ZodGUID",(e,t)=>{rk.init(e,t),ip.init(e,t)}),iy=e_("ZodUUID",(e,t)=>{r_.init(e,t),ip.init(e,t)}),ig=e_("ZodURL",(e,t)=>{rx.init(e,t),ip.init(e,t)}),iw=e_("ZodEmoji",(e,t)=>{rR.init(e,t),ip.init(e,t)}),ib=e_("ZodNanoID",(e,t)=>{rT.init(e,t),ip.init(e,t)}),iA=e_("ZodCUID",(e,t)=>{rI.init(e,t),ip.init(e,t)}),iE=e_("ZodCUID2",(e,t)=>{rU.init(e,t),ip.init(e,t)}),iv=e_("ZodULID",(e,t)=>{rO.init(e,t),ip.init(e,t)}),ik=e_("ZodXID",(e,t)=>{rP.init(e,t),ip.init(e,t)}),i_=e_("ZodKSUID",(e,t)=>{rC.init(e,t),ip.init(e,t)}),iS=e_("ZodIPv4",(e,t)=>{rN.init(e,t),ip.init(e,t)}),ix=e_("ZodIPv6",(e,t)=>{rj.init(e,t),ip.init(e,t)}),iR=e_("ZodCIDRv4",(e,t)=>{rH.init(e,t),ip.init(e,t)}),iT=e_("ZodCIDRv6",(e,t)=>{rB.init(e,t),ip.init(e,t)}),iI=e_("ZodBase64",(e,t)=>{rM.init(e,t),ip.init(e,t)}),iU=e_("ZodBase64URL",(e,t)=>{rV.init(e,t),ip.init(e,t)}),iO=e_("ZodE164",(e,t)=>{rK.init(e,t),ip.init(e,t)}),iP=e_("ZodJWT",(e,t)=>{rW.init(e,t),ip.init(e,t)}),iC=e_("ZodNumber",(e,t)=>{rF.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let{minimum:i,maximum:a,format:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;"string"==typeof o&&o.includes("int")?r.type="integer":r.type="number";let d="number"==typeof l&&l>=(i??-1/0),u="number"==typeof c&&c<=(a??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;d?p?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof i&&(r.minimum=i),u?p?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:"number"==typeof a&&(r.maximum=a),"number"==typeof s&&(r.multipleOf=s)})(e,t,r,0),is(e,"ZodNumber",{gt(e,t){return this.check(nz(e,t))},gte(e,t){return this.check(nN(e,t))},min(e,t){return this.check(nN(e,t))},lt(e,t){return this.check(nL(e,t))},lte(e,t){return this.check(n$(e,t))},max(e,t){return this.check(n$(e,t))},int(e){return this.check(i$(e))},safe(e){return this.check(i$(e))},positive(e){return this.check(nz(0,e))},nonnegative(e){return this.check(nN(0,e))},negative(e){return this.check(nL(0,e))},nonpositive(e){return this.check(n$(0,e))},multipleOf(e,t){return this.check(nj(e,t))},step(e,t){return this.check(nj(e,t))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function iD(e){return new iC({type:"number",checks:[],...eZ(e)})}let iL=e_("ZodNumberFormat",(e,t)=>{rJ.init(e,t),iC.init(e,t)});function i$(e){return new iL({type:"number",check:"number_format",abort:!1,format:"safeint",...eZ(e)})}let iz=e_("ZodBoolean",(e,t)=>{rZ.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.type="boolean"}});function iN(e){return new iz({type:"boolean",...eZ(e)})}let ij=e_("ZodBigInt",(e,t)=>{rG.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")})(0,e,0,0),e.gte=(t,r)=>e.check(nN(t,r)),e.min=(t,r)=>e.check(nN(t,r)),e.gt=(t,r)=>e.check(nz(t,r)),e.gte=(t,r)=>e.check(nN(t,r)),e.min=(t,r)=>e.check(nN(t,r)),e.lt=(t,r)=>e.check(nL(t,r)),e.lte=(t,r)=>e.check(n$(t,r)),e.max=(t,r)=>e.check(n$(t,r)),e.positive=t=>e.check(nz(BigInt(0),t)),e.negative=t=>e.check(nL(BigInt(0),t)),e.nonpositive=t=>e.check(n$(BigInt(0),t)),e.nonnegative=t=>e.check(nN(BigInt(0),t)),e.multipleOf=(t,r)=>e.check(nj(t,r));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null}),iH=e_("ZodAny",(e,t)=>{rQ.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function iB(){return new iH({type:"any"})}let iq=e_("ZodUnknown",(e,t)=>{rY.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function iM(){return new iq({type:"unknown"})}let iV=e_("ZodNever",(e,t)=>{rX.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}}),iK=e_("ZodDate",(e,t)=>{r0.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")})(0,e,0,0),e.min=(t,r)=>e.check(nN(t,r)),e.max=(t,r)=>e.check(n$(t,r));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null}),iW=e_("ZodArray",(e,t)=>{r2.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,{minimum:a,maximum:o}=e._zod.bag;"number"==typeof a&&(r.minItems=a),"number"==typeof o&&(r.maxItems=o),r.type="array",r.items=nW(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,is(e,"ZodArray",{min(e,t){return this.check(nB(e,t))},nonempty(e){return this.check(nB(1,e))},max(e,t){return this.check(nH(e,t))},length(e,t){return this.check(nq(e,t))},unwrap(){return this.element}})});function iF(e,t){return new iW({type:"array",element:e,...eZ(t)})}let iJ=e_("ZodObject",(e,t)=>{r3.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;r.type="object",r.properties={};let a=i.shape;for(let e in a)r.properties[e]=nW(a[e],t,{...n,path:[...n.path,"properties",e]});let o=new Set([...new Set(Object.keys(a))].filter(e=>{let r=i.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));o.size>0&&(r.required=Array.from(o)),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=nW(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),nV.defineLazy(e,"shape",()=>t.shape),is(e,"ZodObject",{keyof(){return i1(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:iM()})},loose(){return this.clone({...this._zod.def,catchall:iM()})},strict(){return this.clone({...this._zod.def,catchall:new iV({type:"never",...eZ(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return nV.extend(this,e)},safeExtend(e){return nV.safeExtend(this,e)},merge(e){return nV.merge(this,e)},pick(e){return nV.pick(this,e)},omit(e){return nV.omit(this,e)},partial(...e){return nV.partial(i5,this,e[0])},required(...e){return nV.required(ae,this,e[0])}})});function iZ(e,t){return new iJ({type:"object",shape:e??{},...nV.normalizeParams(t)})}let iG=e_("ZodUnion",(e,t)=>{r7.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{var i,a,o,s;let c,l,d;return i=e,a=t,o=r,s=n,l=!1===(c=i._zod.def).inclusive,d=c.options.map((e,t)=>nW(e,a,{...s,path:[...s.path,l?"oneOf":"anyOf",t]})),void(l?o.oneOf=d:o.anyOf=d)},e.options=t.options}),iQ=e_("ZodIntersection",(e,t)=>{nt.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,a,o,s;return a=nW((i=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),o=nW(i.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=[...(s=e=>"allOf"in e&&1===Object.keys(e).length)(a)?a.allOf:[a],...s(o)?o.allOf:[o]])}}),iY=e_("ZodRecord",(e,t)=>{ns.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;r.type="object";let a=i.keyType,o=a._zod.bag,s=o?.patterns;if("loose"===i.mode&&s&&s.size>0){let e=nW(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});for(let t of(r.patternProperties={},s))r.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(r.propertyNames=nW(i.keyType,t,{...n,path:[...n.path,"propertyNames"]})),r.additionalProperties=nW(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let c=a._zod.values;if(c){let e=[...c].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e)}})(e,t,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function iX(e,t,r){return new iY(t&&t._zod?{type:"record",keyType:e,valueType:t,...nV.normalizeParams(r)}:{type:"record",keyType:iu(),valueType:e,...nV.normalizeParams(t)})}let i0=e_("ZodEnum",(e,t)=>{nd.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;(i=eI(e._zod.def.entries)).every(e=>"number"==typeof e)&&(r.type="number"),i.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=i},e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new i0({...t,checks:[],...nV.normalizeParams(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new i0({...t,checks:[],...nV.normalizeParams(n),entries:i})}});function i1(e,t){return new i0({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...nV.normalizeParams(t)})}let i2=e_("ZodTransform",(e,t)=>{nu.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new ex(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(nV.issue(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),r.issues.push(nV.issue(n)))};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}}),i5=e_("ZodOptional",(e,t)=>{nf.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>nQ(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function i6(e){return new i5({type:"optional",innerType:e})}let i4=e_("ZodExactOptional",(e,t)=>{nh.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>nQ(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),i8=e_("ZodNullable",(e,t)=>{nm.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,a,o;return a=nW((i=e._zod.def).innerType,t,n),o=t.seen.get(e),void("openapi-3.0"===t.target?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function i3(e){return new i8({type:"nullable",innerType:e})}let i9=e_("ZodDefault",(e,t)=>{ny.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;nW((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),i7=e_("ZodPrefault",(e,t)=>{nw.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;nW((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),ae=e_("ZodNonOptional",(e,t)=>{nb.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;nW((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),at=e_("ZodCatch",(e,t)=>{nE.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i,a=e._zod.def;nW(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{i=a.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=i})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),ar=e_("ZodPipe",(e,t)=>{nv.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,a,o;return a=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(nW(o="input"===t.io?a?i.out:i.in:i.out,t,n),t.seen.get(e).ref=o)},e.in=t.in,e.out=t.out});function an(e,t){return new ar({type:"pipe",in:e,out:t})}let ai=e_("ZodReadonly",(e,t)=>{nx.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;nW((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),aa=e_("ZodCustom",(e,t)=>{nT.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)}),ao={};function as(e){switch(e.constructor.name){case"ZodString":default:return"string";case"ZodNumber":return"number";case"ZodBoolean":return"boolean";case"ZodObject":return"object";case"ZodArray":return"array"}}function ac(e){let t=[];return e.metadata?.openapi?.parameters?t.push(...e.metadata.openapi.parameters):e.query instanceof iJ&&Object.entries(e.query.shape).forEach(([e,r])=>{r instanceof iJ&&t.push({name:e,in:"query",schema:{type:as(r),..."minLength"in r&&r.minLength?{minLength:r.minLength}:{},description:r.description}})}),t}function al(e){return{400:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}},required:["message"]}}},description:"Bad Request. Usually due to missing parameters, or invalid parameters."},401:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}},required:["message"]}}},description:"Unauthorized. Due to missing or invalid authentication."},403:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}}}}},description:"Forbidden. You do not have permission to access this resource or to perform this action."},404:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}}}}},description:"Not Found. The requested resource was not found."},429:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}}}}},description:"Too Many Requests. You have exceeded the rate limit. Try again later."},500:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}}}}},description:"Internal Server Error. This is a problem with the server that you cannot fix."},...e}}async function ad(e,t){return Object.entries(e).forEach(([e,t])=>{let r=t.options;if(!(!t.path||r.metadata?.SERVER_ONLY)&&("GET"===r.method&&(ao[t.path]={get:{tags:["Default",...r.metadata?.openapi?.tags||[]],description:r.metadata?.openapi?.description,operationId:r.metadata?.openapi?.operationId,security:[{bearerAuth:[]}],parameters:ac(r),responses:al(r.metadata?.openapi?.responses)}}),"POST"===r.method)){let e=function(e){if(e.metadata?.openapi?.requestBody)return e.metadata.openapi.requestBody;if(e.body&&(e.body instanceof iJ||e.body instanceof i5)){let t=e.body.shape;if(!t)return;let r={},n=[];return Object.entries(t).forEach(([e,t])=>{t instanceof iJ&&(r[e]={type:as(t),description:t.description},t instanceof i5||n.push(e))}),{required:!(e.body instanceof i5)&&!!e.body,content:{"application/json":{schema:{type:"object",properties:r,required:n}}}}}}(r);ao[t.path]={post:{tags:["Default",...r.metadata?.openapi?.tags||[]],description:r.metadata?.openapi?.description,operationId:r.metadata?.openapi?.operationId,security:[{bearerAuth:[]}],parameters:ac(r),...e?{requestBody:e}:{requestBody:{content:{"application/json":{schema:{type:"object",properties:{}}}}}},responses:al(r.metadata?.openapi?.responses)}}}}),{openapi:"3.1.1",info:{title:"Better Auth",description:"API Reference for your Better Auth Instance",version:"1.1.0"},components:{schemas:{}},security:[{apiKeyCookie:[]}],servers:[{url:t?.url}],tags:[{name:"Default",description:"Default endpoints that are included with Better Auth by default. These endpoints are not part of any plugin."}],paths:ao}}let au=((o=function(){}).prototype=Object.create(null),Object.freeze(o.prototype),o);function ap(){return{root:{key:""},static:new au}}function af(e){let[t,...r]=e.split("/");return""===r[r.length-1]?r.slice(0,-1):r}function ah(e,t){let r=new au;for(let[n,i]of t){let t=n<0?e.slice(-(n+1)).join("/"):e[n];if("string"==typeof i)r[i]=t;else{let e=t.match(i);if(e)for(let t in e.groups)r[t]=e.groups[t]}}return r}function am(e,t="",r,n){t=t.toUpperCase(),47!==r.charCodeAt(0)&&(r=`/${r}`);let i=af(r=r.replace(/\\:/g,"%3A")),a=e.root,o=0,s=[],c=[];for(let e=0;e<i.length;e++){let t=i[e];if(t.startsWith("**")){a.wildcard||(a.wildcard={key:"**"}),a=a.wildcard,s.push([-(e+1),t.split(":")[1]||"_",2===t.length]);break}if("*"===t||t.includes(":")){if(a.param||(a.param={key:"*"}),a=a.param,"*"===t)s.push([e,`_${o++}`,!0]);else if(t.includes(":",1)){let r=function(e){let t=e.replace(/:(\w+)/g,(e,t)=>`(?<${t}>[^/]+)`).replace(/\./g,"\\.");return RegExp(`^${t}$`)}(t);c[e]=r,a.hasRegexParam=!0,s.push([e,r,!1])}else s.push([e,t.slice(1),!1]);continue}"\\*"===t?t=i[e]="*":"\\*\\*"===t&&(t=i[e]="**");let r=a.static?.[t];if(r)a=r;else{let e={key:t};a.static||(a.static=new au),a.static[t]=e,a=e}}let l=s.length>0;a.methods||(a.methods=new au),a.methods[t]??=[],a.methods[t].push({data:n||null,paramsRegexp:c,paramsMap:l?s:void 0}),l||(e.static["/"+i.join("/")]=a)}function ay(e){return e instanceof X.APIError||e instanceof Y.APIError||e?.name==="APIError"}let ag=ek(async()=>({})),aw=ek.create({use:[ag,ek(async()=>({}))]}),ab=[ag];function aA(e,t,r){let n="string"==typeof e?e:void 0,i="object"==typeof t?t:e,a="function"==typeof t?t:r,o=async e=>{try{return await Q(e,()=>a(e))}catch(r){var t;throw t=e.responseHeaders,ay(r)&&t&&Object.defineProperty(r,X.kAPIErrorHeaderSymbol,{enumerable:!1,configurable:!0,value:t,writable:!1}),r}};return n?ev(n,{...i,use:[...i?.use||[],...ab]},o):ev({...i,use:[...i?.use||[],...ab]},o)}aA.serverOnly=(e,t)=>aA({...e,metadata:{...e.metadata,SERVER_ONLY:!0}},t);var aE=e.i(89551),av=e.i(12714),ak=e.i(50227),a_=e.i(43651),aS=e.i(80527);async function ax(t,r){let n;if(t.database)n="function"==typeof t.database?t.database(t):await r(t);else{let r=Object.keys((0,a_.getAuthTables)(t)).reduce((e,t)=>(e[t]=[],e),{}),{memoryAdapter:i}=await e.A(16432);n=i(r)(t)}return n.transaction||(aS.logger.warn("Adapter does not correctly implement transaction function, patching it automatically. Please update your adapter implementation."),n.transaction=async e=>e(n)),n}async function aR(t){return ax(t,async t=>{let{createKyselyAdapter:r}=await e.A(92291),{kysely:n,databaseType:i,transaction:a}=await r(t);if(!n)throw new Y.BetterAuthError("Failed to initialize database adapter");let{kyselyAdapter:o}=await e.A(92291);return o(n,{type:i||"sqlite",debugLogs:!!t.database&&"debugLogs"in t.database&&t.database.debugLogs,transaction:a})(t)})}var aT=e.i(13906),aI=e.i(15272),aU=e.i(97495),aO=e.i(29401);let aP={postgres:{string:["character varying","varchar","text","uuid"],number:["int4","integer","bigint","smallint","numeric","real","double precision"],boolean:["bool","boolean"],date:["timestamptz","timestamp","date"],json:["json","jsonb"]},mysql:{string:["varchar","text","uuid"],number:["integer","int","bigint","smallint","decimal","float","double"],boolean:["boolean","tinyint"],date:["timestamp","datetime","date"],json:["json"]},sqlite:{string:["TEXT"],number:["INTEGER","REAL"],boolean:["INTEGER","BOOLEAN"],date:["DATE","INTEGER"],json:["TEXT"]},mssql:{string:["varchar","nvarchar","uniqueidentifier"],number:["int","bigint","smallint","decimal","float","double"],boolean:["bit","smallint"],date:["datetime2","date","datetime"],json:["varchar","nvarchar"]}};async function aC(e){try{let t=await aO.sql`SHOW search_path`.execute(e),r=t.rows[0]?.search_path??t.rows[0]?.searchPath;if(r)return r.split(",").map(e=>e.trim()).map(e=>e.replace(/^["']|["']$/g,"")).filter(e=>!e.startsWith("$")&&!e.startsWith("\\$"))[0]||"public"}catch{}return"public"}async function aD(e){let t=function(e){let t=(0,a_.getAuthTables)(e),r={};for(let e in t){let n=t[e],i=n.fields,a={};if(Object.entries(i).forEach(([e,r])=>{if(a[r.fieldName||e]=r,r.references){let n=t[r.references.model];n&&(a[r.fieldName||e].references={...r.references,model:n.modelName,field:r.references.field})}}),r[n.modelName]){r[n.modelName].fields={...r[n.modelName].fields,...a},n.disableMigrations&&(r[n.modelName].disableMigrations=!0);continue}r[n.modelName]={fields:a,order:n.order||1/0,disableMigrations:n.disableMigrations}}return r}(e),r=(0,aS.createLogger)(e.logger),{kysely:n,databaseType:i}=await (0,aT.createKyselyAdapter)(e);i||(r.warn("Could not determine database type, defaulting to sqlite. Please provide a type in the database options to avoid this."),i="sqlite"),n||(r.error("Only kysely adapter is supported for migrations. You can use `generate` command to generate the schema, if you're using a different adapter."),process.exit(1));let a="public";if("postgres"===i){a=await aC(n),r.debug(`PostgreSQL migration: Using schema '${a}' (from search_path)`);try{let e=await aO.sql`
|
|
62
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){i(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){i(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle||n.count>1&&"ref"===e.reused){i(r);continue}}}function nJ(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let i=r.def??r.schema,a={...i},o=r.ref;if(r.ref=null,o){n(o);let r=e.seen.get(o),s=r.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in a||delete i[e]);if(s.$ref&&r.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(i[e])===JSON.stringify(r.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){n(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())n(t[0]);let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(r)}Object.assign(i,r.def??r.schema);let a=e.metadataRegistry.get(t)?.id;void 0!==a&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&("draft-2020-12"===e.target?i.$defs=o:i.definitions=o);try{let r=JSON.parse(JSON.stringify(i));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:nZ(t,"input",e.processors),output:nZ(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let nZ=(e,t,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=nK({...i??{},target:a,io:t,processors:r});return nW(e,o),nF(o,e),nJ(o,e)},nG={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nQ=(e,t,r,n)=>{let i=e._zod.def;nW(i.innerType,t,n),t.seen.get(e).ref=i.innerType},nY=e_("ZodISODateTime",(e,t)=>{rD.init(e,t),ip.init(e,t)}),nX=e_("ZodISODate",(e,t)=>{rL.init(e,t),ip.init(e,t)}),n0=e_("ZodISOTime",(e,t)=>{r$.init(e,t),ip.init(e,t)}),n1=e_("ZodISODuration",(e,t)=>{rz.init(e,t),ip.init(e,t)}),n2=e_("ZodError",(e,t)=>{rl.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>n({issues:e},[...i,...a.path]));else if("invalid_key"===a.code)n({issues:a.issues},[...i,...a.path]);else if("invalid_element"===a.code)n({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(0===e.length)r._errors.push(t(a));else{let n=r,i=0;for(;i<e.length;){let r=e[i];i===e.length-1?(n[r]=n[r]||{_errors:[]},n[r]._errors.push(t(a))):n[r]=n[r]||{_errors:[]},n=n[r],i++}}}};return n(e),r})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,eU,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,eU,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),n5=ru(n2),n6=rf(n2),n4=rm(n2),n8=rg(n2),n3=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return ru(n2)(e,t,n)},n9=(e,t,r)=>ru(n2)(e,t,r),n7=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return rf(n2)(e,t,n)},ie=async(e,t,r)=>rf(n2)(e,t,r),it=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return rm(n2)(e,t,n)},ir=(e,t,r)=>rm(n2)(e,t,r),ii=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return rg(n2)(e,t,n)},ia=async(e,t,r)=>rg(n2)(e,t,r),io=new WeakMap;function is(e,t,r){let n=Object.getPrototypeOf(e),i=io.get(n);if(i||(i=new Set,io.set(n,i)),!i.has(t))for(let e in i.add(t),r){let t=r[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,get(){let r=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:r}),r},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let ic=e_("ZodType",(e,t)=>(rA.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nZ(e,"input"),output:nZ(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{let n=nK({...r,processors:t});return nW(e,n),nF(n,e),nJ(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,r)=>n5(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>n4(e,t,r),e.parseAsync=async(t,r)=>n6(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>n8(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>n3(e,t,r),e.decode=(t,r)=>n9(e,t,r),e.encodeAsync=async(t,r)=>n7(e,t,r),e.decodeAsync=async(t,r)=>ie(e,t,r),e.safeEncode=(t,r)=>it(e,t,r),e.safeDecode=(t,r)=>ir(e,t,r),e.safeEncodeAsync=async(t,r)=>ii(e,t,r),e.safeDecodeAsync=async(t,r)=>ia(e,t,r),is(e,"ZodType",{check(...e){let t=this.def;return this.clone(nV.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return eJ(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new aa({type:"custom",check:"custom",fn:e,...eZ(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let n,i;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(e3(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(e3(e)))},e(t.value,t)),(i=new tG({check:"custom",...eZ(t)}))._zod.check=r,n=i}(e,t))},overwrite(e){return this.check(nM(e))},optional(){return i6(this)},exactOptional(){var e;return e=this,new i4({type:"optional",innerType:e})},nullable(){return i3(this)},nullish(){return i6(i3(this))},nonoptional(e){var t,r;return t=this,r=e,new ae({type:"nonoptional",innerType:t,...nV.normalizeParams(r)})},array(){return iF(this)},or(e){return new iG({type:"union",options:[this,e],...nV.normalizeParams(void 0)})},and(e){var t;return t=this,new iQ({type:"intersection",left:t,right:e})},transform(e){return an(this,new i2({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new i9({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():nV.shallowClone(r)}})},prefault(e){var t,r;return t=this,r=e,new i7({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():nV.shallowClone(r)}})},catch(e){var t,r;return t=this,new at({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:()=>r})},pipe(e){return an(this,e)},readonly(){var e;return e=this,new ai({type:"readonly",innerType:e})},describe(e){let t=this.clone();return nU.add(t,{description:e}),t},meta(...e){if(0===e.length)return nU.get(this);let t=this.clone();return nU.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>nU.get(e)?.description,configurable:!0}),e)),il=e_("_ZodString",(e,t)=>{rE.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{r.type="string";let{minimum:i,maximum:a,format:o,patterns:s,contentEncoding:c}=e._zod.bag;if("number"==typeof i&&(r.minLength=i),"number"==typeof a&&(r.maxLength=a),o&&(r.format=nG[o]??o,""===r.format&&delete r.format,"time"===o&&delete r.format),c&&(r.contentEncoding=c),s&&s.size>0){let e=[...s];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r,0);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,is(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new re({check:"string_format",format:"regex",...eZ(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new rn({check:"string_format",format:"includes",...eZ(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new ri({check:"string_format",format:"starts_with",...eZ(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new ra({check:"string_format",format:"ends_with",...eZ(t),suffix:e})}(...e))},min(...e){return this.check(nB(...e))},max(...e){return this.check(nH(...e))},length(...e){return this.check(nq(...e))},nonempty(...e){return this.check(nB(1,...e))},lowercase(e){return this.check(new rt({check:"string_format",format:"lowercase",...eZ(e)}))},uppercase(e){return this.check(new rr({check:"string_format",format:"uppercase",...eZ(e)}))},trim(){return this.check(nM(e=>e.trim()))},normalize(...e){return this.check(function(e){return nM(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(nM(e=>e.toLowerCase()))},toUpperCase(){return this.check(nM(e=>e.toUpperCase()))},slugify(){return this.check(nM(e=>eH(e)))}})}),id=e_("ZodString",(e,t)=>{rE.init(e,t),il.init(e,t),e.email=t=>e.check(nO(ih,t)),e.url=t=>e.check(new ig({type:"string",format:"url",check:"string_format",abort:!1,...eZ(t)})),e.jwt=t=>e.check(new iP({type:"string",format:"jwt",check:"string_format",abort:!1,...eZ(t)})),e.emoji=t=>e.check(new iw({type:"string",format:"emoji",check:"string_format",abort:!1,...eZ(t)})),e.guid=t=>e.check(nP(im,t)),e.uuid=t=>e.check(new iy({type:"string",format:"uuid",check:"string_format",abort:!1,...eZ(t)})),e.uuidv4=t=>e.check(new iy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...eZ(t)})),e.uuidv6=t=>e.check(new iy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...eZ(t)})),e.uuidv7=t=>e.check(new iy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...eZ(t)})),e.nanoid=t=>e.check(new ib({type:"string",format:"nanoid",check:"string_format",abort:!1,...eZ(t)})),e.guid=t=>e.check(nP(im,t)),e.cuid=t=>e.check(new iA({type:"string",format:"cuid",check:"string_format",abort:!1,...eZ(t)})),e.cuid2=t=>e.check(new iE({type:"string",format:"cuid2",check:"string_format",abort:!1,...eZ(t)})),e.ulid=t=>e.check(new iv({type:"string",format:"ulid",check:"string_format",abort:!1,...eZ(t)})),e.base64=t=>e.check(new iI({type:"string",format:"base64",check:"string_format",abort:!1,...eZ(t)})),e.base64url=t=>e.check(new iU({type:"string",format:"base64url",check:"string_format",abort:!1,...eZ(t)})),e.xid=t=>e.check(new ik({type:"string",format:"xid",check:"string_format",abort:!1,...eZ(t)})),e.ksuid=t=>e.check(new i_({type:"string",format:"ksuid",check:"string_format",abort:!1,...eZ(t)})),e.ipv4=t=>e.check(nC(iS,t)),e.ipv6=t=>e.check(nD(ix,t)),e.cidrv4=t=>e.check(new iR({type:"string",format:"cidrv4",check:"string_format",abort:!1,...eZ(t)})),e.cidrv6=t=>e.check(new iT({type:"string",format:"cidrv6",check:"string_format",abort:!1,...eZ(t)})),e.e164=t=>e.check(new iO({type:"string",format:"e164",check:"string_format",abort:!1,...eZ(t)})),e.datetime=t=>e.check(new nY({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...eZ(t)})),e.date=t=>e.check(new nX({type:"string",format:"date",check:"string_format",...eZ(t)})),e.time=t=>e.check(new n0({type:"string",format:"time",check:"string_format",precision:null,...eZ(t)})),e.duration=t=>e.check(new n1({type:"string",format:"duration",check:"string_format",...eZ(t)}))});function iu(e){return new id({type:"string",...eZ(e)})}let ip=e_("ZodStringFormat",(e,t)=>{rv.init(e,t),il.init(e,t)}),ih=e_("ZodEmail",(e,t)=>{rS.init(e,t),ip.init(e,t)}),im=e_("ZodGUID",(e,t)=>{rk.init(e,t),ip.init(e,t)}),iy=e_("ZodUUID",(e,t)=>{r_.init(e,t),ip.init(e,t)}),ig=e_("ZodURL",(e,t)=>{rx.init(e,t),ip.init(e,t)}),iw=e_("ZodEmoji",(e,t)=>{rR.init(e,t),ip.init(e,t)}),ib=e_("ZodNanoID",(e,t)=>{rT.init(e,t),ip.init(e,t)}),iA=e_("ZodCUID",(e,t)=>{rI.init(e,t),ip.init(e,t)}),iE=e_("ZodCUID2",(e,t)=>{rU.init(e,t),ip.init(e,t)}),iv=e_("ZodULID",(e,t)=>{rO.init(e,t),ip.init(e,t)}),ik=e_("ZodXID",(e,t)=>{rP.init(e,t),ip.init(e,t)}),i_=e_("ZodKSUID",(e,t)=>{rC.init(e,t),ip.init(e,t)}),iS=e_("ZodIPv4",(e,t)=>{rN.init(e,t),ip.init(e,t)}),ix=e_("ZodIPv6",(e,t)=>{rj.init(e,t),ip.init(e,t)}),iR=e_("ZodCIDRv4",(e,t)=>{rH.init(e,t),ip.init(e,t)}),iT=e_("ZodCIDRv6",(e,t)=>{rB.init(e,t),ip.init(e,t)}),iI=e_("ZodBase64",(e,t)=>{rM.init(e,t),ip.init(e,t)}),iU=e_("ZodBase64URL",(e,t)=>{rV.init(e,t),ip.init(e,t)}),iO=e_("ZodE164",(e,t)=>{rK.init(e,t),ip.init(e,t)}),iP=e_("ZodJWT",(e,t)=>{rW.init(e,t),ip.init(e,t)}),iC=e_("ZodNumber",(e,t)=>{rF.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let{minimum:i,maximum:a,format:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;"string"==typeof o&&o.includes("int")?r.type="integer":r.type="number";let d="number"==typeof l&&l>=(i??-1/0),u="number"==typeof c&&c<=(a??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;d?p?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof i&&(r.minimum=i),u?p?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:"number"==typeof a&&(r.maximum=a),"number"==typeof s&&(r.multipleOf=s)})(e,t,r,0),is(e,"ZodNumber",{gt(e,t){return this.check(nz(e,t))},gte(e,t){return this.check(nN(e,t))},min(e,t){return this.check(nN(e,t))},lt(e,t){return this.check(nL(e,t))},lte(e,t){return this.check(n$(e,t))},max(e,t){return this.check(n$(e,t))},int(e){return this.check(i$(e))},safe(e){return this.check(i$(e))},positive(e){return this.check(nz(0,e))},nonnegative(e){return this.check(nN(0,e))},negative(e){return this.check(nL(0,e))},nonpositive(e){return this.check(n$(0,e))},multipleOf(e,t){return this.check(nj(e,t))},step(e,t){return this.check(nj(e,t))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function iD(e){return new iC({type:"number",checks:[],...eZ(e)})}let iL=e_("ZodNumberFormat",(e,t)=>{rJ.init(e,t),iC.init(e,t)});function i$(e){return new iL({type:"number",check:"number_format",abort:!1,format:"safeint",...eZ(e)})}let iz=e_("ZodBoolean",(e,t)=>{rZ.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.type="boolean"}});function iN(e){return new iz({type:"boolean",...eZ(e)})}let ij=e_("ZodBigInt",(e,t)=>{rG.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")})(0,e,0,0),e.gte=(t,r)=>e.check(nN(t,r)),e.min=(t,r)=>e.check(nN(t,r)),e.gt=(t,r)=>e.check(nz(t,r)),e.gte=(t,r)=>e.check(nN(t,r)),e.min=(t,r)=>e.check(nN(t,r)),e.lt=(t,r)=>e.check(nL(t,r)),e.lte=(t,r)=>e.check(n$(t,r)),e.max=(t,r)=>e.check(n$(t,r)),e.positive=t=>e.check(nz(BigInt(0),t)),e.negative=t=>e.check(nL(BigInt(0),t)),e.nonpositive=t=>e.check(n$(BigInt(0),t)),e.nonnegative=t=>e.check(nN(BigInt(0),t)),e.multipleOf=(t,r)=>e.check(nj(t,r));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null}),iH=e_("ZodAny",(e,t)=>{rQ.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function iB(){return new iH({type:"any"})}let iq=e_("ZodUnknown",(e,t)=>{rY.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function iM(){return new iq({type:"unknown"})}let iV=e_("ZodNever",(e,t)=>{rX.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}}),iK=e_("ZodDate",(e,t)=>{r0.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")})(0,e,0,0),e.min=(t,r)=>e.check(nN(t,r)),e.max=(t,r)=>e.check(n$(t,r));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null}),iW=e_("ZodArray",(e,t)=>{r2.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,{minimum:a,maximum:o}=e._zod.bag;"number"==typeof a&&(r.minItems=a),"number"==typeof o&&(r.maxItems=o),r.type="array",r.items=nW(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,is(e,"ZodArray",{min(e,t){return this.check(nB(e,t))},nonempty(e){return this.check(nB(1,e))},max(e,t){return this.check(nH(e,t))},length(e,t){return this.check(nq(e,t))},unwrap(){return this.element}})});function iF(e,t){return new iW({type:"array",element:e,...eZ(t)})}let iJ=e_("ZodObject",(e,t)=>{r3.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;r.type="object",r.properties={};let a=i.shape;for(let e in a)r.properties[e]=nW(a[e],t,{...n,path:[...n.path,"properties",e]});let o=new Set([...new Set(Object.keys(a))].filter(e=>{let r=i.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));o.size>0&&(r.required=Array.from(o)),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=nW(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),nV.defineLazy(e,"shape",()=>t.shape),is(e,"ZodObject",{keyof(){return i1(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:iM()})},loose(){return this.clone({...this._zod.def,catchall:iM()})},strict(){return this.clone({...this._zod.def,catchall:new iV({type:"never",...eZ(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return nV.extend(this,e)},safeExtend(e){return nV.safeExtend(this,e)},merge(e){return nV.merge(this,e)},pick(e){return nV.pick(this,e)},omit(e){return nV.omit(this,e)},partial(...e){return nV.partial(i5,this,e[0])},required(...e){return nV.required(ae,this,e[0])}})});function iZ(e,t){return new iJ({type:"object",shape:e??{},...nV.normalizeParams(t)})}let iG=e_("ZodUnion",(e,t)=>{r7.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{var i,a,o,s;let c,l,d;return i=e,a=t,o=r,s=n,l=!1===(c=i._zod.def).inclusive,d=c.options.map((e,t)=>nW(e,a,{...s,path:[...s.path,l?"oneOf":"anyOf",t]})),void(l?o.oneOf=d:o.anyOf=d)},e.options=t.options}),iQ=e_("ZodIntersection",(e,t)=>{nt.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,a,o,s;return a=nW((i=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),o=nW(i.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=[...(s=e=>"allOf"in e&&1===Object.keys(e).length)(a)?a.allOf:[a],...s(o)?o.allOf:[o]])}}),iY=e_("ZodRecord",(e,t)=>{ns.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;r.type="object";let a=i.keyType,o=a._zod.bag,s=o?.patterns;if("loose"===i.mode&&s&&s.size>0){let e=nW(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});for(let t of(r.patternProperties={},s))r.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(r.propertyNames=nW(i.keyType,t,{...n,path:[...n.path,"propertyNames"]})),r.additionalProperties=nW(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let c=a._zod.values;if(c){let e=[...c].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e)}})(e,t,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function iX(e,t,r){return new iY(t&&t._zod?{type:"record",keyType:e,valueType:t,...nV.normalizeParams(r)}:{type:"record",keyType:iu(),valueType:e,...nV.normalizeParams(t)})}let i0=e_("ZodEnum",(e,t)=>{nd.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;(i=eI(e._zod.def.entries)).every(e=>"number"==typeof e)&&(r.type="number"),i.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=i},e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new i0({...t,checks:[],...nV.normalizeParams(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new i0({...t,checks:[],...nV.normalizeParams(n),entries:i})}});function i1(e,t){return new i0({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...nV.normalizeParams(t)})}let i2=e_("ZodTransform",(e,t)=>{nu.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new ex(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(nV.issue(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),r.issues.push(nV.issue(n)))};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}}),i5=e_("ZodOptional",(e,t)=>{nf.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>nQ(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function i6(e){return new i5({type:"optional",innerType:e})}let i4=e_("ZodExactOptional",(e,t)=>{nh.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>nQ(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),i8=e_("ZodNullable",(e,t)=>{nm.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,a,o;return a=nW((i=e._zod.def).innerType,t,n),o=t.seen.get(e),void("openapi-3.0"===t.target?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function i3(e){return new i8({type:"nullable",innerType:e})}let i9=e_("ZodDefault",(e,t)=>{ny.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;nW((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),i7=e_("ZodPrefault",(e,t)=>{nw.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;nW((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),ae=e_("ZodNonOptional",(e,t)=>{nb.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;nW((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),at=e_("ZodCatch",(e,t)=>{nE.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i,a=e._zod.def;nW(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{i=a.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=i})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),ar=e_("ZodPipe",(e,t)=>{nv.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,a,o;return a=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(nW(o="input"===t.io?a?i.out:i.in:i.out,t,n),t.seen.get(e).ref=o)},e.in=t.in,e.out=t.out});function an(e,t){return new ar({type:"pipe",in:e,out:t})}let ai=e_("ZodReadonly",(e,t)=>{nx.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;nW((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),aa=e_("ZodCustom",(e,t)=>{nT.init(e,t),ic.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)}),ao={};function as(e){switch(e.constructor.name){case"ZodString":default:return"string";case"ZodNumber":return"number";case"ZodBoolean":return"boolean";case"ZodObject":return"object";case"ZodArray":return"array"}}function ac(e){let t=[];return e.metadata?.openapi?.parameters?t.push(...e.metadata.openapi.parameters):e.query instanceof iJ&&Object.entries(e.query.shape).forEach(([e,r])=>{r instanceof iJ&&t.push({name:e,in:"query",schema:{type:as(r),..."minLength"in r&&r.minLength?{minLength:r.minLength}:{},description:r.description}})}),t}function al(e){return{400:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}},required:["message"]}}},description:"Bad Request. Usually due to missing parameters, or invalid parameters."},401:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}},required:["message"]}}},description:"Unauthorized. Due to missing or invalid authentication."},403:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}}}}},description:"Forbidden. You do not have permission to access this resource or to perform this action."},404:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}}}}},description:"Not Found. The requested resource was not found."},429:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}}}}},description:"Too Many Requests. You have exceeded the rate limit. Try again later."},500:{content:{"application/json":{schema:{type:"object",properties:{message:{type:"string"}}}}},description:"Internal Server Error. This is a problem with the server that you cannot fix."},...e}}async function ad(e,t){return Object.entries(e).forEach(([e,t])=>{let r=t.options;if(!(!t.path||r.metadata?.SERVER_ONLY)&&("GET"===r.method&&(ao[t.path]={get:{tags:["Default",...r.metadata?.openapi?.tags||[]],description:r.metadata?.openapi?.description,operationId:r.metadata?.openapi?.operationId,security:[{bearerAuth:[]}],parameters:ac(r),responses:al(r.metadata?.openapi?.responses)}}),"POST"===r.method)){let e=function(e){if(e.metadata?.openapi?.requestBody)return e.metadata.openapi.requestBody;if(e.body&&(e.body instanceof iJ||e.body instanceof i5)){let t=e.body.shape;if(!t)return;let r={},n=[];return Object.entries(t).forEach(([e,t])=>{t instanceof iJ&&(r[e]={type:as(t),description:t.description},t instanceof i5||n.push(e))}),{required:!(e.body instanceof i5)&&!!e.body,content:{"application/json":{schema:{type:"object",properties:r,required:n}}}}}}(r);ao[t.path]={post:{tags:["Default",...r.metadata?.openapi?.tags||[]],description:r.metadata?.openapi?.description,operationId:r.metadata?.openapi?.operationId,security:[{bearerAuth:[]}],parameters:ac(r),...e?{requestBody:e}:{requestBody:{content:{"application/json":{schema:{type:"object",properties:{}}}}}},responses:al(r.metadata?.openapi?.responses)}}}}),{openapi:"3.1.1",info:{title:"Better Auth",description:"API Reference for your Better Auth Instance",version:"1.1.0"},components:{schemas:{}},security:[{apiKeyCookie:[]}],servers:[{url:t?.url}],tags:[{name:"Default",description:"Default endpoints that are included with Better Auth by default. These endpoints are not part of any plugin."}],paths:ao}}let au=((o=function(){}).prototype=Object.create(null),Object.freeze(o.prototype),o);function ap(){return{root:{key:""},static:new au}}function af(e){let[t,...r]=e.split("/");return""===r[r.length-1]?r.slice(0,-1):r}function ah(e,t){let r=new au;for(let[n,i]of t){let t=n<0?e.slice(-(n+1)).join("/"):e[n];if("string"==typeof i)r[i]=t;else{let e=t.match(i);if(e)for(let t in e.groups)r[t]=e.groups[t]}}return r}function am(e,t="",r,n){t=t.toUpperCase(),47!==r.charCodeAt(0)&&(r=`/${r}`);let i=af(r=r.replace(/\\:/g,"%3A")),a=e.root,o=0,s=[],c=[];for(let e=0;e<i.length;e++){let t=i[e];if(t.startsWith("**")){a.wildcard||(a.wildcard={key:"**"}),a=a.wildcard,s.push([-(e+1),t.split(":")[1]||"_",2===t.length]);break}if("*"===t||t.includes(":")){if(a.param||(a.param={key:"*"}),a=a.param,"*"===t)s.push([e,`_${o++}`,!0]);else if(t.includes(":",1)){let r=function(e){let t=e.replace(/:(\w+)/g,(e,t)=>`(?<${t}>[^/]+)`).replace(/\./g,"\\.");return RegExp(`^${t}$`)}(t);c[e]=r,a.hasRegexParam=!0,s.push([e,r,!1])}else s.push([e,t.slice(1),!1]);continue}"\\*"===t?t=i[e]="*":"\\*\\*"===t&&(t=i[e]="**");let r=a.static?.[t];if(r)a=r;else{let e={key:t};a.static||(a.static=new au),a.static[t]=e,a=e}}let l=s.length>0;a.methods||(a.methods=new au),a.methods[t]??=[],a.methods[t].push({data:n||null,paramsRegexp:c,paramsMap:l?s:void 0}),l||(e.static["/"+i.join("/")]=a)}function ay(e){return e instanceof X.APIError||e instanceof Y.APIError||e?.name==="APIError"}let ag=ek(async()=>({})),aw=ek.create({use:[ag,ek(async()=>({}))]}),ab=[ag];function aA(e,t,r){let n="string"==typeof e?e:void 0,i="object"==typeof t?t:e,a="function"==typeof t?t:r,o=async e=>{try{return await Q(e,()=>a(e))}catch(r){var t;throw t=e.responseHeaders,ay(r)&&t&&Object.defineProperty(r,X.kAPIErrorHeaderSymbol,{enumerable:!1,configurable:!0,value:t,writable:!1}),r}};return n?ev(n,{...i,use:[...i?.use||[],...ab]},o):ev({...i,use:[...i?.use||[],...ab]},o)}aA.serverOnly=(e,t)=>aA({...e,metadata:{...e.metadata,SERVER_ONLY:!0}},t);var aE=e.i(89551),av=e.i(12714),ak=e.i(50227),a_=e.i(43651),aS=e.i(80527);async function ax(t,r){let n;if(t.database)n="function"==typeof t.database?t.database(t):await r(t);else{let r=Object.keys((0,a_.getAuthTables)(t)).reduce((e,t)=>(e[t]=[],e),{}),{memoryAdapter:i}=await e.A(16432);n=i(r)(t)}return n.transaction||(aS.logger.warn("Adapter does not correctly implement transaction function, patching it automatically. Please update your adapter implementation."),n.transaction=async e=>e(n)),n}async function aR(t){return ax(t,async t=>{let{createKyselyAdapter:r}=await e.A(19783),{kysely:n,databaseType:i,transaction:a}=await r(t);if(!n)throw new Y.BetterAuthError("Failed to initialize database adapter");let{kyselyAdapter:o}=await e.A(19783);return o(n,{type:i||"sqlite",debugLogs:!!t.database&&"debugLogs"in t.database&&t.database.debugLogs,transaction:a})(t)})}var aT=e.i(13906),aI=e.i(15272),aU=e.i(97495),aO=e.i(29401);let aP={postgres:{string:["character varying","varchar","text","uuid"],number:["int4","integer","bigint","smallint","numeric","real","double precision"],boolean:["bool","boolean"],date:["timestamptz","timestamp","date"],json:["json","jsonb"]},mysql:{string:["varchar","text","uuid"],number:["integer","int","bigint","smallint","decimal","float","double"],boolean:["boolean","tinyint"],date:["timestamp","datetime","date"],json:["json"]},sqlite:{string:["TEXT"],number:["INTEGER","REAL"],boolean:["INTEGER","BOOLEAN"],date:["DATE","INTEGER"],json:["TEXT"]},mssql:{string:["varchar","nvarchar","uniqueidentifier"],number:["int","bigint","smallint","decimal","float","double"],boolean:["bit","smallint"],date:["datetime2","date","datetime"],json:["varchar","nvarchar"]}};async function aC(e){try{let t=await aO.sql`SHOW search_path`.execute(e),r=t.rows[0]?.search_path??t.rows[0]?.searchPath;if(r)return r.split(",").map(e=>e.trim()).map(e=>e.replace(/^["']|["']$/g,"")).filter(e=>!e.startsWith("$")&&!e.startsWith("\\$"))[0]||"public"}catch{}return"public"}async function aD(e){let t=function(e){let t=(0,a_.getAuthTables)(e),r={};for(let e in t){let n=t[e],i=n.fields,a={};if(Object.entries(i).forEach(([e,r])=>{if(a[r.fieldName||e]=r,r.references){let n=t[r.references.model];n&&(a[r.fieldName||e].references={...r.references,model:n.modelName,field:r.references.field})}}),r[n.modelName]){r[n.modelName].fields={...r[n.modelName].fields,...a},n.disableMigrations&&(r[n.modelName].disableMigrations=!0);continue}r[n.modelName]={fields:a,order:n.order||1/0,disableMigrations:n.disableMigrations}}return r}(e),r=(0,aS.createLogger)(e.logger),{kysely:n,databaseType:i}=await (0,aT.createKyselyAdapter)(e);i||(r.warn("Could not determine database type, defaulting to sqlite. Please provide a type in the database options to avoid this."),i="sqlite"),n||(r.error("Only kysely adapter is supported for migrations. You can use `generate` command to generate the schema, if you're using a different adapter."),process.exit(1));let a="public";if("postgres"===i){a=await aC(n),r.debug(`PostgreSQL migration: Using schema '${a}' (from search_path)`);try{let e=await aO.sql`
|
|
63
63
|
SELECT schema_name
|
|
64
64
|
FROM information_schema.schemata
|
|
65
65
|
WHERE schema_name = ${a}
|