@vellumai/web 0.9.0-dev.202606181513.fd39213 → 0.9.0-dev.202606181735.ae6e1d8
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/{BundleConfirmPage-bWFUzx3K.js → BundleConfirmPage-C5YHsP4l.js} +1 -1
- package/dist/assets/{account-page-B-Xh0yHW.js → account-page-DMPcevu-.js} +1 -1
- package/dist/assets/{add-credits-modal-D2fbC-hb.js → add-credits-modal-DkTbkOHM.js} +1 -1
- package/dist/assets/{advanced-page-CIwq3e6-.js → advanced-page-DpVBGl0C.js} +1 -1
- package/dist/assets/ai-page-lDm-lg_L.js +1 -0
- package/dist/assets/{angular-html-NUZsP2zU.js → angular-html-BmNBFsfI.js} +1 -1
- package/dist/assets/{angular-ts-CIMKhJTY.js → angular-ts-XlygL9kb.js} +1 -1
- package/dist/assets/api-D89OOveT.js +39 -0
- package/dist/assets/{api-key-screen-lZx78u-G.js → api-key-screen-Cz40Jf_Z.js} +1 -1
- package/dist/assets/{apl-MjftRfgx.js → apl-s5dW4Xe3.js} +1 -1
- package/dist/assets/{app-html-cache-C7dPhzfJ.js → app-html-cache-aRuy3e5M.js} +1 -1
- package/dist/assets/{archive-page-DB38OBq5.js → archive-page-Du-Mr3Yn.js} +1 -1
- package/dist/assets/{assistant-feature-flag-store-ClCVaYet.js → assistant-feature-flag-store--OIPCovT.js} +1 -1
- package/dist/assets/{assistant-identity-store-bwfN6pDI.js → assistant-identity-store-CrDNgetQ.js} +1 -1
- package/dist/assets/{assistant-status-panel-DgvF5b32.js → assistant-status-panel-BlwCp1RM.js} +1 -1
- package/dist/assets/{astro-BZ7raMku.js → astro-yx5PDVSr.js} +1 -1
- package/dist/assets/auth-store-Dl-oh1Wo.js +6 -0
- package/dist/assets/ban-sR0SVgc0.js +1 -0
- package/dist/assets/billing-page-CB0hzC6M.js +3 -0
- package/dist/assets/{blade-BUW76u_q.js → blade-BhhIFd7V.js} +1 -1
- package/dist/assets/{bookmarks-page-B_x2DyVd.js → bookmarks-page-IMGN9q4g.js} +1 -1
- package/dist/assets/{bsl-3N3_1th2.js → bsl-A5qveKzZ.js} +1 -1
- package/dist/assets/build-state-DVFDqDoI.js +1 -0
- package/dist/assets/{cairo-Deqti25L.js → cairo-BrQHTE90.js} +1 -1
- package/dist/assets/{capture-error-B7QmSjOI.js → capture-error-Dm3UtwN5.js} +1 -1
- package/dist/assets/{client-feature-flag-store-DZMwD6Gv.js → client-feature-flag-store-j1kEtlqd.js} +1 -1
- package/dist/assets/{cobol-Cy1RG-Dg.js → cobol-D3ijcGq4.js} +1 -1
- package/dist/assets/{coffee-BHwkqVKf.js → coffee-D-ChTlXU.js} +1 -1
- package/dist/assets/{command-palette-tAd_QyVU.js → command-palette-B9mPRW2_.js} +1 -1
- package/dist/assets/{command-palette-window-page-B2Q6Av94.js → command-palette-window-page-DmmqDJlg.js} +1 -1
- package/dist/assets/community-page-ChwDG3ta.js +1 -0
- package/dist/assets/{connect-page-B3LNeOSl.js → connect-page-BknzHnw5.js} +1 -1
- package/dist/assets/{contacts-gateway-BKzt2hCg.js → contacts-gateway-DAfjhWiX.js} +1 -1
- package/dist/assets/contacts-page-route-CymLKk_g.js +1 -0
- package/dist/assets/{conversation-queries-DS1utZ0q.js → conversation-queries-CNIVu7d-.js} +1 -1
- package/dist/assets/{cpp-CzJNPtyU.js → cpp-DMV6fvKZ.js} +1 -1
- package/dist/assets/{crystal-E_83lUR4.js → crystal-BBrWt0BX.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-BMUPU9Uk.js → danger-zone-redirect-page-qSt-z4bd.js} +1 -1
- package/dist/assets/debug-page-C4RHkrSW.js +2 -0
- package/dist/assets/{deploy-dialogs-BgmF2IE1.js → deploy-dialogs-DNEqLpr_.js} +1 -1
- package/dist/assets/developer-page-BNlQ01UB.js +1 -0
- package/dist/assets/{devices-page-0Nfka3RN.js → devices-page-DLaAx6AA.js} +1 -1
- package/dist/assets/{dictation-overlay-page-BFP5ztSw.js → dictation-overlay-page-Digx3kLf.js} +1 -1
- package/dist/assets/{dist-C1i_kc2J.js → dist-CHPo_3g2.js} +3 -3
- package/dist/assets/{document-viewer-page-wCnrO-vE.js → document-viewer-page-CqUZggsK.js} +1 -1
- package/dist/assets/{earn-credits-modal-CCAfA4RZ.js → earn-credits-modal-Baba_F8G.js} +1 -1
- package/dist/assets/{edge-BTzbn7hq.js → edge-DRwR-sxG.js} +1 -1
- package/dist/assets/{elixir-BLRm_4mB.js → elixir-DI0Ag_4U.js} +1 -1
- package/dist/assets/{elm-CpYPTjna.js → elm-CeCR0Ow7.js} +1 -1
- package/dist/assets/{emails-page-DHprVGpc.js → emails-page-B_6hndP7.js} +1 -1
- package/dist/assets/{erb-1SoUu2uu.js → erb-BUL-jcHP.js} +1 -1
- package/dist/assets/{erlang-D2CheWwS.js → erlang-DavplhZL.js} +1 -1
- package/dist/assets/{esm--NWmLZZJ.js → esm-20LhTLs1.js} +2 -2
- package/dist/assets/esm-BcYoN3Wf.js +2 -0
- package/dist/assets/esm-CJoFeRvt.js +2 -0
- package/dist/assets/esm-D-fanjuu.js +2 -0
- package/dist/assets/esm-DOGtEJMI.js +2 -0
- package/dist/assets/{file-editor-DO2qhWhV.js → file-editor-C97ZCq1L.js} +1 -1
- package/dist/assets/{file-markdown-CCyGVLOO.js → file-markdown-DpAoYOIX.js} +1 -1
- package/dist/assets/{fortran-fixed-form-BP29y5Mv.js → fortran-fixed-form-CTNpJ2NS.js} +1 -1
- package/dist/assets/{fsharp-DCP7lSxH.js → fsharp-BGxhg_eB.js} +1 -1
- package/dist/assets/{gdresource-BoFtus7e.js → gdresource-BL7wZ00_.js} +1 -1
- package/dist/assets/general-page-C6zTQf_Q.js +1 -0
- package/dist/assets/{git-commit-rmSos2Ik.js → git-commit-DbU0PoqM.js} +1 -1
- package/dist/assets/{git-rebase-Ycx62Ck0.js → git-rebase-Deax8zAy.js} +1 -1
- package/dist/assets/{glimmer-js-CJjD8t7Q.js → glimmer-js-CaEPRpFp.js} +1 -1
- package/dist/assets/{glimmer-ts-DiEw1eHA.js → glimmer-ts-DtJMWynv.js} +1 -1
- package/dist/assets/{glsl-BMESLl58.js → glsl-CjZ4TpDy.js} +1 -1
- package/dist/assets/{graphql-oVti-bha.js → graphql-COvajntn.js} +1 -1
- package/dist/assets/{hack-CKVPalx4.js → hack-BJguamor.js} +1 -1
- package/dist/assets/{haml-CWEgtitw.js → haml-KcgCeJr9.js} +1 -1
- package/dist/assets/{handlebars-B2bq3aUA.js → handlebars-k6YV7xEK.js} +1 -1
- package/dist/assets/hatching-screen-A35NJVZv.js +1 -0
- package/dist/assets/home-page-route-CTwmyvc4.js +1 -0
- package/dist/assets/{hosting-screen-H5k7HquU.js → hosting-screen-DUB9fOv9.js} +1 -1
- package/dist/assets/{html-C2SQPzTx.js → html-BsySewGO.js} +1 -1
- package/dist/assets/{html-derivative-BChZ4Gh0.js → html-derivative-C-if7FGv.js} +1 -1
- package/dist/assets/{http-CgPyRf2F.js → http-B0IPCCsY.js} +1 -1
- package/dist/assets/{hurl-C8rH0Uqf.js → hurl-Yy8YRiuz.js} +1 -1
- package/dist/assets/{hxml-BNnDhNNK.js → hxml-D5NppUR9.js} +1 -1
- package/dist/assets/identity-page-route-DVOUPesj.js +1 -0
- package/dist/assets/{index-rogxjn1t.css → index-BHhNKtWo.css} +1 -1
- package/dist/assets/index-zwSMun6P.js +138 -0
- package/dist/assets/inspect-page-B3G5ud5G.js +7 -0
- package/dist/assets/{install-DLdFKlq2.js → install-CznEUhSw.js} +1 -1
- package/dist/assets/integrations-page-D49ydmoB.js +1 -0
- package/dist/assets/{intelligence-layout-DdXkH7Iv.js → intelligence-layout-D-2YL8Pw.js} +1 -1
- package/dist/assets/{jinja-CnzyA3jv.js → jinja-DSGoCQyr.js} +1 -1
- package/dist/assets/{jison-CHRdeG1W.js → jison-C9DG22iJ.js} +1 -1
- package/dist/assets/{julia-BHMmJJou.js → julia-B5ELhSMD.js} +1 -1
- package/dist/assets/{just-CYu2PuLY.js → just-DzYca6zu.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-CEnvxois.js → keyboard-shortcuts-page-C42m7cZr.js} +1 -1
- package/dist/assets/{latex-cbAXpjRc.js → latex-DvJm0dRx.js} +1 -1
- package/dist/assets/{lib-Cg4BwIGu.js → lib-BfLt4LTx.js} +1 -1
- package/dist/assets/{library-detail-page-B59XQ74V.js → library-detail-page-hlTfYlew.js} +1 -1
- package/dist/assets/{library-page-d9BBS_yy.js → library-page-C45HdtVf.js} +1 -1
- package/dist/assets/{liquid-Dv5SI5M9.js → liquid-w3Qap2fP.js} +1 -1
- package/dist/assets/{login-flow-Bwe9IeSu.js → login-flow-C5bezjF0.js} +1 -1
- package/dist/assets/{login-page-BgaMibVf.js → login-page-C0bcpFG1.js} +1 -1
- package/dist/assets/logout-page-CsutDFsB.js +1 -0
- package/dist/assets/{logs-layout-Do18p3et.js → logs-layout-D8ZgafEk.js} +1 -1
- package/dist/assets/{lua-D-ux128R.js → lua-DvAWvfE0.js} +1 -1
- package/dist/assets/{marko-DJbbzvSB.js → marko-eBCi98vU.js} +1 -1
- package/dist/assets/{mdc-C5qO6KeQ.js → mdc-DsCe4Te7.js} +1 -1
- package/dist/assets/{memory-router-playground-page-CByaz0LW.js → memory-router-playground-page-CyBaMsah.js} +1 -1
- package/dist/assets/metric-card-DCTrH7Ri.js +1 -0
- package/dist/assets/{mobile-sidebar-drawer-CmFGv0ak.js → mobile-sidebar-drawer-Da5gzC7g.js} +1 -1
- package/dist/assets/{native-file-BohBSxJn.js → native-file-CiXJfU3t.js} +2 -2
- package/dist/assets/{nextflow-BRCxxam_.js → nextflow-DcPg-gAY.js} +1 -1
- package/dist/assets/{nginx-C8XW8MJU.js → nginx-Bko1R-zO.js} +1 -1
- package/dist/assets/{nim-Db44dZIr.js → nim--C0Ik-1D.js} +1 -1
- package/dist/assets/{notifications-page-BEbDgCqx.js → notifications-page-DQDfclEf.js} +1 -1
- package/dist/assets/{oauth-complete-page-pF-RJI_N.js → oauth-complete-page-ZI_c074j.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-Bi1lVe9S.js → oauth-popup-complete-page-BRKYGmhe.js} +1 -1
- package/dist/assets/pairing-page-CQ_cwNde.js +1 -0
- package/dist/assets/{password-reset-page-DTZC3O1A.js → password-reset-page-Bf2UTcro.js} +1 -1
- package/dist/assets/{perl-BEYrfghi.js → perl-DduvVbRK.js} +1 -1
- package/dist/assets/{php-DrV6_wHn.js → php-B5Fe360g.js} +1 -1
- package/dist/assets/{platform-loopback-page-30OmM3KR.js → platform-loopback-page-CaH530g_.js} +1 -1
- package/dist/assets/{plugin-detail-page-W0_go-aU.js → plugin-detail-page-CWE4pDC_.js} +1 -1
- package/dist/assets/{plugins-page-AyGvIJv-.js → plugins-page-BdryEGCO.js} +1 -1
- package/dist/assets/prechat-route-DCXS4noF.js +1 -0
- package/dist/assets/prefs-D4e9wnqc.js +1 -0
- package/dist/assets/privacy-page-Xwj941_H.js +1 -0
- package/dist/assets/privacy-screen-BzCTDdLA.js +1 -0
- package/dist/assets/{provider-callback-page-Bli_HQOZ.js → provider-callback-page-CT1zaruY.js} +1 -1
- package/dist/assets/{provider-key-oYh1M04a.js → provider-key-CcshwqfP.js} +1 -1
- package/dist/assets/{provider-signup-page-YJlcq9NW.js → provider-signup-page-BfTfyXFx.js} +1 -1
- package/dist/assets/{pug-BBsZdVld.js → pug-DvnoUUh7.js} +1 -1
- package/dist/assets/{qml-Cho-Rpqo.js → qml-D_VQrJTY.js} +1 -1
- package/dist/assets/{quick-input-page-BG0KouSt.js → quick-input-page-BisMcqmB.js} +1 -1
- package/dist/assets/{razor-B-sYwR2S.js → razor-w5MzHMfI.js} +1 -1
- package/dist/assets/react-query.gen-CS6zkmL9.js +1 -0
- package/dist/assets/{research-mock-page-CbPekJOQ.js → research-mock-page-BF5bOdZT.js} +1 -1
- package/dist/assets/{research-onboarding-route-BsLonRxv.js → research-onboarding-route-BYVuT4md.js} +1 -1
- package/dist/assets/{resize-errors-BFYfPOe0.js → resize-errors-CVv5LgVi.js} +1 -1
- package/dist/assets/return-to-HMNJutAQ.js +1 -0
- package/dist/assets/review-terms-screen-DPHnzNGM.js +1 -0
- package/dist/assets/{rst-BmfNSa0N.js → rst-DM4Cg2Q6.js} +1 -1
- package/dist/assets/{ruby-CYkQEPY1.js → ruby-D-t5Ywjo.js} +1 -1
- package/dist/assets/{sas-DNVHKT0s.js → sas-C1Tv6NG5.js} +1 -1
- package/dist/assets/{schedules-B5g8s8wO.js → schedules-CrQqwksG.js} +1 -1
- package/dist/assets/{scss-CJj83Dla.js → scss-MeIdBLE0.js} +1 -1
- package/dist/assets/{sdk.gen-ZXouuy0U.js → sdk.gen-Bm6K4Ux2.js} +1 -1
- package/dist/assets/{sdk.gen-DlgJKwWW.js → sdk.gen-DPECx74f.js} +1 -1
- package/dist/assets/select-assistant-screen-CTqtO0-l.js +1 -0
- package/dist/assets/setting-row-CQxAqFGS.js +1 -0
- package/dist/assets/settings-layout-GYVwTWyu.js +1 -0
- package/dist/assets/{shaderlab-DThCXAmZ.js → shaderlab-Cz0M-ui2.js} +1 -1
- package/dist/assets/share-feedback-modal-CgmYbxCk.js +1 -0
- package/dist/assets/{shellsession-DVAvGPEZ.js → shellsession-DapZ51uU.js} +1 -1
- package/dist/assets/{sidebar-tree-BSHyIykQ.js → sidebar-tree-DqgnZ1kv.js} +1 -1
- package/dist/assets/{signup-page-D7V5QIPk.js → signup-page-_lwhKmXj.js} +1 -1
- package/dist/assets/{signup-shell-CcsQcPdt.js → signup-shell-BkDOFwaV.js} +1 -1
- package/dist/assets/skills-page-C5voNHHS.js +1 -0
- package/dist/assets/{sounds-page-Dv6uyyUR.js → sounds-page-5wWWZaaL.js} +1 -1
- package/dist/assets/{soy-BmqwGQck.js → soy-Beop5oBI.js} +1 -1
- package/dist/assets/sparkles-DwumMvP6.js +1 -0
- package/dist/assets/{sparql-DNRGa_Gu.js → sparql-BMtmaaNL.js} +1 -1
- package/dist/assets/{stata-B8KacTxz.js → stata-B0uyRpup.js} +1 -1
- package/dist/assets/{step-indicator-dots-BlU3rKYn.js → step-indicator-dots-CKeMvci-.js} +1 -1
- package/dist/assets/subagent-detail-panel-D7pBJR6R.js +4 -0
- package/dist/assets/{surrealql-C6oZu2fN.js → surrealql-C0T0gQle.js} +1 -1
- package/dist/assets/{svelte-CvMrrvpl.js → svelte-Bj-ulvm8.js} +1 -1
- package/dist/assets/{system-events-page-C5J2TzoF.js → system-events-page-Bg4NwpQD.js} +1 -1
- package/dist/assets/{system-events-redirect-page-LgAPqevP.js → system-events-redirect-page-JdlpOtHO.js} +1 -1
- package/dist/assets/{templ-B6BU7DPy.js → templ-OEO2PwgV.js} +1 -1
- package/dist/assets/{tex-BpWMzmxo.js → tex-Na0BJQdA.js} +1 -1
- package/dist/assets/{tiptap-document-editor-BXg8fWbZ.js → tiptap-document-editor-MZP7wLqp.js} +1 -1
- package/dist/assets/{tool-detail-panel-Cf0UkplU.js → tool-detail-panel-kPQoKzdi.js} +2 -2
- package/dist/assets/{trace-page-iFVckc_v.js → trace-page-CzsH6RJs.js} +1 -1
- package/dist/assets/{ts-tags-jcpnq-Y4.js → ts-tags-Buu02vSd.js} +1 -1
- package/dist/assets/{twig-Br0yq-NC.js → twig-CCOI4SWn.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-BOCQnAfm.js → upgrade-cancel-page-C_UMehs8.js} +1 -1
- package/dist/assets/{upgrade-success-page-DfCt8s-A.js → upgrade-success-page-CYUvJ95g.js} +1 -1
- package/dist/assets/usage-page-BOeigc6t.js +1 -0
- package/dist/assets/{use-bus-subscription-D1gMRmhe.js → use-bus-subscription-DF4eqfKs.js} +1 -1
- package/dist/assets/use-is-org-ready-CXbqnKBJ.js +1 -0
- package/dist/assets/{use-onboarding-login-D_NSkHfv.js → use-onboarding-login-B5HXgAE0.js} +1 -1
- package/dist/assets/{use-plugin-drift-B1mUU7pv.js → use-plugin-drift-D9ZeB0lE.js} +1 -1
- package/dist/assets/{utils-Chc-yh_2.js → utils-8kC35gfs.js} +1 -1
- package/dist/assets/viewer-store-tiQ39Cg7.js +1 -0
- package/dist/assets/{voice-page-DlCINjLf.js → voice-page-BC_JBhm-.js} +1 -1
- package/dist/assets/{vue-BqPLCY0M.js → vue-BQwEnXV6.js} +1 -1
- package/dist/assets/{vue-html-Bq1Hy7GO.js → vue-html-CNWgfwKp.js} +1 -1
- package/dist/assets/{vue-vine-J7Hwt0Tl.js → vue-vine-CHbL7DF6.js} +1 -1
- package/dist/assets/{weather-forecast-display-DF9cT36-.js → weather-forecast-display-B2XxWS7Q.js} +1 -1
- package/dist/assets/{web-C-Htzjiw.js → web-BKnYcCzf.js} +1 -1
- package/dist/assets/{web-C3baFM-8.js → web-ByXLWYZC.js} +1 -1
- package/dist/assets/{web-Ci9y-0tG.js → web-DqtwTofu.js} +1 -1
- package/dist/assets/{web-6rFxRZ4E.js → web-QypuiBU6.js} +1 -1
- package/dist/assets/{web-C86zpJs9.js → web-f4mjtnFR.js} +1 -1
- package/dist/assets/{web-B8KVeKAO.js → web-oPmAay1Y.js} +1 -1
- package/dist/assets/{web-DXyrLQ3l.js → web-vFnCnJvx.js} +1 -1
- package/dist/assets/{welcome-screen-scmFZ3US.js → welcome-screen-DNor72TT.js} +1 -1
- package/dist/assets/workflow-detail-panel-DVrojrTb.js +1 -0
- package/dist/assets/workspace-page-iNYSnds7.js +1 -0
- package/dist/assets/{xml-CI4IG7vR.js → xml-B_U9cjWO.js} +1 -1
- package/dist/assets/{xsl-D9mK_kiR.js → xsl-DPZRY9zL.js} +1 -1
- package/dist/index.html +67 -65
- package/package.json +1 -1
- package/dist/assets/ai-page-D3LQK1Pn.js +0 -1
- package/dist/assets/api-DFmFVk24.js +0 -39
- package/dist/assets/auth-store-CdoTCJgP.js +0 -6
- package/dist/assets/billing-page-BLlTI5DV.js +0 -3
- package/dist/assets/build-state-BiOhIe1t.js +0 -1
- package/dist/assets/community-page-hY_1zJaq.js +0 -1
- package/dist/assets/contacts-page-route-C4HdPsRv.js +0 -1
- package/dist/assets/debug-page-Cxp-F1sg.js +0 -2
- package/dist/assets/developer-page-SguvKc5s.js +0 -1
- package/dist/assets/esm-CbPGMoFW.js +0 -2
- package/dist/assets/esm-Cwycui3k.js +0 -2
- package/dist/assets/esm-DhfDOeCy.js +0 -2
- package/dist/assets/esm-wSvAfou1.js +0 -2
- package/dist/assets/general-page-DrI0RTSK.js +0 -1
- package/dist/assets/hatching-screen-D02s0hOq.js +0 -1
- package/dist/assets/home-page-route-D7x-XDX_.js +0 -1
- package/dist/assets/identity-page-route-Bj8tSRbj.js +0 -1
- package/dist/assets/index-CEhiJItI.js +0 -138
- package/dist/assets/inspect-page-D--MCqRR.js +0 -7
- package/dist/assets/integrations-page-Cg73W9AG.js +0 -1
- package/dist/assets/logout-page-DTb3dRyn.js +0 -1
- package/dist/assets/pairing-page-DaeVzuAb.js +0 -1
- package/dist/assets/prechat-route-BT8KM5Ip.js +0 -1
- package/dist/assets/prefs-BXOW-ziM.js +0 -1
- package/dist/assets/privacy-page-x6BqysMe.js +0 -1
- package/dist/assets/privacy-screen-DDBIvMgs.js +0 -1
- package/dist/assets/react-query.gen-Dc9bPcAq.js +0 -1
- package/dist/assets/remote-gateway-session-BVFc4ZX7.js +0 -1
- package/dist/assets/review-terms-screen-BLwcHjKm.js +0 -1
- package/dist/assets/select-assistant-screen-HfIL_pw_.js +0 -1
- package/dist/assets/settings-layout-BwhS98yJ.js +0 -1
- package/dist/assets/share-feedback-modal-BBl-kxSg.js +0 -1
- package/dist/assets/skills-page-Dy1GrYRy.js +0 -1
- package/dist/assets/subagent-detail-panel-CBwuGHAq.js +0 -4
- package/dist/assets/usage-page-ydMmNowy.js +0 -1
- package/dist/assets/use-is-org-ready-BwxYweXj.js +0 -1
- package/dist/assets/viewer-store-Bh4ICci0.js +0 -1
- package/dist/assets/workspace-page-BLLS0czw.js +0 -1
- /package/dist/assets/{abap-CJNe528N.js → abap-Bu0T6Al_.js} +0 -0
- /package/dist/assets/{about-page-6S7lUpny.js → about-page--25Z333d.js} +0 -0
- /package/dist/assets/{account-shell-DblhUTJ5.js → account-shell-HMDpCe9t.js} +0 -0
- /package/dist/assets/{actionscript-3-BAZ_6Z10.js → actionscript-3-BBh2_0PU.js} +0 -0
- /package/dist/assets/{ada-feVzGWfj.js → ada-CFBoRA9T.js} +0 -0
- /package/dist/assets/{andromeeda-CNnw8dTn.js → andromeeda-DcZBwPaf.js} +0 -0
- /package/dist/assets/{apache-CVQsMMje.js → apache-R7xc0G73.js} +0 -0
- /package/dist/assets/{apex-l-F_KVcD.js → apex-CRWice4-.js} +0 -0
- /package/dist/assets/{api-errors-DbHkbHFH.js → api-errors-B2GJ5nO1.js} +0 -0
- /package/dist/assets/{applescript-He5R1fkc.js → applescript-C_3LmUl6.js} +0 -0
- /package/dist/assets/{ara-C2UJ0gbG.js → ara-CV-W5Hgd.js} +0 -0
- /package/dist/assets/{arrow-up-DUZaEAPa.js → arrow-up-BEGEFai4.js} +0 -0
- /package/dist/assets/{asciidoc-Cyc12ALB.js → asciidoc-B_154O4_.js} +0 -0
- /package/dist/assets/{asm-CvAw93vT.js → asm-DYZMpR5h.js} +0 -0
- /package/dist/assets/{aurora-x-BVLdi9XW.js → aurora-x-xbsuHScz.js} +0 -0
- /package/dist/assets/{avatar-bundled-components-Dos3cVdK.js → avatar-bundled-components-DPXuNZK4.js} +0 -0
- /package/dist/assets/{avatar-svg-compositor-B2E-HVH3.js → avatar-svg-compositor-DLeuUd5x.js} +0 -0
- /package/dist/assets/{awk-CsYCwpZx.js → awk-CtGnqBgi.js} +0 -0
- /package/dist/assets/{ayu-dark-CKZ8Af5T.js → ayu-dark-EJWn4Kqs.js} +0 -0
- /package/dist/assets/{ayu-light-yQv7h0wx.js → ayu-light-Cgk_QfTq.js} +0 -0
- /package/dist/assets/{ayu-mirage-SXQek0nN.js → ayu-mirage-Co-mvsPv.js} +0 -0
- /package/dist/assets/{ballerina-DChGzDcp.js → ballerina-FF_I4_FO.js} +0 -0
- /package/dist/assets/{bat-CERu697x.js → bat-BrvgUmWp.js} +0 -0
- /package/dist/assets/{beancount-DDlKammq.js → beancount-BXL8T_UG.js} +0 -0
- /package/dist/assets/{bell-Co08GYEf.js → bell-DN1CTRy0.js} +0 -0
- /package/dist/assets/{berry-C4h-lzOM.js → berry-CIKKfJQu.js} +0 -0
- /package/dist/assets/{bibtex-Cu93fKjy.js → bibtex-Cjz3iUeg.js} +0 -0
- /package/dist/assets/{bicep-BY6Lvco2.js → bicep-BcfLCnJ8.js} +0 -0
- /package/dist/assets/{bird2-C3EDUCi0.js → bird2-Bj3a4C-Y.js} +0 -0
- /package/dist/assets/{bookmark-p_bC93pm.js → bookmark-B4FAjPa5.js} +0 -0
- /package/dist/assets/{bug-BHN9VwfO.js → bug-LgSUSrgZ.js} +0 -0
- /package/dist/assets/{c-Bx4sC2Xn.js → c-BUvpFi0s.js} +0 -0
- /package/dist/assets/{c3-MkTecvXG.js → c3-B3W5wIf2.js} +0 -0
- /package/dist/assets/{cadence-PdDwUw_3.js → cadence-5E7jHuph.js} +0 -0
- /package/dist/assets/{calendar-DKf86OVv.js → calendar-kmhfuEQ0.js} +0 -0
- /package/dist/assets/{catppuccin-frappe-C9n8LbR9.js → catppuccin-frappe-CxBHTACM.js} +0 -0
- /package/dist/assets/{catppuccin-latte-Dqr_e8_E.js → catppuccin-latte-1taPK8ho.js} +0 -0
- /package/dist/assets/{catppuccin-macchiato-D6yVpdmv.js → catppuccin-macchiato-CZccUFZV.js} +0 -0
- /package/dist/assets/{catppuccin-mocha-f_7vljBC.js → catppuccin-mocha-6_45QPZ-.js} +0 -0
- /package/dist/assets/{chevron-left-H9xBKELt.js → chevron-left-DvRyCw4l.js} +0 -0
- /package/dist/assets/{chevron-right-Cu9YGUrb.js → chevron-right-BBPC2sN7.js} +0 -0
- /package/dist/assets/{chevron-up-Da5sDXLT.js → chevron-up-Mut6QS-l.js} +0 -0
- /package/dist/assets/{circle-alert-CIUa_TF0.js → circle-alert-CBgSvxFK.js} +0 -0
- /package/dist/assets/{circle-check-BZU8YmDv.js → circle-check-DNFeZyQ-.js} +0 -0
- /package/dist/assets/{clarity-BFWifnyZ.js → clarity-DVzJhaGS.js} +0 -0
- /package/dist/assets/{client.gen-ZHFX_7TH.js → client.gen-CMyrzxRh.js} +0 -0
- /package/dist/assets/{clojure-CBqcp1T-.js → clojure-CFqBoVrK.js} +0 -0
- /package/dist/assets/{cloud-off-B5RLcIuL.js → cloud-off-CFLLJmFS.js} +0 -0
- /package/dist/assets/{cmake-DM7AZrTb.js → cmake-CL1DTwLy.js} +0 -0
- /package/dist/assets/{code-BWz-HGPr.js → code-CbJKf-XB.js} +0 -0
- /package/dist/assets/{codeowners-CC3fq9E7.js → codeowners-C-ETPtZl.js} +0 -0
- /package/dist/assets/{codeql-_4GAN_Bw.js → codeql-CY95M3v0.js} +0 -0
- /package/dist/assets/{common-lisp-D5YTl_Js.js → common-lisp-jkvtZ2Ik.js} +0 -0
- /package/dist/assets/{conversation-store-C-169WSa.js → conversation-store-CHbGaEsm.js} +0 -0
- /package/dist/assets/{coq-3t8pmfdE.js → coq-Bi_unKps.js} +0 -0
- /package/dist/assets/{cpu-DP8XHaq2.js → cpu-5gykk9k8.js} +0 -0
- /package/dist/assets/{credit-card-D5Jr_MaE.js → credit-card-DpTAzTVV.js} +0 -0
- /package/dist/assets/{csharp-D03xWvJ9.js → csharp-QBgvfk5u.js} +0 -0
- /package/dist/assets/{css-BSbjZYTD.js → css-BaZceQzS.js} +0 -0
- /package/dist/assets/{csv-KIr1MqxC.js → csv-CVwuIic9.js} +0 -0
- /package/dist/assets/{cue-x8JY3ZKp.js → cue-DkG0qQZ4.js} +0 -0
- /package/dist/assets/{cypher-DYTdhZke.js → cypher-DTMsy-hB.js} +0 -0
- /package/dist/assets/{d-x3a3_Xaw.js → d-Fjf4Koag.js} +0 -0
- /package/dist/assets/{dark-plus-BoWuNgPh.js → dark-plus-NWOFy8nF.js} +0 -0
- /package/dist/assets/{dart-CBbg6iqZ.js → dart-C-B5quoC.js} +0 -0
- /package/dist/assets/{dax-Blf4pd4U.js → dax-BfbQaS-y.js} +0 -0
- /package/dist/assets/{definitions-Oi0FRVn9.js → definitions-DYNJAKcq.js} +0 -0
- /package/dist/assets/{desktop-DF-gAani.js → desktop-D-wRHhtZ.js} +0 -0
- /package/dist/assets/{detail-card-B1B2dCt-.js → detail-card-BvxBNhpY.js} +0 -0
- /package/dist/assets/{diff-Bz-ynFfT.js → diff-HY2B-Nwh.js} +0 -0
- /package/dist/assets/{dist-FjyBW1Qr.js → dist-MyZ4Do0z.js} +0 -0
- /package/dist/assets/{docker-COcjM2V4.js → docker-D0h2VncY.js} +0 -0
- /package/dist/assets/{dollar-sign-C2a8NdNp.js → dollar-sign-dNG6nmln.js} +0 -0
- /package/dist/assets/{domain-field-D26fonj8.js → domain-field-CxofG0Dv.js} +0 -0
- /package/dist/assets/{dotenv-DQlW1HXq.js → dotenv-anfOT5OS.js} +0 -0
- /package/dist/assets/{dracula-QACZQ6zu.js → dracula-aGLJoy2F.js} +0 -0
- /package/dist/assets/{dracula-soft-CetGliD1.js → dracula-soft-Dlxu_eUn.js} +0 -0
- /package/dist/assets/{dream-maker-iaFuOQSv.js → dream-maker-BnzePdTr.js} +0 -0
- /package/dist/assets/{edit-chat-session-CoCYIa7B.js → edit-chat-session-YxQWBpD-.js} +0 -0
- /package/dist/assets/{effective-timezone-B3Fbyha6.js → effective-timezone-DRpjXyt8.js} +0 -0
- /package/dist/assets/{emacs-lisp-CH1n8WYM.js → emacs-lisp-QnBz66Tt.js} +0 -0
- /package/dist/assets/{emoji-catalog-data-Bqx7bDo2.js → emoji-catalog-data-DhNOHrfo.js} +0 -0
- /package/dist/assets/{environment-store-CKdruGRq.js → environment-store-BWyWaLIj.js} +0 -0
- /package/dist/assets/{event-bus-BfBOaWo4.js → event-bus-B2ZcRI0d.js} +0 -0
- /package/dist/assets/{everforest-dark-qFTxHyEi.js → everforest-dark-DKi3Ha2s.js} +0 -0
- /package/dist/assets/{everforest-light-CMDL7Vzx.js → everforest-light-Di1DSg18.js} +0 -0
- /package/dist/assets/{external-link-BK_NhMUL.js → external-link-B20JjYU8.js} +0 -0
- /package/dist/assets/{feature-flag-catalog-BY11eEKw.js → feature-flag-catalog-DRPf1_SK.js} +0 -0
- /package/dist/assets/{fennel-DyOFhqOX.js → fennel-B3cWpREC.js} +0 -0
- /package/dist/assets/{fish-B0J-vTHc.js → fish-DpI15K3x.js} +0 -0
- /package/dist/assets/{fluent--sbdpSwP.js → fluent-BU_Ao1YA.js} +0 -0
- /package/dist/assets/{format-CPAd76Ns.js → format-C5du35u0.js} +0 -0
- /package/dist/assets/{format-date-Oi80uFkI.js → format-date-xVdpk-HO.js} +0 -0
- /package/dist/assets/{format-file-size-Bs1DU5ou.js → format-file-size-g5Rcla1Z.js} +0 -0
- /package/dist/assets/{fortran-free-form-DejnThIc.js → fortran-free-form-APdw7nRi.js} +0 -0
- /package/dist/assets/{gdscript-BePN-og4.js → gdscript-C9n3aYNH.js} +0 -0
- /package/dist/assets/{gdshader-oOXGIe0e.js → gdshader-BNe8FCMa.js} +0 -0
- /package/dist/assets/{genie-CE5f-hxZ.js → genie-UJn64PaK.js} +0 -0
- /package/dist/assets/{gherkin-BWzSzSMR.js → gherkin-BCsk5gPv.js} +0 -0
- /package/dist/assets/{github-dark-DS082wku.js → github-dark-CcqFUaXh.js} +0 -0
- /package/dist/assets/{github-dark-default-ZJC2ASK_.js → github-dark-default-BEfjv8vU.js} +0 -0
- /package/dist/assets/{github-dark-dimmed-CA3DSNsk.js → github-dark-dimmed-BmClpPII.js} +0 -0
- /package/dist/assets/{github-dark-high-contrast-Ccb0VCI5.js → github-dark-high-contrast-DxtwSwRx.js} +0 -0
- /package/dist/assets/{github-light-BDt3zb-h.js → github-light-BDrNatQj.js} +0 -0
- /package/dist/assets/{github-light-default-CVH9GywU.js → github-light-default-BjpfDxin.js} +0 -0
- /package/dist/assets/{github-light-high-contrast-DBvYA4nB.js → github-light-high-contrast-Ckg6xBqg.js} +0 -0
- /package/dist/assets/{gleam-B9TlhGb-.js → gleam-BAk2TAwy.js} +0 -0
- /package/dist/assets/{globe-Pg4412Nf.js → globe-Cs7zsYYk.js} +0 -0
- /package/dist/assets/{gn-DMQsC2wT.js → gn-sDgKwuzk.js} +0 -0
- /package/dist/assets/{gnuplot-DSp3nTIV.js → gnuplot-CojuaIxD.js} +0 -0
- /package/dist/assets/{go-BDEDpOuU.js → go-ChnctoEy.js} +0 -0
- /package/dist/assets/{groovy-CAKGLWL8.js → groovy-BW1CRJOP.js} +0 -0
- /package/dist/assets/{gruvbox-dark-hard-CICZtI9h.js → gruvbox-dark-hard-NYC8N0Hj.js} +0 -0
- /package/dist/assets/{gruvbox-dark-medium-Dp3d-CTQ.js → gruvbox-dark-medium-4LUdPQMx.js} +0 -0
- /package/dist/assets/{gruvbox-dark-soft-3gVdehkA.js → gruvbox-dark-soft-BiLDT5Eq.js} +0 -0
- /package/dist/assets/{gruvbox-light-hard-BdfmtMlH.js → gruvbox-light-hard-bX_5wboy.js} +0 -0
- /package/dist/assets/{gruvbox-light-medium-B2dTwhCi.js → gruvbox-light-medium-DzOc_ZVX.js} +0 -0
- /package/dist/assets/{gruvbox-light-soft-CqxiStFY.js → gruvbox-light-soft-BrhZmy7L.js} +0 -0
- /package/dist/assets/{hard-drive-DlBM1rEi.js → hard-drive-D763GQiD.js} +0 -0
- /package/dist/assets/{haskell-BKk-Kl5_.js → haskell-cjJpMjf_.js} +0 -0
- /package/dist/assets/{haxe-BPFrQPtj.js → haxe-BH2D3wxw.js} +0 -0
- /package/dist/assets/{hcl-BH96BnDR.js → hcl-B4GRHzID.js} +0 -0
- /package/dist/assets/{hjson-BMjtlQGM.js → hjson-iDxde8KW.js} +0 -0
- /package/dist/assets/{hlsl-g9gCsmqR.js → hlsl-CGH9plnd.js} +0 -0
- /package/dist/assets/{horizon-vpsmnT4b.js → horizon-D8J9R0tx.js} +0 -0
- /package/dist/assets/{horizon-bright-C-g65Lyl.js → horizon-bright-Dqd_0KVK.js} +0 -0
- /package/dist/assets/{houston-AuvwirEd.js → houston-CqAjAAsc.js} +0 -0
- /package/dist/assets/{hy-C4Qxxvge.js → hy-IvNLVoc9.js} +0 -0
- /package/dist/assets/{imba-BMCGEjtx.js → imba-zhmwx7sn.js} +0 -0
- /package/dist/assets/{impersonate-version-flag-BIweCc_k.js → impersonate-version-flag-BhxfH6iZ.js} +0 -0
- /package/dist/assets/{info-Df4cK1Up.js → info-0aHcBJBJ.js} +0 -0
- /package/dist/assets/{ini-CiVvBUuJ.js → ini-BsnJ09OO.js} +0 -0
- /package/dist/assets/{java-S3IvRptg.js → java-BbKRg2mL.js} +0 -0
- /package/dist/assets/{javascript-CiFym4aN.js → javascript-BO_3EWYM.js} +0 -0
- /package/dist/assets/{json-FNNdHa_u.js → json-qMJHCJnt.js} +0 -0
- /package/dist/assets/{json5-CLu_sBvv.js → json5-nJ-dlfSd.js} +0 -0
- /package/dist/assets/{jsonc-BtCrUwnt.js → jsonc-DXDpC9Zc.js} +0 -0
- /package/dist/assets/{jsonl-DCgn6lTZ.js → jsonl-2_BfvIIb.js} +0 -0
- /package/dist/assets/{jsonnet-f86dBoR6.js → jsonnet-x0LYE7XO.js} +0 -0
- /package/dist/assets/{jssm-C9wYN-Un.js → jssm-D9n_WEUN.js} +0 -0
- /package/dist/assets/{jsx-Cg7Lx6bE.js → jsx-CBm28zLd.js} +0 -0
- /package/dist/assets/{kanagawa-dragon-BJovXxUC.js → kanagawa-dragon-BrSAqwaz.js} +0 -0
- /package/dist/assets/{kanagawa-lotus-VMhsCU_v.js → kanagawa-lotus-uNouPKxl.js} +0 -0
- /package/dist/assets/{kanagawa-wave-DkfLcHiJ.js → kanagawa-wave-CeUJ3qVi.js} +0 -0
- /package/dist/assets/{kdl-m2M_hpmI.js → kdl-B64GPTE2.js} +0 -0
- /package/dist/assets/{kotlin-C_hOs0Uj.js → kotlin-NBjS264Y.js} +0 -0
- /package/dist/assets/{kusto-B-nu1FTM.js → kusto-CQGiuo9w.js} +0 -0
- /package/dist/assets/{laserwave-HSOxo19N.js → laserwave-DMcAdL8n.js} +0 -0
- /package/dist/assets/{lean-DFqzkFao.js → lean-C2vo0WKl.js} +0 -0
- /package/dist/assets/{less-huifyCzP.js → less-_Ej26h4v.js} +0 -0
- /package/dist/assets/{lib-CBWNpwBJ.js → lib-IxGNPYTQ.js} +0 -0
- /package/dist/assets/{light-plus-D82c0bmS.js → light-plus-BtzH6Kcu.js} +0 -0
- /package/dist/assets/{link-2-ujSXquYL.js → link-2-lDGwin8R.js} +0 -0
- /package/dist/assets/{llm-dimension-Bo4nKlCe.js → llm-dimension-BJ1QInrm.js} +0 -0
- /package/dist/assets/{llvm-BQ3MEFWj.js → llvm-0cD0J8Ld.js} +0 -0
- /package/dist/assets/{loader-circle-CdxxVJvk.js → loader-circle-B_aODXCH.js} +0 -0
- /package/dist/assets/{log-W6MLdhsm.js → log-Cl-8HWY6.js} +0 -0
- /package/dist/assets/{log-in-DmeCGRNC.js → log-in-BhxLM9n2.js} +0 -0
- /package/dist/assets/{logo-C4fb95aq.js → logo-BmaOHDEJ.js} +0 -0
- /package/dist/assets/{luau-vgObM9Db.js → luau-oesKtmzp.js} +0 -0
- /package/dist/assets/{make-Byhzvb1j.js → make-CMeL3E_9.js} +0 -0
- /package/dist/assets/{markdown-zqWg10F9.js → markdown-DddLVYE3.js} +0 -0
- /package/dist/assets/{material-theme-CoamS4Fi.js → material-theme-CnvIkpVz.js} +0 -0
- /package/dist/assets/{material-theme-darker-C-Y7A753.js → material-theme-darker-BXR4zCIF.js} +0 -0
- /package/dist/assets/{material-theme-lighter-oJTDR2Mw.js → material-theme-lighter-C9m3YFl0.js} +0 -0
- /package/dist/assets/{material-theme-ocean-DTqnFs4i.js → material-theme-ocean-S4vZ_ozl.js} +0 -0
- /package/dist/assets/{material-theme-palenight-B003OogM.js → material-theme-palenight-toh-up6L.js} +0 -0
- /package/dist/assets/{matlab-DHnYEnUO.js → matlab-Com0Ok_m.js} +0 -0
- /package/dist/assets/{mdx-DKHDssVZ.js → mdx-C3U9M9y9.js} +0 -0
- /package/dist/assets/{mermaid-D0oSV8x_.js → mermaid-Sv1QBTxD.js} +0 -0
- /package/dist/assets/{min-dark-jBFp112O.js → min-dark-BHpfTLu2.js} +0 -0
- /package/dist/assets/{min-light-BX0ojdSk.js → min-light-nmgv8tjN.js} +0 -0
- /package/dist/assets/{minimize-2-C4vb3hcK.js → minimize-2-_1kSPlpu.js} +0 -0
- /package/dist/assets/{mipsasm-zLQa96jh.js → mipsasm-B8zV0h2S.js} +0 -0
- /package/dist/assets/{misc-9E89XAY7.js → misc-TMEmisWK.js} +0 -0
- /package/dist/assets/{mojo-B8z3i6gc.js → mojo-DqNBqrie.js} +0 -0
- /package/dist/assets/{monokai--EUyKbtq.js → monokai-MdQxNDb2.js} +0 -0
- /package/dist/assets/{moon-BhPlqy1k.js → moon-Bb6I8Eyg.js} +0 -0
- /package/dist/assets/{moonbit-BLTvrVWa.js → moonbit-BIquleFg.js} +0 -0
- /package/dist/assets/{move-CKsAppOk.js → move-WNzEYZNq.js} +0 -0
- /package/dist/assets/{narrat-BCCAHLWx.js → narrat-Di3VNInW.js} +0 -0
- /package/dist/assets/{native-deep-link-DHVHl6Uy.js → native-deep-link-CaWChag6.js} +0 -0
- /package/dist/assets/{nextflow-groovy-wZGfHagP.js → nextflow-groovy-lEoRSP3F.js} +0 -0
- /package/dist/assets/{night-owl-CfA7aDA7.js → night-owl-BUMT3jZb.js} +0 -0
- /package/dist/assets/{night-owl-light-ClFcKsNV.js → night-owl-light-56jMGMHs.js} +0 -0
- /package/dist/assets/{nix-C5UQ7wEL.js → nix-CsxM0Xoe.js} +0 -0
- /package/dist/assets/{nord-CO_Y9hDN.js → nord-DiOHwVTL.js} +0 -0
- /package/dist/assets/{nushell-lId0mFoG.js → nushell-2ECx9IFK.js} +0 -0
- /package/dist/assets/{objective-c-BvBaNG41.js → objective-c-DQ792k-M.js} +0 -0
- /package/dist/assets/{objective-cpp-C0KRFsXy.js → objective-cpp-BPqohpDj.js} +0 -0
- /package/dist/assets/{ocaml-Cvnu4GL8.js → ocaml-u6aKbVxt.js} +0 -0
- /package/dist/assets/{odin-BKSiKmKh.js → odin-C8k37cBH.js} +0 -0
- /package/dist/assets/{one-dark-pro-C-Jzle1M.js → one-dark-pro-Bq7WouWg.js} +0 -0
- /package/dist/assets/{one-light-Cgtm4qn9.js → one-light-BoYyfZus.js} +0 -0
- /package/dist/assets/{openscad-Dk2PhK7u.js → openscad-CGCLPwTP.js} +0 -0
- /package/dist/assets/{page-shell-zjplma_p.js → page-shell-L1NkKznr.js} +0 -0
- /package/dist/assets/{pascal-hwdU3TKe.js → pascal-5ld2bFbn.js} +0 -0
- /package/dist/assets/{pdf-C_fDy0Qz.js → pdf-DrKiEEck.js} +0 -0
- /package/dist/assets/{pencil-BqT-WChe.js → pencil-CAT69p4q.js} +0 -0
- /package/dist/assets/{pkl-J_1CnmKZ.js → pkl-Dn-UbXbE.js} +0 -0
- /package/dist/assets/{plastic-ClGm5OKF.js → plastic-iUzwc7N8.js} +0 -0
- /package/dist/assets/{plsql-BDrutCci.js → plsql-4VtAFQRr.js} +0 -0
- /package/dist/assets/{po-BcMPBkC8.js → po-DUTG8oJ7.js} +0 -0
- /package/dist/assets/{poimandres-KLcMk2gK.js → poimandres-cPBqn3vV.js} +0 -0
- /package/dist/assets/{polar-DvlpYlpE.js → polar-_MrgmZND.js} +0 -0
- /package/dist/assets/{postcss-ClNx6Yrc.js → postcss-BtHn3WbL.js} +0 -0
- /package/dist/assets/{powerquery-6q4JOGfC.js → powerquery-BfhNbPy5.js} +0 -0
- /package/dist/assets/{powershell-CHWviSeR.js → powershell-BTwE3Uvv.js} +0 -0
- /package/dist/assets/{prechat-names-Ba-YnefK.js → prechat-names-vFJN71oS.js} +0 -0
- /package/dist/assets/{prisma-DOz4K1dt.js → prisma-DgedEPB5.js} +0 -0
- /package/dist/assets/{prolog-B7lK5DtY.js → prolog-Cvoywwok.js} +0 -0
- /package/dist/assets/{proto-CNoG5Nya.js → proto-OY2Wt-aH.js} +0 -0
- /package/dist/assets/{proxy-F0uEV9Dc.js → proxy-Bk4CUXdp.js} +0 -0
- /package/dist/assets/{public-asset-y2pjkMTl.js → public-asset-DiDBfQ0J.js} +0 -0
- /package/dist/assets/{puppet-D_vyKJlV.js → puppet-DJIIteDp.js} +0 -0
- /package/dist/assets/{purescript-CQ4zgAtt.js → purescript-CWcHZ_4J.js} +0 -0
- /package/dist/assets/{python-BAaV7Zg0.js → python-drrfvKMr.js} +0 -0
- /package/dist/assets/{qmldir-BkJZALS1.js → qmldir-U_DlUtZw.js} +0 -0
- /package/dist/assets/{qss-Bf1VygUW.js → qss-DhmGkP2d.js} +0 -0
- /package/dist/assets/{r-DTpjIT-T.js → r-DUCn6OGf.js} +0 -0
- /package/dist/assets/{racket-DQvWLF3B.js → racket-CQwGcjvv.js} +0 -0
- /package/dist/assets/{raku-B2DatCrA.js → raku-BS2P_oJN.js} +0 -0
- /package/dist/assets/{red-BA3lMR3s.js → red-Dv7pHvf3.js} +0 -0
- /package/dist/assets/{reg-pRhhtEP7.js → reg-DOm7t7_F.js} +0 -0
- /package/dist/assets/{regexp-D4bApECU.js → regexp-BzJqRvEE.js} +0 -0
- /package/dist/assets/{rel-Dkwy7cWB.js → rel-9nNA7PxF.js} +0 -0
- /package/dist/assets/{riscv-CBpk7XNF.js → riscv-CMK8Jp-K.js} +0 -0
- /package/dist/assets/{ron-D2xRiyT9.js → ron-Deia4w-l.js} +0 -0
- /package/dist/assets/{rose-pine-B8oqc97q.js → rose-pine-5xX2KsmW.js} +0 -0
- /package/dist/assets/{rose-pine-dawn-CZudWB6Q.js → rose-pine-dawn-D3957WJc.js} +0 -0
- /package/dist/assets/{rose-pine-moon-BQmCwPmv.js → rose-pine-moon-Db5fGU9J.js} +0 -0
- /package/dist/assets/{rosmsg-DzQ7LZDp.js → rosmsg-Ch16l3-6.js} +0 -0
- /package/dist/assets/{routes-BnbYm-Mr.js → routes-DURVkpXA.js} +0 -0
- /package/dist/assets/{rust-CRj-OeqB.js → rust-BMt6Ayxv.js} +0 -0
- /package/dist/assets/{sass-DV_JdCKi.js → sass-aiEFVAQR.js} +0 -0
- /package/dist/assets/{save-BNdcHGn2.js → save-CLK96gTB.js} +0 -0
- /package/dist/assets/{scala-O1JcpAUO.js → scala-0A-y0CkY.js} +0 -0
- /package/dist/assets/{scheme-CQ3NYqCi.js → scheme-DX30mfnD.js} +0 -0
- /package/dist/assets/{sdbl-CaUlaogg.js → sdbl-JrqL4iox.js} +0 -0
- /package/dist/assets/{semver-B9XSBWj5.js → semver-ItsTRQOU.js} +0 -0
- /package/dist/assets/{shellscript-Cw4VFbvs.js → shellscript-DGkkpjG7.js} +0 -0
- /package/dist/assets/{slack-dark-Dmkxml40.js → slack-dark-BR3TsDmO.js} +0 -0
- /package/dist/assets/{slack-ochin-taqpEFw2.js → slack-ochin-DyAfjorS.js} +0 -0
- /package/dist/assets/{smalltalk-DztdAWF4.js → smalltalk-Cof3OlR_.js} +0 -0
- /package/dist/assets/{snazzy-light-DM4zGPpU.js → snazzy-light-CC4udYYq.js} +0 -0
- /package/dist/assets/{solarized-dark-B3Ng_rRg.js → solarized-dark-DknXsDTE.js} +0 -0
- /package/dist/assets/{solarized-light-BMJzgm07.js → solarized-light--AdBEDH9.js} +0 -0
- /package/dist/assets/{solidity-CVd77x1j.js → solidity-qR-HUJDD.js} +0 -0
- /package/dist/assets/{splunk-DBG9mCYS.js → splunk-C6lQd4I1.js} +0 -0
- /package/dist/assets/{sql-rrFFC6Fc.js → sql-BKMzmqD5.js} +0 -0
- /package/dist/assets/{ssh-config-BAJaOk_o.js → ssh-config-MPQVCOUG.js} +0 -0
- /package/dist/assets/{stylus-CaHMbcI_.js → stylus-j1srhNe4.js} +0 -0
- /package/dist/assets/{swift-BGVaX2-Z.js → swift-D-uxmYHp.js} +0 -0
- /package/dist/assets/{synthwave-84-DnPkZXmu.js → synthwave-84-Cq2RaZRc.js} +0 -0
- /package/dist/assets/{system-verilog-C2wU3RKb.js → system-verilog-CdwJVJfm.js} +0 -0
- /package/dist/assets/{systemd-vmaWrlsv.js → systemd-BuxGN1Aj.js} +0 -0
- /package/dist/assets/{talonscript-b1mDcD3C.js → talonscript-WgzgoAvp.js} +0 -0
- /package/dist/assets/{tasl-DcI4Sf1m.js → tasl-DKKD9xHr.js} +0 -0
- /package/dist/assets/{tcl-5lHtlkfj.js → tcl-BbJL-v9L.js} +0 -0
- /package/dist/assets/{terraform-BWttfolC.js → terraform-D9h5l4Od.js} +0 -0
- /package/dist/assets/{tokyo-night-BC-soOg_.js → tokyo-night-DsyaIFHj.js} +0 -0
- /package/dist/assets/{toml-B9dalJKs.js → toml-BYZMBJre.js} +0 -0
- /package/dist/assets/{triangle-alert-B-ye6tYl.js → triangle-alert-9She3ZXq.js} +0 -0
- /package/dist/assets/{tsv-C0j2dduU.js → tsv-lwz38Lgv.js} +0 -0
- /package/dist/assets/{tsx-B10qZjwa.js → tsx-CEtgsCWp.js} +0 -0
- /package/dist/assets/{turtle-rKeDGLSz.js → turtle-CPn7FGQN.js} +0 -0
- /package/dist/assets/{typescript-B7SKNG38.js → typescript-B_Krcmuo.js} +0 -0
- /package/dist/assets/{typespec-BuffxECm.js → typespec-tzUKD-6l.js} +0 -0
- /package/dist/assets/{typst-DphSvVOC.js → typst-CGFhzQ0J.js} +0 -0
- /package/dist/assets/{usage-window-DWIKoAyD.js → usage-window-BxyqRrBc.js} +0 -0
- /package/dist/assets/{use-active-assistant-id-BFElIHKJ.js → use-active-assistant-id-DmsoQoFv.js} +0 -0
- /package/dist/assets/{use-is-mobile-ikBu--_t.js → use-is-mobile-1jZnBx-e.js} +0 -0
- /package/dist/assets/{v-uYZrmpKa.js → v-CYOcGRi1.js} +0 -0
- /package/dist/assets/{vala-giZmu_ab.js → vala-XjzPC9NR.js} +0 -0
- /package/dist/assets/{vb-DnK6z0gT.js → vb-WGBYLMo6.js} +0 -0
- /package/dist/assets/{verilog-s5-98wKF.js → verilog-DjkXjJIM.js} +0 -0
- /package/dist/assets/{vesper-DoQEn0ju.js → vesper-D-v_r_0i.js} +0 -0
- /package/dist/assets/{vhdl-gGJDUUFZ.js → vhdl-Cd13HhqO.js} +0 -0
- /package/dist/assets/{viml-C6_SxGME.js → viml-X5XhCsqc.js} +0 -0
- /package/dist/assets/{vitesse-black-CNInFK6d.js → vitesse-black-cXm85HJn.js} +0 -0
- /package/dist/assets/{vitesse-dark-YnyUziws.js → vitesse-dark-ClRCDj95.js} +0 -0
- /package/dist/assets/{vitesse-light-BrR35sNL.js → vitesse-light-Ku1QxDNQ.js} +0 -0
- /package/dist/assets/{vyper-BMsfCxTh.js → vyper-BERs3zji.js} +0 -0
- /package/dist/assets/{wasm-KNzNfyPH.js → wasm-JhQLN_9d.js} +0 -0
- /package/dist/assets/{wasm-Cok1e5pa.js → wasm-PA_2fksc.js} +0 -0
- /package/dist/assets/{wenyan-RgMhVW-R.js → wenyan-BuW10Zb1.js} +0 -0
- /package/dist/assets/{wgsl-DL_2EXdU.js → wgsl-RDB2M1oV.js} +0 -0
- /package/dist/assets/{wikitext-DMmzvCF0.js → wikitext-BnQxhtTH.js} +0 -0
- /package/dist/assets/{wit-B375rxtW.js → wit-DDMX-T1N.js} +0 -0
- /package/dist/assets/{wolfram-C4RT8d-C.js → wolfram-sRR3CjxX.js} +0 -0
- /package/dist/assets/{x-Bmx5Uey2.js → x-DExTaS8N.js} +0 -0
- /package/dist/assets/{xterm-DIkZ0IL1.js → xterm-B5N900VN.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-BnlhNUFn.js → xterm-addon-fit-CvCGXtx-.js} +0 -0
- /package/dist/assets/{yaml-BrMCzOnW.js → yaml-BiW6ul-R.js} +0 -0
- /package/dist/assets/{zenscript-CkTydF60.js → zenscript-DtR7pYBh.js} +0 -0
- /package/dist/assets/{zig-D2VB9Qdu.js → zig-CHz-3v0e.js} +0 -0
- /package/dist/assets/{zwitch-DzWJYM3n.js → zwitch-DQ1egN7i.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{r as i,t as a}from"./capture-error-B7QmSjOI.js";import{t as o}from"./react-DJZBPgpf.js";import{t as s}from"./button-D7s2Q_uG.js";import{d as c,h as l}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as u}from"./QueryClientProvider-DKhXIxGb.js";import{t as d}from"./useQuery-B45lW1Kk.js";import{t as f}from"./useMutation-Lj4VunQV.js";import{t as p}from"./jsx-runtime-CVSDxk6A.js";import{t as m}from"./typography-BscuIPxA.js";import{t as h}from"./dropdown-SfZ7NXPp.js";import{t as g}from"./confirm-dialog-DbNUkFt6.js";import{t as _}from"./notice-G5Imd5pC.js";import{t as v}from"./tag-BadGF3FB.js";import{t as y}from"./input-CwdmSRlD.js";import{t as b}from"./toggle-_vZlLDBV.js";import{n as x}from"./stat-square-B5tBfA4w.js";import{t as S}from"./modal-DX6UN7b0.js";import{n as C}from"./toast-DLWkiWW6.js";import{t as w}from"./createLucideIcon-DIlBzeWM.js";import{t as T}from"./circle-alert-CIUa_TF0.js";import{t as E}from"./circle-check-BZU8YmDv.js";import{n as D,t as O}from"./domain-field-D26fonj8.js";import{t as k}from"./external-link-BK_NhMUL.js";import{t as A}from"./info-Df4cK1Up.js";import{t as j}from"./loader-circle-CdxxVJvk.js";import{t as M}from"./triangle-alert-B-ye6tYl.js";import{Mt as N,Nn as P,jt as F,nn as I,nt as L}from"./sdk.gen-ZXouuy0U.js";import{Et as R,R as ee,c as z,d as te,l as B,lt as V,u as H,xt as U,z as W}from"./react-query.gen-Dc9bPcAq.js";import{r as G}from"./api-errors-DbHkbHFH.js";import{a as ne}from"./routes-BnbYm-Mr.js";import{t as K}from"./use-is-org-ready-BwxYweXj.js";import{t as q}from"./assistant-identity-store-bwfN6pDI.js";import{t as J}from"./assistant-feature-flag-store-ClCVaYet.js";import{Ai as re,Ci as Y,Cn as ie,Di as ae,Ei as X,En as oe,Fi as se,It as ce,Ki as le,Mi as ue,Ni as de,Oi as fe,On as pe,Pi as me,Si as he,Sn as ge,Ti as _e,Tn as ve,_ as ye,_i as be,_n as xe,ai as Se,bi as Ce,bn as we,ci as Te,cr as Ee,di as De,fi as Oe,gi as ke,gn as Ae,hi as je,ji as Me,ki as Ne,kn as Pe,li as Fe,mi as Ie,mo as Le,oa as Re,oi as ze,on as Be,oo as Ve,pi as He,si as Ue,ui as We,v as Ge,vi as Ke,vn as qe,wi as Je,wn as Ye,xi as Xe,xn as Ze,yi as Qe,yn as $e}from"./index-CEhiJItI.js";import{t as et}from"./use-active-assistant-id-BFElIHKJ.js";import{t as tt}from"./detail-card-B1B2dCt-.js";import{t as nt}from"./environment-store-CKdruGRq.js";var rt=w(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Z=e(o(),1),Q=p();function it({mode:e,onChange:t}){return(0,Q.jsx)(`div`,{className:`max-w-[280px]`,children:(0,Q.jsx)(x,{ariaLabel:`Service mode`,value:e,onChange:t,items:[{value:`managed`,label:`Managed`},{value:`your-own`,label:`Your Own`}]})})}function at({id:e,title:t,subtitle:n,mode:r,onModeChange:i,children:a}){return(0,Q.jsxs)(tt,{id:e,title:t,subtitle:n,accessory:(0,Q.jsx)(it,{mode:r,onChange:i}),children:[(0,Q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,Q.jsx)(`div`,{className:`mt-4`,children:a})]})}function $({onClick:e,disabled:t}){return(0,Q.jsx)(s,{onClick:e,disabled:t,children:`Save`})}function ot({onClick:e,filled:t=!1}){return(0,Q.jsx)(s,{variant:t?`danger`:`dangerGhost`,onClick:e,children:`Reset`})}function st({id:e,title:t,subtitle:n,children:r}){return(0,Q.jsxs)(tt,{id:e,title:t,subtitle:n,children:[(0,Q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,Q.jsx)(`div`,{className:`mt-4`,children:r})]})}function ct({guide:e}){return(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(A,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{children:e.description}),(0,Q.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[e.linkLabel,(0,Q.jsx)(k,{className:`h-3 w-3`})]})]})]})}function lt({status:e,message:t,isLoading:n}){return n?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,children:[(0,Q.jsx)(j,{className:`h-3 w-3 animate-spin`}),`Checking domain…`]}):e?e===`verified`?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-positive-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,title:`DNS records have been verified. Your domain is ready to send and receive email.`,children:[(0,Q.jsx)(Le,{className:`h-3 w-3`}),`Domain verified`]}):e===`pending`||e===`not_started`?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-mid-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-mid-strong)]`,title:`DNS records have been provisioned. Waiting for the email provider to verify them — this usually takes a few minutes.`,children:[(0,Q.jsx)(Ve,{className:`h-3 w-3`}),`Verifying domain…`]}):(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-negative-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,title:`Domain verification failed. DNS records may not have propagated correctly. You could try releasing and re-registering the domain.`,children:[(0,Q.jsx)(T,{className:`h-3 w-3`}),`Verification failed`]}):(0,Q.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,title:`Unable to retrieve domain verification status.`,children:`Unknown status`})}var ut=`__custom__`;function dt(e){return e?!!(e.profile||e.provider||e.model):!1}function ft(e,t){let n=dt(e);return n===dt(t)?n?(e?.profile??null)===(t?.profile??null)&&(e?.provider??null)===(t?.provider??null)&&(e?.model??null)===(t?.model??null):!0:!1}function pt({id:e,displayName:t,description:n,defaultProfileLabel:r,draft:i,profileOptions:a,onDraftChange:o,onToggle:s}){let c=dt(i),l=!i||!c?``:i.provider||i.model?ut:i.profile??``,u=l===ut,d=Me.find(e=>e===i?.provider)??Me[0],f=me(d).map(e=>({value:e.id,label:e.displayName})),p=!!i?.provider&&!i?.model;function m(t){if(t===`__custom__`){let t=Me[0];o(e,{profile:null,provider:t,model:de(t)??``})}else t===``?o(e,null):o(e,{profile:t,provider:null,model:null})}function g(t){let n=de(t)??``;o(e,{...i??{},profile:null,provider:t,model:n})}function _(t){o(e,{...i??{},model:t})}return(0,Q.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default font-medium text-[var(--content-default)]`,children:t}),n&&(0,Q.jsxs)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[n,r&&(0,Q.jsxs)(`span`,{className:`ml-1.5 text-body-small-default text-[var(--content-tertiary)] opacity-60`,children:[`· Default: `,r]})]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c&&(0,Q.jsx)(h,{value:l,onChange:m,options:a,className:`w-36`}),(0,Q.jsx)(b,{checked:c,onChange:t=>s(e,t),"aria-label":`Override ${t}`})]})]}),c&&u&&(0,Q.jsxs)(`div`,{className:`mt-3 space-y-2 border-t border-[var(--border-base)] pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex-1`,children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(h,{value:d??``,onChange:g,options:Me.map(e=>({value:e,label:ue[e]??e}))})]}),(0,Q.jsxs)(`div`,{className:`flex-1`,children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,Q.jsx)(h,{value:i?.model??``,onChange:_,options:f})]})]}),p&&(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:`Pick a model`})]})]})}function mt({isOpen:e,onClose:t,assistantId:n}){let r=(0,Z.useRef)(!1);return(0,Q.jsx)(S.Root,{open:e,onOpenChange:e=>{!e&&!r.current&&t()},children:e?(0,Q.jsx)(ht,{assistantId:n,onClose:t,onSavingChange:e=>{r.current=e}}):null})}function ht({assistantId:e,onClose:t,onSavingChange:n}){let r=u(),{data:i}=d({...z({path:{assistant_id:e}}),staleTime:3e4}),o=(0,Z.useMemo)(()=>i?.llm?.profiles??{},[i?.llm?.profiles]),c=(0,Z.useMemo)(()=>i?.llm?.profileOrder??[],[i?.llm?.profileOrder]),l=(0,Z.useMemo)(()=>i?.llm?.callSites??{},[i?.llm?.callSites]),f=(0,Z.useMemo)(()=>Je(o,c),[o,c]),p=R({onSuccess:t=>{H(r,{path:{assistant_id:e}},t)}}),[m,h]=(0,Z.useState)(``),[_,v]=(0,Z.useState)({}),[b,x]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(!1),E=J.use.analyzeConversation(),{data:D,isLoading:O,isError:k,refetch:A}=d({...te({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4,refetchOnWindowFocus:!1}),M=(0,Z.useMemo)(()=>{let e=(D?.callSites??[]).filter(e=>e.id!==`mainAgent`);return E||(e=e.filter(e=>e.id!==`analyzeConversation`)),e},[D,E]),N=!O&&!k&&!!D&&!!i,P=(0,Z.useMemo)(()=>M.map(e=>e.id),[M]),F=(0,Z.useMemo)(()=>{if(!N)return{};let e={};for(let t of P)if(t in _)e[t]=_[t];else{let n=l[t];e[t]=n?{...n}:{}}return e},[N,P,l,_]),I=(0,Z.useMemo)(()=>new Set(P),[P]),L=(0,Z.useMemo)(()=>Object.entries(l).some(([e,t])=>I.has(e)&&(t?.profile!=null||t?.provider!=null||t?.model!=null)),[l,I]),ee=(0,Z.useMemo)(()=>{if(!N)return!1;for(let e of Object.keys(F))if(!ft(F[e],l[e]))return!0;return!1},[N,F,l]),B=(0,Z.useMemo)(()=>Object.values(F).some(e=>dt(e)&&!!e?.provider&&!e?.model),[F]),V=J.use.queryComplexityRouting(),U=(0,Z.useCallback)(e=>[...Qe(he(f,[e]),V).map(e=>({value:e.name,label:Ce(e)})),{value:ut,label:`Custom`}],[f,V]),W=(0,Z.useMemo)(()=>{if(!m.trim())return M;let e=m.toLowerCase();return M.filter(t=>(t.displayName??``).toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e)||(t.domain??``).toLowerCase().includes(e))},[M,m]),G=(0,Z.useMemo)(()=>{if(!D)return[];let e=D.domains.map(e=>e.id),t=new Map(D.domains.map(e=>[e.id,e])),n=[];for(let r of e){let e=W.filter(e=>e.domain===r);e.length>0&&n.push({domain:t.get(r),sites:e})}let r=new Set(e),i=W.filter(e=>!r.has(e.domain));return i.length>0&&n.push({domain:{id:`other`,displayName:`Other`},sites:i}),n},[D,W]),ne=(0,Z.useCallback)((e,t)=>{v(n=>({...n,[e]:t}))},[]),K=(0,Z.useCallback)((e,t)=>{if(!t){v(t=>({...t,[e]:null}));return}let n=Xe(f,M.find(t=>t.id===e)?.defaultProfile,V);if(n)v(t=>({...t,[e]:{profile:n}}));else{let t=Me[0],n=de(t)??``;v(r=>({...r,[e]:{provider:t,model:n}}))}},[M,f,V]),q=(0,Z.useCallback)(async()=>{x(!0),n?.(!0);try{let n={};for(let e of Object.keys(F)){let t=F[e]??null;n[e]=dt(t)?{profile:t?.profile??null,provider:t?.provider??null,model:t?.model??null}:null}await p.mutateAsync({path:{assistant_id:e},body:{llm:{callSites:n}}}),t(),C.success(`Overrides saved.`)}catch(e){C.error(`Failed to save overrides. Please try again.`),a(e,{context:`call_site_overrides_save`})}finally{x(!1),n?.(!1)}},[F,t,p,n,e]),re=(0,Z.useCallback)(async()=>{x(!0),n?.(!0);try{let n={};for(let e of Object.keys(F))n[e]=null;await p.mutateAsync({path:{assistant_id:e},body:{llm:{callSites:n}}}),t(),C.success(`Overrides reset.`)}catch(e){C.error(`Failed to reset overrides. Please try again.`),a(e,{context:`call_site_overrides_reset`})}finally{x(!1),n?.(!1)}},[F,t,p,n,e]);return(0,Q.jsxs)(S.Content,{size:`lg`,hideCloseButton:!0,children:[(0,Q.jsxs)(S.Header,{children:[(0,Q.jsx)(S.Title,{children:`Action Overrides`}),(0,Q.jsx)(S.Description,{children:`Customize which model profile specific actions should use. Uses your default profile if no override is set.`})]}),(0,Q.jsxs)(S.Body,{children:[(0,Q.jsx)(`div`,{className:`mb-4`,children:(0,Q.jsx)(y,{type:`search`,value:m,onChange:e=>h(e.target.value),placeholder:`Search actions…`,leftIcon:(0,Q.jsx)(Re,{className:`h-4 w-4`}),fullWidth:!0})}),O&&(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Q.jsx)(j,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}),k&&(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Couldn't load actions`}),(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Make sure your assistant is running`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>void A(),children:`Retry`})]}),!O&&!k&&D&&(0,Q.jsx)(`div`,{className:`space-y-4`,children:G.length===0?(0,Q.jsx)(`p`,{className:`py-8 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No actions match your search.`}):G.map(({domain:e,sites:t})=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`mb-2 text-body-small-default font-semibold uppercase tracking-wider text-[var(--content-tertiary)]`,children:e.displayName}),(0,Q.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>{let t=(()=>{let t=F[e.id]??null;return!t||!dt(t)?``:t.provider||t.model?`__custom__`:t.profile??``})(),n=e.defaultProfile?f.find(t=>t.name===e.defaultProfile)?.label??e.defaultProfile:null;return(0,Q.jsx)(pt,{id:e.id,displayName:e.displayName,description:e.description,defaultProfileLabel:n,draft:F[e.id]??null,profileOptions:U(t===``||t===`__custom__`?null:t),onDraftChange:ne,onToggle:K},e.id)})})]},e.id))})]}),(0,Q.jsxs)(S.Footer,{children:[L&&(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>T(!0),disabled:b||!N,tintColor:`var(--system-negative-strong)`,className:`mr-auto`,children:`Reset to Defaults`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:t,disabled:b,children:`Cancel`}),(0,Q.jsx)(s,{variant:`primary`,size:`compact`,onClick:()=>void q(),disabled:!ee||B||b,children:b?(0,Q.jsx)(j,{className:`h-4 w-4 animate-spin`}):`Save`})]}),(0,Q.jsx)(g,{open:w,title:`Reset to Defaults`,message:`Every task override will be reset and will follow your active profile. This cannot be undone.`,confirmLabel:`Reset to Defaults`,destructive:!0,onConfirm:()=>{T(!1),re()},onCancel:()=>T(!1)})]})}function gt({blocked:e,availableReplacements:t,replacement:n,onReplacementChange:r,error:i,saving:a,onClose:o,onConfirm:c}){let l=``;if(e){let t=e.label||e.name;l=e.isActive&&e.callSiteIds.length>0?`"${t}" is the active profile and is used by ${e.callSiteIds.length} call site(s). Pick a replacement profile.`:e.isActive?`"${t}" is the active profile. Pick a different active profile before deleting, or select a replacement below.`:`"${t}" is used by ${e.callSiteIds.length} call site(s). Select a replacement profile to reassign them before deleting.`}return(0,Q.jsx)(S.Root,{open:e!==null,onOpenChange:e=>{e||o()},children:(0,Q.jsxs)(S.Content,{size:`sm`,children:[(0,Q.jsx)(S.Header,{children:(0,Q.jsx)(S.Title,{children:`Can't Delete Profile`})}),(0,Q.jsxs)(S.Body,{className:`space-y-4`,children:[(0,Q.jsx)(m,{variant:`body-medium-default`,as:`p`,children:l}),e&&e.callSiteIds.length>0&&(0,Q.jsx)(`ul`,{className:`space-y-1 pl-1`,children:e.callSiteIds.map(e=>(0,Q.jsxs)(`li`,{className:`text-body-small-default text-(--content-secondary)`,children:[`• `,(0,Q.jsx)(`code`,{children:e})]},e))}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Replacement profile`}),(0,Q.jsx)(h,{"aria-label":`Replacement profile`,value:n,onChange:r,options:[{value:``,label:`Select a replacement…`},...t.map(e=>({value:e.name,label:e.label??e.name}))]})]}),i&&(0,Q.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:i})]}),(0,Q.jsxs)(S.Footer,{children:[(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:o,children:`Cancel`}),(0,Q.jsx)(s,{variant:`primary`,size:`compact`,disabled:!n||a,onClick:c,children:a?`Saving…`:`Reassign and Delete`})]})]})})}function _t({profile:e,isDragging:t,dropTarget:n,isDeleting:r,deleteError:i,isToggling:a,onDragStart:o,onDragEnd:c,onDragOver:l,onDragLeave:u,onDrop:d,onEditClick:f,onDeleteClick:p,onStatusToggle:h}){let g=e.source===`managed`,_=e.status!==`disabled`,y=e.name===Ke;return(0,Q.jsxs)(`div`,{className:`relative`,children:[n?.name===e.name&&!n.after&&(0,Q.jsx)(`div`,{className:`mx-0 h-0.5 rounded-full bg-[var(--border-active)]`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg pr-2 py-2${t?` opacity-50`:``}`,draggable:!g,onDragStart:o,onDragEnd:c,onDragOver:l,onDragLeave:u,onDrop:d,children:[(0,Q.jsx)(rt,{className:`h-4 w-4 shrink-0 ${g?`invisible`:`cursor-grab text-[var(--content-tertiary)]`}`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1${_?``:` opacity-55`}`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(m,{variant:`body-medium-default`,as:`span`,className:`text-(--content-default)`,children:e.label??e.name}),g&&e.name!==`auto`&&(0,Q.jsx)(v,{tone:`positive`,title:`Managed by Platform — auth is locked, but you can rename or disable this profile.`,children:`Platform`})]}),e.description?(0,Q.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`mt-0.5 text-(--content-tertiary)`,children:e.description}):null,e.model??e.provider?(0,Q.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`mt-0.5 text-(--content-tertiary)`,children:e.model??e.provider}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center`,title:_?`Active — toggle to hide from pickers`:`Disabled — toggle to show in pickers`,children:(0,Q.jsx)(b,{checked:_,onChange:e=>h(e),disabled:a,"aria-label":`${_?`Disable`:`Enable`} ${e.label??e.name}`})}),(0,Q.jsxs)(`div`,{className:`flex w-[92px] items-center justify-end gap-2${y?` invisible`:``}`,children:[(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:f,children:g?`View`:`Edit`}),(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(le,{}),"aria-label":`Delete ${e.label??e.name}`,disabled:g||r,title:g?`Managed profiles cannot be deleted`:void 0,onClick:p,tintColor:`var(--system-negative-strong)`})]})]})]}),n?.name===e.name&&n.after&&(0,Q.jsx)(`div`,{className:`mx-0 h-0.5 rounded-full bg-[var(--border-active)]`}),i?(0,Q.jsx)(m,{variant:`body-small-default`,as:`p`,className:`px-2 pb-1 text-(--system-negative-strong)`,children:i}):null,e.name===`auto`&&(0,Q.jsx)(`div`,{className:`mx-2 mt-1 border-b border-[var(--border-subtle)]`})]})}function vt({isOpen:e,assistantId:t,onClose:n}){let r=u(),{data:i}=d({...z({path:{assistant_id:t}}),staleTime:3e4}),o=(0,Z.useMemo)(()=>i?.llm?.profiles??{},[i?.llm?.profiles]),s=(0,Z.useMemo)(()=>i?.llm?.profileOrder??[],[i?.llm?.profileOrder]),c=i?.llm?.activeProfile??null,l=i?.llm?.callSites??{},f=(0,Z.useMemo)(()=>Je(o,s),[o,s]),p=R({onSuccess:e=>{H(r,{path:{assistant_id:t}},e)}}),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),{data:v}=d({...ee({path:{assistant_id:t}}),enabled:e}),y=v?.connections,b=Object.keys(o);async function x(e,n,r){let i=r?.mode??`replace`,c=!(e in o);if(i===`merge`&&!c){await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:n}}}}),h(!1),_(null);return}let l={profiles:{[e]:n}};if(c&&(l.profileOrder=s.includes(e)?s:[...s,e]),c)await p.mutateAsync({path:{assistant_id:t},body:{llm:l}});else{let n=o[e];await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:null}}}});try{await p.mutateAsync({path:{assistant_id:t},body:{llm:l}})}catch(r){throw a(r,{context:`settings-ai-profile-edit-recreate`}),n!=null&&await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:n}}}}).catch(()=>{}),r}}c&&C.success(`Profile "${n.label??e}" created`),h(!1),_(null)}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(S.Root,{open:e,onOpenChange:e=>{e||n()},children:e?(0,Q.jsx)(yt,{assistantId:t,profiles:o,profileOrder:s,orderedProfiles:f,activeProfile:c,callSiteOverrides:l,onClose:n,onEditClick:e=>{_(e),h(!0)},onNewClick:()=>{_(null),h(!0)}}):null}),(0,Q.jsx)(Se,{isOpen:m,mode:g?g.source===`managed`?`view`:`edit`:`create`,profileName:g?.name,initialValues:g??void 0,existingNames:b,connections:y,assistantId:t,onSave:x,onCancel:()=>{h(!1),_(null)}})]})}function yt({assistantId:e,profiles:t,profileOrder:n,orderedProfiles:r,activeProfile:i,callSiteOverrides:o,onClose:c,onEditClick:l,onNewClick:d}){let f=u(),p=R({onSuccess:t=>{H(f,{path:{assistant_id:e}},t)}}),[h,g]=(0,Z.useState)({}),[_,v]=(0,Z.useState)({}),[y,b]=(0,Z.useState)(new Set),[x,C]=(0,Z.useState)(null),[w,T]=(0,Z.useState)(null),[E,D]=(0,Z.useState)(null),[O,k]=(0,Z.useState)(null),A=(0,Z.useRef)(null),j=(0,Z.useRef)(null),[M,N]=(0,Z.useState)(null),[P,F]=(0,Z.useState)(null),[I,L]=(0,Z.useState)(``),[ee,z]=(0,Z.useState)(!1),te=J.use.queryComplexityRouting(),B=(0,Z.useMemo)(()=>Qe(r,te),[r,te]);async function V(n,r){if(y.has(n.name))return!1;b(e=>new Set(e).add(n.name)),C(null);let i=r?`active`:`disabled`;if(!t[n.name])return b(e=>{let t=new Set(e);return t.delete(n.name),t}),!1;try{return await p.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[n.name]:{status:i}}}}}),!0}catch(e){return a(e,{context:`settings-ai-profile-toggle`}),C(`Couldn't update "${n.label??n.name}". Please try again.`),!1}finally{b(e=>{let t=new Set(e);return t.delete(n.name),t})}}async function U(t){v(e=>({...e,[t]:!0})),g(e=>{let n={...e};return delete n[t],n});try{let r=n.filter(e=>e!==t);await p.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[t]:null},profileOrder:r}}})}catch(e){a(e,{context:`settings-ai-profile-delete`}),g(e=>({...e,[t]:`Failed to delete profile. Please try again.`}))}finally{v(e=>{let n={...e};return delete n[t],n})}}function W(e){let t=B.find(t=>t.name===e)?.label??e,n=e===i,r=Object.entries(o).filter(([t,n])=>t!==`mainAgent`&&n?.profile===e).map(([e])=>e);if(n||r.length>0){N({name:e,label:t,isActive:n,callSiteIds:r}),L(``),F(null);return}U(e)}async function G(){if(!M||!I)return;z(!0),F(null);let t={};if(M.isActive&&(t.activeProfile=I),M.callSiteIds.length>0){let e={};for(let t of M.callSiteIds)e[t]={profile:I};t.callSites=e}if(Object.keys(t).length>0)try{await p.mutateAsync({path:{assistant_id:e},body:{llm:t}})}catch(e){a(e,{context:`settings-ai-profile-reassign-delete`}),F(`Failed to reassign references. Please try again.`),z(!1);return}let n=M.name;N(null),z(!1),U(n)}async function ne(t,r){if(t===r.name)return;k(null);let i=n.filter(e=>e!==t),o=i.indexOf(r.name);if(o===-1)return;r.after&&(o+=1);let s=[...i.slice(0,o),t,...i.slice(o)];try{await p.mutateAsync({path:{assistant_id:e},body:{llm:{profileOrder:s}}})}catch(e){a(e,{context:`settings-ai-profile-reorder`}),k(`Failed to reorder profiles. Please try again.`)}}let K=B.filter(e=>e.name!==M?.name&&e.source!==`managed`),q=K.length>0?K:B.filter(e=>e.name!==M?.name);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(S.Content,{size:`md`,children:[(0,Q.jsxs)(S.Header,{children:[(0,Q.jsx)(S.Title,{children:`Model Profiles`}),(0,Q.jsx)(S.Description,{children:`Bundle a provider and model into a named profile. Assign profiles to specific actions or swap between them when chatting.`})]}),(0,Q.jsxs)(S.Body,{children:[B.length===0?(0,Q.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No profiles yet. Create one to get started.`}):(0,Q.jsx)(`div`,{className:`space-y-1`,children:B.map(e=>(0,Q.jsx)(_t,{profile:e,isDragging:w===e.name,dropTarget:E,isDeleting:_[e.name]??!1,deleteError:h[e.name],isToggling:y.has(e.name),onDragStart:t=>{A.current=e.name,T(e.name),t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`)},onDragEnd:()=>{A.current=null,j.current=null,T(null),D(null)},onDragOver:t=>{t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=t.clientY>n.top+n.height/2,i={name:e.name,after:r};j.current=i,D(i)},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||(j.current=null,D(t=>t?.name===e.name?null:t))},onDrop:e=>{e.preventDefault();let t=A.current,n=j.current;A.current=null,j.current=null,T(null),D(null),t&&n&&ne(t,n)},onEditClick:()=>l(e),onDeleteClick:()=>W(e.name),onStatusToggle:t=>void V(e,t)},e.name))}),O&&(0,Q.jsx)(m,{variant:`body-small-default`,as:`p`,className:`mt-2 text-(--system-negative-strong)`,children:O}),x&&(0,Q.jsx)(m,{variant:`body-small-default`,as:`p`,className:`mt-2 text-(--system-negative-strong)`,children:x})]}),(0,Q.jsxs)(S.Footer,{className:`justify-between`,children:[(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:d,children:`+ New Profile`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:c,children:`Done`})]})]}),(0,Q.jsx)(gt,{blocked:M,availableReplacements:q,replacement:I,onReplacementChange:L,error:P,saving:ee,onClose:()=>{N(null),F(null)},onConfirm:()=>void G()})]})}function bt({mode:e,connection:t,assistantId:n,existingNames:r,onSave:i,onCancel:a}){let[o,c]=(0,Z.useState)(e),[l,d]=(0,Z.useState)(void 0),f=o===`managed-edit`,[p,g]=(0,Z.useState)(t?.label??``),[_,v]=(0,Z.useState)(t?.name??``),[b,x]=(0,Z.useState)(t?.provider??`anthropic`),[C,w]=(0,Z.useState)(()=>t?t.auth.type:`platform`),[T,E]=(0,Z.useState)(()=>t?.auth.type===`api_key`?t.auth.credential:t?``:`credential/anthropic/api_key`),[D,O]=(0,Z.useState)(t?.baseUrl??``),[k,A]=(0,Z.useState)(()=>t?.models?t.models.map(e=>e.id).join(`, `):``),[j,M]=(0,Z.useState)(!1),[F,I]=(0,Z.useState)(null),L=b===`openai-compatible`,R=(0,Z.useMemo)(()=>b&&!De.includes(b)?[...De,b]:De,[b]),{handleLabelChange:ee,resetDirty:z}=Te(o,g,v),[te,B]=(0,Z.useState)(``),[H,U]=(0,Z.useState)(!1),W=u(),G=(0,Z.useMemo)(()=>He(T),[T]),ne=C===`api_key`&&G!==null,{hasStoredCredential:K,isLoading:q}=be({assistantId:n,credentialKind:`credential`,credentialName:G?`${G.service}:${G.field}`:``,enabled:ne}),{credentials:J}=Ue({assistantId:n,enabled:C===`api_key`});(0,Z.useEffect)(()=>{let e=t?.provider??`anthropic`;g(t?.label??``),v(t?.name??``),x(e),w(t?t.auth.type:`platform`),t?.auth.type===`api_key`?E(t.auth.credential):E(t?``:`credential/${e}/api_key`),z(),I(null),O(t?.baseUrl??``),A(t?.models?t.models.map(e=>e.id).join(`, `):``),B(``),U(!1)},[t,z]);function re(){c(`create`),d(b===`ollama`?`none`:`api_key`)}let Y=_.trim().length>0;async function ie(){if(Y){M(!0),I(null);try{let e;if(C===`api_key`){let t=T.trim()||`credential/${b}/api_key`,r=te.trim();if(r){U(!0);try{let e=He(t);await P({path:{assistant_id:n},body:e?{type:`credential`,name:`${e.service}:${e.field}`,value:r}:{type:`api_key`,name:b,value:r},throwOnError:!0});let i=ke(n,`credential`,e?`${e.service}:${e.field}`:``);W.setQueryData(i,!0),W.invalidateQueries({queryKey:V({path:{assistant_id:n}})})}catch{I(`Failed to save API key. Please try again.`);return}finally{U(!1)}}e={type:`api_key`,credential:t}}else if(C===`oauth_subscription`)if(t?.auth.type===`oauth_subscription`)e=t.auth;else{I(`Use the "Sign in with ChatGPT" button to connect your subscription.`);return}else if(C===`service_account`)if(t?.auth.type===`service_account`)e=t.auth;else{I(`Service account connections cannot be created through this form.`);return}else e=C===`none`?{type:`none`}:{type:`platform`};let r=p.trim()||null,a={auth:e,label:r,...L&&{base_url:D.trim()||null,models:k.trim()?k.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):null}},{data:o,response:s}=await N({path:{assistant_id:n,name:t?.name??_.trim()},body:a});if(!s?.ok){I(Oe(s?.status,_.trim()));return}if(!o){I(`Server returned an empty response. Please try again.`);return}i(o)}catch{I(`Failed to save connection. Please try again.`)}finally{M(!1)}}}let ae=J.filter(e=>e.service===b),X=o!==`create`&&t?.auth.type===`api_key`,oe=ae.length>0||X,ce=Fe(`Enter your API key`,K);return o===`create`?(0,Q.jsx)(ze,{variant:`modal`,assistantId:n,existingNames:r,defaultProviderType:b,defaultAuthType:l,onCreated:i,onCancel:a},b):(0,Q.jsxs)(S.Content,{size:`md`,children:[(0,Q.jsxs)(S.Header,{children:[(0,Q.jsx)(S.Title,{children:`Edit Connection`}),(0,Q.jsx)(S.Description,{children:f?`Managed by Vellum — auth is locked, but you can rename "${t?.name}".`:`Editing "${t?.name}".`})]}),(0,Q.jsxs)(S.Body,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[`Display Name`,` `,(0,Q.jsx)(`span`,{className:`text-[var(--content-disabled)]`,children:`(optional)`})]}),(0,Q.jsx)(y,{value:p,onChange:e=>ee(e.target.value),placeholder:`e.g. My Anthropic Key`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Key`}),(0,Q.jsx)(y,{value:_,placeholder:`e.g. anthropic-personal`,disabled:!0,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(h,{"aria-label":`Provider`,value:b,onChange:x,disabled:!0,options:R.map(e=>({value:e,label:ue[e]}))})]}),L&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,Q.jsx)(y,{value:D,onChange:e=>O(e.target.value),placeholder:`https://api.example.com/v1`,disabled:f,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,Q.jsx)(y,{value:k,onChange:e=>A(e.target.value),placeholder:`model-1, model-2`,disabled:f,fullWidth:!0}),(0,Q.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Auth Type`}),(0,Q.jsx)(h,{"aria-label":`Auth type`,value:C,onChange:e=>{w(e),I(null)},disabled:f||b===`ollama`,options:(()=>{let e;return e=b===`ollama`?[`none`]:se(b)?[`api_key`,`platform`]:[`api_key`],C&&!e.includes(C)&&e.push(C),e.map(e=>({value:e,label:We[e]}))})()})]}),C===`api_key`&&(0,Q.jsx)(Ie,{apiKeyValue:te,onApiKeyChange:B,credential:T,onCredentialChange:E,isAuthLocked:f,isLoadingCredential:q,apiKeyPlaceholder:ce,provider:b,providerCredentials:ae,showAdvancedSection:oe,onError:I}),C===`oauth_subscription`&&(0,Q.jsx)(je,{assistantId:n,onConnected:i}),F&&(0,Q.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:F})]}),(0,Q.jsxs)(S.Footer,{children:[(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:a,children:`Cancel`}),o===`managed-edit`&&(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:re,disabled:j||H,children:`Save as New`}),(0,Q.jsx)(s,{variant:`primary`,size:`compact`,disabled:!Y||j||H,onClick:()=>void ie(),children:j?`Saving…`:`Save`})]})]})}function xt(e){switch(e.type){case`api_key`:return`API key · ${e.credential}`;case`oauth_subscription`:return`ChatGPT Subscription`;case`platform`:return`Managed proxy`;case`none`:return`None (local)`;default:return e.type}}function St({isOpen:e,assistantId:t,onClose:n}){let[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(null),s=u(),{data:c,isLoading:l,isError:f}=d({...ee({path:{assistant_id:t}}),enabled:e}),p=(0,Z.useMemo)(()=>c?.connections??[],[c]);function m(e){s.invalidateQueries({queryKey:W({path:{assistant_id:t}})}),i(!1),o(null)}let h=p.map(e=>e.name),g=()=>{i(!1),o(null)};return(0,Q.jsx)(S.Root,{open:e,onOpenChange:e=>{e||(r?g():n())},children:e?r?(0,Q.jsx)(bt,{mode:a?a.isManaged?`managed-edit`:`edit`:`create`,connection:a??void 0,assistantId:t,existingNames:h,onSave:m,onCancel:g}):(0,Q.jsx)(Ct,{connections:p,loading:l,isError:f,assistantId:t,onClose:n,onEditClick:e=>{o(e),i(!0)},onNewClick:()=>{o(null),i(!0)},onConnectionDeleted:()=>{s.invalidateQueries({queryKey:W({path:{assistant_id:t}})})}}):null})}function Ct({connections:e,loading:t,isError:n,assistantId:r,onClose:i,onEditClick:a,onNewClick:o,onConnectionDeleted:c}){let[l,u]=(0,Z.useState)({}),[d,f]=(0,Z.useState)({});async function p(e){f(t=>({...t,[e]:!0})),u(t=>{let n={...t};return delete n[e],n});try{let{response:t}=await F({path:{assistant_id:r,name:e}});t?.ok||t?.status===404?c(e):t?.status===409?u(t=>({...t,[e]:`Connection is in use by one or more profiles. Remove those references first.`})):u(t=>({...t,[e]:`Failed to delete connection. Please try again.`}))}catch{u(t=>({...t,[e]:`Failed to delete connection. Please try again.`}))}finally{f(t=>{let n={...t};return delete n[e],n})}}return(0,Q.jsxs)(S.Content,{size:`md`,children:[(0,Q.jsxs)(S.Header,{children:[(0,Q.jsx)(S.Title,{children:`Provider Connections`}),(0,Q.jsx)(S.Description,{children:`Manage inference provider connections. Each connection binds a name to a provider and auth configuration.`})]}),(0,Q.jsx)(S.Body,{children:t?(0,Q.jsx)(`div`,{className:`space-y-2 py-2`,children:[1,2,3].map(e=>(0,Q.jsx)(`div`,{className:`h-10 animate-pulse rounded-lg bg-[var(--surface-active)]`},e))}):n?(0,Q.jsx)(m,{variant:`body-medium-default`,as:`p`,className:`py-4 text-center text-(--system-negative-strong)`,children:`Failed to load connections. Please try again.`}):e.length===0?(0,Q.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No connections yet. Create one to get started.`}):(0,Q.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>{let t=d[e.name]??!1,n=l[e.name],r=e.isManaged??!1;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg px-2 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(m,{variant:`body-medium-default`,as:`span`,className:`text-(--content-default)`,children:e.label??e.name}),r&&(0,Q.jsx)(v,{tone:`positive`,title:`Managed by Platform — auth is locked, but you can rename this connection.`,children:`Platform`})]}),(0,Q.jsxs)(m,{variant:`body-medium-lighter`,as:`p`,className:`mt-0.5 text-(--content-tertiary)`,children:[e.label?`${e.name} · `:``,ue[e.provider]??e.provider,` · `,xt(e.auth)]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:()=>a(e),children:`Edit`}),(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(le,{}),"aria-label":`Delete ${e.name}`,disabled:r||t,title:r?`Managed connections cannot be deleted`:void 0,onClick:()=>void p(e.name),tintColor:`var(--system-negative-strong)`})]})]}),n?(0,Q.jsx)(m,{variant:`body-small-default`,as:`p`,className:`px-2 pb-1 text-(--system-negative-strong)`,children:n}):null]},e.name)})})}),(0,Q.jsxs)(S.Footer,{className:`justify-between`,children:[(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:o,children:`+ New Connection`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:i,children:`Done`})]})]})}function wt(e){let[t,n]=(0,Z.useState)(void 0);return(0,Z.useEffect)(()=>{t!==void 0&&e===t.value&&n(void 0)},[e,t]),[t===void 0?e:t.value,(0,Z.useCallback)(e=>n(e===void 0?void 0:{value:e}),[])]}function Tt(){let e=et(),t=u(),{data:n}=d({...z({path:{assistant_id:e}}),staleTime:3e4}),r=n?.llm?.activeProfile??null,i=n?.llm?.callSites??{},{profiles:o,profileOrder:c}=ye(n?.llm,e),l=(0,Z.useMemo)(()=>Je(o,c),[o,c]),f=R({onSuccess:n=>{H(t,{path:{assistant_id:e}},n)}}),[p,g]=wt(r),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)(!1),w=J.use.queryComplexityRouting(),T=(0,Z.useMemo)(()=>Qe(he(l,[p]),w),[l,p,w]),E=Object.entries(i).filter(([e,t])=>e!==`mainAgent`&&(t?.profile!=null||t?.provider!=null||t?.model!=null)).length,D=E===1?`1 Override`:E>0?`${E} Overrides`:`Overrides`,O=p!==r,k=(0,Z.useCallback)(async()=>{try{await f.mutateAsync({path:{assistant_id:e},body:{llm:{activeProfile:p}}}),C.success(`Profile saved.`)}catch(e){C.error(`Failed to switch profile. Please try again.`),a(e,{context:`settings-ai-language-model-save`})}},[p,f,e]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(st,{title:`Language Model`,subtitle:`Configure the LLMs that power your assistant`,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Default Profile`}),(0,Q.jsx)(h,{value:p??``,onChange:e=>{g(e===``?null:e)},placeholder:`Select a default profile…`,options:T.map(e=>({value:e.name,label:e.name===`auto`?`Automatically switch between profiles`:Ce(e)}))}),w&&p===`auto`&&(0,Q.jsx)(`div`,{className:`flex items-center gap-2 rounded-lg bg-[var(--surface-warning-subtle)] px-3 py-2`,children:(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-warning)]`,children:`Auto may use more powerful models when needed, which can increase costs.`})}),T.length===0?(0,Q.jsx)(m,{variant:`body-small-default`,as:`p`,className:`mt-1 text-(--content-tertiary)`,children:`No profiles yet. Click Profiles below to create one.`}):null]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>S(!0),children:`Providers`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>v(!0),children:`Profiles`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>b(!0),children:D})]}),O&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)($,{onClick:k,disabled:f.isPending}),f.isPending&&(0,Q.jsx)(j,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]})}),e&&(0,Q.jsx)(vt,{isOpen:_,assistantId:e,onClose:()=>v(!1)}),e&&(0,Q.jsx)(mt,{isOpen:y,onClose:()=>b(!1),assistantId:e}),e&&(0,Q.jsx)(St,{isOpen:x,assistantId:e,onClose:()=>S(!1)})]})}var Et=`vellum:ai:imageGenMode`,Dt=`vellum:ai:imageGenModel`,Ot=`vellum:ai:webSearchMode`,kt=`vellum:ai:webSearchProvider`,At=`vellum:ai:emailMode`,jt=`vellum:ai:emailByoProvider`,Mt=`vellum:voice:ttsProvider`,Nt=`vellum:voice:ttsApiKey:`,Pt=`vellum:voice:ttsVoiceId:`,Ft=`vellum:voice:sttProvider`,It=`vellum:voice:sttApiKey:`;function Lt(){let e=et();return(0,Z.useCallback)(async(t,n)=>{try{let{data:r}=await P({path:{assistant_id:e},body:{value:n,type:`api_key`,name:t},throwOnError:!0});Y(r)}catch(e){throw e instanceof Error&&e.message===`No assistant found`?C.error(`Assistant not ready. Please try again.`):C.error(`Failed to save ${t} API key. Please try again.`),a(e,{context:`provision_provider_key`}),e}},[e])}function Rt(){let e=et(),i=u(),{data:o}=d({...z({path:{assistant_id:e}}),staleTime:3e4}),s=R({onSuccess:t=>{H(i,{path:{assistant_id:e}},t)}}),c=Lt(),{serverWebSearchMode:l,serverWebSearchProvider:f}=(0,Z.useMemo)(()=>{if(!o)return{serverWebSearchMode:X(n(Ot,`your-own`),`your-own`),serverWebSearchProvider:n(kt,`inference-provider-native`)};let e=o.services?.[`web-search`];return{serverWebSearchMode:X(e?.mode??n(`vellum:ai:webSearchMode`,`your-own`),`your-own`),serverWebSearchProvider:e?.provider||n(`vellum:ai:webSearchProvider`,`inference-provider-native`)}},[o]),[p,m]=(0,Z.useState)(!1),[g,_]=wt(l),[v,b]=wt(f),[x,S]=(0,Z.useState)(``),w=ae.has(v),{hasStoredCredential:T}=be({assistantId:e,credentialKind:`api_key`,credentialName:v,enabled:w}),E=x.trim().length>0,D=p||g===`your-own`&&w&&!T&&!E||!(g!==l||(g===`managed`?`inference-provider-native`:v)!==f)&&!E,O=Fe(re[v]??`Enter your API key`,T),k=(0,Z.useCallback)(async()=>{m(!0);let t=x.trim(),n=g===`managed`?`inference-provider-native`:v,o=_e(n),l=g===`your-own`&&w&&t.length>0;try{l&&await c(n,t),await s.mutateAsync({path:{assistant_id:e},body:{services:{"web-search":{mode:g,provider:n}}}}).catch(e=>{throw C.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e})}catch{m(!1);return}m(!1);try{if(r(Ot,g),r(kt,n),l){o&&r(o,t);let n=ke(e,`api_key`,v);i.setQueryData(n,!0),i.invalidateQueries({queryKey:n}),S(``)}C.success(`Web search settings saved.`)}catch(e){a(e,{context:`settings-ai-web-search-persist-local`}),C.error(`Saved, but local preferences could not be written.`)}},[w,s,c,i,e,x,g,v]),A=(0,Z.useCallback)(()=>{let e=_e(v);e&&t(e),S(``),b(`inference-provider-native`),r(kt,`inference-provider-native`)},[v,b]);return(0,Q.jsx)(at,{title:`Web Search`,subtitle:`Configure how your assistant should search the web`,mode:g,onModeChange:e=>_(e),children:g===`managed`?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Web search is included with managed inference.`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)($,{onClick:k,disabled:D}),p&&(0,Q.jsx)(j,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(h,{value:v,onChange:b,options:Ne.map(e=>({value:e,label:fe[e]??e}))})]}),w&&(0,Q.jsx)(y,{label:`API Key`,type:`password`,value:x,onChange:e=>S(e.target.value),placeholder:O,fullWidth:!0}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)($,{onClick:k,disabled:D}),p&&(0,Q.jsx)(j,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),w&&(0,Q.jsx)(ot,{onClick:A,filled:!0})]})]})})}var zt=[{id:`elevenlabs`,displayName:`ElevenLabs`,subtitle:`High-quality voice synthesis for conversations and read-aloud. Requires an ElevenLabs API key.`,supportsVoiceSelection:!0,apiKeyPlaceholder:`sk_…`,credentialsGuide:{description:`Sign in to ElevenLabs, go to your Profile, and copy your API key.`,url:`https://elevenlabs.io/app/settings/api-keys`,linkLabel:`Open ElevenLabs API Keys`}},{id:`fish-audio`,displayName:`Fish Audio`,subtitle:`Natural-sounding voice synthesis with custom voice cloning. Requires a Fish Audio API key and voice reference ID.`,supportsVoiceSelection:!0,apiKeyPlaceholder:`Enter your Fish Audio API key`,credentialsGuide:{description:`Sign in to Fish Audio, navigate to API Keys in your dashboard, and create a new key.`,url:`https://fish.audio/app/api-keys/`,linkLabel:`Open Fish Audio API Keys`}},{id:`deepgram`,displayName:`Deepgram`,subtitle:`Fast, accurate text-to-speech synthesis. Uses the same API key as Deepgram speech-to-text.`,supportsVoiceSelection:!1,apiKeyPlaceholder:`Enter your Deepgram API key`,credentialsGuide:{description:`Sign in to Deepgram, navigate to your API Keys page, and create or copy an existing key. This is the same key used for speech-to-text.`,url:`https://console.deepgram.com/`,linkLabel:`Open Deepgram Console`}},{id:`xai`,displayName:`xAI`,subtitle:`Text-to-speech from xAI with expressive voices (eve, ara, rex, sal, leo). Requires an xAI API key.`,supportsVoiceSelection:!1,apiKeyPlaceholder:`Enter your xAI API key`,credentialsGuide:{description:`Sign in to the xAI console, navigate to API Keys, and create a new key.`,url:`https://console.x.ai/`,linkLabel:`Open xAI Console`}}],Bt=[{id:`deepgram`,displayName:`Deepgram`,subtitle:`Fast, accurate speech-to-text transcription. Uses the same API key as Deepgram text-to-speech.`,apiKeyPlaceholder:`Enter your Deepgram API key`,credentialsGuide:{description:`Sign in to Deepgram, navigate to your API Keys page, and create or copy an existing key. This is the same key used for text-to-speech.`,url:`https://console.deepgram.com/`,linkLabel:`Open Deepgram Console`}},{id:`openai`,displayName:`OpenAI`,subtitle:`OpenAI Whisper transcription. Requires an OpenAI API key.`,apiKeyPlaceholder:`sk-…`,credentialsGuide:{description:`Sign in to the OpenAI platform, navigate to API Keys, and create a new secret key.`,url:`https://platform.openai.com/api-keys`,linkLabel:`Open OpenAI API Keys`}},{id:`macos-native`,displayName:`macOS Native Dictation`,subtitle:`Apple's on-device speech recognition, running locally through the macOS helper. Works offline and needs no API key.`,requiresNativeDictation:!0,setupWarning:`Requires macOS Dictation to be turned on: open System Settings → Keyboard, then enable Dictation. macOS downloads the on-device speech model the first time Dictation is enabled — without it, voice input produces no transcript.`}],Vt=[{id:`mailgun`,displayName:`Mailgun`,setupSkill:`mailgun-setup`,docsUrl:`https://www.mailgun.com/`},{id:`resend`,displayName:`Resend`,setupSkill:`resend-setup`,docsUrl:`https://resend.com/`}],Ht=[`gemini-3.1-flash-image-preview`,`gemini-3-pro-image-preview`],Ut={"gemini-3.1-flash-image-preview":`Nano Banana 2`,"gemini-3-pro-image-preview":`Nano Banana Pro`};function Wt({assistantId:e,assistantHandle:t,emailRootDomain:n}){let r=u(),i=c(),[o,p]=l(),[m,h]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null),[S,w]=(0,Z.useState)(``),[T,E]=(0,Z.useState)(null),[k,A]=(0,Z.useState)(!1),[M,N]=(0,Z.useState)(!1),[P,F]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{v||!t||m||(h(t),y(!0))},[t,v,m]);let I=d({...Ee(),enabled:!0}),L=I.data,R=L?.entitlements,ee=R?.managed_email===!0,z=!!R&&!ee,te=!L&&I.isError&&!I.isFetching,B=d({...qe({path:{assistant_id:e}}),enabled:!z}),V=d({...ie({path:{assistant_id:e}}),enabled:!z}),H=B.data?.results?.[0],U=V.data?.results?.[0],W=H?`${H.subdomain}.${n}`:null,K=d({...ve({path:{assistant_id:e,id:U?.id??``}}),enabled:!!U?.id,refetchOnWindowFocus:!1}),q=d({...we({path:{assistant_id:e,id:H?.id??``}}),enabled:!!H?.id,refetchInterval:e=>{let t=e.state.data?.status;return t===`verified`||t===`failed`?!1:1e4},refetchOnWindowFocus:!0});(0,Z.useEffect)(()=>{o.get(`release`)!==`1`||!H||U||(N(!0),p(e=>{let t=new URLSearchParams(e);return t.delete(`release`),t},{replace:!0}))},[U,H,o,p]);let J=f(Ae()),re=f(xe()),Y=f(Ze()),ae=f(ge()),X=(0,Z.useCallback)(()=>{let t={assistant_id:e};r.invalidateQueries({queryKey:$e({path:t})}),r.invalidateQueries({queryKey:Ye({path:t})}),U?.id&&r.invalidateQueries({queryKey:oe({path:{...t,id:U.id}})}),r.invalidateQueries({queryKey:Pe()})},[U?.id,e,r]),se=(0,Z.useCallback)(async()=>{let t=m.trim().toLowerCase();if(!t){x(`Enter a subdomain.`);return}A(!1);try{await J.mutateAsync({path:{assistant_id:e},body:{subdomain:t}}),h(``),x(null),X(),C.success(`Domain ${t}.${n} registered.`)}catch(e){x(G(e,void 0,`Failed to register domain.`))}},[e,n,X,J,m]),ce=(0,Z.useCallback)(async()=>{let t=S.trim().toLowerCase();if(!t){E(`Enter an email username.`);return}try{await Y.mutateAsync({path:{assistant_id:e},body:{username:t}}),w(``),E(null),X(),C.success(`Email address created.`)}catch(e){E(G(e,void 0,`Failed to create email address.`))}},[e,X,Y,S]),ue=(0,Z.useCallback)(async()=>{if(U?.id){F(!1);try{await ae.mutateAsync({path:{assistant_id:e,id:U.id}}),X(),C.success(`Email address removed.`)}catch(e){a(e,{context:`email_address_delete`}),C.error(`Failed to remove email address.`)}}},[U?.id,e,ae,X]),de=(0,Z.useCallback)(async()=>{if(!H?.id)return;if(U){C.error(`Remove the email address first.`);return}N(!1);let t=H.subdomain;try{await re.mutateAsync({path:{assistant_id:e,id:H.id}}),h(t),X(),C.success(`Domain released.`)}catch(e){a(e,{context:`email_domain_release`}),C.error(`Failed to release domain.`)}},[U,e,re,H?.id,H?.subdomain,X]);if(I.isLoading)return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(j,{className:`h-4 w-4 animate-spin`}),`Checking subscription…`]});if(z)return(0,Q.jsxs)(_,{tone:`info`,icon:(0,Q.jsx)(D,{className:`h-4 w-4`,"aria-hidden":!0}),title:`Get a dedicated email address for your assistant`,actions:(0,Q.jsx)(s,{size:`compact`,onClick:()=>i(`${ne.settings.billing}?adjust_plan`),children:`Upgrade to Pro`}),children:[`Pro plans include a managed`,` `,`<your-subdomain>.${n}`,` inbox — no provider setup required. Or switch to `,(0,Q.jsx)(`strong`,{children:`Your Own`}),` to bring an existing provider.`]});let fe=te?(0,Q.jsx)(_,{tone:`warning`,title:`Couldn't verify subscription status`,actions:(0,Q.jsx)(s,{size:`compact`,variant:`outlined`,onClick:()=>I.refetch(),children:`Retry`}),children:`We couldn't reach the billing service. The form below assumes managed email is enabled for your org — if it isn't, registering a domain will fail.`}):null;return H?U?(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[fe,(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Address`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:U.address}),(0,Q.jsx)(lt,{status:q.data?.status,message:q.data?.message,isLoading:q.isLoading}),(0,Q.jsx)(s,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(le,{}),onClick:()=>F(!0),disabled:ae.isPending,"aria-label":`Remove email address`})]}),(0,Q.jsx)(g,{open:P,title:`Remove Email Address`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to remove `,(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:U.address}),`? Your assistant will no longer be able to send or receive email at this address.`]}),confirmLabel:`Remove`,destructive:!0,onConfirm:ue,onCancel:()=>F(!1)})]}),K.data?.usage&&(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[K.data.usage.sent_today,` /`,` `,K.data.usage.daily_limit,` sent today ·`,` `,K.data.usage.received_today,` received`]})]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[fe,(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Domain`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:[H.subdomain,`.`,n]}),(0,Q.jsx)(lt,{status:q.data?.status,message:q.data?.message,isLoading:q.isLoading}),(0,Q.jsx)(s,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(le,{}),onClick:()=>N(!0),disabled:re.isPending,"aria-label":`Release domain`})]}),(0,Q.jsx)(g,{open:M,title:`Release Domain`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to release `,(0,Q.jsxs)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:[H.subdomain,`.`,n]}),`? The subdomain will become available for others to claim.`]}),confirmLabel:`Release`,destructive:!0,onConfirm:de,onCancel:()=>N(!1)})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Email address`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex h-9 min-w-0 flex-1 items-center rounded-md border bg-[var(--field-bg)] text-body-medium-lighter transition-[border-color] duration-150 ${T?`border-[var(--system-negative-strong)]`:`border-[var(--field-border)] focus-within:border-[var(--border-active)]`}`,children:[(0,Q.jsx)(`input`,{value:S,onChange:e=>{w(e.target.value.toLowerCase()),T&&E(null)},placeholder:`hi`,"aria-label":`Email username`,"aria-invalid":!!T,className:`h-full min-w-0 flex-1 bg-transparent pl-3 pr-1 text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,Q.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`@`,W]})]}),(0,Q.jsx)(s,{onClick:ce,disabled:Y.isPending||!S.trim(),children:Y.isPending?`Creating…`:`Create`})]}),T&&(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:T})]})]}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[fe,(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Subdomain`}),(0,Q.jsx)(O,{subdomain:m,onSubdomainChange:e=>{h(e),b&&x(null)},domainSuffix:n,subdomainPlaceholder:`my-assistant`,error:b}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Each assistant gets its own subdomain. Lowercase letters, numbers, and hyphens only.`}),(0,Q.jsx)(s,{onClick:()=>A(!0),disabled:J.isPending||!m.trim(),children:J.isPending?`Registering…`:`Register`}),(0,Q.jsx)(g,{open:k,title:`Set Subdomain`,message:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:m.trim().toLowerCase()||`subdomain`}),` will also become your assistant's public handle. You won't be able to change it once set.`]}),confirmLabel:`Confirm`,onConfirm:se,onCancel:()=>A(!1)})]})}function Gt(){let e=et(),t=K(),{data:o}=d({...pe(),enabled:t}),s=o?.results?.[0]?.handle,c=nt.use.emailRootDomain(),l=ce(),[u,f]=(0,Z.useState)(()=>l===`gated`?`your-own`:X(n(At,`managed`),`managed`)),[p,m]=(0,Z.useState)(()=>{let e=n(jt,`resend`);return e===`mailgun`||e===`resend`?e:`resend`}),g=d({queryKey:[`byoEmailCredential`,e,p],queryFn:async()=>{let{data:t}=await L({path:{assistant_id:e},body:{service:p,field:`api_key`},throwOnError:!0});return t},enabled:u===`your-own`||l===`gated`,staleTime:6e4,retry:i,meta:{errorContext:`byo_email_credential_check`}});(0,Z.useEffect)(()=>{g.error&&a(g.error,{context:`byo_email_credential_check`,bestEffort:!0})},[g.error]);let _=g.data?.hasSecret===!0,v=(0,Z.useCallback)(e=>{f(e),r(At,e)},[]),y=(0,Z.useCallback)(()=>{r(jt,p),C.success(`Email settings saved.`)},[p]),b=(0,Z.useMemo)(()=>Vt.find(e=>e.id===p)??Vt[0],[p]),x=(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(A,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsxs)(`span`,{children:[`Configure `,b.displayName,` via the assistant CLI: ask the assistant to run the`,` `,(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:b.setupSkill}),` `,`skill. It walks you through storing the API key, detecting the domain, and (optionally) wiring up an inbound webhook.`]}),(0,Q.jsxs)(`a`,{href:b.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,b.displayName,(0,Q.jsx)(k,{className:`h-3 w-3`})]})]})]}),S=(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(h,{value:p,onChange:e=>{(e===`mailgun`||e===`resend`)&&m(e)},options:Vt.map(e=>({value:e.id,label:e.displayName}))})]}),_?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--system-positive-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-default)]`,children:[(0,Q.jsx)(E,{className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,Q.jsxs)(`span`,{children:[b.displayName,` API key configured. To reconfigure, run the`,` `,(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:b.setupSkill}),` `,`skill.`]})]}),(0,Q.jsxs)(`a`,{href:b.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-body-small-default text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,b.displayName,(0,Q.jsx)(k,{className:`h-3 w-3`})]})]}):x,(0,Q.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Q.jsx)($,{onClick:y,disabled:!1})})]});return l===`gated`?(0,Q.jsx)(st,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,children:S}):(0,Q.jsx)(at,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,mode:u,onModeChange:v,children:u===`managed`?(0,Q.jsx)(`div`,{className:`space-y-4`,children:l===`disabled`?(0,Q.jsx)(Ge,{children:`Log in to the Vellum platform to manage email settings.`}):(0,Q.jsx)(Wt,{assistantId:e,assistantHandle:s,emailRootDomain:c})}):S})}function Kt(){let e=et(),t=u(),{data:i}=d({...z({path:{assistant_id:e}}),staleTime:3e4}),o=R({onSuccess:n=>{H(t,{path:{assistant_id:e}},n)}}),s=Lt(),[c,l]=wt((0,Z.useMemo)(()=>X(i?i.services?.[`image-generation`]?.mode??n(`vellum:ai:imageGenMode`,`your-own`):n(Et,`your-own`),`your-own`),[i])),[f,p]=(0,Z.useState)(()=>n(Dt,`gemini-3.1-flash-image-preview`)),[m,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(!1),b=(0,Z.useCallback)(async()=>{v(!0);let n=m.trim(),i=c===`your-own`&&n.length>0;try{i&&await s(`gemini`,n),await o.mutateAsync({path:{assistant_id:e},body:{services:{"image-generation":{mode:c}}}}).catch(e=>{throw C.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e});try{await I({path:{assistant_id:e},body:{modelId:f},throwOnError:!0})}catch(e){throw C.error(`Failed to update image generation model. Please try again.`),a(e,{context:`set_image_gen_model`}),e}finally{t.invalidateQueries({queryKey:B({path:{assistant_id:e}})})}}catch{v(!1);return}v(!1);try{r(Et,c),r(Dt,f),i&&g(``),C.success(`Image generation settings saved.`)}catch(e){a(e,{context:`settings-ai-image-gen-persist-local`}),C.error(`Saved, but local preferences could not be written.`)}},[m,c,f,e,o,s,t]),x=(0,Z.useCallback)(()=>{g(``),p(`gemini-3.1-flash-image-preview`),r(Dt,`gemini-3.1-flash-image-preview`)},[]);return(0,Q.jsx)(at,{title:`Image Generation`,subtitle:`Configure which model your assistant uses to generate images`,mode:c,onModeChange:e=>l(e),children:c===`managed`?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,Q.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,Q.jsx)(h,{className:`flex-1`,value:f,onChange:p,options:Ht.map(e=>({value:e,label:Ut[e]??e}))}),(0,Q.jsx)($,{onClick:b,disabled:_}),_&&(0,Q.jsx)(j,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(y,{label:`API Key`,type:`password`,value:m,onChange:e=>g(e.target.value),placeholder:`Enter your Gemini API key`,fullWidth:!0}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,Q.jsx)(h,{value:f,onChange:p,options:Ht.map(e=>({value:e,label:Ut[e]??e}))})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)($,{onClick:b,disabled:_}),_&&(0,Q.jsx)(j,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),(0,Q.jsx)(ot,{onClick:x})]})]})})}async function qt(e){let{provider:t,apiKey:n,voiceId:r,text:i}=e;if(n.trim().length===0)return{kind:`error`,message:`Save an API key for this provider first.`};try{return t===`elevenlabs`?await Jt(n,r,i):t===`deepgram`?await Yt(n,i):t===`fish-audio`?{kind:`unsupported`,message:`Fish Audio TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:t===`xai`?{kind:`unsupported`,message:`xAI TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:{kind:`unsupported`,message:`TTS testing for "${t}" is not supported from the browser yet.`}}catch(e){return{kind:`error`,message:e instanceof Error?e.message:`Failed to reach the TTS provider.`}}}async function Jt(e,t,n){let r=t.trim();if(r.length===0)return{kind:`error`,message:`Enter and save a Voice ID before testing ElevenLabs.`};let i=await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${encodeURIComponent(r)}?output_format=mp3_44100_128`,{method:`POST`,headers:{"xi-api-key":e,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:n,model_id:`eleven_turbo_v2_5`})});return i.ok?{kind:`audio`,blob:await i.blob()}:{kind:`error`,message:await Xt(i,`ElevenLabs rejected the request.`)}}async function Yt(e,t){let n=await fetch(`https://api.deepgram.com/v1/speak?model=aura-2-thalia-en`,{method:`POST`,headers:{Authorization:`Token ${e}`,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:t})});return n.ok?{kind:`audio`,blob:await n.blob()}:{kind:`error`,message:await Xt(n,`Deepgram rejected the request.`)}}async function Xt(e,t){try{let n=await e.text();if(n.length===0)return`${t} (HTTP ${e.status})`;try{let e=JSON.parse(n);if(e&&typeof e==`object`&&`detail`in e&&typeof e.detail==`string`)return e.detail;if(e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`)return e.message}catch{}return n.slice(0,200)}catch{return`${t} (HTTP ${e.status})`}}function Zt(){let e=et(),t=q.use.name()??`your assistant`,i=K(),{data:a}=d({...U({path:{assistant_id:e}}),enabled:i,staleTime:1/0}),o=a?.providers??zt,c=o[0]?.id??`elevenlabs`,[l,u]=(0,Z.useState)(()=>n(Mt,c)),[f,p]=(0,Z.useState)(l),[m,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(``),[b,x]=(0,Z.useState)(``),[S,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(!1),D=(0,Z.useMemo)(()=>o.find(e=>e.id===l)??o[0],[l,o]),O=(0,Z.useCallback)(e=>{let t=n(Nt+e,``),r=n(Pt+e,``);w(t.length>0),v(r),x(r),g(``)},[]);(0,Z.useEffect)(()=>{O(l)},[l,O]);let k=(0,Z.useMemo)(()=>{let e=l!==f,t=m.trim().length>0,n=_.trim()!==b;return e||t||n},[l,f,m,_,b]),A=(0,Z.useCallback)(()=>{r(Mt,l);let e=m.trim();e.length>0&&(r(Nt+l,e),w(!0));let t=_.trim();r(Pt+l,t),p(l),x(t),g(``)},[l,m,_]),j=(0,Z.useCallback)(()=>{r(Nt+l,``),w(!1),g(``)},[l]),M=(0,Z.useCallback)(async()=>{E(!0);try{let e=n(Nt+l,``),r=m.trim(),i=r.length>0?r:e;if(i.length===0){C.error(`Save an API key for this provider before testing.`);return}let a=n(Pt+l,``),o=_.trim(),s=await qt({provider:l,apiKey:i,voiceId:o.length>0?o:a,text:`Hey! It's ${t}. How does this sound?`});if(s.kind!==`audio`){C.error(s.message);return}let c=URL.createObjectURL(s.blob);try{let e=new Audio(c);await e.play(),await new Promise(t=>{e.onended=()=>t(),e.onerror=()=>t()})}finally{URL.revokeObjectURL(c)}}finally{E(!1)}},[t,m,l,_]),N=S?`•••••••• (Enter a new key to replace)`:D.apiKeyPlaceholder;return(0,Q.jsx)(st,{title:`Text-to-Speech`,subtitle:D.subtitle,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(h,{value:l,onChange:u,options:o.map(e=>({value:e.id,label:e.displayName})),"aria-label":`TTS provider`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Q.jsx)(y,{type:`password`,value:m,onChange:e=>g(e.target.value),placeholder:N,fullWidth:!0})]}),D.supportsVoiceSelection&&(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice ID`}),(0,Q.jsx)(y,{type:`text`,value:_,onChange:e=>v(e.target.value),placeholder:`Enter a voice ID`,fullWidth:!0})]}),(0,Q.jsx)(ct,{guide:D.credentialsGuide}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(s,{variant:`outlined`,onClick:M,disabled:T,children:T?`Testing…`:`Test`}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Q.jsx)($,{onClick:A,disabled:!k}),S&&(0,Q.jsx)(ot,{onClick:j})]})]})]})})}function Qt(){let[e]=(0,Z.useState)(()=>Bt.filter(e=>!e.requiresNativeDictation||Be())),t=e[0]?.id??`deepgram`,[i,a]=(0,Z.useState)(()=>{let r=n(Ft,t);return e.some(e=>e.id===r)?r:t}),[o,s]=(0,Z.useState)(i),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{let i=n(Ft,t);i===`macos-native`&&!e.some(e=>e.id===i)&&r(Ft,t)},[e,t]);let f=(0,Z.useMemo)(()=>e.find(e=>e.id===i)??e[0],[e,i]),p=f.apiKeyPlaceholder!==void 0;(0,Z.useEffect)(()=>{d(n(It+i,``).length>0),l(``)},[i]);let m=(0,Z.useMemo)(()=>{let e=i!==o,t=c.trim().length>0;return e||t},[i,o,c]),g=(0,Z.useCallback)(()=>{r(Ft,i);let e=c.trim();e.length>0&&(r(It+i,e),d(!0)),s(i),l(``)},[i,c]),_=(0,Z.useCallback)(()=>{r(It+i,``),d(!1),l(``)},[i]),v=u?`•••••••• (Enter a new key to replace)`:f.apiKeyPlaceholder;return(0,Q.jsx)(st,{title:`Speech-to-Text`,subtitle:f.subtitle,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(h,{value:i,onChange:a,options:e.map(e=>({value:e.id,label:e.displayName})),"aria-label":`STT provider`})]}),p&&(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Q.jsx)(y,{type:`password`,value:c,onChange:e=>l(e.target.value),placeholder:v,fullWidth:!0})]}),f.setupWarning&&(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(M,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-mid-strong)]`}),(0,Q.jsx)(`span`,{children:f.setupWarning})]}),f.credentialsGuide&&(0,Q.jsx)(ct,{guide:f.credentialsGuide}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,Q.jsx)($,{onClick:g,disabled:!m}),u&&(0,Q.jsx)(ot,{onClick:_})]})]})})}function $t(){return(0,Z.useEffect)(()=>{let e=window.location.hash.slice(1);e&&requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({block:`start`})})},[]),(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-4 py-2.5`,children:[(0,Q.jsx)(A,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsxs)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:[`Managed services are metered and deducted from your Vellum account balance.`,` `,(0,Q.jsxs)(`a`,{href:`https://www.vellum.ai/docs/pricing`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--primary-base)] hover:underline`,children:[`View pricing`,(0,Q.jsx)(k,{className:`h-3.5 w-3.5`})]})]})]}),(0,Q.jsx)(Tt,{}),(0,Q.jsx)(Rt,{}),(0,Q.jsx)(Gt,{}),(0,Q.jsx)(Kt,{}),(0,Q.jsx)(Zt,{}),(0,Q.jsx)(Qt,{})]})}export{$t as AiPage};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-jRWAZmH_.js";import{I as t,k as n,s as r}from"./local-mode-Bvz5B1q8.js";import{_ as i,at as a,g as o,h as s,it as c,yt as l}from"./sdk.gen-ZXouuy0U.js";import{i as u,n as d}from"./api-errors-DbHkbHFH.js";import{C as f,I as p,L as ee,R as te,a as ne,i as re,o as ie,w as ae}from"./sdk.gen-DlgJKwWW.js";Object.freeze({status:`aborted`});function m(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 h=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},oe=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},se={};function g(e){return e&&Object.assign(se,e),se}function ce(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 le(e,t){return typeof t==`bigint`?t.toString():t}function _(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function ue(e){return e==null}function de(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function fe(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 pe=Symbol(`evaluating`);function v(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==pe)return r===void 0&&(r=pe,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function y(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function b(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function me(e){return JSON.stringify(e)}function he(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ge=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var _e=_(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function S(e){if(x(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(x(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ve(e){return S(e)?{...e}:Array.isArray(e)?[...e]:e}var ye=new Set([`string`,`number`,`symbol`]);function C(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function w(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function T(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 be(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var xe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Se(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 w(e,b(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 y(this,`shape`,e),e},checks:[]}))}function Ce(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 w(e,b(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 y(this,`shape`,r),r},checks:[]}))}function we(e,t){if(!S(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 w(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return y(this,`shape`,n),n}}))}function Te(e,t){if(!S(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return w(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return y(this,`shape`,n),n}}))}function Ee(e,t){return w(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return y(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function De(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 w(t,b(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 y(this,`shape`,i),i},checks:[]}))}function Oe(e,t,n){return w(t,b(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 y(this,`shape`,i),i}}))}function E(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 D(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function O(e){return typeof e==`string`?e:e?.message}function k(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=O(e.inst?._zod.def?.error?.(e))??O(t?.error?.(e))??O(n.customError?.(e))??O(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ke(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function A(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ae=(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,le,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},je=m(`$ZodError`,Ae),Me=m(`$ZodError`,Ae,{Parent:Error});function Ne(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 Pe(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}var Fe=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 h;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>k(e,a,g())));throw ge(t,i?.callee),t}return o.value},Ie=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=>k(e,a,g())));throw ge(t,i?.callee),t}return o.value},Le=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 h;return a.issues.length?{success:!1,error:new(e??je)(a.issues.map(e=>k(e,i,g())))}:{success:!0,data:a.value}},Re=Le(Me),ze=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=>k(e,i,g())))}:{success:!0,data:a.value}},Be=ze(Me),Ve=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Fe(e)(t,n,i)},He=e=>(t,n,r)=>Fe(e)(t,n,r),Ue=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ie(e)(t,n,i)},We=e=>async(t,n,r)=>Ie(e)(t,n,r),Ge=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Le(e)(t,n,i)},Ke=e=>(t,n,r)=>Le(e)(t,n,r),qe=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ze(e)(t,n,i)},Je=e=>async(t,n,r)=>ze(e)(t,n,r),Ye=/^[cC][^\s-]{8,}$/,Xe=/^[0-9a-z]+$/,Ze=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qe=/^[0-9a-vA-V]{20}$/,$e=/^[A-Za-z0-9]{27}$/,et=/^[a-zA-Z0-9_-]{21}$/,tt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nt=/^([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})$/,rt=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)$/,it=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,at=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function ot(){return new RegExp(at,`u`)}var st=/^(?:(?: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])$/,ct=/^(([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}|:))$/,lt=/^((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])$/,ut=/^(([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])$/,dt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ft=/^[A-Za-z0-9_-]*$/,pt=/^\+[1-9]\d{6,14}$/,mt=`(?:(?:\\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])))`,ht=RegExp(`^${mt}$`);function gt(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 _t(e){return RegExp(`^${gt(e)}$`)}function vt(e){let t=gt({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(`^${mt}T(?:${r})$`)}var yt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},bt=/^-?\d+$/,xt=/^-?\d+(?:\.\d+)?$/,St=/^(?:true|false)$/i,Ct=/^null$/i,wt=/^[^A-Z]*$/,Tt=/^[^a-z]*$/,j=m(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Et={number:`number`,bigint:`bigint`,object:`date`},Dt=m(`$ZodCheckLessThan`,(e,t)=>{j.init(e,t);let n=Et[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})}}),Ot=m(`$ZodCheckGreaterThan`,(e,t)=>{j.init(e,t);let n=Et[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})}}),kt=m(`$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):fe(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})}}),At=m(`$ZodCheckNumberFormat`,(e,t)=>{j.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xe[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=bt)}),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})}}),jt=m(`$ZodCheckMaxLength`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ue(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=ke(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Mt=m(`$ZodCheckMinLength`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ue(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=ke(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Nt=m(`$ZodCheckLengthEquals`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ue(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=ke(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})}}),Pt=m(`$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=()=>{})}),Ft=m(`$ZodCheckRegex`,(e,t)=>{Pt.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})}}),It=m(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=wt,Pt.init(e,t)}),Lt=m(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Tt,Pt.init(e,t)}),Rt=m(`$ZodCheckIncludes`,(e,t)=>{j.init(e,t);let n=C(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})}}),zt=m(`$ZodCheckStartsWith`,(e,t)=>{j.init(e,t);let n=RegExp(`^${C(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})}}),Bt=m(`$ZodCheckEndsWith`,(e,t)=>{j.init(e,t);let n=RegExp(`.*${C(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})}}),Vt=m(`$ZodCheckOverwrite`,(e,t)=>{j.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Ht=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(`
|
|
2
|
-
`).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(`
|
|
3
|
-
`))}},Ut={major:4,minor:3,patch:6},M=m(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ut;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=E(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 h;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=E(e,t))});else{if(e.issues.length===t)continue;r||=E(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(E(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new h;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 h;return o.then(e=>t(e,r,a))}return t(o,r,a)}}v(e,`~standard`,()=>({validate:t=>{try{let n=Re(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Be(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Wt=m(`$ZodString`,(e,t)=>{M.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??yt(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}}),N=m(`$ZodStringFormat`,(e,t)=>{Pt.init(e,t),Wt.init(e,t)}),Gt=m(`$ZodGUID`,(e,t)=>{t.pattern??=nt,N.init(e,t)}),Kt=m(`$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??=rt(e)}else t.pattern??=rt();N.init(e,t)}),qt=m(`$ZodEmail`,(e,t)=>{t.pattern??=it,N.init(e,t)}),Jt=m(`$ZodURL`,(e,t)=>{N.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})}}}),Yt=m(`$ZodEmoji`,(e,t)=>{t.pattern??=ot(),N.init(e,t)}),Xt=m(`$ZodNanoID`,(e,t)=>{t.pattern??=et,N.init(e,t)}),Zt=m(`$ZodCUID`,(e,t)=>{t.pattern??=Ye,N.init(e,t)}),Qt=m(`$ZodCUID2`,(e,t)=>{t.pattern??=Xe,N.init(e,t)}),$t=m(`$ZodULID`,(e,t)=>{t.pattern??=Ze,N.init(e,t)}),en=m(`$ZodXID`,(e,t)=>{t.pattern??=Qe,N.init(e,t)}),tn=m(`$ZodKSUID`,(e,t)=>{t.pattern??=$e,N.init(e,t)}),nn=m(`$ZodISODateTime`,(e,t)=>{t.pattern??=vt(t),N.init(e,t)}),rn=m(`$ZodISODate`,(e,t)=>{t.pattern??=ht,N.init(e,t)}),an=m(`$ZodISOTime`,(e,t)=>{t.pattern??=_t(t),N.init(e,t)}),on=m(`$ZodISODuration`,(e,t)=>{t.pattern??=tt,N.init(e,t)}),sn=m(`$ZodIPv4`,(e,t)=>{t.pattern??=st,N.init(e,t),e._zod.bag.format=`ipv4`}),cn=m(`$ZodIPv6`,(e,t)=>{t.pattern??=ct,N.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})}}}),ln=m(`$ZodCIDRv4`,(e,t)=>{t.pattern??=lt,N.init(e,t)}),un=m(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ut,N.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 dn(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var fn=m(`$ZodBase64`,(e,t)=>{t.pattern??=dt,N.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{dn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function pn(e){if(!ft.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return dn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var mn=m(`$ZodBase64URL`,(e,t)=>{t.pattern??=ft,N.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{pn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),hn=m(`$ZodE164`,(e,t)=>{t.pattern??=pt,N.init(e,t)});function gn(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 _n=m(`$ZodJWT`,(e,t)=>{N.init(e,t),e._zod.check=n=>{gn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),vn=m(`$ZodNumber`,(e,t)=>{M.init(e,t),e._zod.pattern=e._zod.bag.pattern??xt,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}}),yn=m(`$ZodNumberFormat`,(e,t)=>{At.init(e,t),vn.init(e,t)}),bn=m(`$ZodBoolean`,(e,t)=>{M.init(e,t),e._zod.pattern=St,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}}),xn=m(`$ZodNull`,(e,t)=>{M.init(e,t),e._zod.pattern=Ct,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Sn=m(`$ZodUnknown`,(e,t)=>{M.init(e,t),e._zod.parse=e=>e}),Cn=m(`$ZodNever`,(e,t)=>{M.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function wn(e,t,n){e.issues.length&&t.issues.push(...D(n,e.issues)),t.value[n]=e.value}var Tn=m(`$ZodArray`,(e,t)=>{M.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=>wn(t,n,e))):wn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function P(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...D(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function En(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=be(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Dn(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=>P(e,n,i,t,u))):P(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 On=m(`$ZodObject`,(e,t)=>{if(M.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=_(()=>En(t));v(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=x,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=>P(n,t,e,s,r))):P(i,t,e,s,r)}return i?Dn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),kn=m(`$ZodObjectJIT`,(e,t)=>{On.init(e,t);let n=e._zod.parse,r=_(()=>En(t)),i=e=>{let t=new Ht([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=me(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=me(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
4
|
-
if (${n}.issues.length) {
|
|
5
|
-
if (${o} in input) {
|
|
6
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
7
|
-
...iss,
|
|
8
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
9
|
-
})));
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (${n}.value === undefined) {
|
|
14
|
-
if (${o} in input) {
|
|
15
|
-
newResult[${o}] = undefined;
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
newResult[${o}] = ${n}.value;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
`):t.write(`
|
|
22
|
-
if (${n}.issues.length) {
|
|
23
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
24
|
-
...iss,
|
|
25
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
26
|
-
})));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (${n}.value === undefined) {
|
|
30
|
-
if (${o} in input) {
|
|
31
|
-
newResult[${o}] = undefined;
|
|
32
|
-
}
|
|
33
|
-
} else {
|
|
34
|
-
newResult[${o}] = ${n}.value;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=x,s=!se.jitless,c=s&&_e.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Dn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function An(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!E(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>k(e,r,g())))}),t)}var jn=m(`$ZodUnion`,(e,t)=>{M.init(e,t),v(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),v(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),v(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),v(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>de(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>An(t,i,e,a)):An(s,i,e,a)}}),Mn=m(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,jn.init(e,t);let n=e._zod.parse;v(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=_(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!x(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Nn=m(`$ZodIntersection`,(e,t)=>{M.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Fn(e,t,n)):Fn(e,i,a)}});function Pn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(S(e)&&S(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Pn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Pn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Fn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),E(e))return e;let o=Pn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var In=m(`$ZodRecord`,(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!S(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...D(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...D(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&xt.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>k(e,r,g())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...D(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...D(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Ln=m(`$ZodEnum`,(e,t)=>{M.init(e,t);let n=ce(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ye.has(typeof e)).map(e=>typeof e==`string`?C(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Rn=m(`$ZodLiteral`,(e,t)=>{if(M.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?C(e):e?C(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),zn=m(`$ZodTransform`,(e,t)=>{M.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new oe(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new h;return n.value=i,n}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Vn=m(`$ZodOptional`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,v(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),v(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${de(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Bn(t,e.value)):Bn(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Hn=m(`$ZodExactOptional`,(e,t)=>{Vn.init(e,t),v(e._zod,`values`,()=>t.innerType._zod.values),v(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Un=m(`$ZodNullable`,(e,t)=>{M.init(e,t),v(e._zod,`optin`,()=>t.innerType._zod.optin),v(e._zod,`optout`,()=>t.innerType._zod.optout),v(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${de(e.source)}|null)$`):void 0}),v(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Wn=m(`$ZodDefault`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,v(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Gn(e,t)):Gn(r,t)}});function Gn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Kn=m(`$ZodPrefault`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,v(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),qn=m(`$ZodNonOptional`,(e,t)=>{M.init(e,t),v(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Jn(t,e)):Jn(i,e)}});function Jn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Yn=m(`$ZodCatch`,(e,t)=>{M.init(e,t),v(e._zod,`optin`,()=>t.innerType._zod.optin),v(e._zod,`optout`,()=>t.innerType._zod.optout),v(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>k(e,n,g()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>k(e,n,g()))},input:e.value}),e.issues=[]),e)}}),Xn=m(`$ZodPipe`,(e,t)=>{M.init(e,t),v(e._zod,`values`,()=>t.in._zod.values),v(e._zod,`optin`,()=>t.in._zod.optin),v(e._zod,`optout`,()=>t.out._zod.optout),v(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>F(e,t.in,n)):F(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>F(e,t.out,n)):F(r,t.out,n)}});function F(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Zn=m(`$ZodReadonly`,(e,t)=>{M.init(e,t),v(e._zod,`propValues`,()=>t.innerType._zod.propValues),v(e._zod,`values`,()=>t.innerType._zod.values),v(e._zod,`optin`,()=>t.innerType?._zod?.optin),v(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Qn):Qn(r)}});function Qn(e){return e.value=Object.freeze(e.value),e}var $n=m(`$ZodCustom`,(e,t)=>{j.init(e,t),M.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>er(t,n,r,e));er(i,n,r,e)}});function er(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(A(e))}}var tr,nr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function rr(){return new nr}(tr=globalThis).__zod_globalRegistry??(tr.__zod_globalRegistry=rr());var I=globalThis.__zod_globalRegistry;function ir(e,t){return new e({type:`string`,...T(t)})}function ar(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...T(t)})}function or(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...T(t)})}function sr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...T(t)})}function cr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...T(t)})}function lr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...T(t)})}function ur(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...T(t)})}function dr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...T(t)})}function fr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...T(t)})}function pr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...T(t)})}function mr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...T(t)})}function hr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...T(t)})}function gr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...T(t)})}function _r(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...T(t)})}function vr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...T(t)})}function yr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...T(t)})}function br(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...T(t)})}function xr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...T(t)})}function Sr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...T(t)})}function Cr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...T(t)})}function wr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...T(t)})}function Tr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...T(t)})}function Er(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...T(t)})}function Dr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...T(t)})}function Or(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...T(t)})}function kr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...T(t)})}function Ar(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...T(t)})}function jr(e,t){return new e({type:`number`,checks:[],...T(t)})}function Mr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...T(t)})}function Nr(e,t){return new e({type:`boolean`,...T(t)})}function Pr(e,t){return new e({type:`null`,...T(t)})}function Fr(e){return new e({type:`unknown`})}function Ir(e,t){return new e({type:`never`,...T(t)})}function Lr(e,t){return new Dt({check:`less_than`,...T(t),value:e,inclusive:!1})}function Rr(e,t){return new Dt({check:`less_than`,...T(t),value:e,inclusive:!0})}function zr(e,t){return new Ot({check:`greater_than`,...T(t),value:e,inclusive:!1})}function Br(e,t){return new Ot({check:`greater_than`,...T(t),value:e,inclusive:!0})}function Vr(e,t){return new kt({check:`multiple_of`,...T(t),value:e})}function Hr(e,t){return new jt({check:`max_length`,...T(t),maximum:e})}function L(e,t){return new Mt({check:`min_length`,...T(t),minimum:e})}function Ur(e,t){return new Nt({check:`length_equals`,...T(t),length:e})}function Wr(e,t){return new Ft({check:`string_format`,format:`regex`,...T(t),pattern:e})}function Gr(e){return new It({check:`string_format`,format:`lowercase`,...T(e)})}function Kr(e){return new Lt({check:`string_format`,format:`uppercase`,...T(e)})}function qr(e,t){return new Rt({check:`string_format`,format:`includes`,...T(t),includes:e})}function Jr(e,t){return new zt({check:`string_format`,format:`starts_with`,...T(t),prefix:e})}function Yr(e,t){return new Bt({check:`string_format`,format:`ends_with`,...T(t),suffix:e})}function R(e){return new Vt({check:`overwrite`,tx:e})}function Xr(e){return R(t=>t.normalize(e))}function Zr(){return R(e=>e.trim())}function Qr(){return R(e=>e.toLowerCase())}function $r(){return R(e=>e.toUpperCase())}function ei(){return R(e=>he(e))}function ti(e,t,n){return new e({type:`array`,element:t,...T(n)})}function ni(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...T(n)})}function ri(e){let t=ii(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(A(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(A(r))}},e(n.value,n)));return t}function ii(e,t){let n=new j({check:`custom`,...T(t)});return n._zod.check=e,n}function ai(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??I,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function z(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,z(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&B(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function oi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
38
|
-
|
|
39
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function si(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:V(t,`input`,e.processors),output:V(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function B(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return B(r.element,n);if(r.type===`set`)return B(r.valueType,n);if(r.type===`lazy`)return B(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return B(r.innerType,n);if(r.type===`intersection`)return B(r.left,n)||B(r.right,n);if(r.type===`record`||r.type===`map`)return B(r.keyType,n)||B(r.valueType,n);if(r.type===`pipe`)return B(r.in,n)||B(r.out,n);if(r.type===`object`){for(let e in r.shape)if(B(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(B(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(B(e,n))return!0;return!!(r.rest&&B(r.rest,n))}return!1}var ci=(e,t={})=>n=>{let r=ai({...n,processors:t});return z(e,r),oi(r,e),si(r,e)},V=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ai({...i??{},target:a,io:t,processors:n});return z(e,o),oi(o,e),si(o,e)},li={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ui=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=li[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},di=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},fi=(e,t,n,r)=>{n.type=`boolean`},pi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},mi=(e,t,n,r)=>{n.not={}},hi=(e,t,n,r)=>{let i=e._zod.def,a=ce(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},gi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},_i=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},vi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},yi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=z(a.element,t,{...r,path:[...r.path,`items`]})},bi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=z(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=z(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},xi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>z(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Si=(e,t,n,r)=>{let i=e._zod.def,a=z(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=z(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ci=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=z(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=z(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=z(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},wi=(e,t,n,r)=>{let i=e._zod.def,a=z(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ti=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ei=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Di=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Oi=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ki=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;z(a,t,r);let o=t.seen.get(e);o.ref=a},Ai=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ji=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mi=m(`ZodISODateTime`,(e,t)=>{nn.init(e,t),G.init(e,t)});function Ni(e){return Dr(Mi,e)}var Pi=m(`ZodISODate`,(e,t)=>{rn.init(e,t),G.init(e,t)});function Fi(e){return Or(Pi,e)}var Ii=m(`ZodISOTime`,(e,t)=>{an.init(e,t),G.init(e,t)});function Li(e){return kr(Ii,e)}var Ri=m(`ZodISODuration`,(e,t)=>{on.init(e,t),G.init(e,t)});function zi(e){return Ar(Ri,e)}var Bi=(e,t)=>{je.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Pe(e,t)},flatten:{value:t=>Ne(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,le,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,le,2)}},isEmpty:{get(){return e.issues.length===0}}})};m(`ZodError`,Bi);var H=m(`ZodError`,Bi,{Parent:Error}),Vi=Fe(H),Hi=Ie(H),Ui=Le(H),Wi=ze(H),Gi=Ve(H),Ki=He(H),qi=Ue(H),Ji=We(H),Yi=Ge(H),Xi=Ke(H),Zi=qe(H),Qi=Je(H),U=m(`ZodType`,(e,t)=>(M.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:V(e,`input`),output:V(e,`output`)}}),e.toJSONSchema=ci(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(b(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>w(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Vi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ui(e,t,n),e.parseAsync=async(t,n)=>Hi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Gi(e,t,n),e.decode=(t,n)=>Ki(e,t,n),e.encodeAsync=async(t,n)=>qi(e,t,n),e.decodeAsync=async(t,n)=>Ji(e,t,n),e.safeEncode=(t,n)=>Yi(e,t,n),e.safeDecode=(t,n)=>Xi(e,t,n),e.safeEncodeAsync=async(t,n)=>Zi(e,t,n),e.safeDecodeAsync=async(t,n)=>Qi(e,t,n),e.refine=(t,n)=>e.check(so(t,n)),e.superRefine=t=>e.check(co(t)),e.overwrite=t=>e.check(R(t)),e.optional=()=>Ua(e),e.exactOptional=()=>Ga(e),e.nullable=()=>qa(e),e.nullish=()=>Ua(qa(e)),e.nonoptional=t=>$a(e,t),e.array=()=>Y(e),e.or=t=>Ma([e,t]),e.and=t=>Ia(e,t),e.transform=t=>ro(e,Va(t)),e.default=t=>Ya(e,t),e.prefault=t=>Za(e,t),e.catch=t=>to(e,t),e.pipe=t=>ro(e,t),e.readonly=()=>ao(e),e.describe=t=>{let n=e.clone();return I.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return I.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return I.get(e);let n=e.clone();return I.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),$i=m(`_ZodString`,(e,t)=>{Wt.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Wr(...t)),e.includes=(...t)=>e.check(qr(...t)),e.startsWith=(...t)=>e.check(Jr(...t)),e.endsWith=(...t)=>e.check(Yr(...t)),e.min=(...t)=>e.check(L(...t)),e.max=(...t)=>e.check(Hr(...t)),e.length=(...t)=>e.check(Ur(...t)),e.nonempty=(...t)=>e.check(L(1,...t)),e.lowercase=t=>e.check(Gr(t)),e.uppercase=t=>e.check(Kr(t)),e.trim=()=>e.check(Zr()),e.normalize=(...t)=>e.check(Xr(...t)),e.toLowerCase=()=>e.check(Qr()),e.toUpperCase=()=>e.check($r()),e.slugify=()=>e.check(ei())}),ea=m(`ZodString`,(e,t)=>{Wt.init(e,t),$i.init(e,t),e.email=t=>e.check(ar(ta,t)),e.url=t=>e.check(dr(ia,t)),e.jwt=t=>e.check(Er(ya,t)),e.emoji=t=>e.check(fr(aa,t)),e.guid=t=>e.check(or(na,t)),e.uuid=t=>e.check(sr(ra,t)),e.uuidv4=t=>e.check(cr(ra,t)),e.uuidv6=t=>e.check(lr(ra,t)),e.uuidv7=t=>e.check(ur(ra,t)),e.nanoid=t=>e.check(pr(oa,t)),e.guid=t=>e.check(or(na,t)),e.cuid=t=>e.check(mr(sa,t)),e.cuid2=t=>e.check(hr(ca,t)),e.ulid=t=>e.check(gr(la,t)),e.base64=t=>e.check(Cr(ga,t)),e.base64url=t=>e.check(wr(_a,t)),e.xid=t=>e.check(_r(ua,t)),e.ksuid=t=>e.check(vr(da,t)),e.ipv4=t=>e.check(yr(fa,t)),e.ipv6=t=>e.check(br(pa,t)),e.cidrv4=t=>e.check(xr(ma,t)),e.cidrv6=t=>e.check(Sr(ha,t)),e.e164=t=>e.check(Tr(va,t)),e.datetime=t=>e.check(Ni(t)),e.date=t=>e.check(Fi(t)),e.time=t=>e.check(Li(t)),e.duration=t=>e.check(zi(t))});function W(e){return ir(ea,e)}var G=m(`ZodStringFormat`,(e,t)=>{N.init(e,t),$i.init(e,t)}),ta=m(`ZodEmail`,(e,t)=>{qt.init(e,t),G.init(e,t)}),na=m(`ZodGUID`,(e,t)=>{Gt.init(e,t),G.init(e,t)}),ra=m(`ZodUUID`,(e,t)=>{Kt.init(e,t),G.init(e,t)}),ia=m(`ZodURL`,(e,t)=>{Jt.init(e,t),G.init(e,t)}),aa=m(`ZodEmoji`,(e,t)=>{Yt.init(e,t),G.init(e,t)}),oa=m(`ZodNanoID`,(e,t)=>{Xt.init(e,t),G.init(e,t)}),sa=m(`ZodCUID`,(e,t)=>{Zt.init(e,t),G.init(e,t)}),ca=m(`ZodCUID2`,(e,t)=>{Qt.init(e,t),G.init(e,t)}),la=m(`ZodULID`,(e,t)=>{$t.init(e,t),G.init(e,t)}),ua=m(`ZodXID`,(e,t)=>{en.init(e,t),G.init(e,t)}),da=m(`ZodKSUID`,(e,t)=>{tn.init(e,t),G.init(e,t)}),fa=m(`ZodIPv4`,(e,t)=>{sn.init(e,t),G.init(e,t)}),pa=m(`ZodIPv6`,(e,t)=>{cn.init(e,t),G.init(e,t)}),ma=m(`ZodCIDRv4`,(e,t)=>{ln.init(e,t),G.init(e,t)}),ha=m(`ZodCIDRv6`,(e,t)=>{un.init(e,t),G.init(e,t)}),ga=m(`ZodBase64`,(e,t)=>{fn.init(e,t),G.init(e,t)}),_a=m(`ZodBase64URL`,(e,t)=>{mn.init(e,t),G.init(e,t)}),va=m(`ZodE164`,(e,t)=>{hn.init(e,t),G.init(e,t)}),ya=m(`ZodJWT`,(e,t)=>{_n.init(e,t),G.init(e,t)}),ba=m(`ZodNumber`,(e,t)=>{vn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r),e.gt=(t,n)=>e.check(zr(t,n)),e.gte=(t,n)=>e.check(Br(t,n)),e.min=(t,n)=>e.check(Br(t,n)),e.lt=(t,n)=>e.check(Lr(t,n)),e.lte=(t,n)=>e.check(Rr(t,n)),e.max=(t,n)=>e.check(Rr(t,n)),e.int=t=>e.check(Sa(t)),e.safe=t=>e.check(Sa(t)),e.positive=t=>e.check(zr(0,t)),e.nonnegative=t=>e.check(Br(0,t)),e.negative=t=>e.check(Lr(0,t)),e.nonpositive=t=>e.check(Rr(0,t)),e.multipleOf=(t,n)=>e.check(Vr(t,n)),e.step=(t,n)=>e.check(Vr(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function K(e){return jr(ba,e)}var xa=m(`ZodNumberFormat`,(e,t)=>{yn.init(e,t),ba.init(e,t)});function Sa(e){return Mr(xa,e)}var Ca=m(`ZodBoolean`,(e,t)=>{bn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r)});function q(e){return Nr(Ca,e)}var wa=m(`ZodNull`,(e,t)=>{xn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r)});function Ta(e){return Pr(wa,e)}var Ea=m(`ZodUnknown`,(e,t)=>{Sn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function J(){return Fr(Ea)}var Da=m(`ZodNever`,(e,t)=>{Cn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r)});function Oa(e){return Ir(Da,e)}var ka=m(`ZodArray`,(e,t)=>{Tn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(L(t,n)),e.nonempty=t=>e.check(L(1,t)),e.max=(t,n)=>e.check(Hr(t,n)),e.length=(t,n)=>e.check(Ur(t,n)),e.unwrap=()=>e.element});function Y(e,t){return ti(ka,e,t)}var Aa=m(`ZodObject`,(e,t)=>{kn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),v(e,`shape`,()=>t.shape),e.keyof=()=>Q(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:J()}),e.loose=()=>e.clone({...e._zod.def,catchall:J()}),e.strict=()=>e.clone({...e._zod.def,catchall:Oa()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>we(e,t),e.safeExtend=t=>Te(e,t),e.merge=t=>Ee(e,t),e.pick=t=>Se(e,t),e.omit=t=>Ce(e,t),e.partial=(...t)=>De(Ha,e,t[0]),e.required=(...t)=>Oe(Qa,e,t[0])});function X(e,t){return new Aa({type:`object`,shape:e??{},...T(t)})}var ja=m(`ZodUnion`,(e,t)=>{jn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.options=t.options});function Ma(e,t){return new ja({type:`union`,options:e,...T(t)})}var Na=m(`ZodDiscriminatedUnion`,(e,t)=>{ja.init(e,t),Mn.init(e,t)});function Pa(e,t,n){return new Na({type:`union`,options:t,discriminator:e,...T(n)})}var Fa=m(`ZodIntersection`,(e,t)=>{Nn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r)});function Ia(e,t){return new Fa({type:`intersection`,left:e,right:t})}var La=m(`ZodRecord`,(e,t)=>{In.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Z(e,t,n){return new La({type:`record`,keyType:e,valueType:t,...T(n)})}var Ra=m(`ZodEnum`,(e,t)=>{Ln.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ra({...t,checks:[],...T(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ra({...t,checks:[],...T(r),entries:i})}});function Q(e,t){return new Ra({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...T(t)})}var za=m(`ZodLiteral`,(e,t)=>{Rn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $(e,t){return new za({type:`literal`,values:Array.isArray(e)?e:[e],...T(t)})}var Ba=m(`ZodTransform`,(e,t)=>{zn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new oe(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(A(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(A(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Va(e){return new Ba({type:`transform`,transform:e})}var Ha=m(`ZodOptional`,(e,t)=>{Vn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ua(e){return new Ha({type:`optional`,innerType:e})}var Wa=m(`ZodExactOptional`,(e,t)=>{Hn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ga(e){return new Wa({type:`optional`,innerType:e})}var Ka=m(`ZodNullable`,(e,t)=>{Un.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qa(e){return new Ka({type:`nullable`,innerType:e})}var Ja=m(`ZodDefault`,(e,t)=>{Wn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ya(e,t){return new Ja({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ve(t)}})}var Xa=m(`ZodPrefault`,(e,t)=>{Kn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Za(e,t){return new Xa({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ve(t)}})}var Qa=m(`ZodNonOptional`,(e,t)=>{qn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $a(e,t){return new Qa({type:`nonoptional`,innerType:e,...T(t)})}var eo=m(`ZodCatch`,(e,t)=>{Yn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function to(e,t){return new eo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var no=m(`ZodPipe`,(e,t)=>{Xn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.in=t.in,e.out=t.out});function ro(e,t){return new no({type:`pipe`,in:e,out:t})}var io=m(`ZodReadonly`,(e,t)=>{Zn.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e){return new io({type:`readonly`,innerType:e})}var oo=m(`ZodCustom`,(e,t)=>{$n.init(e,t),U.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r)});function so(e,t={}){return ni(oo,e,t)}function co(e){return ri(e)}var lo=Q([`idle`,`thinking`,`streaming`,`tool_running`,`awaiting_confirmation`]),uo=Q([`assistant_turn`,`user_turn`,`global`]),fo=Q([`message_dequeued`,`thinking_delta`,`first_text_delta`,`tool_use_start`,`preview_start`,`tool_result_received`,`confirmation_requested`,`confirmation_resolved`,`context_compacting`,`message_complete`,`generation_cancelled`,`error_terminal`]),po=X({type:$(`assistant_activity_state`),conversationId:W(),activityVersion:K(),phase:lo,anchor:uo,reason:fo,requestId:W().optional(),statusText:W().optional()}),mo=X({type:$(`assistant_text_delta`),text:W(),messageId:W().optional(),conversationId:W().optional()}),ho=X({type:$(`assistant_thinking_delta`),thinking:W(),messageId:W().optional(),conversationId:W().optional(),timestampMs:K().optional()}),go=X({type:$(`assistant_turn_start`),messageId:W(),conversationId:W().optional()}),_o=X({type:$(`avatar_updated`),avatarPath:W()}),vo=X({type:$(`compaction_circuit_closed`),conversationId:W()}),yo=X({type:$(`compaction_circuit_open`),conversationId:W(),reason:$(`3_consecutive_failures`),openUntil:K()}),bo=X({label:W(),description:W(),pattern:W()}),xo=X({label:W(),scope:W()}),So=X({label:W(),scope:W()}),Co=X({filePath:W(),oldContent:W(),newContent:W(),isNewFile:q()}),wo=Q([`allow_once`,`allow_always`,`reject_once`,`reject_always`]),To=X({optionId:W(),name:W(),kind:wo}),Eo=Q([`sandbox`,`host`]),Do=X({type:$(`confirmation_request`),requestId:W(),toolName:W(),input:Z(W(),J()),riskLevel:W(),riskReason:W().optional(),isContainerized:q().optional(),executionTarget:Eo.optional(),allowlistOptions:Y(bo),scopeOptions:Y(xo),directoryScopeOptions:Y(So).optional(),diff:Co.optional(),conversationId:W().optional(),persistentDecisionsAllowed:q().optional(),toolUseId:W().optional(),acpToolKind:W().optional(),acpOptions:Y(To).optional()}),Oo=X({type:$(`contact_request`),requestId:W(),channel:W().optional(),placeholder:W().optional(),label:W().optional(),description:W().optional(),role:W().optional()}),ko=Q([`PROVIDER_NETWORK`,`PROVIDER_RATE_LIMIT`,`MANAGED_USAGE_LIMIT`,`PROVIDER_OVERLOADED`,`PROVIDER_API`,`IMAGE_TOO_LARGE`,`PROVIDER_BILLING`,`PROVIDER_ORDERING`,`PROVIDER_WEB_SEARCH`,`PROVIDER_NOT_CONFIGURED`,`PROVIDER_INVALID_KEY`,`MANAGED_KEY_INVALID`,`CONTEXT_TOO_LARGE`,`BUDGET_YIELD_UNRECOVERED`,`MAX_TOKENS_REACHED`,`CONVERSATION_ABORTED`,`CONVERSATION_PROCESSING_FAILED`,`DISK_SPACE_CRITICAL`,`REGENERATE_FAILED`,`UNKNOWN`]),Ao=X({type:$(`conversation_error`),conversationId:W(),code:ko,userMessage:W(),retryable:q(),debugDetails:W().optional(),errorCategory:W().optional(),connectionName:W().optional(),profileName:W().optional()}),jo=Q([`created`,`renamed`,`deleted`,`reordered`,`seen_changed`]),Mo=X({type:$(`conversation_list_invalidated`),reason:jo}),No=X({type:$(`conversation_title_updated`),conversationId:W(),title:W()}),Po=Q([`disabled`,`ok`,`warning`,`critical`,`unknown`]),Fo=Q([`agent-turns`,`background-work`,`remote-ingress`]),Io=X({enabled:q(),state:Po,locked:q(),acknowledged:q(),overrideActive:q(),effectivelyLocked:q(),lockId:W().nullable(),usagePercent:K().nullable(),thresholdPercent:K(),path:W().nullable(),lastCheckedAt:W().nullable(),blockedCapabilities:Y(Fo),error:W().nullable()}),Lo=X({type:$(`disk_pressure_status_changed`),status:Io}),Ro=X({id:W(),surfaceId:W(),author:W(),content:W(),anchorStart:K().optional(),anchorEnd:K().optional(),anchorText:W().optional(),parentCommentId:W().optional(),status:W(),createdAt:K(),updatedAt:K()}),zo=X({type:$(`document_comment_created`),conversationId:W(),surfaceId:W(),comment:Ro}),Bo=X({type:$(`document_comment_deleted`),conversationId:W(),surfaceId:W(),commentId:W()}),Vo=X({type:$(`document_comment_reopened`),conversationId:W(),surfaceId:W(),commentId:W()}),Ho=X({type:$(`document_comment_resolved`),conversationId:W(),surfaceId:W(),commentId:W(),resolvedBy:W()}),Uo=X({type:$(`document_editor_update`),conversationId:W(),surfaceId:W(),markdown:W(),mode:W()}),Wo=X({type:$(`error`),message:W(),code:W().optional(),category:W().optional(),errorCategory:W().optional(),requestId:W().optional(),conversationId:W().optional()}),Go=X({type:$(`generation_cancelled`),conversationId:W().optional()}),Ko=X({id:W().optional(),filename:W(),mimeType:W(),data:W(),sourceType:Q([`sandbox_file`,`host_file`,`tool_block`]).optional(),sizeBytes:K().optional(),thumbnailData:W().optional(),fileBacked:q().optional(),filePath:W().optional()}),qo=X({type:$(`generation_handoff`),conversationId:W().optional(),requestId:W().optional(),queuedCount:K(),messageId:W().optional(),attachments:Y(Ko).optional(),attachmentWarnings:Y(W()).optional()}),Jo=X({type:$(`home_feed_updated`),updatedAt:W(),newItemCount:K()}),Yo=X({type:$(`identity_changed`),name:W(),role:W(),personality:W(),emoji:W(),home:W()}),Xo=Q([`approved`,`rejected`,`answered`,`cancelled`,`superseded`]),Zo=X({type:$(`interaction_resolved`),requestId:W(),conversationId:W(),state:Xo,kind:W()}),Qo=X({type:$(`message_complete`),messageId:W().optional(),conversationId:W().optional(),source:Q([`main`,`aux`]).optional(),attachments:Y(Ko).optional(),attachmentWarnings:Y(W()).optional()}),$o=X({type:$(`message_dequeued`),conversationId:W(),requestId:W()}),es=X({type:$(`message_queued`),conversationId:W(),requestId:W(),position:K()}),ts=X({type:$(`message_queued_deleted`),conversationId:W(),requestId:W()}),ns=X({type:$(`message_request_complete`),conversationId:W(),requestId:W(),runStillActive:q().optional()}),rs=X({type:$(`navigate_settings`),tab:W()}),is=X({type:$(`notification_intent`),sourceEventName:W(),title:W(),body:W(),deliveryId:W().optional(),deepLinkMetadata:Z(W(),J()).optional(),targetGuardianPrincipalId:W().optional(),silent:q().optional()}),as=X({type:$(`open_url`),url:W().min(1),title:W().optional(),conversationId:W().optional()}),os=X({id:W(),label:W(),description:W().optional()}),ss=X({id:W(),question:W(),description:W().optional(),options:Y(os),freeTextPlaceholder:W().optional()}),cs=X({type:$(`question_request`),requestId:W(),questions:Y(ss),question:W(),description:W().optional(),options:Y(os),freeTextPlaceholder:W().optional(),conversationId:W().optional(),toolUseId:W().optional()}),ls=X({type:$(`relationship_state_updated`),updatedAt:W()}),us=X({type:$(`secret_request`),requestId:W(),service:W(),field:W(),label:W(),description:W().optional(),placeholder:W().optional(),conversationId:W().optional(),purpose:W().optional(),allowedTools:Y(W()).optional(),allowedDomains:Y(W()).optional(),allowOneTimeSend:q().optional()}),ds=X({type:W(),content:W().optional(),text:W().optional(),result:W().optional(),input:Z(W(),J()).optional(),toolName:W().optional(),isError:q().optional(),toolUseId:W().optional()}).passthrough(),fs=X({type:$(`subagent_event`),conversationId:W(),subagentId:W(),event:ds}).strict(),ps=X({type:$(`subagent_spawned`),subagentId:W(),parentConversationId:W(),label:W(),objective:W(),isFork:q().optional(),parentToolUseId:W().optional()}).strict(),ms=Q([`pending`,`running`,`awaiting_input`,`completed`,`failed`,`aborted`]),hs=X({inputTokens:K(),outputTokens:K(),estimatedCost:K()}).strict(),gs=X({type:$(`subagent_status_changed`),subagentId:W(),status:ms,error:W().optional(),usage:hs.optional()}).strict(),_s=X({type:$(`sync_changed`),tags:Y(W().min(1)).min(1),originClientId:W().min(1).optional()}),vs=Q([`tool_start`,`tool_complete`,`status`]),ys=X({type:$(`tool_output_chunk`),chunk:W(),conversationId:W().optional(),toolUseId:W().optional(),subType:vs.optional(),subToolName:W().optional(),subToolInput:W().optional(),subToolIsError:q().optional(),subToolId:W().optional(),messageId:W().optional()}),bs=X({pattern:W(),label:W()}),xs=Q([`anthropic-native`,`brave`,`perplexity`,`tavily`]),Ss=X({rank:K(),title:W(),url:W(),domain:W(),faviconUrl:W().optional(),snippet:W().optional(),age:W().optional(),score:K().optional()}),Cs=X({query:W(),provider:xs,resultCount:K(),durationMs:K(),results:Y(Ss),errorMessage:W().optional()}),ws=X({url:W(),finalUrl:W(),status:K(),contentType:W().optional(),byteCount:K(),charCount:K(),truncated:q(),title:W().optional(),domain:W(),faviconUrl:W().optional(),redirectCount:K(),durationMs:K(),errorMessage:W().optional(),mayRequireJavaScript:q().optional()}),Ts=X({webSearch:Cs.optional(),webFetch:ws.optional()}),Es=X({type:$(`tool_result`),toolName:W(),result:W(),isError:q().optional(),diff:Co.optional(),status:W().optional(),conversationId:W().optional(),imageData:W().optional(),imageDataList:Y(W()).optional(),toolUseId:W().optional(),messageId:W().optional(),riskLevel:W().optional(),riskReason:W().optional(),matchedTrustRuleId:W().optional(),isContainerized:q().optional(),riskScopeOptions:Y(bs).optional(),riskAllowlistOptions:Y(bo).optional(),riskDirectoryScopeOptions:Y(So).optional(),approvalMode:W().optional(),approvalReason:W().optional(),riskThreshold:W().optional(),activityMetadata:Ts.optional(),completedAt:K().optional()}),Ds=X({type:$(`tool_use_preview_start`),toolUseId:W(),toolName:W(),conversationId:W().optional(),messageId:W().optional()}),Os=X({type:$(`tool_use_start`),toolName:W(),input:Z(W(),J()),toolUseId:W().optional(),messageId:W().optional(),conversationId:W().optional(),startedAt:K().optional()}),ks=Q([`request_received`,`request_queued`,`request_dequeued`,`llm_call_started`,`llm_call_finished`,`assistant_message`,`tool_started`,`tool_permission_requested`,`tool_permission_decided`,`tool_finished`,`tool_failed`,`generation_handoff`,`message_complete`,`generation_cancelled`,`request_error`,`tool_profiling_summary`]),As=Q([`info`,`success`,`warning`,`error`]),js=X({type:$(`trace_event`),eventId:W(),conversationId:W(),requestId:W().optional(),timestampMs:K(),sequence:K(),kind:ks,status:As.optional(),summary:W(),attributes:Z(W(),Ma([W(),K(),q(),Ta()])).optional()}),Ms=X({type:$(`turn_profile_auto_routed`),conversationId:W(),profile:W(),profileLabel:W()}),Ns=X({type:$(`ui_surface_complete`),conversationId:W(),surfaceId:W(),summary:W(),submittedData:Z(W(),J()).optional()}),Ps=X({type:$(`ui_surface_dismiss`),conversationId:W(),surfaceId:W()}),Fs=X({id:W(),label:W(),style:Q([`primary`,`secondary`,`destructive`]).optional(),data:Z(W(),J()).optional()}),Is=X({type:$(`ui_surface_show`),conversationId:W(),surfaceId:W(),surfaceType:W(),title:W().optional(),data:Z(W(),J()),actions:Y(Fs).optional(),display:Q([`inline`,`panel`]).optional(),messageId:W().optional(),persistent:q().optional(),toolCallId:W().optional()}),Ls=X({type:$(`ui_surface_update`),conversationId:W(),surfaceId:W(),data:Z(W(),J())}),Rs=X({type:$(`usage_progress`),conversationId:W(),inputTokens:K(),outputTokens:K(),estimatedCost:K(),model:W()}),zs=X({type:$(`usage_update`),conversationId:W(),inputTokens:K(),outputTokens:K(),cacheCreationInputTokens:K().optional(),cacheReadInputTokens:K().optional(),totalInputTokens:K(),totalOutputTokens:K(),estimatedCost:K(),model:W(),contextWindowTokens:K().optional(),contextWindowMaxTokens:K().optional()}),Bs=X({type:$(`user_message_echo`),text:W(),conversationId:W().optional(),messageId:W().optional(),requestId:W().optional(),clientMessageId:W().optional()}).strict(),Vs=`syntheticAgentErrorMessage`,Hs=`compactionAgent`,Us=X({cursorInTextField:q().optional().describe(`Whether the cursor is in an editable text field when dictation started`)}).passthrough().describe(`Dictation context (app name, window title, bundle ID, cursor state, selected text)`),Ws=X({transcription:W().describe(`Raw speech transcription`),context:Us,profileId:W().describe(`Optional dictation profile ID`).optional()}),Gs=X({id:W(),filename:W(),mimeType:W(),sizeBytes:K(),kind:W(),data:W().optional(),thumbnailData:W().optional(),fileBacked:q().optional()}),Ks=X({pattern:W(),label:W()}),qs=X({label:W(),description:W(),pattern:W()}),Js=X({scope:W(),label:W()}),Ys=X({requestId:W(),title:W().optional(),description:W().optional(),toolName:W().optional(),riskLevel:W().optional(),riskReason:W().optional(),input:Z(W(),J()).optional(),allowlistOptions:Y(bo).optional(),scopeOptions:Y(xo).optional(),directoryScopeOptions:Y(So).optional(),persistentDecisionsAllowed:q().optional()}),Xs=Q([`approved`,`denied`,`timed_out`]),Zs=X({id:W().optional(),name:W(),input:Z(W(),J()),result:W().optional(),isError:q().optional(),imageData:W().optional(),imageDataList:Y(W()).optional(),startedAt:K().optional(),completedAt:K().optional(),confirmationDecision:Xs.optional(),confirmationLabel:W().optional(),riskLevel:W().optional(),riskReason:W().optional(),matchedTrustRuleId:W().optional(),autoApproved:q().optional(),approvalMode:W().optional(),approvalReason:W().optional(),riskThreshold:W().optional(),riskScopeOptions:Y(Ks).optional(),riskAllowlistOptions:Y(qs).optional(),riskDirectoryScopeOptions:Y(Js).optional(),activityMetadata:Ts.optional(),scopeOptions:Y(xo).optional(),pendingConfirmation:Ys.optional()}),Qs=X({id:W(),label:W(),style:W().optional(),data:Z(W(),J()).optional()}),$s=X({surfaceId:W(),surfaceType:W(),title:W().optional(),data:Z(W(),J()),actions:Y(Qs).optional(),display:W().optional(),persistent:q().optional(),completed:q().optional(),completionSummary:W().optional(),toolCallId:W().optional()}),ec=X({subagentId:W(),label:W(),status:W(),error:W().optional(),conversationId:W().optional(),objective:W().optional()}),tc=X({appUrl:W().optional(),webUrl:W().optional()}),nc=X({channelId:W(),channelName:W().optional(),channelTs:W(),threadTs:W().optional(),sender:X({displayName:W().optional(),externalUserId:W().optional()}).optional(),messageLink:tc.optional(),threadLink:tc.optional()}),rc=X({type:$(`text`),text:W()}),ic=X({type:$(`thinking`),thinking:W(),startedAt:K().optional(),completedAt:K().optional()}),ac=X({type:$(`tool_use`),toolCall:Zs}),oc=X({type:$(`surface`),surface:$s}),sc=X({type:$(`attachment`),attachment:Gs}),cc=Pa(`type`,[rc,ic,ac,oc,sc]),lc=X({id:W(),mergedMessageIds:Y(W()).optional(),clientMessageId:W().optional(),role:Q([`user`,`assistant`]),content:W().meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Flat plain-text body (joined text segments).`}).optional(),timestamp:W(),attachments:Y(Gs),toolCalls:Y(Zs).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks (the tool_use variant). Flat list of tool calls.`}).optional(),surfaces:Y($s).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks (the surface variant). Flat list of surfaces.`}).optional(),textSegments:Y(W()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Text segments split by tool-call boundaries.`}).optional(),thinkingSegments:Y(W()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Reasoning text extracted from thinking blocks.`}).optional(),contentOrder:Y(W()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Positional "<type>:<index>" content ordering (e.g. "text:0", "thinking:1").`}).optional(),contentBlocks:Y(cc).optional(),subagentNotification:ec.optional(),slackMessage:nc.optional()}),uc=X({status:Io}),dc=$(`notification`),fc=Q([`new`,`seen`,`acted_on`,`dismissed`]),pc=Q([`low`,`medium`,`high`,`critical`]),mc=Q([`security`,`scheduling`,`background`,`email`,`system`]),hc=Q([`heartbeat`,`memory_consolidation`,`schedule`,`auto_analysis`,`user`,`other`]),gc=X({id:W(),label:W(),prompt:W()}),_c=Q([`emailDraft`,`documentPreview`,`permissionChat`,`paymentAuth`,`toolPermission`,`updatesList`]),vc=X({kind:_c}),yc=X({id:W(),type:dc,priority:K().int().min(0).max(100),title:W().optional(),summary:W(),timestamp:W(),status:fc.default(`new`),expiresAt:W().optional(),actions:Y(gc).optional(),urgency:pc.optional(),conversationId:W().optional(),detailPanel:vc.optional(),category:mc.optional(),noteworthy:q().optional(),fromAssistant:q().optional(),metadata:Z(W(),J()).optional(),sourceType:hc.optional(),sourceKey:W().optional(),sourceLabel:W().optional(),createdAt:W()}),bc=Q([`deterministic`,`assistant`]),xc=X({id:W(),label:W(),icon:W().optional(),prompt:W(),source:bc}),Sc=X({greeting:W(),timeAwayLabel:W(),newCount:K().int().min(0)}),Cc=X({items:Y(yc),updatedAt:W(),contextBanner:Sc,suggestedPrompts:Y(xc)}),wc=X({id:W(),category:Q([`voice`,`world`,`priorities`]),text:W(),confidence:Q([`strong`,`uncertain`]),source:Q([`onboarding`,`inferred`])}),Tc=X({id:W(),name:W(),description:W(),tier:Q([`unlocked`,`next-up`,`earned`]),gate:W(),unlockHint:W().optional(),ctaLabel:W().optional()}),Ec=X({version:$(1),assistantId:W(),tier:Ma([$(1),$(2),$(3),$(4)]),progressPercent:K(),facts:Y(wc),capabilities:Y(Tc),conversationCount:K(),hatchedDate:W(),assistantName:W(),userName:W().optional(),updatedAt:W()}),Dc=X({provider:W().nullish(),model:W().nullish(),status:W().nullish(),inputTokens:K().nullish(),outputTokens:K().nullish(),cacheCreationInputTokens:K().nullish(),cacheReadInputTokens:K().nullish(),stopReason:W().nullish(),requestMessageCount:K().nullish(),requestToolCount:K().nullish(),responseMessageCount:K().nullish(),responseToolCallCount:K().nullish(),responsePreview:W().nullish(),toolCallNames:Y(W()).nullish(),estimatedCostUsd:K().nullish(),durationMs:K().nullish()}),Oc=X({kind:W(),label:W().nullish(),role:W().nullish(),text:W().nullish(),toolName:W().nullish(),data:J().optional(),language:W().nullish()}),kc=X({id:W(),createdAt:K(),requestPayload:Ta(),responsePayload:Ta(),provider:W().nullish(),summary:Dc.nullish(),requestSections:Y(Oc).nullish(),responseSections:Y(Oc).nullish(),agentLoopExitReason:W().nullish(),callSite:W().nullish()}),Ac=X({nodeId:W(),score:K(),semanticSimilarity:K(),recencyBoost:K(),type:W().optional()}),jc=X({reason:W(),semanticUnavailable:q(),fallbackSources:Y(W())}),Mc=X({enabled:q(),degraded:q(),provider:W().nullable(),model:W().nullable(),degradation:jc.nullable(),semanticHits:K().nullish(),mergedCount:K().nullish(),selectedCount:K().nullish(),tier1Count:K().nullish(),tier2Count:K().nullish(),hybridSearchLatencyMs:K().nullish(),sparseVectorUsed:q().nullish(),injectedTokens:K().nullish(),latencyMs:K().nullish(),topCandidates:Y(Ac),injectedText:W().nullable(),reason:W().nullable(),queryContext:W().nullable()}),Nc=X({slug:W(),finalActivation:K(),ownActivation:K(),priorActivation:K(),simUser:K(),simAssistant:K(),simNow:K(),simUserRerankBoost:K().optional(),simAssistantRerankBoost:K().optional(),inRerankPool:q().optional(),spreadContribution:K(),source:W(),status:W()}),Pc=X({d:K(),c_user:K(),c_assistant:K(),c_now:K(),k:K(),hops:K(),top_k:K(),epsilon:K()}),Fc=X({turn:K(),mode:W(),concepts:Y(Nc),config:Pc}),Ic=X({slug:W(),source:W(),pinned:q(),sectionOrdinal:K().nullable().optional(),sectionHeading:W().nullable().optional()}),Lc=X({turn:K(),live:q(),shadow:q(),selections:Y(Ic),injectedText:W()}),Rc=X({messageId:W().nullish(),conversationKey:W().nullish(),conversationId:W().nullish(),conversationKind:W(),conversationTotalEstimatedCostUsd:K().nullish(),logs:Y(kc),memoryRecall:Mc.nullable(),memoryV2Activation:Fc.nullable(),memoryV3Selection:Lc.nullish()}),zc=X({type:W(),content:W(),toolName:W().optional(),isError:q().optional(),messageId:W().optional()}),Bc=X({subagentId:W(),objective:W().optional(),status:ms.optional(),usage:hs.optional(),events:Y(zc)}),Vc=e({ACPOptionKindSchema:()=>wo,ACPOptionSchema:()=>To,AllowlistOptionSchema:()=>bo,AssistantActivityAnchorSchema:()=>uo,AssistantActivityPhaseSchema:()=>lo,AssistantActivityReasonSchema:()=>fo,AssistantActivityStateEventSchema:()=>po,AssistantEventEnvelopeSchema:()=>Uc,AssistantEventSchema:()=>Hc,AssistantOutboundAttachmentSchema:()=>Ko,AssistantTextDeltaEventSchema:()=>mo,AssistantThinkingDeltaEventSchema:()=>ho,AssistantTurnStartEventSchema:()=>go,AvatarUpdatedEventSchema:()=>_o,CALL_SITE_COMPACTION_AGENT:()=>Hs,CALL_SITE_SYNTHETIC_AGENT_ERROR_MESSAGE:()=>Vs,CapabilitySchema:()=>Tc,CompactionCircuitClosedEventSchema:()=>vo,CompactionCircuitOpenEventSchema:()=>yo,ConfirmationDiffSchema:()=>Co,ConfirmationExecutionTargetSchema:()=>Eo,ConfirmationRequestEventSchema:()=>Do,ContactRequestEventSchema:()=>Oo,ContextBannerSchema:()=>Sc,ConversationAttachmentBlockSchema:()=>sc,ConversationContentBlockSchema:()=>cc,ConversationErrorCodeSchema:()=>ko,ConversationErrorEventSchema:()=>Ao,ConversationListInvalidatedEventSchema:()=>Mo,ConversationListInvalidatedReasonSchema:()=>jo,ConversationMessageAttachmentSchema:()=>Gs,ConversationMessageSchema:()=>lc,ConversationMessageSurfaceSchema:()=>$s,ConversationMessageToolCallSchema:()=>Zs,ConversationSlackMessageSchema:()=>nc,ConversationSubagentNotificationSchema:()=>ec,ConversationSurfaceBlockSchema:()=>oc,ConversationTextBlockSchema:()=>rc,ConversationThinkingBlockSchema:()=>ic,ConversationTitleUpdatedEventSchema:()=>No,ConversationToolUseBlockSchema:()=>ac,DEFAULT_TOOL_EXECUTION_TIMEOUT_SEC:()=>120,DictationContextSchema:()=>Us,DictationRequestSchema:()=>Ws,DirectoryScopeOptionSchema:()=>So,DiskPressureBlockedCapabilitySchema:()=>Fo,DiskPressureStateSchema:()=>Po,DiskPressureStatusChangedEventSchema:()=>Lo,DiskPressureStatusResponseSchema:()=>uc,DiskPressureStatusSchema:()=>Io,DocumentCommentCreatedEventSchema:()=>zo,DocumentCommentDeletedEventSchema:()=>Bo,DocumentCommentReopenedEventSchema:()=>Vo,DocumentCommentResolvedEventSchema:()=>Ho,DocumentEditorUpdateEventSchema:()=>Uo,ErrorEventSchema:()=>Wo,FactSchema:()=>wc,FeedActionSchema:()=>gc,FeedItemCategorySchema:()=>mc,FeedItemDetailPanelKindSchema:()=>_c,FeedItemDetailPanelSchema:()=>vc,FeedItemSchema:()=>yc,FeedItemSourceTypeSchema:()=>hc,FeedItemStatusSchema:()=>fc,FeedItemTypeSchema:()=>dc,FeedItemUrgencySchema:()=>pc,GenerationCancelledEventSchema:()=>Go,GenerationHandoffEventSchema:()=>qo,HomeFeedResponseSchema:()=>Cc,HomeFeedUpdatedEventSchema:()=>Jo,IdentityChangedEventSchema:()=>Yo,InteractionResolutionStateSchema:()=>Xo,InteractionResolvedEventSchema:()=>Zo,LLMCallSummarySchema:()=>Dc,LLMContextSectionSchema:()=>Oc,LLMRequestLogEntrySchema:()=>kc,LlmContextResponseSchema:()=>Rc,MemoryCandidateSchema:()=>Ac,MemoryDegradationSchema:()=>jc,MemoryRecallLogSchema:()=>Mc,MemoryV2ActivationLogSchema:()=>Fc,MemoryV2ConceptRowSchema:()=>Nc,MemoryV2ConfigSnapshotSchema:()=>Pc,MemoryV3SelectionLogSchema:()=>Lc,MemoryV3SelectionRowSchema:()=>Ic,MessageCompleteEventSchema:()=>Qo,MessageDequeuedEventSchema:()=>$o,MessageQueuedDeletedEventSchema:()=>ts,MessageQueuedEventSchema:()=>es,MessageRequestCompleteEventSchema:()=>ns,NavigateSettingsEventSchema:()=>rs,NotificationIntentEventSchema:()=>is,OpenUrlEventSchema:()=>as,PendingToolConfirmationSchema:()=>Ys,QuestionEntrySchema:()=>ss,QuestionOptionSchema:()=>os,QuestionRequestEventSchema:()=>cs,RelationshipStateSchema:()=>Ec,RelationshipStateUpdatedEventSchema:()=>ls,RiskScopeOptionSchema:()=>bs,ScopeOptionSchema:()=>xo,SecretRequestEventSchema:()=>us,SubagentDetailEventSchema:()=>zc,SubagentDetailResponseSchema:()=>Bc,SubagentEventEventSchema:()=>fs,SubagentInnerEventSchema:()=>ds,SubagentSpawnedEventSchema:()=>ps,SubagentStatusChangedEventSchema:()=>gs,SubagentStatusSchema:()=>ms,SubagentUsageStatsSchema:()=>hs,SuggestedPromptSchema:()=>xc,SuggestedPromptSourceSchema:()=>bc,SurfaceActionSchema:()=>Fs,SyncChangedEventSchema:()=>_s,ToolActivityMetadataSchema:()=>Ts,ToolOutputChunkEventSchema:()=>ys,ToolOutputChunkSubTypeSchema:()=>vs,ToolResultEventSchema:()=>Es,ToolUsePreviewStartEventSchema:()=>Ds,ToolUseStartEventSchema:()=>Os,TraceEventKindSchema:()=>ks,TraceEventSchema:()=>js,TraceEventStatusSchema:()=>As,TurnProfileAutoRoutedEventSchema:()=>Ms,UISurfaceCompleteEventSchema:()=>Ns,UISurfaceDismissEventSchema:()=>Ps,UISurfaceShowEventSchema:()=>Is,UISurfaceUpdateEventSchema:()=>Ls,UsageProgressEventSchema:()=>Rs,UsageUpdateEventSchema:()=>zs,UserMessageEchoEventSchema:()=>Bs,WebFetchMetadataSchema:()=>ws,WebSearchMetadataSchema:()=>Cs,WebSearchProviderIdSchema:()=>xs,WebSearchResultItemSchema:()=>Ss}),Hc=Pa(`type`,[po,mo,ho,go,_o,vo,yo,Do,Oo,Ao,Mo,No,Lo,zo,Bo,Vo,Ho,Uo,Wo,Go,qo,Jo,Yo,Zo,Qo,$o,es,ts,ns,rs,is,as,cs,ls,us,fs,ps,gs,_s,ys,Es,Ds,Os,js,Ms,Ns,Ps,Is,Ls,Rs,zs,Bs]),Uc=X({id:W(),conversationId:W().optional(),seq:K().int().optional(),emittedAt:W(),message:Hc});async function Wc(e,t){let{data:n,error:r,response:i}=await f({body:e??{},query:t?{mode:t}:void 0,throwOnError:!1});return d(i,r,`Failed to hatch assistant.`),i.ok?{ok:!0,status:i.status,data:n}:{ok:!1,status:i.status,error:u(r,i)}}async function Gc(e){if(t()){let e=r();if(e)return{ok:!0,status:200,data:{id:e.assistantId,name:e.name??e.assistantId,status:`active`,is_local:!0,created:e.hatchedAt??``}}}if(e){let{data:t,error:n,response:r}=await te({path:{id:e},throwOnError:!1});return d(r,n,`Failed to get assistant.`),r.ok?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:u(n,r)}}let n=await ae({query:{hosting:`platform`},throwOnError:!1});if(d(n.response,n.error,`Failed to get assistant.`),!n.response.ok)return{ok:!1,status:n.response.status,error:u(n.error,n.response)};let i=n.data?.results??[];if(i.length>0)return{ok:!0,status:n.response.status,data:i[0]};let a=await ae({query:{hosting:`local`},throwOnError:!1});if(d(a.response,a.error,`Failed to get assistant.`),a.response.ok){let e=a.data?.results??[];if(e.length>0)return{ok:!0,status:a.response.status,data:e[0]}}return a.response.ok?{ok:!1,status:404,error:{detail:`No assistants found`}}:{ok:!1,status:a.response.status,error:u(a.error,a.response)}}async function Kc(e){let{data:t,error:n,response:r}=await l({path:{assistant_id:e},throwOnError:!1});return d(r,n,`Failed to get assistant healthz.`),r.ok&&t?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:u(n,r)}}async function qc(e){let{data:t,error:n,response:r}=await a({path:{assistant_id:e},throwOnError:!1});if(d(r,n,`Failed to get assistant disk pressure status.`),r.ok){let e=uc.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:u(e.error.message,r)}}return{ok:!1,status:r.status,error:u(n,r)}}async function Jc(e){let{data:t,error:n,response:r}=await c({path:{assistant_id:e},throwOnError:!1});if(d(r,n,`Failed to acknowledge assistant disk pressure.`),r.ok){let e=uc.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:u(e.error.message,r)}}return{ok:!1,status:r.status,error:u(n,r)}}function Yc(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};if(Array.isArray(t.backups))return t.backups;let n=t,r=[],i=n.local?.snapshots;if(Array.isArray(i))for(let e of i)r.push({snapshot_name:e.filename,pvc:``,created_at:e.created_at,ready_to_use:!0,backup_type:`scheduled`,path:e.path});if(Array.isArray(n.offsite)){for(let e of n.offsite)if(Array.isArray(e.snapshots))for(let t of e.snapshots)r.push({snapshot_name:t.filename,pvc:``,created_at:t.created_at,ready_to_use:!t.encrypted,backup_type:`scheduled`,path:t.path})}return r}function Xc(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};return Array.isArray(t.backups)?t.backups:[]}async function Zc(e){let t=!n(),[r,i]=await Promise.all([o({path:{assistant_id:e},throwOnError:!1}),t?ie({path:{assistant_id:e},throwOnError:!1}):null]);if(d(r.response,r.error,`Failed to list assistant backups.`),!r.response.ok)return{ok:!1,status:r.response.status,error:u(r.error,r.response)};let a=Yc(r.data);if(i){if(i.response?.ok){let e=Xc(i.data);return{ok:!0,status:r.response.status,data:[...e,...a]}}if(a.length===0&&i.response)return{ok:!1,status:i.response.status,error:u(i.error,i.response)}}return{ok:!0,status:r.response.status,data:a}}async function Qc(e){let{data:t,error:r,response:i}=n()?await s({path:{assistant_id:e},throwOnError:!1}):await re({path:{assistant_id:e},throwOnError:!1});if(d(i,r,`Failed to create assistant backup.`),i.ok){let e=t&&typeof t==`object`&&!Array.isArray(t)?t:{};return{ok:!0,status:i.status,data:e}}return{ok:!1,status:i.status,error:u(r,i)}}async function $c(e,t){let{data:r,error:a,response:o}=n()?await i({path:{assistant_id:e},body:{path:t.path??t.snapshot_name},throwOnError:!1}):await ne({path:{assistant_id:e,snapshot_name:t.snapshot_name},throwOnError:!1});if(d(o,a,`Failed to restore assistant backup.`),o.ok){let e=r&&typeof r==`object`&&!Array.isArray(r)?r:{};return{ok:!0,status:o.status,data:e}}return{ok:!1,status:o.status,error:u(a,o)}}async function el(e){let{data:t,error:n,response:r}=await p({path:{id:e},throwOnError:!1});return d(r,n,`Failed to restart assistant.`),r.ok?{ok:!0,data:t&&typeof t==`object`&&!Array.isArray(t)?t:{}}:{ok:!1,status:r.status,error:u(n,r)}}async function tl(e){let{error:t,response:n}=await ee({path:{id:e},throwOnError:!1});return d(n,t,`Failed to retire assistant.`),n.ok?{ok:!0}:{ok:!1,status:n.status,error:u(t,n)}}async function nl(){let{data:e,error:t,response:n}=await ae({query:{hosting:`all`},throwOnError:!1});return d(n,t,`Failed to list assistants.`),n.ok?{ok:!0,status:n.status,data:e?.results??[]}:{ok:!1,status:n.status,error:u(t,n)}}export{Z as C,J as E,X as S,Ma as T,Vs as _,Kc as a,Pa as b,nl as c,tl as d,Uc as f,Hs as g,Bc as h,qc as i,el as l,Vc as m,Qc as n,Wc as o,Hc as p,Gc as r,Zc as s,Jc as t,$c as u,Rs as v,W as w,$ as x,q as y};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,c as n,i as r,t as i}from"./local-settings-lVNyIOJ_.js";import{a,n as o,t as s}from"./device-settings-zXRxGDTH.js";import{o as c,t as l}from"./capture-error-B7QmSjOI.js";import{t as u}from"./react-DJZBPgpf.js";import{t as d}from"./useQuery-B45lW1Kk.js";import{n as f,t as p}from"./create-selectors-ClYkcuKo.js";import{A as m,F as h,I as g,M as ee,N as te,P as ne,S as re,_ as ie,a as ae,b as oe,d as _,g as se,j as ce,m as v,n as le,r as ue,s as de,t as fe,x as pe}from"./local-mode-Bvz5B1q8.js";import{t as y}from"./is-electron-BuSDabCt.js";import{n as b,t as me}from"./resolved-assistants-store-Cumv2SiX.js";import{n as he,r as x,t as ge}from"./api-errors-DbHkbHFH.js";import{a as _e,c as S,r as ve}from"./api-DFmFVk24.js";import{t as C}from"./client.gen-ZHFX_7TH.js";import{bt as ye}from"./sdk.gen-DlgJKwWW.js";import{n as be}from"./event-bus-BfBOaWo4.js";import{a as xe}from"./remote-gateway-session-BVFc4ZX7.js";import{i as Se,t as Ce}from"./dist-FjyBW1Qr.js";import{a as we}from"./routes-BnbYm-Mr.js";var w=p(f(()=>({assistantState:{kind:`loading`},operationalStatusAssistantId:null,expectingFirstMessage:!1}))),Te=new Set;function Ee(e){return Te.add(e),()=>{Te.delete(e)}}function De(){for(let e of Te)try{e()}catch{}}var Oe=new Set([502,503,504]),ke=`Connection interrupted. Reconnecting…`;function Ae(e){return e.code===`proxy_network_error`?!0:(typeof e.detail==`string`?e.detail:``).includes(`net::ERR_`)}function je(e){if(e.ok)switch(e.data.status){case`active`:return e.data.is_local?{kind:`self_hosted`}:{kind:`active`};case`initializing`:return{kind:`initializing`};case`to_be_deleted`:return{kind:`cleaning_up`};default:return{kind:`error`,message:`Unexpected assistant status: ${e.data.status}`}}return e.status===404?{kind:`auto_hatch`}:Ae(e.error)?{kind:`error`,transient:!0,message:ke}:{kind:`error`,message:x(e.error,void 0,`Failed to check assistant status.`)}}function Me(e){return e===void 0||e>=500}var Ne=`platform_hosted_disabled`,Pe=`We are at capacity for Vellum Managed Assistants, more will be available soon!`;function Fe(e,t){return e===503?t?.code===Ne:!1}var Ie=2e3,Le=3e4;function Re(e){return Math.min(Ie*2**e,Le)}var ze=3e5;function Be(){return{kind:`error`,message:`Your assistant is taking longer than expected to start. Please try again, or check the community for help.`}}var Ve=[`assistant`,`current`],He=3e3,Ue=new Set([`initializing`,`cleaning_up`]);function We(e){if(!e)return!1;let t=je(e);return Ue.has(t.kind)?He:!1}function Ge(e){return e?[...Ve,e]:Ve}function Ke(e){let t=e.selectedPlatformAssistantId??null;return d({queryKey:Ge(t),queryFn:()=>ve(t??void 0),enabled:e.enabled,retry:!1,refetchInterval:e=>We(e.state.data),refetchOnWindowFocus:!1})}var qe=new Set([`healthy`,`ok`]);function Je(e){if(!e.ok)return`unreachable`;let t=e.data?.status;return t!==void 0&&!qe.has(t)?`unhealthy`:`healthy`}function Ye(){let e=w.use.assistantState();return e.kind===`self_hosted`||e.kind===`active`&&e.isLocal?e.health??null:null}var T=e=>e===`authenticated`,Xe=e=>e!==`initializing`,E=e=>e===`present`,Ze=new Set([401,403,410]),Qe=e=>!e.ok&&e.status!==void 0&&Ze.has(e.status),$e=4e3,et=6e4,tt=5e3;function nt(){let e=/\/assistant(?:\/|$)/.exec(window.location.pathname),t=e&&e.index>0?window.location.pathname.slice(0,e.index).replace(/\/+$/,``):``;return`${window.location.origin}${t}`}var D=new class{state={kind:`loading`};generation=0;initializingTimeout=null;ready=!1;inputs={sessionStatus:`initializing`,hasPlatformSession:!1,queryClient:null,selectedPlatformAssistantId:null};probeTimer=null;healthHeartbeatTimer=null;healthHeartbeatId=null;healthHeartbeatToken=0;reachabilityProbeInFlightIds=new Set;probeLoopAssistantId=null;errorRetryTimer=null;errorRetryAttempt=0;constructor(){Ee(()=>this.onUnreachable()),be(`app.online`,()=>this.onNetworkOnline()),b.subscribe((e,t)=>{e.selectedAssistantId!==t.selectedAssistantId&&(!g()||this.state.kind===`loading`||this.applyGatewayAuthShortCircuit())})}setInputs(e){this.inputs=e,this.ready=!0}resetForLogout(){b.getState().activeAssistantId!==null&&b.getState().setActiveAssistantId(null),this.setOperationalStatusAssistantId(null),this.cancelProbeTimer(),this.probeLoopAssistantId=null,this.reachabilityProbeInFlightIds.clear(),this.state.kind!==`loading`&&this.transition({kind:`loading`}),this.clearExpectingFirstMessage()}async respondToInputs(){if(this.ready){if(!T(this.inputs.sessionStatus)){this.resetForLogout();return}if(g()){this.applyGatewayAuthShortCircuit();return}this.inputs.hasPlatformSession&&m(null),this.inputs.isOrgReady&&await this.checkAssistant()}}async applyServerResult(e){this.ready&&(this.state.kind!==`initializing`&&this.state.kind!==`cleaning_up`||await this.applyServerStateUpdate(e))}async checkAssistant(e){if(!this.ready)return;if(g()){this.applyGatewayAuthShortCircuit();return}let t=this.generation;try{let n=e??this.inputs.selectedPlatformAssistantId??null,r=await this.inputs.queryClient.fetchQuery({queryKey:Ge(n),queryFn:()=>ve(n??void 0),staleTime:0});if(t!==this.generation||n&&!r.ok&&r.status===404&&(b.getState().setSelectedAssistant(null),r=await this.inputs.queryClient.fetchQuery({queryKey:Ve,queryFn:()=>ve(),staleTime:0}),t!==this.generation))return;await this.applyServerStateUpdate(r)}catch(e){if(console.error(`Error checking assistant status:`,e),l(e,{context:`check_assistant`}),t!==this.generation||this.degradeOnTransportFailure())return;this.transition({kind:`error`,transient:!0,message:ke})}}degradeOnTransportFailure(){return this.state.kind===`active`?(this.triggerReachabilityProbe(),!0):this.state.kind===`initializing`||this.state.kind===`cleaning_up`}retryAssistant(){this.ready&&this.checkAssistant()}markExpectingFirstMessage(){w.getState().expectingFirstMessage||w.setState({expectingFirstMessage:!0})}clearExpectingFirstMessage(){w.getState().expectingFirstMessage&&w.setState({expectingFirstMessage:!1})}transition(e){let t=this.state.kind;this.state=e,w.setState({assistantState:e}),e.kind===`initializing`?t!==`initializing`&&this.armInitializingWatchdog():this.initializingTimeout&&=(clearTimeout(this.initializingTimeout),null),e.kind!==`initializing`&&e.kind!==`active`&&this.clearExpectingFirstMessage(),!(e.kind===`self_hosted`||e.kind===`active`&&e.isLocal)&&this.healthHeartbeatId!==null&&this.cancelHealthHeartbeat(),e.kind===`error`&&e.transient?this.armErrorRetry():this.clearErrorRetry(e.kind!==`error`)}clearErrorRetry(e){this.errorRetryTimer&&=(clearTimeout(this.errorRetryTimer),null),e&&(this.errorRetryAttempt=0)}armErrorRetry(){this.errorRetryTimer&&clearTimeout(this.errorRetryTimer);let e=Re(this.errorRetryAttempt);this.errorRetryAttempt+=1,this.errorRetryTimer=setTimeout(()=>{this.errorRetryTimer=null,this.checkAssistant()},e)}onNetworkOnline(){if(this.ready){if(this.state.kind===`error`&&this.state.transient){this.clearErrorRetry(!0),this.checkAssistant();return}this.state.kind===`active`&&this.state.reachable===!1&&this.checkAssistant()}}armInitializingWatchdog(){this.initializingTimeout&&clearTimeout(this.initializingTimeout),this.initializingTimeout=setTimeout(()=>{this.generation++,c(`Assistant stuck in initializing state`,{level:`warning`,extra:{timeoutMs:ze}}),this.transition(Be())},ze)}projectActive(e){let t=e.data.maintenance_mode,n=e.data.is_local??!1;m(null),this.setOperationalStatusAssistantId(e.data.id);let r=b.getState();r.upsertFromApi(e.data),r.setActiveAssistantId(e.data.id),this.transition({kind:`active`,isLocal:n,maintenanceMode:{enabled:t?.enabled}}),n?this.startHealthHeartbeat(e.data.id):this.probeReachability(e.data.id)}projectSelfHosted(e){this.setOperationalStatusAssistantId(null),m({url:e.data.ingress_url,token:e.data.platform_actor_token});let t=b.getState();t.upsertFromApi(e.data),t.setActiveAssistantId(e.data.id),this.transition({kind:`self_hosted`}),this.startHealthHeartbeat(e.data.id)}applyGatewayAuthShortCircuit(){let e=window.location.origin,t=`self`,n=ue();if(v())e=nt();else if(n){let r=de();e=`${window.location.origin}${n}`,t=r?.assistantId??t}m({url:e,token:te()}),this.setOperationalStatusAssistantId(null),b.getState().setActiveAssistantId(t),this.transition({kind:`active`,isLocal:!0}),this.startHealthHeartbeat(t)}async applyServerStateUpdate(e){let t=this.generation,n=je(e);if(!(n.kind===`error`&&n.transient&&this.degradeOnTransportFailure())&&(e.ok?this.setOperationalStatusAssistantId(e.data.id):this.setOperationalStatusAssistantId(null),n.kind!==`auto_hatch`)){if(n.kind===`active`&&e.ok){this.projectActive(e);return}if(n.kind===`self_hosted`&&e.ok){this.projectSelfHosted(e);return}t===this.generation&&n.kind!==`active`&&this.transition(n)}}async probeReachability(e){if(!this.reachabilityProbeInFlightIds.has(e)){this.reachabilityProbeInFlightIds.add(e);try{let t=this.generation,n;try{n=Je(await _e(e))}catch{n=`unreachable`}if(n===`unreachable`&&!v()){let t=await re(this.state.kind===`self_hosted`||this.state.kind===`active`&&this.state.isLocal?de()?.assistantId??e:e).catch(()=>null);if(t?.ok)switch(t.state){case`healthy`:n=`healthy`;break;case`sleeping`:case`starting`:case`crashed`:n=t.state;break;case`unknown`:break}}if(t!==this.generation||b.getState().activeAssistantId!==e)return;if(this.state.kind===`self_hosted`){this.state.health!==n&&this.transition({...this.state,health:n});return}if(this.state.kind!==`active`)return;let r=n===`healthy`||n===`unhealthy`;if(this.state.reachable===r&&this.state.health===n)return;this.transition({...this.state,reachable:r,health:n})}finally{this.reachabilityProbeInFlightIds.delete(e)}}}cancelProbeTimer(){this.probeTimer&&=(clearTimeout(this.probeTimer),null)}startProbeLoop(e){if(this.probeLoopAssistantId===e)return;this.cancelProbeTimer(),this.probeLoopAssistantId=e;let t=Date.now(),n=()=>{this.probeLoopAssistantId=null},r=async()=>{if(this.state.kind!==`active`||this.state.reachable===!0){n();return}if(Date.now()-t>et){n();return}await this.probeReachability(e);let i=this.state;if(i.kind!==`active`||i.reachable===!0){n();return}if(Date.now()-t>et){n();return}this.probeTimer=setTimeout(()=>void r(),$e)};this.probeTimer=setTimeout(()=>void r(),$e)}startHealthHeartbeat(e){if(this.healthHeartbeatId===e)return;this.cancelHealthHeartbeat(),this.healthHeartbeatId=e;let t=this.healthHeartbeatToken,n=async()=>{t===this.healthHeartbeatToken&&(await this.probeReachability(e),t===this.healthHeartbeatToken&&(this.healthHeartbeatTimer=setTimeout(()=>void n(),tt)))};n()}cancelHealthHeartbeat(){this.healthHeartbeatToken++,this.healthHeartbeatId=null,this.healthHeartbeatTimer&&=(clearTimeout(this.healthHeartbeatTimer),null)}onUnreachable(){this.triggerReachabilityProbe()}triggerReachabilityProbe(){if(this.state.kind!==`active`)return;let e=b.getState().activeAssistantId;if(e){if(this.transition({...this.state,reachable:!1}),this.healthHeartbeatId===e){this.probeReachability(e);return}this.startProbeLoop(e)}}__resetForTesting(){this.initializingTimeout&&=(clearTimeout(this.initializingTimeout),null),this.cancelProbeTimer(),this.cancelHealthHeartbeat(),this.probeLoopAssistantId=null,this.reachabilityProbeInFlightIds.clear(),this.clearErrorRetry(!0),this.state={kind:`loading`},this.generation=0,this.ready=!1,w.setState({expectingFirstMessage:!1,operationalStatusAssistantId:null}),this.inputs={sessionStatus:`initializing`,hasPlatformSession:!1,queryClient:null},w.setState({assistantState:this.state}),b.setState({activeAssistantId:null})}setOperationalStatusAssistantId(e){w.getState().operationalStatusAssistantId!==e&&w.setState({operationalStatusAssistantId:e})}};function rt(e){let{assistants:t,selectedAssistantId:n,assistantsHydrated:r}=b.getState(),i=me(t,e),a=e=>i.some(t=>t.id===e);if(n!==null){let e=t.some(e=>e.id===n);if(a(n)||!e&&!r)return n}let o=fe()?.assistantId??null;return o!==null&&a(o)?o:i[0]?.id??null}async function O(e){b.getState().setSelectedAssistant(e),e!==null&&await oe(e)}var it={bodySerializer:e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t)};Object.entries({$body_:`body`,$headers_:`headers`,$path_:`path`,$query_:`query`});function at({onRequest:e,onSseError:t,onSseEvent:n,responseTransformer:r,responseValidator:i,sseDefaultRetryDelay:a,sseMaxRetryAttempts:o,sseMaxRetryDelay:s,sseSleepFn:c,url:l,...u}){let d,f=c??(e=>new Promise(t=>setTimeout(t,e)));return{stream:async function*(){let c=a??3e3,p=0,m=u.signal??new AbortController().signal;for(;!m.aborted;){p++;let a=u.headers instanceof Headers?u.headers:new Headers(u.headers);d!==void 0&&a.set(`Last-Event-ID`,d);try{let t={redirect:`follow`,...u,body:u.serializedBody,headers:a,signal:m},o=new Request(l,t);e&&(o=await e(l,t));let s=await(u.fetch??globalThis.fetch)(o);if(!s.ok)throw Error(`SSE failed: ${s.status} ${s.statusText}`);if(!s.body)throw Error(`No body in SSE response`);let f=s.body.pipeThrough(new TextDecoderStream).getReader(),p=``,h=()=>{try{f.cancel()}catch{}};m.addEventListener(`abort`,h);try{for(;;){let{done:e,value:t}=await f.read();if(e)break;p+=t,p=p.replace(/\r\n?/g,`
|
|
2
|
-
`);let a=p.split(`
|
|
3
|
-
|
|
4
|
-
`);p=a.pop()??``;for(let e of a){let t=e.split(`
|
|
5
|
-
`),a=[],o;for(let e of t)if(e.startsWith(`data:`))a.push(e.replace(/^data:\s*/,``));else if(e.startsWith(`event:`))o=e.replace(/^event:\s*/,``);else if(e.startsWith(`id:`))d=e.replace(/^id:\s*/,``);else if(e.startsWith(`retry:`)){let t=Number.parseInt(e.replace(/^retry:\s*/,``),10);Number.isNaN(t)||(c=t)}let s,l=!1;if(a.length){let e=a.join(`
|
|
6
|
-
`);try{s=JSON.parse(e),l=!0}catch{s=e}}l&&(i&&await i(s),r&&(s=await r(s))),n?.({data:s,event:o,id:d,retry:c}),a.length&&(yield s)}}}finally{m.removeEventListener(`abort`,h),f.releaseLock()}break}catch(e){if(t?.(e),o!==void 0&&p>=o)break;await f(Math.min(c*2**(p-1),s??3e4))}}}()}}var ot=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},st=e=>{switch(e){case`form`:return`,`;case`pipeDelimited`:return`|`;case`spaceDelimited`:return`%20`;default:return`,`}},ct=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},lt=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let t=(e?i:i.map(e=>encodeURIComponent(e))).join(st(r));switch(r){case`label`:return`.${t}`;case`matrix`:return`;${n}=${t}`;case`simple`:return t;default:return`${n}=${t}`}}let a=ot(r),o=i.map(t=>r===`label`||r===`simple`?e?t:encodeURIComponent(t):k({allowReserved:e,name:n,value:t})).join(a);return r===`label`||r===`matrix`?a+o:o},k=({allowReserved:e,name:t,value:n})=>{if(n==null)return``;if(typeof n==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},ut=({allowReserved:e,explode:t,name:n,style:r,value:i,valueOnly:a})=>{if(i instanceof Date)return a?i.toISOString():`${n}=${i.toISOString()}`;if(r!==`deepObject`&&!t){let t=[];Object.entries(i).forEach(([n,r])=>{t=[...t,n,e?r:encodeURIComponent(r)]});let a=t.join(`,`);switch(r){case`form`:return`${n}=${a}`;case`label`:return`.${a}`;case`matrix`:return`;${n}=${a}`;default:return a}}let o=ct(r),s=Object.entries(i).map(([t,i])=>k({allowReserved:e,name:r===`deepObject`?`${n}[${t}]`:t,value:i})).join(o);return r===`label`||r===`matrix`?o+s:s},dt=/\{[^{}]+\}/g,ft=({path:e,url:t})=>{let n=t,r=t.match(dt);if(r)for(let t of r){let r=!1,i=t.substring(1,t.length-1),a=`simple`;i.endsWith(`*`)&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(`.`)?(i=i.substring(1),a=`label`):i.startsWith(`;`)&&(i=i.substring(1),a=`matrix`);let o=e[i];if(o==null)continue;if(Array.isArray(o)){n=n.replace(t,lt({explode:r,name:i,style:a,value:o}));continue}if(typeof o==`object`){n=n.replace(t,ut({explode:r,name:i,style:a,value:o,valueOnly:!0}));continue}if(a===`matrix`){n=n.replace(t,`;${k({name:i,value:o})}`);continue}let s=encodeURIComponent(a===`label`?`.${o}`:o);n=n.replace(t,s)}return n},pt=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let a=i.startsWith(`/`)?i:`/${i}`,o=(e??``)+a;t&&(o=ft({path:t,url:o}));let s=n?r(n):``;return s.startsWith(`?`)&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function mt(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return`serializedBody`in e?e.serializedBody!==void 0&&e.serializedBody!==``?e.serializedBody:null:e.body===``?null:e.body;if(t)return e.body}var ht=async(e,t)=>{let n=typeof t==`function`?await t(e):t;if(n)return e.scheme===`bearer`?`Bearer ${n}`:e.scheme===`basic`?`Basic ${btoa(n)}`:n},gt=({parameters:e={},...t}={})=>n=>{let r=[];if(n&&typeof n==`object`)for(let i in n){let a=n[i];if(a==null)continue;let o=e[i]||t;if(Array.isArray(a)){let e=lt({allowReserved:o.allowReserved,explode:!0,name:i,style:`form`,value:a,...o.array});e&&r.push(e)}else if(typeof a==`object`){let e=ut({allowReserved:o.allowReserved,explode:!0,name:i,style:`deepObject`,value:a,...o.object});e&&r.push(e)}else{let e=k({allowReserved:o.allowReserved,name:i,value:a});e&&r.push(e)}}return r.join(`&`)},_t=e=>{if(!e)return`stream`;let t=e.split(`;`)[0]?.trim();if(t){if(t.startsWith(`application/json`)||t.endsWith(`+json`))return`json`;if(t===`multipart/form-data`)return`formData`;if([`application/`,`audio/`,`image/`,`video/`].some(e=>t.startsWith(e)))return`blob`;if(t.startsWith(`text/`))return`text`}},vt=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get(`Cookie`)?.includes(`${t}=`)):!1,yt=async({security:e,...t})=>{for(let n of e){if(vt(t,n.name))continue;let e=await ht(n,t.auth);if(!e)continue;let r=n.name??`Authorization`;switch(n.in){case`query`:t.query||={},t.query[r]=e;break;case`cookie`:t.headers.append(`Cookie`,`${r}=${e}`);break;default:t.headers.set(r,e);break}}},bt=e=>pt({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==`function`?e.querySerializer:gt(e.querySerializer),url:e.url}),xt=(e,t)=>{let n={...e,...t};return n.baseUrl?.endsWith(`/`)&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=Ct(e.headers,t.headers),n},St=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},Ct=(...e)=>{let t=new Headers;for(let n of e){if(!n)continue;let e=n instanceof Headers?St(n):Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,typeof r==`object`?JSON.stringify(r):r)}return t},wt=class{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){let t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e==`number`?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){let n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}},Tt=()=>({error:new wt,request:new wt,response:new wt}),Et=gt({allowReserved:!1,array:{explode:!0,style:`form`},object:{explode:!0,style:`deepObject`}}),Dt={"Content-Type":`application/json`},Ot=(e={})=>({...it,headers:Dt,parseAs:`auto`,querySerializer:Et,...e}),A=((e={})=>{let t=xt(Ot(),e),n=()=>({...t}),r=e=>(t=xt(t,e),n()),i=Tt(),a=async e=>{let n={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:Ct(t.headers,e.headers),serializedBody:void 0};n.security&&await yt({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody===``)&&n.headers.delete(`Content-Type`);let r=n;return{opts:r,url:bt(r)}},o=async e=>{let n=e.throwOnError??t.throwOnError,r=e.responseStyle??t.responseStyle,o,s;try{let{opts:t,url:n}=await a(e),r={redirect:`follow`,...t,body:mt(t)};o=new Request(n,r);for(let e of i.request.fns)e&&(o=await e(o,t));let c=t.fetch;s=await c(o);for(let e of i.response.fns)e&&(s=await e(s,o,t));let l={request:o,response:s};if(s.ok){let e=(t.parseAs===`auto`?_t(s.headers.get(`Content-Type`)):t.parseAs)??`json`;if(s.status===204||s.headers.get(`Content-Length`)===`0`){let n;switch(e){case`arrayBuffer`:case`blob`:case`text`:n=await s[e]();break;case`formData`:n=new FormData;break;case`stream`:n=s.body;break;default:n={};break}return t.responseStyle===`data`?n:{data:n,...l}}let n;switch(e){case`arrayBuffer`:case`blob`:case`formData`:case`text`:n=await s[e]();break;case`json`:{let e=await s.text();n=e?JSON.parse(e):{};break}case`stream`:return t.responseStyle===`data`?s.body:{data:s.body,...l}}return e===`json`&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),t.responseStyle===`data`?n:{data:n,...l}}let u=await s.text(),d;try{d=JSON.parse(u)}catch{}throw d??u}catch(t){let a=t;for(let t of i.error.fns)t&&(a=await t(a,s,o,e));if(a||={},n)throw a;return r===`data`?void 0:{error:a,request:o,response:s}}},s=e=>t=>o({...t,method:e}),c=e=>async t=>{let{opts:n,url:r}=await a(t);return at({...n,body:n.body,method:e,onRequest:async(e,t)=>{let r=new Request(e,t);for(let e of i.request.fns)e&&(r=await e(r,n));return r},serializedBody:mt(n),url:r})};return{buildUrl:e=>bt({...t,...e}),connect:s(`CONNECT`),delete:s(`DELETE`),get:s(`GET`),getConfig:n,head:s(`HEAD`),interceptors:i,options:s(`OPTIONS`),patch:s(`PATCH`),post:s(`POST`),put:s(`PUT`),request:o,setConfig:r,sse:{connect:c(`CONNECT`),delete:c(`DELETE`),get:c(`GET`),head:c(`HEAD`),options:c(`OPTIONS`),patch:c(`PATCH`),post:c(`POST`),put:c(`PUT`),trace:c(`TRACE`)},trace:s(`TRACE`)}})(Ot()),kt=e=>(e.client??A).get({url:`/_allauth/{client}/v1/auth/provider/signup`,...e}),At=e=>(e.client??A).post({url:`/_allauth/{client}/v1/auth/provider/signup`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),jt=e=>(e.client??A).delete({url:`/_allauth/{client}/v1/auth/session`,...e}),Mt=e=>(e.client??A).get({url:`/_allauth/{client}/v1/auth/session`,...e}),j=()=>y()?`app`:`browser`;function Nt(e){return!e.ok&&e.status===409}function M(e,t){let n=e;if(n&&Array.isArray(n.errors))return{ok:!1,status:t,errors:n.errors};let r=n?.data;return r&&Array.isArray(r.flows)?{ok:!1,status:t,errors:[],flows:r.flows}:{ok:!1,status:t,errors:[]}}async function N(){let{data:e,error:t,response:n}=await Mt({path:{client:j()}});return e?{ok:!0,data:e.data}:M(t,n?.status)}async function Pt(){let{data:e,error:t,response:n}=await jt({path:{client:j()}});return e?{ok:!0,data:e}:n?.status===401?{ok:!0,data:{}}:M(t,n?.status)}async function Ft(){let{data:e,error:t,response:n}=await kt({path:{client:j()}});return e?{ok:!0,data:e.data}:M(t,n?.status)}async function It({email:e,username:t}){let{data:n,error:r,response:i}=await At({path:{client:j()},body:{email:e,username:t}});return n?{ok:!0,data:n.data}:M(r,i?.status)}var Lt=`vellum:auth:userSnapshot`;function Rt(e){if(e)try{localStorage.setItem(Lt,JSON.stringify(e))}catch{}}function zt(){try{let e=localStorage.getItem(Lt);if(!e)return null;let t=JSON.parse(e);return!t||typeof t!=`object`?null:{id:typeof t.id==`string`?t.id:null,username:typeof t.username==`string`?t.username:null,email:typeof t.email==`string`?t.email:null,isStaff:t.isStaff===!0,firstName:typeof t.firstName==`string`?t.firstName:``,lastName:typeof t.lastName==`string`?t.lastName:``}}catch{return null}}function P(){try{localStorage.removeItem(Lt)}catch{}}var F;function Bt(){return y()?(F===void 0&&(F=window.vellum?.auth?.getSessionToken?.()??null),F):null}function Vt(e){F=e}var Ht=`__Secure-csrftoken`;function I(){return document.cookie.split(`; `).findLast(e=>e.startsWith(`${Ht}=`))?.split(`=`).slice(1).join(`=`)}function Ut(){document.cookie.split(`; `).filter(e=>e.startsWith(`${Ht}=`)).length>1&&(document.cookie=`${Ht}=; path=/; max-age=0; secure`)}var Wt=null;async function Gt(){y()||g()||(Ut(),!I()&&(Wt||=(async()=>{for(let e=0;e<2;e++)try{if(await Mt({path:{client:`browser`}}),I())return}catch{console.warn(`CSRF cookie bootstrap failed (attempt ${e+1}/2)`),e===0&&await new Promise(e=>setTimeout(e,500))}})().finally(()=>{Wt=null}),await Wt))}var Kt=`/_allauth/browser/v1/auth/provider/redirect`;function qt(e,t,n,r={}){let i={provider:e,callback_url:new URL(t,n).href,process:`login`};return r.intent&&(i.intent=r.intent),r.loginHint&&(i.login_hint=r.loginHint),r.providerHint&&(i.provider_hint=r.providerHint),i}function Jt(e){if(!e)throw Error(`Unable to start provider redirect: CSRF token is missing. The session may not be initialized. Please refresh the page and try again.`)}async function Yt(e,t,n={}){await Gt();let r=I();Jt(r);let i=window.location.origin,a=document.createElement(`form`);a.method=`POST`,a.action=`${i}${Kt}`;let o=qt(e,t,i,n);o.csrfmiddlewaretoken=r;for(let[e,t]of Object.entries(o)){let n=document.createElement(`input`);n.type=`hidden`,n.name=e,n.value=t,a.appendChild(n)}document.body.appendChild(a),a.submit()}function Xt(e,t){return e?{kind:`authenticated`}:t.some(e=>e.id===`provider_signup`&&e.is_pending)?{kind:`provider_signup`}:{kind:`error`,message:`Unexpected authentication state.`}}function Zt(e){return e===`vellum.ai`||e.endsWith(`.vellum.ai`)}var Qt=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//;function $t(e,t){if(!e)return t;if(Qt.test(e)){try{let t=new URL(e);if(t.protocol===`https:`&&Zt(t.hostname))return e}catch{}return t}return e.startsWith(`//`)||e.includes(`\\`)||!e.startsWith(`/`)?t:e}var en=`https://www.vellum.ai`,tn=`vellum:loopback:state`,nn=`vellum:loopback:returnTo`;function rn(){let e=window.__VELLUM_CONFIG__;return e?.webUrl?{webUrl:e.webUrl}:{webUrl:en}}function an(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}function on(){return rn().webUrl===window.location.origin}async function sn(e,t){let{webUrl:n}=rn(),r=an(),i=window.location.port||`3000`;sessionStorage.setItem(tn,r),e&&sessionStorage.setItem(nn,e);let a=`/accounts/cli/callback?port=${i}&state=${r}`,o=`${n}/account/${t?.intent===`signup`?`signup`:`login`}?returnTo=${encodeURIComponent(a)}`;window.location.href=o}async function cn(e){y()&&await window.vellum?.menu.setPlatformSession(e)}var ln=e(u(),1),un=Se(`NativeAuth`),dn=we.assistant,fn=!1;function pn(){return fn}function mn(){return`${window.location.protocol}//${window.location.host}`}function L(){return typeof window<`u`&&Ce.isNativePlatform()}var hn=()=>()=>{};function gn(){return(0,ln.useSyncExternalStore)(hn,L,()=>!1)}async function _n(e){let t=e?.baseURL??mn(),{sessionToken:n}=await un.startAuth({baseURL:t,...e?.loginHint?{loginHint:e.loginHint}:{},...e?.providerHint?{providerHint:e.providerHint}:{},...e?.intent?{intent:e.intent}:{}});yn(n),L()&&await vn(),B()&&await wn(n);let r=$t(e?.returnTo??null,dn);window.location.href=r}async function vn(){for(let e=0;e<6;e++){try{let e=await N();if(e.ok&&e.data.user)return}catch{}await new Promise(t=>setTimeout(t,50*(e+1)))}}function yn(e){let t=`path=/; domain=.vellum.ai; secure; samesite=lax; max-age=1209600`;document.cookie=`sessionid=${e}; ${t}`,document.cookie=`__Secure-sessionid=${e}; ${t}`}function bn(){if(typeof document>`u`)return null;let e=document.cookie.split(`; `);for(let t of[`__Secure-sessionid`,`sessionid`]){let n=e.find(e=>e.startsWith(`${t}=`));if(n){let e=n.slice(t.length+1);if(e)return e}}return null}async function xn(e,t,n={}){if(L()){try{await _n({returnTo:n.intent===`signup`?we.onboarding.privacy:n.returnTo??null,loginHint:n.loginHint,providerHint:n.providerHint,intent:n.intent})}catch(e){if(e?.code===`USER_CANCELLED`)return;throw e}return}if(y()&&window.vellum?.auth?.startOAuth){fn=!0;try{let e=await window.vellum.auth.startOAuth({providerHint:n.providerHint,loginHint:n.loginHint,intent:n.intent});if(e?.sessionToken){Vt(e.sessionToken),await cn(!0);let t=$t(n.intent===`signup`?we.onboarding.privacy:n.returnTo??null,dn);window.location.href=t}}finally{fn=!1}return}if(_()&&!on()){await sn(n.returnTo??void 0,{intent:n.intent});return}await Yt(e,t,n)}var R=Se(`NativeBiometric`),Sn=`vellum.ai`;async function Cn(){if(!L())return!1;try{let{available:e}=await R.isAvailable();return e}catch{return!1}}async function wn(e){if(!await Cn())return!1;try{return await R.storeToken({token:e,server:Sn}),!0}catch(e){return console.error(`[native-biometric] failed to store token:`,e),!1}}var z=null;async function Tn(){return L()?z||(z=(async()=>{try{let{token:e}=await R.retrieveToken({server:Sn,reason:`Sign in to Vellum`});return e}catch{return null}finally{z=null}})(),z):null}async function En(){if(L())try{await R.deleteToken({server:Sn})}catch{}}function B(){return o(`biometricEnabled`,!0)}function Dn(e){a(`biometricEnabled`,e)}async function On(){if(!L())return`Biometrics`;try{let{biometryType:e}=await R.isAvailable();switch(e){case`faceId`:return`Face ID`;case`touchId`:return`Touch ID`;case`opticId`:return`Optic ID`;default:return`Biometrics`}}catch{return`Biometrics`}}function kn(e){return e}function V(e,t,n){if(!e||typeof e!=`object`||Array.isArray(e))return{code:null,message:n};let r=kn(e),i=r[t];if(Array.isArray(i)&&i.length>0){let e=i[0];if(typeof e==`string`)return{code:null,message:e};if(e&&typeof e==`object`&&!Array.isArray(e)){let t=kn(e),r=t.code,i=t.string??t.message;return{code:typeof r==`string`?r:null,message:typeof i==`string`?i:n}}}return typeof r.detail==`string`?{code:null,message:r.detail}:{code:null,message:n}}var An={too_short:`Must be at least 3 characters.`,too_long:`Must be at most 30 characters.`,invalid_chars:`Use only lowercase letters, digits, hyphens, and underscores.`,leading_underscore:`Cannot start with an underscore.`,trailing_underscore:`Cannot end with an underscore.`,leading_hyphen:`Cannot start with a hyphen.`,trailing_hyphen:`Cannot end with a hyphen.`,all_digits:`Cannot be all digits.`,reserved:`This handle is reserved.`,taken:`This handle is already taken.`};async function jn(){let{data:e,error:t,response:n}=await C.get({url:`/v1/user/me/`,throwOnError:!1});if(he(n,t,`Failed to load profile.`),!n.ok||!e)throw new ge(n.status,x(t,n,`Failed to load profile.`));return e}var Mn=`Please choose a different handle.`;async function Nn(e){let{data:t,error:n,response:r}=await C.patch({url:`/v1/user/me/`,body:e,throwOnError:!1});if(!r)return{kind:`error`,message:x(n,void 0,`Failed to save profile.`)??`Failed to save profile.`};if(r.ok&&t)return{kind:`ok`,data:t};if(r.status===409){let{message:e}=V(n,`username`,An.taken);return{kind:`taken`,message:e}}if(r.status===400){let{code:e,message:t}=V(n,`username`,Mn);return{kind:`invalid`,code:e,message:t}}return{kind:`error`,message:x(n,r,`Failed to save profile.`)}}async function Pn(e){await C.patch({url:`/v1/user/me/`,body:{consent:e},throwOnError:!0})}async function Fn(e,t){let{data:n,error:r,response:i}=await C.get({url:`/v1/user/username-available/`,query:{username:e},signal:t,throwOnError:!1});if(he(i,r,`Failed to check handle availability.`),!i.ok||!n)throw new ge(i.status,i.status===429?`Too many checks — try again in a moment.`:x(r,i,`Failed to check handle availability.`));return n}function In(e){y()&&window.vellum?.diagnostics?.setShareDiagnostics(e)}var Ln=s(`shareAnalytics`),Rn=s(`shareDiagnostics`),zn=f()(e=>({shareAnalytics:i(Ln,!0),shareDiagnostics:i(Rn,!0),tosAccepted:!1,aiDataConsent:!1,setShareAnalytics:n=>{e({shareAnalytics:n}),t(Ln,n)},setShareDiagnostics:n=>{e({shareDiagnostics:n}),t(Rn,n),In(n)},setTosAccepted:t=>{e({tosAccepted:t})},setAiDataConsent:t=>{e({aiDataConsent:t})}})),H=p(zn),Bn=new Map([[Ln,`shareAnalytics`],[Rn,`shareDiagnostics`]]),Vn={shareAnalytics:!0,shareDiagnostics:!0};for(let[e,t]of Bn)n(e,()=>{let n=i(e,Vn[t]??!1);zn.setState({[t]:n})});var U=`2026-06-08`;function W(e,t){return`device:consent:${e}:v${U}:${t}`}function Hn(e){if(typeof window>`u`||!e)return{tos:!1,ai:!1};try{let t=i(W(`tos`,e),!1),n=i(W(`ai`,e),!1);if(t||n)return{tos:t,ai:n};let r=i(`vellum:onboarding:tosAccepted`,!1),a=i(`vellum:onboarding:aiDataConsent`,!1);return r||a?(Un(e,r,a),{tos:r,ai:a}):{tos:!1,ai:!1}}catch{return{tos:!1,ai:!1}}}function Un(e,n,r){if(!(typeof window>`u`||!e))try{t(W(`tos`,e),n),t(W(`ai`,e),r)}catch{}}function Wn(e){if(r(`vellum:onboarding:tosAccepted`),r(`vellum:onboarding:aiDataConsent`),r(`vellum:onboarding:selectedVersion`),!(typeof window>`u`||!e))try{r(W(`tos`,e)),r(W(`ai`,e))}catch{}}function Gn(e){return e?{tos:e.tos_accepted_version===`2026-06-08`&&e.privacy_policy_accepted_version===`2026-06-08`,ai:e.ai_data_sharing_accepted_version===U,shareAnalytics:e.share_analytics,shareDiagnostics:e.share_diagnostics}:{tos:!1,ai:!1,shareAnalytics:null,shareDiagnostics:null}}function Kn(e){let t=H.getState();t.setTosAccepted(e.tos),t.setAiDataConsent(e.ai),t.setShareAnalytics(e.shareAnalytics),t.setShareDiagnostics(e.shareDiagnostics),Un(e.userId,e.tos,e.ai),e.hasPlatformSession&&Pn({tos_accepted_version:e.tos?U:``,privacy_policy_accepted_version:e.tos?U:``,ai_data_sharing_accepted_version:e.ai?U:``,share_analytics:e.shareAnalytics,share_diagnostics:e.shareDiagnostics}).catch(()=>{})}function qn(e,t,n){let r=H.getState();e===`share_analytics`?(r.setShareAnalytics(t),a(`shareAnalytics`,t)):(r.setShareDiagnostics(t),a(`shareDiagnostics`,t)),n&&Pn({[e]:t}).catch(()=>{})}var Jn=`vellum_active_organization_id`;function Yn(){return globalThis.sessionStorage===void 0?null:globalThis.sessionStorage}function Xn(){let e=Yn();if(!e)return null;try{return e.getItem(Jn)}catch{return null}}function Zn(e){let t=Yn();if(t)try{t.setItem(Jn,e)}catch{}}function Qn(){let e=Yn();if(e)try{e.removeItem(Jn)}catch{}}function $n(e,t){return e.length===0?null:t&&e.some(e=>e.id===t)?t:e[0].id}var G=p(f()((e,t)=>({organizations:[],currentOrganizationId:null,status:`idle`,error:null,fetchOrganizations:async()=>{e({status:`loading`,error:null});try{let n=(await ye()).data?.results??[],r=$n(n,t().currentOrganizationId??Xn());r&&Zn(r),e({organizations:n,currentOrganizationId:r,status:r?`ready`:`error`,error:r?null:`No organization available for this user.`})}catch(t){e({status:`error`,error:t instanceof Error&&t.message?t.message:`Failed to load organizations.`})}},setCurrentOrganizationId:n=>{let{organizations:r}=t();r.some(e=>e.id===n)&&(Zn(n),e({currentOrganizationId:n,status:`ready`}))},clearOrganization:()=>{Qn(),e({organizations:[],currentOrganizationId:null,status:`idle`,error:null})}})));function er(){return G.getState().currentOrganizationId??Xn()}function tr(){G.getState().clearOrganization()}function nr(){let e=0,t=G.subscribe(t=>{(t.status===`ready`||t.status===`error`)&&(e=Date.now())}),n=$.subscribe((e,t)=>{let n=E(e.platformSession),r=E(t.platformSession);n&&(!r||e.user?.id!==t.user?.id)&&G.getState().fetchOrganizations()}),r=()=>{if(!E($.getState().platformSession))return;let{status:t}=G.getState();(t===`ready`||t===`error`)&&Date.now()-e>1e4&&G.getState().fetchOrganizations()},i=be(`app.resume`,()=>{r()});return()=>{t(),n(),i()}}var rr=`vellum:`,ir=[`onboarding.`,`voice:`,`gw:`,`ff:client:`,`local:`,`integrations.`,`vellumDebug.`,`vellum_`],ar=new Set([`vellum_theme`,`vellum_share_analytics`,`vellum_share_diagnostics`,`vellum_biometric_enabled`,`vellum_llm_log_retention`,`vellum_timezone`,`vellum_media_embeds_enabled`,`vellum_media_embed_domains`,`onboarding.lastUserId`]);function or(e){return e.startsWith(rr)?!0:ar.has(e)?!1:ir.some(t=>e.startsWith(t))}function sr(){try{sessionStorage.clear()}catch{}try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n&&or(n)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e))}catch{}}function cr(e){return e?.id??e?.email??e?.username??null}function K(e){return e?{id:cr(e),username:e.username??null,email:e.email??null,isStaff:e.is_staff??!1,firstName:e.first_name??``,lastName:e.last_name??``}:null}var lr=null,q=null,ur=!1,dr={id:`gateway-local`,username:`local`,email:null,isStaff:!1,firstName:`Local`,lastName:`User`},J=e=>(Rt(e),{sessionStatus:`authenticated`,user:e,platformSession:`present`}),Y=()=>({sessionStatus:`authenticated`,user:dr}),X=()=>({sessionStatus:`unauthenticated`,user:null,platformSession:`absent`}),Z=e=>e===null||!e.ok&&!Qe(e);async function fr(e){if(!Bt())return!1;let t=zt();return t?(await Q(t.id),e(J(t)),!0):!1}function pr(e){(!e||lr&&lr!==e)&&tr(),lr=e}function mr(){q?.postMessage(`auth-changed`)}async function Q(e){if(e)try{let t=await jn();if(t.consent){let n=Gn(t.consent),r=H.getState();r.setTosAccepted(n.tos),r.setAiDataConsent(n.ai),n.shareAnalytics!==null&&r.setShareAnalytics(n.shareAnalytics),n.shareDiagnostics!==null&&r.setShareDiagnostics(n.shareDiagnostics),Un(e,n.tos,n.ai),pr(e);return}let n=Hn(e),r=H.getState();r.setTosAccepted(n.tos),r.setAiDataConsent(n.ai),n.tos&&n.ai&&Pn({tos_accepted_version:U,privacy_policy_accepted_version:U,ai_data_sharing_accepted_version:U}).catch(()=>{}),pr(e);return}catch{}let t=Hn(e),n=H.getState();n.setTosAccepted(t.tos),n.setAiDataConsent(t.ai),pr(e)}var hr=0;Promise.resolve();function gr(e,t={}){let n=++hr,r=()=>n!==hr;N().then(async n=>{if(!r())if(n.ok&&n.data.user){let i=K(n.data.user),a=t.setUserOnSuccess?{user:i}:{};if(t.setUserOnSuccess&&Rt(i),_()){let e=!1,t=()=>!e&&!r();try{await Promise.race([(async()=>{await G.getState().fetchOrganizations();let e=await S();t()&&e.ok&&await pe(e.data,G.getState().currentOrganizationId??void 0,t)})(),new Promise((t,n)=>setTimeout(()=>{e=!0,n(Error(`sync timeout`))},3e3))])}catch{}}if(r())return;e({platformSession:`present`,...a})}else t.clearOnFailure&&e({platformSession:`absent`})}).catch(()=>{r()||t.clearOnFailure&&e({platformSession:`absent`})}).finally(()=>{r()||e(e=>e.platformSession===`unknown`?{platformSession:`absent`}:{})})}function _r(e,t){!_()||h()||ae().length>0?gr(e,t):e({platformSession:`absent`})}async function vr(){try{if(await xe())return!0}catch{}return te()!==null}var $=p(f()((e,t)=>({sessionStatus:`initializing`,user:null,platformSession:`unknown`,initSession:async()=>{if(v()){await vr()?e({...Y(),platformSession:`absent`}):e(X());return}if(h()){try{await se(),e(Y())}catch{e({sessionStatus:`unauthenticated`,user:null})}_r(e);return}if(_()&&!h()){if(ae().length>0){let t=null;try{if(t=await N(),t.ok&&t.data.user){let n=K(t.data.user);await Q(n?.id??null);try{await G.getState().fetchOrganizations();let e=await S();e.ok&&await pe(e.data,G.getState().currentOrganizationId??void 0)}catch{}e(J(n));return}}catch{}if(Z(t)){if(await fr(e))return}else P();e(X());return}e(Y()),ur?e({platformSession:`absent`}):gr(e,{setUserOnSuccess:!0}),ur=!1;return}let t=null;try{if(t=await N(),t.ok&&t.data.user){let n=K(t.data.user);await Q(n?.id??null);try{await G.getState().fetchOrganizations();let e=await S();e.ok&&b.getState().setFromApi(e.data)}catch{}e(J(n));return}}catch(e){console.error(`auth.initSession failed`,e)}if(!(Z(t)&&await fr(e))){if(L()&&B())try{let t=await Tn();if(t){yn(t),await vn();let n=await N();if(n.ok&&n.data.user){let t=K(n.data.user);await Q(t?.id??null);try{await G.getState().fetchOrganizations();let e=await S();e.ok&&b.getState().setFromApi(e.data)}catch{}e(J(t));return}}}catch(e){console.warn(`auth.initSession biometric recovery failed`,e)}await Q(null),Z(t)||P(),e(X())}},connectLocalAssistant:async t=>{await ie(le().find(e=>e.assistantId===t)),await O(t),e(Y()),await D.checkAssistant(),_r(e)},connectPlatformAssistant:async t=>{await O(t);let n=await N();if(!n.ok||!n.data.user)throw Error(`Platform authentication required`);let r=K(n.data.user);await Q(r?.id??null),await G.getState().fetchOrganizations(),e(J(r))},refreshSession:async()=>{if(v())return await vr()?(e({...Y(),platformSession:`absent`}),!0):(e(X()),!1);if(g()){try{await ee(ne()),e({sessionStatus:`authenticated`})}catch{return e(X()),!1}return _r(e,{clearOnFailure:!0}),!0}let n=null;try{if(n=await N(),n.ok&&n.data.user){let t=K(n.data.user);if(await Q(t?.id??null),_())try{await G.getState().fetchOrganizations();let e=await S();e.ok&&await pe(e.data,G.getState().currentOrganizationId??void 0)}catch{}return e(J(t)),!0}}catch(e){console.warn(`auth.refreshSession failed`,e)}if(Z(n))return T(t().sessionStatus);if(h()){let n=T(t().sessionStatus);return n&&(P(),e({...Y(),platformSession:`absent`})),n}return P(),await Q(null),e(X()),!1},logout:async()=>{if(g()){D.resetForLogout(),await O(null),ce(),tr(),sr(),e(X()),mr();return}ur=!0;try{await Pt()}finally{y()&&await window.vellum?.auth?.signOut?.(),_()&&(document.cookie=`sessionid=; path=/; samesite=lax; expires=Thu, 01 Jan 1970 00:00:00 UTC`),En(),tr(),sr(),D.resetForLogout(),await O(null),e(X()),mr()}}}))),yr=()=>T($.use.sessionStatus()),br=()=>!Xe($.use.sessionStatus()),xr=()=>E($.use.platformSession());function Sr(){let{refreshSession:e}=$.getState(),t=[],n=()=>e().catch(e=>console.warn(`auth.refreshSession failed`,e)),r=be(`app.resume`,()=>{pn()||n()});return t.push(r),typeof BroadcastChannel<`u`&&(q=new BroadcastChannel(`auth`),q.onmessage=()=>{sr(),window.location.reload()},t.push(()=>{q?.close(),q=null})),()=>t.forEach(e=>e())}export{Me as $,cn as A,It as B,Dn as C,xn as D,L as E,I as F,E as G,rt as H,Bt as I,Ye as J,T as K,Ft as L,$t as M,Xt as N,_n as O,Gt as P,je as Q,N as R,B as S,bn as T,O as U,A as V,D as W,Pe as X,Ke as Y,Fe as Z,Nn as _,br as a,On as b,G as c,qn as d,Oe as et,H as f,jn as g,Fn as h,yr as i,on as j,gn as k,Wn as l,An as m,$ as n,w as nt,er as o,In as p,Xe as q,xr as r,nr as s,Sr as t,De as tt,Kn as u,V as v,wn as w,Cn as x,En as y,Nt as z};
|