@shawnstack/quickforge 1.7.4 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AgentProfilesPage-XNjuqJs7.js +1 -0
- package/dist/assets/ChatPanelHost-CuF-PZpc.js +292 -0
- package/dist/assets/CloudAccountSettingsPage-GJSoi6sO.js +1 -0
- package/dist/assets/PluginsPage-BQgp0qN-.js +1 -0
- package/dist/assets/ScheduledTasksPage-DdekATzq.js +2 -0
- package/dist/assets/{SettingsWorkspacePage-B53_eDf2.js → SettingsWorkspacePage-Cb54Ic91.js} +389 -378
- package/dist/assets/ShareLinksSettingsPage-C75WJpaF.js +1 -0
- package/dist/assets/SharedConversationPage-CjMtSQTW.js +1 -0
- package/dist/assets/{TerminalDock-Dgg-_ZmU.js → TerminalDock-D4zJBJc4.js} +2 -2
- package/dist/assets/WorkspaceInspector-D9kdnLDd.js +36 -0
- package/dist/assets/{abnfDiagram-VRR7QNED-Dy7veffk.js → abnfDiagram-VRR7QNED-CMhVoYUh.js} +1 -1
- package/dist/assets/{arc-Bo3p2lGy.js → arc-w21O0TLn.js} +1 -1
- package/dist/assets/architecture-TIHT7OUA-DMwFMHxq.js +1 -0
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-Cwx8qOvu.js → architectureDiagram-ZJ3FMSHR-C52qL6Hg.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-BiuaAOFa.js → blockDiagram-677ZJIJ3-CM3XbLol.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-BTcGfhK2.js → c4Diagram-LMCZKHZV-D7Bh1ui1.js} +1 -1
- package/dist/assets/channel-Duu1CuH9.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-B6rHWc4S.js +1 -0
- package/dist/assets/{chunk-32BRIVSS-B9PuF_RF.js → chunk-32BRIVSS-xgrtbT8e.js} +1 -1
- package/dist/assets/{chunk-52WLFC77-3zGItfIM.js → chunk-52WLFC77-CDbaHw80.js} +1 -1
- package/dist/assets/{chunk-5FCAYU7R-DQ66qlmt.js → chunk-5FCAYU7R-CcSvVbPc.js} +1 -1
- package/dist/assets/{chunk-5HE753X5-CLqTO-VF.js → chunk-5HE753X5-erFpzzgx.js} +1 -1
- package/dist/assets/{chunk-5JV3BV7I-Csxv1jr6.js → chunk-5JV3BV7I-rEhN9F6G.js} +1 -1
- package/dist/assets/{chunk-5TONJI2A-BCQttpBr.js → chunk-5TONJI2A-D8L-QTwD.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-DEWJGSTb.js → chunk-5VM5RSS4-CjlfMBbM.js} +1 -1
- package/dist/assets/{chunk-7BUUIJ7U-DNorm9MM.js → chunk-7BUUIJ7U-CCcsI9XE.js} +1 -1
- package/dist/assets/{chunk-BIQX33UG-DgvY_BOT.js → chunk-BIQX33UG-FSqFbmb3.js} +1 -1
- package/dist/assets/{chunk-C7G6YPKG-DMvn9IPs.js → chunk-C7G6YPKG-ZMLUvfLy.js} +1 -1
- package/dist/assets/{chunk-CQNSW5MT-Dq2duUgr.js → chunk-CQNSW5MT-DZuBpk25.js} +1 -1
- package/dist/assets/{chunk-CYSBUYHQ-BovYyc4Y.js → chunk-CYSBUYHQ-CB26wsG0.js} +1 -1
- package/dist/assets/{chunk-EMLP6XTP-BMDOpuYN.js → chunk-EMLP6XTP-BbsM8oRw.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-6eP2UPOf.js → chunk-EX3LRPZG-BcQhaqt7.js} +1 -1
- package/dist/assets/{chunk-FWX5IMBZ-D4q-wTSy.js → chunk-FWX5IMBZ-DrnrdrSu.js} +2 -2
- package/dist/assets/{chunk-HOUHSVGY-XjIcuzH7.js → chunk-HOUHSVGY-tdc-Z9eW.js} +1 -1
- package/dist/assets/{chunk-ICXQ74PX-YBXbanq9.js → chunk-ICXQ74PX-Cd7igVGt.js} +1 -1
- package/dist/assets/{chunk-JG7HCLWE-CcN3uNXF.js → chunk-JG7HCLWE-iXXGW8nf.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-Cwg6AUAt.js → chunk-JWPE2WC7-BZ87mXEv.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-NNspcGIU.js → chunk-MOJQB5TN-CLTjV5ov.js} +1 -1
- package/dist/assets/{chunk-MOZMSUNE-pMJ_jMos.js → chunk-MOZMSUNE-B3SCBrRH.js} +1 -1
- package/dist/assets/{chunk-OGEWGWER-CJy-3Ldv.js → chunk-OGEWGWER-TgvkXkFX.js} +1 -1
- package/dist/assets/{chunk-OSBZ3O6U-D7cLHHOA.js → chunk-OSBZ3O6U-B9E2E5v1.js} +1 -1
- package/dist/assets/{chunk-PUDLZKDR-D5YBi1Pi.js → chunk-PUDLZKDR-C5GMVYup.js} +1 -1
- package/dist/assets/{chunk-Q4XR5HBZ-DYmqQdIf.js → chunk-Q4XR5HBZ-fo5-HsqY.js} +1 -1
- package/dist/assets/{chunk-QBLGF6JB-Bfcx00X0.js → chunk-QBLGF6JB-Dwfg8sKc.js} +1 -1
- package/dist/assets/{chunk-R7FJI6CG-oXzadpZY.js → chunk-R7FJI6CG-DpBrv4ni.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-Dt3-8yUh.js → chunk-RYQCIY6F-DzzmTl11.js} +1 -1
- package/dist/assets/{chunk-U6XO7XAA-B55eSvpx.js → chunk-U6XO7XAA-Dw6aviKa.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-Btk4JwCt.js → chunk-V7JOEXUC-CEDazV6w.js} +1 -1
- package/dist/assets/chunk-VAUOI2AC-CWYjg8zE.js +1 -0
- package/dist/assets/{chunk-VR4S4FIN-DgaSiVOY.js → chunk-VR4S4FIN-C_-eEj-9.js} +1 -1
- package/dist/assets/{chunk-WYO6CB5R-rRDZ_Tta.js → chunk-WYO6CB5R-NF-MsJJR.js} +3 -3
- package/dist/assets/chunk-XXDRQBXY-DzTwx8ZH.js +1 -0
- package/dist/assets/{chunk-YOTPTUD7-BnFxj5o4.js → chunk-YOTPTUD7-DqzqtdII.js} +1 -1
- package/dist/assets/{chunk-ZGVPDNZ5-CrnlPlmJ.js → chunk-ZGVPDNZ5-CRrAYi4g.js} +1 -1
- package/dist/assets/{chunk-ZIRB5QZD-BYTiATIH.js → chunk-ZIRB5QZD-Dc1s5bLM.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-Cc63fLWP.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-CoXU0qT6.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-BORKJRwF.js → cose-bilkent-JH36ORCC-cL247pHg.js} +1 -1
- package/dist/assets/cynefin-VYW2F7L2-C8yCvH_o.js +1 -0
- package/dist/assets/{cynefinDiagram-TSTJHNR4-BXKeaSl8.js → cynefinDiagram-TSTJHNR4-D4sZ7LYI.js} +1 -1
- package/dist/assets/{dagre-CrA0XVwJ.js → dagre-DmHb3Ctt.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-ouq_lA1a.js → dagre-VKFMJZFB-BlsnSh-Q.js} +1 -1
- package/dist/assets/{diagram-FQU43EPY-BxR5kUiQ.js → diagram-FQU43EPY-DW1yQiRO.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-DWonk1sL.js → diagram-G47NLZAW-BTUAsFjb.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-fmV_wV5e.js → diagram-NH7WQ7WH-BcaomqSd.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-DvOSRRiV.js → diagram-OA4YK3LP-DDLX7Xwr.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-Bp-xb3uS.js → diagram-WEI45ONY-CIave0An.js} +1 -1
- package/dist/assets/{ebnfDiagram-CCIWWBDH-BTlnwneA.js → ebnfDiagram-CCIWWBDH-Cr1Y6lPu.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-C3fFWGCm.js → erDiagram-Q63AITRT-D3EgiVVH.js} +1 -1
- package/dist/assets/{esm-oa69b5u4.js → esm-Df4edDpj.js} +2 -2
- package/dist/assets/eventmodeling-45OFAUF4-DO1vRTM0.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-BS7KXcqn.js +1 -0
- package/dist/assets/{ganttDiagram-NO4QXBWP-DzAiojNi.js → ganttDiagram-NO4QXBWP-B0oyDIqK.js} +1 -1
- package/dist/assets/gitGraph-TEB2WS4Q-m5F5ef09.js +1 -0
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-Cv57oNEA.js → gitGraphDiagram-IHSO6WYX-uQtr6IqK.js} +1 -1
- package/dist/assets/icons-CXPP1fFT.js +1 -0
- package/dist/assets/index-_ZhK6bvp.js +65 -0
- package/dist/assets/index-iVV2bP_f.css +3 -0
- package/dist/assets/info-DKCQHKI2-CZxPlQJ0.js +1 -0
- package/dist/assets/{infoDiagram-FWYZ7A6U-B5Z_O3Ro.js → infoDiagram-FWYZ7A6U-B_GzlLIM.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-CKTK_TKV.js → ishikawaDiagram-FXEZZL3T-CKQIsSdU.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-Cm9k4ywW.js → journeyDiagram-5HDEW3XC-DrrvzZL1.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-DzNteLwx.js → kanban-definition-HUTT4EX6-CJQRTdXz.js} +1 -1
- package/dist/assets/{line-BG78c_WJ.js → line-B4DxX7tC.js} +1 -1
- package/dist/assets/{linear-1X20_EGu.js → linear-U-nKUhyW.js} +1 -1
- package/dist/assets/{map-CCI8WZkS.js → map-BneTM-ri.js} +1 -1
- package/dist/assets/{mcp-servers-dialog-GXXD9K0U.js → mcp-servers-dialog-BUSPvaqI.js} +2 -2
- package/dist/assets/{mermaid-parser.core-Bb8HI_OS.js → mermaid-parser.core-BlKWrEdZ.js} +2 -2
- package/dist/assets/{mermaid-renderer-PIaNiXAz.js → mermaid-renderer-jEbqFaTe.js} +2 -2
- package/dist/assets/{mermaid.core-DUHOIwL5.js → mermaid.core-DWpShXCs.js} +3 -3
- package/dist/assets/{mindmap-definition-LN4V7U3C-Tnbszo7b.js → mindmap-definition-LN4V7U3C-CEVwZD78.js} +1 -1
- package/dist/assets/model-identity-CgA6_Pbm.js +1 -0
- package/dist/assets/model-reference-o41fJ6jQ.js +1 -0
- package/dist/assets/{monaco-BVtCspYZ.js → monaco-D6OhXgjg.js} +1 -1
- package/dist/assets/{ordinal-v4prQcuq.js → ordinal-B2r5L1v4.js} +1 -1
- package/dist/assets/{otel-D1LswXpM.js → otel-BFnphzjt.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-zIioIZVN.js +1 -0
- package/dist/assets/{pegDiagram-2B236MQR-CX824Kd0.js → pegDiagram-2B236MQR-CBLkBdnQ.js} +1 -1
- package/dist/assets/{pi-ai-DAJlO9ZB.js → pi-ai-Cr2ee4a0.js} +2 -2
- package/dist/assets/{pi-web-ui-B-RJSxjR.js → pi-web-ui-DV5jKjSg.js} +1 -1
- package/dist/assets/pie-RZYD4A2V-GGWijBvB.js +1 -0
- package/dist/assets/{pieDiagram-ENE6RG2P-BT04VWPQ.js → pieDiagram-ENE6RG2P-8tCnwtWS.js} +1 -1
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-BvOZxkBr.js → quadrantDiagram-ABIIQ3AL-CWd28cHF.js} +1 -1
- package/dist/assets/radar-I7S5WNFK-yvwFH3RV.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-BVadlswB.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-B7R-p_2-.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-BnbJxPug.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-Ci3DcEuQ.js +1 -0
- package/dist/assets/{railroadDiagram-RFXS5EU6-DnTU--BV.js → railroadDiagram-RFXS5EU6-CI4ouOBs.js} +1 -1
- package/dist/assets/{react-vendor-eWH0QhNU.js → react-vendor-1KC5PyRx.js} +1 -1
- package/dist/assets/{requirementDiagram-TGXJPOKE--MZX_yEv.js → requirementDiagram-TGXJPOKE-DtFz7sw4.js} +1 -1
- package/dist/assets/{sankeyDiagram-HTMAVEWB-SEZkHhYn.js → sankeyDiagram-HTMAVEWB--VeOwwk9.js} +1 -1
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-BhC2OHiz.js → sequenceDiagram-DBY2YBRQ-B8AHk5Oe.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-Ci5LeToV.js → sizeCapture-X5ZJPWSS-vV_ArM8D.js} +1 -1
- package/dist/assets/{skills-dialog-DDh1h8eH.js → skills-dialog-BThnIUBs.js} +3 -3
- package/dist/assets/{src-CovulcRC.js → src-PYsDme0X.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-DKK5tFT4.js → stateDiagram-2N3HPSRC-etXnJ8X8.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-Dms3pICj.js +1 -0
- package/dist/assets/{swimlanes-5IMT3BWC-DxxGCk67.js → swimlanes-5IMT3BWC-pabIKAmn.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-B14aWjv6.js +8 -0
- package/dist/assets/{timeline-definition-FHXFAJF6-BPXB3Sue.js → timeline-definition-FHXFAJF6-C55MKm3L.js} +1 -1
- package/dist/assets/treeView-QDETBFTQ-Cru9B2zv.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-DNOVHFaJ.js +1 -0
- package/dist/assets/{vennDiagram-L72KCM5P-CxcBCKye.js → vennDiagram-L72KCM5P-CgNf1Q9W.js} +1 -1
- package/dist/assets/wardley-OPB4EBWU-E3m1BOJQ.js +1 -0
- package/dist/assets/{wardleyDiagram-EHGQE667-DEL6Yes5.js → wardleyDiagram-EHGQE667-Drt5ytec.js} +1 -1
- package/dist/assets/{xychartDiagram-FW5EYKEG-N8cPbcjC.js → xychartDiagram-FW5EYKEG-hhoEo_Ar.js} +1 -1
- package/dist/index.html +9 -8
- package/package.json +3 -1
- package/plugins/{openai-documents → documents}/plugin.json +2 -2
- package/plugins/{openai-presentations → presentations}/plugin.json +2 -2
- package/plugins/{openai-spreadsheets → spreadsheets}/plugin.json +2 -2
- package/server/acp/server.mjs +36 -26
- package/server/agent-manager.mjs +130 -28
- package/server/agent-profile-files.mjs +8 -4
- package/server/agent-profile-schema.mjs +47 -23
- package/server/agent-profiles.mjs +1 -1
- package/server/ai-http-logger.mjs +98 -12
- package/server/cloud/chat-idempotency-store.mjs +96 -0
- package/server/cloud/client.mjs +102 -0
- package/server/cloud/config.mjs +53 -0
- package/server/cloud/credential-store.mjs +193 -0
- package/server/cloud/identity.mjs +355 -0
- package/server/cloud/index.mjs +7 -0
- package/server/cloud/models.mjs +80 -0
- package/server/cloud/runtime.mjs +129 -0
- package/server/cloud/service-config.mjs +77 -0
- package/server/index.mjs +28 -11
- package/server/model-catalog.mjs +262 -0
- package/server/plugins/registry.mjs +29 -5
- package/server/routes/agent-profiles.mjs +41 -7
- package/server/routes/agent.mjs +20 -11
- package/server/routes/backup.mjs +7 -1
- package/server/routes/cloud.mjs +227 -0
- package/server/routes/models.mjs +7 -1
- package/server/routes/scheduled-tasks.mjs +38 -8
- package/server/routes/shared-conversation.mjs +62 -58
- package/server/routes/shares.mjs +76 -1
- package/server/routes/storage.mjs +24 -1
- package/server/routes/workspace.mjs +6 -4
- package/server/share-store.mjs +168 -13
- package/server/skills.mjs +30 -3
- package/server/storage.mjs +7 -1
- package/server/subagents.mjs +3 -3
- package/server/tools/definitions.mjs +1 -1
- package/server/tools/index.mjs +2 -2
- package/server/utils/network.mjs +9 -0
- package/server/utils/response.mjs +8 -1
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/SKILL.md +485 -0
- package/skills/skill-creator/UPSTREAM.md +6 -0
- package/skills/skill-creator/agents/analyzer.md +274 -0
- package/skills/skill-creator/agents/comparator.md +202 -0
- package/skills/skill-creator/agents/grader.md +223 -0
- package/skills/skill-creator/assets/eval_review.html +146 -0
- package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/skill-creator/references/schemas.md +430 -0
- package/skills/skill-creator/scripts/__init__.py +0 -0
- package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/skill-creator/scripts/generate_report.py +326 -0
- package/skills/skill-creator/scripts/improve_description.py +247 -0
- package/skills/skill-creator/scripts/package_skill.py +136 -0
- package/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/skills/skill-creator/scripts/run_eval.py +310 -0
- package/skills/skill-creator/scripts/run_loop.py +328 -0
- package/skills/skill-creator/scripts/utils.py +47 -0
- package/dist/assets/AgentProfilesPage-B84w-r9S.js +0 -1
- package/dist/assets/ChatPanelHost-CyO8fEoj.js +0 -288
- package/dist/assets/PluginsPage-D2862wul.js +0 -1
- package/dist/assets/ScheduledTasksPage-GqbiJDPX.js +0 -2
- package/dist/assets/SharedConversationPage-Cw2QFnbC.js +0 -1
- package/dist/assets/WorkspaceInspector-3uLiu6Bv.js +0 -13
- package/dist/assets/architecture-TIHT7OUA-7FQo5GbP.js +0 -1
- package/dist/assets/channel-DToA8d-4.js +0 -1
- package/dist/assets/chunk-2Q5K7J3B-D_Wxpk-T.js +0 -1
- package/dist/assets/chunk-VAUOI2AC-CIZseNLi.js +0 -1
- package/dist/assets/chunk-XXDRQBXY-Do-XYxat.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-Bu24Sy-k.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-DKhh5HSW.js +0 -1
- package/dist/assets/cynefin-VYW2F7L2-oyiAgYC4.js +0 -1
- package/dist/assets/eventmodeling-45OFAUF4-YB_0MefX.js +0 -1
- package/dist/assets/flowDiagram-23GEKE2U-Bc73xdBd.js +0 -1
- package/dist/assets/gitGraph-TEB2WS4Q-Bvp27L0n.js +0 -1
- package/dist/assets/icons-cTkqD_Gi.js +0 -1
- package/dist/assets/index-B48prgLL.js +0 -65
- package/dist/assets/index-DQhwHHer.css +0 -3
- package/dist/assets/info-DKCQHKI2-BsLOivgq.js +0 -1
- package/dist/assets/packet-7NZHBO7P-BKQkXRtk.js +0 -1
- package/dist/assets/pie-RZYD4A2V-BTiTN5Ge.js +0 -1
- package/dist/assets/radar-I7S5WNFK-BU-oVjKM.js +0 -1
- package/dist/assets/railroad-3IZDKUUU-7H2hxNbL.js +0 -1
- package/dist/assets/railroad-abnf-AHOZXSZD-Mx6wf6XQ.js +0 -1
- package/dist/assets/railroad-ebnf-EBAXGLYW-BgXSKhYy.js +0 -1
- package/dist/assets/railroad-peg-LSFZ7HO6-DTEl2rAC.js +0 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-D8x3mkni.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-C4nOBNp8.js +0 -8
- package/dist/assets/treeView-QDETBFTQ-DOE6NSdf.js +0 -1
- package/dist/assets/treemap-6X3UGDF4-Ca7QD_b4.js +0 -1
- package/dist/assets/wardley-OPB4EBWU-D9O4RKRm.js +0 -1
- /package/dist/assets/{array-DqLCdDFv.js → array-B9UHiPd-.js} +0 -0
- /package/dist/assets/{chunk-KEIR6QF5-s7Qq-R3i.js → chunk-KEIR6QF5-jrz1pRUS.js} +0 -0
- /package/dist/assets/{chunk-Y2CYZVJY-BgISNSiw.js → chunk-Y2CYZVJY-D6N-CrJv.js} +0 -0
- /package/dist/assets/{cytoscape.esm-iekjSZ2n.js → cytoscape.esm-DyfqweF2.js} +0 -0
- /package/dist/assets/{defaultLocale-CrJzLgRD.js → defaultLocale-5eAKkKJC.js} +0 -0
- /package/dist/assets/{dist-zzfqk5hx.js → dist-CLg13NtV.js} +0 -0
- /package/dist/assets/{graphlib-CIz_CfxW.js → graphlib-DJkmx0Cq.js} +0 -0
- /package/dist/assets/{init-C0r9Gk5G.js → init-DlZdxViB.js} +0 -0
- /package/dist/assets/{path-DIKpVbHL.js → path-6uRLdFF7.js} +0 -0
- /package/dist/assets/{plugin-api-C8hMT5W6.js → plugin-api-Uu2xAB4d.js} +0 -0
- /package/dist/assets/{rough.esm-BMOtDaaS.js → rough.esm-Bud4g4fh.js} +0 -0
- /package/dist/assets/{web-RgX7H-OH.js → web-DoV8MSMn.js} +0 -0
- /package/dist/assets/{xterm-BFzZ1FH4.js → xterm-Bm_IbozX.js} +0 -0
- /package/plugins/{openai-documents → documents}/commands/document.md +0 -0
- /package/plugins/{openai-documents → documents}/skills/documents/SKILL.md +0 -0
- /package/plugins/{openai-presentations → presentations}/commands/presentation.md +0 -0
- /package/plugins/{openai-presentations → presentations}/skills/presentations/SKILL.md +0 -0
- /package/plugins/{openai-spreadsheets → spreadsheets}/commands/spreadsheet.md +0 -0
- /package/plugins/{openai-spreadsheets → spreadsheets}/skills/spreadsheets/SKILL.md +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-jrz1pRUS.js";import{n as e}from"./chunk-EMLP6XTP-BbsM8oRw.js";export{e as createPacketServices};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-JG7HCLWE-
|
|
1
|
+
import{n as e}from"./chunk-JG7HCLWE-iXXGW8nf.js";import{n as t}from"./chunk-Y2CYZVJY-D6N-CrJv.js";import{m as n}from"./src-PYsDme0X.js";import"./chunk-WYO6CB5R-NF-MsJJR.js";import"./chunk-VAUOI2AC-CWYjg8zE.js";import{n as r,r as i,t as a}from"./chunk-MOJQB5TN-CLTjV5ov.js";import{t as o}from"./chunk-JWPE2WC7-BZ87mXEv.js";import{t as s}from"./mermaid-parser.core-BlKWrEdZ.js";var c=e().RailroadPeg.parser.LangiumParser,l=t(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformOrderedChoice`),u=t(e=>{let t=e.elements.map(d);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=t(e=>{let t=p(e.suffix);return e.operator?{type:`special`,text:e.operator===`&`?`&${f(t)}`:`!${f(t)}`}:t},`transformPrefix`),f=t(e=>{switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}},`nodeToLabel`),p=t(e=>{let t=m(e.primary);if(!e.operator)return t;switch(e.operator){case`?`:return{type:`optional`,element:t};case`*`:return{type:`repetition`,element:t,min:0,max:1/0};case`+`:return{type:`repetition`,element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},`transformSuffix`),m=t(e=>{switch(e.$type){case`PegLiteral`:return{type:`terminal`,value:e.value};case`PegIdentifier`:return{type:`nonterminal`,name:e.name};case`PegGroup`:return l(e.element);case`PegAny`:return{type:`special`,text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},`transformPrimary`),h=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),g=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(h(e)))},`populateDb`),_={parser:{parse:t(e=>{a.clear(),n.debug(`[PEG Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[PEG Parser] Parsed rules:`,r.rules.length),g(r),n.debug(`[PEG Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{_ as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/otel-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/otel-BFnphzjt.js","assets/rolldown-runtime-DWdDZTNf.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{i as e,n as t,t as n}from"./rolldown-runtime-DWdDZTNf.js";var r=`modulepreload`,i=function(e){return`/`+e},a={},o=function(e,t,n){let o=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}o=l(t.map(t=>{if(t=i(t,n),t in a)return;a[t]=!0;let o=t.endsWith(`.css`),s=o?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.href===t&&(!o||r.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${s}`))return;let l=document.createElement(`link`);if(l.rel=o?`stylesheet`:r,o||(l.as=`script`),l.crossOrigin=``,l.href=t,c&&l.setAttribute(`nonce`,c),document.head.appendChild(l),o)return new Promise((e,n)=>{l.addEventListener(`load`,e),l.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},s=n(((e,t)=>{t.exports={}})),c=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Allow=e.ALL=e.COLLECTION=e.ATOM=e.SPECIAL=e.INF=e._INFINITY=e.INFINITY=e.NAN=e.BOOL=e.NULL=e.OBJ=e.ARR=e.NUM=e.STR=void 0,e.STR=1,e.NUM=2,e.ARR=4,e.OBJ=8,e.NULL=16,e.BOOL=32,e.NAN=64,e.INFINITY=128,e._INFINITY=256,e.INF=e.INFINITY|e._INFINITY,e.SPECIAL=e.NULL|e.BOOL|e.INF|e.NAN,e.ATOM=e.STR|e.NUM|e.SPECIAL,e.COLLECTION=e.ARR|e.OBJ,e.ALL=e.ATOM|e.COLLECTION,e.Allow={STR:e.STR,NUM:e.NUM,ARR:e.ARR,OBJ:e.OBJ,NULL:e.NULL,BOOL:e.BOOL,NAN:e.NAN,INFINITY:e.INFINITY,_INFINITY:e._INFINITY,INF:e.INF,SPECIAL:e.SPECIAL,ATOM:e.ATOM,COLLECTION:e.COLLECTION,ALL:e.ALL},e.default=e.Allow})),l=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.Allow=e.MalformedJSON=e.PartialJSON=e.parseJSON=e.parse=void 0;var r=c();Object.defineProperty(e,`Allow`,{enumerable:!0,get:function(){return r.Allow}}),n(c(),e);var i=class extends Error{};e.PartialJSON=i;var a=class extends Error{};e.MalformedJSON=a;function o(e,t=r.Allow.ALL){if(typeof e!=`string`)throw TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw Error(`${e} is empty`);return s(e.trim(),t)}e.parseJSON=o;var s=(e,t)=>{let n=e.length,o=0,s=e=>{throw new i(`${e} at position ${o}`)},c=e=>{throw new a(`${e} at position ${o}`)},l=()=>(m(),o>=n&&s(`Unexpected end of input`),e[o]===`"`?u():e[o]===`{`?d():e[o]===`[`?f():e.substring(o,o+4)===`null`||r.Allow.NULL&t&&n-o<4&&`null`.startsWith(e.substring(o))?(o+=4,null):e.substring(o,o+4)===`true`||r.Allow.BOOL&t&&n-o<4&&`true`.startsWith(e.substring(o))?(o+=4,!0):e.substring(o,o+5)===`false`||r.Allow.BOOL&t&&n-o<5&&`false`.startsWith(e.substring(o))?(o+=5,!1):e.substring(o,o+8)===`Infinity`||r.Allow.INFINITY&t&&n-o<8&&`Infinity`.startsWith(e.substring(o))?(o+=8,1/0):e.substring(o,o+9)===`-Infinity`||r.Allow._INFINITY&t&&1<n-o&&n-o<9&&`-Infinity`.startsWith(e.substring(o))?(o+=9,-1/0):e.substring(o,o+3)===`NaN`||r.Allow.NAN&t&&n-o<3&&`NaN`.startsWith(e.substring(o))?(o+=3,NaN):p()),u=()=>{let i=o,a=!1;for(o++;o<n&&(e[o]!==`"`||a&&e[o-1]===`\\`);)a=e[o]===`\\`?!a:!1,o++;if(e.charAt(o)==`"`)try{return JSON.parse(e.substring(i,++o-Number(a)))}catch(e){c(String(e))}else if(r.Allow.STR&t)try{return JSON.parse(e.substring(i,o-Number(a))+`"`)}catch{return JSON.parse(e.substring(i,e.lastIndexOf(`\\`))+`"`)}s(`Unterminated string literal`)},d=()=>{o++,m();let i={};try{for(;e[o]!==`}`;){if(m(),o>=n&&r.Allow.OBJ&t)return i;let a=u();m(),o++;try{i[a]=l()}catch(e){if(r.Allow.OBJ&t)return i;throw e}m(),e[o]===`,`&&o++}}catch{if(r.Allow.OBJ&t)return i;s(`Expected '}' at end of object`)}return o++,i},f=()=>{o++;let n=[];try{for(;e[o]!==`]`;)n.push(l()),m(),e[o]===`,`&&o++}catch{if(r.Allow.ARR&t)return n;s(`Expected ']' at end of array`)}return o++,n},p=()=>{if(o===0){e===`-`&&c(`Not sure what '-' is`);try{return JSON.parse(e)}catch(n){if(r.Allow.NUM&t)try{return JSON.parse(e.substring(0,e.lastIndexOf(`e`)))}catch{}c(String(n))}}let i=o;for(e[o]===`-`&&o++;e[o]&&`,]}`.indexOf(e[o])===-1;)o++;o==n&&!(r.Allow.NUM&t)&&s(`Unterminated number literal`);try{return JSON.parse(e.substring(i,o))}catch{e.substring(i,o)===`-`&&s(`Not sure what '-' is`);try{return JSON.parse(e.substring(i,e.lastIndexOf(`e`)))}catch(e){c(String(e))}}},m=()=>{for(;o<n&&`
|
|
3
3
|
\r `.includes(e[o]);)o++};return l()};e.parse=o})),u=Symbol(`Let zodToJsonSchema decide on which parser to use`),d={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,target:`jsonSchema7`,strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`,openAiAnyTypeName:`OpenAiAnyType`},f=e=>typeof e==`string`?{...d,name:e}:{...d,...e},p=e=>{let t=f(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};function m(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function h(e,t,n,r,i){e[t]=n,m(e,t,r,i)}var g=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join(`/`)},_;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(_||={});var ee;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(ee||={});var v=_.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),te=e=>{switch(typeof e){case`undefined`:return v.undefined;case`string`:return v.string;case`number`:return Number.isNaN(e)?v.nan:v.number;case`boolean`:return v.boolean;case`function`:return v.function;case`bigint`:return v.bigint;case`symbol`:return v.symbol;case`object`:return Array.isArray(e)?v.array:e===null?v.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?v.promise:typeof Map<`u`&&e instanceof Map?v.map:typeof Set<`u`&&e instanceof Set?v.set:typeof Date<`u`&&e instanceof Date?v.date:v.object;default:return v.unknown}},y=_.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),ne=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};ne.create=e=>new ne(e);var re=(e,t)=>{let n;switch(e.code){case y.invalid_type:n=e.received===v.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case y.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,_.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:n=`Unrecognized key(s) in object: ${_.joinValues(e.keys,`, `)}`;break;case y.invalid_union:n=`Invalid input`;break;case y.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${_.joinValues(e.options)}`;break;case y.invalid_enum_value:n=`Invalid enum value. Expected ${_.joinValues(e.options)}, received '${e.received}'`;break;case y.invalid_arguments:n=`Invalid function arguments`;break;case y.invalid_return_type:n=`Invalid function return type`;break;case y.invalid_date:n=`Invalid date`;break;case y.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:_.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case y.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case y.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case y.custom:n=`Invalid input`;break;case y.invalid_intersection_types:n=`Intersection results could not be merged`;break;case y.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case y.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,_.assertNever(e)}return{message:n}},ie=re;function ae(){return ie}var oe=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function se(e,t){let n=ae(),r=oe({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===re?void 0:re].filter(e=>!!e)});e.common.issues.push(r)}var ce=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return le;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return le;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},le=Object.freeze({status:`aborted`}),ue=e=>({status:`dirty`,value:e}),de=e=>({status:`valid`,value:e}),fe=e=>e.status===`aborted`,pe=e=>e.status===`dirty`,me=e=>e.status===`valid`,he=e=>typeof Promise<`u`&&e instanceof Promise,ge;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(ge||={});var _e=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ve=(e,t)=>{if(me(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new ne(e.common.issues);return this._error=t,this._error}}};function ye(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var be=class{get description(){return this._def.description}_getType(e){return te(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ce,ctx:{common:e.parent.common,data:e.data,parsedType:te(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(he(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:te(e)};return ve(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:te(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return me(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>me(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:te(e)},r=this._parse({data:e,path:n.path,parent:n});return ve(n,await(he(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:y.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new Ct({schema:this,typeName:Mt.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return wt.create(this,this._def)}nullable(){return Tt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return it.create(this)}promise(){return St.create(this,this._def)}or(e){return st.create([this,e],this._def)}and(e){return dt.create(this,e,this._def)}transform(e){return new Ct({...ye(this._def),schema:this,typeName:Mt.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Et({...ye(this._def),innerType:this,defaultValue:t,typeName:Mt.ZodDefault})}brand(){return new kt({typeName:Mt.ZodBranded,type:this,...ye(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Dt({...ye(this._def),innerType:this,catchValue:t,typeName:Mt.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return At.create(this,e)}readonly(){return jt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xe=/^c[^\s-]{8,}$/i,Se=/^[0-9a-z]+$/,Ce=/^[0-9A-HJKMNP-TV-Z]{26}$/i,we=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Te=/^[a-z0-9_-]{21}$/i,Ee=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,De=/^[-+]?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)?)??$/,Oe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ke=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Ae,je=/^(?:(?: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])$/,Me=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Ne=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Pe=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ie=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Le=`((\\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])))`,Re=RegExp(`^${Le}$`);function ze(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Be(e){return RegExp(`^${ze(e)}$`)}function Ve(e){let t=`${Le}T${ze(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function He(e,t){return!!((t===`v4`||!t)&&je.test(e)||(t===`v6`||!t)&&Ne.test(e))}function Ue(e,t){if(!Ee.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function We(e,t){return!!((t===`v4`||!t)&&Me.test(e)||(t===`v6`||!t)&&Pe.test(e))}var Ge=class e extends be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==v.string){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.string,received:t.parsedType}),le}let t=new ce,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),se(n,{code:y.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),se(n,{code:y.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?se(n,{code:y.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&se(n,{code:y.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Oe.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`email`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Ae||=new RegExp(ke,`u`),Ae.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`emoji`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)we.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`uuid`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Te.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`nanoid`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)xe.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`cuid`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Se.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`cuid2`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)Ce.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`ulid`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),se(n,{validation:`url`,code:y.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`regex`,code:y.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),se(n,{code:y.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),se(n,{code:y.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),se(n,{code:y.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Ve(r).test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:y.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Re.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:y.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Be(r).test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{code:y.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?De.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`duration`,code:y.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?He(e.data,r.version)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`ip`,code:y.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Ue(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`jwt`,code:y.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?We(e.data,r.version)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`cidr`,code:y.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Fe.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`base64`,code:y.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Ie.test(e.data)||(n=this._getOrReturnCtx(e,n),se(n,{validation:`base64url`,code:y.invalid_string,message:r.message}),t.dirty()):_.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:y.invalid_string,...ge.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...ge.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...ge.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...ge.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...ge.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...ge.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...ge.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...ge.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...ge.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...ge.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...ge.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...ge.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...ge.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...ge.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...ge.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...ge.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...ge.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...ge.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...ge.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...ge.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...ge.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...ge.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...ge.errToObj(t)})}nonempty(e){return this.min(1,ge.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Ge.create=e=>new Ge({checks:[],typeName:Mt.ZodString,coerce:e?.coerce??!1,...ye(e)});function Ke(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var qe=class e extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==v.number){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.number,received:t.parsedType}),le}let t,n=new ce;for(let r of this._def.checks)r.kind===`int`?_.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),se(t,{code:y.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),se(t,{code:y.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),se(t,{code:y.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Ke(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),se(t,{code:y.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),se(t,{code:y.not_finite,message:r.message}),n.dirty()):_.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,ge.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,ge.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,ge.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,ge.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ge.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:ge.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:ge.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:ge.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:ge.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:ge.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&_.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};qe.create=e=>new qe({checks:[],typeName:Mt.ZodNumber,coerce:e?.coerce||!1,...ye(e)});var Je=class e extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==v.bigint)return this._getInvalidInput(e);let t,n=new ce;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),se(t,{code:y.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),se(t,{code:y.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),se(t,{code:y.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):_.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.bigint,received:t.parsedType}),le}gte(e,t){return this.setLimit(`min`,e,!0,ge.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,ge.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,ge.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,ge.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ge.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:ge.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:ge.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Je.create=e=>new Je({checks:[],typeName:Mt.ZodBigInt,coerce:e?.coerce??!1,...ye(e)});var Ye=class extends be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.boolean,received:t.parsedType}),le}return de(e.data)}};Ye.create=e=>new Ye({typeName:Mt.ZodBoolean,coerce:e?.coerce||!1,...ye(e)});var Xe=class e extends be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==v.date){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.date,received:t.parsedType}),le}if(Number.isNaN(e.data.getTime()))return se(this._getOrReturnCtx(e),{code:y.invalid_date}),le;let t=new ce,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),se(n,{code:y.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),se(n,{code:y.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):_.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:ge.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:ge.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Xe.create=e=>new Xe({checks:[],coerce:e?.coerce||!1,typeName:Mt.ZodDate,...ye(e)});var Ze=class extends be{_parse(e){if(this._getType(e)!==v.symbol){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.symbol,received:t.parsedType}),le}return de(e.data)}};Ze.create=e=>new Ze({typeName:Mt.ZodSymbol,...ye(e)});var Qe=class extends be{_parse(e){if(this._getType(e)!==v.undefined){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.undefined,received:t.parsedType}),le}return de(e.data)}};Qe.create=e=>new Qe({typeName:Mt.ZodUndefined,...ye(e)});var $e=class extends be{_parse(e){if(this._getType(e)!==v.null){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.null,received:t.parsedType}),le}return de(e.data)}};$e.create=e=>new $e({typeName:Mt.ZodNull,...ye(e)});var et=class extends be{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}};et.create=e=>new et({typeName:Mt.ZodAny,...ye(e)});var tt=class extends be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}};tt.create=e=>new tt({typeName:Mt.ZodUnknown,...ye(e)});var nt=class extends be{_parse(e){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.never,received:t.parsedType}),le}};nt.create=e=>new nt({typeName:Mt.ZodNever,...ye(e)});var rt=class extends be{_parse(e){if(this._getType(e)!==v.undefined){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.void,received:t.parsedType}),le}return de(e.data)}};rt.create=e=>new rt({typeName:Mt.ZodVoid,...ye(e)});var it=class e extends be{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==v.array)return se(t,{code:y.invalid_type,expected:v.array,received:t.parsedType}),le;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(se(t,{code:e?y.too_big:y.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(se(t,{code:y.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(se(t,{code:y.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new _e(t,e,t.path,n)))).then(e=>ce.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new _e(t,e,t.path,n)));return ce.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:ge.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:ge.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:ge.toString(n)}})}nonempty(e){return this.min(1,e)}};it.create=(e,t)=>new it({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Mt.ZodArray,...ye(t)});function at(e){if(e instanceof ot){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=wt.create(at(r))}return new ot({...e._def,shape:()=>t})}else if(e instanceof it)return new it({...e._def,type:at(e.element)});else if(e instanceof wt)return wt.create(at(e.unwrap()));else if(e instanceof Tt)return Tt.create(at(e.unwrap()));else if(e instanceof ft)return ft.create(e.items.map(e=>at(e)));else return e}var ot=class e extends be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=_.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==v.object){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.object,received:t.parsedType}),le}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof nt&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new _e(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof nt){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(se(n,{code:y.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new _e(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>ce.mergeObjectSync(t,e)):ce.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return ge.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:ge.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Mt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of _.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of _.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return at(this)}partial(t){let n={};for(let e of _.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of _.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof wt;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return yt(_.objectKeys(this.shape))}};ot.create=(e,t)=>new ot({shape:()=>e,unknownKeys:`strip`,catchall:nt.create(),typeName:Mt.ZodObject,...ye(t)}),ot.strictCreate=(e,t)=>new ot({shape:()=>e,unknownKeys:`strict`,catchall:nt.create(),typeName:Mt.ZodObject,...ye(t)}),ot.lazycreate=(e,t)=>new ot({shape:e,unknownKeys:`strip`,catchall:nt.create(),typeName:Mt.ZodObject,...ye(t)});var st=class extends be{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new ne(e.ctx.common.issues));return se(t,{code:y.invalid_union,unionErrors:n}),le}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new ne(e));return se(t,{code:y.invalid_union,unionErrors:i}),le}}get options(){return this._def.options}};st.create=(e,t)=>new st({options:e,typeName:Mt.ZodUnion,...ye(t)});var ct=e=>e instanceof _t?ct(e.schema):e instanceof Ct?ct(e.innerType()):e instanceof vt?[e.value]:e instanceof bt?e.options:e instanceof xt?_.objectValues(e.enum):e instanceof Et?ct(e._def.innerType):e instanceof Qe?[void 0]:e instanceof $e?[null]:e instanceof wt?[void 0,...ct(e.unwrap())]:e instanceof Tt?[null,...ct(e.unwrap())]:e instanceof kt||e instanceof jt?ct(e.unwrap()):e instanceof Dt?ct(e._def.innerType):[],lt=class e extends be{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==v.object)return se(t,{code:y.invalid_type,expected:v.object,received:t.parsedType}),le;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(se(t,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),le)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=ct(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:Mt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ye(r)})}};function ut(e,t){let n=te(e),r=te(t);if(e===t)return{valid:!0,data:e};if(n===v.object&&r===v.object){let n=_.objectKeys(t),r=_.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ut(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===v.array&&r===v.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ut(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===v.date&&r===v.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var dt=class extends be{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(fe(e)||fe(r))return le;let i=ut(e.value,r.value);return i.valid?((pe(e)||pe(r))&&t.dirty(),{status:t.value,value:i.data}):(se(n,{code:y.invalid_intersection_types}),le)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};dt.create=(e,t,n)=>new dt({left:e,right:t,typeName:Mt.ZodIntersection,...ye(n)});var ft=class e extends be{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.array)return se(n,{code:y.invalid_type,expected:v.array,received:n.parsedType}),le;if(n.data.length<this._def.items.length)return se(n,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),le;!this._def.rest&&n.data.length>this._def.items.length&&(se(n,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new _e(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>ce.mergeArray(t,e)):ce.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ft.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ft({items:e,typeName:Mt.ZodTuple,rest:null,...ye(t)})};var pt=class e extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.object)return se(n,{code:y.invalid_type,expected:v.object,received:n.parsedType}),le;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new _e(n,e,n.path,e)),value:a._parse(new _e(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?ce.mergeObjectAsync(t,r):ce.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof be?new e({keyType:t,valueType:n,typeName:Mt.ZodRecord,...ye(r)}):new e({keyType:Ge.create(),valueType:t,typeName:Mt.ZodRecord,...ye(n)})}},mt=class extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.map)return se(n,{code:y.invalid_type,expected:v.map,received:n.parsedType}),le;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new _e(n,e,n.path,[a,`key`])),value:i._parse(new _e(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return le;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return le;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};mt.create=(e,t,n)=>new mt({valueType:t,keyType:e,typeName:Mt.ZodMap,...ye(n)});var ht=class e extends be{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.set)return se(n,{code:y.invalid_type,expected:v.set,received:n.parsedType}),le;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(se(n,{code:y.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(se(n,{code:y.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return le;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new _e(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:ge.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:ge.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ht.create=(e,t)=>new ht({valueType:e,minSize:null,maxSize:null,typeName:Mt.ZodSet,...ye(t)});var gt=class e extends be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==v.function)return se(t,{code:y.invalid_type,expected:v.function,received:t.parsedType}),le;function n(e,n){return oe({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ae(),re].filter(e=>!!e),issueData:{code:y.invalid_arguments,argumentsError:n}})}function r(e,n){return oe({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ae(),re].filter(e=>!!e),issueData:{code:y.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof St){let e=this;return de(async function(...t){let o=new ne([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return de(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new ne([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new ne([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ft.create(t).rest(tt.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||ft.create([]).rest(tt.create()),returns:n||tt.create(),typeName:Mt.ZodFunction,...ye(r)})}},_t=class extends be{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};_t.create=(e,t)=>new _t({getter:e,typeName:Mt.ZodLazy,...ye(t)});var vt=class extends be{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return se(t,{received:t.data,code:y.invalid_literal,expected:this._def.value}),le}return{status:`valid`,value:e.data}}get value(){return this._def.value}};vt.create=(e,t)=>new vt({value:e,typeName:Mt.ZodLiteral,...ye(t)});function yt(e,t){return new bt({values:e,typeName:Mt.ZodEnum,...ye(t)})}var bt=class e extends be{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return se(t,{expected:_.joinValues(n),received:t.parsedType,code:y.invalid_type}),le}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return se(t,{received:t.data,code:y.invalid_enum_value,options:n}),le}return de(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};bt.create=yt;var xt=class extends be{_parse(e){let t=_.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==v.string&&n.parsedType!==v.number){let e=_.objectValues(t);return se(n,{expected:_.joinValues(e),received:n.parsedType,code:y.invalid_type}),le}if(this._cache||=new Set(_.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=_.objectValues(t);return se(n,{received:n.data,code:y.invalid_enum_value,options:e}),le}return de(e.data)}get enum(){return this._def.values}};xt.create=(e,t)=>new xt({values:e,typeName:Mt.ZodNativeEnum,...ye(t)});var St=class extends be{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==v.promise&&t.common.async===!1?(se(t,{code:y.invalid_type,expected:v.promise,received:t.parsedType}),le):de((t.parsedType===v.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};St.create=(e,t)=>new St({type:e,typeName:Mt.ZodPromise,...ye(t)});var Ct=class extends be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Mt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{se(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return le;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?le:r.status===`dirty`||t.value===`dirty`?ue(r.value):r});{if(t.value===`aborted`)return le;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?le:r.status===`dirty`||t.value===`dirty`?ue(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?le:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?le:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!me(e))return le;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>me(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):le);_.assertNever(r)}};Ct.create=(e,t,n)=>new Ct({schema:e,typeName:Mt.ZodEffects,effect:t,...ye(n)}),Ct.createWithPreprocess=(e,t,n)=>new Ct({schema:t,effect:{type:`preprocess`,transform:e},typeName:Mt.ZodEffects,...ye(n)});var wt=class extends be{_parse(e){return this._getType(e)===v.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};wt.create=(e,t)=>new wt({innerType:e,typeName:Mt.ZodOptional,...ye(t)});var Tt=class extends be{_parse(e){return this._getType(e)===v.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Tt.create=(e,t)=>new Tt({innerType:e,typeName:Mt.ZodNullable,...ye(t)});var Et=class extends be{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===v.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Et.create=(e,t)=>new Et({innerType:e,typeName:Mt.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...ye(t)});var Dt=class extends be{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return he(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new ne(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new ne(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Dt.create=(e,t)=>new Dt({innerType:e,typeName:Mt.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...ye(t)});var Ot=class extends be{_parse(e){if(this._getType(e)!==v.nan){let t=this._getOrReturnCtx(e);return se(t,{code:y.invalid_type,expected:v.nan,received:t.parsedType}),le}return{status:`valid`,value:e.data}}};Ot.create=e=>new Ot({typeName:Mt.ZodNaN,...ye(e)});var kt=class extends be{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},At=class e extends be{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?le:e.status===`dirty`?(t.dirty(),ue(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?le:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:Mt.ZodPipeline})}},jt=class extends be{_parse(e){let t=this._def.innerType._parse(e),n=e=>(me(e)&&(e.value=Object.freeze(e.value)),e);return he(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};jt.create=(e,t)=>new jt({innerType:e,typeName:Mt.ZodReadonly,...ye(t)}),ot.lazycreate;var Mt;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(Mt||={}),Ge.create,qe.create,Ot.create,Je.create,Ye.create,Xe.create,Ze.create,Qe.create,$e.create,et.create,tt.create,nt.create,rt.create,it.create,ot.create,ot.strictCreate,st.create,lt.create,dt.create,ft.create,pt.create,mt.create,ht.create,gt.create,_t.create,vt.create,bt.create,xt.create,St.create,Ct.create,wt.create,Tt.create,Ct.createWithPreprocess,At.create;function Nt(e){if(e.target!==`openAi`)return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy===`relative`?g(t,e.currentPath):t.join(`/`)}}function Pt(e,t){let n={type:`array`};return e.type?._def&&e.type?._def?.typeName!==Mt.ZodAny&&(n.items=Tn(e.type._def,{...t,currentPath:[...t.currentPath,`items`]})),e.minLength&&h(n,`minItems`,e.minLength.value,e.minLength.message,t),e.maxLength&&h(n,`maxItems`,e.maxLength.value,e.maxLength.message,t),e.exactLength&&(h(n,`minItems`,e.exactLength.value,e.exactLength.message,t),h(n,`maxItems`,e.exactLength.value,e.exactLength.message,t)),n}function Ft(e,t){let n={type:`integer`,format:`int64`};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case`min`:t.target===`jsonSchema7`?r.inclusive?h(n,`minimum`,r.value,r.message,t):h(n,`exclusiveMinimum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),h(n,`minimum`,r.value,r.message,t));break;case`max`:t.target===`jsonSchema7`?r.inclusive?h(n,`maximum`,r.value,r.message,t):h(n,`exclusiveMaximum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),h(n,`maximum`,r.value,r.message,t));break;case`multipleOf`:h(n,`multipleOf`,r.value,r.message,t);break}return n}function It(){return{type:`boolean`}}function Lt(e,t){return Tn(e.type._def,t)}var Rt=(e,t)=>Tn(e.innerType._def,t);function zt(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((n,r)=>zt(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return Bt(e,t)}}var Bt=(e,t)=>{let n={type:`integer`,format:`unix-time`};if(t.target===`openApi3`)return n;for(let r of e.checks)switch(r.kind){case`min`:h(n,`minimum`,r.value,r.message,t);break;case`max`:h(n,`maximum`,r.value,r.message,t);break}return n};function Vt(e,t){return{...Tn(e.innerType._def,t),default:e.defaultValue()}}function Ht(e,t){return t.effectStrategy===`input`?Tn(e.schema._def,t):Nt(t)}function Ut(e){return{type:`string`,enum:Array.from(e.values)}}var Wt=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function Gt(e,t){let n=[Tn(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),Tn(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=t.target===`jsonSchema2019-09`?{unevaluatedProperties:!1}:void 0,i=[];return n.forEach(e=>{if(Wt(e))i.push(...e.allOf),e.unevaluatedProperties===void 0&&(r=void 0);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}else r=void 0;i.push(t)}}),i.length?{allOf:i,...r}:void 0}function Kt(e,t){let n=typeof e.value;return n!==`bigint`&&n!==`number`&&n!==`boolean`&&n!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:t.target===`openApi3`?{type:n===`bigint`?`integer`:n,enum:[e.value]}:{type:n===`bigint`?`integer`:n,const:e.value}}var qt=void 0,Jt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(qt===void 0&&(qt=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),qt),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Yt(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:h(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t);break;case`max`:h(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`email`:switch(t.emailStrategy){case`format:email`:$t(n,`email`,r.message,t);break;case`format:idn-email`:$t(n,`idn-email`,r.message,t);break;case`pattern:zod`:en(n,Jt.email,r.message,t);break}break;case`url`:$t(n,`uri`,r.message,t);break;case`uuid`:$t(n,`uuid`,r.message,t);break;case`regex`:en(n,r.regex,r.message,t);break;case`cuid`:en(n,Jt.cuid,r.message,t);break;case`cuid2`:en(n,Jt.cuid2,r.message,t);break;case`startsWith`:en(n,RegExp(`^${Xt(r.value,t)}`),r.message,t);break;case`endsWith`:en(n,RegExp(`${Xt(r.value,t)}$`),r.message,t);break;case`datetime`:$t(n,`date-time`,r.message,t);break;case`date`:$t(n,`date`,r.message,t);break;case`time`:$t(n,`time`,r.message,t);break;case`duration`:$t(n,`duration`,r.message,t);break;case`length`:h(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t),h(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`includes`:en(n,RegExp(Xt(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&$t(n,`ipv4`,r.message,t),r.version!==`v4`&&$t(n,`ipv6`,r.message,t);break;case`base64url`:en(n,Jt.base64url,r.message,t);break;case`jwt`:en(n,Jt.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&en(n,Jt.ipv4Cidr,r.message,t),r.version!==`v4`&&en(n,Jt.ipv6Cidr,r.message,t);break;case`emoji`:en(n,Jt.emoji(),r.message,t);break;case`ulid`:en(n,Jt.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:$t(n,`binary`,r.message,t);break;case`contentEncoding:base64`:h(n,`contentEncoding`,`base64`,r.message,t);break;case`pattern:zod`:en(n,Jt.base64,r.message,t);break}break;case`nanoid`:en(n,Jt.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:(e=>{})(r)}return n}function Xt(e,t){return t.patternStrategy===`escape`?Qt(e):e}var Zt=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function Qt(e){let t=``;for(let n=0;n<e.length;n++)Zt.has(e[n])||(t+=`\\`),t+=e[n];return t}function $t(e,t,n,r){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):h(e,`format`,t,n,r)}function en(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:tn(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):h(e,`pattern`,tn(t,r),n,r)}function tn(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e<r.length;e++){if(a){i+=r[e],a=!1;continue}if(n.i){if(o){if(r[e].match(/[a-z]/)){s?(i+=r[e],i+=`${r[e-2]}-${r[e]}`.toUpperCase(),s=!1):r[e+1]===`-`&&r[e+2]?.match(/[a-z]/)?(i+=r[e],s=!0):i+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){i+=`[${r[e]}${r[e].toUpperCase()}]`;continue}}if(n.m){if(r[e]===`^`){i+=`(^|(?<=[\r
|
|
4
4
|
]))`;continue}else if(r[e]===`$`){i+=`($|(?=[\r
|
|
@@ -75,7 +75,7 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
75
75
|
`,`\r`]),qE.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function JE(e,t){let n=t??0,r=e.indexOf(10,n),i=e.indexOf(13,n);if(r===-1&&i===-1)return null;let a;return a=r!==-1&&i!==-1?Math.min(r,i):r===-1?i:r,e[a]===10?{preceding:a,index:a+1,carriage:!1}:{preceding:a,index:a+1,carriage:!0}}var YE={off:0,error:200,warn:300,info:400,debug:500},XE=(e,t,n)=>{if(e){if(fE(YE,e))return e;tD(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(YE))}`)}};function ZE(){}function QE(e,t,n){return!t||YE[e]>YE[n]?ZE:t[e].bind(t)}var $E={error:ZE,warn:ZE,info:ZE,debug:ZE},eD=new WeakMap;function tD(e){let t=e.logger,n=e.logLevel??`off`;if(!t)return $E;let r=eD.get(t);if(r&&r[0]===n)return r[1];let i={error:QE(`error`,t,n),warn:QE(`warn`,t,n),info:QE(`info`,t,n),debug:QE(`debug`,t,n)};return eD.set(t,[n,i]),i}var nD=e=>(e.options&&(e.options=Object.assign({},e.options),delete e.options.headers),e.headers&&=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,e.toLowerCase()===`x-goog-api-key`||e.toLowerCase()===`authorization`||e.toLowerCase()===`cookie`||e.toLowerCase()===`set-cookie`?`***`:t])),`retryOfRequestLogID`in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),rD=class e{constructor(e,t,n){this.iterator=e,this.controller=t,this.client=n}static fromSSEResponse(t,n,r){let i=!1,a=r?tD(r):console;function o(){return aS(this,arguments,function*(){var e,r,o,s;if(i)throw new JT("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let c=!1;try{try{for(var l=!0,u=oS(iD(t,n)),d;d=yield iS(u.next()),e=d.done,!e;l=!0){s=d.value,l=!1;let e=s;if(!c)if(e.data.startsWith(`[DONE]`)){c=!0;continue}else try{yield yield iS(JSON.parse(e.data))}catch(t){throw a.error(`Could not parse message into JSON:`,e.data),a.error(`From chunk:`,e.raw),t}}}catch(e){r={error:e}}finally{try{!l&&!e&&(o=u.return)&&(yield iS(o.call(u)))}finally{if(r)throw r.error}}c=!0}catch(e){if(KT(e))return yield iS(void 0);throw e}finally{c||n.abort()}})}return new e(o,n,r)}static fromReadableStream(t,n,r){let i=!1;function a(){return aS(this,arguments,function*(){var e,n,r,i;let a=new qE,o=yE(t);try{for(var s=!0,c=oS(o),l;l=yield iS(c.next()),e=l.done,!e;s=!0){i=l.value,s=!1;let e=i;for(let t of a.decode(e))yield yield iS(t)}}catch(e){n={error:e}}finally{try{!s&&!e&&(r=c.return)&&(yield iS(r.call(c)))}finally{if(n)throw n.error}}for(let e of a.flush())yield yield iS(e)})}function o(){return aS(this,arguments,function*(){var e,t,r,o;if(i)throw new JT("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let s=!1;try{try{for(var c=!0,l=oS(a()),u;u=yield iS(l.next()),e=u.done,!e;c=!0){o=u.value,c=!1;let e=o;s||e&&(yield yield iS(JSON.parse(e)))}}catch(e){t={error:e}}finally{try{!c&&!e&&(r=l.return)&&(yield iS(r.call(l)))}finally{if(t)throw t.error}}s=!0}catch(e){if(KT(e))return yield iS(void 0);throw e}finally{s||n.abort()}})}return new e(o,n,r)}[Symbol.asyncIterator](){return this.iterator()}tee(){let t=[],n=[],r=this.iterator(),i=e=>({next:()=>{if(e.length===0){let e=r.next();t.push(e),n.push(e)}return e.shift()}});return[new e(()=>i(t),this.controller,this.client),new e(()=>i(n),this.controller,this.client)]}toReadableStream(){let e=this,t;return _E({async start(){t=e[Symbol.asyncIterator]()},async pull(e){try{let{value:n,done:r}=await t.next();if(r)return e.close();let i=WE(JSON.stringify(n)+`
|
|
76
76
|
`);e.enqueue(i)}catch(t){e.error(t)}},async cancel(){await t.return?.call(t)}})}};function iD(e,t){return aS(this,arguments,function*(){var n,r,i,a;if(!e.body)throw t.abort(),globalThis.navigator!==void 0&&globalThis.navigator.product===`ReactNative`?new JT(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`):new JT(`Attempted to iterate over a response with no body`);let o=new oD,s=new qE,c=yE(e.body);try{for(var l=!0,u=oS(aD(c)),d;d=yield iS(u.next()),n=d.done,!n;l=!0){a=d.value,l=!1;let e=a;for(let t of s.decode(e)){let e=o.decode(t);e&&(yield yield iS(e))}}}catch(e){r={error:e}}finally{try{!l&&!n&&(i=u.return)&&(yield iS(i.call(u)))}finally{if(r)throw r.error}}for(let e of s.flush()){let t=o.decode(e);t&&(yield yield iS(t))}})}function aD(e){return aS(this,arguments,function*(){var t,n,r,i;try{for(var a=!0,o=oS(e),s;s=yield iS(o.next()),t=s.done,!t;a=!0){i=s.value,a=!1;let e=i;e!=null&&(yield yield iS(e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`string`?WE(e):e))}}catch(e){n={error:e}}finally{try{!a&&!t&&(r=o.return)&&(yield iS(r.call(o)))}finally{if(n)throw n.error}}})}var oD=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith(`\r`)&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join(`
|
|
77
77
|
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(`:`))return null;let[t,n,r]=sD(e,`:`);return r.startsWith(` `)&&(r=r.substring(1)),t===`event`?this.event=r:t===`data`&&this.data.push(r),null}};function sD(e,t){let n=e.indexOf(t);return n===-1?[e,``,``]:[e.substring(0,n),t,e.substring(n+t.length)]}async function cD(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:i,startTime:a}=t,o=await(async()=>{if(t.options.stream)return tD(e).debug(`response`,n.status,n.url,n.headers,n.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(n,t.controller,e):rD.fromSSEResponse(n,t.controller,e);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let r=(n.headers.get(`content-type`)?.split(`;`)[0])?.trim();return r?.includes(`application/json`)||r?.endsWith(`+json`)?n.headers.get(`content-length`)===`0`?void 0:await n.json():await n.text()})();return tD(e).debug(`[${r}] response parsed`,nD({retryOfRequestLogID:i,url:n.url,status:n.status,body:o,durationMs:Date.now()-a})),o}var lD=class e extends Promise{constructor(e,t,n=cD){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=n,this.client=e}_thenUnwrap(t){return new e(this.client,this.responsePromise,async(e,n)=>t(await this.parseResponse(e,n),n))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t}}parse(){return this.parsedPromise||=this.responsePromise.then(e=>this.parseResponse(this.client,e)),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}},uD=Symbol(`brand.privateNullableHeaders`);function*dD(e){if(!e)return;if(uD in e){let{values:t,nulls:n}=e;yield*t.entries();for(let e of n)yield[e,null];return}let t=!1,n;e instanceof Headers?n=e.entries():uE(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let e of n){let n=e[0];if(typeof n!=`string`)throw TypeError(`expected header name to be a string`);let r=uE(e[1])?e[1]:[e[1]],i=!1;for(let e of r)e!==void 0&&(t&&!i&&(i=!0,yield[n,null]),yield[n,e])}}var fD=e=>{let t=new Headers,n=new Set;for(let r of e){let e=new Set;for(let[i,a]of dD(r)){let r=i.toLowerCase();e.has(r)||(t.delete(i),e.add(r)),a===null?(t.delete(i),n.add(r)):(t.append(i,a),n.delete(r))}}return{[uD]:!0,values:t,nulls:n}},pD=e=>{var t;if(globalThis.process!==void 0)return({}?.[e])?.trim()||void 0;if(globalThis.Deno!==void 0)return(((t=globalThis.Deno.env)?.get)?.call(t,e))?.trim()||void 0},mD,hD=class e{constructor(t){var{baseURL:n=pD(`GEMINI_NEXT_GEN_API_BASE_URL`),apiKey:r=pD(`GEMINI_API_KEY`)??null,apiVersion:i=`v1beta`}=t,a=nS(t,[`baseURL`,`apiKey`,`apiVersion`]);let o=Object.assign(Object.assign({apiKey:r,apiVersion:i},a),{baseURL:n||`https://generativelanguage.googleapis.com`});this.baseURL=o.baseURL,this.timeout=o.timeout??e.DEFAULT_TIMEOUT,this.logger=o.logger??console;let s=`warn`;this.logLevel=s,this.logLevel=XE(o.logLevel,`ClientOptions.logLevel`,this)??XE(pD(`GEMINI_NEXT_GEN_API_LOG`),`process.env['GEMINI_NEXT_GEN_API_LOG']`,this)??s,this.fetchOptions=o.fetchOptions,this.maxRetries=o.maxRetries??2,this.fetch=o.fetch??gE(),this.encoder=xE,this._options=o,this.apiKey=r,this.apiVersion=i,this.clientAdapter=o.clientAdapter}withOptions(e){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),e))}baseURLOverridden(){return this.baseURL!==`https://generativelanguage.googleapis.com`}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(!(e.has(`authorization`)||e.has(`x-goog-api-key`))&&!(this.apiKey&&e.get(`x-goog-api-key`))&&!t.has(`x-goog-api-key`))throw Error(`Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted`)}async authHeaders(e){let t=fD([e.headers]);if(!(t.values.has(`authorization`)||t.values.has(`x-goog-api-key`))){if(this.apiKey)return fD([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter&&this.clientAdapter.isVertexAI())return fD([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(e){return SE(e)}getUserAgent(){return`${this.constructor.name}/JS ${CE}`}defaultIdempotencyKey(){return`stainless-node-retry-${GT()}`}makeStatusError(e,t,n,r){return YT.generate(e,t,n,r)}buildURL(e,t,n){let r=!this.baseURLOverridden()&&n||this.baseURL,i=cE(e)?new URL(e):new URL(r+(r.endsWith(`/`)&&e.startsWith(`/`)?e.slice(1):e)),a=this.defaultQuery(),o=Object.fromEntries(i.searchParams);return(!dE(a)||!dE(o))&&(t=Object.assign(Object.assign(Object.assign({},o),a),t)),typeof t==`object`&&t&&!Array.isArray(t)&&(i.search=this.stringifyQuery(t)),i.toString()}async prepareOptions(e){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!e.path.startsWith(`/${this.apiVersion}/projects/`)){let t=e.path.slice(this.apiVersion.length+1);e.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${t}`}}async prepareRequest(e,{url:t,options:n}){}get(e,t){return this.methodRequest(`get`,e,t)}post(e,t){return this.methodRequest(`post`,e,t)}patch(e,t){return this.methodRequest(`patch`,e,t)}put(e,t){return this.methodRequest(`put`,e,t)}delete(e,t){return this.methodRequest(`delete`,e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(n=>Object.assign({method:e,path:t},n)))}request(e,t=null){return new lD(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,n){let r=await e,i=r.maxRetries??this.maxRetries;t??=i,await this.prepareOptions(r);let{req:a,url:o,timeout:s}=await this.buildRequest(r,{retryCount:i-t});await this.prepareRequest(a,{url:o,options:r});let c=`log_`+(Math.random()*(1<<24)|0).toString(16).padStart(6,`0`),l=n===void 0?``:`, retryOf: ${n}`,u=Date.now();if(tD(this).debug(`[${c}] sending request`,nD({retryOfRequestLogID:n,method:r.method,url:o,options:r,headers:a.headers})),r.signal?.aborted)throw new XT;let d=new AbortController,f=await this.fetchWithTimeout(o,a,s,d).catch(qT),p=Date.now();if(f instanceof globalThis.Error){let e=`retrying, ${t} attempts remaining`;if(r.signal?.aborted)throw new XT;let i=KT(f)||/timed? ?out/i.test(String(f)+(`cause`in f?String(f.cause):``));if(t)return tD(this).info(`[${c}] connection ${i?`timed out`:`failed`} - ${e}`),tD(this).debug(`[${c}] connection ${i?`timed out`:`failed`} (${e})`,nD({retryOfRequestLogID:n,url:o,durationMs:p-u,message:f.message})),this.retryRequest(r,t,n??c);throw tD(this).info(`[${c}] connection ${i?`timed out`:`failed`} - error; no more retries left`),tD(this).debug(`[${c}] connection ${i?`timed out`:`failed`} (error; no more retries left)`,nD({retryOfRequestLogID:n,url:o,durationMs:p-u,message:f.message})),i?new QT:new ZT({cause:f})}let m=`[${c}${l}] ${a.method} ${o} ${f.ok?`succeeded`:`failed`} with status ${f.status} in ${p-u}ms`;if(!f.ok){let e=await this.shouldRetry(f);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await bE(f.body),tD(this).info(`${m} - ${e}`),tD(this).debug(`[${c}] response error (${e})`,nD({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:p-u})),this.retryRequest(r,t,n??c,f.headers)}let i=e?`error; no more retries left`:`error; not retryable`;tD(this).info(`${m} - ${i}`);let a=await f.text().catch(e=>qT(e).message),o=mE(a),s=o?void 0:a;throw tD(this).debug(`[${c}] response error (${i})`,nD({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,message:s,durationMs:Date.now()-u})),this.makeStatusError(f.status,o,s,f.headers)}return tD(this).info(m),tD(this).debug(`[${c}] response start`,nD({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:p-u})),{response:f,options:r,controller:d,requestLogID:c,retryOfRequestLogID:n,startTime:u}}async fetchWithTimeout(e,t,n,r){let i=t||{},{signal:a,method:o}=i,s=nS(i,[`signal`,`method`]),c=this._makeAbort(r);a&&a.addEventListener(`abort`,c,{once:!0});let l=setTimeout(c,n),u=globalThis.ReadableStream&&s.body instanceof globalThis.ReadableStream||typeof s.body==`object`&&s.body!==null&&Symbol.asyncIterator in s.body,d=Object.assign(Object.assign(Object.assign({signal:r.signal},u?{duplex:`half`}:{}),{method:`GET`}),s);o&&(d.method=o.toUpperCase());try{return await this.fetch.call(void 0,e,d)}finally{clearTimeout(l)}}async shouldRetry(e){let t=e.headers.get(`x-should-retry`);return t===`true`?!0:t===`false`?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,t,n,r){let i,a=r?.get(`retry-after-ms`);if(a){let e=parseFloat(a);Number.isNaN(e)||(i=e)}let o=r?.get(`retry-after`);if(o&&!i){let e=parseFloat(o);i=Number.isNaN(e)?Date.parse(o)-Date.now():e*1e3}if(i===void 0){let n=e.maxRetries??this.maxRetries;i=this.calculateDefaultRetryTimeoutMillis(t,n)}return await hE(i),this.makeRequest(e,t-1,n)}calculateDefaultRetryTimeoutMillis(e,t){let n=t-e;return Math.min(.5*2**n,8)*(1-Math.random()*.25)*1e3}async buildRequest(e,{retryCount:t=0}={}){let n=Object.assign({},e),{method:r,path:i,query:a,defaultBaseURL:o}=n,s=this.buildURL(i,a,o);`timeout`in n&&pE(`timeout`,n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:c,body:l}=this.buildBody({options:n}),u=await this.buildHeaders({options:e,method:r,bodyHeaders:c,retryCount:t});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:r,headers:u},n.signal&&{signal:n.signal}),globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:`half`}),l&&{body:l}),this.fetchOptions??{}),n.fetchOptions??{}),url:s,timeout:n.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:n,retryCount:r}){let i={};this.idempotencyHeader&&t!==`get`&&(e.idempotencyKey||=this.defaultIdempotencyKey(),i[this.idempotencyHeader]=e.idempotencyKey);let a=await this.authHeaders(e),o=fD([i,{Accept:`application/json`,"User-Agent":this.getUserAgent()},this._options.defaultHeaders,n,e.headers,a]);return this.validateHeaders(o),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=fD([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e==`string`&&n.values.has(`content-type`)||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e==`object`&&(Symbol.asyncIterator in e||Symbol.iterator in e&&`next`in e&&typeof e.next==`function`)?{bodyHeaders:void 0,body:vE(e)}:typeof e==`object`&&n.values.get(`content-type`)===`application/x-www-form-urlencoded`?{bodyHeaders:{"content-type":`application/x-www-form-urlencoded`},body:this.stringifyQuery(e)}:this.encoder({body:e,headers:n})}};hD.DEFAULT_TIMEOUT=6e4;var gD=class extends hD{constructor(){super(...arguments),this.interactions=new zE(this),this.webhooks=new VE(this)}};mD=gD,gD.GeminiNextGenAPIClient=mD,gD.GeminiNextGenAPIClientError=JT,gD.APIError=YT,gD.APIConnectionError=ZT,gD.APIConnectionTimeoutError=QT,gD.APIUserAbortError=XT,gD.NotFoundError=nE,gD.ConflictError=rE,gD.RateLimitError=aE,gD.BadRequestError=$T,gD.AuthenticationError=eE,gD.InternalServerError=oE,gD.PermissionDeniedError=tE,gD.UnprocessableEntityError=iE,gD.toFile=jE,gD.Interactions=zE,gD.Webhooks=VE;function _D(e,t){let n={},r=T(e,[`name`]);return r!=null&&w(n,[`_url`,`name`],r),n}function vD(e,t){let n={},r=T(e,[`name`]);return r!=null&&w(n,[`_url`,`name`],r),n}function yD(e,t){let n={},r=T(e,[`sdkHttpResponse`]);return r!=null&&w(n,[`sdkHttpResponse`],r),n}function bD(e,t){let n={},r=T(e,[`sdkHttpResponse`]);return r!=null&&w(n,[`sdkHttpResponse`],r),n}function xD(e,t,n){let r={};if(T(e,[`validationDataset`])!==void 0)throw Error(`validationDataset parameter is not supported in Gemini API.`);let i=T(e,[`tunedModelDisplayName`]);if(t!==void 0&&i!=null&&w(t,[`displayName`],i),T(e,[`description`])!==void 0)throw Error(`description parameter is not supported in Gemini API.`);let a=T(e,[`epochCount`]);t!==void 0&&a!=null&&w(t,[`tuningTask`,`hyperparameters`,`epochCount`],a);let o=T(e,[`learningRateMultiplier`]);if(o!=null&&w(r,[`tuningTask`,`hyperparameters`,`learningRateMultiplier`],o),T(e,[`exportLastCheckpointOnly`])!==void 0)throw Error(`exportLastCheckpointOnly parameter is not supported in Gemini API.`);if(T(e,[`preTunedModelCheckpointId`])!==void 0)throw Error(`preTunedModelCheckpointId parameter is not supported in Gemini API.`);if(T(e,[`adapterSize`])!==void 0)throw Error(`adapterSize parameter is not supported in Gemini API.`);if(T(e,[`tuningMode`])!==void 0)throw Error(`tuningMode parameter is not supported in Gemini API.`);if(T(e,[`customBaseModel`])!==void 0)throw Error(`customBaseModel parameter is not supported in Gemini API.`);let s=T(e,[`batchSize`]);t!==void 0&&s!=null&&w(t,[`tuningTask`,`hyperparameters`,`batchSize`],s);let c=T(e,[`learningRate`]);if(t!==void 0&&c!=null&&w(t,[`tuningTask`,`hyperparameters`,`learningRate`],c),T(e,[`labels`])!==void 0)throw Error(`labels parameter is not supported in Gemini API.`);if(T(e,[`beta`])!==void 0)throw Error(`beta parameter is not supported in Gemini API.`);if(T(e,[`baseTeacherModel`])!==void 0)throw Error(`baseTeacherModel parameter is not supported in Gemini API.`);if(T(e,[`tunedTeacherModelSource`])!==void 0)throw Error(`tunedTeacherModelSource parameter is not supported in Gemini API.`);if(T(e,[`sftLossWeightMultiplier`])!==void 0)throw Error(`sftLossWeightMultiplier parameter is not supported in Gemini API.`);if(T(e,[`outputUri`])!==void 0)throw Error(`outputUri parameter is not supported in Gemini API.`);if(T(e,[`encryptionSpec`])!==void 0)throw Error(`encryptionSpec parameter is not supported in Gemini API.`);return r}function SD(e,t,n){let r={},i=T(n,[`config`,`method`]);if(i===void 0&&(i=`SUPERVISED_FINE_TUNING`),i===`SUPERVISED_FINE_TUNING`){let n=T(e,[`validationDataset`]);t!==void 0&&n!=null&&w(t,[`supervisedTuningSpec`],ID(n))}else if(i===`PREFERENCE_TUNING`){let n=T(e,[`validationDataset`]);t!==void 0&&n!=null&&w(t,[`preferenceOptimizationSpec`],ID(n))}else if(i===`DISTILLATION`){let n=T(e,[`validationDataset`]);t!==void 0&&n!=null&&w(t,[`distillationSpec`],ID(n))}let a=T(e,[`tunedModelDisplayName`]);t!==void 0&&a!=null&&w(t,[`tunedModelDisplayName`],a);let o=T(e,[`description`]);t!==void 0&&o!=null&&w(t,[`description`],o);let s=T(n,[`config`,`method`]);if(s===void 0&&(s=`SUPERVISED_FINE_TUNING`),s===`SUPERVISED_FINE_TUNING`){let n=T(e,[`epochCount`]);t!==void 0&&n!=null&&w(t,[`supervisedTuningSpec`,`hyperParameters`,`epochCount`],n)}else if(s===`PREFERENCE_TUNING`){let n=T(e,[`epochCount`]);t!==void 0&&n!=null&&w(t,[`preferenceOptimizationSpec`,`hyperParameters`,`epochCount`],n)}else if(s===`DISTILLATION`){let n=T(e,[`epochCount`]);t!==void 0&&n!=null&&w(t,[`distillationSpec`,`hyperParameters`,`epochCount`],n)}let c=T(n,[`config`,`method`]);if(c===void 0&&(c=`SUPERVISED_FINE_TUNING`),c===`SUPERVISED_FINE_TUNING`){let n=T(e,[`learningRateMultiplier`]);t!==void 0&&n!=null&&w(t,[`supervisedTuningSpec`,`hyperParameters`,`learningRateMultiplier`],n)}else if(c===`PREFERENCE_TUNING`){let n=T(e,[`learningRateMultiplier`]);t!==void 0&&n!=null&&w(t,[`preferenceOptimizationSpec`,`hyperParameters`,`learningRateMultiplier`],n)}else if(c===`DISTILLATION`){let n=T(e,[`learningRateMultiplier`]);t!==void 0&&n!=null&&w(t,[`distillationSpec`,`hyperParameters`,`learningRateMultiplier`],n)}let l=T(n,[`config`,`method`]);if(l===void 0&&(l=`SUPERVISED_FINE_TUNING`),l===`SUPERVISED_FINE_TUNING`){let n=T(e,[`exportLastCheckpointOnly`]);t!==void 0&&n!=null&&w(t,[`supervisedTuningSpec`,`exportLastCheckpointOnly`],n)}else if(l===`PREFERENCE_TUNING`){let n=T(e,[`exportLastCheckpointOnly`]);t!==void 0&&n!=null&&w(t,[`preferenceOptimizationSpec`,`exportLastCheckpointOnly`],n)}else if(l===`DISTILLATION`){let n=T(e,[`exportLastCheckpointOnly`]);t!==void 0&&n!=null&&w(t,[`distillationSpec`,`exportLastCheckpointOnly`],n)}let u=T(n,[`config`,`method`]);if(u===void 0&&(u=`SUPERVISED_FINE_TUNING`),u===`SUPERVISED_FINE_TUNING`){let n=T(e,[`adapterSize`]);t!==void 0&&n!=null&&w(t,[`supervisedTuningSpec`,`hyperParameters`,`adapterSize`],n)}else if(u===`PREFERENCE_TUNING`){let n=T(e,[`adapterSize`]);t!==void 0&&n!=null&&w(t,[`preferenceOptimizationSpec`,`hyperParameters`,`adapterSize`],n)}else if(u===`DISTILLATION`){let n=T(e,[`adapterSize`]);t!==void 0&&n!=null&&w(t,[`distillationSpec`,`hyperParameters`,`adapterSize`],n)}let d=T(n,[`config`,`method`]);if(d===void 0&&(d=`SUPERVISED_FINE_TUNING`),d===`SUPERVISED_FINE_TUNING`){let n=T(e,[`tuningMode`]);t!==void 0&&n!=null&&w(t,[`supervisedTuningSpec`,`tuningMode`],n)}else if(d===`DISTILLATION`){let n=T(e,[`tuningMode`]);t!==void 0&&n!=null&&w(t,[`distillationSpec`,`tuningMode`],n)}let f=T(e,[`customBaseModel`]);t!==void 0&&f!=null&&w(t,[`customBaseModel`],f);let p=T(n,[`config`,`method`]);if(p===void 0&&(p=`SUPERVISED_FINE_TUNING`),p===`SUPERVISED_FINE_TUNING`){let n=T(e,[`batchSize`]);t!==void 0&&n!=null&&w(t,[`supervisedTuningSpec`,`hyperParameters`,`batchSize`],n)}else if(p===`DISTILLATION`){let n=T(e,[`batchSize`]);t!==void 0&&n!=null&&w(t,[`distillationSpec`,`hyperParameters`,`batchSize`],n)}let m=T(n,[`config`,`method`]);if(m===void 0&&(m=`SUPERVISED_FINE_TUNING`),m===`SUPERVISED_FINE_TUNING`){let n=T(e,[`learningRate`]);t!==void 0&&n!=null&&w(t,[`supervisedTuningSpec`,`hyperParameters`,`learningRate`],n)}else if(m===`DISTILLATION`){let n=T(e,[`learningRate`]);t!==void 0&&n!=null&&w(t,[`distillationSpec`,`hyperParameters`,`learningRate`],n)}let h=T(e,[`labels`]);t!==void 0&&h!=null&&w(t,[`labels`],h);let g=T(e,[`beta`]);t!==void 0&&g!=null&&w(t,[`preferenceOptimizationSpec`,`hyperParameters`,`beta`],g);let _=T(e,[`baseTeacherModel`]);t!==void 0&&_!=null&&w(t,[`distillationSpec`,`baseTeacherModel`],_);let ee=T(e,[`tunedTeacherModelSource`]);t!==void 0&&ee!=null&&w(t,[`distillationSpec`,`tunedTeacherModelSource`],ee);let v=T(e,[`sftLossWeightMultiplier`]);t!==void 0&&v!=null&&w(t,[`distillationSpec`,`hyperParameters`,`sftLossWeightMultiplier`],v);let te=T(e,[`outputUri`]);t!==void 0&&te!=null&&w(t,[`outputUri`],te);let y=T(e,[`encryptionSpec`]);return t!==void 0&&y!=null&&w(t,[`encryptionSpec`],y),r}function CD(e,t){let n={},r=T(e,[`baseModel`]);r!=null&&w(n,[`baseModel`],r);let i=T(e,[`preTunedModel`]);i!=null&&w(n,[`preTunedModel`],i);let a=T(e,[`trainingDataset`]);a!=null&&jD(a);let o=T(e,[`config`]);return o!=null&&xD(o,n),n}function wD(e,t){let n={},r=T(e,[`baseModel`]);r!=null&&w(n,[`baseModel`],r);let i=T(e,[`preTunedModel`]);i!=null&&w(n,[`preTunedModel`],i);let a=T(e,[`trainingDataset`]);a!=null&&MD(a,n,t);let o=T(e,[`config`]);return o!=null&&SD(o,n,t),n}function TD(e,t){let n={},r=T(e,[`name`]);return r!=null&&w(n,[`_url`,`name`],r),n}function ED(e,t){let n={},r=T(e,[`name`]);return r!=null&&w(n,[`_url`,`name`],r),n}function DD(e,t,n){let r={},i=T(e,[`pageSize`]);t!==void 0&&i!=null&&w(t,[`_query`,`pageSize`],i);let a=T(e,[`pageToken`]);t!==void 0&&a!=null&&w(t,[`_query`,`pageToken`],a);let o=T(e,[`filter`]);return t!==void 0&&o!=null&&w(t,[`_query`,`filter`],o),r}function OD(e,t){let n={},r=T(e,[`config`]);return r!=null&&DD(r,n),n}function kD(e,t){let n={},r=T(e,[`sdkHttpResponse`]);r!=null&&w(n,[`sdkHttpResponse`],r);let i=T(e,[`nextPageToken`]);i!=null&&w(n,[`nextPageToken`],i);let a=T(e,[`tuningJobs`]);if(a!=null){let e=a;Array.isArray(e)&&(e=e.map(e=>PD(e))),w(n,[`tuningJobs`],e)}return n}function AD(e,t){let n={},r=T(e,[`name`]);r!=null&&w(n,[`model`],r);let i=T(e,[`name`]);return i!=null&&w(n,[`endpoint`],i),n}function jD(e,t){let n={};if(T(e,[`gcsUri`])!==void 0)throw Error(`gcsUri parameter is not supported in Gemini API.`);if(T(e,[`vertexDatasetResource`])!==void 0)throw Error(`vertexDatasetResource parameter is not supported in Gemini API.`);let r=T(e,[`examples`]);if(r!=null){let e=r;Array.isArray(e)&&(e=e.map(e=>e)),w(n,[`examples`,`examples`],e)}return n}function MD(e,t,n){let r={},i=T(n,[`config`,`method`]);if(i===void 0&&(i=`SUPERVISED_FINE_TUNING`),i===`SUPERVISED_FINE_TUNING`){let n=T(e,[`gcsUri`]);t!==void 0&&n!=null&&w(t,[`supervisedTuningSpec`,`trainingDatasetUri`],n)}else if(i===`PREFERENCE_TUNING`){let n=T(e,[`gcsUri`]);t!==void 0&&n!=null&&w(t,[`preferenceOptimizationSpec`,`trainingDatasetUri`],n)}else if(i===`DISTILLATION`){let n=T(e,[`gcsUri`]);t!==void 0&&n!=null&&w(t,[`distillationSpec`,`promptDatasetUri`],n)}let a=T(n,[`config`,`method`]);if(a===void 0&&(a=`SUPERVISED_FINE_TUNING`),a===`SUPERVISED_FINE_TUNING`){let n=T(e,[`vertexDatasetResource`]);t!==void 0&&n!=null&&w(t,[`supervisedTuningSpec`,`trainingDatasetUri`],n)}else if(a===`PREFERENCE_TUNING`){let n=T(e,[`vertexDatasetResource`]);t!==void 0&&n!=null&&w(t,[`preferenceOptimizationSpec`,`trainingDatasetUri`],n)}else if(a===`DISTILLATION`){let n=T(e,[`vertexDatasetResource`]);t!==void 0&&n!=null&&w(t,[`distillationSpec`,`promptDatasetUri`],n)}if(T(e,[`examples`])!==void 0)throw Error(`examples parameter is not supported in Gemini Enterprise Agent Platform (previously known as Vertex AI).`);return r}function ND(e,t){let n={},r=T(e,[`sdkHttpResponse`]);r!=null&&w(n,[`sdkHttpResponse`],r);let i=T(e,[`name`]);i!=null&&w(n,[`name`],i);let a=T(e,[`state`]);a!=null&&w(n,[`state`],tb(a));let o=T(e,[`createTime`]);o!=null&&w(n,[`createTime`],o);let s=T(e,[`tuningTask`,`startTime`]);s!=null&&w(n,[`startTime`],s);let c=T(e,[`tuningTask`,`completeTime`]);c!=null&&w(n,[`endTime`],c);let l=T(e,[`updateTime`]);l!=null&&w(n,[`updateTime`],l);let u=T(e,[`description`]);u!=null&&w(n,[`description`],u);let d=T(e,[`baseModel`]);d!=null&&w(n,[`baseModel`],d);let f=T(e,[`_self`]);return f!=null&&w(n,[`tunedModel`],AD(f)),n}function PD(e,t){let n={},r=T(e,[`sdkHttpResponse`]);r!=null&&w(n,[`sdkHttpResponse`],r);let i=T(e,[`name`]);i!=null&&w(n,[`name`],i);let a=T(e,[`state`]);a!=null&&w(n,[`state`],tb(a));let o=T(e,[`createTime`]);o!=null&&w(n,[`createTime`],o);let s=T(e,[`startTime`]);s!=null&&w(n,[`startTime`],s);let c=T(e,[`endTime`]);c!=null&&w(n,[`endTime`],c);let l=T(e,[`updateTime`]);l!=null&&w(n,[`updateTime`],l);let u=T(e,[`error`]);u!=null&&w(n,[`error`],u);let d=T(e,[`description`]);d!=null&&w(n,[`description`],d);let f=T(e,[`baseModel`]);f!=null&&w(n,[`baseModel`],f);let p=T(e,[`tunedModel`]);p!=null&&w(n,[`tunedModel`],p);let m=T(e,[`preTunedModel`]);m!=null&&w(n,[`preTunedModel`],m);let h=T(e,[`supervisedTuningSpec`]);h!=null&&w(n,[`supervisedTuningSpec`],h);let g=T(e,[`preferenceOptimizationSpec`]);g!=null&&w(n,[`preferenceOptimizationSpec`],g);let _=T(e,[`distillationSpec`]);_!=null&&w(n,[`distillationSpec`],_);let ee=T(e,[`tuningDataStats`]);ee!=null&&w(n,[`tuningDataStats`],ee);let v=T(e,[`encryptionSpec`]);v!=null&&w(n,[`encryptionSpec`],v);let te=T(e,[`partnerModelTuningSpec`]);te!=null&&w(n,[`partnerModelTuningSpec`],te);let y=T(e,[`customBaseModel`]);y!=null&&w(n,[`customBaseModel`],y);let ne=T(e,[`evaluateDatasetRuns`]);if(ne!=null){let e=ne;Array.isArray(e)&&(e=e.map(e=>e)),w(n,[`evaluateDatasetRuns`],e)}let re=T(e,[`experiment`]);re!=null&&w(n,[`experiment`],re);let ie=T(e,[`fullFineTuningSpec`]);ie!=null&&w(n,[`fullFineTuningSpec`],ie);let ae=T(e,[`labels`]);ae!=null&&w(n,[`labels`],ae);let oe=T(e,[`outputUri`]);oe!=null&&w(n,[`outputUri`],oe);let se=T(e,[`pipelineJob`]);se!=null&&w(n,[`pipelineJob`],se);let ce=T(e,[`serviceAccount`]);ce!=null&&w(n,[`serviceAccount`],ce);let le=T(e,[`tunedModelDisplayName`]);le!=null&&w(n,[`tunedModelDisplayName`],le);let ue=T(e,[`tuningJobState`]);ue!=null&&w(n,[`tuningJobState`],ue);let de=T(e,[`veoTuningSpec`]);de!=null&&w(n,[`veoTuningSpec`],de);let fe=T(e,[`distillationSamplingSpec`]);fe!=null&&w(n,[`distillationSamplingSpec`],fe);let pe=T(e,[`tuningJobMetadata`]);return pe!=null&&w(n,[`tuningJobMetadata`],pe),n}function FD(e,t){let n={},r=T(e,[`sdkHttpResponse`]);r!=null&&w(n,[`sdkHttpResponse`],r);let i=T(e,[`name`]);i!=null&&w(n,[`name`],i);let a=T(e,[`metadata`]);a!=null&&w(n,[`metadata`],a);let o=T(e,[`done`]);o!=null&&w(n,[`done`],o);let s=T(e,[`error`]);return s!=null&&w(n,[`error`],s),n}function ID(e,t){let n={},r=T(e,[`gcsUri`]);r!=null&&w(n,[`validationDatasetUri`],r);let i=T(e,[`vertexDatasetResource`]);return i!=null&&w(n,[`validationDatasetUri`],i),n}var LD=class extends T_{constructor(e){super(),this.apiClient=e,this.list=async(e={})=>new _x(gx.PAGED_ITEM_TUNING_JOBS,e=>this.listInternal(e),await this.listInternal(e),e),this.get=async e=>await this.getInternal(e),this.tune=async e=>{if(this.apiClient.isVertexAI())if(e.baseModel.startsWith(`projects/`)){let t={tunedModelName:e.baseModel};e.config?.preTunedModelCheckpointId&&(t.checkpointId=e.config.preTunedModelCheckpointId);let n=Object.assign(Object.assign({},e),{preTunedModel:t});return n.baseModel=void 0,await this.tuneInternal(n)}else{let t=Object.assign({},e);return await this.tuneInternal(t)}else{let t=Object.assign({},e),n=await this.tuneMldevInternal(t),r=``;return n.metadata!==void 0&&n.metadata.tunedModel!==void 0?r=n.metadata.tunedModel:n.name!==void 0&&n.name.includes(`/operations/`)&&(r=n.name.split(`/operations/`)[0]),{name:r,state:bv.JOB_STATE_QUEUED}}}}async getInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=ED(e);return n=E_(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>PD(e))}else{let i=TD(e);return n=E_(`{name}`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>ND(e))}}async listInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=OD(e);return n=E_(`tuningJobs`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`GET`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=kD(e),n=new gy;return Object.assign(n,t),n})}else throw Error(`This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).`)}async cancel(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=vD(e);return n=E_(`{name}:cancel`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=bD(e),n=new _y;return Object.assign(n,t),n})}else{let i=_D(e);return n=E_(`{name}:cancel`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>{let t=yD(e),n=new _y;return Object.assign(n,t),n})}}async tuneInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI()){let i=wD(e,e);return n=E_(`tuningJobs`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>PD(e))}else throw Error(`This method is only supported by the Gemini Enterprise Agent Platform (previously known as Vertex AI).`)}async tuneMldevInternal(e){let t,n=``,r={};if(this.apiClient.isVertexAI())throw Error(`This method is only supported by the Gemini Developer API.`);{let i=CD(e);return n=E_(`tunedModels`,i._url),r=i._query,delete i._url,delete i._query,t=this.apiClient.request({path:n,queryParams:r,body:JSON.stringify(i),httpMethod:`POST`,httpOptions:e.config?.httpOptions,abortSignal:e.config?.abortSignal}).then(e=>e.json().then(t=>{let n=t;return n.sdkHttpResponse={headers:e.headers},n})),t.then(e=>FD(e))}}},RD=class{async download(e,t){throw Error(`Download to file is not supported in the browser, please use a browser compliant download like an <a> tag.`)}},zD=1024*1024*8,BD=3,VD=1e3,HD=2,UD=`x-goog-upload-status`;async function WD(e,t,n,r){let i=await KD(e,t,n,r),a=await i?.json();if(i?.headers?.[UD]!==`final`)throw Error(`Failed to upload file: Upload status is not finalized.`);return a.file}async function GD(e,t,n,r){let i=await KD(e,t,n,r),a=await i?.json();if(i?.headers?.[UD]!==`final`)throw Error(`Failed to upload file: Upload status is not finalized.`);let o=V_(a),s=new jy;return Object.assign(s,o),s}async function KD(e,t,n,r){let i=t,a=r?.baseUrl||n.clientOptions.httpOptions?.baseUrl;if(a){let e=new URL(a),n=new URL(t);n.protocol=e.protocol,n.host=e.host,n.port=e.port,i=n.toString()}let o=0,s=0,c=new ry(new Response),l=`upload`;for(o=e.size;s<o;){let t=Math.min(zD,o-s),a=e.slice(s,s+t);s+t>=o&&(l+=`, finalize`);let u=0,d=VD;for(;u<BD;){let e=Object.assign(Object.assign({},r?.headers||{}),{"X-Goog-Upload-Command":l,"X-Goog-Upload-Offset":String(s),"Content-Length":String(t)});if(c=await n.request({path:``,body:a,httpMethod:`POST`,httpOptions:Object.assign(Object.assign({},r),{apiVersion:``,baseUrl:i,headers:e})}),c?.headers?.[UD])break;u++,await JD(d),d*=HD}if(s+=t,c?.headers?.[UD]!==`active`)break;if(o<=s)throw Error(`All content has been uploaded, but the upload status is not finalized.`)}return c}async function qD(e){return{size:e.size,type:e.type}}function JD(e){return new Promise(t=>setTimeout(t,e))}var YD=class{async upload(e,t,n,r){if(typeof e==`string`)throw Error(`File path is not supported in browser uploader.`);return await WD(e,t,n,r)}async uploadToFileSearchStore(e,t,n,r){if(typeof e==`string`)throw Error(`File path is not supported in browser uploader.`);return await GD(e,t,n,r)}async stat(e){if(typeof e==`string`)throw Error(`File path is not supported in browser uploader.`);return await qD(e)}},XD=class{create(e,t,n){return new ZD(e,t,n)}},ZD=class{constructor(e,t,n){this.url=e,this.headers=t,this.callbacks=n}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(e){if(this.ws===void 0)throw Error(`WebSocket is not connected`);this.ws.send(e)}close(){if(this.ws===void 0)throw Error(`WebSocket is not connected`);this.ws.close()}},QD=`x-goog-api-key`,$D=class{constructor(e){this.apiKey=e}async addAuthHeaders(e,t){if(e.get(QD)===null){if(this.apiKey.startsWith(`auth_tokens/`))throw Error(`Ephemeral tokens are only supported by the live API.`);if(!this.apiKey)throw Error(`API key is missing. Please provide a valid API key.`);e.append(QD,this.apiKey)}}},eO=`gl-node/`,tO=class{getNextGenClient(){let e=this.httpOptions;if(this._nextGenClient===void 0){let e=this.httpOptions;this._nextGenClient=new gD({baseURL:this.apiClient.getBaseUrl(),apiKey:this.apiKey,apiVersion:this.apiClient.getApiVersion(),clientAdapter:this.apiClient,defaultHeaders:this.apiClient.getDefaultHeaders(),timeout:e?.timeout,maxRetries:e?.retryOptions?.attempts})}return e?.extraBody&&console.warn(`GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored.`),this._nextGenClient}get interactions(){return this._interactions===void 0?(console.warn(`GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.`),this._interactions=this.getNextGenClient().interactions,this._interactions):this._interactions}get webhooks(){return this._webhooks===void 0&&(this._webhooks=this.getNextGenClient().webhooks),this._webhooks}constructor(e){if(e.apiKey==null)throw Error(`An API Key must be set when running in a browser`);if(e.project||e.location)throw Error(`Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.`);this.vertexai=e.vertexai??!1,this.apiKey=e.apiKey;let t=w_(e.httpOptions,e.vertexai,void 0,void 0);t&&(e.httpOptions?e.httpOptions.baseUrl=t:e.httpOptions={baseUrl:t}),this.apiVersion=e.apiVersion,this.httpOptions=e.httpOptions;let n=new $D(this.apiKey);this.apiClient=new Vw({auth:n,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:eO+`web`,uploader:new YD,downloader:new RD}),this.models=new hT(this.apiClient),this.live=new iT(this.apiClient,n,new XD),this.batches=new vx(this.apiClient),this.chats=new dS(this.models,this.apiClient),this.caches=new tS(this.apiClient),this.files=new wS(this.apiClient),this.operations=new gT(this.apiClient),this.authTokens=new FT(this.apiClient),this.tunings=new LD(this.apiClient),this.fileSearchStores=new UT(this.apiClient)}};function nO(e){return e.thought===!0}function rO(e,t){return typeof t==`string`&&t.length>0?t:e}var iO=/^[A-Za-z0-9+/]+={0,2}$/;function aO(e){return!e||e.length%4!=0?!1:iO.test(e)}function oO(e,t){return e&&aO(t)?t:void 0}function sO(e){return e.startsWith(`claude-`)||e.startsWith(`gpt-oss-`)}function cO(e){let t=e.toLowerCase().match(/^gemini(?:-live)?-(\d+)/);if(t)return Number.parseInt(t[1],10)}function lO(e){let t=cO(e);return t===void 0?!0:t>=3}function uO(e,t){let n=[],r=yu(t.messages,e,t=>sO(e.id)?t.replace(/[^a-zA-Z0-9_-]/g,`_`).slice(0,64):t);for(let t of r)if(t.role===`user`)if(typeof t.content==`string`)n.push({role:`user`,parts:[{text:ql(t.content)}]});else{let e=t.content.map(e=>e.type===`text`?{text:ql(e.text)}:{inlineData:{mimeType:e.mimeType,data:e.data}});if(e.length===0)continue;n.push({role:`user`,parts:e})}else if(t.role===`assistant`){let r=[],i=t.provider===e.provider&&t.model===e.id;for(let n of t.content)if(n.type===`text`){if(!n.text||n.text.trim()===``)continue;let e=oO(i,n.textSignature);r.push({text:ql(n.text),...e&&{thoughtSignature:e}})}else if(n.type===`thinking`){if(!n.thinking||n.thinking.trim()===``)continue;if(i){let e=oO(i,n.thinkingSignature);r.push({thought:!0,text:ql(n.thinking),...e&&{thoughtSignature:e}})}else r.push({text:ql(n.thinking)})}else if(n.type===`toolCall`){let t=oO(i,n.thoughtSignature),a={functionCall:{name:n.name,args:n.arguments??{},...sO(e.id)?{id:n.id}:{}},...t&&{thoughtSignature:t}};r.push(a)}if(r.length===0)continue;n.push({role:`model`,parts:r})}else if(t.role===`toolResult`){let r=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
78
|
-
`),i=e.input.includes(`image`)?t.content.filter(e=>e.type===`image`):[],a=r.length>0,o=i.length>0,s=lO(e.id),c=a?ql(r):o?`(see attached image)`:``,l=i.map(e=>({inlineData:{mimeType:e.mimeType,data:e.data}})),u=sO(e.id),d={functionResponse:{name:t.toolName,response:t.isError?{error:c}:{output:c},...o&&s&&{parts:l},...u?{id:t.toolCallId}:{}}},f=n[n.length-1];f?.role===`user`&&f.parts?.some(e=>e.functionResponse)?f.parts.push(d):n.push({role:`user`,parts:[d]}),o&&!s&&n.push({role:`user`,parts:[{text:`Tool result image:`},...l]})}return n}var dO=new Set([`$schema`,`$id`,`$anchor`,`$dynamicAnchor`,`$vocabulary`,`$comment`,`$defs`,`definitions`]);function fO(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={};for(let[n,r]of Object.entries(e))dO.has(n)||(t[n]=fO(r));return t}function pO(e,t=!1){if(e.length!==0)return[{functionDeclarations:e.map(e=>({name:e.name,description:e.description,...t?{parameters:fO(e.parameters)}:{parametersJsonSchema:e.parameters}}))}]}function mO(e){switch(e){case`auto`:return nv.AUTO;case`none`:return nv.NONE;case`any`:return nv.ANY;default:return nv.AUTO}}function hO(e){switch(e){case lv.STOP:return`stop`;case lv.MAX_TOKENS:return`length`;case lv.BLOCKLIST:case lv.PROHIBITED_CONTENT:case lv.SPII:case lv.SAFETY:case lv.IMAGE_SAFETY:case lv.IMAGE_PROHIBITED_CONTENT:case lv.IMAGE_RECITATION:case lv.IMAGE_OTHER:case lv.RECITATION:case lv.FINISH_REASON_UNSPECIFIED:case lv.OTHER:case lv.LANGUAGE:case lv.MALFORMED_FUNCTION_CALL:case lv.UNEXPECTED_TOOL_CALL:case lv.NO_IMAGE:return`error`;default:throw Error(`Unhandled stop reason: ${e}`)}}var gO=t({stream:()=>vO,streamSimple:()=>yO}),_O=0,vO=(e,t,n)=>{let r=new An;return(async()=>{let i={role:`assistant`,content:[],api:`google-generative-ai`,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let a=n?.apiKey;if(!a)throw Error(`No API key for provider: ${e.provider}`);let o=bO(e,a,n?.headers),s=xO(e,t,n),c=await n?.onPayload?.(s,e);c!==void 0&&(s=c);let l=await o.models.generateContentStream(s);r.push({type:`start`,partial:i});let u=null,d=i.content,f=()=>d.length-1;for await(let t of l){i.responseId||=t.responseId;let n=t.candidates?.[0];if(n?.content?.parts)for(let e of n.content.parts){if(e.text!==void 0){let t=nO(e);(!u||t&&u.type!==`thinking`||!t&&u.type!==`text`)&&(u&&(u.type===`text`?r.push({type:`text_end`,contentIndex:d.length-1,content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i})),t?(u={type:`thinking`,thinking:``,thinkingSignature:void 0},i.content.push(u),r.push({type:`thinking_start`,contentIndex:f(),partial:i})):(u={type:`text`,text:``},i.content.push(u),r.push({type:`text_start`,contentIndex:f(),partial:i}))),u.type===`thinking`?(u.thinking+=e.text,u.thinkingSignature=rO(u.thinkingSignature,e.thoughtSignature),r.push({type:`thinking_delta`,contentIndex:f(),delta:e.text,partial:i})):(u.text+=e.text,u.textSignature=rO(u.textSignature,e.thoughtSignature),r.push({type:`text_delta`,contentIndex:f(),delta:e.text,partial:i}))}if(e.functionCall){u&&=(u.type===`text`?r.push({type:`text_end`,contentIndex:f(),content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i}),null);let t=e.functionCall.id,n={type:`toolCall`,id:!t||i.content.some(e=>e.type===`toolCall`&&e.id===t)?`${e.functionCall.name}_${Date.now()}_${++_O}`:t,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};i.content.push(n),r.push({type:`toolcall_start`,contentIndex:f(),partial:i}),r.push({type:`toolcall_delta`,contentIndex:f(),delta:JSON.stringify(n.arguments),partial:i}),r.push({type:`toolcall_end`,contentIndex:f(),toolCall:n,partial:i})}}n?.finishReason&&(i.stopReason=hO(n.finishReason),i.content.some(e=>e.type===`toolCall`)&&(i.stopReason=`toolUse`)),t.usageMetadata&&(i.usage={input:(t.usageMetadata.promptTokenCount||0)-(t.usageMetadata.cachedContentTokenCount||0),output:(t.usageMetadata.candidatesTokenCount||0)+(t.usageMetadata.thoughtsTokenCount||0),cacheRead:t.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:t.usageMetadata.thoughtsTokenCount||0,totalTokens:t.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Dr(e,i.usage))}if(u&&(u.type===`text`?r.push({type:`text_end`,contentIndex:f(),content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i})),n?.signal?.aborted)throw Error(`Request was aborted`);if(i.stopReason===`aborted`||i.stopReason===`error`)throw Error(`An unknown error occurred`);r.push({type:`done`,reason:i.stopReason,message:i}),r.end()}catch(e){for(let e of i.content)`index`in e&&delete e.index;i.stopReason=n?.signal?.aborted?`aborted`:`error`,i.errorMessage=qg(Hg(e)),r.push({type:`error`,reason:i.stopReason,error:i}),r.end()}})(),r},yO=(e,t,n)=>{let r=n?.apiKey;if(!r)throw Error(`No API key for provider: ${e.provider}`);let i=fu(e,t,n,r);if(!n?.reasoning)return vO(e,t,{...i,thinking:{enabled:!1}});let a=Ar(e,n.reasoning),o=a===`off`?`high`:a,s=e;return CO(s)||wO(s)||SO(s)?vO(e,t,{...i,thinking:{enabled:!0,level:EO(o,s)}}):vO(e,t,{...i,thinking:{enabled:!0,budgetTokens:DO(s,o,n.thinkingBudgets)}})};function bO(e,t,n){let r={};e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``);let i=Kl({...e.headers,...n});return i&&(r.headers=i),new tO({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function xO(e,t,n={}){let r=uO(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let a={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:ql(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:pO(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?a.toolConfig={functionCallingConfig:{mode:mO(n.toolChoice)}}:a.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=n.thinking.level,a.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(a.thinkingConfig=TO(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);a.abortSignal=n.signal}return{model:e.id,contents:r,config:a}}function SO(e){return/gemma-?4/.test(e.id.toLowerCase())}function CO(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function wO(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function TO(e){return CO(e)?{thinkingLevel:`LOW`}:wO(e)||SO(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function EO(e,t){if(CO(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(SO(t))switch(e){case`minimal`:case`low`:return`MINIMAL`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function DO(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash-lite`)?{minimal:512,low:2048,medium:8192,high:24576}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}var OO=t({stream:()=>NO,streamSimple:()=>PO}),kO=`v1`,AO=`gcp-vertex-credentials`,jO={THINKING_LEVEL_UNSPECIFIED:rv.THINKING_LEVEL_UNSPECIFIED,MINIMAL:rv.MINIMAL,LOW:rv.LOW,MEDIUM:rv.MEDIUM,HIGH:rv.HIGH},MO=0,NO=(e,t,n)=>{let r=new An;return(async()=>{let i={role:`assistant`,content:[],api:`google-vertex`,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let a=VO(n),o=a?IO(e,a,n?.headers):FO(e,UO(n),WO(n),n?.headers,n?.env),s=GO(e,t,n),c=await n?.onPayload?.(s,e);c!==void 0&&(s=c);let l=await o.models.generateContentStream(s);r.push({type:`start`,partial:i});let u=null,d=i.content,f=()=>d.length-1;for await(let t of l){i.responseId||=t.responseId;let n=t.candidates?.[0];if(n?.content?.parts)for(let e of n.content.parts){if(e.text!==void 0){let t=nO(e);(!u||t&&u.type!==`thinking`||!t&&u.type!==`text`)&&(u&&(u.type===`text`?r.push({type:`text_end`,contentIndex:d.length-1,content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i})),t?(u={type:`thinking`,thinking:``,thinkingSignature:void 0},i.content.push(u),r.push({type:`thinking_start`,contentIndex:f(),partial:i})):(u={type:`text`,text:``},i.content.push(u),r.push({type:`text_start`,contentIndex:f(),partial:i}))),u.type===`thinking`?(u.thinking+=e.text,u.thinkingSignature=rO(u.thinkingSignature,e.thoughtSignature),r.push({type:`thinking_delta`,contentIndex:f(),delta:e.text,partial:i})):(u.text+=e.text,u.textSignature=rO(u.textSignature,e.thoughtSignature),r.push({type:`text_delta`,contentIndex:f(),delta:e.text,partial:i}))}if(e.functionCall){u&&=(u.type===`text`?r.push({type:`text_end`,contentIndex:f(),content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i}),null);let t=e.functionCall.id,n={type:`toolCall`,id:!t||i.content.some(e=>e.type===`toolCall`&&e.id===t)?`${e.functionCall.name}_${Date.now()}_${++MO}`:t,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};i.content.push(n),r.push({type:`toolcall_start`,contentIndex:f(),partial:i}),r.push({type:`toolcall_delta`,contentIndex:f(),delta:JSON.stringify(n.arguments),partial:i}),r.push({type:`toolcall_end`,contentIndex:f(),toolCall:n,partial:i})}}n?.finishReason&&(i.stopReason=hO(n.finishReason),i.content.some(e=>e.type===`toolCall`)&&(i.stopReason=`toolUse`)),t.usageMetadata&&(i.usage={input:(t.usageMetadata.promptTokenCount||0)-(t.usageMetadata.cachedContentTokenCount||0),output:(t.usageMetadata.candidatesTokenCount||0)+(t.usageMetadata.thoughtsTokenCount||0),cacheRead:t.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:t.usageMetadata.thoughtsTokenCount||0,totalTokens:t.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Dr(e,i.usage))}if(u&&(u.type===`text`?r.push({type:`text_end`,contentIndex:f(),content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i})),n?.signal?.aborted)throw Error(`Request was aborted`);if(i.stopReason===`aborted`||i.stopReason===`error`)throw Error(`An unknown error occurred`);r.push({type:`done`,reason:i.stopReason,message:i}),r.end()}catch(e){for(let e of i.content)`index`in e&&delete e.index;i.stopReason=n?.signal?.aborted?`aborted`:`error`,i.errorMessage=qg(Hg(e)),r.push({type:`error`,reason:i.stopReason,error:i}),r.end()}})(),r},PO=(e,t,n)=>{let r=fu(e,t,n,void 0);if(!n?.reasoning)return NO(e,t,{...r,thinking:{enabled:!1}});let i=Ar(e,n.reasoning),a=i===`off`?`high`:i,o=e;return KO(o)||qO(o)?NO(e,t,{...r,thinking:{enabled:!0,level:YO(a,o)}}):NO(e,t,{...r,thinking:{enabled:!0,budgetTokens:XO(o,a,n.thinkingBudgets)}})};function FO(e,t,n,r,i){let a=BO(i);return new tO({vertexai:!0,project:t,location:n,apiVersion:kO,...a?{googleAuthOptions:a}:{},httpOptions:LO(e,r)})}function IO(e,t,n){return new tO({vertexai:!0,apiKey:t,apiVersion:kO,httpOptions:LO(e,n)})}function LO(e,t){let n={},r=RO(e.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=Ov.COLLECTION,zO(r)&&(n.apiVersion=``));let i=Kl({...e.headers,...t});return i&&(n.headers=i),Object.keys(n).length>0?n:void 0}function RO(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function zO(e){try{return new URL(e).pathname.split(`/`).some(e=>/^v\d+(?:beta\d*)?$/.test(e))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function BO(e){let t=Yn(`GOOGLE_APPLICATION_CREDENTIALS`,e);return t?{keyFilename:t}:void 0}function VO(e){let t=e?.apiKey?.trim();if(!(!t||t===AO||HO(t)))return t}function HO(e){return/^<[^>]+>$/.test(e)}function UO(e){let t=e?.project||Yn(`GOOGLE_CLOUD_PROJECT`,e?.env)||Yn(`GCLOUD_PROJECT`,e?.env);if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function WO(e){let t=e?.location||Yn(`GOOGLE_CLOUD_LOCATION`,e?.env);if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function GO(e,t,n={}){let r=uO(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let a={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:ql(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:pO(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?a.toolConfig={functionCallingConfig:{mode:mO(n.toolChoice)}}:a.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=jO[n.thinking.level],a.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(a.thinkingConfig=JO(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);a.abortSignal=n.signal}return{model:e.id,contents:r,config:a}}function KO(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function qO(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function JO(e){let t=e;return KO(t)?{thinkingLevel:rv.LOW}:qO(t)?{thinkingLevel:rv.MINIMAL}:{thinkingBudget:0}}function YO(e,t){if(KO(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function XO(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}var ZO=Object.prototype.hasOwnProperty;function E(e,t){let n=/\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;return function(r={}){return e.replace(n,function(e,n){if(!ZO.call(r,n))throw Error(`Parameter '${n}' is required`);let i=r[n];if(typeof i!=`string`&&typeof i!=`number`)throw Error(`Parameter '${n}' must be a string or number`);return t?.charEncoding===`percent`?encodeURIComponent(`${i}`):`${i}`}).replace(/^\/+/,``)}}var QO={eu:`https://api.mistral.ai`};function $O(e){let t=e.serverURL,n={};t||=QO[e.server??`eu`]||``;let r=E(t)(n);return new URL(r)}var ek={language:`typescript`,openapiDocVersion:`1.0.0`,sdkVersion:`2.2.6`,genVersion:`2.884.13`,userAgent:`speakeasy-sdk/typescript 2.2.6 2.884.13 1.0.0 @mistralai/mistralai`};async function tk(e){let t=e.getReader(),n=[],r=0,i=!1;for(;!i;){let{value:e,done:a}=await t.read();a?i=!0:(n.push(e),r+=e.length)}let a=new Uint8Array(r),o=0;for(let e of n)a.set(e,o),o+=e.length;return a.buffer}function nk(e){if(!e)return null;let t=e.toLowerCase().split(`.`).pop();return t&&{json:`application/json`,xml:`application/xml`,html:`text/html`,htm:`text/html`,txt:`text/plain`,csv:`text/csv`,pdf:`application/pdf`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,svg:`image/svg+xml`,js:`application/javascript`,css:`text/css`,zip:`application/zip`,tar:`application/x-tar`,gz:`application/gzip`,mp4:`video/mp4`,mp3:`audio/mpeg`,wav:`audio/wav`,webp:`image/webp`,ico:`image/x-icon`,woff:`font/woff`,woff2:`font/woff2`,ttf:`font/ttf`,otf:`font/otf`}[t]||null}function rk(e,t){return e instanceof Uint8Array?new Blob([new Uint8Array(e)],{type:t}):new Blob([e],{type:t})}var ik=(e,t)=>t==null?fetch(e):fetch(e,t),ak=class e{options;fetcher;requestHooks=[];requestErrorHooks=[];responseHooks=[];constructor(e={}){this.options=e,this.fetcher=e.fetcher||ik}async request(e){let t=e;for(let e of this.requestHooks){let n=await e(t);n&&(t=n)}try{let e=await this.fetcher(t);for(let n of this.responseHooks)await n(e,t);return e}catch(e){for(let n of this.requestErrorHooks)await n(e,t);throw e}}addHook(...e){if(e[0]===`beforeRequest`)this.requestHooks.push(e[1]);else if(e[0]===`requestError`)this.requestErrorHooks.push(e[1]);else if(e[0]===`response`)this.responseHooks.push(e[1]);else throw Error(`Invalid hook type: ${e[0]}`);return this}removeHook(...e){let t;if(e[0]===`beforeRequest`)t=this.requestHooks;else if(e[0]===`requestError`)t=this.requestErrorHooks;else if(e[0]===`response`)t=this.responseHooks;else throw Error(`Invalid hook type: ${e[0]}`);let n=t.findIndex(t=>t===e[1]);return n>=0&&t.splice(n,1),this}clone(){let t=new e(this.options);return t.requestHooks=this.requestHooks.slice(),t.requestErrorHooks=this.requestErrorHooks.slice(),t.responseHooks=this.responseHooks.slice(),t}},ok=/\s*;\s*/g;function sk(e,t){if(t===`*`)return!0;let n=e.headers.get(`content-type`)?.trim()||`application/octet-stream`;n=n.toLowerCase();let[r=``,...i]=t.toLowerCase().trim().split(ok);if(r.split(`/`).length!==2)return!1;let[a=``,...o]=n.split(ok),[s=``,c=``]=a.split(`/`);if(!s||!c||r!==`*/*`&&a!==r&&`${s}/*`!==r&&`*/${c}`!==r||o.length<i.length)return!1;let l=new Set(o);for(let e of i)if(!l.has(e))return!1;return!0}var ck=RegExp(`^[0-9]xx$`,`i`);function D(e,t){let n=`${e.status}`,r=Array.isArray(t)?t:[t];return r.length?r.some(e=>{let t=`${e}`;if(t===`default`)return!0;if(!ck.test(`${t}`))return t===n;let r=t.charAt(0);if(!r)throw Error(`Invalid status code range`);let i=n.charAt(0);if(!i)throw Error(`Invalid response status code: ${n}`);return i===r}):!1}function lk(e,t,n){return D(e,t)&&sk(e,n)}function uk(e){if(typeof e!=`object`||!e)return!1;let t=e instanceof TypeError&&e.message.toLowerCase().startsWith(`failed to fetch`),n=e instanceof TypeError&&e.message.toLowerCase().startsWith(`fetch failed`),r=`name`in e&&e.name===`ConnectionError`,i=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnreset`;return t||n||i||r}function dk(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`TimeoutError`,n=`code`in e&&e.code===23,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}function fk(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`AbortError`,n=`code`in e&&e.code===20,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}var pk=class{beforeRequest(e,t){let n=`mistral-client-typescript/${ek.sdkVersion}`;return t.headers.set(`user-agent`,n),t.headers.get(`user-agent`)||t.headers.set(`x-mistral-user-agent`,n),t}},mk=`x-model-deprecation-timestamp`,hk=class{afterSuccess(e,t){return t.headers.has(mk)&&t.clone().json().then(e=>{let n=e.model;console.warn(`WARNING: The model ${n} is deprecated and will be removed on ${t.headers.get(mk)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.`)}).catch(()=>{}),t}},gk;async function _k(){if(gk!==void 0)return gk;try{gk=await o(()=>import(`./otel-D1LswXpM.js`),__vite__mapDeps([0,1]))}catch{gk=null}return gk}var vk=`_tracingSpan`,yk=`_tracingBody`,bk=`_tracingTracer`,xk=class e extends ak{wrappedClient;requestContexts;constructor(e,t){super(),this.wrappedClient=e,this.requestContexts=t}async request(e){let t=this.requestContexts.get(e);if(!t)return this.wrappedClient.request(e);let n=null;try{return n=await _k(),n?await n.runWithContext(t,()=>this.wrappedClient.request(e)):await this.wrappedClient.request(e)}catch(e){throw n&&await n.recordRequestError(t,e),e}finally{this.requestContexts.delete(e)}}clone(){return new e(this.wrappedClient.clone(),this.requestContexts)}},Sk=class{#e=new WeakMap;sdkInit(e){return{...e,client:new xk(e.client,this.#e)}}async beforeRequest(e,t){let n=e,r=await _k();if(!r)return t;let i=r.getOrCreateOtelTracer(),{request:a,span:o,body:s}=await r.getTracedRequestAndSpan(i,e.operationID,t);return n[bk]=i,n[vk]=o,n[yk]=s,this.#e.set(a,r.getSpanContext(o)),a}async afterSuccess(e,t){let n=e,r=n[vk],i=n[bk];if(!r||!i)return t;let a=await _k();return a?a.getTracedResponse(i,r,e.operationID,t):t}async afterError(e,t,n){let r=e[vk];if(!r)return{response:t,error:n};let i=await _k();return i?i.getResponseAndError(r,t,n):{response:t,error:n}}};function Ck(e){let t=new pk;e.registerBeforeRequestHook(t);let n=new hk;e.registerAfterSuccessHook(n);let r=new Sk;e.registerBeforeRequestHook(r),e.registerAfterSuccessHook(r),e.registerAfterErrorHook(r),e.registerSDKInitHook(r)}var wk=class{sdkInitHooks=[];beforeCreateRequestHooks=[];beforeRequestHooks=[];afterSuccessHooks=[];afterErrorHooks=[];constructor(){for(let e of[])`sdkInit`in e&&this.registerSDKInitHook(e),`beforeCreateRequest`in e&&this.registerBeforeCreateRequestHook(e),`beforeRequest`in e&&this.registerBeforeRequestHook(e),`afterSuccess`in e&&this.registerAfterSuccessHook(e),`afterError`in e&&this.registerAfterErrorHook(e);Ck(this)}registerSDKInitHook(e){this.sdkInitHooks.push(e)}registerBeforeCreateRequestHook(e){this.beforeCreateRequestHooks.push(e)}registerBeforeRequestHook(e){this.beforeRequestHooks.push(e)}registerAfterSuccessHook(e){this.afterSuccessHooks.push(e)}registerAfterErrorHook(e){this.afterErrorHooks.push(e)}sdkInit(e){return this.sdkInitHooks.reduce((e,t)=>t.sdkInit(e),e)}beforeCreateRequest(e,t){let n=t;for(let t of this.beforeCreateRequestHooks)n=t.beforeCreateRequest(e,n);return n}async beforeRequest(e,t){let n=t;for(let t of this.beforeRequestHooks)n=await t.beforeRequest(e,n);return n}async afterSuccess(e,t){let n=t;for(let t of this.afterSuccessHooks)n=await t.afterSuccess(e,n);return n}async afterError(e,t,n){let r=t,i=n;for(let t of this.afterErrorHooks){let n=await t.afterError(e,r,i);r=n.response,i=n.error}return{response:r,error:i}}},Tk=class extends Error{cause;name=`HTTPClientError`;constructor(e,t){let n=e;t?.cause&&(n+=`: ${t.cause}`),super(n,t),this.cause===void 0&&(this.cause=t?.cause)}},Ek=class extends Tk{name=`UnexpectedClientError`},Dk=class extends Tk{name=`InvalidRequestError`},Ok=class extends Tk{name=`RequestAbortedError`},kk=class extends Tk{name=`RequestTimeoutError`},Ak=class extends Tk{name=`ConnectionError`};function jk(e){return{ok:!0,value:e}}function Mk(e){return{ok:!1,error:e}}async function O(e){let t=await e;if(!t.ok)throw t.error;return t.value}var Nk=Object.freeze({status:`aborted`});function k(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Pk=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Fk=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Ik={};function Lk(e){return e&&Object.assign(Ik,e),Ik}function Rk(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function zk(e,t){return typeof t==`bigint`?t.toString():t}function Bk(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Vk(e){return e==null}function Hk(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Uk(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var Wk=Symbol(`evaluating`);function Gk(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Wk)return r===void 0&&(r=Wk,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Kk(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function qk(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Jk(e){return JSON.stringify(e)}function Yk(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Xk=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Zk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Qk=Bk(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function $k(e){if(Zk(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Zk(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function eA(e){return $k(e)?{...e}:Array.isArray(e)?[...e]:e}var tA=new Set([`string`,`number`,`symbol`]);function nA(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function rA(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function iA(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function aA(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var oA={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function sA(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return rA(e,qk(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Kk(this,`shape`,e),e},checks:[]}))}function cA(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return rA(e,qk(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Kk(this,`shape`,r),r},checks:[]}))}function lA(e,t){if(!$k(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return rA(e,qk(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Kk(this,`shape`,n),n}}))}function uA(e,t){if(!$k(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return rA(e,qk(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Kk(this,`shape`,n),n}}))}function dA(e,t){return rA(e,qk(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Kk(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function fA(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return rA(t,qk(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Kk(this,`shape`,i),i},checks:[]}))}function pA(e,t,n){return rA(t,qk(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Kk(this,`shape`,i),i}}))}function mA(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function hA(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function gA(e){return typeof e==`string`?e:e?.message}function _A(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=gA(e.inst?._zod.def?.error?.(e))??gA(t?.error?.(e))??gA(n.customError?.(e))??gA(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function vA(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function yA(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var bA=(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,zk,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},xA=k(`$ZodError`,bA),SA=k(`$ZodError`,bA,{Parent:Error});function CA(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function wA(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function TA(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function EA(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${TA(e.path)}`);return t.join(`
|
|
78
|
+
`),i=e.input.includes(`image`)?t.content.filter(e=>e.type===`image`):[],a=r.length>0,o=i.length>0,s=lO(e.id),c=a?ql(r):o?`(see attached image)`:``,l=i.map(e=>({inlineData:{mimeType:e.mimeType,data:e.data}})),u=sO(e.id),d={functionResponse:{name:t.toolName,response:t.isError?{error:c}:{output:c},...o&&s&&{parts:l},...u?{id:t.toolCallId}:{}}},f=n[n.length-1];f?.role===`user`&&f.parts?.some(e=>e.functionResponse)?f.parts.push(d):n.push({role:`user`,parts:[d]}),o&&!s&&n.push({role:`user`,parts:[{text:`Tool result image:`},...l]})}return n}var dO=new Set([`$schema`,`$id`,`$anchor`,`$dynamicAnchor`,`$vocabulary`,`$comment`,`$defs`,`definitions`]);function fO(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={};for(let[n,r]of Object.entries(e))dO.has(n)||(t[n]=fO(r));return t}function pO(e,t=!1){if(e.length!==0)return[{functionDeclarations:e.map(e=>({name:e.name,description:e.description,...t?{parameters:fO(e.parameters)}:{parametersJsonSchema:e.parameters}}))}]}function mO(e){switch(e){case`auto`:return nv.AUTO;case`none`:return nv.NONE;case`any`:return nv.ANY;default:return nv.AUTO}}function hO(e){switch(e){case lv.STOP:return`stop`;case lv.MAX_TOKENS:return`length`;case lv.BLOCKLIST:case lv.PROHIBITED_CONTENT:case lv.SPII:case lv.SAFETY:case lv.IMAGE_SAFETY:case lv.IMAGE_PROHIBITED_CONTENT:case lv.IMAGE_RECITATION:case lv.IMAGE_OTHER:case lv.RECITATION:case lv.FINISH_REASON_UNSPECIFIED:case lv.OTHER:case lv.LANGUAGE:case lv.MALFORMED_FUNCTION_CALL:case lv.UNEXPECTED_TOOL_CALL:case lv.NO_IMAGE:return`error`;default:throw Error(`Unhandled stop reason: ${e}`)}}var gO=t({stream:()=>vO,streamSimple:()=>yO}),_O=0,vO=(e,t,n)=>{let r=new An;return(async()=>{let i={role:`assistant`,content:[],api:`google-generative-ai`,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let a=n?.apiKey;if(!a)throw Error(`No API key for provider: ${e.provider}`);let o=bO(e,a,n?.headers),s=xO(e,t,n),c=await n?.onPayload?.(s,e);c!==void 0&&(s=c);let l=await o.models.generateContentStream(s);r.push({type:`start`,partial:i});let u=null,d=i.content,f=()=>d.length-1;for await(let t of l){i.responseId||=t.responseId;let n=t.candidates?.[0];if(n?.content?.parts)for(let e of n.content.parts){if(e.text!==void 0){let t=nO(e);(!u||t&&u.type!==`thinking`||!t&&u.type!==`text`)&&(u&&(u.type===`text`?r.push({type:`text_end`,contentIndex:d.length-1,content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i})),t?(u={type:`thinking`,thinking:``,thinkingSignature:void 0},i.content.push(u),r.push({type:`thinking_start`,contentIndex:f(),partial:i})):(u={type:`text`,text:``},i.content.push(u),r.push({type:`text_start`,contentIndex:f(),partial:i}))),u.type===`thinking`?(u.thinking+=e.text,u.thinkingSignature=rO(u.thinkingSignature,e.thoughtSignature),r.push({type:`thinking_delta`,contentIndex:f(),delta:e.text,partial:i})):(u.text+=e.text,u.textSignature=rO(u.textSignature,e.thoughtSignature),r.push({type:`text_delta`,contentIndex:f(),delta:e.text,partial:i}))}if(e.functionCall){u&&=(u.type===`text`?r.push({type:`text_end`,contentIndex:f(),content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i}),null);let t=e.functionCall.id,n={type:`toolCall`,id:!t||i.content.some(e=>e.type===`toolCall`&&e.id===t)?`${e.functionCall.name}_${Date.now()}_${++_O}`:t,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};i.content.push(n),r.push({type:`toolcall_start`,contentIndex:f(),partial:i}),r.push({type:`toolcall_delta`,contentIndex:f(),delta:JSON.stringify(n.arguments),partial:i}),r.push({type:`toolcall_end`,contentIndex:f(),toolCall:n,partial:i})}}n?.finishReason&&(i.stopReason=hO(n.finishReason),i.content.some(e=>e.type===`toolCall`)&&(i.stopReason=`toolUse`)),t.usageMetadata&&(i.usage={input:(t.usageMetadata.promptTokenCount||0)-(t.usageMetadata.cachedContentTokenCount||0),output:(t.usageMetadata.candidatesTokenCount||0)+(t.usageMetadata.thoughtsTokenCount||0),cacheRead:t.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:t.usageMetadata.thoughtsTokenCount||0,totalTokens:t.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Dr(e,i.usage))}if(u&&(u.type===`text`?r.push({type:`text_end`,contentIndex:f(),content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i})),n?.signal?.aborted)throw Error(`Request was aborted`);if(i.stopReason===`aborted`||i.stopReason===`error`)throw Error(`An unknown error occurred`);r.push({type:`done`,reason:i.stopReason,message:i}),r.end()}catch(e){for(let e of i.content)`index`in e&&delete e.index;i.stopReason=n?.signal?.aborted?`aborted`:`error`,i.errorMessage=qg(Hg(e)),r.push({type:`error`,reason:i.stopReason,error:i}),r.end()}})(),r},yO=(e,t,n)=>{let r=n?.apiKey;if(!r)throw Error(`No API key for provider: ${e.provider}`);let i=fu(e,t,n,r);if(!n?.reasoning)return vO(e,t,{...i,thinking:{enabled:!1}});let a=Ar(e,n.reasoning),o=a===`off`?`high`:a,s=e;return CO(s)||wO(s)||SO(s)?vO(e,t,{...i,thinking:{enabled:!0,level:EO(o,s)}}):vO(e,t,{...i,thinking:{enabled:!0,budgetTokens:DO(s,o,n.thinkingBudgets)}})};function bO(e,t,n){let r={};e.baseUrl&&(r.baseUrl=e.baseUrl,r.apiVersion=``);let i=Kl({...e.headers,...n});return i&&(r.headers=i),new tO({apiKey:t,httpOptions:Object.keys(r).length>0?r:void 0})}function xO(e,t,n={}){let r=uO(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let a={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:ql(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:pO(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?a.toolConfig={functionCallingConfig:{mode:mO(n.toolChoice)}}:a.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=n.thinking.level,a.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(a.thinkingConfig=TO(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);a.abortSignal=n.signal}return{model:e.id,contents:r,config:a}}function SO(e){return/gemma-?4/.test(e.id.toLowerCase())}function CO(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function wO(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function TO(e){return CO(e)?{thinkingLevel:`LOW`}:wO(e)||SO(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function EO(e,t){if(CO(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}if(SO(t))switch(e){case`minimal`:case`low`:return`MINIMAL`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function DO(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash-lite`)?{minimal:512,low:2048,medium:8192,high:24576}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}var OO=t({stream:()=>NO,streamSimple:()=>PO}),kO=`v1`,AO=`gcp-vertex-credentials`,jO={THINKING_LEVEL_UNSPECIFIED:rv.THINKING_LEVEL_UNSPECIFIED,MINIMAL:rv.MINIMAL,LOW:rv.LOW,MEDIUM:rv.MEDIUM,HIGH:rv.HIGH},MO=0,NO=(e,t,n)=>{let r=new An;return(async()=>{let i={role:`assistant`,content:[],api:`google-vertex`,provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let a=VO(n),o=a?IO(e,a,n?.headers):FO(e,UO(n),WO(n),n?.headers,n?.env),s=GO(e,t,n),c=await n?.onPayload?.(s,e);c!==void 0&&(s=c);let l=await o.models.generateContentStream(s);r.push({type:`start`,partial:i});let u=null,d=i.content,f=()=>d.length-1;for await(let t of l){i.responseId||=t.responseId;let n=t.candidates?.[0];if(n?.content?.parts)for(let e of n.content.parts){if(e.text!==void 0){let t=nO(e);(!u||t&&u.type!==`thinking`||!t&&u.type!==`text`)&&(u&&(u.type===`text`?r.push({type:`text_end`,contentIndex:d.length-1,content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i})),t?(u={type:`thinking`,thinking:``,thinkingSignature:void 0},i.content.push(u),r.push({type:`thinking_start`,contentIndex:f(),partial:i})):(u={type:`text`,text:``},i.content.push(u),r.push({type:`text_start`,contentIndex:f(),partial:i}))),u.type===`thinking`?(u.thinking+=e.text,u.thinkingSignature=rO(u.thinkingSignature,e.thoughtSignature),r.push({type:`thinking_delta`,contentIndex:f(),delta:e.text,partial:i})):(u.text+=e.text,u.textSignature=rO(u.textSignature,e.thoughtSignature),r.push({type:`text_delta`,contentIndex:f(),delta:e.text,partial:i}))}if(e.functionCall){u&&=(u.type===`text`?r.push({type:`text_end`,contentIndex:f(),content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i}),null);let t=e.functionCall.id,n={type:`toolCall`,id:!t||i.content.some(e=>e.type===`toolCall`&&e.id===t)?`${e.functionCall.name}_${Date.now()}_${++MO}`:t,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};i.content.push(n),r.push({type:`toolcall_start`,contentIndex:f(),partial:i}),r.push({type:`toolcall_delta`,contentIndex:f(),delta:JSON.stringify(n.arguments),partial:i}),r.push({type:`toolcall_end`,contentIndex:f(),toolCall:n,partial:i})}}n?.finishReason&&(i.stopReason=hO(n.finishReason),i.content.some(e=>e.type===`toolCall`)&&(i.stopReason=`toolUse`)),t.usageMetadata&&(i.usage={input:(t.usageMetadata.promptTokenCount||0)-(t.usageMetadata.cachedContentTokenCount||0),output:(t.usageMetadata.candidatesTokenCount||0)+(t.usageMetadata.thoughtsTokenCount||0),cacheRead:t.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:t.usageMetadata.thoughtsTokenCount||0,totalTokens:t.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Dr(e,i.usage))}if(u&&(u.type===`text`?r.push({type:`text_end`,contentIndex:f(),content:u.text,partial:i}):r.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:i})),n?.signal?.aborted)throw Error(`Request was aborted`);if(i.stopReason===`aborted`||i.stopReason===`error`)throw Error(`An unknown error occurred`);r.push({type:`done`,reason:i.stopReason,message:i}),r.end()}catch(e){for(let e of i.content)`index`in e&&delete e.index;i.stopReason=n?.signal?.aborted?`aborted`:`error`,i.errorMessage=qg(Hg(e)),r.push({type:`error`,reason:i.stopReason,error:i}),r.end()}})(),r},PO=(e,t,n)=>{let r=fu(e,t,n,void 0);if(!n?.reasoning)return NO(e,t,{...r,thinking:{enabled:!1}});let i=Ar(e,n.reasoning),a=i===`off`?`high`:i,o=e;return KO(o)||qO(o)?NO(e,t,{...r,thinking:{enabled:!0,level:YO(a,o)}}):NO(e,t,{...r,thinking:{enabled:!0,budgetTokens:XO(o,a,n.thinkingBudgets)}})};function FO(e,t,n,r,i){let a=BO(i);return new tO({vertexai:!0,project:t,location:n,apiVersion:kO,...a?{googleAuthOptions:a}:{},httpOptions:LO(e,r)})}function IO(e,t,n){return new tO({vertexai:!0,apiKey:t,apiVersion:kO,httpOptions:LO(e,n)})}function LO(e,t){let n={},r=RO(e.baseUrl);r&&(n.baseUrl=r,n.baseUrlResourceScope=Ov.COLLECTION,zO(r)&&(n.apiVersion=``));let i=Kl({...e.headers,...t});return i&&(n.headers=i),Object.keys(n).length>0?n:void 0}function RO(e){let t=e.trim();if(!(!t||t.includes(`{location}`)))return t}function zO(e){try{return new URL(e).pathname.split(`/`).some(e=>/^v\d+(?:beta\d*)?$/.test(e))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function BO(e){let t=Yn(`GOOGLE_APPLICATION_CREDENTIALS`,e);return t?{keyFilename:t}:void 0}function VO(e){let t=e?.apiKey?.trim();if(!(!t||t===AO||HO(t)))return t}function HO(e){return/^<[^>]+>$/.test(e)}function UO(e){let t=e?.project||Yn(`GOOGLE_CLOUD_PROJECT`,e?.env)||Yn(`GCLOUD_PROJECT`,e?.env);if(!t)throw Error(`Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.`);return t}function WO(e){let t=e?.location||Yn(`GOOGLE_CLOUD_LOCATION`,e?.env);if(!t)throw Error(`Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.`);return t}function GO(e,t,n={}){let r=uO(e,t),i={};n.temperature!==void 0&&(i.temperature=n.temperature),n.maxTokens!==void 0&&(i.maxOutputTokens=n.maxTokens);let a={...Object.keys(i).length>0&&i,...t.systemPrompt&&{systemInstruction:ql(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:pO(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?a.toolConfig={functionCallingConfig:{mode:mO(n.toolChoice)}}:a.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=jO[n.thinking.level],a.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(a.thinkingConfig=JO(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);a.abortSignal=n.signal}return{model:e.id,contents:r,config:a}}function KO(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function qO(e){let t=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(t)||t===`gemini-flash-latest`||t===`gemini-flash-lite-latest`}function JO(e){let t=e;return KO(t)?{thinkingLevel:rv.LOW}:qO(t)?{thinkingLevel:rv.MINIMAL}:{thinkingBudget:0}}function YO(e,t){if(KO(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function XO(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}var ZO=Object.prototype.hasOwnProperty;function E(e,t){let n=/\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;return function(r={}){return e.replace(n,function(e,n){if(!ZO.call(r,n))throw Error(`Parameter '${n}' is required`);let i=r[n];if(typeof i!=`string`&&typeof i!=`number`)throw Error(`Parameter '${n}' must be a string or number`);return t?.charEncoding===`percent`?encodeURIComponent(`${i}`):`${i}`}).replace(/^\/+/,``)}}var QO={eu:`https://api.mistral.ai`};function $O(e){let t=e.serverURL,n={};t||=QO[e.server??`eu`]||``;let r=E(t)(n);return new URL(r)}var ek={language:`typescript`,openapiDocVersion:`1.0.0`,sdkVersion:`2.2.6`,genVersion:`2.884.13`,userAgent:`speakeasy-sdk/typescript 2.2.6 2.884.13 1.0.0 @mistralai/mistralai`};async function tk(e){let t=e.getReader(),n=[],r=0,i=!1;for(;!i;){let{value:e,done:a}=await t.read();a?i=!0:(n.push(e),r+=e.length)}let a=new Uint8Array(r),o=0;for(let e of n)a.set(e,o),o+=e.length;return a.buffer}function nk(e){if(!e)return null;let t=e.toLowerCase().split(`.`).pop();return t&&{json:`application/json`,xml:`application/xml`,html:`text/html`,htm:`text/html`,txt:`text/plain`,csv:`text/csv`,pdf:`application/pdf`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,svg:`image/svg+xml`,js:`application/javascript`,css:`text/css`,zip:`application/zip`,tar:`application/x-tar`,gz:`application/gzip`,mp4:`video/mp4`,mp3:`audio/mpeg`,wav:`audio/wav`,webp:`image/webp`,ico:`image/x-icon`,woff:`font/woff`,woff2:`font/woff2`,ttf:`font/ttf`,otf:`font/otf`}[t]||null}function rk(e,t){return e instanceof Uint8Array?new Blob([new Uint8Array(e)],{type:t}):new Blob([e],{type:t})}var ik=(e,t)=>t==null?fetch(e):fetch(e,t),ak=class e{options;fetcher;requestHooks=[];requestErrorHooks=[];responseHooks=[];constructor(e={}){this.options=e,this.fetcher=e.fetcher||ik}async request(e){let t=e;for(let e of this.requestHooks){let n=await e(t);n&&(t=n)}try{let e=await this.fetcher(t);for(let n of this.responseHooks)await n(e,t);return e}catch(e){for(let n of this.requestErrorHooks)await n(e,t);throw e}}addHook(...e){if(e[0]===`beforeRequest`)this.requestHooks.push(e[1]);else if(e[0]===`requestError`)this.requestErrorHooks.push(e[1]);else if(e[0]===`response`)this.responseHooks.push(e[1]);else throw Error(`Invalid hook type: ${e[0]}`);return this}removeHook(...e){let t;if(e[0]===`beforeRequest`)t=this.requestHooks;else if(e[0]===`requestError`)t=this.requestErrorHooks;else if(e[0]===`response`)t=this.responseHooks;else throw Error(`Invalid hook type: ${e[0]}`);let n=t.findIndex(t=>t===e[1]);return n>=0&&t.splice(n,1),this}clone(){let t=new e(this.options);return t.requestHooks=this.requestHooks.slice(),t.requestErrorHooks=this.requestErrorHooks.slice(),t.responseHooks=this.responseHooks.slice(),t}},ok=/\s*;\s*/g;function sk(e,t){if(t===`*`)return!0;let n=e.headers.get(`content-type`)?.trim()||`application/octet-stream`;n=n.toLowerCase();let[r=``,...i]=t.toLowerCase().trim().split(ok);if(r.split(`/`).length!==2)return!1;let[a=``,...o]=n.split(ok),[s=``,c=``]=a.split(`/`);if(!s||!c||r!==`*/*`&&a!==r&&`${s}/*`!==r&&`*/${c}`!==r||o.length<i.length)return!1;let l=new Set(o);for(let e of i)if(!l.has(e))return!1;return!0}var ck=RegExp(`^[0-9]xx$`,`i`);function D(e,t){let n=`${e.status}`,r=Array.isArray(t)?t:[t];return r.length?r.some(e=>{let t=`${e}`;if(t===`default`)return!0;if(!ck.test(`${t}`))return t===n;let r=t.charAt(0);if(!r)throw Error(`Invalid status code range`);let i=n.charAt(0);if(!i)throw Error(`Invalid response status code: ${n}`);return i===r}):!1}function lk(e,t,n){return D(e,t)&&sk(e,n)}function uk(e){if(typeof e!=`object`||!e)return!1;let t=e instanceof TypeError&&e.message.toLowerCase().startsWith(`failed to fetch`),n=e instanceof TypeError&&e.message.toLowerCase().startsWith(`fetch failed`),r=`name`in e&&e.name===`ConnectionError`,i=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnreset`;return t||n||i||r}function dk(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`TimeoutError`,n=`code`in e&&e.code===23,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}function fk(e){if(typeof e!=`object`||!e)return!1;let t=`name`in e&&e.name===`AbortError`,n=`code`in e&&e.code===20,r=`code`in e&&typeof e.code==`string`&&e.code.toLowerCase()===`econnaborted`;return t||n||r}var pk=class{beforeRequest(e,t){let n=`mistral-client-typescript/${ek.sdkVersion}`;return t.headers.set(`user-agent`,n),t.headers.get(`user-agent`)||t.headers.set(`x-mistral-user-agent`,n),t}},mk=`x-model-deprecation-timestamp`,hk=class{afterSuccess(e,t){return t.headers.has(mk)&&t.clone().json().then(e=>{let n=e.model;console.warn(`WARNING: The model ${n} is deprecated and will be removed on ${t.headers.get(mk)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.`)}).catch(()=>{}),t}},gk;async function _k(){if(gk!==void 0)return gk;try{gk=await o(()=>import(`./otel-BFnphzjt.js`),__vite__mapDeps([0,1]))}catch{gk=null}return gk}var vk=`_tracingSpan`,yk=`_tracingBody`,bk=`_tracingTracer`,xk=class e extends ak{wrappedClient;requestContexts;constructor(e,t){super(),this.wrappedClient=e,this.requestContexts=t}async request(e){let t=this.requestContexts.get(e);if(!t)return this.wrappedClient.request(e);let n=null;try{return n=await _k(),n?await n.runWithContext(t,()=>this.wrappedClient.request(e)):await this.wrappedClient.request(e)}catch(e){throw n&&await n.recordRequestError(t,e),e}finally{this.requestContexts.delete(e)}}clone(){return new e(this.wrappedClient.clone(),this.requestContexts)}},Sk=class{#e=new WeakMap;sdkInit(e){return{...e,client:new xk(e.client,this.#e)}}async beforeRequest(e,t){let n=e,r=await _k();if(!r)return t;let i=r.getOrCreateOtelTracer(),{request:a,span:o,body:s}=await r.getTracedRequestAndSpan(i,e.operationID,t);return n[bk]=i,n[vk]=o,n[yk]=s,this.#e.set(a,r.getSpanContext(o)),a}async afterSuccess(e,t){let n=e,r=n[vk],i=n[bk];if(!r||!i)return t;let a=await _k();return a?a.getTracedResponse(i,r,e.operationID,t):t}async afterError(e,t,n){let r=e[vk];if(!r)return{response:t,error:n};let i=await _k();return i?i.getResponseAndError(r,t,n):{response:t,error:n}}};function Ck(e){let t=new pk;e.registerBeforeRequestHook(t);let n=new hk;e.registerAfterSuccessHook(n);let r=new Sk;e.registerBeforeRequestHook(r),e.registerAfterSuccessHook(r),e.registerAfterErrorHook(r),e.registerSDKInitHook(r)}var wk=class{sdkInitHooks=[];beforeCreateRequestHooks=[];beforeRequestHooks=[];afterSuccessHooks=[];afterErrorHooks=[];constructor(){for(let e of[])`sdkInit`in e&&this.registerSDKInitHook(e),`beforeCreateRequest`in e&&this.registerBeforeCreateRequestHook(e),`beforeRequest`in e&&this.registerBeforeRequestHook(e),`afterSuccess`in e&&this.registerAfterSuccessHook(e),`afterError`in e&&this.registerAfterErrorHook(e);Ck(this)}registerSDKInitHook(e){this.sdkInitHooks.push(e)}registerBeforeCreateRequestHook(e){this.beforeCreateRequestHooks.push(e)}registerBeforeRequestHook(e){this.beforeRequestHooks.push(e)}registerAfterSuccessHook(e){this.afterSuccessHooks.push(e)}registerAfterErrorHook(e){this.afterErrorHooks.push(e)}sdkInit(e){return this.sdkInitHooks.reduce((e,t)=>t.sdkInit(e),e)}beforeCreateRequest(e,t){let n=t;for(let t of this.beforeCreateRequestHooks)n=t.beforeCreateRequest(e,n);return n}async beforeRequest(e,t){let n=t;for(let t of this.beforeRequestHooks)n=await t.beforeRequest(e,n);return n}async afterSuccess(e,t){let n=t;for(let t of this.afterSuccessHooks)n=await t.afterSuccess(e,n);return n}async afterError(e,t,n){let r=t,i=n;for(let t of this.afterErrorHooks){let n=await t.afterError(e,r,i);r=n.response,i=n.error}return{response:r,error:i}}},Tk=class extends Error{cause;name=`HTTPClientError`;constructor(e,t){let n=e;t?.cause&&(n+=`: ${t.cause}`),super(n,t),this.cause===void 0&&(this.cause=t?.cause)}},Ek=class extends Tk{name=`UnexpectedClientError`},Dk=class extends Tk{name=`InvalidRequestError`},Ok=class extends Tk{name=`RequestAbortedError`},kk=class extends Tk{name=`RequestTimeoutError`},Ak=class extends Tk{name=`ConnectionError`};function jk(e){return{ok:!0,value:e}}function Mk(e){return{ok:!1,error:e}}async function O(e){let t=await e;if(!t.ok)throw t.error;return t.value}var Nk=Object.freeze({status:`aborted`});function k(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Pk=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Fk=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Ik={};function Lk(e){return e&&Object.assign(Ik,e),Ik}function Rk(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function zk(e,t){return typeof t==`bigint`?t.toString():t}function Bk(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Vk(e){return e==null}function Hk(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Uk(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var Wk=Symbol(`evaluating`);function Gk(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Wk)return r===void 0&&(r=Wk,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Kk(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function qk(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Jk(e){return JSON.stringify(e)}function Yk(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Xk=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Zk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Qk=Bk(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function $k(e){if(Zk(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Zk(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function eA(e){return $k(e)?{...e}:Array.isArray(e)?[...e]:e}var tA=new Set([`string`,`number`,`symbol`]);function nA(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function rA(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function iA(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function aA(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var oA={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function sA(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return rA(e,qk(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Kk(this,`shape`,e),e},checks:[]}))}function cA(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return rA(e,qk(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Kk(this,`shape`,r),r},checks:[]}))}function lA(e,t){if(!$k(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return rA(e,qk(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Kk(this,`shape`,n),n}}))}function uA(e,t){if(!$k(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return rA(e,qk(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Kk(this,`shape`,n),n}}))}function dA(e,t){return rA(e,qk(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Kk(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function fA(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return rA(t,qk(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Kk(this,`shape`,i),i},checks:[]}))}function pA(e,t,n){return rA(t,qk(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Kk(this,`shape`,i),i}}))}function mA(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function hA(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function gA(e){return typeof e==`string`?e:e?.message}function _A(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=gA(e.inst?._zod.def?.error?.(e))??gA(t?.error?.(e))??gA(n.customError?.(e))??gA(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function vA(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function yA(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var bA=(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,zk,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},xA=k(`$ZodError`,bA),SA=k(`$ZodError`,bA,{Parent:Error});function CA(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function wA(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function TA(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function EA(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${TA(e.path)}`);return t.join(`
|
|
79
79
|
`)}var DA=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Pk;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>_A(e,a,Lk())));throw Xk(t,i?.callee),t}return o.value},OA=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>_A(e,a,Lk())));throw Xk(t,i?.callee),t}return o.value},kA=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Pk;return a.issues.length?{success:!1,error:new(e??xA)(a.issues.map(e=>_A(e,i,Lk())))}:{success:!0,data:a.value}},AA=kA(SA),jA=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>_A(e,i,Lk())))}:{success:!0,data:a.value}},MA=jA(SA),NA=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return DA(e)(t,n,i)},PA=e=>(t,n,r)=>DA(e)(t,n,r),FA=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return OA(e)(t,n,i)},IA=e=>async(t,n,r)=>OA(e)(t,n,r),LA=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return kA(e)(t,n,i)},RA=e=>(t,n,r)=>kA(e)(t,n,r),zA=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return jA(e)(t,n,i)},BA=e=>async(t,n,r)=>jA(e)(t,n,r),VA=/^[cC][^\s-]{8,}$/,HA=/^[0-9a-z]+$/,UA=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,WA=/^[0-9a-vA-V]{20}$/,GA=/^[A-Za-z0-9]{27}$/,KA=/^[a-zA-Z0-9_-]{21}$/,qA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,JA=/^([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})$/,YA=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)$/,XA=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ZA=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function QA(){return new RegExp(ZA,`u`)}var $A=/^(?:(?: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])$/,ej=/^(([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}|:))$/,tj=/^((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])$/,nj=/^(([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])$/,rj=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ij=/^[A-Za-z0-9_-]*$/,aj=/^\+[1-9]\d{6,14}$/,oj=`(?:(?:\\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])))`,sj=RegExp(`^${oj}$`);function cj(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function lj(e){return RegExp(`^${cj(e)}$`)}function uj(e){let t=cj({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${oj}T(?:${r})$`)}var dj=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},fj=/^-?\d+$/,pj=/^-?\d+(?:\.\d+)?$/,mj=/^(?:true|false)$/i,hj=/^[^A-Z]*$/,gj=/^[^a-z]*$/,_j=k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vj={number:`number`,bigint:`bigint`,object:`date`},yj=k(`$ZodCheckLessThan`,(e,t)=>{_j.init(e,t);let n=vj[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bj=k(`$ZodCheckGreaterThan`,(e,t)=>{_j.init(e,t);let n=vj[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xj=k(`$ZodCheckMultipleOf`,(e,t)=>{_j.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Uk(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Sj=k(`$ZodCheckNumberFormat`,(e,t)=>{_j.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=oA[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=fj)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}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})}}),Cj=k(`$ZodCheckMaxLength`,(e,t)=>{var n;_j.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Vk(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=vA(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wj=k(`$ZodCheckMinLength`,(e,t)=>{var n;_j.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Vk(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=vA(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Tj=k(`$ZodCheckLengthEquals`,(e,t)=>{var n;_j.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Vk(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=vA(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ej=k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;_j.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Dj=k(`$ZodCheckRegex`,(e,t)=>{Ej.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Oj=k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=hj,Ej.init(e,t)}),kj=k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=gj,Ej.init(e,t)}),Aj=k(`$ZodCheckIncludes`,(e,t)=>{_j.init(e,t);let n=nA(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),jj=k(`$ZodCheckStartsWith`,(e,t)=>{_j.init(e,t);let n=RegExp(`^${nA(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Mj=k(`$ZodCheckEndsWith`,(e,t)=>{_j.init(e,t);let n=RegExp(`.*${nA(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Nj=k(`$ZodCheckOverwrite`,(e,t)=>{_j.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Pj=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
80
80
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
81
81
|
`))}},Fj={major:4,minor:3,patch:6},Ij=k(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fj;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=mA(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Pk;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=mA(e,t))});else{if(e.issues.length===t)continue;r||=mA(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(mA(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Pk;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(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Pk;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Gk(e,`~standard`,()=>({validate:t=>{try{let n=AA(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return MA(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Lj=k(`$ZodString`,(e,t)=>{Ij.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??dj(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Rj=k(`$ZodStringFormat`,(e,t)=>{Ej.init(e,t),Lj.init(e,t)}),zj=k(`$ZodGUID`,(e,t)=>{t.pattern??=JA,Rj.init(e,t)}),Bj=k(`$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(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=YA(e)}else t.pattern??=YA();Rj.init(e,t)}),Vj=k(`$ZodEmail`,(e,t)=>{t.pattern??=XA,Rj.init(e,t)}),Hj=k(`$ZodURL`,(e,t)=>{Rj.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.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)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Uj=k(`$ZodEmoji`,(e,t)=>{t.pattern??=QA(),Rj.init(e,t)}),Wj=k(`$ZodNanoID`,(e,t)=>{t.pattern??=KA,Rj.init(e,t)}),Gj=k(`$ZodCUID`,(e,t)=>{t.pattern??=VA,Rj.init(e,t)}),Kj=k(`$ZodCUID2`,(e,t)=>{t.pattern??=HA,Rj.init(e,t)}),qj=k(`$ZodULID`,(e,t)=>{t.pattern??=UA,Rj.init(e,t)}),Jj=k(`$ZodXID`,(e,t)=>{t.pattern??=WA,Rj.init(e,t)}),Yj=k(`$ZodKSUID`,(e,t)=>{t.pattern??=GA,Rj.init(e,t)}),Xj=k(`$ZodISODateTime`,(e,t)=>{t.pattern??=uj(t),Rj.init(e,t)}),Zj=k(`$ZodISODate`,(e,t)=>{t.pattern??=sj,Rj.init(e,t)}),Qj=k(`$ZodISOTime`,(e,t)=>{t.pattern??=lj(t),Rj.init(e,t)}),$j=k(`$ZodISODuration`,(e,t)=>{t.pattern??=qA,Rj.init(e,t)}),eM=k(`$ZodIPv4`,(e,t)=>{t.pattern??=$A,Rj.init(e,t),e._zod.bag.format=`ipv4`}),tM=k(`$ZodIPv6`,(e,t)=>{t.pattern??=ej,Rj.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),nM=k(`$ZodCIDRv4`,(e,t)=>{t.pattern??=tj,Rj.init(e,t)}),rM=k(`$ZodCIDRv6`,(e,t)=>{t.pattern??=nj,Rj.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function iM(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var aM=k(`$ZodBase64`,(e,t)=>{t.pattern??=rj,Rj.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{iM(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function oM(e){if(!ij.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return iM(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var sM=k(`$ZodBase64URL`,(e,t)=>{t.pattern??=ij,Rj.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{oM(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),cM=k(`$ZodE164`,(e,t)=>{t.pattern??=aj,Rj.init(e,t)});function lM(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var uM=k(`$ZodJWT`,(e,t)=>{Rj.init(e,t),e._zod.check=n=>{lM(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),dM=k(`$ZodNumber`,(e,t)=>{Ij.init(e,t),e._zod.pattern=e._zod.bag.pattern??pj,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),fM=k(`$ZodNumberFormat`,(e,t)=>{Sj.init(e,t),dM.init(e,t)}),pM=k(`$ZodBoolean`,(e,t)=>{Ij.init(e,t),e._zod.pattern=mj,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),mM=k(`$ZodAny`,(e,t)=>{Ij.init(e,t),e._zod.parse=e=>e}),hM=k(`$ZodUnknown`,(e,t)=>{Ij.init(e,t),e._zod.parse=e=>e}),gM=k(`$ZodNever`,(e,t)=>{Ij.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),_M=k(`$ZodVoid`,(e,t)=>{Ij.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),vM=k(`$ZodDate`,(e,t)=>{Ij.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function yM(e,t,n){e.issues.length&&t.issues.push(...hA(n,e.issues)),t.value[n]=e.value}var bM=k(`$ZodArray`,(e,t)=>{Ij.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.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:[]},r);s instanceof Promise?a.push(s.then(t=>yM(t,n,e))):yM(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function xM(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...hA(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function SM(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=aA(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function CM(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>xM(e,n,i,t,u))):xM(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var wM=k(`$ZodObject`,(e,t)=>{if(Ij.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Bk(()=>SM(t));Gk(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Zk,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>xM(n,t,e,s,r))):xM(i,t,e,s,r)}return i?CM(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),TM=k(`$ZodObjectJIT`,(e,t)=>{wM.init(e,t);let n=e._zod.parse,r=Bk(()=>SM(t)),i=e=>{let t=new Pj([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Jk(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Jk(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,t as r}from"./rolldown-runtime-DWdDZTNf.js";import{a as i,c as a,f as o,i as s,l as c,n as l,o as u,p as d,r as f,s as p,u as m}from"./lit-vendor-DvaQX_UQ.js";import{A as h,B as g,C as _,D as v,E as y,F as b,G as x,H as S,I as C,J as w,K as ee,L as T,N as te,O as ne,P as E,S as D,T as re,_ as ie,b as O,c as ae,d as k,f as A,g as j,h as oe,k as se,l as ce,m as le,p as M,q as ue,u as de,v as N,w as fe,x as P,y as F,z as I}from"./pi-ai-
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./rolldown-runtime-DWdDZTNf.js";import{a as i,c as a,f as o,i as s,l as c,n as l,o as u,p as d,r as f,s as p,u as m}from"./lit-vendor-DvaQX_UQ.js";import{A as h,B as g,C as _,D as v,E as y,F as b,G as x,H as S,I as C,J as w,K as ee,L as T,N as te,O as ne,P as E,S as D,T as re,_ as ie,b as O,c as ae,d as k,f as A,g as j,h as oe,k as se,l as ce,m as le,p as M,q as ue,u as de,v as N,w as fe,x as P,y as F,z as I}from"./pi-ai-Cr2ee4a0.js";function pe(e){return t=>e(t||{})}var me={"*":`*`,Copy:`Copy`,"Copy code":`Copy code`,"Copied!":`Copied!`,Download:`Download`,Close:`Close`,Preview:`Preview`,Code:`Code`,"Loading...":`Loading...`,"Select an option":`Select an option`,"Mode 1":`Mode 1`,"Mode 2":`Mode 2`,Required:`Required`,Optional:`Optional`,"Input Required":`Input Required`,Cancel:`Cancel`,Confirm:`Confirm`},he={"*":`*`,Copy:`Kopieren`,"Copy code":`Code kopieren`,"Copied!":`Kopiert!`,Download:`Herunterladen`,Close:`Schließen`,Preview:`Vorschau`,Code:`Code`,"Loading...":`Laden...`,"Select an option":`Option auswählen`,"Mode 1":`Modus 1`,"Mode 2":`Modus 2`,Required:`Erforderlich`,Optional:`Optional`,"Input Required":`Eingabe erforderlich`,Cancel:`Abbrechen`,Confirm:`Bestätigen`},ge={en:me,de:he};function _e(e){ge=e}function ve(){let e=localStorage.getItem(`language`);if(e&&ge[e])return e;let t=navigator.language||navigator.userLanguage,n=t?t.split(`-`)[0]:`en`;return ge[n]?n:`en`}function L(e,t){let n=ve(),r=ge[n]||ge.en;if(t===void 0){let t=r[e];return t||(typeof t==`function`?t:(console.error(`Unknown i18n key: ${e}`),e))}else{let n=r[e];return!n||typeof n!=`object`?(console.error(`Unknown i18n category: ${e}`),t):n[t]||(console.error(`Unknown i18n key: ${e}.${t}`),t)}}var ye={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},be=([e,t,n])=>{let r=document.createElementNS(`http://www.w3.org/2000/svg`,e);return Object.keys(t).forEach(e=>{r.setAttribute(e,String(t[e]))}),n?.length&&n.forEach(e=>{let t=be(e);r.appendChild(t)}),r},xe=(e,t={})=>be([`svg`,{...ye,...t},e]),Se=[[`path`,{d:`M12 18V5`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`}]],Ce=[[`path`,{d:`M20 6 9 17l-5-5`}]],we=[[`path`,{d:`m6 9 6 6 6-6`}]],Te=[[`path`,{d:`m9 18 6-6-6-6`}]],Ee=[[`path`,{d:`m18 15-6-6-6 6`}]],De=[[`path`,{d:`m7 6 5 5 5-5`}],[`path`,{d:`m7 13 5 5 5-5`}]],Oe=[[`path`,{d:`m7 15 5 5 5-5`}],[`path`,{d:`m7 9 5-5 5 5`}]],ke=[[`path`,{d:`m16 18 6-6-6-6`}],[`path`,{d:`m8 6-6 6 6 6`}]],Ae=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]],je=[[`path`,{d:`M12 15V3`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}],[`path`,{d:`m7 10 5 5 5-5`}]],Me=[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]],Ne=[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}],[`path`,{d:`m5 12-3 3 3 3`}],[`path`,{d:`m9 18 3-3-3-3`}]],Pe=[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}],[`path`,{d:`M8 13h2`}],[`path`,{d:`M14 13h2`}],[`path`,{d:`M8 17h2`}],[`path`,{d:`M14 17h2`}]],Fe=[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}],[`path`,{d:`M10 9H8`}],[`path`,{d:`M16 13H8`}],[`path`,{d:`M16 17H8`}]],Ie=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}],[`circle`,{cx:`9`,cy:`9`,r:`2`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`}]],Le=[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]],Re=[[`path`,{d:`M12 2v4`}],[`path`,{d:`m16.2 7.8 2.9-2.9`}],[`path`,{d:`M18 12h4`}],[`path`,{d:`m16.2 16.2 2.9 2.9`}],[`path`,{d:`M12 18v4`}],[`path`,{d:`m4.9 19.1 2.9-2.9`}],[`path`,{d:`M2 12h4`}],[`path`,{d:`m4.9 4.9 2.9 2.9`}]],ze=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}]],Be=[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`}]],Ve=[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}],[`path`,{d:`M8 16H3v5`}]],He=[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`}],[`path`,{d:`m21.854 2.147-10.94 10.939`}]],Ue=[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`}],[`path`,{d:`M20 2v4`}],[`path`,{d:`M22 4h-4`}],[`circle`,{cx:`4`,cy:`20`,r:`2`}]],We=[[`path`,{d:`m7 11 2-2-2-2`}],[`path`,{d:`M11 13h4`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}]],Ge=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}]],Ke=[[`path`,{d:`M18 6 6 18`}],[`path`,{d:`m6 6 12 12`}]],qe={xs:`w-3 h-3`,sm:`w-4 h-4`,md:`w-5 h-5`,lg:`w-6 h-6`,xl:`w-8 h-8`};function Je(e,t=`md`,n){return d`${p(Ye(e,t,n).outerHTML)}`}function Ye(e,t=`md`,n){return xe(e,{class:qe[t]+(n?` `+n:``)})}var Xe=null;function Ze(e){let{value:t,placeholder:n=L(`Select an option`),options:r,onChange:i,disabled:s=!1,className:l=``,width:u=`180px`,size:f=`md`,variant:p=`default`,fitContent:m=!1}=e,h=a(),g={isOpen:!1,focusedIndex:-1},_={sm:`h-8 px-2 text-xs`,md:`h-9 px-3 text-sm`,lg:`h-10 px-4 text-base`},v={default:`text-foreground border-input bg-transparent hover:bg-accent/50 shadow-xs`,ghost:`text-foreground border-transparent bg-transparent hover:bg-accent hover:text-accent-foreground`,outline:`text-foreground border-input bg-transparent hover:bg-accent hover:text-accent-foreground`},y=[],b=r.length>0&&`options`in r[0];b?r.forEach(e=>{y.push(...e.options.filter(e=>!e.disabled))}):y.push(...r.filter(e=>!e.disabled));let x=y.find(e=>e.value===t),S=null,C=()=>(S||(S=document.createElement(`div`),S.className=`select-portal-container`,S.style.cssText=`position: fixed; z-index: 50; pointer-events: none;`,document.body.appendChild(S)),S),w=()=>{if(!h.value||!S)return;let e=h.value.getBoundingClientRect();g.triggerRect=e;let t=window.innerHeight-e.bottom,n=e.top,r=t<300&&n>t;S.style.cssText=`
|
|
2
2
|
position: fixed;
|
|
3
3
|
left: ${e.left}px;
|
|
4
4
|
${r?`bottom: ${window.innerHeight-e.top}px`:`top: ${e.bottom}px`};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-jrz1pRUS.js";import{n as e}from"./chunk-YOTPTUD7-DqzqtdII.js";export{e as createPieServices};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-D6N-CrJv.js";import{m as t}from"./src-PYsDme0X.js";import{H as n,K as r,U as i,a,c as o,f as s,v as c,w as l,x as u,y as d}from"./chunk-WYO6CB5R-NF-MsJJR.js";import{t as f}from"./ordinal-B2r5L1v4.js";import{n as p}from"./path-6uRLdFF7.js";import{m}from"./dist-CLg13NtV.js";import{t as h}from"./arc-w21O0TLn.js";import{t as g}from"./array-B9UHiPd-.js";import{i as _,p as v}from"./chunk-ICXQ74PX-Cd7igVGt.js";import{t as y}from"./chunk-VAUOI2AC-CWYjg8zE.js";import{t as b}from"./chunk-JWPE2WC7-BZ87mXEv.js";import{n as x}from"./mermaid-parser.core-BlKWrEdZ.js";function S(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function C(e){return e}function w(){var e=C,t=S,n=null,r=p(0),i=p(m),a=p(0);function o(o){var s,c=(o=g(o)).length,l,u,d=0,f=Array(c),p=Array(c),h=+r.apply(this,arguments),_=Math.min(m,Math.max(-m,i.apply(this,arguments)-h)),v,y=Math.min(Math.abs(_)/c,a.apply(this,arguments)),b=y*(_<0?-1:1),x;for(s=0;s<c;++s)(x=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=x);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(_-c*b)/d:0;s<c;++s,h=v)l=f[s],x=p[l],v=h+(x>0?x*u:0)+b,p[l]={data:o[l],index:s,value:x,startAngle:h,endAngle:v,padAngle:y};return p}return o.value=function(t){return arguments.length?(e=typeof t==`function`?t:p(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:p(+e),o):r},o.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:p(+e),o):i},o.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:p(+e),o):a},o}var T=s.pie,E={sections:new Map,showData:!1,config:T},D=E.sections,O=E.showData,k=structuredClone(T),A={getConfig:e(()=>structuredClone(k),`getConfig`),clear:e(()=>{D=new Map,O=E.showData,a()},`clear`),setDiagramTitle:r,getDiagramTitle:l,setAccTitle:i,getAccTitle:d,setAccDescription:n,getAccDescription:c,addSection:e(({label:e,value:n})=>{if(n<0)throw Error(`"${e}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);D.has(e)||(D.set(e,n),t.debug(`added new section: ${e}, with value: ${n}`))},`addSection`),getSections:e(()=>D,`getSections`),setShowData:e(e=>{O=e},`setShowData`),getShowData:e(()=>O,`getShowData`)},j=e((e,t)=>{b(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},`populateDb`),M={parse:e(async e=>{let n=await x(`pie`,e);t.debug(n),j(n,A)},`parse`)},N=e(e=>`
|
|
2
2
|
.pieCircle{
|
|
3
3
|
stroke: ${e.pieStrokeColor};
|
|
4
4
|
stroke-width : ${e.pieStrokeWidth};
|