@vellumai/web 0.10.10 → 0.10.11-dev.202607212222.fe33210

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 (354) hide show
  1. package/dist/assets/{BundleConfirmPage-DTwntn4X.js → BundleConfirmPage-DNYvq-iC.js} +1 -1
  2. package/dist/assets/{a2a-invite-B-5DQeoe.js → a2a-invite-TwKJ1taE.js} +1 -1
  3. package/dist/assets/{about-page-CTorC0We.js → about-page-C-kIVb7a.js} +1 -1
  4. package/dist/assets/account-page-Cty4MhKi.js +1 -0
  5. package/dist/assets/{account-shell-CfWeuJs3.js → account-shell-Vvty68tY.js} +1 -1
  6. package/dist/assets/{acp-run-detail-panel-B0k2rYpM.js → acp-run-detail-panel-CBebcmWB.js} +4 -4
  7. package/dist/assets/activity-steps-panel-pw_G-YBX.js +1 -0
  8. package/dist/assets/add-credits-modal-CXeX2B2Q.js +1 -0
  9. package/dist/assets/ai-page-DBVNmogG.js +1 -0
  10. package/dist/assets/api-4X-X5R5M.js +1 -0
  11. package/dist/assets/{api-BBMl4mW3.js → api-Ffg_vD9E.js} +1 -1
  12. package/dist/assets/{api-errors-CDe82ZvY.js → api-errors-CoE1wFl2.js} +1 -1
  13. package/dist/assets/{api-key-screen-BYdMayOl.js → api-key-screen-gjHOe41n.js} +1 -1
  14. package/dist/assets/{app-info-Dwct98Bb.js → app-info-LSjlWG3w.js} +1 -1
  15. package/dist/assets/{archive-redirect-page-E3vzn7Cc.js → archive-redirect-page-Dos7WEDP.js} +1 -1
  16. package/dist/assets/{assistant-feature-flag-store-BpbbAIKZ.js → assistant-feature-flag-store-aNAjw1qx.js} +1 -1
  17. package/dist/assets/assistant-identity-store-CgJwLRMd.js +1 -0
  18. package/dist/assets/assistant-status-panel-DjbXPGzE.js +1 -0
  19. package/dist/assets/auth-store-CQkJpfOH.js +2 -0
  20. package/dist/assets/{background-task-detail-panel-wG11sk-D.js → background-task-detail-panel-CIwotT4H.js} +1 -1
  21. package/dist/assets/billing-page-DZErDSca.js +3 -0
  22. package/dist/assets/billing-redirect-page-CODl039S.js +1 -0
  23. package/dist/assets/bookmarks-page-Cw_EkTDH.js +1 -0
  24. package/dist/assets/browser-DvVliQQE.js +2 -0
  25. package/dist/assets/{build-state-DR-w7k-Q.js → build-state-3TH38Fw_.js} +1 -1
  26. package/dist/assets/{capture-error-BGD3-GQf.js → capture-error-anSemq95.js} +1 -1
  27. package/dist/assets/channels-page-route-CEK5zuZX.js +9 -0
  28. package/dist/assets/chart-column-L6Nldm8M.js +1 -0
  29. package/dist/assets/chat-BDhsGoUo.js +1 -0
  30. package/dist/assets/chat-markdown-message-DGmzrpoV.js +2 -0
  31. package/dist/assets/{client-feature-flag-store-DeUwlUsr.js → client-feature-flag-store-D85jf9vW.js} +1 -1
  32. package/dist/assets/{client-identity-jCzxcz5m.js → client-identity-B_r6IM_R.js} +1 -1
  33. package/dist/assets/{command-palette-nEbCvF9B.js → command-palette-DK46EOhG.js} +1 -1
  34. package/dist/assets/{command-palette-window-page-Um5WOMD9.js → command-palette-window-page-DNs9CvaQ.js} +1 -1
  35. package/dist/assets/{community-page-BpLDD6Gw.js → community-page-i0mRY-hk.js} +1 -1
  36. package/dist/assets/{confirm-dialog-CCrDkChx.js → confirm-dialog-Zyfei9GV.js} +1 -1
  37. package/dist/assets/connect-page-C3EPtveS.js +1 -0
  38. package/dist/assets/consent-C8XzlZzW.js +1 -0
  39. package/dist/assets/{consent-controls-CiU4EkLm.js → consent-controls-bsQlQb3J.js} +1 -1
  40. package/dist/assets/{contacts-gateway-EIOxMIFC.js → contacts-gateway-B7Q0KRzM.js} +1 -1
  41. package/dist/assets/contacts-page-route-CMrgJaPQ.js +1 -0
  42. package/dist/assets/{conversation-list-fetchers-BOrVAREL.js → conversation-list-fetchers-DKtnmlFF.js} +1 -1
  43. package/dist/assets/{conversation-store-DBm_wIJg.js → conversation-store-Ogn1aavZ.js} +1 -1
  44. package/dist/assets/{credential-entry-page-_NrjRBZ2.js → credential-entry-page-BzRdfcLk.js} +1 -1
  45. package/dist/assets/credentials-page-D4-ljpgj.js +1 -0
  46. package/dist/assets/{danger-zone-redirect-page-xzib25RG.js → danger-zone-redirect-page-G4LukiTP.js} +1 -1
  47. package/dist/assets/debug-page-DQVUt7fj.js +4 -0
  48. package/dist/assets/{deploy-dialogs-BNZpdpkW.js → deploy-dialogs-DvT4jFAn.js} +1 -1
  49. package/dist/assets/{detail-card-CA8lPa5K.js → detail-card-C2f90pfI.js} +1 -1
  50. package/dist/assets/{detail-panel-stop-button-QQ20Gb80.js → detail-panel-stop-button-BqB8QTg0.js} +1 -1
  51. package/dist/assets/developer-page-Cil8jvLn.js +1 -0
  52. package/dist/assets/{devices-redirect-page-DpaYzLMA.js → devices-redirect-page-B3OLKb5Z.js} +1 -1
  53. package/dist/assets/{diagnostics-CNSs2GQW.js → diagnostics-gOI79YBb.js} +1 -1
  54. package/dist/assets/{dictation-overlay-page-DFy73eLq.js → dictation-overlay-page-B7fFOHvz.js} +1 -1
  55. package/dist/assets/document-viewer-page-CK_BUEK2.js +1 -0
  56. package/dist/assets/{edge-swipe-arbiter-store-urfzS6HH.js → edge-swipe-arbiter-store-a9LiewmS.js} +1 -1
  57. package/dist/assets/emails-page-kw0F6HIz.js +1 -0
  58. package/dist/assets/{environment-store-D_Bc9wnl.js → environment-store-Bxe2pTvW.js} +1 -1
  59. package/dist/assets/esm-B-GaVjH1.js +2 -0
  60. package/dist/assets/esm-BhZb3XhL.js +1 -0
  61. package/dist/assets/esm-BvREcXsb.js +2 -0
  62. package/dist/assets/{esm-DvjYgAFs.js → esm-CABHbixu.js} +2 -2
  63. package/dist/assets/esm-CtFJECNT.js +2 -0
  64. package/dist/assets/esm-Dy0d6BZB.js +2 -0
  65. package/dist/assets/esm-u9ag4ek2.js +2 -0
  66. package/dist/assets/feature-flag-catalog-DpiUkDzU.js +1 -0
  67. package/dist/assets/{file-editor-kHnQQ-I8.js → file-editor-BlzzF05y.js} +1 -1
  68. package/dist/assets/{file-markdown-DZhQRECx.js → file-markdown-BXMDJYDD.js} +1 -1
  69. package/dist/assets/general-page-lhrDY8Ij.js +1 -0
  70. package/dist/assets/get-memory-stats-CJElyWmX.js +1 -0
  71. package/dist/assets/{haptics-D5SxnqtJ.js → haptics-BCOHPEbp.js} +2 -2
  72. package/dist/assets/hatching-screen-DTXAGLWO.js +1 -0
  73. package/dist/assets/home-page-route-iz2ZynKJ.js +1 -0
  74. package/dist/assets/{hosting-screen-Zb6-T1r9.js → hosting-screen-D1rPuj5b.js} +1 -1
  75. package/dist/assets/identity-page-route-4W1yTMCZ.js +7 -0
  76. package/dist/assets/index-B92kvb9E.css +2 -0
  77. package/dist/assets/index-Dv7BQn1T.js +217 -0
  78. package/dist/assets/{ingest-DbnjKjOF.js → ingest-EqEPbLa8.js} +1 -1
  79. package/dist/assets/{inspect-page-Iemfgo7r.js → inspect-page-BuCuunkh.js} +6 -6
  80. package/dist/assets/integrations-page-CWIX3Pap.js +1 -0
  81. package/dist/assets/intelligence-layout-Do9FBKr8.js +1 -0
  82. package/dist/assets/{keyboard-shortcuts-redirect-page-CSeKG-5e.js → keyboard-shortcuts-redirect-page-DeJ-n4fJ.js} +1 -1
  83. package/dist/assets/{latest-assistant-text-cGlQO-ow.js → latest-assistant-text-D0MTsoYL.js} +2 -2
  84. package/dist/assets/library-detail-page-tlCgZt0u.js +1 -0
  85. package/dist/assets/library-page-BtkzFVg6.js +1 -0
  86. package/dist/assets/link-click-UU2H_LTM.js +1 -0
  87. package/dist/assets/list-row-CFyYr-FU.js +1 -0
  88. package/dist/assets/local-mode-Dydd46cS.js +39 -0
  89. package/dist/assets/{login-flow-CsH-88pb.js → login-flow-BbDKvY8O.js} +1 -1
  90. package/dist/assets/{login-page-DxxrePFg.js → login-page-Bh_lIgB-.js} +1 -1
  91. package/dist/assets/{logout-page-C27fK6LX.js → logout-page-C8YbLjg9.js} +1 -1
  92. package/dist/assets/{logs-layout-DrBxBaoW.js → logs-layout-DwkPGaVq.js} +1 -1
  93. package/dist/assets/machine-sizes-ByPhm3J2.js +1 -0
  94. package/dist/assets/memory-page-route-CYz7kk_H.js +2 -0
  95. package/dist/assets/memory-router-playground-page-DjdB1tz8.js +3 -0
  96. package/dist/assets/menu-C9SOvGlk.js +1 -0
  97. package/dist/assets/messages-4fYDxCnR.js +13 -0
  98. package/dist/assets/{metric-card-BvFbnMl1.js → metric-card-DDHse5we.js} +1 -1
  99. package/dist/assets/{mobile-sidebar-drawer-BmS9adnj.js → mobile-sidebar-drawer-BbrmNPqi.js} +1 -1
  100. package/dist/assets/mutation-error-D_121hKK.js +1 -0
  101. package/dist/assets/{native-biometric-gWkPFBiw.js → native-biometric-Bp5eYpXj.js} +1 -1
  102. package/dist/assets/{native-file-CgfJr8IE.js → native-file-nGF42SR0.js} +2 -2
  103. package/dist/assets/{notice-BylgS5W_.js → notice-DkAWz47A.js} +1 -1
  104. package/dist/assets/notifications-page-DOgXluxw.js +1 -0
  105. package/dist/assets/{oauth-complete-page-BMqOW3MA.js → oauth-complete-page--s6EieXt.js} +1 -1
  106. package/dist/assets/{oauth-popup-complete-page-D-r0oM8y.js → oauth-popup-complete-page-ChPgDm_s.js} +1 -1
  107. package/dist/assets/{onboarding-store-DZ2FrhW-.js → onboarding-store-Bxw_JVDh.js} +1 -1
  108. package/dist/assets/{page-empty-state-DbCk3v6f.js → page-empty-state-CJMyr1gl.js} +1 -1
  109. package/dist/assets/{page-shell-DeTaZ_s4.js → page-shell-DjszLGB6.js} +1 -1
  110. package/dist/assets/{pairing-page-CELMlJeG.js → pairing-page-Bqc8999R.js} +1 -1
  111. package/dist/assets/panel-item-An-BBeyL.js +1 -0
  112. package/dist/assets/{password-reset-page-DNE8HK7m.js → password-reset-page-D6koYozO.js} +1 -1
  113. package/dist/assets/personality-page-HJZONsvO.js +1 -0
  114. package/dist/assets/plan-tier-meta-Drr3TB4O.js +1 -0
  115. package/dist/assets/plans-page-BBkQTRY0.js +1 -0
  116. package/dist/assets/{platform-detection-1awANa55.js → platform-detection-BnBFKFxp.js} +1 -1
  117. package/dist/assets/{platform-loopback-page-Dpa25N6y.js → platform-loopback-page-CqY91W2m.js} +1 -1
  118. package/dist/assets/plugin-attribution-DaTkKmHy.js +1 -0
  119. package/dist/assets/plugin-detail-page-B_8f3Php.js +1 -0
  120. package/dist/assets/plugins-page-Bm29U9jj.js +1 -0
  121. package/dist/assets/prechat-mDxOfWth.js +1 -0
  122. package/dist/assets/{prefs-wApndUEh.js → prefs-Od3axSSC.js} +1 -1
  123. package/dist/assets/privacy-page-CZA704jY.js +1 -0
  124. package/dist/assets/privacy-screen-DpKoUfn5.js +1 -0
  125. package/dist/assets/{provider-callback-page-fjZoTIWk.js → provider-callback-page-DOSYKFzf.js} +1 -1
  126. package/dist/assets/{provider-key-BGsg7FL-.js → provider-key-BwkVylwK.js} +1 -1
  127. package/dist/assets/{provider-signup-page-s0iG7WXI.js → provider-signup-page-B8wtRgEE.js} +1 -1
  128. package/dist/assets/{quick-input-page-BmPU9B6u.js → quick-input-page-PxnfHKLV.js} +1 -1
  129. package/dist/assets/react-query.gen-DfzfX_Jv.js +1 -0
  130. package/dist/assets/{remote-gateway-session-CuTuWPx8.js → remote-gateway-session-D-udmSfx.js} +1 -1
  131. package/dist/assets/{research-mock-page-CssYNgG7.js → research-mock-page-DQo0mg10.js} +1 -1
  132. package/dist/assets/{research-onboarding-persistence-BLNrBZSe.js → research-onboarding-persistence-C4LT0Ekr.js} +1 -1
  133. package/dist/assets/research-onboarding-route-B7iCfoVD.js +43 -0
  134. package/dist/assets/resize-errors-NWH12qGQ.js +1 -0
  135. package/dist/assets/{resolved-assistants-store-DdnJoLGS.js → resolved-assistants-store-DdHm-7v4.js} +1 -1
  136. package/dist/assets/{return-to-BVIOUdUp.js → return-to-ugSGJ0dm.js} +1 -1
  137. package/dist/assets/{review-terms-screen-Cv_jkYHP.js → review-terms-screen-CoxVDyYG.js} +1 -1
  138. package/dist/assets/risk-C7HwWgEc.js +3 -0
  139. package/dist/assets/routes-Cwb-U9H-.js +1 -0
  140. package/dist/assets/{schedules-Baaz8ToC.js → schedules-BKXuUZjT.js} +1 -1
  141. package/dist/assets/schedules-page-CFTQf8v5.js +1 -0
  142. package/dist/assets/{sdk.gen-BJsTUGAk.js → sdk.gen-B3ej_AZQ.js} +1 -1
  143. package/dist/assets/sdk.gen-BR-xXIZm.js +6 -0
  144. package/dist/assets/{security-redirect-page-lq2zT9X9.js → security-redirect-page-DPNpPTGT.js} +1 -1
  145. package/dist/assets/{select-assistant-screen-B0qoVKd5.js → select-assistant-screen-CdVceAV3.js} +1 -1
  146. package/dist/assets/{settings-divider-Dk_uJxp_.js → settings-divider-jsYVGphg.js} +1 -1
  147. package/dist/assets/settings-layout-TNLMnU0M.js +1 -0
  148. package/dist/assets/settings-wSv59mkN.js +1 -0
  149. package/dist/assets/share-feedback-modal--hKDRNqj.js +1 -0
  150. package/dist/assets/shared-ui-BKbnBt9U.js +1 -0
  151. package/dist/assets/sidebar-tree-BGTRgKT7.js +1 -0
  152. package/dist/assets/{signup-page-CQLi5G7p.js → signup-page-Bpopr3yN.js} +1 -1
  153. package/dist/assets/site-favicon-BpOLYixK.js +1 -0
  154. package/dist/assets/skill-detail-page-Z5YRQiAc.js +1 -0
  155. package/dist/assets/{skill-detail-panel-J7W0DU8J.js → skill-detail-panel-CuUAJQke.js} +1 -1
  156. package/dist/assets/{skills-DJft07cl.js → skills-DZ_w0wsZ.js} +1 -1
  157. package/dist/assets/skills-page-B7tsrugc.js +1 -0
  158. package/dist/assets/sliders-horizontal-MqeLCMh3.js +1 -0
  159. package/dist/assets/{sounds-redirect-page-CBcnSoVu.js → sounds-redirect-page-1l5Wdx8t.js} +1 -1
  160. package/dist/assets/{src-CDdn26Yb.js → src-BNYQ8guL.js} +3 -3
  161. package/dist/assets/{start-screen-Cbh01xPj.js → start-screen-DpOIS-if.js} +1 -1
  162. package/dist/assets/{subagent-detail-panel-D9BXd8vR.js → subagent-detail-panel-ht65j33j.js} +2 -2
  163. package/dist/assets/{subagent-store-D0ALjG5_.js → subagent-store-B2CYmCAg.js} +2 -2
  164. package/dist/assets/superpowers-page-B42njqFf.js +1 -0
  165. package/dist/assets/system-events-page-C6Az1fvq.js +1 -0
  166. package/dist/assets/{system-events-redirect-page-ZFijxK36.js → system-events-redirect-page-Dn_GzAqr.js} +1 -1
  167. package/dist/assets/{theme-stage-page-DUeQZVJ3.js → theme-stage-page-BcQ6IXfK.js} +1 -1
  168. package/dist/assets/{tiptap-document-editor-yCVhNTRu.js → tiptap-document-editor-BgEtWNR4.js} +1 -1
  169. package/dist/assets/{toast-ZoZVyeDI.js → toast-Be8FEQ-I.js} +1 -1
  170. package/dist/assets/{tool-detail-panel-Dtl2QLOW.js → tool-detail-panel-20rkMKFB.js} +1 -1
  171. package/dist/assets/typed-storage-Cphlhvyu.js +1 -0
  172. package/dist/assets/upgrade-cancel-page-B0zGoVXK.js +1 -0
  173. package/dist/assets/upgrade-success-page-z-nE1BA-.js +1 -0
  174. package/dist/assets/{usage-redirect-page-Bs2mzWyk.js → usage-redirect-page-QcU-WiR0.js} +1 -1
  175. package/dist/assets/{use-assistant-identity-details-D-gTqmOL.js → use-assistant-identity-details-C2evuHmG.js} +1 -1
  176. package/dist/assets/use-bus-subscription-PbK6Fx9c.js +1 -0
  177. package/dist/assets/{use-edge-swipe-back-Dpo-0Weh.js → use-edge-swipe-back-8FoEHlTk.js} +1 -1
  178. package/dist/assets/use-invite-link-dialog-6AF_jD7j.js +1 -0
  179. package/dist/assets/use-is-org-ready-CpemTPRx.js +1 -0
  180. package/dist/assets/{use-onboarding-login-D6BGXpJ1.js → use-onboarding-login-BVpbqGtW.js} +1 -1
  181. package/dist/assets/use-skill-actions-O3duTfMO.js +1 -0
  182. package/dist/assets/{use-skill-detail-files-DS6fk9Xz.js → use-skill-detail-files-Di3orLzH.js} +1 -1
  183. package/dist/assets/users--1gWeHEq.js +1 -0
  184. package/dist/assets/{utils-ilzygKkt.js → utils-DvUW9GK8.js} +1 -1
  185. package/dist/assets/{viewer-store-ClQ_c5qv.js → viewer-store-CA46JenB.js} +1 -1
  186. package/dist/assets/voice-page-ML3JUgck.js +1 -0
  187. package/dist/assets/{weather-forecast-display-Dcw7Ta6D.js → weather-forecast-display-D7xV8-Tp.js} +1 -1
  188. package/dist/assets/{web-CyWG_cm-.js → web-C_RyjuPn.js} +1 -1
  189. package/dist/assets/{web-DqOpt9dV.js → web-D1Wdlc7e.js} +1 -1
  190. package/dist/assets/{web-Cx4jtwLB.js → web-D2t1-p2V.js} +1 -1
  191. package/dist/assets/{web-DxGQp5dQ.js → web-DE01jWtm.js} +1 -1
  192. package/dist/assets/{web-BJvOJyLN.js → web-DK4RzUrM.js} +1 -1
  193. package/dist/assets/{web-CrrIg0Pn.js → web-DNkvgjT6.js} +1 -1
  194. package/dist/assets/{web-qzBk16t5.js → web-DoV8m3zw.js} +1 -1
  195. package/dist/assets/{web-DoNLEdOt.js → web-DwtkFwhF.js} +1 -1
  196. package/dist/assets/{welcome-screen-C35jMBVC.js → welcome-screen-DWuLmVC0.js} +1 -1
  197. package/dist/assets/workflow-detail-panel-CVsj9EzC.js +1 -0
  198. package/dist/assets/workspace-page-DRCReh6V.js +1 -0
  199. package/dist/index.html +113 -114
  200. package/package.json +1 -1
  201. package/dist/assets/account-page-B27dNQ3d.js +0 -1
  202. package/dist/assets/activity-steps-panel-LDydO3OK.js +0 -1
  203. package/dist/assets/add-credits-modal-vjAb-rsd.js +0 -1
  204. package/dist/assets/ai-page-UMlli-yL.js +0 -1
  205. package/dist/assets/animated-avatar-CyIeKE-s.js +0 -1
  206. package/dist/assets/api-DjY6rho1.js +0 -1
  207. package/dist/assets/assistant-identity-store-bwxIa6fM.js +0 -1
  208. package/dist/assets/assistant-status-panel-DDvWvhN1.js +0 -1
  209. package/dist/assets/auth-store-B6EXnaee.js +0 -2
  210. package/dist/assets/billing-page-BHg4_D8p.js +0 -3
  211. package/dist/assets/bookmarks-page-Dj_WhT38.js +0 -1
  212. package/dist/assets/browser-JyOUYdam.js +0 -2
  213. package/dist/assets/calendar-D0labpMU.js +0 -1
  214. package/dist/assets/channels-page-route-BLMC84yp.js +0 -9
  215. package/dist/assets/chat-CMHzEB4C.js +0 -1
  216. package/dist/assets/chat-markdown-message-D8WjuXJe.js +0 -2
  217. package/dist/assets/chevron-right-jRymmL7S.js +0 -1
  218. package/dist/assets/connect-page-B_dNamaq.js +0 -1
  219. package/dist/assets/consent-DAnl-k-J.js +0 -1
  220. package/dist/assets/contacts-page-route-Na5xsrCM.js +0 -1
  221. package/dist/assets/credentials-page-DiPIjJOv.js +0 -1
  222. package/dist/assets/credit-card-CpZ4FEYf.js +0 -1
  223. package/dist/assets/debug-page-Op9gPo8_.js +0 -4
  224. package/dist/assets/developer-page-CEm6gJ5c.js +0 -1
  225. package/dist/assets/document-viewer-page-BB8CFKzx.js +0 -1
  226. package/dist/assets/emails-page-DfS8M0KH.js +0 -1
  227. package/dist/assets/esm-B1YHbxjr.js +0 -2
  228. package/dist/assets/esm-BVtejx8-.js +0 -2
  229. package/dist/assets/esm-Cag4B91R.js +0 -2
  230. package/dist/assets/esm-DlbLA_5U.js +0 -2
  231. package/dist/assets/esm-Drxb0ny0.js +0 -1
  232. package/dist/assets/esm-eTfO3z5C.js +0 -2
  233. package/dist/assets/feature-flag-catalog-C-DtLj8f.js +0 -1
  234. package/dist/assets/general-page-DRyIIgkk.js +0 -1
  235. package/dist/assets/hatching-screen-D0zBF6G3.js +0 -1
  236. package/dist/assets/home-page-route-BMbIyFRk.js +0 -1
  237. package/dist/assets/identity-page-route-BmQtmPF0.js +0 -7
  238. package/dist/assets/index-CgcZXB4g.js +0 -211
  239. package/dist/assets/index-yF00bLYk.css +0 -2
  240. package/dist/assets/integrations-page-8U6yrpy_.js +0 -1
  241. package/dist/assets/intelligence-layout-Bk61phvn.js +0 -1
  242. package/dist/assets/library-detail-page-BCRw2pXt.js +0 -1
  243. package/dist/assets/library-page-BCFKyR7R.js +0 -1
  244. package/dist/assets/list-row-9xgQystQ.js +0 -1
  245. package/dist/assets/local-mode-hyYI6_OH.js +0 -39
  246. package/dist/assets/memory-page-route-BdF70Wmp.js +0 -1
  247. package/dist/assets/memory-router-playground-page-BlT9oFs0.js +0 -3
  248. package/dist/assets/menu-DpEE6Pur.js +0 -1
  249. package/dist/assets/messages-obj2ULvb.js +0 -13
  250. package/dist/assets/middleware-DL-IveDQ.js +0 -1
  251. package/dist/assets/mutation-error-CbcKvssD.js +0 -1
  252. package/dist/assets/notifications-page-DsQJaAsR.js +0 -1
  253. package/dist/assets/panel-item-Bvqsr5n9.js +0 -1
  254. package/dist/assets/personality-page-BdkuO-Fy.js +0 -1
  255. package/dist/assets/plugin-detail-page-evKImXPP.js +0 -1
  256. package/dist/assets/plugins-page-DblHkb06.js +0 -1
  257. package/dist/assets/plugins-surface-Db6GSyl4.js +0 -1
  258. package/dist/assets/prechat-P1y7ZM6C.js +0 -1
  259. package/dist/assets/prechat-names-clVy5Mee.js +0 -1
  260. package/dist/assets/prechat-route-DcgCgSV8.js +0 -1
  261. package/dist/assets/privacy-page-Ccn6St6F.js +0 -1
  262. package/dist/assets/privacy-screen-IqygR70e.js +0 -1
  263. package/dist/assets/react-query.gen-BQH0QRfT.js +0 -1
  264. package/dist/assets/react-query.gen-BXPoln4i.js +0 -1
  265. package/dist/assets/research-onboarding-route-sFu5EQW9.js +0 -42
  266. package/dist/assets/resize-errors-B4T7-3eS.js +0 -1
  267. package/dist/assets/risk-BNYYQUrq.js +0 -3
  268. package/dist/assets/routes-XPLb07Av.js +0 -1
  269. package/dist/assets/schedules-page-DCFEdNCs.js +0 -1
  270. package/dist/assets/sdk.gen-D_Qurj4O.js +0 -6
  271. package/dist/assets/settings-layout-B_NU6GFk.js +0 -1
  272. package/dist/assets/share-feedback-modal-c0vGJBMA.js +0 -1
  273. package/dist/assets/sidebar-tree-Cq8ACYzP.js +0 -1
  274. package/dist/assets/site-favicon-B6zQaqfA.js +0 -1
  275. package/dist/assets/skill-detail-page-C_-DI2tN.js +0 -1
  276. package/dist/assets/skills-page-BhMnBhiu.js +0 -1
  277. package/dist/assets/step-indicator-dots-D03TmFKG.js +0 -1
  278. package/dist/assets/system-events-page-BWbjCZVh.js +0 -1
  279. package/dist/assets/typed-storage-CpCv7yDp.js +0 -1
  280. package/dist/assets/upgrade-cancel-page-DmdDdCjG.js +0 -1
  281. package/dist/assets/upgrade-success-page-DQoC2Y_H.js +0 -1
  282. package/dist/assets/use-active-assistant-id-9rGx8kT9.js +0 -1
  283. package/dist/assets/use-invite-link-dialog-DhVTs4OS.js +0 -1
  284. package/dist/assets/use-is-org-ready-ChwxZgjQ.js +0 -1
  285. package/dist/assets/use-skill-actions-fDejA0nc.js +0 -1
  286. package/dist/assets/use-skill-categories-DCOdxAre.js +0 -1
  287. package/dist/assets/voice-page-BRscGXct.js +0 -1
  288. package/dist/assets/workflow-detail-panel-CYjQlhPc.js +0 -1
  289. package/dist/assets/workspace-page-Dh-OnRd7.js +0 -1
  290. /package/dist/assets/{app-types-CR9QB0-8.js → app-types-DXAh2ikt.js} +0 -0
  291. /package/dist/assets/{avatar-bundled-components--1Wyhs4r.js → avatar-bundled-components-ELDcio1Z.js} +0 -0
  292. /package/dist/assets/{avatar-svg-compositor-CnDf9Ibf.js → avatar-svg-compositor-D7Dy9s1k.js} +0 -0
  293. /package/dist/assets/{ban-Ih5bAOHZ.js → ban-Bvfp1f1I.js} +0 -0
  294. /package/dist/assets/{bell-BbESwsZk.js → bell-V9BYKY__.js} +0 -0
  295. /package/dist/assets/{bookmark-Dzconbsv.js → bookmark-CjHh36q4.js} +0 -0
  296. /package/dist/assets/{brain-CMiHVWFK.js → brain-Ci5ws6Wl.js} +0 -0
  297. /package/dist/assets/{bug-YmXTm_XW.js → bug-BMI_6ziD.js} +0 -0
  298. /package/dist/assets/{build.umd-DE_kTHxO.js → build.umd-Cygy7skA.js} +0 -0
  299. /package/dist/assets/{checkbox-B2rdLpjz.js → checkbox-1DytZ46G.js} +0 -0
  300. /package/dist/assets/{client.gen-DZZugzSk.js → client.gen-DVfIRXUZ.js} +0 -0
  301. /package/dist/assets/{cpu-1TmG9m0R.js → cpu-DuPtXZt_.js} +0 -0
  302. /package/dist/assets/{create-selectors-tFGOU7xo.js → create-selectors-8NePGNlX.js} +0 -0
  303. /package/dist/assets/{definitions-DW2pQQOo.js → definitions-BEx8SBhF.js} +0 -0
  304. /package/dist/assets/{definitions-CZmL_0H7.js → definitions-yU7UnVpH.js} +0 -0
  305. /package/dist/assets/{dist-CGPrc2vu2.js → dist-DyRKd0bN2.js} +0 -0
  306. /package/dist/assets/{domains-CoWIwFeg.js → domains-CIIVdIa8.js} +0 -0
  307. /package/dist/assets/{download-CXYjvgB3.js → download-B6XjnEzx.js} +0 -0
  308. /package/dist/assets/{dropdown-BMNSccmo.js → dropdown-BxYrCXBS.js} +0 -0
  309. /package/dist/assets/{emoji-catalog-data-Do3FUA8t.js → emoji-catalog-data-D_xqkMQV.js} +0 -0
  310. /package/dist/assets/{event-bus-BG8U4Mul.js → event-bus-BNx4a0Ds.js} +0 -0
  311. /package/dist/assets/{external-link-5a-JuPGf.js → external-link-Cczz6xJ4.js} +0 -0
  312. /package/dist/assets/{eye-Cvo8rdU0.js → eye-C2rSrbD-.js} +0 -0
  313. /package/dist/assets/{eye-off-BgOJcVXo.js → eye-off-BQ9J3pF2.js} +0 -0
  314. /package/dist/assets/{file-D1SmEL-K.js → file-C8pjlmtk.js} +0 -0
  315. /package/dist/assets/{file-text-E5adVLLN.js → file-text-DA128T4K.js} +0 -0
  316. /package/dist/assets/{folder-open-9vQalGTM.js → folder-open-7DKBH5WB.js} +0 -0
  317. /package/dist/assets/{format-file-size-Dy3zTYKi.js → format-file-size-BSrdQr7P.js} +0 -0
  318. /package/dist/assets/{globe-Dx8dM0gj.js → globe-DgKSh933.js} +0 -0
  319. /package/dist/assets/{hard-drive-BxDRcYId.js → hard-drive-DVmyHlZR.js} +0 -0
  320. /package/dist/assets/{impersonate-version-flag-CjFVQtQC.js → impersonate-version-flag-DRJTfKcP.js} +0 -0
  321. /package/dist/assets/{info-DPHR_AMJ.js → info-CqgkBvyS.js} +0 -0
  322. /package/dist/assets/{is-electron-DBOtwp5h.js → is-electron-y5bNUVyG.js} +0 -0
  323. /package/dist/assets/{key-round-DY4dz3U6.js → key-round-CN4UKztQ.js} +0 -0
  324. /package/dist/assets/{link-2-BASJHEX6.js → link-2-B9c5ZsFq.js} +0 -0
  325. /package/dist/assets/{loader-circle-D57RZgLH.js → loader-circle-Ck8fq3yv.js} +0 -0
  326. /package/dist/assets/{log-in-DWnaKiOt.js → log-in-khREn0DP.js} +0 -0
  327. /package/dist/assets/{mic-DdZ0A0iw.js → mic-DEmgi4rh.js} +0 -0
  328. /package/dist/assets/{minimize-2-DM7ejF4M.js → minimize-2-dsDfFPkN.js} +0 -0
  329. /package/dist/assets/{misc-Dz1odwkI.js → misc-D0u5tzSd.js} +0 -0
  330. /package/dist/assets/{monitor-DTDBOcSy.js → monitor-BFX2ySFb.js} +0 -0
  331. /package/dist/assets/{moon-Ci1LuSVx.js → moon-h3xmz34k.js} +0 -0
  332. /package/dist/assets/{native-deep-link-B9BuDLg1.js → native-deep-link-CbHUZ2h_.js} +0 -0
  333. /package/dist/assets/{onboarding-step-layout-2XcmxqFN.js → onboarding-step-layout-zvLUIT7j.js} +0 -0
  334. /package/dist/assets/{pdf-0k9eWpTI.js → pdf-aq5Mn3GZ.js} +0 -0
  335. /package/dist/assets/{pencil-DEevs4oD.js → pencil-CsnkG5VN.js} +0 -0
  336. /package/dist/assets/{plus-CQiIB1qS.js → plus-DZZypDUF.js} +0 -0
  337. /package/dist/assets/{pointer-Cdz7NGHe.js → pointer-DcD0Nt7Z.js} +0 -0
  338. /package/dist/assets/{profile-metadata-DZwV-VFB.js → profile-metadata-BJ5STh3u.js} +0 -0
  339. /package/dist/assets/{puzzle-CL8CuOcC.js → puzzle-C894zd87.js} +0 -0
  340. /package/dist/assets/{refresh-cw-CMEIZvPt.js → refresh-cw-cau3ebz1.js} +0 -0
  341. /package/dist/assets/{repeat-CS_kgMdk.js → repeat-BhXOPeQU.js} +0 -0
  342. /package/dist/assets/{semver-CRR7tMUr.js → semver-DIkpaM51.js} +0 -0
  343. /package/dist/assets/{setting-row-BoJnQfzh.js → setting-row-Bx39umS2.js} +0 -0
  344. /package/dist/assets/{shield-check-BOKWBJve.js → shield-check-C3mmA0Pk.js} +0 -0
  345. /package/dist/assets/{signup-shell-B1qn4Jpy.js → signup-shell-BEiv8qU3.js} +0 -0
  346. /package/dist/assets/{sparkles-DDIsk_nZ.js → sparkles-BK3KXCjl.js} +0 -0
  347. /package/dist/assets/{status-badge-pill-j3ke1d9o.js → status-badge-pill-BopXdkRS.js} +0 -0
  348. /package/dist/assets/{theme-preferences-DXNlsaIE.js → theme-preferences-D58K1K0j.js} +0 -0
  349. /package/dist/assets/{three-dot-indicator-CwchtNVS.js → three-dot-indicator-DNuHHwtA.js} +0 -0
  350. /package/dist/assets/{triangle-alert-DXEpFOj_.js → triangle-alert-CnjNKhNx.js} +0 -0
  351. /package/dist/assets/{use-copy-to-clipboard-D3nUm_6n.js → use-copy-to-clipboard-BCTXSMa-.js} +0 -0
  352. /package/dist/assets/{user-plus-Jr3b-fDv.js → user-plus-KuzSTM_D.js} +0 -0
  353. /package/dist/assets/{xterm-BESsuCOb.js → xterm-DUb6-aPw.js} +0 -0
  354. /package/dist/assets/{xterm-addon-fit-CuoO7A0l.js → xterm-addon-fit-D82wciIP.js} +0 -0
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,r as n}from"./device-settings-DXp9L4iB.js";import{t as r}from"./capture-error-anSemq95.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-BQVYX8n_.js";import{m as o,t as s,u as c}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./useMutation-Lj4VunQV.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./card-D8zyWtZh.js";import{t as m}from"./createLucideIcon-Bjb-Kuq7.js";import{t as h}from"./bell-V9BYKY__.js";import{t as g}from"./check-wF3S-AV4.js";import{t as _}from"./chevron-down-DpYf9Gwq.js";import{t as v}from"./circle-alert-CTnM6GCb.js";import{t as y}from"./circle-check-DqvTjWle.js";import{o as b}from"./list-row-CFyYr-FU.js";import{t as x}from"./hard-drive-DVmyHlZR.js";import{t as S}from"./loader-circle-Ck8fq3yv.js";import{t as C}from"./monitor-BFX2ySFb.js";import{t as w}from"./moon-h3xmz34k.js";import{t as T}from"./refresh-cw-cau3ebz1.js";import{n as E,t as D}from"./resize-errors-NWH12qGQ.js";import{t as O}from"./sparkles-BK3KXCjl.js";import{t as k}from"./triangle-alert-CnjNKhNx.js";import{t as A}from"./x-CswtfvgS.js";import{t as j}from"./notice-DkAWz47A.js";import{t as M}from"./progress-bar-Bqv7D4mZ.js";import{M as N,N as P,i as F,j as I,n as ee}from"./src-BNYQ8guL.js";import{t as te}from"./tag-B6WeUtBW.js";import{t as L}from"./input-ZpyYt_a0.js";import{t as R}from"./toggle-QSEiPr3k.js";import{t as z}from"./modal-BtcwNEBj.js";import{n as B}from"./toast-Be8FEQ-I.js";import{t as V}from"./confirm-dialog-Zyfei9GV.js";import{t as ne}from"./dropdown-BxYrCXBS.js";import{E as H,O as re,S as U,c as W,d as ie,f as ae,g as oe,h as se,i as ce,nt as le,r as ue,x as de}from"./local-mode-Dydd46cS.js";import{t as G}from"./is-electron-y5bNUVyG.js";import{n as fe}from"./resolved-assistants-store-DdHm-7v4.js";import{r as pe,t as me}from"./semver-DIkpaM51.js";import{n as he,r as ge,t as _e}from"./api-errors-CoE1wFl2.js";import{D as ve,S as ye,T as be,a as xe,b as Se,g as Ce,h as we,k as Te,n as Ee,u as De,v as Oe,y as ke}from"./auth-store-CQkJpfOH.js";import{t as K}from"./client.gen-DVfIRXUZ.js";import{C as Ae,H as je,M as Me,T as Ne,X as Pe,Z as Fe,j as Ie,zt as Le}from"./sdk.gen-B3ej_AZQ.js";import{a as Re,o as ze}from"./api-Ffg_vD9E.js";import{c as q}from"./routes-Cwb-U9H-.js";import{a as Be,r as Ve}from"./platform-detection-BnBFKFxp.js";import{t as J}from"./client-feature-flag-store-D85jf9vW.js";import{t as He}from"./assistant-feature-flag-store-aNAjw1qx.js";import{t as Ue}from"./pointer-DcD0Nt7Z.js";import{t as We}from"./proxy-BzlH_XAe.js";import{t as Ge}from"./AnimatePresence-C8APSgIu.js";import{t as Ke}from"./use-reduced-motion-CcGT6CHV.js";import{Bn as qe,Dt as Je,Gn as Ye,H as Y,J as Xe,Ki as Ze,Kn as Qe,Ko as $e,M as et,Mn as tt,N as nt,Ra as rt,Rn as it,Sn as at,Un as ot,Vn as st,Wi as ct,Wn as lt,Xo as ut,Yr as dt,Zt as ft,_a as pt,_i as mt,ai as ht,ar as gt,ba as _t,bi as vt,ca as yt,di as bt,fa as xt,fi as St,ga as Ct,gi as wt,hi as Tt,ho as Et,j as Dt,mo as Ot,ns as kt,or as At,pa as jt,pi as Mt,po as Nt,ts as Pt,ui as Ft,va as It,vi as Lt,ws as Rt,xa as zt,xi as Bt,ya as Vt}from"./index-Dv7BQn1T.js";import{t as X}from"./detail-card-C2f90pfI.js";import{t as Ht}from"./app-info-LSjlWG3w.js";import{t as Ut}from"./environment-store-Bxe2pTvW.js";import{a as Wt,i as Gt,n as Kt,o as qt}from"./machine-sizes-ByPhm3J2.js";import{a as Jt,i as Yt,n as Xt,r as Zt,t as Qt}from"./assistant-status-panel-DjbXPGzE.js";import{t as $t}from"./settings-divider-jsYVGphg.js";var en=m(`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`}]]),tn=m(`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(i(),1),Q=f();function nn(){let e=J.use.velvet(),{theme:t,setThemePreference:n}=at(),r=[{value:`system`,label:`System`,icon:(0,Q.jsx)(C,{className:`h-4 w-4`})},{value:`light`,label:`Light`,icon:(0,Q.jsx)($e,{className:`h-4 w-4`})},{value:`dark`,label:`Dark`,icon:(0,Q.jsx)(w,{className:`h-4 w-4`})},...e?[{value:`velvet`,label:`Velvet`,icon:(0,Q.jsx)(Rt,{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)(I,{ariaLabel:`Theme`,value:t,onChange:n,items:r})})]})}var rn=we,an=`Please choose a different handle.`;async function on(e,t){let{data:n,error:r,response:i}=await Me({path:{id:e},body:{handle:t},throwOnError:!1});if(!i)return{kind:`error`,message:ge(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}=Se(r,`handle`,rn.taken);return{kind:`taken`,message:e}}if(i.status===400){let{code:e,message:t}=Se(r,`handle`,an);return{kind:`invalid`,code:e,message:t}}return{kind:`error`,message:ge(r,i,`Failed to save handle.`)}}async function sn(e,t,n){let{data:r,error:i,response:a}=await Ae({path:{assistant_id:e},query:{handle:t},signal:n,throwOnError:!1});if(he(a,i,`Failed to check handle availability.`),!a.ok||!r)throw new _e(a.status,a.status===429?`Too many checks — try again in a moment.`:ge(i,a,`Failed to check handle availability.`));return{available:r.available,code:r.code??null,message:r.message??null}}function cn(e){return/\d{2,}$/.test(e)}var ln=300,un=1400;function dn({initialHandle:e,inputLabel:t,helperText:n,idleHelperText:r,checkAvailable:i,save:o,onSaved:s,saveSuccessToast:c,fieldId:l}){let[u,d]=(0,Z.useState)(e),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),[_,y]=(0,Z.useState)(`idle`),[b,x]=(0,Z.useState)(null),C=Ke(),w=(0,Z.useRef)(null),T=(0,Z.useMemo)(()=>u.trim().toLowerCase(),[u]),E=T===e.toLowerCase();(0,Z.useEffect)(()=>{if(E||T.length===0){h(!1),w.current?.abort();return}let e=new AbortController;w.current?.abort(),w.current=e,h(!0);let t=window.setTimeout(async()=>{try{let t=await i(T,e.signal);e.signal.aborted||p(t)}catch(t){e.signal.aborted||x(t instanceof Error?t.message:`Couldn't check availability.`)}finally{e.signal.aborted||h(!1)}},ln);return()=>{window.clearTimeout(t),e.abort()}},[T,E,i]);let D=(()=>{if(b)return b;if(f&&!f.available){let e=f.code;return f.message??(e?rn[e]:`Please choose a different handle.`)}return null})(),O=D?n:E?r??null:m?`Checking availability…`:f?.available?`Available.`:null,k=!E&&!m&&f?.available!==!1&&_!==`saving`,A=(0,Z.useCallback)(async()=>{if(!k)return;y(`saving`),x(null);let e=await o(T);if(e.kind===`ok`){y(`saved`),s(e.data),B.success(c),window.setTimeout(()=>y(`idle`),un);return}if(e.kind===`taken`){y(`idle`),p({available:!1,code:`taken`,message:e.message});return}if(e.kind===`invalid`){y(`idle`),p({available:!1,code:e.code,message:e.message});return}y(`error`),x(e.message),B.error(e.message)},[k,T,s,o,c]),j=(()=>{if(E&&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)(Ge,{mode:`wait`,initial:!1,children:(0,Q.jsxs)(We.span,{initial:C?!1:{opacity:0,scale:.85},animate:{opacity:1,scale:1},exit:C?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)(S,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),e===`available`&&(0,Q.jsx)(g,{className:`h-4 w-4 text-[var(--system-positive-strong)]`,"aria-label":`Available`}),e===`invalid`&&(0,Q.jsx)(v,{className:`h-4 w-4 text-[var(--system-negative-strong)]`,"aria-label":`Not available`})]},e)}):null})(),M=(()=>{switch(_){case`saving`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(S,{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)(g,{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)(L,{label:t,value:u,onChange:e=>{d(e.target.value.replace(/\s+/g,``)),p(null),x(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:D??void 0,helperText:O??void 0,"aria-invalid":!!D,fullWidth:!0,"data-testid":`${l}-input`}),(!E||_!==`idle`)&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(a,{variant:`primary`,size:`compact`,onClick:A,disabled:!k,"aria-live":`polite`,"data-testid":`${l}-save`,children:M})})]})}function fn({initial:e,onSaved:t}){let n=Ee.use.refreshSession(),r=cn(e.username)?`Your handle was auto-generated at signup — pick one you like.`:void 0,i=(0,Z.useCallback)(async e=>await ke({username:e}),[]),a=(0,Z.useCallback)((e,t)=>Ce(e,t),[]),o=(0,Z.useCallback)(e=>{t(e),n()},[t,n]);return(0,Q.jsx)(dn,{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=u({...dt({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 on(e.id,t),[e.id]),c=(0,Z.useCallback)((t,n)=>sn(e.id,t,n),[e.id]);return i?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(L,{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)(s,{to:`${q.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)(dn,{initialHandle:n,inputLabel:`Assistant handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:a,checkAvailable:c,save:o,onSaved:t,saveSuccessToast:`Assistant handle updated.`,fieldId:`assistant-handle`})}function mn(){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)(`div`,{className:`h-3 w-16 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-9 w-full animate-pulse rounded-md bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-3 w-72 animate-pulse rounded bg-[var(--surface-muted)]`})]}),(0,Q.jsx)(`div`,{className:`h-9 w-full animate-pulse rounded-md bg-[var(--surface-muted)]`}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`div`,{className:`h-3 w-60 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-7 w-16 animate-pulse rounded-md bg-[var(--surface-muted)]`})]}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Loading your profile…`})]})}function hn(){return(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`})}function gn({assistant:e,showHandles:t=!0,children:n}={}){let r=Ee.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)(L,{label:`Email`,value:r,disabled:!0,readOnly:!0})}),t&&(0,Q.jsxs)(Q.Fragment,{children:[r&&(0,Q.jsx)(hn,{}),(0,Q.jsx)(_n,{assistant:e})]}),n!=null&&(0,Q.jsxs)(Q.Fragment,{children:[(r||t)&&(0,Q.jsx)(hn,{}),n]})]})})}function _n({assistant:e}){let[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null),a=Ke(),[o,s]=(0,Z.useState)(e??null);return(0,Z.useEffect)(()=>{s(e??null)},[e]),(0,Z.useEffect)(()=>{let e=!1;return Oe().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)(We.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)(fn,{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)(mn,{})}var vn=ht({query:{hosting:`platform`}});function yn(){let e=Xe(),t=u(vn),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)(C,{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)(te,{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)(g,{className:`h-4 w-4`}),`Active`]}):(0,Q.jsx)(a,{variant:`outlined`,size:`compact`,disabled:t.status!==`active`,onClick:()=>{Te(t.id),B.success(`Switched active assistant.`)},children:`Switch`})})]},t.id)})})})}var bn=[{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 xn(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 Sn({assistantId:e}){let t=l(),n=Ut.use.isNonProduction(),r=(0,Z.useMemo)(()=>bn.filter(e=>!e.devOnly||n),[n]),{data:i,isLoading:o,isError:s}=u(mt({path:{id:e}})),c=(0,Z.useMemo)(()=>i?.idle_timeout_seconds??259200,[i]),[d,f]=(0,Z.useState)(null),p=d??c,m=d!==null,h=jt({onSuccess:()=>{B.success(`Sleep policy saved.`),f(null),t.invalidateQueries({queryKey:Lt({path:{id:e}})})},onError:()=>{B.error(`Failed to save sleep policy. Please try again.`)}});return o?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(S,{className:`h-4 w-4 animate-spin`}),`Loading sleep settings...`]}):s?(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)(a,{variant:`outlined`,active:p===e.seconds,onClick:()=>f(e.seconds),children:e.label},e.seconds))}),(0,Q.jsxs)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:[`Current: `,xn(p)]})]}),m&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(a,{variant:`primary`,leftIcon:h.isPending?(0,Q.jsx)(S,{className:`animate-spin`}):void 0,onClick:()=>h.mutate({path:{id:e},body:{idle_timeout_seconds:p}}),disabled:h.isPending,children:`Save`}),(0,Q.jsx)(a,{variant:`outlined`,onClick:()=>f(null),disabled:h.isPending,children:`Cancel`})]})]})}function Cn(e,t,n){let r=[e.version];return e.version===n&&r.push(`(latest)`),t&&e.version===t&&r.push(`(current)`),r.join(` `)}var wn=3e3;function Tn({version:e,assistantId:t}){let{onTap:n,message:r}=Yt(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 En({assistantId:e,currentVersion:t,releaseChannel:n,onUpgradeComplete:r}){let i=He.use.rollbackEnabled(),o=J.use.previewChannel(),s=l(),c=lt(n,o),f=c===`preview`,[p,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),[C,w]=(0,Z.useState)(null),E=e=>e&&h.current&&e===h.current?(queueMicrotask(()=>{w(b?`Successfully rolled back to version ${h.current}.`:`Successfully updated to version ${h.current}.`),m(!1),h.current=null,_(null),B.success(b?`Rollback complete — assistant is healthy.`:`Update complete — assistant is healthy.`,{id:`runtime-upgrade-complete`,tone:`strong`}),r?.()}),!1):wn;u({...Tt({path:{id:e}}),refetchInterval:p?e=>E(e.state.data?.current_release_version):!1});let{data:D,isLoading:O}=u(yt({query:{channel:c}})),k=D?.find(e=>e.is_stable!==!1)??D?.[0],A=g??k?.version??null,j=(0,Z.useMemo)(()=>{if(!i||!A||!t)return!1;let e=pe(A),n=pe(t);return!e||!n?!1:me(e,n)<0},[i,A,t]),M=(0,Z.useMemo)(()=>{if(!A)return!1;if(!t)return!0;let e=pe(A),n=pe(t);if(!e||!n)return A!==t;let r=me(e,n);return i?r!==0:r>0},[i,A,t]),N=d({mutationFn:async t=>{let{data:n}=await Pe({path:{id:e},body:t,throwOnError:!0});return n}}),P=d({mutationFn:async t=>{let{data:n}=await je({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)(Tn,{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:f?`Preview release`:M?j?`Rollback to`:`Update to`:`Selected`}),(0,Q.jsx)(`span`,{className:`block min-w-0`,children:O?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(S,{className:`h-3 w-3 animate-spin`}),`Loading...`]}):D&&D.length>0?i?(0,Q.jsx)(ne,{value:A??``,onChange:e=>_(e===k?.version?null:e),disabled:p||N.isPending||P.isPending,options:D.map(e=>({value:e.version,label:Cn(e,t,k?.version)}))}):(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:k?Cn(k,t,k.version):`—`}):`No releases available`})]})]}),(0,Q.jsx)(a,{variant:j?`outlined`:`primary`,className:`min-w-[160px]`,leftIcon:N.isPending||P.isPending||p?(0,Q.jsx)(S,{className:`animate-spin`}):(0,Q.jsx)(T,{}),onClick:()=>y(!0),disabled:!M||N.isPending||P.isPending||p||O||!D?.length,children:p?b?`Rolling back...`:`Updating...`:j?`Rollback`:f?`Update preview`:`Update`}),f&&(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`})]}),!M&&t&&A&&!O&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:C??`You are already on this version.`}),(0,Q.jsx)(V,{open:v,title:j?`Rollback assistant`:f?`Update preview release`:`Update assistant`,message:j?`Rollback to version ${A??`unknown`}? The assistant will be briefly unavailable.`:f?`Update to preview version ${A??`latest`}? The assistant will be briefly unavailable during the update.`:`Update to version ${A??`latest`}? The assistant will be briefly unavailable during the update.`,confirmLabel:j?`Rollback`:f?`Update preview`:`Update`,onConfirm:async()=>{y(!1),w(null);let t=g??void 0;try{if(j){let e=await P.mutateAsync({version:t});h.current=e.version??t??null,B.success(e.detail||`Rollback to ${t} initiated.`)}else{let e=await N.mutateAsync({version:t});if(e.detail?.includes(`Already on the latest`)){B.warning(e.detail);return}h.current=e.version??t??null,B.success(e.detail||`Update to ${e.version??t??`latest`} initiated.`)}x(j),m(!0),s.invalidateQueries({queryKey:wt({path:{id:e}})})}catch{B.error(j?`Failed to trigger rollback. Please try again.`:`Failed to trigger update. Please try again.`)}},onCancel:()=>y(!1)})]})}function Dn({assistantId:e,currentVersion:t,onUpgradeComplete:n}){let[r,i]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),{data:c,isLoading:l}=u(yt({query:{stable:!0,limit:100}})),d=(0,Z.useMemo)(()=>ot(c),[c]),f=d?.version,p=t?Ye(t,f):!!f,m=Qe({assistantId:e,targetVersion:f});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)(Tn,{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...`:f&&d?Cn(d,t,f):`No releases available`})]})]}),(0,Q.jsx)(a,{variant:`primary`,className:`min-w-[160px]`,leftIcon:m.isPending?(0,Q.jsx)(S,{className:`animate-spin`}):(0,Q.jsx)(T,{}),onClick:()=>i(!0),disabled:m.isPending||l||!f||!p,children:m.isPending?`Updating...`:f?`Update to ${f}`:`Update`}),o&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:o}),!o&&!p&&f&&!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)(V,{open:r,title:`Update assistant`,message:`Update to version ${f??`latest`}? The assistant will be briefly unavailable during the update.`,confirmLabel:`Update`,onConfirm:async()=>{i(!1),s(null);try{let e=await m.upgrade();s(e.version?`Successfully updated to version ${e.version}.`:`Successfully updated to version ${f??`latest`}.`),B.success(`Update complete — assistant is healthy.`,{id:`runtime-upgrade-complete`,tone:`strong`}),n?.()}catch(e){B.error(e instanceof Error?e.message:`Failed to trigger update. Please try again.`)}},onCancel:()=>i(!1)})]})}function On(){let e=Et({platformHostedOnly:!0}),t=Ot(),n=Ee.use.user()?.id??null,r=Ee.use.logout(),[i,o]=(0,Z.useState)(!1),s=Ct({onSuccess:async()=>{B.success(`Account deletion requested. You will be logged out shortly.`),De(n),await r(),rt(q.account.login)},onError:()=>{B.error(`Failed to request account deletion. Please try again.`)}}),c=e===`full`&&t;return(0,Z.useEffect)(()=>{c&&i&&o(!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)(a,{variant:`dangerOutline`,onClick:()=>o(!0),disabled:s.isPending||c,className:`self-start`,children:`Delete My Account`}),c&&(0,Q.jsx)(S,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`})]})})]}),(0,Q.jsx)(V,{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){o(!1);return}o(!1),s.mutate({})},onCancel:()=>o(!1)})]})}function kn({title:e,subtitle:t,benefits:n,ctaLabel:r,ctaLeftIcon:i,onAction:o}){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)(a,{variant:`primary`,size:`regular`,leftIcon:i,onClick:o,className:`self-start`,children:r})]})})}function An(){return Be()?(0,Q.jsx)(kn,{title:`Get the iOS App`,subtitle:`The Vellum iOS app gives you a native experience.`,benefits:[{icon:h,text:`Push notifications`},{icon:en,text:`Biometric login`},{icon:tn,text:`Native haptics`},{icon:ut,text:`Home screen access`}],ctaLabel:`Download`,ctaLeftIcon:(0,Q.jsx)(ut,{size:16}),onAction:()=>{et(),Dt()}}):null}async function jn(){if(!G())return[];let e=window.vellum;return e?.hotkeys?e.hotkeys.get():[]}async function Mn(e,t){if(!G())return;let n=window.vellum;n?.hotkeys&&await n.hotkeys.set(e,t)}function Nn(e){if(!G())return()=>{};let t=window.vellum;return t?.hotkeys?t.hotkeys.onChange(e):()=>{}}var Pn={ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`,Enter:`Return`,NumpadEnter:`Return`,Space:`Space`,Tab:`Tab`,Escape:`Escape`,Backspace:`Backspace`,Delete:`Delete`,Insert:`Insert`,Home:`Home`,End:`End`,PageUp:`PageUp`,PageDown:`PageDown`,Minus:`-`,Equal:`=`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Semicolon:`;`,Quote:`'`,Backquote:"`",Comma:`,`,Period:`.`,Slash:`/`},Fn=new Set([`MetaLeft`,`MetaRight`,`ControlLeft`,`ControlRight`,`AltLeft`,`AltRight`,`ShiftLeft`,`ShiftRight`]),In=e=>{let t=e.code;return Fn.has(t)?null:/^Key[A-Z]$/.test(t)?t.slice(3):/^Digit[0-9]$/.test(t)?t.slice(5):/^Numpad[0-9]$/.test(t)?`num${t.slice(6)}`:/^F[0-9]{1,2}$/.test(t)?t:Pn[t]??null},Ln=e=>{let t=In(e);if(t===null)return null;let n=[];return e.metaKey&&n.push(`CmdOrCtrl`),e.ctrlKey&&n.push(`Control`),e.altKey&&n.push(`Alt`),e.shiftKey&&n.push(`Shift`),[...n,t].join(`+`)},Rn=(e,t,n)=>n===``?null:e.find(e=>e.key!==t&&e.accelerator===n)??null,zn=[{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 Bn({hotkey:e,recording:t,conflictLabel:n,onStartRecording:r,onCancelRecording:i,onReset:o,onRemove:s}){let c=e.accelerator===``,l=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:[t?(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Recording… press a shortcut, or Esc to cancel`}):c?(0,Q.jsx)(`span`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`Disabled`}):(0,Q.jsx)(ee,{accelerator:e.accelerator}),t?(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,onClick:i,children:`Cancel`}):(0,Q.jsx)(a,{variant:`outlined`,size:`compact`,onClick:r,"aria-label":`Record shortcut for ${e.label}`,children:`Record`}),(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,disabled:!l,leftIcon:(0,Q.jsx)(Pt,{className:`h-3.5 w-3.5`}),onClick:o,"aria-label":`Reset ${e.label} to default`}),(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,disabled:c,leftIcon:(0,Q.jsx)(A,{className:`h-3.5 w-3.5`}),onClick:s,"aria-label":`Remove ${e.label} binding`})]})]})}function Vn(){let[e,t]=(0,Z.useState)([]),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(null),o=(0,Z.useCallback)(()=>{jn().then(t)},[]);(0,Z.useEffect)(()=>(o(),Nn(t)),[o]);let s=(0,Z.useCallback)(()=>{r(null),a(null)},[]);(0,Z.useEffect)(()=>{if(n===null)return;let t=t=>{if(t.preventDefault(),t.stopPropagation(),t.code===`Escape`){s();return}let r=Ln(t);if(r===null)return;let i=Rn(e,n,r);if(i!==null){a({key:n,label:i.label});return}Mn(n,r).then(o),s()};return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[n,e,o,s]);let c=(0,Z.useCallback)(e=>{a(null),r(e)},[]),l=(0,Z.useCallback)(t=>{let n=Rn(e,t,e.find(e=>e.key===t)?.defaultAccelerator??``);if(n!==null){r(null),a({key:t,label:n.label});return}s(),Mn(t,null).then(o)},[e,o,s]),u=(0,Z.useCallback)(e=>{s(),Mn(e,``).then(o)},[o,s]),d=(0,Z.useMemo)(()=>zn.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:[i!==null&&(0,Q.jsxs)(j,{tone:`warning`,children:[`That shortcut is already used by `,i.label,`.`,` `,n===null?`Remove or change that binding before resetting.`:`Pick a different combination, or press Esc to cancel.`]}),d.map(e=>(0,Q.jsxs)(p,{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)(Bn,{hotkey:e,recording:n===e.key,conflictLabel:i!==null&&i.key===e.key?i.label:null,onStartRecording:()=>c(e.key),onCancelRecording:s,onReset:()=>l(e.key),onRemove:()=>u(e.key)},e.key))})]},e.scope))]})}async function Hn(){if(!G())return!1;let e=window.vellum;return e?.launchAtLogin?e.launchAtLogin.get():!1}async function Un(e){if(!G())return;let t=window.vellum;t?.launchAtLogin&&await t.launchAtLogin.set(e)}function Wn(){let e=nt.useValue();if(Ue())return null;let t=Ve()?`Cmd`:`Ctrl`;return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Composer`}),(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(R,{checked:e,onChange:nt.save,label:`Send with ${t}+Enter`,helperText:`When enabled, Enter inserts a new line and ${t}+Enter sends.`})})]})}function Gn(){let[e,t]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{Hn().then(t)},[]);let n=async e=>{t(e);try{await Un(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)(R,{checked:e,onChange:e=>void n(e),"aria-label":`Launch at Login`})})]})}function Kn({open:e,onClose:t}){return(0,Q.jsx)(z.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,Q.jsxs)(z.Content,{size:`lg`,children:[(0,Q.jsxs)(z.Header,{children:[(0,Q.jsx)(z.Title,{children:`Preferences`}),(0,Q.jsx)(z.Description,{children:`Customize shortcuts and how Vellum behaves on this device.`})]}),(0,Q.jsx)(z.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[G()&&(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)(Vn,{})})]}),(0,Q.jsx)(Wn,{}),G()&&(0,Q.jsx)(Gn,{})]})})]})})}function qn(e){return e===`preview`?`preview`:`stable`}function Jn(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 Yn(e){return e.source_release_version?`Stable ${e.source_release_version}`:e.snapshot_name}function Xn(e){return e.filter(e=>e.ready_to_use)}function Zn(e){return e?.feature_enabled===!1}function Qn({assistantId:e,onComplete:t}){let n=J.use.previewChannel(),r=l(),[i,a]=(0,Z.useState)(),[o,s]=(0,Z.useState)(!1),[c,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(`restore_backup`),[h,g]=(0,Z.useState)(``),v=St({path:{assistant_id:e}}),y=Mt({path:{assistant_id:e}}),b=wt({path:{id:e}}),{data:x,isLoading:C,isError:w}=u({...v,enabled:n,retry:!1}),T=x?.preview_backups??[],E=(0,Z.useMemo)(()=>Xn(T),[T]),D=E[0],O=E.find(e=>e.snapshot_name===h)??D,k=()=>{r.invalidateQueries({queryKey:y}),r.invalidateQueries({queryKey:b}),t?.()},A=d(Ft()),M=d(bt()),N=qn(x?.current_channel),P=A.isPending||M.isPending,I=P||Zn(x)||!x?.latest_preview_release,ee=p===`restore_backup`&&!O;if((0,Z.useEffect)(()=>{a(N===`preview`?`release-channel`:void 0)},[N]),!n)return null;let L=x?.standard_upgrade_available??!1;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F.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)(F.Item,{value:`release-channel`,id:`preview-release-channel`,children:[(0,Q.jsxs)(F.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`}),x&&(0,Q.jsx)(te,{tone:N===`preview`?`warning`:`neutral`,children:N===`preview`?`Preview`:`Stable`})]}),(0,Q.jsx)(_,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(F.Content,{children:(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[C&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(S,{className:`h-4 w-4 animate-spin`}),`Loading release channel...`]}),w&&(0,Q.jsx)(j,{tone:`error`,title:`Could not load release channel status`,children:`Refresh this page before changing release channels.`}),x&&(0,Q.jsxs)(Q.Fragment,{children:[Zn(x)&&(0,Q.jsx)(j,{tone:`neutral`,title:`Preview channel is unavailable`,children:`The Preview channel is not enabled for this assistant.`}),N===`stable`?(0,Q.jsx)($n,{status:x,isChangingChannel:P,optInDisabled:I,onOptIn:()=>s(!0)}):(0,Q.jsx)(er,{status:x,isChangingChannel:P,onOptOut:()=>{let e=D;g(e?.snapshot_name??``),m(e?`restore_backup`:L?`standard_upgrade`:`restore_backup`),f(!0)}})]})]})})]})}),(0,Q.jsx)(nr,{open:o,isPending:A.isPending,previewVersion:x?.latest_preview_release?.version,onConfirm:async()=>{try{let t=await A.mutateAsync({path:{assistant_id:e}});B.success(t.detail||`Preview channel enabled.`),s(!1),k()}catch(e){B.error(ge(e,void 0,`Could not enable Preview channel.`))}},onCancel:()=>s(!1)}),(0,Q.jsx)(rr,{open:c,backups:E,mode:p,selectedSnapshotName:O?.snapshot_name??``,isPending:M.isPending,restoreModeDisabled:ee,standardUpgradeAvailable:L,onModeChange:m,onSnapshotChange:g,onConfirm:async()=>{if(!ee)try{let t=await M.mutateAsync({path:{assistant_id:e},body:p===`restore_backup`?{mode:`restore_backup`,snapshot_name:O?.snapshot_name}:{mode:`standard_upgrade`}});B.success(t.detail||`Stable channel enabled.`),f(!1),k()}catch(e){B.error(ge(e,void 0,`Could not switch to Stable.`))}},onCancel:()=>f(!1)})]})}function $n({status:e,isChangingChannel:t,optInDisabled:n,onOptIn:r}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(tr,{status:e}),!e.latest_preview_release&&(0,Q.jsx)(j,{tone:`neutral`,title:`No Preview release is available`,children:`Stable remains the only available release channel.`}),(0,Q.jsx)(a,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(S,{className:`animate-spin`}):(0,Q.jsx)(kt,{}),disabled:n,onClick:r,children:`Opt in to Preview`})]})}function er({status:e,isChangingChannel:t,onOptOut:n}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(tr,{status:e}),(0,Q.jsx)(a,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(S,{className:`animate-spin`}):(0,Q.jsx)(Pt,{}),disabled:t,onClick:n,children:`Switch back to Stable`})]})}function tr({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 nr({open:e,isPending:t,previewVersion:n,onConfirm:r,onCancel:i}){return(0,Q.jsx)(z.Root,{open:e,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(z.Content,{size:`md`,hideCloseButton:t,children:[(0,Q.jsxs)(z.Header,{children:[(0,Q.jsx)(z.Title,{icon:k,children:`Opt in to Preview`}),(0,Q.jsx)(z.Description,{children:`Preview releases may be unstable. A 90-day safety backup is taken before the image changes.`})]}),(0,Q.jsx)(z.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(j,{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)(z.Footer,{children:[(0,Q.jsx)(a,{variant:`outlined`,disabled:t,onClick:i,children:`Cancel`}),(0,Q.jsx)(a,{variant:`primary`,disabled:t,leftIcon:t?(0,Q.jsx)(S,{className:`animate-spin`}):(0,Q.jsx)(kt,{}),onClick:r,children:t?`Switching...`:`Take Backup and Switch`})]})]})})}function rr({open:e,backups:t,mode:n,selectedSnapshotName:r,isPending:i,restoreModeDisabled:o,standardUpgradeAvailable:s,onModeChange:c,onSnapshotChange:l,onConfirm:u,onCancel:d}){return(0,Q.jsx)(z.Root,{open:e,onOpenChange:e=>!e&&d(),children:(0,Q.jsxs)(z.Content,{size:`md`,hideCloseButton:i,children:[(0,Q.jsxs)(z.Header,{children:[(0,Q.jsx)(z.Title,{icon:k,children:`Switch back to Stable`}),(0,Q.jsx)(z.Description,{children:`Choose how this assistant should leave the Preview channel.`})]}),(0,Q.jsx)(z.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(P,{value:n,onValueChange:c,disabled:i,"aria-label":`Stable channel return method`,children:[(0,Q.jsx)(N,{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)(N,{value:`standard_upgrade`,disabled:!s,label:`Switch to Stable without restoring backup`,helperText:s?`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)(ne,{value:r,onChange:l,disabled:i,options:t.map(e=>({value:e.snapshot_name,label:`${Yn(e)} - ${Jn(e.created_at)}`}))})]}),n===`restore_backup`&&t.length===0&&!s&&(0,Q.jsx)(j,{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)(j,{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)(z.Footer,{children:[(0,Q.jsx)(a,{variant:`outlined`,disabled:i,onClick:d,children:`Cancel`}),(0,Q.jsx)(a,{variant:n===`standard_upgrade`?`danger`:`primary`,disabled:i||o||n===`standard_upgrade`&&!s,leftIcon:i?(0,Q.jsx)(S,{className:`animate-spin`}):(0,Q.jsx)(T,{}),onClick:u,children:i?`Switching...`:`Switch to Stable`})]})]})})}function ir({assistant:e,healthz:t,healthzLoading:n,healthzPolling:r,refetch:i,refetchUntilResized:o}){let l=c(),d=u(Ze()),f=d.data,p=!e.is_local,m=f?.plan_id===`pro`,h=u({...ct(),enabled:m}),g=e.machine_size||`small`,_=Gt(h.data?.max_machine_tier??null),v=(0,Z.useMemo)(()=>Wt(_,g,(0,Q.jsx)(te,{tone:`positive`,children:`Current`})),[_,g]),y=h.data?.selected_storage_gib??null,[b,C]=(0,Z.useState)(!1),w=_.length>0?_[_.length-1]:null,[k,A]=(0,Z.useState)(null),M=k??w??g,[N,P]=(0,Z.useState)(null),[F,I]=(0,Z.useState)(null),ee=xt({onSuccess:(e,n)=>{B.success(`Resize started. Changes will apply shortly.`,{id:`assistant-resize`}),I(null),A(null),C(!1),n.body?.machine_size==null?i():o(t)},onError:e=>{I(D(e,`Failed to resize assistant. Please try again.`))}});if(d.isError&&f==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)(j,{tone:`error`,children:`Could not load your subscription. Please try again.`})});let L=m&&_.includes(M)&&M!==g?M:null,R=m&&y!=null&&!0,V=m&&_.length>0&&qt(g)<qt(_[_.length-1]),H=ee.isPending||r,re=y==null?t?.disk?.totalMb??null:y*1024,U=t?.disk&&re!=null?{value:t.disk.usedMb,max:re,caption:`${Qt(t.disk.usedMb)} of ${Qt(re)}`}:null,W=t?.cpu?{value:t.cpu.currentPercent,max:100,caption:`${t.cpu.currentPercent.toFixed(1)}%`}:null,ie=t?.memory?{value:t.memory.currentMb,max:t.memory.maxMb,caption:`${Qt(t.memory.currentMb)} of ${Qt(t.memory.maxMb)}`}:null,ae=p?m?R?(0,Q.jsxs)(`button`,{type:`button`,disabled:H,onClick:()=>C(!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)(O,{className:`h-3.5 w-3.5`}),`Increase Storage`]}):(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,disabled:H,onClick:()=>C(!0),children:`Resize`}):(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,onClick:()=>P(`storage`),children:`Resize`}):null,oe=p?m?V?(0,Q.jsxs)(`button`,{type:`button`,disabled:H,onClick:()=>C(!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)(O,{className:`h-3.5 w-3.5`}),`Increase Size`]}):(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,disabled:H,onClick:()=>C(!0),children:`Resize`}):(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,onClick:()=>P(`machine`),children:`Resize`}):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)(a,{variant:`ghost`,size:`compact`,iconOnly:n||r?(0,Q.jsx)(S,{className:`animate-spin`}):(0,Q.jsx)(T,{}),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)(x,{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`}),U?(0,Q.jsx)(Jt,{value:U.value,max:U.max,caption:U.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(S,{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)(E,{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)(te,{tone:`neutral`,children:Kt[g]})]}),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`}),W?(0,Q.jsx)(Jt,{value:W.value,max:W.max,caption:W.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(S,{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`}),ie?(0,Q.jsx)(Jt,{value:ie.value,max:ie.max,caption:ie.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(S,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]})]})]})]})}),(0,Q.jsx)(z.Root,{open:N!=null,onOpenChange:e=>{e||P(null)},children:(0,Q.jsxs)(z.Content,{size:`sm`,children:[(0,Q.jsxs)(z.Header,{children:[(0,Q.jsx)(z.Title,{children:`Upgrade to Pro`}),(0,Q.jsx)(z.Description,{children:N===`storage`?`Upgrade to the Pro plan to increase your storage allocation and get more space for your assistant.`:`Upgrade to the Pro plan to unlock larger machine sizes with more CPU and memory for your assistant.`})]}),(0,Q.jsxs)(z.Footer,{children:[(0,Q.jsx)(a,{variant:`ghost`,onClick:()=>P(null),children:`Cancel`}),(0,Q.jsx)(a,{onClick:()=>{P(null),l(`${q.settings.usage}?tab=billing&adjust_plan=1`)},children:`Upgrade`})]})]})}),(0,Q.jsx)(z.Root,{open:b,onOpenChange:e=>{e||(C(!1),A(null),I(null))},children:(0,Q.jsxs)(z.Content,{size:`sm`,children:[(0,Q.jsxs)(z.Header,{children:[(0,Q.jsx)(z.Title,{icon:E,children:`Resize Assistant`}),(0,Q.jsx)(z.Description,{children:`Resize your assistant's compute and storage. Your assistant will briefly restart.`})]}),(0,Q.jsx)(z.Body,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[_.length===0?(0,Q.jsx)(j,{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)(ne,{options:v,value:M,onChange:A,"aria-label":`Compute machine size`,"data-testid":`resize-machine-size`})]}),R?(0,Q.jsx)(j,{tone:`info`,children:`Storage will be expanded to ${y} GiB.`}):(0,Q.jsx)(j,{tone:`neutral`,children:`Storage will not change.`}),F&&(0,Q.jsx)(j,{tone:`error`,children:F})]})}),(0,Q.jsxs)(z.Footer,{className:`items-center justify-between`,children:[(0,Q.jsxs)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:[`Need more?`,` `,(0,Q.jsx)(s,{to:`${q.settings.usage}?tab=billing&adjust_plan=1`,className:`text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 transition-colors hover:text-[var(--content-default)]`,onClick:()=>C(!1),children:`Upgrade plan`})]}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(a,{variant:`ghost`,onClick:()=>{C(!1),A(null),I(null)},children:`Cancel`}),(0,Q.jsx)(a,{disabled:L==null&&!R||H,leftIcon:H?(0,Q.jsx)(S,{className:`animate-spin`}):void 0,onClick:()=>{I(null);let t={};L!=null&&(t.machine_size=L),R&&y!=null&&(t.storage_gib=y),ee.mutate({path:{id:e.id},body:t})},children:F?`Retry`:`Apply`})]})]})]})})]})}function ar({assistantId:e}){let t=c(),[n,r]=(0,Z.useState)(!1),[i,o]=(0,Z.useState)(!1);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(a,{variant:`dangerOutline`,onClick:()=>r(!0),className:`shrink-0`,children:`Retire Assistant`}),(0,Q.jsx)(gt,{open:n,isPending:i,onConfirm:async()=>{o(!0);let n=await At(e);if(n.ok){r(!1),t(n.nextRoute,{replace:!0});return}B.error(n.error),o(!1),r(!1)},onCancel:()=>r(!1)})]})}function or(){let e=st(),t=it.useValue();return qe(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)(R,{checked:t,onChange:t=>{it.save(t),t||tt(`settings`,`dont_show_again`,e)},"aria-label":`Show tips`})]}):null}var sr=`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 cr(){let e=Intl;if(typeof e.supportedValuesOf==`function`)try{let t=e.supportedValuesOf(`timeZone`);if(t.length>0)return[...t].sort()}catch{}return[...sr].sort()}function lr(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 ur(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`2-digit`,hour12:!0}).format(new Date)}catch{return``}}function dr(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,` `)}function fr({value:e,onChange:t}){let[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null),u=(0,Z.useMemo)(()=>cr().map(e=>lr(e)).filter(e=>e!==null),[]);(0,Z.useEffect)(()=>{let e=window.setTimeout(()=>{a(n.trim().toLowerCase())},200);return()=>window.clearTimeout(e)},[n]),(0,Z.useEffect)(()=>{if(!o)return;let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]);let d=(0,Z.useMemo)(()=>i?u.filter(e=>e.city.toLowerCase().includes(i)||e.region.toLowerCase().includes(i)||e.offsetLabel.toLowerCase().includes(i)||e.identifier.toLowerCase().includes(i)):u,[u,i]),f=(0,Z.useMemo)(()=>{if(!e)return``;let t=e.split(`/`);return(t[t.length-1]??e).replace(/_/g,` `)},[e]),p=e=>{t(e),r(``),s(!1),l.current?.blur()};return(0,Q.jsxs)(`div`,{ref:c,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)(`div`,{className:`relative w-full md:max-w-[280px]`,children:[(0,Q.jsx)(L,{ref:l,type:`text`,value:n,placeholder:f||`Search city or country...`,onChange:e=>{r(e.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:e=>{e.key===`Escape`&&(r(``),s(!1),l.current?.blur())},fullWidth:!0}),o&&d.length>0&&(0,Q.jsx)(`div`,{className:`absolute left-0 right-0 top-full z-20 mt-1 max-h-[240px] overflow-y-auto rounded-md border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-lg`,children:d.slice(0,200).map(t=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>p(t.identifier),className:`flex w-full cursor-pointer items-center justify-between gap-3 px-3 py-2 text-left text-body-medium-lighter transition-colors ${t.identifier===e?`bg-[var(--surface-active)] text-[var(--content-default)]`:`text-[var(--content-default)] hover: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:t.city}),t.region&&(0,Q.jsx)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:t.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:ur(t.identifier)}),(0,Q.jsx)(`span`,{children:t.offsetLabel})]})]},t.identifier))})]})]}),(0,Q.jsx)($t,{}),(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:dr(e)})]})]})}function pr(){let e=fe.use.activeAssistantId(),[i,a]=(0,Z.useState)(()=>n(`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=>{r(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)(fr,{value:i,onChange:e=>{a(e),t(`timezone`,e),u(e)}})})]})}var mr=[[`Mon`,0],[`Tue`,1],[`Wed`,2],[`Thu`,3],[`Fri`,4],[`Sat`,5],[`Sun`,6]];function hr(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 gr(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 _r(){return Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??``}function vr(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:hr(t),windowEnd:hr(n)}}function yr({assistantId:e}){let t=l(),{data:n,isLoading:r,isError:i}=u(vt({path:{id:e}})),o=(0,Z.useMemo)(()=>vr(n),[n]),[s,c]=(0,Z.useState)(null),f=s??o,p=s!==null,m=(0,Z.useMemo)(()=>_r(),[]),[h,g]=(0,Z.useState)(null),_=h??f.daysOfMonth.join(`, `),v=d({mutationFn:async t=>{let{data:n}=await Fe({path:{id:e},body:t,throwOnError:!0});return n}}),y=e=>{c(t=>({...t??o,...e}))},b=e=>{y({daysOfWeek:f.daysOfWeek.includes(e)?f.daysOfWeek.filter(t=>t!==e):[...f.daysOfWeek,e].sort((e,t)=>e-t)})},x=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)(S,{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)(R,{checked:f.enabled,onChange:e=>y({enabled:e}),label:`Automatic updates`,helperText:`Update automatically during a configured time window`}),f.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)(I,{ariaLabel:`Frequency`,value:f.frequency,onChange:e=>{e!==`monthly`&&g(null),y({frequency:e})},items:[{value:`daily`,label:`Daily`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`}]})})]}),f.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:mr.map(([e,t])=>(0,Q.jsx)(a,{variant:`outlined`,size:`compact`,active:f.daysOfWeek.includes(t),onClick:()=>b(t),children:e},t))})]}),f.frequency===`monthly`&&(0,Q.jsx)(L,{label:`Day(s) of month`,type:`text`,value:_,onChange:e=>g(e.target.value),onBlur:e=>{let t=x(e.target.value);y({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)(L,{type:`time`,value:f.windowStart,onChange:e=>y({windowStart:e.target.value})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`to`}),(0,Q.jsx)(L,{type:`time`,value:f.windowEnd,onChange:e=>y({windowEnd:e.target.value})})]})]})]}),(0,Q.jsx)(a,{variant:`primary`,leftIcon:v.isPending?(0,Q.jsx)(S,{className:`animate-spin`}):void 0,onClick:async()=>{let n=f.frequency===`monthly`&&h!==null?x(h):f.daysOfMonth;try{await v.mutateAsync({enabled:f.enabled,timezone:`UTC`,schedule:{frequency:f.frequency,days_of_week:f.frequency===`weekly`?f.daysOfWeek:[],days_of_month:f.frequency===`monthly`?n:[],window:{start:gr(f.windowStart),end:gr(f.windowEnd)}}}),B.success(`Auto-update policy saved.`),c(null),g(null),t.invalidateQueries({queryKey:Bt({path:{id:e}})})}catch{B.error(`Failed to save policy. Please try again.`)}},disabled:v.isPending||!p,children:`Save policy`})]})}function br({assistantId:e,open:t,onClose:n}){return(0,Q.jsx)(z.Root,{open:t,onOpenChange:e=>{e||n()},children:(0,Q.jsxs)(z.Content,{size:`md`,children:[(0,Q.jsxs)(z.Header,{children:[(0,Q.jsx)(z.Title,{children:`Update Window`}),(0,Q.jsx)(z.Description,{children:`Configure when automatic updates are applied.`})]}),(0,Q.jsx)(z.Body,{children:(0,Q.jsx)(yr,{assistantId:e})})]})})}function xr(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`)return t}}function Sr({open:e,onOpenChange:t}){let n=l(),[r,i]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(``),[c,u]=(0,Z.useState)(null),d=(0,Z.useRef)(!1),f=(0,Z.useRef)(e),p=()=>n.invalidateQueries({queryKey:zt()}),m=e=>{Le({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=xr(e);n===`no_workos_account`?B.error(`Two-factor authentication is only available for Vellum platform accounts.`):n===`throttled`||n===`workos_rate_limited`?B.error(`Too many attempts. Try again in a minute.`):n===`factor_limit_reached`?B.error(`An authenticator app is already set up. Remove it before adding another.`):B.error(`Failed to start setup. Please try again.`),t(!1)}}),g=Vt({onSuccess:e=>{e.valid?(d.current=!0,B.success(`Two-factor authentication is on.`),p(),t(!1)):u(`That code didn't match. Check your authenticator app and try again.`)},onError:e=>{let n=xr(e);if(n===`challenge_already_verified`){d.current=!0,B.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),s(``),u(`This setup session expired. Scan the new QR code and try again.`),h.mutate({});return}if(n===`throttled`||n===`workos_rate_limited`){u(`Too many attempts. Wait a minute and try again.`);return}u(`Couldn't verify the code. Wait a moment and try again.`)}});(0,Z.useEffect)(()=>{f.current=e,e&&(d.current=!1,i(null),s(``),u(null),h.mutate({}))},[e]);let _=e=>{!e&&g.isPending||(!e&&r&&!d.current&&m(r.factor_id),t(e))},v=()=>{r&&navigator.clipboard.writeText(r.secret).then(()=>B.success(`Setup key copied.`)).catch(()=>B.error(`Couldn't copy the setup key.`))},y=()=>{!r||o.length!==6||g.isPending||(u(null),g.mutate({body:{challenge_id:r.challenge_id,code:o}}))};return(0,Q.jsx)(z.Root,{open:e,onOpenChange:_,children:(0,Q.jsxs)(z.Content,{size:`sm`,children:[(0,Q.jsxs)(z.Header,{children:[(0,Q.jsx)(z.Title,{children:`Set up authenticator app`}),(0,Q.jsx)(z.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)(z.Body,{children:r===null?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,Q.jsx)(S,{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(),y()},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:v,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)(b,{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)(L,{id:`totp-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,placeholder:`123456`,value:o,onChange:e=>s(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)(z.Footer,{children:[(0,Q.jsx)(a,{variant:`outlined`,onClick:()=>_(!1),disabled:g.isPending,children:`Cancel`}),(0,Q.jsx)(a,{onClick:y,disabled:r===null||o.length!==6||g.isPending,children:g.isPending?`Verifying…`:`Verify`})]})]})})}function Cr(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function wr(){let e=l(),[t,n]=(0,Z.useState)(!1),[r,i]=(0,Z.useState)(null),o=u({..._t()}),s=o.data??[],c=()=>e.invalidateQueries({queryKey:zt()}),d=It({onSuccess:()=>{B.success(`Authenticator app removed.`),c()},onError:e=>{if(xr(e)===`factor_not_found`){c();return}B.error(`Failed to remove the authenticator app. Please try again.`)}});return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o.isPending?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(S,{className:`h-4 w-4 animate-spin`}),(0,Q.jsx)(`span`,{className:`text-body-medium-default`,children:`Loading authenticator apps…`})]}):o.isError?(0,Q.jsxs)(j,{tone:`error`,children:[`Couldn't load your authenticator apps.`,` `,(0,Q.jsx)(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>void o.refetch(),children:`Try again`})]}):s.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:s.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)(ut,{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 ${Cr(e.created_at)}`:``]})]})]}),(0,Q.jsx)(a,{variant:`dangerOutline`,onClick:()=>i(e),disabled:d.isPending,children:`Remove`})]},e.id))}),!o.isPending&&!o.isError&&s.length===0&&(0,Q.jsx)(a,{onClick:()=>n(!0),className:`self-start`,children:`Add authenticator app`}),(0,Q.jsx)(Sr,{open:t,onOpenChange:n}),(0,Q.jsx)(V,{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&&d.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}},Tr=`local`,Er=`docker`,Dr=`vellum`;function Or(e){switch((e??``).toLowerCase()){case Tr:return`local`;case Er:return`docker`;case Dr:return`managed`;default:return`other`}}function kr(e){let t=Or(e);return t===`managed`?`local`:t===`local`?`platform`:null}function Ar(e){switch(e){case`docker`:return`Move to Docker`;case`platform`:return`Move to Cloud (Platform)`;case`local`:return`Move to Local`}}function jr(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 Mr(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 Nr(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 Pr(e){let t=ce(e);if(!t)throw new $(`local_assistant_not_found`,`Assistant ${e.assistantId} has no resolved local gateway.`);return`${window.location.origin}${t}`}async function Fr(e,t){let n=await H(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 Ir(e,t){let n=Pr(e),r=await Fr(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 Nr(i,t)}async function Lr(e,t){let n=Pr(e),r=await Fr(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 Br(i);if(a&&a.success===!1)throw new $(`import_failed`,a.error??`Import reported failure`)}async function Rr(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 zr(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 Br(e){try{return await e.json()}catch{return null}}var Vr=new Set([500,502,503,504]),Hr=3,Ur=e=>new Promise(t=>setTimeout(t,e));async function Wr(e,t=new Set){for(let n=0;n<=Hr;n++){let{response:r,data:i,error:a}=await e(),o=r?.status??0;if(n<Hr&&Vr.has(o)&&!t.has(o)){await Ur(2**n*1e3);continue}return{status:o,data:i,error:a}}throw new $(`unknown`,`Unexpected retry loop exit`)}async function Gr(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 Wr(()=>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 Kr(e,t){let{status:n,data:r,error:i}=await Wr(()=>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=Mr(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 qr(e,t,n){for(let r=0;r<=Hr;r++){let i=await Jr(e,t,n);if(r<Hr&&Vr.has(i)){await Ur(2**r*1e3),n?.(0);continue}if(i<200||i>=300)throw new $(`export_failed`,`Bundle upload failed (HTTP ${i}).`);return}}function Jr(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 Yr(e,t){for(let n=0;n<=Hr;n++){let r=await fetch(e,{method:`GET`});if(n<Hr&&Vr.has(r.status)){await Ur(2**n*1e3),t?.(0);continue}if(!r.ok)throw new $(`import_failed`,`Bundle download failed (HTTP ${r.status}).`);return Nr(r,t)}throw new $(`import_failed`,`Unexpected retry loop exit`)}async function Xr(e){let{status:t,data:n,error:r}=await Wr(()=>K.post({url:`/v1/migrations/import-from-gcs/`,body:{bundle_key:e},throwOnError:!1}));return{status:t,body:n??r??null}}async function Zr(e){let{status:t,data:n}=await Wr(()=>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 Qr=5e3,$r=36e5,ei=5*6e4,ti=30,ni=e=>new Promise(t=>setTimeout(t,e));function ri(){let e=c(),t=W(),n=kr(t?.cloud),[i,a]=(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=>{a({kind:`transferring`,step:e,progress:null})},[]),f=(0,Z.useCallback)(e=>{a(t=>t.kind===`transferring`?{...t,progress:e}:t)},[]),p=(0,Z.useCallback)(async()=>{if(!(!t||!n)){u.current={id:t.assistantId,kind:Or(t.cloud)===`managed`?`managed`:`local`,createdFresh:!1};try{if(n===`platform`)await ii(t,d,f,l);else if(n===`local`)await ai(t,d,f,l);else throw new $(`unknown`,`Unsupported teleport destination.`);a({kind:`verifying`})}catch(e){a({kind:`failed`,error:`Teleport failed: ${e instanceof $||e instanceof Error?e.message:`Teleport failed.`}`}),r(e,{context:`teleport-execute`}),await si(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,a({kind:`idle`})},[]);return{destination:n,phase:i,confirmOpen:o,requestTeleport:m,cancelConfirm:h,confirm:g,confirmAndSwitch:(0,Z.useCallback)(()=>{let t=l.current,n=u.current;t&&(async()=>{try{let e=Ee.getState();t.kind===`managed`?await e.connectPlatformAssistant(t.id):(await e.connectLocalAssistant(t.id),ye(t.id,{onError:e=>r(e,{context:`teleport-inject-platform-identity`})}))}catch(e){a({kind:`failed`,error:`Switch failed: ${e instanceof Error?e.message:`Failed to switch assistant.`}`}),r(e,{context:`teleport-confirm-switch`});return}n&&At(n.id).then(e=>{e.ok||r(Error(e.error),{context:`teleport-retire-source`})}),_(),e(q.assistant,{replace:!0})})()},[e,_]),cancelTeleport:(0,Z.useCallback)(()=>{let e=l.current,t=u.current;l.current=null,u.current=null,a({kind:`idle`}),si(e,t,`teleport-cancel-retire-target`)},[]),reset:_}}async function ii(e,t,n,r){t(`Exporting assistant data...`);let i=await Ir(e,n);t(`Resolving organization...`);let a=await li();t(`Checking for existing assistant...`);let o=(await Ne({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 Gr(e.resources?.runtimeVersion);await qr(s.url,i,n),t(`Setting up cloud assistant...`);let c=await ze(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 de({assistantId:l,name:c.data.name,cloud:`vellum`,runtimeUrl:le(),hatchedAt:c.data.created??new Date().toISOString(),organizationId:a}),await U(e.assistantId),r.current={id:l,kind:`managed`,createdFresh:!0},t(`Finalizing cloud assistant...`),await ui(l),t(`Importing data to cloud...`);let u=await Xr(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 di(e)}else{let e=u.body;if(e&&e.success===!1)throw new $(`import_failed`,e.error??`Import reported failure.`)}}async function ai(e,t,n,r){t(`Preparing export...`);let i=await Gr(await ci(e.assistantId),`runtime`);t(`Exporting cloud data...`);let a=await Rr(e.assistantId,i.url);await fi(e.assistantId,a),t(`Preparing local assistant...`);let{assistant:o,createdFresh:s}=await pi();r.current={id:o.assistantId,kind:`local`,createdFresh:s};let c=await oi(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 Kr(i.bundleKey,c);t(`Downloading data...`);let u=await Yr(l,n);t(`Importing data...`),await hi(o,u),await U(e.assistantId)}async function oi(e,t){if(e.resources?.runtimeVersion)return e.resources.runtimeVersion;if(t)return(await Ht())?.version??void 0}async function si(e,t,n){if(e?.createdFresh){let t=await At(e.id);t.ok||r(Error(t.error),{context:n})}t&&await U(t.id)}async function ci(e){let t=await Re(e);return t.ok?t.data.version??void 0:void 0}async function li(){let e=ve.getState();e.organizations.length===0&&await e.fetchOrganizations();let t=ve.getState().organizations,n=be();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 ve.getState().setCurrentOrganizationId(r),r}async function ui(e){let t=Date.now();for(;Date.now()-t<ei;){let{data:t,response:n}=await Ie({path:{id:e},throwOnError:!1});if(n?.ok&&t?.state===`active`)return;await ni(Qr)}}async function di(e){let t=Date.now();for(;Date.now()-t<$r;){await ni(Qr);let t=await Zr(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 fi(e,t){let n=Date.now();for(;Date.now()-n<$r;)if(await ni(Qr),await zr(e,t)===`complete`)return;throw new $(`export_timed_out`,`Export timed out.`)}async function pi(){let e=await re(void 0,void 0);if(!e.ok)throw new $(`local_assistant_not_found`,e.error??`Could not create a local assistant.`);await oe();let t=e.assistantId?ue().find(t=>t.assistantId===e.assistantId):mi();if(!t)throw new $(`local_assistant_not_found`,`Could not find or create a local assistant.`);return{assistant:t,createdFresh:!0}}function mi(){return ue().slice().sort((e,t)=>(t.hatchedAt??``).localeCompare(e.hatchedAt??``))[0]}async function hi(e,t){let n;for(let r=0;r<ti;r++)try{await Lr(e,t);return}catch(e){n=e,await ni(1e3)}throw n instanceof Error?n:new $(`import_failed`,`Import failed.`)}function gi(){let e=ri(),{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:jr(t)}),(0,Q.jsx)(a,{variant:`outlined`,className:`self-start`,onClick:e.requestTeleport,children:Ar(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)(S,{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)(M,{value:n.progress,"aria-label":`Teleport progress`,className:`max-w-[240px]`})]}),n.kind===`verifying`&&(0,Q.jsx)(j,{tone:`success`,icon:(0,Q.jsx)(y,{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)(a,{variant:`primary`,onClick:e.confirmAndSwitch,children:`Confirm & Switch`}),(0,Q.jsx)(a,{variant:`outlined`,onClick:e.cancelTeleport,children:`Cancel`})]})}),n.kind===`failed`&&(0,Q.jsx)(j,{tone:`error`,title:n.error,actions:(0,Q.jsx)(a,{variant:`outlined`,onClick:e.reset,children:`Try Again`})}),(0,Q.jsx)(V,{open:e.confirmOpen,title:Ar(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 _i(){let{assistant:e,healthz:t,healthzLoading:n,healthzPolling:r,refetch:i,refetchUntilResized:s}=Xt(),l=J.use.multiPlatformAssistant(),u=J.use.teleport(),d=J.use.accountMfa(),f=He.use.settingsSleepPolicy(),p=xe(),m=c(),h=Et(),g=Et({platformHostedOnly:!0}),_=Nt(),v=ft({assistantId:e?.id??null,enabled:g===`full`&&_}),[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)(!1),[C,w]=o();(0,Z.useEffect)(()=>{if(C.get(`preferences`)!==`open`)return;let e=new URLSearchParams(C);e.delete(`preferences`),w(e,{replace:!0}),S(!0)},[C,w]);let T=e?.is_local&&!ae()?null:e,E=W(),D=ae()&&!!e&&!!E&&ie(E),O=D,k=D&&!se(),A=g===`full`&&!!T||k&&!!e;(0,Z.useEffect)(()=>{!e||window.location.hash!==`#storage-resources`||requestAnimationFrame(()=>{document.getElementById(`storage-resources`)?.scrollIntoView({block:`start`})})},[e]);let j=t?.version??e?.current_release_version??null,M=(h===`full`||O)&&!!T||h===`disabled`&&!O,N=g!==`gated`,P=G()||!Ue();return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[v.status&&v.mode!==`inactive`&&(0,Q.jsx)(Je,{status:v.status,mode:v.mode,isAcknowledging:v.isAcknowledging,acknowledgeError:v.acknowledgeError?.message??null,onAcknowledge:()=>void v.acknowledge(),onReviewWorkspaceData:()=>void m(`${q.workspace}?sort=size`),onUpgradeStorage:g===`full`?()=>void m(`${q.settings.usage}?tab=billing&adjust_plan=1`):null}),(0,Q.jsxs)(gn,{assistant:_?T:null,showHandles:p&&h===`full`,children:[(0,Q.jsx)(pr,{}),d&&h!==`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:`Two-Factor Authentication`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Require a code from an authenticator app when you sign in.`}),(0,Q.jsx)(`div`,{className:`mt-1`,children:h===`disabled`?(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to manage two-factor authentication.`}):(0,Q.jsx)(wr,{})})]})]})]}),(0,Q.jsx)(X,{title:`Version`,subtitle:`Manage your assistant's software version and updates.`,accessory:g===`full`&&T?(0,Q.jsx)(a,{variant:`outlined`,onClick:()=>b(!0),children:`Update Window`}):void 0,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[g===`full`&&T&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(En,{assistantId:T.id,currentVersion:j,releaseChannel:T.release_channel,onUpgradeComplete:()=>{i()}}),(0,Q.jsx)(Qn,{assistantId:T.id,onComplete:()=>{i()}})]}),k&&e&&(0,Q.jsx)(Dn,{assistantId:e.id,currentVersion:j,onUpgradeComplete:()=>{i()}}),!A&&e&&(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:`Current`}),(0,Q.jsx)(Zt,{version:j,loading:n&&!e.current_release_version,assistantId:e.id??null})]}),g===`disabled`&&!k&&(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to manage software updates.`})]})}),g===`full`&&T&&(0,Q.jsx)(br,{assistantId:T.id,open:y,onClose:()=>b(!1)}),g===`full`&&e&&(0,Q.jsx)(ir,{assistant:e,healthz:t,healthzLoading:n,healthzPolling:r,refetch:i,refetchUntilResized:s}),g===`disabled`&&(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)(Y,{children:`Log in to the Vellum platform to manage compute resources.`})}),(0,Q.jsx)(X,{title:`Preferences`,subtitle:`Customize how Vellum looks and behaves on this device.`,accessory:P?(0,Q.jsx)(a,{variant:`outlined`,onClick:()=>S(!0),children:`Customize`}):void 0,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsx)(nn,{}),(0,Q.jsx)(or,{})]})}),P&&(0,Q.jsx)(Kn,{open:x,onClose:()=>S(!1)}),u&&G()&&(0,Q.jsx)(gi,{}),(0,Q.jsx)(An,{}),g===`full`&&T&&f&&(0,Q.jsx)(X,{title:`Sleep Policy`,subtitle:`Control how long this assistant stays awake when idle.`,children:(0,Q.jsx)(Sn,{assistantId:T.id})}),g===`disabled`&&f&&(0,Q.jsx)(X,{title:`Sleep Policy`,subtitle:`Control how long this assistant stays awake when idle.`,children:(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to manage sleep policy.`})}),l&&(0,Q.jsx)(yn,{}),(M||N)&&(0,Q.jsx)(X,{variant:`danger`,title:`Danger Zone`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[M&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Retire Assistant`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Permanently retire this assistant and delete all associated data.`}),(0,Q.jsx)(`div`,{className:`mt-1`,children:(h===`full`||O)&&T?(0,Q.jsx)(ar,{assistantId:T.id}):(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to retire this assistant.`})})]}),M&&N&&(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(On,{})]})})]})}export{_i as GeneralPage};
@@ -0,0 +1 @@
1
+ import{t as e}from"./queryOptions-BtNi-_9H.js";import{ln as t}from"./sdk.gen-BR-xXIZm.js";import{n,r,t as i}from"./api-errors-CoE1wFl2.js";var a=`Failed to load memory stats.`;function o(o){return e({queryKey:[`memory-stats`,o],staleTime:5*6e4,queryFn:async()=>{let{data:e,error:s,response:c}=await t({path:{assistant_id:o},throwOnError:!1});if(n(c,s,a),c.status===404)return{kind:`unsupported`};if(!c.ok)throw new i(c.status,r(s,c,a));return{kind:`ready`,concepts:e?.concepts??0}}})}export{o as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-eTfO3z5C.js","assets/preload-helper-BewR0kVT.js","assets/dist-CGPrc2vu2.js","assets/definitions-DW2pQQOo.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-BewR0kVT.js";import{u as t}from"./native-biometric-gWkPFBiw.js";var n=async e=>{if(t())try{await e()}catch{}},r={light:()=>n(async()=>{let{Haptics:t,ImpactStyle:n}=await e(async()=>{let{Haptics:e,ImpactStyle:t}=await import(`./esm-eTfO3z5C.js`);return{Haptics:e,ImpactStyle:t}},__vite__mapDeps([0,1,2,3]));await t.impact({style:n.Light})}),medium:()=>n(async()=>{let{Haptics:t,ImpactStyle:n}=await e(async()=>{let{Haptics:e,ImpactStyle:t}=await import(`./esm-eTfO3z5C.js`);return{Haptics:e,ImpactStyle:t}},__vite__mapDeps([0,1,2,3]));await t.impact({style:n.Medium})}),success:()=>n(async()=>{let{Haptics:t,NotificationType:n}=await e(async()=>{let{Haptics:e,NotificationType:t}=await import(`./esm-eTfO3z5C.js`);return{Haptics:e,NotificationType:t}},__vite__mapDeps([0,1,2,3]));await t.notification({type:n.Success})}),error:()=>n(async()=>{let{Haptics:t,NotificationType:n}=await e(async()=>{let{Haptics:e,NotificationType:t}=await import(`./esm-eTfO3z5C.js`);return{Haptics:e,NotificationType:t}},__vite__mapDeps([0,1,2,3]));await t.notification({type:n.Error})})};export{r as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-B-GaVjH1.js","assets/preload-helper-BewR0kVT.js","assets/dist-DyRKd0bN2.js","assets/definitions-BEx8SBhF.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./preload-helper-BewR0kVT.js";import{u as t}from"./native-biometric-Bp5eYpXj.js";var n=async e=>{if(t())try{await e()}catch{}},r={light:()=>n(async()=>{let{Haptics:t,ImpactStyle:n}=await e(async()=>{let{Haptics:e,ImpactStyle:t}=await import(`./esm-B-GaVjH1.js`);return{Haptics:e,ImpactStyle:t}},__vite__mapDeps([0,1,2,3]));await t.impact({style:n.Light})}),medium:()=>n(async()=>{let{Haptics:t,ImpactStyle:n}=await e(async()=>{let{Haptics:e,ImpactStyle:t}=await import(`./esm-B-GaVjH1.js`);return{Haptics:e,ImpactStyle:t}},__vite__mapDeps([0,1,2,3]));await t.impact({style:n.Medium})}),success:()=>n(async()=>{let{Haptics:t,NotificationType:n}=await e(async()=>{let{Haptics:e,NotificationType:t}=await import(`./esm-B-GaVjH1.js`);return{Haptics:e,NotificationType:t}},__vite__mapDeps([0,1,2,3]));await t.notification({type:n.Success})}),error:()=>n(async()=>{let{Haptics:t,NotificationType:n}=await e(async()=>{let{Haptics:e,NotificationType:t}=await import(`./esm-B-GaVjH1.js`);return{Haptics:e,NotificationType:t}},__vite__mapDeps([0,1,2,3]));await t.notification({type:n.Error})})};export{r as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./capture-error-anSemq95.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./button-BQVYX8n_.js";import{m as a,u as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{t as l}from"./progress-bar-Bqv7D4mZ.js";import{O as ee,_ as te,f as u,g as ne,nt as d,rt as re,x as f,y as ie}from"./local-mode-Dydd46cS.js";import{t as p}from"./is-electron-y5bNUVyG.js";import{n as m}from"./resolved-assistants-store-DdHm-7v4.js";import{r as ae}from"./api-errors-CoE1wFl2.js";import{A as oe,B as se,D as ce,L as le,N as h,R as ue,k as g,n as _,z as v}from"./auth-store-CQkJpfOH.js";import{a as de,o as fe,r as y}from"./api-Ffg_vD9E.js";import{u as pe}from"./native-biometric-Bp5eYpXj.js";import{c as b}from"./routes-Cwb-U9H-.js";import{m as me,o as he}from"./prefs-Od3axSSC.js";import{r as x,t as S}from"./build-state-3TH38Fw_.js";import{t as C}from"./avatar-bundled-components-ELDcio1Z.js";import{t as w}from"./avatar-svg-compositor-D7Dy9s1k.js";import{Ma as T,Na as E,_n as D,ka as O}from"./index-Dv7BQn1T.js";import{t as ge}from"./provider-key-BwkVylwK.js";import{t as k}from"./plugin-attribution-DaTkKmHy.js";var A=e(r(),1);async function _e(e,t,r){try{await T(e)||await E(e,t),r.invalidateQueries({queryKey:O(e)})}catch(e){n(e,{context:`onboarding_avatar_sync`})}}function j(e){let t=e=>e[Math.floor(Math.random()*e.length)];return{bodyShape:t(e.bodyShapes).id,eyeStyle:t(e.eyeStyles).id,color:t(e.colors).id}}var M=c(),N=3e3,ve=800,P=3e5,F=null,I=null,L=null;function R(){F=null,I=null,L=null}var ye={initializing:0,provisioning:.33,connecting:.66,ready:1},z=1500,be={initializing:`Getting things ready…`,provisioning:`Setting up your assistant…`,connecting:`Connecting to your assistant…`,ready:`Ready`};function xe(e,t,n){if(e>=t)return t;let r=1-(1-Math.min(1,n/z))**3;return e+(t-e)*r}function Se(){let e=x(S(),{kind:`hatch-gate`});return e.action===`redirect`?{kind:`redirect`,to:e.to}:e.action===`wait`?{kind:`wait`}:{kind:`proceed`}}function B(){let e=o(),r=s(),[c]=a(),x=c.get(`hosting`),S=c.get(`fail`),T=c.get(k),E=p(),O=u()&&x!==null&&x!==`vellum-cloud`,z=_.use.sessionStatus(),B=O?h(z):z,[V]=(0,A.useState)(()=>L??=j(C)),H=(0,A.useMemo)(()=>{let e=w(C,V.bodyShape,V.eyeStyle,V.color,320);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`},[V]),[U,W]=(0,A.useState)(`initializing`),[G,K]=(0,A.useState)(null),[Ce,q]=(0,A.useState)(!1),[we,Te]=(0,A.useState)(0),[Ee,J]=(0,A.useState)(0),[De,Oe]=(0,A.useState)(0),Y=(0,A.useRef)(U),X=(0,A.useRef)(0),Z=(0,A.useRef)(0),Q=(0,A.useRef)(0),$=(0,A.useCallback)(e=>{X.current=Q.current,Z.current=Date.now(),Y.current=e,W(e),Oe(e=>e+1)},[]);return(0,A.useEffect)(()=>{if(S!==null){K(`Simulated hatch failure (developer menu → Replay Hatch Failure).`);return}let i=Se();if(i.kind===`redirect`){e(i.to,{replace:!0});return}if(i.kind===`wait`)return;q(!1);let a=!1,o=null,s=null,c=null,l=Date.now(),p,h=!1,C=!1,w=he(),E=t=>{try{me(``)}catch(e){n(e,{context:`onboarding_mark_completed`})}J(1),Q.current=1,X.current=1,W(`ready`),Y.current=`ready`,s=setTimeout(()=>{a||(R(),(async()=>{if(await oe.checkAssistant(),!a){if(pe()){oe.markExpectingFirstMessage(),e(`${b.assistant}?onboarding=1`,{replace:!0});return}if(O){let n=new URLSearchParams;x&&n.set(`hosting`,x),t&&n.set(`assistant`,t),T&&n.set(k,T);let r=n.toString();e(`${b.onboarding.research}${r?`?${r}`:``}`,{replace:!0});return}e(b.onboarding.research,{replace:!0})}})())},ve)},D=e=>_e(e,V,r),A=async()=>{if($(`provisioning`),!O){try{let e=await y(),t=v(e);if(!a&&e.ok&&t.kind===`active`){u()&&f({assistantId:e.data.id,name:e.data.name,cloud:`vellum`,runtimeUrl:d(),hatchedAt:new Date().toISOString(),organizationId:ce.getState().currentOrganizationId??void 0}),E();return}t.kind===`auto_hatch`&&(C=!0)}catch{}if(a)return}if(O){try{F||=ee(void 0,x===`docker`?`docker`:void 0);let e=await F;if(a)return;if(!e.ok){R(),K(e.error??`Failed to hatch local assistant.`);return}await ne(),e.assistantId&&g(e.assistantId),$(`connecting`);let t=!1;for(;!a&&!t;){if(await ie()){re(),await te(),t=!0;break}if(Date.now()-l>=P){R(),K(`Your assistant is taking longer than expected. Please try again.`);return}await new Promise(e=>{c=setTimeout(e,N)}),c=null}if(a)return;if(e.assistantId)try{await ge(e.assistantId)}catch(e){n(e,{context:`onboarding_apply_provider_key`})}e.assistantId&&await _.getState().connectLocalAssistant(e.assistantId),e.assistantId&&(m.getState().upsertFromApi({id:e.assistantId,name:e.assistantId,status:`active`,is_local:!0,created:new Date().toISOString()}),g(e.assistantId),D(e.assistantId)),E(e.assistantId)}catch{if(R(),a)return;K(`Failed to hatch local assistant. Check CLI logs for details.`)}return}try{I||=fe(w?{version:w}:void 0);let e=await I;if(I=null,a)return;if(e.ok&&(p=e.data.id),h=e.ok&&e.status===201,!e.ok){if(t(`Onboarding hatch request failed`,{level:`warning`,extra:{status:e.status,error:e.error}}),ue(e.status,e.error)){K(le),q(!0);return}if(!se(e.status)){K(ae(e.error,void 0,`Failed to start your assistant. Please try again.`));return}}}catch(e){if(I=null,n(e,{context:`onboarding_hatch_assistant`}),a)return}j(0)},j=e=>{a||(o=setTimeout(M,e))},M=async()=>{if(!a){if(Date.now()-l>=P){t(`Onboarding hatch wait exceeded timeout`,{level:`warning`,extra:{maxWaitMs:P}}),K(`Your assistant is taking longer than expected. Please try again.`);return}try{let e=await y(p);if(a||p&&!e.ok&&e.status===404&&(p=void 0,e=await y(),a))return;let t=v(e);if(t.kind===`active`){if(e.ok){let t=e.data.id;for(m.getState().upsertFromApi(e.data),g(t),(h||C)&&D(t),u()&&f({assistantId:t,name:e.data.name,cloud:`vellum`,runtimeUrl:d(),hatchedAt:new Date().toISOString(),organizationId:ce.getState().currentOrganizationId??void 0}),$(`connecting`);!a;){try{if((await de(t)).ok)break}catch{}if(Date.now()-l>=P){K(`Your assistant is taking longer than expected. Please try again.`);return}await new Promise(e=>{o=setTimeout(e,N)}),o=null}if(a)return}E();return}if(t.kind===`error`){K(t.message);return}t.kind!==`auto_hatch`&&Y.current===`provisioning`&&$(`connecting`),j(N)}catch(e){if(n(e,{context:`onboarding_poll_assistant`}),a)return;j(N)}}};return A(),()=>{a=!0,o&&clearTimeout(o),s&&clearTimeout(s),c&&clearTimeout(c)}},[we,S,V,B,e,r,$,O]),(0,A.useEffect)(()=>{Z.current===0&&(Z.current=Date.now());let e,t=()=>{let n=Date.now()-Z.current,r=ye[Y.current],i=xe(X.current,r,n);Q.current=i,J(i),r-i>1e-6&&(e=requestAnimationFrame(t))};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[De]),G?(0,M.jsx)(D,{children:(0,M.jsxs)(`div`,{role:`alert`,className:`mx-auto flex w-full max-w-xl flex-col items-center ${E?`min-h-full px-8 pt-21 pb-28 electron-prechat-type`:`min-h-screen justify-center px-6 pb-40`} text-center text-[var(--content-default)]`,children:[(0,M.jsx)(`h1`,{className:E?`text-title-large`:`text-3xl font-semibold tracking-tight`,children:`Something went wrong`}),(0,M.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${E?`mt-3.5`:`mt-4`}`,children:G}),Ce&&(0,M.jsxs)(`div`,{className:`mt-6 flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,M.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Get started today with a local assistant`}),(0,M.jsx)(i,{asChild:!0,variant:`primary`,size:`regular`,fullWidth:!0,className:E?void 0:`h-11 text-base`,children:(0,M.jsx)(`a`,{href:`${window.location.origin}/download`,children:`Download the macOS app`})})]}),(0,M.jsx)(`img`,{src:H,alt:``,width:160,height:160,className:`${E?`my-auto py-8`:`my-16`} onboarding-avatar-failed`}),(0,M.jsxs)(`div`,{className:`flex w-full flex-col ${E?`gap-2.5 max-w-[280px]`:`gap-2 max-w-sm`}`,children:[(0,M.jsx)(i,{variant:`primary`,size:`regular`,fullWidth:!0,className:E?void 0:`h-11 text-base`,onClick:()=>{X.current=0,Z.current=Date.now(),Y.current=`initializing`,Q.current=0,W(`initializing`),J(0),Oe(e=>e+1),K(null),q(!1),Te(e=>e+1)},children:`Try again`}),(0,M.jsx)(i,{variant:`outlined`,size:`regular`,fullWidth:!0,className:E?void 0:`h-11 text-base`,onClick:()=>void e(O?b.onboarding.hosting:b.onboarding.privacy,{replace:!0}),children:`Back`})]})]})}):(0,M.jsx)(D,{children:(0,M.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${E?`min-h-full px-8 pt-21 pb-28 electron-prechat-type`:`min-h-screen justify-center px-6 pb-40`} text-center text-[var(--content-default)]`,children:[(0,M.jsx)(`h1`,{className:E?`text-title-large`:`text-3xl font-semibold tracking-tight`,children:U===`ready`?`Your assistant is ready!`:`Waking up…`}),U!==`ready`&&(0,M.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${E?`mt-3.5`:`mt-4`}`,children:`Hang tight — your assistant will have a few questions for you once it's up.`}),(0,M.jsx)(`img`,{src:H,alt:``,width:160,height:160,className:`${E?`my-auto py-8`:`my-16`} ${U===`ready`?`onboarding-avatar-awake`:`onboarding-avatar-pulse`}`}),(0,M.jsx)(l,{value:Ee,height:6,className:`w-full ${E?`max-w-[200px]`:`max-w-sm`}`,"aria-label":`Assistant startup progress`}),(0,M.jsx)(`p`,{className:`text-[var(--content-tertiary)] ${E?`mt-4 text-label-small-default`:`mt-3 text-body-small-default`}`,children:be[U]})]})})}export{B as HatchingScreen};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{P as n,t as r}from"./button-BQVYX8n_.js";import{l as i,u as a}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./useQuery-B45lW1Kk.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{t as l}from"./typography-Cqi8q9o7.js";import{t as u}from"./arrow-left-C2re-gYj.js";import{t as d}from"./bell-V9BYKY__.js";import{n as f}from"./settings-wSv59mkN.js";import{r as p}from"./panel-item-An-BBeyL.js";import{t as m}from"./x-CswtfvgS.js";import{d as h,h as g,i as _}from"./src-BNYQ8guL.js";import{t as v}from"./tag-B6WeUtBW.js";import{R as y,z as b}from"./react-query.gen-DfzfX_Jv.js";import{c as x}from"./routes-Cwb-U9H-.js";import{$n as S,Ba as C,J as w,Oa as T,Qn as E,Va as D,Wo as O,_ as k,a as A,c as ee,d as j,er as M,f as N,g as P,h as F,i as I,ir as L,jt as R,l as z,ms as B,n as te,o as ne,p as re,ps as ie,r as ae,s as V,ts as H,u as U}from"./index-Dv7BQn1T.js";import{t as W}from"./page-shell-DjszLGB6.js";import{l as G,s as K,t as q,u as oe}from"./page-empty-state-CJMyr1gl.js";var J=e(t(),1),Y=c(),se={p:({children:e})=>(0,Y.jsx)(`p`,{className:`mb-2 text-body-medium-default last:mb-0`,style:{color:`var(--content-secondary)`},children:e}),strong:({children:e})=>(0,Y.jsx)(`strong`,{style:{color:`var(--content-default)`},children:e}),em:({children:e})=>(0,Y.jsx)(`em`,{style:{color:`var(--content-default)`},children:e}),a:({href:e,children:t})=>(0,Y.jsx)(`a`,{href:e,className:`underline`,style:{color:`var(--content-link)`},target:`_blank`,rel:`noopener noreferrer`,onClick:t=>R(t,e),children:t}),ul:({children:e})=>(0,Y.jsx)(`ul`,{className:`mb-2 list-disc pl-5 text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),ol:({children:e})=>(0,Y.jsx)(`ol`,{className:`mb-2 list-decimal pl-5 text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),li:({children:e})=>(0,Y.jsx)(`li`,{className:`mb-0.5`,children:e}),code:({children:e})=>(0,Y.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,Y.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,Y.jsx)(`h1`,{className:`mb-2 text-title-medium first:mt-0`,style:{color:`var(--content-default)`},children:e}),h2:({children:e})=>(0,Y.jsx)(`h2`,{className:`mb-2 text-title-small first:mt-0`,style:{color:`var(--content-default)`},children:e}),h3:({children:e})=>(0,Y.jsx)(`h3`,{className:`mb-1 text-body-medium-default first:mt-0`,style:{color:`var(--content-default)`},children:e}),blockquote:({children:e})=>(0,Y.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,Y.jsx)(`div`,{className:`mb-2 overflow-x-auto`,children:(0,Y.jsx)(`table`,{className:`w-full border-collapse text-body-small-default`,style:{color:`var(--content-secondary)`},children:e})}),thead:({children:e})=>(0,Y.jsx)(`thead`,{style:{backgroundColor:`var(--surface-lift)`},children:e}),tbody:({children:e})=>(0,Y.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,Y.jsx)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:e}),th:({children:e})=>(0,Y.jsx)(`th`,{className:`px-2 py-1.5 text-left font-semibold`,style:{color:`var(--content-default)`},children:e}),td:({children:e})=>(0,Y.jsx)(`td`,{className:`px-2 py-1.5 align-top`,children:e})};function ce({content:e,className:t}){return(0,Y.jsx)(`div`,{className:n(`text-body-medium-default`,t),children:(0,Y.jsx)(g,{remarkPlugins:[h],components:se,children:e})})}function X({item:e}){return(0,Y.jsx)(ce,{content:e.summary})}function le(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 ue(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Z({item:e}){let t=e.metadata,n=t?.provider;if(!n)return(0,Y.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:e.title??e.summary});let r=t?.accountInfo??null,i=t?.status??`unreachable`,a=t?.details??``,o=Array.isArray(t?.missingScopes)?t.missingScopes:[];return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-md)]`,children:[(0,Y.jsx)(l,{variant:`title-small`,as:`h3`,children:n}),r?(0,Y.jsx)(l,{variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:r}):null,(0,Y.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)]`,children:[(0,Y.jsx)(`span`,{className:`inline-block shrink-0 rounded-full`,style:{width:8,height:8,backgroundColor:le(i)},"aria-hidden":`true`}),(0,Y.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:ue(i)})]}),a?(0,Y.jsx)(l,{variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:a}):null,o.length>0?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)]`,children:[(0,Y.jsx)(l,{variant:`body-small-emphasised`,className:`text-[var(--content-secondary)]`,children:`Missing scopes`}),(0,Y.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-[var(--app-spacing-xxs)] pl-[var(--app-spacing-lg)]`,children:o.map(e=>(0,Y.jsx)(`li`,{children:(0,Y.jsx)(l,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:e})},e))})]}):null]})}function de(e){return e&&N[e]?N[e]:N.system}function fe(e){return e.title?e.title:e.category?e.category.charAt(0).toUpperCase()+e.category.slice(1):`Notification`}function pe({item:e,isMobile:t,validConversationIds:n,onClose:i,onGoToThread:a,onUpdateStatus:o,onDismiss:s,onViewSchedule:c}){if(!e)return null;let d=e.detailPanel?.kind,p=fe(e),h=de(e.category),g=h.icon,_=e.status===`new`,y=e.status===`dismissed`,b=!!e.conversationId&&n.has(e.conversationId);return t?(0,Y.jsxs)(`div`,{className:`flex h-full flex-col bg-[var(--surface-overlay)]`,children:[(0,Y.jsxs)(`div`,{className:`relative flex shrink-0 items-center px-3 py-2`,children:[(0,Y.jsx)(r,{variant:`ghost`,iconOnly:(0,Y.jsx)(u,{}),onClick:i,"aria-label":`Back`,tooltip:`Back`}),(0,Y.jsx)(l,{variant:`body-medium-default`,className:`pointer-events-none absolute inset-x-0 text-center text-[var(--content-secondary)]`,children:`Details`}),(0,Y.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Y.jsx)(r,{variant:`ghost`,iconOnly:_?(0,Y.jsx)(B,{}):(0,Y.jsx)(ie,{}),onClick:()=>o(e.id,_?`seen`:`new`),"aria-label":_?`Mark as read`:`Mark as unread`,tooltip:_?`Mark as read`:`Mark as unread`}),y?(0,Y.jsx)(r,{variant:`ghost`,iconOnly:(0,Y.jsx)(H,{}),onClick:()=>o(e.id,`seen`),"aria-label":`Restore`,tooltip:`Restore`}):(0,Y.jsx)(r,{variant:`ghost`,iconOnly:(0,Y.jsx)(O,{}),onClick:()=>s(e.id),"aria-label":`Dismiss`,tooltip:`Dismiss`})]})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center justify-center rounded-full`,style:{width:40,height:40,backgroundColor:h.weak},"aria-hidden":`true`,children:(0,Y.jsx)(g,{width:18,height:18,style:{color:h.strong}})}),(0,Y.jsx)(l,{variant:`title-small`,className:`min-w-0 text-[var(--content-default)]`,children:p}),(0,Y.jsx)(v,{tone:`neutral`,className:`shrink-0`,title:F(e.timestamp),children:P(e.timestamp)})]}),(0,Y.jsx)(`div`,{className:`mx-4 border-b border-[var(--border-disabled)]`}),(0,Y.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:d===`toolPermission`?(0,Y.jsx)(Z,{item:e}):(0,Y.jsx)(X,{item:e})}),b||c?(0,Y.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 px-4 pb-4 pt-2`,children:[c?(0,Y.jsx)(r,{variant:`outlined`,fullWidth:!0,leftIcon:(0,Y.jsx)(f,{className:`size-4`}),onClick:c,children:`View schedule`}):null,b?(0,Y.jsx)(r,{variant:`primary`,fullWidth:!0,onClick:()=>a(e.conversationId),children:`Go to Conversation`}):null]}):null]}):(0,Y.jsxs)(`div`,{className:`flex h-full flex-col rounded-[var(--radius-xl)] border border-[var(--border-base)] bg-[var(--surface-overlay)]`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)] border-b border-[var(--border-base)] p-[var(--app-spacing-lg)]`,children:[(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center justify-center rounded-full`,style:{width:28,height:28,backgroundColor:h.weak},"aria-hidden":`true`,children:(0,Y.jsx)(g,{width:14,height:14,style:{color:h.strong}})}),(0,Y.jsx)(l,{variant:`title-small`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,children:p}),b?(0,Y.jsx)(r,{variant:`outlined`,onClick:()=>a(e.conversationId),children:`Go to Convo`}):null,(0,Y.jsx)(r,{variant:`outlined`,iconOnly:(0,Y.jsx)(m,{}),onClick:i,"aria-label":`Close detail panel`,tooltip:`Close`})]}),(0,Y.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-[var(--app-spacing-lg)]`,children:[d===`toolPermission`?(0,Y.jsx)(Z,{item:e}):(0,Y.jsx)(X,{item:e}),(0,Y.jsx)(`div`,{className:`mt-[var(--app-spacing-md)]`,children:(0,Y.jsx)(v,{tone:`neutral`,title:F(e.timestamp),children:P(e.timestamp)})})]}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-[var(--app-spacing-sm)] border-t border-[var(--border-base)] p-[var(--app-spacing-lg)]`,children:[(0,Y.jsx)(`div`,{children:c?(0,Y.jsx)(r,{variant:`outlined`,leftIcon:(0,Y.jsx)(f,{className:`size-4`}),onClick:c,children:`View schedule`}):null}),(0,Y.jsx)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)]`,children:y?(0,Y.jsx)(r,{variant:`primary`,onClick:()=>o(e.id,`seen`),children:`Restore`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(r,{variant:`outlined`,onClick:()=>o(e.id,_?`seen`:`new`),children:_?`Mark as read`:`Mark as unread`}),(0,Y.jsx)(r,{variant:`primary`,onClick:()=>s(e.id),children:`Dismiss`})]})})]})]})}var me={today:`Today`,yesterday:`Yesterday`,older:`Older`},Q=10080*60*1e3;function $(e,t){return e.status===`new`||e.status===`dismissed`?!1:t-new Date(e.createdAt).getTime()>Q}function he({items:e,selectedItemId:t,validConversationIds:n,onSelectItem:r,onDismissItem:i,onRestoreItem:a,onToggleRead:o,onGoToThread:s,archivedOpen:c,onArchivedOpenChange:u,dismissedOpen:f,onDismissedOpenChange:m}){let[h,g]=(0,J.useState)(null),[v]=(0,J.useState)(()=>Date.now()),y=ae(e.filter(e=>e.status!==`dismissed`)),b=y.filter(e=>!$(e,v)),x=z(y.filter(e=>$(e,v))),S=A(b),C=h&&S.includes(h)?h:null;h!==C&&g(C);let w=V(z(I(b,C))),T=e.filter(e=>e.status===`dismissed`).sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-lg)]`,children:[(0,Y.jsx)(re,{categories:S,activeFilter:C,onFilterChange:g}),w.size===0?C?(0,Y.jsx)(l,{variant:`body-medium-lighter`,className:`py-[var(--app-spacing-xl)] text-center text-[var(--content-disabled)]`,children:`No items match the selected filter.`}):(0,Y.jsx)(q,{icon:d,title:`No notifications yet`,description:`Updates and activity from your assistant will appear here.`}):[...w.entries()].map(([e,a])=>(0,Y.jsxs)(`section`,{className:`flex flex-col gap-[var(--app-spacing-md)]`,children:[(0,Y.jsx)(l,{variant:`body-small-default`,as:`h3`,className:`text-[var(--content-tertiary)]`,children:me[e]}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)]`,children:a.map(e=>(0,Y.jsx)(j,{item:e,isActive:e.id===t,validConversationIds:n,onSelect:r,onDismiss:i,onToggleRead:o,onGoToThread:s},e.id))})]},e)),x.length>0&&(0,Y.jsx)(_.Root,{type:`single`,collapsible:!0,value:c?`archived-read`:``,onValueChange:e=>u?.(e===`archived-read`),children:(0,Y.jsxs)(_.Item,{value:`archived-read`,children:[(0,Y.jsxs)(_.Trigger,{className:`group gap-[var(--app-spacing-xs)] text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Y.jsx)(p,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,Y.jsxs)(`span`,{children:[`Earlier (`,x.length,`)`]})]}),(0,Y.jsx)(_.Content,{children:(0,Y.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)] pt-[var(--app-spacing-sm)]`,children:x.map(e=>(0,Y.jsx)(j,{item:e,isActive:e.id===t,validConversationIds:n,onSelect:r,onDismiss:i,onToggleRead:o,onGoToThread:s},e.id))})})]})}),T.length>0&&(0,Y.jsx)(_.Root,{type:`single`,collapsible:!0,value:f?`dismissed`:``,onValueChange:e=>m?.(e===`dismissed`),children:(0,Y.jsxs)(_.Item,{value:`dismissed`,children:[(0,Y.jsxs)(_.Trigger,{className:`group gap-[var(--app-spacing-xs)] text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Y.jsx)(p,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,Y.jsxs)(`span`,{children:[`Dismissed (`,T.length,`)`]})]}),(0,Y.jsx)(_.Content,{children:(0,Y.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)] pt-[var(--app-spacing-sm)]`,children:T.map(e=>(0,Y.jsx)(j,{item:e,onSelect:r,onDismiss:a,trailingAction:`restore`},e.id))})})]})})]})}function ge(){return(0,Y.jsx)(`h1`,{className:`shrink-0 text-title-large text-[var(--content-default)]`,children:`Activity`})}function _e(e){let t=o(),n=(0,J.useMemo)(()=>b({path:{assistant_id:e??``}}),[e]),r=s({...y({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4}),i=(0,J.useCallback)(()=>{e&&t.invalidateQueries({queryKey:n})},[e,t,n]);return{...r,invalidate:i}}function ve(){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xl)]`,children:[(0,Y.jsx)(`div`,{className:`h-7 w-64 animate-pulse rounded-md bg-[var(--surface-lift)]`}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-sm)]`,children:Array.from({length:4},(e,t)=>(0,Y.jsx)(`div`,{className:`h-16 animate-pulse rounded-md bg-[var(--surface-lift)]`},t))})]})}function ye(e){let t=e?.metadata?.scheduleId;return typeof t==`string`&&t.length>0?t:null}function be({assistantId:e,validConversationIds:t,onOpenConversation:n,onViewSchedule:i,initialFeedItemId:a,navigationKey:o,onInitialFeedItemConsumed:c}){let l=C(),u=U(e);_e(e);let{data:d}=s(K(e)),[f,p]=(0,J.useState)(null),[m,h]=(0,J.useState)(!1),[g,_]=(0,J.useState)(!1),v=(0,J.useCallback)(e=>{e.status===`new`?(p({...e,status:`seen`}),u.updateStatus.mutate({itemId:e.id,status:`seen`})):p(e)},[u.updateStatus]),y=(0,J.useCallback)(()=>{p(null)},[]),b=(0,J.useCallback)(e=>{u.updateStatus.mutate({itemId:e,status:`dismissed`}),f?.id===e&&p(null)},[u.updateStatus,f?.id]),x=(0,J.useCallback)(e=>{u.updateStatus.mutate({itemId:e,status:`seen`}),p(t=>t?.id===e?{...t,status:`seen`}:t)},[u.updateStatus]),S=(0,J.useCallback)((e,t)=>{u.updateStatus.mutate({itemId:e,status:t}),p(n=>n?.id===e?{...n,status:t}:n)},[u.updateStatus]),w=(0,J.useCallback)(e=>{p(null),n(e)},[n]),T=u.data?.items??[],[E,D]=(0,J.useState)(null);(0,J.useEffect)(()=>{if(!a||o===E||u.isLoading)return;D(o??null);let e=T.find(e=>e.id===a);e&&e.status!==`dismissed`&&v(e),c?.()},[a,o,E,u.isLoading,T,v,c]);let O=ne(T),A=O.filter(e=>e.status===`new`).length,j=O.length,M=k(),N=(0,J.useCallback)(()=>{u.markAll.mutate(ee(O))},[u.markAll,O]),P=(0,J.useCallback)(()=>{u.markAll.mutate(te(O)),p(null)},[u.markAll,O]),F=ye(f),I=F!=null&&(d??[]).some(e=>e.id===F),L=f?(0,Y.jsx)(pe,{item:f,isMobile:l,validConversationIds:t,onClose:y,onGoToThread:w,onUpdateStatus:S,onDismiss:b,onViewSchedule:I?()=>i(F):void 0}):null,R=(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-[var(--app-spacing-lg)] overflow-y-auto`,children:[u.isError?(0,Y.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-[var(--system-negative-weak)] bg-[var(--system-negative-weak)] px-[var(--app-spacing-lg)] py-[var(--app-spacing-md)] text-[var(--system-negative-strong)]`,children:[`Couldn't load home feed`,u.error instanceof Error?`: ${u.error.message}`:`.`]}):null,M&&(A>0||j>0)&&(0,Y.jsxs)(`div`,{className:`flex items-center justify-end gap-[var(--app-spacing-sm)]`,children:[A>0&&(0,Y.jsx)(r,{variant:`ghost`,size:`compact`,onClick:N,disabled:u.markAll.isPending,children:`Mark all as read`}),j>0&&(0,Y.jsx)(r,{variant:`ghost`,size:`compact`,onClick:P,disabled:u.markAll.isPending,children:`Clear all`})]}),(0,Y.jsx)(he,{items:T,selectedItemId:f?.id,validConversationIds:t,onSelectItem:v,onDismissItem:b,onRestoreItem:x,onToggleRead:S,onGoToThread:w,archivedOpen:m,onArchivedOpenChange:h,dismissedOpen:g,onDismissedOpenChange:_})]}),z=L&&!l?(0,Y.jsx)(G,{storageKey:`homeDetailDrawerWidth`,detailKey:f?.id,section:R,detail:L}):R,B=u.isLoading?(0,Y.jsx)(ve,{}):(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-[var(--app-spacing-xl)]`,children:[l?null:(0,Y.jsx)(ge,{}),z]});return L&&l?(0,Y.jsx)(oe,{children:L}):(0,Y.jsx)(W,{children:B})}function xe(){let e=a(),t=i(),n=w(),r=t.state?.feedItemId??null,o=(0,J.useCallback)(()=>{e(t.pathname+t.search,{replace:!0})},[e,t.pathname,t.search]),s=L.use.setTopBarCenter(),c=C(),{conversations:u}=S(n),{conversations:d}=E(n,!0),{conversations:f}=M(n,!0),p=(0,J.useMemo)(()=>new Set(T(u,d,f).map(e=>e.conversationId)),[u,d,f]);return(0,J.useEffect)(()=>(s(c?(0,Y.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:`Activity`}):null),()=>{s(null)}),[c,s]),(0,Y.jsx)(be,{assistantId:n,validConversationIds:p,initialFeedItemId:r,navigationKey:t.key,onInitialFeedItemConsumed:o,onOpenConversation:t=>D(e,t),onViewSchedule:t=>e(x.schedules.detail(t))})}export{xe as HomePageRoute};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{nt as o,rt as s}from"./local-mode-hyYI6_OH.js";import{t as c}from"./is-electron-DBOtwp5h.js";import{n as l}from"./resolved-assistants-store-DdnJoLGS.js";import{i as u}from"./auth-store-B6EXnaee.js";import{c as d,r as f}from"./routes-XPLb07Av.js";import{t as p}from"./client-feature-flag-store-DeUwlUsr.js";import{t as m}from"./use-onboarding-login-D6BGXpJ1.js";import{Na as h,Sa as g,vn as _}from"./index-CgcZXB4g.js";import{r as v}from"./provider-key-BGsg7FL-.js";var y=e(t(),1),b=a(),x=`h-5 w-5 shrink-0 text-[var(--content-secondary)]`;function S(){let e=u(),t=p.use.multiPlatformAssistant(),n=l.use.assistants().some(e=>e.isPlatformHosted);return[{mode:`vellum-cloud`,label:`Vellum Cloud`,subtitle:`Always on, 24/7, even when your computer is off. Runs on Vellum's secure infrastructure.`,icon:(0,b.jsx)(h,{className:x}),...!e||!t&&n?{disabled:!0,badge:e?`Limit Reached`:`Requires Account`}:{}},{mode:`local`,label:`Local`,subtitle:`Runs directly on your machine. Your data never leaves your computer.`,icon:(0,b.jsx)(g,{className:x})}]}function C(){let e=i(),[t]=r(),a=t.get(`from`)===`select-assistant`,l=u(),p=c(),h=S(),g=h.find(e=>e.mode===`vellum-cloud`)?.disabled,[x,C]=(0,y.useState)(l&&!g?`vellum-cloud`:`local`);(0,y.useEffect)(()=>{g&&x===`vellum-cloud`&&C(`local`)},[g,x]);let{loading:T,error:E,login:D,cancel:O}=m(`${d.onboarding.hosting}?from=select-assistant`),k=a&&!l&&!p;return(0,b.jsx)(_,{children:(0,b.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${p?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,b.jsx)(`h1`,{className:p?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Hosting`}),(0,b.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${p?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Where do you want your assistant to live?`}),E&&(0,b.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:E}),(0,b.jsx)(`div`,{className:`grid w-full ${p?`mt-8 gap-2`:`auto-rows-fr mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:h.map(e=>(0,b.jsx)(w,{option:e,selected:x===e.mode,onSelect:()=>{e.disabled||C(e.mode)}},e.mode))}),(0,b.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${p?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,b.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:p?void 0:`h-11 text-base`,onClick:()=>{x===`vellum-cloud`?(s(),o(null),v(null),e(d.onboarding.privacy)):e(`${d.onboarding.apiKey}?hosting=${x}`)},children:`Continue`}),k&&(0,b.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:T?O:()=>void D(),children:T?`Cancel`:`Log In`}),(0,b.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:p?void 0:`h-11 text-base`,onClick:()=>{e(a?d.selectAssistant:d.welcome)},disabled:T,children:`Back`})]}),(0,b.jsx)(`a`,{href:f(d.docs.hostingOptions),target:`_blank`,rel:`noreferrer`,className:`prechat-md-regular mt-6 text-body-medium-default text-[var(--content-default)] underline`,style:{animation:`fadeInUp 0.5s ease-out 0.6s both`},children:`Need help choosing?`})]})})}function w({option:e,selected:t,onSelect:n}){let r=c();return(0,b.jsxs)(`button`,{type:`button`,onClick:n,disabled:e.disabled,className:`flex w-full items-center border text-left transition-colors ${r?`h-[72px] gap-3 rounded-lg p-3`:`gap-4 rounded-xl px-4 py-4`} ${e.disabled?`cursor-not-allowed opacity-60`:`cursor-pointer`} ${t&&!e.disabled?`${r?`border-[var(--primary-base)]/50`:`border-[var(--primary-base)]`} bg-[var(--primary-base)]/5`:`${r?`border-[var(--border-disabled)]`:`border-[var(--border-element)]`} bg-transparent`}`,children:[e.icon,(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),e.badge&&(0,b.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${r?`text-label-medium-default`:`text-body-small-default`}`,children:e.badge})]}),(0,b.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-[var(--content-tertiary)] ${r?`text-label-medium-default leading-[14px]`:`text-body-small-default`}`,children:e.subtitle})]}),!e.disabled&&(0,b.jsx)(`div`,{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-full ${r?`border-[1.5px]`:`border-2`} ${t?r?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--primary-base)]`:`border-[var(--border-element)]`}`,children:t&&(0,b.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full ${r?`bg-[var(--aux-white)]`:`bg-[var(--primary-base)]`}`})})]})}export{C as HostingScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{rt as o,tt as s}from"./local-mode-Dydd46cS.js";import{t as c}from"./is-electron-y5bNUVyG.js";import{n as l}from"./resolved-assistants-store-DdHm-7v4.js";import{i as u}from"./auth-store-CQkJpfOH.js";import{c as d,r as f}from"./routes-Cwb-U9H-.js";import{t as p}from"./client-feature-flag-store-D85jf9vW.js";import{t as m}from"./use-onboarding-login-BVpbqGtW.js";import{Ps as h,_n as g,xs as _}from"./index-Dv7BQn1T.js";import{r as v}from"./provider-key-BwkVylwK.js";var y=e(t(),1),b=a(),x=`h-5 w-5 shrink-0 text-[var(--content-secondary)]`;function S(){let e=u(),t=p.use.multiPlatformAssistant(),n=l.use.assistants().some(e=>e.isPlatformHosted);return[{mode:`vellum-cloud`,label:`Vellum Cloud`,subtitle:`Always on, 24/7, even when your computer is off. Runs on Vellum's secure infrastructure.`,icon:(0,b.jsx)(h,{className:x}),...!e||!t&&n?{disabled:!0,badge:e?`Limit Reached`:`Requires Account`}:{}},{mode:`local`,label:`Local`,subtitle:`Runs directly on your machine. Your data never leaves your computer.`,icon:(0,b.jsx)(_,{className:x})}]}function C(){let e=i(),[t]=r(),a=t.get(`from`)===`select-assistant`,l=u(),p=c(),h=S(),_=h.find(e=>e.mode===`vellum-cloud`)?.disabled,[x,C]=(0,y.useState)(l&&!_?`vellum-cloud`:`local`);(0,y.useEffect)(()=>{_&&x===`vellum-cloud`&&C(`local`)},[_,x]);let{loading:T,error:E,login:D,cancel:O}=m(`${d.onboarding.hosting}?from=select-assistant`),k=a&&!l&&!p;return(0,b.jsx)(g,{children:(0,b.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${p?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,b.jsx)(`h1`,{className:p?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Hosting`}),(0,b.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${p?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Where do you want your assistant to live?`}),E&&(0,b.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:E}),(0,b.jsx)(`div`,{className:`grid w-full ${p?`mt-8 gap-2`:`auto-rows-fr mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:h.map(e=>(0,b.jsx)(w,{option:e,selected:x===e.mode,onSelect:()=>{e.disabled||C(e.mode)}},e.mode))}),(0,b.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${p?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,b.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:p?void 0:`h-11 text-base`,onClick:()=>{x===`vellum-cloud`?(o(),s(null),v(null),e(d.onboarding.privacy)):e(`${d.onboarding.apiKey}?hosting=${x}`)},children:`Continue`}),k&&(0,b.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:T?O:()=>void D(),children:T?`Cancel`:`Log In`}),(0,b.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:p?void 0:`h-11 text-base`,onClick:()=>{e(a?d.selectAssistant:d.welcome)},disabled:T,children:`Back`})]}),(0,b.jsx)(`a`,{href:f(d.docs.hostingOptions),target:`_blank`,rel:`noreferrer`,className:`prechat-md-regular mt-6 text-body-medium-default text-[var(--content-default)] underline`,style:{animation:`fadeInUp 0.5s ease-out 0.6s both`},children:`Need help choosing?`})]})})}function w({option:e,selected:t,onSelect:n}){let r=c();return(0,b.jsxs)(`button`,{type:`button`,onClick:n,disabled:e.disabled,className:`flex w-full items-center border text-left transition-colors ${r?`h-[72px] gap-3 rounded-lg p-3`:`gap-4 rounded-xl px-4 py-4`} ${e.disabled?`cursor-not-allowed opacity-60`:`cursor-pointer`} ${t&&!e.disabled?`${r?`border-[var(--primary-base)]/50`:`border-[var(--primary-base)]`} bg-[var(--primary-base)]/5`:`${r?`border-[var(--border-disabled)]`:`border-[var(--border-element)]`} bg-transparent`}`,children:[e.icon,(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),e.badge&&(0,b.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${r?`text-label-medium-default`:`text-body-small-default`}`,children:e.badge})]}),(0,b.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-[var(--content-tertiary)] ${r?`text-label-medium-default leading-[14px]`:`text-body-small-default`}`,children:e.subtitle})]}),!e.disabled&&(0,b.jsx)(`div`,{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-full ${r?`border-[1.5px]`:`border-2`} ${t?r?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--primary-base)]`:`border-[var(--border-element)]`}`,children:t&&(0,b.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full ${r?`bg-[var(--aux-white)]`:`bg-[var(--primary-base)]`}`})})]})}export{C as HostingScreen};
@@ -0,0 +1,7 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{t as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./card-D8zyWtZh.js";import{t as c}from"./createLucideIcon-Bjb-Kuq7.js";import{t as l}from"./brain-Ci5ws6Wl.js";import{t as u}from"./chevron-left-B_RAz34t.js";import{r as d}from"./panel-item-An-BBeyL.js";import{t as f}from"./folder-open-7DKBH5WB.js";import{t as p}from"./pencil-CsnkG5VN.js";import{t as m}from"./sparkles-BK3KXCjl.js";import{t as h}from"./users--1gWeHEq.js";import"./src-BNYQ8guL.js";import{t as g}from"./modal-BtcwNEBj.js";import{n as _}from"./toast-Be8FEQ-I.js";import{E as v,St as y,b,ht as x,ln as S,o as C,t as w}from"./react-query.gen-DfzfX_Jv.js";import{t as T}from"./assistant-identity-store-CgJwLRMd.js";import{c as E}from"./routes-Cwb-U9H-.js";import{t as D}from"./assistant-feature-flag-store-aNAjw1qx.js";import{t as O}from"./proxy-BzlH_XAe.js";import{t as k}from"./use-reduced-motion-CcGT6CHV.js";import{Aa as A,Dn as j,En as M,Gs as N,Io as P,J as F,Na as ee,On as I,Ot as L,Pa as te,Uo as ne,bs as R,en as z,ja as re,js as ie,yt as ae,zn as oe}from"./index-Dv7BQn1T.js";import{t as se}from"./page-shell-DjszLGB6.js";import{a as ce,i as le,n as B,o as V}from"./latest-assistant-text-D0MTsoYL.js";import{a as H,n as ue,r as U,s as de,t as fe}from"./use-assistant-identity-details-C2evuHmG.js";import{t as pe}from"./schedules-BKXuUZjT.js";import{t as me}from"./get-memory-stats-CJElyWmX.js";var he=c(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),W=e(t(),1),G=o();function K(e,t,n){return n===`forward`?(e+1)%t:(e-1+t)%t}function ge({open:e,onClose:t,assistantId:r,components:i,traits:a,customImageUrl:o,onSaveCharacter:s,onUploadImage:c,assistantName:l,onRenameSubmit:u,isRenaming:d=!1}){let f=(0,W.useRef)(null),[p,m]=(0,W.useState)(null),[h,_]=(0,W.useState)(!1),v=i??p,[y,b]=(0,W.useState)(0),[x,S]=(0,W.useState)(0),[C,w]=(0,W.useState)(0),[T,E]=(0,W.useState)(`character`),[D,O]=(0,W.useState)(null),[k,A]=(0,W.useState)(!1),[j,M]=(0,W.useState)(!1),[N,P]=(0,W.useState)(l??``),F=D??o,I=!!F;(0,W.useEffect)(()=>{e&&P(l??``)},[e,l]);let L=(0,W.useRef)(!1);(0,W.useEffect)(()=>{e&&!L.current&&E(o?`custom`:`character`),L.current=e},[e,o]),(0,W.useEffect)(()=>{if(e)if(v&&a){let e=v.bodyShapes.findIndex(e=>e.id===a.bodyShape),t=v.eyeStyles.findIndex(e=>e.id===a.eyeStyle),n=v.colors.findIndex(e=>e.id===a.color);b(e>=0?e:0),S(t>=0?t:0),w(n>=0?n:0)}else b(0),S(0),w(0)},[e,v,a]),(0,W.useEffect)(()=>{if(!e||v||h)return;let t=!1;return _(!0),re(r).then(e=>{t||(m(e),_(!1))}),()=>{t=!0}},[e,v,h,r]),(0,W.useEffect)(()=>{if(D)return()=>{URL.revokeObjectURL(D)}},[D]),(0,W.useEffect)(()=>{e||O(null)},[e]);let R=N.trim(),z=!!u&&R.length>0&&R!==(l??``),oe=(0,W.useCallback)(()=>{v&&(E(`character`),b(Math.floor(Math.random()*v.bodyShapes.length)),S(Math.floor(Math.random()*v.eyeStyles.length)),w(Math.floor(Math.random()*v.colors.length)))},[v]),se=(0,W.useCallback)(()=>{f.current?.click()},[]),ce=(0,W.useCallback)(async e=>{let t=e.target.files?.[0];if(!t)return;M(!0);let n=await te(r,t);M(!1),n&&(c(),O(URL.createObjectURL(t)),E(`custom`)),f.current&&(f.current.value=``)},[r,c]),le=(0,W.useCallback)(async e=>{if(e.preventDefault(),!(k||d)){if(z&&u&&u(R),v&&T===`character`){let e={bodyShape:v.bodyShapes[y].id,eyeStyle:v.eyeStyles[x].id,color:v.colors[C].id};A(!0);try{await ee(r,e),O(null),s(e)}finally{A(!1)}}t()}},[k,d,z,u,R,v,T,y,x,C,r,s,t]),B=v?.bodyShapes[y],V=v?.eyeStyles[x],H=v?.colors[C],ue=T===`custom`&&I,U=l!==void 0&&u?(0,G.jsx)(_e,{value:N,onChange:P,disabled:d}):null;return(0,G.jsx)(g.Root,{open:e,onOpenChange:e=>!e&&t(),children:(0,G.jsxs)(g.Content,{size:`sm`,children:[(0,G.jsx)(g.Header,{children:(0,G.jsx)(g.Title,{children:`Update Avatar`})}),(0,G.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:le,children:[(0,G.jsx)(g.Body,{className:`space-y-4`,children:ue?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(`div`,{className:`rounded-2xl bg-[var(--surface-sunken)] p-6`,children:(0,G.jsx)(`img`,{src:F,alt:`Uploaded avatar`,className:`h-40 w-40 rounded-xl object-cover`})})}),(0,G.jsxs)(`div`,{className:`space-y-3`,children:[U,(0,G.jsx)(ve,{label:`Use a character instead`,description:`Pick from our built-in avatars`,onClick:()=>E(`character`),thumbnail:v&&B&&V&&H?(0,G.jsx)(ae,{components:v,bodyShapeId:B.id,eyeStyleId:V.id,colorId:H.id,size:32}):(0,G.jsx)(ie,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})]})]}):v?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(`div`,{className:`rounded-2xl bg-[var(--surface-sunken)] p-6`,children:(0,G.jsx)(ae,{components:v,bodyShapeId:B.id,eyeStyleId:V.id,colorId:H.id,size:160})})}),(0,G.jsxs)(`div`,{className:`space-y-3`,children:[U,(0,G.jsx)(q,{label:`Body`,value:B.id,onPrev:()=>b(K(y,v.bodyShapes.length,`backward`)),onNext:()=>b(K(y,v.bodyShapes.length,`forward`))}),(0,G.jsx)(q,{label:`Eyes`,value:V.id,onPrev:()=>S(K(x,v.eyeStyles.length,`backward`)),onNext:()=>S(K(x,v.eyeStyles.length,`forward`))}),(0,G.jsx)(q,{label:`Color`,value:H.id,colorHex:H.hex,onPrev:()=>w(K(C,v.colors.length,`backward`)),onNext:()=>w(K(C,v.colors.length,`forward`))})]}),I&&(0,G.jsx)(ve,{label:`Keep your uploaded image`,description:`Saving the character replaces it`,onClick:()=>E(`custom`),thumbnail:(0,G.jsx)(`img`,{src:F,alt:``,className:`h-8 w-8 rounded-md object-cover`})})]}):(0,G.jsxs)(G.Fragment,{children:[U,h?(0,G.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,G.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--border-element)] border-t-[var(--content-tertiary)]`})}):(0,G.jsx)(`div`,{className:`py-8 text-center text-body-medium-lighter text-[var(--content-quiet)]`,children:`Unable to load avatar components. Make sure your assistant is running.`})]})}),(0,G.jsxs)(g.Footer,{className:`justify-between`,children:[(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(n,{type:`button`,variant:`outlined`,iconOnly:(0,G.jsx)(ie,{}),"aria-label":`Randomize`,tooltip:`Randomize`,onClick:oe,disabled:!v}),(0,G.jsx)(n,{type:`button`,variant:`outlined`,iconOnly:(0,G.jsx)(ne,{}),"aria-label":`Upload image`,tooltip:`Upload image`,onClick:se,disabled:j})]}),(0,G.jsx)(n,{type:`submit`,variant:`primary`,disabled:k||d||j,children:k||d?`Saving…`:`Save`})]})]}),(0,G.jsx)(`input`,{ref:f,type:`file`,accept:`image/png,image/jpeg,image/webp,image/gif`,className:`hidden`,onChange:ce})]})})}function _e({value:e,onChange:t,disabled:n}){return(0,G.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] px-3 py-2`,children:[(0,G.jsx)(`span`,{className:`text-body-small-default uppercase tracking-wider text-[var(--content-quiet)]`,children:`Name`}),(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`flex min-w-[80px] items-center justify-center`,children:(0,G.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),disabled:n,maxLength:40,size:8,placeholder:`Name`,"aria-label":`Name`,className:`h-7 min-w-0 field-sizing-content bg-transparent text-center text-body-medium-default text-[var(--content-strong)] outline-none placeholder:text-[var(--content-tertiary)] disabled:cursor-not-allowed disabled:opacity-60`})}),(0,G.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-7 shrink-0`})]})]})}function ve({label:e,description:t,thumbnail:n,onClick:r}){return(0,G.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full cursor-pointer items-center gap-3 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-md bg-[var(--surface-sunken)]`,children:n}),(0,G.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`span`,{className:`block truncate text-body-medium-default text-[var(--content-strong)]`,children:e}),(0,G.jsx)(`span`,{className:`block truncate text-body-small-default text-[var(--content-quiet)]`,children:t})]}),(0,G.jsx)(d,{className:`h-4 w-4 shrink-0 text-[var(--content-quiet)]`})]})}function q({label:e,value:t,colorHex:n,onPrev:r,onNext:i}){return(0,G.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] px-3 py-2`,children:[(0,G.jsx)(`span`,{className:`text-body-small-default uppercase tracking-wider text-[var(--content-quiet)]`,children:e}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Previous ${e.toLowerCase()}`,className:`flex h-7 w-7 cursor-pointer items-center justify-center rounded-md text-[var(--content-quiet)] transition-colors hover:bg-[var(--surface-active)]`,children:(0,G.jsx)(u,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`flex min-w-[80px] items-center justify-center gap-2`,children:[n&&(0,G.jsx)(`div`,{className:`h-4 w-4 rounded-full border border-[var(--border-element)]`,style:{backgroundColor:n}}),(0,G.jsx)(`span`,{className:`text-body-medium-default capitalize text-[var(--content-strong)]`,children:t})]}),(0,G.jsx)(`button`,{type:`button`,onClick:i,"aria-label":`Next ${e.toLowerCase()}`,className:`flex h-7 w-7 cursor-pointer items-center justify-center rounded-md text-[var(--content-quiet)] transition-colors hover:bg-[var(--surface-active)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})})]})]})}function ye(e){let t=e.trim();return`<system-message>
2
+ The user renamed you: your name is now ${t}.
3
+
4
+ Update IDENTITY.md so its name line reads exactly \`- **Name:** ${t}\`. This is a rename only — keep everything else in IDENTITY.md and SOUL.md exactly as it is, and do not touch users/ (that is your user's profile, not your identity). If your name appears elsewhere in those files, update those mentions to ${t} too.
5
+
6
+ Reply with a single short sentence acknowledging your new name.
7
+ </system-message>`}async function be(e,t){return U({assistantId:e,content:ye(t),title:`Updating name`,context:`identity_overview_rename`})}var xe=6e4,Se=3;function J(e,t,n){return e===1?t:n}function Ce(e,{supportsPlugins:t,showChannels:n}){let r={assistant_id:e},i={staleTime:xe,retry:!1,enabled:!0},o=a({...y({path:r,query:{kind:`installed`}}),select:e=>e.skills.length,...i}),s=a({...L(e),select:e=>e.plugins.length,enabled:t}),c=a({...w({path:r}),select:e=>e.apps.length,...i}),l=a({...v({path:r}),select:e=>e.documents.length,...i}),u=a({...S({path:r}),select:e=>e.entries.length,...i}),d=a({...b({path:r}),select:e=>e.contacts.length,...i}),f=a({...C({path:r}),select:e=>e.snapshots.filter(e=>e.ready).length,...i,enabled:n}),p=a({queryKey:x({path:r}),queryFn:()=>pe(e),select:e=>{let t=e.filter(e=>e.enabled).sort((e,t)=>e.nextRunAt-t.nextRunAt);return{count:t.length,items:t.slice(0,Se).map(e=>({id:e.id,name:e.name,cadence:e.cadenceDescription,nextRunAt:e.nextRunAt}))}},...i}),m=a({queryKey:V(e),queryFn:()=>ce(e),...i});return{personality:{radar:m.data===void 0?void 0:le(m.data??{})},superpowers:o.data===void 0?void 0:{text:[`${o.data} ${J(o.data,`skill`,`skills`)}`,...s.data===void 0?[]:[`${s.data} ${J(s.data,`plugin`,`plugins`)}`]].join(` · `)},library:c.data===void 0?void 0:{text:[`${c.data} ${J(c.data,`app`,`apps`)}`,...l.data===void 0?[]:[`${l.data} ${J(l.data,`doc`,`docs`)}`]].join(` · `)},workspace:u.data===void 0?void 0:{value:u.data,label:J(u.data,`item`,`items`)},contacts:d.data===void 0?void 0:{value:d.data,label:J(d.data,`person`,`people`)},channels:f.data===void 0?void 0:{value:f.data,label:`connected`},schedules:p.data===void 0?void 0:p.data.count===0?{text:`Nothing scheduled yet`}:{value:p.data.count,label:`active`,schedules:{items:p.data.items,more:p.data.count-p.data.items.length}}}}var Y=96,X=150,we=36,Te=46,Ee=58,De=(e,t,n)=>Math.max(t,Math.min(n,e));function Oe(e,t,n){let r=De(n.x-e.left,Y,e.width-Y),i=De(n.y-e.top,Y,e.height-Y);return{rect:e,facing:t,peek:t===`top`?{x:r,y:0}:t===`bottom`?{x:r,y:e.height}:t===`left`?{x:0,y:i}:{x:e.width,y:i}}}var ke={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}},Ae={type:`spring`,stiffness:150,damping:19},je=.22,Me=.15;function Ne({hex:e,components:t,traits:n,target:r}){let i=r!==null,[a,o]=(0,W.useState)(null);r&&r!==a&&o(r);let s=r??a,[c,l]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=!1,t,n=()=>{t=setTimeout(()=>{e||(l(!0),t=setTimeout(()=>{e||(l(!1),n())},140))},2500+Math.random()*4e3)};return n(),()=>{e=!0,clearTimeout(t)}},[]);let u=(0,W.useMemo)(()=>{let e=t.eyeStyles.find(e=>e.id===n.eyeStyle);return e?{paths:e.paths,bbox:j(e.paths.map(e=>M(e.svgPath)))}:null},[t,n.eyeStyle]);if(!u||!s)return null;let{rect:d,facing:f,peek:p}=s,m={x:d.left+p.x,y:d.top+p.y},h=ke[f],g=u.bbox.h/u.bbox.w,_=Ee,v=_*g,y={x:m.x+h.x*we,y:m.y+h.y*we},b={x:-h.x*Te,y:-h.y*Te},x=u.bbox.x+u.bbox.w/2,S=u.bbox.y+u.bbox.h/2,C=i?{...Ae,delay:je,opacity:{duration:.15,delay:je}}:{duration:Me};return(0,G.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0`,children:[(0,G.jsx)(O.div,{className:`absolute top-0 left-0 rounded-full`,style:{backgroundColor:e,width:X,height:X},initial:!1,animate:{x:m.x-X/2+(i?0:b.x),y:m.y-X/2+(i?0:b.y),opacity:+!!i},transition:C}),(0,G.jsx)(O.div,{className:`absolute top-0 left-0`,initial:!1,animate:{x:y.x-_/2+(i?0:b.x),y:y.y-v/2+(i?0:b.y),width:_,height:v,opacity:+!!i},transition:C,children:(0,G.jsx)(`svg`,{viewBox:`${u.bbox.x} ${u.bbox.y} ${u.bbox.w} ${u.bbox.h}`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`,style:{overflow:`visible`,display:`block`},children:(0,G.jsx)(`g`,{style:{transform:c?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${x}px ${S}px`,transition:`transform 0.14s ease-in-out`},children:u.paths.map((e,t)=>(0,G.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})]})}var Pe=65,Fe=26;function Ie(e,t){let n=k(),[r,i]=(0,W.useState)(n?e.length:0);return(0,W.useEffect)(()=>{if(n){i(e.length);return}i(0);let r=setInterval(()=>{i(t=>t>=e.length?(clearInterval(r),t):t+1)},t);return()=>clearInterval(r)},[e,t,n]),{typed:e.slice(0,r),typing:r<e.length}}function Le({name:e,isRenaming:t,overrideText:n=null}){let r=n??`Hi, I’m ${e}`,{typed:i,typing:a}=Ie(r,n?Fe:Pe);return(0,G.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,G.jsxs)(`h1`,{"aria-label":r,className:`relative leading-none whitespace-nowrap text-[var(--content-strong)] ${n?`text-[2.1rem] max-sm:text-[1.4rem]`:`text-[3.25rem] max-sm:text-[2rem]`}`,style:{fontFamily:`var(--font-serif)`},children:[(0,G.jsx)(`span`,{className:`invisible`,"aria-hidden":`true`,children:r}),(0,G.jsxs)(`span`,{className:`absolute inset-0`,"aria-hidden":`true`,children:[i,a&&(0,G.jsx)(`span`,{className:`animate-pulse`,children:`▎`})]})]}),!n&&t&&(0,G.jsx)(`div`,{"aria-label":`Renaming in progress`,className:`h-5 w-5 shrink-0 animate-spin rounded-full border-2 border-[var(--border-base)]`,style:{borderTopColor:`var(--content-default)`}})]})}function Re({showChannels:e,showMemory:t}){let n=[{key:`personality`,label:`Personality`,description:`Tune how I talk`,to:E.personality},{key:`schedules`,label:`Schedules`,description:`My routines`,to:E.schedules.root},{key:`superpowers`,label:`My Superpowers`,description:`What I can do`,to:E.superpowers}];return t&&n.push({key:`memory`,label:`Memory`,description:`What I remember`,to:E.memory}),n.push({key:`library`,label:`Library`,description:`My apps & docs`,to:E.library.root},{key:`workspace`,label:`Workspace`,description:`My files`,to:E.workspace},{key:`contacts`,label:`Contacts`,description:`People I know`,to:E.contacts.root}),e&&n.push({key:`channels`,label:`Channels`,description:`Where I listen`,to:E.channels}),n}var Z=[{label:`Coworker`,sub:`vs. companion`,value:e=>Q(e,`companion-coworker`)},{label:`Baby Boomer`,sub:`vs. Gen Z`,value:e=>Q(e,`genz-boomer`)},{label:`Collaborative`,sub:`vs. independent`,value:e=>Q(e,`execute-collaborate`)},{label:`Serious`,sub:`vs. playful`,value:e=>Q(e,`playful-serious`)},{label:`Unfiltered`,sub:`vs. polite`,value:e=>Q(e,`polite-unfiltered`)}];function Q(e,t){let n=e[t]??H;return Math.max(0,Math.min(100,n))}var ze=356,Be=246,Ve=ze/2,He=132,$=100,Ue=.1,We=[.25,.5,.75,1],Ge=[{anchor:`middle`,dx:0,dy:-18},{anchor:`start`,dx:9,dy:-2},{anchor:`start`,dx:-10,dy:17},{anchor:`end`,dx:10,dy:17},{anchor:`end`,dx:-9,dy:-2}];function Ke(e,t){let n=-Math.PI/2+e*2*Math.PI/Z.length;return{x:Ve+t*Math.cos(n),y:He+t*Math.sin(n)}}function qe(e){return Z.map((t,n)=>{let r=Ke(n,e(n));return`${r.x.toFixed(1)},${r.y.toFixed(1)}`}).join(` `)}function Je({values:e,className:t}){let n=Z.map(t=>`${t.label} ${Math.round(t.value(e))}`).join(`, `);return(0,G.jsxs)(`svg`,{viewBox:`0 0 ${ze} ${Be}`,role:`img`,"aria-label":`Personality: ${n}`,className:t,children:[We.map(e=>(0,G.jsx)(`polygon`,{points:qe(()=>$*e),fill:`none`,stroke:`currentColor`,strokeOpacity:.25,strokeWidth:1,strokeLinejoin:`round`},e)),Z.map((e,t)=>{let n=Ke(t,$);return(0,G.jsx)(`line`,{x1:Ve,y1:He,x2:n.x,y2:n.y,stroke:`currentColor`,strokeOpacity:.25,strokeWidth:1},t)}),(0,G.jsx)(O.g,{initial:{scale:.4,opacity:0},animate:{scale:1,opacity:1},transition:{type:`spring`,stiffness:140,damping:16},style:{transformOrigin:`${Ve}px ${He}px`},children:(0,G.jsx)(`polygon`,{points:qe(t=>$*Math.max(Ue,Z[t].value(e)/100)),fill:`var(--card-accent)`,fillOpacity:.25,stroke:`var(--card-accent)`,strokeWidth:2,strokeLinejoin:`round`})}),Z.map((e,t)=>{let n=Ge[t],r=Ke(t,$),i=r.x+n.dx;return(0,G.jsxs)(`text`,{x:i,y:r.y+n.dy,textAnchor:n.anchor,children:[(0,G.jsx)(`tspan`,{x:i,fontSize:11.5,fontWeight:500,fill:`currentColor`,children:e.label}),(0,G.jsx)(`tspan`,{x:i,dy:12.5,fontSize:10,fill:`currentColor`,fillOpacity:.8,children:e.sub})]},e.label)})]})}var Ye={personality:m,schedules:N,superpowers:P,memory:l,library:R,workspace:f,contacts:h,channels:he},Xe={personality:`rounded-3xl`,schedules:`rounded-3xl`,superpowers:`rounded-[1.25rem_2.75rem_1.25rem_2.5rem]`,channels:`rounded-[2.25rem_1rem_2.5rem_1.25rem]`,contacts:`rounded-[1rem_2.5rem_1.25rem_2.75rem]`,workspace:`rounded-[1.25rem_2.5rem_1rem_2.5rem]`},Ze=720,Qe=480,$e=[`superpowers`,`memory`,`library`,`workspace`,`contacts`,`channels`],et={personality:`Go ahead — tweak my soul`,superpowers:`Everything I know how to do`,memory:`Everything I remember`,library:`The apps and docs I've made for you`,schedules:`What I do on repeat`,workspace:`All the files that power me`,contacts:`The people I know and trust`,channels:`All the places you can reach me`};function tt(e){return!Number.isFinite(e)||e<=0?`—`:new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}var nt=280,rt=140,it=.44,at=1118,ot=300,st=.09,ct=14,lt=5,ut=22;function dt({assistantId:e}){let t=i(),{components:n,traits:r,customImageUrl:o,isLoading:s,invalidate:c}=A(e),l=ue(e),u=oe(),d=D.use.channelTrustFloors(),f=D.use.memoryConceptGraph(),p=Ce(e,{supportsPlugins:u,showChannels:d}),m=a({...me(e),enabled:f}),h={...p,memory:m.data?.kind===`ready`?{value:m.data.concepts,label:m.data.concepts===1?`memory`:`memories`}:void 0},[g,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(!1),x=(0,W.useCallback)(n=>{b(!0),be(e,n).then(r=>{if(b(!1),r){t.invalidateQueries({queryKey:fe(e)});let{version:r,setIdentity:i}=T.getState();i(n,r),_.success(`Say hi to ${n}!`)}else _.error(`The rename didn't go through. Please try again.`)})},[e,t]),S=(0,W.useCallback)(()=>{c()},[c]),C=Re({showChannels:d,showMemory:f}),w=s||l.isLoading,E=de(n,r);return(0,G.jsxs)(se,{style:E?{backgroundColor:`color-mix(in srgb, ${E} ${ct}%, var(--surface-overlay))`}:void 0,children:[w?(0,G.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,G.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2`,style:{borderColor:`var(--border-base)`,borderTopColor:`var(--content-tertiary)`}})}):(0,G.jsx)(mt,{components:n,traits:r,customImageUrl:o,name:l.data?.identity?.name||`Assistant`,sections:C,stats:h,avatarHex:E,isRenaming:y,onOpenAvatarModal:()=>v(!0)}),(0,G.jsx)(ge,{open:g,onClose:()=>v(!1),assistantId:e,components:n,traits:r,customImageUrl:o,onSaveCharacter:S,onUploadImage:S,assistantName:l.data?.identity?.name||`Assistant`,onRenameSubmit:x,isRenaming:y})]})}function ft({section:e,stat:t,gridArea:n,cardStyle:i,hoverFill:a,mini:o,stacked:c,flooded:l=!1,floodOrigin:u,linkRef:d,onHoverChange:f}){let p=Ye[e.key]??m,[h,g]=(0,W.useState)({x:50,y:100});u&&u!==h&&g(u);let _=l?`text-[var(--card-flood-fg)]`:`text-[var(--content-default)]`,v=l?`text-[var(--card-flood-fg)]`:`text-[var(--content-strong)]`,y=l?`text-[var(--card-flood-fg)] opacity-75`:`text-[var(--content-secondary)]`,b=(0,G.jsx)(O.span,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0`,style:{backgroundColor:`var(--card-accent)`},initial:!1,animate:{clipPath:l?`circle(141% at ${h.x}% ${h.y}%)`:`circle(0% at ${h.x}% ${h.y}%)`},transition:l?{duration:.5,ease:`easeOut`}:{duration:.35,ease:`easeIn`}});if(c){let n=t?.value===void 0?t?.text:`${t.value} ${t.label??``}`.trim();return(0,G.jsx)(s.Root,{asChild:!0,bordered:!0,elevated:!0,clipContents:!0,className:`rounded-2xl bg-[var(--card-bg)]`,children:(0,G.jsxs)(r,{to:e.to,className:`relative flex h-full w-full cursor-pointer flex-col gap-1 p-4 text-left transition-all duration-150 hover:bg-[var(--card-hover)] active:scale-[0.98]`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(p,{className:`h-5 w-5 shrink-0 text-[var(--content-default)]`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e.label})]}),(0,G.jsx)(`span`,{className:`text-[13px] text-[var(--content-secondary)]`,children:e.description}),n&&(0,G.jsx)(`span`,{className:`mt-auto truncate pt-1 text-[12px] font-medium text-[var(--content-tertiary)]`,children:n})]})})}if(o){let n=t?.value===void 0?t?.text:`${t.value} ${t.label}`;return(0,G.jsx)(s.Root,{asChild:!0,bordered:!1,elevated:!0,clipContents:!0,className:`rounded-[12px] border-0 bg-[var(--card-bg)]`,children:(0,G.jsxs)(r,{to:e.to,ref:d,onMouseEnter:()=>f?.(!0),onMouseLeave:()=>f?.(!1),className:`relative flex h-full flex-1 cursor-pointer items-center gap-2 px-4 py-2.5 transition-all duration-150 active:scale-[0.98] ${a?`hover:bg-[var(--card-hover)]`:``}`,children:[b,(0,G.jsx)(`span`,{className:`relative flex h-10 w-10 shrink-0 items-center justify-center`,children:(0,G.jsx)(p,{className:`h-5 w-5 transition-colors duration-300 ${y}`,"aria-hidden":!0})}),(0,G.jsxs)(`span`,{className:`relative flex min-w-0 flex-col gap-0`,children:[(0,G.jsx)(`span`,{className:`truncate text-title-small leading-normal transition-colors duration-300 ${v}`,children:e.label}),n&&(0,G.jsx)(`span`,{className:`truncate text-[11px] leading-normal font-medium transition-colors duration-300 ${l?`text-[var(--card-flood-fg)] opacity-75`:`text-[var(--content-tertiary)]`}`,children:n})]})]})})}let x=e.key===`personality`||e.key===`schedules`;return(0,G.jsx)(s.Root,{asChild:!0,bordered:!x,elevated:!x,className:`${Xe[e.key]??``} ${x?`border border-[var(--border-base)] bg-[var(--card-feature-bg,var(--card-bg))]`:`bg-[var(--card-bg)]`}`,style:{...n?{gridArea:n}:{},...i},children:(0,G.jsxs)(r,{to:e.to,ref:d,onMouseEnter:()=>f?.(!0),onMouseLeave:()=>f?.(!1),className:`relative flex h-full w-full cursor-pointer flex-col justify-between gap-3 overflow-hidden p-5 text-left transition-all duration-150 active:scale-[0.98] ${a?`hover:bg-[var(--card-hover)]`:``}`,children:[b,n&&t?.radar&&(0,G.jsx)(`span`,{className:`absolute inset-x-5 top-14 bottom-4 flex items-center justify-center transition-colors duration-300 ${l?`text-[var(--card-flood-fg)]`:`text-[var(--content-secondary)]`}`,style:l?{"--card-accent":`var(--card-flood-fg)`}:void 0,children:(0,G.jsx)(Je,{values:t.radar,className:`h-auto w-full`})}),x?(0,G.jsxs)(`span`,{className:`relative flex items-center gap-2`,children:[(0,G.jsx)(p,{className:`h-5 w-5 transition-colors duration-300 ${_}`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`text-body-medium-default transition-colors duration-300 ${_}`,children:e.label})]}):(0,G.jsxs)(`span`,{className:`relative flex flex-col items-start gap-1.5`,children:[(0,G.jsx)(p,{className:`h-6 w-6 transition-colors duration-300 ${_}`,"aria-hidden":!0}),(0,G.jsxs)(`span`,{className:`flex flex-col`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default transition-colors duration-300 ${_}`,children:e.label}),(0,G.jsx)(`span`,{className:`text-[13px] transition-colors duration-300 ${y}`,children:e.description})]})]}),n&&t?.schedules&&t.schedules.items.length>0&&(0,G.jsxs)(`span`,{className:`relative flex min-h-0 flex-1 flex-col justify-start gap-2 overflow-hidden py-2`,children:[t.schedules.items.map(e=>(0,G.jsxs)(`span`,{className:`flex flex-col gap-0.5 rounded-xl px-3 py-2 transition-colors duration-300`,style:{backgroundColor:l?`color-mix(in srgb, var(--card-flood-fg) 12%, transparent)`:`color-mix(in srgb, var(--content-default) 5%, transparent)`},children:[(0,G.jsx)(`span`,{className:`truncate text-[13px] font-medium transition-colors duration-300 ${_}`,children:e.name}),(0,G.jsxs)(`span`,{className:`truncate text-[12px] transition-colors duration-300 ${y}`,children:[e.cadence,` · next `,tt(e.nextRunAt)]})]},e.id)),t.schedules.more>0&&(0,G.jsxs)(`span`,{className:`text-[12px] font-medium transition-colors duration-300 ${y}`,children:[`View `,t.schedules.more,` more…`]})]}),t?.value===void 0?t?.text?(0,G.jsx)(`span`,{className:`relative text-[14px] font-medium italic transition-colors duration-300 ${_}`,children:t.text}):null:(0,G.jsxs)(`span`,{className:`relative flex flex-col leading-none`,children:[(0,G.jsx)(`span`,{className:`text-[3.25rem] transition-colors duration-300 max-lg:text-[2.5rem] ${v}`,style:{fontFamily:`var(--font-serif)`},children:t.value}),(0,G.jsx)(`span`,{className:`mt-1 text-[13px] transition-colors duration-300 ${y}`,children:t.label})]})]})})}function pt({components:e,traits:t,customImageUrl:n,name:r,avatarSize:i,isRenaming:a,onEdit:o}){return(0,G.jsxs)(`div`,{className:`relative z-[1] flex flex-col items-center justify-center gap-5`,children:[(0,G.jsx)(Le,{name:r,isRenaming:a}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`Update avatar and name`,title:`Update avatar and name`,onClick:o,className:`avatar-edit-cursor outline-none keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)]`,children:n&&!t?(0,G.jsx)(`img`,{src:n,alt:``,width:i,height:i,className:`rounded-full object-cover`,style:{width:i,height:i}}):(0,G.jsx)(z,{components:e,traits:t,customImageUrl:n,size:i,interactive:!0})})]})}function mt({components:e,traits:t,customImageUrl:n,name:r,sections:i,stats:a,avatarHex:o,isRenaming:s,onOpenAvatarModal:c}){let{ref:l,size:u}=B(),d=k(),f=u.w>=Ze&&u.h>=Qe,m=Math.round(Math.min(nt,Math.max(rt,Math.min(u.w,u.h)*.32))),h=!!(o&&e&&t),g=f&&!d&&h,_=(0,W.useRef)(null),v=(0,W.useRef)({}),[y,b]=(0,W.useState)(null),x=(0,W.useCallback)(e=>{_.current=e,l(e)},[l]),S=(0,W.useCallback)((e,t)=>{if(!g)return;if(!t){b(null);return}let n=_.current,r=v.current[e];if(!n||!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o={left:a.left-i.left,top:a.top-i.top,width:a.width,height:a.height},s=(o.left+o.width/2-i.width/2)/(i.width/2),c=(o.top+o.height/2-i.height/2)/(i.height/2),l=Oe(o,Math.abs(s)>Math.abs(c)?s<0?`right`:`left`:c<0?`bottom`:`top`,{x:i.width/2,y:i.height/2});b({key:e,target:l,origin:{x:l.peek.x/o.width*100,y:l.peek.y/o.height*100}})},[g]),C=g?y:null,w=C?et[C.key]??null:null,T={"--card-bg":o?`color-mix(in srgb, ${o} var(--card-tint-pct, ${lt}%), var(--card-surface, var(--surface-lift)))`:`var(--surface-lift)`,"--card-feature-bg":o?`color-mix(in srgb, var(--card-accent) 28%, var(--card-surface, var(--surface-lift)))`:`var(--surface-lift)`,"--card-hover":o?`color-mix(in srgb, ${o} ${ut}%, var(--card-surface, var(--surface-lift)))`:`var(--surface-hover)`,"--card-accent":o??`var(--content-default)`,"--card-flood-fg":o?I(o):`var(--content-default)`},E=(u.h-8)/(1-st),D=Math.round(Math.min(at,E,Math.max(ot,u.w*it))),A=Math.round(D*st),j=(0,G.jsx)(pt,{components:e,traits:t,customImageUrl:n,name:r,avatarSize:m,isRenaming:s,onEdit:c});if(!f)return(0,G.jsxs)(`div`,{ref:x,className:`identity-bento flex min-h-0 flex-1 flex-col items-center gap-6 overflow-y-auto px-2 py-4`,style:T,children:[j,(0,G.jsx)(`div`,{className:`grid w-full max-w-md shrink-0 grid-cols-2 gap-3`,children:i.map(e=>(0,G.jsx)(ft,{section:e,stat:a[e.key],hoverFill:!0,stacked:!0},e.key))})]});let M=i.filter(e=>!$e.includes(e.key)),N=i.filter(e=>$e.includes(e.key)),P=[1.15,1,.45,.3],F=(u.h-(P.length-1)*12)/P.reduce((e,t)=>e+t,0),ee=Math.round(F*P[0]),L=(h?[`"personality greeting greeting greeting schedules"`,`". . . . schedules"`,`". . . . ."`,`"smalls smalls smalls smalls smalls"`]:[`"personality greeting greeting greeting schedules"`,`". avatar avatar avatar schedules"`,`". avatar avatar avatar ."`,`"smalls smalls smalls smalls smalls"`]).join(` `),te=e=>({section:e,stat:a[e.key],hoverFill:!g,flooded:C?.key===e.key,floodOrigin:C?.key===e.key?C.origin:void 0,linkRef:t=>{v.current[e.key]=t},onHoverChange:t=>S(e.key,t)});return(0,G.jsxs)(`div`,{ref:x,className:`identity-bento relative grid min-h-0 flex-1 gap-3 overflow-hidden`,style:{...T,gridTemplateColumns:`1.55fr 1fr 1fr 1fr 1.55fr`,gridTemplateRows:P.map(e=>`${e}fr`).join(` `),gridTemplateAreas:L},children:[h?(0,G.jsx)(O.div,{className:`pointer-events-none absolute left-1/2 z-0`,style:{width:D,height:D,bottom:-A,x:`-50%`},initial:!1,animate:C?{scale:.4,opacity:0}:{scale:1,opacity:1},transition:C?{duration:.15}:{delay:.25,type:`spring`,stiffness:210,damping:18},children:(0,G.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-label":`Update avatar and name`,title:`Update avatar and name`,onClick:c,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())},className:`avatar-edit-cursor group pointer-events-auto relative h-full w-full scale-100 outline-none transition-transform duration-200 ease-out hover:scale-105 keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)]`,children:[(0,G.jsx)(z,{components:e,traits:t,customImageUrl:n,size:D,interactive:!0}),(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 flex items-center justify-center opacity-0 transition-opacity duration-150 group-hover:opacity-100`,children:(0,G.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full bg-black/40`,children:(0,G.jsx)(p,{className:`h-5 w-5 text-white`})})})]})}):(0,G.jsx)(`div`,{className:`relative z-[1] flex items-start justify-center`,style:{gridArea:`avatar`},children:(0,G.jsx)(`button`,{type:`button`,"aria-label":`Update avatar and name`,title:`Update avatar and name`,onClick:c,className:`avatar-edit-cursor rounded-full outline-none keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)]`,children:n?(0,G.jsx)(`img`,{src:n,alt:``,width:m,height:m,className:`rounded-full object-cover`,style:{width:m,height:m}}):(0,G.jsx)(z,{components:e,traits:t,customImageUrl:null,size:m})})}),(0,G.jsx)(`div`,{className:`relative z-[1] flex items-center justify-center`,style:{gridArea:`greeting`},children:(0,G.jsx)(Le,{name:r,isRenaming:s,overrideText:w})}),g&&o&&e&&t&&(0,G.jsx)(Ne,{hex:o,components:e,traits:t,target:C?.target??null}),M.map(e=>(0,G.jsx)(ft,{...te(e),gridArea:e.key,cardStyle:e.key===`schedules`?{alignSelf:`start`,height:`auto`,minHeight:ee}:void 0},e.key)),(0,G.jsx)(`div`,{className:`flex min-h-0 items-stretch gap-3`,style:{gridArea:`smalls`},children:N.map(e=>(0,G.jsx)(ft,{...te(e),mini:!0},e.key))})]})}function ht(){return(0,G.jsx)(dt,{assistantId:F()})}function gt(){return(0,G.jsx)(ht,{},F())}export{gt as IdentityPageRoute};