@vellumai/web 0.11.5-staging.1 → 0.11.5-staging.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/dist/assets/{Trans-Ayy2zoN6.js → Trans-CM5UUgDt.js} +1 -1
  2. package/dist/assets/{a2a-invite-BnytH07i.js → a2a-invite-CduLLtki.js} +1 -1
  3. package/dist/assets/{account-page-fksftFTI.js → account-page-CSJOSKzD.js} +1 -1
  4. package/dist/assets/{account-shell-Cm4mAmQ1.js → account-shell-WRaiE1O8.js} +1 -1
  5. package/dist/assets/{acp-run-detail-panel-DpY-2IUp.js → acp-run-detail-panel-gR77X6Xm.js} +1 -1
  6. package/dist/assets/{activity-steps-panel-D9L-wNUS.js → activity-steps-panel-BglLu7wx.js} +1 -1
  7. package/dist/assets/{add-credential-modal-D2dFz_aq.js → add-credential-modal-DgoBqgwB.js} +1 -1
  8. package/dist/assets/{add-credits-modal-CmRWmR5E.js → add-credits-modal-BNab_7H9.js} +1 -1
  9. package/dist/assets/{ai-page-DSvzyRcE.js → ai-page-CLAFnWl5.js} +1 -1
  10. package/dist/assets/{api-key-screen-8g2vhXCU.js → api-key-screen-CS0KZgP6.js} +1 -1
  11. package/dist/assets/{app-card-Cz7zkQT3.js → app-card-C7c3c4l4.js} +1 -1
  12. package/dist/assets/{archive-redirect-page-ClPbJzqu.js → archive-redirect-page-DZkHnLmA.js} +1 -1
  13. package/dist/assets/{assistant-feature-flag-store-DPde0AIx.js → assistant-feature-flag-store-CdXRp9pV.js} +1 -1
  14. package/dist/assets/{assistant-status-panel-uGuW1yZK.js → assistant-status-panel-BogBdYLj.js} +1 -1
  15. package/dist/assets/auth-store-iNnDaLgR.js +2 -0
  16. package/dist/assets/{auth-welcome-screen-Da31gKxW.js → auth-welcome-screen-BoiE47Sg.js} +1 -1
  17. package/dist/assets/{avatar-random-BL7Gu5qp.js → avatar-random-C7t2cN3Y.js} +1 -1
  18. package/dist/assets/{background-task-detail-panel-CxmesGo1.js → background-task-detail-panel-BeXbhHLZ.js} +1 -1
  19. package/dist/assets/{billing-page-EthbxOpl.js → billing-page-PuFxEptl.js} +3 -3
  20. package/dist/assets/{billing-redirect-page-DbvbLo7I.js → billing-redirect-page-BFDitQeE.js} +1 -1
  21. package/dist/assets/bookmarks-page-DY_CJ4I3.js +1 -0
  22. package/dist/assets/{browser-DH4V-FME.js → browser--x9YKXWo.js} +2 -2
  23. package/dist/assets/{build-state-DjZj1PEB.js → build-state-Dtia1Hnq.js} +1 -1
  24. package/dist/assets/{button-VkxVX0DM.js → button-C8CGr0T0.js} +1 -1
  25. package/dist/assets/{channels-page-route-DzS1In-E.js → channels-page-route-WZWPUfRo.js} +1 -1
  26. package/dist/assets/{chat-markdown-message-FJAu4s2A.js → chat-markdown-message-JeYI9m3i.js} +1 -1
  27. package/dist/assets/{checkbox-BkYoVUtf.js → checkbox-BWX_Dnge.js} +1 -1
  28. package/dist/assets/checkout-continuation-B-A9SoHt.js +1 -0
  29. package/dist/assets/{checkout-page-WkiUwe7y.js → checkout-page-BYHPD7UJ.js} +1 -1
  30. package/dist/assets/checkout-return-target-DnT91-Y_.js +1 -0
  31. package/dist/assets/{client-feature-flag-store-o8FXKc-R.js → client-feature-flag-store-DuVzcD-V.js} +1 -1
  32. package/dist/assets/{client-perf-EM-2B6Ha.js → client-perf-Bg-CBIVj.js} +1 -1
  33. package/dist/assets/{command-palette-Tz8bW1Zb.js → command-palette-C8JWMyiC.js} +1 -1
  34. package/dist/assets/{command-palette-window-page-CICaRPRP.js → command-palette-window-page-C8vw0yIO.js} +1 -1
  35. package/dist/assets/common-gaw6OefS.js +1 -0
  36. package/dist/assets/{community-page-CuJypGVc.js → community-page-DvR4X6k9.js} +1 -1
  37. package/dist/assets/companion-surface-page-iknPQRTu.js +1 -0
  38. package/dist/assets/{composer-settings-xBD4cVBI.js → composer-settings-B84-FOM1.js} +1 -1
  39. package/dist/assets/{confirm-dialog--7V28331.js → confirm-dialog-DYmL6FRe.js} +1 -1
  40. package/dist/assets/{connect-page-Dkitufkv.js → connect-page-CKAizrWr.js} +1 -1
  41. package/dist/assets/consent-DgQeejGe.js +1 -0
  42. package/dist/assets/{consent-controls-D7wjMU4g.js → consent-controls-V9Wca6TV.js} +1 -1
  43. package/dist/assets/{contacts-page-route-Dsb5c0ov.js → contacts-page-route-BceswcoE.js} +1 -1
  44. package/dist/assets/{conversation-cache-DJbtcDiW.js → conversation-cache-CuEQRyqi.js} +1 -1
  45. package/dist/assets/{conversation-navigation-Cg1rXwwx.js → conversation-navigation-CfOyMc6W.js} +1 -1
  46. package/dist/assets/{conversation-queries-YVB1UbYl.js → conversation-queries-CtAFZgFP.js} +1 -1
  47. package/dist/assets/{conversation-selection-CRqFjCDm.js → conversation-selection-ZuF7NVBR.js} +1 -1
  48. package/dist/assets/{copy-to-clipboard-wnEkIu5M.js → copy-to-clipboard-yufQqRBL.js} +1 -1
  49. package/dist/assets/{credential-entry-page-DvSQvCah.js → credential-entry-page-B0NYTomQ.js} +1 -1
  50. package/dist/assets/{credentials-page-qE6ZVx_g.js → credentials-page-DfOet7SI.js} +1 -1
  51. package/dist/assets/{csv-preview-CmccW-uE.js → csv-preview-QUU-h2MX.js} +1 -1
  52. package/dist/assets/{danger-zone-redirect-page-D9ysYxNl.js → danger-zone-redirect-page-B_ZMX7ns.js} +1 -1
  53. package/dist/assets/{debug-page-BUP88wEB.js → debug-page-DXvFlnqh.js} +1 -1
  54. package/dist/assets/{deploy-dialogs-DB5LzYcq.js → deploy-dialogs-ilUtMpvf.js} +1 -1
  55. package/dist/assets/{deploy-store-wUa1-kTk.js → deploy-store-C_y0BvwK.js} +1 -1
  56. package/dist/assets/{detail-card-DBxsIpmu.js → detail-card-DwBporBs.js} +1 -1
  57. package/dist/assets/{detail-drawer-PnkAA_sr.js → detail-drawer-Di5V_iLf.js} +1 -1
  58. package/dist/assets/{detail-shell-BpJzTGvM.js → detail-shell-CcrQic9y.js} +1 -1
  59. package/dist/assets/developer-page-B_LQmpH7.js +1 -0
  60. package/dist/assets/{devices-redirect-page-B1K9-KDL.js → devices-redirect-page-BD0VY17t.js} +1 -1
  61. package/dist/assets/{diagnostics-D82Xy5aG.js → diagnostics-BcQgahbk.js} +1 -1
  62. package/dist/assets/dist-BFOJNO7w.js +1 -0
  63. package/dist/assets/{dist-D94ZMew1.js → dist-BsGO-mS7.js} +1 -1
  64. package/dist/assets/{dist-CzN28mbE.js → dist-DN2Wju98.js} +1 -1
  65. package/dist/assets/{dist--4Bbb2u3.js → dist-eCSUXDGk.js} +1 -1
  66. package/dist/assets/{doctor-handoff-store-DsMgYJHu.js → doctor-handoff-store-B_RlFFKC.js} +1 -1
  67. package/dist/assets/{document-viewer-container-RskGQW6t.js → document-viewer-container-D3aPjnj8.js} +2 -2
  68. package/dist/assets/{document-viewer-page-CbpsmQWC.js → document-viewer-page-CvQXX7Mp.js} +1 -1
  69. package/dist/assets/{emails-page-_5YOJc7e.js → emails-page-DbAVQ_jC.js} +1 -1
  70. package/dist/assets/esm-4Bnaz5rU.js +2 -0
  71. package/dist/assets/{esm-BNARxlDM.js → esm-C4VoH46A.js} +1 -1
  72. package/dist/assets/{esm-D5OjXPP0.js → esm-CrXbhSov.js} +2 -2
  73. package/dist/assets/{esm-BRNK_0Y3.js → esm-Cz8_Dotd.js} +1 -1
  74. package/dist/assets/esm-DBGqhIh5.js +1 -0
  75. package/dist/assets/esm-DXPZZih3.js +2 -0
  76. package/dist/assets/esm-DcJxSeV0.js +2 -0
  77. package/dist/assets/{esm-8NN8IH0k.js → esm-Ddv_MyHw.js} +2 -2
  78. package/dist/assets/esm-Do2zrCWJ.js +2 -0
  79. package/dist/assets/esm-DrXV9mo-.js +2 -0
  80. package/dist/assets/{external-anchor-BQjaNMxT.js → external-anchor-owoORewf.js} +1 -1
  81. package/dist/assets/feature-flag-catalog-C1y2RUth.js +1 -0
  82. package/dist/assets/feed-item-status-actions-C3JfFvZc.js +1 -0
  83. package/dist/assets/{file-editor-DQtez5BN.js → file-editor-CeYfWNBz.js} +1 -1
  84. package/dist/assets/{file-markdown-CFQG2IW9.js → file-markdown-B9G_TXX-.js} +1 -1
  85. package/dist/assets/{first-run-scope-Cs-NWmVG.js → first-run-scope-MD-rEgje.js} +1 -1
  86. package/dist/assets/{format-usd-Dv-VJP5v.js → format-usd-BYzA1eMJ.js} +1 -1
  87. package/dist/assets/{funnel-events-DEzFt9ac.js → funnel-events-ClGpFDNM.js} +1 -1
  88. package/dist/assets/general-page-CzDlVoNx.js +1 -0
  89. package/dist/assets/{haptics-BR_zMLz2.js → haptics-F-nvqKYf.js} +2 -2
  90. package/dist/assets/{hatching-screen-BKmwq_y2.js → hatching-screen-FgNbjXOt.js} +1 -1
  91. package/dist/assets/{home-page-route-BWF6O6BN.js → home-page-route-C7Aeo-Mg.js} +1 -1
  92. package/dist/assets/{hosting-screen-BI8jdpYg.js → hosting-screen-CLVRdDiX.js} +1 -1
  93. package/dist/assets/{i18n-7Z5ghN39.js → i18n-C3bX3mTs.js} +1 -1
  94. package/dist/assets/{identity-page-route-pCMyDEEU.js → identity-page-route-CHncFua2.js} +1 -1
  95. package/dist/assets/index-C7hCfQpd.css +2 -0
  96. package/dist/assets/{index-CffZ8_I1.js → index-DS0PEdhO.js} +5 -5
  97. package/dist/assets/{ingest-BubkTA7j.js → ingest-C1wiUm1l.js} +1 -1
  98. package/dist/assets/{input-DkgpMeG9.js → input-DlkBtbxm.js} +1 -1
  99. package/dist/assets/{inspect-page-2b2xMjZ-.js → inspect-page-CNLiZXRt.js} +3 -3
  100. package/dist/assets/{installed-plugins-query-CmlpXeFG.js → installed-plugins-query-DQKwv-Iz.js} +1 -1
  101. package/dist/assets/{integrations-page-C6SEZlRH.js → integrations-page-B9SHiomg.js} +1 -1
  102. package/dist/assets/{intelligence-layout-BltAdOWl.js → intelligence-layout-BoW8JbDc.js} +1 -1
  103. package/dist/assets/internal-thread-actions-C0S_b7cx.js +1 -0
  104. package/dist/assets/{invalidate-memory-queries-C_LpIe-7.js → invalidate-memory-queries-uk2gV1m0.js} +1 -1
  105. package/dist/assets/{invalidate-plugin-queries-DpWKL6e1.js → invalidate-plugin-queries-CI1Cseau.js} +1 -1
  106. package/dist/assets/{keyboard-shortcuts-redirect-page-BZAeBBT5.js → keyboard-shortcuts-redirect-page-BY3Va4w9.js} +1 -1
  107. package/dist/assets/{latest-assistant-text-C8nmvw4v.js → latest-assistant-text-fXT5Jkt8.js} +1 -1
  108. package/dist/assets/{library-detail-page-BTDRSSKy.js → library-detail-page-CX92FKAK.js} +1 -1
  109. package/dist/assets/{library-page-GoqUkn2E.js → library-page-D2v2j-WU.js} +1 -1
  110. package/dist/assets/{list-row-D1odQOMJ.js → list-row-6uedKE84.js} +1 -1
  111. package/dist/assets/{local-runtime-upgrade-BTtW-R95.js → local-runtime-upgrade-BpvLk3HN.js} +1 -1
  112. package/dist/assets/{login-flow-DIQYXP6A.js → login-flow-BYBqjDap.js} +1 -1
  113. package/dist/assets/{login-page-hY9FaC1m.js → login-page-fl8rgXFq.js} +1 -1
  114. package/dist/assets/{logout-page-mVYiyZFE.js → logout-page-DLjLy7Hp.js} +1 -1
  115. package/dist/assets/{logs-layout-_ycf1xan.js → logs-layout-Du4o-HeH.js} +1 -1
  116. package/dist/assets/{markdown-preview-CzYn25XC.js → markdown-preview-ukYPAksc.js} +1 -1
  117. package/dist/assets/{memory-page-route-CA8ygLKs.js → memory-page-route-CvKjQ2FE.js} +1 -1
  118. package/dist/assets/{memory-router-playground-page-B8rj0dNA.js → memory-router-playground-page-Dh8zVze9.js} +1 -1
  119. package/dist/assets/{menu-noj9Ohcf.js → menu-Ci8JeI2H.js} +1 -1
  120. package/dist/assets/{message-files-panel-COyAxMPi.js → message-files-panel-DEAC2iCY.js} +1 -1
  121. package/dist/assets/{messages-BhT6U312.js → messages-D5oI1yRV.js} +1 -1
  122. package/dist/assets/{metric-card-BQ-q7_9N.js → metric-card-YqtdN5uX.js} +1 -1
  123. package/dist/assets/{modal-UYNawsIu.js → modal-DN_Uwwkg.js} +1 -1
  124. package/dist/assets/native-anchor-C13W_dF5.js +1 -0
  125. package/dist/assets/{native-biometric-Dk_rOSjU.js → native-biometric-DzQYY-Z2.js} +1 -1
  126. package/dist/assets/{native-file-Dt4IC5xP.js → native-file-qM32rSz7.js} +2 -2
  127. package/dist/assets/{navigation-resolver-Cb4Lilq5.js → navigation-resolver-B6QxHAa5.js} +1 -1
  128. package/dist/assets/{not-found-CV2fs1T6.js → not-found-DXwfp4Yf.js} +1 -1
  129. package/dist/assets/{notifications-DZCtGip1.js → notifications-DMNpr3pt.js} +1 -1
  130. package/dist/assets/{notifications-page-BZmovm97.js → notifications-page-DD-175gq.js} +1 -1
  131. package/dist/assets/{oauth-complete-page-BTWKsjld.js → oauth-complete-page-DBDWL3aD.js} +1 -1
  132. package/dist/assets/{oauth-connection-utils-9aKLpLet.js → oauth-connection-utils-dPIUOXze.js} +1 -1
  133. package/dist/assets/{oauth-popup-complete-page-Dn7v4THp.js → oauth-popup-complete-page-Dv0482xp.js} +1 -1
  134. package/dist/assets/{onboarding-layout-81jlZ1Nr.js → onboarding-layout-CYgAi-S1.js} +1 -1
  135. package/dist/assets/{open-workspace-file-CINDRVEK.js → open-workspace-file-Ca9gUjoQ.js} +2 -2
  136. package/dist/assets/{operational-status-D9ExUyuP.js → operational-status-DVK3_kD_.js} +1 -1
  137. package/dist/assets/{page-shell-DEN0SqaR.js → page-shell-nVp2ogSk.js} +1 -1
  138. package/dist/assets/{pairing-page-CUdrYuE6.js → pairing-page-CLNSXQ7A.js} +1 -1
  139. package/dist/assets/{password-reset-page-BkX1L0-o.js → password-reset-page-BNw-K6vZ.js} +1 -1
  140. package/dist/assets/{personality-page-C6Fs2NDZ.js → personality-page-axIG9Tu_.js} +1 -1
  141. package/dist/assets/{plans-page-CtUDk34m.js → plans-page-DQu9C86N.js} +1 -1
  142. package/dist/assets/{platform-detection-CuBj2s81.js → platform-detection-C-a_Mru0.js} +1 -1
  143. package/dist/assets/{platform-login-notice-V5xsGsbM.js → platform-login-notice-Dmq_2Akt.js} +1 -1
  144. package/dist/assets/{platform-loopback-page-07jf3mNj.js → platform-loopback-page-B0UOR3ct.js} +1 -1
  145. package/dist/assets/{plugin-detail-page-hHTbKbVT.js → plugin-detail-page-2ySPND3h.js} +1 -1
  146. package/dist/assets/{plugins-page-Cg5tKwHZ.js → plugins-page-D7jLWtXv.js} +1 -1
  147. package/dist/assets/popover-B_nY8VYI.js +1 -0
  148. package/dist/assets/{prefs-D-MNCWeN.js → prefs-BFDWWNwd.js} +1 -1
  149. package/dist/assets/{preview-error-UT2_K5co.js → preview-error-B7qHC1Y4.js} +1 -1
  150. package/dist/assets/{privacy-page-CN-sgiHL.js → privacy-page-B-FaZv9p.js} +1 -1
  151. package/dist/assets/{privacy-screen-WnmVno78.js → privacy-screen-Ng4c4whW.js} +1 -1
  152. package/dist/assets/{provider-callback-page-CZfGxI4n.js → provider-callback-page-CwYFxjk3.js} +1 -1
  153. package/dist/assets/{provider-signup-page-By9jDuQZ.js → provider-signup-page-BORU3SZe.js} +1 -1
  154. package/dist/assets/{push-registration-CHsDMNLd.js → push-registration-CyLSsbG5.js} +2 -2
  155. package/dist/assets/{remove-from-device-dialog-C0oKQcpu.js → remove-from-device-dialog-Bpy0yOG4.js} +1 -1
  156. package/dist/assets/{research-facts-CVSPPobz.js → research-facts-DzELMLzK.js} +1 -1
  157. package/dist/assets/{research-mock-page-Du5tkfLD.js → research-mock-page-BkcbRMpS.js} +1 -1
  158. package/dist/assets/{research-onboarding-route-1Gr9h1zU.js → research-onboarding-route-BlBSSOiI.js} +1 -1
  159. package/dist/assets/{research-results-view-D300rmPl.js → research-results-view-D1hOhfTP.js} +1 -1
  160. package/dist/assets/{retire-confirm-dialog-Dj9Jz__k.js → retire-confirm-dialog-Zwo-Sjrc.js} +1 -1
  161. package/dist/assets/{review-terms-screen-CgaEflP1.js → review-terms-screen-DmNdg_zJ.js} +1 -1
  162. package/dist/assets/routes-BaPyKuTq.js +24 -0
  163. package/dist/assets/{runtime-upgrade-banner-DeZvRYKI.js → runtime-upgrade-banner-bHSGkzwB.js} +2 -2
  164. package/dist/assets/{sandbox-bridge-DJb4AAAd.js → sandbox-bridge-BcJiBmUR.js} +1 -1
  165. package/dist/assets/{schedules-D1Qj_LW9.js → schedules-CgwiGq3x.js} +1 -1
  166. package/dist/assets/{schedules-page-yQdICdi-.js → schedules-page-Ca_u2KkZ.js} +1 -1
  167. package/dist/assets/{section-membership-BLXUZceV.js → section-membership-CJlFrKoM.js} +1 -1
  168. package/dist/assets/{security-redirect-page-C1UvbW-C.js → security-redirect-page-eZ_C_Wf0.js} +1 -1
  169. package/dist/assets/{select-D133FK9g.js → select-DJDG9pwU.js} +1 -1
  170. package/dist/assets/select-assistant-screen-DSLQRer8.js +1 -0
  171. package/dist/assets/{self-hosted-servers-DbufWkqP.js → self-hosted-servers-DJIKPu90.js} +1 -1
  172. package/dist/assets/settings-BY8t4asx.js +1 -0
  173. package/dist/assets/{settings-divider-Cps8oOmA.js → settings-divider-BCyO1zmM.js} +1 -1
  174. package/dist/assets/{settings-layout-BIJoqFh0.js → settings-layout-Cv8u2dv7.js} +1 -1
  175. package/dist/assets/{settings-navigation-CBm-xDCe.js → settings-navigation-R6E3Weed.js} +1 -1
  176. package/dist/assets/{share-feedback-modal-CNyAJFsA.js → share-feedback-modal-COH8zwku.js} +2 -2
  177. package/dist/assets/{sidebar-tree-D2xvxqPq.js → sidebar-tree-Bfvk_uAR.js} +1 -1
  178. package/dist/assets/{signup-page-CTjLMOgF.js → signup-page-BsMK6h9P.js} +1 -1
  179. package/dist/assets/{site-favicon-MMcieZs1.js → site-favicon-Bu9L02gb.js} +1 -1
  180. package/dist/assets/{skill-detail-page-33xPKTfo.js → skill-detail-page-D9WBRKuf.js} +1 -1
  181. package/dist/assets/{skill-detail-panel-DicPuAYf.js → skill-detail-panel-kCMadngl.js} +1 -1
  182. package/dist/assets/{skills-CAW10RD_.js → skills-C3-ibGUo.js} +1 -1
  183. package/dist/assets/{skills-page-DtcZVUgk.js → skills-page-BMYP4Xi0.js} +1 -1
  184. package/dist/assets/{sounds-page-B1xgQyur.js → sounds-page-Du1t_S8A.js} +1 -1
  185. package/dist/assets/{src-Ch3HTlFm.js → src-DMnnfLrU.js} +2 -2
  186. package/dist/assets/{start-screen-1HZMKOoC.js → start-screen-I5HBKHT6.js} +1 -1
  187. package/dist/assets/{status-badge-pill-C8kQPvkY.js → status-badge-pill-w-ULYfRy.js} +1 -1
  188. package/dist/assets/{stt-language-picker-modal-0Y0jfxfK.js → stt-language-picker-modal-Cq76JJex.js} +1 -1
  189. package/dist/assets/{subagent-detail-panel-cG6QAznG.js → subagent-detail-panel-DP4dB-Dz.js} +1 -1
  190. package/dist/assets/{subagent-store-Bho3BXWd.js → subagent-store-Bn8k7JMr.js} +1 -1
  191. package/dist/assets/{superpowers-page-CMB1OtM0.js → superpowers-page-COTkr31c.js} +1 -1
  192. package/dist/assets/{swipe-action-reveal-Dj3B2k-t.js → swipe-action-reveal-CQY9DSup.js} +1 -1
  193. package/dist/assets/{system-events-page-XOi-gc2G.js → system-events-page-CvoSQs7q.js} +1 -1
  194. package/dist/assets/{system-events-redirect-page-BrQ1djZt.js → system-events-redirect-page-BjnwAn9h.js} +1 -1
  195. package/dist/assets/{tag-Ddzwz3ij.js → tag-D2QYCm1p.js} +1 -1
  196. package/dist/assets/{telegram-setup-wizard-D0bxOb5-.js → telegram-setup-wizard-6UP2MTrh.js} +1 -1
  197. package/dist/assets/{text-preview-D78CT11A.js → text-preview-BG__pDe7.js} +1 -1
  198. package/dist/assets/{theme-stage-page-DPIaeTEy.js → theme-stage-page-YfsM529J.js} +1 -1
  199. package/dist/assets/{tiptap-document-editor-DjSqTI1f.js → tiptap-document-editor-BM6zL6R7.js} +2 -2
  200. package/dist/assets/{toast-ZCXyBjoj.js → toast-CHtrY-GO.js} +1 -1
  201. package/dist/assets/{tool-detail-panel-D8Zr9tQz.js → tool-detail-panel-_LC-zFuo.js} +1 -1
  202. package/dist/assets/{transcript-message-body-shared-DKncF4vA.js → transcript-message-body-shared-D8cmJP1C.js} +1 -1
  203. package/dist/assets/{trust-rules-api-JydQ2uwR.js → trust-rules-api-CE_KJOp2.js} +1 -1
  204. package/dist/assets/{upgrade-cancel-page-gyvvmc_X.js → upgrade-cancel-page-DyLSvLsm.js} +1 -1
  205. package/dist/assets/{upgrade-success-page-_86uG48f.js → upgrade-success-page-BRPyFCq4.js} +1 -1
  206. package/dist/assets/{usage-redirect-page-DheTMqmF.js → usage-redirect-page-C4O5a5QM.js} +1 -1
  207. package/dist/assets/use-app-theme-BMyUWfBR.js +1 -0
  208. package/dist/assets/{use-assistant-identity-details-DUPitZAF.js → use-assistant-identity-details-C3sH1daz.js} +1 -1
  209. package/dist/assets/{use-attachment-preview-Y4kLa4bZ.js → use-attachment-preview-BUJ9CHqr.js} +2 -2
  210. package/dist/assets/{use-attachment-squares-C8jwl-uP.js → use-attachment-squares-CFAezuph.js} +1 -1
  211. package/dist/assets/{use-bookmarks-D-YUJTtH.js → use-bookmarks--Hn0Ty3s.js} +1 -1
  212. package/dist/assets/{use-checkout-dismiss-refresh-DVs2FMHj.js → use-checkout-dismiss-refresh-CTdb-p9h.js} +1 -1
  213. package/dist/assets/{use-command-palette-sections-BBglPqI8.js → use-command-palette-sections-_F3pQkoi.js} +1 -1
  214. package/dist/assets/{use-copy-to-clipboard-CBJ6pmkd.js → use-copy-to-clipboard-BPX7B4SE.js} +1 -1
  215. package/dist/assets/{use-edge-swipe-C-5S-Uf_.js → use-edge-swipe-CJYjm94h.js} +1 -1
  216. package/dist/assets/{use-edge-swipe-back-BO5FNCGw.js → use-edge-swipe-back-L6kJ84LI.js} +2 -2
  217. package/dist/assets/{use-edit-app-Mv9eDXyB.js → use-edit-app-C0wNLJT8.js} +1 -1
  218. package/dist/assets/{use-invite-link-dialog-Dn0_apkq.js → use-invite-link-dialog-B1oz9iwD.js} +1 -1
  219. package/dist/assets/{use-is-org-ready-CXChKRKk.js → use-is-org-ready-CEB5IRpO.js} +1 -1
  220. package/dist/assets/{use-onboarding-login-LxAfxxq4.js → use-onboarding-login-DSP8WCFe.js} +1 -1
  221. package/dist/assets/{use-platform-assistant-id-DGkEazpv.js → use-platform-assistant-id-n0Yl5uUG.js} +1 -1
  222. package/dist/assets/{use-platform-gate-dRg4Iaxg.js → use-platform-gate-DNfLk9Xd.js} +1 -1
  223. package/dist/assets/{use-return-to-short-circuit-BxcUEcT0.js → use-return-to-short-circuit-CY3AuCF9.js} +1 -1
  224. package/dist/assets/{use-save-twilio-credentials-cvialhOy.js → use-save-twilio-credentials-BWaLXE4J.js} +1 -1
  225. package/dist/assets/{use-side-list-room-B4aMMgSM.js → use-side-list-room-CO7nxluQ.js} +1 -1
  226. package/dist/assets/{use-skill-actions-BJnqKPy2.js → use-skill-actions-D7CK9Jhy.js} +1 -1
  227. package/dist/assets/{use-skill-detail-files-Dr4hogsT.js → use-skill-detail-files-Cop9LnVd.js} +1 -1
  228. package/dist/assets/{use-sticky-profiles-BzJCyWjh.js → use-sticky-profiles-D3ybBRfX.js} +1 -1
  229. package/dist/assets/{use-stt-language-selection-CqvYwuRJ.js → use-stt-language-selection-Dkm4Uq69.js} +1 -1
  230. package/dist/assets/{use-subagent-card-data-Ck-rTbqy.js → use-subagent-card-data-DbKFX1Jc.js} +1 -1
  231. package/dist/assets/{use-swipe-horizontal-DqSSUt1N.js → use-swipe-horizontal-BwZ0yvoM.js} +1 -1
  232. package/dist/assets/use-touch-mobile-CaIiM-us.js +1 -0
  233. package/dist/assets/use-transcript-message-by-id-BbJqGOYZ.js +1 -0
  234. package/dist/assets/{use-transcript-messages-D2DbIxRi.js → use-transcript-messages-Bp4Jsfks.js} +1 -1
  235. package/dist/assets/{use-voice-sample-preview-DgOqv2M7.js → use-voice-sample-preview-4vpwPGNW.js} +1 -1
  236. package/dist/assets/{useTranslation-CJMg4EBF.js → useTranslation-CCDbxnME.js} +1 -1
  237. package/dist/assets/{voice-page-Cle_chtc.js → voice-page--99ik4mV.js} +1 -1
  238. package/dist/assets/{voice-providers-note-CtAmFnWb.js → voice-providers-note-7m0LvxmN.js} +1 -1
  239. package/dist/assets/{web-B3W2e_Vh.js → web-0-rqi4je.js} +1 -1
  240. package/dist/assets/{web-Dc65176I.js → web-8fcyoNsL.js} +1 -1
  241. package/dist/assets/{web-CY247JIt.js → web-DCamMnI1.js} +1 -1
  242. package/dist/assets/{web-67Khnm-P.js → web-DIlEhBsT.js} +1 -1
  243. package/dist/assets/{web-B1q1ICxT.js → web-Do_X9zWq.js} +1 -1
  244. package/dist/assets/{web-BTPJ9E5m.js → web-DsVO-tkH.js} +1 -1
  245. package/dist/assets/{web-BCijmPgJ.js → web-UN0kX9ic.js} +1 -1
  246. package/dist/assets/{web-DRglVskM.js → web-aW1scjmM.js} +1 -1
  247. package/dist/assets/{web-BLn6q1jU.js → web-eVpCzMlE.js} +1 -1
  248. package/dist/assets/{welcome-screen-BLOCzpJp.js → welcome-screen-Drdb1oS6.js} +1 -1
  249. package/dist/assets/{workflow-detail-panel-C2uCVk6h.js → workflow-detail-panel-DS9_MRNg.js} +1 -1
  250. package/dist/assets/{workspace-page-DDLacEWd.js → workspace-page-CPDwYVlW.js} +1 -1
  251. package/dist/assets/{workspace-tree-query-yJYR72mM.js → workspace-tree-query-DzYz0-QE.js} +1 -1
  252. package/dist/index.html +118 -118
  253. package/package.json +1 -1
  254. package/dist/assets/auth-store-DHZaL7sV.js +0 -2
  255. package/dist/assets/bookmarks-page-d8nnNDbX.js +0 -1
  256. package/dist/assets/checkout-continuation-Dy6JhKe2.js +0 -1
  257. package/dist/assets/checkout-return-target-DL3gHGhi.js +0 -1
  258. package/dist/assets/common-p0vxUnEQ.js +0 -1
  259. package/dist/assets/companion-surface-page-mFuAra3C.js +0 -1
  260. package/dist/assets/consent-B28ImHdT.js +0 -1
  261. package/dist/assets/developer-page-EXPzzlyV.js +0 -1
  262. package/dist/assets/dist-DMYOKN8y.js +0 -1
  263. package/dist/assets/esm-0I5Dlpfv.js +0 -2
  264. package/dist/assets/esm-3UB7kHQk.js +0 -1
  265. package/dist/assets/esm-ByRflon4.js +0 -2
  266. package/dist/assets/esm-CQSb4ucv.js +0 -2
  267. package/dist/assets/esm-Cg0JWVKA.js +0 -2
  268. package/dist/assets/esm-DRm8O1kL.js +0 -2
  269. package/dist/assets/feature-flag-catalog-BE_ZpOEG.js +0 -1
  270. package/dist/assets/feed-item-status-actions-Cz3H5a6L.js +0 -1
  271. package/dist/assets/general-page-B9DgYoMz.js +0 -1
  272. package/dist/assets/index-ClaG_N2S.css +0 -2
  273. package/dist/assets/internal-thread-actions-DNd3HO_g.js +0 -1
  274. package/dist/assets/native-anchor-BrkS1YE6.js +0 -1
  275. package/dist/assets/popover-D3A6cIyW.js +0 -1
  276. package/dist/assets/routes-DyzEBtxt.js +0 -24
  277. package/dist/assets/select-assistant-screen-Bo3KgcFM.js +0 -1
  278. package/dist/assets/settings-CNNFT1Oh.js +0 -1
  279. package/dist/assets/use-app-theme-CMwGeP40.js +0 -1
  280. package/dist/assets/use-touch-mobile-Dr8DcEJC.js +0 -1
  281. package/dist/assets/use-transcript-message-by-id-NAxAU6wP.js +0 -1
  282. /package/dist/assets/{dist-RzxQVwj7.js → dist-D7UWVopK.js} +0 -0
  283. /package/dist/assets/{native-deep-link-D1B4PPZo.js → native-deep-link-IwasVyFQ.js} +0 -0
  284. /package/dist/assets/{onboarding-store-CXXioE_U.js → onboarding-store-9CMrOvS2.js} +0 -0
  285. /package/dist/assets/{react-query.gen-OpeDEMIm.js → react-query.gen-CYP-Tn4K.js} +0 -0
  286. /package/dist/assets/{routes-Bj1LYNBZ.js → routes-yNhBxUSb.js} +0 -0
  287. /package/dist/assets/{theme-preferences-DYqPKXf4.js → theme-preferences-CAlH0BJX.js} +0 -0
  288. /package/dist/assets/{typed-storage-CMa-TZhF.js → typed-storage-BNw603jr.js} +0 -0
  289. /package/dist/assets/{use-assistant-avatar-By4FjR0h.js → use-assistant-avatar-adekIS8v.js} +0 -0
@@ -1 +0,0 @@
1
- import{t as e}from"./client-feature-flag-store-o8FXKc-R.js";import{E as t}from"./native-biometric-Dk_rOSjU.js";function n(){let t=e.use.marketingPricingTakeover(),n=e.use.hydrated();return t?`enabled`:n?`disabled`:`pending`}var r=`continue`;function i(e,n){return t(e.get(r),n)}export{i as n,n as r,r as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./dist-RzxQVwj7.js";import{r as t}from"./platform-detection-CuBj2s81.js";function n(){return t()===`macos`||e.isNativePlatform()?`native`:`web`}export{n as t};
@@ -1 +0,0 @@
1
- var e={configureAutoReload:`Configurar la recarga automática`},t={badge:`Error 404`,title:`Página no encontrada`,body:`La página que buscas no existe o puede haberse movido.`,backToAssistant:`Volver a tu asistente`,goBack:`Atrás`},n={title:`La utilización de recursos es alta`,body:`Tu asistente ha estado usando recursos elevados durante un periodo prolongado; mejora tu plan para potenciar tu asistente.`,bodyNoUpgrade:`Tu asistente ha estado usando recursos elevados durante un periodo prolongado.`,upgrade:`Mejorar plan`,dontShowAgain:`No mostrar de nuevo`},r={ariaLabel:`Acciones de {name}`},i={file:`Archivo`,view:`Ver`,developer:`Desarrollador`,help:`Ayuda`},a={addCreditsModal:e,notFound:t,resourcePressureBanner:n,sectionActionsButton:r,windowsMenuBar:i};export{e as addCreditsModal,a as default,t as notFound,n as resourcePressureBanner,r as sectionActionsButton,i as windowsMenuBar};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-BJ8jcmzB.js";import{t as r}from"./arrow-up-BiLIdQeR.js";import{c as i,l as a,n as o,o as s,s as c}from"./desktop-voice-activity-B0dHlUep.js";import{t as l}from"./check-NGUguBHp.js";import{t as u}from"./mic-W9IfxqWv.js";import{t as d}from"./volume-2-C9nj0NKL.js";import{t as f}from"./x-zfSDUG5z.js";import{p}from"./src-Ch3HTlFm.js";import{a as m,c as h,f as g,h as _,m as v,o as y,p as b,r as x,u as S}from"./schemas-CwBN1MUL.js";import{a as C,d as w,f as T,i as E,l as D,n as O,o as k,p as ee,s as A,t as j,u as M}from"./companion-surface-Cnmjk-6O.js";import{t as N}from"./avatar-bundled-components-CAE0CJ9e.js";import{t as P}from"./animated-avatar-Bk5J30oP.js";var F=e(t(),1),I=[`idle`,`thinking`,`error`,`disconnected`,`authFailed`],L=[`connecting`,`listening`,`transcribing`,`thinking`,`speaking`,`ending`],R=[`muteMicrophone`,`unmuteMicrophone`,`muteAssistantAudio`,`unmuteAssistantAudio`,`endSession`,`approveRequest`,`denyRequest`],z=[`activityComplete`,`toolConfirmation`,`voiceResponseComplete`,`notificationIntent`],B={small:44,medium:66,large:88,huge:110}.small/2+24,V=[`meet`,`talk`,`type`,`tray`];x(I),S({category:x(z),title:b(),body:b(),deliveryId:b().optional(),conversationId:b().optional(),toolCallId:b().optional(),deepLinkMetadata:g(b(),_()).optional()}),S({phase:x(L),label:b(),accentHex:b(),muted:y(),outputMuted:y(),detail:b(),approvalRequestId:b()}).extend({assistantName:b(),avatarBase64:b().optional()}),S({action:x(R),requestId:b().optional()});var H=m(S({role:v([h(`user`),h(`assistant`)]),text:b()})).max(40);S({assistantName:b(),turns:H,working:y().default(!1)});var U=b().max(64).regex(/^(#[0-9a-fA-F]{3,8}|(?:rgb|hsl)a?\([^()]*\)|[a-zA-Z]+)$/);S({color:U,symbolColor:U,colorScheme:x([`light`,`dark`])});var W=n(),G=12,K=44,q=244,J={meet:{title:`This is me`,body:`I stay on your desktop, even when Vellum isn’t visible.`},talk:{title:`Talk`,body:`Start a voice conversation.`},type:{title:`Type`,body:`Send a message from here and read the reply here too.`},tray:{title:`Hide me anytime`,body:`Disable “Show Companion” in the menu bar.`}},te=e=>e===`talk`||e===`type`?e:void 0,ne=e=>e===null||e===`meet`?null:`hover`;function re({beat:e,growth:t=`right`,cardGrowth:n=`up`,accentHex:r,cardRef:i,onAdvance:a}){let o=V.indexOf(e),s=o===V.length-1,c=J[e],l=t===`left`?{right:`50%`,marginRight:-(K/2)}:{left:`50%`,marginLeft:-(K/2)},u=n===`up`?{top:`calc(100% - ${B}px)`,transform:`translateY(calc(-100% - ${K/2+G}px))`}:{top:B,transform:`translateY(${K/2+G}px)`};return(0,W.jsxs)(`div`,{ref:i,role:`group`,"aria-label":`Introducing your companion`,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:q,...l,...u},onMouseDown:e=>{e.stopPropagation()},children:[(0,W.jsx)(`p`,{className:`text-[13px] leading-tight font-medium text-white`,children:c.title}),(0,W.jsx)(`p`,{className:`text-[12px] leading-[1.45] text-white/70`,children:c.body}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between pt-0.5`,children:[(0,W.jsx)(`div`,{className:`flex items-center gap-1`,"aria-hidden":!0,children:V.map((e,t)=>(0,W.jsx)(`span`,{className:`size-1.5 rounded-full transition-colors`,style:{backgroundColor:t===o?r??`#5eead4`:`rgba(255,255,255,.2)`}},e))}),(0,W.jsxs)(`div`,{className:`flex items-center gap-1`,children:[!s&&(0,W.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:()=>a?.(`dismiss`),children:`Skip`}),(0,W.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:()=>a?.(`next`),children:s?`Got it`:`Next`})]})]})]})}var Y=`#5eead4`,X=new Set([`transcribing`,`thinking`,`speaking`]),Z=44,ie=28,ae=8,oe={resting:Z,hover:188,call:296,typing:360},se=360,ce=220;function le({phase:e,turns:t=[],assistantName:n=`your assistant`,glow:r=!0,accentHex:i=Y,avatarSrc:a,character:o,hovered:s=!1,onHoverStart:c,onHoverEnd:l,growth:u=`right`,cardGrowth:d=`up`,rootRef:f,onSurfaceMouseDown:p,onSurfaceContextMenu:m,spotlight:h,onTalk:g,onType:_,onSubmit:v,onCancelTyping:y,onAvatarClick:b,working:x=!1,call:S,onControl:C,intro:w}){let T=e!==`resting`,E=e===`typing`,D=x||S!==void 0&&X.has(S.phase),O=(0,F.useRef)(null),[k,ee]=(0,F.useState)(null);(0,F.useLayoutEffect)(()=>{let e=O.current;if(!e)return;let t=()=>{ee(e.scrollWidth)};t();let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[e]);let A=E?se:Z+(T?(k??oe[e]-Z)+ae:0),j=u===`left`?{right:`50%`,marginRight:-(Z/2)}:{left:`50%`,marginLeft:-(Z/2)},M=d===`up`?{top:`calc(100% - ${B}px)`}:{top:B},N={width:A,...j,...M,transform:E?d===`up`?`translateY(calc(-100% + ${Z/2}px))`:`translateY(-${Z/2}px)`:`translateY(-50%)`,transitionTimingFunction:`cubic-bezier(.2,.8,.2,1)`,"--accent":i};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`absolute cursor-grab transition-[width] duration-300 select-none will-change-[width] active:cursor-grabbing ${E?`flex rounded-[22px] ${d===`up`?`flex-col`:`flex-col-reverse`}`:`flex h-11 items-center rounded-full`} ${u===`left`&&!E?`flex-row-reverse`:``}`,style:N,onMouseLeave:l,onMouseDown:p,onContextMenu:m,ref:f,children:[(0,W.jsx)(`span`,{className:`absolute inset-0 border border-white/10 bg-[#17181b]/95 shadow-lg shadow-black/40 transition-opacity duration-200 ${E?`rounded-[22px]`:`rounded-full`}`,style:{opacity:+!!T},"aria-hidden":!0}),D&&(0,W.jsx)(`span`,{className:`companion-working-ring pointer-events-none absolute -inset-0.5 ${E?`rounded-[24px]`:`rounded-full`}`,style:{"--companion-ring-accent":i},"aria-hidden":!0}),E&&t.length>0&&(0,W.jsx)(fe,{turns:t}),(0,W.jsxs)(`div`,{className:`relative flex h-11 shrink-0 items-center ${u===`left`?`flex-row-reverse`:``}`,children:[(0,W.jsx)(me,{glow:r&&!T,accentHex:i,avatarSrc:a,character:o,attentive:s,busy:D,onMouseEnter:c,onClick:b}),E?(0,W.jsx)(pe,{assistantName:n,growth:u,onSubmit:v,onCancel:y}):(0,W.jsx)(`div`,{className:`relative flex min-w-0 items-center gap-1 overflow-hidden transition-opacity duration-200`,ref:O,inert:!T,style:{opacity:+!!T,transitionDelay:T?`120ms`:`0ms`},children:e===`call`?(0,W.jsx)(ge,{call:S,onControl:C}):(0,W.jsx)(he,{spotlight:h,onTalk:g,onType:_})})]})]}),w]})}function ue({href:e,children:t}){return(0,W.jsx)(`a`,{href:e,className:`underline decoration-white/30 underline-offset-2 hover:decoration-white/60`,onClick:t=>{t.preventDefault(),e!==void 0&&k(e)},onMouseDown:e=>{e.stopPropagation()},children:t})}var de=ue;function fe({turns:e}){let t=(0,F.useRef)(null);return(0,F.useEffect)(()=>{let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[e]),(0,W.jsx)(`div`,{ref:t,className:`relative flex flex-col gap-1.5 overflow-y-auto px-3 pt-3 pb-1 select-text`,style:{maxHeight:ce},children:e.map((e,t)=>{let n=e.role===`user`;return(0,W.jsx)(`div`,{className:`flex shrink-0 ${n?`justify-end`:`justify-start`}`,children:n?(0,W.jsx)(`p`,{className:`max-w-[80%] rounded-lg bg-white/[0.08] px-2.5 py-1.5 text-[12px] leading-[1.45] whitespace-pre-wrap text-white/75`,children:e.text}):(0,W.jsx)(`div`,{"data-theme":`dark`,className:`companion-markdown min-w-0 text-[12px] leading-[1.45] text-white/85`,children:(0,W.jsx)(p,{content:e.text,linkComponent:de})})},`${e.role}-${t}`)})})}function pe({assistantName:e,growth:t=`right`,onSubmit:n,onCancel:i}){let[a,o]=(0,F.useState)(``),s=(0,F.useRef)(null),c=a.trim();(0,F.useEffect)(()=>{s.current?.focus()},[]);let l=()=>{c!==``&&(o(``),n?.(c))};return(0,W.jsxs)(`div`,{className:`relative flex min-w-0 flex-1 items-center gap-1 ${t===`left`?`pl-2`:`pr-2`}`,children:[(0,W.jsx)(`input`,{ref:s,type:`text`,value:a,placeholder:`Message ${e}`,onChange:e=>{o(e.target.value)},onKeyDown:e=>{if(e.key===`Enter`){e.preventDefault(),l();return}e.key===`Escape`&&(e.preventDefault(),i?.())},onMouseDown:e=>{e.stopPropagation()},className:`min-w-0 flex-1 bg-transparent text-[12px] text-white/85 select-text placeholder:text-white/40 focus:outline-none`}),(0,W.jsx)(`button`,{type:`button`,"aria-label":c===``?`Go back`:`Send`,title:c===``?`Go back`:`Send`,onClick:c===``?i:l,onMouseDown:e=>{e.stopPropagation()},className:`grid size-7 shrink-0 place-items-center rounded-full bg-white/10 text-white/85 transition-colors hover:bg-white/20`,children:c===``?(0,W.jsx)(f,{className:`size-3.5`,"aria-hidden":!0}):(0,W.jsx)(r,{className:`size-3.5`,"aria-hidden":!0})})]})}function me({glow:e,accentHex:t,avatarSrc:n,character:r,busy:i=!1,attentive:a=!1,onMouseEnter:o,onClick:s}){return(0,W.jsxs)(`div`,{className:`relative grid size-11 shrink-0 place-items-center`,onMouseEnter:o,onClick:s,children:[e&&(0,W.jsx)(`span`,{className:`absolute size-10 animate-pulse rounded-full blur-lg`,style:{background:t,opacity:.4},"aria-hidden":!0}),r===void 0?n===void 0?(0,W.jsx)(`span`,{className:`relative size-7 rounded-full drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,style:{background:t},"aria-hidden":!0}):(0,W.jsx)(`img`,{src:n,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,W.jsx)(`div`,{className:`relative drop-shadow-[0_1px_3px_rgba(0,0,0,0.55)]`,children:(0,W.jsx)(P,{components:N,traits:r,size:ie,isAssistantBusy:i,attentive:a})})]})}function he({spotlight:e,onTalk:t,onType:n}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Q,{icon:(0,W.jsx)(a,{className:`size-4`}),label:`Talk`,showLabel:!0,active:e===`talk`,onClick:t}),(0,W.jsx)(Q,{icon:(0,W.jsx)(i,{className:`size-4`}),label:`Type`,showLabel:!0,active:e===`type`,onClick:n})]})}function ge({call:e,onControl:t}){if(e!==void 0&&e.approvalRequestId!==``)return(0,W.jsx)(_e,{detail:e.detail,requestId:e.approvalRequestId,onControl:t});let n=e===void 0?`Listening`:e.detail||e.label,r=e?.muted??!1,i=e?.outputMuted??!1;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`ml-1 max-w-[120px] shrink-0 truncate text-[12px] text-white/85`,children:n}),(0,W.jsx)(Q,{icon:r?(0,W.jsx)(c,{className:`size-4`}):(0,W.jsx)(u,{className:`size-4`}),label:r?`Unmute microphone`:`Mute microphone`,onClick:()=>{t?.(r?`unmuteMicrophone`:`muteMicrophone`)}}),(0,W.jsx)(Q,{icon:i?(0,W.jsx)(s,{className:`size-4`}):(0,W.jsx)(d,{className:`size-4`}),label:i?`Unmute assistant`:`Mute assistant`,onClick:()=>{t?.(i?`unmuteAssistantAudio`:`muteAssistantAudio`)}}),(0,W.jsx)(Q,{icon:(0,W.jsx)(f,{className:`size-4`,strokeWidth:2.5}),label:`End session`,tone:`negative`,onClick:()=>{t?.(`endSession`)}})]})}function _e({detail:e,requestId:t,onControl:n}){return(0,W.jsxs)(W.Fragment,{children:[e!==``&&(0,W.jsx)(`span`,{className:`ml-1 max-w-[120px] shrink-0 truncate text-[12px] text-white/85`,children:e}),(0,W.jsx)(Q,{icon:(0,W.jsx)(l,{className:`size-4`}),label:`Allow`,showLabel:!0,tone:`positive`,onClick:()=>{n?.(`approveRequest`,t)}}),(0,W.jsx)(Q,{icon:(0,W.jsx)(f,{className:`size-4`}),label:`Deny`,showLabel:!0,tone:`negative`,onClick:()=>{n?.(`denyRequest`,t)}})]})}function Q({icon:e,label:t,tone:n,showLabel:r=!1,active:i=!1,onClick:a}){return(0,W.jsxs)(`button`,{type:`button`,"aria-label":t,title:t,onClick:a,onMouseDown:e=>{e.stopPropagation()},className:`flex h-7 shrink-0 items-center gap-1.5 rounded-full px-2 text-[12px] transition-colors hover:bg-white/15 ${i?`bg-white/15`:``} ${n===`negative`?`text-[#ff6b6b]`:n===`positive`?`text-[#5ee08a]`:`text-white/85`}`,children:[e,r&&(0,W.jsx)(`span`,{children:t})]})}var ve=3,$=44;function ye(){let[e,t]=(0,F.useState)(`right`),[n,r]=(0,F.useState)(`up`),[i,a]=(0,F.useState)($),[s,c]=(0,F.useState)(),[l,u]=(0,F.useState)(),[d,f]=(0,F.useState)(null),[p,m]=(0,F.useState)([]),[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(!1),[y,b]=(0,F.useState)(!1),[x,S]=(0,F.useState)(null),[k,N]=(0,F.useState)(!1),[P,I]=(0,F.useState)(!1),L=(0,F.useRef)(!1),R=(0,F.useRef)(null),z=(0,F.useRef)(null),B=(0,F.useRef)(null),V=(0,F.useRef)(null),H=(0,F.useRef)(!1);(0,F.useEffect)(()=>{let e=e=>{t(e.growth),r(e.cardGrowth),a(e.avatarBox),c(e.avatarBase64===void 0?void 0:`data:image/png;base64,${e.avatarBase64}`),u(e.character),f(e.call),m(e.turns),g(e.assistantName),v(e.working),S(e.intro)},n=ee(e);return E().then(t=>{t&&e(t)}),n},[]),(0,F.useEffect)(()=>()=>{D(!1),A(!1)},[]),(0,F.useEffect)(()=>{A(k)},[k]);let U=e=>{L.current!==e&&(L.current=e,D(e))},G=x!==null&&!k&&d===null,K=(0,F.useRef)(G);(0,F.useEffect)(()=>{K.current&&!G&&(b(!1),U(!1)),K.current=G},[G]);let q=()=>{N(!1),b(!1),U(!1),I(!1)},J=e=>{if(B.current!==null&&e.buttons===0&&(B.current=null),B.current!==null){let{x:t,y:n}=B.current;C(e.screenX-t,e.screenY-n),B.current={x:e.screenX,y:e.screenY};let r=V.current;r!==null&&Math.abs(e.screenX-r.x)+Math.abs(e.screenY-r.y)>ve&&(H.current=!0);return}let t=R.current;if(!t)return;let n=t=>{if(!t)return!1;let n=t.getBoundingClientRect();return e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom},r=n(t),i=n(z.current);b(r),U(r||i)},Y=ne(x),X=k?`typing`:d===null?Y??(y?`hover`:`resting`):`call`,Z=d!==null&&/^#[0-9a-f]{6}$/i.test(d.accentHex)?d.accentHex:void 0;return(0,W.jsx)(`div`,{className:`relative h-screen w-screen bg-transparent`,onMouseMove:J,onMouseUp:()=>{B.current=null},onMouseLeave:()=>{B.current=null,b(!1),U(!1)},children:(0,W.jsx)(`div`,{className:`absolute top-0 left-0 origin-top-left`,style:{width:`${100*$/i}%`,height:`${100*$/i}%`,transform:`scale(${i/$})`},children:(0,W.jsx)(le,{phase:X,growth:e,cardGrowth:n,avatarSrc:s,character:l,hovered:y,accentHex:Z,turns:P?p:[],assistantName:h===``?void 0:h,call:d??void 0,working:_,spotlight:te(x),intro:!G||x===null?null:(0,W.jsx)(re,{beat:x,growth:e,cardGrowth:n,accentHex:Z,cardRef:z,onAdvance:O}),rootRef:R,onSurfaceMouseDown:e=>{e.button===0&&(B.current={x:e.screenX,y:e.screenY},V.current={x:e.screenX,y:e.screenY},H.current=!1)},onSurfaceContextMenu:e=>{let t=e.target?.closest(`input, textarea, [contenteditable='true']`)!==null,n=(window.getSelection()?.toString().trim().length??0)>0;t||n||(e.preventDefault(),M())},onAvatarClick:()=>{H.current||j()},onTalk:w,onType:()=>{N(!0)},onSubmit:e=>{P||(m([]),I(!0)),T(e,!P)},onCancelTyping:q,onControl:(e,t)=>{o(t===void 0?{action:e}:{action:e,requestId:t})}})})})}export{ye as CompanionSurfacePage};
@@ -1 +0,0 @@
1
- import{t as e}from"./onboarding-store-CXXioE_U.js";function t(){let{shareAnalytics:t,serverAnalyticsEffective:n,pendingAnalyticsOptIn:r}=e.getState();return t===!1?!1:r?!0:n??!0}export{t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,m as n,o as r,t as i}from"./capture-error-VBsIaC5d.js";import{t as a}from"./react-BFJW0bSv.js";import{t as o}from"./button-VkxVX0DM.js";import{h as s,n as c}from"./chunk-5KNZJZUH-BUqIilZr.js";import{n as l}from"./QueryClientProvider-EuRl-wrW.js";import{t as u}from"./useQuery-CTSuec5b.js";import{t as d}from"./jsx-runtime-BJ8jcmzB.js";import{t as f}from"./cn-Cf8SmgbR.js";import{s as p}from"./list-row-D1odQOMJ.js";import{t as m}from"./createLucideIcon-B-ZPaMbU.js";import{t as h}from"./bug-DSXaice2.js";import{t as ee}from"./circle-x-qsWcnNwx.js";import{t as g}from"./info-D0qquAkS.js";import{t as _}from"./loader-circle-C9QjVTuc.js";import{t as v}from"./search-FGnzWjRX.js";import{t as y}from"./triangle-alert-B-18Pims.js";import"./src-Ch3HTlFm.js";import{t as b}from"./tag-Ddzwz3ij.js";import{t as x}from"./toggle-0qt1e_3r.js";import{n as S}from"./toast-ZCXyBjoj.js";import{t as te}from"./confirm-dialog--7V28331.js";import{t as ne}from"./select-D133FK9g.js";import{F as re,v as ie}from"./local-mode-DzIUFjhf.js";import"./i18n-7Z5ghN39.js";import{t as C}from"./useTranslation-CJMg4EBF.js";import{tt as ae}from"./auth-store-DHZaL7sV.js";import{t as w}from"./client.gen-C1nf2AIs.js";import{l as oe,s as se}from"./api-ByKY0Cbt.js";import{a as T,l as E,o as D}from"./feature-flag-catalog-BE_ZpOEG.js";import{t as O}from"./client-feature-flag-store-o8FXKc-R.js";import{d as ce}from"./routes-Bj1LYNBZ.js";import{r as k}from"./use-is-org-ready-CXChKRKk.js";import{Qt as A,at as le,dn as j,f as M,it as N,u as P,un as F}from"./react-query.gen-OpeDEMIm.js";import{O as I,v as L}from"./react-query.gen-D3r2fwXH.js";import{t as R}from"./assistant-feature-flag-store-DPde0AIx.js";import{t as z}from"./use-active-assistant-id-BFE4r9Rp.js";import{t as B}from"./detail-card-DBxsIpmu.js";import{t as V}from"./environment-store-rZ0hkMHt.js";import{n as H}from"./assistant-status-panel-uGuW1yZK.js";var U=m(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),W=m(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),G=e(a(),1),K=d();function ue({memoryEnabled:e,retrospectiveEnabled:t}){let n=z(),r=l(),a=A({onSuccess:e=>{M(r,{path:{assistant_id:n}},e)}}),o=async e=>{try{await a.mutateAsync({path:{assistant_id:n},body:{memory:{retrospective:{enabled:e}}}}),S.success(e?`Memory retrospectives enabled.`:`Memory retrospectives paused.`)}catch(e){i(e,{context:`settings-memory-retrospective-toggle`}),S.error(`Failed to update memory retrospectives.`)}};return(0,K.jsxs)(`div`,{className:`flex flex-row items-start justify-between gap-4 border-t border-[var(--border-subtle)] pt-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,K.jsx)(`h3`,{className:`text-body-medium-default text-[var(--content-emphasised)]`,children:`Retrospectives`}),(0,K.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Let your assistant re-read recent conversations in the background and save what it missed in the moment. Pausing this keeps the rest of memory working.`})]}),(0,K.jsx)(x,{checked:t,onChange:e=>void o(e),"aria-label":`Enable memory retrospectives`,disabled:!e||a.isPending})]})}function de({memoryEnabled:e}){let t=z(),n=l(),{data:r}=u({...N({path:{assistant_id:t}}),staleTime:3e4}),a=e=>{le(n,{path:{assistant_id:t}},t=>t&&{...t,status:e?`running`:`not_running`})},o=F({onSuccess:()=>a(!0)}),s=j({onSuccess:()=>a(!1)}),c=async e=>{try{e?(await o.mutateAsync({path:{assistant_id:t}}),S.success(`Background worker started.`)):(await s.mutateAsync({path:{assistant_id:t}}),S.success(`Background worker stopped.`))}catch(e){i(e,{context:`settings-memory-worker-toggle`}),S.error(`Failed to update background worker.`)}};if(!r)return null;let d=o.isPending||s.isPending;return(0,K.jsxs)(`div`,{className:`flex flex-row items-start justify-between gap-4 border-t border-[var(--border-subtle)] pt-4`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,K.jsx)(`h3`,{className:`text-body-medium-default text-[var(--content-emphasised)]`,children:`Background worker`}),(0,K.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Run memory consolidation in a dedicated background process. It starts automatically; stop it to pause background memory processing until the next restart.`})]}),(0,K.jsx)(x,{checked:r.status===`running`,onChange:e=>void c(e),"aria-label":`Enable background memory worker`,disabled:!e||d})]})}function fe(){let{healthz:e}=H(),t=z(),n=l(),r=e?.capabilities?.memoryOptOut===!0,{data:a}=u({...P({path:{assistant_id:t}}),staleTime:3e4,enabled:r}),o=A({onSuccess:e=>{M(n,{path:{assistant_id:t}},e)}}),s=a?.memory?.enabled!==!1,c=a?.memory?.retrospective?.enabled!==!1,d=async e=>{try{await o.mutateAsync({path:{assistant_id:t},body:{memory:{enabled:e}}}),S.success(e?`Memory enabled.`:`Memory disabled.`)}catch(e){i(e,{context:`settings-memory-toggle`}),S.error(`Failed to update memory setting.`)}};return r?(0,K.jsxs)(B,{title:`Memory`,subtitle:`Let your assistant remember information from past conversations. Turning this off also pauses memory consolidation.`,accessory:(0,K.jsx)(x,{checked:s,onChange:e=>void d(e),"aria-label":`Enable memory`,disabled:o.isPending}),compactAccessory:!0,children:[(0,K.jsx)(ue,{memoryEnabled:s,retrospectiveEnabled:c}),(0,K.jsx)(de,{memoryEnabled:s})]}):null}function pe(){let e=l(),[t,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)(!1),a=k(),s=z(),{data:c,isLoading:d}=u({...I({path:{id:s}}),enabled:a}),{data:f,isLoading:p}=u({...L({query:{hosting:`all`}}),enabled:a}),m=d||p,h=f?.results??[];return(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsx)(me,{assistant:c??null,loading:m}),(0,K.jsx)(he,{assistants:h,activeAssistantId:s,loading:m}),(0,K.jsxs)(B,{title:`Hatch New Assistant`,subtitle:`Create a new assistant instance.`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,K.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Provision a new assistant. This may take a moment.`}),(0,K.jsx)(o,{variant:`outlined`,leftIcon:t?(0,K.jsx)(_,{className:`animate-spin`}):void 0,onClick:()=>i(!0),disabled:t,className:`shrink-0`,children:`Hatch`})]}),(0,K.jsx)(te,{open:r,title:`Hatch New Assistant`,message:`Are you sure you want to create a new assistant? This will provision new infrastructure.`,confirmLabel:`Hatch`,onConfirm:async()=>{i(!1),n(!0);try{let t=await se(void 0,`create`);if(t.ok){if(ie())try{let e=await oe();e.ok&&await re(e.data,ae.getState().currentOrganizationId??void 0)}catch{}S.success(t.status===201?`New assistant hatched successfully.`:`You already have an assistant. Nothing new was created.`),e.invalidateQueries({queryKey:[{_id:`assistantsRetrieve`}]}),e.invalidateQueries({queryKey:L({query:{hosting:`all`}}).queryKey})}else{let e=typeof t.error?.detail==`string`?t.error.detail:`Failed to hatch assistant.`;S.error(e)}}catch{S.error(`Failed to hatch assistant.`)}finally{n(!1)}},onCancel:()=>i(!1)})]})]})}function me({assistant:e,loading:t}){return t?(0,K.jsx)(B,{title:`Assistant Info`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,K.jsx)(_,{className:`h-4 w-4 animate-spin`}),`Loading assistant info...`]})}):e?(0,K.jsx)(B,{title:`Assistant Info`,subtitle:`Current assistant details.`,children:(0,K.jsxs)(`div`,{className:`grid grid-cols-[140px_minmax(0,1fr)] gap-y-3`,children:[(0,K.jsx)(q,{children:`Name`}),(0,K.jsx)(J,{children:e.name??`Unnamed`}),(0,K.jsx)(q,{children:`Status`}),(0,K.jsx)(`div`,{children:(0,K.jsx)(b,{tone:e.status===`active`?`positive`:`neutral`,children:e.status})}),(0,K.jsx)(q,{children:`Assistant ID`}),(0,K.jsx)(`span`,{className:`break-all font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.id}),e.machine_id&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(q,{children:`Machine ID`}),(0,K.jsx)(`span`,{className:`break-all font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.machine_id})]}),(0,K.jsx)(q,{children:`Created`}),(0,K.jsx)(J,{children:new Date(e.created).toLocaleDateString()}),(0,K.jsx)(q,{children:`Last Modified`}),(0,K.jsx)(J,{children:new Date(e.modified).toLocaleDateString()}),e.current_release_version&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(q,{children:`Version`}),(0,K.jsx)(J,{children:e.current_release_version})]})]})}):(0,K.jsx)(B,{title:`Assistant Info`,children:(0,K.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No assistant found. Hatch an assistant to get started.`})})}function he({assistants:e,activeAssistantId:t,loading:n}){return n||e.length===0?null:(0,K.jsx)(B,{title:`All Assistants`,subtitle:`${e.length} assistant${e.length===1?``:`s`} found.`,children:(0,K.jsx)(`div`,{className:`max-h-[300px] space-y-2 overflow-y-auto`,children:e.map(e=>{let n=e.id===t;return(0,K.jsx)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${n?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e.name||`Unnamed`}),(0,K.jsx)(b,{tone:e.status===`active`?`positive`:`neutral`,children:e.status}),n&&(0,K.jsx)(b,{tone:`warning`,children:`Current`})]}),(0,K.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.id})]})},e.id)})})})}function q({children:e}){return(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e})}function J({children:e}){return(0,K.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e})}function ge(){let e=V.use.emailRootDomain(),t=V.use.isNonProduction(),n=V.use.setEnvironment();return(0,K.jsx)(B,{title:`Environment`,subtitle:`Environment configuration overrides for this session.`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,K.jsx)(x,{checked:t,onChange:e=>n({isNonProduction:e}),"aria-label":`Non-Production is ${t?`on`:`off`}`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Non-Production`}),(0,K.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Indicates a non-production environment. Enables dev-only UI surfaces and diagnostics.`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,K.jsx)(b,{tone:`neutral`,children:e})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Email Root Domain`}),(0,K.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Root domain used for assistant email addresses (e.g. vellum.me).`})]})]})]})})}async function _e(){let{data:e,response:t}=await w.get({url:`/v1/feature-flags/`,throwOnError:!1});return t?.ok?e?.flags??[]:[]}var Y={client:`warning`,assistant:`positive`};function ve(){let e=z(),{data:t}=u({queryKey:[`feature-flag-definitions`],queryFn:_e,enabled:k(),staleTime:300*1e3}),n=(0,G.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of t)n.type===`string`&&n.values?.length&&e.set(n.key,n.values);return e},[t]),[r,i]=(0,G.useState)(``),a=O(),o=R(),s=(0,G.useMemo)(()=>{let e=[];for(let t of D){let r=T(t.key);if(typeof t.defaultEnabled==`boolean`){let n=a[r],i=o[r],s=t.scope===`both`?n===!0||i===!0:t.scope===`assistant`?i:n;if(typeof s!=`boolean`)continue;e.push({kind:`boolean`,storeKey:r,scope:t.scope,label:t.label,description:t.description,value:s,defaultValue:t.defaultEnabled})}else if(typeof t.defaultEnabled==`string`){let i=a.stringFlags?.[r],s=o.stringFlags?.[r],c=t.scope===`assistant`?s??t.defaultEnabled:i??t.defaultEnabled;e.push({kind:`string`,storeKey:r,scope:t.scope,label:t.label,description:t.description,value:c,defaultValue:t.defaultEnabled,values:n.get(t.key)??t.values})}}return e.sort((e,t)=>e.label.localeCompare(t.label,void 0,{sensitivity:`base`}))},[a,o,n]),c=(0,G.useMemo)(()=>{if(!r.trim())return s;let e=r.trim().toLowerCase();return s.filter(t=>t.label.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)||t.storeKey.toLowerCase().includes(e)||t.scope.includes(e)||t.scope===`both`&&(`client`.includes(e)||`assistant`.includes(e)))},[s,r]);return(0,K.jsx)(B,{title:`Feature Flags`,subtitle:`Active feature flags evaluated for the current session.`,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(v,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--content-tertiary)]`}),(0,K.jsx)(`input`,{type:`text`,placeholder:`Search flags...`,value:r,onChange:e=>i(e.target.value),className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-default)] py-2 pl-9 pr-3 text-body-medium-default text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] focus:border-[var(--border-focus)] focus:outline-none`})]}),c.length===0&&(0,K.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No matching flags.`}),c.length>0&&(0,K.jsx)(`div`,{className:`max-h-[500px] space-y-2 overflow-y-auto`,children:c.map(t=>(0,K.jsx)(xe,{flag:t,assistantId:e},t.storeKey))})]})})}function X({scope:e}){return e===`both`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(b,{tone:Y.client,children:`client`}),(0,K.jsx)(b,{tone:Y.assistant,children:`assistant`})]}):(0,K.jsx)(b,{tone:Y[e],children:e})}function ye({flag:e,assistantId:t}){let n=O.use.setFlag(),r=R.use.setFlag();return(0,K.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,K.jsx)(x,{checked:e.value,onChange:i=>{E(e.scope,`client`)&&n(e.storeKey,i),E(e.scope,`assistant`)&&r(e.storeKey,i,t)},"aria-label":`${e.label} is ${e.value?`on`:`off`}`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),(0,K.jsx)(X,{scope:e.scope})]}),(0,K.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e.description}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default:`}),(0,K.jsx)(b,{tone:`neutral`,children:e.defaultValue?`On`:`Off`})]})]})]})}function be({flag:e,assistantId:t}){let n=O.use.setStringFlag(),r=R.use.setStringFlag(),[i,a]=(0,G.useState)(e.value);(0,G.useEffect)(()=>{a(e.value)},[e.value]);let o=i=>{i!==e.value&&(E(e.scope,`client`)&&n(e.storeKey,i),E(e.scope,`assistant`)&&r(e.storeKey,i,t))},s=i!==e.value,c=e.values&&e.values.length>0?e.values:null,l=s&&c!=null&&!c.includes(i),u=()=>{l||o(i)},d=e=>{e.key===`Enter`&&e.currentTarget.blur()},p=c!=null&&c.includes(e.value);return(0,K.jsx)(`div`,{className:`flex items-start gap-3 py-3`,children:(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),(0,K.jsx)(X,{scope:e.scope})]}),(0,K.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e.description}),p?(0,K.jsx)(ne,{value:e.value,onChange:e=>{a(e),o(e)},options:c.map(e=>({value:e,label:e})),className:`w-48`,"aria-label":`${e.label} value`}):(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),onBlur:u,onKeyDown:d,className:f(`w-full rounded-lg border bg-[var(--surface-default)] px-3 py-1.5 text-body-small-default text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] focus:outline-none`,l?`border-[var(--system-negative-strong)]`:`border-[var(--border-base)] focus:border-[var(--border-focus)]`),placeholder:e.defaultValue||`Enter value...`}),l&&(0,K.jsxs)(`span`,{className:`block text-body-small-default text-[var(--system-negative-strong)]`,children:[`Expected one of: `,c.join(`, `)]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default:`}),(0,K.jsx)(b,{tone:`neutral`,children:e.defaultValue||`(empty)`})]})]})})}function xe({flag:e,assistantId:t}){return e.kind===`string`?(0,K.jsx)(be,{flag:e,assistantId:t}):(0,K.jsx)(ye,{flag:e,assistantId:t})}function Se(){let e=(0,G.useCallback)(()=>{t(Error(`[Dev Settings] Test error event`)),S.success(`Sentry error event sent.`)},[]),i=(0,G.useCallback)(()=>{r(`[Dev Settings] Test warning event`,`warning`),S.success(`Sentry warning event sent.`)},[]),a=(0,G.useCallback)(()=>{r(`[Dev Settings] Test info event`,`info`),S.success(`Sentry info event sent.`)},[]),o=(0,G.useCallback)(()=>{r(`[Dev Settings] Test fatal event`,`fatal`),S.success(`Sentry fatal event sent.`)},[]),s=(0,G.useCallback)(()=>{n({name:`[Dev Settings] Test transaction`,op:`test.transaction`,forceTransaction:!0}).end(),S.success(`Sentry performance transaction sent.`)},[]);return(0,K.jsx)(B,{title:`Sentry Testing`,subtitle:`Fire test events to verify Sentry integration is working.`,children:(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsx)(Z,{icon:(0,K.jsx)(U,{className:`h-4 w-4 text-[var(--system-negative-strong)]`}),label:`Fatal Event`,description:`Send a fatal-level event to Sentry.`,onClick:o}),(0,K.jsx)(Z,{icon:(0,K.jsx)(ee,{className:`h-4 w-4 text-[var(--system-negative-default)]`}),label:`Error Event`,description:`Capture a test Error exception.`,onClick:e}),(0,K.jsx)(Z,{icon:(0,K.jsx)(y,{className:`h-4 w-4 text-[var(--system-warning-default)]`}),label:`Warning Event`,description:`Send a warning-level message.`,onClick:i}),(0,K.jsx)(Z,{icon:(0,K.jsx)(g,{className:`h-4 w-4 text-[var(--content-tertiary)]`}),label:`Info Event`,description:`Send an info-level message.`,onClick:a}),(0,K.jsx)(Z,{icon:(0,K.jsx)(W,{className:`h-4 w-4 text-[var(--system-positive-default)]`}),label:`Performance Transaction`,description:`Start and end a test transaction span.`,onClick:s})]})})}function Z({icon:e,label:t,description:n,onClick:r}){return(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border border-[var(--border-base)] px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`shrink-0`,children:e}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:t}),(0,K.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n})]})]}),(0,K.jsxs)(o,{variant:`outlined`,size:`compact`,onClick:r,children:[(0,K.jsx)(h,{className:`h-4 w-4`}),`Send`]})]})}var Q=[{id:`feature-flags`,labelKey:`developerPage.tabFeatureFlags`},{id:`lifecycle`,labelKey:`developerPage.tabLifecycle`},{id:`sentry`,labelKey:`developerPage.tabSentry`},{id:`memory`,labelKey:`developerPage.tabMemory`}],$=`flex min-h-0 flex-1 flex-col pt-6`;function Ce(){let{t:e}=C(`settings`),[t,n]=s(),r=R.use.settingsDeveloperNav(),i=R.use.hasHydrated(),a=(0,G.useMemo)(()=>{let e=t.get(`tab`);return Q.find(t=>t.id===e)?.id??`feature-flags`},[t]);return i&&!r?(0,K.jsx)(c,{replace:!0,to:ce.settings.general}):(0,K.jsx)(`div`,{"data-slot":`developer-page`,className:`flex min-h-0 flex-1 flex-col`,children:(0,K.jsxs)(p.Root,{value:a,onValueChange:e=>{let r=new URLSearchParams(t.toString());e===`feature-flags`?r.delete(`tab`):r.set(`tab`,e),n(r,{replace:!0})},className:`flex min-h-0 flex-1 flex-col`,children:[(0,K.jsx)(p.List,{className:`shrink-0`,"aria-label":e(`developerPage.sectionsAriaLabel`),children:Q.map(t=>(0,K.jsx)(p.Trigger,{value:t.id,children:e(t.labelKey)},t.id))}),(0,K.jsx)(p.Panel,{value:`feature-flags`,className:$,children:(0,K.jsxs)(`div`,{className:`space-y-6`,children:[(0,K.jsx)(ve,{}),(0,K.jsx)(ge,{})]})}),(0,K.jsx)(p.Panel,{value:`lifecycle`,className:$,children:(0,K.jsx)(pe,{})}),(0,K.jsx)(p.Panel,{value:`sentry`,className:$,children:(0,K.jsx)(Se,{})}),(0,K.jsx)(p.Panel,{value:`memory`,className:$,children:(0,K.jsx)(`div`,{className:`space-y-4`,children:(0,K.jsx)(fe,{})})})]})})}export{Ce as DeveloperPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{B as n,H as r,L as i,V as a,m as o,o as s}from"./button-VkxVX0DM.js";import{t as c}from"./jsx-runtime-BJ8jcmzB.js";import{n as l,t as u}from"./dist-D94ZMew1.js";var d=e(t(),1);function f(e){let t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function p(e,[t,n]){return Math.min(n,Math.max(t,e))}var m=c(),h=[`PageUp`,`PageDown`],g=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],_={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},v=`Slider`,[y,b,x]=l(v),[S,C]=n(v,[x]),[w,T]=S(v),E=d.forwardRef((e,t)=>{let{name:n,min:i=0,max:a=100,step:o=1,orientation:c=`horizontal`,disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:f=[i],value:_,onValueChange:v=()=>{},onValueCommit:b=()=>{},inverted:x=!1,form:S,...C}=e,T=d.useRef(new Set),E=d.useRef(0),D=d.useRef(!1),O=c===`horizontal`?k:A,[j=[],M]=s({prop:_,defaultProp:f,onChange:e=>{[...T.current][E.current]?.focus({preventScroll:!0,focusVisible:D.current}),D.current=!1,v(e)}}),N=d.useRef(j);function P(e){L(e,Y(j,e))}function F(e){L(e,E.current)}function I(){let e=N.current[E.current];j[E.current]!==e&&b(j)}function L(e,t,{commit:n}={commit:!1}){let r=ee(o),s=p(te(Math.round((e-i)/o)*o+i,r),[i,a]);M((e=[])=>{let r=K(e,s,t);if(Q(r,u*o)){E.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&b(r),t?r:e}else return e})}return(0,m.jsx)(w,{scope:e.__scopeSlider,name:n,disabled:l,min:i,max:a,valueIndexToChangeRef:E,thumbs:T.current,values:j,orientation:c,form:S,children:(0,m.jsx)(y.Provider,{scope:e.__scopeSlider,children:(0,m.jsx)(y.Slot,{scope:e.__scopeSlider,children:(0,m.jsx)(O,{"aria-disabled":l,"data-disabled":l?``:void 0,...C,ref:t,onPointerDown:r(C.onPointerDown,()=>{l||(N.current=j,D.current=!1)}),min:i,max:a,inverted:x,onSlideStart:l?void 0:P,onSlideMove:l?void 0:F,onSlideEnd:l?void 0:I,onHomeKeyDown:()=>{l||(D.current=!0,L(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(D.current=!0,L(a,j.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){D.current=!0;let n=h.includes(e.key)||e.shiftKey&&g.includes(e.key)?10:1,r=E.current,i=j[r];L(i+o*n*t,r,{commit:!0})}}})})})})});E.displayName=v;var[D,O]=S(v,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),k=d.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:f,...p}=e,[h,g]=d.useState(null),v=a(t,g),y=d.useRef(void 0),b=u(i),x=b===`ltr`,S=x&&!o||!x&&o;function C(e){let t=y.current||h.getBoundingClientRect(),i=$([0,t.width],S?[n,r]:[r,n]);return y.current=t,i(e-t.left)}return(0,m.jsx)(D,{scope:e.__scopeSlider,startEdge:S?`left`:`right`,endEdge:S?`right`:`left`,direction:S?1:-1,size:`width`,children:(0,m.jsx)(j,{dir:b,"data-orientation":`horizontal`,...p,ref:v,style:{...p.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=C(e.clientX);s?.(t)},onSlideMove:e=>{let t=C(e.clientX);c?.(t)},onSlideEnd:()=>{y.current=void 0,l?.()},onStepKeyDown:e=>{let t=_[S?`from-left`:`from-right`].includes(e.key);f?.({event:e,direction:t?-1:1})}})})}),A=d.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,f=d.useRef(null),p=a(t,f),h=d.useRef(void 0),g=!i;function v(e){let t=h.current||f.current.getBoundingClientRect(),i=$([0,t.height],g?[r,n]:[n,r]);return h.current=t,i(e-t.top)}return(0,m.jsx)(D,{scope:e.__scopeSlider,startEdge:g?`bottom`:`top`,endEdge:g?`top`:`bottom`,size:`height`,direction:g?1:-1,children:(0,m.jsx)(j,{"data-orientation":`vertical`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=v(e.clientY);o?.(t)},onSlideMove:e=>{let t=v(e.clientY);s?.(t)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:e=>{let t=_[g?`from-bottom`:`from-top`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),j=d.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onHomeKeyDown:c,onEndKeyDown:l,onStepKeyDown:u,...d}=e,f=T(v,n);return(0,m.jsx)(i.span,{...d,ref:t,onKeyDown:r(e.onKeyDown,e=>{e.key===`Home`?(c(e),e.preventDefault()):e.key===`End`?(l(e),e.preventDefault()):h.concat(g).includes(e.key)&&(u(e),e.preventDefault())}),onPointerDown:r(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),f.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):a(e)}),onPointerMove:r(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&o(e)}),onPointerUp:r(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),s(e))})})}),M=`SliderTrack`,N=d.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,a=T(M,n);return(0,m.jsx)(i.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...r,ref:t})});N.displayName=M;var P=`SliderRange`,F=d.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,o=T(P,n),s=O(P,n),c=a(t,d.useRef(null)),l=o.values.length,u=o.values.map(e=>q(e,o.min,o.max)),f=l>1?Math.min(...u):0,p=100-Math.max(...u);return(0,m.jsx)(i.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...r,ref:c,style:{...e.style,[s.startEdge]:f+`%`,[s.endEdge]:p+`%`}})});F.displayName=P;var I=`SliderThumb`,[L,R]=S(I),z=`SliderThumbProvider`;function B(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=T(z,t),s=b(t),[c,l]=d.useState(null),u=d.useMemo(()=>c?s().findIndex(e=>e.ref.current===c):-1,[s,c]),f=o(c),p=c?!!a.form||!!c.closest(`form`):!0,h=a.values[u],g=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),_=h===void 0?0:q(h,a.min,a.max);d.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]);let v={value:h,name:g,form:a.form,isFormControl:p,index:u,thumb:c,onThumbChange:l,percent:_,size:f};return(0,m.jsx)(L,{scope:t,...v,children:ne(i)?i(v):r})}B.displayName=z;var V=`SliderThumbTrigger`,H=d.forwardRef((e,t)=>{let{__scopeSlider:n,...o}=e,s=T(V,n),c=O(V,n),{index:l,value:u,percent:d,size:f,onThumbChange:p}=R(V,n),h=a(t,p),g=J(l,s.values.length),_=f?.[c.size],v=_?X(_,d,c.direction):0;return(0,m.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[c.startEdge]:`calc(${d}% + ${v}px)`},children:(0,m.jsx)(y.ItemSlot,{scope:n,children:(0,m.jsx)(i.span,{role:`slider`,"aria-label":e[`aria-label`]||g,"aria-valuemin":s.min,"aria-valuenow":u,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?``:void 0,tabIndex:s.disabled?void 0:0,...o,ref:h,style:u===void 0?{display:`none`}:e.style,onFocus:r(e.onFocus,()=>{s.valueIndexToChangeRef.current=l})})})})});H.displayName=V;var U=d.forwardRef((e,t)=>{let{__scopeSlider:n,name:r,...i}=e;return(0,m.jsx)(B,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(H,{...i,ref:t,__scopeSlider:n}),r?(0,m.jsx)(G,{__scopeSlider:n},e):null]})})});U.displayName=I;var W=`SliderBubbleInput`,G=d.forwardRef(({__scopeSlider:e,...t},n)=>{let{value:r,name:o,form:s}=R(W,e),c=d.useRef(null),l=a(c,n),u=f(r);return d.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==r&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[u,r]),(0,m.jsx)(i.input,{style:{display:`none`},name:o,form:s,...t,ref:l,defaultValue:r})});G.displayName=W;function K(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function q(e,t,n){return p(100/(n-t)*(e-t),[0,100])}function J(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function Y(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function X(e,t,n){let r=e/2;return(r-$([0,50],[0,r])(t)*n)*n}function Z(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Q(e,t){if(t>0){let n=Z(e);return Math.min(...n)>=t}return!0}function $(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function ee(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}function te(e,t){let n=10**t;return Math.round(e*n)/n}function ne(e){return typeof e==`function`}export{f as a,N as i,F as n,U as r,E as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-BLn6q1jU.js","assets/dist-RzxQVwj7.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-Cv2QeVDK.js";import{i as t}from"./dist-RzxQVwj7.js";var n;(function(e){e.Light=`light`,e.Dark=`dark`})(n||={});var r=t(`SafeArea`,{web:()=>e(()=>import(`./web-BLn6q1jU.js`).then(e=>new e.SafeAreaWeb),__vite__mapDeps([0,1]))});export{r as SafeArea};
@@ -1 +0,0 @@
1
- import{i as e}from"./dist-RzxQVwj7.js";var t=e(`PushNotifications`,{});export{t as PushNotifications};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-B3W2e_Vh.js","assets/dist-RzxQVwj7.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-Cv2QeVDK.js";import{i as t}from"./dist-RzxQVwj7.js";var n=t(`Share`,{web:()=>e(()=>import(`./web-B3W2e_Vh.js`).then(e=>new e.ShareWeb),__vite__mapDeps([0,1]))});export{n as Share};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-67Khnm-P.js","assets/dist-RzxQVwj7.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-Cv2QeVDK.js";import{i as t}from"./dist-RzxQVwj7.js";var n=t(`App`,{web:()=>e(()=>import(`./web-67Khnm-P.js`).then(e=>new e.AppWeb),__vite__mapDeps([0,1]))});export{n as App};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-Dc65176I.js","assets/dist-RzxQVwj7.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-Cv2QeVDK.js";import{i as t}from"./dist-RzxQVwj7.js";var n=t(`Browser`,{web:()=>e(()=>import(`./web-Dc65176I.js`).then(e=>new e.BrowserWeb),__vite__mapDeps([0,1]))});export{n as Browser};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-B1q1ICxT.js","assets/dist-RzxQVwj7.js","assets/definitions-BRiVhEtI.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-Cv2QeVDK.js";import{i as t}from"./dist-RzxQVwj7.js";import{n,t as r}from"./definitions-BRiVhEtI.js";var i=t(`Haptics`,{web:()=>e(()=>import(`./web-B1q1ICxT.js`).then(e=>new e.HapticsWeb),__vite__mapDeps([0,1,2]))});export{i as Haptics,r as ImpactStyle,n as NotificationType};
@@ -1 +0,0 @@
1
- var e={version:1,flags:[{id:`in-chat-onboarding-tour`,scope:`client`,key:`in-chat-onboarding-tour`,label:`In-Chat Onboarding Tour`,description:`Multivariate experiment for the eyes-led in-chat onboarding tour. control = straight to chat after research onboarding (current behavior); tour = the extended tour auto-plays on first workspace entry. Desktop-only: phone-width viewports and the native shell get neither the tour nor its telemetry (not even the exposure event), so the funnel measures desktop sessions exclusively. Targeted via LaunchDarkly (70% tour / 30% control).`,defaultEnabled:`control`,values:[`control`,`tour`]},{id:`user-hosted-enabled`,scope:`client`,key:`user-hosted-enabled`,label:`User Hosted Enabled`,description:`Enable user-hosted onboarding flow`,defaultEnabled:!1},{id:`proactive-tips`,scope:`client`,key:`proactive-tips`,label:`Proactive Tips`,description:`Gates the dismissible proactive tip card in the web sidebar. String-valued so future A/B arms can be added as new values.`,defaultEnabled:`off`,values:[`off`,`on`]},{id:`experiment-activation-flow-2026-06-03`,scope:`both`,key:`experiment-activation-flow-2026-06-03`,label:`Activation Flow Experiment 2026-06-03`,description:`Multivariate activation-flow experiment. control = standard flow; variant-a = activation rail; personal-page = new sign-up-page variant (front-end only). Targeted via LaunchDarkly.`,defaultEnabled:`control`,values:[`control`,`variant-a`,`personal-page`]},{id:`local-docker-enabled`,scope:`client`,key:`local-docker-enabled`,label:`Local Docker Mode`,description:`When enabled, the Local hosting option uses Docker under the hood for sandboxed execution, hiding the separate Docker card`,defaultEnabled:!1},{id:`a2a-channel`,scope:`assistant`,key:`a2a-channel`,label:`A2A Channel`,description:`Enable the A2A (Agent-to-Agent) channel for inter-assistant communication via the open A2A protocol`,defaultEnabled:!1},{id:`settings-developer-nav`,scope:`assistant`,key:`settings-developer-nav`,label:`Settings Developer Nav`,description:`Control Developer nav visibility in macOS settings`,defaultEnabled:!1},{id:`developer-menu-items`,scope:`client`,key:`developer-menu-items`,label:`Developer Menu Items`,description:`Show Component Gallery and Replay Onboarding in the menu bar`,defaultEnabled:!1},{id:`settings-embedding-provider`,scope:`assistant`,key:`settings-embedding-provider`,label:`Embedding Provider Settings`,description:`Show the Embedding service card in Models & Services settings`,defaultEnabled:!1},{id:`multi-platform-assistant`,scope:`client`,key:`multi-platform-assistant`,label:`Multi-Platform Assistant Switcher`,description:`Enable the menu-bar assistant switcher for managing multiple platform-hosted assistants (new/switch/retire)`,defaultEnabled:!1},{id:`quick-input`,scope:`client`,key:`quick-input`,label:`Quick Input`,description:`Enable the Quick Input popover on right-click of the menu bar icon`,defaultEnabled:!1},{id:`expand-completed-steps`,scope:`client`,key:`expand-completed-steps`,label:`Expand Completed Steps`,description:`Auto-expand completed tool call step groups instead of showing them collapsed`,defaultEnabled:!1},{id:`backward-releases`,scope:`assistant`,key:`backward-releases`,label:`Backward Releases`,description:`Show older versions in the version picker, allowing rollback to previous releases`,defaultEnabled:!1},{id:`fast-mode`,scope:`assistant`,key:`fast-mode`,label:`Fast Mode`,description:`Enable Anthropic fast mode for Opus models (4.6, 4.7, 4.8), delivering up to 2.5x higher output tokens per second at premium pricing`,defaultEnabled:!1},{id:`teleport`,scope:`client`,key:`teleport`,label:`Teleport`,description:`Enable teleport UI in General settings for moving assistants between hosting environments`,defaultEnabled:!1},{id:`apple-container`,scope:`client`,key:`apple-container`,label:`Apple Container`,description:`Enable assistant sandboxing via Apple Containers on macOS 26+, providing a lightweight native sandbox without third-party dependencies`,defaultEnabled:!1},{id:`fork-from-message`,scope:`client`,key:`fork-from-message`,label:`Internal Thread Actions (legacy key)`,description:"Legacy key for `internal-thread-actions`. The client grants the internal thread affordances when either key is enabled, so the platform may serve the gate under either name. Declared here so the flag mapper keeps the value instead of dropping it as undeclared.",defaultEnabled:!1},{id:`internal-thread-actions`,scope:`client`,key:`internal-thread-actions`,label:`Internal Thread Actions`,description:`Show the internal thread affordances: 'Fork from here' on messages, 'Fork Conversation', 'Analyze Conversation', and 'Copy conversation ID' in the thread menu, plus the LLM inspector surfaces. The flag is the sole gate: any session that enables it gets the affordances, including local sessions with no platform identity.`,defaultEnabled:!1},{id:`home-tab`,scope:`client`,key:`home-tab`,label:`Home Tab`,description:`Replace the knowledge graph top-level tab with a new Home page showing relationship progression, facts, and capability tiers`,defaultEnabled:!1},{id:`scroll-debug-overlay`,scope:`client`,key:`scroll-debug-overlay`,label:`Scroll Debug Overlay`,description:`Show a live HUD in the top-right of the conversation with scroll geometry, velocity, update rate, and anchor-preserver activity. Developer diagnostic for investigating scroll jank.`,defaultEnabled:!1},{id:`compaction-playground`,scope:`assistant`,key:`compaction-playground`,label:`Compaction Playground`,description:`Expose the developer-only Compaction Playground tab in macOS Settings and enable the /playground/* HTTP endpoints for exercising compaction conditions. Dev-only; default off.`,defaultEnabled:!1},{id:`app-control`,scope:`assistant`,key:`app-control`,label:`App Control`,description:`Enable the app-control skill (per-app screenshot + raw input bypassing AX tree)`,defaultEnabled:!1},{id:`velvet-theme`,scope:`client`,key:`velvet-theme`,label:`Velvet Theme`,description:`Show the Velvet theme option in the macOS appearance settings. Velvet is a dark-mode variant with red/pink accent colors.`,defaultEnabled:!1},{id:`chat-pull-to-refresh-enabled`,scope:`client`,key:`chat-pull-to-refresh-enabled`,label:`Chat Pull to Refresh`,description:`Enable pull-to-refresh gesture in the chat view.`,defaultEnabled:!1},{id:`centralized-assistant-status`,scope:`client`,key:`centralized-assistant-status`,label:`Centralized Assistant Status`,description:`Enable client polling of the centralized assistant operational status endpoint.`,defaultEnabled:!1},{id:`preview-channel`,scope:`client`,key:`preview-channel`,label:`Preview Channel`,description:`Enable user-facing Preview release channel controls in assistant settings.`,defaultEnabled:!1},{id:`rollback-enabled`,scope:`assistant`,key:`rollback-enabled`,label:`Rollback Enabled`,description:`Show older versions in the version picker, allowing rollback to previous releases.`,defaultEnabled:!1},{id:`self-hosted-assistant`,scope:`client`,key:`self-hosted-assistant`,label:`Self-Hosted Assistant`,description:`Enable self-hosted assistant configuration.`,defaultEnabled:!1},{id:`web-remote-ingress`,scope:`client`,key:`web-remote-ingress`,label:`Web Remote Ingress`,description:`Show the pair-a-device card in web settings. Visibility only; pairing itself is always available.`,defaultEnabled:!1},{id:`paired-devices-ui`,scope:`client`,key:`paired-devices-ui`,label:`Paired Devices UI`,description:"Show the paired-devices list and revoke controls inside the pair-a-device settings card. Visibility only; `vellum devices` on the host stays available.",defaultEnabled:!1},{id:`settings-sleep-policy`,scope:`assistant`,key:`settings-sleep-policy`,label:`Settings Sleep Policy`,description:`Enable sleep policy settings.`,defaultEnabled:!1},{id:`velvet`,scope:`client`,key:`velvet`,label:`Velvet`,description:`Enable the Velvet design theme.`,defaultEnabled:!1},{id:`memory-router-playground`,scope:`client`,key:`memory-router-playground`,label:`Memory Router Playground`,description:`Expose the developer-only Memory Router Playground tab in macOS Settings and the /assistant/memory-router-playground web page for dry-running v4 router config overrides against the live page index. Dev-only; default off.`,defaultEnabled:!1},{id:`self-intro-greeting`,scope:`both`,key:`self-intro-greeting`,label:`Self-intro first message`,description:`On the first conversation, send a natural self-introduction (e.g. "Hi Vela, I'm alex. Nice to meet you.") on the user's behalf and route it through real LLM inference, instead of serving the canned first greeting. Names come from the onboarding context; falls back to the canned greeting when no name is known. Exposed to clients so pre-hatch onboarding can compute the source-of-truth initial message, and to the assistant so older clients can still be gated server-side. See assistant/src/daemon/first-greeting.ts (buildSelfIntroMessage).`,defaultEnabled:!1},{id:`channel-trust-floors`,scope:`assistant`,key:`channel-trust-floors`,label:`Channel Trust Floors`,description:`Expose the Channel Trust Floors settings card (per-channel inbound admission policy) on the Privacy settings page. When off, the card is hidden and channels fall back to their default admission floors. On by default; disable to hide the card.`,defaultEnabled:!0},{id:`mcp-add-server`,scope:`assistant`,key:`mcp-add-server`,label:`MCP Add Server`,description:`Show the Add Server action on the MCP settings page. The MCP page itself remains visible; this flag gates only creating new Model Context Protocol server connections.`,defaultEnabled:!1},{id:`os-beta`,scope:`assistant`,key:`os-beta`,label:`OS Beta`,description:`Enable the OS Beta model profile (MiniMax M3 / Together) in the assistant's model profile selection.`,defaultEnabled:!1},{id:`new-thread-suggestions`,scope:`client`,key:`new-thread-suggestions`,label:`New-thread suggestions library`,description:`Replace the empty-state conversation-starter chips with the scrollable, categorized suggestions library and detail drawer (currently mocked data).`,defaultEnabled:!1},{id:`account-mfa`,scope:`client`,key:`account-mfa`,label:`Account MFA`,description:`Surface the Security settings page where users enroll and manage TOTP two-factor authentication for their Vellum (WorkOS) account. Applies to email/password sign-in only.`,defaultEnabled:!1},{id:`chat-credential-reveal`,scope:`assistant`,key:`chat-credential-reveal`,label:`Chat Credential Reveal`,description:"Persist chat secret redactions as sentinel markers instead of the legacy HTML marker, enriched with the vault identity when the value byte-matches a credential revealed this turn. Also gates the `credentials reveal --for-chat` channel and the live-stream swap that replaces an echoed reveal plaintext with its sentinel before emission. Redaction itself is NOT gated: a route-proven reveal plaintext stays out of persisted rows in both modes. Client chip rendering is gated on daemon version, not on this flag.",defaultEnabled:!1},{id:`assistant-switcher`,scope:`client`,key:`assistant-switcher`,label:`Assistant Switcher`,description:`Show the Switch Assistant section in General settings, linking to the assistant chooser. Covers local clients, signed-in cloud-hub users, remote-gateway origins, and native mobile shells; remote-gateway desktop browsers hand off to the hub chooser with a self-registration param. Also makes the chooser's selection authoritative for the app's active assistant on every surface including the platform hub, a job that previously belonged to multi-platform-assistant alone.`,defaultEnabled:!1},{id:`marketing-pricing-takeover`,scope:`client`,key:`marketing-pricing-takeover`,label:`Marketing Pricing Takeover`,description:"Gates the marketing pricing takeover page (www.vellum.ai/pricing) and the `/assistant/checkout?package=<slug>` deep link its package CTAs target. One flag covers both halves of the funnel so they can never be enabled independently and strand a CTA. When off, the checkout deep link redirects to the in-app plans takeover.",defaultEnabled:!1},{id:`assistant-reply-push`,scope:`assistant`,key:`assistant-reply-push`,label:`Assistant Reply Push`,description:"Gates the `chat.assistant_reply` push notification the assistant sends at the end of a user-initiated turn whose reply the user has not seen. On by default; turn it off to silence the push without disabling the rest of the notification pipeline.",defaultEnabled:!0},{id:`desktop-presence-suppression`,scope:`assistant`,key:`desktop-presence-suppression`,label:`Desktop Presence Suppression`,description:"Gates whether a `chat.assistant_reply` push is suppressed while a Mac desktop client reports itself attended. On by default; turn it off to restore unconditional reply pushes.",defaultEnabled:!0},{id:`web-presence-suppression`,scope:`assistant`,key:`web-presence-suppression`,label:`Web Presence Suppression`,description:"Gates whether a `chat.assistant_reply` push is suppressed while a browser tab reports itself visible on that conversation. On by default; turn it off to restore unconditional reply pushes for web-visible conversations.",defaultEnabled:!0},{id:`plugin-schedules`,scope:`assistant`,key:`plugin-schedules`,label:`Plugin Schedules`,description:`Plugins declare recurring schedules as files that register and run automatically`,defaultEnabled:!0},{id:`experiment-balanced-model-2026-08-06`,scope:`assistant`,key:`experiment-balanced-model-2026-08-06`,label:`Experiment: Balanced Profile Model`,description:`Multivariate experiment on the model the managed Balanced inference profile resolves to. control = gpt-5.6-luna (the shipped pin); terra = gpt-5.6-terra; glm-5p2 = accounts/fireworks/models/glm-5p2. Only the managed (vellum) implementation moves: ChatGPT-subscription and BYOK installs run the provider the user chose and are outside the experiment. Rollout and targeting are managed in the LaunchDarkly dashboard; any value that is not an arm name resolves to control.`,defaultEnabled:`control`,values:[`control`,`terra`,`glm-5p2`]},{id:`obscure-credits`,scope:`client`,key:`obscure-credits`,label:`Obscure Credits`,description:`Replaces the dollar amounts on the billing Plan section with a usage-relative view: the current-plan tile trades its price footer for a Usage Balance bar (managed spend this billing cycle against the package's included credits) and the credits spec chip reads "<Package> usage, reset monthly" instead of naming a dollar bundle. Spec chips wrap horizontally to fit the shorter labels. Off leaves the Plan section exactly as it ships today.`,defaultEnabled:!1}]};function t(e,t){return e===t||e===`both`}var n=e.flags,r={};function i(e){return r[e]||e.split(`-`).map((e,t)=>e===`ui`?`UI`:t===0?e:e[0].toUpperCase()+e.slice(1)).join(``)}function a(e){let r={};for(let a of n)typeof a.defaultEnabled==`boolean`&&t(a.scope,e)&&(r[i(a.key)]=a.defaultEnabled);return r}function o(e){let r={};for(let a of n)typeof a.defaultEnabled==`string`&&t(a.scope,e)&&(r[i(a.key)]=a.defaultEnabled);return r}var s=a(`client`),c=a(`assistant`),l=o(`client`),u=o(`assistant`),d=new Map;for(let e of n)d.set(i(e.key),e);var f=new Map;for(let e of n)f.set(i(e.key),e.key);function p(e){return i(e)}function m(e){return f.get(e)}function h(e){return d.get(e)}var g=`VITE_VELLUM_FLAG_`;function _(e){return e.toLowerCase().replace(/_/g,`-`)}var v=new Set([`true`,`1`,`yes`,`on`]),y=new Set([`false`,`0`,`no`,`off`]),b=new Map;for(let e of n)b.set(e.key,e);function x(e){return typeof e?.defaultEnabled==`string`}function S(e,t){let n=b.get(e),r=t.toLowerCase();return x(n)?n?.values?n.values.find(e=>e.toLowerCase()===r):t:v.has(r)?!0:y.has(r)?!1:t}function C(){if(typeof window<`u`&&window.__VELLUM_FLAG_OVERRIDES__!=null)return{...window.__VELLUM_FLAG_OVERRIDES__};let e={},t={BASE_URL:`/assistant/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_PLATFORM_MODE:`false`};for(let n of Object.keys(t))if(n.startsWith(g)){let r=_(n.slice(17)),i=t[n];if(i!=null){let t=S(r,i);t!==void 0&&(e[r]=t)}}return e}var w=null;function T(){return w===null&&(w=C()),w}function E(e){let n=T(),r={},i={};for(let[a,o]of Object.entries(n)){let n=b.get(a);if(!n||!t(n.scope,e))continue;let s=p(a);if(x(n)){let e=typeof o==`string`?o:o?`on`:`off`;(typeof o==`string`||n.values?.includes(e))&&(i[s]=e)}else typeof o==`boolean`?r[s]=o:i[s]=o}return{bool:r,str:i}}export{p as a,h as c,l as i,t as l,u as n,n as o,s as r,E as s,c as t,m as u};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n,t as r}from"./button-VkxVX0DM.js";import{n as i}from"./QueryClientProvider-EuRl-wrW.js";import{t as a}from"./useQuery-CTSuec5b.js";import{t as o}from"./useMutation-D2YPyfEH.js";import{t as s}from"./jsx-runtime-BJ8jcmzB.js";import{t as c}from"./cn-Cf8SmgbR.js";import{t as l}from"./typography-DekrYXvs.js";import{f as ee,o as u}from"./list-row-D1odQOMJ.js";import{t as d}from"./createLucideIcon-B-ZPaMbU.js";import{t as f}from"./bell-CHRdx4mp.js";import{t as p}from"./brain-9Csfs96f.js";import{t as m}from"./calendar-DUfSq9XY.js";import{t as h}from"./clock-CNSYP9nm.js";import{t as g}from"./ellipsis-DLgXzWgN.js";import{t as _}from"./list-Dn1NSBlc.js";import{t as v}from"./mail-BFnJM9hP.js";import{t as y}from"./message-square-CENNR7tf.js";import{t as b}from"./rotate-ccw-Cc2yZNdm.js";import{t as x}from"./settings-CyYRtP_K.js";import{t as S}from"./shield-check-B5eUPC8R.js";import{t as C}from"./trash-2-DnajdgJS.js";import{C as te,E as ne,L as w,_ as T,x as re}from"./src-Ch3HTlFm.js";import{t as ie}from"./tag-Ddzwz3ij.js";import"./i18n-7Z5ghN39.js";import{t as E}from"./useTranslation-CJMg4EBF.js";import{i as ae}from"./utils-wDLoxcBZ.js";import{Bt as oe,Lt as se,Rt as ce,zt as le}from"./sdk.gen-hZs6YBR0.js";import{d as D}from"./routes-Bj1LYNBZ.js";import{Nt as ue,U as de,W as O}from"./react-query.gen-OpeDEMIm.js";import{t as k}from"./use-bus-subscription-BmtCG3i6.js";import{t as fe}from"./haptics-BR_zMLz2.js";import{t as pe}from"./use-media-query-DSngkas0.js";import{t as me}from"./pointer-Cxac45y6.js";import{t as he}from"./interactive-target-DT1VQruY.js";import{t as ge}from"./swipe-action-reveal-Dj3B2k-t.js";import{t as _e}from"./native-anchor-BrkS1YE6.js";import{i as ve}from"./format-date-DEIFj6w3.js";import{n as ye}from"./schedules-D1Qj_LW9.js";var be=d(`mail-check`,[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]]),xe=d(`mail-open`,[[`path`,{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`,key:`1jhwl8`}],[`path`,{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`,key:`1qfld7`}]]),A=e(t(),1),Se=500,Ce=10;function j(e,t=Se,n={}){let{shouldSkip:r,ignoreInteractiveTarget:i=!1}=n,a=(0,A.useRef)(null),o=(0,A.useRef)(null),s=(0,A.useCallback)(()=>{a.current&&=(clearTimeout(a.current),null)},[]);return{onTouchStart:(0,A.useCallback)(n=>{if(!me())return;let c=n.touches[0];if(!c)return;let l=n.target;!i&&he(l)||r?.(l)||(o.current={x:c.clientX,y:c.clientY},s(),a.current=setTimeout(()=>{let t=window.getSelection();if(t&&t.toString().length>0){s();return}fe.light(),e()},t))},[e,t,s,r,i]),onTouchMove:(0,A.useCallback)(e=>{if(!o.current)return;let t=e.touches[0];if(!t)return;let n=t.clientX-o.current.x,r=t.clientY-o.current.y;Math.hypot(n,r)>Ce&&s()},[s]),onTouchEnd:(0,A.useCallback)(()=>{s(),o.current=null},[s]),onTouchCancel:(0,A.useCallback)(()=>{s(),o.current=null},[s])}}function M({shouldSkip:e}={}){let[t,n]=(0,A.useState)(!1),r=(0,A.useRef)(!1),i=j((0,A.useCallback)(()=>{r.current=!0,n(!0)},[]),void 0,{ignoreInteractiveTarget:!0,shouldSkip:e}),a=(0,A.useCallback)(e=>{n(e),e||(r.current=!1)},[]),o=(0,A.useCallback)(()=>a(!1),[a]),s=(0,A.useCallback)(e=>{r.current&&(r.current=!1,e.preventDefault(),e.stopPropagation())},[]),c=(0,A.useCallback)(e=>{i.onTouchEnd(),r.current&&e.preventDefault()},[i]);return{open:t,onOpenChange:a,close:o,wrapperProps:{className:`contents`,onClickCapture:s,onTouchStart:i.onTouchStart,onTouchMove:i.onTouchMove,onTouchEnd:c,onTouchCancel:i.onTouchCancel}}}var we=`(hover: hover)`;function N(){return pe(we)}function Te(e){let t=N();return e?t:!0}var P=s(),F=v,I=xe,Ee=be;function De(e){return e?F:I}var Oe=`0.10.5`;function ke(){return ae(Oe)}var L={security:{icon:S,strong:`var(--feed-nudge-strong)`,weak:`var(--feed-nudge-weak)`,labelKey:`category.security`},email:{icon:v,strong:`var(--feed-digest-strong)`,weak:`var(--feed-digest-weak)`,labelKey:`category.email`},scheduling:{icon:h,strong:`var(--feed-thread-strong)`,weak:`var(--feed-thread-weak)`,labelKey:`category.scheduling`},background:{icon:x,strong:`var(--system-info-strong)`,weak:`var(--system-info-weak)`,labelKey:`category.background`},system:{icon:f,strong:`var(--feed-digest-strong)`,weak:`var(--feed-digest-weak)`,labelKey:`category.system`}};function R(e){return e&&L[e]?L[e]:L.system}var Ae=[`security`,`email`,`scheduling`,`background`,`system`],z=`all`;function je({categories:e,activeFilter:t,onFilterChange:n}){let{t:r}=E(`home`),i=Ae.filter(t=>e.includes(t));if(i.length<=1)return null;let a=[{value:z,label:r(`category.all`),icon:(0,P.jsx)(_,{className:`h-4 w-4`})},...i.map(e=>{let{icon:t,labelKey:n}=L[e];return{value:e,label:r(n),icon:(0,P.jsx)(t,{className:`h-4 w-4`})}})];return(0,P.jsx)(u,{ariaLabel:r(`homeFeedFilterBar.ariaLabel`),value:t??z,onChange:e=>n(e===z?null:e),items:a,className:`self-start !w-auto [&>*]:!flex-none`})}function Me({category:e}){let{t}=E(`home`),n=R(e);return(0,P.jsx)(ie,{className:`bg-[var(--feed-chip-weak)] uppercase tracking-wide leading-none`,style:{"--feed-chip-weak":n.weak},children:t(n.labelKey)})}var Ne=12,B=280,V=4096,Pe=V*4,Fe=`.,;:!?-…`,Ie=/(?:…|\.{3,})$/,Le=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]),Re=te().use(ne).use(T);function H(e){return Fe.includes(e)}function ze(e){let t=e.length;for(;t>0&&H(e[t-1]);)--t;return e.slice(0,t)}function Be(e){if(e.length<=V)return U(e);let t=U(e.slice(0,V));return t.length>0||e.trim().length===0?t:U(e.slice(0,Pe))}function U(e){return W(Re.parse(e)).replace(/\s+/g,` `).trim()}function W(e){switch(e.type){case`code`:case`html`:case`thematicBreak`:case`yaml`:return``;case`inlineCode`:case`text`:return e.value??``;case`break`:return` `;case`delete`:case`emphasis`:case`link`:case`linkReference`:case`strong`:return G(e);case`image`:case`imageReference`:{let t=e.alt??``;return t.trim().length===0?``:t}default:return e.children===void 0?e.value??``:G(e)}}function G(e){let t=``;for(let n of e.children??[]){let e=W(n);e.length!==0&&(t.length>0&&!Le.has(n.type)&&(t+=` `),t+=e)}return t}function K(e){let t=[],n=!1;for(let r=0;r<e.length;r+=1){let i=e[r],a=r+1;if(/\s/.test(i)){if(n||t.length===0)continue;n=!0,t.push({char:` `,end:a});continue}n=!1;let o=i.toLowerCase();t.push({char:o.length===1?o:i,end:a})}return t}function q(e){return ze(K(e).map(e=>e.char).join(``).trimEnd()).trimEnd()}function Ve(e,t){if(t<=0)return e;let n=K(e);return t>n.length?``:e.slice(n[t-1].end)}function He(e){let t=0;for(;t<e.length;){let n=e[t];if(!/\s/.test(n)&&!H(n))break;t+=1}return e.slice(t)}function J(e){return e!==void 0&&/[\p{L}\p{M}\p{N}]/u.test(e)}function Y(e,t){return e.startsWith(t)?!J(e[t.length]):!1}function X(e,t){let n=t;for(;n>0&&J(e[n-1]);)--n;return n}function Ue(e){if(e.length<=B)return e;let t=e.slice(0,B),n=J(e[B])?X(t,t.length):t.length,r=t.slice(0,n).trimEnd();return r.length===0?t:r}function Z(e){return Ue(Be(e))}function We(e,t){let n=Z(t);if(n.length===0)return null;let r=q(n),i=q(e);if(r===i)return null;let a=Ie.test(e.trimEnd());if(!(a?r.startsWith(i):Y(r,i)))return(a?i.startsWith(r):Y(i,r))?null:n;let o=He(Ve(n,a&&J(r[i.length])?X(r,i.length):i.length));return o.length<Ne?null:o}function Q(e,t){return{icon:De(e),label:t(e?`actions.markAsRead`:`actions.markAsUnread`),nextStatus:e?`seen`:`new`}}function Ge({item:e,isUnread:t,validConversationIds:n,onDismiss:r,onToggleRead:i,onGoToThread:a,trailingAction:o,t:s}){if(o===`restore`)return[{id:`restore`,label:s(`actions.restore`),icon:b,onSelect:()=>r(e.id),swipeEdge:`trailing`,showsLabel:!0}];let c=[];if(i){let n=Q(t,s);c.push({id:`toggle-read`,label:n.label,icon:n.icon,onSelect:()=>i(e.id,n.nextStatus),swipeEdge:`trailing`})}let l=e.conversationId;return a&&l!=null&&(!n||n.has(l))&&c.push({id:`go-to-thread`,label:s(`actions.goToThread`),icon:y,onSelect:()=>{t&&i&&i(e.id,`seen`),a(l)}}),c.push({id:`dismiss`,label:s(`actions.dismiss`),icon:C,onSelect:()=>r(e.id),destructive:!0,swipeEdge:`trailing`}),c}function $(e,t){return e.filter(e=>e.swipeEdge===t).map(e=>({id:e.id,label:e.label,icon:e.icon,variant:e.destructive?`destructive`:`default`,onSelect:e.onSelect}))}var Ke=c(`flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-[var(--content-secondary)] transition-colors`,`hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`);function qe({actions:e}){return(0,P.jsx)(P.Fragment,{children:e.map(({id:e,label:t,icon:r,onSelect:i,showsLabel:a})=>(0,P.jsx)(n,{content:t,children:(0,P.jsxs)(`button`,{type:`button`,"aria-label":t,onClick:e=>{e.stopPropagation(),i()},className:c(Ke,a&&`w-auto gap-[var(--app-spacing-xs)] px-2`),children:[(0,P.jsx)(r,{width:16,height:16,"aria-hidden":`true`}),a?(0,P.jsx)(`span`,{className:`text-body-small-default`,children:t}):null]})},e))})}function Je({label:e}){return(0,P.jsx)(w.Trigger,{asChild:!1,"aria-label":e,className:c(Ke,`pointer-events-auto`),children:(0,P.jsx)(g,{width:16,height:16,"aria-hidden":`true`})})}function Ye({actions:e,title:t,open:n,onOpenChange:r,children:i}){return(0,P.jsxs)(w.Root,{open:n,onOpenChange:r,presentation:`sheet`,children:[i,(0,P.jsx)(w.Content,{title:t,showTitle:!0,children:e.map(({id:e,label:t,icon:n,onSelect:r,destructive:i})=>(0,P.jsx)(w.Item,{icon:n,label:t,tone:i?`destructive`:`default`,onSelect:r},e))})]})}function Xe(e){return[...e].sort((e,t)=>e.priority===t.priority?new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime():t.priority-e.priority)}function Ze(e){let t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1),i={today:[],yesterday:[],older:[]};for(let t of e){let e=new Date(t.createdAt);e>=n?i.today.push(t):e>=r?i.yesterday.push(t):i.older.push(t)}let a=new Map;return i.today.length>0&&a.set(`today`,i.today),i.yesterday.length>0&&a.set(`yesterday`,i.yesterday),i.older.length>0&&a.set(`older`,i.older),a}function Qe(e,t){return t===null?e:e.filter(e=>(e.category??`system`)===t)}function $e(e){return e.filter(e=>e.urgency!==`high`&&e.urgency!==`critical`)}function et(e){return $e(e.filter(e=>e.status!==`dismissed`))}function tt(e,t){let n=e?.metadata?.[t];return typeof n==`string`&&n.length>0?n:null}function nt(e){return tt(e,`scheduleId`)}function rt(e){return tt(e,`skillId`)}var it=`Notification`;function at(e){let t=e.title??Z(e.summary);return t.length>0?t:it}function ot(e){return{from:[`new`],to:`seen`,ids:e.filter(e=>e.status===`new`).map(e=>e.id)}}function st(e){return{from:[`new`,`seen`,`acted_on`],to:`dismissed`,ids:e.map(e=>e.id)}}function ct(e){let t=new Set;for(let n of e)t.add(n.category??`system`);return[...t]}var lt=`data-recap-card-link`,ut={[lt]:``},dt=e=>{let t=e?.closest(`button, a`);return t!=null&&!t.hasAttribute(lt)},ft=new Set([`Conversation`,`Other`]),pt={comfortable:{card:`p-[var(--app-spacing-md)]`,stack:`gap-[var(--app-spacing-xs)]`,titleVariant:`title-small`,clamp:`line-clamp-2`,showsMetaRow:!0},compact:{card:`p-[var(--app-spacing-sm)]`,stack:`gap-[var(--app-spacing-xxs)]`,titleVariant:`body-medium-default`,clamp:`line-clamp-1`,showsMetaRow:!1}};function mt({item:e,isActive:t=!1,validConversationIds:n,onSelect:r,onDismiss:i,onToggleRead:a,onGoToThread:o,trailingAction:s=`dismiss`,density:u=`comfortable`}){let{t:d}=E(`home`),f=e.status===`new`,p=pt[u],m=Ge({item:e,isUnread:f,validConversationIds:n,onDismiss:i,onToggleRead:a,onGoToThread:o,trailingAction:s,t:d}),h=N(),g=M({shouldSkip:dt}),_=d(`homeRecapRow.actionsTitle`),v=e.sourceLabel&&!ft.has(e.sourceLabel)?e.sourceLabel:null,y=(0,A.useMemo)(()=>at({title:e.title,summary:e.summary}),[e.title,e.summary]),b=(0,A.useMemo)(()=>We(y,e.summary),[y,e.summary]),x=(0,P.jsx)(l,{"data-testid":`home-recap-row-title`,variant:p.titleVariant,className:c(`leading-snug text-[var(--content-default)]`,p.showsMetaRow?p.clamp:`min-w-0 flex-1 truncate`),children:y}),S=(0,P.jsx)(l,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,...h?{"data-reveal-yield":``}:{},children:ve(e.timestamp)}),C=(0,P.jsxs)(`div`,{"data-reveal-row":``,className:c(`group relative flex w-full items-start gap-[var(--app-spacing-sm)]`,`rounded-[var(--radius-lg)] border border-[var(--border-base)]`,`transition-[background-color,opacity] duration-150`,p.card,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-overlay)] hover:bg-[var(--surface-hover)]`,!f&&!t&&`opacity-70`),children:[(0,P.jsx)(`button`,{type:`button`,"aria-label":y,onClick:()=>r(e),...ut,className:`absolute inset-0 w-full cursor-pointer rounded-[var(--radius-lg)]`}),(0,P.jsx)(`div`,{"data-testid":`home-recap-row-dot-gutter`,className:`pointer-events-none relative flex h-8 w-2 shrink-0 items-center`,children:f&&(0,P.jsx)(`span`,{"data-testid":`home-recap-row-unread-dot`,"aria-hidden":`true`,className:`h-2 w-2 rounded-full bg-[var(--system-mid-strong)]`})}),(0,P.jsxs)(`div`,{className:c(`pointer-events-none relative flex min-w-0 flex-1 flex-col`,p.stack),children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)]`,children:[p.showsMetaRow?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Me,{category:e.category}),v!==null&&(0,P.jsx)(l,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:v})]}):x,h?(0,P.jsxs)(ee,{className:`ml-auto justify-items-end`,children:[S,(0,P.jsx)(`span`,{"data-reveal":``,className:`flex items-center gap-[var(--app-spacing-sm)]`,children:(0,P.jsx)(qe,{actions:m})})]}):(0,P.jsxs)(`span`,{className:`ml-auto flex items-center gap-[var(--app-spacing-sm)]`,children:[S,(0,P.jsx)(Je,{label:_})]})]}),p.showsMetaRow&&x,b!==null&&(0,P.jsx)(l,{variant:`body-medium-lighter`,className:c(`leading-normal text-[var(--content-secondary)]`,p.clamp),children:b})]})]});return(0,P.jsx)(Ye,{actions:m,title:_,open:g.open,onOpenChange:g.onOpenChange,children:(0,P.jsx)(`div`,{...g.wrapperProps,children:(0,P.jsx)(ge,{leadingActions:$(m,`leading`),trailingActions:$(m,`trailing`),className:`rounded-[var(--radius-lg)]`,children:C})})})}var ht=[{kind:`schedule`,labelKey:`actions.viewSchedule`,icon:m,readId:nt,toDetail:e=>D.schedules.detail(e)},{kind:`skill`,labelKey:`actions.viewSkill`,icon:p,readId:rt,toDetail:e=>D.skills.detail(e)}];function gt(e,t,n){let r=a({...ye(t??void 0),enabled:n}),i=a({...ue({path:{assistant_id:t??``},query:{kind:`installed`}}),enabled:n&&!!t}),o=r.data,s=i.data;return(0,A.useMemo)(()=>{if(!t)return{links:[],isPending:!1};let n={schedule:{items:o,isPending:r.isPending},skill:{items:s?.skills,isPending:i.isPending}},a=[],c=!1;for(let t of ht){let r=t.readId(e);if(r===null)continue;let i=n[t.kind];if(i.isPending)c=!0;else if(!i.items?.some(e=>e.id===r))continue;a.push({kind:t.kind,labelKey:t.labelKey,icon:t.icon,to:t.toDetail(r)})}return{links:a,isPending:c}},[t,e,o,s,r.isPending,i.isPending])}function _t(e){let t=i(),n=(0,A.useRef)(null),r=(0,A.useRef)(0),s=(0,A.useMemo)(()=>({path:{assistant_id:e??``},query:{timeAwaySeconds:0}}),[e]),c=(0,A.useMemo)(()=>de(s),[s]);k(`app.hidden`,()=>{n.current=Date.now()}),k(`app.resume`,({signal:i})=>{i!==`online`&&n.current!==null&&(r.current=Math.round((Date.now()-n.current)/1e3),n.current=null,e&&t.invalidateQueries({queryKey:c}))});let l=a({queryKey:c,queryFn:async({signal:t})=>{let{data:n}=await le({path:{assistant_id:e},query:{timeAwaySeconds:r.current},signal:t,throwOnError:!0});return n},enabled:!!e,staleTime:3e4}),ee=o({mutationFn:async({itemId:t,status:n})=>{let{data:r}=await ce({path:{assistant_id:e,id:t},body:{status:n},throwOnError:!0});return r},onMutate:async({itemId:e,status:n})=>{await t.cancelQueries({queryKey:c});let r=t.getQueryData(c);return O(t,s,t=>t&&{...t,items:t.items.map(t=>t.id===e?{...t,status:n}:t)}),{previous:r}},onError:(e,n,r)=>{r?.previous&&O(t,s,r.previous)},onSettled:()=>{t.invalidateQueries({queryKey:c})}}),u=o({mutationFn:async({itemId:t,actionId:n})=>{let{data:r}=await se({path:{assistant_id:e,id:t,actionId:n},throwOnError:!0});return r},onMutate:async({itemId:e})=>{await t.cancelQueries({queryKey:c});let n=t.getQueryData(c);return O(t,s,t=>t&&{...t,items:t.items.map(t=>t.id===e?{...t,status:`acted_on`}:t)}),{previous:n}},onError:(e,n,r)=>{r?.previous&&O(t,s,r.previous)},onSettled:()=>{t.invalidateQueries({queryKey:c})}}),d=o({mutationFn:async({from:t,to:n,ids:r})=>{let{data:i}=await oe({path:{assistant_id:e},body:{from:t,to:n,ids:r},throwOnError:!0});return i},onMutate:async({from:e,to:n,ids:r})=>{await t.cancelQueries({queryKey:c});let i=t.getQueryData(c),a=new Set(e),o=r?new Set(r):null;return O(t,s,e=>{if(!e)return e;let t=e.items.map(e=>a.has(e.status)&&e.status!==n&&(!o||o.has(e.id))?{...e,status:n}:e),r=t.filter(e=>e.status===`new`).length;return{...e,items:t,contextBanner:{...e.contextBanner,newCount:r}}}),{previous:i}},onError:(e,n,r)=>{r?.previous&&O(t,s,r.previous)},onSettled:()=>{t.invalidateQueries({queryKey:c})}}),f=(0,A.useCallback)(()=>{e&&t.invalidateQueries({queryKey:c})},[e,t,c]);return{...l,updateStatus:ee,triggerAction:u,markAll:d,invalidate:f}}var vt={p:({children:e})=>(0,P.jsx)(`p`,{className:`mb-2 text-body-medium-default last:mb-0`,style:{color:`var(--content-secondary)`},children:e}),strong:({children:e})=>(0,P.jsx)(`strong`,{style:{color:`var(--content-default)`},children:e}),em:({children:e})=>(0,P.jsx)(`em`,{style:{color:`var(--content-default)`},children:e}),a:({href:e,children:t})=>(0,P.jsx)(`a`,{href:e,className:`underline`,style:{color:`var(--content-link)`},target:`_blank`,rel:`noopener noreferrer`,onClick:t=>_e(t,e),children:t}),ul:({children:e})=>(0,P.jsx)(`ul`,{className:`mb-2 list-disc pl-5 text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),ol:({children:e})=>(0,P.jsx)(`ol`,{className:`mb-2 list-decimal pl-5 text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),li:({children:e})=>(0,P.jsx)(`li`,{className:`mb-0.5`,children:e}),code:({children:e})=>(0,P.jsx)(`code`,{className:`rounded px-1 py-0.5 font-mono text-[0.85em]`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 8%, transparent)`,color:`var(--content-default)`},children:e}),pre:({children:e})=>(0,P.jsx)(`pre`,{className:`mb-2 overflow-x-auto rounded p-3 font-mono text-[0.85em]`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`,color:`var(--content-default)`},children:e}),h1:({children:e})=>(0,P.jsx)(`h1`,{className:`mb-2 text-title-medium first:mt-0`,style:{color:`var(--content-default)`},children:e}),h2:({children:e})=>(0,P.jsx)(`h2`,{className:`mb-2 text-title-small first:mt-0`,style:{color:`var(--content-default)`},children:e}),h3:({children:e})=>(0,P.jsx)(`h3`,{className:`mb-1 text-body-medium-default first:mt-0`,style:{color:`var(--content-default)`},children:e}),blockquote:({children:e})=>(0,P.jsx)(`blockquote`,{className:`mb-2 border-l-2 pl-3 text-body-medium-default`,style:{borderColor:`var(--border-base)`,color:`var(--content-tertiary)`},children:e}),table:({children:e})=>(0,P.jsx)(`div`,{className:`mb-2 overflow-x-auto`,children:(0,P.jsx)(`table`,{className:`w-full border-collapse text-body-small-default`,style:{color:`var(--content-secondary)`},children:e})}),thead:({children:e})=>(0,P.jsx)(`thead`,{style:{backgroundColor:`var(--surface-lift)`},children:e}),tbody:({children:e})=>(0,P.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,P.jsx)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:e}),th:({children:e})=>(0,P.jsx)(`th`,{className:`px-2 py-1.5 text-left font-semibold`,style:{color:`var(--content-default)`},children:e}),td:({children:e})=>(0,P.jsx)(`td`,{className:`px-2 py-1.5 align-top`,children:e})};function yt({content:e,className:t}){return(0,P.jsx)(`div`,{className:c(`text-body-medium-default`,t),children:(0,P.jsx)(re,{remarkPlugins:[T],components:vt,children:e})})}function bt({item:e,className:t}){return(0,P.jsx)(yt,{content:e.summary,className:t})}function xt(e){switch(e){case`revoked`:case`expired`:return`var(--system-negative-strong)`;case`missing_scopes`:case`missing_token`:case`ping_failed`:return`var(--system-mid-strong)`;default:return`var(--content-disabled)`}}function St(e){switch(e){case`revoked`:return`homeToolPermissionCard.status.revoked`;case`expired`:return`homeToolPermissionCard.status.expired`;case`missing_scopes`:return`homeToolPermissionCard.status.missingScopes`;case`missing_token`:return`homeToolPermissionCard.status.missingToken`;case`ping_failed`:return`homeToolPermissionCard.status.pingFailed`;case`unreachable`:return`homeToolPermissionCard.status.unreachable`;default:return null}}function Ct(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function wt({item:e}){let{t}=E(`home`),n=e.metadata,r=n?.provider;if(!r)return(0,P.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:e.summary});let i=n?.accountInfo??null,a=n?.status??`unreachable`,o=St(a),s=n?.details??``,c=Array.isArray(n?.missingScopes)?n.missingScopes:[];return(0,P.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-md)]`,children:[(0,P.jsx)(l,{variant:`title-small`,as:`h3`,children:r}),i?(0,P.jsx)(l,{variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:i}):null,(0,P.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)]`,children:[(0,P.jsx)(`span`,{className:`inline-block shrink-0 rounded-full`,style:{width:8,height:8,backgroundColor:xt(a)},"aria-hidden":`true`}),(0,P.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:o?t(o):Ct(a)})]}),s?(0,P.jsx)(l,{variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:s}):null,c.length>0?(0,P.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)]`,children:[(0,P.jsx)(l,{variant:`body-small-emphasised`,className:`text-[var(--content-secondary)]`,children:t(`homeToolPermissionCard.missingScopes`)}),(0,P.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-[var(--app-spacing-xxs)] pl-[var(--app-spacing-lg)]`,children:c.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(l,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:e})},e))})]}):null]})}function Tt({item:e,onUpdateStatus:t,onDismiss:n}){let{t:i}=E(`home`),a=Q(e.status===`new`,i),o=a.icon;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(r,{variant:`ghost`,iconOnly:(0,P.jsx)(o,{}),onClick:()=>t(e.id,a.nextStatus),"aria-label":a.label,tooltip:a.label}),e.status===`dismissed`?(0,P.jsx)(r,{variant:`ghost`,iconOnly:(0,P.jsx)(b,{}),onClick:()=>t(e.id,`seen`),"aria-label":i(`actions.restore`),tooltip:i(`actions.restore`)}):(0,P.jsx)(r,{variant:`ghost`,iconOnly:(0,P.jsx)(C,{}),onClick:()=>n(e.id),"aria-label":i(`actions.dismiss`),tooltip:i(`actions.dismiss`)})]})}export{Te as C,F as S,j as T,je as _,gt as a,Ee as b,$e as c,et as d,Ze as f,Q as g,Xe as h,_t as i,Qe as l,at as m,wt as n,mt as o,ot as p,bt as r,st as s,Tt as t,ct as u,R as v,M as w,I as x,ke as y};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,l as n}from"./local-settings-Bx7FsNo5.js";import{o as r,r as i}from"./device-settings-DZvv4pnY.js";import{t as a}from"./capture-error-VBsIaC5d.js";import{t as o}from"./react-BFJW0bSv.js";import{t as s}from"./button-VkxVX0DM.js";import{d as c,h as l,t as u}from"./chunk-5KNZJZUH-BUqIilZr.js";import{n as d}from"./QueryClientProvider-EuRl-wrW.js";import{t as f}from"./useQuery-CTSuec5b.js";import{t as p}from"./useMutation-D2YPyfEH.js";import{t as m}from"./jsx-runtime-BJ8jcmzB.js";import{t as h}from"./cn-Cf8SmgbR.js";import{t as g}from"./card-DUsAeHUS.js";import{d as _,o as v}from"./list-row-D1odQOMJ.js";import{t as y}from"./createLucideIcon-B-ZPaMbU.js";import{t as b}from"./bell-CHRdx4mp.js";import{t as x}from"./check-NGUguBHp.js";import{t as S}from"./chevron-down-D1ho6wFA.js";import{t as C}from"./circle-alert-B-Zu9T9V.js";import{t as w}from"./circle-check-BQyrCkaB.js";import{t as T}from"./hard-drive-zWkzTs9d.js";import{t as E}from"./heart-DBsRPrRH.js";import{t as D}from"./loader-circle-C9QjVTuc.js";import{t as O}from"./monitor-C7Po319a.js";import{t as k}from"./moon-D2HTb8zV.js";import{C as A,E as j,d as M,g as N,h as P,i as F,l as ee,n as I,o as te,t as L,u as ne,w as R,x as re}from"./composer-settings-xBD4cVBI.js";import{t as ie}from"./refresh-cw-DwfKxRXV.js";import{t as ae}from"./rotate-ccw-Cc2yZNdm.js";import{t as oe}from"./smartphone-CWnipfJ7.js";import{t as se}from"./sparkles-DvB22tVW.js";import{t as ce}from"./sun-sLCgv7zn.js";import{t as le}from"./triangle-alert-B-18Pims.js";import{t as ue}from"./x-zfSDUG5z.js";import{t as z}from"./notice-C_AsX_o9.js";import{t as de}from"./progress-bar-C4e3e4vV.js";import{B as fe,V as pe,o as me,r as he,s as B}from"./src-Ch3HTlFm.js";import{t as ge}from"./tag-Ddzwz3ij.js";import{t as V}from"./input-DkgpMeG9.js";import{t as _e}from"./toggle-0qt1e_3r.js";import{t as H}from"./modal-UYNawsIu.js";import{n as U}from"./toast-ZCXyBjoj.js";import{t as ve}from"./confirm-dialog--7V28331.js";import{t as ye}from"./select-D133FK9g.js";import{t as be}from"./skeleton-D8_lkywC.js";import{C as xe,K as Se,M as Ce,P as we,S as Te,U as Ee,V as De,Z as Oe,_ as ke,a as Ae,f as je,i as Me,p as Ne,u as Pe,v as Fe,z as Ie}from"./local-mode-DzIUFjhf.js";import{t as Le}from"./is-electron-C9-jl_HE.js";import{r as Re}from"./resolved-assistants-store-D57qRwKv.js";import{s as W,t as ze}from"./i18n-7Z5ghN39.js";import{t as Be}from"./useTranslation-CJMg4EBF.js";import{i as G,n as Ve,t as He}from"./api-errors-DYGVb-Sh.js";import{r as Ue,t as We}from"./semver-D1eVfLWz.js";import{i as Ge}from"./utils-wDLoxcBZ.js";import{$ as Ke,E as qe,S as Je,T as Ye,Z as Xe,a as Ze,g as Qe,n as $e,q as et,tt,w as nt,x as rt}from"./auth-store-DHZaL7sV.js";import{t as K}from"./client.gen-C1nf2AIs.js";import{$ as it,C as at,Gt as ot,N as st,P as ct,Q as lt,T as ut,W as dt}from"./sdk.gen-DXPJc8Xk.js";import{a as ft,s as pt}from"./api-ByKY0Cbt.js";import{c as mt}from"./remote-gateway-session-B4C6b4Sx.js";import{t as q}from"./client-feature-flag-store-o8FXKc-R.js";import{d as J}from"./routes-Bj1LYNBZ.js";import{d as ht,h as gt,o as _t,p as vt,u as yt}from"./platform-detection-CuBj2s81.js";import{i as bt,r as xt,t as St}from"./use-platform-gate-dRg4Iaxg.js";import{A as Ct,At as wt,D as Tt,E as Et,Ft as Dt,It as Ot,Lt as kt,N as At,Nt as jt,O as Mt,P as Nt,Pt,Rt as Ft,T as It,Tt as Lt,c as Rt,ht as zt,j as Bt,k as Vt,kt as Ht,pt as Ut,v as Wt,w as Gt}from"./react-query.gen-D3r2fwXH.js";import{t as Kt}from"./hard-navigate-D1rxKLPg.js";import{t as qt}from"./assistant-feature-flag-store-DPde0AIx.js";import{t as Jt}from"./pointer-Cxac45y6.js";import{n as Yt,t as Xt}from"./retire-confirm-dialog-Dj9Jz__k.js";import{a as Zt,i as Qt,r as $t,s as en}from"./local-runtime-upgrade-BTtW-R95.js";import{t as tn}from"./copy-to-clipboard-wnEkIu5M.js";import{t as nn}from"./proxy-C_GXGfwL.js";import{t as rn}from"./AnimatePresence-DkZYJl3q.js";import{t as an}from"./use-reduced-motion-DzXyVFAi.js";import{t as Y}from"./platform-login-notice-V5xsGsbM.js";import{t as on}from"./use-active-assistant-id-BFE4r9Rp.js";import{t as sn}from"./use-copy-to-clipboard-CBJ6pmkd.js";import{t as X}from"./detail-card-DBxsIpmu.js";import{t as cn}from"./app-info-CEe_jK5S.js";import{a as ln,i as un,l as dn,o as fn}from"./machine-sizes-Wnvi4rGR.js";import{t as pn}from"./environment-store-rZ0hkMHt.js";import{a as mn,i as hn,n as gn,r as _n,t as vn}from"./assistant-status-panel-uGuW1yZK.js";import{t as yn}from"./use-hotkey-recorder-BgB8ju9u.js";import{t as bn}from"./settings-divider-Cps8oOmA.js";var xn=y(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),Sn=y(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Cn=y(`vibrate`,[[`path`,{d:`m2 8 2 2-2 2 2 2-2 2`,key:`sv1b1`}],[`path`,{d:`m22 8-2 2 2 2-2 2 2 2`,key:`101i4y`}],[`rect`,{width:`8`,height:`14`,x:`8`,y:`5`,rx:`1`,key:`1oyrl4`}]]),Z=e(o(),1),Q=m();function wn(){let e=q.use.velvet(),{theme:t,setThemePreference:n}=P(),r=[{value:`system`,label:`System`,icon:(0,Q.jsx)(O,{className:`h-4 w-4`})},{value:`light`,label:`Light`,icon:(0,Q.jsx)(ce,{className:`h-4 w-4`})},{value:`dark`,label:`Dark`,icon:(0,Q.jsx)(k,{className:`h-4 w-4`})},...e?[{value:`velvet`,label:`Velvet`,icon:(0,Q.jsx)(E,{className:`h-4 w-4`})}]:[]];return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Theme`}),(0,Q.jsx)(`div`,{className:`mt-2 max-w-[360px]`,children:(0,Q.jsx)(v,{ariaLabel:`Theme`,value:t,onChange:n,items:r})})]})}var Tn=rt,En=`Please choose a different handle.`;async function Dn(e,t){let{data:n,error:r,response:i}=await ct({path:{id:e},body:{handle:t},throwOnError:!1});if(!i)return{kind:`error`,message:G(r,void 0,`Failed to save handle.`)??`Failed to save handle.`};if(i.ok&&n)return{kind:`ok`,data:n};if(i.status===409){let{message:e}=qe(r,`handle`,Tn.taken);return{kind:`taken`,message:e}}if(i.status===400){let{code:e,message:t}=qe(r,`handle`,En);return{kind:`invalid`,code:e,message:t}}return{kind:`error`,message:G(r,i,`Failed to save handle.`)}}async function On(e,t,n){let{data:r,error:i,response:a}=await at({path:{assistant_id:e},query:{handle:t},signal:n,throwOnError:!1});if(Ve(a,i,`Failed to check handle availability.`),!a.ok||!r)throw new He(a.status,a.status===429?`Too many checks — try again in a moment.`:G(i,a,`Failed to check handle availability.`));return{available:r.available,code:r.code??null,message:r.message??null}}function kn(e){return/\d{2,}$/.test(e)}var An=300,jn=1400;function Mn({initialHandle:e,inputLabel:t,helperText:n,idleHelperText:r,checkAvailable:i,save:a,onSaved:o,saveSuccessToast:c,fieldId:l}){let[u,d]=(0,Z.useState)(e),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(`idle`),[v,y]=(0,Z.useState)(null),b=an(),S=(0,Z.useRef)(null),w=(0,Z.useMemo)(()=>u.trim().toLowerCase(),[u]),T=w===e.toLowerCase();(0,Z.useEffect)(()=>{if(T||w.length===0){h(!1),S.current?.abort();return}let e=new AbortController;S.current?.abort(),S.current=e,h(!0);let t=window.setTimeout(async()=>{try{let t=await i(w,e.signal);e.signal.aborted||p(t)}catch(t){e.signal.aborted||y(t instanceof Error?t.message:`Couldn't check availability.`)}finally{e.signal.aborted||h(!1)}},An);return()=>{window.clearTimeout(t),e.abort()}},[w,T,i]);let E=(()=>{if(v)return v;if(f&&!f.available){let e=f.code;return f.message??(e?Tn[e]:`Please choose a different handle.`)}return null})(),O=E?n:T?r??null:m?`Checking availability…`:f?.available?`Available.`:null,k=!T&&!m&&f?.available!==!1&&g!==`saving`,A=(0,Z.useCallback)(async()=>{if(!k)return;_(`saving`),y(null);let e=await a(w);if(e.kind===`ok`){_(`saved`),o(e.data),U.success(c),window.setTimeout(()=>_(`idle`),jn);return}if(e.kind===`taken`){_(`idle`),p({available:!1,code:`taken`,message:e.message});return}if(e.kind===`invalid`){_(`idle`),p({available:!1,code:e.code,message:e.message});return}_(`error`),y(e.message),U.error(e.message)},[k,w,o,a,c]),j=(()=>{if(T&&u.length>0||u.length===0)return null;let e=m?`checking`:f?.available?`available`:f?.available===!1?`invalid`:null;return e?(0,Q.jsx)(rn,{mode:`wait`,initial:!1,children:(0,Q.jsxs)(nn.span,{initial:b?!1:{opacity:0,scale:.85},animate:{opacity:1,scale:1},exit:b?void 0:{opacity:0,scale:.85},transition:{duration:.14,ease:`easeOut`},className:`flex items-center`,"aria-hidden":e!==`available`&&e!==`invalid`,children:[e===`checking`&&(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),e===`available`&&(0,Q.jsx)(x,{className:`h-4 w-4 text-[var(--system-positive-strong)]`,"aria-label":`Available`}),e===`invalid`&&(0,Q.jsx)(C,{className:`h-4 w-4 text-[var(--system-negative-strong)]`,"aria-label":`Not available`})]},e)}):null})(),M=(()=>{switch(g){case`saving`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(D,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}),`Saving…`]});case`saved`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(x,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Saved`]});default:return`Save`}})();return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(V,{label:t,value:u,onChange:e=>{d(e.target.value.replace(/\s+/g,``)),p(null),y(null)},autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,maxLength:30,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),rightIcon:j,errorText:E??void 0,helperText:O??void 0,"aria-invalid":!!E,fullWidth:!0,"data-testid":`${l}-input`}),(!T||g!==`idle`)&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(s,{variant:`primary`,size:`compact`,onClick:A,disabled:!k,"aria-live":`polite`,"data-testid":`${l}-save`,children:M})})]})}function Nn({initial:e,onSaved:t}){let n=$e.use.refreshSession(),r=kn(e.username)?`Your handle was auto-generated at signup — pick one you like.`:void 0,i=(0,Z.useCallback)(async e=>await Ye({username:e}),[]),a=(0,Z.useCallback)((e,t)=>Je(e,t),[]),o=(0,Z.useCallback)(e=>{t(e),n()},[t,n]);return(0,Q.jsx)(Mn,{initialHandle:e.username,inputLabel:`User handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:r,checkAvailable:a,save:i,onSaved:o,saveSuccessToast:`Profile updated.`,fieldId:`user-handle`})}function Pn({assistant:e,onSaved:t}){let n=e.handle??``,r=f({...Rt({path:{assistant_id:e.id}})}).data?.results?.[0],i=!!r&&r.subdomain.toLowerCase()===n.toLowerCase(),a=n.length===0?`Your assistant doesn't have a handle yet — claim one to make it mentionable.`:void 0,o=(0,Z.useCallback)(async t=>await Dn(e.id,t),[e.id]),s=(0,Z.useCallback)((t,n)=>On(e.id,t,n),[e.id]);return i?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(V,{label:`Assistant handle`,value:n,readOnly:!0,disabled:!0,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),fullWidth:!0,"data-testid":`assistant-handle-input`}),(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Your assistant's handle is locked because it's used as its email subdomain. To change it,`,` `,(0,Q.jsx)(u,{to:`${J.settings.ai}?release=1#email`,className:`text-[var(--content-link)] underline hover:text-[var(--content-link-hover)]`,children:`release the subdomain`}),` `,`first.`]})]}):(0,Q.jsx)(Mn,{initialHandle:n,inputLabel:`Assistant handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:a,checkAvailable:s,save:o,onSaved:t,saveSuccessToast:`Assistant handle updated.`,fieldId:`assistant-handle`})}function Fn(){return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-busy":!0,"aria-live":`polite`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(be,{className:`h-3 w-16`}),(0,Q.jsx)(be,{className:`h-9 w-full rounded-md`}),(0,Q.jsx)(be,{className:`h-3 w-72`})]}),(0,Q.jsx)(be,{className:`h-9 w-full rounded-md`}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(be,{className:`h-3 w-60`}),(0,Q.jsx)(be,{className:`h-7 w-16 rounded-md`})]}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Loading your profile…`})]})}function In(){return(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`})}function Ln({assistant:e,showHandles:t=!0,children:n}={}){let r=$e.use.user?.()?.email??null;return(0,Q.jsx)(X,{title:`Profile`,subtitle:`Manage your account details and preferences.`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[r&&(0,Q.jsx)(`div`,{className:`max-w-[420px]`,children:(0,Q.jsx)(V,{label:`Email`,value:r,disabled:!0,readOnly:!0})}),t&&(0,Q.jsxs)(Q.Fragment,{children:[r&&(0,Q.jsx)(In,{}),(0,Q.jsx)(Rn,{assistant:e})]}),n!=null&&(0,Q.jsxs)(Q.Fragment,{children:[(r||t)&&(0,Q.jsx)(In,{}),n]})]})})}function Rn({assistant:e}){let[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null),a=an(),[o,s]=(0,Z.useState)(e??null);return(0,Z.useEffect)(()=>{s(e??null)},[e]),(0,Z.useEffect)(()=>{let e=!1;return nt().then(t=>{e||n(t)}).catch(t=>{e||i(t instanceof Error?t.message:`Failed to load profile.`)}),()=>{e=!0}},[]),r?(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:r}):t?(0,Q.jsxs)(nn.div,{initial:a?!1:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.22,ease:`easeOut`},className:`flex flex-col gap-6`,children:[(0,Q.jsx)(Nn,{initial:t,onSaved:n}),o&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(Pn,{assistant:o,onSaved:s})]})]}):(0,Q.jsx)(Fn,{})}var zn=Wt({query:{hosting:`platform`}});function Bn(){let e=on(),t=f(zn),n=t.data?.results??[];return t.isPending||n.length<2?null:(0,Q.jsx)(X,{title:`Switch Assistant`,subtitle:`Choose which assistant is active for this account.`,children:(0,Q.jsx)(`div`,{className:`space-y-2`,children:n.map(t=>{let n=t.id===e;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${n?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(O,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:t.name||`Unnamed`}),t.status!==`active`&&(0,Q.jsx)(ge,{tone:`warning`,children:t.status})]})})]}),(0,Q.jsx)(`div`,{className:`shrink-0`,children:n?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-body-small-default text-[var(--system-positive-default)]`,children:[(0,Q.jsx)(x,{className:`h-4 w-4`}),`Active`]}):(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,disabled:t.status!==`active`,onClick:()=>{Xe(t.id),U.success(`Switched active assistant.`)},children:`Switch`})})]},t.id)})})})}var Vn=[{label:`Never`,seconds:0},{label:`5 min`,seconds:300,devOnly:!0},{label:`10 min`,seconds:600,devOnly:!0},{label:`1 hour`,seconds:3600},{label:`3 hours`,seconds:10800},{label:`1 day`,seconds:86400},{label:`3 days`,seconds:259200},{label:`7 days`,seconds:604800},{label:`14 days`,seconds:1209600},{label:`30 days`,seconds:2592e3}];function Hn(e){if(e===0)return`Never (sleep disabled)`;let t=Math.floor(e/86400),n=Math.floor(e%86400/3600);if(t>0&&n>0)return`${t}d ${n}h`;if(t>0)return`${t} day${t===1?``:`s`}`;if(n>0)return`${n} hour${n===1?``:`s`}`;let r=Math.floor(e/60);return r>0?`${r} minute${r===1?``:`s`}`:`${e}s`}function Un({assistantId:e}){let t=d(),n=pn.use.isNonProduction(),r=(0,Z.useMemo)(()=>Vn.filter(e=>!e.devOnly||n),[n]),{data:i,isLoading:a,isError:o}=f(Ct({path:{id:e}})),c=(0,Z.useMemo)(()=>i?.idle_timeout_seconds??259200,[i]),[l,u]=(0,Z.useState)(null),p=l??c,m=l!==null,h=wt({onSuccess:()=>{U.success(`Sleep policy saved.`),u(null),t.invalidateQueries({queryKey:Bt({path:{id:e}})})},onError:()=>{U.error(`Failed to save sleep policy. Please try again.`)}});return a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin`}),`Loading sleep settings...`]}):o?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:`Failed to load sleep policy. Refresh the page to try again.`}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Idle timeout`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`How long the assistant can be idle before it is put to sleep. "Never" disables idle sleep entirely.`}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:r.map(e=>(0,Q.jsx)(s,{variant:`outlined`,active:p===e.seconds,onClick:()=>u(e.seconds),children:e.label},e.seconds))}),(0,Q.jsxs)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:[`Current: `,Hn(p)]})]}),m&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(s,{variant:`primary`,leftIcon:h.isPending?(0,Q.jsx)(D,{className:`animate-spin`}):void 0,onClick:()=>h.mutate({path:{id:e},body:{idle_timeout_seconds:p}}),disabled:h.isPending,children:`Save`}),(0,Q.jsx)(s,{variant:`outlined`,onClick:()=>u(null),disabled:h.isPending,children:`Cancel`})]})]})}function Wn(e,t,n){let r=[e.version];return e.version===n&&r.push(`(latest)`),t&&e.version===t&&r.push(`(current)`),r.join(` `)}var Gn=3e3;function Kn({version:e,assistantId:t}){let{onTap:n,message:r}=hn(t);return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`block min-w-0 break-all text-left text-body-medium-lighter text-[var(--content-default)]`,onClick:n,children:e??`—`}),r&&(0,Q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-accent)]`,children:r})]})}function qn({assistantId:e,currentVersion:t,releaseChannel:n,onUpgradeComplete:r}){let i=qt.use.rollbackEnabled(),a=q.use.previewChannel(),o=d(),c=Qt(n,a),l=c===`preview`,[u,m]=(0,Z.useState)(!1),h=(0,Z.useRef)(null),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null),w=e=>e&&h.current&&e===h.current?(queueMicrotask(()=>{C(b?`Successfully rolled back to version ${h.current}.`:`Successfully updated to version ${h.current}.`),m(!1),h.current=null,_(null),U.success(b?`Rollback complete. Your assistant is healthy.`:`Update complete. Your assistant is healthy.`,{id:`runtime-upgrade-complete`,tone:`strong`}),r?.()}),!1):Gn;f({...Mt({path:{id:e}}),refetchInterval:u?e=>w(e.state.data?.current_release_version):!1});let{data:T,isLoading:E}=f(Lt({query:{channel:c}})),O=T?.find(e=>e.is_stable!==!1)??T?.[0],k=g??O?.version??null,A=(0,Z.useMemo)(()=>{if(!i||!k||!t)return!1;let e=Ue(k),n=Ue(t);return!e||!n?!1:We(e,n)<0},[i,k,t]),j=(0,Z.useMemo)(()=>{if(!k)return!1;if(!t)return!0;let e=Ue(k),n=Ue(t);if(!e||!n)return k!==t;let r=We(e,n);return i?r!==0:r>0},[i,k,t]),M=p({mutationFn:async t=>{let{data:n}=await lt({path:{id:e},body:t,throwOnError:!0});return n}}),N=p({mutationFn:async t=>{let{data:n}=await dt({path:{id:e},body:t,throwOnError:!0});return n}});return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Current`}),(0,Q.jsx)(Kn,{version:t,assistantId:e})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:l?`Preview release`:j?A?`Rollback to`:`Update to`:`Selected`}),(0,Q.jsx)(`span`,{className:`block min-w-0`,children:E?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(D,{className:`h-3 w-3 animate-spin`}),`Loading...`]}):T&&T.length>0?i?(0,Q.jsx)(ye,{value:k??``,onChange:e=>_(e===O?.version?null:e),disabled:u||M.isPending||N.isPending,options:T.map(e=>({value:e.version,label:Wn(e,t,O?.version)}))}):(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:O?Wn(O,t,O.version):`—`}):`No releases available`})]})]}),(0,Q.jsx)(s,{variant:A?`outlined`:`primary`,className:`min-w-[160px]`,leftIcon:M.isPending||N.isPending||u?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(ie,{}),onClick:()=>y(!0),disabled:!j||M.isPending||N.isPending||u||E||!T?.length,children:u?b?`Rolling back...`:`Updating...`:A?`Rollback`:l?`Update preview`:`Update`}),l&&(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Using Preview releases.`,` `,(0,Q.jsx)(`a`,{href:`#preview-release-channel`,className:`text-[var(--primary-base)] underline-offset-2 hover:underline`,children:`Switch back to Stable`})]}),!j&&t&&k&&!E&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:S??`You are already on this version.`}),(0,Q.jsx)(ve,{open:v,title:A?`Rollback assistant`:l?`Update preview release`:`Update assistant`,message:A?`Rollback to version ${k??`unknown`}? The assistant will be briefly unavailable.`:l?`Update to preview version ${k??`latest`}? The assistant will be briefly unavailable during the update.`:`Update to version ${k??`latest`}? The assistant will be briefly unavailable during the update.`,confirmLabel:A?`Rollback`:l?`Update preview`:`Update`,onConfirm:async()=>{y(!1),C(null);let t=i?k??void 0:void 0;try{if(A){let e=await N.mutateAsync({version:t});h.current=e.version??t??null,U.success(e.detail||`Rollback to ${t} initiated.`)}else{let e=await M.mutateAsync({version:t});if(e.detail?.includes(`Already on the latest`)){U.warning(e.detail);return}h.current=e.version??t??null,U.success(e.detail||`Update to ${e.version??t??`latest`} initiated.`)}x(A),m(!0),o.invalidateQueries({queryKey:Vt({path:{id:e}})})}catch{U.error(A?`Failed to trigger rollback. Please try again.`:`Failed to trigger update. Please try again.`)}},onCancel:()=>y(!1)})]})}function Jn({assistantId:e,currentVersion:t,onUpgradeComplete:n}){let[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(null),{data:c,isLoading:l}=f(Lt({query:{stable:!0,limit:100}})),u=(0,Z.useMemo)(()=>$t(c),[c]),d=u?.version,p=t?Zt(t,d):!!d,m=en({assistantId:e,targetVersion:d});return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Current`}),(0,Q.jsx)(Kn,{version:t,assistantId:e})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Update to`}),(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:l?`Loading...`:d&&u?Wn(u,t,d):`No releases available`})]})]}),(0,Q.jsx)(s,{variant:`primary`,className:`min-w-[160px]`,leftIcon:m.isPending?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(ie,{}),onClick:()=>i(!0),disabled:m.isPending||l||!d||!p,children:m.isPending?`Updating...`:d?`Update to ${d}`:`Update`}),a&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:a}),!a&&!p&&d&&!l&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:`You are already on this version.`}),(0,Q.jsx)(ve,{open:r,title:`Update assistant`,message:`Update to version ${d??`latest`}? The assistant will be briefly unavailable during the update.`,confirmLabel:`Update`,onConfirm:async()=>{i(!1),o(null);try{let e=await m.upgrade();o(e.version?`Successfully updated to version ${e.version}.`:`Successfully updated to version ${d??`latest`}.`),U.success(`Update complete. Your assistant is healthy.`,{id:`runtime-upgrade-complete`,tone:`strong`}),n?.()}catch(e){U.error(e instanceof Error?e.message:`Failed to trigger update. Please try again.`)}},onCancel:()=>i(!1)})]})}function Yn(){let e=bt({platformHostedOnly:!0}),t=xt(),n=$e.use.user()?.id??null,r=$e.use.logout(),[i,a]=(0,Z.useState)(!1),o=jt({onSuccess:async()=>{U.success(`Account deletion requested. You will be logged out shortly.`),Qe(n),await r(),Kt(J.account.login)},onError:()=>{U.error(`Failed to request account deletion. Please try again.`)}}),c=e===`full`&&t;return(0,Z.useEffect)(()=>{c&&i&&a(!1)},[c,i]),e===`gated`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Delete Account`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Permanently delete your account and all associated data.`}),(0,Q.jsx)(`div`,{className:`mt-1`,children:e===`disabled`?(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to delete your account.`}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(s,{variant:`dangerOutline`,onClick:()=>a(!0),disabled:o.isPending||c,className:`self-start`,children:`Delete My Account`}),c&&(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`})]})})]}),(0,Q.jsx)(ve,{open:i,title:`Delete Account`,message:`This will permanently delete your account and all associated data. This action cannot be undone.`,confirmLabel:`Delete Account`,destructive:!0,onConfirm:()=>{if(c){a(!1);return}a(!1),o.mutate({})},onCancel:()=>a(!1)})]})}function Xn({title:e,subtitle:t,benefits:n,ctaLabel:r,ctaLeftIcon:i,onAction:a}){return(0,Q.jsx)(X,{title:e,subtitle:t,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`ul`,{className:`space-y-3`,children:n.map(({icon:e,text:t})=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md`,style:{background:`var(--surface-base)`},children:(0,Q.jsx)(e,{size:14,style:{color:`var(--content-secondary)`},"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[color:var(--content-secondary)]`,children:t})]},t))}),(0,Q.jsx)(s,{variant:`primary`,size:`regular`,leftIcon:i,onClick:a,className:`self-start`,children:r})]})})}function Zn(){let e=ht(),t=yt(),n=e?`ios`:t?`android`:null,r=n?F(n):null;return r?(0,Q.jsx)(Xn,{title:`Get the ${r.appName} App`,subtitle:`The Vellum ${r.appName} app gives you a native experience.`,benefits:[{icon:b,text:`Push notifications`},{icon:xn,text:`Biometric login`},{icon:Cn,text:`Native haptics`},{icon:oe,text:`Home screen access`}],ctaLabel:`Download`,ctaLeftIcon:(0,Q.jsx)(oe,{size:16}),onAction:()=>{ee(r.platform),te(r.platform)}}):null}var Qn=`0.10.0`;function $n(){return Ge(Qn)}var er=[`login.tailscale.com`,`tailscale.com`,`www.tailscale.com`,`ngrok.com`,`dashboard.ngrok.com`,`dash.cloudflare.com`,`cloudflare.com`,`www.cloudflare.com`];function tr(e){let t;try{t=new URL(e).hostname}catch{return!1}return er.includes(t)}function nr(e){let t;try{t=new URL(e).hostname}catch{return null}return er.includes(t)?t.includes(`tailscale`)?`Tailscale`:t.includes(`ngrok`)?`ngrok`:t.includes(`cloudflare`)?`Cloudflare`:null:null}function rr(e){try{let t=new URL(e).hostname;return t===`localhost`||t===`[::1]`||/^127(?:\.\d{1,3}){3}$/.test(t)}catch{return!1}}function ir(e){let t=new URL(e);t.search=``,t.hash=``;let n=t.pathname.split(`/`).filter(Boolean),r=n.indexOf(`assistant`);return r>=0&&n.splice(r),t.pathname=n.length?`/${n.join(`/`)}`:`/`,t.toString().replace(/\/+$/,``)}function ar(e){let t;try{t=ir(e)}catch{return{ok:!1,reason:`unparseable`}}return rr(t)?{ok:!1,reason:`loopback`}:tr(t)?{ok:!1,reason:`service-website`}:new URL(t).protocol===`https:`?{ok:!0,url:t}:{ok:!1,reason:`non-https`}}function or(e){let t=new URL(e.verificationUri);return t.hash=new URLSearchParams({device_code:e.deviceCode}).toString(),t.toString()}function sr(e,t){switch(e){case`unparseable`:return W(`settings:pairDeviceUrl.unparseable`);case`loopback`:return W(`settings:pairDeviceUrl.loopback`);case`non-https`:return W(`settings:pairDeviceUrl.nonHttps`);case`service-website`:return W(`settings:pairDeviceUrl.serviceWebsite`,{service:t&&nr(t)||W(`settings:pairDeviceUrl.serviceFallbackName`)})}}var cr=`/v1/remote-web/pairing-challenge`,lr=`/v1/remote-web/pairing-verification`,ur=`/v1/remote-web/pairing-requests`,dr=`${ur}/approve`,fr=`${ur}/deny`;function pr(){return W(`settings:pairDeviceClient.connectivityHint`)}var mr=class extends Error{hint;status;code;constructor(e,t={}){super(e),this.name=`PairDeviceError`,this.hint=t.hint,this.status=t.status,this.code=t.code}},hr=5e3;function gr(){if(typeof window>`u`)return null;let e=Ne(),t=Ae(e);return t?{base:`${window.location.origin}${t}`,assistantName:e?.name?.trim()||null,ingressUrl:e?.ingressUrl?.trim()||null}:null}function _r(e){let t=e?.error?.message;return typeof t==`string`&&t.trim()?t:null}function vr(e){let t=e?.error?.code;return typeof t==`string`&&t?t:void 0}async function yr(e,t,n,r){let i;try{i=await fetch(e,{...t,signal:n})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?e:new mr(W(`settings:pairDeviceClient.networkError`))}let a=await i.json().catch(()=>null);if(!i.ok)throw new mr(_r(a)??W(`settings:pairDeviceClient.httpError`,{status:i.status}),{hint:r,status:i.status,code:vr(a)});if(typeof a!=`object`||!a)throw new mr(W(`settings:pairDeviceClient.unexpectedResponse`));return a}function br(e,t,n,r){return yr(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)},n,r)}async function xr(e){let{base:t,publicBaseUrl:n,signal:r}=e,i=await br(`${t}${cr}`,{publicBaseUrl:n},r,pr());try{await br(`${t}${lr}`,{userCode:i.userCode},r,pr())}catch(e){let n=AbortSignal.timeout(hr);throw e instanceof DOMException&&e.name===`AbortError`?Sr(t,i.userCode,n):await Sr(t,i.userCode,r?AbortSignal.any([r,n]):n),e}return{pairUrl:or(i),expiresAt:i.expiresAt}}async function Sr(e,t,n){try{let r=(await Cr({base:e,signal:n})).find(e=>e.userCode===t);r&&await Er({base:e,requestId:r.requestId,signal:n})}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;a(e,{context:`pair-device-orphan-cleanup`,bestEffort:!0})}}async function Cr(e){let t=await yr(`${e.base}${ur}`,{method:`GET`},e.signal);return Array.isArray(t.requests)?t.requests:[]}async function wr(e,t){await br(`${t.base}${e}`,{requestId:t.requestId},t.signal)}function Tr(e){return wr(dr,e)}function Er(e){return wr(fr,e)}var Dr=Object.defineProperty,Or=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable,jr=(e,t,n)=>t in e?Dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mr=(e,t)=>{for(var n in t||={})kr.call(t,n)&&jr(e,n,t[n]);if(Or)for(var n of Or(t))Ar.call(t,n)&&jr(e,n,t[n]);return e},Nr=(e,t)=>{var n={};for(var r in e)kr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Or)for(var r of Or(e))t.indexOf(r)<0&&Ar.call(e,r)&&(n[r]=e[r]);return n},Pr;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(Pr||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(Pr||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(Pr||={});var Fr=Pr,Ir={L:Fr.QrCode.Ecc.LOW,M:Fr.QrCode.Ecc.MEDIUM,Q:Fr.QrCode.Ecc.QUARTILE,H:Fr.QrCode.Ecc.HIGH},Lr=128,Rr=`L`,zr=`#FFFFFF`,Br=`#000000`,Vr=!1,Hr=1,Ur=4,Wr=0,Gr=.1;function Kr(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function qr(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function Jr(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*Gr),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function Yr(e,t){return t==null?e?Ur:Wr:Math.max(Math.floor(t),0)}function Xr({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:a,size:o,boostLevel:s}){let c=Z.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...Fr.QrSegment.makeSegments(t)),e),[]);return Fr.QrCode.encodeSegments(r,Ir[t],n,void 0,void 0,s)},[e,t,n,s]),{cells:l,margin:u,numCells:d,calculatedImageSettings:f}=Z.useMemo(()=>{let e=c.getModules(),t=Yr(r,i);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:Jr(e,o,t,a)}},[c,o,a,r,i]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:f}}var Zr=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Qr=Z.forwardRef(function(e,t){let n=e,{value:r,size:i=Lr,level:a=Rr,bgColor:o=zr,fgColor:s=Br,includeMargin:c=Vr,minVersion:l=Hr,boostLevel:u,marginSize:d,imageSettings:f}=n,p=Nr(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:m}=p,h=Nr(p,[`style`]),g=f?.src,_=Z.useRef(null),v=Z.useRef(null),y=Z.useCallback(e=>{_.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[b,x]=Z.useState(!1),{margin:S,cells:C,numCells:w,calculatedImageSettings:T}=Xr({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:d,imageSettings:f,size:i});Z.useEffect(()=>{if(_.current!=null){let e=_.current,t=e.getContext(`2d`);if(!t)return;let n=C,r=v.current,a=T!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;a&&T.excavation!=null&&(n=qr(C,T.excavation));let c=window.devicePixelRatio||1;e.height=e.width=i*c;let l=i/w*c;t.scale(l,l),t.fillStyle=o,t.fillRect(0,0,w,w),t.fillStyle=s,Zr?t.fill(new Path2D(Kr(n,S))):C.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+S,n+S,1,1)})}),T&&(t.globalAlpha=T.opacity),a&&t.drawImage(r,T.x+S,T.y+S,T.w,T.h)}}),Z.useEffect(()=>{x(!1)},[g]);let E=Mr({height:i,width:i},m),D=null;return g!=null&&(D=Z.createElement(`img`,{src:g,key:g,style:{display:`none`},onLoad:()=>{x(!0)},ref:v,crossOrigin:T?.crossOrigin})),Z.createElement(Z.Fragment,null,Z.createElement(`canvas`,Mr({style:E,height:i,width:i,ref:y,role:`img`},h)),D)});Qr.displayName=`QRCodeCanvas`;var $r=Z.forwardRef(function(e,t){let n=e,{value:r,size:i=Lr,level:a=Rr,bgColor:o=zr,fgColor:s=Br,includeMargin:c=Vr,minVersion:l=Hr,boostLevel:u,title:d,marginSize:f,imageSettings:p}=n,m=Nr(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:h,cells:g,numCells:_,calculatedImageSettings:v}=Xr({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:f,imageSettings:p,size:i}),y=g,b=null;p!=null&&v!=null&&(v.excavation!=null&&(y=qr(g,v.excavation)),b=Z.createElement(`image`,{href:p.src,height:v.h,width:v.w,x:v.x+h,y:v.y+h,preserveAspectRatio:`none`,opacity:v.opacity,crossOrigin:v.crossOrigin}));let x=Kr(y,h);return Z.createElement(`svg`,Mr({height:i,width:i,viewBox:`0 0 ${_} ${_}`,ref:t,role:`img`},m),!!d&&Z.createElement(`title`,null,d),Z.createElement(`path`,{fill:o,d:`M0,0 h${_}v${_}H0z`,shapeRendering:`crispEdges`}),Z.createElement(`path`,{fill:s,d:x,shapeRendering:`crispEdges`}),b)});$r.displayName=`QRCodeSVG`;function ei(e,t){if(!Number.isFinite(t)||t<=0)return e(`pairDeviceReady.singleUse`);let n=Math.ceil(t/1e3);return e(`pairDeviceReady.expiresIn`,{time:`${Math.floor(n/60)}:${(n%60).toString().padStart(2,`0`)}`})}function ti({pairUrl:e,remainingMs:t,expired:n,copied:r,onCopy:i}){let{t:a}=Be(`settings`);return n?(0,Q.jsx)(z,{tone:`warning`,title:a(`pairDeviceReady.expiredTitle`),children:a(`pairDeviceReady.expiredBody`)}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(`div`,{className:`w-fit rounded-lg bg-white p-3`,children:(0,Q.jsx)($r,{value:e,size:192,level:`M`,title:a(`pairDeviceReady.qrTitle`)})}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`code`,{"data-testid":`pair-device-url`,className:`min-w-0 flex-1 truncate rounded-md bg-[var(--surface-active)] px-2.5 py-1.5 text-body-small-default text-[var(--content-secondary)]`,children:e}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,leftIcon:r?(0,Q.jsx)(x,{}):(0,Q.jsx)(_,{}),onClick:()=>i(e),children:a(r?`pairDeviceReady.copiedButton`:`pairDeviceReady.copyButton`)})]}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:ei(a,t)})]})}var ni=5e3;function ri({pollWhilePairing:e=!1,revalidateKey:t}={}){let[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(null),u=(0,Z.useRef)(!0),d=(0,Z.useRef)(0);(0,Z.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]);let f=(0,Z.useCallback)((e=Ne()?.assistantId)=>{if(!e)return;r(t=>t&&t.assistantId!==e?null:t);let t=++d.current;Ee(e).then(n=>{!u.current||t!==d.current||r(n.ok?{assistantId:e,devices:n.devices}:null)})},[]),p=Re.use.selectedAssistantId()??Ne()?.assistantId;(0,Z.useEffect)(()=>{a(null),l(null),f(p)},[p,f]);let m=(0,Z.useRef)(t);(0,Z.useEffect)(()=>{t!==m.current&&(m.current=t,f(p))},[t,p,f]);let h=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{if(e&&!o){h.current=!0;let e=setInterval(()=>f(),ni);return()=>clearInterval(e)}!e&&h.current&&(h.current=!1,f())},[e,o,f]);let g=(0,Z.useCallback)(e=>{l(null),a(e)},[]),_=(0,Z.useCallback)(()=>{a(null),l(null)},[]),v=(0,Z.useCallback)(()=>{!n||!i||o||(s(!0),l(null),Se(n.assistantId,i.hashedDeviceId).then(e=>{u.current&&(s(!1),e.ok?(a(null),f()):l(e.error))}))},[n,i,o,f]);return{devices:n?.devices??null,confirmTarget:i,isRevoking:o,revokeError:c,requestRevoke:g,cancelRevoke:_,confirmRevoke:v}}function ii(e){return e.slice(0,12)}function ai(e,t){return t?t.charAt(0).toUpperCase()+t.slice(1):e(`pairedDevicesSection.platformUnknown`)}function oi(e,t){return t===null?e(`pairedDevicesSection.dateUnknown`):new Date(t).toLocaleDateString(ze())}function si({pollWhilePairing:e=!1,revalidateKey:t}={}){let{t:n}=Be(`settings`),r=ri({pollWhilePairing:e,revalidateKey:t}),{devices:i,confirmTarget:a}=r;return i===null||i.length===0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(B.Root,{type:`multiple`,children:(0,Q.jsxs)(B.Item,{value:`paired-devices`,children:[(0,Q.jsxs)(B.Trigger,{className:`group flex w-full items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:n(`pairedDevicesSection.title`,{count:i.length})}),(0,Q.jsx)(S,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(B.Content,{children:(0,Q.jsx)(`div`,{className:`mt-3 flex flex-col gap-3`,children:i.map(e=>(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,Q.jsxs)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:[ai(n,e.platform),` `,(0,Q.jsx)(`span`,{className:`font-mono text-[var(--content-tertiary)]`,title:e.hashedDeviceId,children:ii(e.hashedDeviceId)}),e.isCurrentHost&&(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:` · ${n(`pairedDevicesSection.thisMachine`)}`})]}),(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:n(`pairedDevicesSection.datesLine`,{paired:oi(n,e.issuedAt),lastUsed:oi(n,e.lastUsedAt)})})]}),(0,Q.jsx)(s,{variant:`dangerOutline`,size:`compact`,className:`shrink-0`,disabled:e.isCurrentHost===!0,title:e.isCurrentHost?n(`pairedDevicesSection.hostRevokeDisabledTitle`):void 0,onClick:()=>r.requestRevoke(e),children:n(`pairedDevicesSection.revokeButton`)})]},e.hashedDeviceId))})})]})}),(0,Q.jsx)(ve,{open:a!==null,title:n(`pairedDevicesSection.confirmTitle`),message:a&&(0,Q.jsxs)(Q.Fragment,{children:[n(`pairedDevicesSection.confirmMessage`,{platform:ai(n,a.platform),hash:ii(a.hashedDeviceId)}),r.revokeError&&(0,Q.jsx)(`span`,{className:`mt-2 block text-[var(--system-negative-strong)]`,children:r.revokeError})]}),confirmLabel:n(`pairedDevicesSection.revokeButton`),destructive:!0,isPending:r.isRevoking,onConfirm:r.confirmRevoke,onCancel:r.cancelRevoke})]})}var ci=[{unit:`year`,ms:365*24*60*60*1e3},{unit:`month`,ms:720*60*60*1e3},{unit:`week`,ms:10080*60*1e3},{unit:`day`,ms:1440*60*1e3},{unit:`hour`,ms:3600*1e3},{unit:`minute`,ms:60*1e3},{unit:`second`,ms:1e3}],li=new Map;function ui(e){let t=e??``,n=li.get(t);return n===void 0&&(n=typeof Intl<`u`&&`RelativeTimeFormat`in Intl?new Intl.RelativeTimeFormat(e,{style:`long`,numeric:`auto`}):null,li.set(t,n)),n}function di(e,t={}){let n=ui(t.locale);if(!n)return new Date(e).toLocaleString();let r=e-Date.now(),i=Math.abs(r),a=ci.findIndex(({unit:e})=>e===(t.minimumUnit??`second`));for(let{unit:e,ms:t}of ci.slice(0,a+1))if(i>=t)return n.format(Math.round(r/t),e);return n.format(0,`second`)}var fi=5e3;function pi(e,t){return e.length===t.length&&t.every((t,n)=>e[n]?.requestId===t.requestId)}function mi(e,t){let[n,r]=(0,Z.useState)([]),[i,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)(null),d=(0,Z.useRef)(null),f=(0,Z.useRef)(null),[p,m]=(0,Z.useState)(e);e!==p&&(m(e),r([]),o(null),c(null),u(null)),(0,Z.useEffect)(()=>()=>{f.current?.abort(),f.current=null},[e]),(0,Z.useEffect)(()=>{let t=async()=>{d.current?.abort();let t=new AbortController;d.current=t;try{let n=await Cr({base:e,signal:t.signal});if(t.signal.aborted)return;r(e=>pi(e,n)?e:n),u(e=>e&&!e.sticky&&!n.some(t=>t.requestId===e.requestId)?null:e),c(null)}catch(e){if(t.signal.aborted)return;if(e instanceof mr){c(e.message);return}a(e,{context:`pair-device-pending-requests-poll`}),c(W(`settings:usePendingPairingRequests.pollErrorFallback`))}};t();let n=setInterval(()=>void t(),fi);return()=>{clearInterval(n),d.current?.abort()}},[e]);let h=(0,Z.useCallback)(async(n,i)=>{if(f.current)return;let s=new AbortController;f.current=s,o({requestId:n,action:i}),u(null);let c=()=>{d.current?.abort(),r(e=>e.filter(e=>e.requestId!==n))};try{if(await(i===`approve`?Tr:Er)({base:e,requestId:n,signal:s.signal}),s.signal.aborted)return;c(),i===`approve`&&t?.()}catch(e){if(s.signal.aborted)return;e instanceof mr?i===`deny`&&e.status===409&&e.code===`ALREADY_APPROVED`?(c(),t?.(),u({requestId:n,message:W(`settings:usePendingPairingRequests.denyAlreadyApproved`),sticky:!0})):e.status===404||e.status===410?c():u({requestId:n,message:e.message}):(a(e,{context:`pair-device-pending-request-action`}),u({requestId:n,message:W(`settings:usePendingPairingRequests.actionErrorFallback`)}))}finally{f.current===s&&(f.current=null),s.signal.aborted||o(null)}},[e,t]),g=(0,Z.useCallback)(e=>h(e,`approve`),[h]),_=(0,Z.useCallback)(e=>h(e,`deny`),[h]);return{requests:n,actingOn:i,error:l?.message??s,approve:g,deny:_}}var hi=3e4;function gi(e){return di(new Date(e).getTime(),{locale:ze(),minimumUnit:`minute`})}function _i({base:e,onApproved:t}){let{t:n}=Be(`settings`),{requests:r,actingOn:i,error:a,approve:o,deny:c}=mi(e,t),l=r.length>0,[,u]=(0,Z.useState)(0);return(0,Z.useEffect)(()=>{if(!l)return;let e=setInterval(()=>u(e=>e+1),hi);return()=>clearInterval(e)},[l]),r.length===0&&!a?null:(0,Q.jsxs)(`section`,{className:`flex flex-col gap-3 border-t border-[var(--border-element)] pt-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:n(`pendingPairingRequests.title`)}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`pendingPairingRequests.instruction`)})]}),a&&(0,Q.jsx)(z,{tone:`error`,title:a}),r.length>0&&(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2`,children:r.map(e=>{let t=i!==null&&i.requestId===e.requestId?i.action:null,r=t===`approve`,a=t===`deny`;return(0,Q.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-lg border border-[var(--border-element)] p-3`,children:[(0,Q.jsx)(`code`,{className:`w-fit rounded-md bg-[var(--surface-active)] px-2.5 py-1.5 text-title-medium tracking-wide text-[var(--content-emphasised)]`,children:e.userCode}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e.viaEdgeProxy===!1?n(`pendingPairingRequests.requestedMetaHost`,{when:gi(e.requestedAt)}):n(`pendingPairingRequests.requestedMeta`,{when:gi(e.requestedAt),ip:e.requesterIp})}),e.requesterUserAgent&&(0,Q.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,title:e.requesterUserAgent,children:e.requesterUserAgent})]}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(s,{variant:`primary`,size:`compact`,disabled:i!==null,"aria-busy":r||void 0,leftIcon:r?(0,Q.jsx)(D,{className:`animate-spin`}):void 0,onClick:()=>void o(e.requestId),children:n(`pendingPairingRequests.approveButton`)}),(0,Q.jsx)(s,{variant:`dangerOutline`,size:`compact`,disabled:i!==null,"aria-busy":a||void 0,leftIcon:a?(0,Q.jsx)(D,{className:`animate-spin`}):void 0,onClick:()=>void c(e.requestId),children:n(`pendingPairingRequests.denyButton`)})]})]},e.requestId)})})]})}var vi=`vellum:pair-device:public-base-url`;function yi(e){let n=e?.trim();if(n)return{url:n,source:`tunnel`};let r=t(vi,``).trim();return r?{url:r,source:`stored`}:{url:``,source:`none`}}function bi(e,t){let[r]=(0,Z.useState)(()=>yi(t)),[i,o]=(0,Z.useState)(r.url),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)({kind:`idle`}),[d,f]=(0,Z.useState)(()=>Date.now()),p=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>p.current?.abort(),[]),(0,Z.useEffect)(()=>{if(l.kind!==`ready`)return;f(Date.now());let e=setInterval(()=>f(Date.now()),1e3);return()=>clearInterval(e)},[l]);let m=(0,Z.useCallback)(e=>{o(e),c(null)},[]),h=(0,Z.useCallback)(()=>{if(!e)return;let t=i.trim(),r=ar(t);if(!r.ok){c(sr(r.reason,t));return}c(null),p.current?.abort();let o=new AbortController;p.current=o,u({kind:`minting`}),(async()=>{try{let t=await xr({base:e,publicBaseUrl:r.url,signal:o.signal});if(o.signal.aborted)return;n(vi,r.url),u({kind:`ready`,pairUrl:t.pairUrl,expiresAtMs:Date.parse(t.expiresAt)})}catch(e){if(o.signal.aborted)return;if(e instanceof mr){u({kind:`error`,message:e.message,hint:e.hint});return}a(e,{context:`pair-device-mint`}),u({kind:`error`,message:W(`settings:usePairDevice.mintErrorFallback`)})}})()},[e,i]),g=l.kind===`ready`?Math.max(0,l.expiresAtMs-d):0,_=l.kind===`ready`&&g<=0;return{publicBaseUrl:i,setPublicBaseUrl:m,prefillSource:r.source,inputError:s,phase:l,remainingMs:g,expired:_,generate:h}}function xi(){let{t:e}=Be(`settings`),t=gr(),n=$n(),r=q.use.webRemoteIngress(),i=q.use.pairedDevicesUI(),a=bi(t?.base??null,t?.ingressUrl??null),[o,c]=(0,Z.useState)(0),{copy:l,copied:u}=sn({errorMessage:e(`pairDeviceCard.copyError`)});if(!t||!n||!r)return null;let{phase:d}=a,f=d.kind===`minting`,p=d.kind===`ready`,m=a.prefillSource===`tunnel`,h=a.prefillSource===`none`&&a.publicBaseUrl.trim()===``,g=e(f?`pairDeviceCard.generateButtonMinting`:p?`pairDeviceCard.generateButtonRegenerate`:`pairDeviceCard.generateButton`);return(0,Q.jsx)(X,{title:e(`pairDeviceCard.title`),subtitle:e(`pairDeviceCard.subtitle`,{name:t.assistantName??e(`pairDeviceCard.subtitleFallbackName`)}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[h&&(0,Q.jsx)(z,{tone:`info`,title:e(`pairDeviceCard.noTunnelTitle`),children:e(`pairDeviceCard.noTunnelBody`)}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(V,{label:e(`pairDeviceCard.publicUrlLabel`),fullWidth:!0,placeholder:e(`pairDeviceCard.publicUrlPlaceholder`),helperText:e(m?`pairDeviceCard.publicUrlHelperTunnel`:`pairDeviceCard.publicUrlHelper`),value:a.publicBaseUrl,errorText:a.inputError??void 0,disabled:f,onChange:e=>a.setPublicBaseUrl(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),a.generate())}}),(0,Q.jsx)(s,{variant:`primary`,className:`self-start`,disabled:f||a.publicBaseUrl.trim()===``,onClick:a.generate,children:g})]}),d.kind===`error`&&(0,Q.jsx)(z,{tone:`error`,title:d.message,children:d.hint}),p&&(0,Q.jsx)(ti,{pairUrl:d.pairUrl,remainingMs:a.remainingMs,expired:a.expired,copied:u,onCopy:l}),(0,Q.jsx)(_i,{base:t.base,onApproved:()=>c(e=>e+1)}),i&&(0,Q.jsx)(si,{pollWhilePairing:p&&!a.expired,revalidateKey:o})]})})}var Si=[{scope:`global`,title:`Global shortcuts`,description:`Work anywhere, even when Vellum is in the background.`},{scope:`menu`,title:`App shortcuts`,description:`Work while a Vellum window is focused.`}];function Ci({hotkey:e,recording:t,conflictLabel:n,alternateBinding:r,onStartRecording:i,onCancelRecording:a,onReset:o,onRemove:c}){let l=e.accelerator===``,u=e.override!==null;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e.label}),n!==null&&(0,Q.jsxs)(`div`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:[`Already used by `,n]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[r,t?(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Recording… press a shortcut, or Esc to cancel`}):l?(0,Q.jsx)(`span`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`None`}):(0,Q.jsx)(he,{accelerator:e.accelerator}),t?(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:a,children:`Cancel`}):(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:i,"aria-label":`Record shortcut for ${e.label}`,children:`Record`}),(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,disabled:!u,leftIcon:(0,Q.jsx)(ae,{className:`h-3.5 w-3.5`}),onClick:o,"aria-label":`Reset ${e.label} to default`}),(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,disabled:l,leftIcon:(0,Q.jsx)(ue,{className:`h-3.5 w-3.5`}),onClick:c,"aria-label":`Remove ${e.label} binding`})]})]})}function wi(){let{catalog:e,recordingKey:t,conflict:n,startRecording:r,stopRecording:i,resetHotkey:a,removeHotkey:o}=yn(),s=(0,Z.useMemo)(()=>Si.map(t=>({...t,commands:e.filter(e=>e.rebindable&&e.scope===t.scope)})).filter(e=>e.commands.length>0),[e]);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[n!==null&&(0,Q.jsxs)(z,{tone:`warning`,children:[`That shortcut is already used by `,n.label,`.`,` `,t===null?`Remove or change that binding before resetting.`:`Pick a different combination, or press Esc to cancel.`]}),s.map(e=>(0,Q.jsxs)(g,{bordered:!0,children:[(0,Q.jsxs)(`div`,{className:`mb-2`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-emphasised text-[var(--content-default)]`,children:e.title}),(0,Q.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,Q.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:e.commands.map(e=>(0,Q.jsx)(Ci,{hotkey:e,recording:t===e.key,conflictLabel:n!==null&&n.key===e.key?n.label:null,onStartRecording:()=>r(e.key),onCancelRecording:i,onReset:()=>a(e.key),onRemove:()=>o(e.key)},e.key))})]},e.scope))]})}async function Ti(){if(!Le())return!1;let e=window.vellum;return e?.launchAtLogin?e.launchAtLogin.get():!1}async function Ei(e){if(!Le())return;let t=window.vellum;t?.launchAtLogin&&await t.launchAtLogin.set(e)}function Di(){let e=L.useValue(),t=I.useValue(),n=!Jt(),r=_t()?`Cmd`:`Ctrl`;return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Composer`}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-4`,children:[n&&(0,Q.jsx)(_e,{checked:e,onChange:L.save,label:`Send with ${r}+Enter`,helperText:`When enabled, Enter inserts a new line and ${r}+Enter sends.`}),(0,Q.jsx)(_e,{checked:t,onChange:I.save,label:`Show context window usage`,helperText:`Adds a ring to the composer tracking how full the context window is. Your assistant compacts its context automatically either way.`})]})]})}function Oi(){let[e,t]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{Ti().then(t)},[]);let n=async e=>{t(e);try{await Ei(e)}catch{t(!e)}};return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Launch at Login`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Automatically start Vellum when you log in to your Mac.`}),(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(_e,{checked:e,onChange:e=>void n(e),"aria-label":`Launch at Login`})})]})}function ki({open:e,onClose:t}){return(0,Q.jsx)(H.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,Q.jsxs)(H.Content,{size:`lg`,children:[(0,Q.jsxs)(H.Header,{children:[(0,Q.jsx)(H.Title,{children:`Preferences`}),(0,Q.jsx)(H.Description,{children:`Customize shortcuts and how Vellum behaves on this device.`})]}),(0,Q.jsx)(H.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[Le()&&(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Keyboard Shortcuts`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Customize the shortcuts for Vellum's commands.`}),(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(wi,{})})]}),(0,Q.jsx)(Di,{}),Le()&&(0,Q.jsx)(Oi,{})]})})]})})}function Ai(e){return e===`preview`?`preview`:`stable`}function ji(e){if(!e)return`Unknown`;let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown`:t.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Mi(e){return e.source_release_version?`Stable ${e.source_release_version}`:e.snapshot_name}function Ni(e){return e.filter(e=>e.ready_to_use)}function Pi(e){return e?.feature_enabled===!1}function Fi({assistantId:e,onComplete:t}){let n=q.use.previewChannel(),r=d(),[i,a]=(0,Z.useState)(),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[u,m]=(0,Z.useState)(`restore_backup`),[h,g]=(0,Z.useState)(``),_=Et({path:{assistant_id:e}}),v=Tt({path:{assistant_id:e}}),y=Vt({path:{id:e}}),{data:b,isLoading:x,isError:C}=f({..._,enabled:n,retry:!1}),w=b?.preview_backups??[],T=(0,Z.useMemo)(()=>Ni(w),[w]),E=T[0],O=T.find(e=>e.snapshot_name===h)??E,k=()=>{r.invalidateQueries({queryKey:v}),r.invalidateQueries({queryKey:y}),t?.()},A=p(Gt()),j=p(It()),M=Ai(b?.current_channel),N=A.isPending||j.isPending,P=N||Pi(b)||!b?.latest_preview_release,F=u===`restore_backup`&&!O;if((0,Z.useEffect)(()=>{a(M===`preview`?`release-channel`:void 0)},[M]),!n)return null;let ee=b?.standard_upgrade_available??!1;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(B.Root,{type:`single`,collapsible:!0,value:i,onValueChange:e=>a(e||void 0),className:`mt-5 border-t border-[var(--border-base)] pt-5`,children:(0,Q.jsxs)(B.Item,{value:`release-channel`,id:`preview-release-channel`,children:[(0,Q.jsxs)(B.Trigger,{className:`group justify-between gap-3`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:`Release Channel`}),b&&(0,Q.jsx)(ge,{tone:M===`preview`?`warning`:`neutral`,children:M===`preview`?`Preview`:`Stable`})]}),(0,Q.jsx)(S,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(B.Content,{children:(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[x&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin`}),`Loading release channel...`]}),C&&(0,Q.jsx)(z,{tone:`error`,title:`Could not load release channel status`,children:`Refresh this page before changing release channels.`}),b&&(0,Q.jsxs)(Q.Fragment,{children:[Pi(b)&&(0,Q.jsx)(z,{tone:`neutral`,title:`Preview channel is unavailable`,children:`The Preview channel is not enabled for this assistant.`}),M===`stable`?(0,Q.jsx)(Ii,{status:b,isChangingChannel:N,optInDisabled:P,onOptIn:()=>s(!0)}):(0,Q.jsx)(Li,{status:b,isChangingChannel:N,onOptOut:()=>{let e=E;g(e?.snapshot_name??``),m(e?`restore_backup`:ee?`standard_upgrade`:`restore_backup`),l(!0)}})]})]})})]})}),(0,Q.jsx)(zi,{open:o,isPending:A.isPending,previewVersion:b?.latest_preview_release?.version,onConfirm:async()=>{try{let t=await A.mutateAsync({path:{assistant_id:e}});U.success(t.detail||`Preview channel enabled.`),s(!1),k()}catch(e){U.error(G(e,void 0,`Could not enable Preview channel.`))}},onCancel:()=>s(!1)}),(0,Q.jsx)(Bi,{open:c,backups:T,mode:u,selectedSnapshotName:O?.snapshot_name??``,isPending:j.isPending,restoreModeDisabled:F,standardUpgradeAvailable:ee,onModeChange:m,onSnapshotChange:g,onConfirm:async()=>{if(!F)try{let t=await j.mutateAsync({path:{assistant_id:e},body:u===`restore_backup`?{mode:`restore_backup`,snapshot_name:O?.snapshot_name}:{mode:`standard_upgrade`}});U.success(t.detail||`Stable channel enabled.`),l(!1),k()}catch(e){U.error(G(e,void 0,`Could not switch to Stable.`))}},onCancel:()=>l(!1)})]})}function Ii({status:e,isChangingChannel:t,optInDisabled:n,onOptIn:r}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(Ri,{status:e}),!e.latest_preview_release&&(0,Q.jsx)(z,{tone:`neutral`,title:`No Preview release is available`,children:`Stable remains the only available release channel.`}),(0,Q.jsx)(s,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(j,{}),disabled:n,onClick:r,children:`Opt in to Preview`})]})}function Li({status:e,isChangingChannel:t,onOptOut:n}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(Ri,{status:e}),(0,Q.jsx)(s,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(ae,{}),disabled:t,onClick:n,children:`Switch back to Stable`})]})}function Ri({status:e}){return(0,Q.jsxs)(`dl`,{className:`grid gap-3 text-body-medium-lighter sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:`Latest Stable`}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_stable_release?.version??`None`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:`Latest Preview`}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_preview_release?.version??`None`})]})]})}function zi({open:e,isPending:t,previewVersion:n,onConfirm:r,onCancel:i}){return(0,Q.jsx)(H.Root,{open:e,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(H.Content,{size:`md`,hideCloseButton:t,children:[(0,Q.jsxs)(H.Header,{icon:le,children:[(0,Q.jsx)(H.Title,{children:`Opt in to Preview`}),(0,Q.jsx)(H.Description,{children:`Preview releases may be unstable. A 90-day safety backup is taken before the image changes.`})]}),(0,Q.jsx)(H.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(z,{tone:`warning`,title:`Data loss may occur when returning to Stable`,children:`Preview data may not be compatible with the Stable channel. The safety backup lets you restore the Stable-channel data that existed before opt-in.`}),(0,Q.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,Q.jsx)(`li`,{children:`Create and verify a Preview safety backup.`}),(0,Q.jsxs)(`li`,{children:[`Switch to Preview image `,n??`latest`,`.`]}),(0,Q.jsx)(`li`,{children:`Run the normal upgrade path and wait for health.`})]})]})}),(0,Q.jsxs)(H.Footer,{children:[(0,Q.jsx)(s,{variant:`outlined`,disabled:t,onClick:i,children:`Cancel`}),(0,Q.jsx)(s,{variant:`primary`,disabled:t,leftIcon:t?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(j,{}),onClick:r,children:t?`Switching...`:`Take Backup and Switch`})]})]})})}function Bi({open:e,backups:t,mode:n,selectedSnapshotName:r,isPending:i,restoreModeDisabled:a,standardUpgradeAvailable:o,onModeChange:c,onSnapshotChange:l,onConfirm:u,onCancel:d}){return(0,Q.jsx)(H.Root,{open:e,onOpenChange:e=>!e&&d(),children:(0,Q.jsxs)(H.Content,{size:`md`,hideCloseButton:i,children:[(0,Q.jsxs)(H.Header,{icon:le,children:[(0,Q.jsx)(H.Title,{children:`Switch back to Stable`}),(0,Q.jsx)(H.Description,{children:`Choose how this assistant should leave the Preview channel.`})]}),(0,Q.jsx)(H.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(pe,{value:n,onValueChange:c,disabled:i,"aria-label":`Stable channel return method`,children:[(0,Q.jsx)(fe,{value:`restore_backup`,disabled:t.length===0,label:`Restore safety backup`,helperText:`Return to the Stable-channel data captured before Preview opt-in.`}),(0,Q.jsx)(fe,{value:`standard_upgrade`,disabled:!o,label:`Switch to Stable without restoring backup`,helperText:o?`Keep the current data and directly switch to the Stable image.`:`Unavailable because the latest Stable release is older than this assistant's Preview release.`})]}),n===`restore_backup`&&t.length>0&&(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-medium-default text-[var(--content-secondary)]`,children:[`Safety backup`,(0,Q.jsx)(ye,{value:r,onChange:l,disabled:i,options:t.map(e=>({value:e.snapshot_name,label:`${Mi(e)} - ${ji(e.created_at)}`}))})]}),n===`restore_backup`&&t.length===0&&!o&&(0,Q.jsx)(z,{tone:`error`,title:`Stable requires a safety backup`,children:`This Preview release is newer than the latest Stable release, so switching directly is blocked. Wait for a newer Stable release, or run Vellum Doctor if the safety backup is missing.`}),n===`standard_upgrade`&&(0,Q.jsx)(z,{tone:`error`,title:`Preview data may not survive this`,children:`Switching directly to the Stable image without restoring the safety backup may cause data loss or leave the assistant unusable if Preview data is incompatible with Stable.`})]})}),(0,Q.jsxs)(H.Footer,{children:[(0,Q.jsx)(s,{variant:`outlined`,disabled:i,onClick:d,children:`Cancel`}),(0,Q.jsx)(s,{variant:n===`standard_upgrade`?`danger`:`primary`,disabled:i||a||n===`standard_upgrade`&&!o,leftIcon:i?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(ie,{}),onClick:u,children:i?`Switching...`:`Switch to Stable`})]})]})})}var Vi=new Set([`exceeds_machine_tier`,`exceeds_storage_tier`]);function Hi(e,t){return e&&typeof e==`object`&&!Array.isArray(e)&&`error`in e&&typeof e.error==`string`&&Vi.has(e.error)?`That size isn't available on your plan.`:G(e,void 0,t)}function Ui({assistant:e,healthz:t,healthzLoading:n,healthzPolling:r,refetch:i,refetchUntilResized:a}){let o=c(),l=vt(),d=f(zt()),p=d.data,m=!e.is_local,h=p?.plan_id===`pro`,g=f({...Ut(),enabled:h}),_=e.machine_size||`small`,v=ln(g.data?.max_machine_tier??null),y=(0,Z.useMemo)(()=>fn(v,_,(0,Q.jsx)(ge,{tone:`positive`,children:`Current`})),[v,_]),b=g.data?.selected_storage_gib??null,[x,S]=(0,Z.useState)(!1),C=v.length>0?v[v.length-1]:null,[w,E]=(0,Z.useState)(null),O=w??C??_,[k,A]=(0,Z.useState)(!1),[j,M]=(0,Z.useState)(null),N=Ht({onSuccess:(e,n)=>{U.success(`Resize started. Changes will apply shortly.`,{id:`assistant-resize`}),M(null),E(null),S(!1),n.body?.machine_size==null?i():a(t)},onError:e=>{M(Hi(e,`Failed to resize assistant. Please try again.`))}});if(d.isError&&p==null)return(0,Q.jsx)(X,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,children:(0,Q.jsx)(z,{tone:`error`,children:`Could not load your subscription. Please try again.`})});let P=h&&v.includes(O)&&O!==_?O:null,F=h&&b!=null&&!0,ee=h&&v.length>0&&dn(_)<dn(v[v.length-1]),I=N.isPending||r,te=b==null?t?.disk?.totalMb??null:b*1024,L=t?.disk&&te!=null?{value:t.disk.usedMb,max:te,caption:`${vn(t.disk.usedMb)} of ${vn(te)}`}:null,ne=t?.cpu?{value:t.cpu.currentPercent,max:100,caption:`${t.cpu.currentPercent.toFixed(1)}%`}:null,R=t?.memory?{value:t.memory.currentMb,max:t.memory.maxMb,caption:`${vn(t.memory.currentMb)} of ${vn(t.memory.maxMb)}`}:null,re=l?null:(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:()=>A(!0),children:`Resize`}),ae=m?h?F?(0,Q.jsxs)(`button`,{type:`button`,disabled:I,onClick:()=>S(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(se,{className:`h-3.5 w-3.5`}),`Increase Storage`]}):(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,disabled:I,onClick:()=>S(!0),children:`Resize`}):re:null,oe=m?h?ee?(0,Q.jsxs)(`button`,{type:`button`,disabled:I,onClick:()=>S(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(se,{className:`h-3.5 w-3.5`}),`Increase Size`]}):(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,disabled:I,onClick:()=>S(!0),children:`Resize`}):re:null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,compactAccessory:!0,accessory:(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:n||r?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(ie,{}),tooltip:r?`Applying resize…`:`Refresh resource metrics`,"aria-label":`Refresh resource metrics`,disabled:n||r,onClick:()=>void i()}),children:(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-[1fr_2fr]`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(T,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Disk`})]}),ae]}),(0,Q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-1 pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Storage`}),L?(0,Q.jsx)(mn,{value:L.value,max:L.max,caption:L.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(D,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Unavailable`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(Sn,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Machine`}),(0,Q.jsx)(ge,{tone:`neutral`,children:un[_]})]}),oe]}),(0,Q.jsxs)(`div`,{className:`mt-auto grid grid-cols-2 gap-3 pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`CPU`}),ne?(0,Q.jsx)(mn,{value:ne.value,max:ne.max,caption:ne.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(D,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Memory`}),R?(0,Q.jsx)(mn,{value:R.value,max:R.max,caption:R.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(D,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]})]})]})]})}),(0,Q.jsx)(H.Root,{open:k,onOpenChange:e=>{e||A(!1)},children:(0,Q.jsxs)(H.Content,{size:`sm`,children:[(0,Q.jsxs)(H.Header,{children:[(0,Q.jsx)(H.Title,{children:`Upgrade your plan`}),(0,Q.jsx)(H.Description,{children:`Move to a higher plan for more power, more storage, and a larger credit bundle.`})]}),(0,Q.jsxs)(H.Footer,{children:[(0,Q.jsx)(s,{variant:`ghost`,onClick:()=>A(!1),children:`Cancel`}),(0,Q.jsx)(s,{onClick:()=>{A(!1),o(J.plans)},children:`Upgrade`})]})]})}),(0,Q.jsx)(H.Root,{open:x,onOpenChange:e=>{e||(S(!1),E(null),M(null))},children:(0,Q.jsxs)(H.Content,{size:`sm`,children:[(0,Q.jsxs)(H.Header,{icon:Sn,children:[(0,Q.jsx)(H.Title,{children:`Resize Assistant`}),(0,Q.jsx)(H.Description,{children:`Resize your assistant's compute and storage. Your assistant will briefly restart.`})]}),(0,Q.jsx)(H.Body,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[v.length===0?(0,Q.jsx)(z,{tone:`warning`,children:`No machine tier configured. Visit the community for help.`}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-secondary)]`,children:`Machine Size`}),(0,Q.jsx)(ye,{options:y,value:O,onChange:E,"aria-label":`Compute machine size`,"data-testid":`resize-machine-size`})]}),F?(0,Q.jsx)(z,{tone:`info`,children:`Storage will be expanded to ${b} GB.`}):(0,Q.jsx)(z,{tone:`neutral`,children:`Storage will not change.`}),j&&(0,Q.jsx)(z,{tone:`error`,children:j})]})}),(0,Q.jsxs)(H.Footer,{className:l?`justify-end`:`items-center justify-between`,children:[l?null:(0,Q.jsxs)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:[`Need more?`,` `,(0,Q.jsx)(u,{to:J.plans,className:`text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 transition-colors hover:text-[var(--content-default)]`,onClick:()=>S(!1),children:`Upgrade plan`})]}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(s,{variant:`ghost`,onClick:()=>{S(!1),E(null),M(null)},children:`Cancel`}),(0,Q.jsx)(s,{disabled:P==null&&!F||I,leftIcon:I?(0,Q.jsx)(D,{className:`animate-spin`}):void 0,onClick:()=>{M(null);let t={};P!=null&&(t.machine_size=P),F&&b!=null&&(t.storage_gib=b),N.mutate({path:{id:e.id},body:t})},children:j?`Retry`:`Apply`})]})]})]})})]})}function Wi({assistantId:e}){let t=c(),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(!1);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(s,{variant:`dangerOutline`,onClick:()=>r(!0),className:`shrink-0`,children:`Retire Assistant`}),(0,Q.jsx)(Xt,{open:n,isPending:i,onConfirm:async()=>{a(!0);let n=await Yt(e);if(n.ok){r(!1),t(n.nextRoute,{replace:!0});return}U.error(n.error),a(!1),r(!1)},onCancel:()=>r(!1)})]})}function Gi(){let e=R(),t=re.useValue();return A(e)?(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Show tips`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Occasional tips in the sidebar that highlight features you haven't tried yet.`})]}),(0,Q.jsx)(_e,{checked:t,onChange:t=>{re.save(t),t||N(`settings`,`dont_show_again`,e)},"aria-label":`Show tips`})]}):null}var Ki=`UTC.Africa/Cairo.Africa/Johannesburg.Africa/Lagos.Africa/Nairobi.America/Anchorage.America/Argentina/Buenos_Aires.America/Bogota.America/Chicago.America/Denver.America/Halifax.America/Lima.America/Los_Angeles.America/Mexico_City.America/New_York.America/Phoenix.America/Santiago.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Jerusalem.Asia/Karachi.Asia/Kolkata.Asia/Kuala_Lumpur.Asia/Manila.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Athens.Europe/Berlin.Europe/Brussels.Europe/Dublin.Europe/Istanbul.Europe/Lisbon.Europe/London.Europe/Madrid.Europe/Moscow.Europe/Paris.Europe/Rome.Europe/Stockholm.Europe/Vienna.Europe/Warsaw.Europe/Zurich.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function qi(){let e=Intl;if(typeof e.supportedValuesOf==`function`)try{let t=e.supportedValuesOf(`timeZone`);if(t.length>0)return[...t].sort()}catch{}return[...Ki].sort()}function Ji(e){let t=e.split(`/`),n=(t[t.length-1]??e).replace(/_/g,` `),r=t.length>1?(t[0]??``).replace(/_/g,` `):``,i=0,a=``;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`shortOffset`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??`GMT`;a=t.startsWith(`GMT`)||t.startsWith(`UTC`)?t:`GMT ${t}`;let n=t.match(/([+-])(\d{1,2})(?::(\d{2}))?/);if(n){let e=n[1]===`-`?-1:1,t=parseInt(n[2]??`0`,10),r=parseInt(n[3]??`0`,10);i=e*(t*60+r)}}catch{return null}return{identifier:e,city:n,region:r,offsetLabel:a,offsetMinutes:i}}function Yi(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`2-digit`,hour12:!0}).format(new Date)}catch{return``}}function Xi(e){if(!e)return`Not set`;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`long`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;if(t)return t}catch{}return e.replace(/_/g,` `)}var Zi=200;function Qi({value:e,onChange:t}){let[n,r]=(0,Z.useState)(``),i=(0,Z.useMemo)(()=>qi().map(e=>Ji(e)).filter(e=>e!==null),[]),a=n.trim().toLowerCase(),o=(0,Z.useMemo)(()=>(a?i.filter(e=>e.city.toLowerCase().includes(a)||e.region.toLowerCase().includes(a)||e.offsetLabel.toLowerCase().includes(a)||e.identifier.toLowerCase().includes(a)):i).slice(0,Zi),[i,a]),s=(0,Z.useMemo)(()=>o.map(e=>e.identifier),[o]),c=(0,Z.useMemo)(()=>{if(!e)return``;let t=e.split(`/`);return(t[t.length-1]??e).replace(/_/g,` `)},[e]);return(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 md:flex-row md:items-center md:justify-between md:gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Closest city`}),(0,Q.jsxs)(me.Root,{className:`w-full md:max-w-[280px]`,options:s,value:e,onSelect:t,onOpenChange:e=>{e||r(``)},autoActivateFirst:a.length>0,children:[(0,Q.jsx)(me.Input,{type:`text`,"aria-label":`Closest city`,value:n,placeholder:c||`Search city or country...`,onChange:e=>r(e.target.value),fullWidth:!0}),(0,Q.jsx)(me.List,{"aria-label":`Cities`,className:`absolute left-0 right-0 top-full z-20 mt-1 max-h-[240px] rounded-md border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-lg`,emptyState:(0,Q.jsx)(`p`,{className:`px-3 py-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No matching cities`}),children:o.map(e=>(0,Q.jsxs)(me.Option,{value:e.identifier,className:h(`flex w-full items-center justify-between gap-3 px-3 py-2`,`text-body-medium-lighter text-[var(--content-default)] transition-colors`,`hover:bg-[var(--surface-active)]`,`data-[active]:bg-[var(--surface-active)] aria-selected:bg-[var(--surface-active)]`),children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-default`,children:e.city}),e.region&&(0,Q.jsx)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.region})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(`span`,{children:Yi(e.identifier)}),(0,Q.jsx)(`span`,{children:e.offsetLabel})]})]},e.identifier))})]})]}),(0,Q.jsx)(bn,{}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Time zone`}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:Xi(e)})]})]})}function $i(){let e=Re.use.activeAssistantId(),[t,n]=(0,Z.useState)(()=>i(`timezone`,``)),o=(0,Z.useRef)(e);(0,Z.useEffect)(()=>{o.current=e},[e]);let s=(0,Z.useRef)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(()=>{}),u=e=>{if(s.current){c.current=e;return}let t=o.current;if(!t){c.current=null;return}s.current=!0,c.current=null,K.patch({url:`/v1/assistants/{assistant_id}/config`,path:{assistant_id:t},body:{ui:{userTimezone:e}},throwOnError:!0}).catch(e=>{a(e,{context:`settings-timezone-override`})}).finally(()=>{s.current=!1;let e=c.current;c.current=null,e!==null&&l.current(e)})};return(0,Z.useEffect)(()=>{l.current=u}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Timezone`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Used when displaying times and scheduling reminders.`}),(0,Q.jsx)(`div`,{className:`mt-1`,children:(0,Q.jsx)(Qi,{value:t,onChange:e=>{n(e),r(`timezone`,e),u(e)}})})]})}var ea=[[`Mon`,0],[`Tue`,1],[`Wed`,2],[`Thu`,3],[`Fri`,4],[`Sat`,5],[`Sun`,6]];function ta(e){let[t,n]=e.split(`:`).map(Number),r=new Date,i=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),t,n));return`${i.getHours().toString().padStart(2,`0`)}:${i.getMinutes().toString().padStart(2,`0`)}`}function na(e){let[t,n]=e.split(`:`).map(Number),r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate(),t,n);return`${i.getUTCHours().toString().padStart(2,`0`)}:${i.getUTCMinutes().toString().padStart(2,`0`)}`}function ra(){return Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??``}function ia(e){let t=e?.schedule?.window.start??`06:00`,n=e?.schedule?.window.end??`08:00`;return{enabled:e?.enabled??!0,timezone:`UTC`,frequency:e?.schedule?.frequency??`weekly`,daysOfWeek:e?.schedule?.days_of_week??[0],daysOfMonth:e?.schedule?.days_of_month??[],windowStart:ta(t),windowEnd:ta(n)}}function aa({assistantId:e}){let t=d(),{data:n,isLoading:r,isError:i}=f(At({path:{id:e}})),a=(0,Z.useMemo)(()=>ia(n),[n]),[o,c]=(0,Z.useState)(null),l=o??a,u=o!==null,m=(0,Z.useMemo)(()=>ra(),[]),[h,g]=(0,Z.useState)(null),_=h??l.daysOfMonth.join(`, `),y=p({mutationFn:async t=>{let{data:n}=await it({path:{id:e},body:t,throwOnError:!0});return n}}),b=e=>{c(t=>({...t??a,...e}))},x=e=>{b({daysOfWeek:l.daysOfWeek.includes(e)?l.daysOfWeek.filter(t=>t!==e):[...l.daysOfWeek,e].sort((e,t)=>e-t)})},S=e=>e.split(`,`).map(e=>parseInt(e.trim(),10)).filter(e=>!isNaN(e)&&e>=1&&e<=31);return r?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin`}),`Loading update window settings...`]}):i?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:`Failed to load update window policy. Refresh the page to try again.`}):(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsx)(_e,{checked:l.enabled,onChange:e=>b({enabled:e}),label:`Automatic updates`,helperText:`Update automatically during a configured time window`}),l.enabled&&(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:`Frequency`}),(0,Q.jsx)(`div`,{className:`max-w-[400px]`,children:(0,Q.jsx)(v,{ariaLabel:`Frequency`,value:l.frequency,onChange:e=>{e!==`monthly`&&g(null),b({frequency:e})},items:[{value:`daily`,label:`Daily`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`}]})})]}),l.frequency===`weekly`&&(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:`Day(s) of week`}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:ea.map(([e,t])=>(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,active:l.daysOfWeek.includes(t),onClick:()=>x(t),children:e},t))})]}),l.frequency===`monthly`&&(0,Q.jsx)(V,{label:`Day(s) of month`,type:`text`,value:_,onChange:e=>g(e.target.value),onBlur:e=>{let t=S(e.target.value);b({daysOfMonth:t}),g(t.join(`, `))},placeholder:`e.g. 1, 15`,helperText:`Comma-separated day numbers (1–31)`,className:`w-48`}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:[`Update window`,m?` (${m})`:``]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(V,{type:`time`,value:l.windowStart,onChange:e=>b({windowStart:e.target.value})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`to`}),(0,Q.jsx)(V,{type:`time`,value:l.windowEnd,onChange:e=>b({windowEnd:e.target.value})})]})]})]}),(0,Q.jsx)(s,{variant:`primary`,leftIcon:y.isPending?(0,Q.jsx)(D,{className:`animate-spin`}):void 0,onClick:async()=>{let n=l.frequency===`monthly`&&h!==null?S(h):l.daysOfMonth;try{await y.mutateAsync({enabled:l.enabled,timezone:`UTC`,schedule:{frequency:l.frequency,days_of_week:l.frequency===`weekly`?l.daysOfWeek:[],days_of_month:l.frequency===`monthly`?n:[],window:{start:na(l.windowStart),end:na(l.windowEnd)}}}),U.success(`Auto-update policy saved.`),c(null),g(null),t.invalidateQueries({queryKey:Nt({path:{id:e}})})}catch{U.error(`Failed to save policy. Please try again.`)}},disabled:y.isPending||!u,children:`Save policy`})]})}function oa({assistantId:e,open:t,onClose:n}){return(0,Q.jsx)(H.Root,{open:t,onOpenChange:e=>{e||n()},children:(0,Q.jsxs)(H.Content,{size:`md`,children:[(0,Q.jsxs)(H.Header,{children:[(0,Q.jsx)(H.Title,{children:`Update Window`}),(0,Q.jsx)(H.Description,{children:`Configure when automatic updates are applied.`})]}),(0,Q.jsx)(H.Body,{children:(0,Q.jsx)(aa,{assistantId:e})})]})})}function sa(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`)return t}}function ca({open:e,onOpenChange:t}){let n=d(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(null),u=(0,Z.useRef)(!1),f=(0,Z.useRef)(e),p=()=>n.invalidateQueries({queryKey:Ft()}),m=e=>{ot({path:{id:e}}).catch(()=>void 0).finally(()=>void p())},h=Pt({onSuccess:e=>{if(!f.current){m(e.factor_id);return}i(e)},onError:e=>{let n=sa(e);n===`no_workos_account`?U.error(`Two-factor authentication is only available for Vellum platform accounts.`):n===`throttled`||n===`workos_rate_limited`?U.error(`Too many attempts. Try again in a minute.`):n===`factor_limit_reached`?U.error(`An authenticator app is already set up. Remove it before adding another.`):U.error(`Failed to start setup. Please try again.`),t(!1)}}),g=Ot({onSuccess:e=>{e.valid?(u.current=!0,U.success(`Two-factor authentication is on.`),p(),t(!1)):l(`That code didn't match. Check your authenticator app and try again.`)},onError:e=>{let n=sa(e);if(n===`challenge_already_verified`){u.current=!0,U.success(`Two-factor authentication is on.`),p(),t(!1);return}if(n===`challenge_expired`||n===`challenge_not_found`){r&&m(r.factor_id),i(null),o(``),l(`This setup session expired. Scan the new QR code and try again.`),h.mutate({});return}if(n===`throttled`||n===`workos_rate_limited`){l(`Too many attempts. Wait a minute and try again.`);return}l(`Couldn't verify the code. Wait a moment and try again.`)}});(0,Z.useEffect)(()=>{f.current=e,e&&(u.current=!1,i(null),o(``),l(null),h.mutate({}))},[e]);let v=e=>{!e&&g.isPending||(!e&&r&&!u.current&&m(r.factor_id),t(e))},y=()=>{r&&tn(r.secret,{successMessage:`Setup key copied.`,errorMessage:`Couldn't copy the setup key.`})},b=()=>{!r||a.length!==6||g.isPending||(l(null),g.mutate({body:{challenge_id:r.challenge_id,code:a}}))};return(0,Q.jsx)(H.Root,{open:e,onOpenChange:v,children:(0,Q.jsxs)(H.Content,{size:`sm`,children:[(0,Q.jsxs)(H.Header,{children:[(0,Q.jsx)(H.Title,{children:`Set up authenticator app`}),(0,Q.jsx)(H.Description,{children:`Scan the QR code with an authenticator app such as Google Authenticator or 1Password, then enter the 6-digit code it shows.`})]}),(0,Q.jsx)(H.Body,{children:r===null?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,Q.jsx)(D,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,Q.jsxs)(`form`,{className:`flex flex-col items-center gap-4`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,Q.jsx)(`img`,{src:r.qr_code,alt:`QR code for your authenticator app`,className:`h-44 w-44 rounded-lg bg-white p-2`}),(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Can't scan it? Enter this setup key manually:`}),(0,Q.jsxs)(`button`,{type:`button`,onClick:y,className:`flex cursor-pointer items-center gap-2 self-start font-mono text-body-small-default text-[var(--content-default)] hover:text-[var(--content-emphasised)]`,children:[(0,Q.jsx)(`span`,{className:`break-all text-left`,children:r.secret}),(0,Q.jsx)(_,{className:`h-3.5 w-3.5 shrink-0`})]})]}),(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,Q.jsx)(`label`,{htmlFor:`totp-code`,className:`text-body-small-default text-[var(--content-tertiary)]`,children:`6-digit code`}),(0,Q.jsx)(V,{id:`totp-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,placeholder:`123456`,value:a,onChange:e=>o(e.target.value.replace(/\D/g,``).slice(0,6))}),c&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-body-small-default text-[var(--system-negative-strong)]`,children:c})]})]})}),(0,Q.jsxs)(H.Footer,{children:[(0,Q.jsx)(s,{variant:`outlined`,onClick:()=>v(!1),disabled:g.isPending,children:`Cancel`}),(0,Q.jsx)(s,{onClick:b,disabled:r===null||a.length!==6||g.isPending,children:g.isPending?`Verifying…`:`Verify`})]})]})})}function la(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function ua(){let e=d(),[t,n]=(0,Z.useState)(!1),[r,i]=(0,Z.useState)(null),a=f({...kt()}),o=a.data??[],c=()=>e.invalidateQueries({queryKey:Ft()}),l=Dt({onSuccess:()=>{U.success(`Authenticator app removed.`),c()},onError:e=>{if(sa(e)===`factor_not_found`){c();return}U.error(`Failed to remove the authenticator app. Please try again.`)}});return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[a.isPending?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin`}),(0,Q.jsx)(`span`,{className:`text-body-medium-default`,children:`Loading authenticator apps…`})]}):a.isError?(0,Q.jsxs)(z,{tone:`error`,children:[`Couldn't load your authenticator apps.`,` `,(0,Q.jsx)(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>void a.refetch(),children:`Try again`})]}):o.length===0?(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`No authenticator app is set up. Add one to require a one-time code at sign-in.`}):(0,Q.jsx)(`ul`,{className:`flex flex-col divide-y divide-[var(--border-base)]`,children:o.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(oe,{className:`h-5 w-5 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Authenticator app`}),(0,Q.jsxs)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:[e.user,e.created_at?` · Added ${la(e.created_at)}`:``]})]})]}),(0,Q.jsx)(s,{variant:`dangerOutline`,onClick:()=>i(e),disabled:l.isPending,children:`Remove`})]},e.id))}),!a.isPending&&!a.isError&&o.length===0&&(0,Q.jsx)(s,{onClick:()=>n(!0),className:`self-start`,children:`Add authenticator app`}),(0,Q.jsx)(ca,{open:t,onOpenChange:n}),(0,Q.jsx)(ve,{open:r!==null,title:`Remove authenticator app`,message:`Signing in will no longer ask for a code from this app. You can set up a new authenticator app at any time.`,confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{r&&l.mutate({path:{id:r.id}}),i(null)},onCancel:()=>i(null)})]})}var $=class extends Error{code;constructor(e,t){super(t),this.name=`TeleportError`,this.code=e}},da=`local`,fa=`docker`,pa=`vellum`;function ma(e){switch((e??``).toLowerCase()){case da:return`local`;case fa:return`docker`;case pa:return`managed`;default:return`other`}}function ha(e){let t=ma(e);return t===`managed`?`local`:t===`local`?`platform`:null}function ga(e){switch(e){case`docker`:return`Move to Docker`;case`platform`:return`Move to Cloud (Platform)`;case`local`:return`Move to Local`}}function _a(e){switch(e){case`docker`:return`Run your assistant in a Docker container on this Mac.`;case`platform`:return`Run your assistant in the cloud, managed by the Vellum platform.`;case`local`:return`Run your assistant locally on this Mac.`}}function va(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.reason!==`version_mismatch`)return null;let n=t.bundle_compat,r=t.target_runtime_version;if(!n||typeof n!=`object`||typeof r!=`string`)return null;let i=n,a=i.min_runtime_version;if(typeof a!=`string`)return null;let o=typeof i.max_runtime_version==`string`?i.max_runtime_version:null;return`Cannot import: bundle requires runtime ${o?`${a}–${o}`:`${a}+`}, but this local runtime is ${r}. Update your local runtime before importing.`}async function ya(e,t){let n=Number(e.headers.get(`Content-Length`)??0);if(!e.body||!t||n<=0){let n=await e.arrayBuffer();return t?.(1),n}let r=e.body.getReader(),i=[],a=0;for(;;){let{done:e,value:o}=await r.read();if(e)break;i.push(o),a+=o.length,t(a/n)}let o=new Uint8Array(a),s=0;for(let e of i)o.set(e,s),s+=e.length;return t(1),o.buffer}function ba(e){let t=Ae(e);if(!t)throw new $(`local_assistant_not_found`,`Assistant ${e.assistantId} has no resolved local gateway.`);return`${window.location.origin}${t}`}async function xa(e,t){let n=await Ie(e.assistantId),r=await fetch(`${t}/auth/token`,{method:`POST`,headers:{Authorization:`Bearer ${n}`}});if(!r.ok)throw new $(`not_signed_in`,`Gateway token request failed (HTTP ${r.status}).`);let{token:i}=await r.json();return i}async function Sa(e,t){let n=ba(e),r=await xa(e,n),i=await fetch(`${n}/v1/migrations/export`,{method:`POST`,headers:{Authorization:`Bearer ${r}`}});if(!i.ok)throw new $(`export_failed`,`Export failed (HTTP ${i.status}).`);return ya(i,t)}async function Ca(e,t){let n=ba(e),r=await xa(e,n),i=await fetch(`${n}/v1/migrations/import`,{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:new Blob([t],{type:`application/octet-stream`})});if(!i.ok)throw new $(`import_failed`,`Import failed (HTTP ${i.status}).`);let a=await Ea(i);if(a&&a.success===!1)throw new $(`import_failed`,a.error??`Import reported failure`)}async function wa(e,t){let{data:n,response:r}=await K.post({url:`/v1/assistants/{assistant_id}/migrations/export-to-gcs/`,path:{assistant_id:e},body:{upload_url:t},throwOnError:!1}),i=r?.status??0;if(!(r?.ok??!1)&&i!==202)throw new $(`export_failed`,`Export failed (HTTP ${i}).`);let a=n?.job_id;if(!a)throw new $(`export_failed`,`Export accepted but no job ID was returned.`);return a}async function Ta(e,t){let{data:n,response:r}=await K.get({url:`/v1/assistants/{assistant_id}/migrations/jobs/{job_id}`,path:{assistant_id:e,job_id:t},throwOnError:!1}),i=r?.status??0;if(i>=500)return`processing`;if(!(r?.ok??!1))throw new $(`export_job_failed`,`Job status check failed (HTTP ${i})`);let a=n;if(a?.status===`failed`)throw new $(`export_job_failed`,a.error??`Export job failed`);return a?.status??`processing`}async function Ea(e){try{return await e.json()}catch{return null}}var Da=new Set([500,502,503,504]),Oa=3,ka=e=>new Promise(t=>setTimeout(t,e));async function Aa(e,t=new Set){for(let n=0;n<=Oa;n++){let{response:r,data:i,error:a}=await e(),o=r?.status??0;if(n<Oa&&Da.has(o)&&!t.has(o)){await ka(2**n*1e3);continue}return{status:o,data:i,error:a}}throw new $(`unknown`,`Unexpected retry loop exit`)}async function ja(e,t){let n={operation:`upload`};e&&(n.min_runtime_version=e,n.max_runtime_version=null),t&&(n.consumer=t);let{status:r,data:i}=await Aa(()=>K.post({url:`/v1/migrations/signed-url/`,body:n,throwOnError:!1}),new Set([404,503]));if(r===503||r===404)throw new $(`export_failed`,`Signed URL uploads are not available — the platform may not support this feature yet.`);if(r!==201)throw new $(`export_failed`,`Migration request failed (HTTP ${r}).`);let a=i;return{url:a.url,bundleKey:a.bundle_key,expiresAt:a.expires_at}}async function Ma(e,t){let{status:n,data:r,error:i}=await Aa(()=>K.post({url:`/v1/migrations/signed-url/`,body:{operation:`download`,bundle_key:e,target_runtime_version:t},throwOnError:!1}),new Set([422]));if(n===422){let e=va(i);if(e)throw new $(`version_mismatch`,e)}if(n!==200&&n!==201)throw new $(`import_failed`,`Migration request failed (HTTP ${n}).`);return r.url}async function Na(e,t,n){for(let r=0;r<=Oa;r++){let i=await Pa(e,t,n);if(r<Oa&&Da.has(i)){await ka(2**r*1e3),n?.(0);continue}if(i<200||i>=300)throw new $(`export_failed`,`Bundle upload failed (HTTP ${i}).`);return}}function Pa(e,t,n){return new Promise((r,i)=>{let a=new XMLHttpRequest;a.open(`PUT`,e),a.setRequestHeader(`Content-Type`,`application/octet-stream`),a.timeout=36e5,n&&(a.upload.onprogress=e=>{e.lengthComputable&&n(e.loaded/e.total)}),a.onload=()=>{n?.(1),r(a.status)},a.onerror=()=>i(new $(`export_failed`,`Bundle upload failed.`)),a.ontimeout=()=>i(new $(`export_timed_out`,`Bundle upload timed out.`)),a.send(t)})}async function Fa(e,t){for(let n=0;n<=Oa;n++){let r=await fetch(e,{method:`GET`});if(n<Oa&&Da.has(r.status)){await ka(2**n*1e3),t?.(0);continue}if(!r.ok)throw new $(`import_failed`,`Bundle download failed (HTTP ${r.status}).`);return ya(r,t)}throw new $(`import_failed`,`Unexpected retry loop exit`)}async function Ia(e){let{status:t,data:n,error:r}=await Aa(()=>K.post({url:`/v1/migrations/import-from-gcs/`,body:{bundle_key:e},throwOnError:!1}));return{status:t,body:n??r??null}}async function La(e){let{status:t,data:n}=await Aa(()=>K.get({url:`/v1/migrations/jobs/{job_id}/`,path:{job_id:e},throwOnError:!1}));if(t!==200)throw new $(`import_failed`,`Job status check failed (HTTP ${t})`);let r=n??{};return{status:typeof r.status==`string`?r.status:`unknown`,jobId:typeof r.job_id==`string`?r.job_id:null,error:typeof r.error==`string`?r.error:null}}var Ra=5e3,za=36e5,Ba=5*6e4,Va=30,Ha=e=>new Promise(t=>setTimeout(t,e));function Ua(){let e=c(),t=Ne(),n=ha(t?.cloud),[r,i]=(0,Z.useState)({kind:`idle`}),[o,s]=(0,Z.useState)(!1),l=(0,Z.useRef)(null),u=(0,Z.useRef)(null),d=(0,Z.useCallback)(e=>{i({kind:`transferring`,step:e,progress:null})},[]),f=(0,Z.useCallback)(e=>{i(t=>t.kind===`transferring`?{...t,progress:e}:t)},[]),p=(0,Z.useCallback)(async()=>{if(!(!t||!n)){u.current={id:t.assistantId,kind:ma(t.cloud)===`managed`?`managed`:`local`,createdFresh:!1};try{if(n===`platform`)await Wa(t,d,f,l);else if(n===`local`)await Ga(t,d,f,l);else throw new $(`unknown`,`Unsupported teleport destination.`);i({kind:`verifying`})}catch(e){i({kind:`failed`,error:`Teleport failed: ${e instanceof $||e instanceof Error?e.message:`Teleport failed.`}`}),a(e,{context:`teleport-execute`}),await qa(l.current,u.current,`teleport-execute-cleanup`),l.current=null}}},[t,n,d,f]),m=(0,Z.useCallback)(()=>s(!0),[]),h=(0,Z.useCallback)(()=>s(!1),[]),g=(0,Z.useCallback)(()=>{s(!1),p()},[p]),_=(0,Z.useCallback)(()=>{l.current=null,u.current=null,i({kind:`idle`})},[]);return{destination:n,phase:r,confirmOpen:o,requestTeleport:m,cancelConfirm:h,confirm:g,confirmAndSwitch:(0,Z.useCallback)(()=>{let t=l.current,n=u.current;t&&(async()=>{try{let e=$e.getState();t.kind===`managed`?await e.connectPlatformAssistant(t.id):(await e.connectLocalAssistant(t.id),et(t.id,{onError:e=>a(e,{context:`teleport-inject-platform-identity`})}))}catch(e){i({kind:`failed`,error:`Switch failed: ${e instanceof Error?e.message:`Failed to switch assistant.`}`}),a(e,{context:`teleport-confirm-switch`});return}n&&Yt(n.id).then(e=>{e.ok||a(Error(e.error),{context:`teleport-retire-source`})}),_(),e(J.assistant,{replace:!0})})()},[e,_]),cancelTeleport:(0,Z.useCallback)(()=>{let e=l.current,t=u.current;l.current=null,u.current=null,i({kind:`idle`}),qa(e,t,`teleport-cancel-retire-target`)},[]),reset:_}}async function Wa(e,t,n,r){t(`Exporting assistant data...`);let i=await Sa(e,n);t(`Resolving organization...`);let a=await Ya();t(`Checking for existing assistant...`);let o=(await ut({query:{hosting:`platform`},throwOnError:!1})).data?.results?.[0];if(o)throw new $(`existing_platform_assistant`,`You already have a platform assistant '${o.id}'. Retire it first, then retry the teleport.`);t(`Uploading data to cloud...`);let s=await ja(e.resources?.runtimeVersion);await Na(s.url,i,n),t(`Setting up cloud assistant...`);let c=await pt(void 0,`create`);if(!c.ok)throw new $(`import_failed`,`Failed to set up the cloud assistant.`);if(c.status===200)throw new $(`existing_platform_assistant`,`You already have a platform assistant '${c.data.id}'. Retire it first, then retry the teleport.`);let l=c.data.id;await Ce({assistantId:l,name:c.data.name,cloud:`vellum`,runtimeUrl:Oe(),hatchedAt:c.data.created??new Date().toISOString(),organizationId:a}),await we(e.assistantId),r.current={id:l,kind:`managed`,createdFresh:!0},t(`Finalizing cloud assistant...`),await Xa(l),t(`Importing data to cloud...`);let u=await Ia(s.bundleKey);if(u.status<200||u.status>=300){let e=u.body;throw new $(`import_failed`,e?.error??`Import failed (HTTP ${u.status}).`)}if(u.status===202){let e=u.body?.job_id;if(!e)throw new $(`import_failed`,`Import accepted but no job ID returned.`);await Za(e)}else{let e=u.body;if(e&&e.success===!1)throw new $(`import_failed`,e.error??`Import reported failure.`)}}async function Ga(e,t,n,r){t(`Preparing export...`);let i=await ja(await Ja(e.assistantId),`runtime`);t(`Exporting cloud data...`);let a=await wa(e.assistantId,i.url);await Qa(e.assistantId,a),t(`Preparing local assistant...`);let{assistant:o,createdFresh:s}=await $a();r.current={id:o.assistantId,kind:`local`,createdFresh:s};let c=await Ka(o,s);if(!c)throw new $(`local_assistant_not_found`,`Could not determine the local assistant's runtime version. Restart or upgrade the local assistant, then retry the teleport.`);t(`Preparing import...`);let l=await Ma(i.bundleKey,c);t(`Downloading data...`);let u=await Fa(l,n);t(`Importing data...`),await to(o,u),await we(e.assistantId)}async function Ka(e,t){if(e.resources?.runtimeVersion)return e.resources.runtimeVersion;if(t)return(await cn())?.version??void 0}async function qa(e,t,n){if(e?.createdFresh){let t=await Yt(e.id);t.ok||a(Error(t.error),{context:n})}t&&await we(t.id)}async function Ja(e){let t=await ft(e);return t.ok?t.data.version??void 0:void 0}async function Ya(){let e=tt.getState();e.organizations.length===0&&await e.fetchOrganizations();let t=tt.getState().organizations,n=Ke();if(n&&t.some(e=>e.id===n))return n;if(t.length===0)throw new $(`no_organizations`,`No organizations found for this account.`);if(t.length>1)throw new $(`multiple_organizations`,`Multiple organizations found — please select one in account settings first.`);let r=t[0].id;return tt.getState().setCurrentOrganizationId(r),r}async function Xa(e){let t=Date.now();for(;Date.now()-t<Ba;){let{data:t,response:n}=await st({path:{id:e},throwOnError:!1});if(n?.ok&&t?.state===`active`)return;await Ha(Ra)}}async function Za(e){let t=Date.now();for(;Date.now()-t<za;){await Ha(Ra);let t=await La(e);if(t.status===`complete`)return;if(t.status===`failed`)throw new $(`import_failed`,t.error??`Import job failed`)}throw new $(`import_failed`,`Import timed out after 60 minutes.`)}async function Qa(e,t){let n=Date.now();for(;Date.now()-n<za;)if(await Ha(Ra),await Ta(e,t)===`complete`)return;throw new $(`export_timed_out`,`Export timed out.`)}async function $a(){let e=await De(void 0,void 0);if(!e.ok)throw new $(`local_assistant_not_found`,e.error??`Could not create a local assistant.`);await xe();let t=e.assistantId?Me().find(t=>t.assistantId===e.assistantId):eo();if(!t)throw new $(`local_assistant_not_found`,`Could not find or create a local assistant.`);return{assistant:t,createdFresh:!0}}function eo(){return Me().slice().sort((e,t)=>(t.hatchedAt??``).localeCompare(e.hatchedAt??``))[0]}async function to(e,t){let n;for(let r=0;r<Va;r++)try{await Ca(e,t);return}catch(e){n=e,await Ha(1e3)}throw n instanceof Error?n:new $(`import_failed`,`Import failed.`)}function no(){let e=Ua(),{destination:t,phase:n}=e;return t?(0,Q.jsxs)(X,{title:`Teleport`,subtitle:`Move your assistant to a different hosting environment.`,children:[n.kind===`idle`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:_a(t)}),(0,Q.jsx)(s,{variant:`outlined`,className:`self-start`,onClick:e.requestTeleport,children:ga(t)})]}),n.kind===`transferring`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n.progress==null&&(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:n.step})]}),n.progress!=null&&(0,Q.jsx)(de,{value:n.progress,"aria-label":`Teleport progress`,className:`max-w-[240px]`})]}),n.kind===`verifying`&&(0,Q.jsx)(z,{tone:`success`,icon:(0,Q.jsx)(w,{className:`h-4 w-4`}),title:`Transfer complete — verify your new assistant is working.`,actions:(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(s,{variant:`primary`,onClick:e.confirmAndSwitch,children:`Confirm & Switch`}),(0,Q.jsx)(s,{variant:`outlined`,onClick:e.cancelTeleport,children:`Cancel`})]})}),n.kind===`failed`&&(0,Q.jsx)(z,{tone:`error`,title:n.error,actions:(0,Q.jsx)(s,{variant:`outlined`,onClick:e.reset,children:`Try Again`})}),(0,Q.jsx)(ve,{open:e.confirmOpen,title:ga(t),message:`Your data will be copied to the new environment. The current assistant will remain available until you confirm the new one works.`,confirmLabel:`Teleport`,onConfirm:e.confirm,onCancel:e.cancelConfirm})]}):null}function ro(){let{t:e}=Be(`settings`),{assistant:t,healthz:n,healthzLoading:r,healthzPolling:i,refetch:a,refetchUntilResized:o}=gn(),u=q.use.multiPlatformAssistant(),d=q.use.assistantSwitcher(),f=q.use.teleport(),p=q.use.accountMfa(),m=qt.use.settingsSleepPolicy(),h=Ze(),g=gt(),_=d&&(Fe()||h||Te()||g),v=c(),y=bt(),b=bt({platformHostedOnly:!0}),x=St(),S=vt(),C=M({assistantId:t?.id??null,enabled:b===`full`&&x}),[w,T]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(!1),[O,k]=l();(0,Z.useEffect)(()=>{if(O.get(`preferences`)!==`open`)return;let e=new URLSearchParams(O);e.delete(`preferences`),k(e,{replace:!0}),D(!0)},[O,k]);let A=t?.is_local&&!Fe()?null:t,j=Ne(),N=Fe()&&!!t&&!!j&&ke(j),P=N,F=N&&!Te(),ee=b===`full`&&!!A||F&&!!t;(0,Z.useEffect)(()=>{!t||window.location.hash!==`#storage-resources`||requestAnimationFrame(()=>{document.getElementById(`storage-resources`)?.scrollIntoView({block:`start`})})},[t]);let I=n?.version??t?.current_release_version??null,te=()=>{let e=je();if(Te()&&!g&&e){let t=new URLSearchParams({register:mt()}),n=Pe();n&&t.set(`name`,n);let r=new URL(e).origin;window.location.assign(`${r}${J.selectAssistant}?${t.toString()}`);return}v(`${J.selectAssistant}?noAutoSkip=1`)},L=(y===`full`||P)&&!!A||y===`disabled`&&!P,R=b!==`gated`;return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[C.status&&C.mode!==`inactive`&&(0,Q.jsx)(ne,{status:C.status,mode:C.mode,isAcknowledging:C.isAcknowledging,acknowledgeError:C.acknowledgeError?.message??null,onAcknowledge:()=>void C.acknowledge(),onReviewWorkspaceData:()=>void v(`${J.workspace}?sort=size`),onUpgradeStorage:b===`full`&&!S?()=>void v(J.plans):null}),(0,Q.jsxs)(Ln,{assistant:x?A:null,showHandles:h&&y===`full`,children:[(0,Q.jsx)($i,{}),p&&y!==`gated`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`generalPage.twoFactorTitle`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`generalPage.twoFactorDescription`)}),(0,Q.jsx)(`div`,{className:`mt-1`,children:y===`disabled`?(0,Q.jsx)(Y,{children:e(`generalPage.twoFactorLoginNotice`)}):(0,Q.jsx)(ua,{})})]})]})]}),(0,Q.jsx)(X,{title:e(`generalPage.versionTitle`),subtitle:e(`generalPage.versionSubtitle`),accessory:b===`full`&&A?(0,Q.jsx)(s,{variant:`outlined`,onClick:()=>T(!0),children:e(`generalPage.updateWindow`)}):void 0,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[b===`full`&&A&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(qn,{assistantId:A.id,currentVersion:I,releaseChannel:A.release_channel,onUpgradeComplete:()=>{a()}}),(0,Q.jsx)(Fi,{assistantId:A.id,onComplete:()=>{a()}})]}),F&&t&&(0,Q.jsx)(Jn,{assistantId:t.id,currentVersion:I,onUpgradeComplete:()=>{a()}}),!ee&&t&&(0,Q.jsxs)(`div`,{className:`grid grid-cols-[140px_minmax(0,1fr)] gap-y-3`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`generalPage.current`)}),(0,Q.jsx)(_n,{version:I,loading:r&&!t.current_release_version,assistantId:t.id??null})]}),b===`disabled`&&!F&&(0,Q.jsx)(Y,{children:e(`generalPage.updatesLoginNotice`)})]})}),b===`full`&&A&&(0,Q.jsx)(oa,{assistantId:A.id,open:w,onClose:()=>T(!1)}),b===`full`&&t&&(0,Q.jsx)(Ui,{assistant:t,healthz:n,healthzLoading:r,healthzPolling:i,refetch:a,refetchUntilResized:o}),b===`disabled`&&(0,Q.jsx)(X,{id:`storage-resources`,title:e(`generalPage.computeResourcesTitle`),subtitle:e(`generalPage.computeResourcesSubtitle`),children:(0,Q.jsx)(Y,{children:e(`generalPage.computeResourcesLoginNotice`)})}),(0,Q.jsx)(X,{title:e(`generalPage.preferencesTitle`),subtitle:e(`generalPage.preferencesSubtitle`),accessory:(0,Q.jsx)(s,{variant:`outlined`,onClick:()=>D(!0),children:e(`generalPage.customize`)}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsx)(wn,{}),(0,Q.jsx)(Gi,{})]})}),(0,Q.jsx)(ki,{open:E,onClose:()=>D(!1)}),f&&Le()&&(0,Q.jsx)(no,{}),(0,Q.jsx)(Zn,{}),(0,Q.jsx)(xi,{}),b===`full`&&A&&m&&(0,Q.jsx)(X,{title:e(`generalPage.sleepPolicyTitle`),subtitle:e(`generalPage.sleepPolicySubtitle`),children:(0,Q.jsx)(Un,{assistantId:A.id})}),b===`disabled`&&m&&(0,Q.jsx)(X,{title:e(`generalPage.sleepPolicyTitle`),subtitle:e(`generalPage.sleepPolicySubtitle`),children:(0,Q.jsx)(Y,{children:e(`generalPage.sleepPolicyLoginNotice`)})}),u&&!_&&(0,Q.jsx)(Bn,{}),_&&(0,Q.jsx)(X,{title:e(`generalPage.switchAssistantTitle`),subtitle:e(`generalPage.switchAssistantSubtitle`),accessory:(0,Q.jsx)(s,{variant:`outlined`,onClick:te,children:e(`generalPage.chooseAssistant`)})}),(L||R)&&(0,Q.jsx)(X,{variant:`danger`,title:e(`generalPage.dangerZoneTitle`),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[L&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`generalPage.retireAssistantTitle`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`generalPage.retireAssistantDescription`)}),(0,Q.jsx)(`div`,{className:`mt-1`,children:(y===`full`||P)&&A?(0,Q.jsx)(Wi,{assistantId:A.id}):(0,Q.jsx)(Y,{children:e(`generalPage.retireAssistantLoginNotice`)})})]}),L&&R&&(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(Yn,{})]})})]})}export{ro as GeneralPage};