@vellumai/web 0.10.8-staging.1 → 0.10.8

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 (189) hide show
  1. package/dist/assets/{AnimatePresence-C8APSgIu.js → AnimatePresence-s1Z1HHWx.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-M2tkzwiz.js → BundleConfirmPage-C6bP7QB3.js} +1 -1
  3. package/dist/assets/{about-page-C-kIVb7a.js → about-page-XGv9RAQu.js} +1 -1
  4. package/dist/assets/{account-page-DOSnPXjP.js → account-page-Dno1SeJN.js} +1 -1
  5. package/dist/assets/{account-shell-74OchOxg.js → account-shell-CdhP9l8T.js} +1 -1
  6. package/dist/assets/{acp-run-detail-panel-DFoD_DVJ.js → acp-run-detail-panel-B1-zyOUe.js} +4 -4
  7. package/dist/assets/{activity-steps-panel-jztC4BRv.js → activity-steps-panel-BGyfMCXK.js} +1 -1
  8. package/dist/assets/{add-credits-modal-daNASKHJ.js → add-credits-modal-PP1PX8Qv.js} +1 -1
  9. package/dist/assets/{advanced-page-B8h5sAe5.js → advanced-page-vCbMVJsK.js} +1 -1
  10. package/dist/assets/{ai-page-BInYrZV7.js → ai-page-BIYybKux.js} +1 -1
  11. package/dist/assets/{animated-avatar-CrlodWQr.js → animated-avatar-Cqpzb8O4.js} +1 -1
  12. package/dist/assets/{api-key-screen-Cynx0r0g.js → api-key-screen-DTSP_-Da.js} +1 -1
  13. package/dist/assets/{archive-page-DqXRVFoF.js → archive-page-RZ2VP63A.js} +1 -1
  14. package/dist/assets/{assistant-feature-flag-store-CKUjJHuh.js → assistant-feature-flag-store-DA8Oj9Mf.js} +1 -1
  15. package/dist/assets/{assistant-status-panel-eNWJodpn.js → assistant-status-panel-BC0RTDls.js} +1 -1
  16. package/dist/assets/{auth-store-CD7PGb3q.js → auth-store-C09YAZEu.js} +2 -2
  17. package/dist/assets/{background-task-detail-panel-Bsi8IoaY.js → background-task-detail-panel-BfnsD-3B.js} +1 -1
  18. package/dist/assets/{billing-page-dpKYjJH3.js → billing-page-1z_L2m6q.js} +3 -3
  19. package/dist/assets/{bookmarks-page-BI92Y3eM.js → bookmarks-page-CjcavZv8.js} +1 -1
  20. package/dist/assets/{browser-BPZAXjRE.js → browser-C6a_nhhZ.js} +2 -2
  21. package/dist/assets/{build-state-DGsKGdpj.js → build-state-PUXrUU4W.js} +1 -1
  22. package/dist/assets/channels-page-route-WjNmd0sS.js +9 -0
  23. package/dist/assets/chat-markdown-message-BnX6bhgs.js +2 -0
  24. package/dist/assets/{client-feature-flag-store-C0g8zi1W.js → client-feature-flag-store-DkJl-g9A.js} +1 -1
  25. package/dist/assets/{command-palette-Dk6UsSlv.js → command-palette-6o4m7BM9.js} +1 -1
  26. package/dist/assets/{command-palette-window-page-zDow8o4K.js → command-palette-window-page-BsJlr5bh.js} +1 -1
  27. package/dist/assets/community-page-CJA4JfuC.js +1 -0
  28. package/dist/assets/{connect-page-BXTqYbdY.js → connect-page-DZgU3jCf.js} +1 -1
  29. package/dist/assets/{consent-controls-BZMxm0n3.js → consent-controls-Cnr1DzCr.js} +1 -1
  30. package/dist/assets/contacts-page-route-P0neH-PV.js +1 -0
  31. package/dist/assets/{credentials-page-0S5ifTFC.js → credentials-page-MkKE_19-.js} +1 -1
  32. package/dist/assets/debug-page-B88f4aDU.js +4 -0
  33. package/dist/assets/{deploy-dialogs-BBHNKgDi.js → deploy-dialogs-paL_zcvG.js} +1 -1
  34. package/dist/assets/{detail-card-RGTjHkZ8.js → detail-card-xKZlkbz5.js} +1 -1
  35. package/dist/assets/{detail-panel-stop-button-oIDUq-kJ.js → detail-panel-stop-button-y7O3HqJj.js} +1 -1
  36. package/dist/assets/{developer-page-Djolz4Fg.js → developer-page-BFMS6pwU.js} +1 -1
  37. package/dist/assets/{devices-page-XJJSA97y.js → devices-page-B3D5iLhD.js} +1 -1
  38. package/dist/assets/{dictation-overlay-page-cqsEjyx_.js → dictation-overlay-page-BkEBWrWm.js} +1 -1
  39. package/dist/assets/{document-viewer-page-jInmb33M.js → document-viewer-page-B631L6-3.js} +1 -1
  40. package/dist/assets/{earn-credits-modal-C_jhLLw5.js → earn-credits-modal-CFla-iKl.js} +1 -1
  41. package/dist/assets/edge-swipe-arbiter-store-BeOhrE7M.js +1 -0
  42. package/dist/assets/{emails-page-fov7ihfj.js → emails-page-7c9kVi_k.js} +1 -1
  43. package/dist/assets/{esm-Ddmch1KU.js → esm-Bzs_witt.js} +2 -2
  44. package/dist/assets/{esm-CYMQv-VS.js → esm-C5J59K0j.js} +2 -2
  45. package/dist/assets/{esm-CTXnt94k.js → esm-CT8NUp3h.js} +2 -2
  46. package/dist/assets/esm-DEu9JbAE.js +2 -0
  47. package/dist/assets/{esm-BciT3LGF.js → esm-DZkj1VLJ.js} +2 -2
  48. package/dist/assets/{esm-CvWQdH3L.js → esm-DtJz1M8R.js} +2 -2
  49. package/dist/assets/{feature-flag-catalog-CHuc71P8.js → feature-flag-catalog-GgSNKkqP.js} +1 -1
  50. package/dist/assets/{file-markdown-BXUvAQ24.js → file-markdown-Bq97tNxs.js} +1 -1
  51. package/dist/assets/{general-page-gojItIOd.js → general-page-D-Gr2lkW.js} +1 -1
  52. package/dist/assets/{haptics-DKVhthJo.js → haptics-lMERs7us.js} +2 -2
  53. package/dist/assets/hatching-screen-BlwicgIz.js +1 -0
  54. package/dist/assets/home-page-route-D24x4A0S.js +1 -0
  55. package/dist/assets/{hosting-screen-BTLHWS2M.js → hosting-screen-BZLZular.js} +1 -1
  56. package/dist/assets/identity-page-route-BwOJeenx.js +1 -0
  57. package/dist/assets/{index-BjtwYdrT.css → index-C9GrLGul.css} +1 -1
  58. package/dist/assets/{index-CSefSVJO.js → index-yu6nDHvG.js} +21 -21
  59. package/dist/assets/{inspect-page-CT8NspqC.js → inspect-page-1RejwSP_.js} +4 -4
  60. package/dist/assets/{integrations-page-DtClqS91.js → integrations-page-BV5BiHPD.js} +1 -1
  61. package/dist/assets/{intelligence-layout-D9ReVcK0.js → intelligence-layout-iQFO8in_.js} +1 -1
  62. package/dist/assets/{keyboard-shortcuts-page-CovdLPhh.js → keyboard-shortcuts-page-jt13JtxS.js} +1 -1
  63. package/dist/assets/{library-detail-page-MAsxHH08.js → library-detail-page-BAGWt1Lw.js} +1 -1
  64. package/dist/assets/{library-page-CYuSc92M.js → library-page-CqeoBhDY.js} +1 -1
  65. package/dist/assets/{login-flow-CHNlba5i.js → login-flow-B6q00uIW.js} +1 -1
  66. package/dist/assets/{login-page-CK1TxruP.js → login-page-BQVTWuQc.js} +1 -1
  67. package/dist/assets/{logout-page-W3gl_1Ax.js → logout-page-BV0URcAd.js} +1 -1
  68. package/dist/assets/{logs-layout-CR7u05YO.js → logs-layout-DO3yfZqD.js} +1 -1
  69. package/dist/assets/{memory-router-playground-page-eDjKwsbG.js → memory-router-playground-page-CQxX6mCn.js} +1 -1
  70. package/dist/assets/{metric-card-BN23geOu.js → metric-card-DvXjHVCV.js} +1 -1
  71. package/dist/assets/{mobile-sidebar-drawer-3LqMCZgK.js → mobile-sidebar-drawer-Epbt6p-k.js} +1 -1
  72. package/dist/assets/{native-file-Cn3RbQbT.js → native-file-DI99Emal.js} +2 -2
  73. package/dist/assets/{notifications-page-CtyUuC15.js → notifications-page-CXaZpD3s.js} +1 -1
  74. package/dist/assets/{oauth-complete-page-3DcY6Or3.js → oauth-complete-page-BlJm9tRJ.js} +1 -1
  75. package/dist/assets/{oauth-popup-complete-page-Cn-1bOwa.js → oauth-popup-complete-page-BqUopTat.js} +1 -1
  76. package/dist/assets/{page-shell-C2TBO8M8.js → page-shell-BUGBKCmv.js} +1 -1
  77. package/dist/assets/{pairing-page-Bb-_q_zP.js → pairing-page-B5GrCx4C.js} +1 -1
  78. package/dist/assets/{platform-loopback-page-Dfl_gjZm.js → platform-loopback-page-MZdCPXRI.js} +1 -1
  79. package/dist/assets/{plugin-detail-page-C_vv0F7O.js → plugin-detail-page-Byuqbr1N.js} +1 -1
  80. package/dist/assets/plugins-page-Ci0CoSAN.js +1 -0
  81. package/dist/assets/{prechat-route-CgCradwf.js → prechat-route-9JFn-w_1.js} +1 -1
  82. package/dist/assets/{prefs-DYaOj-dg.js → prefs-B1Y3q3c8.js} +1 -1
  83. package/dist/assets/{privacy-page-BqYdFos7.js → privacy-page-BTpvj9ZP.js} +1 -1
  84. package/dist/assets/{privacy-screen-DBMkRqiF.js → privacy-screen-CUbVcDf_.js} +1 -1
  85. package/dist/assets/{provider-callback-page-B-aDgII8.js → provider-callback-page-fB2tIyqL.js} +1 -1
  86. package/dist/assets/{provider-signup-page-CYK4VNf0.js → provider-signup-page-C4Dn-wtJ.js} +1 -1
  87. package/dist/assets/{quick-input-page-oif3WEFT.js → quick-input-page-Cv_CzapK.js} +1 -1
  88. package/dist/assets/{research-mock-page-CooZPqtv.js → research-mock-page-1T92rXz3.js} +1 -1
  89. package/dist/assets/{research-onboarding-route-BJqAsTdE.js → research-onboarding-route-CmWgwOFk.js} +3 -3
  90. package/dist/assets/{review-terms-screen-CVRYEl6e.js → review-terms-screen-DrD4vywk.js} +1 -1
  91. package/dist/assets/{risk-Dsj4oM8c.js → risk-Dopd25rc.js} +1 -1
  92. package/dist/assets/{security-page-DN5BI6Ag.js → security-page-BYI7twYM.js} +1 -1
  93. package/dist/assets/select-assistant-screen-Br-PNDO1.js +1 -0
  94. package/dist/assets/{settings-layout-BNwCqvBi.js → settings-layout-lddMUg7A.js} +1 -1
  95. package/dist/assets/share-feedback-modal-DSwfhMsV.js +1 -0
  96. package/dist/assets/{sidebar-tree-Bh-tcSsp.js → sidebar-tree-C1_LiBB9.js} +1 -1
  97. package/dist/assets/{signup-page-D6cMhBxv.js → signup-page-D6hAK-Us.js} +1 -1
  98. package/dist/assets/{signup-shell-D4Afeijm.js → signup-shell-DufHA5do.js} +1 -1
  99. package/dist/assets/{site-favicon-DSzk4cg0.js → site-favicon-fQHLTT6F.js} +1 -1
  100. package/dist/assets/{skill-detail-page-Jisds_Gs.js → skill-detail-page-BlfgTyFC.js} +1 -1
  101. package/dist/assets/{skill-detail-panel-BEJqfJig.js → skill-detail-panel-BGoRUWNU.js} +1 -1
  102. package/dist/assets/{skills-CSlvOB79.js → skills-AtSQBwXr.js} +1 -1
  103. package/dist/assets/{skills-page-Cs1EG4X5.js → skills-page-DeIiyhVc.js} +1 -1
  104. package/dist/assets/{sounds-page-ChFJ0OPm.js → sounds-page-BgLLJ-o9.js} +1 -1
  105. package/dist/assets/{src-B2IjVySQ.js → src-zsLiFPw3.js} +1 -1
  106. package/dist/assets/{subagent-detail-panel-ACj_B6Id.js → subagent-detail-panel-BGuVa8-m.js} +1 -1
  107. package/dist/assets/{system-events-page-JhzC5xhW.js → system-events-page-C1hXOYmg.js} +1 -1
  108. package/dist/assets/{tiptap-document-editor-DSny-IjF.js → tiptap-document-editor-C-eOEBR_.js} +1 -1
  109. package/dist/assets/tool-detail-panel-wAuQ7gi8.js +2 -0
  110. package/dist/assets/{upgrade-cancel-page-D_YziHQs.js → upgrade-cancel-page-BGgPmDmT.js} +1 -1
  111. package/dist/assets/{upgrade-success-page-Cg7IIDei.js → upgrade-success-page-TJBopZ0Z.js} +1 -1
  112. package/dist/assets/{usage-page-DB3LFuYw.js → usage-page-DLWFk2P0.js} +1 -1
  113. package/dist/assets/use-edge-swipe-back-B4XlZ1Iu.js +1 -0
  114. package/dist/assets/use-invite-link-dialog-BdnW1BHj.js +1 -0
  115. package/dist/assets/use-is-org-ready-jhEM-4rY.js +1 -0
  116. package/dist/assets/{use-onboarding-login-Bo_t51AV.js → use-onboarding-login-B-1jrjFL.js} +1 -1
  117. package/dist/assets/{use-reduced-motion-CcGT6CHV.js → use-reduced-motion-Cj0Z8KSf.js} +1 -1
  118. package/dist/assets/{use-skill-actions-e6TfdF23.js → use-skill-actions-BpVxiQZY.js} +1 -1
  119. package/dist/assets/{use-skill-categories-i_9x26zg.js → use-skill-categories-CCxtjMC_.js} +1 -1
  120. package/dist/assets/{use-skill-detail-files-Cu4nrHPA.js → use-skill-detail-files-Dpp521cY.js} +1 -1
  121. package/dist/assets/{voice-page-wTcwV9j9.js → voice-page-BoCTB8Jx.js} +1 -1
  122. package/dist/assets/{weather-forecast-display-C_3DSHxa.js → weather-forecast-display-Bix8rpji.js} +1 -1
  123. package/dist/assets/{web-DlbBHOna.js → web-C1L-cpPj.js} +1 -1
  124. package/dist/assets/{web-BpBQ3Cf2.js → web-RhBklijR.js} +1 -1
  125. package/dist/assets/{welcome-screen-BF3r_rfT.js → welcome-screen-CVI4Hjnt.js} +1 -1
  126. package/dist/assets/{workflow-detail-panel-DzvDXyoD.js → workflow-detail-panel-CwZH3tDl.js} +1 -1
  127. package/dist/assets/workspace-page-CwIsXk1j.js +1 -0
  128. package/dist/index.html +28 -27
  129. package/package.json +1 -1
  130. package/dist/assets/channels-page-route-6cT6U3pZ.js +0 -9
  131. package/dist/assets/chat-markdown-message-CItp7csw.js +0 -2
  132. package/dist/assets/community-page-BVJxxP10.js +0 -1
  133. package/dist/assets/contacts-page-route-WXG6_xo2.js +0 -1
  134. package/dist/assets/debug-page-C-HWHD-3.js +0 -4
  135. package/dist/assets/esm-DsIXwGm7.js +0 -2
  136. package/dist/assets/hatching-screen-C0MNyetb.js +0 -1
  137. package/dist/assets/home-page-route-X4KYSdMI.js +0 -1
  138. package/dist/assets/identity-page-route-D5xzlpim.js +0 -1
  139. package/dist/assets/plugins-page-Cv0FXn1j.js +0 -1
  140. package/dist/assets/select-assistant-screen-B63mlflD.js +0 -1
  141. package/dist/assets/share-feedback-modal-BloP-1QE.js +0 -1
  142. package/dist/assets/tool-detail-panel-z5iYNIYq.js +0 -2
  143. package/dist/assets/use-edge-swipe-back-AcKDuMrX.js +0 -1
  144. package/dist/assets/use-invite-link-dialog-CExxDwnZ.js +0 -1
  145. package/dist/assets/use-is-org-ready-BtwH2--_.js +0 -1
  146. package/dist/assets/workspace-page-DCcsRyQz.js +0 -1
  147. /package/dist/assets/{a2a-invite-BriFFHnO.js → a2a-invite-B9cylfIO.js} +0 -0
  148. /package/dist/assets/{app-info-LSjlWG3w.js → app-info-Clwt3pCt.js} +0 -0
  149. /package/dist/assets/{build.umd-wlq6sZjw.js → build.umd-CxdKgGWo.js} +0 -0
  150. /package/dist/assets/{contacts-gateway-CNqVHBQ3.js → contacts-gateway-CW5CipBv.js} +0 -0
  151. /package/dist/assets/{credential-entry-page-jJzKVnQk.js → credential-entry-page-9H2HOu88.js} +0 -0
  152. /package/dist/assets/{danger-zone-redirect-page-DL5S8CAN.js → danger-zone-redirect-page-BWg7rn8D.js} +0 -0
  153. /package/dist/assets/{definitions-alqf_FBK.js → definitions-CaYcW4Yq.js} +0 -0
  154. /package/dist/assets/{definitions-B1DK4OsQ.js → definitions-DScTW2c-.js} +0 -0
  155. /package/dist/assets/{emoji-catalog-data-D_xqkMQV.js → emoji-catalog-data-D8lRMt3A.js} +0 -0
  156. /package/dist/assets/{environment-store-fb1I8_0E.js → environment-store-C0f32873.js} +0 -0
  157. /package/dist/assets/{esm-DwTCNETa.js → esm-B54gzHCZ.js} +0 -0
  158. /package/dist/assets/{file-editor-BbrbkQCm.js → file-editor-sT7eHxsw.js} +0 -0
  159. /package/dist/assets/{format-date-BczUbfC1.js → format-date-CghpPTDc.js} +0 -0
  160. /package/dist/assets/{format-file-size-D7iZejgy.js → format-file-size-DzVEncaw.js} +0 -0
  161. /package/dist/assets/{llm-dimension-Bu_nHMF_.js → llm-dimension-DyYwG3mU.js} +0 -0
  162. /package/dist/assets/{mutation-error-CrhKyTkx.js → mutation-error-DYv0eJ_i.js} +0 -0
  163. /package/dist/assets/{onboarding-step-layout-zvLUIT7j.js → onboarding-step-layout-2XcmxqFN.js} +0 -0
  164. /package/dist/assets/{optimistic-lifecycle-DTggtDfs.js → optimistic-lifecycle-BvfDBY8o.js} +0 -0
  165. /package/dist/assets/{password-reset-page-DVIt7mWy.js → password-reset-page-BCk9Si73.js} +0 -0
  166. /package/dist/assets/{pdf-CuY9CA7Q.js → pdf-C3Qukw-J.js} +0 -0
  167. /package/dist/assets/{plugins-surface-C7NU-_rg.js → plugins-surface-z3RTZS4H.js} +0 -0
  168. /package/dist/assets/{prechat-names-b5RkG_F-.js → prechat-names-clVy5Mee.js} +0 -0
  169. /package/dist/assets/{provider-key-DBiHV_K5.js → provider-key-3AHnKoz9.js} +0 -0
  170. /package/dist/assets/{proxy-BzlH_XAe.js → proxy-o6cPThl2.js} +0 -0
  171. /package/dist/assets/{public-asset-Di3QykUd.js → public-asset-GKv5zCfZ.js} +0 -0
  172. /package/dist/assets/{schedules-Dj3YQqG5.js → schedules-BfKi12EZ.js} +0 -0
  173. /package/dist/assets/{setting-row-QKgqbQ4U.js → setting-row-CUka7_L9.js} +0 -0
  174. /package/dist/assets/{skill-icon-CEEEqpSq.js → skill-icon-cNkD2w1X.js} +0 -0
  175. /package/dist/assets/{status-badge-pill-BopXdkRS.js → status-badge-pill-0N6rTEBg.js} +0 -0
  176. /package/dist/assets/{step-indicator-dots-Cou0-IgA.js → step-indicator-dots-D03TmFKG.js} +0 -0
  177. /package/dist/assets/{system-events-redirect-page-D5EfWOEK.js → system-events-redirect-page-DbaFKRXH.js} +0 -0
  178. /package/dist/assets/{three-dot-indicator-BVtP8eei.js → three-dot-indicator-DNuHHwtA.js} +0 -0
  179. /package/dist/assets/{usage-window-Btqj3Jpn.js → usage-window-C6gWu5Qu.js} +0 -0
  180. /package/dist/assets/{use-active-assistant-id-BNRMo_Mi.js → use-active-assistant-id-BWXi63qg.js} +0 -0
  181. /package/dist/assets/{use-copy-to-clipboard-tXJpCn2M.js → use-copy-to-clipboard-BCTXSMa-.js} +0 -0
  182. /package/dist/assets/{web-CsaTwTXy.js → web-BD2N6zhd.js} +0 -0
  183. /package/dist/assets/{web-Xex3K4gk.js → web-BaubW4Pp.js} +0 -0
  184. /package/dist/assets/{web-U-rR-rZR.js → web-CJiP8Lg6.js} +0 -0
  185. /package/dist/assets/{web-D5_lKOWn.js → web-D8PpvYf_.js} +0 -0
  186. /package/dist/assets/{web-B9ZvD-Tt.js → web-Duw5A2aP.js} +0 -0
  187. /package/dist/assets/{web-Bi2V5gD3.js → web-O1LOb-o9.js} +0 -0
  188. /package/dist/assets/{xterm-D9pOJCAq.js → xterm-CBmd_y-b.js} +0 -0
  189. /package/dist/assets/{xterm-addon-fit-BTV6oL76.js → xterm-addon-fit-THPW0uy0.js} +0 -0
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-CTXnt94k.js","assets/preload-helper-BewR0kVT.js","assets/dist-DS5iJwBJ2.js","assets/definitions-alqf_FBK.js","assets/esm-BciT3LGF.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./chunk-jRWAZmH_.js";import{t}from"./preload-helper-BewR0kVT.js";import{t as n}from"./dist-DS5iJwBJ2.js";var r=e({saveFile:()=>i});async function i(e,t){n.isNativePlatform()?await a(e,t):o(e,t)}async function a(e,n){let{Filesystem:r,Directory:i}=await t(async()=>{let{Filesystem:e,Directory:t}=await import(`./esm-CTXnt94k.js`);return{Filesystem:e,Directory:t}},__vite__mapDeps([0,1,2,3])),{Share:a}=await t(async()=>{let{Share:e}=await import(`./esm-BciT3LGF.js`);return{Share:e}},__vite__mapDeps([4,1,2])),o;if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch file: ${t.statusText}`);o=await t.blob()}else o=e;let c=await s(o),l=await r.writeFile({path:n,data:c,directory:i.Cache});try{await a.share({files:[l.uri]})}catch{}r.deleteFile({path:n,directory:i.Cache}).catch(()=>{})}function o(e,t){let n=document.createElement(`a`);typeof e==`string`?n.href=e:n.href=URL.createObjectURL(e),n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),e instanceof Blob&&URL.revokeObjectURL(n.href)}function s(e){return new Promise((t,n)=>{let r=new FileReader;r.onloadend=()=>{let e=r.result.split(`,`)[1];e?t(e):n(Error(`Failed to convert blob to base64`))},r.onerror=()=>n(r.error),r.readAsDataURL(e)})}export{i as n,r as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-CT8NUp3h.js","assets/preload-helper-BewR0kVT.js","assets/dist-DS5iJwBJ2.js","assets/definitions-CaYcW4Yq.js","assets/esm-DZkj1VLJ.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./chunk-jRWAZmH_.js";import{t}from"./preload-helper-BewR0kVT.js";import{t as n}from"./dist-DS5iJwBJ2.js";var r=e({saveFile:()=>i});async function i(e,t){n.isNativePlatform()?await a(e,t):o(e,t)}async function a(e,n){let{Filesystem:r,Directory:i}=await t(async()=>{let{Filesystem:e,Directory:t}=await import(`./esm-CT8NUp3h.js`);return{Filesystem:e,Directory:t}},__vite__mapDeps([0,1,2,3])),{Share:a}=await t(async()=>{let{Share:e}=await import(`./esm-DZkj1VLJ.js`);return{Share:e}},__vite__mapDeps([4,1,2])),o;if(typeof e==`string`){let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch file: ${t.statusText}`);o=await t.blob()}else o=e;let c=await s(o),l=await r.writeFile({path:n,data:c,directory:i.Cache});try{await a.share({files:[l.uri]})}catch{}r.deleteFile({path:n,directory:i.Cache}).catch(()=>{})}function o(e,t){let n=document.createElement(`a`);typeof e==`string`?n.href=e:n.href=URL.createObjectURL(e),n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),e instanceof Blob&&URL.revokeObjectURL(n.href)}function s(e){return new Promise((t,n)=>{let r=new FileReader;r.onloadend=()=>{let e=r.result.split(`,`)[1];e?t(e):n(Error(`Failed to convert blob to base64`))},r.onerror=()=>n(r.error),r.readAsDataURL(e)})}export{i as n,r as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./createLucideIcon-IRfcSUxS.js";import{t as c}from"./bell-BQLonLMp.js";import{t as l}from"./check-DFNrQERi.js";import{t as u}from"./menu-Dy5QbnTj.js";import{t as d}from"./loader-circle-Cz7opInR.js";import{t as f}from"./moon-B8qiwjrW.js";import{t as p}from"./triangle-alert-Z0Gq0IuB.js";import{t as m}from"./notice-DkcNAP8O.js";import{t as h}from"./popover-CFL4WZTr.js";import{t as g}from"./input-CoUmPnRU.js";import{n as _,t as v}from"./panel-item-CouW2A55.js";import{n as y}from"./toast-xTp-xwYL.js";import{c as b}from"./routes-BbeIx_F9.js";import{_t as x,ft as S,gt as C,ht as w,mt as T,pt as E,vt as D}from"./react-query.gen-DPzPS206.js";import{D as O,Hr as k,Ur as A,Wr as j,vr as M}from"./index-CSefSVJO.js";import{t as N}from"./mutation-error-CrhKyTkx.js";import{r as P}from"./format-date-BczUbfC1.js";var F=s(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=s(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),L=e(t(),1);function R(e){e.invalidateQueries({queryKey:T()}),e.invalidateQueries({queryKey:D()})}function z(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var B=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],V=o();function H({notificationId:e,currentlySnoozed:t,children:n}){let i=r(),o=a(x()),s=M(),[c,l]=(0,L.useState)(!1),d=()=>R(i),f=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:d,onError:N(`Failed to snooze notification`)})},p=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:d,onError:N(`Failed to clear snooze`)})};return s?(0,V.jsxs)(_.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Snooze until…`})}),(0,V.jsxs)(_.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(v,{label:e,onSelect:()=>{o.isPending||(l(!1),f(t))}},e)),t&&(0,V.jsx)(v,{label:`Clear snooze`,onSelect:()=>{o.isPending||(l(!1),p())}})]})]})]}):(0,V.jsxs)(u.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(u.Trigger,{children:n}),(0,V.jsxs)(u.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(u.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>f(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(u.Separator,{}),(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>p(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(w()),l=a(C()),[u,f]=(0,L.useState)(``),p=()=>R(s),m=()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();c.mutate({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:u.trim()||`User requested pause`,expires_at:e}},{onSuccess:e=>{n(e),p(),t()},onError:N(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),p(),t()},onError:N(`Failed to resume alerts`)})},_=c.isPending||l.isPending;return(0,V.jsxs)(`div`,{children:[!o&&(0,V.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,V.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,P(e.expires_at)]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>h(e.id),disabled:_,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,V.jsx)(g,{type:`text`,value:u,onChange:e=>f(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:_,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function W({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=z(e),a=!e.is_read;return(0,V.jsxs)(`div`,{className:`relative rounded-lg border border-[var(--border-base)] p-4`,style:{background:e.is_resolved?`var(--surface-base)`:`var(--surface-lift)`,opacity:e.is_resolved?.75:1},children:[(0,V.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-negative-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,V.jsx)(p,{className:`h-3 w-3`}),`Alert`]}),i&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--surface-base)] px-2 py-0.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-positive-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,children:[(0,V.jsx)(l,{className:`h-3 w-3`}),`Resolved`]})]}),(0,V.jsx)(`h3`,{className:`text-body-medium-default leading-tight`,style:{color:e.is_resolved?`var(--content-secondary)`:`var(--content-default)`},children:e.title}),e.body&&(0,V.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsxs)(`span`,{children:[`Last seen `,P(e.last_seen_at)]}),e.occurrence_count>1&&(0,V.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id,a),disabled:n,className:`flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-body-small-default transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,style:{background:a?`var(--primary-base)`:`var(--surface-base)`,color:a?`var(--content-inset)`:`var(--content-secondary)`},children:[n?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(l,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,V.jsx)(H,{notificationId:e.id,currentlySnoozed:i,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=j({platformHostedOnly:!0}),t=k(),o=A(),s=r(),l=M(),[u,f]=(0,L.useState)(`open`),[p,g]=(0,L.useState)(!1),[v,x]=(0,L.useState)([]),{data:C,isLoading:w,isError:T,refetch:D}=i({...E({query:{status:u}}),enabled:e===`full`&&t}),N=e===`full`&&o||(t?w:!1);(0,L.useEffect)(()=>{!t&&p&&g(!1)},[t,p]);let P=t?T:!1,z=t?C?.results??[]:[],B=z.filter(e=>!e.is_read&&!e.is_resolved),H=a(S()),[G,K]=(0,L.useState)(new Set),[q,J]=(0,L.useState)(!1),Y=(0,L.useCallback)(()=>R(s),[s]),X=async(e,t)=>{K(t=>new Set(t).add(e));try{await H.mutateAsync({path:{id:e},body:{acknowledged:t}}),Y()}catch(e){y.error(e instanceof Error?e.message:`Failed to update notification`)}finally{K(t=>{let n=new Set(t);return n.delete(e),n})}},Z=async()=>{if(!(B.length===0||q)){J(!0);try{await Promise.allSettled(B.map(e=>H.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{Y(),J(!1)}}},Q=(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,title:`Pause alerts`,children:[(0,V.jsx)(F,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),$=(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>x(t=>[...t,e]),onPauseDeleted:e=>x(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,V.jsx)(n,{replace:!0,to:b.settings.general}):e===`disabled`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,V.jsx)(O,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(l?(0,V.jsxs)(_.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Pause alerts`})}),(0,V.jsx)(_.Body,{children:(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>x(t=>[...t,e]),onPauseDeleted:e=>x(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(h.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(h.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(h.Content,{align:`end`,className:`w-72`,children:$})]}))]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-1`,children:[`open`,`resolved`].map(e=>{let t=u===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>f(e),className:`cursor-pointer rounded px-3 py-1 text-body-small-default capitalize transition-colors`,style:{background:t?`var(--surface-lift)`:`transparent`,color:t?`var(--content-default)`:`var(--content-secondary)`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.08)`:void 0},children:e},e)})}),u===`open`&&B.length>1&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>void Z(),disabled:q,className:`ml-auto flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-transparent px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:[q?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(I,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),N?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,V.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(m,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void D(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):z.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,V.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,u,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:u===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:z.map(e=>(0,V.jsx)(W,{notification:e,onAck:(e,t)=>void X(e,t),isAcking:G.has(e.id)},e.id))})]})}export{G as NotificationsPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./createLucideIcon-IRfcSUxS.js";import{t as c}from"./bell-BQLonLMp.js";import{t as l}from"./check-DFNrQERi.js";import{t as u}from"./menu-Dy5QbnTj.js";import{t as d}from"./loader-circle-Cz7opInR.js";import{t as f}from"./moon-B8qiwjrW.js";import{t as p}from"./triangle-alert-Z0Gq0IuB.js";import{t as m}from"./notice-DkcNAP8O.js";import{t as h}from"./popover-CFL4WZTr.js";import{t as g}from"./input-CoUmPnRU.js";import{n as _,t as v}from"./panel-item-CouW2A55.js";import{n as y}from"./toast-xTp-xwYL.js";import{c as b}from"./routes-BbeIx_F9.js";import{_t as x,ft as S,gt as C,ht as w,mt as T,pt as E,vt as D}from"./react-query.gen-DPzPS206.js";import{D as O,Hr as k,Ur as A,Vr as j,_r as M}from"./index-yu6nDHvG.js";import{t as N}from"./mutation-error-DYv0eJ_i.js";import{r as P}from"./format-date-CghpPTDc.js";var F=s(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=s(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),L=e(t(),1);function R(e){e.invalidateQueries({queryKey:T()}),e.invalidateQueries({queryKey:D()})}function z(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var B=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],V=o();function H({notificationId:e,currentlySnoozed:t,children:n}){let i=r(),o=a(x()),s=M(),[c,l]=(0,L.useState)(!1),d=()=>R(i),f=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:d,onError:N(`Failed to snooze notification`)})},p=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:d,onError:N(`Failed to clear snooze`)})};return s?(0,V.jsxs)(_.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Snooze until…`})}),(0,V.jsxs)(_.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(v,{label:e,onSelect:()=>{o.isPending||(l(!1),f(t))}},e)),t&&(0,V.jsx)(v,{label:`Clear snooze`,onSelect:()=>{o.isPending||(l(!1),p())}})]})]})]}):(0,V.jsxs)(u.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(u.Trigger,{children:n}),(0,V.jsxs)(u.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(u.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>f(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(u.Separator,{}),(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>p(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(w()),l=a(C()),[u,f]=(0,L.useState)(``),p=()=>R(s),m=()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();c.mutate({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:u.trim()||`User requested pause`,expires_at:e}},{onSuccess:e=>{n(e),p(),t()},onError:N(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),p(),t()},onError:N(`Failed to resume alerts`)})},_=c.isPending||l.isPending;return(0,V.jsxs)(`div`,{children:[!o&&(0,V.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,V.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,P(e.expires_at)]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>h(e.id),disabled:_,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,V.jsx)(g,{type:`text`,value:u,onChange:e=>f(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:_,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function W({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=z(e),a=!e.is_read;return(0,V.jsxs)(`div`,{className:`relative rounded-lg border border-[var(--border-base)] p-4`,style:{background:e.is_resolved?`var(--surface-base)`:`var(--surface-lift)`,opacity:e.is_resolved?.75:1},children:[(0,V.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-negative-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,V.jsx)(p,{className:`h-3 w-3`}),`Alert`]}),i&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--surface-base)] px-2 py-0.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-positive-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,children:[(0,V.jsx)(l,{className:`h-3 w-3`}),`Resolved`]})]}),(0,V.jsx)(`h3`,{className:`text-body-medium-default leading-tight`,style:{color:e.is_resolved?`var(--content-secondary)`:`var(--content-default)`},children:e.title}),e.body&&(0,V.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsxs)(`span`,{children:[`Last seen `,P(e.last_seen_at)]}),e.occurrence_count>1&&(0,V.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id,a),disabled:n,className:`flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-body-small-default transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,style:{background:a?`var(--primary-base)`:`var(--surface-base)`,color:a?`var(--content-inset)`:`var(--content-secondary)`},children:[n?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(l,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,V.jsx)(H,{notificationId:e.id,currentlySnoozed:i,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=A({platformHostedOnly:!0}),t=j(),o=k(),s=r(),l=M(),[u,f]=(0,L.useState)(`open`),[p,g]=(0,L.useState)(!1),[v,x]=(0,L.useState)([]),{data:C,isLoading:w,isError:T,refetch:D}=i({...E({query:{status:u}}),enabled:e===`full`&&t}),N=e===`full`&&o||(t?w:!1);(0,L.useEffect)(()=>{!t&&p&&g(!1)},[t,p]);let P=t?T:!1,z=t?C?.results??[]:[],B=z.filter(e=>!e.is_read&&!e.is_resolved),H=a(S()),[G,K]=(0,L.useState)(new Set),[q,J]=(0,L.useState)(!1),Y=(0,L.useCallback)(()=>R(s),[s]),X=async(e,t)=>{K(t=>new Set(t).add(e));try{await H.mutateAsync({path:{id:e},body:{acknowledged:t}}),Y()}catch(e){y.error(e instanceof Error?e.message:`Failed to update notification`)}finally{K(t=>{let n=new Set(t);return n.delete(e),n})}},Z=async()=>{if(!(B.length===0||q)){J(!0);try{await Promise.allSettled(B.map(e=>H.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{Y(),J(!1)}}},Q=(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,title:`Pause alerts`,children:[(0,V.jsx)(F,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),$=(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>x(t=>[...t,e]),onPauseDeleted:e=>x(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,V.jsx)(n,{replace:!0,to:b.settings.general}):e===`disabled`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,V.jsx)(O,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(l?(0,V.jsxs)(_.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Pause alerts`})}),(0,V.jsx)(_.Body,{children:(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>x(t=>[...t,e]),onPauseDeleted:e=>x(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(h.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(h.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(h.Content,{align:`end`,className:`w-72`,children:$})]}))]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-1`,children:[`open`,`resolved`].map(e=>{let t=u===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>f(e),className:`cursor-pointer rounded px-3 py-1 text-body-small-default capitalize transition-colors`,style:{background:t?`var(--surface-lift)`:`transparent`,color:t?`var(--content-default)`:`var(--content-secondary)`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.08)`:void 0},children:e},e)})}),u===`open`&&B.length>1&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>void Z(),disabled:q,className:`ml-auto flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-transparent px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:[q?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(I,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),N?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,V.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(m,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void D(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):z.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,V.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,u,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:u===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:z.map(e=>(0,V.jsx)(W,{notification:e,onAck:(e,t)=>void X(e,t),isAcking:G.has(e.id)},e.id))})]})}export{G as NotificationsPage};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{en as i}from"./index-CSefSVJO.js";var a=e(t(),1),o=r();function s(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,o.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function c(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var l=`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{en as i}from"./index-yu6nDHvG.js";var a=e(t(),1),o=r();function s(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,o.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function c(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var l=`
2
2
  :root {
3
3
  --oauth-surface: #F5F3EB;
4
4
  --oauth-surface-card: #FFFFFF;
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{n as i,r as a}from"./native-deep-link-CJGNy9bj.js";import{en as o}from"./index-CSefSVJO.js";var s=e(t(),1),c=r();function l(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,c.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function u(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var d=`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{n as i,r as a}from"./native-deep-link-CJGNy9bj.js";import{en as o}from"./index-yu6nDHvG.js";var s=e(t(),1),c=r();function l(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,c.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function u(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var d=`
2
2
  :root {
3
3
  --oauth-surface: #F5F3EB;
4
4
  --oauth-surface-card: #FFFFFF;
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./cn-C36Yvcac.js";import"./src-B2IjVySQ.js";var n=e();function r({children:e,className:r}){return(0,n.jsx)(`div`,{className:t(`flex min-h-0 flex-1 flex-col rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-6 py-5`,r),children:e})}export{r as t};
1
+ import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./cn-C36Yvcac.js";import"./src-zsLiFPw3.js";var n=e();function r({children:e,className:r}){return(0,n.jsx)(`div`,{className:t(`flex min-h-0 flex-1 flex-col rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-6 py-5`,r),children:e})}export{r as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./circle-alert-zOqdmf25.js";import{t as o}from"./circle-check-VSiny8yl.js";import{t as s}from"./loader-circle-Cz7opInR.js";import{g as c}from"./local-mode-grqHUoNh.js";import{a as l,i as u,n as d,r as f,t as p}from"./remote-gateway-session-CbBWrPZH.js";import{t as m}from"./return-to-BwxkOGDI.js";import{c as h}from"./routes-BbeIx_F9.js";import{t as g}from"./index-CSefSVJO.js";var _=e(t(),1),v=i();function y(e){switch(e.kind){case`starting`:return{title:`Starting pairing`,body:`Creating a code for this browser.`};case`approved`:return{title:`Connected`,body:`Opening your assistant.`};case`expired`:return{title:`Pairing expired`,body:`Start a new web pairing from the local assistant.`};case`error`:return{title:`Pairing failed`,body:e.message};case`polling`:return{title:`Waiting for approval`,body:`Confirm this code on the machine running your assistant.`}}}function b({state:e}){return e.kind===`approved`?(0,v.jsx)(o,{className:`h-5 w-5 text-green-600`,"aria-hidden":!0}):e.kind===`starting`||e.kind===`polling`?(0,v.jsx)(s,{className:`h-5 w-5 animate-spin text-blue-600`,"aria-hidden":!0}):(0,v.jsx)(a,{className:`h-5 w-5 text-red-600`,"aria-hidden":!0})}function x(){let e=r(),t=n(),i=c(),a=(0,_.useMemo)(()=>m(new URLSearchParams(e.search).get(`returnTo`),h.assistant),[e.search]),o=(0,_.useMemo)(()=>l(`${e.pathname}${e.search}${e.hash}`),[e.pathname,e.search,e.hash]),[s,x]=(0,_.useState)(()=>o.deviceCode?{deviceCode:o.deviceCode,userCode:o.userCode}:null),[S,C]=(0,_.useState)(s?{kind:`polling`,expiresAt:null}:{kind:`starting`});if((0,_.useEffect)(()=>{if(!i||s)return;let e=new AbortController;return(async()=>{try{let t=await f(e.signal);x({deviceCode:t.deviceCode,userCode:t.userCode}),C({kind:`polling`,expiresAt:t.expiresAt})}catch{if(e.signal.aborted)return;C({kind:`error`,message:`The assistant could not start pairing. Refresh the page to try again.`})}})(),()=>{e.abort()}},[i,s]),(0,_.useEffect)(()=>{if(!i||!s?.deviceCode)return;let e=new AbortController,n=null,r=async()=>{try{let i=await u(s.deviceCode,e.signal);if(i.status===`pending`){C({kind:`polling`,expiresAt:i.expiresAt||null}),n=setTimeout(()=>void r(),Math.max(1,i.intervalSeconds)*1e3);return}d(i),C({kind:`approved`}),n=setTimeout(()=>t(a,{replace:!0}),250)}catch(t){if(e.signal.aborted)return;if(t instanceof p&&t.status===401){C({kind:`expired`});return}if(t instanceof p&&t.code===`GUARDIAN_REPAIR_REQUIRED`){C({kind:`error`,message:`The assistant's trust database needs repair. Run guardian repair on the machine hosting the assistant, then retry this same pairing link — the code stays valid.`});return}C({kind:`error`,message:`The assistant could not complete pairing. Try starting a new pairing.`})}};return r(),()=>{e.abort(),n&&clearTimeout(n)}},[i,s?.deviceCode,t,a]),!i)return(0,v.jsx)(g,{});let w=y(S);return(0,v.jsx)(`main`,{className:`flex min-h-svh items-center justify-center bg-[var(--background-default)] px-6 py-10 text-[var(--content-primary)]`,children:(0,v.jsxs)(`section`,{className:`w-full max-w-md rounded-lg border border-[var(--border-default)] bg-[var(--background-surface)] p-8 shadow-sm`,children:[(0,v.jsxs)(`div`,{className:`mb-5 flex items-center gap-3`,children:[(0,v.jsx)(b,{state:S}),(0,v.jsx)(`h1`,{className:`text-xl font-semibold`,children:w.title})]}),s?.userCode?(0,v.jsxs)(`div`,{className:`mb-5 rounded-md border border-[var(--border-subtle)] bg-[var(--background-muted)] p-4 text-center`,children:[(0,v.jsx)(`div`,{className:`text-xs font-medium uppercase text-[var(--content-secondary)]`,children:`Pairing code`}),(0,v.jsx)(`div`,{className:`mt-2 font-mono text-3xl font-semibold tracking-[0.18em]`,children:s.userCode})]}):null,(0,v.jsx)(`p`,{className:`text-sm leading-6 text-[var(--content-secondary)]`,children:w.body}),S.kind===`polling`&&S.expiresAt?(0,v.jsxs)(`p`,{className:`mt-4 text-xs text-[var(--content-tertiary)]`,children:[`Expires `,new Date(S.expiresAt).toLocaleTimeString(),`.`]}):null]})})}export{x as RemoteWebPairingPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./circle-alert-zOqdmf25.js";import{t as o}from"./circle-check-VSiny8yl.js";import{t as s}from"./loader-circle-Cz7opInR.js";import{g as c}from"./local-mode-grqHUoNh.js";import{a as l,i as u,n as d,r as f,t as p}from"./remote-gateway-session-CbBWrPZH.js";import{t as m}from"./return-to-BwxkOGDI.js";import{c as h}from"./routes-BbeIx_F9.js";import{t as g}from"./index-yu6nDHvG.js";var _=e(t(),1),v=i();function y(e){switch(e.kind){case`starting`:return{title:`Starting pairing`,body:`Creating a code for this browser.`};case`approved`:return{title:`Connected`,body:`Opening your assistant.`};case`expired`:return{title:`Pairing expired`,body:`Start a new web pairing from the local assistant.`};case`error`:return{title:`Pairing failed`,body:e.message};case`polling`:return{title:`Waiting for approval`,body:`Confirm this code on the machine running your assistant.`}}}function b({state:e}){return e.kind===`approved`?(0,v.jsx)(o,{className:`h-5 w-5 text-green-600`,"aria-hidden":!0}):e.kind===`starting`||e.kind===`polling`?(0,v.jsx)(s,{className:`h-5 w-5 animate-spin text-blue-600`,"aria-hidden":!0}):(0,v.jsx)(a,{className:`h-5 w-5 text-red-600`,"aria-hidden":!0})}function x(){let e=r(),t=n(),i=c(),a=(0,_.useMemo)(()=>m(new URLSearchParams(e.search).get(`returnTo`),h.assistant),[e.search]),o=(0,_.useMemo)(()=>l(`${e.pathname}${e.search}${e.hash}`),[e.pathname,e.search,e.hash]),[s,x]=(0,_.useState)(()=>o.deviceCode?{deviceCode:o.deviceCode,userCode:o.userCode}:null),[S,C]=(0,_.useState)(s?{kind:`polling`,expiresAt:null}:{kind:`starting`});if((0,_.useEffect)(()=>{if(!i||s)return;let e=new AbortController;return(async()=>{try{let t=await f(e.signal);x({deviceCode:t.deviceCode,userCode:t.userCode}),C({kind:`polling`,expiresAt:t.expiresAt})}catch{if(e.signal.aborted)return;C({kind:`error`,message:`The assistant could not start pairing. Refresh the page to try again.`})}})(),()=>{e.abort()}},[i,s]),(0,_.useEffect)(()=>{if(!i||!s?.deviceCode)return;let e=new AbortController,n=null,r=async()=>{try{let i=await u(s.deviceCode,e.signal);if(i.status===`pending`){C({kind:`polling`,expiresAt:i.expiresAt||null}),n=setTimeout(()=>void r(),Math.max(1,i.intervalSeconds)*1e3);return}d(i),C({kind:`approved`}),n=setTimeout(()=>t(a,{replace:!0}),250)}catch(t){if(e.signal.aborted)return;if(t instanceof p&&t.status===401){C({kind:`expired`});return}if(t instanceof p&&t.code===`GUARDIAN_REPAIR_REQUIRED`){C({kind:`error`,message:`The assistant's trust database needs repair. Run guardian repair on the machine hosting the assistant, then retry this same pairing link — the code stays valid.`});return}C({kind:`error`,message:`The assistant could not complete pairing. Try starting a new pairing.`})}};return r(),()=>{e.abort(),n&&clearTimeout(n)}},[i,s?.deviceCode,t,a]),!i)return(0,v.jsx)(g,{});let w=y(S);return(0,v.jsx)(`main`,{className:`flex min-h-svh items-center justify-center bg-[var(--background-default)] px-6 py-10 text-[var(--content-primary)]`,children:(0,v.jsxs)(`section`,{className:`w-full max-w-md rounded-lg border border-[var(--border-default)] bg-[var(--background-surface)] p-8 shadow-sm`,children:[(0,v.jsxs)(`div`,{className:`mb-5 flex items-center gap-3`,children:[(0,v.jsx)(b,{state:S}),(0,v.jsx)(`h1`,{className:`text-xl font-semibold`,children:w.title})]}),s?.userCode?(0,v.jsxs)(`div`,{className:`mb-5 rounded-md border border-[var(--border-subtle)] bg-[var(--background-muted)] p-4 text-center`,children:[(0,v.jsx)(`div`,{className:`text-xs font-medium uppercase text-[var(--content-secondary)]`,children:`Pairing code`}),(0,v.jsx)(`div`,{className:`mt-2 font-mono text-3xl font-semibold tracking-[0.18em]`,children:s.userCode})]}):null,(0,v.jsx)(`p`,{className:`text-sm leading-6 text-[var(--content-secondary)]`,children:w.body}),S.kind===`polling`&&S.expiresAt?(0,v.jsxs)(`p`,{className:`mt-4 text-xs text-[var(--content-tertiary)]`,children:[`Expires `,new Date(S.expiresAt).toLocaleTimeString(),`.`]}):null]})})}export{x as RemoteWebPairingPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{g as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{j as o,w as s}from"./local-mode-grqHUoNh.js";import{D as c,n as l}from"./auth-store-CD7PGb3q.js";import{c as u}from"./api-_7pKLlYA.js";import{c as d}from"./routes-BbeIx_F9.js";var f=e(n(),1),p=a(),m=`vellum:loopback:state`,h=`vellum:loopback:returnTo`;function g(){let[e]=i(),n=r(),[a,g]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let r=e.get(`state`),i=e.get(`session_token`),a=sessionStorage.getItem(m),f=sessionStorage.getItem(h)||d.assistant;if(sessionStorage.removeItem(m),sessionStorage.removeItem(h),!r||r!==a){g(`Login failed: state mismatch. Please try again.`);return}if(!i){g(`Login failed: no session token received. Please try again.`);return}if(!/^[a-zA-Z0-9]+$/.test(i)){g(`Login failed: invalid session token.`);return}(async()=>{if(!await o(i)){g(`Login failed: couldn't reach the local Vellum server to store the session. Please try again.`);return}await l.getState().initSession(),await t(!0);try{let e=await u();if(e.ok&&e.data.length>0){await s(e.data,c.getState().currentOrganizationId??void 0),n(d.assistant,{replace:!0});return}}catch{}n(f,{replace:!0})})()},[e,n]),a?(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:a}),(0,p.jsx)(`button`,{type:`button`,className:`mt-4 rounded-lg border border-[var(--border-disabled)] px-4 py-2 text-sm hover:bg-[var(--surface-lift)]`,onClick:()=>void n(d.welcome),children:`Back to Welcome`})]})}):(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:`Completing login...`})})}export{g as PlatformLoopbackPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{g as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{j as o,w as s}from"./local-mode-grqHUoNh.js";import{D as c,n as l}from"./auth-store-C09YAZEu.js";import{c as u}from"./api-_7pKLlYA.js";import{c as d}from"./routes-BbeIx_F9.js";var f=e(n(),1),p=a(),m=`vellum:loopback:state`,h=`vellum:loopback:returnTo`;function g(){let[e]=i(),n=r(),[a,g]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let r=e.get(`state`),i=e.get(`session_token`),a=sessionStorage.getItem(m),f=sessionStorage.getItem(h)||d.assistant;if(sessionStorage.removeItem(m),sessionStorage.removeItem(h),!r||r!==a){g(`Login failed: state mismatch. Please try again.`);return}if(!i){g(`Login failed: no session token received. Please try again.`);return}if(!/^[a-zA-Z0-9]+$/.test(i)){g(`Login failed: invalid session token.`);return}(async()=>{if(!await o(i)){g(`Login failed: couldn't reach the local Vellum server to store the session. Please try again.`);return}await l.getState().initSession(),await t(!0);try{let e=await u();if(e.ok&&e.data.length>0){await s(e.data,c.getState().currentOrganizationId??void 0),n(d.assistant,{replace:!0});return}}catch{}n(f,{replace:!0})})()},[e,n]),a?(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:a}),(0,p.jsx)(`button`,{type:`button`,className:`mt-4 rounded-lg border border-[var(--border-disabled)] px-4 py-2 text-sm hover:bg-[var(--surface-lift)]`,onClick:()=>void n(d.welcome),children:`Back to Welcome`})]})}):(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:`Completing login...`})})}export{g as PlatformLoopbackPage};
@@ -1 +1 @@
1
- import{p as e,r as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./assistant-identity-store-CX03CK8q.js";import{c as i}from"./routes-BbeIx_F9.js";import{t as a}from"./plugins-surface-C7NU-_rg.js";var o=n();function s(){let n=r.use.version(),s=a(),{name:c}=e();return n===null?null:s?c?(0,o.jsx)(t,{to:`${i.plugins}?plugin=${encodeURIComponent(c)}`,replace:!0}):(0,o.jsx)(t,{to:i.plugins,replace:!0}):(0,o.jsx)(t,{to:i.identity,replace:!0})}export{s as PluginDetailPage};
1
+ import{p as e,r as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./assistant-identity-store-CX03CK8q.js";import{c as i}from"./routes-BbeIx_F9.js";import{t as a}from"./plugins-surface-z3RTZS4H.js";var o=n();function s(){let n=r.use.version(),s=a(),{name:c}=e();return n===null?null:s?c?(0,o.jsx)(t,{to:`${i.plugins}?plugin=${encodeURIComponent(c)}`,replace:!0}):(0,o.jsx)(t,{to:i.plugins,replace:!0}):(0,o.jsx)(t,{to:i.identity,replace:!0})}export{s as PluginDetailPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,t as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./react-DJZBPgpf.js";import{F as i,t as a}from"./button-amTXFI-2.js";import{h as o,r as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as c}from"./QueryClientProvider-DKhXIxGb.js";import{t as l}from"./useQuery-B45lW1Kk.js";import{t as u}from"./useMutation-Lj4VunQV.js";import{t as d}from"./jsx-runtime-CVSDxk6A.js";import{t as f}from"./card-Bv5O5juh.js";import{t as p}from"./createLucideIcon-IRfcSUxS.js";import{t as m}from"./arrow-left-DI9551VI.js";import{t as h}from"./check-DFNrQERi.js";import{t as g}from"./cloud-off-Db1nySkc.js";import{t as _}from"./download-CAuK-nZ6.js";import{t as v}from"./external-link-Dqpx9nRm.js";import{i as y,n as b,r as x,t as S}from"./use-skill-categories-CCxtjMC_.js";import{t as C}from"./globe-4qSOWE2N.js";import{t as w}from"./hard-drive-rDxhoRUm.js";import{t as T}from"./loader-circle-Cz7opInR.js";import{t as E}from"./sparkles-PGiR5v1g.js";import{t as D}from"./triangle-alert-Z0Gq0IuB.js";import{t as ee}from"./x-CkSVp1Ok.js";import"./src-zsLiFPw3.js";import{t as O}from"./tag-CV4v7fRF.js";import{t as k}from"./popover-CFL4WZTr.js";import{t as A}from"./input-CoUmPnRU.js";import{t as j}from"./toggle-CDfguvUz.js";import{n as M,t as N}from"./panel-item-CouW2A55.js";import{n as P}from"./toast-xTp-xwYL.js";import{t as F}from"./confirm-dialog-CSkhRFRk.js";import{t as I}from"./file-markdown-Bq97tNxs.js";import{Fn as te,Mn as L,Nn as ne,Rn as re}from"./sdk.gen-BwnFjFcp.js";import{at as ie,ct as ae,in as oe,nn as se,rn as ce,rt as le,st as R}from"./react-query.gen-C6wVk6Rw.js";import{t as ue}from"./assistant-identity-store-CX03CK8q.js";import{n as de}from"./utils-xg2dl_KJ.js";import{c as fe}from"./routes-BbeIx_F9.js";import{t as z}from"./misc-BYQPh7vS.js";import{Ai as pe,Ea as B,Fi as me,Ma as V,Pi as H,Ta as U,_r as he,ea as W,pr as ge,vi as G,xt as _e}from"./index-yu6nDHvG.js";import{t as ve}from"./use-active-assistant-id-BWXi63qg.js";import{t as ye}from"./plugins-surface-z3RTZS4H.js";var K=p(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),q=e(r(),1),J=d(),be={sm:`h-7 w-7`,md:`h-8 w-8 text-3xl`};function Y({external:e=!1,icon:t,iconSrc:n,size:r=`sm`,className:i}){let[a,o]=(0,q.useState)(!1);(0,q.useEffect)(()=>{o(!1)},[n]);let s=t||(e?`📦`:`🧩`),c=!!n&&!a;return(0,J.jsx)(`span`,{className:z(`flex shrink-0 items-center justify-center`,be[r],i),children:c?(0,J.jsx)(`img`,{src:n,alt:``,"aria-hidden":!0,loading:`lazy`,className:`h-full w-full object-contain`,onError:()=>o(!0)}):s})}var xe=e=>`Remove "${e}" from this assistant?`,Se=e=>`"${e}" has local edits that will be overwritten by the upgrade. Continue?`,Ce=`Upgrade anyway`,we=`Failed to install plugin. Please try again.`,Te=`Failed to remove plugin. Please try again.`,Ee=`Failed to upgrade plugin. Please try again.`,De=`Failed to update plugin. Please try again.`;function Oe(e,t){let n=e.map(e=>({name:e.name,description:e.description??void 0,status:`installed`,external:void 0,version:e.version??void 0,path:e.path,issues:e.issues,enabled:e.enabled,icon:e.icon,hasIcon:e.hasIcon,iconVersion:e.iconVersion})),r=new Set(n.map(e=>e.name)),i=t.filter(e=>!r.has(e.name)).map(e=>({name:e.name,description:e.description,status:`available`,external:!0,path:e.path}));return[...n,...i]}function ke(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description].some(e=>e?.toLowerCase().includes(n)):!0}function Ae(e){return[...e].sort((e,t)=>{let n=e.status===`installed`;return n===(t.status===`installed`)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function je(e,t){switch(t){case`all`:return e;case`available`:return e.filter(e=>e.status===`available`);case`installed`:return e.filter(e=>e.status===`installed`);case`active`:return e.filter(e=>e.status===`installed`&&e.enabled!==!1);case`off`:return e.filter(e=>e.status===`installed`&&e.enabled===!1)}}function X(e){return e?e.slice(0,7):`unknown`}function Z({plugin:e,surfaces:t=null,className:n}){let r=[{label:`Source`,value:e.source?.kind===`github`?e.source.repo:`Local`,href:(e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null)??void 0}];return e.homepage&&r.push({label:`Homepage`,value:e.homepage,href:e.homepage}),e.license&&r.push({label:`License`,value:e.license}),t&&(t.skills.length>0&&r.push({label:`Skills`,value:String(t.skills.length)}),t.hooks.length>0&&r.push({label:`Hooks`,value:String(t.hooks.length)}),t.tools.length>0&&r.push({label:`Tools`,value:String(t.tools.length)})),(0,J.jsx)(`dl`,{className:z(`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,n),style:{borderColor:`var(--border-base)`},children:r.map(e=>(0,J.jsxs)(`div`,{className:`contents`,children:[(0,J.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,J.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,J.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 underline`,style:{color:`var(--primary-base, #60a5fa)`},children:[e.value,(0,J.jsx)(v,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function Q({plugin:e,drift:t,onInstall:n,onRemove:r,onUpgrade:i,isInstalling:o,isRemoving:s,isUpgrading:c,hasLocalEdits:l,enabled:u,onToggle:d,isToggling:f}){let[p,m]=(0,q.useState)(!1),[h,g]=(0,q.useState)(!1),v=e.installed??!1,y=e.artifact??null,b=t?.status===`update-available`,x=b?`Upgrade ${X(t?.local?.commit??null)} → ${X(t?.remote?.commit??null)}`:void 0;return(0,J.jsxs)(J.Fragment,{children:[v?(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-nowrap md:shrink-0`,children:[u!==void 0&&d?(0,J.jsx)(j,{label:`Auto-include in chat`,checked:u,onChange:()=>d(),disabled:f}):null,y?(0,J.jsx)(a,{asChild:!0,leftIcon:(0,J.jsx)(_,{"aria-hidden":!0}),children:(0,J.jsx)(`a`,{href:y.url,download:!0,children:y.label??`Download`})}):null,b?(0,J.jsx)(a,{type:`button`,onClick:()=>{if(l){g(!0);return}i()},disabled:c,title:x,leftIcon:c?(0,J.jsx)(T,{className:`animate-spin`,"aria-hidden":!0}):(0,J.jsx)(B,{"aria-hidden":!0}),children:`Upgrade`}):null,(0,J.jsx)(a,{type:`button`,variant:`dangerOutline`,onClick:()=>m(!0),disabled:s,leftIcon:s?(0,J.jsx)(T,{className:`animate-spin`,"aria-hidden":!0}):(0,J.jsx)(G,{"aria-hidden":!0}),children:`Remove`})]}):(0,J.jsx)(a,{type:`button`,onClick:n,disabled:o,leftIcon:o?(0,J.jsx)(T,{className:`animate-spin`,"aria-hidden":!0}):(0,J.jsx)(V,{"aria-hidden":!0}),children:`Install`}),(0,J.jsx)(F,{open:p,title:`Remove plugin`,message:xe(e.name),confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{m(!1),r()},onCancel:()=>m(!1)}),(0,J.jsx)(F,{open:h,title:`Upgrade plugin`,message:Se(e.name),confirmLabel:Ce,destructive:!0,onConfirm:()=>{g(!1),i()},onCancel:()=>g(!1)})]})}function Me(){return(0,J.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,J.jsx)(T,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Ne(){return(0,J.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,J.jsx)(D,{className:`h-6 w-6`,"aria-hidden":!0}),(0,J.jsx)(`p`,{className:`text-body-medium-default`,children:`We couldn't load this plugin.`}),(0,J.jsx)(`p`,{className:`text-body-small-default`,children:`It may not exist, or your assistant may be on an older build.`})]})}function Pe({isInstallError:e,isRemoveError:t,isUpgradeError:n}){let r=e?we:t?Te:n?Ee:null;return r?(0,J.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,J.jsx)(D,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),r]}):null}function Fe({external:e,className:t}){let n=e?{label:`External`,icon:C}:{label:`Local`,icon:w};return(0,J.jsx)(O,{tone:`neutral`,leftIcon:(0,q.createElement)(n.icon),className:t,children:n.label})}function Ie({onClick:e,isUpgrading:t=!1}={}){let n=(0,J.jsx)(O,{tone:`warning`,leftIcon:(0,q.createElement)(t?T:B,{className:t?`animate-spin`:void 0}),className:`shrink-0`,children:`Update available`});return e?(0,J.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},disabled:t,"aria-label":`Upgrade plugin`,className:`shrink-0 rounded-[6px] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:cursor-not-allowed`,children:n}):n}var Le=300*1e3;function Re({assistantId:e,name:t,enabled:n=!0}){return l({...ie({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t&&n,staleTime:Le,retry:!1})}function ze(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}function Be(e,t,n){let r=c(),i=n?.onRemoved,a=l({...le({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t}),o=Re({assistantId:e,name:t,enabled:a.data?.installed??!1}).data,s=(0,q.useCallback)(()=>ge(r,e,t),[e,t,r]),u=oe({onSuccess:()=>{s(),P.success(`Installed ${t||`plugin`}`)}}),d=se({onSuccess:()=>{s(),i?.()}}),f=ce({onSuccess:e=>{s(),P.success(e.outcome===`already-up-to-date`?`${t||`Plugin`} is already up to date`:`Upgraded ${t||`plugin`} to ${X(e.toCommit)}`)}});return{plugin:a.data??null,drift:o,isLoading:a.isLoading,isError:a.isError,install:()=>{u.mutate({path:{assistant_id:e},body:{name:t}})},remove:()=>{d.mutate({path:{assistant_id:e,name:t}})},upgrade:()=>{f.mutate({path:{assistant_id:e,name:t},body:{}})},isInstalling:u.isPending,isRemoving:d.isPending,isUpgrading:f.isPending,isInstallError:u.isError,isRemoveError:d.isError,isUpgradeError:f.isError,hasLocalEdits:ze(o)}}var Ve=`0.10.5`;function He(){return de(Ve)}function Ue(e,t,n,r){let i=He(),{data:a}=l({queryKey:[`pluginIcon`,e,t,r],queryFn:async()=>{let{data:n,error:r}=await te({path:{assistant_id:e,name:t},parseAs:`blob`,throwOnError:!1});if(r||!(n instanceof Blob))throw Error(`Failed to load plugin icon`);return n},enabled:!!(i&&n&&r),staleTime:1/0,retry:!1}),[o,s]=(0,q.useState)(void 0);return(0,q.useEffect)(()=>{if(!a){s(void 0);return}let e=URL.createObjectURL(a);return s(e),()=>{URL.revokeObjectURL(e)}},[a]),o}function We(e){let t=c(),n={queryKey:R({path:{assistant_id:e}})},r=(e,r)=>{t.setQueriesData(n,t=>t&&{...t,plugins:t.plugins.map(t=>t.name===e?{...t,enabled:r}:t)})},i=u({mutationFn:async({name:t,nextEnabled:n})=>{let r=await(n?ne({path:{assistant_id:e,name:t},throwOnError:!1}):L({path:{assistant_id:e,name:t},throwOnError:!1})),i=r.response?.status;if(r.response?.ok||i===409)return r;throw Error(`Plugin toggle failed (${i??`network error`})`)},onMutate:async({name:e,nextEnabled:i})=>{await t.cancelQueries(n),r(e,i)},onError:(e,{name:t,nextEnabled:n})=>{r(t,!n),P.error(De)},onSettled:(n,r,i)=>{ge(t,e,i.name)}});return{toggle:(e,t)=>{i.mutate({name:e,nextEnabled:t})},togglingName:i.isPending?i.variables?.name??null:null}}function Ge({assistantId:e,name:t,onBack:n,externalHint:r,enabled:i}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Be(e,t,{onRemoved:n}),{toggle:S,togglingName:C}=We(e),w=Ue(e,t,o?.hasIcon,o?.iconVersion);return(0,J.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,J.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,J.jsx)(a,{type:`button`,variant:`ghost`,iconOnly:(0,J.jsx)(m,{"aria-hidden":!0}),"aria-label":`Back to plugins`,onClick:n}),(0,J.jsx)(Ke,{name:t,plugin:o,externalHint:r,iconSrc:w,drift:s,onInstall:u,onRemove:d,onUpgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x,enabled:i,onToggle:()=>S(t,!i),isToggling:C===t})]}),(v||y||b)&&(0,J.jsx)(Pe,{isInstallError:v,isRemoveError:y,isUpgradeError:b}),(0,J.jsx)(f.Root,{asChild:!0,children:(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:c?(0,J.jsx)(Me,{}):l||!o?(0,J.jsx)(Ne,{}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,J.jsx)(I,{content:o.readme}):(0,J.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})]})}function Ke({name:e,plugin:t,externalHint:n,iconSrc:r,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}){let h=t?.source?.kind===`github`,g=t?h:n,_=i?.status===`update-available`;return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[g===void 0?(0,J.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,J.jsx)(Y,{external:g,icon:t?.icon??void 0,iconSrc:r,size:`md`}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,J.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,J.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,t?(0,J.jsx)(Fe,{external:h}):null,_?(0,J.jsx)(Ie,{}):null]}),t?.description?(0,J.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?(0,J.jsx)(Q,{plugin:t,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}):null]})}var qe=e(i(),1);function Je({assistantId:e,name:t,onBack:n,externalHint:r,enabled:i}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Be(e,t,{onRemoved:n}),{toggle:S,togglingName:C}=We(e),[w,T]=(0,q.useState)(null);(0,q.useEffect)(()=>{T(document.getElementById(`viewport-overlays`))},[]);let E=o?.source?.kind===`github`,D=o?E:r,ee=s?.status===`update-available`,O=o?.name??t,k=Ue(e,t,o?.hasIcon,o?.iconVersion),A=(0,J.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsx)(a,{variant:`ghost`,iconOnly:(0,J.jsx)(m,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to plugins`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:O}),(0,J.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0 touch-mobile:h-10 touch-mobile:w-10`})]}),(0,J.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[D===void 0?(0,J.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,J.jsx)(Y,{external:D,icon:o?.icon??void 0,iconSrc:k,size:`md`}),(0,J.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:O})]}),(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[ee?(0,J.jsx)(Ie,{}):null,o?(0,J.jsx)(Fe,{external:E}):null]})]}),o?.description?(0,J.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:o.description}):null]}),o?(0,J.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:(0,J.jsx)(Q,{plugin:o,drift:s,enabled:i,onToggle:()=>S(t,!i),isToggling:C===t,onInstall:u,onRemove:d,onUpgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x})}):null,(v||y||b)&&(0,J.jsx)(`div`,{className:`mt-3`,children:(0,J.jsx)(Pe,{isInstallError:v,isRemoveError:y,isUpgradeError:b})}),(0,J.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,J.jsx)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:c?(0,J.jsx)(Me,{}):l||!o?(0,J.jsx)(Ne,{}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,J.jsx)(I,{content:o.readme}):(0,J.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})})]});return w?(0,qe.createPortal)(A,w):A}var Ye={value:`all`,label:`All`,icon:W},Xe={value:`available`,label:`Available`,icon:V};function Ze(e){return e?[Ye,{value:`active`,label:`Active`,icon:me},{value:`off`,label:`Off`,icon:K},Xe]:[Ye,{value:`installed`,label:`Installed`,icon:U},Xe]}function Qe({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i=!1,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginToggleSupported:d}){return(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(A,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search plugins`,"aria-label":`Search plugins`,leftIcon:(0,J.jsx)(pe,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,J.jsx)(T,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,J.jsx)($e,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginToggleSupported:d})]})}function $e(e){let t=he(),[n,r]=(0,q.useState)(!1),i=(0,J.jsx)(a,{type:`button`,variant:`outlined`,iconOnly:(0,J.jsx)(y,{"aria-hidden":!0}),"aria-label":`Filter plugins`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,J.jsx)(et,{...e,open:n,onOpenChange:r,trigger:i}):(0,J.jsxs)(k.Root,{open:n,onOpenChange:r,children:[(0,J.jsx)(k.Trigger,{asChild:!0,children:i}),(0,J.jsx)(k.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,J.jsx)(`ul`,{role:`listbox`,children:(0,J.jsx)(rt,{label:`Status`,options:Ze(e.pluginToggleSupported),selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}})})})]})}function et({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:i,counts:o,totalCount:s,showCounts:c,pluginToggleSupported:l,open:u,onOpenChange:d,trigger:f}){let p=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,J.jsxs)(M.Root,{open:u,onOpenChange:d,children:[(0,J.jsx)(M.Trigger,{asChild:!0,children:f}),(0,J.jsxs)(M.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,J.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,J.jsx)(M.Header,{children:(0,J.jsx)(M.Title,{children:`Filters`})}),(0,J.jsxs)(M.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,J.jsx)(tt,{label:`Status`,children:Ze(l).map(n=>(0,J.jsx)(nt,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),n.length>0&&(0,J.jsxs)(tt,{label:`Categories`,children:[(0,J.jsx)(nt,{icon:W,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>i(null)}),p.map(e=>(0,J.jsx)(nt,{icon:x(e.icon)??W,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>i(e.slug)},e.slug))]})]}),(0,J.jsx)(M.Footer,{children:(0,J.jsx)(a,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>d(!1),children:`Done`})})]})]})}function tt({label:e,children:t}){return(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function nt({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,J.jsx)(N,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,J.jsx)(h,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function rt({label:e,options:t,selected:n,onSelect:r}){return(0,J.jsxs)(`li`,{children:[(0,J.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,J.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,J.jsx)(`li`,{children:(0,J.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,J.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,J.jsx)(U,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}function it({assistantId:e,item:t,drift:n,onSelect:r,onInstall:i,onRemove:o,onUpgrade:s,isInstalling:c=!1,isRemoving:l=!1,isUpgrading:u=!1}){let d=t.status===`available`,p=n?.status===`update-available`,m=t.enabled!==void 0,h=t.enabled===!1,g=Ue(e,t.name,t.hasIcon,t.iconVersion);return(0,J.jsx)(f.Root,{asChild:!0,children:(0,J.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:r,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,J.jsx)(Y,{size:`sm`,external:t.external,icon:t.icon,iconSrc:g,className:h?`opacity-50`:void 0}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:h?`var(--content-tertiary)`:`var(--content-emphasised)`},children:t.name}),t.version?(0,J.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,p?(0,J.jsx)(Ie,{onClick:s,isUpgrading:u}):null]}),(0,J.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description??`No description provided.`}),t.issues&&t.issues.length>0?(0,J.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:t.issues.join(`; `),children:[t.issues[0],t.issues.length>1?` (+${t.issues.length-1} more)`:``]}):null]}),d?c?(0,J.jsx)(a,{type:`button`,iconOnly:(0,J.jsx)(T,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,J.jsx)(a,{type:`button`,iconOnly:(0,J.jsx)(V,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),i?.()},disabled:!i,"aria-label":`Install plugin`,expandOnMobile:!1}):(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[m?(0,J.jsx)(O,{tone:t.enabled?`positive`:`neutral`,children:t.enabled?`Enabled`:`Disabled`}):null,(0,J.jsx)(a,{type:`button`,variant:`dangerOutline`,iconOnly:l?(0,J.jsx)(T,{className:`animate-spin`,"aria-hidden":!0}):(0,J.jsx)(G,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),o?.()},disabled:l||u||!o,"aria-label":`Remove plugin`,expandOnMobile:!1})]})]})})}var at=300*1e3,$=[],ot=[];async function st(e,t,n){let r=await re({path:{assistant_id:e},query:{q:void 0,category:t},signal:n,throwOnError:!1});if(r.response?.status===404)return{plugins:[]};if(!r.response?.ok)throw Error(`Failed to load plugins`);return r.data??{plugins:[]}}function ct(e,t){let[n,r]=(0,q.useState)({assistantId:e,latched:!1}),i=n.assistantId===e?n.latched:!1;return n.assistantId!==e&&r({assistantId:e,latched:!1}),(0,q.useEffect)(()=>{t&&r(t=>t.assistantId===e&&t.latched?t:{assistantId:e,latched:!0})},[e,t]),i||t}function lt(e,t=null){let n=t??void 0,r=l({queryKey:R({path:{assistant_id:e},query:{q:void 0,category:n}}),queryFn:({signal:t})=>st(e,n,t),enabled:!!e,staleTime:at}),i=l({..._e(e),enabled:!!e&&t!==null}),a=l({...ae({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e,staleTime:at}),o=(0,q.useMemo)(()=>{let e=t===null?r.data?.plugins:i.data?.plugins??r.data?.plugins;return new Set((e??$).map(e=>e.name))},[t,i.data?.plugins,r.data?.plugins]),s=(0,q.useMemo)(()=>{let e=r.data?.plugins??$,n=a.data?.matches??ot;return Ae(Oe(e,(t===null?n:n.filter(e=>(e.category??`system`)===t)).filter(e=>!o.has(e.name))))},[r.data?.plugins,a.data?.matches,t,o]),u=t===null?r.data:i.data,d=ct(e,u?.categoryCounts!==void 0),f=ct(e,(u?.plugins??$).some(e=>e.enabled!==void 0)),p=c(),m=(0,q.useRef)(null);return(0,q.useEffect)(()=>{if(m.current===e||!a.isSuccess)return;let t=u?.plugins;if(!t?.length)return;let n=new Map((a.data?.matches??ot).map(e=>[e.name,e.category]));t.some(e=>{let t=n.get(e.name);return t!=null&&t!==`system`&&(e.category??`system`)===`system`})&&(m.current=e,p.invalidateQueries({queryKey:R({path:{assistant_id:e},query:{q:void 0}})}))},[e,a.isSuccess,a.data?.matches,u?.plugins,p]),{items:s,isLoading:r.isLoading,catalogLoading:a.isLoading,isError:r.isError,isFetching:r.isFetching||a.isFetching,catalogError:a.isError,categorySupported:d,pluginToggleSupported:f,installedCategoryCounts:u?.categoryCounts,installedPlugins:u?.plugins??$,installedTotal:u?.totalCount,catalogMatches:a.data?.matches??ot,unfilteredInstalledNames:o}}var ut=`vellum:plugins:tipDismissed`;function dt({assistantId:e}){let r=c(),i=he(),[a,s]=o(),l=a.get(`plugin`),[u,d]=(0,q.useState)(``),[f,p]=(0,q.useState)(`all`),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(null),[v,y]=(0,q.useState)(null),[x,C]=(0,q.useState)(null),[w,T]=(0,q.useState)(null),[E,D]=(0,q.useState)(null),[ee,O]=(0,q.useState)(()=>n(ut,!1)),[k,A]=(0,q.useState)(e);e!==k&&(A(e),h(null));let j=e===k?m:null,{data:M=[]}=S(e),{items:N,isLoading:I,catalogLoading:te,isError:L,isFetching:ne,catalogError:re,categorySupported:ie,pluginToggleSupported:ae,installedCategoryCounts:le,installedPlugins:R,installedTotal:ue,catalogMatches:de,unfilteredInstalledNames:fe}=lt(e,j),z=(ae?[`all`,`active`,`off`,`available`]:[`all`,`installed`,`available`]).includes(f)?f:`all`,{counts:pe,totalCount:B}=ft(le,R,ue,de,fe,z),me=ie&&M.length>0,V=(0,q.useCallback)(t=>ge(r,e,t),[e,r]),H=oe({onMutate:e=>_(e.body.name),onSuccess:(e,t)=>P.success(`Installed ${t.body.name}`),onError:()=>P.error(we),onSettled:(e,t,n)=>{_(null),V(n.body.name)}}),U=se({onMutate:e=>y(e.path.name),onSuccess:(e,t)=>P.success(`Removed ${t.path.name}`),onError:()=>P.error(Te),onSettled:(e,t,n)=>{y(null),V(n.path.name)}}),W=ce({onMutate:e=>C(e.path.name),onSuccess:(e,t)=>P.success(e.outcome===`already-up-to-date`?`${t.path.name} is already up to date`:`Upgraded ${t.path.name} to ${X(e.toCommit)}`),onError:()=>P.error(Ee),onSettled:(e,t,n)=>{C(null),V(n.path.name)}}),G=(0,q.useCallback)(e=>s(t=>{let n=new URLSearchParams(t);return n.set(`plugin`,e.name),n}),[s]),_e=(0,q.useCallback)(()=>s(e=>{let t=new URLSearchParams(e);return t.delete(`plugin`),t},{replace:!0}),[s]),ve=(0,q.useCallback)(t=>{H.mutate({path:{assistant_id:e},body:{name:t.name}})},[e,H]),ye=(0,q.useCallback)(()=>{w&&(U.mutate({path:{assistant_id:e,name:w.name}}),T(null))},[e,w,U]),K=(0,q.useCallback)(t=>{W.mutate({path:{assistant_id:e,name:t},body:{}})},[e,W]),be=(0,q.useCallback)(()=>{E&&(K(E.name),D(null))},[E,K]),Y=(0,q.useCallback)((e,t)=>{if(ze(t)){D(e);return}K(e.name)},[K]),De=(0,q.useCallback)(()=>{O(!0),t(ut,!0)},[]),Oe=(0,q.useMemo)(()=>je(N,z).filter(e=>ke(e,u)),[N,z,u]),Ae=ne&&!I,Z=u.trim().length>0;if(l){let t=N.find(e=>e.name===l),n={assistantId:e,name:l,externalHint:t?.external,enabled:t?.enabled,onBack:_e};return i?(0,J.jsx)(Je,{...n}):(0,J.jsx)(Ge,{...n})}let Q=(0,J.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:I?(0,J.jsx)(gt,{}):L?(0,J.jsx)(_t,{}):Oe.length===0?te&&(z===`all`||z===`available`)?(0,J.jsx)(gt,{}):(0,J.jsx)(vt,{filter:z,category:j}):(0,J.jsx)(`ul`,{className:`flex flex-col gap-2`,children:Oe.map(t=>(0,J.jsx)(`li`,{children:t.status===`installed`?(0,J.jsx)(pt,{assistantId:e,item:t,onSelect:()=>G(t),onRemove:()=>T(t),onUpgrade:e=>Y(t,e),isRemoving:v===t.name,isUpgrading:x===t.name}):(0,J.jsx)(it,{assistantId:e,item:t,onSelect:()=>G(t),onInstall:()=>ve(t),isInstalling:g===t.name})},t.name))})});return(0,J.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!ee&&(0,J.jsx)(mt,{onDismiss:De}),(0,J.jsx)(Qe,{search:u,onSearchChange:d,filter:z,onFilterChange:p,isSearching:Ae,categories:me?M:[],category:j,onCategoryChange:h,counts:pe,totalCount:B,showCounts:!Z,pluginToggleSupported:ae}),re&&!I&&!L?(0,J.jsx)(ht,{}):null,me?(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,J.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto md:block`,children:(0,J.jsx)(b,{ariaLabel:`Plugin categories`,selected:j,onSelect:h,counts:pe,totalCount:B,showCounts:!Z,categories:M})}),Q]}):Q,(0,J.jsx)(F,{open:w!==null,title:`Remove plugin`,message:w?xe(w.name):``,confirmLabel:`Remove`,destructive:!0,onConfirm:ye,onCancel:()=>T(null)}),(0,J.jsx)(F,{open:E!==null,title:`Upgrade plugin`,message:E?Se(E.name):``,confirmLabel:Ce,destructive:!0,onConfirm:be,onCancel:()=>D(null)})]})}function ft(e,t,n,r,i,a){return(0,q.useMemo)(()=>{let o={},s=a!==`available`,c=a===`all`||a===`available`,l=a===`active`||a===`off`,u=l?t.filter(e=>a===`off`?e.enabled===!1:e.enabled!==!1):t;if(s)if(!l&&e&&Object.keys(e).length>0)Object.assign(o,e);else for(let e of u){let t=e.category??`system`;o[t]=(o[t]??0)+1}let d=0;if(c)for(let e of r){if(i.has(e.name))continue;let t=e.category??`system`;o[t]=(o[t]??0)+1,d+=1}let f=l?u.length:n??t.length;return{counts:o,totalCount:(s?f:0)+d}},[e,t,n,r,i,a])}function pt({assistantId:e,item:t,onSelect:n,onRemove:r,onUpgrade:i,isRemoving:a,isUpgrading:o}){let s=Re({assistantId:e,name:t.name}).data;return(0,J.jsx)(it,{assistantId:e,item:t,drift:s,onSelect:n,onRemove:r,onUpgrade:()=>i(s),isRemoving:a,isUpgrading:o})}function mt({onDismiss:e}){return(0,J.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,J.jsx)(E,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,J.jsx)(`p`,{className:`flex-1`,children:`Browse the catalog below to install plugins that extend your assistant.`}),(0,J.jsx)(a,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,J.jsx)(ee,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function ht(){return(0,J.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,J.jsx)(g,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,J.jsx)(`p`,{className:`flex-1`,children:`Catalog browsing is temporarily unavailable. Installed plugins are still listed below.`})]})}function gt(){return(0,J.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,J.jsx)(T,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function _t(){return(0,J.jsx)(f.Root,{children:(0,J.jsxs)(f.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,J.jsx)(D,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,J.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load plugins`}),(0,J.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function vt({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=yt(e,t);return(0,J.jsx)(f.Root,{children:(0,J.jsxs)(f.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,J.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,J.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,J.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r})]})})}function yt(e,t){if(t)return{title:`No plugins in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:W};switch(e){case`installed`:return{title:`No Plugins Installed`,subtitle:`Browse the catalog to install plugins that extend your assistant.`,Icon:H};case`active`:return{title:`No Active Plugins`,subtitle:`Install a plugin from the catalog, or turn on an installed one.`,Icon:H};case`off`:return{title:`No Plugins Turned Off`,subtitle:`Installed plugins you turn off will appear here.`,Icon:H};case`available`:return{title:`No Plugins Available`,subtitle:`Every catalog plugin is already installed.`,Icon:U};default:return{title:`No Plugins Found`,subtitle:`Browse the catalog to install plugins that extend your assistant.`,Icon:H}}}function bt(){let e=ue.use.version(),t=ye(),n=ve();return e===null?null:t?(0,J.jsx)(dt,{assistantId:n}):(0,J.jsx)(s,{to:fe.identity,replace:!0})}export{bt as PluginsPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{m as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.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"./card-Bv5O5juh.js";import{t as u}from"./check-DFNrQERi.js";import{t as d}from"./chevron-left-BMF1xNfR.js";import{t as f}from"./loader-circle-Cz7opInR.js";import{t as p}from"./pencil-CUIr0IFo.js";import{t as m}from"./x-CkSVp1Ok.js";import{t as h}from"./input-CoUmPnRU.js";import{l as g,p as _,s as v}from"./local-mode-grqHUoNh.js";import{t as y}from"./is-electron-y5bNUVyG.js";import{n as b}from"./resolved-assistants-store-BSZbT8Ju.js";import{A as x,C as ee,a as S,j as C,n as w,o as T}from"./auth-store-CD7PGb3q.js";import{t as E}from"./client.gen-DVfIRXUZ.js";import{c as D}from"./routes-BbeIx_F9.js";import{a as O}from"./platform-detection-BrxvFUiR.js";import{i as k,s as A}from"./prefs-DYaOj-dg.js";import{t as j}from"./client-feature-flag-store-C0g8zi1W.js";import{n as te,t as ne}from"./browser-BPZAXjRE.js";import{c as M,l as re,n as ie,t as N}from"./prechat-P1y7ZM6C.js";import{Ct as ae,b as P,r as oe}from"./react-query.gen-DPzPS206.js";import{t as F}from"./public-asset-Di3QykUd.js";import{$t as I,Qt as se,U as ce,W as le,Zt as ue,_ as de,bt as fe,en as L,ft as R,g as pe,h as z,ht as me,nn as he,pa as B,pt as ge,rn as V,vt as _e,yt as ve}from"./index-CSefSVJO.js";import{t as H}from"./onboarding-step-layout-zvLUIT7j.js";import{n as U,r as ye}from"./prechat-names-b5RkG_F-.js";import{t as be}from"./step-indicator-dots-Cou0-IgA.js";var W=e(n(),1);async function xe(){try{let{data:e,response:t}=await E.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var G=c(),Se=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function Ce({onComplete:e}){function t(){de(),z(),e()}return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,G.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,G.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,G.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,G.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,G.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,G.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,G.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,G.jsx)(`ul`,{className:`space-y-4`,children:Se.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,G.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,G.jsx)(u,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,G.jsxs)(`span`,{className:`text-left`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,G.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var K=`google`,we=[{id:`gmail`,label:`Gmail`,logoSrc:F(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:F(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:F(`/images/integrations/google-drive.svg`)}];function Te({assistantId:e,assistantName:n,onConnect:i,onSkip:a,onBack:s}){let c=y(),l=o(),u=t(),p=(0,W.useRef)(null),m=(0,W.useRef)(null),h=(0,W.useRef)(null),g=(0,W.useRef)(null),_=(0,W.useRef)(null),v=(0,W.useRef)(null),b=(0,W.useRef)(null),[x,S]=(0,W.useState)(!1),C=(0,W.useCallback)(()=>{m.current=null,S(!1)},[]),w=(0,W.useCallback)(()=>{_.current&&=(window.removeEventListener(`message`,_.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),T=(0,W.useCallback)(()=>{p.current&&!p.current.closed&&p.current.close(),p.current=null,h.current&&=(clearInterval(h.current),null),g.current&&=(clearTimeout(g.current),null)},[]),E=ae();(0,W.useEffect)(()=>()=>{h.current&&clearInterval(h.current),g.current&&clearTimeout(g.current),p.current&&!p.current.closed&&p.current.close(),_.current&&window.removeEventListener(`message`,_.current),v.current&&window.removeEventListener(`storage`,v.current),b.current&&=(b.current(),null)},[]);let O=(0,W.useCallback)(async e=>{try{return(await l.fetchQuery({...P({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===K&&e.connected)??null}catch{return null}},[l]),k=(0,W.useCallback)(async()=>{let e=m.current?.platformAssistantId;T(),C(),i((e?await O(e):null)?.scopes_granted??[])},[C,T,O,i]),A=(0,W.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!m.current||e.requestId!==m.current.requestId||(e.oauthStatus===`connected`?k():(T(),C())))},[C,T,k]),j=(0,W.useCallback)(e=>{let t=m.current;if(!t)return;let n=ue(e,window.location.origin,t.requestId);n&&A(n)},[A]),M=(0,W.useCallback)(e=>{let t=m.current;if(!t)return;let n=se(e,t.requestId);n&&(A(n),window.localStorage.removeItem(L(t.requestId)))},[A]);he((0,W.useCallback)(e=>{let t=m.current;t&&e.requestId===t.requestId&&A({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[A]));let re=(0,W.useCallback)(()=>{let t=crypto.randomUUID();if(w(),_.current=j,v.current=M,u){S(!0),(async()=>{let n;try{n=await ee(e)}catch{C();return}m.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){ne(e.connect_url)},onError(){C()}})})(),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),b.current&&b.current();let n=te(()=>{let e=m.current;if(!e){n(),b.current=null;return}(async()=>{let t=await O(e.platformAssistantId);m.current&&(t?await k():C(),w(),n(),b.current=null)})()});b.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){w();return}p.current=n,S(!0),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),h.current=setInterval(()=>{p.current&&p.current.closed&&m.current&&!g.current&&(g.current=setTimeout(async()=>{g.current=null;let e=m.current;if(!e)return;let t=window.localStorage.getItem(L(e.requestId));if(t)try{let n=JSON.parse(t);if(I(n,e.requestId)){A(n),window.localStorage.removeItem(L(e.requestId)),w();return}}catch{}let n=await O(e.platformAssistantId);m.current&&(n?await k():(T(),C()),w())},1e3))},100),(async()=>{let n;try{n=await ee(e)}catch{T(),C(),w();return}m.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){p.current&&!p.current.closed?p.current.location.href=e.connect_url:m.current&&(T(),C(),w())},onError(){T(),C(),w()}})})()},[e,C,T,O,A,j,M,k,u,w,E]),ie=n||`your assistant`,N=n||`Your assistant`;return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${c?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:s,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${c?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${ie} can use Gmail, Calendar, and Drive with your permission.`}),(0,G.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:we.map(e=>(0,G.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,G.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,G.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${N} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,G.jsxs)(`div`,{className:`${c?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:re,disabled:x||E.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:x||E.isPending?(0,G.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,G.jsx)(f,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,disabled:x||E.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function Ee({userName:e,assistantName:t,selectedGroupId:n,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:l,onSkip:u}){let f=y();return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,G.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(h,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),className:H,fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(h,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),className:H,fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>o(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:U.map(e=>(0,G.jsx)(De,{group:e,isActive:n===e.id,onToggle:()=>s(n===e.id?null:e.id)},e.id))})]})]}),(0,G.jsxs)(`div`,{className:`${f?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:l,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function De({group:e,isActive:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,G.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function Oe({userName:e,assistantName:t,displayedAssistantNames:n,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:l,totalSteps:u}){return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[o?(0,G.jsx)(r,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(d,{}),onClick:o,"aria-label":`Back`}):(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(be,{current:l,total:u})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(h,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),className:H,fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(h,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),className:H,fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var ke=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:F(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:F(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:F(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:F(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:F(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:F(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:F(`/images/prior-assistants/copilot.svg`)}];function Ae({selectedAssistants:e,onChange:t,onBack:n,onContinue:i,onSkip:a}){let o=y(),[s,c]=(0,W.useState)(()=>J(e)),[u,f]=(0,W.useState)(()=>s.length>0),g=(0,W.useRef)(Y(e));(0,W.useEffect)(()=>{let t=Y(e);if(t===g.current)return;let n=J(e);c(n),f(e=>e||n.length>0),g.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}q(n,e)||(g.current=Y(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,G.jsxs)(`div`,{className:`${o?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[ke.map(t=>(0,G.jsx)(je,{assistant:t,selected:e.has(t.id),onToggle:()=>_(t.id)},t.id)),u?null:(0,G.jsx)(Me,{onClick:()=>f(!0)})]}),u?(0,G.jsx)(l,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(p,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),c(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(m,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(h,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>c(e.target.value),helperText:`Separate multiple assistants with commas`,className:H,fullWidth:!0}),v.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function q(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function J(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function je({assistant:e,selected:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(Ne,{assistant:e,size:32}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(u,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Me({onClick:e}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(B,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ne({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Pe({selectedTasks:e,onChange:t,onBack:n,onContinue:i,onSkip:a}){let o=y(),s=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,G.jsx)(`div`,{className:`${o?`mt-6`:`mt-8`} flex w-full flex-col ${o?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:ce.map(t=>{let n=le[t.iconKey],r=e.has(t.id);return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${o?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,G.jsx)(n,{className:`h-4 w-4`}):null}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,G.jsx)(u,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Fe=new Set([`gmail`,`google-calendar`,`google-drive`]),Ie=[{id:`gmail`,label:`Gmail`,logoSrc:F(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:F(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:F(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:F(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:F(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:F(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:F(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:F(`/images/integrations/github.svg`),logoSrcDark:F(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:F(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:F(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:F(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:F(`/images/integrations/apple-notes.svg`)}];function Le(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function Re({selectedTools:e,onChange:t,onBack:n,onContinue:i,onSkip:a}){let o=y(),[s,c]=(0,W.useState)(()=>ze(e)),[u,f]=(0,W.useState)(()=>s.length>0),g=(0,W.useRef)(Z(e));(0,W.useEffect)(()=>{let t=Z(e);if(t===g.current)return;let n=ze(e);c(n),f(e=>e||n.length>0),g.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}X(n,e)||(g.current=Z(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${n?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[n?(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),n?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,G.jsxs)(`div`,{className:`grid w-full gap-2 ${o?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Ie.map(t=>(0,G.jsx)(Q,{tool:t,selected:e.has(t.id),onToggle:()=>_(t.id),electron:o},t.id)),u?null:(0,G.jsx)($,{onClick:()=>f(!0),electron:o})]}),u?(0,G.jsx)(l,{padding:o?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col ${o?`gap-2`:`gap-3`}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(p,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),c(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(m,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(h,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>c(e.target.value),helperText:`Separate multiple tools with commas`,className:H,fullWidth:!0}),v.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function X(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ze(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Z(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Q({tool:e,selected:t,onToggle:n,electron:r}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(Be,{tool:e,size:32}),(0,G.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(u,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function $({onClick:e,electron:t}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(B,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Be({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Ve({selectedGroupId:e,onGroupChange:t,onBack:n,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(r,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(d,{}),onClick:n,"aria-label":`Back`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(be,{current:o,total:s})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,G.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,G.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:U.map(n=>{let r=e===n.id;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,G.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,G.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function He(e){let[t,n]=(0,W.useState)(()=>(e??``).trim()),r=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,W.useCallback)(e=>{r.current=!0,n(e)},[])}}var Ue=[`gmail`,`google-calendar`,`google-drive`],We=`experiment-activation-flow-2026-06-03`,Ge=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ke(e,t,n){return t?.initialMessage?t.initialMessage:n?ie(e):N}function qe(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:t===`paredDown`?{tools:r?[...Ue]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:Le([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=We,i.bootstrapTemplate=Ge);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),t===`paredDown`?r&&(i.googleScopes=e.connectedScopes):t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Le([...e.selectedPriorAssistants])),i.initialMessage=Ke(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function Je(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Ye(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:R.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:R.controlWorkType,enabled:!t},{id:`tools`,funnelStep:R.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:R.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?R.gmailConnect:R.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:R.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Xe(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Ze=`1`;function Qe(e){return e===`nativeVibe`||e===Ze?`nativeVibe`:null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function et(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function tt(){let e=i(),n=t(),r=A()&&k();return(0,W.useEffect)(()=>{!r&&!n&&e(D.onboarding.privacy,{replace:!0})},[r,n,e]),n||r}function nt(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,W.useState)(()=>t?`nativeName`:`name`),a=(0,W.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,W.useLayoutEffect)(()=>{if(n)try{let e=Qe(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,W.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,W.useCallback)(()=>{a(null)},[a])}}var rt=3;function it(){let e=g();return e?.cloud===`vellum`?e.assistantId:v()[0]?.assistantId??null}function at(){let e=i(),[n]=a(),r=n.get(`preview`)===`true`,o=w.use.user(),c=S(),l=T(),u=o?.id??null,d=o?.firstName??``,f=o?.lastName??``,p=t(),m=b.use.activeAssistantId(),h=_(),g=O()&&!pe(),v=j.use.stringFlags().preChatOnboardingExperiment20260606??`control`,y=(j.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,ee=j.use.selfIntroGreeting(),E=_e(v),k=ve()??E,A=k===ge.paredDown,te=h?it():null,ne=tt(),{currentStep:ie,setCurrentStep:N,clearPersistedStep:ae}=nt(u,p),P=w.use.platformSession(),F=C(P),[I,se]=(0,W.useState)(()=>new Set),[ce,le]=(0,W.useState)(()=>new Set),[ue,de]=(0,W.useState)(()=>new Set),{value:L,onChange:R}=He(h&&!F?``:d||f),[z,he]=(0,W.useState)(null),[B]=(0,W.useState)(()=>ye()),[V,H]=(0,W.useState)(``),[U,be]=(0,W.useState)(!1),[Se,K]=(0,W.useState)([]),{data:we}=s({...oe(),enabled:!l&&c&&(!h||F)}),{data:De,isLoading:ke}=s({queryKey:[`onboarding-recipe`,u],queryFn:xe,enabled:!l&&c&&!p&&!h,staleTime:1/0}),q=De??null,J=we?.id??m??te,Y=Je({localMode:h,platformSession:P,hasCachedPlatformAssistant:te!==null}),je=Y,Me=Y,Ne=async()=>{await x.checkAssistant(),e(`${D.assistant}?onboarding=1`,{replace:!0})};function Ie(e,t=k){r||me(e,{userId:u,variant:fe(t)})}let Le=[...I].some(e=>Fe.has(e)),X=p?Xe():Ye({paredDown:A,canOfferPriorAssistants:Me,canOfferGoogleStep:r?!1:je,hasGoogleTool:Le,showIOSAppStep:g});function ze(t){if(r){e(-1);return}re(qe({mode:p?`native`:A?`paredDown`:`control`,recipe:p?null:q,selectedTools:I,selectedTasks:ce,selectedPriorAssistants:t?.selectedPriorAssistants??ue,tone:z??q?.tone??`grounded`,userName:L,assistantName:V,selfIntroGreetingEnabled:ee,activationFlowEnabled:p?void 0:y,googleConnected:U,googleScopes:Se,connectedScopes:t?.connectedScopes}));let n=V.trim();n&&M(n),p?(ae(),e(D.onboarding.privacy)):(x.markExpectingFirstMessage(),Ne())}let Z=(e,t)=>{e.funnelStep&&Ie(e.funnelStep);let n=$e(X,e.id);n?N(n):ze(t)},Q=e=>{let t=et(X,e.id);t&&N(t)};if(!ne||ke)return null;let $=X.find(e=>e.id===ie)??X[0];return $?$.id===`nativeName`?(0,G.jsx)(Oe,{userName:L,assistantName:V,displayedAssistantNames:B,onUserNameChange:R,onAssistantNameChange:H,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:rt}):$.id===`nativeVibe`?(0,G.jsx)(Ve,{selectedGroupId:z,onGroupChange:he,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:rt}):$.id===`name`?(0,G.jsx)(Ee,{userName:L,assistantName:V,selectedGroupId:z,displayedAssistantNames:B,onUserNameChange:R,onAssistantNameChange:H,onGroupChange:he,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,G.jsx)(Pe,{selectedTasks:ce,onChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,G.jsx)(Re,{selectedTools:I,onChange:se,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,G.jsx)(Ae,{selectedAssistants:ue,onChange:de,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;de(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?J?(0,G.jsx)(Te,{assistantId:J,assistantName:V,onConnect:e=>{be(!0),K(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,G.jsx)(Ce,{onComplete:()=>Z($)}):null:null}function ot(){return(0,G.jsx)(at,{})}export{ot as PreChatRoute};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{m as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.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"./card-Bv5O5juh.js";import{t as u}from"./check-DFNrQERi.js";import{t as d}from"./chevron-left-BMF1xNfR.js";import{t as f}from"./loader-circle-Cz7opInR.js";import{t as p}from"./pencil-CUIr0IFo.js";import{t as m}from"./x-CkSVp1Ok.js";import{t as h}from"./input-CoUmPnRU.js";import{l as g,p as _,s as v}from"./local-mode-grqHUoNh.js";import{t as y}from"./is-electron-y5bNUVyG.js";import{n as b}from"./resolved-assistants-store-BSZbT8Ju.js";import{A as x,C as ee,a as S,j as C,n as w,o as T}from"./auth-store-C09YAZEu.js";import{t as E}from"./client.gen-DVfIRXUZ.js";import{c as D}from"./routes-BbeIx_F9.js";import{a as O}from"./platform-detection-BrxvFUiR.js";import{i as k,s as A}from"./prefs-B1Y3q3c8.js";import{t as j}from"./client-feature-flag-store-DkJl-g9A.js";import{n as te,t as ne}from"./browser-C6a_nhhZ.js";import{c as M,l as re,n as ie,t as N}from"./prechat-P1y7ZM6C.js";import{Ct as ae,b as P,r as oe}from"./react-query.gen-DPzPS206.js";import{t as F}from"./public-asset-GKv5zCfZ.js";import{$t as I,Qt as se,U as ce,W as le,Zt as ue,_ as de,bt as fe,en as L,fa as R,ft as z,g as pe,h as me,ht as he,nn as B,pt as ge,rn as V,vt as _e,yt as ve}from"./index-yu6nDHvG.js";import{t as H}from"./onboarding-step-layout-2XcmxqFN.js";import{n as U,r as ye}from"./prechat-names-clVy5Mee.js";import{t as be}from"./step-indicator-dots-D03TmFKG.js";var W=e(n(),1);async function xe(){try{let{data:e,response:t}=await E.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var G=c(),Se=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function Ce({onComplete:e}){function t(){de(),me(),e()}return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,G.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,G.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,G.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,G.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,G.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,G.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,G.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,G.jsx)(`ul`,{className:`space-y-4`,children:Se.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,G.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,G.jsx)(u,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,G.jsxs)(`span`,{className:`text-left`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,G.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var K=`google`,we=[{id:`gmail`,label:`Gmail`,logoSrc:F(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:F(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:F(`/images/integrations/google-drive.svg`)}];function Te({assistantId:e,assistantName:n,onConnect:i,onSkip:a,onBack:s}){let c=y(),l=o(),u=t(),p=(0,W.useRef)(null),m=(0,W.useRef)(null),h=(0,W.useRef)(null),g=(0,W.useRef)(null),_=(0,W.useRef)(null),v=(0,W.useRef)(null),b=(0,W.useRef)(null),[x,S]=(0,W.useState)(!1),C=(0,W.useCallback)(()=>{m.current=null,S(!1)},[]),w=(0,W.useCallback)(()=>{_.current&&=(window.removeEventListener(`message`,_.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),T=(0,W.useCallback)(()=>{p.current&&!p.current.closed&&p.current.close(),p.current=null,h.current&&=(clearInterval(h.current),null),g.current&&=(clearTimeout(g.current),null)},[]),E=ae();(0,W.useEffect)(()=>()=>{h.current&&clearInterval(h.current),g.current&&clearTimeout(g.current),p.current&&!p.current.closed&&p.current.close(),_.current&&window.removeEventListener(`message`,_.current),v.current&&window.removeEventListener(`storage`,v.current),b.current&&=(b.current(),null)},[]);let O=(0,W.useCallback)(async e=>{try{return(await l.fetchQuery({...P({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===K&&e.connected)??null}catch{return null}},[l]),k=(0,W.useCallback)(async()=>{let e=m.current?.platformAssistantId;T(),C(),i((e?await O(e):null)?.scopes_granted??[])},[C,T,O,i]),A=(0,W.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!m.current||e.requestId!==m.current.requestId||(e.oauthStatus===`connected`?k():(T(),C())))},[C,T,k]),j=(0,W.useCallback)(e=>{let t=m.current;if(!t)return;let n=ue(e,window.location.origin,t.requestId);n&&A(n)},[A]),M=(0,W.useCallback)(e=>{let t=m.current;if(!t)return;let n=se(e,t.requestId);n&&(A(n),window.localStorage.removeItem(L(t.requestId)))},[A]);B((0,W.useCallback)(e=>{let t=m.current;t&&e.requestId===t.requestId&&A({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[A]));let re=(0,W.useCallback)(()=>{let t=crypto.randomUUID();if(w(),_.current=j,v.current=M,u){S(!0),(async()=>{let n;try{n=await ee(e)}catch{C();return}m.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){ne(e.connect_url)},onError(){C()}})})(),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),b.current&&b.current();let n=te(()=>{let e=m.current;if(!e){n(),b.current=null;return}(async()=>{let t=await O(e.platformAssistantId);m.current&&(t?await k():C(),w(),n(),b.current=null)})()});b.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){w();return}p.current=n,S(!0),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),h.current=setInterval(()=>{p.current&&p.current.closed&&m.current&&!g.current&&(g.current=setTimeout(async()=>{g.current=null;let e=m.current;if(!e)return;let t=window.localStorage.getItem(L(e.requestId));if(t)try{let n=JSON.parse(t);if(I(n,e.requestId)){A(n),window.localStorage.removeItem(L(e.requestId)),w();return}}catch{}let n=await O(e.platformAssistantId);m.current&&(n?await k():(T(),C()),w())},1e3))},100),(async()=>{let n;try{n=await ee(e)}catch{T(),C(),w();return}m.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){p.current&&!p.current.closed?p.current.location.href=e.connect_url:m.current&&(T(),C(),w())},onError(){T(),C(),w()}})})()},[e,C,T,O,A,j,M,k,u,w,E]),ie=n||`your assistant`,N=n||`Your assistant`;return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${c?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:s,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${c?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${ie} can use Gmail, Calendar, and Drive with your permission.`}),(0,G.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:we.map(e=>(0,G.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,G.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,G.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${N} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,G.jsxs)(`div`,{className:`${c?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:re,disabled:x||E.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:x||E.isPending?(0,G.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,G.jsx)(f,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,disabled:x||E.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function Ee({userName:e,assistantName:t,selectedGroupId:n,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:l,onSkip:u}){let f=y();return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,G.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(h,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),className:H,fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(h,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),className:H,fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>o(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:U.map(e=>(0,G.jsx)(De,{group:e,isActive:n===e.id,onToggle:()=>s(n===e.id?null:e.id)},e.id))})]})]}),(0,G.jsxs)(`div`,{className:`${f?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:l,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function De({group:e,isActive:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,G.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function Oe({userName:e,assistantName:t,displayedAssistantNames:n,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:l,totalSteps:u}){return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[o?(0,G.jsx)(r,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(d,{}),onClick:o,"aria-label":`Back`}):(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(be,{current:l,total:u})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(h,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),className:H,fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(h,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),className:H,fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var ke=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:F(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:F(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:F(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:F(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:F(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:F(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:F(`/images/prior-assistants/copilot.svg`)}];function Ae({selectedAssistants:e,onChange:t,onBack:n,onContinue:i,onSkip:a}){let o=y(),[s,c]=(0,W.useState)(()=>J(e)),[u,f]=(0,W.useState)(()=>s.length>0),g=(0,W.useRef)(Y(e));(0,W.useEffect)(()=>{let t=Y(e);if(t===g.current)return;let n=J(e);c(n),f(e=>e||n.length>0),g.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}q(n,e)||(g.current=Y(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,G.jsxs)(`div`,{className:`${o?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[ke.map(t=>(0,G.jsx)(je,{assistant:t,selected:e.has(t.id),onToggle:()=>_(t.id)},t.id)),u?null:(0,G.jsx)(Me,{onClick:()=>f(!0)})]}),u?(0,G.jsx)(l,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(p,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),c(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(m,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(h,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>c(e.target.value),helperText:`Separate multiple assistants with commas`,className:H,fullWidth:!0}),v.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function q(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function J(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function je({assistant:e,selected:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(Ne,{assistant:e,size:32}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(u,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Me({onClick:e}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(R,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ne({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Pe({selectedTasks:e,onChange:t,onBack:n,onContinue:i,onSkip:a}){let o=y(),s=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,G.jsx)(`div`,{className:`${o?`mt-6`:`mt-8`} flex w-full flex-col ${o?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:ce.map(t=>{let n=le[t.iconKey],r=e.has(t.id);return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${o?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,G.jsx)(n,{className:`h-4 w-4`}):null}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,G.jsx)(u,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Fe=new Set([`gmail`,`google-calendar`,`google-drive`]),Ie=[{id:`gmail`,label:`Gmail`,logoSrc:F(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:F(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:F(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:F(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:F(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:F(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:F(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:F(`/images/integrations/github.svg`),logoSrcDark:F(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:F(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:F(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:F(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:F(`/images/integrations/apple-notes.svg`)}];function Le(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function Re({selectedTools:e,onChange:t,onBack:n,onContinue:i,onSkip:a}){let o=y(),[s,c]=(0,W.useState)(()=>ze(e)),[u,f]=(0,W.useState)(()=>s.length>0),g=(0,W.useRef)(Z(e));(0,W.useEffect)(()=>{let t=Z(e);if(t===g.current)return;let n=ze(e);c(n),f(e=>e||n.length>0),g.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}X(n,e)||(g.current=Z(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${n?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[n?(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(d,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),n?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,G.jsxs)(`div`,{className:`grid w-full gap-2 ${o?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Ie.map(t=>(0,G.jsx)(Q,{tool:t,selected:e.has(t.id),onToggle:()=>_(t.id),electron:o},t.id)),u?null:(0,G.jsx)($,{onClick:()=>f(!0),electron:o})]}),u?(0,G.jsx)(l,{padding:o?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col ${o?`gap-2`:`gap-3`}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(p,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),c(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(m,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(h,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>c(e.target.value),helperText:`Separate multiple tools with commas`,className:H,fullWidth:!0}),v.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function X(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ze(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Z(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Q({tool:e,selected:t,onToggle:n,electron:r}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(Be,{tool:e,size:32}),(0,G.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(u,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function $({onClick:e,electron:t}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(R,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Be({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Ve({selectedGroupId:e,onGroupChange:t,onBack:n,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(r,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(d,{}),onClick:n,"aria-label":`Back`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(be,{current:o,total:s})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,G.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,G.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:U.map(n=>{let r=e===n.id;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,G.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,G.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function He(e){let[t,n]=(0,W.useState)(()=>(e??``).trim()),r=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,W.useCallback)(e=>{r.current=!0,n(e)},[])}}var Ue=[`gmail`,`google-calendar`,`google-drive`],We=`experiment-activation-flow-2026-06-03`,Ge=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ke(e,t,n){return t?.initialMessage?t.initialMessage:n?ie(e):N}function qe(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:t===`paredDown`?{tools:r?[...Ue]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:Le([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=We,i.bootstrapTemplate=Ge);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),t===`paredDown`?r&&(i.googleScopes=e.connectedScopes):t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Le([...e.selectedPriorAssistants])),i.initialMessage=Ke(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function Je(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Ye(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:z.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:z.controlWorkType,enabled:!t},{id:`tools`,funnelStep:z.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:z.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?z.gmailConnect:z.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:z.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Xe(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Ze=`1`;function Qe(e){return e===`nativeVibe`||e===Ze?`nativeVibe`:null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function et(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function tt(){let e=i(),n=t(),r=A()&&k();return(0,W.useEffect)(()=>{!r&&!n&&e(D.onboarding.privacy,{replace:!0})},[r,n,e]),n||r}function nt(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,W.useState)(()=>t?`nativeName`:`name`),a=(0,W.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,W.useLayoutEffect)(()=>{if(n)try{let e=Qe(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,W.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,W.useCallback)(()=>{a(null)},[a])}}var rt=3;function it(){let e=g();return e?.cloud===`vellum`?e.assistantId:v()[0]?.assistantId??null}function at(){let e=i(),[n]=a(),r=n.get(`preview`)===`true`,o=w.use.user(),c=S(),l=T(),u=o?.id??null,d=o?.firstName??``,f=o?.lastName??``,p=t(),m=b.use.activeAssistantId(),h=_(),g=O()&&!pe(),v=j.use.stringFlags().preChatOnboardingExperiment20260606??`control`,y=(j.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,ee=j.use.selfIntroGreeting(),E=_e(v),k=ve()??E,A=k===ge.paredDown,te=h?it():null,ne=tt(),{currentStep:ie,setCurrentStep:N,clearPersistedStep:ae}=nt(u,p),P=w.use.platformSession(),F=C(P),[I,se]=(0,W.useState)(()=>new Set),[ce,le]=(0,W.useState)(()=>new Set),[ue,de]=(0,W.useState)(()=>new Set),{value:L,onChange:R}=He(h&&!F?``:d||f),[z,me]=(0,W.useState)(null),[B]=(0,W.useState)(()=>ye()),[V,H]=(0,W.useState)(``),[U,be]=(0,W.useState)(!1),[Se,K]=(0,W.useState)([]),{data:we}=s({...oe(),enabled:!l&&c&&(!h||F)}),{data:De,isLoading:ke}=s({queryKey:[`onboarding-recipe`,u],queryFn:xe,enabled:!l&&c&&!p&&!h,staleTime:1/0}),q=De??null,J=we?.id??m??te,Y=Je({localMode:h,platformSession:P,hasCachedPlatformAssistant:te!==null}),je=Y,Me=Y,Ne=async()=>{await x.checkAssistant(),e(`${D.assistant}?onboarding=1`,{replace:!0})};function Ie(e,t=k){r||he(e,{userId:u,variant:fe(t)})}let Le=[...I].some(e=>Fe.has(e)),X=p?Xe():Ye({paredDown:A,canOfferPriorAssistants:Me,canOfferGoogleStep:r?!1:je,hasGoogleTool:Le,showIOSAppStep:g});function ze(t){if(r){e(-1);return}re(qe({mode:p?`native`:A?`paredDown`:`control`,recipe:p?null:q,selectedTools:I,selectedTasks:ce,selectedPriorAssistants:t?.selectedPriorAssistants??ue,tone:z??q?.tone??`grounded`,userName:L,assistantName:V,selfIntroGreetingEnabled:ee,activationFlowEnabled:p?void 0:y,googleConnected:U,googleScopes:Se,connectedScopes:t?.connectedScopes}));let n=V.trim();n&&M(n),p?(ae(),e(D.onboarding.privacy)):(x.markExpectingFirstMessage(),Ne())}let Z=(e,t)=>{e.funnelStep&&Ie(e.funnelStep);let n=$e(X,e.id);n?N(n):ze(t)},Q=e=>{let t=et(X,e.id);t&&N(t)};if(!ne||ke)return null;let $=X.find(e=>e.id===ie)??X[0];return $?$.id===`nativeName`?(0,G.jsx)(Oe,{userName:L,assistantName:V,displayedAssistantNames:B,onUserNameChange:R,onAssistantNameChange:H,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:rt}):$.id===`nativeVibe`?(0,G.jsx)(Ve,{selectedGroupId:z,onGroupChange:me,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:rt}):$.id===`name`?(0,G.jsx)(Ee,{userName:L,assistantName:V,selectedGroupId:z,displayedAssistantNames:B,onUserNameChange:R,onAssistantNameChange:H,onGroupChange:me,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,G.jsx)(Pe,{selectedTasks:ce,onChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,G.jsx)(Re,{selectedTools:I,onChange:se,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,G.jsx)(Ae,{selectedAssistants:ue,onChange:de,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;de(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?J?(0,G.jsx)(Te,{assistantId:J,assistantName:V,onConnect:e=>{be(!0),K(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,G.jsx)(Ce,{onComplete:()=>Z($)}):null:null}function ot(){return(0,G.jsx)(at,{})}export{ot as PreChatRoute};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{O as i}from"./native-biometric-Czaf9IqI.js";import{t as a}from"./react-DJZBPgpf.js";import{p as o}from"./auth-store-CD7PGb3q.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.privacyConsent(),(0,s.useCallback)(e=>{o.getState().setPrivacyConsent(e)},[])]}function p(){return[o.use.analyticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setAnalyticsConsentCurrent(e)},[])]}function m(){return[o.use.diagnosticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setDiagnosticsConsentCurrent(e)},[])]}function h(){return o.getState().tosAccepted}function g(){return o.getState().privacyConsent}function _(){return o.getState().analyticsConsentCurrent}function v(){return o.getState().diagnosticsConsentCurrent}function y(){return o.getState().consentHydrated}function b(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function x(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function S(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{x as a,p as c,l as d,u as f,g as i,m as l,S as m,y as n,b as o,d as p,v as r,h as s,_ as t,f as u};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{O as i}from"./native-biometric-Czaf9IqI.js";import{t as a}from"./react-DJZBPgpf.js";import{p as o}from"./auth-store-C09YAZEu.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.privacyConsent(),(0,s.useCallback)(e=>{o.getState().setPrivacyConsent(e)},[])]}function p(){return[o.use.analyticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setAnalyticsConsentCurrent(e)},[])]}function m(){return[o.use.diagnosticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setDiagnosticsConsentCurrent(e)},[])]}function h(){return o.getState().tosAccepted}function g(){return o.getState().privacyConsent}function _(){return o.getState().analyticsConsentCurrent}function v(){return o.getState().diagnosticsConsentCurrent}function y(){return o.getState().consentHydrated}function b(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function x(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function S(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{x as a,p as c,l as d,u as f,g as i,m as l,S as m,y as n,b as o,d as p,v as r,h as s,_ as t,f as u};