@vellumai/web 0.12.5-staging.2 → 0.12.5-staging.3
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-2n6gRbID.js → a2a-invite-2DFcr5cK.js} +1 -1
- package/dist/assets/{about-page-N1N2ME9b.js → about-page-CPNBbifd.js} +1 -1
- package/dist/assets/{account-page-DOnTpuZ-.js → account-page-CJ_VtU8O.js} +1 -1
- package/dist/assets/{account-shell-CDePfCVi.js → account-shell-DxLEvbei.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-B3R4i5mk.js → acp-run-detail-panel-CB_kEsnS.js} +1 -1
- package/dist/assets/{activation-list-route-CHvtTpMz.js → activation-list-route-CGW4JxwN.js} +1 -1
- package/dist/assets/{activity-redirect-page-CTTRdkxc.js → activity-redirect-page-BIjoWTCA.js} +1 -1
- package/dist/assets/{activity-steps-panel-DR0Y2oZk.js → activity-steps-panel-DMQrQxtA.js} +1 -1
- package/dist/assets/add-credits-modal-Dv7XHwyy.js +1 -0
- package/dist/assets/{add-credits-modal-Bf3UIKWo.js → add-credits-modal-LuPOq4kF.js} +1 -1
- package/dist/assets/{ai-page-nn0k_IIb.js → ai-page-BYnMIWGK.js} +1 -1
- package/dist/assets/{all-chats-page-route-CPhckAtu.js → all-chats-page-route-nS138Vap.js} +1 -1
- package/dist/assets/{android-billing-handoff-Bdbyo5OG.js → android-billing-handoff-Q1a-ZHj3.js} +1 -1
- package/dist/assets/{animated-stat-square-C1mgqXq8.js → animated-stat-square--YG74D1T.js} +1 -1
- package/dist/assets/{api-key-screen-BRkuexDs.js → api-key-screen-CYEJaUQl.js} +1 -1
- package/dist/assets/app-Dy5YEvtr.css +2 -0
- package/dist/assets/{app-g1TvV-Dl.js → app-XG_RF2yi.js} +55 -55
- package/dist/assets/{app-info-R4Y_BPoT.js → app-info-zQFV6PZi.js} +1 -1
- package/dist/assets/{archive-redirect-page-Cb4LdH50.js → archive-redirect-page-DQbvA1Z-.js} +1 -1
- package/dist/assets/{assistant-handle-modal-BQBleuWg.js → assistant-handle-modal-CbatcZHT.js} +1 -1
- package/dist/assets/{assistant-inbox-page-route-CWQiF8gx.js → assistant-inbox-page-route-CxI0ViyX.js} +1 -1
- package/dist/assets/{assistant-inbox-upgrade-body-D3qYrXZU.js → assistant-inbox-upgrade-body-UUuOySwQ.js} +1 -1
- package/dist/assets/{assistant-status-panel-Dz8eNfbE.js → assistant-status-panel-Db_tR-He.js} +1 -1
- package/dist/assets/auth-store-CpGZaJMT.js +1 -0
- package/dist/assets/{auth-welcome-screen-CYoMdZVW.js → auth-welcome-screen-CCmw8K2q.js} +1 -1
- package/dist/assets/avatar-bundled-components-BOhrT2YY.js +1 -0
- package/dist/assets/{avatar-random-7_b8sN9c.js → avatar-random-ChM4pm8c.js} +2 -2
- package/dist/assets/{await-org-header-settled-BaNRynwI.js → await-org-header-settled-D7gXGNkp.js} +1 -1
- package/dist/assets/{background-task-detail-panel-DyQHMRcX.js → background-task-detail-panel-BfpAZAV7.js} +1 -1
- package/dist/assets/billing-page-D4Aw0uK5.js +3 -0
- package/dist/assets/{billing-redirect-page-DisLOg_5.js → billing-redirect-page-CPoe8Fxo.js} +1 -1
- package/dist/assets/{bookmarks-page-CaKBt1k4.js → bookmarks-page-DabizPXt.js} +1 -1
- package/dist/assets/{bundle-confirm-page-W2r6YW2S.js → bundle-confirm-page--s00f5SK.js} +1 -1
- package/dist/assets/{channel-transcript-panel-DjZfVDU6.js → channel-transcript-panel-kIskgOQO.js} +1 -1
- package/dist/assets/{channels-page-route-fjQyOftI.js → channels-page-route-DBYtimrU.js} +1 -1
- package/dist/assets/{chat-info-panel-CQwSB97L.js → chat-info-panel-C8-aLnsR.js} +1 -1
- package/dist/assets/{checkout-continuation-CGCnWbzu.js → checkout-continuation-DV6qqLmB.js} +1 -1
- package/dist/assets/{checkout-page-DoYMFyd4.js → checkout-page-CDszxDKy.js} +1 -1
- package/dist/assets/checkout-return-target-kOAtAdtD.js +1 -0
- package/dist/assets/{command-palette-D0KYxCnU.js → command-palette-CvSDYYKx.js} +1 -1
- package/dist/assets/{command-palette-window-page-BTVDAM95.js → command-palette-window-page-vfJ8M15E.js} +1 -1
- package/dist/assets/command-palette-xzqumNt2.js +1 -0
- package/dist/assets/{community-page--2IpZpKw.js → community-page-Dnrsh7JC.js} +1 -1
- package/dist/assets/{companion-accent-CBLb9Kpv.js → companion-accent-CbS8BVae.js} +1 -1
- package/dist/assets/{companion-dock-zones-page-DxuMrFf9.js → companion-dock-zones-page-CRsK4Pv9.js} +1 -1
- package/dist/assets/{companion-layout-C6tp_Wvl.js → companion-layout-DCGXuvsw.js} +1 -1
- package/dist/assets/{companion-popover-B7KpH4N8.js → companion-popover-BsoxqJOP.js} +1 -1
- package/dist/assets/{companion-popover-page-YQKBZlNX.js → companion-popover-page-B-tbPgw2.js} +1 -1
- package/dist/assets/{companion-surface-DM4lsh7V.js → companion-surface-Lu_Uj_QW.js} +1 -1
- package/dist/assets/{companion-surface-page-BvvOIZO_.js → companion-surface-page-Cu5KYGHm.js} +1 -1
- package/dist/assets/{companion-tour-entry-BBJtal5R.js → companion-tour-entry-C3txdrPi.js} +1 -1
- package/dist/assets/{companion-watch-frame-page-D_cml_5E.js → companion-watch-frame-page-CxWQHVyd.js} +1 -1
- package/dist/assets/{connect-page-De9qYGFr.js → connect-page-BnIPLsIl.js} +1 -1
- package/dist/assets/{consent-controls-gxLFaZqC.js → consent-controls-CzokWb_V.js} +1 -1
- package/dist/assets/{contacts-gateway-xRhaWZVq.js → contacts-gateway-CXKsci-d.js} +1 -1
- package/dist/assets/{contacts-page-route-DuAdAqXe.js → contacts-page-route-rxGvMBYc.js} +1 -1
- package/dist/assets/{copy-button-DUDzh1nb.js → copy-button-CDraE4Q7.js} +1 -1
- package/dist/assets/{credential-entry-page-DMfgwRck.js → credential-entry-page-CISniD8g.js} +1 -1
- package/dist/assets/{credentials-page-CMgmkOGd.js → credentials-page-CY8AWXDI.js} +1 -1
- package/dist/assets/{csv-preview-CQY-2Dx9.js → csv-preview-CIYuh6hO.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-yy5xW0mL.js → danger-zone-redirect-page-CvReBloK.js} +1 -1
- package/dist/assets/{debug-page-BU3-JUrT.js → debug-page-Bi_rgZ5l.js} +1 -1
- package/dist/assets/deploy-dialogs-C2piFvJp.js +1 -0
- package/dist/assets/{deploy-dialogs-Daud7Ibu.js → deploy-dialogs-HsxdyBbf.js} +1 -1
- package/dist/assets/{desktop-preview-content-Cg0mJFW9.js → desktop-preview-content-CV1cf7mU.js} +2 -2
- package/dist/assets/{desktop-status-DGbF0l_T.js → desktop-status-DEExfNSz.js} +1 -1
- package/dist/assets/{desktop-viewer-ClERTjPw.js → desktop-viewer-D7Wghl4J.js} +1 -1
- package/dist/assets/{detail-card-uV-Fvv0m.js → detail-card-C7tTQwmv.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-CpIFrlAa.js → detail-panel-stop-button-DnqOX8hL.js} +1 -1
- package/dist/assets/{detail-primitives-BVAXXLTM.js → detail-primitives-wlzeidYY.js} +1 -1
- package/dist/assets/{developer-page-C2US1ngx.js → developer-page-BCRjXz1c.js} +1 -1
- package/dist/assets/{devices-redirect-page-C6LAvhsi.js → devices-redirect-page-7ye90eAr.js} +1 -1
- package/dist/assets/{dictation-overlay-page-4Ws_3jMt.js → dictation-overlay-page-DOBCTXi_.js} +1 -1
- package/dist/assets/{document-load-Bc7bzEgK.js → document-load-C2pkXMId.js} +1 -1
- package/dist/assets/document-load-D-wTWGym.js +1 -0
- package/dist/assets/{document-viewer-page-rYlc99qC.js → document-viewer-page-DOzOlaOx.js} +1 -1
- package/dist/assets/{emails-page-BoKSj0Bi.js → emails-page-BcGsKx08.js} +1 -1
- package/dist/assets/{file-diff-view-D4vpp28T.js → file-diff-view-Cl9aJla4.js} +1 -1
- package/dist/assets/{file-view-mode-CFTpeJXr.js → file-view-mode-B1UgDONH.js} +1 -1
- package/dist/assets/{general-page-CCuGQaED.js → general-page-D5BxF2Og.js} +1 -1
- package/dist/assets/{hatching-screen-DlG-aMJX.js → hatching-screen-6FiOHAnm.js} +1 -1
- package/dist/assets/{hosting-screen-COVzfBVx.js → hosting-screen-CYbWPSH7.js} +1 -1
- package/dist/assets/{identity-page-route-9SdenOmX.js → identity-page-route-B7hLB4vt.js} +1 -1
- package/dist/assets/{inspect-page-9FD0Y4Wu.js → inspect-page-Q3Uns0YC.js} +3 -3
- package/dist/assets/{integrations-page-CXrP8dj3.js → integrations-page-C--xdzQF.js} +1 -1
- package/dist/assets/{intelligence-layout-_R-R-8WX.js → intelligence-layout-5NiOjPJY.js} +1 -1
- package/dist/assets/{intelligence-layout-slots-store-DfpF-AiU.js → intelligence-layout-slots-store-DTzofJ6x.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-redirect-page-CD21JSvn.js → keyboard-shortcuts-redirect-page-BXubnemT.js} +1 -1
- package/dist/assets/{latest-assistant-text-D5_fKeDo.js → latest-assistant-text-C5_QcZxG.js} +1 -1
- package/dist/assets/{library-detail-page-DG-7BXZ4.js → library-detail-page-lz31jiv2.js} +1 -1
- package/dist/assets/{library-page-DRUkvK5M.js → library-page-Cqt_PX2Z.js} +1 -1
- package/dist/assets/local-mode-BdKYdq-q.js +1 -0
- package/dist/assets/{login-page-BqaYnqWg.js → login-page-BcSmXRpH.js} +1 -1
- package/dist/assets/{logout-page-C6QRRvol.js → logout-page-BiLyA8KS.js} +1 -1
- package/dist/assets/{logs-layout-CgZTvfsn.js → logs-layout-DtEdDxuo.js} +1 -1
- package/dist/assets/{markdown-preview-CjIFQp7z.js → markdown-preview-BZ0peNgQ.js} +1 -1
- package/dist/assets/{media-preview-CQ5_mth7.js → media-preview-WLwNLylQ.js} +1 -1
- package/dist/assets/{memory-page-route-CMctq-2Y.js → memory-page-route-ULkaZxE1.js} +1 -1
- package/dist/assets/{memory-router-playground-page-dreB6wRu.js → memory-router-playground-page-BW7vZW_9.js} +1 -1
- package/dist/assets/{message-files-panel-CDRctrdn.js → message-files-panel-CjeAStji.js} +1 -1
- package/dist/assets/native-attachment-pickers-DyuoT-EL.js +1 -0
- package/dist/assets/native-file-xbQpY6mL.js +1 -0
- package/dist/assets/{notifications-page-u4JixJTc.js → notifications-page-CJRzep02.js} +1 -1
- package/dist/assets/{oauth-complete-page-C9Yh4aN1.js → oauth-complete-page-ocdI_rC8.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-T4U79Q12.js → oauth-popup-complete-page-HK8d4Spc.js} +1 -1
- package/dist/assets/paired-platform-identity-BPPyfzDM.js +1 -0
- package/dist/assets/{pairing-page-CmjjyJSK.js → pairing-page-DnBwkmV0.js} +1 -1
- package/dist/assets/password-reset-page-B6LfA1PC.js +1 -0
- package/dist/assets/{pdf-file-preview-BV59QVcL.js → pdf-file-preview-BICwIHq3.js} +1 -1
- package/dist/assets/{permission-guide-page-Zb7kuXV2.js → permission-guide-page-z6AAkvY2.js} +1 -1
- package/dist/assets/{permission-setup-D8C_-pLn.js → permission-setup-DQzKLhBn.js} +1 -1
- package/dist/assets/{personality-page-Bl2WDg64.js → personality-page-CKLYnk7H.js} +1 -1
- package/dist/assets/{personality-page-Cl6IWyFN.js → personality-page-CzJKC8lv.js} +1 -1
- package/dist/assets/{personality-sliders-CHGQlasL.js → personality-sliders-Dd3JGL5I.js} +1 -1
- package/dist/assets/{plans-page-CX_DS3pd.js → plans-page-DDs81rnq.js} +1 -1
- package/dist/assets/{platform-loopback-page-BbAZA0xo.js → platform-loopback-page-BC5gtTbI.js} +1 -1
- package/dist/assets/{plugin-detail-page-Y171rg5Z.js → plugin-detail-page-Dre4KSYH.js} +1 -1
- package/dist/assets/{plugins-page-7JFDRd3d.js → plugins-page-BJhR5JYi.js} +1 -1
- package/dist/assets/plugins-surface-B99o65kn.js +1 -0
- package/dist/assets/{preview-error-DRiLBVjC.js → preview-error-BSpmr-KH.js} +1 -1
- package/dist/assets/{privacy-page-BbzNYunu.js → privacy-page-BUf0Wrj1.js} +1 -1
- package/dist/assets/{privacy-screen-DRWTgt4o.js → privacy-screen-CRkWqj_4.js} +1 -1
- package/dist/assets/{profile-card-BUk3o7SO.js → profile-card-BDi2Aa7O.js} +1 -1
- package/dist/assets/{provider-callback-page-4eckbJpB.js → provider-callback-page-xSMG5fuv.js} +1 -1
- package/dist/assets/{provider-key-CJJJNyHJ.js → provider-key-CY2sGv7V.js} +1 -1
- package/dist/assets/{provider-signup-page-DEgiOj-f.js → provider-signup-page-CYvh6GNB.js} +1 -1
- package/dist/assets/{quick-input-page-DaqK2hi0.js → quick-input-page-Lfrb-P2b.js} +1 -1
- package/dist/assets/referral-modal--kTnJAWn.js +1 -0
- package/dist/assets/{referral-modal-IFQp20cn.js → referral-modal-Bk5N1oeX.js} +1 -1
- package/dist/assets/{research-mock-page-C9fb3mU6.js → research-mock-page-BdpSM2ZV.js} +1 -1
- package/dist/assets/{research-onboarding-route-Cm8d8gDB.js → research-onboarding-route-DLbIS8Fh.js} +1 -1
- package/dist/assets/{review-terms-screen-DMQInhYK.js → review-terms-screen-DXYmPnS3.js} +1 -1
- package/dist/assets/routes-CJexmSc5.js +1 -0
- package/dist/assets/{schedules--58e813j.js → schedules-B_xQSD0K.js} +1 -1
- package/dist/assets/{schedules-page-B6cSKNVA.js → schedules-page--mjVQq8F.js} +1 -1
- package/dist/assets/{security-redirect-page-BP_ofq6j.js → security-redirect-page-CJJqdMen.js} +1 -1
- package/dist/assets/{select-assistant-screen-BG3K7gmK.js → select-assistant-screen-CWrLBgEC.js} +1 -1
- package/dist/assets/{self-hosted-servers-BWwS6drJ.js → self-hosted-servers-ByTPcaPx.js} +1 -1
- package/dist/assets/{service-form-controls-DdqTR20W.js → service-form-controls-DtPD00wU.js} +1 -1
- package/dist/assets/{setting-row-DUPI2E5K.js → setting-row-CaZDTGD2.js} +1 -1
- package/dist/assets/settings-CF0G96O8.js +3 -0
- package/dist/assets/settings-D9aUsORh.js +3 -0
- package/dist/assets/{settings-Bxxp6jKc.js → settings-XqI4_biG.js} +1 -1
- package/dist/assets/{settings-layout-Bwhzzkgd.js → settings-layout-DNdADVFk.js} +1 -1
- package/dist/assets/{settings-B267Hpr6.js → settings-ooHvceam.js} +1 -1
- package/dist/assets/{share-feedback-modal-dOu0B-Md.js → share-feedback-modal-BcKnGtHL.js} +1 -1
- package/dist/assets/share-feedback-modal-DF6Y_Ddr.js +1 -0
- package/dist/assets/{sidebar-tree-EIcBry0H.js → sidebar-tree-BTeywUnh.js} +1 -1
- package/dist/assets/{signup-page-iMX6V56Q.js → signup-page-C3giBlX2.js} +1 -1
- package/dist/assets/{signup-shell-DE0anhe6.js → signup-shell-GSIPLhaj.js} +1 -1
- package/dist/assets/{skill-detail-page-DY4PImw4.js → skill-detail-page-Deqf_hR_.js} +1 -1
- package/dist/assets/{skill-detail-panel-C5ehfnq7.js → skill-detail-panel-Dxor1hrH.js} +1 -1
- package/dist/assets/{skill-removal-dialog-BUKv2Tas.js → skill-removal-dialog-BT--h1By.js} +1 -1
- package/dist/assets/{skills-page-D0nQMb4s.js → skills-page-KhBWpqn3.js} +1 -1
- package/dist/assets/{sounds-page-BHxwlTqF.js → sounds-page-DTRSATq6.js} +1 -1
- package/dist/assets/{start-screen-BNWpr3jU.js → start-screen-xL6YeEfA.js} +1 -1
- package/dist/assets/{step-detail-header-B4fNZIZg.js → step-detail-header-q2pswG-E.js} +1 -1
- package/dist/assets/{stt-language-picker-modal-DfBKJmLh.js → stt-language-picker-modal-oMpmGSKQ.js} +1 -1
- package/dist/assets/{subagent-detail-panel-ByW7jl3W.js → subagent-detail-panel-BbfzXdX1.js} +1 -1
- package/dist/assets/{superpowers-page-D_RuLpvG.js → superpowers-page-Bew1AAic.js} +1 -1
- package/dist/assets/{system-events-page-C7X57xA5.js → system-events-page-CyvA59Rb.js} +1 -1
- package/dist/assets/{system-events-redirect-page-CTGlRdMz.js → system-events-redirect-page-BlGZqWyR.js} +1 -1
- package/dist/assets/{teleport-gateway-client-B-Ymh7N4.js → teleport-gateway-client-ZoYt4yRw.js} +1 -1
- package/dist/assets/{text-preview-DXRIEUbr.js → text-preview-C4goqoCR.js} +1 -1
- package/dist/assets/{theme-stage-page-T1E0J2aJ.js → theme-stage-page-wBctgsW9.js} +1 -1
- package/dist/assets/{tiptap-document-editor-DqmlydKI.js → tiptap-document-editor-9k3KCMGt.js} +1 -1
- package/dist/assets/tool-detail-panel-BXJOMwEr.js +1 -0
- package/dist/assets/{tool-detail-panel-Cy_HQVT-.js → tool-detail-panel-D3kcmDuC.js} +1 -1
- package/dist/assets/{trait-cycle-row-BNqcZU0H.js → trait-cycle-row-Bj1z4vx9.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-BH0iigJ_.js → upgrade-cancel-page-B8aHpJFd.js} +1 -1
- package/dist/assets/{upgrade-success-page-CQTTbbGB.js → upgrade-success-page-Dj6egC1G.js} +1 -1
- package/dist/assets/{usage-redirect-page-4wBYE6Hz.js → usage-redirect-page-Cc7zOqgH.js} +1 -1
- package/dist/assets/{use-app-delete-BqUAzWOi.js → use-app-delete-S-DdyUwn.js} +1 -1
- package/dist/assets/{use-assistant-identity-details-DsO3-hL9.js → use-assistant-identity-details-DT3Hy4pf.js} +1 -1
- package/dist/assets/{use-checkout-dismiss-refresh-DpbPh5Dv.js → use-checkout-dismiss-refresh-DV7QRuSY.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-C_dV-uDl.js → use-edge-swipe-back-BCvtCYFp.js} +1 -1
- package/dist/assets/{use-hotkey-recorder-DSplqHTv.js → use-hotkey-recorder-BIhIsp-5.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-BbFm0xLB.js → use-invite-link-dialog-DQEUmYHq.js} +1 -1
- package/dist/assets/{use-plugins-list-v7ZdJF5y.js → use-plugins-list-DPWrP6Mv.js} +1 -1
- package/dist/assets/{use-return-to-short-circuit-e_HCiNdS.js → use-return-to-short-circuit-BVGVwuLm.js} +1 -1
- package/dist/assets/{use-side-list-room-CJYjHQez.js → use-side-list-room-DH5gDKs9.js} +1 -1
- package/dist/assets/{use-skill-actions-U5IaZ-Z1.js → use-skill-actions-CMoU5oFT.js} +1 -1
- package/dist/assets/{use-skill-detail-files-B2ECj0iR.js → use-skill-detail-files-19-kefs2.js} +1 -1
- package/dist/assets/use-supports-credentials-settings-Bq2yot1y.js +1 -0
- package/dist/assets/{use-transcript-message-by-id-De7Rp17U.js → use-transcript-message-by-id-KYGOx3D6.js} +1 -1
- package/dist/assets/{voice-page-CUNQ2QJA.js → voice-page-Cuy1oc6q.js} +1 -1
- package/dist/assets/{wake-detail-panel-BouMf1FM.js → wake-detail-panel-B6BImUJo.js} +1 -1
- package/dist/assets/{weather-forecast-display-Ea8cYhbQ.js → weather-forecast-display-BvUd--wf.js} +1 -1
- package/dist/assets/{welcome-screen-Bh45FGdD.js → welcome-screen-CtVGX2aV.js} +1 -1
- package/dist/assets/{workflow-detail-panel-BfplcjXd.js → workflow-detail-panel-DMYrbO29.js} +1 -1
- package/dist/assets/{workspace-page-Cn3iFJgb.js → workspace-page-DPWYRJjr.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/add-credits-modal-CjhPCEo3.js +0 -1
- package/dist/assets/app-hw35VYTL.css +0 -2
- package/dist/assets/auth-store-B_1Y9Uid.js +0 -1
- package/dist/assets/avatar-bundled-components-5UFPY9JK.js +0 -1
- package/dist/assets/billing-page-JaprT6Vv.js +0 -3
- package/dist/assets/checkout-return-target-D5A2Rv1t.js +0 -1
- package/dist/assets/command-palette-Lr-NeDCr.js +0 -1
- package/dist/assets/deploy-dialogs-BaSfIbBO.js +0 -1
- package/dist/assets/document-load-CD-0uWA-.js +0 -1
- package/dist/assets/local-mode-CP6E3D3e.js +0 -1
- package/dist/assets/native-attachment-pickers-DGHZuGbD.js +0 -1
- package/dist/assets/native-file-DxOOIrLm.js +0 -1
- package/dist/assets/paired-platform-identity-X_FlXunr.js +0 -1
- package/dist/assets/password-reset-page-CDmQuW9S.js +0 -1
- package/dist/assets/plugins-surface-DAYezPv6.js +0 -1
- package/dist/assets/referral-modal-8IXUqxso.js +0 -1
- package/dist/assets/routes-CkL6GgBk.js +0 -1
- package/dist/assets/settings-Clb97agh.js +0 -3
- package/dist/assets/settings-o6cuYhH5.js +0 -3
- package/dist/assets/share-feedback-modal-fY8BlOwK.js +0 -1
- package/dist/assets/tool-detail-panel-Dqa39U7-.js +0 -1
- package/dist/assets/use-supports-credentials-settings-CMhSepvQ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,Ur as n,Wr as r,eC as i,gC as a,qg as o,qo as s,wC as c}from"./app-g1TvV-Dl.js";import{E as l,dt as u}from"./vendor-DwMhK7fD.js";import{t as d,x as f}from"./react-B9IgSVeK.js";import{G as p,Ji as m,dr as h,h as g,i as _}from"./icons-C0wyat6T.js";var v=e(f(),1),y=d();function b({label:e,selected:t,onPick:n,trailing:r}){return(0,y.jsxs)(`div`,{role:`option`,"aria-selected":t,className:s(`flex min-h-9 items-center gap-2 rounded-lg px-3 py-1.5 transition-colors`,t?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`),onClick:n,children:[(0,y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:e}),r,t?(0,y.jsx)(m,{"aria-hidden":!0,className:`size-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`})]})}function x({label:e,children:t}){return(0,y.jsx)(c,{className:`-mx-2 min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`flex flex-col`,children:t})})}function S({popover:e,onAnswer:t}){let{t:n}=l();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(x,{label:n(`companionPopover.microphoneTitle`),children:[(0,y.jsx)(b,{label:n(`companionPopover.systemDefault`),selected:e.selected===``,onPick:()=>t?.({kind:`pick`,optionId:``})}),e.options.map(n=>(0,y.jsx)(b,{label:n.label,selected:e.selected===n.id,onPick:()=>t?.({kind:`pick`,optionId:n.id})},n.id))]}),e.needsPermission?(0,y.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`companionPopover.microphonePermissionHint`)}):null]})}function C(){let[e,t]=(0,v.useState)(null),n=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>{n.current?.pause(),n.current=null},[]),{playing:e,play:(e,r)=>{n.current?.pause();let i=new Audio(r);n.current=i,t(e);let a=()=>{n.current===i&&(n.current=null,t(null))};i.onended=a,i.onerror=a,i.play().catch(a)},stop:()=>{n.current?.pause(),n.current=null,t(null)}}}function w({popover:e,onAnswer:n}){let{t:r}=l(),{playing:i,play:a,stop:o}=C();return(0,y.jsx)(x,{label:r(`companionPopover.voiceTitle`),children:e.groups.map(s=>(0,y.jsxs)(`div`,{role:`group`,"aria-label":s.accent,children:[(0,y.jsx)(`div`,{className:`px-3 pt-3 pb-1 text-label-small-default text-[var(--content-tertiary)]`,children:s.accent}),s.voices.map(s=>{let c=i===s.id;return(0,y.jsx)(b,{label:s.isDefault?(0,y.jsxs)(y.Fragment,{children:[s.label,(0,y.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:` ${r(`companionPopover.defaultSuffix`)}`})]}):s.label,selected:e.selected===s.id,onPick:()=>n?.({kind:`pick`,optionId:s.id}),trailing:s.sampleUrl===``?void 0:(0,y.jsx)(t,{variant:`ghost`,size:`compact`,className:`size-7 shrink-0`,iconOnly:c?(0,y.jsx)(p,{}):(0,y.jsx)(g,{}),"aria-label":c?r(`companionPopover.stopPreview`):r(`companionPopover.previewVoice`,{voice:s.label}),onClick:e=>{e.stopPropagation(),c?o():a(s.id,s.sampleUrl)}})},s.id)})]},s.accent))})}var T=e=>/^https?:\/\//i.test(e)||/^data:image\//i.test(e),E=`border border-white/5 bg-[var(--surface-base)] text-[var(--content-default)] shadow-lg shadow-black/40`,D=e=>`radial-gradient(120% 80% at 0% 0%, ${e===void 0?`transparent`:`color-mix(in srgb, ${e} 7%, transparent)`} 0%, transparent 70%), #17181b`;function O({popover:e,view:t,cardRef:n,onAnswer:r,onView:i,onOpenLink:a,accentHex:o,attached:c=!1,className:u,style:d}){let{t:f}=l();return(e.kind===`approvals`||e.kind===`secret`)&&t!==`expanded`?(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:s(`w-max max-w-[640px] rounded-[22px]`,E,u),style:d,children:(0,y.jsx)(k,{popover:e,onAnswer:r,onView:i})}):(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:s(`flex min-h-0 flex-col gap-3 p-4 text-[var(--content-default)]`,!c&&`rounded-[20px] border border-white/10 shadow-2xl shadow-black/50`,e.kind===`approvals`?`w-max max-w-[640px]`:`w-[360px]`,(e.kind===`microphones`||e.kind===`voices`)&&`gap-2 px-4 pb-3`,u),style:c?d:{background:D(o),...d},children:e.kind===`approvals`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(I,{title:f(`companionPopover.needsOkCount`,{count:e.items.length}),onClose:()=>i?.(`deferred`)}),(0,y.jsx)(L,{items:e.items,onAnswer:r})]}):e.kind===`secret`?(0,y.jsx)(R,{popover:e,onAnswer:r,onView:i}):e.kind===`microphones`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(I,{title:f(`companionPopover.microphoneTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(S,{popover:e,onAnswer:r})]}):e.kind===`voices`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(I,{title:f(`companionPopover.voiceTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(w,{popover:e,onAnswer:r})]}):(0,y.jsx)(z,{popover:e,onAnswer:r,onOpenLink:a})})}function k({popover:e,onAnswer:t,onView:n,className:r}){let{t:i}=l(),a=e.kind===`approvals`?e.items[0]:void 0,o=e.kind===`approvals`&&e.items.length===1;return(0,y.jsxs)(`div`,{"data-companion-prompt-row":e.kind,className:s(`flex min-h-11 min-w-0 items-center gap-1.5 py-1.5 pr-1.5 text-[var(--content-default)]`,e.kind===`secret`?`pl-2`:`pl-4`,r),children:[e.kind===`secret`?(0,y.jsx)(U,{providerKey:e.providerKey}):null,(0,y.jsx)(P,{className:`min-w-0 flex-1 text-body-medium-default`,maxWidth:A,text:e.kind===`secret`?e.service===``?i(`companionPopover.needsCredentials`):i(`companionPopover.needsCredentialsFor`,{service:e.service}):o&&a!==void 0?a.title:i(`companionPopover.needsOkCount`,{count:e.items.length})}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-1`,children:o&&a!==void 0?(0,y.jsx)(F,{item:a,pill:!0,onAnswer:t}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(K,{tone:`secondary`,onClick:()=>n?.(`deferred`),children:i(`companionPopover.notNow`)}),(0,y.jsx)(K,{tone:`primary`,onClick:()=>n?.(`expanded`),children:e.kind===`secret`?i(`companionPopover.enter`):i(`companionPopover.review`)})]})})]})}var A=440,j=400;function M(e,t,n){let r=e.trim().split(/\s+/).filter(e=>e!==``),i=r.length;if(i<2||n(r.join(` `))<=t)return[r.join(` `)];let a=r.map(()=>[]);for(let e=0;e<i;e+=1)for(let t=e+1;t<=i;t+=1)a[e][t]=n(r.slice(e,t).join(` `));let o=(e,t)=>r.slice(e,t).join(` `),s=[];for(let e=0;e<i;){let n=e+1;for(;n<i&&a[e][n+1]<=t;)n+=1;s.push(o(e,n)),e=n}if(s.length<2||i>N)return s;let c=e=>{let n=null;for(let r=i-1;r>=e-1;--r){let o=a[r][i];if(o>t&&r!==i-1)continue;let s=new Map;for(let e=1;e<=r;e+=1)a[0][e]<=o&&s.set(`${e}:0`,{cost:(o-a[0][e])**2,breaks:[0]});for(let t=2;t<=e-1;t+=1){let e=new Map;for(let[t,n]of s){let[i,s]=t.split(`:`).map(Number),c=a[s][i];for(let t=i+1;t<=r;t+=1){let r=a[i][t];if(r<c||r>o)continue;let s=n.cost+(o-r)**2,l=`${t}:${i}`,u=e.get(l);(u===void 0||s<u.cost)&&e.set(l,{cost:s,breaks:[...n.breaks,i]})}}s=e}for(let[e,t]of s){let[i,s]=e.split(`:`).map(Number);i!==r||a[s][i]>o||(n===null||t.cost<n.cost)&&(n={cost:t.cost,breaks:[...t.breaks,r]})}}if(n===null)return null;let r=[...n.breaks,i];return n.breaks.map((e,t)=>o(e,r[t+1]))};for(let e=s.length;e<=i;e+=1){let t=c(e);if(t!==null)return t}return s}var N=48;function P({text:e,maxWidth:t,className:n,title:r}){let i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let n=i.current;if(n===null)return;let r=!1,a=()=>{if(r)return;let i=document.createElement(`span`);i.style.cssText=`position:absolute;visibility:hidden;white-space:pre;left:0;top:0`,n.appendChild(i);let a=new Map,s=M(e,t,e=>{let t=a.get(e);if(t!==void 0)return t;i.textContent=e;let n=i.getBoundingClientRect().width;return a.set(e,n),n});i.remove(),o(s.length>1?s:null)};return a(),document.fonts?.addEventListener(`loadingdone`,a),document.fonts?.ready.then(a),()=>{r=!0,document.fonts?.removeEventListener(`loadingdone`,a)}},[e,t]),(0,y.jsx)(`span`,{ref:i,dir:`auto`,className:n,title:r,children:a===null?e:a.map((e,t)=>(0,y.jsxs)(`span`,{className:`block whitespace-nowrap`,children:[e,t<a.length-1?` `:null]},t))})}function F({item:e,pill:n,onAnswer:r}){let{t:i}=l(),a=()=>r?.({kind:`deny`,itemId:e.id}),o=()=>r?.({kind:e.permission===void 0?`allow`:`settings`,itemId:e.id});return n?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(K,{tone:`negative`,onClick:a,children:i(`companionPopover.deny`)}),(0,y.jsx)(K,{tone:`primary`,onClick:o,children:i(`companionPopover.allow`)})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(t,{variant:`dangerOutline`,onClick:a,children:i(`companionPopover.deny`)}),(0,y.jsx)(t,{variant:`primary`,onClick:o,children:i(`companionPopover.allow`)})]})}function I({title:e,icon:n,emphasis:r=!1,onClose:i}){let{t:a}=l();return(0,y.jsxs)(`div`,{className:`-mt-0.5 -mr-1.5 flex min-h-7 items-center gap-2`,children:[n,(0,y.jsx)(`p`,{dir:`auto`,className:s(`min-w-0 flex-1`,r?`text-title-small leading-snug`:`text-body-small-default text-[var(--content-tertiary)] select-none`),children:e}),(0,y.jsx)(t,{variant:`ghost`,className:`size-7 rounded-lg px-0`,"aria-label":a(`companionPopover.dismiss`),iconOnly:(0,y.jsx)(_,{className:`size-4`,strokeWidth:2}),onClick:i})]})}function L({items:e,onAnswer:t}){return(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,n)=>(0,y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-[var(--surface-lift)] text-body-medium-default text-[var(--content-tertiary)]`,children:n+1}),(0,y.jsx)(P,{className:`min-w-0 flex-1 pl-1 text-body-medium-default`,maxWidth:j,title:e.detail===``?void 0:e.detail,text:e.title}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-2`,children:(0,y.jsx)(F,{item:e,pill:!1,onAnswer:t})})]},e.id))})})}function R({popover:e,onAnswer:n,onView:r}){let{t:i}=l(),[s,u]=(0,v.useState)(``),d=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=()=>{d.current?.focus()};return e(),window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[]),(0,y.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),s!==``&&n?.({kind:`secret`,value:s})},children:[(0,y.jsx)(I,{icon:(0,y.jsx)(U,{providerKey:e.providerKey}),title:e.service===``?i(`companionPopover.needsCredentials`):i(`companionPopover.needsCredentialsFor`,{service:e.service}),onClose:()=>r?.(`deferred`)}),(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.detail===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e.detail}),(0,y.jsx)(a,{ref:d,type:`password`,fullWidth:!0,autoComplete:`off`,className:`select-text`,maxLength:o,label:e.label===``?i(`companionPopover.credentialLabel`):e.label,placeholder:e.placeholder,value:s,onChange:e=>{u(e.target.value)}})]})}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,y.jsx)(t,{variant:`outlined`,onClick:()=>r?.(`deferred`),children:i(`companionPopover.notNow`)}),(0,y.jsx)(t,{variant:`primary`,type:`submit`,disabled:s===``,children:i(`companionPopover.confirm`)})]})]})}function z({popover:e,onAnswer:n,onOpenLink:r}){let{t:i}=l(),[a,o]=(0,v.useState)(!1);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(I,{emphasis:!0,title:e.title===``?e.kind===`surface`?i(`companionPopover.surfaceFallback`):``:e.title,onClose:()=>n?.({kind:`dismiss`})}),e.kind===`card`?(0,y.jsxs)(y.Fragment,{children:[e.subtitle===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`-mt-2.5 text-body-medium-lighter text-[var(--content-tertiary)]`,children:e.subtitle}),(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.body===``?null:(0,y.jsx)(B,{body:e.body,onOpenLink:r})})}),e.actions.length>0?(0,y.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:W(e.actions).map(e=>(0,y.jsx)(t,{variant:G(e),disabled:a,onClick:()=>{o(!0),n?.({kind:`action`,actionId:e.id})},children:e.label},e.id))}):null]}):(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,y.jsx)(t,{variant:`primary`,onClick:()=>n?.({kind:`open`}),children:i(`companionPopover.openApp`)})})})]})}function B({body:e,onOpenLink:t}){return(0,y.jsx)(i,{content:e,className:`text-body-medium-lighter text-[var(--content-secondary)] [&_li]:mb-1 [&_ol]:mb-2 [&_ol]:pl-4 [&_p]:mb-2 [&_ul]:mb-2 [&_ul]:pl-4`,linkComponent:(0,v.useCallback)(({href:e,children:n})=>(0,y.jsx)(`a`,{href:e,className:`text-[var(--content-default)] underline decoration-[var(--content-tertiary)] underline-offset-2 hover:decoration-[var(--content-default)]`,onClick:n=>{n.preventDefault(),e!==void 0&&t?.(e)},children:n}),[t]),imageComponent:H,urlTransform:V})}var V=e=>/^data:image\//i.test(e)?e:u(e),H=({src:e,alt:t})=>T(e)?(0,y.jsx)(`img`,{src:e,alt:t,draggable:!1,className:`my-1 max-h-60 w-full rounded-xl object-contain`}):null;function U({providerKey:e}){return e!==void 0&&r(e)?(0,y.jsx)(n,{providerKey:e,displayName:null,logoUrl:null,size:24}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-6 shrink-0 items-center justify-center text-[var(--content-tertiary)]`,children:(0,y.jsx)(h,{className:`size-4`,strokeWidth:2})})}var W=e=>[...e.filter(e=>e.style!==`primary`),...e.filter(e=>e.style===`primary`)],G=e=>{switch(e.style){case`primary`:return`primary`;case`destructive`:return`danger`;case`secondary`:return`outlined`}};function K({tone:e,onClick:n,type:r=`button`,disabled:i,children:a}){return(0,y.jsx)(t,{shape:`pill`,type:r,disabled:i,variant:e===`primary`?`primary`:e===`negative`?`dangerGhost`:`ghost`,className:s(`h-8 px-3`,e===`secondary`&&`bg-[var(--surface-lift)] hover:bg-[var(--surface-active)]`,e===`negative`&&`bg-[var(--system-negative-weak)]`),onClick:n,children:a})}export{k as n,O as t};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,Ur as n,Wr as r,eC as i,gC as a,qg as o,qo as s,wC as c}from"./app-XG_RF2yi.js";import{E as l,dt as u}from"./vendor-DwMhK7fD.js";import{t as d,x as f}from"./react-B9IgSVeK.js";import{G as p,Ji as m,dr as h,h as g,i as _}from"./icons-C0wyat6T.js";var v=e(f(),1),y=d();function b({label:e,selected:t,onPick:n,trailing:r}){return(0,y.jsxs)(`div`,{role:`option`,"aria-selected":t,className:s(`flex min-h-9 items-center gap-2 rounded-lg px-3 py-1.5 transition-colors`,t?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`),onClick:n,children:[(0,y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:e}),r,t?(0,y.jsx)(m,{"aria-hidden":!0,className:`size-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`})]})}function x({label:e,children:t}){return(0,y.jsx)(c,{className:`-mx-2 min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{role:`listbox`,"aria-label":e,className:`flex flex-col`,children:t})})}function S({popover:e,onAnswer:t}){let{t:n}=l();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(x,{label:n(`companionPopover.microphoneTitle`),children:[(0,y.jsx)(b,{label:n(`companionPopover.systemDefault`),selected:e.selected===``,onPick:()=>t?.({kind:`pick`,optionId:``})}),e.options.map(n=>(0,y.jsx)(b,{label:n.label,selected:e.selected===n.id,onPick:()=>t?.({kind:`pick`,optionId:n.id})},n.id))]}),e.needsPermission?(0,y.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`companionPopover.microphonePermissionHint`)}):null]})}function C(){let[e,t]=(0,v.useState)(null),n=(0,v.useRef)(null);return(0,v.useEffect)(()=>()=>{n.current?.pause(),n.current=null},[]),{playing:e,play:(e,r)=>{n.current?.pause();let i=new Audio(r);n.current=i,t(e);let a=()=>{n.current===i&&(n.current=null,t(null))};i.onended=a,i.onerror=a,i.play().catch(a)},stop:()=>{n.current?.pause(),n.current=null,t(null)}}}function w({popover:e,onAnswer:n}){let{t:r}=l(),{playing:i,play:a,stop:o}=C();return(0,y.jsx)(x,{label:r(`companionPopover.voiceTitle`),children:e.groups.map(s=>(0,y.jsxs)(`div`,{role:`group`,"aria-label":s.accent,children:[(0,y.jsx)(`div`,{className:`px-3 pt-3 pb-1 text-label-small-default text-[var(--content-tertiary)]`,children:s.accent}),s.voices.map(s=>{let c=i===s.id;return(0,y.jsx)(b,{label:s.isDefault?(0,y.jsxs)(y.Fragment,{children:[s.label,(0,y.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:` ${r(`companionPopover.defaultSuffix`)}`})]}):s.label,selected:e.selected===s.id,onPick:()=>n?.({kind:`pick`,optionId:s.id}),trailing:s.sampleUrl===``?void 0:(0,y.jsx)(t,{variant:`ghost`,size:`compact`,className:`size-7 shrink-0`,iconOnly:c?(0,y.jsx)(p,{}):(0,y.jsx)(g,{}),"aria-label":c?r(`companionPopover.stopPreview`):r(`companionPopover.previewVoice`,{voice:s.label}),onClick:e=>{e.stopPropagation(),c?o():a(s.id,s.sampleUrl)}})},s.id)})]},s.accent))})}var T=e=>/^https?:\/\//i.test(e)||/^data:image\//i.test(e),E=`border border-white/5 bg-[var(--surface-base)] text-[var(--content-default)] shadow-lg shadow-black/40`,D=e=>`radial-gradient(120% 80% at 0% 0%, ${e===void 0?`transparent`:`color-mix(in srgb, ${e} 7%, transparent)`} 0%, transparent 70%), #17181b`;function O({popover:e,view:t,cardRef:n,onAnswer:r,onView:i,onOpenLink:a,accentHex:o,attached:c=!1,className:u,style:d}){let{t:f}=l();return(e.kind===`approvals`||e.kind===`secret`)&&t!==`expanded`?(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:s(`w-max max-w-[640px] rounded-[22px]`,E,u),style:d,children:(0,y.jsx)(k,{popover:e,onAnswer:r,onView:i})}):(0,y.jsx)(`div`,{ref:n,role:`group`,"data-companion-popover":e.kind,className:s(`flex min-h-0 flex-col gap-3 p-4 text-[var(--content-default)]`,!c&&`rounded-[20px] border border-white/10 shadow-2xl shadow-black/50`,e.kind===`approvals`?`w-max max-w-[640px]`:`w-[360px]`,(e.kind===`microphones`||e.kind===`voices`)&&`gap-2 px-4 pb-3`,u),style:c?d:{background:D(o),...d},children:e.kind===`approvals`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(I,{title:f(`companionPopover.needsOkCount`,{count:e.items.length}),onClose:()=>i?.(`deferred`)}),(0,y.jsx)(L,{items:e.items,onAnswer:r})]}):e.kind===`secret`?(0,y.jsx)(R,{popover:e,onAnswer:r,onView:i}):e.kind===`microphones`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(I,{title:f(`companionPopover.microphoneTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(S,{popover:e,onAnswer:r})]}):e.kind===`voices`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(I,{title:f(`companionPopover.voiceTitle`),onClose:()=>r?.({kind:`dismiss`})}),(0,y.jsx)(w,{popover:e,onAnswer:r})]}):(0,y.jsx)(z,{popover:e,onAnswer:r,onOpenLink:a})})}function k({popover:e,onAnswer:t,onView:n,className:r}){let{t:i}=l(),a=e.kind===`approvals`?e.items[0]:void 0,o=e.kind===`approvals`&&e.items.length===1;return(0,y.jsxs)(`div`,{"data-companion-prompt-row":e.kind,className:s(`flex min-h-11 min-w-0 items-center gap-1.5 py-1.5 pr-1.5 text-[var(--content-default)]`,e.kind===`secret`?`pl-2`:`pl-4`,r),children:[e.kind===`secret`?(0,y.jsx)(U,{providerKey:e.providerKey}):null,(0,y.jsx)(P,{className:`min-w-0 flex-1 text-body-medium-default`,maxWidth:A,text:e.kind===`secret`?e.service===``?i(`companionPopover.needsCredentials`):i(`companionPopover.needsCredentialsFor`,{service:e.service}):o&&a!==void 0?a.title:i(`companionPopover.needsOkCount`,{count:e.items.length})}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-1`,children:o&&a!==void 0?(0,y.jsx)(F,{item:a,pill:!0,onAnswer:t}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(K,{tone:`secondary`,onClick:()=>n?.(`deferred`),children:i(`companionPopover.notNow`)}),(0,y.jsx)(K,{tone:`primary`,onClick:()=>n?.(`expanded`),children:e.kind===`secret`?i(`companionPopover.enter`):i(`companionPopover.review`)})]})})]})}var A=440,j=400;function M(e,t,n){let r=e.trim().split(/\s+/).filter(e=>e!==``),i=r.length;if(i<2||n(r.join(` `))<=t)return[r.join(` `)];let a=r.map(()=>[]);for(let e=0;e<i;e+=1)for(let t=e+1;t<=i;t+=1)a[e][t]=n(r.slice(e,t).join(` `));let o=(e,t)=>r.slice(e,t).join(` `),s=[];for(let e=0;e<i;){let n=e+1;for(;n<i&&a[e][n+1]<=t;)n+=1;s.push(o(e,n)),e=n}if(s.length<2||i>N)return s;let c=e=>{let n=null;for(let r=i-1;r>=e-1;--r){let o=a[r][i];if(o>t&&r!==i-1)continue;let s=new Map;for(let e=1;e<=r;e+=1)a[0][e]<=o&&s.set(`${e}:0`,{cost:(o-a[0][e])**2,breaks:[0]});for(let t=2;t<=e-1;t+=1){let e=new Map;for(let[t,n]of s){let[i,s]=t.split(`:`).map(Number),c=a[s][i];for(let t=i+1;t<=r;t+=1){let r=a[i][t];if(r<c||r>o)continue;let s=n.cost+(o-r)**2,l=`${t}:${i}`,u=e.get(l);(u===void 0||s<u.cost)&&e.set(l,{cost:s,breaks:[...n.breaks,i]})}}s=e}for(let[e,t]of s){let[i,s]=e.split(`:`).map(Number);i!==r||a[s][i]>o||(n===null||t.cost<n.cost)&&(n={cost:t.cost,breaks:[...t.breaks,r]})}}if(n===null)return null;let r=[...n.breaks,i];return n.breaks.map((e,t)=>o(e,r[t+1]))};for(let e=s.length;e<=i;e+=1){let t=c(e);if(t!==null)return t}return s}var N=48;function P({text:e,maxWidth:t,className:n,title:r}){let i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null);return(0,v.useLayoutEffect)(()=>{let n=i.current;if(n===null)return;let r=!1,a=()=>{if(r)return;let i=document.createElement(`span`);i.style.cssText=`position:absolute;visibility:hidden;white-space:pre;left:0;top:0`,n.appendChild(i);let a=new Map,s=M(e,t,e=>{let t=a.get(e);if(t!==void 0)return t;i.textContent=e;let n=i.getBoundingClientRect().width;return a.set(e,n),n});i.remove(),o(s.length>1?s:null)};return a(),document.fonts?.addEventListener(`loadingdone`,a),document.fonts?.ready.then(a),()=>{r=!0,document.fonts?.removeEventListener(`loadingdone`,a)}},[e,t]),(0,y.jsx)(`span`,{ref:i,dir:`auto`,className:n,title:r,children:a===null?e:a.map((e,t)=>(0,y.jsxs)(`span`,{className:`block whitespace-nowrap`,children:[e,t<a.length-1?` `:null]},t))})}function F({item:e,pill:n,onAnswer:r}){let{t:i}=l(),a=()=>r?.({kind:`deny`,itemId:e.id}),o=()=>r?.({kind:e.permission===void 0?`allow`:`settings`,itemId:e.id});return n?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(K,{tone:`negative`,onClick:a,children:i(`companionPopover.deny`)}),(0,y.jsx)(K,{tone:`primary`,onClick:o,children:i(`companionPopover.allow`)})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(t,{variant:`dangerOutline`,onClick:a,children:i(`companionPopover.deny`)}),(0,y.jsx)(t,{variant:`primary`,onClick:o,children:i(`companionPopover.allow`)})]})}function I({title:e,icon:n,emphasis:r=!1,onClose:i}){let{t:a}=l();return(0,y.jsxs)(`div`,{className:`-mt-0.5 -mr-1.5 flex min-h-7 items-center gap-2`,children:[n,(0,y.jsx)(`p`,{dir:`auto`,className:s(`min-w-0 flex-1`,r?`text-title-small leading-snug`:`text-body-small-default text-[var(--content-tertiary)] select-none`),children:e}),(0,y.jsx)(t,{variant:`ghost`,className:`size-7 rounded-lg px-0`,"aria-label":a(`companionPopover.dismiss`),iconOnly:(0,y.jsx)(_,{className:`size-4`,strokeWidth:2}),onClick:i})]})}function L({items:e,onAnswer:t}){return(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,n)=>(0,y.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-[var(--surface-lift)] text-body-medium-default text-[var(--content-tertiary)]`,children:n+1}),(0,y.jsx)(P,{className:`min-w-0 flex-1 pl-1 text-body-medium-default`,maxWidth:j,title:e.detail===``?void 0:e.detail,text:e.title}),(0,y.jsx)(`span`,{className:`ml-2 flex shrink-0 items-center gap-2`,children:(0,y.jsx)(F,{item:e,pill:!1,onAnswer:t})})]},e.id))})})}function R({popover:e,onAnswer:n,onView:r}){let{t:i}=l(),[s,u]=(0,v.useState)(``),d=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=()=>{d.current?.focus()};return e(),window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[]),(0,y.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),s!==``&&n?.({kind:`secret`,value:s})},children:[(0,y.jsx)(I,{icon:(0,y.jsx)(U,{providerKey:e.providerKey}),title:e.service===``?i(`companionPopover.needsCredentials`):i(`companionPopover.needsCredentialsFor`,{service:e.service}),onClose:()=>r?.(`deferred`)}),(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.detail===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e.detail}),(0,y.jsx)(a,{ref:d,type:`password`,fullWidth:!0,autoComplete:`off`,className:`select-text`,maxLength:o,label:e.label===``?i(`companionPopover.credentialLabel`):e.label,placeholder:e.placeholder,value:s,onChange:e=>{u(e.target.value)}})]})}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[(0,y.jsx)(t,{variant:`outlined`,onClick:()=>r?.(`deferred`),children:i(`companionPopover.notNow`)}),(0,y.jsx)(t,{variant:`primary`,type:`submit`,disabled:s===``,children:i(`companionPopover.confirm`)})]})]})}function z({popover:e,onAnswer:n,onOpenLink:r}){let{t:i}=l(),[a,o]=(0,v.useState)(!1);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(I,{emphasis:!0,title:e.title===``?e.kind===`surface`?i(`companionPopover.surfaceFallback`):``:e.title,onClose:()=>n?.({kind:`dismiss`})}),e.kind===`card`?(0,y.jsxs)(y.Fragment,{children:[e.subtitle===``?null:(0,y.jsx)(`p`,{dir:`auto`,className:`-mt-2.5 text-body-medium-lighter text-[var(--content-tertiary)]`,children:e.subtitle}),(0,y.jsx)(c,{className:`min-h-0 flex-1`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,y.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.body===``?null:(0,y.jsx)(B,{body:e.body,onOpenLink:r})})}),e.actions.length>0?(0,y.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2`,children:W(e.actions).map(e=>(0,y.jsx)(t,{variant:G(e),disabled:a,onClick:()=>{o(!0),n?.({kind:`action`,actionId:e.id})},children:e.label},e.id))}):null]}):(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,y.jsx)(t,{variant:`primary`,onClick:()=>n?.({kind:`open`}),children:i(`companionPopover.openApp`)})})})]})}function B({body:e,onOpenLink:t}){return(0,y.jsx)(i,{content:e,className:`text-body-medium-lighter text-[var(--content-secondary)] [&_li]:mb-1 [&_ol]:mb-2 [&_ol]:pl-4 [&_p]:mb-2 [&_ul]:mb-2 [&_ul]:pl-4`,linkComponent:(0,v.useCallback)(({href:e,children:n})=>(0,y.jsx)(`a`,{href:e,className:`text-[var(--content-default)] underline decoration-[var(--content-tertiary)] underline-offset-2 hover:decoration-[var(--content-default)]`,onClick:n=>{n.preventDefault(),e!==void 0&&t?.(e)},children:n}),[t]),imageComponent:H,urlTransform:V})}var V=e=>/^data:image\//i.test(e)?e:u(e),H=({src:e,alt:t})=>T(e)?(0,y.jsx)(`img`,{src:e,alt:t,draggable:!1,className:`my-1 max-h-60 w-full rounded-xl object-contain`}):null;function U({providerKey:e}){return e!==void 0&&r(e)?(0,y.jsx)(n,{providerKey:e,displayName:null,logoUrl:null,size:24}):(0,y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-6 shrink-0 items-center justify-center text-[var(--content-tertiary)]`,children:(0,y.jsx)(h,{className:`size-4`,strokeWidth:2})})}var W=e=>[...e.filter(e=>e.style!==`primary`),...e.filter(e=>e.style===`primary`)],G=e=>{switch(e.style){case`primary`:return`primary`;case`destructive`:return`danger`;case`secondary`:return`outlined`}};function K({tone:e,onClick:n,type:r=`button`,disabled:i,children:a}){return(0,y.jsx)(t,{shape:`pill`,type:r,disabled:i,variant:e===`primary`?`primary`:e===`negative`?`dangerGhost`:`ghost`,className:s(`h-8 px-3`,e===`secondary`&&`bg-[var(--surface-lift)] hover:bg-[var(--surface-active)]`,e===`negative`&&`bg-[var(--system-negative-weak)]`),onClick:n,children:a})}export{k as n,O as t};
|
package/dist/assets/{companion-popover-page-YQKBZlNX.js → companion-popover-page-B-tbPgw2.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Bl as t,Dl as n,Fl as r,Il as i,wl as a,yl as o}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Bl as t,Dl as n,Fl as r,Il as i,wl as a,yl as o}from"./app-XG_RF2yi.js";import{t as s,x as c}from"./react-B9IgSVeK.js";import{n as l}from"./companion-accent-CbS8BVae.js";import{t as u}from"./companion-popover-BsoxqJOP.js";var d=e(c(),1),f=s();function p(){let[e,s]=(0,d.useState)(null),c=(0,d.useRef)(null);(0,d.useEffect)(()=>{let e=t(s);return a().then(e=>{e&&s(e)}),e},[]);let p=e?.popover,m=p?.id,h=e?.popoverView??`row`;return(0,d.useLayoutEffect)(()=>{let e=c.current;if(m===void 0||e===null)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect();r(m,Math.ceil(t)+24,Math.ceil(n)+24)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[m,h]),p===void 0?null:(0,f.jsx)(`div`,{"data-theme":`dark`,className:`h-screen w-screen bg-transparent select-none`,style:{padding:12},children:(0,f.jsx)(u,{popover:p,view:h,accentHex:l(e?.call??null,e?.accentHex,e?.character)??void 0,cardRef:c,style:{maxHeight:536},onAnswer:e=>{o(e,p.id)},onView:e=>{i(p.id,e)},onOpenLink:e=>{n(e)}},p.id)})}export{p as CompanionPopoverPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$d as t,BC as n,CS as r,Gg as i,Gl as a,Hg as o,Kg as s,Oa as c,Qd as l,Tn as u,Wg as d,Zg as f,Zi as p,ef as m,tf as h,ts as g,wC as _}from"./app-g1TvV-Dl.js";import{E as v,d as y,s as b}from"./vendor-DwMhK7fD.js";import{t as x,x as S}from"./react-B9IgSVeK.js";import{Ai as C,Cr as w,Fa as T,G as ee,Gi as E,Ji as D,Ki as O,Tn as k,Wi as A,Xr as te,Ya as j,Yr as ne,Zt as M,bt as re,h as ie,i as N,m as ae,qi as oe,wn as P}from"./icons-C0wyat6T.js";import{l as F,n as I,t as se}from"./permission-setup-D8C_-pLn.js";import{t as ce}from"./companion-layout-C6tp_Wvl.js";var le=j(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),ue=j(`screen-share`,[[`path`,{d:`M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3`,key:`i8wdob`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m17 8 5-5`,key:`fqif7o`}],[`path`,{d:`M17 3h5v5`,key:`1o3tu8`}]]),de=j(`slash`,[[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}]]),L=e(S(),1);function fe(e,t){return e===`inputMonitoring`||t?.canRequest===!1||e!==`screen`&&t?.status===`denied`}var pe={try:`microphone`,key:`inputMonitoring`,share:`screen`};function R(e){return e!==null&&(e.state.phase!==`known`||e.state.item.status!==`granted`)}function me(e){let n=e===null?null:pe[e]??null,i=e!==null,[o,s]=(0,L.useState)(void 0),[c,u]=(0,L.useState)(null),d=(0,L.useRef)(()=>{});return(0,L.useEffect)(()=>{if(u(null),!i)return;let e=!0,o=!1,c=0,f=!1,p=!1,_=null,v=async()=>{if(!(!e||o||p||_!==`ready`)){p=!0;try{let t=await g();if(!e||o||_!==`ready`||t===null||t===`com.apple.systempreferences`||t===`com.apple.SecurityAgent`)return;_=null,I(),await a()}catch(e){r(e,{context:`companionIntro.resumeAfterPermission`})}finally{p=!1}}},y=(t,r=!1)=>{e&&(s(e=>JSON.stringify(e)===JSON.stringify(t)?e:t),r||u(null),_!==null&&n!==null&&(_=t?t[n].status===`granted`?`ready`:`waiting`:null,v()))},b=t=>{e&&(n!==null&&u({kind:n,phase:`error`}),r(t,{context:`companionIntro.permission`,tags:{kind:n??`tour`}}))},x=async()=>{if(f||o)return;f=!0;let t=c;try{let n=await l();e&&t===c&&!o&&y(n),n===null&&clearInterval(S)}catch(e){t===c&&!o&&b(e)}finally{f=!1}},S=setInterval(()=>{x()},2e3),C=h(e=>{c+=1,y(e,o)});return x(),d.current=r=>{!e||o||n===null||(o=!0,c+=1,u({kind:n,phase:`requesting`}),(async()=>{try{let i=await l();if(!e)return;if(!i){y(null);return}let a=i[n];if(a.status===`granted`||a.status===`restricted`){y(i);return}let o=c;_=`waiting`;let s=n!==`microphone`&&F()?await se(n,r):fe(n,a)?await t(n):await m(n);e&&(o===c?y(s?{...i,[n]:s}:null):u(null))}catch(e){_=null,b(e)}finally{o=!1,v()}})())},()=>{e=!1,I(),clearInterval(S),C()}},[n,i]),n===null||o===null?null:{kind:n,state:c?.kind===n?{phase:c.phase}:o?{phase:`known`,item:o[n]}:{phase:`checking`},enable:e=>d.current(e)}}var z=x();function he(e){return e===`paste-failed`?`companionSurface.offerPasteFailed`:`companionSurface.offerNowhere`}var ge=260;function _e({offer:e,growth:t=`right`,cardGrowth:n=`up`,avatarBox:r=o,optionsBox:i=o,cardRef:a,onAnswer:s}){let{t:c}=v(),l=e.reason===`claimed`?c(`companionSurface.offerVersion`):c(he(e.reason)),{inUnits:u,avatarHalf:d,lineAt:f,edgeAt:p,introStepOff:m}=ce(r,i),h=u(m(n)),g=p(t,-d),y={top:f(n,0),transform:n===`up`?`translateY(calc(-100% - ${h}px))`:`translateY(${h}px)`};return(0,z.jsxs)(`div`,{ref:a,role:`group`,"aria-label":l,"data-companion-dictation-offer":!0,className:`absolute flex flex-col gap-2 rounded-2xl border border-white/10 bg-[#17181b]/95 px-3.5 py-3 shadow-lg shadow-black/40`,style:{width:ge,...g,...y},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`p`,{className:`text-[11px] font-medium tracking-wide text-white/45 uppercase select-none`,children:l}),(0,z.jsx)(_,{className:`max-h-40 flex-col`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,z.jsx)(`p`,{dir:`auto`,className:`text-[13px] leading-[1.45] text-white/90`,children:e.text})}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 pt-0.5`,children:[(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/55 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>s?.(`dismiss`),children:e.reason===`claimed`?c(`companionSurface.notNow`):c(`companionSurface.offerDiscard`)}),e.reason===`claimed`?(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/70 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>s?.(`quit`),children:c(`companionSurface.offerQuit`,{app:e.app})}):null,(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full bg-white/15 px-3 text-[12px] text-white transition-colors hover:bg-white/25`,onClick:()=>s?.(e.reason===`claimed`?`use`:`copy`),children:e.reason===`claimed`?c(`companionSurface.offerUse`):c(`companionSurface.offerCopy`)})]})]})}var ve={microphone:{action:`companionIntro.permission.microphoneAction`,body:`companionIntro.permission.microphoneBody`},inputMonitoring:{action:`companionIntro.permission.openSettings`,body:`companionIntro.permission.shortcutBody`},screen:{action:`companionIntro.permission.screenAction`,body:`companionIntro.permission.screenBody`}};function ye({permission:e}){let{t}=v(),r=(0,L.useRef)(null),{state:i}=e,a=i.phase===`known`?i.item:null,o=i.phase===`checking`||i.phase===`requesting`,s=fe(e.kind,a),c=a?.status===`restricted`,l=i.phase===`error`||a?.error!==void 0,u=ve[e.kind];return(0,z.jsxs)(`div`,{ref:r,className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:t(u.body)}),(0,z.jsx)(n,{size:`compact`,shape:`pill`,className:`self-start bg-white/15 text-white hover:bg-white/25`,loading:o,disabled:c||i.phase===`checking`,onClick:()=>{let t=r.current?.getBoundingClientRect();e.enable(t?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0)},children:t(s?`companionIntro.permission.openSettings`:u.action)}),(0,z.jsx)(`p`,{role:`status`,className:`text-[12px] leading-tight text-white/60`,children:c?t(`companionIntro.permission.restricted`):l?t(`companionIntro.permission.error`):s?t(e.kind===`microphone`?`companionIntro.permission.microphoneSettingsHint`:`companionIntro.permission.settingsHint`):o?t(`companionIntro.permission.waiting`):e.kind===`microphone`?t(`companionIntro.permission.microphonePromptHint`):null})]})}var be=3e3,xe={idle:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.idle.body`},meet:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.meet.body`},talk:{title:`companionIntro.talk.title`,body:`companionIntro.talk.body`},key:{title:`companionIntro.key.title`},share:{title:`companionIntro.share.title`,body:`companionIntro.share.body`},draw:{title:`companionIntro.draw.title`,body:`companionIntro.draw.body`},mute:{title:`companionIntro.mute.title`,body:`companionIntro.mute.body`},try:{title:`companionIntro.try.title`,body:`companionIntro.try.body`}},B=e=>f(e),V=e=>({phase:`listening`,label:e,accentHex:``,muted:!1,outputMuted:!1,detail:``,approvalRequestId:``,assistantName:``}),H={share:`⌥S`,draw:`⌥D`,muteMicrophone:`⌥M`,muteAssistant:`⌥A`},Se={share:{icon:(0,z.jsx)(ue,{className:`size-5`}),shortcut:H.share},draw:{icon:(0,z.jsx)(M,{className:`size-5`}),shortcut:H.draw},mute:{icon:(0,z.jsx)(P,{className:`size-5`}),shortcut:H.muteMicrophone}},Ce=e=>B(e)===void 0?null:`call`,we=(e,t)=>B(e)===void 0?null:{call:V(t),sharing:e!==`share`};function Te({beat:e,growth:t=`right`,cardGrowth:n=`up`,avatarBox:r=o,optionsBox:a=o,accentHex:c,assistantName:l,cardRef:u,onAdvance:p,permission:m=null,greeted:h=!1,voiceKeyTaps:g=0,chordPresses:_=0,chordControl:y}){let{t:b}=v(),x=d.indexOf(e),S=x===d.length-1,C=x<=0,w=xe[e],T=R(m),ee=m?.state.phase===`checking`,E=i[e],D=f(e),O=D===void 0?void 0:Se[D],[k,A]=(0,L.useState)(!1);(0,L.useEffect)(()=>{A(!1)},[e]),(0,L.useEffect)(()=>{if(!k)return;let e=setTimeout(()=>{A(!1)},be);return()=>{clearTimeout(e)}},[k]),(0,L.useEffect)(()=>{A(!1)},[g]);let[te,j]=(0,L.useState)(g),[ne,M]=(0,L.useState)(_),[re,ie]=(0,L.useState)(e);re===e?g<te&&j(g):(ie(e),j(g),M(_));let ae=Math.min(Math.max(g-te,0),2);_<ne&&M(_);let oe=D!==void 0&&y===D&&_>ne,{inUnits:P,avatarHalf:F,gap:I,lineAt:se,edgeAt:le,introStepOff:ue}=ce(r,a),de=n===`down`||B(e)===void 0?P(ue(n)):P(F+I)+22+P(F)+6,fe=le(t,-F),pe={top:se(n,0),transform:n===`up`?`translateY(calc(-100% - ${de}px))`:`translateY(${de}px)`};return(0,z.jsxs)(`div`,{ref:u,role:`group`,"aria-label":b(`companionIntro.ariaLabel`),className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-5 shadow-lg shadow-black/40`,style:{width:320,height:224,...fe,...pe},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`button`,{type:`button`,"aria-label":b(`companionIntro.close`),className:`absolute top-2 right-2 flex size-6 items-center justify-center rounded-full text-white/45 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>p?.(`dismiss`),children:(0,z.jsx)(N,{className:`size-3.5`})}),(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`pr-6 text-[16px] leading-tight font-medium text-white`,children:(0,z.jsx)(`span`,{className:`line-clamp-2`,children:`titleNamed`in w&&l!==void 0?b(w.titleNamed,{name:l}):b(w.title)})}),ee?null:T&&m!==null?(0,z.jsx)(ye,{permission:m}):(0,z.jsxs)(z.Fragment,{children:[`body`in w?(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:b(e===`talk`&&h?`companionIntro.talk.greeted`:w.body)}):null,e===`talk`&&(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0})}),e===`key`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:b(k?`companionIntro.key.scolded`:`companionIntro.talk.gesture`)}),(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})})]}),e===`try`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-3`,children:[(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0}),(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})]}),(0,z.jsx)(`p`,{className:`text-center text-[11px] leading-tight text-white/45`,children:b(k?`companionIntro.key.scolded`:`companionIntro.try.how`)})]}),O!==void 0&&(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-xl bg-white/10 text-white/85`,children:O.icon}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:b(`companionIntro.call.click`)})]}),(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex h-10 items-center rounded-xl border px-3 text-[13px] font-medium transition-colors ${oe?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:`border-white/15 bg-white/10 text-white/85`}`,children:O.shortcut}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:b(`companionIntro.call.shortcut`)})]})]})]})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 pt-2`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1`,"aria-hidden":!0,children:s.map(e=>(0,z.jsx)(`span`,{className:`size-1.5 rounded-full transition-colors`,style:{backgroundColor:e===E?c??`#5eead4`:`rgba(255,255,255,.2)`}},e))}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[C?null:(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full px-3 text-[14px] text-white/60 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>p?.(`back`),children:b(`companionIntro.back`)}),(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full bg-white/15 px-3 text-[14px] text-white transition-colors hover:bg-white/25`,onClick:()=>p?.(`next`),children:b(S?`companionIntro.done`:T&&!ee?`companionIntro.permission.skip`:`companionIntro.next`)})]})]})]})}function U({label:e,taps:t=0,scolded:n=!1,take:r}){let i=t>=2?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:t===1?`border-emerald-400/70 bg-emerald-400/20 text-emerald-100`:`border-white/20 bg-white/10 text-white/85`,a=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(w,{className:`size-4`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`absolute bottom-1 left-1.5 text-[9px] leading-none opacity-70`,"aria-hidden":!0,children:e})]}),o=`relative inline-flex size-11 items-center justify-center rounded-lg border font-medium shadow-[inset_0_-2px_0_rgba(0,0,0,.4)] transition-[color,background-color,border-color,transform] ${i} ${n?`scale-90 opacity-70`:``}`;return r===void 0?(0,z.jsx)(`span`,{className:o,"aria-label":e,children:a}):(0,z.jsx)(`button`,{type:`button`,className:`${o}${t===0?`hover:border-white/40 hover:bg-white/20`:``}`,"aria-label":e,onClick:r,children:a})}var Ee=e=>e.filter(e=>e.state===`running`),W=e=>e.filter(e=>e.state===`waiting`),De=e=>({"--companion-ring-accent":e});function Oe({size:e,still:t=!1}){return(0,z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,className:`shrink-0 ${t?``:`companion-work-spin`}`,"aria-hidden":!0,children:[(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeOpacity:`0.2`,strokeWidth:`2`}),(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:t?void 0:`10 28`,strokeOpacity:t?.6:void 0})]})}function ke({state:e}){return e===`done`?(0,z.jsx)(D,{className:`companion-work-pop size-3.5 shrink-0 text-[var(--companion-ring-accent)]`,"aria-hidden":!0}):(0,z.jsx)(N,{className:`companion-work-pop size-3.5 shrink-0 text-white/50`,"aria-hidden":!0})}function Ae(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function G(){let[e,t]=(0,L.useState)(()=>Date.now());return(0,L.useEffect)(()=>{let e=window.setInterval(()=>{t(Date.now())},1e3);return()=>{window.clearInterval(e)}},[]),e}function je({work:e,accentHex:t}){let{t:n}=v(),r=G(),i=e.slice(0,5),a=e.length-i.length;return(0,z.jsxs)(`div`,{className:`flex w-full min-w-[300px] flex-col gap-1.5 px-4 py-3 text-[12px] text-white/85`,style:De(t),"data-companion-work-shelf":!0,children:[i.map(e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.state===`running`||e.state===`waiting`?(0,z.jsx)(Oe,{size:14,still:e.state===`waiting`}):(0,z.jsx)(ke,{state:e.state}),(0,z.jsx)(`span`,{className:`max-w-[55%] shrink-0 truncate font-medium ${e.state===`done`||e.state===`failed`?`text-white/55`:``}`,children:e.title}),(0,z.jsx)(`span`,{className:`companion-work-fade min-w-0 flex-1 truncate text-white/50`,children:e.state===`running`?e.step:e.state===`waiting`?n(`companionSurface.workWaitingStep`):e.state===`done`?n(`companionSurface.workDone`):n(`companionSurface.workStopped`)},e.state===`running`?e.step:e.state),e.kind===`subagent`?(0,z.jsx)(`span`,{className:`shrink-0 text-[11px] text-white/40 tabular-nums`,children:Ae(r-e.startedAt)}):null]},e.id)),a>0?(0,z.jsx)(`div`,{className:`pl-[22px] text-[11px] text-white/40`,children:n(`companionSurface.workMore`,{count:a})}):null]})}var Me={min:3,max:10},Ne=(e=Math.random)=>{let t=e();return t<1/3?`top`:t<2/3?`topLeft`:`topRight`},Pe=1600,Fe=.22,Ie=.04,Le=4,Re=(e,t)=>{let n=Math.min(.95,Math.max(.25,e.eyeCenterFrac+e.eyeHalfFrac+Ie)),r=Math.min(t,24,14/n),i=r*n;return{size:r,exposed:i,clip:{width:r+2*Le,height:i+Le},rest:i+2}},ze=(e,t=Math.random)=>(e.min+t()*(e.max-e.min))*1e3;function Be(e,t=Me){let[n,r]=(0,L.useState)(0),{min:i,max:a}=t;return(0,L.useEffect)(()=>{if(!e)return;let t,n=()=>{t=setTimeout(()=>{r(e=>e+1),n()},ze({min:i,max:a}))};return n(),()=>{clearTimeout(t)}},[e,i,a]),n}var Ve=(e,t,n={width:0,height:0})=>{let r=e===`topLeft`?n.width/4:e===`topRight`?n.width*3/4:n.width/2;return{slot:{width:t.width,height:t.height,bottom:`100%`,left:r-t.width/2}}};function He({character:e,capsule:t,enabled:n,held:r=!1,edge:i,interval:a=Me,className:o,style:s}){let l=b(),d=(0,L.useMemo)(()=>u(c,e),[e]),f=Be(n&&!r&&!l&&d!==null,a),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(`top`);if((0,L.useEffect)(()=>{if(f===0)return;_(Ne()),h(!0);let e=setTimeout(()=>{h(!1)},Pe);return()=>{clearTimeout(e)}},[f]),d===null||l)return null;let v=Re(d,t.width),x=r||m,S=i??g,C=Ve(S,v.clip,t);return(0,z.jsx)(`div`,{className:`companion-peek ${o??``}`,style:{width:t.width,height:t.height,...s},"data-risen":x,"data-edge":S,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute`,style:C.slot,children:(0,z.jsx)(`div`,{className:`absolute inset-0 overflow-hidden`,children:(0,z.jsx)(y.div,{className:`absolute left-1/2`,style:{width:v.size,height:v.size,marginLeft:-v.size/2,top:v.clip.height-v.exposed},initial:{y:v.rest},animate:{y:x?0:v.rest},transition:r?{duration:0}:x?{type:`spring`,stiffness:280,damping:14}:{duration:Fe,ease:`easeIn`},children:(0,z.jsx)(p,{components:c,traits:e,size:v.size})})})})})}var Ue=(0,L.createContext)(`above`),We=`#5eead4`,Ge=new Set([`transcribing`,`thinking`,`speaking`]),K=28,q={idle:{width:64,height:14},closing:K,rim:2,bloom:4},Ke=q.idle,qe=(e,t,n)=>[`inset 0 0 0 ${t}px color-mix(in srgb, ${e} 78%, transparent)`,`0 0 ${n}px color-mix(in srgb, ${e} 85%, transparent)`,`0 0 ${n*4}px color-mix(in srgb, ${e} 42%, transparent)`,`0 8px 24px rgba(0, 0, 0, 0.45)`].join(`, `),Je=244,Ye=200,J=120,Xe=32,Ze={watching:40,summary:220,dictating:Je+32,offer:Ye+32,call:4+J+180},Qe=84,$e={width:28,height:Qe+140+20};function et({phase:e,assistantName:t=``,accentHex:n=We,avatarSrc:r,character:i,hovered:a=!1,growth:s=`right`,avatarBox:c=o,optionsBox:l=o,cardGrowth:u=`up`,dock:d=`bottom`,rootRef:f,restingPillRef:p,avatarRef:m,onSurfacePointerDown:h,onSurfaceContextMenu:g,spotlight:_,avatarStaged:y=!1,avatarTucked:x=!1,onWatch:S,onTeach:C,picking:w=!1,sharing:T=!1,shareEnabled:ee=!1,sharePicking:E=!1,onShare:D,onStopShare:O,annotating:k=!1,annotationTool:A,onAnnotationTool:te,drawToolsRef:j,onAnnotate:ne,marked:M=!1,onClearMarks:re,openPicker:ie,onPicker:N,shortcuts:ae,onAvatarClick:oe,working:P=!1,watching:F=!1,watchRetro:I,onWatchRetro:se,dictationOffer:le,offer:ue,watchEnabled:de=!1,dictating:fe,dictationText:pe=``,call:R,onControl:me,intro:he,picker:ge,prompt:_e,promptRef:ve,promptsDeferred:ye=0,onReviewPrompts:be,onWorkShelfChange:xe}){let{t:B}=v(),V=e===`call`?R?.work:void 0,H=V!==void 0&&V.length>0,[Se,Ce]=(0,L.useState)(!1);(0,L.useEffect)(()=>{H||Ce(!1)},[H]);let we=d===`left`||d===`right`?void 0:_e,Te=we==null?Se&&H:!1;(0,L.useEffect)(()=>{xe?.(Te)},[xe,Te]);let U=(0,L.useMemo)(()=>we??(Se&&H?(0,z.jsx)(je,{work:V,accentHex:n}):void 0),[we,Se,H,V,n]),Ee=e!==`resting`,W=e===`call`||e===`dictating`||e===`offer`||e===`summary`||e===`watching`,De=(0,L.useRef)(null),[Oe,ke]=(0,L.useState)(null),Ae=_===`talk`?void 0:_;(0,L.useEffect)(()=>{if(Ae===void 0){ke(null);return}return nt(De,`[data-control="${Ae}"]`,e=>{ke(e.x)})},[Ae,e,T]);let[G,Me]=(0,L.useState)(null);(0,L.useEffect)(()=>{if(!y){Me(null);return}return nt(De,`[data-avatar-stage]`,Me)},[y,e]);let[Ne,Pe]=(0,L.useState)(!1);(0,L.useEffect)(()=>{if(e!==`hover`){Pe(!1);return}let t=setTimeout(()=>{Pe(!0)},500);return()=>{clearTimeout(t)}},[e]);let Fe=he==null?_===`talk`||e===`hover`&&Ne:!1,Ie=I===`pending`,Le=P||R!==void 0&&Ge.has(R.phase),Re=b(),ze=(0,L.useRef)(null),[Be,Ve]=(0,L.useState)(null),He=(0,L.useRef)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=ze.current;if(!e)return;let t=()=>{Ve({width:e.scrollWidth-He.current.width,height:e.scrollHeight-He.current.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[e]);let{scale:K,avatarRel:Ke,avatarHalf:Je,gap:Ye,inUnits:J,lineAt:Xe,edgeAt:Qe}=ce(c,l),et=e===`call`,Y=et&&(d===`left`||d===`right`),tt=Y?d===`left`?`right`:`left`:`above`,X=W?Y?(Be?.width??$e.width)+16:o+(Be?.width??Ze[e])+8:0,dt=W?o+(Be?.height??$e.height)+8:0,Z=et&&U!=null,pt=(0,L.useRef)(null),[mt,ht]=(0,L.useState)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=pt.current;if(!Z||e===null)return;let t=()=>{let t=e.getBoundingClientRect();ht({width:Math.ceil(t.width/K),height:Math.ceil(t.height/K)})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Z,U,K]);let gt=Z&&!Y?Math.max(X,mt.width):X,_t=Z&&Y?Math.max(dt,mt.height):dt,vt=Y?_t-dt:gt-X;(0,L.useLayoutEffect)(()=>{He.current=Y?{width:0,height:vt}:{width:vt,height:0}},[vt,Y]);let Q=Y?`50%`:Xe(u,0),yt=Qe(s,s===`left`?l/2:-(l/2)),bt=c/o,xt=Ee?{width:q.closing*bt,height:q.closing*bt}:q.idle,St=he!=null,Ct=et?{width:gt,...Y?{height:_t}:{},left:`50%`,top:Q,transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`}:{width:X,...yt,top:Q,transform:`translateY(-50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`},$=G===null?Oe!==null&&!Y?`${Oe}px`:et&&!Y?`calc(50% - ${gt/2-o/2}px)`:`50%`:`${G.x}px`,wt=G===null?Oe!==null&&!Y?`calc(${Q} - ${J(Je+Ye)+22}px)`:Y?`calc(50% - ${_t/2-o/2}px)`:Q:`${G.y}px`;return(0,z.jsxs)(`div`,{ref:De,className:`absolute top-0 left-0 origin-top-left`,style:{width:`${100/K}%`,height:`${100/K}%`,transform:`scale(${K})`},children:[Z?(0,z.jsx)(ut,{dock:d,top:Q,width:Y?mt.width:gt,height:_t,barThickness:Y?X:44,promptRef:ve,children:U}):null,Z?(0,z.jsx)(`div`,{ref:pt,inert:!0,"aria-hidden":!0,"data-theme":`dark`,className:`pointer-events-none invisible absolute top-0 left-0 w-max ${Y?`max-w-[400px]`:`max-w-[640px]`}`,children:U}):null,(0,z.jsxs)(`div`,{className:`absolute flex cursor-grab items-center rounded-full duration-300 select-none active:cursor-grabbing ${Y?`flex-col transition-[width,height] will-change-[width,height]`:`h-11 transition-[width] will-change-[width]`} ${!et&&s===`left`?`justify-end`:``}`,style:Ct,onPointerDown:h,onContextMenu:g,ref:f,children:[(0,z.jsx)(`span`,{className:`absolute inset-0 rounded-full transition-opacity duration-200 ${Z?`bg-[#17181b]`:`border border-white/10 bg-[#17181b]/95 shadow-lg shadow-black/40`}`,style:{opacity:+!!W},"aria-hidden":!0}),(0,z.jsx)(`div`,{className:`relative flex shrink-0 items-center ${Y?`flex-col`:`h-11`}`,style:Y?{paddingTop:o,paddingBottom:8,paddingInline:8}:s===`left`?{paddingLeft:8,paddingRight:o}:{paddingLeft:o,paddingRight:8},children:(0,z.jsx)(`div`,{className:`flex items-center gap-1 overflow-hidden transition-opacity duration-200 ${Y?`min-h-0 flex-col`:`min-w-0`}`,ref:ze,inert:!W,style:{opacity:+!!W,transitionDelay:W?`120ms`:`0ms`},children:e===`call`?(0,z.jsx)(Ue.Provider,{value:tt,children:(0,z.jsx)(ft,{call:R,assistantName:t,spotlight:_,watching:F,watchEnabled:de,picking:w,sharing:T,shareEnabled:ee,sharePicking:E,annotating:k,marked:M,annotationTool:A,vertical:Y,drawToolsPlacement:Y?d===`left`?`right`:`left`:u===`up`?`above`:`below`,drawToolsRef:j,onAnnotationTool:te,onControl:me,onWatch:S,onTeach:C,onShare:D,onStopShare:O,onAnnotate:ne,onClearMarks:re,openPicker:ie,onPicker:N,pickerSide:Y?d===`left`?`right`:`left`:d===`top`?`below`:`above`,shortcuts:ae,promptsDeferred:ye,lineExtra:vt,onReviewPrompts:be,accentHex:n,workShelfOpen:Te,onToggleWorkShelf:()=>{Ce(e=>!e)}})}):e===`dictating`&&fe!==void 0?(0,z.jsx)(ot,{dictating:fe,dictationText:pe}):e===`summary`&&I!==void 0?(0,z.jsx)(lt,{retro:I,onWatchRetro:se}):e===`offer`&&le!==void 0?(0,z.jsx)(st,{offer:le}):(0,z.jsx)(ct,{watching:F,onWatch:S})})})]}),(0,z.jsx)(`div`,{className:`absolute cursor-grab active:cursor-grabbing`,style:{width:J(q.idle.width),height:J(q.idle.height),pointerEvents:Ee?`none`:void 0,left:`50%`,top:Q,transform:`translate(-50%, -50%)`},onPointerDown:h,onContextMenu:g,ref:p,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute top-1/2 left-1/2 rounded-full transition-[width,height,opacity] duration-300`,style:{width:J(xt.width),height:J(xt.height),transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:Re?`opacity`:void 0,boxShadow:qe(n,J(q.rim),J(q.bloom)),opacity:Ee||G!==null||St&&!x?0:1}})}),(0,z.jsx)(it,{className:Fe?`opacity-100`:`opacity-0`,"data-companion-name":Fe?`shown`:`hidden`,style:{left:`50%`,top:Q,transform:`translate(-50%, calc(-100% - ${J(Je)}px - ${rt}px))`},label:B(`companionSurface.talk`)}),(0,z.jsx)(at,{label:B(e===`call`?`companionSurface.openVellum`:`companionSurface.talk`),accentHex:n,avatarSrc:r,character:i,attentive:a,busy:Le||F||Ie,collapsed:!Ee&&(!St||x),restingScale:o/c,style:{left:$,top:wt,zIndex:G===null?void 0:2,transform:`translate(-50%, -50%)${Ke===1?``:` scale(${Ke})`}`,transition:Re?void 0:Oe===null&&G===null?`left 300ms cubic-bezier(.2,.8,.2,1), top 300ms cubic-bezier(.2,.8,.2,1)`:`left 420ms cubic-bezier(.34,1.56,.64,1), top 420ms cubic-bezier(.34,1.56,.64,1)`},elementRef:m,onPointerDown:h,onContextMenu:g,onClick:oe}),he,ge,ue]})}var Y=`rgba(28, 28, 30, 0.55)`,tt=`backdrop-blur-md backdrop-saturate-150`,nt=(e,t,n)=>{let r=0,i=performance.now(),a=()=>{let o=e.current,s=o?.querySelector(t);if(o&&s){let e=o.getBoundingClientRect(),t=s.getBoundingClientRect(),r=e.width===0?1:o.offsetWidth/e.width;n({x:(t.left+t.width/2-e.left)*r,y:(t.top+t.height/2-e.top)*r})}performance.now()-i<500&&(r=requestAnimationFrame(a))};return a(),()=>{cancelAnimationFrame(r)}},rt=4;function it({className:e,style:t,label:n,shortcut:r,beak:i=`down`,...a}){return(0,z.jsxs)(`span`,{className:`pointer-events-none absolute rounded-md px-2 py-1 text-[11px] leading-4 font-medium whitespace-nowrap text-white/90 shadow-md shadow-black/30 transition-opacity duration-200 ${tt} ${e}`,style:{...t,backgroundColor:Y},"aria-hidden":!0,...a,children:[n,r===void 0?null:(0,z.jsx)(`span`,{className:`ml-1.5 font-normal text-white/60`,"data-shortcut":!0,children:r}),(0,z.jsx)(`span`,{className:`absolute ${i===`down`?`top-full left-1/2 h-1.5 w-2.5 -translate-x-1/2`:i===`left`?`top-1/2 right-full h-2.5 w-1.5 -translate-y-1/2`:`top-1/2 left-full h-2.5 w-1.5 -translate-y-1/2`} ${tt}`,style:{backgroundColor:Y,clipPath:i===`down`?`polygon(0 0, 100% 0, 50% 100%)`:i===`left`?`polygon(100% 0, 100% 100%, 0 50%)`:`polygon(0 0, 0 100%, 100% 50%)`},"aria-hidden":!0})]})}function at({accentHex:e,avatarSrc:t,character:n,busy:r=!1,attentive:i=!1,collapsed:a=!1,restingScale:o=1,label:s,style:l,elementRef:u,onPointerDown:d,onContextMenu:f,onClick:m}){let h=b();return(0,z.jsxs)(`div`,{role:`button`,"aria-label":s,className:`absolute grid size-11 cursor-grab place-items-center active:cursor-grabbing`,style:l,ref:u,onPointerDown:d,onContextMenu:f,onClick:m,children:[n===void 0?null:(0,z.jsx)(He,{character:n,capsule:Ke,enabled:a&&!r,className:`absolute top-1/2 left-1/2 transition-opacity duration-200`,style:{transform:`translate(-50%, -50%) scale(${o})`,opacity:+!!a}}),(0,z.jsx)(`div`,{className:`transition-[opacity,transform] duration-300`,style:{opacity:+!a,transform:a?`scale(0.35)`:`scale(1)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:h?`opacity`:void 0},children:(0,z.jsx)(`div`,{className:`companion-avatar-bob relative grid place-items-center`,style:{animation:h?`none`:void 0},children:n===void 0?t===void 0?(0,z.jsx)(`span`,{className:`relative size-7 rounded-full drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,style:{background:e},"aria-hidden":!0}):(0,z.jsx)(`img`,{src:t,alt:``,draggable:!1,className:`relative size-7 rounded-full object-contain drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)] [-webkit-user-drag:none]`}):(0,z.jsx)(`div`,{className:`relative drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,children:(0,z.jsx)(p,{components:c,traits:n,size:K,isAssistantBusy:r,attentive:i})})})})]})}function ot({dictating:e,dictationText:t}){let{t:n}=v(),r=t.trim();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),r?(0,z.jsx)(`span`,{dir:`auto`,className:`flex justify-end overflow-hidden text-[12px] whitespace-nowrap text-white/85`,style:{width:Je},children:(0,z.jsx)(`span`,{className:`shrink-0`,children:r})}):(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Je},children:n(e===`listening`?`companionSurface.dictating`:`companionSurface.dictatingTranscribing`)})]})}function st({offer:e}){let{t}=v();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Ye},children:e.reason===`claimed`?t(`companionSurface.offerHeard`,{app:e.app}):t(he(e.reason))})]})}function ct({watching:e=!1,onWatch:t}){return(0,z.jsx)(z.Fragment,{children:e&&(0,z.jsx)(vt,{onWatch:t})})}function X({watching:e,watchEnabled:t,picking:n,dimmed:r,onWatch:i,onTeach:a}){let{t:o}=v();return t?(0,z.jsx)($,{icon:(0,z.jsx)(ne,{className:`size-4`}),label:o(`companionSurface.teach`),dimmed:r,pressed:e||n,onClick:e?i:a??i}):e?(0,z.jsx)(vt,{onWatch:i}):null}function lt({retro:e,onWatchRetro:t}){let{t:n}=v();return e===`pending`?(0,z.jsx)(`span`,{className:`ml-1 shrink-0 text-[12px] text-white/85`,children:n(`companionSurface.summarizing`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(re,{className:`size-4`}),label:n(`companionSurface.showSummary`),showLabel:!0,onClick:()=>{t?.(!0)}}),(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`}),label:n(`companionSurface.notNow`),showLabel:!0,onClick:()=>{t?.(!1)}})]})}function ut({dock:e,top:t,width:n,height:r,barThickness:i,promptRef:a,children:o}){let s=i/2,c=e===`top`?`below`:e===`left`?`right`:e===`right`?`left`:`above`,l=c===`left`||c===`right`,u=l?{left:`50%`,top:t,width:n+s,height:r,transform:c===`right`?`translate(0, -50%)`:`translate(-100%, -50%)`,[c===`right`?`paddingLeft`:`paddingRight`]:s}:{left:`50%`,top:t,width:n,transform:c===`below`?`translate(-50%, 0)`:`translate(-50%, -100%)`,[c===`below`?`paddingTop`:`paddingBottom`]:s},d={above:`rounded-t-[22px]`,below:`rounded-b-[22px]`,left:`rounded-l-[22px]`,right:`rounded-r-[22px]`}[c];return(0,z.jsxs)(`div`,{ref:a,"data-theme":`dark`,"data-shelf-side":c,className:`absolute`,style:u,onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 bg-[#17181b] shadow-lg shadow-black/40 ${d}`}),(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute bg-white/10 ${l?`top-4 bottom-4 w-px`:`right-4 left-4 h-px`}`,style:{[dt[c]]:s}}),(0,z.jsx)(`div`,{className:`relative`,children:o})]})}var dt={above:`bottom`,below:`top`,left:`right`,right:`left`};function ft({call:e,assistantName:t,spotlight:n,watching:r,watchEnabled:i,picking:a,sharing:o,shareEnabled:s,sharePicking:c,annotating:l,marked:u,annotationTool:d,vertical:f,drawToolsPlacement:p,drawToolsRef:m,onAnnotationTool:h,onControl:g,onWatch:_,onTeach:y,onShare:b,onStopShare:x,onAnnotate:S,onClearMarks:C,openPicker:w,onPicker:T,pickerSide:ee,shortcuts:E,promptsDeferred:D=0,onReviewPrompts:O,lineExtra:A=0,accentHex:te,workShelfOpen:j,onToggleWorkShelf:ne}){let{t:M}=v();if(e===void 0)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Z,{vertical:f,extra:A,text:t===``?M(`companionSurface.calling`):M(`companionSurface.callingNamed`,{name:t})}),(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,onWatch:_,onTeach:y}),(0,z.jsx)(_t,{onControl:g})]});let re=e.work===void 0&&e.detail||e.label,N=e.work??[],oe=N.length>0,{muted:F,outputMuted:I}=e,se=e.assistantName;return(0,z.jsxs)(z.Fragment,{children:[oe?(0,z.jsx)(xt,{work:N,accentHex:te,open:j,onToggle:ne}):null,(0,z.jsx)(Z,{vertical:f,extra:A-(!f&&oe?Xe:0),text:re}),D>0?(0,z.jsx)(`button`,{type:`button`,"data-theme":`dark`,"aria-label":M(`companionPopover.pendingBadge`,{count:D}),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--system-negative-weak)] text-[13px] text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-hover)] hover:text-white`,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{O?.()},children:D}):null,(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,dimmed:n!==void 0,onWatch:_,onTeach:y}),(0,z.jsx)(pt,{sharing:o,shareEnabled:s,sharePicking:c,shortcut:s?E?.share:void 0,spotlit:n===`share`,dimmed:n!==void 0&&n!==`share`,onShare:b,onStopShare:x}),(0,z.jsx)(mt,{sharing:o,annotating:l,spotlit:n===`draw`,dimmed:n!==void 0&&n!==`draw`,shortcut:s?E?.draw:void 0,tool:d,placement:p,toolsRef:m,onAnnotate:S,onTool:h}),(0,z.jsx)(gt,{sharing:o,marked:u,dimmed:n!==void 0,onClearMarks:C}),(0,z.jsx)($,{icon:I?(0,z.jsx)(ae,{className:`size-4`}):(0,z.jsx)(ie,{className:`size-4`}),label:se===``?M(I?`companionSurface.unmuteAssistant`:`companionSurface.muteAssistant`):M(I?`companionSurface.unmuteAssistantNamed`:`companionSurface.muteAssistantNamed`,{name:se}),shortcut:E?.muteAssistant,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(I?`unmuteAssistantAudio`:`muteAssistantAudio`)}}),(0,z.jsx)($,{icon:F?(0,z.jsx)(k,{className:`size-4`}):(0,z.jsx)(P,{className:`size-4`}),label:M(F?`companionSurface.unmuteMicrophone`:`companionSurface.muteMicrophone`),shortcut:E?.muteMicrophone,control:`mute`,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(F?`unmuteMicrophone`:`muteMicrophone`)}}),(0,z.jsx)(Ct,{picker:`microphones`,label:M(`companionSurface.chooseMicrophone`),side:ee,open:w===`microphones`,onPicker:T}),(0,z.jsx)(_t,{dimmed:n!==void 0,onControl:g})]})}function Z({vertical:e,text:t,extra:n=0}){return e?(0,z.jsx)(`span`,{className:`mt-1 shrink-0 truncate text-[12px] text-white/85`,style:{height:Qe+n,writingMode:`vertical-rl`},"data-label":`line`,children:t}):(0,z.jsx)(`span`,{className:`ml-1 shrink-0 truncate text-[12px] text-white/85`,style:{width:J+n},"data-label":`line`,children:t})}function pt({sharing:e,shareEnabled:t,sharePicking:n,shortcut:r,spotlit:i,dimmed:a,onShare:o,onStopShare:s}){let{t:c}=v();return!t&&!e?null:(0,z.jsx)($,{icon:(0,z.jsx)(ue,{className:`size-4`}),label:c(`companionSurface.share`),shortcut:r,control:`share`,spotlit:i,dimmed:a,pressed:e||n,onClick:e?s:o})}function mt({sharing:e,annotating:t,shortcut:n,spotlit:r,dimmed:i,tool:a,placement:o,toolsRef:s,onAnnotate:c,onTool:l}){let{t:u}=v();return e?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(M,{className:`size-4`}),label:u(`companionSurface.draw`),shortcut:n,control:`draw`,spotlit:r,dimmed:i,pressed:t,className:`companion-draw-anchor`,onClick:()=>{c?.(!t)}}),t&&a!==void 0&&(0,z.jsx)(ht,{tool:a,placement:o,toolsRef:s,onTool:l})]}):null}function ht({tool:e,placement:t,toolsRef:n,onTool:r}){let{t:i}=v(),a=[{tool:`freehand`,icon:(0,z.jsx)(M,{className:`size-4`}),label:i(`companionSurface.drawFreehand`)},{tool:`line`,icon:(0,z.jsx)(de,{className:`size-4`}),label:i(`companionSurface.drawLine`)},{tool:`box`,icon:(0,z.jsx)(ee,{className:`size-4`}),label:i(`companionSurface.drawBox`)},{tool:`circle`,icon:(0,z.jsx)(C,{className:`size-4`}),label:i(`companionSurface.drawCircle`)}];return(0,z.jsx)(`div`,{className:`companion-draw-tools absolute flex items-center gap-0.5 rounded-full border border-white/10 bg-[#17181b]/95 p-0.5 shadow-lg shadow-black/40 companion-draw-tools-${t} ${t===`left`||t===`right`?`flex-col`:``}`,role:`group`,"aria-label":i(`companionSurface.drawTools`),"data-testid":`companion-draw-tools`,ref:n,onPointerDown:e=>{e.stopPropagation()},children:a.map(t=>(0,z.jsx)($,{icon:t.icon,label:t.label,pressed:e===t.tool,onClick:()=>{r?.(t.tool)}},t.tool))})}function gt({sharing:e,marked:t,dimmed:n,onClearMarks:r}){let{t:i}=v();return!e||!t?null:(0,z.jsx)($,{icon:(0,z.jsx)(le,{className:`size-4`}),label:i(`companionSurface.clearMarks`),dimmed:n,onClick:()=>{r?.()}})}function _t({dimmed:e,onControl:t}){let{t:n}=v();return(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`,strokeWidth:2.5}),label:n(`companionSurface.endSession`),tone:`negative`,dimmed:e,onClick:()=>{t?.(`endSession`)}})}function vt({onWatch:e}){let{t}=v();return(0,z.jsx)($,{icon:(0,z.jsx)(te,{className:`size-4`}),label:t(`companionSurface.stopTeaching`),onClick:e})}var Q=`-translate-y-[calc(50%+22px)]`,yt={right:`translate-x-[calc(50%+22px)]`,left:`-translate-x-[calc(50%+22px)]`},bt=e=>e===`above`?{className:Q,beak:`down`}:{className:yt[e],beak:e===`right`?`left`:`right`};function xt({work:e,accentHex:t,open:n,onToggle:r}){let{t:i}=v(),a=bt((0,L.useContext)(Ue)),o=Ee(e),s=W(e),c=o.length>0?o:s,l=e.at(-1),u=(c.length>0?c:e).map(e=>e.title).join(` · `);return(0,z.jsxs)(`button`,{type:`button`,"aria-label":o.length===0&&s.length>0?i(`companionSurface.workWaiting`,{count:s.length}):i(`companionSurface.workCount`,{count:o.length}),"aria-expanded":r===void 0?void 0:n,"data-control":`work`,disabled:r===void 0,className:`group flex h-7 shrink-0 items-center justify-center rounded-full px-1.5 transition-colors enabled:hover:bg-white/15 ${n?`bg-white/15`:``}`,style:{...De(t),width:Xe},onPointerDown:e=>{e.stopPropagation()},onClick:r,children:[(0,z.jsx)(`span`,{className:`relative grid size-5 place-items-center`,children:c.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`absolute inset-0 grid place-items-center`,children:(0,z.jsx)(Oe,{size:20,still:o.length===0})}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none font-semibold text-white/90 tabular-nums`,children:c.length})]}):(0,z.jsx)(ke,{state:l?.state===`failed`?`failed`:`done`})}),n?null:(0,z.jsx)(it,{label:u,className:`opacity-0 group-hover:opacity-100 ${a.className}`,beak:a.beak,"data-label":`hover`})]})}var St={above:A,below:oe,left:O,right:E};function Ct({picker:e,label:t,side:n,open:r,onPicker:i}){if(i===void 0)return null;let a=St[n];return(0,z.jsx)($,{icon:(0,z.jsx)(a,{className:`size-3.5`,strokeWidth:2.25}),label:t,pressed:r,narrow:!0,onClick:()=>{i(e)}})}function $({icon:e,label:t,shortcut:n,tone:r,showLabel:i=!1,pressed:a,spotlit:o=!1,dimmed:s=!1,control:c,narrow:l=!1,className:u=``,onClick:d}){let f=bt((0,L.useContext)(Ue));return(0,z.jsxs)(`button`,{type:`button`,"aria-label":t,"aria-pressed":a,"data-control":c,onClick:d,onPointerDown:e=>{e.stopPropagation()},className:`group flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-full text-[12px] transition-[background-color,opacity] duration-200 hover:bg-white/15 ${l?`-mx-1 px-0.5`:`px-2`} ${u} ${a===!0||o?`bg-white/15`:``} ${s?`opacity-35`:``} ${r===`negative`?`text-[#ff6b6b]`:r===`positive`?`text-[#5ee08a]`:`text-white/85`}`,children:[e,i?(0,z.jsx)(`span`,{children:t}):(0,z.jsx)(it,{label:t,shortcut:n,className:`opacity-0 group-hover:opacity-100 ${f.className}`,beak:f.beak,"data-label":`hover`})]})}export{we as a,_e as c,V as i,R as l,Te as n,Ce as o,H as r,B as s,et as t,me as u};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$d as t,BC as n,CS as r,Gg as i,Gl as a,Hg as o,Kg as s,Oa as c,Qd as l,Tn as u,Wg as d,Zg as f,Zi as p,ef as m,tf as h,ts as g,wC as _}from"./app-XG_RF2yi.js";import{E as v,d as y,s as b}from"./vendor-DwMhK7fD.js";import{t as x,x as S}from"./react-B9IgSVeK.js";import{Ai as C,Cr as w,Fa as T,G as ee,Gi as E,Ji as D,Ki as O,Tn as k,Wi as A,Xr as te,Ya as j,Yr as ne,Zt as M,bt as re,h as ie,i as N,m as ae,qi as oe,wn as P}from"./icons-C0wyat6T.js";import{l as F,n as I,t as se}from"./permission-setup-DQzKLhBn.js";import{t as ce}from"./companion-layout-DCGXuvsw.js";var le=j(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),ue=j(`screen-share`,[[`path`,{d:`M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3`,key:`i8wdob`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m17 8 5-5`,key:`fqif7o`}],[`path`,{d:`M17 3h5v5`,key:`1o3tu8`}]]),de=j(`slash`,[[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}]]),L=e(S(),1);function fe(e,t){return e===`inputMonitoring`||t?.canRequest===!1||e!==`screen`&&t?.status===`denied`}var pe={try:`microphone`,key:`inputMonitoring`,share:`screen`};function R(e){return e!==null&&(e.state.phase!==`known`||e.state.item.status!==`granted`)}function me(e){let n=e===null?null:pe[e]??null,i=e!==null,[o,s]=(0,L.useState)(void 0),[c,u]=(0,L.useState)(null),d=(0,L.useRef)(()=>{});return(0,L.useEffect)(()=>{if(u(null),!i)return;let e=!0,o=!1,c=0,f=!1,p=!1,_=null,v=async()=>{if(!(!e||o||p||_!==`ready`)){p=!0;try{let t=await g();if(!e||o||_!==`ready`||t===null||t===`com.apple.systempreferences`||t===`com.apple.SecurityAgent`)return;_=null,I(),await a()}catch(e){r(e,{context:`companionIntro.resumeAfterPermission`})}finally{p=!1}}},y=(t,r=!1)=>{e&&(s(e=>JSON.stringify(e)===JSON.stringify(t)?e:t),r||u(null),_!==null&&n!==null&&(_=t?t[n].status===`granted`?`ready`:`waiting`:null,v()))},b=t=>{e&&(n!==null&&u({kind:n,phase:`error`}),r(t,{context:`companionIntro.permission`,tags:{kind:n??`tour`}}))},x=async()=>{if(f||o)return;f=!0;let t=c;try{let n=await l();e&&t===c&&!o&&y(n),n===null&&clearInterval(S)}catch(e){t===c&&!o&&b(e)}finally{f=!1}},S=setInterval(()=>{x()},2e3),C=h(e=>{c+=1,y(e,o)});return x(),d.current=r=>{!e||o||n===null||(o=!0,c+=1,u({kind:n,phase:`requesting`}),(async()=>{try{let i=await l();if(!e)return;if(!i){y(null);return}let a=i[n];if(a.status===`granted`||a.status===`restricted`){y(i);return}let o=c;_=`waiting`;let s=n!==`microphone`&&F()?await se(n,r):fe(n,a)?await t(n):await m(n);e&&(o===c?y(s?{...i,[n]:s}:null):u(null))}catch(e){_=null,b(e)}finally{o=!1,v()}})())},()=>{e=!1,I(),clearInterval(S),C()}},[n,i]),n===null||o===null?null:{kind:n,state:c?.kind===n?{phase:c.phase}:o?{phase:`known`,item:o[n]}:{phase:`checking`},enable:e=>d.current(e)}}var z=x();function he(e){return e===`paste-failed`?`companionSurface.offerPasteFailed`:`companionSurface.offerNowhere`}var ge=260;function _e({offer:e,growth:t=`right`,cardGrowth:n=`up`,avatarBox:r=o,optionsBox:i=o,cardRef:a,onAnswer:s}){let{t:c}=v(),l=e.reason===`claimed`?c(`companionSurface.offerVersion`):c(he(e.reason)),{inUnits:u,avatarHalf:d,lineAt:f,edgeAt:p,introStepOff:m}=ce(r,i),h=u(m(n)),g=p(t,-d),y={top:f(n,0),transform:n===`up`?`translateY(calc(-100% - ${h}px))`:`translateY(${h}px)`};return(0,z.jsxs)(`div`,{ref:a,role:`group`,"aria-label":l,"data-companion-dictation-offer":!0,className:`absolute flex flex-col gap-2 rounded-2xl border border-white/10 bg-[#17181b]/95 px-3.5 py-3 shadow-lg shadow-black/40`,style:{width:ge,...g,...y},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`p`,{className:`text-[11px] font-medium tracking-wide text-white/45 uppercase select-none`,children:l}),(0,z.jsx)(_,{className:`max-h-40 flex-col`,size:20,fadeEdges:`end`,hideScrollBar:!0,children:(0,z.jsx)(`p`,{dir:`auto`,className:`text-[13px] leading-[1.45] text-white/90`,children:e.text})}),(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 pt-0.5`,children:[(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/55 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>s?.(`dismiss`),children:e.reason===`claimed`?c(`companionSurface.notNow`):c(`companionSurface.offerDiscard`)}),e.reason===`claimed`?(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full px-2.5 text-[12px] text-white/70 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>s?.(`quit`),children:c(`companionSurface.offerQuit`,{app:e.app})}):null,(0,z.jsx)(`button`,{type:`button`,className:`h-7 rounded-full bg-white/15 px-3 text-[12px] text-white transition-colors hover:bg-white/25`,onClick:()=>s?.(e.reason===`claimed`?`use`:`copy`),children:e.reason===`claimed`?c(`companionSurface.offerUse`):c(`companionSurface.offerCopy`)})]})]})}var ve={microphone:{action:`companionIntro.permission.microphoneAction`,body:`companionIntro.permission.microphoneBody`},inputMonitoring:{action:`companionIntro.permission.openSettings`,body:`companionIntro.permission.shortcutBody`},screen:{action:`companionIntro.permission.screenAction`,body:`companionIntro.permission.screenBody`}};function ye({permission:e}){let{t}=v(),r=(0,L.useRef)(null),{state:i}=e,a=i.phase===`known`?i.item:null,o=i.phase===`checking`||i.phase===`requesting`,s=fe(e.kind,a),c=a?.status===`restricted`,l=i.phase===`error`||a?.error!==void 0,u=ve[e.kind];return(0,z.jsxs)(`div`,{ref:r,className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:t(u.body)}),(0,z.jsx)(n,{size:`compact`,shape:`pill`,className:`self-start bg-white/15 text-white hover:bg-white/25`,loading:o,disabled:c||i.phase===`checking`,onClick:()=>{let t=r.current?.getBoundingClientRect();e.enable(t?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0)},children:t(s?`companionIntro.permission.openSettings`:u.action)}),(0,z.jsx)(`p`,{role:`status`,className:`text-[12px] leading-tight text-white/60`,children:c?t(`companionIntro.permission.restricted`):l?t(`companionIntro.permission.error`):s?t(e.kind===`microphone`?`companionIntro.permission.microphoneSettingsHint`:`companionIntro.permission.settingsHint`):o?t(`companionIntro.permission.waiting`):e.kind===`microphone`?t(`companionIntro.permission.microphonePromptHint`):null})]})}var be=3e3,xe={idle:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.idle.body`},meet:{title:`companionIntro.idle.title`,titleNamed:`companionIntro.idle.titleNamed`,body:`companionIntro.meet.body`},talk:{title:`companionIntro.talk.title`,body:`companionIntro.talk.body`},key:{title:`companionIntro.key.title`},share:{title:`companionIntro.share.title`,body:`companionIntro.share.body`},draw:{title:`companionIntro.draw.title`,body:`companionIntro.draw.body`},mute:{title:`companionIntro.mute.title`,body:`companionIntro.mute.body`},try:{title:`companionIntro.try.title`,body:`companionIntro.try.body`}},B=e=>f(e),V=e=>({phase:`listening`,label:e,accentHex:``,muted:!1,outputMuted:!1,detail:``,approvalRequestId:``,assistantName:``}),H={share:`⌥S`,draw:`⌥D`,muteMicrophone:`⌥M`,muteAssistant:`⌥A`},Se={share:{icon:(0,z.jsx)(ue,{className:`size-5`}),shortcut:H.share},draw:{icon:(0,z.jsx)(M,{className:`size-5`}),shortcut:H.draw},mute:{icon:(0,z.jsx)(P,{className:`size-5`}),shortcut:H.muteMicrophone}},Ce=e=>B(e)===void 0?null:`call`,we=(e,t)=>B(e)===void 0?null:{call:V(t),sharing:e!==`share`};function Te({beat:e,growth:t=`right`,cardGrowth:n=`up`,avatarBox:r=o,optionsBox:a=o,accentHex:c,assistantName:l,cardRef:u,onAdvance:p,permission:m=null,greeted:h=!1,voiceKeyTaps:g=0,chordPresses:_=0,chordControl:y}){let{t:b}=v(),x=d.indexOf(e),S=x===d.length-1,C=x<=0,w=xe[e],T=R(m),ee=m?.state.phase===`checking`,E=i[e],D=f(e),O=D===void 0?void 0:Se[D],[k,A]=(0,L.useState)(!1);(0,L.useEffect)(()=>{A(!1)},[e]),(0,L.useEffect)(()=>{if(!k)return;let e=setTimeout(()=>{A(!1)},be);return()=>{clearTimeout(e)}},[k]),(0,L.useEffect)(()=>{A(!1)},[g]);let[te,j]=(0,L.useState)(g),[ne,M]=(0,L.useState)(_),[re,ie]=(0,L.useState)(e);re===e?g<te&&j(g):(ie(e),j(g),M(_));let ae=Math.min(Math.max(g-te,0),2);_<ne&&M(_);let oe=D!==void 0&&y===D&&_>ne,{inUnits:P,avatarHalf:F,gap:I,lineAt:se,edgeAt:le,introStepOff:ue}=ce(r,a),de=n===`down`||B(e)===void 0?P(ue(n)):P(F+I)+22+P(F)+6,fe=le(t,-F),pe={top:se(n,0),transform:n===`up`?`translateY(calc(-100% - ${de}px))`:`translateY(${de}px)`};return(0,z.jsxs)(`div`,{ref:u,role:`group`,"aria-label":b(`companionIntro.ariaLabel`),className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-5 shadow-lg shadow-black/40`,style:{width:320,height:224,...fe,...pe},onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`button`,{type:`button`,"aria-label":b(`companionIntro.close`),className:`absolute top-2 right-2 flex size-6 items-center justify-center rounded-full text-white/45 transition-colors hover:bg-white/10 hover:text-white/80`,onClick:()=>p?.(`dismiss`),children:(0,z.jsx)(N,{className:`size-3.5`})}),(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`pr-6 text-[16px] leading-tight font-medium text-white`,children:(0,z.jsx)(`span`,{className:`line-clamp-2`,children:`titleNamed`in w&&l!==void 0?b(w.titleNamed,{name:l}):b(w.title)})}),ee?null:T&&m!==null?(0,z.jsx)(ye,{permission:m}):(0,z.jsxs)(z.Fragment,{children:[`body`in w?(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:b(e===`talk`&&h?`companionIntro.talk.greeted`:w.body)}):null,e===`talk`&&(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0})}),e===`key`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-[14px] leading-[1.45] text-white/70`,children:b(k?`companionIntro.key.scolded`:`companionIntro.talk.gesture`)}),(0,z.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})})]}),e===`try`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-3`,children:[(0,z.jsx)(`span`,{"data-avatar-stage":!0,className:`block size-11`,"aria-hidden":!0}),(0,z.jsx)(U,{label:`fn`,taps:ae,scolded:k,take:()=>{A(!0)}})]}),(0,z.jsx)(`p`,{className:`text-center text-[11px] leading-tight text-white/45`,children:b(k?`companionIntro.key.scolded`:`companionIntro.try.how`)})]}),O!==void 0&&(0,z.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-xl bg-white/10 text-white/85`,children:O.icon}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:b(`companionIntro.call.click`)})]}),(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,z.jsx)(`span`,{className:`flex h-10 items-center rounded-xl border px-3 text-[13px] font-medium transition-colors ${oe?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:`border-white/15 bg-white/10 text-white/85`}`,children:O.shortcut}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none text-white/40`,children:b(`companionIntro.call.shortcut`)})]})]})]})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 pt-2`,children:[(0,z.jsx)(`div`,{className:`flex items-center gap-1`,"aria-hidden":!0,children:s.map(e=>(0,z.jsx)(`span`,{className:`size-1.5 rounded-full transition-colors`,style:{backgroundColor:e===E?c??`#5eead4`:`rgba(255,255,255,.2)`}},e))}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[C?null:(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full px-3 text-[14px] text-white/60 transition-colors hover:bg-white/10 hover:text-white`,onClick:()=>p?.(`back`),children:b(`companionIntro.back`)}),(0,z.jsx)(`button`,{type:`button`,className:`h-8 whitespace-nowrap rounded-full bg-white/15 px-3 text-[14px] text-white transition-colors hover:bg-white/25`,onClick:()=>p?.(`next`),children:b(S?`companionIntro.done`:T&&!ee?`companionIntro.permission.skip`:`companionIntro.next`)})]})]})]})}function U({label:e,taps:t=0,scolded:n=!1,take:r}){let i=t>=2?`border-emerald-300/90 bg-emerald-400/55 text-emerald-50`:t===1?`border-emerald-400/70 bg-emerald-400/20 text-emerald-100`:`border-white/20 bg-white/10 text-white/85`,a=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(w,{className:`size-4`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`absolute bottom-1 left-1.5 text-[9px] leading-none opacity-70`,"aria-hidden":!0,children:e})]}),o=`relative inline-flex size-11 items-center justify-center rounded-lg border font-medium shadow-[inset_0_-2px_0_rgba(0,0,0,.4)] transition-[color,background-color,border-color,transform] ${i} ${n?`scale-90 opacity-70`:``}`;return r===void 0?(0,z.jsx)(`span`,{className:o,"aria-label":e,children:a}):(0,z.jsx)(`button`,{type:`button`,className:`${o}${t===0?`hover:border-white/40 hover:bg-white/20`:``}`,"aria-label":e,onClick:r,children:a})}var Ee=e=>e.filter(e=>e.state===`running`),W=e=>e.filter(e=>e.state===`waiting`),De=e=>({"--companion-ring-accent":e});function Oe({size:e,still:t=!1}){return(0,z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,className:`shrink-0 ${t?``:`companion-work-spin`}`,"aria-hidden":!0,children:[(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeOpacity:`0.2`,strokeWidth:`2`}),(0,z.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,fill:`none`,stroke:`var(--companion-ring-accent)`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:t?void 0:`10 28`,strokeOpacity:t?.6:void 0})]})}function ke({state:e}){return e===`done`?(0,z.jsx)(D,{className:`companion-work-pop size-3.5 shrink-0 text-[var(--companion-ring-accent)]`,"aria-hidden":!0}):(0,z.jsx)(N,{className:`companion-work-pop size-3.5 shrink-0 text-white/50`,"aria-hidden":!0})}function Ae(e){let t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)}`}function G(){let[e,t]=(0,L.useState)(()=>Date.now());return(0,L.useEffect)(()=>{let e=window.setInterval(()=>{t(Date.now())},1e3);return()=>{window.clearInterval(e)}},[]),e}function je({work:e,accentHex:t}){let{t:n}=v(),r=G(),i=e.slice(0,5),a=e.length-i.length;return(0,z.jsxs)(`div`,{className:`flex w-full min-w-[300px] flex-col gap-1.5 px-4 py-3 text-[12px] text-white/85`,style:De(t),"data-companion-work-shelf":!0,children:[i.map(e=>(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.state===`running`||e.state===`waiting`?(0,z.jsx)(Oe,{size:14,still:e.state===`waiting`}):(0,z.jsx)(ke,{state:e.state}),(0,z.jsx)(`span`,{className:`max-w-[55%] shrink-0 truncate font-medium ${e.state===`done`||e.state===`failed`?`text-white/55`:``}`,children:e.title}),(0,z.jsx)(`span`,{className:`companion-work-fade min-w-0 flex-1 truncate text-white/50`,children:e.state===`running`?e.step:e.state===`waiting`?n(`companionSurface.workWaitingStep`):e.state===`done`?n(`companionSurface.workDone`):n(`companionSurface.workStopped`)},e.state===`running`?e.step:e.state),e.kind===`subagent`?(0,z.jsx)(`span`,{className:`shrink-0 text-[11px] text-white/40 tabular-nums`,children:Ae(r-e.startedAt)}):null]},e.id)),a>0?(0,z.jsx)(`div`,{className:`pl-[22px] text-[11px] text-white/40`,children:n(`companionSurface.workMore`,{count:a})}):null]})}var Me={min:3,max:10},Ne=(e=Math.random)=>{let t=e();return t<1/3?`top`:t<2/3?`topLeft`:`topRight`},Pe=1600,Fe=.22,Ie=.04,Le=4,Re=(e,t)=>{let n=Math.min(.95,Math.max(.25,e.eyeCenterFrac+e.eyeHalfFrac+Ie)),r=Math.min(t,24,14/n),i=r*n;return{size:r,exposed:i,clip:{width:r+2*Le,height:i+Le},rest:i+2}},ze=(e,t=Math.random)=>(e.min+t()*(e.max-e.min))*1e3;function Be(e,t=Me){let[n,r]=(0,L.useState)(0),{min:i,max:a}=t;return(0,L.useEffect)(()=>{if(!e)return;let t,n=()=>{t=setTimeout(()=>{r(e=>e+1),n()},ze({min:i,max:a}))};return n(),()=>{clearTimeout(t)}},[e,i,a]),n}var Ve=(e,t,n={width:0,height:0})=>{let r=e===`topLeft`?n.width/4:e===`topRight`?n.width*3/4:n.width/2;return{slot:{width:t.width,height:t.height,bottom:`100%`,left:r-t.width/2}}};function He({character:e,capsule:t,enabled:n,held:r=!1,edge:i,interval:a=Me,className:o,style:s}){let l=b(),d=(0,L.useMemo)(()=>u(c,e),[e]),f=Be(n&&!r&&!l&&d!==null,a),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(`top`);if((0,L.useEffect)(()=>{if(f===0)return;_(Ne()),h(!0);let e=setTimeout(()=>{h(!1)},Pe);return()=>{clearTimeout(e)}},[f]),d===null||l)return null;let v=Re(d,t.width),x=r||m,S=i??g,C=Ve(S,v.clip,t);return(0,z.jsx)(`div`,{className:`companion-peek ${o??``}`,style:{width:t.width,height:t.height,...s},"data-risen":x,"data-edge":S,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute`,style:C.slot,children:(0,z.jsx)(`div`,{className:`absolute inset-0 overflow-hidden`,children:(0,z.jsx)(y.div,{className:`absolute left-1/2`,style:{width:v.size,height:v.size,marginLeft:-v.size/2,top:v.clip.height-v.exposed},initial:{y:v.rest},animate:{y:x?0:v.rest},transition:r?{duration:0}:x?{type:`spring`,stiffness:280,damping:14}:{duration:Fe,ease:`easeIn`},children:(0,z.jsx)(p,{components:c,traits:e,size:v.size})})})})})}var Ue=(0,L.createContext)(`above`),We=`#5eead4`,Ge=new Set([`transcribing`,`thinking`,`speaking`]),K=28,q={idle:{width:64,height:14},closing:K,rim:2,bloom:4},Ke=q.idle,qe=(e,t,n)=>[`inset 0 0 0 ${t}px color-mix(in srgb, ${e} 78%, transparent)`,`0 0 ${n}px color-mix(in srgb, ${e} 85%, transparent)`,`0 0 ${n*4}px color-mix(in srgb, ${e} 42%, transparent)`,`0 8px 24px rgba(0, 0, 0, 0.45)`].join(`, `),Je=244,Ye=200,J=120,Xe=32,Ze={watching:40,summary:220,dictating:Je+32,offer:Ye+32,call:4+J+180},Qe=84,$e={width:28,height:Qe+140+20};function et({phase:e,assistantName:t=``,accentHex:n=We,avatarSrc:r,character:i,hovered:a=!1,growth:s=`right`,avatarBox:c=o,optionsBox:l=o,cardGrowth:u=`up`,dock:d=`bottom`,rootRef:f,restingPillRef:p,avatarRef:m,onSurfacePointerDown:h,onSurfaceContextMenu:g,spotlight:_,avatarStaged:y=!1,avatarTucked:x=!1,onWatch:S,onTeach:C,picking:w=!1,sharing:T=!1,shareEnabled:ee=!1,sharePicking:E=!1,onShare:D,onStopShare:O,annotating:k=!1,annotationTool:A,onAnnotationTool:te,drawToolsRef:j,onAnnotate:ne,marked:M=!1,onClearMarks:re,openPicker:ie,onPicker:N,shortcuts:ae,onAvatarClick:oe,working:P=!1,watching:F=!1,watchRetro:I,onWatchRetro:se,dictationOffer:le,offer:ue,watchEnabled:de=!1,dictating:fe,dictationText:pe=``,call:R,onControl:me,intro:he,picker:ge,prompt:_e,promptRef:ve,promptsDeferred:ye=0,onReviewPrompts:be,onWorkShelfChange:xe}){let{t:B}=v(),V=e===`call`?R?.work:void 0,H=V!==void 0&&V.length>0,[Se,Ce]=(0,L.useState)(!1);(0,L.useEffect)(()=>{H||Ce(!1)},[H]);let we=d===`left`||d===`right`?void 0:_e,Te=we==null?Se&&H:!1;(0,L.useEffect)(()=>{xe?.(Te)},[xe,Te]);let U=(0,L.useMemo)(()=>we??(Se&&H?(0,z.jsx)(je,{work:V,accentHex:n}):void 0),[we,Se,H,V,n]),Ee=e!==`resting`,W=e===`call`||e===`dictating`||e===`offer`||e===`summary`||e===`watching`,De=(0,L.useRef)(null),[Oe,ke]=(0,L.useState)(null),Ae=_===`talk`?void 0:_;(0,L.useEffect)(()=>{if(Ae===void 0){ke(null);return}return nt(De,`[data-control="${Ae}"]`,e=>{ke(e.x)})},[Ae,e,T]);let[G,Me]=(0,L.useState)(null);(0,L.useEffect)(()=>{if(!y){Me(null);return}return nt(De,`[data-avatar-stage]`,Me)},[y,e]);let[Ne,Pe]=(0,L.useState)(!1);(0,L.useEffect)(()=>{if(e!==`hover`){Pe(!1);return}let t=setTimeout(()=>{Pe(!0)},500);return()=>{clearTimeout(t)}},[e]);let Fe=he==null?_===`talk`||e===`hover`&&Ne:!1,Ie=I===`pending`,Le=P||R!==void 0&&Ge.has(R.phase),Re=b(),ze=(0,L.useRef)(null),[Be,Ve]=(0,L.useState)(null),He=(0,L.useRef)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=ze.current;if(!e)return;let t=()=>{Ve({width:e.scrollWidth-He.current.width,height:e.scrollHeight-He.current.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[e]);let{scale:K,avatarRel:Ke,avatarHalf:Je,gap:Ye,inUnits:J,lineAt:Xe,edgeAt:Qe}=ce(c,l),et=e===`call`,Y=et&&(d===`left`||d===`right`),tt=Y?d===`left`?`right`:`left`:`above`,X=W?Y?(Be?.width??$e.width)+16:o+(Be?.width??Ze[e])+8:0,dt=W?o+(Be?.height??$e.height)+8:0,Z=et&&U!=null,pt=(0,L.useRef)(null),[mt,ht]=(0,L.useState)({width:0,height:0});(0,L.useLayoutEffect)(()=>{let e=pt.current;if(!Z||e===null)return;let t=()=>{let t=e.getBoundingClientRect();ht({width:Math.ceil(t.width/K),height:Math.ceil(t.height/K)})};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Z,U,K]);let gt=Z&&!Y?Math.max(X,mt.width):X,_t=Z&&Y?Math.max(dt,mt.height):dt,vt=Y?_t-dt:gt-X;(0,L.useLayoutEffect)(()=>{He.current=Y?{width:0,height:vt}:{width:vt,height:0}},[vt,Y]);let Q=Y?`50%`:Xe(u,0),yt=Qe(s,s===`left`?l/2:-(l/2)),bt=c/o,xt=Ee?{width:q.closing*bt,height:q.closing*bt}:q.idle,St=he!=null,Ct=et?{width:gt,...Y?{height:_t}:{},left:`50%`,top:Q,transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`}:{width:X,...yt,top:Q,transform:`translateY(-50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`},$=G===null?Oe!==null&&!Y?`${Oe}px`:et&&!Y?`calc(50% - ${gt/2-o/2}px)`:`50%`:`${G.x}px`,wt=G===null?Oe!==null&&!Y?`calc(${Q} - ${J(Je+Ye)+22}px)`:Y?`calc(50% - ${_t/2-o/2}px)`:Q:`${G.y}px`;return(0,z.jsxs)(`div`,{ref:De,className:`absolute top-0 left-0 origin-top-left`,style:{width:`${100/K}%`,height:`${100/K}%`,transform:`scale(${K})`},children:[Z?(0,z.jsx)(ut,{dock:d,top:Q,width:Y?mt.width:gt,height:_t,barThickness:Y?X:44,promptRef:ve,children:U}):null,Z?(0,z.jsx)(`div`,{ref:pt,inert:!0,"aria-hidden":!0,"data-theme":`dark`,className:`pointer-events-none invisible absolute top-0 left-0 w-max ${Y?`max-w-[400px]`:`max-w-[640px]`}`,children:U}):null,(0,z.jsxs)(`div`,{className:`absolute flex cursor-grab items-center rounded-full duration-300 select-none active:cursor-grabbing ${Y?`flex-col transition-[width,height] will-change-[width,height]`:`h-11 transition-[width] will-change-[width]`} ${!et&&s===`left`?`justify-end`:``}`,style:Ct,onPointerDown:h,onContextMenu:g,ref:f,children:[(0,z.jsx)(`span`,{className:`absolute inset-0 rounded-full transition-opacity duration-200 ${Z?`bg-[#17181b]`:`border border-white/10 bg-[#17181b]/95 shadow-lg shadow-black/40`}`,style:{opacity:+!!W},"aria-hidden":!0}),(0,z.jsx)(`div`,{className:`relative flex shrink-0 items-center ${Y?`flex-col`:`h-11`}`,style:Y?{paddingTop:o,paddingBottom:8,paddingInline:8}:s===`left`?{paddingLeft:8,paddingRight:o}:{paddingLeft:o,paddingRight:8},children:(0,z.jsx)(`div`,{className:`flex items-center gap-1 overflow-hidden transition-opacity duration-200 ${Y?`min-h-0 flex-col`:`min-w-0`}`,ref:ze,inert:!W,style:{opacity:+!!W,transitionDelay:W?`120ms`:`0ms`},children:e===`call`?(0,z.jsx)(Ue.Provider,{value:tt,children:(0,z.jsx)(ft,{call:R,assistantName:t,spotlight:_,watching:F,watchEnabled:de,picking:w,sharing:T,shareEnabled:ee,sharePicking:E,annotating:k,marked:M,annotationTool:A,vertical:Y,drawToolsPlacement:Y?d===`left`?`right`:`left`:u===`up`?`above`:`below`,drawToolsRef:j,onAnnotationTool:te,onControl:me,onWatch:S,onTeach:C,onShare:D,onStopShare:O,onAnnotate:ne,onClearMarks:re,openPicker:ie,onPicker:N,pickerSide:Y?d===`left`?`right`:`left`:d===`top`?`below`:`above`,shortcuts:ae,promptsDeferred:ye,lineExtra:vt,onReviewPrompts:be,accentHex:n,workShelfOpen:Te,onToggleWorkShelf:()=>{Ce(e=>!e)}})}):e===`dictating`&&fe!==void 0?(0,z.jsx)(ot,{dictating:fe,dictationText:pe}):e===`summary`&&I!==void 0?(0,z.jsx)(lt,{retro:I,onWatchRetro:se}):e===`offer`&&le!==void 0?(0,z.jsx)(st,{offer:le}):(0,z.jsx)(ct,{watching:F,onWatch:S})})})]}),(0,z.jsx)(`div`,{className:`absolute cursor-grab active:cursor-grabbing`,style:{width:J(q.idle.width),height:J(q.idle.height),pointerEvents:Ee?`none`:void 0,left:`50%`,top:Q,transform:`translate(-50%, -50%)`},onPointerDown:h,onContextMenu:g,ref:p,"aria-hidden":!0,children:(0,z.jsx)(`div`,{className:`absolute top-1/2 left-1/2 rounded-full transition-[width,height,opacity] duration-300`,style:{width:J(xt.width),height:J(xt.height),transform:`translate(-50%, -50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:Re?`opacity`:void 0,boxShadow:qe(n,J(q.rim),J(q.bloom)),opacity:Ee||G!==null||St&&!x?0:1}})}),(0,z.jsx)(it,{className:Fe?`opacity-100`:`opacity-0`,"data-companion-name":Fe?`shown`:`hidden`,style:{left:`50%`,top:Q,transform:`translate(-50%, calc(-100% - ${J(Je)}px - ${rt}px))`},label:B(`companionSurface.talk`)}),(0,z.jsx)(at,{label:B(e===`call`?`companionSurface.openVellum`:`companionSurface.talk`),accentHex:n,avatarSrc:r,character:i,attentive:a,busy:Le||F||Ie,collapsed:!Ee&&(!St||x),restingScale:o/c,style:{left:$,top:wt,zIndex:G===null?void 0:2,transform:`translate(-50%, -50%)${Ke===1?``:` scale(${Ke})`}`,transition:Re?void 0:Oe===null&&G===null?`left 300ms cubic-bezier(.2,.8,.2,1), top 300ms cubic-bezier(.2,.8,.2,1)`:`left 420ms cubic-bezier(.34,1.56,.64,1), top 420ms cubic-bezier(.34,1.56,.64,1)`},elementRef:m,onPointerDown:h,onContextMenu:g,onClick:oe}),he,ge,ue]})}var Y=`rgba(28, 28, 30, 0.55)`,tt=`backdrop-blur-md backdrop-saturate-150`,nt=(e,t,n)=>{let r=0,i=performance.now(),a=()=>{let o=e.current,s=o?.querySelector(t);if(o&&s){let e=o.getBoundingClientRect(),t=s.getBoundingClientRect(),r=e.width===0?1:o.offsetWidth/e.width;n({x:(t.left+t.width/2-e.left)*r,y:(t.top+t.height/2-e.top)*r})}performance.now()-i<500&&(r=requestAnimationFrame(a))};return a(),()=>{cancelAnimationFrame(r)}},rt=4;function it({className:e,style:t,label:n,shortcut:r,beak:i=`down`,...a}){return(0,z.jsxs)(`span`,{className:`pointer-events-none absolute rounded-md px-2 py-1 text-[11px] leading-4 font-medium whitespace-nowrap text-white/90 shadow-md shadow-black/30 transition-opacity duration-200 ${tt} ${e}`,style:{...t,backgroundColor:Y},"aria-hidden":!0,...a,children:[n,r===void 0?null:(0,z.jsx)(`span`,{className:`ml-1.5 font-normal text-white/60`,"data-shortcut":!0,children:r}),(0,z.jsx)(`span`,{className:`absolute ${i===`down`?`top-full left-1/2 h-1.5 w-2.5 -translate-x-1/2`:i===`left`?`top-1/2 right-full h-2.5 w-1.5 -translate-y-1/2`:`top-1/2 left-full h-2.5 w-1.5 -translate-y-1/2`} ${tt}`,style:{backgroundColor:Y,clipPath:i===`down`?`polygon(0 0, 100% 0, 50% 100%)`:i===`left`?`polygon(100% 0, 100% 100%, 0 50%)`:`polygon(0 0, 0 100%, 100% 50%)`},"aria-hidden":!0})]})}function at({accentHex:e,avatarSrc:t,character:n,busy:r=!1,attentive:i=!1,collapsed:a=!1,restingScale:o=1,label:s,style:l,elementRef:u,onPointerDown:d,onContextMenu:f,onClick:m}){let h=b();return(0,z.jsxs)(`div`,{role:`button`,"aria-label":s,className:`absolute grid size-11 cursor-grab place-items-center active:cursor-grabbing`,style:l,ref:u,onPointerDown:d,onContextMenu:f,onClick:m,children:[n===void 0?null:(0,z.jsx)(He,{character:n,capsule:Ke,enabled:a&&!r,className:`absolute top-1/2 left-1/2 transition-opacity duration-200`,style:{transform:`translate(-50%, -50%) scale(${o})`,opacity:+!!a}}),(0,z.jsx)(`div`,{className:`transition-[opacity,transform] duration-300`,style:{opacity:+!a,transform:a?`scale(0.35)`:`scale(1)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,transitionProperty:h?`opacity`:void 0},children:(0,z.jsx)(`div`,{className:`companion-avatar-bob relative grid place-items-center`,style:{animation:h?`none`:void 0},children:n===void 0?t===void 0?(0,z.jsx)(`span`,{className:`relative size-7 rounded-full drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,style:{background:e},"aria-hidden":!0}):(0,z.jsx)(`img`,{src:t,alt:``,draggable:!1,className:`relative size-7 rounded-full object-contain drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)] [-webkit-user-drag:none]`}):(0,z.jsx)(`div`,{className:`relative drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,children:(0,z.jsx)(p,{components:c,traits:n,size:K,isAssistantBusy:r,attentive:i})})})})]})}function ot({dictating:e,dictationText:t}){let{t:n}=v(),r=t.trim();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),r?(0,z.jsx)(`span`,{dir:`auto`,className:`flex justify-end overflow-hidden text-[12px] whitespace-nowrap text-white/85`,style:{width:Je},children:(0,z.jsx)(`span`,{className:`shrink-0`,children:r})}):(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Je},children:n(e===`listening`?`companionSurface.dictating`:`companionSurface.dictatingTranscribing`)})]})}function st({offer:e}){let{t}=v();return(0,z.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 px-1`,children:[(0,z.jsx)(T,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate text-[12px] text-white/85`,style:{width:Ye},children:e.reason===`claimed`?t(`companionSurface.offerHeard`,{app:e.app}):t(he(e.reason))})]})}function ct({watching:e=!1,onWatch:t}){return(0,z.jsx)(z.Fragment,{children:e&&(0,z.jsx)(vt,{onWatch:t})})}function X({watching:e,watchEnabled:t,picking:n,dimmed:r,onWatch:i,onTeach:a}){let{t:o}=v();return t?(0,z.jsx)($,{icon:(0,z.jsx)(ne,{className:`size-4`}),label:o(`companionSurface.teach`),dimmed:r,pressed:e||n,onClick:e?i:a??i}):e?(0,z.jsx)(vt,{onWatch:i}):null}function lt({retro:e,onWatchRetro:t}){let{t:n}=v();return e===`pending`?(0,z.jsx)(`span`,{className:`ml-1 shrink-0 text-[12px] text-white/85`,children:n(`companionSurface.summarizing`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(re,{className:`size-4`}),label:n(`companionSurface.showSummary`),showLabel:!0,onClick:()=>{t?.(!0)}}),(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`}),label:n(`companionSurface.notNow`),showLabel:!0,onClick:()=>{t?.(!1)}})]})}function ut({dock:e,top:t,width:n,height:r,barThickness:i,promptRef:a,children:o}){let s=i/2,c=e===`top`?`below`:e===`left`?`right`:e===`right`?`left`:`above`,l=c===`left`||c===`right`,u=l?{left:`50%`,top:t,width:n+s,height:r,transform:c===`right`?`translate(0, -50%)`:`translate(-100%, -50%)`,[c===`right`?`paddingLeft`:`paddingRight`]:s}:{left:`50%`,top:t,width:n,transform:c===`below`?`translate(-50%, 0)`:`translate(-50%, -100%)`,[c===`below`?`paddingTop`:`paddingBottom`]:s},d={above:`rounded-t-[22px]`,below:`rounded-b-[22px]`,left:`rounded-l-[22px]`,right:`rounded-r-[22px]`}[c];return(0,z.jsxs)(`div`,{ref:a,"data-theme":`dark`,"data-shelf-side":c,className:`absolute`,style:u,onPointerDown:e=>{e.stopPropagation()},children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 bg-[#17181b] shadow-lg shadow-black/40 ${d}`}),(0,z.jsx)(`span`,{"aria-hidden":!0,className:`absolute bg-white/10 ${l?`top-4 bottom-4 w-px`:`right-4 left-4 h-px`}`,style:{[dt[c]]:s}}),(0,z.jsx)(`div`,{className:`relative`,children:o})]})}var dt={above:`bottom`,below:`top`,left:`right`,right:`left`};function ft({call:e,assistantName:t,spotlight:n,watching:r,watchEnabled:i,picking:a,sharing:o,shareEnabled:s,sharePicking:c,annotating:l,marked:u,annotationTool:d,vertical:f,drawToolsPlacement:p,drawToolsRef:m,onAnnotationTool:h,onControl:g,onWatch:_,onTeach:y,onShare:b,onStopShare:x,onAnnotate:S,onClearMarks:C,openPicker:w,onPicker:T,pickerSide:ee,shortcuts:E,promptsDeferred:D=0,onReviewPrompts:O,lineExtra:A=0,accentHex:te,workShelfOpen:j,onToggleWorkShelf:ne}){let{t:M}=v();if(e===void 0)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Z,{vertical:f,extra:A,text:t===``?M(`companionSurface.calling`):M(`companionSurface.callingNamed`,{name:t})}),(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,onWatch:_,onTeach:y}),(0,z.jsx)(_t,{onControl:g})]});let re=e.work===void 0&&e.detail||e.label,N=e.work??[],oe=N.length>0,{muted:F,outputMuted:I}=e,se=e.assistantName;return(0,z.jsxs)(z.Fragment,{children:[oe?(0,z.jsx)(xt,{work:N,accentHex:te,open:j,onToggle:ne}):null,(0,z.jsx)(Z,{vertical:f,extra:A-(!f&&oe?Xe:0),text:re}),D>0?(0,z.jsx)(`button`,{type:`button`,"data-theme":`dark`,"aria-label":M(`companionPopover.pendingBadge`,{count:D}),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--system-negative-weak)] text-[13px] text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-hover)] hover:text-white`,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{O?.()},children:D}):null,(0,z.jsx)(X,{watching:r,watchEnabled:i,picking:a,dimmed:n!==void 0,onWatch:_,onTeach:y}),(0,z.jsx)(pt,{sharing:o,shareEnabled:s,sharePicking:c,shortcut:s?E?.share:void 0,spotlit:n===`share`,dimmed:n!==void 0&&n!==`share`,onShare:b,onStopShare:x}),(0,z.jsx)(mt,{sharing:o,annotating:l,spotlit:n===`draw`,dimmed:n!==void 0&&n!==`draw`,shortcut:s?E?.draw:void 0,tool:d,placement:p,toolsRef:m,onAnnotate:S,onTool:h}),(0,z.jsx)(gt,{sharing:o,marked:u,dimmed:n!==void 0,onClearMarks:C}),(0,z.jsx)($,{icon:I?(0,z.jsx)(ae,{className:`size-4`}):(0,z.jsx)(ie,{className:`size-4`}),label:se===``?M(I?`companionSurface.unmuteAssistant`:`companionSurface.muteAssistant`):M(I?`companionSurface.unmuteAssistantNamed`:`companionSurface.muteAssistantNamed`,{name:se}),shortcut:E?.muteAssistant,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(I?`unmuteAssistantAudio`:`muteAssistantAudio`)}}),(0,z.jsx)($,{icon:F?(0,z.jsx)(k,{className:`size-4`}):(0,z.jsx)(P,{className:`size-4`}),label:M(F?`companionSurface.unmuteMicrophone`:`companionSurface.muteMicrophone`),shortcut:E?.muteMicrophone,control:`mute`,spotlit:n===`mute`,dimmed:n!==void 0&&n!==`mute`,onClick:()=>{g?.(F?`unmuteMicrophone`:`muteMicrophone`)}}),(0,z.jsx)(Ct,{picker:`microphones`,label:M(`companionSurface.chooseMicrophone`),side:ee,open:w===`microphones`,onPicker:T}),(0,z.jsx)(_t,{dimmed:n!==void 0,onControl:g})]})}function Z({vertical:e,text:t,extra:n=0}){return e?(0,z.jsx)(`span`,{className:`mt-1 shrink-0 truncate text-[12px] text-white/85`,style:{height:Qe+n,writingMode:`vertical-rl`},"data-label":`line`,children:t}):(0,z.jsx)(`span`,{className:`ml-1 shrink-0 truncate text-[12px] text-white/85`,style:{width:J+n},"data-label":`line`,children:t})}function pt({sharing:e,shareEnabled:t,sharePicking:n,shortcut:r,spotlit:i,dimmed:a,onShare:o,onStopShare:s}){let{t:c}=v();return!t&&!e?null:(0,z.jsx)($,{icon:(0,z.jsx)(ue,{className:`size-4`}),label:c(`companionSurface.share`),shortcut:r,control:`share`,spotlit:i,dimmed:a,pressed:e||n,onClick:e?s:o})}function mt({sharing:e,annotating:t,shortcut:n,spotlit:r,dimmed:i,tool:a,placement:o,toolsRef:s,onAnnotate:c,onTool:l}){let{t:u}=v();return e?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)($,{icon:(0,z.jsx)(M,{className:`size-4`}),label:u(`companionSurface.draw`),shortcut:n,control:`draw`,spotlit:r,dimmed:i,pressed:t,className:`companion-draw-anchor`,onClick:()=>{c?.(!t)}}),t&&a!==void 0&&(0,z.jsx)(ht,{tool:a,placement:o,toolsRef:s,onTool:l})]}):null}function ht({tool:e,placement:t,toolsRef:n,onTool:r}){let{t:i}=v(),a=[{tool:`freehand`,icon:(0,z.jsx)(M,{className:`size-4`}),label:i(`companionSurface.drawFreehand`)},{tool:`line`,icon:(0,z.jsx)(de,{className:`size-4`}),label:i(`companionSurface.drawLine`)},{tool:`box`,icon:(0,z.jsx)(ee,{className:`size-4`}),label:i(`companionSurface.drawBox`)},{tool:`circle`,icon:(0,z.jsx)(C,{className:`size-4`}),label:i(`companionSurface.drawCircle`)}];return(0,z.jsx)(`div`,{className:`companion-draw-tools absolute flex items-center gap-0.5 rounded-full border border-white/10 bg-[#17181b]/95 p-0.5 shadow-lg shadow-black/40 companion-draw-tools-${t} ${t===`left`||t===`right`?`flex-col`:``}`,role:`group`,"aria-label":i(`companionSurface.drawTools`),"data-testid":`companion-draw-tools`,ref:n,onPointerDown:e=>{e.stopPropagation()},children:a.map(t=>(0,z.jsx)($,{icon:t.icon,label:t.label,pressed:e===t.tool,onClick:()=>{r?.(t.tool)}},t.tool))})}function gt({sharing:e,marked:t,dimmed:n,onClearMarks:r}){let{t:i}=v();return!e||!t?null:(0,z.jsx)($,{icon:(0,z.jsx)(le,{className:`size-4`}),label:i(`companionSurface.clearMarks`),dimmed:n,onClick:()=>{r?.()}})}function _t({dimmed:e,onControl:t}){let{t:n}=v();return(0,z.jsx)($,{icon:(0,z.jsx)(N,{className:`size-4`,strokeWidth:2.5}),label:n(`companionSurface.endSession`),tone:`negative`,dimmed:e,onClick:()=>{t?.(`endSession`)}})}function vt({onWatch:e}){let{t}=v();return(0,z.jsx)($,{icon:(0,z.jsx)(te,{className:`size-4`}),label:t(`companionSurface.stopTeaching`),onClick:e})}var Q=`-translate-y-[calc(50%+22px)]`,yt={right:`translate-x-[calc(50%+22px)]`,left:`-translate-x-[calc(50%+22px)]`},bt=e=>e===`above`?{className:Q,beak:`down`}:{className:yt[e],beak:e===`right`?`left`:`right`};function xt({work:e,accentHex:t,open:n,onToggle:r}){let{t:i}=v(),a=bt((0,L.useContext)(Ue)),o=Ee(e),s=W(e),c=o.length>0?o:s,l=e.at(-1),u=(c.length>0?c:e).map(e=>e.title).join(` · `);return(0,z.jsxs)(`button`,{type:`button`,"aria-label":o.length===0&&s.length>0?i(`companionSurface.workWaiting`,{count:s.length}):i(`companionSurface.workCount`,{count:o.length}),"aria-expanded":r===void 0?void 0:n,"data-control":`work`,disabled:r===void 0,className:`group flex h-7 shrink-0 items-center justify-center rounded-full px-1.5 transition-colors enabled:hover:bg-white/15 ${n?`bg-white/15`:``}`,style:{...De(t),width:Xe},onPointerDown:e=>{e.stopPropagation()},onClick:r,children:[(0,z.jsx)(`span`,{className:`relative grid size-5 place-items-center`,children:c.length>0?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`absolute inset-0 grid place-items-center`,children:(0,z.jsx)(Oe,{size:20,still:o.length===0})}),(0,z.jsx)(`span`,{className:`text-[10px] leading-none font-semibold text-white/90 tabular-nums`,children:c.length})]}):(0,z.jsx)(ke,{state:l?.state===`failed`?`failed`:`done`})}),n?null:(0,z.jsx)(it,{label:u,className:`opacity-0 group-hover:opacity-100 ${a.className}`,beak:a.beak,"data-label":`hover`})]})}var St={above:A,below:oe,left:O,right:E};function Ct({picker:e,label:t,side:n,open:r,onPicker:i}){if(i===void 0)return null;let a=St[n];return(0,z.jsx)($,{icon:(0,z.jsx)(a,{className:`size-3.5`,strokeWidth:2.25}),label:t,pressed:r,narrow:!0,onClick:()=>{i(e)}})}function $({icon:e,label:t,shortcut:n,tone:r,showLabel:i=!1,pressed:a,spotlit:o=!1,dimmed:s=!1,control:c,narrow:l=!1,className:u=``,onClick:d}){let f=bt((0,L.useContext)(Ue));return(0,z.jsxs)(`button`,{type:`button`,"aria-label":t,"aria-pressed":a,"data-control":c,onClick:d,onPointerDown:e=>{e.stopPropagation()},className:`group flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-full text-[12px] transition-[background-color,opacity] duration-200 hover:bg-white/15 ${l?`-mx-1 px-0.5`:`px-2`} ${u} ${a===!0||o?`bg-white/15`:``} ${s?`opacity-35`:``} ${r===`negative`?`text-[#ff6b6b]`:r===`positive`?`text-[#5ee08a]`:`text-white/85`}`,children:[e,i?(0,z.jsx)(`span`,{children:t}):(0,z.jsx)(it,{label:t,shortcut:n,className:`opacity-0 group-hover:opacity-100 ${f.className}`,beak:f.beak,"data-label":`hover`})]})}export{we as a,_e as c,V as i,R as l,Te as n,Ce as o,H as r,B as s,et as t,me as u};
|
package/dist/assets/{companion-surface-page-BvvOIZO_.js → companion-surface-page-Cu5KYGHm.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$d as t,Al as n,BC as r,Bl as i,Cl as a,Dl as o,El as ee,Hg as s,Hl as c,Il as l,Kl as u,Ll as d,Ml as f,Ol as p,Pl as m,Qg as h,Rl as g,Sl as te,Tl as _,Ul as ne,Vl as re,bl as v,gl as y,hl as ie,jl as b,pl as x,tf as S,uC as C,vl as ae,wC as oe,wl as se,xl as ce,yl as w,zl as T}from"./app-g1TvV-Dl.js";import{E as le}from"./vendor-DwMhK7fD.js";import{t as E,x as D}from"./react-B9IgSVeK.js";import{Ka as O,yn as ue}from"./icons-C0wyat6T.js";import{a as de,c as fe,l as pe,n as me,o as he,r as ge,s as _e,t as ve,u as ye}from"./companion-surface-DM4lsh7V.js";import{n as be}from"./companion-accent-CBLb9Kpv.js";import{n as xe,t as Se}from"./companion-popover-B7KpH4N8.js";import{n as k,r as Ce,t as A}from"./companion-layout-C6tp_Wvl.js";var j=e(D(),1),M=E(),we=460,Te=3,N=88,Ee=3,De=[`screens`,`tabs`,`windows`],Oe=(e,t)=>t===`screens`?e.displays.length:t===`tabs`?e.tabs.length:e.windows.length,ke=e=>De.find(t=>Oe(e,t)>0)??`screens`,P=e=>e.kind===`display`?`display-${e.displayId}`:`window-${e.windowId}`;function Ae({sources:e,captureThumbnail:t,cardGrowth:n=`up`,side:i,avatarBox:a=s,optionsBox:o=s,cardRef:ee,label:c,onPick:l,onAllowScreenRecording:u}){let{t:d}=le(),{inUnits:f,lineAt:p,edgeAt:m,introStepOff:g,gap:te}=A(a,o),_=f(g(n)),ne=i===void 0?{left:`50%`,top:p(n,0),transform:n===`up`?`translate(-50%, calc(-100% - ${_}px))`:`translate(-50%, ${_}px)`}:{...m(i,h(a,o)+te),top:`50%`,transform:`translateY(-50%)`},re=e!==null&&e.screenRecordingGranted===!1,v=re?null:e,y=v===null?[]:De.filter(e=>Oe(v,e)>0),ie=v!==null&&y.length===0,[b,x]=(0,j.useState)(null),S=v===null?`screens`:b!==null&&y.includes(b)?b:ke(v),ae=(0,j.useMemo)(()=>v===null?[]:S===`screens`?v.displays.map(e=>{let t={kind:`display`,displayId:e.displayId};return{key:P(t),target:t}}):S===`windows`?v.windows.map(e=>{let t={kind:`window`,windowId:e.windowId};return{key:P(t),target:t}}):[],[S,v]),[se,ce]=(0,j.useState)(new Map),w=(0,j.useRef)(new Set),T=(0,j.useRef)(0),E=(0,j.useRef)(!1);(0,j.useEffect)(()=>(E.current=!0,()=>{E.current=!1}),[]),(0,j.useEffect)(()=>{w.current=new Set,T.current+=1,ce(new Map),x(null)},[e]);let D=(0,j.useRef)(null);(0,j.useEffect)(()=>{D.current!==null&&(D.current.scrollTop=0)},[S]),(0,j.useEffect)(()=>{if(t!==void 0)for(let{key:e,target:n}of ae){if(w.current.has(e))continue;w.current.add(e);let r=T.current,i=t=>{!E.current||r!==T.current||ce(n=>new Map(n).set(e,t))};t(n).then(i,()=>{i(null)})}},[t,ae]);let O=e=>t===void 0?null:se.get(e),de=e=>d(e===`screens`?`companionSurface.captureScreens`:e===`tabs`?`companionSurface.captureTabs`:`companionSurface.captureWindows`);return(0,M.jsxs)(`div`,{ref:ee,role:`group`,"aria-label":c??d(`companionSurface.capturePicker`),"data-companion-capture-picker":!0,"data-theme":`dark`,className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-1.5 shadow-lg shadow-black/40`,style:{width:we,...ne},onPointerDown:e=>{e.stopPropagation()},children:[y.length>1&&(0,M.jsx)(C,{className:`mx-auto mb-1.5 w-auto shrink-0`,items:y.map(e=>({value:e,label:de(e)})),value:S,ariaLabel:d(`companionSurface.captureKind`),onChange:x}),(0,M.jsx)(oe,{ref:D,className:`max-h-48 flex-col px-0.5`,size:24,fadeEdges:`end`,hideScrollBar:!0,children:(0,M.jsxs)(`div`,{className:`flex flex-col`,"data-slot":`capture-sources`,children:[e===null&&(0,M.jsx)(Me,{}),re&&(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-2 py-2`,"data-slot":`capture-needs-grant`,children:[(0,M.jsx)(`span`,{className:`text-[12px] text-white/70`,children:d(`companionSurface.captureScreenRecordingOff`)}),(0,M.jsx)(r,{variant:`primary`,size:`compact`,className:`shrink-0`,onClick:u,children:d(`companionSurface.captureTurnOnScreenRecording`)})]}),v!==null&&S===`screens`&&(0,M.jsx)(F,{children:v.displays.map(e=>{let t=d(`companionSurface.captureScreen`,{n:e.index+1}),n=P({kind:`display`,displayId:e.displayId});return(0,M.jsx)(I,{title:t,ariaLabel:t,answer:O(n),fallback:(0,M.jsx)(ue,{className:`size-5 text-white/40`,"aria-hidden":!0}),onClick:()=>{l?.({kind:`display`,displayId:e.displayId})}},n)})}),v!==null&&S===`windows`&&(0,M.jsx)(F,{children:v.windows.map(e=>{let t=P({kind:`window`,windowId:e.windowId}),n=e.title===``?e.app:e.title;return(0,M.jsx)(I,{title:n,ariaLabel:e.title===``?n:`${n} (${e.app})`,answer:O(t),fallback:(0,M.jsx)(L,{icon:e.icon,large:!0}),icon:(0,M.jsx)(L,{icon:e.icon}),onClick:()=>{l?.({kind:`window`,windowId:e.windowId})}},t)})}),v!==null&&S===`tabs`&&(0,M.jsx)(`div`,{className:`flex flex-col`,children:v.tabs.map(e=>(0,M.jsx)(je,{icon:(0,M.jsx)(L,{icon:e.icon}),title:e.title,onClick:()=>{l?.({kind:`tab`,chromeWindowId:e.chromeWindowId,tabIndex:e.tabIndex})}},`tab-${e.chromeWindowId}-${e.tabIndex}`))}),ie&&(0,M.jsx)(`span`,{className:`px-2 py-3 text-[12px] text-white/50`,children:d(`companionSurface.captureNothing`)})]})})]})}function F({children:e}){return(0,M.jsx)(`div`,{className:`grid gap-1.5 py-0.5`,style:{gridTemplateColumns:`repeat(${Te}, minmax(0, 1fr))`},children:e})}function I({title:e,ariaLabel:t,answer:n,fallback:r,icon:i,onClick:a}){return(0,M.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`group flex min-w-0 flex-col gap-1 rounded-lg p-1 text-left transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:a,children:[(0,M.jsx)(`span`,{"data-slot":`capture-preview`,className:`flex items-center justify-center overflow-hidden rounded-md bg-black/40 ring-1 ring-white/10 ${n===void 0?`animate-pulse`:``}`,style:{height:N},children:n==null?r:(0,M.jsx)(`img`,{src:n,alt:``,draggable:!1,className:`max-h-full max-w-full object-contain`})}),(0,M.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[i,(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-white/75 group-hover:text-white/90`,children:e})]})]})}function je({icon:e,title:t,onClick:n}){return(0,M.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`flex h-8 w-full shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[12px] text-white/85 transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:n,children:[e,(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}function L({icon:e,large:t=!1}){return(0,M.jsx)(`span`,{className:`flex shrink-0 items-center justify-center overflow-hidden ring-1 ring-white/10 ${t?`size-7 rounded-lg`:`size-3.5 rounded-[4px]`}`,children:e===void 0?(0,M.jsx)(O,{className:t?`size-5 text-white/40`:`size-3 text-white/70`,"aria-hidden":!0}):(0,M.jsx)(`img`,{src:e,alt:``,className:`size-full`,draggable:!1})})}function Me(){return(0,M.jsx)(F,{children:Array.from({length:Ee},(e,t)=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 p-1`,"aria-hidden":!0,children:[(0,M.jsx)(`span`,{className:`animate-pulse rounded-md bg-white/10`,style:{height:N}}),(0,M.jsx)(`span`,{className:`h-2 animate-pulse rounded-full bg-white/10`,style:{width:t===0?`70%`:`45%`}})]},t))})}var Ne=3,Pe=440;function Fe(){let{t:e}=le(),[r,h]=(0,j.useState)(`right`),[C,oe]=(0,j.useState)(`up`),[E,D]=(0,j.useState)(`bottom`),[O,ue]=(0,j.useState)(s),[A,we]=(0,j.useState)(s),[Te,N]=(0,j.useState)(),[Ee,De]=(0,j.useState)(),[Oe,ke]=(0,j.useState)(),[P,F]=(0,j.useState)(null),[I,je]=(0,j.useState)(!1),[L,Me]=(0,j.useState)(void 0),[Fe,Ie]=(0,j.useState)(``),[R,Le]=(0,j.useState)(``),[Re,ze]=(0,j.useState)(!1),[z,Be]=(0,j.useState)(!1),[Ve,He]=(0,j.useState)(void 0),[B,Ue]=(0,j.useState)(void 0),[V,We]=(0,j.useState)(void 0),[H,Ge]=(0,j.useState)(void 0),[Ke,qe]=(0,j.useState)(!1),[Je,Ye]=(0,j.useState)(!1),[Xe,Ze]=(0,j.useState)(void 0),[Qe,$e]=(0,j.useState)(!1),[et,tt]=(0,j.useState)(!1),[nt,rt]=(0,j.useState)(!1),[it,at]=(0,j.useState)(!1),[ot,st]=(0,j.useState)(void 0),[U,W]=(0,j.useState)(!1),[G,ct]=(0,j.useState)(`teach`),[lt,ut]=(0,j.useState)(null),K=(0,j.useRef)(0),[dt,q]=(0,j.useState)(!1),[J,ft]=(0,j.useState)(null),[pt,mt]=(0,j.useState)(0),[ht,gt]=(0,j.useState)(0),[_t,vt]=(0,j.useState)(void 0),Y=(0,j.useRef)(!1),yt=(0,j.useRef)(null),bt=(0,j.useRef)(null),xt=(0,j.useRef)(null),St=(0,j.useRef)(null),Ct=(0,j.useRef)(null),wt=(0,j.useRef)(null),Tt=(0,j.useRef)(null),Et=(0,j.useRef)(null),Dt=(0,j.useRef)(!1),Ot=(0,j.useCallback)(e=>{Et.current=e,e===null&&Dt.current&&(Dt.current=!1,Y.current=!1,m(!1))},[]),X=(0,j.useRef)(null),kt=(0,j.useRef)(null),At=(0,j.useRef)(!1);(0,j.useEffect)(()=>{let e=e=>{h(e.growth),oe(e.cardGrowth),D(e.dock??`bottom`),ue(e.avatarBox),we(e.optionsBox??e.avatarBox),N(e.avatarBase64===void 0?void 0:`data:image/png;base64,${e.avatarBase64}`),De(e.character),ke(e.accentHex),F(e.call),je(e.dialing===!0),Le(e.assistantName),ze(e.working),Be(e.watching===!0),Me(e.dictating),Ie(e.dictationText??``),He(e.watchRetro),Ue(e.dictationOffer),We(e.popover),Ge(e.popoverView),qe(e.watchEnabled===!0),Ye(e.watchTargets===!0),Ze(e.screenShare),$e(e.screenShareEnabled===!0),tt(e.annotating===!0),rt((e.coachmarks?.length??0)>0),at(e.marksCleared!==void 0),st(e.annotationTool),ft(e.intro),mt(e.voiceKeyTaps??0),gt(e.introChordPresses??0),vt(e.introChordControl)},t=i(e);return se().then(t=>{t&&e(t)}),t},[]),(0,j.useEffect)(()=>()=>{m(!1)},[]);let jt=P!==null||I,Mt=Xe!==void 0,Nt=(0,j.useMemo)(()=>x()?ne():void 0,[]);(0,j.useEffect)(()=>{jt||(K.current+=1,W(!1))},[jt]),(0,j.useEffect)(()=>{z&&G===`teach`&&(K.current+=1,W(!1))},[z,G]),(0,j.useEffect)(()=>{Mt&&G===`share`&&(K.current+=1,W(!1))},[Mt,G]);let Pt=(e,t)=>{ut(null),ct(e),W(!0);let n=++K.current;_().then(e=>{if(n===K.current){if(e!==null){ut(e);return}W(!1),t()}})},Ft=U&<?.screenRecordingGranted===!1;(0,j.useEffect)(()=>{if(Ft)return S(e=>{if(e.screen?.status!==`granted`)return;let t=++K.current;_().then(e=>{t!==K.current||e===null||ut(e)})})},[Ft]);let It=()=>{if(!Je){c();return}if(U&&G===`teach`){K.current+=1,W(!1);return}Pt(`teach`,c)},Lt=()=>{if(U&&G===`share`){K.current+=1,W(!1);return}Pt(`share`,()=>void 0)};(0,j.useEffect)(()=>{!U&&Y.current&&(Y.current=!1,m(!1))},[U]),(0,j.useEffect)(()=>{B===void 0&&Y.current&&(Y.current=!1,m(!1))},[B]);let Rt=(0,j.useRef)(!1),zt=V!==void 0&&H!==void 0&&H!==`deferred`&&(P!==null||I)&&E!==`left`&&E!==`right`,Bt=zt?V?.id:void 0;(0,j.useLayoutEffect)(()=>{let e=Tt.current;if(Bt===void 0||e===null)return;let t=()=>{f(Bt,e.getBoundingClientRect().height)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Bt,H]);let[Vt,Ht]=(0,j.useState)(!1),Ut=zt||Vt;(0,j.useEffect)(()=>{!Ut&&Rt.current&&(Rt.current=!1,Y.current=!1,m(!1))},[Ut]);let Wt=e=>{if(K.current+=1,W(!1),G===`share`){d(e);return}c(e)},Z=e=>{Y.current!==e&&(Y.current=e,m(e))},Q=J!==null&&P===null&&!I,Gt=(0,j.useRef)(Q);(0,j.useEffect)(()=>{Gt.current&&!Q&&(q(!1),Z(!1)),Gt.current=Q},[Q]);let Kt=he(J),qt=Q?de(J,e(`companionIntro.call.line`)):null,Jt=ye(Q?J:null),Yt=pe(Jt),Xt=Q&&!Yt&&(J===`talk`||J===`try`),Zt=Q&&J===`idle`&&dt;(0,j.useEffect)(()=>{Zt&&y(`next`)},[Zt]);let[Qt,$t]=(0,j.useState)(!1);(0,j.useEffect)(()=>{$t(!1)},[J]);let en=()=>{J===`try`&&!Yt&&y(`try`)},$=qt!==null,tn=P!==null||I?`call`:L===void 0?B===void 0?z?`watching`:Ve===void 0?Kt??(dt?`hover`:`resting`):`summary`:`offer`:`dictating`,nn=e=>{if(X.current!==null&&e.buttons===0&&(X.current=null,p()),X.current!==null){let{x:t,y:n}=X.current;ee(e.screenX-t,e.screenY-n),X.current={x:e.screenX,y:e.screenY};let r=kt.current;r!==null&&Math.abs(e.screenX-r.x)+Math.abs(e.screenY-r.y)>Ne&&(At.current=!0);return}let t=xt.current;if(!t)return;let n=yt.current?.getBoundingClientRect()??null,r=bt.current?.getBoundingClientRect()??null,i=n!==null&&n.width>0?n:r!==null&&r.width>0?r:null,a=Ce({x:e.clientX,y:e.clientY},{avatar:t.getBoundingClientRect(),pill:i}),o=St.current,s=o!==null&&k(o.getBoundingClientRect(),e.clientX,e.clientY),c=wt.current,l=c!==null&&k(c.getBoundingClientRect(),e.clientX,e.clientY),u=Ct.current,d=u!==null&&k(u.getBoundingClientRect(),e.clientX,e.clientY),f=Tt.current,m=f!==null&&k(f.getBoundingClientRect(),e.clientX,e.clientY),h=Et.current,g=h!==null&&k(h.getBoundingClientRect(),e.clientX,e.clientY);q(a),Dt.current=g,Rt.current=m,Z(a||s||d||l||g||m)},rn=be(P,Oe,Ee),an=V===void 0||H!==`deferred`?0:V.kind===`approvals`?V.items.length:1;return(0,M.jsx)(`div`,{className:`relative h-screen w-screen bg-transparent`,onMouseMove:nn,onMouseUp:()=>{X.current!==null&&(X.current=null,p())},onPointerCancel:()=>{X.current!==null&&(X.current=null,p()),q(!1),Z(!1)},onMouseLeave:()=>{X.current===null&&(q(!1),Z(!1))},children:(0,M.jsx)(ve,{phase:tn,growth:r,cardGrowth:C,dock:E,avatarBox:O,optionsBox:A,avatarSrc:Te,character:Ee,hovered:dt,accentHex:rn,call:P??qt?.call??void 0,assistantName:R,dictating:L,dictationText:Fe,working:Re,watching:z,watchRetro:Ve,onWatchRetro:v,dictationOffer:B,offer:B===void 0?null:(0,M.jsx)(fe,{offer:B,growth:r,cardGrowth:C,avatarBox:O,optionsBox:A,cardRef:wt,onAnswer:e=>{ae(e,B.id)}}),watchEnabled:Ke,spotlight:_e(J),avatarStaged:Xt,avatarTucked:Q&&J===`idle`,intro:!Q||J===null?null:(0,M.jsx)(me,{beat:J,growth:r,cardGrowth:C,avatarBox:O,optionsBox:A,accentHex:rn,assistantName:R===``?void 0:R,cardRef:St,permission:Jt,greeted:Qt,voiceKeyTaps:pt,chordPresses:ht,chordControl:_t,onAdvance:e=>{if(e===`try`){en();return}y(e)}}),rootRef:yt,restingPillRef:bt,avatarRef:xt,onSurfacePointerDown:e=>{e.button===0&&e.target.closest(`button, a`)===null&&(e.currentTarget.setPointerCapture(e.pointerId),X.current={x:e.screenX,y:e.screenY},kt.current={x:e.screenX,y:e.screenY},At.current=!1)},onSurfaceContextMenu:e=>{(window.getSelection()?.toString().trim().length??0)>0||(e.preventDefault(),g())},onAvatarClick:()=>{if(!(At.current||$)){if(J!==null){Q&&!Yt&&(J===`talk`?$t(!0):J===`try`&&en());return}if(P!==null||I){ie();return}T()}},onWatch:()=>{$||c()},onTeach:$?void 0:It,picking:U&&G===`teach`,sharing:qt?.sharing??Mt,shareEnabled:$||Qe,sharePicking:U&&G===`share`,onShare:$?void 0:Lt,onStopShare:$?void 0:()=>{d()},annotating:et,onAnnotate:$?void 0:e=>{n(e)},marked:it&&(nt||et),onClearMarks:$?void 0:()=>{te()},openPicker:V?.kind===`microphones`?V.kind:void 0,onPicker:!$&&a()?e=>{re(e)}:void 0,annotationTool:ot,onAnnotationTool:$?void 0:e=>{b(e)},drawToolsRef:Ot,shortcuts:$?ge:Nt,picker:U?(0,M.jsx)(Ae,{sources:lt,captureThumbnail:ce,cardGrowth:C,side:(P!==null||I)&&(E===`left`||E===`right`)?E===`left`?`right`:`left`:void 0,avatarBox:O,optionsBox:A,cardRef:Ct,label:G===`share`?e(`companionSurface.sharePicker`):void 0,onPick:Wt,onAllowScreenRecording:()=>{t(`screen`).catch(()=>void 0)}}):null,prompt:!zt||V===void 0?null:H===`row`&&(V.kind===`approvals`||V.kind===`secret`)?(0,M.jsx)(xe,{popover:V,onAnswer:e=>{w(e,V.id)},onView:e=>{l(V.id,e)}}):(0,M.jsx)(Se,{attached:!0,popover:V,view:H??`expanded`,style:{maxHeight:Pe},onAnswer:e=>{w(e,V.id)},onView:e=>{l(V.id,e)},onOpenLink:e=>{o(e)}},V.id),promptRef:Tt,onWorkShelfChange:Ht,promptsDeferred:an,onReviewPrompts:()=>{V!==void 0&&l(V.id,`expanded`)},onControl:$?void 0:(e,t)=>{u(t===void 0?{action:e}:{action:e,requestId:t})}})})}export{Fe as CompanionSurfacePage};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$d as t,Al as n,BC as r,Bl as i,Cl as a,Dl as o,El as ee,Hg as s,Hl as c,Il as l,Kl as u,Ll as d,Ml as f,Ol as p,Pl as m,Qg as h,Rl as g,Sl as te,Tl as _,Ul as ne,Vl as re,bl as v,gl as y,hl as ie,jl as b,pl as x,tf as S,uC as C,vl as ae,wC as oe,wl as se,xl as ce,yl as w,zl as T}from"./app-XG_RF2yi.js";import{E as le}from"./vendor-DwMhK7fD.js";import{t as E,x as D}from"./react-B9IgSVeK.js";import{Ka as O,yn as ue}from"./icons-C0wyat6T.js";import{a as de,c as fe,l as pe,n as me,o as he,r as ge,s as _e,t as ve,u as ye}from"./companion-surface-Lu_Uj_QW.js";import{n as be}from"./companion-accent-CbS8BVae.js";import{n as xe,t as Se}from"./companion-popover-BsoxqJOP.js";import{n as k,r as Ce,t as A}from"./companion-layout-DCGXuvsw.js";var j=e(D(),1),M=E(),we=460,Te=3,N=88,Ee=3,De=[`screens`,`tabs`,`windows`],Oe=(e,t)=>t===`screens`?e.displays.length:t===`tabs`?e.tabs.length:e.windows.length,ke=e=>De.find(t=>Oe(e,t)>0)??`screens`,P=e=>e.kind===`display`?`display-${e.displayId}`:`window-${e.windowId}`;function Ae({sources:e,captureThumbnail:t,cardGrowth:n=`up`,side:i,avatarBox:a=s,optionsBox:o=s,cardRef:ee,label:c,onPick:l,onAllowScreenRecording:u}){let{t:d}=le(),{inUnits:f,lineAt:p,edgeAt:m,introStepOff:g,gap:te}=A(a,o),_=f(g(n)),ne=i===void 0?{left:`50%`,top:p(n,0),transform:n===`up`?`translate(-50%, calc(-100% - ${_}px))`:`translate(-50%, ${_}px)`}:{...m(i,h(a,o)+te),top:`50%`,transform:`translateY(-50%)`},re=e!==null&&e.screenRecordingGranted===!1,v=re?null:e,y=v===null?[]:De.filter(e=>Oe(v,e)>0),ie=v!==null&&y.length===0,[b,x]=(0,j.useState)(null),S=v===null?`screens`:b!==null&&y.includes(b)?b:ke(v),ae=(0,j.useMemo)(()=>v===null?[]:S===`screens`?v.displays.map(e=>{let t={kind:`display`,displayId:e.displayId};return{key:P(t),target:t}}):S===`windows`?v.windows.map(e=>{let t={kind:`window`,windowId:e.windowId};return{key:P(t),target:t}}):[],[S,v]),[se,ce]=(0,j.useState)(new Map),w=(0,j.useRef)(new Set),T=(0,j.useRef)(0),E=(0,j.useRef)(!1);(0,j.useEffect)(()=>(E.current=!0,()=>{E.current=!1}),[]),(0,j.useEffect)(()=>{w.current=new Set,T.current+=1,ce(new Map),x(null)},[e]);let D=(0,j.useRef)(null);(0,j.useEffect)(()=>{D.current!==null&&(D.current.scrollTop=0)},[S]),(0,j.useEffect)(()=>{if(t!==void 0)for(let{key:e,target:n}of ae){if(w.current.has(e))continue;w.current.add(e);let r=T.current,i=t=>{!E.current||r!==T.current||ce(n=>new Map(n).set(e,t))};t(n).then(i,()=>{i(null)})}},[t,ae]);let O=e=>t===void 0?null:se.get(e),de=e=>d(e===`screens`?`companionSurface.captureScreens`:e===`tabs`?`companionSurface.captureTabs`:`companionSurface.captureWindows`);return(0,M.jsxs)(`div`,{ref:ee,role:`group`,"aria-label":c??d(`companionSurface.capturePicker`),"data-companion-capture-picker":!0,"data-theme":`dark`,className:`absolute flex flex-col rounded-2xl border border-white/10 bg-[#17181b]/95 p-1.5 shadow-lg shadow-black/40`,style:{width:we,...ne},onPointerDown:e=>{e.stopPropagation()},children:[y.length>1&&(0,M.jsx)(C,{className:`mx-auto mb-1.5 w-auto shrink-0`,items:y.map(e=>({value:e,label:de(e)})),value:S,ariaLabel:d(`companionSurface.captureKind`),onChange:x}),(0,M.jsx)(oe,{ref:D,className:`max-h-48 flex-col px-0.5`,size:24,fadeEdges:`end`,hideScrollBar:!0,children:(0,M.jsxs)(`div`,{className:`flex flex-col`,"data-slot":`capture-sources`,children:[e===null&&(0,M.jsx)(Me,{}),re&&(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-2 py-2`,"data-slot":`capture-needs-grant`,children:[(0,M.jsx)(`span`,{className:`text-[12px] text-white/70`,children:d(`companionSurface.captureScreenRecordingOff`)}),(0,M.jsx)(r,{variant:`primary`,size:`compact`,className:`shrink-0`,onClick:u,children:d(`companionSurface.captureTurnOnScreenRecording`)})]}),v!==null&&S===`screens`&&(0,M.jsx)(F,{children:v.displays.map(e=>{let t=d(`companionSurface.captureScreen`,{n:e.index+1}),n=P({kind:`display`,displayId:e.displayId});return(0,M.jsx)(I,{title:t,ariaLabel:t,answer:O(n),fallback:(0,M.jsx)(ue,{className:`size-5 text-white/40`,"aria-hidden":!0}),onClick:()=>{l?.({kind:`display`,displayId:e.displayId})}},n)})}),v!==null&&S===`windows`&&(0,M.jsx)(F,{children:v.windows.map(e=>{let t=P({kind:`window`,windowId:e.windowId}),n=e.title===``?e.app:e.title;return(0,M.jsx)(I,{title:n,ariaLabel:e.title===``?n:`${n} (${e.app})`,answer:O(t),fallback:(0,M.jsx)(L,{icon:e.icon,large:!0}),icon:(0,M.jsx)(L,{icon:e.icon}),onClick:()=>{l?.({kind:`window`,windowId:e.windowId})}},t)})}),v!==null&&S===`tabs`&&(0,M.jsx)(`div`,{className:`flex flex-col`,children:v.tabs.map(e=>(0,M.jsx)(je,{icon:(0,M.jsx)(L,{icon:e.icon}),title:e.title,onClick:()=>{l?.({kind:`tab`,chromeWindowId:e.chromeWindowId,tabIndex:e.tabIndex})}},`tab-${e.chromeWindowId}-${e.tabIndex}`))}),ie&&(0,M.jsx)(`span`,{className:`px-2 py-3 text-[12px] text-white/50`,children:d(`companionSurface.captureNothing`)})]})})]})}function F({children:e}){return(0,M.jsx)(`div`,{className:`grid gap-1.5 py-0.5`,style:{gridTemplateColumns:`repeat(${Te}, minmax(0, 1fr))`},children:e})}function I({title:e,ariaLabel:t,answer:n,fallback:r,icon:i,onClick:a}){return(0,M.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`group flex min-w-0 flex-col gap-1 rounded-lg p-1 text-left transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:a,children:[(0,M.jsx)(`span`,{"data-slot":`capture-preview`,className:`flex items-center justify-center overflow-hidden rounded-md bg-black/40 ring-1 ring-white/10 ${n===void 0?`animate-pulse`:``}`,style:{height:N},children:n==null?r:(0,M.jsx)(`img`,{src:n,alt:``,draggable:!1,className:`max-h-full max-w-full object-contain`})}),(0,M.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[i,(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] text-white/75 group-hover:text-white/90`,children:e})]})]})}function je({icon:e,title:t,onClick:n}){return(0,M.jsxs)(`button`,{type:`button`,"aria-label":t,"data-slot":`capture-source`,className:`flex h-8 w-full shrink-0 items-center gap-2 rounded-lg px-2 text-left text-[12px] text-white/85 transition-colors outline-none hover:bg-white/10 focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:ring-inset active:bg-white/15`,onClick:n,children:[e,(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}function L({icon:e,large:t=!1}){return(0,M.jsx)(`span`,{className:`flex shrink-0 items-center justify-center overflow-hidden ring-1 ring-white/10 ${t?`size-7 rounded-lg`:`size-3.5 rounded-[4px]`}`,children:e===void 0?(0,M.jsx)(O,{className:t?`size-5 text-white/40`:`size-3 text-white/70`,"aria-hidden":!0}):(0,M.jsx)(`img`,{src:e,alt:``,className:`size-full`,draggable:!1})})}function Me(){return(0,M.jsx)(F,{children:Array.from({length:Ee},(e,t)=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 p-1`,"aria-hidden":!0,children:[(0,M.jsx)(`span`,{className:`animate-pulse rounded-md bg-white/10`,style:{height:N}}),(0,M.jsx)(`span`,{className:`h-2 animate-pulse rounded-full bg-white/10`,style:{width:t===0?`70%`:`45%`}})]},t))})}var Ne=3,Pe=440;function Fe(){let{t:e}=le(),[r,h]=(0,j.useState)(`right`),[C,oe]=(0,j.useState)(`up`),[E,D]=(0,j.useState)(`bottom`),[O,ue]=(0,j.useState)(s),[A,we]=(0,j.useState)(s),[Te,N]=(0,j.useState)(),[Ee,De]=(0,j.useState)(),[Oe,ke]=(0,j.useState)(),[P,F]=(0,j.useState)(null),[I,je]=(0,j.useState)(!1),[L,Me]=(0,j.useState)(void 0),[Fe,Ie]=(0,j.useState)(``),[R,Le]=(0,j.useState)(``),[Re,ze]=(0,j.useState)(!1),[z,Be]=(0,j.useState)(!1),[Ve,He]=(0,j.useState)(void 0),[B,Ue]=(0,j.useState)(void 0),[V,We]=(0,j.useState)(void 0),[H,Ge]=(0,j.useState)(void 0),[Ke,qe]=(0,j.useState)(!1),[Je,Ye]=(0,j.useState)(!1),[Xe,Ze]=(0,j.useState)(void 0),[Qe,$e]=(0,j.useState)(!1),[et,tt]=(0,j.useState)(!1),[nt,rt]=(0,j.useState)(!1),[it,at]=(0,j.useState)(!1),[ot,st]=(0,j.useState)(void 0),[U,W]=(0,j.useState)(!1),[G,ct]=(0,j.useState)(`teach`),[lt,ut]=(0,j.useState)(null),K=(0,j.useRef)(0),[dt,q]=(0,j.useState)(!1),[J,ft]=(0,j.useState)(null),[pt,mt]=(0,j.useState)(0),[ht,gt]=(0,j.useState)(0),[_t,vt]=(0,j.useState)(void 0),Y=(0,j.useRef)(!1),yt=(0,j.useRef)(null),bt=(0,j.useRef)(null),xt=(0,j.useRef)(null),St=(0,j.useRef)(null),Ct=(0,j.useRef)(null),wt=(0,j.useRef)(null),Tt=(0,j.useRef)(null),Et=(0,j.useRef)(null),Dt=(0,j.useRef)(!1),Ot=(0,j.useCallback)(e=>{Et.current=e,e===null&&Dt.current&&(Dt.current=!1,Y.current=!1,m(!1))},[]),X=(0,j.useRef)(null),kt=(0,j.useRef)(null),At=(0,j.useRef)(!1);(0,j.useEffect)(()=>{let e=e=>{h(e.growth),oe(e.cardGrowth),D(e.dock??`bottom`),ue(e.avatarBox),we(e.optionsBox??e.avatarBox),N(e.avatarBase64===void 0?void 0:`data:image/png;base64,${e.avatarBase64}`),De(e.character),ke(e.accentHex),F(e.call),je(e.dialing===!0),Le(e.assistantName),ze(e.working),Be(e.watching===!0),Me(e.dictating),Ie(e.dictationText??``),He(e.watchRetro),Ue(e.dictationOffer),We(e.popover),Ge(e.popoverView),qe(e.watchEnabled===!0),Ye(e.watchTargets===!0),Ze(e.screenShare),$e(e.screenShareEnabled===!0),tt(e.annotating===!0),rt((e.coachmarks?.length??0)>0),at(e.marksCleared!==void 0),st(e.annotationTool),ft(e.intro),mt(e.voiceKeyTaps??0),gt(e.introChordPresses??0),vt(e.introChordControl)},t=i(e);return se().then(t=>{t&&e(t)}),t},[]),(0,j.useEffect)(()=>()=>{m(!1)},[]);let jt=P!==null||I,Mt=Xe!==void 0,Nt=(0,j.useMemo)(()=>x()?ne():void 0,[]);(0,j.useEffect)(()=>{jt||(K.current+=1,W(!1))},[jt]),(0,j.useEffect)(()=>{z&&G===`teach`&&(K.current+=1,W(!1))},[z,G]),(0,j.useEffect)(()=>{Mt&&G===`share`&&(K.current+=1,W(!1))},[Mt,G]);let Pt=(e,t)=>{ut(null),ct(e),W(!0);let n=++K.current;_().then(e=>{if(n===K.current){if(e!==null){ut(e);return}W(!1),t()}})},Ft=U&<?.screenRecordingGranted===!1;(0,j.useEffect)(()=>{if(Ft)return S(e=>{if(e.screen?.status!==`granted`)return;let t=++K.current;_().then(e=>{t!==K.current||e===null||ut(e)})})},[Ft]);let It=()=>{if(!Je){c();return}if(U&&G===`teach`){K.current+=1,W(!1);return}Pt(`teach`,c)},Lt=()=>{if(U&&G===`share`){K.current+=1,W(!1);return}Pt(`share`,()=>void 0)};(0,j.useEffect)(()=>{!U&&Y.current&&(Y.current=!1,m(!1))},[U]),(0,j.useEffect)(()=>{B===void 0&&Y.current&&(Y.current=!1,m(!1))},[B]);let Rt=(0,j.useRef)(!1),zt=V!==void 0&&H!==void 0&&H!==`deferred`&&(P!==null||I)&&E!==`left`&&E!==`right`,Bt=zt?V?.id:void 0;(0,j.useLayoutEffect)(()=>{let e=Tt.current;if(Bt===void 0||e===null)return;let t=()=>{f(Bt,e.getBoundingClientRect().height)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[Bt,H]);let[Vt,Ht]=(0,j.useState)(!1),Ut=zt||Vt;(0,j.useEffect)(()=>{!Ut&&Rt.current&&(Rt.current=!1,Y.current=!1,m(!1))},[Ut]);let Wt=e=>{if(K.current+=1,W(!1),G===`share`){d(e);return}c(e)},Z=e=>{Y.current!==e&&(Y.current=e,m(e))},Q=J!==null&&P===null&&!I,Gt=(0,j.useRef)(Q);(0,j.useEffect)(()=>{Gt.current&&!Q&&(q(!1),Z(!1)),Gt.current=Q},[Q]);let Kt=he(J),qt=Q?de(J,e(`companionIntro.call.line`)):null,Jt=ye(Q?J:null),Yt=pe(Jt),Xt=Q&&!Yt&&(J===`talk`||J===`try`),Zt=Q&&J===`idle`&&dt;(0,j.useEffect)(()=>{Zt&&y(`next`)},[Zt]);let[Qt,$t]=(0,j.useState)(!1);(0,j.useEffect)(()=>{$t(!1)},[J]);let en=()=>{J===`try`&&!Yt&&y(`try`)},$=qt!==null,tn=P!==null||I?`call`:L===void 0?B===void 0?z?`watching`:Ve===void 0?Kt??(dt?`hover`:`resting`):`summary`:`offer`:`dictating`,nn=e=>{if(X.current!==null&&e.buttons===0&&(X.current=null,p()),X.current!==null){let{x:t,y:n}=X.current;ee(e.screenX-t,e.screenY-n),X.current={x:e.screenX,y:e.screenY};let r=kt.current;r!==null&&Math.abs(e.screenX-r.x)+Math.abs(e.screenY-r.y)>Ne&&(At.current=!0);return}let t=xt.current;if(!t)return;let n=yt.current?.getBoundingClientRect()??null,r=bt.current?.getBoundingClientRect()??null,i=n!==null&&n.width>0?n:r!==null&&r.width>0?r:null,a=Ce({x:e.clientX,y:e.clientY},{avatar:t.getBoundingClientRect(),pill:i}),o=St.current,s=o!==null&&k(o.getBoundingClientRect(),e.clientX,e.clientY),c=wt.current,l=c!==null&&k(c.getBoundingClientRect(),e.clientX,e.clientY),u=Ct.current,d=u!==null&&k(u.getBoundingClientRect(),e.clientX,e.clientY),f=Tt.current,m=f!==null&&k(f.getBoundingClientRect(),e.clientX,e.clientY),h=Et.current,g=h!==null&&k(h.getBoundingClientRect(),e.clientX,e.clientY);q(a),Dt.current=g,Rt.current=m,Z(a||s||d||l||g||m)},rn=be(P,Oe,Ee),an=V===void 0||H!==`deferred`?0:V.kind===`approvals`?V.items.length:1;return(0,M.jsx)(`div`,{className:`relative h-screen w-screen bg-transparent`,onMouseMove:nn,onMouseUp:()=>{X.current!==null&&(X.current=null,p())},onPointerCancel:()=>{X.current!==null&&(X.current=null,p()),q(!1),Z(!1)},onMouseLeave:()=>{X.current===null&&(q(!1),Z(!1))},children:(0,M.jsx)(ve,{phase:tn,growth:r,cardGrowth:C,dock:E,avatarBox:O,optionsBox:A,avatarSrc:Te,character:Ee,hovered:dt,accentHex:rn,call:P??qt?.call??void 0,assistantName:R,dictating:L,dictationText:Fe,working:Re,watching:z,watchRetro:Ve,onWatchRetro:v,dictationOffer:B,offer:B===void 0?null:(0,M.jsx)(fe,{offer:B,growth:r,cardGrowth:C,avatarBox:O,optionsBox:A,cardRef:wt,onAnswer:e=>{ae(e,B.id)}}),watchEnabled:Ke,spotlight:_e(J),avatarStaged:Xt,avatarTucked:Q&&J===`idle`,intro:!Q||J===null?null:(0,M.jsx)(me,{beat:J,growth:r,cardGrowth:C,avatarBox:O,optionsBox:A,accentHex:rn,assistantName:R===``?void 0:R,cardRef:St,permission:Jt,greeted:Qt,voiceKeyTaps:pt,chordPresses:ht,chordControl:_t,onAdvance:e=>{if(e===`try`){en();return}y(e)}}),rootRef:yt,restingPillRef:bt,avatarRef:xt,onSurfacePointerDown:e=>{e.button===0&&e.target.closest(`button, a`)===null&&(e.currentTarget.setPointerCapture(e.pointerId),X.current={x:e.screenX,y:e.screenY},kt.current={x:e.screenX,y:e.screenY},At.current=!1)},onSurfaceContextMenu:e=>{(window.getSelection()?.toString().trim().length??0)>0||(e.preventDefault(),g())},onAvatarClick:()=>{if(!(At.current||$)){if(J!==null){Q&&!Yt&&(J===`talk`?$t(!0):J===`try`&&en());return}if(P!==null||I){ie();return}T()}},onWatch:()=>{$||c()},onTeach:$?void 0:It,picking:U&&G===`teach`,sharing:qt?.sharing??Mt,shareEnabled:$||Qe,sharePicking:U&&G===`share`,onShare:$?void 0:Lt,onStopShare:$?void 0:()=>{d()},annotating:et,onAnnotate:$?void 0:e=>{n(e)},marked:it&&(nt||et),onClearMarks:$?void 0:()=>{te()},openPicker:V?.kind===`microphones`?V.kind:void 0,onPicker:!$&&a()?e=>{re(e)}:void 0,annotationTool:ot,onAnnotationTool:$?void 0:e=>{b(e)},drawToolsRef:Ot,shortcuts:$?ge:Nt,picker:U?(0,M.jsx)(Ae,{sources:lt,captureThumbnail:ce,cardGrowth:C,side:(P!==null||I)&&(E===`left`||E===`right`)?E===`left`?`right`:`left`:void 0,avatarBox:O,optionsBox:A,cardRef:Ct,label:G===`share`?e(`companionSurface.sharePicker`):void 0,onPick:Wt,onAllowScreenRecording:()=>{t(`screen`).catch(()=>void 0)}}):null,prompt:!zt||V===void 0?null:H===`row`&&(V.kind===`approvals`||V.kind===`secret`)?(0,M.jsx)(xe,{popover:V,onAnswer:e=>{w(e,V.id)},onView:e=>{l(V.id,e)}}):(0,M.jsx)(Se,{attached:!0,popover:V,view:H??`expanded`,style:{maxHeight:Pe},onAnswer:e=>{w(e,V.id)},onView:e=>{l(V.id,e)},onOpenLink:e=>{o(e)}},V.id),promptRef:Tt,onWorkShelfChange:Ht,promptsDeferred:an,onReviewPrompts:()=>{V!==void 0&&l(V.id,`expanded`)},onControl:$?void 0:(e,t)=>{u(t===void 0?{action:e}:{action:e,requestId:t})}})})}export{Fe as CompanionSurfacePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,Oc as n,Yg as r,Zs as i,cC as a}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,Oc as n,Yg as r,Zs as i,cC as a}from"./app-XG_RF2yi.js";import{E as o}from"./vendor-DwMhK7fD.js";import{t as s,x as c}from"./react-B9IgSVeK.js";import{Mn as l,Ra as u,Ya as d,i as f}from"./icons-C0wyat6T.js";import{i as p,t as m}from"./companion-surface-Lu_Uj_QW.js";var h=d(`monitor-up`,[[`path`,{d:`m9 10 3-3 3 3`,key:`11gsxs`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}]]),g=d(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),_=e(c(),1),v=s(),y=r(`avatar`,`small`),b=r(`options`,`small`);function x({avatar:e,assistantName:r,open:s,onStart:c,onDismiss:d}){let{t:x}=o(),C=(0,_.useRef)(null),w=e?n(e.customImageUrl,e.components,e.traits,y):null;return(0,v.jsx)(a.Root,{open:s,onOpenChange:e=>{e||d()},children:(0,v.jsx)(a.Content,{ref:C,size:`lg`,hideCloseButton:!0,dismissOnOverlayClick:!1,onOpenAutoFocus:e=>{e.preventDefault(),C.current?.focus()},onEscapeKeyDown:e=>{e.preventDefault(),d()},className:`max-w-[820px] overflow-hidden`,style:i(e?.accentHex),children:(0,v.jsxs)(`div`,{className:`relative grid min-h-[500px] md:grid-cols-[1.18fr_0.82fr]`,children:[(0,v.jsx)(`button`,{type:`button`,"aria-label":x(`companionIntro.announcement.close`),className:`absolute top-4 right-4 z-10 flex size-8 items-center justify-center rounded-full text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-active)] hover:text-[var(--content-default)] md:text-white/60 md:hover:bg-white/10 md:hover:text-white`,onClick:d,children:(0,v.jsx)(f,{className:`size-4`})}),(0,v.jsxs)(`div`,{className:`relative flex min-w-0 flex-col p-8 sm:p-10`,children:[(0,v.jsx)(a.Title,{className:`[&>span]:whitespace-normal pr-8 text-[32px] leading-[1.08] tracking-[0.01em]`,children:x(`companionIntro.announcement.title`)}),(0,v.jsx)(a.Description,{className:`mt-3 max-w-[420px] text-body-medium-lighter leading-6 text-[var(--content-secondary)]`,children:x(`companionIntro.announcement.body`)}),(0,v.jsxs)(`div`,{className:`mt-6 flex flex-col gap-2`,children:[(0,v.jsx)(S,{icon:l,title:x(`companionIntro.announcement.cards.flow.title`),body:x(`companionIntro.announcement.cards.flow.body`)}),(0,v.jsx)(S,{icon:h,title:x(`companionIntro.announcement.cards.context.title`),body:x(`companionIntro.announcement.cards.context.body`)}),(0,v.jsx)(S,{icon:g,title:x(`companionIntro.announcement.cards.together.title`),body:x(`companionIntro.announcement.cards.together.body`)})]}),(0,v.jsx)(`div`,{className:`mt-auto flex justify-end pt-8`,children:(0,v.jsx)(t,{variant:`primary`,rightIcon:(0,v.jsx)(u,{className:`size-4`}),onClick:c,children:x(`companionIntro.announcement.start`)})})]}),(0,v.jsxs)(`div`,{className:`relative hidden min-h-[500px] overflow-hidden bg-[#17191d] md:block`,"aria-label":x(`companionIntro.announcement.previewLabel`),children:[(0,v.jsx)(`div`,{className:`absolute inset-0 opacity-80`,style:{background:`radial-gradient(circle at 68% 22%, color-mix(in srgb, ${e?.accentHex??`var(--content-tertiary)`} 20%, transparent), transparent 34%), linear-gradient(145deg, #252a32 0%, #15171b 72%)`}}),(0,v.jsxs)(`div`,{className:`absolute top-20 right-8 left-8 h-60 overflow-hidden rounded-xl border border-white/10 bg-white/8 shadow-2xl shadow-black/30`,children:[(0,v.jsxs)(`div`,{className:`flex h-8 items-center gap-1.5 border-b border-white/8 px-3`,children:[(0,v.jsx)(`span`,{className:`size-2 rounded-full bg-white/20`}),(0,v.jsx)(`span`,{className:`size-2 rounded-full bg-white/15`}),(0,v.jsx)(`span`,{className:`size-2 rounded-full bg-white/10`})]}),(0,v.jsxs)(`div`,{className:`flex flex-col gap-3 p-5`,children:[(0,v.jsx)(`span`,{className:`h-2.5 w-2/3 rounded-full bg-white/13`}),(0,v.jsx)(`span`,{className:`h-2.5 w-full rounded-full bg-white/8`}),(0,v.jsx)(`span`,{className:`h-2.5 w-5/6 rounded-full bg-white/8`}),(0,v.jsx)(`span`,{className:`mt-3 h-20 rounded-lg bg-white/6`})]})]}),(0,v.jsx)(`div`,{className:`absolute inset-x-0 bottom-16 h-48`,inert:!0,children:(0,v.jsx)(m,{phase:`call`,call:p(x(`companionIntro.call.line`)),shareEnabled:!0,sharing:!0,assistantName:r??x(`companionIntro.announcement.previewAssistantName`),accentHex:e?.accentHex??void 0,character:w?.kind===`character`?w.traits:void 0,avatarSrc:w?.kind===`image`?w.url:void 0,avatarBox:y,optionsBox:b})})]})]})})})}function S({icon:e,title:t,body:n}){return(0,v.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,v.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-[color-mix(in_srgb,var(--avatar-accent,var(--surface-lift))_28%,var(--surface-base))] text-[var(--content-default)]`,children:(0,v.jsx)(e,{className:`size-4`})}),(0,v.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,v.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-emphasised)]`,children:t}),(0,v.jsx)(`span`,{className:`text-body-small-default leading-5 text-[var(--content-tertiary)]`,children:n})]})]})}export{x as CompanionTourEntryModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Bg as t,Bl as n,Nl as r,Vg as i,_l as a,kl as o,wl as s}from"./app-g1TvV-Dl.js";import{E as c}from"./vendor-DwMhK7fD.js";import{t as l,x as u}from"./react-B9IgSVeK.js";import{n as d}from"./companion-accent-CBLb9Kpv.js";var f=e(u(),1);function p(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function m(e,t){return Math.round(e*1e3)*73856093^Math.round(t*1e3)*19349663}function h(e,t){if(e.length<2)return``;let n=n=>t?e[(n+e.length)%e.length]:e[Math.min(Math.max(n,0),e.length-1)],r=n(0),i=`M ${g(r.x)} ${g(r.y)}`,a=t?e.length:e.length-1;for(let e=0;e<a;e+=1){let t=n(e-1),r=n(e),a=n(e+1),o=n(e+2),s={x:r.x+(a.x-t.x)/6,y:r.y+(a.y-t.y)/6},c={x:a.x-(o.x-r.x)/6,y:a.y-(o.y-r.y)/6};i+=` C ${g(s.x)} ${g(s.y)}, ${g(c.x)} ${g(c.y)}, ${g(a.x)} ${g(a.y)}`}return t?`${i} Z`:i}function g(e){return Math.round(e*100)/100}var _=.09,v=.05,y=.028;function b(e){return Math.min(Math.max(e,0),_)}var x=1.5;x-Math.SQRT2*(x-1);function S(e,t){let n=Math.min(t*x,Math.min(e.width,e.height)/2+t),r=n-t,i=r,a=e.width-r,o=r,s=e.height-r,c={x:Math.max(a-i,0),y:Math.max(s-o,0)},l=Math.PI*n/2,u=[l,c.x,l,c.y,l,c.x,l,c.y],d=u.reduce((e,t)=>e+t,0),f=[{centre:{x:i,y:o},from:Math.PI},{centre:{x:a,y:o},from:-Math.PI/2},{centre:{x:a,y:s},from:0},{centre:{x:i,y:s},from:Math.PI/2}];return{at:e=>{let t=e%1*d;t<0&&(t+=d);for(let e=0;e<u.length;e+=1){let r=u[e];if(t>r&&e<u.length-1){t-=r;continue}let c=r===0?0:Math.min(t/r,1),l=f[e/2];if(e%2==0){let e=l.from+Math.PI/2*c;return{x:l.centre.x+Math.cos(e)*n,y:l.centre.y+Math.sin(e)*n}}let[d,p]=[[{x:i,y:o-n},{x:a,y:o-n}],[{x:a+n,y:o},{x:a+n,y:s}],[{x:a,y:s+n},{x:i,y:s+n}],[{x:i-n,y:s},{x:i-n,y:o}]][(e-1)/2];return{x:d.x+(p.x-d.x)*c,y:d.y+(p.y-d.y)*c}}return{x:0,y:0}},length:d}}function C(e,t){let n=t.padding??8,r={x:e.width/2,y:e.height/2},i=S(e,n),a=b(t.strength),o=p(t.seed),s=[];for(let e=0;e<=13;e+=1){let t=i.at(.18+1.055*e/13),n={x:t.x-r.x,y:t.y-r.y},c=Math.hypot(n.x,n.y)||1,l=o()*a*c;s.push({x:t.x+n.x/c*l,y:t.y+n.y/c*l})}return s}function w(e,t){return h(C(e,t),!1)}function T(e){let t=e.gap??10,n=b(e.strength),r=p(e.seed),i=e.length+t,a=Math.max(28,e.length*.55),o=a/2,s={x:o,y:i},c={x:o,y:t},l=r()<.5?-1:1,u=a*.17*l,d=e=>({x:(1-e)*(1-e)*s.x+2*(1-e)*e*(o+u)+e*e*c.x,y:(1-e)*(1-e)*s.y+2*(1-e)*e*((s.y+c.y)/2)+e*e*c.y}),f=[];for(let e=0;e<=9;e+=1){let t=e/9,i=d(t),o=(1-t)*(1-t),s=(r()-.5)*2*n*a*o;f.push({x:i.x+s,y:i.y})}let m=d(1-1/9),_=Math.atan2(c.y-m.y,c.x-m.x),v=Math.max(11,e.length*.3),y=.42,x=`M ${g(c.x+Math.cos(_-Math.PI+y)*v)} ${g(c.y+Math.sin(_-Math.PI+y)*v)} L ${g(c.x)} ${g(c.y)} L ${g(c.x+Math.cos(_-Math.PI-y)*v)} ${g(c.y+Math.sin(_-Math.PI-y)*v)}`;return{shaft:h(f,!1),head:x,width:a,height:i}}function E(){let[e,t]=(0,f.useState)(()=>({width:typeof window>`u`?0:window.innerWidth,height:typeof window>`u`?0:window.innerHeight}));return(0,f.useEffect)(()=>{let e=()=>{t({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]),e}var D=l(),O=.6,k=10,A=52,j=10,M=A+j,N=10,P=8;function F(e,t){let n=e.kind===`point`?M:0,r=e.kind===`point`?e.y:e.y+e.height,i=e.kind===`point`?0:e.width,a=(1-r)*t-n,o=e.y*t-n;return{above:a<58&&o>a,trailing:e.x+i>O}}function I(e,t,n){let r=n?1-e.y:e.kind===`point`?e.y:e.y+e.height,i=Math.max(t-58,0),a=e.kind===`point`?A:0;return Math.round(Math.min(r*t+a+k,i))}function L(e){let t=Math.min(Math.max(e,0),1)*100;return`${Number(t.toFixed(4))}%`}function R(e){let t=e.kind===`region`?`${e.width},${e.height}`:`point`;return`${e.kind},${e.x},${e.y},${t},${e.caption??``}`}function z({mark:e,box:t}){let n=Math.max(e.width*t.width,1),r=Math.max(e.height*t.height,1),i=N+P,a=w({width:n,height:r},{strength:v,seed:m(e.x,e.y),padding:N});return(0,D.jsxs)(`svg`,{className:`companion-coachmark`,"data-testid":`companion-coachmark`,"aria-hidden":`true`,viewBox:`${-i} ${-i} ${n+i*2} ${r+i*2}`,width:n+i*2,height:r+i*2,style:{left:Math.round(e.x*t.width-i),top:Math.round(e.y*t.height-i)},children:[(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:a}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:a})]})}function B({mark:e,above:t,box:n}){let r=T({length:A,approach:t?`above`:`below`,strength:y,seed:m(e.x,e.y),gap:j});return(0,D.jsxs)(`svg`,{className:`companion-coachmark-pointer`,"data-testid":`companion-coachmark-pointer`,"data-above":t?``:void 0,"aria-hidden":`true`,viewBox:`0 0 ${r.width} ${r.height}`,width:r.width,height:r.height,style:{left:Math.round(e.x*n.width-r.width/2),top:Math.round(e.y*n.height-(t?r.height:0)),...t?{"--companion-coachmark-turn":`rotate(180deg)`}:{}},children:[(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:r.shaft}),(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:r.head}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:r.shaft}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:r.head})]})}function V({marks:e,ink:t}){let n=E();return(0,D.jsx)(`div`,{className:`pointer-events-none fixed inset-0`,"data-testid":`companion-coachmarks`,style:{"--companion-ring-accent":t},role:`presentation`,children:e.map(e=>{let{above:t,trailing:r}=F(e,n.height),i=`${I(e,n.height,t)}px`;return(0,D.jsxs)(f.Fragment,{children:[e.kind===`region`?(0,D.jsx)(z,{mark:e,box:n}):(0,D.jsx)(B,{mark:e,above:t,box:n}),e.caption!==void 0&&e.caption!==``&&(0,D.jsx)(`div`,{className:`companion-coachmark-caption`,"data-testid":`companion-coachmark-caption`,"data-above":t?``:void 0,"data-trailing":r?``:void 0,style:{...r?{right:L(1-(e.kind===`region`?e.x+e.width:e.x))}:{left:L(e.x)},...t?{bottom:i}:{top:i},maxWidth:L(.4)},children:e.caption})]},R(e))})})}var H=4500,U=e=>Math.min(Math.max(e,0),1);function W(e,t,n){switch(e){case`line`:return[t,n];case`box`:return[t,{x:n.x,y:t.y},n,{x:t.x,y:n.y},t];case`circle`:{let e=(t.x+n.x)/2,r=(t.y+n.y)/2,i=Math.abs(n.x-t.x)/2,a=Math.abs(n.y-t.y)/2;return Array.from({length:49},(t,n)=>{let o=n/48*Math.PI*2;return{x:e+i*Math.cos(o),y:r+a*Math.sin(o)}})}}}function G(e,n,r){let i=(n.x-e.x)*r,a=n.y-e.y;return i*i+a*a>=t**2}var K=`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>`;function q(e){let t=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><g stroke="#ffffff" stroke-width="4">${K}</g><g stroke="${e}" stroke-width="2">${K}</g></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(t)}") 2 22, crosshair`}function J({ink:e,cleared:t=0,tool:n=`freehand`}){let[o,s]=(0,f.useState)([]),c=(0,f.useRef)([]),l=(0,f.useRef)(null),u=(0,f.useRef)({x:0,y:0}),d=(0,f.useRef)(!1),p=(0,f.useRef)(0),m=(0,f.useRef)(new Set),h=E(),g=h.height===0?1:h.width/h.height,_=(0,f.useRef)(e);(0,f.useEffect)(()=>{_.current=e},[e]),(0,f.useEffect)(()=>{let e=m.current;return()=>{for(let t of e)clearTimeout(t);e.clear(),l.current!==null&&(l.current=null,a(`released`,[],_.current))}},[]);let v=(0,f.useCallback)(e=>{c.current=e,s(e)},[]),y=(0,f.useRef)(t);(0,f.useEffect)(()=>{t!==y.current&&(y.current=t,v(c.current.filter(e=>e.id===l.current)))},[t,v]);let b=e=>({x:h.width===0?0:U(e.clientX/h.width),y:h.height===0?0:U(e.clientY/h.height)}),x=()=>{l.current===null&&(d.current=!0,r(!0))},S=()=>{d.current&&(d.current=!1,r(!1))},C=t=>{if(S(),l.current!==null)return;t.currentTarget.setPointerCapture(t.pointerId);let n=p.current++;l.current=n;let r=b(t);u.current=r,v([...c.current,{id:n,points:[r],spent:!1}]),a(`drawing`,[],e)},w=e=>{S();let t=l.current;if(t===null)return;let r=b(e),i=c.current.find(e=>e.id===t);if(i===void 0)return;let a=i.points[i.points.length-1];a!==void 0&&!G(a,r,g)||v(c.current.map(e=>e.id===t?{...e,points:n===`freehand`?[...e.points,r].slice(-512):W(n,u.current,r)}:e))},T=t=>{if(l.current===null)return;l.current=null,t.currentTarget.hasPointerCapture(t.pointerId)&&t.currentTarget.releasePointerCapture(t.pointerId);let n=c.current.map(e=>({...e,spent:!0}));v(n),a(`released`,n.slice(-24).map(e=>({points:e.points})),e);let r=new Set(n.map(e=>e.id)),i=setTimeout(()=>{m.current.delete(i),v(c.current.filter(e=>!r.has(e.id)))},H+900);m.current.add(i)},O=i*Math.min(h.width,h.height),k=(0,f.useMemo)(()=>q(e),[e]);return(0,D.jsx)(`svg`,{className:`companion-share-annotation fixed inset-0 h-full w-full`,style:{cursor:n===`freehand`?k:`crosshair`,"--companion-ink-hold":`${H}ms`,"--companion-ink-fade":`900ms`},"data-testid":`companion-share-annotation`,"data-cleared":t,"data-tool":n,role:`presentation`,onPointerDown:C,onPointerMove:w,onPointerUp:T,onPointerCancel:T,onWheel:x,children:o.map(t=>(0,D.jsx)(Y,{stroke:t,box:h,width:O,ink:e},t.id))})}function Y({stroke:e,box:t,width:n,ink:r}){let i=e.spent?`companion-share-ink companion-share-ink-spent`:`companion-share-ink`,a=e.points[0];return e.points.length===1&&a!==void 0?(0,D.jsx)(`circle`,{className:i,cx:a.x*t.width,cy:a.y*t.height,r:n/2,fill:r}):(0,D.jsx)(`polyline`,{className:i,points:e.points.map(e=>`${e.x*t.width},${e.y*t.height}`).join(` `),fill:`none`,stroke:r,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`})}function X(e,t){return e?{kind:`teaching`}:t===void 0?null:{kind:`sharing`,target:t}}function Z({read:e,assistantName:t,style:n}){let{t:r}=c(),i=t!==``,a=e.kind===`teaching`?i?r(`companionWatchFramePage.teachingNamed`,{name:t}):r(`companionWatchFramePage.teaching`):e.target.kind===`display`?i?r(`companionWatchFramePage.sharingScreenNamed`,{name:t}):r(`companionWatchFramePage.sharingScreen`):i?r(`companionWatchFramePage.sharingWindowNamed`,{name:t}):r(`companionWatchFramePage.sharingWindow`);return(0,D.jsxs)(`div`,{className:`companion-watch-frame-label`,"data-testid":`companion-watch-frame-label`,"data-read":e.kind,style:n,children:[(0,D.jsx)(`span`,{className:`companion-watch-frame-label-dot`}),a]})}function Q(e,t){let n=(0,f.useRef)({captureCount:e,watching:t}),[r,i]=(0,f.useState)(0);return(0,f.useEffect)(()=>{let r=n.current;if(n.current={captureCount:e,watching:t},!t){i(0);return}r.watching&&e>r.captureCount&&i(e=>e+1)},[e,t]),r}function $(e){let t=(0,f.useRef)(!1);(0,f.useEffect)(()=>{if(!e||t.current)return;let n=0,r=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>{t.current=!0,o()})});return()=>{cancelAnimationFrame(r),cancelAnimationFrame(n)}},[e])}function ee(){let[e,t]=(0,f.useState)(null);(0,f.useEffect)(()=>{let e=n(t);return s().then(e=>{e&&t(e)}),e},[]);let r=e?.watching===!0,i=e?.screenShare!==void 0,a=X(r,e?.screenShare),o=a!==null;$(o);let c=Q(e?.captureCount??0,r),l=d(e?.call??null,e?.accentHex,e?.character),u=l===void 0?void 0:{"--companion-ring-accent":l},p=e?.frameInsetTop??0,m=p>0?{...u,"--companion-frame-inset":`${p}px`}:u,h=e?.annotating===!0,g=i&&!r?e?.coachmarks??[]:[];return(0,D.jsxs)(`div`,{className:`pointer-events-none h-screen w-screen bg-transparent`,role:`presentation`,"aria-hidden":!0,children:[o&&(0,D.jsx)(`div`,{className:`companion-watch-frame fixed inset-0`,style:u}),a!==null&&(0,D.jsx)(Z,{read:a,assistantName:e?.assistantName??``,style:m}),r&&c>0&&(0,D.jsx)(`div`,{className:`companion-watch-frame-flash fixed inset-0`,style:u},c),h&&(0,D.jsx)(J,{ink:l??`#5eead4`,cleared:e?.marksCleared??0,tool:e?.annotationTool}),g.length>0&&(0,D.jsx)(V,{marks:g,ink:l??`#5eead4`})]})}export{ee as CompanionWatchFramePage};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Bg as t,Bl as n,Nl as r,Vg as i,_l as a,kl as o,wl as s}from"./app-XG_RF2yi.js";import{E as c}from"./vendor-DwMhK7fD.js";import{t as l,x as u}from"./react-B9IgSVeK.js";import{n as d}from"./companion-accent-CbS8BVae.js";var f=e(u(),1);function p(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function m(e,t){return Math.round(e*1e3)*73856093^Math.round(t*1e3)*19349663}function h(e,t){if(e.length<2)return``;let n=n=>t?e[(n+e.length)%e.length]:e[Math.min(Math.max(n,0),e.length-1)],r=n(0),i=`M ${g(r.x)} ${g(r.y)}`,a=t?e.length:e.length-1;for(let e=0;e<a;e+=1){let t=n(e-1),r=n(e),a=n(e+1),o=n(e+2),s={x:r.x+(a.x-t.x)/6,y:r.y+(a.y-t.y)/6},c={x:a.x-(o.x-r.x)/6,y:a.y-(o.y-r.y)/6};i+=` C ${g(s.x)} ${g(s.y)}, ${g(c.x)} ${g(c.y)}, ${g(a.x)} ${g(a.y)}`}return t?`${i} Z`:i}function g(e){return Math.round(e*100)/100}var _=.09,v=.05,y=.028;function b(e){return Math.min(Math.max(e,0),_)}var x=1.5;x-Math.SQRT2*(x-1);function S(e,t){let n=Math.min(t*x,Math.min(e.width,e.height)/2+t),r=n-t,i=r,a=e.width-r,o=r,s=e.height-r,c={x:Math.max(a-i,0),y:Math.max(s-o,0)},l=Math.PI*n/2,u=[l,c.x,l,c.y,l,c.x,l,c.y],d=u.reduce((e,t)=>e+t,0),f=[{centre:{x:i,y:o},from:Math.PI},{centre:{x:a,y:o},from:-Math.PI/2},{centre:{x:a,y:s},from:0},{centre:{x:i,y:s},from:Math.PI/2}];return{at:e=>{let t=e%1*d;t<0&&(t+=d);for(let e=0;e<u.length;e+=1){let r=u[e];if(t>r&&e<u.length-1){t-=r;continue}let c=r===0?0:Math.min(t/r,1),l=f[e/2];if(e%2==0){let e=l.from+Math.PI/2*c;return{x:l.centre.x+Math.cos(e)*n,y:l.centre.y+Math.sin(e)*n}}let[d,p]=[[{x:i,y:o-n},{x:a,y:o-n}],[{x:a+n,y:o},{x:a+n,y:s}],[{x:a,y:s+n},{x:i,y:s+n}],[{x:i-n,y:s},{x:i-n,y:o}]][(e-1)/2];return{x:d.x+(p.x-d.x)*c,y:d.y+(p.y-d.y)*c}}return{x:0,y:0}},length:d}}function C(e,t){let n=t.padding??8,r={x:e.width/2,y:e.height/2},i=S(e,n),a=b(t.strength),o=p(t.seed),s=[];for(let e=0;e<=13;e+=1){let t=i.at(.18+1.055*e/13),n={x:t.x-r.x,y:t.y-r.y},c=Math.hypot(n.x,n.y)||1,l=o()*a*c;s.push({x:t.x+n.x/c*l,y:t.y+n.y/c*l})}return s}function w(e,t){return h(C(e,t),!1)}function T(e){let t=e.gap??10,n=b(e.strength),r=p(e.seed),i=e.length+t,a=Math.max(28,e.length*.55),o=a/2,s={x:o,y:i},c={x:o,y:t},l=r()<.5?-1:1,u=a*.17*l,d=e=>({x:(1-e)*(1-e)*s.x+2*(1-e)*e*(o+u)+e*e*c.x,y:(1-e)*(1-e)*s.y+2*(1-e)*e*((s.y+c.y)/2)+e*e*c.y}),f=[];for(let e=0;e<=9;e+=1){let t=e/9,i=d(t),o=(1-t)*(1-t),s=(r()-.5)*2*n*a*o;f.push({x:i.x+s,y:i.y})}let m=d(1-1/9),_=Math.atan2(c.y-m.y,c.x-m.x),v=Math.max(11,e.length*.3),y=.42,x=`M ${g(c.x+Math.cos(_-Math.PI+y)*v)} ${g(c.y+Math.sin(_-Math.PI+y)*v)} L ${g(c.x)} ${g(c.y)} L ${g(c.x+Math.cos(_-Math.PI-y)*v)} ${g(c.y+Math.sin(_-Math.PI-y)*v)}`;return{shaft:h(f,!1),head:x,width:a,height:i}}function E(){let[e,t]=(0,f.useState)(()=>({width:typeof window>`u`?0:window.innerWidth,height:typeof window>`u`?0:window.innerHeight}));return(0,f.useEffect)(()=>{let e=()=>{t({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]),e}var D=l(),O=.6,k=10,A=52,j=10,M=A+j,N=10,P=8;function F(e,t){let n=e.kind===`point`?M:0,r=e.kind===`point`?e.y:e.y+e.height,i=e.kind===`point`?0:e.width,a=(1-r)*t-n,o=e.y*t-n;return{above:a<58&&o>a,trailing:e.x+i>O}}function I(e,t,n){let r=n?1-e.y:e.kind===`point`?e.y:e.y+e.height,i=Math.max(t-58,0),a=e.kind===`point`?A:0;return Math.round(Math.min(r*t+a+k,i))}function L(e){let t=Math.min(Math.max(e,0),1)*100;return`${Number(t.toFixed(4))}%`}function R(e){let t=e.kind===`region`?`${e.width},${e.height}`:`point`;return`${e.kind},${e.x},${e.y},${t},${e.caption??``}`}function z({mark:e,box:t}){let n=Math.max(e.width*t.width,1),r=Math.max(e.height*t.height,1),i=N+P,a=w({width:n,height:r},{strength:v,seed:m(e.x,e.y),padding:N});return(0,D.jsxs)(`svg`,{className:`companion-coachmark`,"data-testid":`companion-coachmark`,"aria-hidden":`true`,viewBox:`${-i} ${-i} ${n+i*2} ${r+i*2}`,width:n+i*2,height:r+i*2,style:{left:Math.round(e.x*t.width-i),top:Math.round(e.y*t.height-i)},children:[(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:a}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:a})]})}function B({mark:e,above:t,box:n}){let r=T({length:A,approach:t?`above`:`below`,strength:y,seed:m(e.x,e.y),gap:j});return(0,D.jsxs)(`svg`,{className:`companion-coachmark-pointer`,"data-testid":`companion-coachmark-pointer`,"data-above":t?``:void 0,"aria-hidden":`true`,viewBox:`0 0 ${r.width} ${r.height}`,width:r.width,height:r.height,style:{left:Math.round(e.x*n.width-r.width/2),top:Math.round(e.y*n.height-(t?r.height:0)),...t?{"--companion-coachmark-turn":`rotate(180deg)`}:{}},children:[(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:r.shaft}),(0,D.jsx)(`path`,{className:`companion-coachmark-halo`,d:r.head}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:r.shaft}),(0,D.jsx)(`path`,{className:`companion-coachmark-ink`,d:r.head})]})}function V({marks:e,ink:t}){let n=E();return(0,D.jsx)(`div`,{className:`pointer-events-none fixed inset-0`,"data-testid":`companion-coachmarks`,style:{"--companion-ring-accent":t},role:`presentation`,children:e.map(e=>{let{above:t,trailing:r}=F(e,n.height),i=`${I(e,n.height,t)}px`;return(0,D.jsxs)(f.Fragment,{children:[e.kind===`region`?(0,D.jsx)(z,{mark:e,box:n}):(0,D.jsx)(B,{mark:e,above:t,box:n}),e.caption!==void 0&&e.caption!==``&&(0,D.jsx)(`div`,{className:`companion-coachmark-caption`,"data-testid":`companion-coachmark-caption`,"data-above":t?``:void 0,"data-trailing":r?``:void 0,style:{...r?{right:L(1-(e.kind===`region`?e.x+e.width:e.x))}:{left:L(e.x)},...t?{bottom:i}:{top:i},maxWidth:L(.4)},children:e.caption})]},R(e))})})}var H=4500,U=e=>Math.min(Math.max(e,0),1);function W(e,t,n){switch(e){case`line`:return[t,n];case`box`:return[t,{x:n.x,y:t.y},n,{x:t.x,y:n.y},t];case`circle`:{let e=(t.x+n.x)/2,r=(t.y+n.y)/2,i=Math.abs(n.x-t.x)/2,a=Math.abs(n.y-t.y)/2;return Array.from({length:49},(t,n)=>{let o=n/48*Math.PI*2;return{x:e+i*Math.cos(o),y:r+a*Math.sin(o)}})}}}function G(e,n,r){let i=(n.x-e.x)*r,a=n.y-e.y;return i*i+a*a>=t**2}var K=`<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>`;function q(e){let t=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><g stroke="#ffffff" stroke-width="4">${K}</g><g stroke="${e}" stroke-width="2">${K}</g></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(t)}") 2 22, crosshair`}function J({ink:e,cleared:t=0,tool:n=`freehand`}){let[o,s]=(0,f.useState)([]),c=(0,f.useRef)([]),l=(0,f.useRef)(null),u=(0,f.useRef)({x:0,y:0}),d=(0,f.useRef)(!1),p=(0,f.useRef)(0),m=(0,f.useRef)(new Set),h=E(),g=h.height===0?1:h.width/h.height,_=(0,f.useRef)(e);(0,f.useEffect)(()=>{_.current=e},[e]),(0,f.useEffect)(()=>{let e=m.current;return()=>{for(let t of e)clearTimeout(t);e.clear(),l.current!==null&&(l.current=null,a(`released`,[],_.current))}},[]);let v=(0,f.useCallback)(e=>{c.current=e,s(e)},[]),y=(0,f.useRef)(t);(0,f.useEffect)(()=>{t!==y.current&&(y.current=t,v(c.current.filter(e=>e.id===l.current)))},[t,v]);let b=e=>({x:h.width===0?0:U(e.clientX/h.width),y:h.height===0?0:U(e.clientY/h.height)}),x=()=>{l.current===null&&(d.current=!0,r(!0))},S=()=>{d.current&&(d.current=!1,r(!1))},C=t=>{if(S(),l.current!==null)return;t.currentTarget.setPointerCapture(t.pointerId);let n=p.current++;l.current=n;let r=b(t);u.current=r,v([...c.current,{id:n,points:[r],spent:!1}]),a(`drawing`,[],e)},w=e=>{S();let t=l.current;if(t===null)return;let r=b(e),i=c.current.find(e=>e.id===t);if(i===void 0)return;let a=i.points[i.points.length-1];a!==void 0&&!G(a,r,g)||v(c.current.map(e=>e.id===t?{...e,points:n===`freehand`?[...e.points,r].slice(-512):W(n,u.current,r)}:e))},T=t=>{if(l.current===null)return;l.current=null,t.currentTarget.hasPointerCapture(t.pointerId)&&t.currentTarget.releasePointerCapture(t.pointerId);let n=c.current.map(e=>({...e,spent:!0}));v(n),a(`released`,n.slice(-24).map(e=>({points:e.points})),e);let r=new Set(n.map(e=>e.id)),i=setTimeout(()=>{m.current.delete(i),v(c.current.filter(e=>!r.has(e.id)))},H+900);m.current.add(i)},O=i*Math.min(h.width,h.height),k=(0,f.useMemo)(()=>q(e),[e]);return(0,D.jsx)(`svg`,{className:`companion-share-annotation fixed inset-0 h-full w-full`,style:{cursor:n===`freehand`?k:`crosshair`,"--companion-ink-hold":`${H}ms`,"--companion-ink-fade":`900ms`},"data-testid":`companion-share-annotation`,"data-cleared":t,"data-tool":n,role:`presentation`,onPointerDown:C,onPointerMove:w,onPointerUp:T,onPointerCancel:T,onWheel:x,children:o.map(t=>(0,D.jsx)(Y,{stroke:t,box:h,width:O,ink:e},t.id))})}function Y({stroke:e,box:t,width:n,ink:r}){let i=e.spent?`companion-share-ink companion-share-ink-spent`:`companion-share-ink`,a=e.points[0];return e.points.length===1&&a!==void 0?(0,D.jsx)(`circle`,{className:i,cx:a.x*t.width,cy:a.y*t.height,r:n/2,fill:r}):(0,D.jsx)(`polyline`,{className:i,points:e.points.map(e=>`${e.x*t.width},${e.y*t.height}`).join(` `),fill:`none`,stroke:r,strokeWidth:n,strokeLinecap:`round`,strokeLinejoin:`round`})}function X(e,t){return e?{kind:`teaching`}:t===void 0?null:{kind:`sharing`,target:t}}function Z({read:e,assistantName:t,style:n}){let{t:r}=c(),i=t!==``,a=e.kind===`teaching`?i?r(`companionWatchFramePage.teachingNamed`,{name:t}):r(`companionWatchFramePage.teaching`):e.target.kind===`display`?i?r(`companionWatchFramePage.sharingScreenNamed`,{name:t}):r(`companionWatchFramePage.sharingScreen`):i?r(`companionWatchFramePage.sharingWindowNamed`,{name:t}):r(`companionWatchFramePage.sharingWindow`);return(0,D.jsxs)(`div`,{className:`companion-watch-frame-label`,"data-testid":`companion-watch-frame-label`,"data-read":e.kind,style:n,children:[(0,D.jsx)(`span`,{className:`companion-watch-frame-label-dot`}),a]})}function Q(e,t){let n=(0,f.useRef)({captureCount:e,watching:t}),[r,i]=(0,f.useState)(0);return(0,f.useEffect)(()=>{let r=n.current;if(n.current={captureCount:e,watching:t},!t){i(0);return}r.watching&&e>r.captureCount&&i(e=>e+1)},[e,t]),r}function $(e){let t=(0,f.useRef)(!1);(0,f.useEffect)(()=>{if(!e||t.current)return;let n=0,r=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>{t.current=!0,o()})});return()=>{cancelAnimationFrame(r),cancelAnimationFrame(n)}},[e])}function ee(){let[e,t]=(0,f.useState)(null);(0,f.useEffect)(()=>{let e=n(t);return s().then(e=>{e&&t(e)}),e},[]);let r=e?.watching===!0,i=e?.screenShare!==void 0,a=X(r,e?.screenShare),o=a!==null;$(o);let c=Q(e?.captureCount??0,r),l=d(e?.call??null,e?.accentHex,e?.character),u=l===void 0?void 0:{"--companion-ring-accent":l},p=e?.frameInsetTop??0,m=p>0?{...u,"--companion-frame-inset":`${p}px`}:u,h=e?.annotating===!0,g=i&&!r?e?.coachmarks??[]:[];return(0,D.jsxs)(`div`,{className:`pointer-events-none h-screen w-screen bg-transparent`,role:`presentation`,"aria-hidden":!0,children:[o&&(0,D.jsx)(`div`,{className:`companion-watch-frame fixed inset-0`,style:u}),a!==null&&(0,D.jsx)(Z,{read:a,assistantName:e?.assistantName??``,style:m}),r&&c>0&&(0,D.jsx)(`div`,{className:`companion-watch-frame-flash fixed inset-0`,style:u},c),h&&(0,D.jsx)(J,{ink:l??`#5eead4`,cleared:e?.marksCleared??0,tool:e?.annotationTool}),g.length>0&&(0,D.jsx)(V,{marks:g,ink:l??`#5eead4`})]})}export{ee as CompanionWatchFramePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{AC as t,BC as n,OC as r,mS as i,nt as a,sC as o}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{AC as t,BC as n,OC as r,mS as i,nt as a,sC as o}from"./app-XG_RF2yi.js";import{E as s,Xn as c,nr as l}from"./vendor-DwMhK7fD.js";import{_ as u,f as d,t as f,x as p}from"./react-B9IgSVeK.js";import{D as m,tr as h}from"./icons-C0wyat6T.js";import{n as g}from"./a2a-invite-2DFcr5cK.js";import{r as _}from"./contacts-gateway-CXKsci-d.js";var v=e(p(),1),y=f();function b(e){let t=e[0];return typeof t==`object`&&!!t&&t._id===`contactsGet`}function x(e){switch(e){case`expired`:case`not_found`:return`connectPage.errorExpired`;case`already_redeemed_by_other`:return`connectPage.errorAlreadyRedeemed`;case`sender_not_found`:return`connectPage.errorSenderNotFound`;case`not_platform_managed`:return`connectPage.errorNotPlatformManaged`;default:return null}}function S(){return(0,y.jsx)(C,{assistantId:a()})}function C({assistantId:e}){let{t:a}=s(`contacts`),f=d(),p=l(),[S]=u(),C=(0,v.useMemo)(()=>g(S),[S]),w=c({mutationFn:()=>{if(!C)throw Error(`Invalid invite link`);return _(e,{senderAssistantId:C.senderAssistantId,token:C.token})},onSuccess:e=>{e.success&&(p.invalidateQueries({predicate:e=>b(e.queryKey)}),e.alreadyConnected?o(a(`connectPage.alreadyConnected`)):o(a(`connectPage.connected`)),f(i.contacts.root))}}),T=(0,v.useCallback)(()=>{f(i.contacts.root)},[f]),E=(0,v.useCallback)(()=>{w.mutate()},[w]),D=(0,v.useMemo)(()=>{if(w.isError)return w.error instanceof Error?w.error.message:a(`connectPage.errorGeneric`);if(w.data&&!w.data.success){let e=x(w.data.errorCode);return e?a(e):w.data.error||a(`connectPage.errorGeneric`)}return null},[w.isError,w.error,w.data,a]);return C?(0,y.jsx)(`div`,{className:`flex min-h-full items-center justify-center p-6`,children:(0,y.jsx)(r,{className:`w-full max-w-md`,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(h,{className:`h-6 w-6`,style:{color:`var(--content-secondary)`}}),(0,y.jsx)(t,{variant:`title-small`,children:a(`connectPage.title`)})]}),(0,y.jsx)(t,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:a(`connectPage.body`)}),D&&(0,y.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md p-3`,style:{backgroundColor:`var(--system-negative-weak)`,color:`var(--system-negative-strong)`},children:[(0,y.jsx)(m,{className:`h-4 w-4 shrink-0`}),(0,y.jsx)(t,{variant:`body-small-default`,children:D})]}),(0,y.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,y.jsx)(n,{variant:`primary`,onClick:E,loading:w.isPending,disabled:w.isPending,children:w.isPending?a(`actions.connecting`):a(`actions.connect`)}),(0,y.jsx)(n,{variant:`outlined`,onClick:T,disabled:w.isPending,children:a(`actions.cancel`)})]})]})})}):(0,y.jsx)(`div`,{className:`flex min-h-full items-center justify-center p-6`,children:(0,y.jsx)(r,{className:`w-full max-w-md`,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(m,{className:`h-6 w-6`,style:{color:`var(--system-negative-strong)`}}),(0,y.jsx)(t,{variant:`title-small`,children:a(`connectPage.invalidTitle`)})]}),(0,y.jsx)(t,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:a(`connectPage.invalidBody`)}),(0,y.jsx)(`div`,{className:`flex gap-2 pt-2`,children:(0,y.jsx)(n,{variant:`primary`,onClick:T,children:a(`connectPage.goToContacts`)})})]})})})}export{S as ConnectPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{My as e,OC as t,mC as n,mS as r,pS as i}from"./app-
|
|
1
|
+
import{My as e,OC as t,mC as n,mS as r,pS as i}from"./app-XG_RF2yi.js";import{E as a,O as o}from"./vendor-DwMhK7fD.js";import{t as s}from"./react-B9IgSVeK.js";import{t as c}from"./setting-row-CaZDTGD2.js";var l=s(),u=[`[&_button[data-state=checked]]:bg-[var(--primary-base)]`,`[&_svg]:text-[var(--content-inset)]`,`[&_button[data-state=unchecked]]:bg-[var(--surface-base)]`,`[&_button[data-state=unchecked]]:border-[var(--border-element)]`].join(` `),d=`mb-2.5 ml-1 text-body-small-default font-medium uppercase tracking-wider text-[var(--content-tertiary)]`,f={privacy:{href:r.docs.legal.privacyPolicy,text:`Privacy and AI Data Sharing Policy`,aria:`I agree to the Privacy and AI Data Sharing Policy`},tos:{href:r.docs.legal.termsOfUse,text:`Terms of Service`,aria:`I agree to the Terms of Service`}};function p({kind:t,checked:r,onChange:a}){let s=f[t];return(0,l.jsx)(n,{checked:r,onCheckedChange:e=>a(e===!0),label:(0,l.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:(0,l.jsx)(o,{i18nKey:`consentControls.agreeTo`,ns:`onboarding`,values:{policy:s.text},components:{link:(0,l.jsx)(e,{href:i(s.href),tone:`quiet`,glyph:!1})}})}),"aria-label":s.aria,className:u})}function m(){return(0,l.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function h({notes:e}){let{t}=a(`onboarding`);return!e||e.length===0?null:(0,l.jsxs)(`div`,{className:`rounded-r-md border-l-2 border-[var(--content-secondary)] bg-[var(--surface-base)] py-3 pl-3.5 pr-3.5`,children:[(0,l.jsx)(`p`,{className:`text-body-small-default font-medium text-[var(--content-secondary)]`,children:t(`consentControls.whatsChanged`)}),e.length===1?(0,l.jsx)(`p`,{className:`mt-1.5 text-body-medium-lighter text-[var(--content-default)]`,children:e[0]}):(0,l.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1.5`,children:e.map(e=>(0,l.jsxs)(`li`,{className:`flex gap-2.5 text-body-medium-lighter text-[var(--content-default)]`,children:[(0,l.jsx)(`span`,{"aria-hidden":!0,className:`mt-[0.5em] h-1 w-1 flex-none rounded-full bg-[var(--content-tertiary)]`}),(0,l.jsx)(`span`,{children:e})]},e))})]})}function g({electron:e,showAnalytics:n=!0,showDiagnostics:r=!0,shareAnalytics:i,shareDiagnostics:o,onShareAnalyticsChange:s,onShareDiagnosticsChange:u,className:f,style:p}){let{t:h}=a(`onboarding`);return(0,l.jsxs)(`section`,{className:f,style:p,children:[(0,l.jsx)(`p`,{className:d,children:h(`consentControls.privacyPreferences`)}),(0,l.jsx)(t,{padding:e?`sm`:`md`,className:`w-full`,children:(0,l.jsxs)(`div`,{className:`flex flex-col ${e?`gap-3`:`gap-4`}`,children:[n&&(0,l.jsx)(c,{label:h(`consentControls.analyticsLabel`),helperText:h(`consentControls.analyticsHelp`),checked:i,onChange:s}),n&&r&&(0,l.jsx)(m,{}),r&&(0,l.jsx)(c,{label:h(`consentControls.diagnosticsLabel`),helperText:h(`consentControls.diagnosticsHelp`),checked:o,onChange:u})]})})]})}function _({electron:e,showPrivacy:t=!0,showTos:n=!0,privacyConsent:r,tosAccepted:i,onPrivacyChange:o,onTosChange:s,privacyNotes:c,tosNotes:u,className:f,style:m}){let{t:g}=a(`onboarding`);return(0,l.jsxs)(`section`,{className:f,style:m,children:[(0,l.jsx)(`p`,{className:d,children:g(`consentControls.agreements`)}),(0,l.jsxs)(`div`,{className:`flex flex-col pl-2 ${e?`gap-3.5`:`gap-4`}`,children:[t&&(0,l.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,l.jsx)(h,{notes:c}),(0,l.jsx)(p,{kind:`privacy`,checked:r,onChange:o})]}),n&&(0,l.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,l.jsx)(h,{notes:u}),(0,l.jsx)(p,{kind:`tos`,checked:i,onChange:s})]})]})]})}export{g as n,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AS as e,DS as t,Jf as n,OS as r,Xf as i,Yf as a,av as o}from"./app-
|
|
1
|
+
import{AS as e,DS as t,Jf as n,OS as r,Xf as i,Yf as a,av as o}from"./app-XG_RF2yi.js";async function s(n,a){let{data:o,error:s,response:c}=await i({path:{assistant_id:n},body:a,throwOnError:!1});if(r(c,s,`Failed to save contact`),!c.ok||!o?.contact)throw new t(c.status,e(s,c,`Failed to save contact`));return o.contact}async function c(n,i){let{error:o,response:s}=await a({path:{assistant_id:n,contact_id:i},throwOnError:!1});if(r(s,o,`Failed to delete contact`),!s.ok&&s.status!==204)throw new t(s.status,e(o,s,`Failed to delete contact`))}async function l(i,a){let{error:o,response:s}=await n({path:{assistant_id:i,channel_id:a},throwOnError:!1});if(r(s,o,`Failed to verify channel`),!s.ok)throw new t(s.status,e(o,s,`Failed to verify channel`))}async function u(e,n,r){let i=(await s(e,{id:n.id,displayName:n.displayName,channels:[{type:r.type,address:r.address}]})).channels.find(e=>e.type===r.type&&e.address.toLowerCase()===r.address.toLowerCase());if(!i)throw new t(409,`That account is already linked to another contact.`);if(i.status===`blocked`)throw new t(409,`That account is blocked for this contact. Unblock it before linking.`);await l(e,i.id)}async function d(n,i){let{data:a,error:s,response:c}=await o.post({url:`/v1/assistants/{assistant_id}/a2a/invites/redeem/`,path:{assistant_id:n},body:{sender_assistant_id:i.senderAssistantId,token:i.token},headers:{"Content-Type":`application/json`},throwOnError:!1});if(r(c,s,`Failed to redeem A2A invite`),!c.ok)throw new t(c.status,e(s,c,`Failed to redeem A2A invite`));return{success:a?.success??!0,alreadyConnected:a?.already_connected,error:a?.error,errorCode:a?.error_code}}export{l as a,s as i,u as n,d as r,c as t};
|