@vellumai/web 0.12.4-staging.2 → 0.12.4-staging.4
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/{a2a-invite-DizlchNv.js → a2a-invite-BSzXL6i3.js} +1 -1
- package/dist/assets/{about-page-Y8a--p-0.js → about-page-Ne3KY7p6.js} +1 -1
- package/dist/assets/{account-page-oXqvFuC5.js → account-page-DR4ueI-s.js} +1 -1
- package/dist/assets/{account-shell-BW5fY_u7.js → account-shell-BCvjHT7j.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-CViUQ4Gg.js → acp-run-detail-panel-BA9xGUzb.js} +1 -1
- package/dist/assets/{activation-list-route-swzAPcaY.js → activation-list-route-Br9gsfSd.js} +1 -1
- package/dist/assets/{activity-redirect-page-Wc2DZYeP.js → activity-redirect-page-BOS14fri.js} +1 -1
- package/dist/assets/{activity-steps-panel--otugh_6.js → activity-steps-panel-88l6Ei6w.js} +1 -1
- package/dist/assets/add-credits-modal-0pYLUDo4.js +1 -0
- package/dist/assets/{add-credits-modal-ZnKmvy6V.js → add-credits-modal-O1N2pbak.js} +1 -1
- package/dist/assets/{ai-page-BMR6BEti.js → ai-page-DU0mYnYP.js} +1 -1
- package/dist/assets/all-chats-page-route-CkFi0Q7K.js +1 -0
- package/dist/assets/{android-billing-handoff-6shikm2k.js → android-billing-handoff-C06TxyLt.js} +1 -1
- package/dist/assets/{api-key-screen-CbnUNlGK.js → api-key-screen-BD62ySmK.js} +1 -1
- package/dist/assets/{app-D8sMVA0h.js → app-Qc-rYPt9.js} +46 -46
- package/dist/assets/{app-info-z1hPo0V6.js → app-info-YYU2hCWc.js} +1 -1
- package/dist/assets/{archive-redirect-page-DEdZNQal.js → archive-redirect-page-AYY4xZby.js} +1 -1
- package/dist/assets/{assistant-handle-modal-Rx01AWRM.js → assistant-handle-modal-BZJgqpG8.js} +1 -1
- package/dist/assets/{assistant-inbox-page-route-CWfD1nW8.js → assistant-inbox-page-route-B61doUw8.js} +1 -1
- package/dist/assets/{assistant-inbox-upgrade-body-DnzMfD6M.js → assistant-inbox-upgrade-body-BC-REEBi.js} +1 -1
- package/dist/assets/{assistant-status-panel-Cox-mezz.js → assistant-status-panel-uJMo_YOD.js} +1 -1
- package/dist/assets/auth-store-FcZEUxA_.js +1 -0
- package/dist/assets/{auth-welcome-screen-Bwm2MF1q.js → auth-welcome-screen-uOY9YbXG.js} +1 -1
- package/dist/assets/avatar-bundled-components-DcmDX83d.js +1 -0
- package/dist/assets/{avatar-random-DenoKEgP.js → avatar-random-DxLJmo42.js} +2 -2
- package/dist/assets/{await-org-header-settled-BxLRQCmZ.js → await-org-header-settled-dTqfGHq2.js} +1 -1
- package/dist/assets/{background-task-detail-panel-COBZw2lg.js → background-task-detail-panel-CBjRAdga.js} +1 -1
- package/dist/assets/{billing-page-DfUj1I0G.js → billing-page-CA6R2wjZ.js} +3 -3
- package/dist/assets/{billing-redirect-page-DKyiR6MR.js → billing-redirect-page-DK5z_EZp.js} +1 -1
- package/dist/assets/{bookmarks-page-CFEE1Uxr.js → bookmarks-page-DPEug6V3.js} +1 -1
- package/dist/assets/{bundle-confirm-page-B-d41LNa.js → bundle-confirm-page-Co72y9XS.js} +1 -1
- package/dist/assets/{channel-transcript-panel-CmHEsFMk.js → channel-transcript-panel-B0cRZsgw.js} +1 -1
- package/dist/assets/{channels-page-route-CuAKuwQD.js → channels-page-route-V3Fk_Hzf.js} +1 -1
- package/dist/assets/chat-BQddXCk9.js +3 -0
- package/dist/assets/chat-BZsmqRU3.js +3 -0
- package/dist/assets/{chat-AntDwRty.js → chat-C6WWTxFu.js} +1 -1
- package/dist/assets/chat-D7FyK_n_.js +3 -0
- package/dist/assets/chat-info-panel-Bv1Aet5S.js +1 -0
- package/dist/assets/{checkout-continuation-C7ALmXXi.js → checkout-continuation-c9cPR68T.js} +1 -1
- package/dist/assets/{checkout-page-BiKD4JLD.js → checkout-page-Cq5DAqbf.js} +1 -1
- package/dist/assets/checkout-return-target-CA5-Gi7-.js +1 -0
- package/dist/assets/command-palette-BUCV7aZK.js +1 -0
- package/dist/assets/{command-palette-BlZE0DtA.js → command-palette-Drf-HDLE.js} +1 -1
- package/dist/assets/{command-palette-window-page-B_vTgfMk.js → command-palette-window-page-DCE-g55A.js} +1 -1
- package/dist/assets/common-C7iok8sT.js +1 -0
- package/dist/assets/common-CMLZe_W6.js +1 -0
- package/dist/assets/common-Dgnh0Njn.js +1 -0
- package/dist/assets/common-QPQ83NEi.js +1 -0
- package/dist/assets/{community-page-h4SSKpvs.js → community-page-BJxApcxO.js} +1 -1
- package/dist/assets/{companion-accent-CpX6aNlW.js → companion-accent-Cp2MmcWR.js} +1 -1
- package/dist/assets/{companion-dock-zones-page-VmKgW5GB.js → companion-dock-zones-page-Zvhwz0Yz.js} +1 -1
- package/dist/assets/{companion-layout-TXE0PA9f.js → companion-layout-cM6NtktC.js} +1 -1
- package/dist/assets/{companion-popover-C-jOy9ph.js → companion-popover-D2taDck6.js} +1 -1
- package/dist/assets/{companion-popover-page-BroQfXvM.js → companion-popover-page-DGS-UTTL.js} +1 -1
- package/dist/assets/{companion-surface-DOIgH-bV.js → companion-surface-oVNh5kA4.js} +1 -1
- package/dist/assets/{companion-surface-page-DRLXSLvn.js → companion-surface-page-CXiHLf2G.js} +1 -1
- package/dist/assets/companion-tour-entry-CpXEfiiz.js +1 -0
- package/dist/assets/{companion-watch-frame-page-BrtR8aJG.js → companion-watch-frame-page-CIEEUVOP.js} +1 -1
- package/dist/assets/{connect-page-yTAoyfL3.js → connect-page-CILP_iqJ.js} +1 -1
- package/dist/assets/{consent-controls-n1HIl_Qh.js → consent-controls-ole3UEoz.js} +1 -1
- package/dist/assets/{contacts-gateway-CnUI-BQ8.js → contacts-gateway-zkBOSVyx.js} +1 -1
- package/dist/assets/{contacts-page-route-BeTKJ0wU.js → contacts-page-route-GyaYbluM.js} +1 -1
- package/dist/assets/{copy-button-zFMI1aRE.js → copy-button-CzMsh4gB.js} +1 -1
- package/dist/assets/{credential-entry-page-BX5tgHs-.js → credential-entry-page-CueibLp2.js} +1 -1
- package/dist/assets/{credentials-page-DO12GLZa.js → credentials-page-DgmnWmph.js} +1 -1
- package/dist/assets/{csv-preview-DTvQhodp.js → csv-preview-CemRbf9W.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-CKPdbPhO.js → danger-zone-redirect-page-BJ31hZvD.js} +1 -1
- package/dist/assets/{debug-page-KaXTLZ3j.js → debug-page-CYN-HFc_.js} +1 -1
- package/dist/assets/deploy-dialogs-C_aIE0ti.js +1 -0
- package/dist/assets/{deploy-dialogs-D1N0Mx60.js → deploy-dialogs-DP0ls5p1.js} +1 -1
- package/dist/assets/{desktop-preview-content-BGP-Q4ES.js → desktop-preview-content-BmkyExHH.js} +2 -2
- package/dist/assets/{desktop-status-DhhVXu3M.js → desktop-status-CG431FNc.js} +1 -1
- package/dist/assets/{desktop-viewer-BS0GRBKw.js → desktop-viewer-DwehmMBT.js} +1 -1
- package/dist/assets/{detail-card-5ja97d__.js → detail-card-DaoCCbYV.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-C_TanbFS.js → detail-panel-stop-button-CZfhwEjC.js} +1 -1
- package/dist/assets/{detail-primitives-DlHfs3NY.js → detail-primitives-B2TDPtFR.js} +1 -1
- package/dist/assets/{developer-page-Ia_M--jA.js → developer-page-e5ZIJFP5.js} +1 -1
- package/dist/assets/{devices-redirect-page-Dicfe-Xh.js → devices-redirect-page-Dq7s97Ga.js} +1 -1
- package/dist/assets/{dictation-overlay-page-DLKil78N.js → dictation-overlay-page-DF-XpmHA.js} +1 -1
- package/dist/assets/document-load-88Gh0gTG.js +1 -0
- package/dist/assets/{document-load-D7lS0Qam.js → document-load-CcDODImt.js} +1 -1
- package/dist/assets/{document-viewer-page-Bvnx2eMP.js → document-viewer-page-DiD-zvuQ.js} +1 -1
- package/dist/assets/{emails-page-D3O_HhPG.js → emails-page-6gtVUatK.js} +1 -1
- package/dist/assets/{file-diff-view-D1j-t0cs.js → file-diff-view-bwx_MkXN.js} +1 -1
- package/dist/assets/{file-editor-CDuPINUR.js → file-editor-D0P-Gy-a.js} +1 -1
- package/dist/assets/general-page-BZQ7yEvH.js +2 -0
- package/dist/assets/hatching-screen-DBprFgEA.js +1 -0
- package/dist/assets/{hosting-screen-AXFQL3em.js → hosting-screen-BA7wRb0n.js} +1 -1
- package/dist/assets/identity-page-route-BfgfhU08.js +7 -0
- package/dist/assets/{inspect-page-EGAIWdPZ.js → inspect-page-CH3uVGix.js} +3 -3
- package/dist/assets/{integrations-page-BOgg6KK3.js → integrations-page-0clh02lf.js} +1 -1
- package/dist/assets/{intelligence-layout-BPa8zuju.js → intelligence-layout-CC6J5rMH.js} +1 -1
- package/dist/assets/intelligence-layout-slots-store-BrxvOjyS.js +1 -0
- package/dist/assets/{keyboard-shortcuts-redirect-page-3JddlI6I.js → keyboard-shortcuts-redirect-page-B1HB0ZJQ.js} +1 -1
- package/dist/assets/{latest-assistant-text-fShWplU9.js → latest-assistant-text-DFGZImdA.js} +1 -1
- package/dist/assets/{library-detail-page-CqqXK7mJ.js → library-detail-page-Db0s21ez.js} +1 -1
- package/dist/assets/{library-page-Db5rMvEu.js → library-page-CHncUGxN.js} +1 -1
- package/dist/assets/local-mode-D_-1ec4p.js +1 -0
- package/dist/assets/{login-page-BbfY1JYR.js → login-page-D2uVokBF.js} +1 -1
- package/dist/assets/{logout-page-DoibQ_Ri.js → logout-page-H2ViUr-T.js} +1 -1
- package/dist/assets/{logs-layout-Dobrj5WD.js → logs-layout-C0DDeC5h.js} +1 -1
- package/dist/assets/{markdown-preview-CNgPT8Ns.js → markdown-preview-BJR1Lp-C.js} +1 -1
- package/dist/assets/{media-preview-BB_3EZbz.js → media-preview-CVf1UuE9.js} +1 -1
- package/dist/assets/{memory-page-route-DLi_ptkl.js → memory-page-route-BBFz1YiU.js} +1 -1
- package/dist/assets/{memory-router-playground-page-DozE3X0H.js → memory-router-playground-page-BudLOTc4.js} +1 -1
- package/dist/assets/{message-files-panel-BPTDooXh.js → message-files-panel-Qq9UEaxA.js} +1 -1
- package/dist/assets/{metric-card-D0M85__8.js → metric-card-lmiHO3PF.js} +1 -1
- package/dist/assets/native-attachment-pickers-BhYBtKp-.js +1 -0
- package/dist/assets/native-file-D0FCYmrg.js +1 -0
- package/dist/assets/{notifications-page-Ysp5efLW.js → notifications-page-BmNyEMIk.js} +1 -1
- package/dist/assets/{oauth-complete-page-CDxvG_L-.js → oauth-complete-page-Cypawil4.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-CwJxBm2S.js → oauth-popup-complete-page-CWQF6Tbc.js} +1 -1
- package/dist/assets/paired-platform-identity-BqBlEtsv.js +1 -0
- package/dist/assets/{pairing-page-DIcQb9OJ.js → pairing-page-OjkCjTgJ.js} +1 -1
- package/dist/assets/password-reset-page-DakZp7KC.js +1 -0
- package/dist/assets/{pdf-file-preview-DX0ZQoVT.js → pdf-file-preview-BxCXMhqC.js} +1 -1
- package/dist/assets/{personality-page-BFiUCJ1L.js → personality-page-BU6yPK14.js} +1 -1
- package/dist/assets/{personality-page-D4cC26jw.js → personality-page-Dm9LQmBW.js} +1 -1
- package/dist/assets/{personality-sliders-BM4di6t9.js → personality-sliders-Dehyaji_.js} +1 -1
- package/dist/assets/{plans-page-miRpUo-U.js → plans-page-CAyi2Nxa.js} +1 -1
- package/dist/assets/{platform-loopback-page-CCG5On-e.js → platform-loopback-page-Dr-fFIwU.js} +1 -1
- package/dist/assets/{plugin-detail-page-Dt5XsCxQ.js → plugin-detail-page-B3Rx7z27.js} +1 -1
- package/dist/assets/{plugins-page-B_d5EVPw.js → plugins-page-DN9rPLRn.js} +1 -1
- package/dist/assets/plugins-surface-CrFNy0ps.js +1 -0
- package/dist/assets/{preview-error-DoWnZxU0.js → preview-error-DB2rjYvO.js} +1 -1
- package/dist/assets/{privacy-page-BmyUhMnI.js → privacy-page-BcpCT1Vb.js} +1 -1
- package/dist/assets/{privacy-screen-CuOvxzA8.js → privacy-screen-grsFP0UO.js} +1 -1
- package/dist/assets/{profile-card-DSHsAWzC.js → profile-card-BP9AMkh4.js} +1 -1
- package/dist/assets/{provider-callback-page-BVSe9lzW.js → provider-callback-page-g4qnXUAS.js} +1 -1
- package/dist/assets/{provider-key-Dn1NaLjs.js → provider-key-CK86YQ0g.js} +1 -1
- package/dist/assets/{provider-signup-page-B8wHDvGe.js → provider-signup-page-Ce4IEtKF.js} +1 -1
- package/dist/assets/{quick-input-page-BcTqo_SA.js → quick-input-page-BJ-kLGi7.js} +1 -1
- package/dist/assets/{referral-modal-CXPg4U-L.js → referral-modal-Bd_Bwh5m.js} +1 -1
- package/dist/assets/referral-modal-Ts_6L7Jq.js +1 -0
- package/dist/assets/{research-mock-page-lCKcSGWS.js → research-mock-page-bXHr3HJ1.js} +1 -1
- package/dist/assets/research-onboarding-route-BXcRnuIA.js +50 -0
- package/dist/assets/{review-terms-screen-CcKEKn6x.js → review-terms-screen-DZCb5jS5.js} +1 -1
- package/dist/assets/routes-CpEsYa-V.js +1 -0
- package/dist/assets/{schedules-C862mQ95.js → schedules-EEPosYPL.js} +1 -1
- package/dist/assets/schedules-page-Dqs-gg7s.js +1 -0
- package/dist/assets/{security-redirect-page-Cf6N-pAp.js → security-redirect-page-BUtDM_HH.js} +1 -1
- package/dist/assets/{select-assistant-screen-DmC81TOi.js → select-assistant-screen-BOubdStJ.js} +1 -1
- package/dist/assets/{self-hosted-servers-CuhcBUtc.js → self-hosted-servers-CJjUOVLQ.js} +1 -1
- package/dist/assets/{service-form-controls-Q1QYmu0R.js → service-form-controls-DwwYjgqa.js} +1 -1
- package/dist/assets/{setting-row-bAvkY8qq.js → setting-row-D7xTN4Nd.js} +1 -1
- package/dist/assets/{settings-divider-JNNvLiiq.js → settings-divider-y1Y7piXi.js} +1 -1
- package/dist/assets/{settings-layout-kZQ0T-wh.js → settings-layout-7t6GBbdu.js} +1 -1
- package/dist/assets/{share-feedback-modal-C1NM5ZQA.js → share-feedback-modal-DnH2sXjE.js} +1 -1
- package/dist/assets/share-feedback-modal-DuI0v7AI.js +1 -0
- package/dist/assets/{sidebar-tree-C31ptvb9.js → sidebar-tree-CqElNW5F.js} +1 -1
- package/dist/assets/{signup-page-BgeUPiLo.js → signup-page-ZDm4OjY3.js} +1 -1
- package/dist/assets/{signup-shell-qd7yOKsi.js → signup-shell-kgxV4p4a.js} +1 -1
- package/dist/assets/{skill-detail-page-Cx1j6Kur.js → skill-detail-page-nWwa0XFq.js} +1 -1
- package/dist/assets/{skill-detail-panel-CEblhGiR.js → skill-detail-panel-9H7ft8ro.js} +1 -1
- package/dist/assets/{skill-removal-dialog-sFJ2FlXs.js → skill-removal-dialog-DfBhw0Lh.js} +1 -1
- package/dist/assets/{skills-page-DwaV4t6G.js → skills-page-CamB2mns.js} +1 -1
- package/dist/assets/{sounds-page-DIwns3JM.js → sounds-page-Bj48pTCF.js} +1 -1
- package/dist/assets/{start-screen-Bhe95rpT.js → start-screen-DtUnAChR.js} +1 -1
- package/dist/assets/{stt-language-picker-modal-6st6DWoq.js → stt-language-picker-modal-Dgcq9xkd.js} +1 -1
- package/dist/assets/{subagent-detail-panel-zJtzbOlF.js → subagent-detail-panel-U4m5BxZG.js} +1 -1
- package/dist/assets/{superpowers-page-Cpl22-6n.js → superpowers-page-WkwbyGXZ.js} +1 -1
- package/dist/assets/{system-events-page-C2YAEfJf.js → system-events-page-Bw9HBTD3.js} +1 -1
- package/dist/assets/{system-events-redirect-page-CVuxUaY0.js → system-events-redirect-page-BfQvezRk.js} +1 -1
- package/dist/assets/{text-preview-BO6RkCx5.js → text-preview-CUqsudgl.js} +1 -1
- package/dist/assets/{theme-stage-page-DhT0XNI2.js → theme-stage-page-HhLVo3o6.js} +1 -1
- package/dist/assets/{tiptap-document-editor-BcLk_m4Z.js → tiptap-document-editor-rY7Mbt4u.js} +1 -1
- package/dist/assets/{tool-detail-panel-DgLms60D.js → tool-detail-panel-B9PQpvb8.js} +1 -1
- package/dist/assets/tool-detail-panel-Bt4vBf09.js +1 -0
- package/dist/assets/{trait-cycle-row-DaQ1Ws3F.js → trait-cycle-row-C-mybyb7.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-CA1adXlD.js → upgrade-cancel-page-CfqBVU8V.js} +1 -1
- package/dist/assets/{upgrade-success-page-DQgW1mUo.js → upgrade-success-page-3efxDP6a.js} +1 -1
- package/dist/assets/{usage-redirect-page-CUIv8k9u.js → usage-redirect-page-D4aGhmzR.js} +1 -1
- package/dist/assets/{use-app-delete-rBDVuftC.js → use-app-delete-vuGBgQkn.js} +1 -1
- package/dist/assets/{use-assistant-identity-details-IZ1p17bP.js → use-assistant-identity-details-CrWNdPFJ.js} +1 -1
- package/dist/assets/{use-checkout-dismiss-refresh-CPok4Xxh.js → use-checkout-dismiss-refresh-BwT2zWIT.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-C6D5cD0V.js → use-edge-swipe-back-DjHkqNOJ.js} +1 -1
- package/dist/assets/{use-hotkey-recorder-CQ81x0jZ.js → use-hotkey-recorder-OFYAQ-HC.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-CEz7AGhb.js → use-invite-link-dialog-CCACCzhi.js} +1 -1
- package/dist/assets/{use-plugins-list-D7kaVDLa.js → use-plugins-list-D-azzToZ.js} +1 -1
- package/dist/assets/{use-return-to-short-circuit-B3O40EpG.js → use-return-to-short-circuit-CpUBlNYt.js} +1 -1
- package/dist/assets/{use-side-list-room-jwL301KF.js → use-side-list-room-DoHREePf.js} +1 -1
- package/dist/assets/{use-skill-actions-10SaGQ2V.js → use-skill-actions-DG-ZngUy.js} +1 -1
- package/dist/assets/{use-skill-detail-files-OgBPzm48.js → use-skill-detail-files-CHrwga8E.js} +1 -1
- package/dist/assets/use-supports-credentials-settings-Bq6T6gWf.js +1 -0
- package/dist/assets/{use-transcript-message-by-id-Iq7GcnGe.js → use-transcript-message-by-id-Bfbshp9w.js} +1 -1
- package/dist/assets/{voice-page-CaiYChec.js → voice-page-DiAOJ_tF.js} +1 -1
- package/dist/assets/{wake-detail-panel-CT3DYLQZ.js → wake-detail-panel-CeBICW69.js} +1 -1
- package/dist/assets/{weather-forecast-display-BFdH_k1K.js → weather-forecast-display-ULwhP9mt.js} +1 -1
- package/dist/assets/{welcome-screen-CqkJbp4o.js → welcome-screen-DgJPqZ2G.js} +1 -1
- package/dist/assets/{workflow-detail-panel-C-eS7Dvm.js → workflow-detail-panel-DmsjHIzU.js} +1 -1
- package/dist/assets/{workspace-page-BlTW2cBW.js → workspace-page-DHnNp7n8.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/add-credits-modal-8XswoyyE.js +0 -1
- package/dist/assets/auth-store-Cl64mEJk.js +0 -1
- package/dist/assets/avatar-bundled-components-D5UflXXI.js +0 -1
- package/dist/assets/chat-65GwDn4W.js +0 -3
- package/dist/assets/chat-B63XecSL.js +0 -3
- package/dist/assets/chat-cDbsbgu5.js +0 -3
- package/dist/assets/chat-info-panel-oH5Oyl38.js +0 -1
- package/dist/assets/checkout-return-target-DMdfJOOA.js +0 -1
- package/dist/assets/command-palette-w64ApCdQ.js +0 -1
- package/dist/assets/common-1dGFkyPX.js +0 -1
- package/dist/assets/common-CEWnU0pW.js +0 -1
- package/dist/assets/common-Cy_3dwBD.js +0 -1
- package/dist/assets/common-D42ZRpvb.js +0 -1
- package/dist/assets/companion-tour-entry-B1IsGYch.js +0 -1
- package/dist/assets/deploy-dialogs-CRJiVPdx.js +0 -1
- package/dist/assets/document-load-DSIq6Sq0.js +0 -1
- package/dist/assets/general-page-CsElCUdU.js +0 -2
- package/dist/assets/hatching-screen-DAfWJUbK.js +0 -1
- package/dist/assets/identity-page-route-DAr3l3g4.js +0 -7
- package/dist/assets/intelligence-layout-slots-store-BJaDjomF.js +0 -1
- package/dist/assets/local-mode-D_3DvD-d.js +0 -1
- package/dist/assets/native-attachment-pickers-CwbujgDo.js +0 -1
- package/dist/assets/native-file-D0pwPgoW.js +0 -1
- package/dist/assets/old-chats-page-route-BcqodIdi.js +0 -1
- package/dist/assets/paired-platform-identity-T0oJWAAF.js +0 -1
- package/dist/assets/password-reset-page-C7NkRhLd.js +0 -1
- package/dist/assets/plugins-surface-BxV_0iuU.js +0 -1
- package/dist/assets/referral-modal-CI2bBp4q.js +0 -1
- package/dist/assets/research-onboarding-route-CXMe3vp7.js +0 -50
- package/dist/assets/routes-QuWxfGvc.js +0 -1
- package/dist/assets/schedules-page-Vm7pjI-3.js +0 -1
- package/dist/assets/share-feedback-modal-C1e2jpWO.js +0 -1
- package/dist/assets/tool-detail-panel-BmOzPhuv.js +0 -1
- package/dist/assets/use-supports-credentials-settings-DuYuJNsF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{KS as t,Mf as n,kr as r,ov as i,qS as a,sh as o}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{KS as t,Mf as n,kr as r,ov as i,qS as a,sh as o}from"./app-Qc-rYPt9.js";import{I as s,j as c,tr as l}from"./vendor-DEhKVoiV.js";import{t as u,x as d}from"./react-B9IgSVeK.js";var f=u();function p({app:e,isDeleting:n,onConfirm:r,onCancel:i}){let{t:a}=c();return(0,f.jsx)(t,{open:e!==null,title:a(`deleteAppDialog.title`),message:e?a(`deleteAppDialog.message`,{name:e.name}):``,confirmLabel:a(n?`deleteAppDialog.deleting`:`deleteAppDialog.delete`),destructive:!0,onConfirm:r,onCancel:i})}var m=e(d(),1);function h(e,t,{exported:n,failed:i}){let{id:a,name:o}=t,s=(0,m.useRef)(!1);return(0,m.useCallback)(async()=>{if(!s.current){s.current=!0;try{await r(e,{id:a,name:o},{exported:n,failed:i})}finally{s.current=!1}}},[e,a,o,n,i])}function g(e){let t=l(),[r,c]=(0,m.useState)(null),[u,d]=(0,m.useState)(!1);return{pendingDelete:r,isDeleting:u,requestDelete:c,confirmDelete:(0,m.useCallback)(async()=>{if(!(!r||u)){d(!0);try{await i({path:{assistant_id:e,id:r.id},throwOnError:!0}),o(e,r.id),t.invalidateQueries({queryKey:n({path:{assistant_id:e}})}),c(null)}catch(e){a.error(e instanceof Error?e.message:s(`useAppDelete.deleteFailed`))}finally{d(!1)}}},[r,u,e,t]),cancelDelete:(0,m.useCallback)(()=>{u||c(null)},[u])}}export{h as n,p as r,g as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Hv as e,Vv as t,Y_ as n,_v as r,lS as i,p_ as a,pv as o,yc as s}from"./app-
|
|
1
|
+
import{Hv as e,Vv as t,Y_ as n,_v as r,lS as i,p_ as a,pv as o,yc as s}from"./app-Qc-rYPt9.js";import{Qn as c}from"./vendor-DEhKVoiV.js";import{i as l,n as u,t as d}from"./latest-assistant-text-DFGZImdA.js";var f=[{id:n.companionCoworker,leftKey:`personalityAxes.companionCoworker.left`,rightKey:`personalityAxes.companionCoworker.right`},{id:n.genzBoomer,leftKey:`personalityAxes.genzBoomer.left`,rightKey:`personalityAxes.genzBoomer.right`},{id:n.executeCollaborate,leftKey:`personalityAxes.executeCollaborate.left`,rightKey:`personalityAxes.executeCollaborate.right`},{id:n.playfulSerious,leftKey:`personalityAxes.playfulSerious.left`,rightKey:`personalityAxes.playfulSerious.right`},{id:n.politeUnfiltered,leftKey:`personalityAxes.politeUnfiltered.left`,rightKey:`personalityAxes.politeUnfiltered.right`}],p=50,m=1500,h=12e4,g=e=>new Promise(t=>setTimeout(t,e));async function _({assistantId:n,content:a,title:s,context:c}){let f,p=!1;try{let i=await r({path:{assistant_id:n},body:{conversationType:`background`,title:s},throwOnError:!1});if(f=i.data?.id,!i.response?.ok||!f)return!1;let o=u({conversationId:f,content:a,transport:`vellum`});if(!(await e({path:{assistant_id:n},body:o,throwOnError:!1})).response?.ok)return!1;let c=Date.now()+h,_=``,v=0,y=!1;for(;Date.now()<c;){await g(m);let e=await t({path:{assistant_id:n},query:{conversationId:f},throwOnError:!1}),r=d(e.data?.messages??[]);if(r&&(v=r===_?v+1:0,_=r),e.data?.processing===!0&&(y=!0),l({processing:e.data?.processing,sawProcessing:y,hasReply:r.length>0,stableReads:v})){p=!0;break}}}catch(e){i(e,{context:c})}finally{if(f)try{await o({path:{assistant_id:n,id:f},throwOnError:!1})}catch(e){i(e,{context:`${c}_archive`})}}return p}function v(e){return[`assistant-identity-details`,e]}function y(e){return c({queryKey:v(e),queryFn:async()=>{let[t,n]=await Promise.all([s(e),a(e).catch(()=>({ok:!1,status:0,error:{}}))]);return{identity:t,createdAt:n.ok?n.data.created:null}}})}export{p as a,f as i,y as n,_ as r,v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$S as t,$u as n,By as r,Ch as i,Cu as a,Cy as o,EC as s,Hs as c,Hy as l,Ib as u,Ih as d,JS as f,Jg as p,Ju as m,KS as h,Mh as g,Oh as _,QS as v,Qu as y,Ri as b,Ro as x,Sh as S,Un as C,Vi as w,Vs as T,WS as E,Xl as D,Xu as O,Yu as k,Zg as A,Zu as j,_d as ee,ad as M,eS as N,ed as te,gC as P,gd as ne,kh as re,mu as ie,nd as ae,nu as oe,pC as F,qS as I,rC as se,td as ce,tu as le,vu as ue,wh as de,wy as L,xh as fe,xi as R}from"./app-D8sMVA0h.js";import{I as z,Qn as B,Yn as pe,ar as me,j as V,sr as he,tr as H}from"./vendor-DEhKVoiV.js";import{f as ge,t as _e,x as ve}from"./react-B9IgSVeK.js";import{D as ye,Ji as U,Ra as be,Ui as W,Vn as xe,Ya as Se,Yn as Ce,ci as we,fr as G,pi as Te,xr as Ee,zi as De}from"./icons-C0wyat6T.js";import{c as Oe,i as K,l as ke,n as Ae,r as je,t as Me}from"./machine-sizes-BWbhowrp.js";import{a as Ne,i as Pe,n as Fe,r as Ie,t as Le}from"./provisioning-targets-Csh2mGBG.js";var Re=Se(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),q=e(ve(),1),J=_e();function ze({icon:e}){return(0,J.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--system-negative-strong) 12%, transparent)`},children:(0,J.jsx)(e,{className:`h-5 w-5`,style:{color:`var(--system-negative-strong)`},"aria-hidden":`true`})})}var Y={fontFamily:`var(--font-serif)`,fontSize:`32px`,fontWeight:400,lineHeight:1.2,letterSpacing:`0.64px`};function X({title:e,subtitle:t}){return(0,J.jsxs)(`header`,{className:`flex flex-col items-center gap-2 pt-12 text-center`,children:[(0,J.jsx)(`h2`,{className:`text-[var(--content-emphasised)]`,style:Y,children:e}),t&&(0,J.jsx)(`p`,{className:`text-[14px] font-normal text-[var(--content-secondary)]`,children:t})]})}var Be=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1},{bodyShape:`stack`,eyeStyle:`gentle`,color:`purple`,size:110,position:`-left-[39px] top-[74%]`,rotate:0},{bodyShape:`urchin`,eyeStyle:`goofy`,color:`pink`,size:137,position:`-right-[42px] -bottom-[40px]`,rotate:180},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`,size:72,position:`left-[37%] -bottom-[22px] -translate-x-1/2`,rotate:0}],Ve=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1}];function He({variant:e=`full`}){let t=R();return t?(0,J.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`creature-corners`,className:`pointer-events-none absolute inset-0 select-none`,children:(e===`top`?Ve:Be).map((e,n)=>(0,J.jsx)(`span`,{className:`absolute ${e.position}`,style:{rotate:`${e.rotate}deg`},children:(0,J.jsx)(C,{components:t,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:e.size})},n))}):null}var Z={waitingStatus:`Upgrading your assistant…`,snagStatus:`We hit a snag upgrading your assistant`,snagCaption:`Retry in the background and we'll keep working on your upgrade.`,confirmingStatus:`Confirming your upgrade…`,confirmTimeoutStatus:`Still confirming your upgrade`,confirmTimeoutCaption:`Your payment went through safely. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still upgrading. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your upgrade continues in the background.`,backgroundRetryToast:`We'll retry your upgrade in the background.`,completeSubtitle:`Enjoy the new found power.`,fetchErrorBody:`We hit a problem checking your subscription. Your upgrade may still be processing. Return to billing to refresh.`},Q={waitingStatus:`Updating your assistant…`,snagStatus:`We hit a snag updating your assistant`,snagCaption:`Retry in the background and we'll keep working on your plan change.`,confirmingStatus:`Confirming your plan change…`,confirmTimeoutStatus:`Still confirming your plan change`,confirmTimeoutCaption:`Your plan change was submitted. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still updating. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your plan change continues in the background.`,backgroundRetryToast:`We'll retry your plan change in the background.`,completeSubtitle:`Your plan changes are live.`,fetchErrorBody:`We hit a problem checking your subscription. Your plan change may still be processing. Return to billing to refresh.`},$={upgrade:Z,downgrade:Q,change:Q};function Ue(e=`upgrade`){return $[e]}function We(e,t=!0){let{data:n}=B({...D(),enabled:t&&e==null}),{data:r}=B({...a({path:{id:e??``}}),enabled:t&&e!=null});return e==null?n:r}function Ge({assistantId:e,direction:t}){let n=ge(),{t:r}=V(`settings`),i=We(e,d())?.name||r(`completeState.assistantFallbackName`);return(0,J.jsxs)(`div`,{className:`relative flex min-h-[320px] flex-col items-center justify-center overflow-hidden px-8 pb-16 [animation:onboarding-step-in_350ms_ease-out] motion-reduce:[animation:none]`,children:[(0,J.jsx)(He,{variant:`full`}),(0,J.jsxs)(`div`,{className:`relative flex w-full flex-col items-center`,children:[(0,J.jsx)(X,{title:r(`completeState.title`),subtitle:Ue(t).completeSubtitle}),(0,J.jsx)(`div`,{className:`mt-10 flex w-full flex-col items-center gap-10`,children:(0,J.jsx)(s,{variant:`primary`,"data-testid":`onboarding-complete-return`,onClick:()=>{e!=null&&p(e),n(N.assistant,{replace:!0})},children:r(`completeState.returnTo`,{assistantName:i})})})]})]})}function Ke(e=!0,t){let n=We(t,e),r=t??n?.id,{data:i,isError:a,isFetching:o,dataUpdatedAt:s,errorUpdatedAt:c}=B({...le({path:{assistant_id:r??``}}),enabled:e&&!!r});return{assistant:n,assistantId:r,domains:i,domainsError:a,domainsFetching:o,domainsUpdatedAt:s,domainsErrorUpdatedAt:c}}var qe=1e3,Je=1e4,Ye=2500,Xe=2e3,Ze=1e4,Qe=[`machine_size`,`subdomain`,`non_field_errors`],$e={subdomain_taken:`That subdomain is already taken. Try another.`,assistant_already_has_domain:`Your assistant already has a custom domain.`,no_assistant_to_attach_domain:`We couldn't find an assistant to attach this domain to.`,exceeds_machine_tier:`That machine size isn't available on your plan.`,provisioning_submission_failed:`We couldn't queue your upgrade just now. Try again in a moment.`,no_active_pro:`We couldn't confirm your Pro plan yet. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to upgrade yet. Try again in a moment.`},et={provisioning_submission_failed:`We couldn't queue your plan change just now. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to update yet. Try again in a moment.`};function tt(e,t,n=`upgrade`){if(e&&typeof e==`object`){let t=e;if(typeof t.error==`string`){let e=(n===`upgrade`?void 0:et[t.error])??$e[t.error];if(e)return e}for(let e of Qe){let n=t[e];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(typeof t.detail==`string`)return t.detail}return t}var nt=`h-8 rounded-lg border border-[var(--border-element)] bg-[var(--field-bg)] px-2.5 text-[14px] text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-[border-color] duration-150 focus:border-[var(--border-active)] disabled:cursor-not-allowed disabled:opacity-60`,rt=`text-[11px] font-medium text-[var(--content-secondary)]`;function it({onExit:e,machineBusy:t=!1,assistantId:n}){let{t:r}=V(`settings`),i=H(),a=b.use.emailRootDomain(),{assistant:o,assistantId:c,domains:l}=Ke(!0,n),u=l?.results[0],[d,p]=(0,q.useState)(``),[m,h]=(0,q.useState)(`hi`),[g,_]=(0,q.useState)(!1);(0,q.useEffect)(()=>{if(!g){if(u){p(u.subdomain),_(!0);return}!o?.handle||d||(p(o.handle),_(!0))}},[o?.handle,u,g,d]);let[v,y]=(0,q.useState)(null),[x,S]=(0,q.useState)(!1),C=pe(j()),w=!!u||x,T=C.isPending||x;return(0,q.useEffect)(()=>{if(!x)return;let t=setTimeout(e,800);return()=>clearTimeout(t)},[x,e]),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(f.Body,{className:`animate-[onboarding-step-in_350ms_ease-out] space-y-6 pb-0 motion-reduce:animate-none`,children:[(0,J.jsx)(He,{variant:`top`}),(0,J.jsx)(X,{title:r(`domainStep.title`),subtitle:r(`domainStep.subtitle`)}),(0,J.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`label`,{htmlFor:`onboarding-email-prefix`,className:rt,children:r(`domainStep.prefixLabel`)}),(0,J.jsx)(`input`,{id:`onboarding-email-prefix`,value:m,onChange:e=>h(e.target.value.toLowerCase().trim()),disabled:T||w,readOnly:w,placeholder:r(`domainStep.emailUsernamePlaceholder`),className:`${nt} w-24`})]}),(0,J.jsx)(`span`,{className:`flex h-8 items-center text-[var(--content-secondary)]`,children:`@`}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`label`,{htmlFor:`onboarding-email-handle`,className:rt,children:r(`domainStep.handleLabel`)}),(0,J.jsx)(`input`,{id:`onboarding-email-handle`,value:d,onChange:e=>{p(e.target.value.toLowerCase().trim()),v&&y(null)},disabled:T||w,readOnly:w,autoFocus:!0,placeholder:r(`domainStep.subdomainExamplePlaceholder`),"aria-invalid":!!v,className:`${nt} w-full min-w-0`})]}),(0,J.jsxs)(`span`,{className:`flex h-8 shrink-0 items-center text-[14px] text-[var(--content-tertiary)]`,children:[`.`,a]})]}),v&&(0,J.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:v}),w&&(0,J.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:r(`domainStep.domainLockedMessage`)})]}),t&&!w&&(0,J.jsx)(F,{tone:`neutral`,children:r(`domainStep.machineBusyNotice`)}),!w&&(0,J.jsx)(F,{tone:`info`,className:`border-transparent bg-[var(--surface-active)]`,children:(0,J.jsx)(`span`,{className:`font-medium text-[var(--content-tertiary)]`,children:r(`domainStep.handleImmutableNotice`)})}),x?(0,J.jsx)(F,{tone:`success`,children:r(`domainStep.domainSetRedirecting`)}):null]}),(0,J.jsx)(f.Footer,{className:`items-center pt-6`,children:w?(0,J.jsx)(s,{variant:`primary`,"data-testid":`onboarding-domain-continue`,onClick:e,children:r(`domainStep.continue`)}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(s,{variant:`outlined`,"data-testid":`onboarding-domain-skip`,disabled:T,onClick:()=>{T||C.mutate({body:{skipped:!0}},{onSuccess:e,onError:()=>e()})},children:r(`domainStep.skip`)}),(0,J.jsx)(s,{variant:`primary`,"data-testid":`onboarding-domain-set`,disabled:!d||T||t,onClick:()=>{T||t||!d||C.mutate({body:{subdomain:d,...m?{email_username:m}:{}}},{onSuccess:()=>{y(null),S(!0),i.invalidateQueries({queryKey:ie()}),i.invalidateQueries({queryKey:oe({path:{assistant_id:c??``}})}),i.invalidateQueries({queryKey:te()})},onError:e=>{y(tt(e,r(`domainStep.registerSubdomainFailed`)))}})},children:r(`domainStep.next`)})]})})]})}function at({onGoToBilling:e,direction:t}){let{t:n}=V(`settings`);return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-6 py-10 text-center`,children:[(0,J.jsx)(ze,{icon:W}),(0,J.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,J.jsx)(P,{variant:`title-small`,as:`h1`,children:n(`errorStates.fetchErrorTitle`)}),(0,J.jsx)(P,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:Ue(t).fetchErrorBody})]}),(0,J.jsx)(s,{variant:`primary`,"data-testid":`onboarding-go-to-billing`,onClick:e,children:n(`errorStates.goToBilling`)})]})}function ot(e){let{targets:t,fromSnapshot:n,machineFloor:r,credits:i}=e,a=[];return t.machineSize==null?r!=null&&n.machineSize!=null&&n.machineSize!==r&&a.push({key:`machine`,label:`Machine`,from:K[n.machineSize],to:K[r]}):n.machineSize!==t.machineSize&&a.push({key:`machine`,label:`Machine`,from:n.machineSize==null?void 0:K[n.machineSize],to:K[t.machineSize]}),t.storageGib!=null&&(n.storageGib==null||t.storageGib>n.storageGib)&&a.push({key:`storage`,label:`Storage`,from:n.storageGib==null?void 0:`${n.storageGib} GB`,to:`${t.storageGib} GB`}),i!=null&&a.push({key:`credits`,label:i.label??`Credits`,from:i.from,to:i.to}),a}var st=60,ct=st*2;function lt({imageUrl:e,animateIn:t=!0}){return(0,J.jsxs)(`div`,{"aria-hidden":!0,"data-testid":`takeover-backdrop`,className:`pointer-events-none absolute inset-0 overflow-hidden${t?` provision-avatar-reveal`:``}`,children:[(0,J.jsx)(`img`,{src:e,alt:``,decoding:`async`,draggable:!1,className:`absolute left-1/2 top-1/2 max-w-none -translate-x-1/2 -translate-y-1/2 object-cover object-center`,style:{filter:`blur(${st}px)`,width:`calc(100% + ${ct*2}px)`,height:`calc(100% + ${ct*2}px)`}}),(0,J.jsx)(`div`,{className:`absolute inset-0 bg-black/55`})]})}function ut(e,t){if(t!=null)return e?.credit_tiers?.find(e=>e.tier===t)}function dt(e){let t=e?.match(/^credits_(\d+)$/)?.[1];return t==null?null:Number(t)}function ft(e){let t=d(),{data:n}=B({...m(),enabled:t&&e});return n?.plans.find(e=>e.id===`pro`)}function pt(e,t){return t==null?0:ut(e,t)?.credits_usd??dt(t)}function mt(e,t){return t==null?null:ut(e,t)?.label}function ht(e){let t=ft(e!=null);if(e==null||t==null)return null;let n,r;if(e.kind===`package`){let i=t.packages.find(t=>t.key===e.packageKey),a=ut(t,i?.credit_tier);n=i?.credits_usd??a?.credits_usd,r=i?.usage_label??a?.label??void 0}else{let i=ut(t,e.creditTier);n=i?.credits_usd,r=i?.label}return n==null?null:{fromLabel:null,toLabel:r}}function gt(e){let t=ft(e!=null);return e==null||pt(t,e.fromTier)==null||pt(t,e.toTier)==null?null:{fromLabel:mt(t,e.fromTier),toLabel:mt(t,e.toTier)}}function _t(e){let t=u.use.activeAssistantId(),n=e===void 0?t:e,{components:r,traits:a,customImageUrl:o,state:s,isLoading:l}=_(n),d=(0,q.useMemo)(()=>i(),[de()]),f=d!=null&&S(d)?d:null,p=n!=null&&!l,m=f!=null&&(n==null||n===f.assistantId),h=m&&!(p&&(r!=null||a!=null||o!=null))?f:null,v=h?h.components:r,y=h?h.traits:a,b=h?null:o,x=p||m,C=re({state:h?null:s,components:v,traits:y,customImageUrl:b})??(b?null:g[0]?.hex??null);return{tintHex:x&&C?c(C):T,backdropImageUrl:x?b:null,ready:x,avatar:{components:v,traits:y,customImageUrl:b}}}function vt(e,t){let[n,r]=(0,q.useState)(e),i=(0,q.useRef)(0);return(0,q.useEffect)(()=>{i.current=performance.now()},[]),(0,q.useEffect)(()=>{if(t<=0||e===n)return;let a=t-(performance.now()-i.current);if(a<=0){i.current=performance.now(),r(e);return}let o=setTimeout(()=>{i.current=performance.now(),r(e)},a);return()=>clearTimeout(o)},[e,n,t]),t<=0?e:n}var yt=`--takeover-surface`,bt=`var(${yt},${T})`,xt=`color-mix(in srgb, var(--content-emphasised) 10%, transparent)`,St=240,Ct=1.414,wt=[{minHeight:680,size:St},{minHeight:600,size:184}],Tt=132;function Et(e){for(let t of wt)if(e>=t.minHeight)return t.size;return Tt}function Dt(){let[e,t]=(0,q.useState)(()=>Et(typeof window>`u`?1/0:window.innerHeight));return(0,q.useEffect)(()=>{let e=()=>t(Et(window.innerHeight));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var Ot={machine:we,storage:Ee,credits:Te},kt={idle:``,working:` is-working`,settling:` is-settling`,stalled:` is-stalled`,grown:` is-evolved`};function At(e,t){return e===`DONE`||e===`NOT_APPLICABLE`?`grown`:e===`STALLED`?`stalled`:e===`WAITING`||e===`RESIZING`?t?`settling`:`working`:`idle`}function jt({assistantId:e,mode:t,downsizing:n=!1}){let{avatar:r,ready:i}=_t(e),a=R(),o=Dt(),s=t===`working`||t===`settling`;return(0,J.jsxs)(`div`,{"aria-hidden":!0,className:`provision-avatar-evolve relative z-10 flex flex-col items-center${kt[i?t:`idle`]}${n?` is-downsizing`:``}`,style:{"--provision-avatar-size":`${o}px`,"--provision-avatar-growth":Ct},children:[(0,J.jsxs)(`div`,{className:`provision-avatar-stage`,children:[(0,J.jsx)(`div`,{"data-testid":`provision-avatar-placeholder`,className:`provision-avatar-placeholder${i?` is-resolved`:``}`}),(0,J.jsx)(`div`,{className:`provision-avatar-layer`,children:(0,J.jsx)(`div`,{className:`provision-avatar-current`,children:(0,J.jsx)(`div`,{className:`provision-avatar-strain`,children:i&&(0,J.jsx)(`div`,{className:`provision-avatar-reveal`,children:(0,J.jsx)(w,{components:r.components??a,traits:r.traits,customImageUrl:r.customImageUrl,size:o,isAssistantBusy:s})})})})})]}),(0,J.jsx)(`div`,{className:`provision-avatar-shadow`})]})}function Mt({status:e,caption:t}){return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,J.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:Y,children:e}),t&&(0,J.jsx)(P,{variant:`body-medium-lighter`,as:`p`,className:`max-w-sm text-[var(--content-secondary)]`,children:t})]})}function Nt({icon:e,label:t,from:n,to:r,done:i=!1,pending:a=!1,testId:o}){let{t:s}=V(`settings`),c=null;return i?c=s(`provisioningState.statusComplete`):a&&(c=s(`provisioningState.statusPending`)),(0,J.jsxs)(`div`,{"data-testid":o,className:`flex min-w-0 flex-auto items-center gap-2 rounded-lg px-2 py-1.5${a?` opacity-70`:``}`,style:{backgroundColor:xt},children:[(0,J.jsx)(`span`,{className:`hidden h-6 w-6 shrink-0 items-center justify-center min-[420px]:flex`,children:(0,J.jsx)(e,{className:`h-3.5 w-3.5 text-[var(--content-tertiary)]`,"aria-hidden":`true`})}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 text-left wrap-anywhere`,children:[(0,J.jsx)(`span`,{className:`text-[12px] font-medium leading-tight text-[var(--content-tertiary)]`,children:t}),(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5 text-[14px] font-medium leading-[18px] text-[var(--content-emphasised)]`,children:[n&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{children:n}),(0,J.jsx)(`span`,{className:`sr-only`,children:s(`provisioningState.srOnlyTo`)}),(0,J.jsx)(be,{className:`h-3 w-3 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":`true`})]}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,J.jsx)(`span`,{children:r}),i?(0,J.jsx)(U,{"data-testid":`chip-check`,className:`h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`,"aria-hidden":`true`}):a&&(0,J.jsx)(Ce,{"data-testid":`chip-spinner`,className:`h-3.5 w-3.5 shrink-0 animate-spin text-[var(--content-tertiary)] motion-reduce:animate-none`,"aria-hidden":`true`})]}),c&&(0,J.jsx)(`span`,{className:`sr-only`,children:c})]})]})]})}function Pt({label:e}){return(0,J.jsx)(`span`,{className:`rounded-lg px-3 py-2 text-[14px] text-[var(--content-emphasised)]`,style:{backgroundColor:xt},children:e})}function Ft({children:e,wide:t=!1,testId:n}){return(0,J.jsx)(`div`,{"data-testid":n,className:`flex w-full ${t?`max-w-2xl`:`max-w-sm`} items-stretch justify-center gap-2`,children:e})}function It(e,t){return e===`credits`?!0:t?.[e]===!0}function Lt(e,t){if(e==null)return null;let n=t(`provisioningState.noExtraUsage`),r=e.toLabel===null?n:e.toLabel;return r==null?null:{label:t(`provisioningState.usageLabel`),from:e.fromLabel===null?n:e.fromLabel,to:r}}function Rt({intent:e,creditsChange:t,targets:n,fromSnapshot:r,machineFloor:i,landed:a,allDone:o=!1,creditsOnly:s=!1}){let{t:c}=V(`settings`),l=ht(e),u=gt(t),d=ot({targets:n,fromSnapshot:r,machineFloor:i,credits:Lt(l??u,c)}),f=s?d.filter(e=>e.key===`credits`):d,p=f.filter(e=>o||It(e.key,a)).map(e=>e.label).join(`, `),[m]=(0,q.useState)(p),h=p===m?``:c(`provisioningState.dimensionsComplete`,{dimensions:p});return f.length===0?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ft,{testId:`resource-chips`,wide:f.length>=3,children:f.map(e=>{let t=o||It(e.key,a);return(0,J.jsx)(Nt,{testId:`chip-${e.key}`,icon:Ot[e.key],label:e.label,from:e.from,to:e.to,done:t,pending:!t},e.key)})}),(0,J.jsx)(`p`,{"aria-live":`polite`,className:`sr-only`,"data-testid":`chip-announcement`,children:h})]})}function zt({intent:e}){let{t}=V(`settings`),n=ht(e.kind===`custom`?e:null);if(e.kind===`package`)return(0,J.jsx)(Ft,{children:(0,J.jsx)(Pt,{label:t(`provisioningState.packageChip`,{name:e.packageKey.charAt(0).toUpperCase()+e.packageKey.slice(1)})})});let r=[e.machineTier,e.storageTier,e.creditTier].filter(e=>e!=null).length;return(0,J.jsxs)(Ft,{wide:r>=3,children:[e.machineTier!=null&&(0,J.jsx)(Nt,{icon:we,label:t(`provisioningState.machineLabel`),to:Ae[e.machineTier]??e.machineTier}),e.storageTier!=null&&(0,J.jsx)(Nt,{icon:Ee,label:t(`provisioningState.storageLabel`),to:e.storageTier.toUpperCase()}),e.creditTier!=null&&n?.toLabel!=null&&(0,J.jsx)(Pt,{label:n.toLabel})]})}function Bt({state:e,direction:t,softWaiting:n,intent:r,creditsChange:i,targets:a,fromSnapshot:o,machineFloor:c,landed:l,celebrating:u,onCelebrationEnd:d,assistantId:f,escapeAvailable:p,onEscape:m,onPhaseChange:h,kickError:g,confirm:_,dwellMs:v=Ye,phaseMinMs:y=900}){let{t:b}=V(`settings`),x=Ue(t),S=(0,q.useRef)(d);(0,q.useEffect)(()=>{S.current=d},[d]);let C=vt(e,y),w=C===`DONE`||C===`NOT_APPLICABLE`,T=C===`RESIZING`?`WAITING`:C,E=(0,q.useRef)(h);(0,q.useEffect)(()=>{E.current=h},[h]),(0,q.useEffect)(()=>{E.current?.(C)},[C]);let{tintHex:D,backdropImageUrl:O}=_t(f),k=u&&w;return(0,q.useEffect)(()=>{if(!k)return;let e=setTimeout(()=>S.current(),v);return()=>clearTimeout(e)},[k,v]),(0,J.jsxs)(`div`,{"data-theme":`dark`,className:`provision-surface-settle relative flex h-full min-h-[420px] w-full flex-col items-center [justify-content:safe_center] gap-10 px-6 py-10 text-center`,style:{[yt]:D,backgroundColor:bt},children:[O&&(0,J.jsx)(lt,{imageUrl:O}),(0,J.jsx)(jt,{assistantId:f,mode:At(C,n),downsizing:t===`downgrade`}),(0,J.jsx)(`div`,{className:`relative z-10 flex min-h-[144px] w-full flex-col items-center gap-8 [animation:onboarding-step-in_420ms_ease-out] motion-reduce:[animation:none]`,children:ee()},T)]});function A(e=b(`provisioningState.continueInBackground`)){return p?(0,J.jsx)(s,{variant:`ghost`,"data-testid":`provisioning-escape`,onClick:m,children:e}):null}function j({allDone:e=!1,creditsOnly:t=!1}={}){return(0,J.jsx)(Rt,{intent:r,creditsChange:i,targets:a,fromSnapshot:o,machineFloor:c,landed:l,allDone:e,creditsOnly:t})}function ee(){if(C===`CONFIRMING`)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:x.confirmingStatus,caption:b(`provisioningState.confirmingCaption`)}),r&&(0,J.jsx)(zt,{intent:r}),A()]});if(C===`WAITING`||C===`RESIZING`)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:x.waitingStatus,caption:b(n?`provisioningState.waitingCaptionLong`:`provisioningState.waitingCaptionShort`)}),j(),A()]});if(C===`DONE`)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:b(`provisioningState.allDoneStatus`)}),j({allDone:!0})]});if(C===`NOT_APPLICABLE`)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:b(`provisioningState.planReadyStatus`)}),j({allDone:!0,creditsOnly:!0})]});if(C===`STALLED`){let e=g!=null;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:e?x.snagStatus:b(`provisioningState.takingLongerStatus`),caption:e?tt(g,x.snagCaption,t):b(`provisioningState.stalledCaption`)}),j(),e?A(b(`provisioningState.retryInBackground`)):A()]})}return C===`CONFIRM_TIMEOUT`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:x.confirmTimeoutStatus,caption:x.confirmTimeoutCaption}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,J.jsx)(s,{variant:`outlined`,"data-testid":`onboarding-go-to-billing`,onClick:_.onGoToBilling,children:b(`provisioningState.goToBilling`)}),(0,J.jsx)(s,{variant:`primary`,"data-testid":`onboarding-retry`,onClick:_.onRetry,children:b(`provisioningState.tryAgain`)})]})]}):null}}function Vt(e){let{planId:t,targets:n,actuals:r,initialActuals:i,resizeOperationInFlight:a,sawOperation:o,msSinceWatchStart:s,confirmExpired:c,serverVerdict:l=null,statusObservedSinceTargetsMet:u=!0,targetsProveNoop:d=!0}=e;if(t!==`pro`)return{state:c?`CONFIRM_TIMEOUT`:`CONFIRMING`,softWaiting:!1};let f=o||a,p=l===`started`||l===`in_progress`,m=o||d&&u;if(!a){let e=p?m:f||l===`already_done`||i!=null&&!Ne(n,i);if(Ne(n,r)){if(e)return{state:`DONE`,softWaiting:!1};if(!p&&(d||l===`not_applicable`))return{state:`NOT_APPLICABLE`,softWaiting:!1}}else{if(l===`already_done`)return{state:`DONE`,softWaiting:!1};if(l===`not_applicable`)return{state:`NOT_APPLICABLE`,softWaiting:!1}}}return s!=null&&s>=9e4?{state:`STALLED`,softWaiting:!1}:f||l===`started`||l===`in_progress`?{state:`RESIZING`,softWaiting:!1}:{state:`WAITING`,softWaiting:s!=null&&s>=3e4}}var Ht=2e3,Ut=1e3,Wt=[`DONE`,`NOT_APPLICABLE`,`CONFIRM_TIMEOUT`],Gt={assistantId:null,machine:null,storage:null};function Kt({open:e,canLowerResources:t=!1,verdictRecheckMs:r=Ze}){let i=H(),o=d(),[s,c]=(0,q.useState)(!1),[l,u]=(0,q.useState)(0),[f,p]=(0,q.useState)(null),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(null),[v,b]=(0,q.useState)(null),[x,S]=(0,q.useState)(null),[C,w]=(0,q.useState)(null),[T,E]=(0,q.useState)(Gt),[O,k]=(0,q.useState)(null),[j,ee]=(0,q.useState)(!1),M=(0,q.useRef)(!1),N=(0,q.useRef)(!1),P=(0,q.useRef)(0),[ne,re]=(0,q.useState)(!1),[ie,oe]=(0,q.useState)(null),[F,I]=(0,q.useState)(null),[se,le]=(0,q.useState)(null),[de,L]=(0,q.useState)(()=>Date.now()),[fe,R]=(0,q.useState)(!0);(0,q.useEffect)(()=>{e||(c(!1),u(0),p(null),h(null),_(null),re(!1),oe(null),I(null),le(null),R(!0),b(null),S(null),w(null),E(Gt),k(null),ee(!1),M.current=!1,N.current=!1,P.current+=1)},[e]),(0,q.useEffect)(()=>{e&&(p(Date.now()),i.invalidateQueries({queryKey:ae()}),i.invalidateQueries({queryKey:te()}))},[e,i]);let z=m!=null,V=B({...ce(),refetchInterval:e=>e.state.data?.plan_id===`pro`||s?!1:qe,refetchIntervalInBackground:!1,enabled:e&&o&&!z}),ge=(f!=null&&V.dataUpdatedAt>=f?V.data?.plan_id:null)??null;(0,q.useEffect)(()=>{if(!e||z||ge!==`pro`)return;let t=Date.now();h(t),L(t)},[e,z,ge]),(0,q.useEffect)(()=>{if(!e||z)return;let t=setTimeout(()=>c(!0),Je);return()=>clearTimeout(t)},[e,z,l]);let _e=(0,q.useCallback)(()=>{c(!1),u(e=>e+1),A.getState().fetchOrganizations(),i.invalidateQueries({queryKey:ae()})},[i]),ve=(0,q.useCallback)(()=>{let e=Date.now();_(e),L(e)},[]),{mutate:ye}=pe(y()),U=(0,q.useCallback)(e=>{let t=P.current;ye({},{onSuccess:n=>{t===P.current&&(k(null),Fe(n)?N.current?k({error:n.reason??`no_active_pro`}):(N.current=!0,ee(!0),e===`escape`&&ve()):(b(n.state),e===`escape`&&ve()))},onError:e=>{t===P.current&&k(e)}})},[ye,ve]);(0,q.useEffect)(()=>{!e||!o||!z||M.current||(M.current=!0,U(`auto`))},[e,o,z,U]),(0,q.useEffect)(()=>{if(!j)return;let e=P.current,t=setTimeout(()=>{ee(!1),e===P.current&&U(`auto`)},Xe);return()=>clearTimeout(t)},[j,U]);let be=(0,q.useCallback)(()=>U(`escape`),[U]),W=B({...n(),enabled:e&&o&&z}),xe=fe?Ht:!1,Se=B({...D(),enabled:e&&o&&z,refetchInterval:e=>e.state.data?.id==null?xe:!1,retry:!1}),Ce=z&&f!=null&&W.dataUpdatedAt>=f,we=Ce&&!W.isPending&&!W.isFetching,G=(Ce?W.data?.primary_assistant_id:null)??(W.isPending?null:Se.data?.id??null),Te=B({...a({path:{id:G??`unresolved`}}),enabled:e&&o&&z&&G!=null,refetchInterval:xe,retry:!1}),Ee=ue({path:{id:G??`unresolved`}}),De=B({...Ee,enabled:e&&o&&z&&G!=null,refetchInterval:xe,retry:!1}),K=(0,q.useRef)(0),[Ae,je]=(0,q.useState)(0),Re=he(Ee.queryKey);(0,q.useEffect)(()=>i.getQueryCache().subscribe(t=>{if(!(t.type!==`updated`||t.query.queryHash!==Re)){if(t.action.type===`fetch`)K.current+=1;else if(t.action.type===`success`&&!t.action.manual){let n=K.current,r=e&&Ie(t.action.data);me.schedule(()=>{je(n),r&&(re(!0),oe(G))})}}}),[i,Re,e,G]);let J=Ie(De.data),ze=ie===G,Y=W.data,X=(0,q.useMemo)(()=>Y?{machineSize:Oe(Y.max_machine_tier),storageGib:Y.selected_storage_gib??null}:null,[Y]),Be=Y!=null&&Y.max_machine_tier==null?Me:null,Ve=Y?Y.domain_setup_available&&Y.primary_assistant_id!=null:void 0,He=Te.data,Z=(0,q.useMemo)(()=>He?{machineSize:He.machine_size??null,storageGib:He.provisioned_storage_gib??null}:null,[He]),Q=se===G,$=(0,q.useMemo)(()=>{let e=Le(X,Z),t=X?.machineSize??Be;if(t==null)return e;let n=Z?.machineSize??null;if(n==null)return{...e,machine:!1};let r=(Q?F?.machineSize:null)??n,i=ke(t)<ke(r);return{...e,machine:i?ke(n)<=ke(t):ke(n)>=ke(t)}},[X,Z,F,Q,Be]),Ue=Ne(X,Z),We=C===G;(0,q.useEffect)(()=>{e&&(Ue?(S(e=>e!=null&&We?e:Date.now()),w(G)):(S(null),w(null)))},[e,Ue,G,We]);let Ge=T.assistantId===G;(0,q.useEffect)(()=>{if(!e)return;let t=K.current;E(e=>{let n=e.assistantId===G?e:Gt,r=$.machine?n.machine??t:null,i=$.storage?n.storage??t:null;return e.assistantId===G&&e.machine===r&&e.storage===i?e:{assistantId:G,machine:r,storage:i}})},[e,$,G]);let Ke=(0,q.useMemo)(()=>{let e=Pe(De.data),t=e=>e!=null&&Ge&&Ae>e;return{machine:$.machine&&!e.machine&&t(T.machine),storage:$.storage&&!e.storage&&t(T.storage)}},[$,T,Ge,Ae,De.data]);(0,q.useEffect)(()=>{!e||!Z||F!=null&&Q||(I(Z),le(G))},[e,Z,G,F,Q]);let Ye=g??m,Qe=Ye==null?null:Math.max(0,de-Ye),$e=!t,{state:et,softWaiting:tt}=Vt({planId:z?`pro`:ge,targets:X,actuals:Z,initialActuals:Q?F:null,resizeOperationInFlight:J,sawOperation:ne&&ze,msSinceWatchStart:Qe,confirmExpired:s,serverVerdict:v,statusObservedSinceTargetsMet:x!=null&&We&&De.dataUpdatedAt>x,targetsProveNoop:$e}),nt=Wt.includes(et),rt=e&&z&&!nt;(0,q.useEffect)(()=>{R(rt)},[rt]),(0,q.useEffect)(()=>{if(!e||!z||nt)return;let t=setInterval(()=>L(Date.now()),Ut);return()=>clearInterval(t)},[e,z,nt]);let it=!$e&&(v===`started`||v===`in_progress`)&&!(ne&&ze);return(0,q.useEffect)(()=>{if(!e||!z||nt||!it)return;let t=setInterval(()=>U(`auto`),r);return()=>clearInterval(t)},[e,z,nt,it,r,U]),{state:et,softWaiting:tt,targets:X,actualsSnapshot:F,machineFloor:Be,landed:Ke,assistantId:G,domainStepAvailable:Ve,onboardingSettled:we,confirmError:!z&&V.isError,targetsError:z&&W.isError&&(!Y||!Ce),escapeEligible:Qe!=null&&Qe>=6e4,retryConfirm:_e,kickProvisioning:be,kickError:O}}var qt=200,Jt=380;function Yt(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}var Xt=e=>e===`WAITING`||e===`RESIZING`||e===`STALLED`,Zt=e=>e===`DONE`||e===`NOT_APPLICABLE`,Qt={machineSize:null,storageGib:null};function $t({open:e,onClose:t,dwellMs:n,phaseMinMs:i,mode:a=`checkout`,resizeContext:o}){let{t:s}=V(`settings`),c=a===`resize`,u=H(),[d,p]=(0,q.useState)(`provisioning`),[m,g]=(0,q.useState)(`idle`),_=(0,q.useRef)([]),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(null),[S,C]=(0,q.useState)(null),[w,T]=(0,q.useState)(!1),E=c?o?.direction:void 0,D=Ue(E),O=Kt({open:e,canLowerResources:c?o?.canLowerResources===!0:!1}),k=(0,q.useRef)(!1);(0,q.useEffect)(()=>{if(e){k.current=!0,y(c?null:l()),C(e=>e??Date.now());return}_.current.forEach(clearTimeout),_.current=[],p(`provisioning`),g(`idle`),x(null),C(null),T(!1),k.current&&(k.current=!1,fe())},[e,c]),(0,q.useEffect)(()=>()=>{_.current.forEach(clearTimeout)},[]),(0,q.useEffect)(()=>{d===`complete`&&r()},[d]);let A=Xt(O.state),j=Zt(b??O.state),{targets:ee,assistantId:M,domainStepAvailable:N,onboardingSettled:te}=O,P=c?o?.fromSnapshot:void 0,ne=O.actualsSnapshot,re={machineSize:P?.machineSize??ne?.machineSize??null,storageGib:P?.storageGib??ne?.storageGib??null},{tintHex:ie,backdropImageUrl:ae}=_t(M),F=c&&N===!0,{domains:se,domainsError:ce,domainsFetching:le,domainsUpdatedAt:ue,domainsErrorUpdatedAt:de}=Ke(e&&F,M),L=(se?.results.length??0)>0,R=(0,q.useRef)(null);(0,q.useEffect)(()=>{if(!e){R.current=null;return}!F||M==null||R.current!==M&&(R.current=M,u.invalidateQueries({queryKey:oe({path:{assistant_id:M}})}))},[e,F,M,u]);let z=!le&&(S!=null&&ue>=S||S!=null&&!!ce&&de>=S),[B,pe]=(0,q.useState)(!1),me=te&&(!F||z);(0,q.useEffect)(()=>{if(!e){pe(!1);return}me&&pe(!0)},[e,me]);let he=(0,q.useCallback)(()=>{let e=c?N===!0&&!L?`domain`:`complete`:N===!1?`complete`:`domain`;if(Yt()){p(e);return}g(`covering`),_.current.push(setTimeout(()=>{p(e),g(`revealing`),_.current.push(setTimeout(()=>g(`idle`),Jt))},qt))},[N,c,L]),ge=(0,q.useCallback)(()=>{T(!0)},[]),_e=(0,q.useCallback)(()=>{O.kickProvisioning(),I.info(O.kickError==null?D.backgroundExitToast:D.backgroundRetryToast),T(!1),t()},[O,t,D]),ve=(0,q.useCallback)(()=>{T(!1)},[]),ye=d===`provisioning`&&(O.confirmError||O.targetsError),U=d===`provisioning`&&!ye,be=U&&!j,W=`transition-[background-color] duration-300 ease-out${U?` bg-black p-0`:``}`,xe=U?`[animation:fadeIn_0.45s_ease-out_both]`:m===`revealing`?`[animation:fadeInUp_0.42s_ease-out_0.12s_both]`:`[animation:fadeIn_0.25s_ease-out_both]`;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(f.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,J.jsxs)(f.Content,{size:`md`,hideCloseButton:d!==`complete`,dismissOnOverlayClick:!be,onEscapeKeyDown:be?e=>e.preventDefault():void 0,onInteractOutside:be?e=>e.preventDefault():void 0,"data-theme":U?`dark`:void 0,overlayClassName:W,className:U?`overflow-y-auto inset-0 max-w-none w-screen h-screen max-h-none rounded-none border-0`:`overflow-hidden`,style:{[yt]:ie},children:[(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col motion-reduce:[animation:none] ${xe}`,children:Se()},d),m!==`idle`&&(0,J.jsx)(`div`,{"aria-hidden":!0,"data-testid":`takeover-exit-sheet`,className:`pointer-events-none fixed inset-0 z-50 ${m===`covering`?`[animation:fadeIn_200ms_ease-in_both]`:`[animation:fadeIn_380ms_ease-out_both_reverse]`}`,style:{backgroundColor:bt},children:ae&&(0,J.jsx)(lt,{imageUrl:ae,animateIn:!1})})]})}),(0,J.jsx)(h,{open:w&&A,title:s(`billingOnboardingModal.backgroundConfirmTitle`),message:D.backgroundConfirmMessage,confirmLabel:s(`billingOnboardingModal.backgroundConfirmContinue`),cancelLabel:s(`billingOnboardingModal.backgroundConfirmKeepWaiting`),onConfirm:_e,onCancel:ve})]});function Se(){return d===`provisioning`?O.confirmError||O.targetsError?(0,J.jsx)(at,{onGoToBilling:t,direction:E}):(0,J.jsx)(Bt,{state:O.state,direction:E,softWaiting:O.softWaiting,intent:v,creditsChange:c?o?.credits:void 0,targets:ee??Qt,fromSnapshot:re,machineFloor:O.machineFloor,landed:O.landed,celebrating:B,onCelebrationEnd:he,assistantId:M,escapeAvailable:A&&O.escapeEligible,onEscape:ge,onPhaseChange:x,kickError:O.kickError,confirm:{onRetry:O.retryConfirm,onGoToBilling:t},dwellMs:n,phaseMinMs:i}):d===`domain`?(0,J.jsx)(it,{machineBusy:A,assistantId:M,onExit:()=>p(`complete`)}):(0,J.jsx)(Ge,{assistantId:M,direction:E})}}function en(e){return e!=null&&!e.customized}function tn(e){return en(e)?e.name:`Custom`}var nn=[`mighty`,`super`,`ultra`],rn=[`free`,...nn];function an(e){return rn.indexOf(e)}function on(e,t){if(e===null)return`upgrade`;let n=an(e),r=an(t);return n===-1||r===-1?`upgrade`:r===n?`current`:r<n?`downgrade`:`upgrade`}function sn(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>nn.indexOf(e.key)-nn.indexOf(t.key));if(!t)return n[0];let r=n.findIndex(e=>e.key===t);return r===-1?n[0]:r>=n.length-1?null:n[r+1]}var cn=[`too_expensive`,`missing_features`,`switched_service`,`unused`,`too_complex`,`low_quality`,`customer_service`,`other`],ln={too_expensive:`cancelReasonSurvey.optionTooExpensive`,missing_features:`cancelReasonSurvey.optionMissingFeatures`,switched_service:`cancelReasonSurvey.optionSwitchedService`,unused:`cancelReasonSurvey.optionUnused`,too_complex:`cancelReasonSurvey.optionTooComplex`,low_quality:`cancelReasonSurvey.optionLowQuality`,customer_service:`cancelReasonSurvey.optionCustomerService`,other:`cancelReasonSurvey.optionOther`},un=1e3,dn={feedback:null,comment:``};function fn(e){return e.feedback!=null}function pn(e){let t=e.feedback===`other`?e.comment.trim():``;return{feedback:e.feedback,comment:t||null}}function mn({value:e,onChange:n,disabled:r}){let{t:i}=V(`settings`);return(0,J.jsxs)(`div`,{className:`mt-5 space-y-3`,"data-testid":`cancel-reason-survey`,children:[(0,J.jsx)(P,{as:`p`,variant:`body-medium-default`,children:i(`cancelReasonSurvey.title`)}),(0,J.jsx)(t,{value:e.feedback??``,onValueChange:t=>n({...e,feedback:t===``?null:t}),name:`cancel-reason`,disabled:r,"aria-label":i(`cancelReasonSurvey.title`),children:cn.map(e=>(0,J.jsx)(v,{value:e,label:i(ln[e])},e))}),e.feedback===`other`?(0,J.jsx)(se,{label:i(`cancelReasonSurvey.otherLabel`),placeholder:i(`cancelReasonSurvey.otherPlaceholder`),value:e.comment,onChange:t=>n({...e,comment:t.target.value}),maxLength:un,rows:3,disabled:r,fullWidth:!0,"data-testid":`cancel-reason-comment`}):null]})}var hn={free:{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},mighty:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`},super:{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},ultra:{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`}};function gn({tier:e,size:t=40}){let n=hn[e]??hn.free,r=R();return(0,J.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,J.jsx)(C,{components:r,bodyShapeId:n.bodyShape,colorId:n.color,size:t}):(0,J.jsx)(`div`,{style:{width:t,height:t}})})}var _n={free:{tagline:`Get to know your assistant.`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`More capacity for consistent use.`,cta:`Power Up`,priceCaption:`Billed monthly`,recommended:!0},super:{tagline:`Do more, think less about the how.`,cta:`Go Super`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Your second brain, running full speed.`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function vn(e){return _n[e]}function yn(e){return`Downgrade to ${e}`}function bn(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function xn(e){return`${bn(e)}/mo`}function Sn(e){return`${bn(e)}/month`}function Cn(e){return`${e>0?`+`:`−`}${bn(Math.abs(e))}/mo`}function wn(e){return`${e} GB storage`}function Tn(e){return`${bn(e*100)} of bundled credits`}var En=`Small`;function Dn(e){return e?.machine_size?K[e.machine_size]??e.machine_size:En}function On(e,t){let n=vn(e.key)?.extraFeatures??[];return[{icon:Re,label:`${Dn(e)} Machine`},{icon:Ee,label:`${e.storage_gib} GB Storage`},{icon:Te,label:t},...n.map(e=>({icon:xe,label:e}))]}function kn(){return[{icon:Re,label:`${En} Machine`},{icon:Ee,label:`4 GB Storage`},{icon:Te,label:`Pay as you go credits`}]}function An(e,t=[]){let n=e?.credits_usd??0,r=e?.storage_gib??4,i=je[e?.machine_size??`small`];return[`${Dn(e)} machine${i?` (${i})`:``}`,wn(r),e?.usage_label??Tn(n),...t]}var jn={machine:`Configurable machine size`,storage:`Configurable storage`,credits:`Pay-as-you-go and bundled credits`};function Mn(e,t){let n=[`${e.machineTier?Ae[e.machineTier]??t.machine_tiers.find(t=>t.tier===e.machineTier)?.label??e.machineTier:En} Machine`];if(e.storageGib!=null&&n.push(`${e.storageGib} GB`),e.creditTier!=null){let r=ut(t,e.creditTier)?.label,i=dt(e.creditTier);n.push(r??(i==null?`Credit bundle`:`${i} credits/mo`))}return n}function Nn(e,t){let n=new Set([jn.machine]);return e.storageGib!=null&&n.add(jn.storage),e.creditTier!=null&&n.add(jn.credits),[...Mn(e,t),...t.included_features.filter(e=>!n.has(e))]}function Pn(e){return e.disabled===!0}function Fn({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:r,onMachineTierChange:i,onStorageTierChange:a,currentMachinePriceCents:o,currentStoragePriceCents:s}){let{t:c}=V(`settings`),l=(0,q.useMemo)(()=>e.map(e=>{let t=Ae[e.tier]??e.label,n=o==null?c(`tierPicker.priceAddon`,{price:xn(e.price_cents)}):e.price_cents===o?c(`tierPicker.priceCurrent`,{price:xn(e.price_cents)}):Cn(e.price_cents-o);return{value:e.tier,label:c(`tierPicker.machineOption`,{label:t,priceLabel:n}),disabled:Pn(e)}}),[e,o,c]),u=(0,q.useMemo)(()=>t.map(e=>{let t=s==null?c(`tierPicker.priceAddon`,{price:xn(e.price_cents)}):e.price_cents===s?c(`tierPicker.priceCurrent`,{price:xn(e.price_cents)}):Cn(e.price_cents-s);return{value:e.tier,label:c(`tierPicker.storageOption`,{gib:e.storage_gib,priceLabel:t}),disabled:Pn(e)}}),[t,s,c]);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(P,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:c(`tierPicker.machineLabel`)}),(0,J.jsx)(`span`,{title:c(`tierPicker.machineTooltip`),children:(0,J.jsx)(G,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,J.jsx)(E,{"aria-label":c(`tierPicker.machineAriaLabel`),placeholder:c(`tierPicker.machinePlaceholder`),value:n??``,onChange:i,options:l})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(P,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:c(`tierPicker.storageLabel`)}),(0,J.jsx)(`span`,{title:c(`tierPicker.storageTooltip`),children:(0,J.jsx)(G,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,J.jsx)(E,{"aria-label":c(`tierPicker.storageAriaLabel`),placeholder:c(`tierPicker.storagePlaceholder`),value:r??``,onChange:a,options:u})]})]})}var In=new Set([`active`,`trialing`,`past_due`]);function Ln(e){return e.plan_id!==`base`&&e.cancel_at_period_end!==!0&&!e.cancel_at&&e.status!=null&&In.has(e.status)}function Rn(e){return e?.status!=null&&In.has(e.status)}var zn=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`package`,`non_field_errors`];function Bn(e,t){if(e&&typeof e==`object`){for(let t of zn)if(t in e){let n=e[t];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(`detail`in e&&typeof e.detail==`string`)return e.detail}return t}function Vn(e,t){let n=e.filter(e=>!Pn(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function Hn(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function Un(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}function Wn(){let e=H();return async t=>{try{let n=await t.mutateAsync();return await e.invalidateQueries({queryKey:ae()}),t.onSuccess(n),n}catch(e){return I.error(Bn(e,t.errorFallback()),{id:t.errorToastId}),null}}}var Gn=`billing-portal-return-snapshot`;function Kn(e){try{sessionStorage.removeItem(Gn),sessionStorage.setItem(Gn,JSON.stringify(e))}catch{}}function qn(){if(typeof sessionStorage>`u`)return null;try{let e=sessionStorage.getItem(Gn);if(!e)return null;let t=JSON.parse(e);return typeof t.cancel_at_period_end!=`boolean`||typeof t.plan_id!=`string`?null:{cancel_at_period_end:t.cancel_at_period_end,cancel_at:t.cancel_at??null,plan_id:t.plan_id}}catch{return null}}function Jn(){try{sessionStorage.removeItem(Gn)}catch{}}function Yn(e){return e?{cancel_at_period_end:e.cancel_at_period_end,cancel_at:e.cancel_at??null,plan_id:e.plan_id}:null}function Xn(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function Zn(e){return e?e.cancel_at??e.current_period_end??null:null}function Qn(e){let t=H();return(0,q.useEffect)(()=>L(()=>{t.invalidateQueries(ce())}),[t]),ne({onSuccess:t=>{e&&Kn(e),o(t.portal_url)},onError:()=>{I.error(z(`settings:useBillingPortalSession.openError`),{id:`billing-portal-session-error`})}})}function $n(){let e=ee(),t=Wn();return{cancelSubscription:n=>t({mutateAsync:()=>e.mutateAsync({body:n}),onSuccess:e=>{let t=e.cancel_at?Xn(e.cancel_at):z(`settings:useCancelSubscription.endOfBillingPeriod`);I.info(z(`settings:useCancelSubscription.canceledToast`,{date:t}),{id:`subscription-cancel`})},errorToastId:`subscription-cancel-error`,errorFallback:()=>z(`settings:useCancelSubscription.cancelFailedToast`)}),isPending:e.isPending}}function er(e){return Promise.all([e.invalidateQueries({queryKey:ae()}),e.invalidateQueries({queryKey:k()}),e.invalidateQueries({queryKey:te()}),e.invalidateQueries({queryKey:M()})])}function tr({enabled:e=!0}={}){let t=H(),{t:r}=V(`settings`),[i,a]=(0,q.useState)(null),o=(0,q.useRef)(!1),[s,c]=(0,q.useState)(!1),l=d(),u=e&&l,f=B({...ce(),enabled:u}),p=f.data,h=p!=null&&p.plan_id!==`base`,g=B({...n(),enabled:u&&h}),_=B({...m(),enabled:u&&h}).data?.plans.find(e=>e.id===`pro`)?.machine_tiers??[],v=e=>_.find(t=>t.tier===e)?.price_cents??null,y=pe(O()),b={machineTier:g.data?.max_machine_tier??null,storageTier:g.data?.selected_storage_tier??null,storageGib:g.data?.selected_storage_gib??null,creditTier:p?.selected_credit_tier??null,hasPlatformFee:p?.has_platform_fee??!0},x=p!=null&&p.plan_id!==`base`&&p.status!=null&&In.has(p.status)&&p.cancel_at_period_end!==!0&&!p.cancel_at,S=!h||!g.isPending,C=!h||g.isSuccess&&g.data!=null&&!g.isFetching&&g.dataUpdatedAt>=f.dataUpdatedAt,w=s||y.isPending,T=async(e,t=b)=>{if(o.current)return null;o.current=!0,c(!0);try{return await E(e,t)}finally{o.current=!1,c(!1)}},E=async(e,n)=>{a(null);let i=e=>(a(e),I.error(e),null),[o,s]=await Promise.all([f.refetch(),g.refetch()]),c=o.data,l=s.data;if(o.isError||s.isError||c==null||l==null)return i(r(`customPlanModal.changeFailed`));let u={machineTier:l.max_machine_tier??null,storageTier:l.selected_storage_tier??null,storageGib:l.selected_storage_gib??null,creditTier:c.selected_credit_tier??null,hasPlatformFee:c.has_platform_fee??!0},d={machineTier:e.machineTier===n.machineTier?u.machineTier:e.machineTier,storageTier:e.storageTier===n.storageTier&&u.storageTier!=null?u.storageTier:e.storageTier,creditTier:e.creditTier===n.creditTier?u.creditTier:e.creditTier},p=d.machineTier!==u.machineTier,m=d.storageTier!==u.storageTier,h=d.creditTier!==u.creditTier,_=!u.hasPlatformFee,b=v(d.machineTier),x=v(u.machineTier),S=p&&b!=null&&x!=null&&b<x;if(!p&&!m&&!h&&!_)return{needsResize:!1,creditChanged:!1};let C;try{C=(await y.mutateAsync({body:{machine_tier:d.machineTier,storage_tier:d.storageTier,credit_tier:d.creditTier}})).status}catch(e){return i(Bn(e,r(`customPlanModal.changeFailed`)))}return await er(t),C===`no_op`?{needsResize:!1,creditChanged:!1}:{needsResize:m||p&&!S,creditChanged:h}};return{changeTiers:T,isPending:w,error:i,current:b,eligible:x,currentReady:S,currentKnown:C,primaryAssistantId:C?g.data?.primary_assistant_id??null:null}}function nr(){let e=H(),{t}=V(`settings`),n=pe(O());return{changePackage:async r=>{try{let t=await n.mutateAsync({body:{package:r}});return await er(e),t}catch(e){return I.error(Bn(e,t(`customPlanModal.changeFailed`))),null}},isPending:n.isPending}}function rr({className:e,"data-testid":t,children:n}){return(0,J.jsx)(`div`,{"aria-hidden":!0,"data-testid":t,className:x(`flex size-[52px] shrink-0 items-center justify-center rounded-xl`,e),children:n})}var ir=32;function ar(){let{ready:e,avatar:t}=_t();return(0,J.jsx)(rr,{"data-testid":`assistant-avatar-tile`,className:`bg-[var(--surface-active)]`,children:e?(0,J.jsx)(w,{components:t.components,traits:t.traits,customImageUrl:t.customImageUrl,size:ir}):null})}var or=`Billed monthly · prorated difference charged today`,sr=`Billed monthly · prorated difference charged today or credited next invoice`,cr=`Billed monthly · prorated credit on your next invoice`,lr=`Your machine downsizes now and your storage stays. No refund.`,ur=`Continue`,dr=`The plan includes`,fr=`Your plan will include`;function pr(e,t,n){let r=n?vn(n)?.tagline??``:``;switch(e){case`downgrade`:return{title:yn(t),subtitle:``,priceCaption:cr,checklistHeading:fr,note:lr,confirmLabel:yn(t),destructive:!0};case`switch`:return{title:`Switch to ${t}`,subtitle:r,priceCaption:sr,checklistHeading:dr,note:``,confirmLabel:ur,destructive:!1};default:return{title:`Upgrade to ${t}`,subtitle:r,priceCaption:or,checklistHeading:dr,note:``,confirmLabel:ur,destructive:!1}}}function mr({open:e,relation:t,packageName:n,targetPackage:r,pending:i,onCancel:a,onConfirm:o}){let{t:c}=V(`settings`),l=(0,q.useRef)(null),u=(0,q.useId)(),d=pr(t,n,r?.key??null),p=r?{price:xn(r.total_price_cents),highlights:An(r,vn(r.key)?.extraFeatures??[])}:null,m=d.subtitle,h=d.note?{"aria-describedby":u}:m?{}:{"aria-describedby":void 0};return(0,J.jsx)(f.Root,{open:e,onOpenChange:e=>{!e&&!i&&a()},children:(0,J.jsxs)(f.Content,{size:`sm`,hideCloseButton:!0,className:`gap-4 p-4 max-w-[421px]`,onOpenAutoFocus:e=>{e.preventDefault(),l.current?.focus()},...h,children:[(0,J.jsxs)(f.Header,{className:`flex-row items-center gap-3 p-0 pb-2`,children:[d.destructive?(0,J.jsx)(rr,{"data-testid":`package-switch-warning-tile`,className:`bg-[var(--system-negative-weak)]`,children:(0,J.jsx)(ye,{className:`size-6 text-[var(--system-negative-strong)]`})}):(0,J.jsx)(ar,{}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(f.Title,{className:`text-title-small text-[var(--content-emphasised)] [&>span]:whitespace-normal`,children:d.title}),m?(0,J.jsx)(f.Description,{className:`mt-0 text-body-medium-default text-[var(--content-tertiary)]`,children:m}):null]})]}),p?(0,J.jsxs)(f.Body,{className:`flex flex-col gap-4 p-0`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(P,{as:`p`,variant:`title-large`,className:`text-[var(--content-default)]`,children:p.price}),(0,J.jsx)(P,{as:`p`,variant:`label-medium-default`,className:`leading-[15px] text-[var(--content-tertiary)]`,children:d.priceCaption})]}),(0,J.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,J.jsx)(P,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:d.checklistHeading}),(0,J.jsx)(`ul`,{className:`flex flex-col gap-2`,children:p.highlights.map(e=>(0,J.jsxs)(`li`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(De,{className:`size-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,J.jsx)(P,{as:`span`,variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e})]},e))})]}):null,d.note?(0,J.jsx)(P,{id:u,as:`p`,variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:d.note}):null,(0,J.jsxs)(f.Footer,{className:`flex-col gap-4 p-0`,children:[(0,J.jsx)(s,{fullWidth:!0,variant:d.destructive?`danger`:`primary`,onClick:o,disabled:i,"data-testid":`confirm-package-switch-button`,children:d.confirmLabel}),(0,J.jsx)(s,{ref:l,fullWidth:!0,variant:`ghost`,onClick:a,disabled:i,children:c(`packageSwitchConfirmModal.cancel`)})]})]})})}function hr(){let e=H();(0,q.useEffect)(()=>L(()=>{er(e)}),[e])}export{xn as A,en as B,Nn as C,On as D,Dn as E,mn as F,Ke as G,tn as H,dn as I,We as K,fn as L,wn as M,vn as N,Cn as O,gn as P,pn as R,Pn as S,kn as T,on as U,sn as V,$t as W,Ln as _,er as a,Vn as b,Jn as c,qn as d,Qn as f,Rn as g,Bn as h,tr as i,Sn as j,bn as k,Xn as l,In as m,mr as n,$n as o,Wn as p,Re as q,nr as r,Yn as s,hr as t,Zn as u,Un as v,Mn as w,Fn as x,Hn as y,nn as z};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$S as t,$u as n,By as r,Ch as i,Cu as a,Cy as o,EC as s,Hs as c,Hy as l,Ib as u,Ih as d,JS as f,Jg as p,Ju as m,KS as h,Mh as g,Oh as _,QS as v,Qu as y,Ri as b,Ro as x,Sh as S,Un as C,Vi as w,Vs as T,WS as E,Xl as D,Xu as O,Yu as k,Zg as A,Zu as j,_d as ee,ad as M,eS as N,ed as te,gC as P,gd as ne,kh as re,mu as ie,nd as ae,nu as oe,pC as F,qS as I,rC as se,td as ce,tu as le,vu as ue,wh as de,wy as L,xh as fe,xi as R}from"./app-Qc-rYPt9.js";import{I as z,Qn as B,Yn as pe,ar as me,j as V,sr as he,tr as H}from"./vendor-DEhKVoiV.js";import{f as ge,t as _e,x as ve}from"./react-B9IgSVeK.js";import{D as ye,Ji as U,Ra as be,Ui as W,Vn as xe,Ya as Se,Yn as Ce,ci as we,fr as G,pi as Te,xr as Ee,zi as De}from"./icons-C0wyat6T.js";import{c as Oe,i as K,l as ke,n as Ae,r as je,t as Me}from"./machine-sizes-BWbhowrp.js";import{a as Ne,i as Pe,n as Fe,r as Ie,t as Le}from"./provisioning-targets-Csh2mGBG.js";var Re=Se(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),q=e(ve(),1),J=_e();function ze({icon:e}){return(0,J.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--system-negative-strong) 12%, transparent)`},children:(0,J.jsx)(e,{className:`h-5 w-5`,style:{color:`var(--system-negative-strong)`},"aria-hidden":`true`})})}var Y={fontFamily:`var(--font-serif)`,fontSize:`32px`,fontWeight:400,lineHeight:1.2,letterSpacing:`0.64px`};function X({title:e,subtitle:t}){return(0,J.jsxs)(`header`,{className:`flex flex-col items-center gap-2 pt-12 text-center`,children:[(0,J.jsx)(`h2`,{className:`text-[var(--content-emphasised)]`,style:Y,children:e}),t&&(0,J.jsx)(`p`,{className:`text-[14px] font-normal text-[var(--content-secondary)]`,children:t})]})}var Be=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1},{bodyShape:`stack`,eyeStyle:`gentle`,color:`purple`,size:110,position:`-left-[39px] top-[74%]`,rotate:0},{bodyShape:`urchin`,eyeStyle:`goofy`,color:`pink`,size:137,position:`-right-[42px] -bottom-[40px]`,rotate:180},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`,size:72,position:`left-[37%] -bottom-[22px] -translate-x-1/2`,rotate:0}],Ve=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1}];function He({variant:e=`full`}){let t=R();return t?(0,J.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`creature-corners`,className:`pointer-events-none absolute inset-0 select-none`,children:(e===`top`?Ve:Be).map((e,n)=>(0,J.jsx)(`span`,{className:`absolute ${e.position}`,style:{rotate:`${e.rotate}deg`},children:(0,J.jsx)(C,{components:t,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:e.size})},n))}):null}var Z={waitingStatus:`Upgrading your assistant…`,snagStatus:`We hit a snag upgrading your assistant`,snagCaption:`Retry in the background and we'll keep working on your upgrade.`,confirmingStatus:`Confirming your upgrade…`,confirmTimeoutStatus:`Still confirming your upgrade`,confirmTimeoutCaption:`Your payment went through safely. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still upgrading. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your upgrade continues in the background.`,backgroundRetryToast:`We'll retry your upgrade in the background.`,completeSubtitle:`Enjoy the new found power.`,fetchErrorBody:`We hit a problem checking your subscription. Your upgrade may still be processing. Return to billing to refresh.`},Q={waitingStatus:`Updating your assistant…`,snagStatus:`We hit a snag updating your assistant`,snagCaption:`Retry in the background and we'll keep working on your plan change.`,confirmingStatus:`Confirming your plan change…`,confirmTimeoutStatus:`Still confirming your plan change`,confirmTimeoutCaption:`Your plan change was submitted. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still updating. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your plan change continues in the background.`,backgroundRetryToast:`We'll retry your plan change in the background.`,completeSubtitle:`Your plan changes are live.`,fetchErrorBody:`We hit a problem checking your subscription. Your plan change may still be processing. Return to billing to refresh.`},$={upgrade:Z,downgrade:Q,change:Q};function Ue(e=`upgrade`){return $[e]}function We(e,t=!0){let{data:n}=B({...D(),enabled:t&&e==null}),{data:r}=B({...a({path:{id:e??``}}),enabled:t&&e!=null});return e==null?n:r}function Ge({assistantId:e,direction:t}){let n=ge(),{t:r}=V(`settings`),i=We(e,d())?.name||r(`completeState.assistantFallbackName`);return(0,J.jsxs)(`div`,{className:`relative flex min-h-[320px] flex-col items-center justify-center overflow-hidden px-8 pb-16 [animation:onboarding-step-in_350ms_ease-out] motion-reduce:[animation:none]`,children:[(0,J.jsx)(He,{variant:`full`}),(0,J.jsxs)(`div`,{className:`relative flex w-full flex-col items-center`,children:[(0,J.jsx)(X,{title:r(`completeState.title`),subtitle:Ue(t).completeSubtitle}),(0,J.jsx)(`div`,{className:`mt-10 flex w-full flex-col items-center gap-10`,children:(0,J.jsx)(s,{variant:`primary`,"data-testid":`onboarding-complete-return`,onClick:()=>{e!=null&&p(e),n(N.assistant,{replace:!0})},children:r(`completeState.returnTo`,{assistantName:i})})})]})]})}function Ke(e=!0,t){let n=We(t,e),r=t??n?.id,{data:i,isError:a,isFetching:o,dataUpdatedAt:s,errorUpdatedAt:c}=B({...le({path:{assistant_id:r??``}}),enabled:e&&!!r});return{assistant:n,assistantId:r,domains:i,domainsError:a,domainsFetching:o,domainsUpdatedAt:s,domainsErrorUpdatedAt:c}}var qe=1e3,Je=1e4,Ye=2500,Xe=2e3,Ze=1e4,Qe=[`machine_size`,`subdomain`,`non_field_errors`],$e={subdomain_taken:`That subdomain is already taken. Try another.`,assistant_already_has_domain:`Your assistant already has a custom domain.`,no_assistant_to_attach_domain:`We couldn't find an assistant to attach this domain to.`,exceeds_machine_tier:`That machine size isn't available on your plan.`,provisioning_submission_failed:`We couldn't queue your upgrade just now. Try again in a moment.`,no_active_pro:`We couldn't confirm your Pro plan yet. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to upgrade yet. Try again in a moment.`},et={provisioning_submission_failed:`We couldn't queue your plan change just now. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to update yet. Try again in a moment.`};function tt(e,t,n=`upgrade`){if(e&&typeof e==`object`){let t=e;if(typeof t.error==`string`){let e=(n===`upgrade`?void 0:et[t.error])??$e[t.error];if(e)return e}for(let e of Qe){let n=t[e];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(typeof t.detail==`string`)return t.detail}return t}var nt=`h-8 rounded-lg border border-[var(--border-element)] bg-[var(--field-bg)] px-2.5 text-[14px] text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-[border-color] duration-150 focus:border-[var(--border-active)] disabled:cursor-not-allowed disabled:opacity-60`,rt=`text-[11px] font-medium text-[var(--content-secondary)]`;function it({onExit:e,machineBusy:t=!1,assistantId:n}){let{t:r}=V(`settings`),i=H(),a=b.use.emailRootDomain(),{assistant:o,assistantId:c,domains:l}=Ke(!0,n),u=l?.results[0],[d,p]=(0,q.useState)(``),[m,h]=(0,q.useState)(`hi`),[g,_]=(0,q.useState)(!1);(0,q.useEffect)(()=>{if(!g){if(u){p(u.subdomain),_(!0);return}!o?.handle||d||(p(o.handle),_(!0))}},[o?.handle,u,g,d]);let[v,y]=(0,q.useState)(null),[x,S]=(0,q.useState)(!1),C=pe(j()),w=!!u||x,T=C.isPending||x;return(0,q.useEffect)(()=>{if(!x)return;let t=setTimeout(e,800);return()=>clearTimeout(t)},[x,e]),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(f.Body,{className:`animate-[onboarding-step-in_350ms_ease-out] space-y-6 pb-0 motion-reduce:animate-none`,children:[(0,J.jsx)(He,{variant:`top`}),(0,J.jsx)(X,{title:r(`domainStep.title`),subtitle:r(`domainStep.subtitle`)}),(0,J.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`label`,{htmlFor:`onboarding-email-prefix`,className:rt,children:r(`domainStep.prefixLabel`)}),(0,J.jsx)(`input`,{id:`onboarding-email-prefix`,value:m,onChange:e=>h(e.target.value.toLowerCase().trim()),disabled:T||w,readOnly:w,placeholder:r(`domainStep.emailUsernamePlaceholder`),className:`${nt} w-24`})]}),(0,J.jsx)(`span`,{className:`flex h-8 items-center text-[var(--content-secondary)]`,children:`@`}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(`label`,{htmlFor:`onboarding-email-handle`,className:rt,children:r(`domainStep.handleLabel`)}),(0,J.jsx)(`input`,{id:`onboarding-email-handle`,value:d,onChange:e=>{p(e.target.value.toLowerCase().trim()),v&&y(null)},disabled:T||w,readOnly:w,autoFocus:!0,placeholder:r(`domainStep.subdomainExamplePlaceholder`),"aria-invalid":!!v,className:`${nt} w-full min-w-0`})]}),(0,J.jsxs)(`span`,{className:`flex h-8 shrink-0 items-center text-[14px] text-[var(--content-tertiary)]`,children:[`.`,a]})]}),v&&(0,J.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:v}),w&&(0,J.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:r(`domainStep.domainLockedMessage`)})]}),t&&!w&&(0,J.jsx)(F,{tone:`neutral`,children:r(`domainStep.machineBusyNotice`)}),!w&&(0,J.jsx)(F,{tone:`info`,className:`border-transparent bg-[var(--surface-active)]`,children:(0,J.jsx)(`span`,{className:`font-medium text-[var(--content-tertiary)]`,children:r(`domainStep.handleImmutableNotice`)})}),x?(0,J.jsx)(F,{tone:`success`,children:r(`domainStep.domainSetRedirecting`)}):null]}),(0,J.jsx)(f.Footer,{className:`items-center pt-6`,children:w?(0,J.jsx)(s,{variant:`primary`,"data-testid":`onboarding-domain-continue`,onClick:e,children:r(`domainStep.continue`)}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(s,{variant:`outlined`,"data-testid":`onboarding-domain-skip`,disabled:T,onClick:()=>{T||C.mutate({body:{skipped:!0}},{onSuccess:e,onError:()=>e()})},children:r(`domainStep.skip`)}),(0,J.jsx)(s,{variant:`primary`,"data-testid":`onboarding-domain-set`,disabled:!d||T||t,onClick:()=>{T||t||!d||C.mutate({body:{subdomain:d,...m?{email_username:m}:{}}},{onSuccess:()=>{y(null),S(!0),i.invalidateQueries({queryKey:ie()}),i.invalidateQueries({queryKey:oe({path:{assistant_id:c??``}})}),i.invalidateQueries({queryKey:te()})},onError:e=>{y(tt(e,r(`domainStep.registerSubdomainFailed`)))}})},children:r(`domainStep.next`)})]})})]})}function at({onGoToBilling:e,direction:t}){let{t:n}=V(`settings`);return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-6 py-10 text-center`,children:[(0,J.jsx)(ze,{icon:W}),(0,J.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,J.jsx)(P,{variant:`title-small`,as:`h1`,children:n(`errorStates.fetchErrorTitle`)}),(0,J.jsx)(P,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:Ue(t).fetchErrorBody})]}),(0,J.jsx)(s,{variant:`primary`,"data-testid":`onboarding-go-to-billing`,onClick:e,children:n(`errorStates.goToBilling`)})]})}function ot(e){let{targets:t,fromSnapshot:n,machineFloor:r,credits:i}=e,a=[];return t.machineSize==null?r!=null&&n.machineSize!=null&&n.machineSize!==r&&a.push({key:`machine`,label:`Machine`,from:K[n.machineSize],to:K[r]}):n.machineSize!==t.machineSize&&a.push({key:`machine`,label:`Machine`,from:n.machineSize==null?void 0:K[n.machineSize],to:K[t.machineSize]}),t.storageGib!=null&&(n.storageGib==null||t.storageGib>n.storageGib)&&a.push({key:`storage`,label:`Storage`,from:n.storageGib==null?void 0:`${n.storageGib} GB`,to:`${t.storageGib} GB`}),i!=null&&a.push({key:`credits`,label:i.label??`Credits`,from:i.from,to:i.to}),a}var st=60,ct=st*2;function lt({imageUrl:e,animateIn:t=!0}){return(0,J.jsxs)(`div`,{"aria-hidden":!0,"data-testid":`takeover-backdrop`,className:`pointer-events-none absolute inset-0 overflow-hidden${t?` provision-avatar-reveal`:``}`,children:[(0,J.jsx)(`img`,{src:e,alt:``,decoding:`async`,draggable:!1,className:`absolute left-1/2 top-1/2 max-w-none -translate-x-1/2 -translate-y-1/2 object-cover object-center`,style:{filter:`blur(${st}px)`,width:`calc(100% + ${ct*2}px)`,height:`calc(100% + ${ct*2}px)`}}),(0,J.jsx)(`div`,{className:`absolute inset-0 bg-black/55`})]})}function ut(e,t){if(t!=null)return e?.credit_tiers?.find(e=>e.tier===t)}function dt(e){let t=e?.match(/^credits_(\d+)$/)?.[1];return t==null?null:Number(t)}function ft(e){let t=d(),{data:n}=B({...m(),enabled:t&&e});return n?.plans.find(e=>e.id===`pro`)}function pt(e,t){return t==null?0:ut(e,t)?.credits_usd??dt(t)}function mt(e,t){return t==null?null:ut(e,t)?.label}function ht(e){let t=ft(e!=null);if(e==null||t==null)return null;let n,r;if(e.kind===`package`){let i=t.packages.find(t=>t.key===e.packageKey),a=ut(t,i?.credit_tier);n=i?.credits_usd??a?.credits_usd,r=i?.usage_label??a?.label??void 0}else{let i=ut(t,e.creditTier);n=i?.credits_usd,r=i?.label}return n==null?null:{fromLabel:null,toLabel:r}}function gt(e){let t=ft(e!=null);return e==null||pt(t,e.fromTier)==null||pt(t,e.toTier)==null?null:{fromLabel:mt(t,e.fromTier),toLabel:mt(t,e.toTier)}}function _t(e){let t=u.use.activeAssistantId(),n=e===void 0?t:e,{components:r,traits:a,customImageUrl:o,state:s,isLoading:l}=_(n),d=(0,q.useMemo)(()=>i(),[de()]),f=d!=null&&S(d)?d:null,p=n!=null&&!l,m=f!=null&&(n==null||n===f.assistantId),h=m&&!(p&&(r!=null||a!=null||o!=null))?f:null,v=h?h.components:r,y=h?h.traits:a,b=h?null:o,x=p||m,C=re({state:h?null:s,components:v,traits:y,customImageUrl:b})??(b?null:g[0]?.hex??null);return{tintHex:x&&C?c(C):T,backdropImageUrl:x?b:null,ready:x,avatar:{components:v,traits:y,customImageUrl:b}}}function vt(e,t){let[n,r]=(0,q.useState)(e),i=(0,q.useRef)(0);return(0,q.useEffect)(()=>{i.current=performance.now()},[]),(0,q.useEffect)(()=>{if(t<=0||e===n)return;let a=t-(performance.now()-i.current);if(a<=0){i.current=performance.now(),r(e);return}let o=setTimeout(()=>{i.current=performance.now(),r(e)},a);return()=>clearTimeout(o)},[e,n,t]),t<=0?e:n}var yt=`--takeover-surface`,bt=`var(${yt},${T})`,xt=`color-mix(in srgb, var(--content-emphasised) 10%, transparent)`,St=240,Ct=1.414,wt=[{minHeight:680,size:St},{minHeight:600,size:184}],Tt=132;function Et(e){for(let t of wt)if(e>=t.minHeight)return t.size;return Tt}function Dt(){let[e,t]=(0,q.useState)(()=>Et(typeof window>`u`?1/0:window.innerHeight));return(0,q.useEffect)(()=>{let e=()=>t(Et(window.innerHeight));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var Ot={machine:we,storage:Ee,credits:Te},kt={idle:``,working:` is-working`,settling:` is-settling`,stalled:` is-stalled`,grown:` is-evolved`};function At(e,t){return e===`DONE`||e===`NOT_APPLICABLE`?`grown`:e===`STALLED`?`stalled`:e===`WAITING`||e===`RESIZING`?t?`settling`:`working`:`idle`}function jt({assistantId:e,mode:t,downsizing:n=!1}){let{avatar:r,ready:i}=_t(e),a=R(),o=Dt(),s=t===`working`||t===`settling`;return(0,J.jsxs)(`div`,{"aria-hidden":!0,className:`provision-avatar-evolve relative z-10 flex flex-col items-center${kt[i?t:`idle`]}${n?` is-downsizing`:``}`,style:{"--provision-avatar-size":`${o}px`,"--provision-avatar-growth":Ct},children:[(0,J.jsxs)(`div`,{className:`provision-avatar-stage`,children:[(0,J.jsx)(`div`,{"data-testid":`provision-avatar-placeholder`,className:`provision-avatar-placeholder${i?` is-resolved`:``}`}),(0,J.jsx)(`div`,{className:`provision-avatar-layer`,children:(0,J.jsx)(`div`,{className:`provision-avatar-current`,children:(0,J.jsx)(`div`,{className:`provision-avatar-strain`,children:i&&(0,J.jsx)(`div`,{className:`provision-avatar-reveal`,children:(0,J.jsx)(w,{components:r.components??a,traits:r.traits,customImageUrl:r.customImageUrl,size:o,isAssistantBusy:s})})})})})]}),(0,J.jsx)(`div`,{className:`provision-avatar-shadow`})]})}function Mt({status:e,caption:t}){return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,J.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:Y,children:e}),t&&(0,J.jsx)(P,{variant:`body-medium-lighter`,as:`p`,className:`max-w-sm text-[var(--content-secondary)]`,children:t})]})}function Nt({icon:e,label:t,from:n,to:r,done:i=!1,pending:a=!1,testId:o}){let{t:s}=V(`settings`),c=null;return i?c=s(`provisioningState.statusComplete`):a&&(c=s(`provisioningState.statusPending`)),(0,J.jsxs)(`div`,{"data-testid":o,className:`flex min-w-0 flex-auto items-center gap-2 rounded-lg px-2 py-1.5${a?` opacity-70`:``}`,style:{backgroundColor:xt},children:[(0,J.jsx)(`span`,{className:`hidden h-6 w-6 shrink-0 items-center justify-center min-[420px]:flex`,children:(0,J.jsx)(e,{className:`h-3.5 w-3.5 text-[var(--content-tertiary)]`,"aria-hidden":`true`})}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 text-left wrap-anywhere`,children:[(0,J.jsx)(`span`,{className:`text-[12px] font-medium leading-tight text-[var(--content-tertiary)]`,children:t}),(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5 text-[14px] font-medium leading-[18px] text-[var(--content-emphasised)]`,children:[n&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{children:n}),(0,J.jsx)(`span`,{className:`sr-only`,children:s(`provisioningState.srOnlyTo`)}),(0,J.jsx)(be,{className:`h-3 w-3 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":`true`})]}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,J.jsx)(`span`,{children:r}),i?(0,J.jsx)(U,{"data-testid":`chip-check`,className:`h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`,"aria-hidden":`true`}):a&&(0,J.jsx)(Ce,{"data-testid":`chip-spinner`,className:`h-3.5 w-3.5 shrink-0 animate-spin text-[var(--content-tertiary)] motion-reduce:animate-none`,"aria-hidden":`true`})]}),c&&(0,J.jsx)(`span`,{className:`sr-only`,children:c})]})]})]})}function Pt({label:e}){return(0,J.jsx)(`span`,{className:`rounded-lg px-3 py-2 text-[14px] text-[var(--content-emphasised)]`,style:{backgroundColor:xt},children:e})}function Ft({children:e,wide:t=!1,testId:n}){return(0,J.jsx)(`div`,{"data-testid":n,className:`flex w-full ${t?`max-w-2xl`:`max-w-sm`} items-stretch justify-center gap-2`,children:e})}function It(e,t){return e===`credits`?!0:t?.[e]===!0}function Lt(e,t){if(e==null)return null;let n=t(`provisioningState.noExtraUsage`),r=e.toLabel===null?n:e.toLabel;return r==null?null:{label:t(`provisioningState.usageLabel`),from:e.fromLabel===null?n:e.fromLabel,to:r}}function Rt({intent:e,creditsChange:t,targets:n,fromSnapshot:r,machineFloor:i,landed:a,allDone:o=!1,creditsOnly:s=!1}){let{t:c}=V(`settings`),l=ht(e),u=gt(t),d=ot({targets:n,fromSnapshot:r,machineFloor:i,credits:Lt(l??u,c)}),f=s?d.filter(e=>e.key===`credits`):d,p=f.filter(e=>o||It(e.key,a)).map(e=>e.label).join(`, `),[m]=(0,q.useState)(p),h=p===m?``:c(`provisioningState.dimensionsComplete`,{dimensions:p});return f.length===0?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Ft,{testId:`resource-chips`,wide:f.length>=3,children:f.map(e=>{let t=o||It(e.key,a);return(0,J.jsx)(Nt,{testId:`chip-${e.key}`,icon:Ot[e.key],label:e.label,from:e.from,to:e.to,done:t,pending:!t},e.key)})}),(0,J.jsx)(`p`,{"aria-live":`polite`,className:`sr-only`,"data-testid":`chip-announcement`,children:h})]})}function zt({intent:e}){let{t}=V(`settings`),n=ht(e.kind===`custom`?e:null);if(e.kind===`package`)return(0,J.jsx)(Ft,{children:(0,J.jsx)(Pt,{label:t(`provisioningState.packageChip`,{name:e.packageKey.charAt(0).toUpperCase()+e.packageKey.slice(1)})})});let r=[e.machineTier,e.storageTier,e.creditTier].filter(e=>e!=null).length;return(0,J.jsxs)(Ft,{wide:r>=3,children:[e.machineTier!=null&&(0,J.jsx)(Nt,{icon:we,label:t(`provisioningState.machineLabel`),to:Ae[e.machineTier]??e.machineTier}),e.storageTier!=null&&(0,J.jsx)(Nt,{icon:Ee,label:t(`provisioningState.storageLabel`),to:e.storageTier.toUpperCase()}),e.creditTier!=null&&n?.toLabel!=null&&(0,J.jsx)(Pt,{label:n.toLabel})]})}function Bt({state:e,direction:t,softWaiting:n,intent:r,creditsChange:i,targets:a,fromSnapshot:o,machineFloor:c,landed:l,celebrating:u,onCelebrationEnd:d,assistantId:f,escapeAvailable:p,onEscape:m,onPhaseChange:h,kickError:g,confirm:_,dwellMs:v=Ye,phaseMinMs:y=900}){let{t:b}=V(`settings`),x=Ue(t),S=(0,q.useRef)(d);(0,q.useEffect)(()=>{S.current=d},[d]);let C=vt(e,y),w=C===`DONE`||C===`NOT_APPLICABLE`,T=C===`RESIZING`?`WAITING`:C,E=(0,q.useRef)(h);(0,q.useEffect)(()=>{E.current=h},[h]),(0,q.useEffect)(()=>{E.current?.(C)},[C]);let{tintHex:D,backdropImageUrl:O}=_t(f),k=u&&w;return(0,q.useEffect)(()=>{if(!k)return;let e=setTimeout(()=>S.current(),v);return()=>clearTimeout(e)},[k,v]),(0,J.jsxs)(`div`,{"data-theme":`dark`,className:`provision-surface-settle relative flex h-full min-h-[420px] w-full flex-col items-center [justify-content:safe_center] gap-10 px-6 py-10 text-center`,style:{[yt]:D,backgroundColor:bt},children:[O&&(0,J.jsx)(lt,{imageUrl:O}),(0,J.jsx)(jt,{assistantId:f,mode:At(C,n),downsizing:t===`downgrade`}),(0,J.jsx)(`div`,{className:`relative z-10 flex min-h-[144px] w-full flex-col items-center gap-8 [animation:onboarding-step-in_420ms_ease-out] motion-reduce:[animation:none]`,children:ee()},T)]});function A(e=b(`provisioningState.continueInBackground`)){return p?(0,J.jsx)(s,{variant:`ghost`,"data-testid":`provisioning-escape`,onClick:m,children:e}):null}function j({allDone:e=!1,creditsOnly:t=!1}={}){return(0,J.jsx)(Rt,{intent:r,creditsChange:i,targets:a,fromSnapshot:o,machineFloor:c,landed:l,allDone:e,creditsOnly:t})}function ee(){if(C===`CONFIRMING`)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:x.confirmingStatus,caption:b(`provisioningState.confirmingCaption`)}),r&&(0,J.jsx)(zt,{intent:r}),A()]});if(C===`WAITING`||C===`RESIZING`)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:x.waitingStatus,caption:b(n?`provisioningState.waitingCaptionLong`:`provisioningState.waitingCaptionShort`)}),j(),A()]});if(C===`DONE`)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:b(`provisioningState.allDoneStatus`)}),j({allDone:!0})]});if(C===`NOT_APPLICABLE`)return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:b(`provisioningState.planReadyStatus`)}),j({allDone:!0,creditsOnly:!0})]});if(C===`STALLED`){let e=g!=null;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:e?x.snagStatus:b(`provisioningState.takingLongerStatus`),caption:e?tt(g,x.snagCaption,t):b(`provisioningState.stalledCaption`)}),j(),e?A(b(`provisioningState.retryInBackground`)):A()]})}return C===`CONFIRM_TIMEOUT`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Mt,{status:x.confirmTimeoutStatus,caption:x.confirmTimeoutCaption}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,J.jsx)(s,{variant:`outlined`,"data-testid":`onboarding-go-to-billing`,onClick:_.onGoToBilling,children:b(`provisioningState.goToBilling`)}),(0,J.jsx)(s,{variant:`primary`,"data-testid":`onboarding-retry`,onClick:_.onRetry,children:b(`provisioningState.tryAgain`)})]})]}):null}}function Vt(e){let{planId:t,targets:n,actuals:r,initialActuals:i,resizeOperationInFlight:a,sawOperation:o,msSinceWatchStart:s,confirmExpired:c,serverVerdict:l=null,statusObservedSinceTargetsMet:u=!0,targetsProveNoop:d=!0}=e;if(t!==`pro`)return{state:c?`CONFIRM_TIMEOUT`:`CONFIRMING`,softWaiting:!1};let f=o||a,p=l===`started`||l===`in_progress`,m=o||d&&u;if(!a){let e=p?m:f||l===`already_done`||i!=null&&!Ne(n,i);if(Ne(n,r)){if(e)return{state:`DONE`,softWaiting:!1};if(!p&&(d||l===`not_applicable`))return{state:`NOT_APPLICABLE`,softWaiting:!1}}else{if(l===`already_done`)return{state:`DONE`,softWaiting:!1};if(l===`not_applicable`)return{state:`NOT_APPLICABLE`,softWaiting:!1}}}return s!=null&&s>=9e4?{state:`STALLED`,softWaiting:!1}:f||l===`started`||l===`in_progress`?{state:`RESIZING`,softWaiting:!1}:{state:`WAITING`,softWaiting:s!=null&&s>=3e4}}var Ht=2e3,Ut=1e3,Wt=[`DONE`,`NOT_APPLICABLE`,`CONFIRM_TIMEOUT`],Gt={assistantId:null,machine:null,storage:null};function Kt({open:e,canLowerResources:t=!1,verdictRecheckMs:r=Ze}){let i=H(),o=d(),[s,c]=(0,q.useState)(!1),[l,u]=(0,q.useState)(0),[f,p]=(0,q.useState)(null),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(null),[v,b]=(0,q.useState)(null),[x,S]=(0,q.useState)(null),[C,w]=(0,q.useState)(null),[T,E]=(0,q.useState)(Gt),[O,k]=(0,q.useState)(null),[j,ee]=(0,q.useState)(!1),M=(0,q.useRef)(!1),N=(0,q.useRef)(!1),P=(0,q.useRef)(0),[ne,re]=(0,q.useState)(!1),[ie,oe]=(0,q.useState)(null),[F,I]=(0,q.useState)(null),[se,le]=(0,q.useState)(null),[de,L]=(0,q.useState)(()=>Date.now()),[fe,R]=(0,q.useState)(!0);(0,q.useEffect)(()=>{e||(c(!1),u(0),p(null),h(null),_(null),re(!1),oe(null),I(null),le(null),R(!0),b(null),S(null),w(null),E(Gt),k(null),ee(!1),M.current=!1,N.current=!1,P.current+=1)},[e]),(0,q.useEffect)(()=>{e&&(p(Date.now()),i.invalidateQueries({queryKey:ae()}),i.invalidateQueries({queryKey:te()}))},[e,i]);let z=m!=null,V=B({...ce(),refetchInterval:e=>e.state.data?.plan_id===`pro`||s?!1:qe,refetchIntervalInBackground:!1,enabled:e&&o&&!z}),ge=(f!=null&&V.dataUpdatedAt>=f?V.data?.plan_id:null)??null;(0,q.useEffect)(()=>{if(!e||z||ge!==`pro`)return;let t=Date.now();h(t),L(t)},[e,z,ge]),(0,q.useEffect)(()=>{if(!e||z)return;let t=setTimeout(()=>c(!0),Je);return()=>clearTimeout(t)},[e,z,l]);let _e=(0,q.useCallback)(()=>{c(!1),u(e=>e+1),A.getState().fetchOrganizations(),i.invalidateQueries({queryKey:ae()})},[i]),ve=(0,q.useCallback)(()=>{let e=Date.now();_(e),L(e)},[]),{mutate:ye}=pe(y()),U=(0,q.useCallback)(e=>{let t=P.current;ye({},{onSuccess:n=>{t===P.current&&(k(null),Fe(n)?N.current?k({error:n.reason??`no_active_pro`}):(N.current=!0,ee(!0),e===`escape`&&ve()):(b(n.state),e===`escape`&&ve()))},onError:e=>{t===P.current&&k(e)}})},[ye,ve]);(0,q.useEffect)(()=>{!e||!o||!z||M.current||(M.current=!0,U(`auto`))},[e,o,z,U]),(0,q.useEffect)(()=>{if(!j)return;let e=P.current,t=setTimeout(()=>{ee(!1),e===P.current&&U(`auto`)},Xe);return()=>clearTimeout(t)},[j,U]);let be=(0,q.useCallback)(()=>U(`escape`),[U]),W=B({...n(),enabled:e&&o&&z}),xe=fe?Ht:!1,Se=B({...D(),enabled:e&&o&&z,refetchInterval:e=>e.state.data?.id==null?xe:!1,retry:!1}),Ce=z&&f!=null&&W.dataUpdatedAt>=f,we=Ce&&!W.isPending&&!W.isFetching,G=(Ce?W.data?.primary_assistant_id:null)??(W.isPending?null:Se.data?.id??null),Te=B({...a({path:{id:G??`unresolved`}}),enabled:e&&o&&z&&G!=null,refetchInterval:xe,retry:!1}),Ee=ue({path:{id:G??`unresolved`}}),De=B({...Ee,enabled:e&&o&&z&&G!=null,refetchInterval:xe,retry:!1}),K=(0,q.useRef)(0),[Ae,je]=(0,q.useState)(0),Re=he(Ee.queryKey);(0,q.useEffect)(()=>i.getQueryCache().subscribe(t=>{if(!(t.type!==`updated`||t.query.queryHash!==Re)){if(t.action.type===`fetch`)K.current+=1;else if(t.action.type===`success`&&!t.action.manual){let n=K.current,r=e&&Ie(t.action.data);me.schedule(()=>{je(n),r&&(re(!0),oe(G))})}}}),[i,Re,e,G]);let J=Ie(De.data),ze=ie===G,Y=W.data,X=(0,q.useMemo)(()=>Y?{machineSize:Oe(Y.max_machine_tier),storageGib:Y.selected_storage_gib??null}:null,[Y]),Be=Y!=null&&Y.max_machine_tier==null?Me:null,Ve=Y?Y.domain_setup_available&&Y.primary_assistant_id!=null:void 0,He=Te.data,Z=(0,q.useMemo)(()=>He?{machineSize:He.machine_size??null,storageGib:He.provisioned_storage_gib??null}:null,[He]),Q=se===G,$=(0,q.useMemo)(()=>{let e=Le(X,Z),t=X?.machineSize??Be;if(t==null)return e;let n=Z?.machineSize??null;if(n==null)return{...e,machine:!1};let r=(Q?F?.machineSize:null)??n,i=ke(t)<ke(r);return{...e,machine:i?ke(n)<=ke(t):ke(n)>=ke(t)}},[X,Z,F,Q,Be]),Ue=Ne(X,Z),We=C===G;(0,q.useEffect)(()=>{e&&(Ue?(S(e=>e!=null&&We?e:Date.now()),w(G)):(S(null),w(null)))},[e,Ue,G,We]);let Ge=T.assistantId===G;(0,q.useEffect)(()=>{if(!e)return;let t=K.current;E(e=>{let n=e.assistantId===G?e:Gt,r=$.machine?n.machine??t:null,i=$.storage?n.storage??t:null;return e.assistantId===G&&e.machine===r&&e.storage===i?e:{assistantId:G,machine:r,storage:i}})},[e,$,G]);let Ke=(0,q.useMemo)(()=>{let e=Pe(De.data),t=e=>e!=null&&Ge&&Ae>e;return{machine:$.machine&&!e.machine&&t(T.machine),storage:$.storage&&!e.storage&&t(T.storage)}},[$,T,Ge,Ae,De.data]);(0,q.useEffect)(()=>{!e||!Z||F!=null&&Q||(I(Z),le(G))},[e,Z,G,F,Q]);let Ye=g??m,Qe=Ye==null?null:Math.max(0,de-Ye),$e=!t,{state:et,softWaiting:tt}=Vt({planId:z?`pro`:ge,targets:X,actuals:Z,initialActuals:Q?F:null,resizeOperationInFlight:J,sawOperation:ne&&ze,msSinceWatchStart:Qe,confirmExpired:s,serverVerdict:v,statusObservedSinceTargetsMet:x!=null&&We&&De.dataUpdatedAt>x,targetsProveNoop:$e}),nt=Wt.includes(et),rt=e&&z&&!nt;(0,q.useEffect)(()=>{R(rt)},[rt]),(0,q.useEffect)(()=>{if(!e||!z||nt)return;let t=setInterval(()=>L(Date.now()),Ut);return()=>clearInterval(t)},[e,z,nt]);let it=!$e&&(v===`started`||v===`in_progress`)&&!(ne&&ze);return(0,q.useEffect)(()=>{if(!e||!z||nt||!it)return;let t=setInterval(()=>U(`auto`),r);return()=>clearInterval(t)},[e,z,nt,it,r,U]),{state:et,softWaiting:tt,targets:X,actualsSnapshot:F,machineFloor:Be,landed:Ke,assistantId:G,domainStepAvailable:Ve,onboardingSettled:we,confirmError:!z&&V.isError,targetsError:z&&W.isError&&(!Y||!Ce),escapeEligible:Qe!=null&&Qe>=6e4,retryConfirm:_e,kickProvisioning:be,kickError:O}}var qt=200,Jt=380;function Yt(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}var Xt=e=>e===`WAITING`||e===`RESIZING`||e===`STALLED`,Zt=e=>e===`DONE`||e===`NOT_APPLICABLE`,Qt={machineSize:null,storageGib:null};function $t({open:e,onClose:t,dwellMs:n,phaseMinMs:i,mode:a=`checkout`,resizeContext:o}){let{t:s}=V(`settings`),c=a===`resize`,u=H(),[d,p]=(0,q.useState)(`provisioning`),[m,g]=(0,q.useState)(`idle`),_=(0,q.useRef)([]),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(null),[S,C]=(0,q.useState)(null),[w,T]=(0,q.useState)(!1),E=c?o?.direction:void 0,D=Ue(E),O=Kt({open:e,canLowerResources:c?o?.canLowerResources===!0:!1}),k=(0,q.useRef)(!1);(0,q.useEffect)(()=>{if(e){k.current=!0,y(c?null:l()),C(e=>e??Date.now());return}_.current.forEach(clearTimeout),_.current=[],p(`provisioning`),g(`idle`),x(null),C(null),T(!1),k.current&&(k.current=!1,fe())},[e,c]),(0,q.useEffect)(()=>()=>{_.current.forEach(clearTimeout)},[]),(0,q.useEffect)(()=>{d===`complete`&&r()},[d]);let A=Xt(O.state),j=Zt(b??O.state),{targets:ee,assistantId:M,domainStepAvailable:N,onboardingSettled:te}=O,P=c?o?.fromSnapshot:void 0,ne=O.actualsSnapshot,re={machineSize:P?.machineSize??ne?.machineSize??null,storageGib:P?.storageGib??ne?.storageGib??null},{tintHex:ie,backdropImageUrl:ae}=_t(M),F=c&&N===!0,{domains:se,domainsError:ce,domainsFetching:le,domainsUpdatedAt:ue,domainsErrorUpdatedAt:de}=Ke(e&&F,M),L=(se?.results.length??0)>0,R=(0,q.useRef)(null);(0,q.useEffect)(()=>{if(!e){R.current=null;return}!F||M==null||R.current!==M&&(R.current=M,u.invalidateQueries({queryKey:oe({path:{assistant_id:M}})}))},[e,F,M,u]);let z=!le&&(S!=null&&ue>=S||S!=null&&!!ce&&de>=S),[B,pe]=(0,q.useState)(!1),me=te&&(!F||z);(0,q.useEffect)(()=>{if(!e){pe(!1);return}me&&pe(!0)},[e,me]);let he=(0,q.useCallback)(()=>{let e=c?N===!0&&!L?`domain`:`complete`:N===!1?`complete`:`domain`;if(Yt()){p(e);return}g(`covering`),_.current.push(setTimeout(()=>{p(e),g(`revealing`),_.current.push(setTimeout(()=>g(`idle`),Jt))},qt))},[N,c,L]),ge=(0,q.useCallback)(()=>{T(!0)},[]),_e=(0,q.useCallback)(()=>{O.kickProvisioning(),I.info(O.kickError==null?D.backgroundExitToast:D.backgroundRetryToast),T(!1),t()},[O,t,D]),ve=(0,q.useCallback)(()=>{T(!1)},[]),ye=d===`provisioning`&&(O.confirmError||O.targetsError),U=d===`provisioning`&&!ye,be=U&&!j,W=`transition-[background-color] duration-300 ease-out${U?` bg-black p-0`:``}`,xe=U?`[animation:fadeIn_0.45s_ease-out_both]`:m===`revealing`?`[animation:fadeInUp_0.42s_ease-out_0.12s_both]`:`[animation:fadeIn_0.25s_ease-out_both]`;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(f.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,J.jsxs)(f.Content,{size:`md`,hideCloseButton:d!==`complete`,dismissOnOverlayClick:!be,onEscapeKeyDown:be?e=>e.preventDefault():void 0,onInteractOutside:be?e=>e.preventDefault():void 0,"data-theme":U?`dark`:void 0,overlayClassName:W,className:U?`overflow-y-auto inset-0 max-w-none w-screen h-screen max-h-none rounded-none border-0`:`overflow-hidden`,style:{[yt]:ie},children:[(0,J.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col motion-reduce:[animation:none] ${xe}`,children:Se()},d),m!==`idle`&&(0,J.jsx)(`div`,{"aria-hidden":!0,"data-testid":`takeover-exit-sheet`,className:`pointer-events-none fixed inset-0 z-50 ${m===`covering`?`[animation:fadeIn_200ms_ease-in_both]`:`[animation:fadeIn_380ms_ease-out_both_reverse]`}`,style:{backgroundColor:bt},children:ae&&(0,J.jsx)(lt,{imageUrl:ae,animateIn:!1})})]})}),(0,J.jsx)(h,{open:w&&A,title:s(`billingOnboardingModal.backgroundConfirmTitle`),message:D.backgroundConfirmMessage,confirmLabel:s(`billingOnboardingModal.backgroundConfirmContinue`),cancelLabel:s(`billingOnboardingModal.backgroundConfirmKeepWaiting`),onConfirm:_e,onCancel:ve})]});function Se(){return d===`provisioning`?O.confirmError||O.targetsError?(0,J.jsx)(at,{onGoToBilling:t,direction:E}):(0,J.jsx)(Bt,{state:O.state,direction:E,softWaiting:O.softWaiting,intent:v,creditsChange:c?o?.credits:void 0,targets:ee??Qt,fromSnapshot:re,machineFloor:O.machineFloor,landed:O.landed,celebrating:B,onCelebrationEnd:he,assistantId:M,escapeAvailable:A&&O.escapeEligible,onEscape:ge,onPhaseChange:x,kickError:O.kickError,confirm:{onRetry:O.retryConfirm,onGoToBilling:t},dwellMs:n,phaseMinMs:i}):d===`domain`?(0,J.jsx)(it,{machineBusy:A,assistantId:M,onExit:()=>p(`complete`)}):(0,J.jsx)(Ge,{assistantId:M,direction:E})}}function en(e){return e!=null&&!e.customized}function tn(e){return en(e)?e.name:`Custom`}var nn=[`mighty`,`super`,`ultra`],rn=[`free`,...nn];function an(e){return rn.indexOf(e)}function on(e,t){if(e===null)return`upgrade`;let n=an(e),r=an(t);return n===-1||r===-1?`upgrade`:r===n?`current`:r<n?`downgrade`:`upgrade`}function sn(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>nn.indexOf(e.key)-nn.indexOf(t.key));if(!t)return n[0];let r=n.findIndex(e=>e.key===t);return r===-1?n[0]:r>=n.length-1?null:n[r+1]}var cn=[`too_expensive`,`missing_features`,`switched_service`,`unused`,`too_complex`,`low_quality`,`customer_service`,`other`],ln={too_expensive:`cancelReasonSurvey.optionTooExpensive`,missing_features:`cancelReasonSurvey.optionMissingFeatures`,switched_service:`cancelReasonSurvey.optionSwitchedService`,unused:`cancelReasonSurvey.optionUnused`,too_complex:`cancelReasonSurvey.optionTooComplex`,low_quality:`cancelReasonSurvey.optionLowQuality`,customer_service:`cancelReasonSurvey.optionCustomerService`,other:`cancelReasonSurvey.optionOther`},un=1e3,dn={feedback:null,comment:``};function fn(e){return e.feedback!=null}function pn(e){let t=e.feedback===`other`?e.comment.trim():``;return{feedback:e.feedback,comment:t||null}}function mn({value:e,onChange:n,disabled:r}){let{t:i}=V(`settings`);return(0,J.jsxs)(`div`,{className:`mt-5 space-y-3`,"data-testid":`cancel-reason-survey`,children:[(0,J.jsx)(P,{as:`p`,variant:`body-medium-default`,children:i(`cancelReasonSurvey.title`)}),(0,J.jsx)(t,{value:e.feedback??``,onValueChange:t=>n({...e,feedback:t===``?null:t}),name:`cancel-reason`,disabled:r,"aria-label":i(`cancelReasonSurvey.title`),children:cn.map(e=>(0,J.jsx)(v,{value:e,label:i(ln[e])},e))}),e.feedback===`other`?(0,J.jsx)(se,{label:i(`cancelReasonSurvey.otherLabel`),placeholder:i(`cancelReasonSurvey.otherPlaceholder`),value:e.comment,onChange:t=>n({...e,comment:t.target.value}),maxLength:un,rows:3,disabled:r,fullWidth:!0,"data-testid":`cancel-reason-comment`}):null]})}var hn={free:{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},mighty:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`},super:{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},ultra:{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`}};function gn({tier:e,size:t=40}){let n=hn[e]??hn.free,r=R();return(0,J.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,J.jsx)(C,{components:r,bodyShapeId:n.bodyShape,colorId:n.color,size:t}):(0,J.jsx)(`div`,{style:{width:t,height:t}})})}var _n={free:{tagline:`Get to know your assistant.`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`More capacity for consistent use.`,cta:`Power Up`,priceCaption:`Billed monthly`,recommended:!0},super:{tagline:`Do more, think less about the how.`,cta:`Go Super`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Your second brain, running full speed.`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function vn(e){return _n[e]}function yn(e){return`Downgrade to ${e}`}function bn(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function xn(e){return`${bn(e)}/mo`}function Sn(e){return`${bn(e)}/month`}function Cn(e){return`${e>0?`+`:`−`}${bn(Math.abs(e))}/mo`}function wn(e){return`${e} GB storage`}function Tn(e){return`${bn(e*100)} of bundled credits`}var En=`Small`;function Dn(e){return e?.machine_size?K[e.machine_size]??e.machine_size:En}function On(e,t){let n=vn(e.key)?.extraFeatures??[];return[{icon:Re,label:`${Dn(e)} Machine`},{icon:Ee,label:`${e.storage_gib} GB Storage`},{icon:Te,label:t},...n.map(e=>({icon:xe,label:e}))]}function kn(){return[{icon:Re,label:`${En} Machine`},{icon:Ee,label:`4 GB Storage`},{icon:Te,label:`Pay as you go credits`}]}function An(e,t=[]){let n=e?.credits_usd??0,r=e?.storage_gib??4,i=je[e?.machine_size??`small`];return[`${Dn(e)} machine${i?` (${i})`:``}`,wn(r),e?.usage_label??Tn(n),...t]}var jn={machine:`Configurable machine size`,storage:`Configurable storage`,credits:`Pay-as-you-go and bundled credits`};function Mn(e,t){let n=[`${e.machineTier?Ae[e.machineTier]??t.machine_tiers.find(t=>t.tier===e.machineTier)?.label??e.machineTier:En} Machine`];if(e.storageGib!=null&&n.push(`${e.storageGib} GB`),e.creditTier!=null){let r=ut(t,e.creditTier)?.label,i=dt(e.creditTier);n.push(r??(i==null?`Credit bundle`:`${i} credits/mo`))}return n}function Nn(e,t){let n=new Set([jn.machine]);return e.storageGib!=null&&n.add(jn.storage),e.creditTier!=null&&n.add(jn.credits),[...Mn(e,t),...t.included_features.filter(e=>!n.has(e))]}function Pn(e){return e.disabled===!0}function Fn({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:r,onMachineTierChange:i,onStorageTierChange:a,currentMachinePriceCents:o,currentStoragePriceCents:s}){let{t:c}=V(`settings`),l=(0,q.useMemo)(()=>e.map(e=>{let t=Ae[e.tier]??e.label,n=o==null?c(`tierPicker.priceAddon`,{price:xn(e.price_cents)}):e.price_cents===o?c(`tierPicker.priceCurrent`,{price:xn(e.price_cents)}):Cn(e.price_cents-o);return{value:e.tier,label:c(`tierPicker.machineOption`,{label:t,priceLabel:n}),disabled:Pn(e)}}),[e,o,c]),u=(0,q.useMemo)(()=>t.map(e=>{let t=s==null?c(`tierPicker.priceAddon`,{price:xn(e.price_cents)}):e.price_cents===s?c(`tierPicker.priceCurrent`,{price:xn(e.price_cents)}):Cn(e.price_cents-s);return{value:e.tier,label:c(`tierPicker.storageOption`,{gib:e.storage_gib,priceLabel:t}),disabled:Pn(e)}}),[t,s,c]);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(P,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:c(`tierPicker.machineLabel`)}),(0,J.jsx)(`span`,{title:c(`tierPicker.machineTooltip`),children:(0,J.jsx)(G,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,J.jsx)(E,{"aria-label":c(`tierPicker.machineAriaLabel`),placeholder:c(`tierPicker.machinePlaceholder`),value:n??``,onChange:i,options:l})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(P,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:c(`tierPicker.storageLabel`)}),(0,J.jsx)(`span`,{title:c(`tierPicker.storageTooltip`),children:(0,J.jsx)(G,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,J.jsx)(E,{"aria-label":c(`tierPicker.storageAriaLabel`),placeholder:c(`tierPicker.storagePlaceholder`),value:r??``,onChange:a,options:u})]})]})}var In=new Set([`active`,`trialing`,`past_due`]);function Ln(e){return e.plan_id!==`base`&&e.cancel_at_period_end!==!0&&!e.cancel_at&&e.status!=null&&In.has(e.status)}function Rn(e){return e?.status!=null&&In.has(e.status)}var zn=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`package`,`non_field_errors`];function Bn(e,t){if(e&&typeof e==`object`){for(let t of zn)if(t in e){let n=e[t];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(`detail`in e&&typeof e.detail==`string`)return e.detail}return t}function Vn(e,t){let n=e.filter(e=>!Pn(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function Hn(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function Un(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}function Wn(){let e=H();return async t=>{try{let n=await t.mutateAsync();return await e.invalidateQueries({queryKey:ae()}),t.onSuccess(n),n}catch(e){return I.error(Bn(e,t.errorFallback()),{id:t.errorToastId}),null}}}var Gn=`billing-portal-return-snapshot`;function Kn(e){try{sessionStorage.removeItem(Gn),sessionStorage.setItem(Gn,JSON.stringify(e))}catch{}}function qn(){if(typeof sessionStorage>`u`)return null;try{let e=sessionStorage.getItem(Gn);if(!e)return null;let t=JSON.parse(e);return typeof t.cancel_at_period_end!=`boolean`||typeof t.plan_id!=`string`?null:{cancel_at_period_end:t.cancel_at_period_end,cancel_at:t.cancel_at??null,plan_id:t.plan_id}}catch{return null}}function Jn(){try{sessionStorage.removeItem(Gn)}catch{}}function Yn(e){return e?{cancel_at_period_end:e.cancel_at_period_end,cancel_at:e.cancel_at??null,plan_id:e.plan_id}:null}function Xn(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function Zn(e){return e?e.cancel_at??e.current_period_end??null:null}function Qn(e){let t=H();return(0,q.useEffect)(()=>L(()=>{t.invalidateQueries(ce())}),[t]),ne({onSuccess:t=>{e&&Kn(e),o(t.portal_url)},onError:()=>{I.error(z(`settings:useBillingPortalSession.openError`),{id:`billing-portal-session-error`})}})}function $n(){let e=ee(),t=Wn();return{cancelSubscription:n=>t({mutateAsync:()=>e.mutateAsync({body:n}),onSuccess:e=>{let t=e.cancel_at?Xn(e.cancel_at):z(`settings:useCancelSubscription.endOfBillingPeriod`);I.info(z(`settings:useCancelSubscription.canceledToast`,{date:t}),{id:`subscription-cancel`})},errorToastId:`subscription-cancel-error`,errorFallback:()=>z(`settings:useCancelSubscription.cancelFailedToast`)}),isPending:e.isPending}}function er(e){return Promise.all([e.invalidateQueries({queryKey:ae()}),e.invalidateQueries({queryKey:k()}),e.invalidateQueries({queryKey:te()}),e.invalidateQueries({queryKey:M()})])}function tr({enabled:e=!0}={}){let t=H(),{t:r}=V(`settings`),[i,a]=(0,q.useState)(null),o=(0,q.useRef)(!1),[s,c]=(0,q.useState)(!1),l=d(),u=e&&l,f=B({...ce(),enabled:u}),p=f.data,h=p!=null&&p.plan_id!==`base`,g=B({...n(),enabled:u&&h}),_=B({...m(),enabled:u&&h}).data?.plans.find(e=>e.id===`pro`)?.machine_tiers??[],v=e=>_.find(t=>t.tier===e)?.price_cents??null,y=pe(O()),b={machineTier:g.data?.max_machine_tier??null,storageTier:g.data?.selected_storage_tier??null,storageGib:g.data?.selected_storage_gib??null,creditTier:p?.selected_credit_tier??null,hasPlatformFee:p?.has_platform_fee??!0},x=p!=null&&p.plan_id!==`base`&&p.status!=null&&In.has(p.status)&&p.cancel_at_period_end!==!0&&!p.cancel_at,S=!h||!g.isPending,C=!h||g.isSuccess&&g.data!=null&&!g.isFetching&&g.dataUpdatedAt>=f.dataUpdatedAt,w=s||y.isPending,T=async(e,t=b)=>{if(o.current)return null;o.current=!0,c(!0);try{return await E(e,t)}finally{o.current=!1,c(!1)}},E=async(e,n)=>{a(null);let i=e=>(a(e),I.error(e),null),[o,s]=await Promise.all([f.refetch(),g.refetch()]),c=o.data,l=s.data;if(o.isError||s.isError||c==null||l==null)return i(r(`customPlanModal.changeFailed`));let u={machineTier:l.max_machine_tier??null,storageTier:l.selected_storage_tier??null,storageGib:l.selected_storage_gib??null,creditTier:c.selected_credit_tier??null,hasPlatformFee:c.has_platform_fee??!0},d={machineTier:e.machineTier===n.machineTier?u.machineTier:e.machineTier,storageTier:e.storageTier===n.storageTier&&u.storageTier!=null?u.storageTier:e.storageTier,creditTier:e.creditTier===n.creditTier?u.creditTier:e.creditTier},p=d.machineTier!==u.machineTier,m=d.storageTier!==u.storageTier,h=d.creditTier!==u.creditTier,_=!u.hasPlatformFee,b=v(d.machineTier),x=v(u.machineTier),S=p&&b!=null&&x!=null&&b<x;if(!p&&!m&&!h&&!_)return{needsResize:!1,creditChanged:!1};let C;try{C=(await y.mutateAsync({body:{machine_tier:d.machineTier,storage_tier:d.storageTier,credit_tier:d.creditTier}})).status}catch(e){return i(Bn(e,r(`customPlanModal.changeFailed`)))}return await er(t),C===`no_op`?{needsResize:!1,creditChanged:!1}:{needsResize:m||p&&!S,creditChanged:h}};return{changeTiers:T,isPending:w,error:i,current:b,eligible:x,currentReady:S,currentKnown:C,primaryAssistantId:C?g.data?.primary_assistant_id??null:null}}function nr(){let e=H(),{t}=V(`settings`),n=pe(O());return{changePackage:async r=>{try{let t=await n.mutateAsync({body:{package:r}});return await er(e),t}catch(e){return I.error(Bn(e,t(`customPlanModal.changeFailed`))),null}},isPending:n.isPending}}function rr({className:e,"data-testid":t,children:n}){return(0,J.jsx)(`div`,{"aria-hidden":!0,"data-testid":t,className:x(`flex size-[52px] shrink-0 items-center justify-center rounded-xl`,e),children:n})}var ir=32;function ar(){let{ready:e,avatar:t}=_t();return(0,J.jsx)(rr,{"data-testid":`assistant-avatar-tile`,className:`bg-[var(--surface-active)]`,children:e?(0,J.jsx)(w,{components:t.components,traits:t.traits,customImageUrl:t.customImageUrl,size:ir}):null})}var or=`Billed monthly · prorated difference charged today`,sr=`Billed monthly · prorated difference charged today or credited next invoice`,cr=`Billed monthly · prorated credit on your next invoice`,lr=`Your machine downsizes now and your storage stays. No refund.`,ur=`Continue`,dr=`The plan includes`,fr=`Your plan will include`;function pr(e,t,n){let r=n?vn(n)?.tagline??``:``;switch(e){case`downgrade`:return{title:yn(t),subtitle:``,priceCaption:cr,checklistHeading:fr,note:lr,confirmLabel:yn(t),destructive:!0};case`switch`:return{title:`Switch to ${t}`,subtitle:r,priceCaption:sr,checklistHeading:dr,note:``,confirmLabel:ur,destructive:!1};default:return{title:`Upgrade to ${t}`,subtitle:r,priceCaption:or,checklistHeading:dr,note:``,confirmLabel:ur,destructive:!1}}}function mr({open:e,relation:t,packageName:n,targetPackage:r,pending:i,onCancel:a,onConfirm:o}){let{t:c}=V(`settings`),l=(0,q.useRef)(null),u=(0,q.useId)(),d=pr(t,n,r?.key??null),p=r?{price:xn(r.total_price_cents),highlights:An(r,vn(r.key)?.extraFeatures??[])}:null,m=d.subtitle,h=d.note?{"aria-describedby":u}:m?{}:{"aria-describedby":void 0};return(0,J.jsx)(f.Root,{open:e,onOpenChange:e=>{!e&&!i&&a()},children:(0,J.jsxs)(f.Content,{size:`sm`,hideCloseButton:!0,className:`gap-4 p-4 max-w-[421px]`,onOpenAutoFocus:e=>{e.preventDefault(),l.current?.focus()},...h,children:[(0,J.jsxs)(f.Header,{className:`flex-row items-center gap-3 p-0 pb-2`,children:[d.destructive?(0,J.jsx)(rr,{"data-testid":`package-switch-warning-tile`,className:`bg-[var(--system-negative-weak)]`,children:(0,J.jsx)(ye,{className:`size-6 text-[var(--system-negative-strong)]`})}):(0,J.jsx)(ar,{}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsx)(f.Title,{className:`text-title-small text-[var(--content-emphasised)] [&>span]:whitespace-normal`,children:d.title}),m?(0,J.jsx)(f.Description,{className:`mt-0 text-body-medium-default text-[var(--content-tertiary)]`,children:m}):null]})]}),p?(0,J.jsxs)(f.Body,{className:`flex flex-col gap-4 p-0`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(P,{as:`p`,variant:`title-large`,className:`text-[var(--content-default)]`,children:p.price}),(0,J.jsx)(P,{as:`p`,variant:`label-medium-default`,className:`leading-[15px] text-[var(--content-tertiary)]`,children:d.priceCaption})]}),(0,J.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,J.jsx)(P,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:d.checklistHeading}),(0,J.jsx)(`ul`,{className:`flex flex-col gap-2`,children:p.highlights.map(e=>(0,J.jsxs)(`li`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(De,{className:`size-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,J.jsx)(P,{as:`span`,variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e})]},e))})]}):null,d.note?(0,J.jsx)(P,{id:u,as:`p`,variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:d.note}):null,(0,J.jsxs)(f.Footer,{className:`flex-col gap-4 p-0`,children:[(0,J.jsx)(s,{fullWidth:!0,variant:d.destructive?`danger`:`primary`,onClick:o,disabled:i,"data-testid":`confirm-package-switch-button`,children:d.confirmLabel}),(0,J.jsx)(s,{ref:l,fullWidth:!0,variant:`ghost`,onClick:a,disabled:i,children:c(`packageSwitchConfirmModal.cancel`)})]})]})})}function hr(){let e=H();(0,q.useEffect)(()=>L(()=>{er(e)}),[e])}export{xn as A,en as B,Nn as C,On as D,Dn as E,mn as F,Ke as G,tn as H,dn as I,We as K,fn as L,wn as M,vn as N,Cn as O,gn as P,pn as R,Pn as S,kn as T,on as U,sn as V,$t as W,Ln as _,er as a,Vn as b,Jn as c,qn as d,Qn as f,Rn as g,Bn as h,tr as i,Sn as j,bn as k,Xn as l,In as m,mr as n,$n as o,Wn as p,Re as q,nr as r,Yn as s,hr as t,Zn as u,Un as v,Mn as w,Fn as x,Hn as y,nn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ei as t,Fa as n,Ha as r,La as i,Ra as a}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ei as t,Fa as n,Ha as r,La as i,Ra as a}from"./app-Qc-rYPt9.js";import{x as o}from"./react-B9IgSVeK.js";var s=e(o(),1),c=.25;function l(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function u({containerRef:e,onBack:o,enabled:u,navKey:d,prefetchHref:f}){let p=(0,s.useRef)(o);(0,s.useLayoutEffect)(()=>{p.current=o},[o]);let m=(0,s.useRef)(f);(0,s.useLayoutEffect)(()=>{m.current=f},[f]);let h=(0,s.useRef)(!1),g=(0,s.useRef)(new Set),_=(0,s.useRef)(!1),v=n.use.registerBackOwner(),y=n.use.unregisterBackOwner();(0,s.useEffect)(()=>{if(u)return v(),y},[u,v,y]),(0,s.useEffect)(()=>{_.current=!1;let t=g.current;return()=>{_.current=!0;for(let e of t)clearTimeout(e);t.clear();let n=e.current;n&&l(n)}},[e]);let b=(e,t)=>{let n=setTimeout(()=>{g.current.delete(n),_.current||e()},t);g.current.add(n)},x=(e,t)=>{e.style.transform=t===0?``:`translateX(${t}px)`},S=e=>{e.style.transition=`transform 200ms ${r}`,x(e,0);let t=()=>{e.removeEventListener(`transitionend`,t),l(e)};e.addEventListener(`transitionend`,t,{once:!0}),b(()=>l(e),250)},C=e=>{e.style.transition=`transform 150ms ${r}`,x(e,window.innerWidth);let t=!1,n=()=>{if(t||_.current)return;t=!0,e.removeEventListener(`transitionend`,n);let r=-(window.innerWidth*c);e.style.transition=`none`,e.style.transform=`translateX(${r}px)`,e.style.opacity=`0`,e.offsetWidth,h.current=!0,p.current(),b(()=>{h.current&&(h.current=!1,l(e))},400)};e.addEventListener(`transitionend`,n,{once:!0}),b(n,200)};a({enabled:u,onConfirm:()=>{t(m.current);let n=e.current;n&&(n.style.transition=`none`,n.style.willChange=`transform`)},onMove:(t,n)=>{let r=e.current;r&&x(r,i(t,n))},onCommit:()=>{let t=e.current;if(!t){p.current();return}C(t)},onCancel:t=>{let n=e.current;n&&(t?S(n):l(n))}}),(0,s.useLayoutEffect)(()=>{if(!h.current)return;h.current=!1;let t=e.current;if(!t)return;let n=!1,i=()=>{n||(n=!0,t.removeEventListener(`transitionend`,i),l(t))};t.style.transition=`transform 200ms ${r}, opacity 200ms ${r}`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,i,{once:!0});let a=setTimeout(i,250);return()=>{clearTimeout(a),t.removeEventListener(`transitionend`,i),l(t)}},[d,e])}export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{ca as t,ig as n,la as r,sa as i}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{ca as t,ig as n,la as r,sa as i}from"./app-Qc-rYPt9.js";import{x as a}from"./react-B9IgSVeK.js";var o=e(a(),1),s={ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`,Enter:`Return`,NumpadEnter:`Return`,Space:`Space`,Tab:`Tab`,Escape:`Escape`,Backspace:`Backspace`,Delete:`Delete`,Insert:`Insert`,Home:`Home`,End:`End`,PageUp:`PageUp`,PageDown:`PageDown`,Minus:`-`,Equal:`=`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Semicolon:`;`,Quote:`'`,Backquote:"`",Comma:`,`,Period:`.`,Slash:`/`},c=new Set([`MetaLeft`,`MetaRight`,`ControlLeft`,`ControlRight`,`AltLeft`,`AltRight`,`ShiftLeft`,`ShiftRight`]),l=e=>{let t=e.code;return c.has(t)?null:/^Key[A-Z]$/.test(t)?t.slice(3):/^Digit[0-9]$/.test(t)?t.slice(5):/^Numpad[0-9]$/.test(t)?`num${t.slice(6)}`:/^F[0-9]{1,2}$/.test(t)?t:s[t]??null},u=(e,t=`macos`)=>{let n=l(e);if(n===null)return null;let r=[];return t===`windows`||t===`linux`?(e.ctrlKey&&r.push(`CmdOrCtrl`),e.metaKey&&r.push(`Super`)):(e.metaKey&&r.push(`CmdOrCtrl`),e.ctrlKey&&r.push(`Control`)),e.altKey&&r.push(`Alt`),e.shiftKey&&r.push(`Shift`),[...r,n].join(`+`)},d={macos:new Set([`Command`,`Cmd`,`CommandOrControl`]),windows:new Set([`Control`,`Ctrl`,`CommandOrControl`]),linux:new Set([`Control`,`Ctrl`,`CommandOrControl`])},f=(e,t=`macos`)=>{let n=d[t],r=e.split(`+`).map(e=>n.has(e)?`CmdOrCtrl`:e),i=r.pop()??``;return[...new Set(r)].sort().concat(i).join(`+`)},p=(e,t,n,r=`macos`)=>{if(n===``)return null;let i=f(n,r);return e.find(e=>e.key!==t&&e.accelerator!==``&&f(e.accelerator,r)===i)??null};function m(e){let a=e?.onBound,[s,c]=(0,o.useState)([]),[l,d]=(0,o.useState)(null),[f,m]=(0,o.useState)(null),h=(0,o.useCallback)(()=>{i().then(c)},[]);(0,o.useEffect)(()=>(h(),t(c)),[h]);let g=(0,o.useCallback)(()=>{d(null),m(null)},[]);return(0,o.useEffect)(()=>{if(l===null)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.code===`Escape`){g();return}let t=n()??`macos`,i=u(e,t);if(i===null)return;let o=p(s,l,i,t);if(o!==null){m({key:l,label:o.label});return}r(l,i).then(()=>{a?.(l),h()}).catch(()=>{h()}),g()};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[l,s,a,h,g]),{catalog:s,recordingKey:l,conflict:f,startRecording:(0,o.useCallback)(e=>{m(null),d(e)},[]),stopRecording:g,resetHotkey:(0,o.useCallback)(e=>{let t=p(s,e,s.find(t=>t.key===e)?.defaultAccelerator??``,n()??`macos`);if(t!==null){d(null),m({key:e,label:t.label});return}g(),r(e,null).then(h)},[s,h,g]),removeHotkey:(0,o.useCallback)(e=>{g(),r(e,``).then(h)},[h,g])}}export{m as t};
|
package/dist/assets/{use-invite-link-dialog-CEz7AGhb.js → use-invite-link-dialog-CCACCzhi.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Av as t,C as n,EC as r,Ff as i,JS as a,Js as o,Ov as s,Pf as c,S as l,Xf as u,Ys as d,b as f,dh as p,dp as m,gC as h,gS as g,hp as _,jv as v,kv as y,mS as b,mp as ee,nC as x,pS as S,ph as C,pp as te,qS as w,uh as T,up as E,vf as D,vy as O,x as ne,xg as k,y as re}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Av as t,C as n,EC as r,Ff as i,JS as a,Js as o,Ov as s,Pf as c,S as l,Xf as u,Ys as d,b as f,dh as p,dp as m,gC as h,gS as g,hp as _,jv as v,kv as y,mS as b,mp as ee,nC as x,pS as S,ph as C,pp as te,qS as w,uh as T,up as E,vf as D,vy as O,x as ne,xg as k,y as re}from"./app-Qc-rYPt9.js";import{Qn as A,Yn as j,j as M,tr as N}from"./vendor-DEhKVoiV.js";import{t as P,x as F}from"./react-B9IgSVeK.js";import{Ji as I,Yn as L,li as R,tr as z}from"./icons-C0wyat6T.js";import{t as B}from"./a2a-invite-BSzXL6i3.js";var V=e(F(),1),H=P(),U=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],W=`trusted_contacts`,G=new Set([`platform`,`a2a`]),K=new Set([`vellum`,`whatsapp`]);function ie(e){return K.has(e)}function q(e){return t=>{w.error(t instanceof Error?t.message:e)}}function J(e){return typeof e==`string`&&U.includes(e)}function Y(e){return G.has(e)}function X(e){return(e?.policies??[]).filter(e=>!Y(e.channelType)&&!ie(e.channelType)).map(e=>({...e,policy:J(e.policy)?e.policy:`trusted_contacts`}))}async function Z(e,t,n,r){if(Y(t))throw new S(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await D({path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},throwOnError:!1});if(b(o,a,`Failed to save channel policy.`),!o.ok)throw new S(o.status,g(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new S(500,`Gateway returned no policy in response.`);return i.policy}var ae=`0.10.0`;function Q(){return k(ae)}function oe(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function se({open:e,assistantId:t,onClose:n}){let{t:i}=M(),{copy:o,copied:s,reset:c}=O({errorMessage:`Couldn't copy the invite link.`}),l=(0,V.useRef)(!1),u=j({...E({path:{assistant_id:t}})}),d=(0,V.useRef)(u.mutate);(0,V.useLayoutEffect)(()=>{d.current=u.mutate});let f=(0,V.useRef)(u.reset);(0,V.useLayoutEffect)(()=>{f.current=u.reset}),(0,V.useEffect)(()=>{e&&!l.current&&d.current({path:{assistant_id:t}}),l.current=e},[e,t]);let p=(0,V.useCallback)(()=>{f.current(),c(),n()},[n,c]),m=u.isSuccess&&u.data.token?B({senderAssistantId:t,token:u.data.token}):``;return(0,H.jsx)(a.Root,{open:e,onOpenChange:e=>{e||p()},children:(0,H.jsxs)(a.Content,{size:`sm`,children:[(0,H.jsx)(a.Header,{children:(0,H.jsx)(a.Title,{children:i(`generateInviteLinkDialog.title`)})}),(0,H.jsx)(a.Body,{children:u.isPending?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,H.jsx)(L,{className:`h-4 w-4 animate-spin`}),i(`generateInviteLinkDialog.creating`)]}):u.isError?(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:i(`generateInviteLinkDialog.createFailed`)}),(0,H.jsx)(r,{variant:`outlined`,onClick:()=>u.mutate({path:{assistant_id:t}}),children:i(`generateInviteLinkDialog.tryAgain`)})]}):u.isSuccess?(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsx)(h,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:i(`generateInviteLinkDialog.shareHint`)}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(x,{type:`text`,readOnly:!0,value:m,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>o(m),"aria-label":i(`generateInviteLinkDialog.copyAriaLabel`),className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-[var(--border-base)] hover:bg-[var(--surface-hover)]`,children:s?(0,H.jsx)(I,{className:`h-4 w-4`}):(0,H.jsx)(R,{className:`h-4 w-4`})})]}),u.data.expiresAt!=null&&(0,H.jsx)(h,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:oe(u.data.expiresAt)})]}):null}),(0,H.jsx)(a.Footer,{children:(0,H.jsx)(r,{variant:`outlined`,onClick:p,children:i(`generateInviteLinkDialog.done`)})})]})})}function ce({onClick:e}){let{t}=M();return(0,H.jsx)(r,{variant:`outlined`,size:`compact`,leftIcon:(0,H.jsx)(z,{className:`h-3.5 w-3.5`}),onClick:e,children:t(`shareConnectionLinkButton.label`)})}function le(e){let t=N(),n=Q(),r=(0,V.useMemo)(()=>({path:{assistant_id:e}}),[e]),i=(0,V.useMemo)(()=>d(r),[r]),a=A({...o(r),enabled:n,select:X}),s=(0,V.useMemo)(()=>{let e={};for(let t of a.data??[])p(t.channelType)&&(e[t.channelType]=t.policy);return e},[a.data]),c=j({mutationFn:({channelKey:t,policy:n})=>Z(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:i}),onError:q(`Failed to save channel policy`)}),l=(0,V.useCallback)((e,t)=>{c.mutate({channelKey:e,policy:t})},[c]);return n?{policies:s,savingKey:c.isPending?c.variables?.channelKey??null:null,isLoading:a.isPending,isError:a.isError,onChange:l}:{policies:void 0,savingKey:null,isLoading:!1,isError:!1,onChange:void 0}}var ue=`0.11.5-dev.202608242314.38e0513`;function de(){return k(ue)}var fe=`0.11.5-dev.202608252008.65007aa`;function pe(){return k(fe)}var $={slack:y,telegram:t,discord:s,email:void 0,phone:v},me={slack:`useAssistantChannels.setupPrompt.slack`,telegram:`useAssistantChannels.setupPrompt.telegram`,discord:`useAssistantChannels.setupPrompt.discord`,email:`useAssistantChannels.setupPrompt.email`,phone:`useAssistantChannels.setupPrompt.phone`},he={slack:`useAssistantChannels.finishPrompt.slack`,telegram:`useAssistantChannels.finishPrompt.telegram`,discord:`useAssistantChannels.finishPrompt.discord`,email:`useAssistantChannels.finishPrompt.email`,phone:`useAssistantChannels.finishPrompt.phone`},ge=15e3;function _e({assistantId:e,onStartSetupConversation:t}){let{t:r}=M(`common`),a=N(),o=(0,V.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,V.useMemo)(()=>i(o),[o]),u=de(),d=pe(),p=(0,V.useMemo)(()=>ve(u),[u]),h=A({...c(o),enabled:!!e,refetchInterval:ge,select:e=>e.snapshots}),g=(0,V.useMemo)(()=>ye(h.data??[],p,d),[h.data,p,d]),v=g.some(e=>e.key===`slack`&&e.configured),y=A({...te(o),enabled:v,select:e=>e.threadMode}),b=le(e),x=(0,V.useCallback)(()=>a.invalidateQueries({queryKey:s}),[a,s]),S=j({mutationFn:async t=>{let n=$[t];if(!n)throw Error(`No route clears ${t} credentials.`);await n({path:{assistant_id:e},throwOnError:!0})},onSettled:(t,r,i)=>{x(),i===`slack`&&n(a,e)}}),C=f({assistantId:e}),w=ne({assistantId:e}),T=A({...m(o),enabled:!!e&&d}),E=l({assistantId:e}),D=re({assistantId:e}),O=j({..._(),onSuccess:()=>{a.invalidateQueries({queryKey:ee(o)})}}),k=w.mutate,P=(0,V.useCallback)(e=>{k(e)},[k]),F=C.mutate,I=(0,V.useCallback)(e=>{F(e)},[F]),L=E.mutate,R=(0,V.useCallback)((e,t)=>{L({botToken:e,appToken:t})},[L]),z=O.mutate,B=(0,V.useCallback)(t=>{z({path:{assistant_id:e},body:{threadMode:t}})},[z,e]),H=D.mutateAsync,U=(0,V.useCallback)(async(e,t)=>{await H({accountSid:e,authToken:t})},[H]),W=(0,V.useCallback)((e,n=!1)=>{t&&t(r(n?he[e]:me[e]))},[t,r]),G=S.mutate,K=(0,V.useCallback)(e=>{G(e)},[G]);return{channels:g,pendingChannelKey:S.isPending?S.variables??null:null,slackThreadMode:y.data,slackThreadModePending:O.isPending,channelPolicies:b.policies,policySavingKey:b.savingKey,policiesLoading:b.isLoading,policiesError:b.isError,onChannelPolicyChange:b.onChange,onSetup:t?W:void 0,onDisconnect:K,onSaveTelegramToken:I,telegramSaveStatus:C.status,telegramSaveError:C.error?.message??null,onSaveDiscordToken:P,discordSaveStatus:w.status,discordSaveError:w.error?.message??null,discordInviteUrl:w.data?.data?.inviteUrl??T.data?.inviteUrl,onSaveSlackConfig:R,slackSaveStatus:E.status,slackSaveError:E.error?.message??null,onSlackThreadModeChange:B,onSaveTwilioCredentials:U}}function ve(e){return e?T:T.filter(e=>e!==`discord`)}function ye(e,t,n){let r=new Map;for(let t of e)r.set(t.channel,t);return t.map(e=>{let t=r.get(e);return{key:e,status:be(t),configured:t?.setupStatus===`ready`,canDisconnect:$[e]!==void 0&&(e!==`discord`||n),canManualEntry:C[e].credentialForm!==void 0&&(e!==`discord`||n),health:t?.health,address:t?.channelHandle??void 0}})}function be(e){return e?e.ready?`ready`:e.setupStatus===`not_configured`?`not_configured`:`incomplete`:`not_configured`}function xe(e){let t=N(),[n,r]=(0,V.useState)(!1);return{isOpen:n,open:(0,V.useCallback)(()=>{r(!0)},[]),close:(0,V.useCallback)(()=>{r(!1),t.invalidateQueries({queryKey:u({path:{assistant_id:e}})})},[t,e])}}export{Q as a,q as c,se as i,W as l,_e as n,Z as o,ce as r,X as s,xe as t,U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Kv as t,Op as n,Qn as r,Ro as i,gm as a,kp as o,mc as s,mm as c,qS as l,qv as u,xg as d}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Kv as t,Op as n,Qn as r,Ro as i,gm as a,kp as o,mc as s,mm as c,qS as l,qv as u,xg as d}from"./app-Qc-rYPt9.js";import{I as f,Qn as p,j as m,tr as h}from"./vendor-DEhKVoiV.js";import{t as g,x as _}from"./react-B9IgSVeK.js";var v=e(_(),1),y=g(),b={sm:`h-7 w-7`,md:`h-8 w-8 text-3xl`};function x({external:e=!1,icon:t,iconUrl:n,iconSrc:r,size:a=`sm`,className:o}){let[s,c]=(0,v.useState)(!1),l=r??n;(0,v.useEffect)(()=>{c(!1)},[l]);let u=t||(e?`📦`:`🧩`),d=!!l&&!s;return(0,y.jsx)(`span`,{className:i(`flex shrink-0 items-center justify-center`,b[a],o),children:d?(0,y.jsx)(`img`,{src:l,alt:``,"aria-hidden":!0,loading:`lazy`,className:`h-full w-full object-contain`,onError:()=>c(!0)}):u})}function S(e){return e!==void 0&&e.startsWith(`https://`)}function C(e,t){let n=e.map(e=>({name:e.name,description:e.description??void 0,status:`installed`,external:void 0,version:e.version??void 0,path:e.path,issues:e.issues,enabled:e.enabled,icon:e.icon,hasIcon:e.hasIcon,iconVersion:e.iconVersion})),r=new Set(n.map(e=>e.name)),i=t.filter(e=>!r.has(e.name)).map(e=>({name:e.name,description:e.description,status:`available`,external:!0,path:e.path,...S(e.icon)?{iconUrl:e.icon}:{icon:e.icon}}));return[...n,...i]}function w(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description].some(e=>e?.toLowerCase().includes(n)):!0}function T(e){return[...e].sort((e,t)=>{let n=e.status===`installed`;return n===(t.status===`installed`)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function E(e,t){switch(t){case`all`:return e;case`available`:return e.filter(e=>e.status===`available`);case`installed`:return e.filter(e=>e.status===`installed`);case`active`:return e.filter(e=>e.status===`installed`&&e.enabled!==!1);case`off`:return e.filter(e=>e.status===`installed`&&e.enabled===!1)}}function D(e){return e?e.slice(0,7):`unknown`}var O=`plugin.uninstall.mcp_oauth_credentials_unchecked`;function k(e,t){for(let n of e??[])l.warning(t(n===O?`pluginToast.mcpOAuthCredentialsUnchecked`:`pluginToast.cleanupWarning`))}function A(e,t){let{t:n}=m(`intelligence`),r=h(),i=c({onSuccess:(i,a)=>{let o=a.path.name;s(r,e,o),t?.onRemoved?.(o),t?.announceWarnings!==!1&&k(i?.warnings,n)},onError:(e,n)=>{t?.onRemoveError?.(n.path.name,e)}}),a=i.mutate;return{remove:(0,v.useCallback)(t=>{a({path:{assistant_id:e,name:t}})},[e,a]),isRemoving:i.isPending,isRemoveError:i.isError}}function j(e,t,n){let{t:r}=m(`intelligence`),i=h(),o=a({onSuccess:()=>{s(i,e,t),n?.onInstalled?.(),n?.announceInstall!==!1&&l.success(r(`pluginToast.installed`,{name:t||r(`pluginToast.pluginFallback`)}))}}),c=A(e,{onRemoved:()=>n?.onRemoved?.()});return{install:()=>{o.mutate({path:{assistant_id:e},body:{name:t}})},installAsync:()=>o.mutateAsync({path:{assistant_id:e},body:{name:t}}),remove:()=>{c.remove(t)},isInstalling:o.isPending,isRemoving:c.isRemoving,isInstallError:o.isError,isRemoveError:c.isRemoveError}}var M=`0.10.5`;function N(){return d(M)}function P(e,n,r,i){let a=N(),{data:o}=p({queryKey:[`pluginIcon`,e,n,i],queryFn:async()=>{let{data:r,error:i}=await t({path:{assistant_id:e,name:n},parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))throw Error(`Failed to load plugin icon`);return r},enabled:!!(a&&r&&i),staleTime:1/0,retry:!1}),[s,c]=(0,v.useState)(void 0);return(0,v.useEffect)(()=>{if(!o){c(void 0);return}let e=URL.createObjectURL(o);return c(e),()=>{URL.revokeObjectURL(e)}},[o]),s}var F=300*1e3,I=[],L=[],R=`system`;async function z(e,t,n){let r=await u({path:{assistant_id:e},query:{q:void 0,category:t},signal:n,throwOnError:!1});if(r.response?.status===404)return{plugins:[]};if(!r.response?.ok)throw Error(f(`usePluginsList.failureMessage`,{ns:`intelligence`}));return r.data??{plugins:[]}}function B(e,t){let[n,r]=(0,v.useState)({assistantId:e,latched:!1}),i=n.assistantId===e?n.latched:!1;return n.assistantId!==e&&r({assistantId:e,latched:!1}),(0,v.useEffect)(()=>{t&&r(t=>t.assistantId===e&&t.latched?t:{assistantId:e,latched:!0})},[e,t]),i||t}function V(e,t=null,i=!0){let a=t??void 0,s=p({queryKey:n({path:{assistant_id:e},query:{q:void 0,category:a}}),queryFn:({signal:t})=>z(e,a,t),enabled:!!e&&i,staleTime:F}),c=p({...r(e),enabled:!!e&&i&&t!==null}),l=p({...o({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e&&i,staleTime:F}),u=(0,v.useMemo)(()=>{let e=t===null?s.data?.plugins:c.data?.plugins??s.data?.plugins;return new Set((e??I).map(e=>e.name))},[t,c.data?.plugins,s.data?.plugins]),d=(0,v.useMemo)(()=>{let e=s.data?.plugins??I,n=l.data?.matches??L;return T(C(e,(t===null?n:n.filter(e=>(e.category??`system`)===t)).filter(e=>!u.has(e.name))))},[s.data?.plugins,l.data?.matches,t,u]),f=t===null?s.data:c.data,m=B(e,f?.categoryCounts!==void 0),g=B(e,(f?.plugins??I).some(e=>e.enabled!==void 0)),_=h(),y=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(y.current===e||!l.isSuccess)return;let t=f?.plugins;if(!t?.length)return;let r=new Map((l.data?.matches??L).map(e=>[e.name,e.category]));t.some(e=>{let t=r.get(e.name);return t!=null&&t!==`system`&&(e.category??`system`)===`system`})&&(y.current=e,_.invalidateQueries({queryKey:n({path:{assistant_id:e},query:{q:void 0}})}))},[e,l.isSuccess,l.data?.matches,f?.plugins,_]),{items:d,isLoading:s.isLoading,catalogLoading:l.isLoading,isError:s.isError,installedLoaded:s.data!==void 0,isFetching:s.isFetching||l.isFetching,catalogError:l.isError,categorySupported:m,pluginToggleSupported:g,installedCategoryCounts:f?.categoryCounts,installedPlugins:f?.plugins??I,installedTotal:f?.totalCount,catalogMatches:l.data?.matches??L,unfilteredInstalledNames:u}}export{A as a,w as c,j as i,D as l,V as n,k as o,P as r,E as s,R as t,x as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ac as t,Fc as n,Pm as r,Vm as i,eS as a,jc as o,rb as s,zm as c}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ac as t,Fc as n,Pm as r,Vm as i,eS as a,jc as o,rb as s,zm as c}from"./app-Qc-rYPt9.js";import{j as l}from"./vendor-DEhKVoiV.js";import{_ as u,r as d,t as f,x as p}from"./react-B9IgSVeK.js";import{Yn as m}from"./icons-C0wyat6T.js";var h=f();function g(){let{t:e}=l(`account`);return(0,h.jsx)(m,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":e(`authWaitSpinner.loading`)})}var _=e(p(),1);function v({to:e}){let r=t(e);return(0,_.useEffect)(()=>{r&&n(e)},[r,e]),r?null:(0,h.jsx)(d,{to:e,replace:!0})}function y(){let[e]=u(),t=c(),n=i(),l=r(),d=e.get(`returnTo`),f=s(d,a.assistant);if(!d)return{kind:`proceed`,returnTo:null};if(n)return{kind:`wait`};if(!t)return{kind:`proceed`,returnTo:f};if(o(f)){if(l===`pending`)return{kind:`wait`};if(l===`disabled`)return{kind:`proceed`,returnTo:f}}return{kind:`redirect`,node:(0,h.jsx)(v,{to:f})}}export{g as n,y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ca as t,EC as n,Ia as r,wa as i,za as a}from"./app-Qc-rYPt9.js";import{j as o}from"./vendor-DEhKVoiV.js";import{t as s,x as c}from"./react-B9IgSVeK.js";import{Fn as l,i as u}from"./icons-C0wyat6T.js";var d=e(c(),1),f=s(),p=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function m({open:e,onClose:t,children:i,title:s}){let{t:c}=o(),l=(0,d.useRef)(null),m=(0,d.useRef)(null),h=(0,d.useRef)(t);(0,d.useEffect)(()=>{h.current=t});let{dragOffset:g,isDragging:_,onTouchStart:v,onTouchMove:y,onTouchEnd:b,onTouchCancel:x}=r({enabled:e,onSwipeLeft:t});return a(e),(0,d.useEffect)(()=>{if(!e)return;m.current?.focus();let t=e=>{if(e.key===`Escape`&&!e.defaultPrevented){e.preventDefault(),h.current();return}if(e.key!==`Tab`||!l.current)return;let t=l.current.querySelectorAll(p),n=t[0],r=t[t.length-1];if(!n||!r){e.preventDefault();return}let i=document.activeElement,a=l.current.contains(i);e.shiftKey?(!a||i===n)&&(e.preventDefault(),r.focus()):(!a||i===r)&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e]),e?(0,f.jsxs)(`div`,{ref:l,className:`fixed inset-0`,style:{zIndex:40},role:`dialog`,"aria-modal":`true`,"aria-label":s,children:[(0,f.jsx)(`button`,{type:`button`,"aria-label":c(`sideListDrawer.closeSidebarAria`),className:`absolute inset-0 h-full w-full cursor-default`,style:{background:`rgba(0, 0, 0, 0.4)`,zIndex:40},onClick:t}),(0,f.jsxs)(`aside`,{className:`relative flex h-full w-[80vw] max-w-xs flex-col shadow-xl`,style:{background:`var(--surface-lift)`,borderRight:`1px solid var(--border-base)`,zIndex:50,paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,transform:`translateX(${g}px)`,transition:_?`none`:`transform 200ms ease-out`,touchAction:`pan-y`},onTouchStart:v,onTouchMove:y,onTouchEnd:b,onTouchCancel:x,children:[(0,f.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-3`,style:{borderColor:`var(--border-base)`},children:[(0,f.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:s}),(0,f.jsx)(n,{ref:m,type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,f.jsx)(u,{"aria-hidden":!0}),onClick:t,"aria-label":c(`sideListDrawer.closeAria`),tintColor:`var(--content-tertiary)`})]}),(0,f.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:i})]})]}):null}function h({onClick:e}){let{t}=o();return(0,f.jsx)(n,{type:`button`,variant:`ghost`,iconOnly:(0,f.jsx)(l,{"aria-hidden":!0}),onClick:e,"aria-label":t(`sideListDrawer.openSidebarAria`),tintColor:`var(--content-secondary)`})}var g=640;function _(){let{ref:e,size:n}=t(),r=n.w<=0,a=i(r),o=(r?a.w:n.w)>=g,[s,c]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{o&&c(!1)},[o]),{paneRef:e,hasRoomForList:o,drawerOpen:s,openDrawer:(0,d.useCallback)(()=>c(!0),[]),closeDrawer:(0,d.useCallback)(()=>c(!1),[])}}export{m as n,h as r,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{_m as t,cC as n,gS as r,h as i,mC as a,mS as o,pS as s,sy as c}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{_m as t,cC as n,gS as r,h as i,mC as a,mS as o,pS as s,sy as c}from"./app-Qc-rYPt9.js";import{I as l,Yn as u,j as d,tr as f}from"./vendor-DEhKVoiV.js";import{t as p,x as m}from"./react-B9IgSVeK.js";import{Cr as h,P as g,Pt as _,Ya as v,b as y,ha as b}from"./icons-C0wyat6T.js";var x=v(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),S=e(m(),1),C=p(),w={vellum:x,clawhub:h,skillssh:g,custom:y,"assistant-memory":b};function T(e,t){switch(e){case`vellum`:return`Vellum`;case`clawhub`:return`Clawhub`;case`skillssh`:return`skills.sh`;case`custom`:return t(`skillOriginBadge.custom`);case`assistant-memory`:return t(`skillOriginBadge.assistantMemory`)}}function E({origin:e}){let{t}=d(`intelligence`),r=e in w?{label:T(e,t),icon:w[e]}:{label:e.replace(/-/g,` `),icon:_};return(0,C.jsx)(n,{tone:`neutral`,leftIcon:(0,S.createElement)(r.icon),className:`capitalize`,children:r.label})}function D(e){return e.kind===`installed`||e.kind===`bundled`}function O(e){return e.kind===`catalog`}function k({icon:e,iconColor:t=`var(--content-tertiary)`,title:n,subtitle:r,children:i}){return(0,C.jsx)(a.Root,{children:(0,C.jsxs)(a.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,C.jsx)(e,{className:`mb-3 h-8 w-8`,style:{color:t},"aria-hidden":!0}),(0,C.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,C.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r}),i]})})}async function A(e,t,n){let{data:i,error:a,response:u}=await c({path:{assistant_id:e},body:n?{slug:t,version:n}:{slug:t},throwOnError:!1}),d=l(`installSkill.failureMessage`,{ns:`intelligence`});if(o(u,a,d),!u.ok)throw new s(u.status,r(a,u,d));return i??{ok:!0}}function j(e,{onRemoved:n}={}){let r=f(),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(null),[l,d]=(0,S.useState)(null),p=(0,S.useCallback)(()=>{i(r,e)},[e,r]),m=u({mutationFn:t=>A(e,t),onMutate:e=>o(e),onSettled:()=>{o(null),p()}}),h=t({onMutate:e=>c(e.path.id),onSuccess:()=>{n?.()},onSettled:()=>{c(null),p()}}),g=(0,S.useCallback)(e=>{m.mutate(e.slug??e.id)},[m]),_=(0,S.useCallback)(e=>{d(e)},[]),v=(0,S.useCallback)(()=>{l&&(h.mutate({path:{assistant_id:e,id:l.id}}),d(null))},[e,l,h]),y=(0,S.useCallback)(()=>{d(null)},[]);return{handleInstall:g,handleRemove:_,isInstallingSkill:(0,S.useCallback)(e=>a===(e.slug??e.id),[a]),isRemovingSkill:(0,S.useCallback)(e=>s===e.id,[s]),skillPendingRemoval:l,confirmRemove:v,cancelRemove:y}}export{E as a,D as i,k as n,x as o,O as r,j as t};
|
package/dist/assets/{use-skill-detail-files-OgBPzm48.js → use-skill-detail-files-CHrwga8E.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ro as t,Rp as n,eS as r,oC as i,zp as a}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ro as t,Rp as n,eS as r,oC as i,zp as a}from"./app-Qc-rYPt9.js";import{Qn as o,j as s}from"./vendor-DEhKVoiV.js";import{n as c,t as l,x as u}from"./react-B9IgSVeK.js";import{Ra as d}from"./icons-C0wyat6T.js";var f=l();function p({skill:e,className:n,onNavigate:a}){let{t:o}=s();return e.origin!==`assistant-memory`||!e.sourceConversationId?null:(0,f.jsxs)(c,{to:r.conversation(e.sourceConversationId),onClick:a,className:t(i({tone:`quiet`}),`inline-flex w-fit items-center gap-1 text-body-small-default text-[var(--content-tertiary)]`,n),children:[o(`skillLineageLink.label`),(0,f.jsx)(d,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0})]})}var m=e(u(),1);function h(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function g(e,t){let[r,i]=(0,m.useState)(null),s=o({...a({path:{assistant_id:e??``,id:t}}),select:e=>e??null,enabled:!!e}),c=(0,m.useMemo)(()=>s.data?.files??[],[s.data]),l=(0,m.useMemo)(()=>c.find(e=>e.name===`SKILL.md`),[c]),u=h(c,r),d=o({...n({path:{assistant_id:e??``,id:t},query:{path:u??``}}),select:e=>e??null,enabled:!!(e&&u)});return{fileEntries:c,skillMd:l,selectedPath:r,setSelectedPath:i,activePath:u,activeFile:c.find(e=>e.path===u),isFilesLoading:s.isLoading,isFilesPending:s.isPending,fileContent:d.data?.content??null,isBinary:!!d.data?.isBinary,isContentLoading:d.isLoading,isContentPending:d.isPending}}export{p as n,g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bg as e}from"./app-Qc-rYPt9.js";var t=`0.10.8`;function n(n){return e(t,n)}export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Jm as t,xr as n}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Jm as t,xr as n}from"./app-Qc-rYPt9.js";import{x as r}from"./react-B9IgSVeK.js";var i=e(r(),1);function a(e){let r=n();return(0,i.useMemo)(()=>{if(e)return r.find(n=>t(n).includes(e))},[r,e])}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$o as t,AC as n,Bo as r,Dd as i,EC as a,Ed as o,Gl as s,Go as c,Ho as l,Ic as u,Ih as d,JS as f,Jp as p,Kl as m,Lc as h,Lf as g,Od as _,Qt as v,Rc as y,Rf as b,Rx as x,SC as S,Uc as C,Uo as w,Vo as T,WS as E,Wo as D,XS as O,YS as k,Zt as A,as as j,eS as M,en as ee,es as te,fv as ne,is as N,it as re,ns as ie,nt as P,oC as ae,os as F,ot as oe,qS as se,rs as ce,rt as le,tC as I,tS as ue,ts as de,yo as L,zS as fe,zc as pe}from"./app-D8sMVA0h.js";import{Qn as R,j as z,tr as me}from"./vendor-DEhKVoiV.js";import{_ as he,n as ge,r as B,t as _e,x as ve}from"./react-B9IgSVeK.js";import{La as ye,fr as V}from"./icons-C0wyat6T.js";import{t as H}from"./detail-card-5ja97d__.js";import{t as be}from"./stt-language-picker-modal-6st6DWoq.js";import{t as xe}from"./use-hotkey-recorder-CQ81x0jZ.js";var U=e(ve(),1),W=_e();function G({label:e,selected:t,recording:n=!1,onClick:r}){return(0,W.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,W.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,W.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function Se(){let{t:e}=z(`settings`),{available:t,currentCode:n,configuredProviderId:r,selectLanguage:i,selecting:o}=re(P()),[s,c]=(0,U.useState)(!1);return t?(0,W.jsxs)(H,{title:e(`listeningLanguageCard.title`),subtitle:e(`listeningLanguageCard.subtitle`),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`span`,{className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`,children:oe(n,r)}),(0,W.jsx)(a,{variant:`outlined`,onClick:()=>c(!0),className:`shrink-0`,children:e(`listeningLanguageCard.change`)})]}),(0,W.jsx)(be,{open:s,onOpenChange:c,title:e(`listeningLanguageCard.title`),currentCode:n,configuredProviderId:r,selectLanguage:i,selecting:o})]}):null}var K=`flux`;function Ce(e){return e===`vellum`}function we(e,t){let n=e?.trim().toLowerCase();return!n||n===`multi`||t===void 0?!0:t.includes(n.split(`-`)[0]??n)}function Te(){let{t:e}=z(`settings`),t=me(),n=d(),r=P(),[i,a]=(0,U.useState)(!1),{data:o}=R({...g({path:{assistant_id:r}}),enabled:n,staleTime:3e4}),s=o?.services?.stt,{data:c}=R({...p({path:{assistant_id:r}}),enabled:n,staleTime:5*6e4}),l=s?.roles?.liveVoice?.provider??s?.provider,u=c?.providers?.find(e=>e.id===l),f=u?.modelFamilies?.includes(K)??!1;if(!l||!f)return null;let m=we(s?.language,u?.turnDetectionLanguages),h=s?.roles?.liveVoice,_=h?h.model:s?.providers?.[l]?.model,v=_===void 0?Ce(l)&&m:_===K,y=async n=>{a(!0);try{let{response:e}=await ne({path:{assistant_id:r},body:{services:{stt:{roles:{liveVoice:{provider:l,model:n?K:u?.baseModelFamily}}}}},throwOnError:!1});if(!e?.ok)throw Error(String(e?.status??``));await t.invalidateQueries({queryKey:b({path:{assistant_id:r}})})}catch{se.error(e(`voicePage.turnDetectionFailed`))}finally{a(!1)}};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`voicePage.turnDetectionLabel`)}),(0,W.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(m?`voicePage.turnDetectionDescription`:`voicePage.turnDetectionLanguageUnsupported`)}),(0,W.jsx)(I,{checked:v,disabled:i||!m&&!v,onChange:e=>void y(e),"aria-label":e(`voicePage.turnDetectionLabel`)})]})}var q=`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,J=`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--system-negative-strong)]`,Ee=2;function Y(e){let t=[];return e.ctrlKey&&t.push(`control`),e.altKey&&t.push(`option`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`command`),F(t)}function De(){let{t:e}=z(`settings`),n=de(),s=r(e=>e.registered)===!1,[c,l]=(0,U.useState)(null),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)([]),[m,h]=(0,U.useState)(!1),g=(0,U.useRef)(null),v=(0,U.useCallback)(async()=>{l((await o())?.inputMonitoring.status??null)},[]);(0,U.useEffect)(()=>{v();let e=setInterval(()=>{v()},2e3);return()=>{clearInterval(e)}},[v]);let y=(0,U.useCallback)(()=>{_(`inputMonitoring`).then(v)},[v]),b=(0,U.useCallback)(()=>{i(`inputMonitoring`).then(v)},[v]),x=(0,U.useCallback)(e=>{ie(e),d(!1),p([]),h(!1),e.kind!==`off`&&y()},[y]),S=(0,U.useCallback)(()=>{d(!0),p([]),h(!1),requestAnimationFrame(()=>{g.current?.focus()})},[]),C=(0,U.useCallback)(()=>{d(!1),p([]),h(!1)},[]),w=(0,U.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){C();return}p(Y(e))},[C]),T=(0,U.useCallback)(e=>{if(u&&!(Y(e).length>0)){if(f.length>=Ee){x({kind:`modifierOnly`,modifiers:f});return}p([]),h(!0)}},[x,f,u]);(0,U.useEffect)(()=>{if(!u)return;let e=e=>{g.current&&!g.current.contains(e.target)&&C()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[C,u]);let E=te(n),D=n.kind===`modifierOnly`&&!E,O=n.kind!==`off`,k=n.kind===`modifierOnly`&&n.modifiers.includes(`control`)&&n.modifiers.includes(`option`),A=c===`granted`;return(0,W.jsx)(H,{title:e(`voiceKeyCard.title`),subtitle:e(`voiceKeyCard.subtitle`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsxs)(`div`,{ref:g,tabIndex:u?0:-1,onKeyDown:u?w:void 0,onKeyUp:u?T:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[(0,W.jsx)(G,{label:e(`voiceKeyCard.fnLabel`),selected:E,onClick:()=>x(t)}),u?(0,W.jsx)(G,{label:f.length>0?j(f):e(`voiceKeyCard.recordingPrompt`),selected:!0,recording:!0,onClick:C}):(0,W.jsx)(G,{label:n.kind===`modifierOnly`&&!E?j(n.modifiers):e(`voiceKeyCard.customLabel`),selected:D,onClick:S}),(0,W.jsx)(G,{label:e(`voiceKeyCard.offLabel`),selected:!O,onClick:()=>x({kind:`off`})})]}),m&&(0,W.jsxs)(`div`,{className:q,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voiceKeyCard.customHint`)})]}),O&&c!==null&&!A&&(0,W.jsxs)(`div`,{className:`flex flex-col items-start gap-2 pt-1`,children:[(0,W.jsxs)(`div`,{className:J,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voiceKeyCard.needsInputMonitoring`)})]}),(0,W.jsx)(a,{variant:`outlined`,onClick:b,children:e(`voiceKeyCard.allowInputMonitoring`)})]}),O&&A&&s&&(0,W.jsxs)(`div`,{className:J,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voiceKeyCard.refusedNote`)})]}),E&&(0,W.jsxs)(`div`,{className:q,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voiceKeyCard.fnDictationNote`)})]}),k&&(0,W.jsxs)(`div`,{className:q,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voiceKeyCard.voiceOverNote`)})]})]})})}function Oe({assistantId:e,open:t,onOpenChange:n}){return(0,W.jsx)(f.Root,{open:t,onOpenChange:n,children:(0,W.jsx)(f.Content,{size:`md`,children:(0,W.jsx)(ke,{assistantId:e,onDone:()=>n(!1)})})})}function ke({assistantId:e,onDone:t}){let{t:n}=z(),{available:r,currentModel:i,selectModel:o,selecting:s}=L(e);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(f.Header,{children:[(0,W.jsx)(f.Title,{children:n(`voicePickerModal.title`)}),r&&(0,W.jsx)(f.Description,{children:`Uses Vellum credits, through providers like ElevenLabs and Deepgram.`})]}),(0,W.jsx)(f.Body,{children:(0,W.jsx)(v,{assistantId:e,filterBySource:!0,value:i,onChange:o,autoScrollToSelected:!0})}),(0,W.jsxs)(f.Footer,{className:`items-center justify-between gap-3`,children:[(0,W.jsx)(le,{}),(0,W.jsx)(a,{variant:`primary`,onClick:t,disabled:s,className:`shrink-0`,children:n(`voicePickerModal.done`)})]})]})}function Ae(){let{t:e}=z(`settings`),t=P(),{available:n,settled:r,voices:i,currentModel:o}=L(t),s=i.find(e=>e.model===o)??i[0],[c,l]=(0,U.useState)(!1),u=x.use.name(),d=u?e(`voicePickerCard.titleWithName`,{name:u}):e(`voicePickerCard.title`);return r?n&&s?(0,W.jsxs)(H,{title:d,subtitle:e(`voicePickerCard.creditsNote`),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(A,{description:s.description,className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`}),(0,W.jsx)(a,{variant:`outlined`,onClick:()=>l(!0),className:`shrink-0`,children:e(`voicePickerCard.changeButton`)})]}),(0,W.jsx)(Oe,{assistantId:t,open:c,onOpenChange:l})]}):(0,W.jsx)(H,{title:d,children:(0,W.jsx)(ee,{})}):(0,W.jsx)(H,{title:d,children:(0,W.jsx)(fe,{as:`span`,role:`status`,"aria-label":e(`voicePickerCard.loadingAria`),className:`block h-9 w-48`})})}var je=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],Me=`We recommend keeping both off to start. It feels more like a real conversation.`;function Ne(){let{t:e}=z();return(0,W.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:e(`voiceTranscriptToggles.recommendedOff`)})}function Pe({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,W.jsx)(Ne,{}):null]}),t?(0,W.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,W.jsx)(I,{checked:r,onChange:i,"aria-label":e})]})}function Fe({showDescription:e=!1,showRecommendedBadge:t=!1}){let{t:n}=z(),r=m.use.showUserTranscript(),i=m.use.showAssistantTranscript(),a=m.use.setShowUserTranscript(),o=m.use.setShowAssistantTranscript(),s={showUserTranscript:{checked:r,onChange:a},showAssistantTranscript:{checked:i,onChange:o}},c=(e,t)=>n(e===`showUserTranscript`?`voiceTranscriptToggles.userTranscriptLabel`:`voiceTranscriptToggles.assistantTranscriptLabel`,t),l=(e,t)=>n(e===`showUserTranscript`?`voiceTranscriptToggles.userTranscriptDescription`:`voiceTranscriptToggles.assistantTranscriptDescription`,t);return(0,W.jsx)(W.Fragment,{children:je.map(n=>{let r=s[n.prefKey];return(0,W.jsx)(Pe,{label:c(n.prefKey,n.label),description:e?l(n.prefKey,n.description):void 0,showBadge:t,checked:r.checked,onChange:r.onChange},n.prefKey)})})}var X=`text-body-small-default text-[var(--content-tertiary)]`;function Ie(){let[e]=he(),t=e.get(`tab`);return t===`sounds`?(0,W.jsx)(B,{replace:!0,to:M.settings.sounds}):t===`services`?(0,W.jsx)(B,{replace:!0,to:M.settings.ai}):(0,W.jsx)(Le,{})}function Le(){let{t:e}=z(`settings`);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,W.jsxs)(Z,{heading:e(`voicePage.sectionOutputHeading`),description:e(`voicePage.sectionOutputDescription`),children:[(0,W.jsx)(Ae,{}),(0,W.jsx)(Re,{})]}),(0,W.jsxs)(Z,{heading:e(`voicePage.sectionInputHeading`),description:e(`voicePage.sectionInputDescription`),children:[(0,W.jsx)(Be,{}),(0,W.jsx)(Se,{}),C()?(0,W.jsx)(De,{}):(0,W.jsx)(Ue,{}),(0,W.jsx)(We,{})]}),(0,W.jsx)(Z,{heading:e(`voicePage.sectionCaptionsHeading`),children:(0,W.jsx)(ze,{})})]})}function Re(){let{t:e}=z(`settings`),{available:t}=L(P());return t?(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 text-body-small-lighter text-[var(--content-tertiary)]`,children:[(0,W.jsx)(V,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-quiet)]`}),(0,W.jsx)(`span`,{children:e(`voicePage.speechServicesBannerPrompt`)}),(0,W.jsxs)(ge,{to:`${M.settings.ai}#text-to-speech`,className:n(ae({tone:`quiet`}),`inline-flex items-center gap-1 text-[var(--content-secondary)] decoration-[var(--border-element)] underline-offset-2`),children:[e(`voicePage.speechServicesBannerLink`),(0,W.jsx)(ye,{className:`h-3 w-3`})]})]}):null}function Z({heading:e,description:t,children:n}){return(0,W.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`h2`,{className:`text-label-medium-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t&&(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:t})]}),n]})}function ze(){let{t:e}=z(`settings`);return(0,W.jsx)(H,{title:e(`voicePage.captionsTitle`),subtitle:e(`voicePage.captionsSubtitle`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(Fe,{showDescription:!0}),(0,W.jsx)(`p`,{className:`${X} pt-1`,children:e(`voicePage.captionsRecommendation`,Me)})]})})}var Q=``;function Be(){let{t:e}=z(`settings`),[t,n]=(0,U.useState)([]),[r,i]=(0,U.useState)(!1),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(()=>u()),d=(0,U.useCallback)(async()=>{if(!navigator.mediaDevices?.enumerateDevices)return;let e=await h();i(e.needsPermission),n(e.devices),s(e.known)},[]),f=(0,U.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}d()},[d]);(0,U.useEffect)(()=>{d();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void d();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[d]);let p=(0,U.useMemo)(()=>{let n=t.map((t,n)=>({value:t.deviceId,label:t.label||e(`voicePage.microphoneFallbackLabel`,{index:n+1})})),r=c!==Q&&!n.some(e=>e.value===c);return[{value:null,label:e(`voicePage.systemDefault`)},...n,...r?[{value:c,label:e(o?`voicePage.savedMicrophoneNotConnected`:`voicePage.savedMicrophone`)}]:[]]},[t,c,o,e]),m=(0,U.useCallback)(e=>{l(e),y(e)},[]);(0,U.useEffect)(()=>pe(()=>{l(u())}),[]);let g=c===Q?null:c;return(0,W.jsx)(H,{title:e(`voicePage.microphoneTitle`),subtitle:e(`voicePage.microphoneSubtitle`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`div`,{className:`max-w-xs`,children:(0,W.jsx)(E,{options:p,value:g,onChange:m,onSelectNone:()=>m(Q),"aria-label":e(`voicePage.microphoneAriaLabel`)})}),r&&(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(a,{variant:`outlined`,onClick:f,children:e(`voicePage.allowMicrophoneAccess`)}),(0,W.jsx)(`span`,{className:X,children:e(`voicePage.grantMicrophoneAccessHint`)})]})]})})}var Ve=new Set([`Control`,`Alt`,`Shift`,`Meta`]),$=`toggleVoice`,He=[{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}}];function Ue(){let{t:e}=z(`settings`),t=ue(),[n,r]=(0,U.useState)(()=>w()),[i,a]=(0,U.useState)(!1),[o,s]=(0,U.useState)([]),[u,d]=(0,U.useState)(!1),f=(0,U.useRef)(null),p=(0,U.useMemo)(()=>{let e=l();return[{label:ce(e),activator:e}]},[]),m=n.kind!==`off`,h=(0,U.useCallback)(e=>{r(e),c(e),a(!1),s([]),d(!1)},[]),g=xe({onBound:()=>h({kind:`off`})}),_=g.catalog.find(e=>e.key===$)?.accelerator??``,v=g.recordingKey===$,y=D()?He:[],b=(0,U.useCallback)(e=>{h(e),g.removeHotkey($)},[g,h]),x=(0,U.useCallback)(()=>{h({kind:`off`}),g.removeHotkey($)},[g,h]),C=(0,U.useCallback)(()=>{a(!0),s([]),d(!1),requestAnimationFrame(()=>{f.current?.focus()})},[]),E=(0,U.useCallback)(()=>{a(!1),s([]),d(!1)},[]),O=(0,U.useCallback)(e=>{let t=[];return e.ctrlKey&&t.push(`control`),e.altKey&&t.push(`option`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`command`),t},[]),k=(0,U.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){E();return}let t=O(e);if(Ve.has(e.key)){d(!1),s(F(t));return}if(t.length===0){d(!0);return}h({kind:`key`,label:e.key.length===1?e.key.toUpperCase():e.key,modifiers:F(t)})},[E,O,h]),A=(0,U.useCallback)(e=>{i&&O(e).length===0&&o.length>0&&(s([]),d(!0))},[O,i,o]);(0,U.useEffect)(()=>{if(!i)return;let e=e=>{f.current&&!f.current.contains(e.target)&&E()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[E,i]);let M=m&&!p.some(e=>N(e.activator,n));return t?(0,W.jsx)(H,{title:e(`voicePage.voiceShortcutTitle`),subtitle:e(`voicePage.voiceShortcutSubtitleDesktop`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[y.map(e=>(0,W.jsx)(G,{label:e.label,selected:N(e.activator,n),onClick:()=>b(e.activator)},e.label)),(0,W.jsx)(G,{label:v?e(`voicePage.recordingPrompt`):_?(0,W.jsx)(S,{accelerator:_}):e(`voicePage.customKey`),selected:_!==``,recording:v,onClick:v?g.stopRecording:()=>g.startRecording($)}),(0,W.jsx)(G,{label:e(`voicePage.offKeyLabel`),selected:n.kind===`off`&&!_&&!v,onClick:x})]}),g.conflict?.key===$&&(0,W.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voicePage.shortcutConflict`,{command:g.conflict.label})})]})]})}):(0,W.jsx)(H,{title:e(`voicePage.voiceShortcutTitle`),subtitle:e(`voicePage.voiceShortcutSubtitle`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsx)(I,{checked:m,onChange:e=>{h(e?T():{kind:`off`})},label:e(`voicePage.enableVoiceShortcut`)}),m&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(`span`,{className:X,children:e(`voicePage.activationKeyLabel`)}),(0,W.jsxs)(`div`,{ref:f,tabIndex:i?0:-1,onKeyDown:i?k:void 0,onKeyUp:i?A:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[p.map(e=>(0,W.jsx)(G,{label:e.label,selected:N(e.activator,n),onClick:()=>h(e.activator)},e.label)),i?(0,W.jsx)(G,{label:o.length>0?j(o):e(`voicePage.pressShortcut`),selected:!0,recording:!0,onClick:E}):(0,W.jsx)(G,{label:M?ce(n):e(`voicePage.customKey`),selected:M,onClick:C})]}),u&&(0,W.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voicePage.shortcutChordHint`)})]}),m&&(0,W.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voicePage.focusedTabNote`)})]})]})]})})}function We(){let{t:e}=z(`settings`),t=m.use.pauseBeforeReplyMs(),n=m.use.setPauseBeforeReplyMs(),r=m.use.interruptSensitivity(),i=m.use.setInterruptSensitivity(),o=(0,U.useMemo)(()=>[{value:`low`,label:e(`voicePage.interruptSensitivityLow`)},{value:`medium`,label:e(`voicePage.interruptSensitivityMedium`)},{value:`high`,label:e(`voicePage.interruptSensitivityHigh`)}],[e]),c=t!==null||r!==null;return(0,W.jsx)(H,{title:e(`voicePage.turnTakingTitle`),subtitle:e(`voicePage.turnTakingSubtitle`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,W.jsx)(Te,{}),(0,W.jsx)(Ge,{label:e(`voicePage.pauseBeforeReplyLabel`),description:e(`voicePage.pauseBeforeReplyDescription`),isDefault:t===null,children:(0,W.jsx)(`div`,{className:`max-w-xs`,children:(0,W.jsx)(k,{value:(t??1200)/1e3,onValueChange:e=>{typeof e==`number`&&n(Math.round(e*1e3))},min:500/1e3,max:s/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":e(`voicePage.pauseBeforeReplyAriaLabel`)})})}),(0,W.jsx)(Ge,{label:e(`voicePage.interruptSensitivityLabel`),description:e(`voicePage.interruptSensitivityDescription`),isDefault:r===null,children:(0,W.jsx)(`div`,{className:`max-w-xs`,children:(0,W.jsx)(O,{items:o,value:r??`medium`,onChange:i,ariaLabel:e(`voicePage.interruptSensitivityAriaLabel`)})})}),c&&(0,W.jsx)(`div`,{children:(0,W.jsx)(a,{variant:`outlined`,onClick:()=>{n(null),i(null)},children:e(`voicePage.resetToDefaults`)})})]})})}function Ge({label:e,description:t,isDefault:n,children:r}){let{t:i}=z(`settings`);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),n&&(0,W.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:i(`voicePage.defaultBadge`)})]}),(0,W.jsx)(`p`,{className:X,children:t}),r]})}export{Ie as VoicePage};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$o as t,AC as n,Bo as r,Dd as i,EC as a,Ed as o,Gl as s,Go as c,Ho as l,Ic as u,Ih as d,JS as f,Jp as p,Kl as m,Lc as h,Lf as g,Od as _,Qt as v,Rc as y,Rf as b,Rx as x,SC as S,Uc as C,Uo as w,Vo as T,WS as E,Wo as D,XS as O,YS as k,Zt as A,as as j,eS as M,en as ee,es as te,fv as ne,is as N,it as re,ns as ie,nt as P,oC as ae,os as F,ot as oe,qS as se,rs as ce,rt as le,tC as I,tS as ue,ts as de,yo as L,zS as fe,zc as pe}from"./app-Qc-rYPt9.js";import{Qn as R,j as z,tr as me}from"./vendor-DEhKVoiV.js";import{_ as he,n as ge,r as B,t as _e,x as ve}from"./react-B9IgSVeK.js";import{La as ye,fr as V}from"./icons-C0wyat6T.js";import{t as H}from"./detail-card-DaoCCbYV.js";import{t as be}from"./stt-language-picker-modal-Dgcq9xkd.js";import{t as xe}from"./use-hotkey-recorder-OFYAQ-HC.js";var U=e(ve(),1),W=_e();function G({label:e,selected:t,recording:n=!1,onClick:r}){return(0,W.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,W.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,W.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function Se(){let{t:e}=z(`settings`),{available:t,currentCode:n,configuredProviderId:r,selectLanguage:i,selecting:o}=re(P()),[s,c]=(0,U.useState)(!1);return t?(0,W.jsxs)(H,{title:e(`listeningLanguageCard.title`),subtitle:e(`listeningLanguageCard.subtitle`),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`span`,{className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`,children:oe(n,r)}),(0,W.jsx)(a,{variant:`outlined`,onClick:()=>c(!0),className:`shrink-0`,children:e(`listeningLanguageCard.change`)})]}),(0,W.jsx)(be,{open:s,onOpenChange:c,title:e(`listeningLanguageCard.title`),currentCode:n,configuredProviderId:r,selectLanguage:i,selecting:o})]}):null}var K=`flux`;function Ce(e){return e===`vellum`}function we(e,t){let n=e?.trim().toLowerCase();return!n||n===`multi`||t===void 0?!0:t.includes(n.split(`-`)[0]??n)}function Te(){let{t:e}=z(`settings`),t=me(),n=d(),r=P(),[i,a]=(0,U.useState)(!1),{data:o}=R({...g({path:{assistant_id:r}}),enabled:n,staleTime:3e4}),s=o?.services?.stt,{data:c}=R({...p({path:{assistant_id:r}}),enabled:n,staleTime:5*6e4}),l=s?.roles?.liveVoice?.provider??s?.provider,u=c?.providers?.find(e=>e.id===l),f=u?.modelFamilies?.includes(K)??!1;if(!l||!f)return null;let m=we(s?.language,u?.turnDetectionLanguages),h=s?.roles?.liveVoice,_=h?h.model:s?.providers?.[l]?.model,v=_===void 0?Ce(l)&&m:_===K,y=async n=>{a(!0);try{let{response:e}=await ne({path:{assistant_id:r},body:{services:{stt:{roles:{liveVoice:{provider:l,model:n?K:u?.baseModelFamily}}}}},throwOnError:!1});if(!e?.ok)throw Error(String(e?.status??``));await t.invalidateQueries({queryKey:b({path:{assistant_id:r}})})}catch{se.error(e(`voicePage.turnDetectionFailed`))}finally{a(!1)}};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`voicePage.turnDetectionLabel`)}),(0,W.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(m?`voicePage.turnDetectionDescription`:`voicePage.turnDetectionLanguageUnsupported`)}),(0,W.jsx)(I,{checked:v,disabled:i||!m&&!v,onChange:e=>void y(e),"aria-label":e(`voicePage.turnDetectionLabel`)})]})}var q=`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,J=`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--system-negative-strong)]`,Ee=2;function Y(e){let t=[];return e.ctrlKey&&t.push(`control`),e.altKey&&t.push(`option`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`command`),F(t)}function De(){let{t:e}=z(`settings`),n=de(),s=r(e=>e.registered)===!1,[c,l]=(0,U.useState)(null),[u,d]=(0,U.useState)(!1),[f,p]=(0,U.useState)([]),[m,h]=(0,U.useState)(!1),g=(0,U.useRef)(null),v=(0,U.useCallback)(async()=>{l((await o())?.inputMonitoring.status??null)},[]);(0,U.useEffect)(()=>{v();let e=setInterval(()=>{v()},2e3);return()=>{clearInterval(e)}},[v]);let y=(0,U.useCallback)(()=>{_(`inputMonitoring`).then(v)},[v]),b=(0,U.useCallback)(()=>{i(`inputMonitoring`).then(v)},[v]),x=(0,U.useCallback)(e=>{ie(e),d(!1),p([]),h(!1),e.kind!==`off`&&y()},[y]),S=(0,U.useCallback)(()=>{d(!0),p([]),h(!1),requestAnimationFrame(()=>{g.current?.focus()})},[]),C=(0,U.useCallback)(()=>{d(!1),p([]),h(!1)},[]),w=(0,U.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){C();return}p(Y(e))},[C]),T=(0,U.useCallback)(e=>{if(u&&!(Y(e).length>0)){if(f.length>=Ee){x({kind:`modifierOnly`,modifiers:f});return}p([]),h(!0)}},[x,f,u]);(0,U.useEffect)(()=>{if(!u)return;let e=e=>{g.current&&!g.current.contains(e.target)&&C()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[C,u]);let E=te(n),D=n.kind===`modifierOnly`&&!E,O=n.kind!==`off`,k=n.kind===`modifierOnly`&&n.modifiers.includes(`control`)&&n.modifiers.includes(`option`),A=c===`granted`;return(0,W.jsx)(H,{title:e(`voiceKeyCard.title`),subtitle:e(`voiceKeyCard.subtitle`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsxs)(`div`,{ref:g,tabIndex:u?0:-1,onKeyDown:u?w:void 0,onKeyUp:u?T:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[(0,W.jsx)(G,{label:e(`voiceKeyCard.fnLabel`),selected:E,onClick:()=>x(t)}),u?(0,W.jsx)(G,{label:f.length>0?j(f):e(`voiceKeyCard.recordingPrompt`),selected:!0,recording:!0,onClick:C}):(0,W.jsx)(G,{label:n.kind===`modifierOnly`&&!E?j(n.modifiers):e(`voiceKeyCard.customLabel`),selected:D,onClick:S}),(0,W.jsx)(G,{label:e(`voiceKeyCard.offLabel`),selected:!O,onClick:()=>x({kind:`off`})})]}),m&&(0,W.jsxs)(`div`,{className:q,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voiceKeyCard.customHint`)})]}),O&&c!==null&&!A&&(0,W.jsxs)(`div`,{className:`flex flex-col items-start gap-2 pt-1`,children:[(0,W.jsxs)(`div`,{className:J,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voiceKeyCard.needsInputMonitoring`)})]}),(0,W.jsx)(a,{variant:`outlined`,onClick:b,children:e(`voiceKeyCard.allowInputMonitoring`)})]}),O&&A&&s&&(0,W.jsxs)(`div`,{className:J,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voiceKeyCard.refusedNote`)})]}),E&&(0,W.jsxs)(`div`,{className:q,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voiceKeyCard.fnDictationNote`)})]}),k&&(0,W.jsxs)(`div`,{className:q,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voiceKeyCard.voiceOverNote`)})]})]})})}function Oe({assistantId:e,open:t,onOpenChange:n}){return(0,W.jsx)(f.Root,{open:t,onOpenChange:n,children:(0,W.jsx)(f.Content,{size:`md`,children:(0,W.jsx)(ke,{assistantId:e,onDone:()=>n(!1)})})})}function ke({assistantId:e,onDone:t}){let{t:n}=z(),{available:r,currentModel:i,selectModel:o,selecting:s}=L(e);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(f.Header,{children:[(0,W.jsx)(f.Title,{children:n(`voicePickerModal.title`)}),r&&(0,W.jsx)(f.Description,{children:`Uses Vellum credits, through providers like ElevenLabs and Deepgram.`})]}),(0,W.jsx)(f.Body,{children:(0,W.jsx)(v,{assistantId:e,filterBySource:!0,value:i,onChange:o,autoScrollToSelected:!0})}),(0,W.jsxs)(f.Footer,{className:`items-center justify-between gap-3`,children:[(0,W.jsx)(le,{}),(0,W.jsx)(a,{variant:`primary`,onClick:t,disabled:s,className:`shrink-0`,children:n(`voicePickerModal.done`)})]})]})}function Ae(){let{t:e}=z(`settings`),t=P(),{available:n,settled:r,voices:i,currentModel:o}=L(t),s=i.find(e=>e.model===o)??i[0],[c,l]=(0,U.useState)(!1),u=x.use.name(),d=u?e(`voicePickerCard.titleWithName`,{name:u}):e(`voicePickerCard.title`);return r?n&&s?(0,W.jsxs)(H,{title:d,subtitle:e(`voicePickerCard.creditsNote`),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(A,{description:s.description,className:`min-w-0 text-body-medium-lighter text-[var(--content-default)]`}),(0,W.jsx)(a,{variant:`outlined`,onClick:()=>l(!0),className:`shrink-0`,children:e(`voicePickerCard.changeButton`)})]}),(0,W.jsx)(Oe,{assistantId:t,open:c,onOpenChange:l})]}):(0,W.jsx)(H,{title:d,children:(0,W.jsx)(ee,{})}):(0,W.jsx)(H,{title:d,children:(0,W.jsx)(fe,{as:`span`,role:`status`,"aria-label":e(`voicePickerCard.loadingAria`),className:`block h-9 w-48`})})}var je=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],Me=`We recommend keeping both off to start. It feels more like a real conversation.`;function Ne(){let{t:e}=z();return(0,W.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:e(`voiceTranscriptToggles.recommendedOff`)})}function Pe({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,W.jsx)(Ne,{}):null]}),t?(0,W.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,W.jsx)(I,{checked:r,onChange:i,"aria-label":e})]})}function Fe({showDescription:e=!1,showRecommendedBadge:t=!1}){let{t:n}=z(),r=m.use.showUserTranscript(),i=m.use.showAssistantTranscript(),a=m.use.setShowUserTranscript(),o=m.use.setShowAssistantTranscript(),s={showUserTranscript:{checked:r,onChange:a},showAssistantTranscript:{checked:i,onChange:o}},c=(e,t)=>n(e===`showUserTranscript`?`voiceTranscriptToggles.userTranscriptLabel`:`voiceTranscriptToggles.assistantTranscriptLabel`,t),l=(e,t)=>n(e===`showUserTranscript`?`voiceTranscriptToggles.userTranscriptDescription`:`voiceTranscriptToggles.assistantTranscriptDescription`,t);return(0,W.jsx)(W.Fragment,{children:je.map(n=>{let r=s[n.prefKey];return(0,W.jsx)(Pe,{label:c(n.prefKey,n.label),description:e?l(n.prefKey,n.description):void 0,showBadge:t,checked:r.checked,onChange:r.onChange},n.prefKey)})})}var X=`text-body-small-default text-[var(--content-tertiary)]`;function Ie(){let[e]=he(),t=e.get(`tab`);return t===`sounds`?(0,W.jsx)(B,{replace:!0,to:M.settings.sounds}):t===`services`?(0,W.jsx)(B,{replace:!0,to:M.settings.ai}):(0,W.jsx)(Le,{})}function Le(){let{t:e}=z(`settings`);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,W.jsxs)(Z,{heading:e(`voicePage.sectionOutputHeading`),description:e(`voicePage.sectionOutputDescription`),children:[(0,W.jsx)(Ae,{}),(0,W.jsx)(Re,{})]}),(0,W.jsxs)(Z,{heading:e(`voicePage.sectionInputHeading`),description:e(`voicePage.sectionInputDescription`),children:[(0,W.jsx)(Be,{}),(0,W.jsx)(Se,{}),C()?(0,W.jsx)(De,{}):(0,W.jsx)(Ue,{}),(0,W.jsx)(We,{})]}),(0,W.jsx)(Z,{heading:e(`voicePage.sectionCaptionsHeading`),children:(0,W.jsx)(ze,{})})]})}function Re(){let{t:e}=z(`settings`),{available:t}=L(P());return t?(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-1 text-body-small-lighter text-[var(--content-tertiary)]`,children:[(0,W.jsx)(V,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-quiet)]`}),(0,W.jsx)(`span`,{children:e(`voicePage.speechServicesBannerPrompt`)}),(0,W.jsxs)(ge,{to:`${M.settings.ai}#text-to-speech`,className:n(ae({tone:`quiet`}),`inline-flex items-center gap-1 text-[var(--content-secondary)] decoration-[var(--border-element)] underline-offset-2`),children:[e(`voicePage.speechServicesBannerLink`),(0,W.jsx)(ye,{className:`h-3 w-3`})]})]}):null}function Z({heading:e,description:t,children:n}){return(0,W.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`h2`,{className:`text-label-medium-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t&&(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:t})]}),n]})}function ze(){let{t:e}=z(`settings`);return(0,W.jsx)(H,{title:e(`voicePage.captionsTitle`),subtitle:e(`voicePage.captionsSubtitle`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(Fe,{showDescription:!0}),(0,W.jsx)(`p`,{className:`${X} pt-1`,children:e(`voicePage.captionsRecommendation`,Me)})]})})}var Q=``;function Be(){let{t:e}=z(`settings`),[t,n]=(0,U.useState)([]),[r,i]=(0,U.useState)(!1),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(()=>u()),d=(0,U.useCallback)(async()=>{if(!navigator.mediaDevices?.enumerateDevices)return;let e=await h();i(e.needsPermission),n(e.devices),s(e.known)},[]),f=(0,U.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}d()},[d]);(0,U.useEffect)(()=>{d();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void d();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[d]);let p=(0,U.useMemo)(()=>{let n=t.map((t,n)=>({value:t.deviceId,label:t.label||e(`voicePage.microphoneFallbackLabel`,{index:n+1})})),r=c!==Q&&!n.some(e=>e.value===c);return[{value:null,label:e(`voicePage.systemDefault`)},...n,...r?[{value:c,label:e(o?`voicePage.savedMicrophoneNotConnected`:`voicePage.savedMicrophone`)}]:[]]},[t,c,o,e]),m=(0,U.useCallback)(e=>{l(e),y(e)},[]);(0,U.useEffect)(()=>pe(()=>{l(u())}),[]);let g=c===Q?null:c;return(0,W.jsx)(H,{title:e(`voicePage.microphoneTitle`),subtitle:e(`voicePage.microphoneSubtitle`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`div`,{className:`max-w-xs`,children:(0,W.jsx)(E,{options:p,value:g,onChange:m,onSelectNone:()=>m(Q),"aria-label":e(`voicePage.microphoneAriaLabel`)})}),r&&(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(a,{variant:`outlined`,onClick:f,children:e(`voicePage.allowMicrophoneAccess`)}),(0,W.jsx)(`span`,{className:X,children:e(`voicePage.grantMicrophoneAccessHint`)})]})]})})}var Ve=new Set([`Control`,`Alt`,`Shift`,`Meta`]),$=`toggleVoice`,He=[{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}}];function Ue(){let{t:e}=z(`settings`),t=ue(),[n,r]=(0,U.useState)(()=>w()),[i,a]=(0,U.useState)(!1),[o,s]=(0,U.useState)([]),[u,d]=(0,U.useState)(!1),f=(0,U.useRef)(null),p=(0,U.useMemo)(()=>{let e=l();return[{label:ce(e),activator:e}]},[]),m=n.kind!==`off`,h=(0,U.useCallback)(e=>{r(e),c(e),a(!1),s([]),d(!1)},[]),g=xe({onBound:()=>h({kind:`off`})}),_=g.catalog.find(e=>e.key===$)?.accelerator??``,v=g.recordingKey===$,y=D()?He:[],b=(0,U.useCallback)(e=>{h(e),g.removeHotkey($)},[g,h]),x=(0,U.useCallback)(()=>{h({kind:`off`}),g.removeHotkey($)},[g,h]),C=(0,U.useCallback)(()=>{a(!0),s([]),d(!1),requestAnimationFrame(()=>{f.current?.focus()})},[]),E=(0,U.useCallback)(()=>{a(!1),s([]),d(!1)},[]),O=(0,U.useCallback)(e=>{let t=[];return e.ctrlKey&&t.push(`control`),e.altKey&&t.push(`option`),e.shiftKey&&t.push(`shift`),e.metaKey&&t.push(`command`),t},[]),k=(0,U.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){E();return}let t=O(e);if(Ve.has(e.key)){d(!1),s(F(t));return}if(t.length===0){d(!0);return}h({kind:`key`,label:e.key.length===1?e.key.toUpperCase():e.key,modifiers:F(t)})},[E,O,h]),A=(0,U.useCallback)(e=>{i&&O(e).length===0&&o.length>0&&(s([]),d(!0))},[O,i,o]);(0,U.useEffect)(()=>{if(!i)return;let e=e=>{f.current&&!f.current.contains(e.target)&&E()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[E,i]);let M=m&&!p.some(e=>N(e.activator,n));return t?(0,W.jsx)(H,{title:e(`voicePage.voiceShortcutTitle`),subtitle:e(`voicePage.voiceShortcutSubtitleDesktop`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[y.map(e=>(0,W.jsx)(G,{label:e.label,selected:N(e.activator,n),onClick:()=>b(e.activator)},e.label)),(0,W.jsx)(G,{label:v?e(`voicePage.recordingPrompt`):_?(0,W.jsx)(S,{accelerator:_}):e(`voicePage.customKey`),selected:_!==``,recording:v,onClick:v?g.stopRecording:()=>g.startRecording($)}),(0,W.jsx)(G,{label:e(`voicePage.offKeyLabel`),selected:n.kind===`off`&&!_&&!v,onClick:x})]}),g.conflict?.key===$&&(0,W.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voicePage.shortcutConflict`,{command:g.conflict.label})})]})]})}):(0,W.jsx)(H,{title:e(`voicePage.voiceShortcutTitle`),subtitle:e(`voicePage.voiceShortcutSubtitle`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsx)(I,{checked:m,onChange:e=>{h(e?T():{kind:`off`})},label:e(`voicePage.enableVoiceShortcut`)}),m&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(`span`,{className:X,children:e(`voicePage.activationKeyLabel`)}),(0,W.jsxs)(`div`,{ref:f,tabIndex:i?0:-1,onKeyDown:i?k:void 0,onKeyUp:i?A:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[p.map(e=>(0,W.jsx)(G,{label:e.label,selected:N(e.activator,n),onClick:()=>h(e.activator)},e.label)),i?(0,W.jsx)(G,{label:o.length>0?j(o):e(`voicePage.pressShortcut`),selected:!0,recording:!0,onClick:E}):(0,W.jsx)(G,{label:M?ce(n):e(`voicePage.customKey`),selected:M,onClick:C})]}),u&&(0,W.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voicePage.shortcutChordHint`)})]}),m&&(0,W.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-lighter text-[var(--content-quiet)]`,children:[(0,W.jsx)(V,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,W.jsx)(`span`,{children:e(`voicePage.focusedTabNote`)})]})]})]})})}function We(){let{t:e}=z(`settings`),t=m.use.pauseBeforeReplyMs(),n=m.use.setPauseBeforeReplyMs(),r=m.use.interruptSensitivity(),i=m.use.setInterruptSensitivity(),o=(0,U.useMemo)(()=>[{value:`low`,label:e(`voicePage.interruptSensitivityLow`)},{value:`medium`,label:e(`voicePage.interruptSensitivityMedium`)},{value:`high`,label:e(`voicePage.interruptSensitivityHigh`)}],[e]),c=t!==null||r!==null;return(0,W.jsx)(H,{title:e(`voicePage.turnTakingTitle`),subtitle:e(`voicePage.turnTakingSubtitle`),children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,W.jsx)(Te,{}),(0,W.jsx)(Ge,{label:e(`voicePage.pauseBeforeReplyLabel`),description:e(`voicePage.pauseBeforeReplyDescription`),isDefault:t===null,children:(0,W.jsx)(`div`,{className:`max-w-xs`,children:(0,W.jsx)(k,{value:(t??1200)/1e3,onValueChange:e=>{typeof e==`number`&&n(Math.round(e*1e3))},min:500/1e3,max:s/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":e(`voicePage.pauseBeforeReplyAriaLabel`)})})}),(0,W.jsx)(Ge,{label:e(`voicePage.interruptSensitivityLabel`),description:e(`voicePage.interruptSensitivityDescription`),isDefault:r===null,children:(0,W.jsx)(`div`,{className:`max-w-xs`,children:(0,W.jsx)(O,{items:o,value:r??`medium`,onChange:i,ariaLabel:e(`voicePage.interruptSensitivityAriaLabel`)})})}),c&&(0,W.jsx)(`div`,{children:(0,W.jsx)(a,{variant:`outlined`,onClick:()=>{n(null),i(null)},children:e(`voicePage.resetToDefaults`)})})]})})}function Ge({label:e,description:t,isDefault:n,children:r}){let{t:i}=z(`settings`);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),n&&(0,W.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:i(`voicePage.defaultBadge`)})]}),(0,W.jsx)(`p`,{className:X,children:t}),r]})}export{Ie as VoicePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Dn as e,On as t,qn as n}from"./app-
|
|
1
|
+
import{Dn as e,On as t,qn as n}from"./app-Qc-rYPt9.js";import{j as r}from"./vendor-DEhKVoiV.js";import{t as i}from"./react-B9IgSVeK.js";import{$ as a}from"./icons-C0wyat6T.js";var o=i();function s({payload:e,onClose:i}){let{t:s}=r(`chat`),u=t(e.body);return(0,o.jsx)(n,{Glyph:a,title:e.title||s(`wakeDetailPanel.title`),closeLabel:s(`wakeDetailPanel.closeAria`),closeVariant:`outlined`,onClose:i,children:(0,o.jsxs)(`dl`,{className:`flex flex-col gap-6`,children:[u.workflow&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.workflow`),children:u.workflow}),u.runStatus&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.runStatus`),children:(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:u.runStatus})}),u.result&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.result`),children:(0,o.jsx)(c,{result:u.result})}),u.rest&&(0,o.jsx)(l,{label:s(`wakeDetailPanel.details`),children:(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:u.rest})}),e.metadata.length>0&&(0,o.jsx)(`div`,{className:`flex flex-col gap-6`,children:e.metadata.map(e=>(0,o.jsx)(l,{label:e.label,children:e.value},e.label))})]})})}function c({result:t}){let n=e(t);return n?(0,o.jsx)(`div`,{className:`flex flex-col gap-4`,children:n.map((e,t)=>(0,o.jsx)(`div`,{className:t>0?`flex flex-col gap-2 border-t border-[var(--border-hover)] pt-4`:`flex flex-col gap-2`,children:e.map(e=>(0,o.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,o.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:e.key}),(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:e.value})]},e.key))},t))}):(0,o.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:t})}function l({label:e,children:t}){return(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`dt`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:e}),(0,o.jsx)(`dd`,{className:`text-body-medium-default text-[var(--content-default)]`,children:t})]})}export{s as WakeDetailPanel};
|