@vellumai/web 0.10.12-staging.2 → 0.10.12

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 (409) hide show
  1. package/dist/assets/{AnimatePresence-DwfFixKx.js → AnimatePresence-3WpfAWHe.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-gQyAQ1Np.js → BundleConfirmPage-CDklssHh.js} +1 -1
  3. package/dist/assets/{a2a-invite-h0ZA9fjr.js → a2a-invite-DUYZLVQb.js} +1 -1
  4. package/dist/assets/{about-page-o4HW3X7x.js → about-page-CT70Pgvf.js} +1 -1
  5. package/dist/assets/access-D3fUSyFH.js +1 -0
  6. package/dist/assets/{account-page-CCGELSOs.js → account-page-D5cJIu1-.js} +1 -1
  7. package/dist/assets/{account-shell-AfPNPQvp.js → account-shell-C_IH8r44.js} +1 -1
  8. package/dist/assets/{acp-run-actions-Ct6s3jTx.js → acp-run-actions-CAjb0Wcm.js} +1 -1
  9. package/dist/assets/{acp-run-detail-panel-6KF1gTs7.js → acp-run-detail-panel-DqzZdPiN.js} +1 -1
  10. package/dist/assets/{acp-run-store-DvHGcG6-.js → acp-run-store-C6n-XeY_.js} +1 -1
  11. package/dist/assets/{activity-steps-panel-BixdRLE2.js → activity-steps-panel-BzHQOJsQ.js} +1 -1
  12. package/dist/assets/{add-credits-modal-IV5EP5Uo.js → add-credits-modal-CCEMf2_U.js} +1 -1
  13. package/dist/assets/ai-page-BznkOakE.js +1 -0
  14. package/dist/assets/{animated-avatar-B7_KzM7V.js → animated-avatar-DzfEDnTh.js} +1 -1
  15. package/dist/assets/{api-DL5vlAJ0.js → api-CJFoPWHm.js} +1 -1
  16. package/dist/assets/{api-BafF_-rc.js → api-XwdNiVE9.js} +1 -1
  17. package/dist/assets/{api-key-screen-Dh7AJqr3.js → api-key-screen-BXn2F-lQ.js} +1 -1
  18. package/dist/assets/{app-card-BV9XWgfV.js → app-card-Uowaj1kh.js} +1 -1
  19. package/dist/assets/{app-info-Bus9qaJo.js → app-info-qQex8Ndg.js} +1 -1
  20. package/dist/assets/{archive-redirect-page-Cyh8EfTp.js → archive-redirect-page-CpKvFqvX.js} +1 -1
  21. package/dist/assets/{assistant-feature-flag-store-DrFDLNVv.js → assistant-feature-flag-store-CLqMw4mK.js} +1 -1
  22. package/dist/assets/assistant-identity-store-DIyVo8LV.js +1 -0
  23. package/dist/assets/{assistant-status-panel-DODbammu.js → assistant-status-panel-DKnWIr7_.js} +1 -1
  24. package/dist/assets/{auth-store-CK95leo_.js → auth-store-D9BqFncz.js} +2 -2
  25. package/dist/assets/{avatar-renderer-DAklEC5T.js → avatar-renderer-DK54o2kQ.js} +1 -1
  26. package/dist/assets/avatar-svg-compositor-FtVPqzlC.js +1 -0
  27. package/dist/assets/{background-task-actions-BfAGLLHN.js → background-task-actions-CmYMPa2o.js} +1 -1
  28. package/dist/assets/{background-task-detail-panel-DOWj29Ko.js → background-task-detail-panel-KDqjs7i2.js} +1 -1
  29. package/dist/assets/{background-task-store-CN04oS2z.js → background-task-store-DFS8MP5D.js} +1 -1
  30. package/dist/assets/billing-page-Cc5fHBn2.js +3 -0
  31. package/dist/assets/{billing-redirect-page-BsV6cEpx.js → billing-redirect-page-BRcj5q0u.js} +1 -1
  32. package/dist/assets/{bookmarks-page-CPmWAOGH.js → bookmarks-page-fFnFzh4F.js} +1 -1
  33. package/dist/assets/{browser-DtFBB5v5.js → browser-CNL8hh8H.js} +2 -2
  34. package/dist/assets/{build-state-DoiXhrgx.js → build-state-WR9nlRgM.js} +1 -1
  35. package/dist/assets/{capture-error-CqtAGHQu.js → capture-error-Bj8_eutd.js} +1 -1
  36. package/dist/assets/{channels-page-route-BBwlgesO.js → channels-page-route-wxREzs6W.js} +1 -1
  37. package/dist/assets/{chat-avatar-C7xsXP27.js → chat-avatar-DIDq1Jt5.js} +1 -1
  38. package/dist/assets/{chat-layout-slots-store-C325hn1X.js → chat-layout-slots-store-C2IFeZFr.js} +1 -1
  39. package/dist/assets/{chat-markdown-message-C2uQyAXa.js → chat-markdown-message-ERK48E1Z.js} +2 -2
  40. package/dist/assets/{checkbox-BZTUJtxM.js → checkbox-BY0BDJjm.js} +1 -1
  41. package/dist/assets/{client-feature-flag-store-DR6pLmyc.js → client-feature-flag-store-oTfL8Oiz.js} +1 -1
  42. package/dist/assets/{client-identity-ChGFRQsv.js → client-identity-BS5mQsaQ.js} +1 -1
  43. package/dist/assets/{command-palette-CYwgr9BF.js → command-palette-CsRPcIM-.js} +1 -1
  44. package/dist/assets/{command-palette-window-page-ByOPmEAV.js → command-palette-window-page-BzQ_oDaq.js} +1 -1
  45. package/dist/assets/{community-page-D7FDDkdu.js → community-page-mlhk4LsN.js} +1 -1
  46. package/dist/assets/{confirm-dialog-DZX6LhLy.js → confirm-dialog-UYFm4osC.js} +1 -1
  47. package/dist/assets/{connect-page-BXelaj8V.js → connect-page-PuRyFup0.js} +1 -1
  48. package/dist/assets/consent-DbD2Hcbf.js +1 -0
  49. package/dist/assets/{consent-controls-DoUmeaFm.js → consent-controls-BOFoWAYO.js} +1 -1
  50. package/dist/assets/{contacts-gateway-BI9Ok4O5.js → contacts-gateway-C5OljhCC.js} +1 -1
  51. package/dist/assets/{contacts-page-route-C2cmfHU4.js → contacts-page-route-VBlklzVL.js} +1 -1
  52. package/dist/assets/{conversation-cache-irOw8vtk.js → conversation-cache-CqCkWHT6.js} +1 -1
  53. package/dist/assets/{conversation-list-fetchers-CeiuJYcE.js → conversation-list-fetchers-D84gJs6f.js} +1 -1
  54. package/dist/assets/{conversation-navigation-DUNqTEXk.js → conversation-navigation-Wm7_pLFs.js} +1 -1
  55. package/dist/assets/{conversation-queries-Bo-ZW6ul.js → conversation-queries-Ba_1sW5M.js} +1 -1
  56. package/dist/assets/{conversation-store-C0tvFESx.js → conversation-store-bshB7nDP.js} +1 -1
  57. package/dist/assets/{credential-entry-page-Dt_0bNAT.js → credential-entry-page-Bfrl1sD_.js} +1 -1
  58. package/dist/assets/{credentials-page-BDfP4yY4.js → credentials-page-B-AJyMvk.js} +1 -1
  59. package/dist/assets/{danger-zone-redirect-page-CpEYg1lA.js → danger-zone-redirect-page-DKfrmf_o.js} +1 -1
  60. package/dist/assets/{debug-page-Bh4VqdzS.js → debug-page-DWEIExMH.js} +2 -2
  61. package/dist/assets/{deploy-dialogs-D_AQFfc0.js → deploy-dialogs-BNMcZzII.js} +1 -1
  62. package/dist/assets/{deploy-store-Co5K25DO.js → deploy-store-CxnShfQj.js} +1 -1
  63. package/dist/assets/{detail-card-BKbhBGhy.js → detail-card-CwtjhGfi.js} +1 -1
  64. package/dist/assets/{detail-panel-stop-button-C-Y-hevf.js → detail-panel-stop-button-C1rystDS.js} +1 -1
  65. package/dist/assets/{detail-shell-BW-7Q0R6.js → detail-shell-DcNnOqM_.js} +1 -1
  66. package/dist/assets/{developer-page-tydL_eOW.js → developer-page-Bu7HBiPJ.js} +1 -1
  67. package/dist/assets/{devices-redirect-page-7yfm7RVK.js → devices-redirect-page-Cvt_H5ig.js} +1 -1
  68. package/dist/assets/{diagnostics-C1vLQi8c.js → diagnostics-Dva51gYK.js} +1 -1
  69. package/dist/assets/{dictation-overlay-page-BM_PPlmh.js → dictation-overlay-page-zpoNqudq.js} +1 -1
  70. package/dist/assets/{dictation-overlay-w1YHEfFR.js → dictation-overlay-pePw7mLd.js} +1 -1
  71. package/dist/assets/{dist-BswnB-bR.js → dist-DC9QooLF.js} +1 -1
  72. package/dist/assets/{dist-CQN0ZAOZ.js → dist-oCfq2a_n.js} +1 -1
  73. package/dist/assets/{document-viewer-container-Do8yUakJ.js → document-viewer-container-Cl4jDmfx.js} +2 -2
  74. package/dist/assets/{document-viewer-page-BzM3ABt9.js → document-viewer-page-kV6TCXu0.js} +1 -1
  75. package/dist/assets/{edge-swipe-arbiter-store-D9XJTxJJ.js → edge-swipe-arbiter-store-DyemvsR-.js} +1 -1
  76. package/dist/assets/effective-timezone-qiooajmO.js +1 -0
  77. package/dist/assets/{emails-page-Cn56Zrp2.js → emails-page-D9E3uXkG.js} +1 -1
  78. package/dist/assets/{environment-store-BXSWXdjm.js → environment-store-BFVmN-OW.js} +1 -1
  79. package/dist/assets/esm-BQjZqfJZ.js +2 -0
  80. package/dist/assets/esm-BTyZM-kf.js +2 -0
  81. package/dist/assets/esm-BWFeAIOX.js +2 -0
  82. package/dist/assets/{esm-DCA3xHJS.js → esm-C6-ZMSya.js} +2 -2
  83. package/dist/assets/esm-CDPcGg-B.js +2 -0
  84. package/dist/assets/esm-DEY-lP80.js +1 -0
  85. package/dist/assets/esm-DKdDWqsF.js +2 -0
  86. package/dist/assets/{eye-bbox-vHbpD-XX.js → eye-bbox-DXmmg9ML.js} +1 -1
  87. package/dist/assets/{file-editor-AqFGpEiG.js → file-editor-DpNdd7HZ.js} +1 -1
  88. package/dist/assets/{file-markdown-Dz0E8JCw.js → file-markdown-CLmQTpqL.js} +1 -1
  89. package/dist/assets/{first-run-scope-vr9PkCPF.js → first-run-scope-BoT9LMYw.js} +1 -1
  90. package/dist/assets/{funnel-events-wLEIhAS6.js → funnel-events-CK938pi2.js} +1 -1
  91. package/dist/assets/general-page-DpKVqj5t.js +1 -0
  92. package/dist/assets/{get-memory-stats-B9qL5lJg.js → get-memory-stats-ERcqnC0Q.js} +1 -1
  93. package/dist/assets/{haptics-BOyIPZDm.js → haptics-D9eNTUq-.js} +2 -2
  94. package/dist/assets/{hatching-screen-DKqcfIqT.js → hatching-screen-d3SWqFKY.js} +1 -1
  95. package/dist/assets/{home-page-route-4LoUJVyf.js → home-page-route-BOCisuYY.js} +1 -1
  96. package/dist/assets/{hosting-screen-ChxMs5SE.js → hosting-screen-6xIW6q02.js} +1 -1
  97. package/dist/assets/{identity-page-route-BZv_8gEN.js → identity-page-route-qWwRSRld.js} +1 -1
  98. package/dist/assets/index-B0l9Wjpj.css +2 -0
  99. package/dist/assets/{index-4G2A642F.js → index-BOC87TAq.js} +3 -3
  100. package/dist/assets/{ingest-JAa1OGej.js → ingest-DGkxw0Go.js} +1 -1
  101. package/dist/assets/{inspect-page-D6BmfgaE.js → inspect-page-CRBfQ5WU.js} +3 -3
  102. package/dist/assets/{installed-plugins-query-BARnE4gA.js → installed-plugins-query-C29LGAEV.js} +1 -1
  103. package/dist/assets/{integration-icon-B5V_-Cwm.js → integration-icon-Dvjn3ytY.js} +1 -1
  104. package/dist/assets/{integrations-page-CiKJbgld.js → integrations-page-D5KWY6v-.js} +1 -1
  105. package/dist/assets/{intelligence-layout-iZMnS_UR.js → intelligence-layout-DP9zklR6.js} +1 -1
  106. package/dist/assets/{invalidate-plugin-queries-QIHve9na.js → invalidate-plugin-queries-DamxiwYv.js} +1 -1
  107. package/dist/assets/{keyboard-shortcuts-redirect-page-Bj55BTMo.js → keyboard-shortcuts-redirect-page--bCvhp62.js} +1 -1
  108. package/dist/assets/{latest-assistant-text-BjCANctw.js → latest-assistant-text-D5WR-o6J.js} +1 -1
  109. package/dist/assets/{library-detail-page-rAKEZjAC.js → library-detail-page-pviljaQw.js} +1 -1
  110. package/dist/assets/{library-page-DLXws76z.js → library-page-CYYuLywk.js} +1 -1
  111. package/dist/assets/{list-row-MeHwwyA6.js → list-row-B1wPb2Au.js} +1 -1
  112. package/dist/assets/{local-mode-CTrmCbAp.js → local-mode-Ckii2tmN.js} +1 -1
  113. package/dist/assets/{local-runtime-upgrade-DhywiNJj.js → local-runtime-upgrade-BggVMXfW.js} +1 -1
  114. package/dist/assets/{login-flow-GvzsqmPU.js → login-flow-BCNBNLzu.js} +1 -1
  115. package/dist/assets/{login-page-BpyN5i3N.js → login-page-DdHXGGAt.js} +1 -1
  116. package/dist/assets/{logout-page-BYTvA7jR.js → logout-page-DjihP6Qk.js} +1 -1
  117. package/dist/assets/{logs-layout-CAsT7PSA.js → logs-layout-C84-h0Hn.js} +1 -1
  118. package/dist/assets/{memory-page-route-Ct0vQuTQ.js → memory-page-route-dGWTWCWF.js} +1 -1
  119. package/dist/assets/{memory-router-playground-page-Dw5KRcud.js → memory-router-playground-page-CjUiz_bH.js} +1 -1
  120. package/dist/assets/{menu-CKZtG-s_.js → menu-BvjhxZo7.js} +1 -1
  121. package/dist/assets/{messages-DR9NaU6I.js → messages-Dl5_cjD9.js} +1 -1
  122. package/dist/assets/{metric-card-BGMRvm8T.js → metric-card-CkAD9RpC.js} +1 -1
  123. package/dist/assets/{mobile-sidebar-drawer-Dwe3U09O.js → mobile-sidebar-drawer-CbJ5JfXT.js} +1 -1
  124. package/dist/assets/{modal-DwsThLGg.js → modal-BR4CUFBd.js} +1 -1
  125. package/dist/assets/mutation-error-CwYvaYnb.js +1 -0
  126. package/dist/assets/native-anchor-CVNubOIm.js +1 -0
  127. package/dist/assets/{native-biometric-BBZbTKi0.js → native-biometric-CntdlaL-.js} +1 -1
  128. package/dist/assets/{native-file-fkzAxQg0.js → native-file-B6_oAU2Q.js} +2 -2
  129. package/dist/assets/{not-found-BAcyD9Pu.js → not-found-DV3iLBwm.js} +1 -1
  130. package/dist/assets/{notice-DCp7WO3L.js → notice-BMK7xqUw.js} +1 -1
  131. package/dist/assets/{notifications-page-DzAAMGmB.js → notifications-page-B9vnqyB1.js} +1 -1
  132. package/dist/assets/{oauth-complete-page-pSE2ePnC.js → oauth-complete-page-BSxiDbQm.js} +1 -1
  133. package/dist/assets/{oauth-connection-utils-U3iVzpfJ.js → oauth-connection-utils-DbcihBL8.js} +1 -1
  134. package/dist/assets/{oauth-popup-complete-page-D4Uc4M6G.js → oauth-popup-complete-page-CyYbqLoK.js} +1 -1
  135. package/dist/assets/{onboarding-layout-1lVX8db0.js → onboarding-layout-Dd5fPfE7.js} +1 -1
  136. package/dist/assets/{onboarding-store-hpvNtD3A.js → onboarding-store-DutUn1E3.js} +1 -1
  137. package/dist/assets/open-workspace-file-CpveqBim.js +2 -0
  138. package/dist/assets/{page-empty-state-BOJLN0oo.js → page-empty-state-BA3_YQN2.js} +1 -1
  139. package/dist/assets/{page-shell-CdgW9nzA.js → page-shell-_QxBKTK3.js} +1 -1
  140. package/dist/assets/{pairing-page-KqVmsFUh.js → pairing-page-DPfIgf3F.js} +1 -1
  141. package/dist/assets/{panel-item-ldBYDDDs.js → panel-item-CrtoJCrd.js} +1 -1
  142. package/dist/assets/{password-reset-page-CMaCRCUO.js → password-reset-page-D55bGMVy.js} +1 -1
  143. package/dist/assets/{personality-page-Dt5aGp-e.js → personality-page-fJJd-i4s.js} +1 -1
  144. package/dist/assets/plans-page-C-JyEPT_.js +1 -0
  145. package/dist/assets/{platform-detection-DOh3jMAT.js → platform-detection-CMiRPRCq.js} +1 -1
  146. package/dist/assets/{platform-login-notice-LOYoqOMf.js → platform-login-notice-BG9TFAJa.js} +1 -1
  147. package/dist/assets/{platform-loopback-page-BscTnDN8.js → platform-loopback-page-DunGLusR.js} +1 -1
  148. package/dist/assets/{plugin-detail-page-rtP8WprQ.js → plugin-detail-page-BngHrN8T.js} +1 -1
  149. package/dist/assets/{plugins-page-BlLCo_51.js → plugins-page-DD0t1_pE.js} +1 -1
  150. package/dist/assets/plugins-surface-D4i2vqBz.js +1 -0
  151. package/dist/assets/{popover-BFL-uOLh.js → popover-BRpYVASI.js} +1 -1
  152. package/dist/assets/{prefs-B2UAscQt.js → prefs-BZnS5vR_.js} +1 -1
  153. package/dist/assets/{privacy-page-DIfDx43s.js → privacy-page-nZvfh3dh.js} +1 -1
  154. package/dist/assets/{privacy-screen-CT2vDIPL.js → privacy-screen-D2aDT6E6.js} +1 -1
  155. package/dist/assets/{provider-callback-page-CBhBrIAp.js → provider-callback-page-BwANEd-K.js} +1 -1
  156. package/dist/assets/{provider-key-BoyxWMGQ.js → provider-key-B3R8SlMJ.js} +1 -1
  157. package/dist/assets/{provider-signup-page-MRdEILUW.js → provider-signup-page-Cz2DP-jP.js} +1 -1
  158. package/dist/assets/{quick-input-page-ZAHDIH7x.js → quick-input-page-CF2MJnCE.js} +1 -1
  159. package/dist/assets/{react-query.gen-oEdI--ip.js → react-query.gen-Mwd5l-vZ.js} +1 -1
  160. package/dist/assets/{react-query.gen-CbsPBjd9.js → react-query.gen-r3I6j8-1.js} +1 -1
  161. package/dist/assets/{remote-gateway-session-DAfJAELv.js → remote-gateway-session-BHjZ9gQ6.js} +1 -1
  162. package/dist/assets/{research-facts-e-0TmtJP.js → research-facts-UIXXE8D6.js} +1 -1
  163. package/dist/assets/{research-mock-page-DTTf0zfR.js → research-mock-page-DnbQpZcp.js} +1 -1
  164. package/dist/assets/{research-onboarding-persistence-BN6g1lF7.js → research-onboarding-persistence-CceFfAqE.js} +1 -1
  165. package/dist/assets/{research-onboarding-route-xdBEvVjC.js → research-onboarding-route-yg2iKw6i.js} +1 -1
  166. package/dist/assets/{research-results-view-DhHY5ZPj.js → research-results-view-CxhTn2J7.js} +1 -1
  167. package/dist/assets/{resolved-assistants-store-PdwcxGwN.js → resolved-assistants-store-C-PdxK8f.js} +1 -1
  168. package/dist/assets/{retire-confirm-dialog-BF8nORxR.js → retire-confirm-dialog--eF_pXhA.js} +1 -1
  169. package/dist/assets/{review-terms-screen-DWW0H6gs.js → review-terms-screen-Dpk-gyJE.js} +1 -1
  170. package/dist/assets/{risk-DXfbjxrL.js → risk-C_bbPQPd.js} +1 -1
  171. package/dist/assets/{routes-C3xPjNWF.js → routes-BBFM42ft.js} +11 -11
  172. package/dist/assets/{routes-bwxCYLJj.js → routes-vE-2hncW.js} +1 -1
  173. package/dist/assets/{runtime-upgrade-banner-Dlp0eQiE.js → runtime-upgrade-banner-DQI-l3Yc.js} +2 -2
  174. package/dist/assets/{schedules-o0jcCr54.js → schedules-DF5cTXBf.js} +1 -1
  175. package/dist/assets/{schedules-page-BCofuXAr.js → schedules-page-Dgu-znOf.js} +1 -1
  176. package/dist/assets/{sdk.gen-C6q_cviY.js → sdk.gen-BIu1DgTs.js} +1 -1
  177. package/dist/assets/{security-redirect-page-B_ci75cb.js → security-redirect-page-BEohiPDW.js} +1 -1
  178. package/dist/assets/{select-assistant-screen-g68FASxq.js → select-assistant-screen-C2q8wO2f.js} +1 -1
  179. package/dist/assets/{setting-row-CxQBrD8s.js → setting-row-0LXvW7Kh.js} +1 -1
  180. package/dist/assets/{settings-divider-ORJowxpl.js → settings-divider-CXIrJieH.js} +1 -1
  181. package/dist/assets/{settings-layout-DvMiWCPp.js → settings-layout-b7iBWIT-.js} +1 -1
  182. package/dist/assets/settings-navigation-BGdjm0Ki.js +1 -0
  183. package/dist/assets/{share-feedback-modal-BlqdxyC5.js → share-feedback-modal-B05-nKgu.js} +1 -1
  184. package/dist/assets/{sidebar-tree-DtsphGOt.js → sidebar-tree-ByF78JHW.js} +1 -1
  185. package/dist/assets/{signup-page-B-9iClzh.js → signup-page-CGauGszD.js} +1 -1
  186. package/dist/assets/{signup-shell-CS8qe8J1.js → signup-shell-Bw6r9tWP.js} +1 -1
  187. package/dist/assets/{site-favicon-BwdB2A7_.js → site-favicon-CCyX9r-Z.js} +1 -1
  188. package/dist/assets/{skill-detail-page-RlOqtrxz.js → skill-detail-page-GlV5JRzQ.js} +1 -1
  189. package/dist/assets/{skill-detail-panel-72NTcSvY.js → skill-detail-panel-crqCBZbU.js} +1 -1
  190. package/dist/assets/{skills-CS48H_5g.js → skills-C1CAcW7T.js} +1 -1
  191. package/dist/assets/{skills-page-B5c4S__U.js → skills-page-BikP-AR7.js} +1 -1
  192. package/dist/assets/{slack-setup-wizard-DyLOaNeb.js → slack-setup-wizard-DKj1_XdA.js} +1 -1
  193. package/dist/assets/{cpu-eUAdrpWb.js → sliders-horizontal-slneqAyY.js} +1 -1
  194. package/dist/assets/{sound-manager-BkU9w22u.js → sound-manager-xEbUgFv-.js} +1 -1
  195. package/dist/assets/{sounds-page-B_VfIF_f.js → sounds-page-9_otQ97S.js} +1 -1
  196. package/dist/assets/{src-B9F84D64.js → src-D89CNeuT.js} +1 -1
  197. package/dist/assets/{start-screen-BzchtmN4.js → start-screen-DSF3melT.js} +1 -1
  198. package/dist/assets/{stream-watchdog-LwK1DR5Q.js → stream-watchdog-BafbDdX9.js} +1 -1
  199. package/dist/assets/{subagent-detail-panel-CnkzZsGz.js → subagent-detail-panel-q0g4JWAX.js} +1 -1
  200. package/dist/assets/{subagent-store-CM0X7ol2.js → subagent-store-D-GPthdC.js} +1 -1
  201. package/dist/assets/{superpowers-page-D0T5rLBb.js → superpowers-page-UgdWFWsF.js} +1 -1
  202. package/dist/assets/{system-events-page-9lCNzX-7.js → system-events-page-Bw94HLwx.js} +1 -1
  203. package/dist/assets/{system-events-redirect-page-AHa_MARa.js → system-events-redirect-page-BGZQC8-K.js} +1 -1
  204. package/dist/assets/{tag-D8NAGb0r.js → tag-NXcyiTkK.js} +1 -1
  205. package/dist/assets/{theme-stage-page-CntGqJIW.js → theme-stage-page-bEZxHTyN.js} +1 -1
  206. package/dist/assets/{threshold-presets-ti1ttrv3.js → threshold-presets-BO8En2q0.js} +1 -1
  207. package/dist/assets/{tiptap-document-editor-BOuerIA1.js → tiptap-document-editor-CyY1HRzV.js} +1 -1
  208. package/dist/assets/{toast-DR7D7Uma.js → toast-LgLp4obE.js} +1 -1
  209. package/dist/assets/{tool-detail-panel-B6-P-pe0.js → tool-detail-panel-DFMOphDJ.js} +1 -1
  210. package/dist/assets/{transcript-message-body-shared-CQwPiuDN.js → transcript-message-body-shared-nWAkSzar.js} +1 -1
  211. package/dist/assets/{trust-rules-api-lD2Ni46I.js → trust-rules-api-C0-hkXT2.js} +1 -1
  212. package/dist/assets/{upgrade-cancel-page-D0hw2jKj.js → upgrade-cancel-page-DwxI6NLL.js} +1 -1
  213. package/dist/assets/{upgrade-success-page-CmEZ39Sn.js → upgrade-success-page-SO92J-Rf.js} +1 -1
  214. package/dist/assets/{usage-redirect-page-Cq2M7ii4.js → usage-redirect-page-BJBkecYr.js} +1 -1
  215. package/dist/assets/{use-active-assistant-id-BcM35kFN.js → use-active-assistant-id-Cjbsk2Q3.js} +1 -1
  216. package/dist/assets/{use-app-theme-DVqzJFH6.js → use-app-theme-Q42fO5Nz.js} +1 -1
  217. package/dist/assets/{use-assistant-avatar-DpMH3A_7.js → use-assistant-avatar-DSu2_Mzi.js} +1 -1
  218. package/dist/assets/{use-assistant-capability-DkGxxxTG.js → use-assistant-capability-gxe56K48.js} +1 -1
  219. package/dist/assets/{use-assistant-identity-details-CN_tizo0.js → use-assistant-identity-details-CpHkzjrI.js} +1 -1
  220. package/dist/assets/{use-avatar-accent-var-C4DSU-BO.js → use-avatar-accent-var-PV9tsBJj.js} +1 -1
  221. package/dist/assets/{use-bookmarks-DzswOt-6.js → use-bookmarks-BbJtKyHe.js} +1 -1
  222. package/dist/assets/{use-bundled-avatar-components-IQw2k8-g.js → use-bundled-avatar-components-Gp_YaD6o.js} +2 -2
  223. package/dist/assets/{use-bus-subscription-DIENjckU.js → use-bus-subscription-Cu4Y9DQi.js} +1 -1
  224. package/dist/assets/use-checkout-dismiss-refresh-kdxxDNpF.js +1 -0
  225. package/dist/assets/{use-command-palette-sections-BFYwWTT8.js → use-command-palette-sections-BWjxkwKB.js} +1 -1
  226. package/dist/assets/{use-discord-nudge-CRU-lEHV.js → use-discord-nudge-C_QdHIeX.js} +1 -1
  227. package/dist/assets/{use-edge-swipe-6PtOzG4E.js → use-edge-swipe-DVeTYbmY.js} +1 -1
  228. package/dist/assets/{use-edge-swipe-back-Y66_jaFR.js → use-edge-swipe-back-DDq-N20h.js} +1 -1
  229. package/dist/assets/{use-edit-app-B3lr2KkA.js → use-edit-app-DfFIonqZ.js} +1 -1
  230. package/dist/assets/{use-effective-timezone-Da7pvXSm.js → use-effective-timezone-LqzBqHBy.js} +1 -1
  231. package/dist/assets/{use-invite-link-dialog-4cPtNBj0.js → use-invite-link-dialog-DX58-LWY.js} +1 -1
  232. package/dist/assets/use-ios-app-nudge-BO8jWfr0.js +1 -0
  233. package/dist/assets/use-is-org-ready-X_98Cnx9.js +1 -0
  234. package/dist/assets/{use-onboarding-login-DWweCRJ-.js → use-onboarding-login-B8rpbSEh.js} +1 -1
  235. package/dist/assets/{use-platform-gate-DcS6snds.js → use-platform-gate-Dry0Nv4f.js} +1 -1
  236. package/dist/assets/{use-reduced-motion-Bv27WKCk.js → use-reduced-motion-Se97jRQ-.js} +1 -1
  237. package/dist/assets/{use-save-twilio-credentials-BDbv1FdS.js → use-save-twilio-credentials-CUQ6gdIj.js} +1 -1
  238. package/dist/assets/{use-skill-actions-C34mG6kK.js → use-skill-actions-DgK7Nmt1.js} +1 -1
  239. package/dist/assets/{use-skill-detail-files-M-YjNd2c.js → use-skill-detail-files-_v4zUF6S.js} +1 -1
  240. package/dist/assets/use-sticky-profiles-B0zVD3uk.js +1 -0
  241. package/dist/assets/{use-subagent-card-data-CmbaKWII.js → use-subagent-card-data-YbAN73Fw.js} +1 -1
  242. package/dist/assets/{use-supports-bookmarks-CJC-T2ro.js → use-supports-bookmarks-C3J7FtDn.js} +1 -1
  243. package/dist/assets/{use-swipe-engine-RAFE-Hrf.js → use-swipe-engine-DRvffOuu.js} +1 -1
  244. package/dist/assets/{utils-DW4oHJu6.js → utils-BtC1KiH4.js} +1 -1
  245. package/dist/assets/{utils-CrvvcikL.js → utils-CnB60ZJN.js} +1 -1
  246. package/dist/assets/{viewer-store-CLSpfTlZ.js → viewer-store-BDpZVbcr.js} +1 -1
  247. package/dist/assets/{voice-list-woCTax9H.js → voice-list-DJeZeHuA.js} +1 -1
  248. package/dist/assets/{voice-page-BDjuMuY8.js → voice-page-DQcyxaPl.js} +1 -1
  249. package/dist/assets/{voice-picker-modal-BiCmmLJz.js → voice-picker-modal-BXMvQihh.js} +1 -1
  250. package/dist/assets/{weather-forecast-display-D5OkfHyL.js → weather-forecast-display-D2sn4QD4.js} +1 -1
  251. package/dist/assets/{web-BMLENaxE.js → web-7I6Bn0iP.js} +1 -1
  252. package/dist/assets/{web-BK2xLXXm.js → web-BE7l06mM.js} +1 -1
  253. package/dist/assets/{web-BLJkVZnq.js → web-BEpNr5_U.js} +1 -1
  254. package/dist/assets/{web-Cc4zhBG7.js → web-BPyURh2Z.js} +1 -1
  255. package/dist/assets/{web-D6tBOv21.js → web-Bj8XUknF.js} +1 -1
  256. package/dist/assets/{web-Cimwq57E.js → web-CBluPLFP.js} +1 -1
  257. package/dist/assets/{web-C4ApmvCw.js → web-Cmg3AbZk.js} +1 -1
  258. package/dist/assets/{web-BQLS3-Jp.js → web-DHVjLzid.js} +1 -1
  259. package/dist/assets/{welcome-screen-BTmdDQ8q.js → welcome-screen-n-cGiojh.js} +1 -1
  260. package/dist/assets/{workflow-detail-panel-BigYPr9m.js → workflow-detail-panel-Cq3AwWXE.js} +1 -1
  261. package/dist/assets/{workflow-store-B-5tSUVD.js → workflow-store-QV5aMjTt.js} +1 -1
  262. package/dist/assets/{workspace-page-D1Ds9_ey.js → workspace-page-CL9z2Jrs.js} +1 -1
  263. package/dist/index.html +228 -229
  264. package/package.json +1 -1
  265. package/dist/assets/access-DFmdmMm5.js +0 -1
  266. package/dist/assets/ai-page-_F_gn-vY.js +0 -1
  267. package/dist/assets/assistant-identity-store-RThYdwnA.js +0 -1
  268. package/dist/assets/avatar-svg-compositor-CgyK5D40.js +0 -1
  269. package/dist/assets/billing-page-D1vuR7wJ.js +0 -3
  270. package/dist/assets/consent-Bkslj0yQ.js +0 -1
  271. package/dist/assets/crown-DTdTkF6n.js +0 -1
  272. package/dist/assets/effective-timezone-CnKC3vj0.js +0 -1
  273. package/dist/assets/esm-CBsKAtYP.js +0 -2
  274. package/dist/assets/esm-CkAk1b7M.js +0 -1
  275. package/dist/assets/esm-DVuEArjY.js +0 -2
  276. package/dist/assets/esm-LrelsjXA.js +0 -2
  277. package/dist/assets/esm-NJgNz35U.js +0 -2
  278. package/dist/assets/esm-PbRZjFG7.js +0 -2
  279. package/dist/assets/general-page-CVLpYzRN.js +0 -1
  280. package/dist/assets/index-_3FdgMgw.css +0 -2
  281. package/dist/assets/mutation-error--1w2EbUT.js +0 -1
  282. package/dist/assets/native-anchor-DtMEHD4d.js +0 -1
  283. package/dist/assets/open-workspace-file-C0ZDhKxD.js +0 -2
  284. package/dist/assets/plans-page-B0jfFMS-.js +0 -1
  285. package/dist/assets/plugins-surface-C6q5ZBC0.js +0 -1
  286. package/dist/assets/settings-navigation-DCqMil0c.js +0 -1
  287. package/dist/assets/sliders-horizontal-D5dtNWk8.js +0 -1
  288. package/dist/assets/use-checkout-dismiss-refresh-DRknWbR3.js +0 -1
  289. package/dist/assets/use-ios-app-nudge-BV5eX4Fv.js +0 -1
  290. package/dist/assets/use-is-org-ready-DryM43xt.js +0 -1
  291. package/dist/assets/use-sticky-profiles-CostDY59.js +0 -1
  292. /package/dist/assets/{Combination-C7TWRLS7.js → Combination-CkAMwkbS.js} +0 -0
  293. /package/dist/assets/{api-errors-BRGPPSWw.js → api-errors-CFiCT7Ap.js} +0 -0
  294. /package/dist/assets/{app-types-DSkgEmV3.js → app-types-CBg2__YH.js} +0 -0
  295. /package/dist/assets/{apple-logo-BaqMf8q6.js → apple-logo-poQac1tY.js} +0 -0
  296. /package/dist/assets/{avatar-bundled-components-CTd294ra.js → avatar-bundled-components-CecbESCk.js} +0 -0
  297. /package/dist/assets/{avatar-subagent-BpXST4nO.js → avatar-subagent-C9WTTUjI.js} +0 -0
  298. /package/dist/assets/{avatar-tone-4L7foPzW.js → avatar-tone-CMoWR2JX.js} +0 -0
  299. /package/dist/assets/{browser-timezone-DGz-HvxU.js → browser-timezone-C_0jBUid.js} +0 -0
  300. /package/dist/assets/{build.umd-DlzJAHJ4.js → build.umd-59c0EvgO.js} +0 -0
  301. /package/dist/assets/{by-tool-use-id-index-DcsiqOhc.js → by-tool-use-id-index-aoRP6d51.js} +0 -0
  302. /package/dist/assets/{chat-BIJEFb5u.js → chat-BrL0k2UY.js} +0 -0
  303. /package/dist/assets/{client.gen-Dq2brHDV.js → client.gen-CV05d-kw.js} +0 -0
  304. /package/dist/assets/{conversation-selection-Cx6Axfzb.js → conversation-selection-3EKkKt0G.js} +0 -0
  305. /package/dist/assets/{create-selectors-B-P03-8K.js → create-selectors-Qo7kcikX.js} +0 -0
  306. /package/dist/assets/{definitions-MzBHgkRs.js → definitions-OhJf_HMS.js} +0 -0
  307. /package/dist/assets/{definitions-quuEj_td.js → definitions-PikNVFdS.js} +0 -0
  308. /package/dist/assets/{dices-FpUbVcWW.js → dices-DcuIF52A.js} +0 -0
  309. /package/dist/assets/{dist-BJSu8g5P.js → dist-BwAT3VYQ.js} +0 -0
  310. /package/dist/assets/{dist-CKLJHt4Z.js → dist-CaYJ736y.js} +0 -0
  311. /package/dist/assets/{dist-BKxs5XmY.js → dist-jXSU-ejH.js} +0 -0
  312. /package/dist/assets/{domains-BwT1h2fD.js → domains-DWRzNRJy.js} +0 -0
  313. /package/dist/assets/{download-BBg2iaa4.js → download-CywcQLB2.js} +0 -0
  314. /package/dist/assets/{dropdown-Dt0Iof85.js → dropdown-BCfnSdIZ.js} +0 -0
  315. /package/dist/assets/{edit-chat-session-BVmK2sam.js → edit-chat-session-yPtopwB6.js} +0 -0
  316. /package/dist/assets/{ellipsis-BRJI5_P1.js → ellipsis-DnoqTkj4.js} +0 -0
  317. /package/dist/assets/{emoji-catalog-data-BCc1YNMR.js → emoji-catalog-data-COLzb2Wj.js} +0 -0
  318. /package/dist/assets/{event-bus-D2jlU6rm.js → event-bus-DSxmBYhD.js} +0 -0
  319. /package/dist/assets/{external-link-CAce-RVu.js → external-link-CS0aVYGt.js} +0 -0
  320. /package/dist/assets/{external-urls-HAW1JmbX.js → external-urls-BYwuIdYk.js} +0 -0
  321. /package/dist/assets/{eye-DTyDWiqu.js → eye-BMVGQXHT.js} +0 -0
  322. /package/dist/assets/{eye-off-fuOP4Lij.js → eye-off-Jdx8qkOK.js} +0 -0
  323. /package/dist/assets/{feature-flag-catalog-C45bOtg3.js → feature-flag-catalog-BAyJlRMY.js} +0 -0
  324. /package/dist/assets/{file-CNougInA.js → file-Ddp9Dqgl.js} +0 -0
  325. /package/dist/assets/{file-code-DD3K2kve.js → file-code-BDHws4Dk.js} +0 -0
  326. /package/dist/assets/{file-plus-Dq2xo7Ic.js → file-plus-C3SBA8ll.js} +0 -0
  327. /package/dist/assets/{file-text-BCsUYVEF.js → file-text-Br730Q4B.js} +0 -0
  328. /package/dist/assets/{folder-Dgxb-gKb.js → folder-DF8nFp7N.js} +0 -0
  329. /package/dist/assets/{folder-open-CAb0DLYq.js → folder-open-Nlg0OphT.js} +0 -0
  330. /package/dist/assets/{format-date-C5pKGCAG.js → format-date-RZ9mCDCy.js} +0 -0
  331. /package/dist/assets/{format-file-size-Btq3aJL3.js → format-file-size-CQaPE33p.js} +0 -0
  332. /package/dist/assets/{globe-CEgs-yoc.js → globe-CMtjL_s_.js} +0 -0
  333. /package/dist/assets/{hard-drive-dYuXAWBE.js → hard-drive-DWFPKcXI.js} +0 -0
  334. /package/dist/assets/{hard-navigate-V2EFapkk.js → hard-navigate-DZlpL1No.js} +0 -0
  335. /package/dist/assets/{heart-BqO0KKAc.js → heart-789ajxtB.js} +0 -0
  336. /package/dist/assets/{impersonate-version-flag-QIrc9g5I.js → impersonate-version-flag-4Ki_3iKD.js} +0 -0
  337. /package/dist/assets/{inbox-DXYIwUrn.js → inbox-B6TknLsk.js} +0 -0
  338. /package/dist/assets/{info-CYiVdnQV.js → info-vgPTIsGI.js} +0 -0
  339. /package/dist/assets/{input-C-GkeWCw.js → input-hw3el2GJ.js} +0 -0
  340. /package/dist/assets/{is-electron-7N7iyz1y.js → is-electron-m5eeGBnd.js} +0 -0
  341. /package/dist/assets/{key-round-CSc3w5ka.js → key-round-0Zop_GsZ.js} +0 -0
  342. /package/dist/assets/{laptop-ByoaxLxg.js → laptop-DSZhU52i.js} +0 -0
  343. /package/dist/assets/{layout-grid-PPpVK0nJ.js → layout-grid-DA_CfD6d.js} +0 -0
  344. /package/dist/assets/{link-2-BMNZFfWH.js → link-2-BKL8QWRX.js} +0 -0
  345. /package/dist/assets/{link-CowyzCIZ.js → link-BfUb7cwC.js} +0 -0
  346. /package/dist/assets/{link-click-DLYgWZdo.js → link-click-BoSQACXo.js} +0 -0
  347. /package/dist/assets/{list-CDyb1CGV.js → list-DNbTcxAh.js} +0 -0
  348. /package/dist/assets/{loader-circle-BzJ2kz3F.js → loader-circle-XREx3i4W.js} +0 -0
  349. /package/dist/assets/{log-in-Bhye1kwc.js → log-in-CqVJRYe-.js} +0 -0
  350. /package/dist/assets/{log-out-BLE632qu.js → log-out-B4hsBWnk.js} +0 -0
  351. /package/dist/assets/{machine-sizes-Cu2Qa0bd.js → machine-sizes-DAflIPTM.js} +0 -0
  352. /package/dist/assets/{mail-DABv3_Ue.js → mail-CMdPNysl.js} +0 -0
  353. /package/dist/assets/{message-circle-gk_DFUIg.js → message-circle-BsH7vHtN.js} +0 -0
  354. /package/dist/assets/{message-square-zCNXaHYX.js → message-square-CQGiY4zk.js} +0 -0
  355. /package/dist/assets/{message-square-text-asdoy3SW.js → message-square-text-D0Q7W58R.js} +0 -0
  356. /package/dist/assets/{mic-DZrWtAAu.js → mic-xmDFUbCL.js} +0 -0
  357. /package/dist/assets/{minimize-2-BR0ed4mI.js → minimize-2-CaXsUqSp.js} +0 -0
  358. /package/dist/assets/{misc-CAQM4FGM.js → misc-DckBb5zz.js} +0 -0
  359. /package/dist/assets/{monitor-B5vtTCxm.js → monitor-B1y28fS1.js} +0 -0
  360. /package/dist/assets/{moon-DSdti3GO.js → moon-BJzODLTY.js} +0 -0
  361. /package/dist/assets/{native-deep-link-D4jZANvf.js → native-deep-link-PvbVHiPM.js} +0 -0
  362. /package/dist/assets/{oauth-popup-Bru0o3W0.js → oauth-popup-DZEqljdC.js} +0 -0
  363. /package/dist/assets/{onboarding-step-layout-D9rghAjS.js → onboarding-step-layout-CURfuoh4.js} +0 -0
  364. /package/dist/assets/{optimistic-lifecycle-50vNA6dY.js → optimistic-lifecycle-C2a6IJ7E.js} +0 -0
  365. /package/dist/assets/{paperclip-DVE0scjU.js → paperclip-c8Xlrnx4.js} +0 -0
  366. /package/dist/assets/{pdf-DFUISXhq.js → pdf-IQXtc7_x.js} +0 -0
  367. /package/dist/assets/{plugin-attribution-CItr0rSf.js → plugin-attribution-DCFEMRUF.js} +0 -0
  368. /package/dist/assets/{pointer-QlIwQKYH.js → pointer-RLpjGG7A.js} +0 -0
  369. /package/dist/assets/{prechat-EVefdGcO.js → prechat-DIuViPZk.js} +0 -0
  370. /package/dist/assets/{profile-metadata-D2IzF-q3.js → profile-metadata-h4CTeMKT.js} +0 -0
  371. /package/dist/assets/{progress-bar-CJxkStgF.js → progress-bar-C_T5_pf2.js} +0 -0
  372. /package/dist/assets/{proxy-Ca4nD_gM.js → proxy-RtD8704m.js} +0 -0
  373. /package/dist/assets/{public-asset-CoSMBS62.js → public-asset-CbDDcomC.js} +0 -0
  374. /package/dist/assets/{rotate-ccw-Da_2DvhY.js → rotate-ccw-BjzeX7qz.js} +0 -0
  375. /package/dist/assets/{sandbox-bridge-BhR-nW2z.js → sandbox-bridge-DgDrAWv3.js} +0 -0
  376. /package/dist/assets/{sdk.gen-CsFDyJ6U.js → sdk.gen-BVAVE6A_.js} +0 -0
  377. /package/dist/assets/{sdk.gen-DEFA-6EJ.js → sdk.gen-DPKrJeho.js} +0 -0
  378. /package/dist/assets/{search-DA3TmTuR.js → search-BVW-n8to.js} +0 -0
  379. /package/dist/assets/{semver-Bfq1LtyW.js → semver-BpijV4FQ.js} +0 -0
  380. /package/dist/assets/{send-DHWUIK7G.js → send-Q71Exj3z.js} +0 -0
  381. /package/dist/assets/{shield-check-C7I-REGg.js → shield-check-22NwY9JM.js} +0 -0
  382. /package/dist/assets/{shield-B69p45Kq.js → shield-fzs_emVe.js} +0 -0
  383. /package/dist/assets/{smartphone-BbK6bGuE.js → smartphone-mDNwm_ss.js} +0 -0
  384. /package/dist/assets/{sparkles-DC8kqYjt.js → sparkles-Ccrj7hxd.js} +0 -0
  385. /package/dist/assets/{square-Bn3X6ZlO.js → square-D_e8nR-F.js} +0 -0
  386. /package/dist/assets/{status-badge-pill-wJPMXQk1.js → status-badge-pill-z1OKPW3B.js} +0 -0
  387. /package/dist/assets/{sun-BKEPYS7Q.js → sun-Dw0t1n1O.js} +0 -0
  388. /package/dist/assets/{terminal-Cs_TREv-.js → terminal-CdCI6wMV.js} +0 -0
  389. /package/dist/assets/{theme-preferences-LQuLaIA6.js → theme-preferences-ln8xC5zH.js} +0 -0
  390. /package/dist/assets/{three-dot-indicator-CfjkCgEH.js → three-dot-indicator-SJcKW5cG.js} +0 -0
  391. /package/dist/assets/{toggle-D776PTw-.js → toggle-lfnhEAcN.js} +0 -0
  392. /package/dist/assets/{trash-2-De6X8YiM.js → trash-2-L5LNgw9o.js} +0 -0
  393. /package/dist/assets/{triangle-alert--e3n47gm.js → triangle-alert-CQfiAg_t.js} +0 -0
  394. /package/dist/assets/{typed-storage-zmOSvIeO.js → typed-storage-9Sn8tkE7.js} +0 -0
  395. /package/dist/assets/{use-copy-to-clipboard-O2AZwhGa.js → use-copy-to-clipboard-DBVpNZOl.js} +0 -0
  396. /package/dist/assets/{use-is-mobile-Cx2xnNUx.js → use-is-mobile-Bz2l7wPL.js} +0 -0
  397. /package/dist/assets/{user-Dq9DUxnU.js → user-_zNqL48O.js} +0 -0
  398. /package/dist/assets/{user-plus-CXMJ1x_5.js → user-plus-oiIr9ey8.js} +0 -0
  399. /package/dist/assets/{users-DWDkv8ju.js → users-iLvfYFOP.js} +0 -0
  400. /package/dist/assets/{video-CZnrM0pw.js → video-BcgduiJ6.js} +0 -0
  401. /package/dist/assets/{volume-2-Bj3y3ZBJ.js → volume-2-CvT-JEIl.js} +0 -0
  402. /package/dist/assets/{workflow-DbPANJpf.js → workflow-cWWiPi3K.js} +0 -0
  403. /package/dist/assets/{workflow-status-CgrMMiJT.js → workflow-status-DXdUkbSd.js} +0 -0
  404. /package/dist/assets/{workspace-theme-tokens-bLqHFK0a.js → workspace-theme-tokens-J8dqkK9n.js} +0 -0
  405. /package/dist/assets/{wrench-tjOqvzJ2.js → wrench-0WW0zkkG.js} +0 -0
  406. /package/dist/assets/{x-DuBvjmAE.js → x-JBAsSOmg.js} +0 -0
  407. /package/dist/assets/{xterm-DZ5GcyM-.js → xterm-CdT0HObJ.js} +0 -0
  408. /package/dist/assets/{xterm-addon-fit-SiMU5kXG.js → xterm-addon-fit-CPcVj1i5.js} +0 -0
  409. /package/dist/assets/{zoom-in-BBlu4Gwn.js → zoom-in-CaLYwni-.js} +0 -0
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as i}from"./QueryClientProvider-CMu7CkQU.js";import{t as a}from"./useQuery-Bz-fbQ-m.js";import{t as o}from"./useMutation-CXGTrp4W.js";import{t as s}from"./jsx-runtime-D3ZM-ToX.js";import{t as c}from"./typography-DEI9Ra9z.js";import{t as l}from"./createLucideIcon-CAM1RhH8.js";import{t as u}from"./arrow-right-B-jRJNWP.js";import{t as d}from"./check-sC49_hjU.js";import{t as f}from"./circle-alert-DVCpoZrc.js";import{t as p}from"./circle-check-CjGnAahM.js";import{t as m}from"./coins-Hrmb9tmj.js";import{n as h,t as g}from"./sliders-horizontal-slneqAyY.js";import{t as _}from"./hard-drive-DWFPKcXI.js";import{t as v}from"./info-vgPTIsGI.js";import{t as y}from"./triangle-alert-CQfiAg_t.js";import{t as b}from"./notice-BMK7xqUw.js";import{t as x}from"./modal-BR4CUFBd.js";import{n as S}from"./toast-LgLp4obE.js";import{t as C}from"./confirm-dialog-UYFm4osC.js";import{t as w}from"./dropdown-BCfnSdIZ.js";import{t as T}from"./is-electron-m5eeGBnd.js";import{n as E}from"./resolved-assistants-store-C-PdxK8f.js";import{D,k as O}from"./auth-store-D9BqFncz.js";import{t as k}from"./dist-BwAT3VYQ.js";import{u as A}from"./routes-vE-2hncW.js";import{t as j}from"./use-is-org-ready-X_98Cnx9.js";import{n as ee,r as M}from"./browser-CNL8hh8H.js";import{n as N}from"./use-assistant-avatar-DSu2_Mzi.js";import{$ as P,C as te,O as F,at as I,c as ne,ct as L,et as R,it as re,jt as ie,l as z,lt as ae,nt as B,ot as oe,r as se,rt as ce,st as le,tt as ue,ut as V,y as H}from"./react-query.gen-Mwd5l-vZ.js";import{t as de}from"./avatar-bundled-components-CecbESCk.js";import{n as U}from"./use-avatar-accent-var-PV9tsBJj.js";import{t as fe}from"./proxy-RtD8704m.js";import{t as W}from"./AnimatePresence-3WpfAWHe.js";import{t as pe}from"./use-reduced-motion-Se97jRQ-.js";import{n as me,t as he}from"./avatar-tone-CMoWR2JX.js";import{t as ge}from"./chat-avatar-DIDq1Jt5.js";import{t as G}from"./avatar-renderer-DK54o2kQ.js";import{n as _e}from"./use-bundled-avatar-components-Gp_YaD6o.js";import{t as ve}from"./environment-store-BFVmN-OW.js";import{a as ye,n as K,r as be,t as xe}from"./machine-sizes-DAflIPTM.js";var q=l(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),J=e(t(),1),Y=`vellum.pro-checkout-intent`,Se=1800*1e3;function Ce(e){try{sessionStorage.setItem(Y,JSON.stringify({...e,savedAt:Date.now()}))}catch{}}function we(){if(typeof sessionStorage>`u`)return null;let e=null;try{e=sessionStorage.getItem(Y)}catch{return null}if(!e)return null;let t;try{t=JSON.parse(e)}catch{return Te(),null}return!Ee(t)||Date.now()-t.savedAt>Se?(Te(),null):t}function Te(){try{sessionStorage.removeItem(Y)}catch{}}function Ee(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.savedAt==`number`?t.kind===`package`?typeof t.packageKey==`string`:t.kind===`custom`:!1}var X=s();function De({icon:e}){return(0,X.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--system-negative-strong) 12%, transparent)`},children:(0,X.jsx)(e,{className:`h-5 w-5`,style:{color:`var(--system-negative-strong)`},"aria-hidden":`true`})})}var Oe={fontFamily:`var(--font-serif)`,fontSize:`32px`,fontWeight:400,lineHeight:1.2,letterSpacing:`0.64px`};function ke({title:e,subtitle:t}){return(0,X.jsxs)(`header`,{className:`flex flex-col items-center gap-2 pt-12 text-center`,children:[(0,X.jsx)(`h2`,{className:`text-[var(--content-emphasised)]`,style:Oe,children:e}),t&&(0,X.jsx)(`p`,{className:`text-[14px] font-normal text-[var(--content-secondary)]`,children:t})]})}var Ae=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1},{bodyShape:`stack`,eyeStyle:`gentle`,color:`purple`,size:110,position:`-left-[39px] top-[74%]`,rotate:0},{bodyShape:`urchin`,eyeStyle:`goofy`,color:`pink`,size:137,position:`-right-[42px] -bottom-[40px]`,rotate:180},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`,size:72,position:`left-[37%] -bottom-[22px] -translate-x-1/2`,rotate:0}],je=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1}];function Me({variant:e=`full`}){let t=_e();return t?(0,X.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`creature-corners`,className:`pointer-events-none absolute inset-0 select-none`,children:(e===`top`?je:Ae).map((e,n)=>(0,X.jsx)(`span`,{className:`absolute ${e.position}`,style:{rotate:`${e.rotate}deg`},children:(0,X.jsx)(G,{components:t,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:e.size})},n))}):null}function Ne(e,t=!0){let{data:n}=a({...se(),enabled:t&&e==null}),{data:r}=a({...F({path:{id:e??``}}),enabled:t&&e!=null});return e==null?n:r}function Pe({assistantId:e}){let t=r(),i=Ne(e,j())?.name||`your assistant`;return(0,X.jsxs)(`div`,{className:`relative flex min-h-[320px] flex-col items-center justify-center overflow-hidden px-8 pb-16 [animation:onboarding-step-in_350ms_ease-out] motion-reduce:[animation:none]`,children:[(0,X.jsx)(Me,{variant:`full`}),(0,X.jsxs)(`div`,{className:`relative flex w-full flex-col items-center`,children:[(0,X.jsx)(ke,{title:`You're all set!`,subtitle:`Enjoy the new found power.`}),(0,X.jsx)(`div`,{className:`mt-10 flex w-full flex-col items-center gap-10`,children:(0,X.jsxs)(n,{variant:`primary`,"data-testid":`onboarding-complete-return`,onClick:()=>{e!=null&&O(e),t(A.assistant,{replace:!0})},children:[`Return to `,i]})})]})]})}function Fe(e=!0,t){let n=Ne(t,e),r=t??n?.id,{data:i,isError:o,isFetching:s,dataUpdatedAt:c,errorUpdatedAt:l}=a({...ne({path:{assistant_id:r??``}}),enabled:e&&!!r});return{assistant:n,assistantId:r,domains:i,domainsError:o,domainsFetching:s,domainsUpdatedAt:c,domainsErrorUpdatedAt:l}}var Ie=1e3,Le=1e4,Re=2500,ze=2e3,Be=[`machine_size`,`subdomain`,`non_field_errors`],Ve={subdomain_taken:`That subdomain is already taken. Try another.`,assistant_already_has_domain:`Your assistant already has a custom domain.`,no_assistant_to_attach_domain:`We couldn't find an assistant to attach this domain to.`,exceeds_machine_tier:`That machine size isn't available on your plan.`,provisioning_submission_failed:`We couldn't queue your upgrade just now. Try again in a moment.`,no_active_pro:`We couldn't confirm your Pro plan yet. Try again in a moment.`};function He(e,t){if(e&&typeof e==`object`){let t=e;if(typeof t.error==`string`){let e=Ve[t.error];if(e)return e}for(let e of Be){let n=t[e];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(typeof t.detail==`string`)return t.detail}return t}var Ue=`h-8 rounded-lg border border-[var(--border-element)] bg-[var(--field-bg)] px-2.5 text-[14px] text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-[border-color] duration-150 focus:border-[var(--border-active)] disabled:cursor-not-allowed disabled:opacity-60`,We=`text-[11px] font-medium text-[var(--content-secondary)]`;function Ge({onExit:e,machineBusy:t=!1,assistantId:r}){let a=i(),s=ve.use.emailRootDomain(),{assistant:c,assistantId:l,domains:u}=Fe(!0,r),d=u?.results[0],[f,p]=(0,J.useState)(``),[m,h]=(0,J.useState)(`hi`),[g,_]=(0,J.useState)(!1);(0,J.useEffect)(()=>{if(!g){if(d){p(d.subdomain),_(!0);return}!c?.handle||f||(p(c.handle),_(!0))}},[c?.handle,d,g,f]);let[v,y]=(0,J.useState)(null),[S,C]=(0,J.useState)(!1),w=o(I()),T=!!d||S,E=w.isPending||S;return(0,J.useEffect)(()=>{if(!S)return;let t=setTimeout(e,800);return()=>clearTimeout(t)},[S,e]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(x.Body,{className:`animate-[onboarding-step-in_350ms_ease-out] space-y-6 pb-0 motion-reduce:animate-none`,children:[(0,X.jsx)(Me,{variant:`top`}),(0,X.jsx)(ke,{title:`Assistant Email`,subtitle:`Set up an email for your assistant.`}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`label`,{htmlFor:`onboarding-email-prefix`,className:We,children:`Prefix`}),(0,X.jsx)(`input`,{id:`onboarding-email-prefix`,value:m,onChange:e=>h(e.target.value.toLowerCase().trim()),disabled:E||T,readOnly:T,placeholder:`hi`,className:`${Ue} w-24`})]}),(0,X.jsx)(`span`,{className:`flex h-8 items-center text-[var(--content-secondary)]`,children:`@`}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,X.jsx)(`label`,{htmlFor:`onboarding-email-handle`,className:We,children:`Handle (public)`}),(0,X.jsx)(`input`,{id:`onboarding-email-handle`,value:f,onChange:e=>{p(e.target.value.toLowerCase().trim()),v&&y(null)},disabled:E||T,readOnly:T,autoFocus:!0,placeholder:`my-assistant`,"aria-invalid":!!v,className:`${Ue} w-full min-w-0`})]}),(0,X.jsxs)(`span`,{className:`flex h-8 shrink-0 items-center text-[14px] text-[var(--content-tertiary)]`,children:[`.`,s]})]}),v&&(0,X.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:v}),T&&(0,X.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`This domain has been set and cannot be changed.`})]}),t&&!T&&(0,X.jsx)(b,{tone:`neutral`,children:`Your assistant is restarting — you can set the domain in a moment.`}),!T&&(0,X.jsx)(b,{tone:`info`,className:`border-transparent bg-[var(--surface-active)]`,children:(0,X.jsx)(`span`,{className:`font-medium text-[var(--content-tertiary)]`,children:`You won't be able to change the handle once set.`})}),S?(0,X.jsx)(b,{tone:`success`,children:`Domain set — redirecting…`}):null]}),(0,X.jsx)(x.Footer,{className:`items-center pt-6`,children:T?(0,X.jsx)(n,{variant:`primary`,"data-testid":`onboarding-domain-continue`,onClick:e,children:`Continue`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(n,{variant:`outlined`,"data-testid":`onboarding-domain-skip`,disabled:E,onClick:()=>{E||w.mutate({body:{skipped:!0}},{onSuccess:e,onError:()=>e()})},children:`Skip`}),(0,X.jsx)(n,{variant:`primary`,"data-testid":`onboarding-domain-set`,disabled:!f||E||t,onClick:()=>{E||t||!f||w.mutate({body:{subdomain:f,...m?{email_username:m}:{}}},{onSuccess:()=>{y(null),C(!0),a.invalidateQueries({queryKey:H()}),a.invalidateQueries({queryKey:z({path:{assistant_id:l??``}})}),a.invalidateQueries({queryKey:L()})},onError:e=>{y(He(e,`Couldn't register that subdomain. Try a different one.`))}})},children:`Next`})]})})]})}function Ke({onGoToBilling:e}){return(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-6 py-10 text-center`,children:[(0,X.jsx)(De,{icon:f}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(c,{variant:`title-small`,as:`h1`,children:`Couldn't reach billing`}),(0,X.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:`We hit a problem checking your subscription. Your upgrade may still be processing — return to billing to refresh.`})]}),(0,X.jsx)(n,{variant:`primary`,"data-testid":`onboarding-go-to-billing`,onClick:e,children:`Go to billing`})]})}function qe(e){let{targets:t,fromSnapshot:n,credits:r}=e,i=[];return t.machineSize!=null&&i.push({key:`machine`,label:`Machine`,from:n.machineSize!=null&&n.machineSize!==t.machineSize?K[n.machineSize]:void 0,to:K[t.machineSize]}),t.storageGib!=null&&i.push({key:`storage`,label:`Storage`,from:n.storageGib!=null&&n.storageGib!==t.storageGib?`${n.storageGib} GB`:void 0,to:`${t.storageGib} GB`}),r!=null&&i.push({key:`credits`,label:`Credits`,from:r.from,to:r.to}),i}var Je=60,Ye=Je*2;function Xe({imageUrl:e,animateIn:t=!0}){return(0,X.jsxs)(`div`,{"aria-hidden":!0,"data-testid":`takeover-backdrop`,className:`pointer-events-none absolute inset-0 overflow-hidden${t?` provision-avatar-reveal`:``}`,children:[(0,X.jsx)(`img`,{src:e,alt:``,decoding:`async`,draggable:!1,className:`absolute left-1/2 top-1/2 max-w-none -translate-x-1/2 -translate-y-1/2 object-cover object-center`,style:{filter:`blur(${Je}px)`,width:`calc(100% + ${Ye*2}px)`,height:`calc(100% + ${Ye*2}px)`}}),(0,X.jsx)(`div`,{className:`absolute inset-0 bg-black/55`})]})}function Ze(e,t){if(t!=null)return e?.credit_tiers?.find(e=>e.tier===t)}function Qe(e,t){let n=e?.find(e=>e.id===`pro`);return Ze(n,t)?.label??null}function $e(e){let t=j(),{data:n}=a({...P(),enabled:t&&e!=null});if(e==null)return null;let r=n?.plans.find(e=>e.id===`pro`);if(r==null)return null;if(e.kind===`package`){let t=r.packages.find(t=>t.key===e.packageKey);return Ze(r,t?.credit_tier)?.label??(t?.credits_usd==null?null:`${t.credits_usd} credits`)}return Qe(n?.plans,e.creditTier)}function et(e){let t=j(),{data:n}=a({...P(),enabled:t&&e!=null});return Qe(n?.plans,e)}function tt(e){let t=E.use.activeAssistantId(),n=e===void 0?t:e,{components:r,traits:i,customImageUrl:a,isLoading:o}=N(n),s=n!=null&&!o,c=U(r,i)??(a?null:(r??de).colors?.[0]?.hex??null);return{tintHex:s&&c?me(c):he,backdropImageUrl:s?a:null,ready:s,avatar:{components:r,traits:i,customImageUrl:a}}}function nt(e,t){let{intervalMs:n,enabled:r}=t,[i,a]=(0,J.useState)(0);return(0,J.useEffect)(()=>{if(!r||e<=1){a(0);return}let t=setInterval(()=>{a(t=>(t+1)%e)},n);return()=>{clearInterval(t),a(0)}},[e,n,r]),!r||e<=1?0:Math.min(i,e-1)}function rt(e,t){let[n,r]=(0,J.useState)(e),i=(0,J.useRef)(0);return(0,J.useEffect)(()=>{i.current=performance.now()},[]),(0,J.useEffect)(()=>{if(t<=0||e===n)return;let a=t-(performance.now()-i.current);if(a<=0){i.current=performance.now(),r(e);return}let o=setTimeout(()=>{i.current=performance.now(),r(e)},a);return()=>clearTimeout(o)},[e,n,t]),t<=0?e:n}var it=`--takeover-surface`,at=`var(${it},${he})`,ot=`color-mix(in srgb, var(--content-emphasised) 10%, transparent)`,st=2,ct=2500,lt=240,ut=1.414,dt=[{minHeight:680,size:lt},{minHeight:600,size:184}],ft=132;function pt(e){for(let t of dt)if(e>=t.minHeight)return t.size;return ft}function mt(){let[e,t]=(0,J.useState)(()=>pt(typeof window>`u`?1/0:window.innerHeight));return(0,J.useEffect)(()=>{let e=()=>t(pt(window.innerHeight));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var ht={machine:h,storage:_,credits:m},gt={idle:``,working:` is-working`,settling:` is-settling`,stalled:` is-stalled`,grown:` is-evolved`};function _t(e,t){return e===`DONE`||e===`NOT_APPLICABLE`?`grown`:e===`STALLED`?`stalled`:e===`WAITING`||e===`RESIZING`?t?`settling`:`working`:`idle`}function vt({assistantId:e,mode:t}){let{avatar:n,ready:r}=tt(e),i=_e(),a=mt(),o=t===`working`||t===`settling`;return(0,X.jsxs)(`div`,{"aria-hidden":!0,className:`provision-avatar-evolve relative z-10 flex flex-col items-center${gt[r?t:`idle`]}`,style:{"--provision-avatar-size":`${a}px`,"--provision-avatar-growth":ut},children:[(0,X.jsx)(`div`,{className:`provision-avatar-stage`,children:(0,X.jsx)(`div`,{className:`provision-avatar-layer`,children:(0,X.jsx)(`div`,{className:`provision-avatar-current`,children:(0,X.jsx)(`div`,{className:`provision-avatar-strain`,children:r&&(0,X.jsx)(`div`,{className:`provision-avatar-reveal`,children:(0,X.jsx)(ge,{components:n.components??i,traits:n.traits,customImageUrl:n.customImageUrl,size:a,isAssistantBusy:o})})})})})}),(0,X.jsx)(`div`,{className:`provision-avatar-shadow`})]})}function Z({status:e,caption:t}){return(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,X.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:Oe,children:e}),t&&(0,X.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`max-w-sm text-[var(--content-secondary)]`,children:t})]})}function Q({icon:e,label:t,from:n,to:r,done:i=!1}){return(0,X.jsxs)(`div`,{className:`flex flex-1 items-center gap-2 rounded-lg px-2 py-1.5`,style:{backgroundColor:ot},children:[(0,X.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center`,children:(0,X.jsx)(e,{className:`h-3.5 w-3.5 text-[var(--content-tertiary)]`,"aria-hidden":`true`})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1 text-left`,children:[(0,X.jsx)(`span`,{className:`text-[12px] font-medium leading-tight text-[var(--content-tertiary)]`,children:t}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[14px] font-medium leading-[18px] text-[var(--content-emphasised)]`,children:[n&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:n}),(0,X.jsx)(u,{className:`h-3 w-3 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":`true`})]}),(0,X.jsx)(`span`,{children:r}),i&&(0,X.jsx)(d,{className:`h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`,"aria-hidden":`true`})]})]})]})}function yt({label:e}){return(0,X.jsx)(`span`,{className:`rounded-lg px-3 py-2 text-[14px] text-[var(--content-emphasised)]`,style:{backgroundColor:ot},children:e})}function bt({children:e}){return(0,X.jsx)(`div`,{className:`flex w-full max-w-sm flex-wrap items-stretch justify-center gap-2`,children:e})}function xt({intent:e,targets:t,fromSnapshot:n}){let r=$e(e),i=pe(),a=qe({targets:t,fromSnapshot:n,credits:r?{from:`0`,to:r}:null}),o=a.length>st&&!i,s=nt(a.length,{intervalMs:ct,enabled:o});if(a.length===0)return null;if(o){let e=a[s];return(0,X.jsx)(bt,{children:(0,X.jsx)(W,{mode:`popLayout`,initial:!1,children:(0,X.jsx)(fe.div,{className:`flex flex-1`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:(0,X.jsx)(Q,{icon:ht[e.key],label:e.label,from:e.from,to:e.to,done:!1})},e.key)})})}return(0,X.jsx)(bt,{children:a.map(e=>(0,X.jsx)(Q,{icon:ht[e.key],label:e.label,from:e.from,to:e.to,done:!1},e.key))})}function St({intent:e}){return e.kind===`package`?(0,X.jsx)(bt,{children:(0,X.jsx)(yt,{label:`${e.packageKey.charAt(0).toUpperCase()+e.packageKey.slice(1)} package`})}):(0,X.jsxs)(bt,{children:[e.machineTier!=null&&(0,X.jsx)(Q,{icon:h,label:`Machine`,to:xe[e.machineTier]??e.machineTier}),e.storageTier!=null&&(0,X.jsx)(Q,{icon:_,label:`Storage`,to:e.storageTier.toUpperCase()}),e.creditTier!=null&&(0,X.jsx)(yt,{label:`${e.creditTier.replace(`credits_`,``)} credits`})]})}function Ct({targets:e,fromSnapshot:t,done:n=!1}){return(0,X.jsx)(bt,{children:qe({targets:e,fromSnapshot:t,credits:null}).map(e=>(0,X.jsx)(Q,{icon:ht[e.key],label:e.label,from:n?void 0:e.from,to:e.to,done:n},e.key))})}function wt({state:e,softWaiting:t,intent:r,resizeCredits:i,targets:a,fromSnapshot:o,celebrating:s,onCelebrationEnd:c,assistantId:l,escapeAvailable:u,onEscape:d,onPhaseChange:f,kickError:p,confirm:m,dwellMs:h=Re,phaseMinMs:g=900}){let _=i!==void 0,v=et(i??null),y=(0,J.useRef)(c);(0,J.useEffect)(()=>{y.current=c},[c]);let b=rt(e,g),x=b===`DONE`||b===`NOT_APPLICABLE`,S=b===`RESIZING`?`WAITING`:b,C=(0,J.useRef)(f);(0,J.useEffect)(()=>{C.current=f},[f]),(0,J.useEffect)(()=>{C.current?.(b)},[b]);let{tintHex:w,backdropImageUrl:T}=tt(l),E=s&&x;return(0,J.useEffect)(()=>{if(!E)return;let e=setTimeout(()=>y.current(),h);return()=>clearTimeout(e)},[E,h]),(0,X.jsxs)(`div`,{"data-theme":`dark`,className:`provision-surface-settle relative flex h-full min-h-[420px] w-full flex-col items-center [justify-content:safe_center] gap-10 px-6 py-10 text-center`,style:{[it]:w,backgroundColor:at},children:[T&&(0,X.jsx)(Xe,{imageUrl:T}),(0,X.jsx)(vt,{assistantId:l,mode:_t(b,t)}),(0,X.jsx)(`div`,{className:`relative z-10 flex min-h-[144px] w-full flex-col items-center gap-8 [animation:onboarding-step-in_420ms_ease-out] motion-reduce:[animation:none]`,children:k()},S)]});function D(e=`Continue in the background`){return u?(0,X.jsx)(n,{variant:`ghost`,"data-testid":`provisioning-escape`,onClick:d,children:e}):null}function O(){return _?(0,X.jsx)(bt,{children:v==null?(0,X.jsx)(yt,{label:`Credits updated`}):(0,X.jsx)(Q,{icon:ht.credits,label:`Credits`,to:v,done:!0})}):null}function k(){if(b===`CONFIRMING`)return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{status:`Confirming your upgrade…`,caption:`This might take a couple seconds.`}),r&&(0,X.jsx)(St,{intent:r}),D()]});if(b===`WAITING`||b===`RESIZING`)return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{status:`Upgrading your assistant…`,caption:t?`Still working — this can take a minute or two.`:`This might take a couple seconds.`}),(0,X.jsx)(xt,{intent:r,targets:a,fromSnapshot:o}),D()]});if(b===`DONE`)return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{status:`All done!`}),(0,X.jsx)(Ct,{targets:a,fromSnapshot:o,done:!0}),O()]});if(b===`NOT_APPLICABLE`)return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{status:`Your plan is ready`}),O()]});if(b===`STALLED`){let e=p!=null;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{status:e?`We hit a snag upgrading your assistant`:`This is taking longer than expected`,caption:e?He(p,`Retry in the background — we'll keep working on your upgrade.`):`This may take a couple of minutes.`}),(0,X.jsx)(xt,{intent:r,targets:a,fromSnapshot:o}),e?D(`Retry in the background`):D()]})}return b===`CONFIRM_TIMEOUT`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{status:`Still confirming your upgrade`,caption:`Your payment went through safely — this can take a minute.`}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,X.jsx)(n,{variant:`outlined`,"data-testid":`onboarding-go-to-billing`,onClick:m.onGoToBilling,children:`Go to billing`}),(0,X.jsx)(n,{variant:`primary`,"data-testid":`onboarding-retry`,onClick:m.onRetry,children:`Try again`})]})]}):null}}function Tt(e,t){if(!e)return!1;let n=e.machineSize==null||t?.machineSize!=null&&ye(t.machineSize)>=ye(e.machineSize),r=e.storageGib==null||t?.storageGib!=null&&t.storageGib>=e.storageGib;return n&&r}function Et(e){let{planId:t,targets:n,actuals:r,initialActuals:i,resizeOperationInFlight:a,sawOperation:o,msSinceWatchStart:s,confirmExpired:c,serverVerdict:l=null,statusObservedSinceTargetsMet:u=!0}=e;if(t!==`pro`)return{state:c?`CONFIRM_TIMEOUT`:`CONFIRMING`,softWaiting:!1};let d=o||a,f=l===`started`||l===`in_progress`,p=o||u;if(!a){let e=f?p:d||l===`already_done`||i!=null&&!Tt(n,i);if(Tt(n,r)){if(e)return{state:`DONE`,softWaiting:!1};if(!f)return{state:`NOT_APPLICABLE`,softWaiting:!1}}else{if(l===`already_done`)return{state:`DONE`,softWaiting:!1};if(l===`not_applicable`)return{state:`NOT_APPLICABLE`,softWaiting:!1}}}return s!=null&&s>=9e4?{state:`STALLED`,softWaiting:!1}:d||l===`started`||l===`in_progress`?{state:`RESIZING`,softWaiting:!1}:{state:`WAITING`,softWaiting:s!=null&&s>=3e4}}var Dt=2e3,Ot=1e3,kt=[`DONE`,`NOT_APPLICABLE`,`CONFIRM_TIMEOUT`];function At(e){if(!e)return!1;if(e.state===`resizing_machine`||e.state===`resizing_storage`)return!0;let t=e.active_operation?.operation;return typeof t==`string`&&t.startsWith(`resize`)}function jt({open:e}){let t=i(),n=j(),[r,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(0),[u,d]=(0,J.useState)(null),[f,p]=(0,J.useState)(null),[m,h]=(0,J.useState)(null),[g,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(null),[S,C]=(0,J.useState)(null),[w,T]=(0,J.useState)(!1),E=(0,J.useRef)(!1),O=(0,J.useRef)(!1),k=(0,J.useRef)(0),[A,ee]=(0,J.useState)(!1),[M,N]=(0,J.useState)(null),[P,I]=(0,J.useState)(null),[ne,R]=(0,J.useState)(()=>Date.now()),[re,ie]=(0,J.useState)(!0);(0,J.useEffect)(()=>{e||(s(!1),l(0),d(null),p(null),h(null),ee(!1),N(null),I(null),ie(!0),_(null),y(null),x(null),C(null),T(!1),E.current=!1,O.current=!1,k.current+=1)},[e]),(0,J.useEffect)(()=>{e&&(d(Date.now()),t.invalidateQueries({queryKey:V()}),t.invalidateQueries({queryKey:L()}))},[e,t]);let z=f!=null,B=a({...ae(),refetchInterval:e=>e.state.data?.plan_id===`pro`||r?!1:Ie,refetchIntervalInBackground:!1,enabled:e&&n&&!z}),ce=(u!=null&&B.dataUpdatedAt>=u?B.data?.plan_id:null)??null;(0,J.useEffect)(()=>{if(!e||z||ce!==`pro`)return;let t=Date.now();p(t),R(t)},[e,z,ce]),(0,J.useEffect)(()=>{if(!e||z)return;let t=setTimeout(()=>s(!0),Le);return()=>clearTimeout(t)},[e,z,c]);let ue=(0,J.useCallback)(()=>{s(!1),l(e=>e+1),D.getState().fetchOrganizations(),t.invalidateQueries({queryKey:V()})},[t]),H=(0,J.useCallback)(()=>{let e=Date.now();h(e),R(e)},[]),{mutate:de}=o(oe()),U=(0,J.useCallback)(e=>{let t=k.current;de({},{onSuccess:n=>{t===k.current&&(C(null),n.state===`not_applicable`&&n.reason===`no_active_pro`?O.current?C({error:`no_active_pro`}):(O.current=!0,T(!0),e===`escape`&&H()):(_(n.state),e===`escape`&&H()))},onError:e=>{t===k.current&&C(e)}})},[de,H]);(0,J.useEffect)(()=>{!e||!n||!z||E.current||(E.current=!0,U(`auto`))},[e,n,z,U]),(0,J.useEffect)(()=>{if(!w)return;let e=k.current,t=setTimeout(()=>{T(!1),e===k.current&&U(`auto`)},ze);return()=>clearTimeout(t)},[w,U]);let fe=(0,J.useCallback)(()=>U(`escape`),[U]),W=a({...le(),enabled:e&&n&&z}),pe=re?Dt:!1,me=a({...se(),enabled:e&&n&&z,refetchInterval:e=>e.state.data?.id==null?pe:!1,retry:!1}),he=z&&u!=null&&W.dataUpdatedAt>=u,ge=he&&!W.isPending&&!W.isFetching,G=(he?W.data?.primary_assistant_id:null)??(W.isPending?null:me.data?.id??null),_e=a({...F({path:{id:G??`unresolved`}}),enabled:e&&n&&z&&G!=null,refetchInterval:pe,retry:!1}),ve=a({...te({path:{id:G??`unresolved`}}),enabled:e&&n&&z&&G!=null,refetchInterval:pe,retry:!1}),ye=At(ve.data);(0,J.useEffect)(()=>{ye&&ee(!0)},[ye]);let K=W.data,xe=(0,J.useMemo)(()=>K?{machineSize:be(K.max_machine_tier).at(-1)??null,storageGib:K.selected_storage_gib??null}:null,[K]),q=_e.data,Y=(0,J.useMemo)(()=>q?{machineSize:q.machine_size??null,storageGib:q.provisioned_storage_gib??null}:null,[q]),Se=P===G,Ce=Tt(xe,Y),we=b===G;(0,J.useEffect)(()=>{e&&(Ce?(y(e=>e!=null&&we?e:Date.now()),x(G)):(y(null),x(null)))},[e,Ce,G,we]),(0,J.useEffect)(()=>{!e||!Y||M!=null&&Se||(N(Y),I(G))},[e,Y,G,M,Se]);let Te=m??f,Ee=Te==null?null:Math.max(0,ne-Te),{state:X,softWaiting:De}=Et({planId:z?`pro`:ce,targets:xe,actuals:Y,initialActuals:Se?M:null,resizeOperationInFlight:ye,sawOperation:A,msSinceWatchStart:Ee,confirmExpired:r,serverVerdict:g,statusObservedSinceTargetsMet:v!=null&&we&&ve.dataUpdatedAt>v}),Oe=kt.includes(X),ke=e&&z&&!Oe;return(0,J.useEffect)(()=>{ie(ke)},[ke]),(0,J.useEffect)(()=>{if(!e||!z||Oe)return;let t=setInterval(()=>R(Date.now()),Ot);return()=>clearInterval(t)},[e,z,Oe]),{state:X,softWaiting:De,targets:xe,actualsSnapshot:M,assistantId:G,domainSetupAvailable:K?.domain_setup_available,onboardingSettled:ge,confirmError:!z&&B.isError,targetsError:z&&W.isError&&(!K||!he),escapeEligible:Ee!=null&&Ee>=6e4,retryConfirm:ue,kickProvisioning:fe,kickError:S}}var Mt=200,Nt=380;function Pt(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}var Ft=e=>e===`WAITING`||e===`RESIZING`||e===`STALLED`,It=e=>e===`DONE`||e===`NOT_APPLICABLE`,Lt={machineSize:null,storageGib:null};function Rt({open:e,onClose:t,dwellMs:n,phaseMinMs:r,mode:a=`checkout`,resizeCredits:o}){let s=a===`resize`,c=i(),[l,u]=(0,J.useState)(`provisioning`),[d,f]=(0,J.useState)(`idle`),p=(0,J.useRef)([]),[m,h]=(0,J.useState)(null),[g,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(null),[b,w]=(0,J.useState)(!1),T=jt({open:e});(0,J.useEffect)(()=>{if(e){h(s?null:we()),y(e=>e??Date.now());return}p.current.forEach(clearTimeout),p.current=[],u(`provisioning`),f(`idle`),_(null),y(null),w(!1)},[e,s]),(0,J.useEffect)(()=>()=>{p.current.forEach(clearTimeout)},[]),(0,J.useEffect)(()=>{l===`complete`&&Te()},[l]);let E=Ft(T.state),D=It(g??T.state),{targets:O,assistantId:k,domainSetupAvailable:A,onboardingSettled:j}=T,{tintHex:ee,backdropImageUrl:M}=tt(k),N=s&&A===!0,{domains:P,domainsError:te,domainsFetching:F,domainsUpdatedAt:I,domainsErrorUpdatedAt:ne}=Fe(e&&N,k),L=(P?.results.length??0)>0,R=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(!e){R.current=null;return}!N||k==null||R.current!==k&&(R.current=k,c.invalidateQueries({queryKey:z({path:{assistant_id:k}})}))},[e,N,k,c]);let re=!F&&(v!=null&&I>=v||v!=null&&!!te&&ne>=v),[ie,ae]=(0,J.useState)(!1),B=j&&(!N||re);(0,J.useEffect)(()=>{if(!e){ae(!1);return}B&&ae(!0)},[e,B]);let oe=(0,J.useCallback)(()=>{let e=s?A===!0&&!L?`domain`:`complete`:A===!1?`complete`:`domain`;if(Pt()){u(e);return}f(`covering`),p.current.push(setTimeout(()=>{u(e),f(`revealing`),p.current.push(setTimeout(()=>f(`idle`),Nt))},Mt))},[A,s,L]),se=(0,J.useCallback)(()=>{w(!0)},[]),ce=(0,J.useCallback)(()=>{T.kickProvisioning(),S.info(T.kickError==null?`Your upgrade continues in the background.`:`We'll retry your upgrade in the background.`),w(!1),t()},[T,t]),le=(0,J.useCallback)(()=>{w(!1)},[]),ue=l===`provisioning`&&(T.confirmError||T.targetsError),V=l===`provisioning`&&!ue,H=V&&!D,de=`transition-[background-color] duration-300 ease-out${V?` bg-black p-0`:``}`,U=V?`[animation:fadeIn_0.45s_ease-out_both]`:d===`revealing`?`[animation:fadeInUp_0.42s_ease-out_0.12s_both]`:`[animation:fadeIn_0.25s_ease-out_both]`;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(x.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,X.jsxs)(x.Content,{size:`md`,hideCloseButton:l!==`complete`,dismissOnOverlayClick:!H,onEscapeKeyDown:H?e=>e.preventDefault():void 0,onInteractOutside:H?e=>e.preventDefault():void 0,"data-theme":V?`dark`:void 0,overlayClassName:de,className:V?`overflow-y-auto inset-0 max-w-none w-screen h-screen max-h-none rounded-none border-0`:`overflow-hidden`,style:{[it]:ee},children:[(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col motion-reduce:[animation:none] ${U}`,children:fe()},l),d!==`idle`&&(0,X.jsx)(`div`,{"aria-hidden":!0,"data-testid":`takeover-exit-sheet`,className:`pointer-events-none fixed inset-0 z-50 ${d===`covering`?`[animation:fadeIn_200ms_ease-in_both]`:`[animation:fadeIn_380ms_ease-out_both_reverse]`}`,style:{backgroundColor:at},children:M&&(0,X.jsx)(Xe,{imageUrl:M,animateIn:!1})})]})}),(0,X.jsx)(C,{open:b&&E,title:`Continue in the background?`,message:`Your assistant is still upgrading. Chatting won't be available until it finishes — you can keep waiting here, or continue and we'll let you know when it's ready.`,confirmLabel:`Continue`,cancelLabel:`Keep waiting`,onConfirm:ce,onCancel:le})]});function fe(){return l===`provisioning`?T.confirmError||T.targetsError?(0,X.jsx)(Ke,{onGoToBilling:t}):(0,X.jsx)(wt,{state:T.state,softWaiting:T.softWaiting,intent:m,resizeCredits:s?o:void 0,targets:O??Lt,fromSnapshot:T.actualsSnapshot??Lt,celebrating:ie,onCelebrationEnd:oe,assistantId:k,escapeAvailable:E&&T.escapeEligible,onEscape:se,onPhaseChange:_,kickError:T.kickError,confirm:{onRetry:T.retryConfirm,onGoToBilling:t},dwellMs:n,phaseMinMs:r}):l===`domain`?(0,X.jsx)(Ge,{machineBusy:E,assistantId:k,onExit:()=>u(`complete`)}):(0,X.jsx)(Pe,{assistantId:k})}}function zt(e){return e!=null&&!e.customized}function Bt(e){return zt(e)?e.name:`Custom`}var Vt=[`mighty`,`super`,`ultra`],Ht=[`free`,...Vt];function Ut(e){return Ht.indexOf(e)}function Wt(e,t){if(e===null)return`upgrade`;let n=Ut(e),r=Ut(t);return n===-1||r===-1?`upgrade`:r===n?`current`:r<n?`downgrade`:`upgrade`}function Gt(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>Vt.indexOf(e.key)-Vt.indexOf(t.key));if(!t)return n[0];let r=n.findIndex(e=>e.key===t);return r===-1?n[0]:r>=n.length-1?null:n[r+1]}var Kt=`billing-portal-return-snapshot`;function qt(e){try{sessionStorage.removeItem(Kt),sessionStorage.setItem(Kt,JSON.stringify(e))}catch{}}function Jt(){if(typeof sessionStorage>`u`)return null;try{let e=sessionStorage.getItem(Kt);if(!e)return null;let t=JSON.parse(e);return typeof t.cancel_at_period_end!=`boolean`||typeof t.plan_id!=`string`?null:{cancel_at_period_end:t.cancel_at_period_end,cancel_at:t.cancel_at??null,plan_id:t.plan_id}}catch{return null}}function Yt(){try{sessionStorage.removeItem(Kt)}catch{}}function Xt(e){return e?{cancel_at_period_end:e.cancel_at_period_end,cancel_at:e.cancel_at??null,plan_id:e.plan_id}:null}function Zt(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function Qt(e){return e?e.cancel_at??e.current_period_end??null:null}function $t(e){let t=i();return(0,J.useEffect)(()=>M(()=>{t.invalidateQueries(ae())}),[t]),ie({onSuccess:t=>{e&&qt(e),ee(t.portal_url)},onError:()=>{S.error(`Couldn't open the billing portal. Please try again.`,{id:`billing-portal-session-error`})}})}function en(){return T()||k.isNativePlatform()?`native`:`web`}function tn(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function $(e){return`${tn(e)}/mo`}function nn(e){return`${e>0?`+`:`−`}${tn(Math.abs(e))}/mo`}function rn(e){return e.disabled===!0}function an({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:r,onMachineTierChange:i,onStorageTierChange:a,currentMachinePriceCents:o,currentStoragePriceCents:s}){let l=(0,J.useMemo)(()=>e.map(e=>{let t=xe[e.tier]??e.label,n=o==null?`+${$(e.price_cents)}`:e.price_cents===o?`(${$(e.price_cents)}, current)`:nn(e.price_cents-o);return{value:e.tier,label:`${t} ${n}`,disabled:rn(e)}}),[e,o]),u=(0,J.useMemo)(()=>t.map(e=>{let t=s==null?`+${$(e.price_cents)}`:e.price_cents===s?`(${$(e.price_cents)}, current)`:nn(e.price_cents-s);return{value:e.tier,label:`${e.storage_gib} GB ${t}`,disabled:rn(e)}}),[t,s]);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(c,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Machine`}),(0,X.jsx)(`span`,{title:`Determines the CPU and memory allocated to your assistant`,children:(0,X.jsx)(v,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,X.jsx)(w,{"aria-label":`Machine tier`,placeholder:`Select a machine tier`,value:n??``,onChange:i,options:l})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(c,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Storage`}),(0,X.jsx)(`span`,{title:`Persistent disk space for your assistant's files and data`,children:(0,X.jsx)(v,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,X.jsx)(w,{"aria-label":`Storage tier`,placeholder:`Select a storage tier`,value:r??``,onChange:a,options:u})]})]})}var on=new Set([`active`,`trialing`,`past_due`]);function sn(e){return e.plan_id!==`base`&&e.cancel_at_period_end!==!0&&!e.cancel_at&&e.status!=null&&on.has(e.status)}var cn=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`package`,`non_field_errors`];function ln(e,t){if(e&&typeof e==`object`){for(let t of cn)if(t in e){let n=e[t];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(`detail`in e&&typeof e.detail==`string`)return e.detail}return t}function un(e,t){let n=e.filter(e=>!rn(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function dn(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function fn(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}function pn(){let e=i(),t=o(ce());return{changePackage:async n=>{try{let r=await t.mutateAsync({body:{package:n}});return await Promise.all([e.invalidateQueries({queryKey:V()}),e.invalidateQueries({queryKey:R()}),e.invalidateQueries({queryKey:L()})]),r}catch(e){return S.error(ln(e,`Failed to change your plan. Please try again.`)),null}},isPending:t.isPending}}function mn({enabled:e=!0}={}){let t=i(),n=j(),r=e&&n,s=a({...ae(),enabled:r}).data,c=s!=null&&s.plan_id!==`base`,l=a({...le(),enabled:r&&c}),u=a({...P(),enabled:r&&c}).data?.plans.find(e=>e.id===`pro`)?.machine_tiers??[],d=e=>u.find(t=>t.tier===e)?.price_cents??null,f=o(B()),p=o(re()),m=o(ue()),h={machineTier:l.data?.max_machine_tier??null,storageTier:l.data?.selected_storage_tier??null,storageGib:l.data?.selected_storage_gib??null,creditTier:s?.selected_credit_tier??null},g=s!=null&&s.plan_id!==`base`&&s.status!=null&&on.has(s.status)&&s.cancel_at_period_end!==!0&&!s.cancel_at,_=!c||!l.isPending,v=f.isPending||p.isPending||m.isPending,y=()=>Promise.all([t.invalidateQueries({queryKey:V()}),t.invalidateQueries({queryKey:L()}),t.invalidateQueries({queryKey:R()})]);return{changeTiers:async e=>{let t=e.machineTier!==h.machineTier,n=e.storageTier!==h.storageTier,r=e.creditTier!==h.creditTier,i=d(e.machineTier),a=d(h.machineTier),o=t&&i!=null&&a!=null&&i<a,s=[];if(t&&s.push(new Promise(t=>{f.mutate({body:{machine_tier:e.machineTier}},{onSuccess:()=>t({dimension:`machine`,ok:!0}),onError:e=>t({dimension:`machine`,ok:!1,error:e})})})),n&&s.push(new Promise(t=>{p.mutate({body:{storage_tier:e.storageTier}},{onSuccess:()=>t({dimension:`storage`,ok:!0}),onError:e=>t({dimension:`storage`,ok:!1,error:e})})})),r&&s.push(new Promise(t=>{m.mutate({body:{credit_tier:e.creditTier}},{onSuccess:()=>t({dimension:`credit`,ok:!0}),onError:e=>t({dimension:`credit`,ok:!1,error:e})})})),s.length===0)return{needsResize:!1,creditChanged:!1};let c=await Promise.all(s);await y();let l=c.some(e=>e.ok&&e.dimension===`machine`)&&!o,u=c.some(e=>e.ok&&e.dimension===`storage`),g=l||u,_=c.some(e=>e.ok&&e.dimension===`credit`),v=c.filter(e=>!e.ok);if(v.length>0){let e=v.map(e=>ln(e.error,`Failed to update ${e.dimension} tier.`)).join(` `);return S.error(e),g||_?{needsResize:g,creditChanged:_}:null}return{needsResize:g,creditChanged:_}},isPending:v,current:h,eligible:g,currentReady:_}}var hn=`__none__`,gn=`No extra credits`;function _n(e){return`${e.storage_gib} GB storage`}function vn(e){return`${tn(e.credits_usd*100)} of bundled credits`}function yn(e){let{proPlan:t,seed:n,machineTier:r,storageTier:i,creditChoice:a}=e,o=t.machine_tiers,s=t.storage_tiers,c=t.credit_tiers??[],l=o.find(e=>e.tier===r)??null,u=s.find(e=>e.tier===i)??null,d=a&&a!==`__none__`?c.find(e=>e.tier===a)??null:null,f=n==null?null:o.find(e=>e.tier===n.machineTier)??null,p=n==null?null:s.find(e=>e.tier===n.storageTier)??null,m=n!=null&&n.creditTier!=null?c.find(e=>e.tier===n.creditTier)??null:null,h=n!=null&&n.machineTier!=null&&f==null,g=n!=null&&p==null,_=[{key:`base`,label:`Pro base plan — ${$(t.base_price_cents)}`,changed:!1}];if(l!=null){let e=n!=null&&!h&&f?.tier!==l.tier;_.push({key:`machine`,label:l.description,previousLabel:e&&f!=null?f.description:void 0,changed:e})}if(u!=null){let e=n!=null&&!g&&p?.tier!==u.tier;_.push({key:`storage`,label:_n(u),previousLabel:e&&p!=null?_n(p):void 0,changed:e})}let v=a===`__none__`?gn:d==null?null:vn(d);if(v!=null){let e=n!=null&&(n.creditTier??`__none__`)!==a,t=n?.creditTier==null?gn:m==null?void 0:vn(m);_.push({key:`credit`,label:v,previousLabel:e?t:void 0,changed:e})}let y=t.base_price_cents+(l?.price_cents??0)+(u?.price_cents??0)+(d?.price_cents??0),b=h||g||n!=null&&n.creditTier!=null&&m==null;if(n==null||b)return{totalCents:y,previousTotalCents:null,deltaCents:null,rows:_};let x=t.base_price_cents+(f?.price_cents??0)+(p?.price_cents??0)+(m?.price_cents??0);return{totalCents:y,previousTotalCents:x,deltaCents:y-x,rows:_}}function bn(e){return(0,X.jsxs)(`span`,{className:`text-[12px] font-medium text-[var(--content-disabled)]`,children:[`+`,$(e)]})}function xn({open:e,proPlan:t,pending:r,currentStorageGib:i,initialSelection:a,onClose:o,onContinue:s}){let c=e?a??null:null,[l,u]=(0,J.useState)(()=>c?.machineTier??``),[d,f]=(0,J.useState)(()=>c?.storageTier??``),[h,v]=(0,J.useState)(()=>c?c.creditTier??`__none__`:``),[y,b]=(0,J.useState)({open:e,initialSelection:a});(y.open!==e||y.initialSelection!==a)&&(b({open:e,initialSelection:a}),u(c?.machineTier??``),f(c?.storageTier??``),v(c?c.creditTier??`__none__`:``));let S=t.machine_tiers,C=(0,J.useMemo)(()=>t.storage_tiers.filter(e=>!e.legacy||e.tier===a?.storageTier),[t.storage_tiers,a?.storageTier]),T=t.credit_tiers??[],E=(0,J.useMemo)(()=>(t.credit_tiers??[]).filter(e=>!e.legacy),[t.credit_tiers]),D=e=>rn(e)||e.legacy&&e.tier!==a?.storageTier||i!=null&&e.storage_gib<i,O=S.map(e=>({value:e.tier,label:e.description,icon:(0,X.jsx)(q,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:bn(e.price_cents),disabled:rn(e)})),k=C.map(e=>({value:e.tier,label:e.label,icon:(0,X.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:bn(e.price_cents),disabled:D(e)})),A=h&&h!==`__none__`?T.find(e=>e.tier===h)??null:null,j=A?.legacy?A:null,ee=[{value:hn,label:gn,icon:(0,X.jsx)(m,{className:`h-4 w-4`,"aria-hidden":!0})},...E.map(e=>({value:e.tier,label:e.label,icon:(0,X.jsx)(m,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:bn(e.price_cents)})),...j?[{value:j.tier,label:j.label,icon:(0,X.jsx)(m,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:bn(j.price_cents),disabled:!0}]:[]],M=S.find(e=>e.tier===l)??null,N=d!==``&&d===a?.storageTier,P=C.find(e=>e.tier===d&&(N||!D(e)))??null,te=h===`__none__`||h===a?.creditTier||E.some(e=>e.tier===h),F=h!==``&&te?h:null,I=M!=null&&P!=null&&F!=null,ne=a!=null&&l===(a.machineTier??``)&&d===a.storageTier&&h===(a.creditTier??`__none__`),L=(0,J.useMemo)(()=>yn({proPlan:t,seed:a??null,machineTier:l,storageTier:d,creditChoice:h}),[t,a,l,d,h]);return(0,X.jsx)(x.Root,{open:e,onOpenChange:e=>{e||o()},children:(0,X.jsx)(x.Content,{size:`lg`,"data-theme":`light`,hideCloseButton:!0,overlayClassName:`backdrop-blur-[2px]`,className:`max-w-[820px] md:min-h-[min(608px,calc(100vh-4rem))]`,children:(0,X.jsx)(x.Body,{className:`p-4`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-8 md:flex-row md:gap-12`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6 md:flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--surface-active)] p-[14px]`,children:(0,X.jsx)(g,{className:`h-6 w-6 text-[var(--content-emphasised)]`,"aria-hidden":!0})}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,X.jsx)(x.Title,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Create a custom plan`}),(0,X.jsx)(x.Description,{className:`mt-0 text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:`Just better.`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Select a machine size:`}),(0,X.jsx)(w,{"aria-label":`Machine size`,placeholder:`Select a machine size`,value:l,onChange:u,options:O})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Select storage:`}),(0,X.jsx)(w,{"aria-label":`Storage`,placeholder:`Select storage`,value:d,onChange:f,options:k})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Bundle some credits:`}),(0,X.jsx)(w,{"aria-label":`Credit bundle`,placeholder:`Select a credit bundle`,value:h,onChange:v,options:ee})]})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-16 md:pt-[5px]`,children:[(0,X.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Recap`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:$(L.totalCents)}),L.deltaCents!=null&&L.deltaCents!==0&&L.previousTotalCents!=null&&(0,X.jsxs)(`span`,{className:`text-[12px] font-medium ${L.deltaCents>0?`text-[var(--system-positive-strong)]`:`text-[var(--system-negative-strong)]`}`,children:[nn(L.deltaCents),` compared to previous (`,tn(L.previousTotalCents),`)`]}),(0,X.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Total`})]}),(0,X.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,X.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Your selection:`}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-2`,children:L.rows.map(e=>(0,X.jsxs)(`li`,{className:`flex flex-col gap-2`,children:[e.previousLabel!=null&&(0,X.jsxs)(`div`,{className:`relative flex w-fit items-start gap-2`,children:[(0,X.jsx)(p,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-disabled)]`,"aria-hidden":!0}),(0,X.jsx)(`s`,{className:`text-[14px] font-medium leading-[18px] text-[var(--content-disabled)] no-underline`,children:e.previousLabel}),(0,X.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute -left-1 right-0 top-[9px] h-px bg-[var(--content-disabled)]`})]}),(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(p,{className:`mt-0.5 h-4 w-4 shrink-0 ${e.changed?`text-[var(--system-positive-strong)]`:`text-[var(--content-secondary)]`}`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-[14px] font-medium leading-[18px] text-[var(--content-secondary)]`,children:e.label})]})]},e.key))}),(0,X.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:!I||ne||r,onClick:()=>{!I||ne||r||s({machineTier:M.tier,storageTier:P.tier,creditTier:F===`__none__`?null:F})},children:`Continue`}),(0,X.jsx)(n,{variant:`ghost`,fullWidth:!0,disabled:r,onClick:o,children:`Cancel`})]})]})]})})})})}var Sn={free:{tagline:`Get to know your assistant.`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`More capacity for consistent use.`,cta:`Power Up`,priceCaption:`Billed monthly`,recommended:!0,upgradeBlurb:`$25 in Credits, more storage and power`},super:{tagline:`Stronger performance for heavier workloads.`,cta:`Go Super`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`],upgradeBlurb:`$45 credits, 3× storage, more power, and email.`},ultra:{tagline:`Built for sustained, high-demand work.`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`],upgradeBlurb:`$115 credits, 2x storage, more power, and email.`}};function Cn(e){return Sn[e]}function wn(e){return`Downgrade to ${e}`}var Tn=`Your machine downsizes now and your storage stays. No refund — a prorated credit applies to your next invoice.`,En=`You'll be charged the prorated difference now.`,Dn=`Your plan changes now. Any prorated difference is charged now or credited to your next invoice.`;function On({open:e,relation:t,packageName:r,pending:i,onCancel:a,onConfirm:o}){let s=t===`downgrade`,l=t===`switch`,u=s?`Downgrade to ${r}?`:l?`Switch to ${r}?`:`Upgrade to ${r}?`,d=s?Tn:l?Dn:En;return(0,X.jsx)(x.Root,{open:e,onOpenChange:e=>{!e&&!i&&a()},children:(0,X.jsxs)(x.Content,{size:`md`,hideCloseButton:!0,children:[(0,X.jsx)(x.Header,{children:(0,X.jsx)(x.Title,{icon:s?y:void 0,children:u})}),(0,X.jsx)(x.Body,{children:(0,X.jsx)(c,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:d})}),(0,X.jsxs)(x.Footer,{children:[(0,X.jsx)(n,{variant:`outlined`,onClick:a,disabled:i,children:`Cancel`}),(0,X.jsx)(n,{variant:s?`danger`:`primary`,onClick:o,disabled:i,"data-testid":`confirm-package-switch-button`,children:s?wn(r):`Switch to ${r}`})]})]})})}var kn={free:{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},mighty:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`},super:{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},ultra:{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`}};function An({tier:e,size:t=40}){let n=kn[e]??kn.free,r=_e();return(0,X.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,X.jsx)(G,{components:r,bodyShapeId:n.bodyShape,colorId:n.color,size:t}):(0,X.jsx)(`div`,{style:{width:t,height:t}})})}var jn=`Small`;function Mn(e){return e?.machine_size?K[e.machine_size]??e.machine_size:jn}function Nn(e){let t=e?.credits_usd??0,n=e?.storage_gib??4;return[{icon:q,label:`${Mn(e)} Machine`},{icon:m,label:`$${t} credits`},{icon:_,label:`${n} GB`}]}function Pn(){let e=i();(0,J.useEffect)(()=>M(()=>{e.invalidateQueries({queryKey:V()}),e.invalidateQueries({queryKey:R()}),e.invalidateQueries({queryKey:L()})}),[e])}export{zt as A,Xt as C,Jt as D,Qt as E,Ze as F,Fe as I,Ce as L,Bt as M,Wt as N,$t as O,Rt as P,en as S,Zt as T,un as _,An as a,tn as b,Cn as c,pn as d,on as f,dn as g,fn as h,Nn as i,Gt as j,Vt as k,xn as l,sn as m,jn as n,On as o,ln as p,Mn as r,wn as s,Pn as t,mn as u,an as v,Yt as w,$ as x,nn as y};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./QueryClientProvider-CMu7CkQU.js";import{t as r}from"./useQuery-Bz-fbQ-m.js";import{t as i}from"./createLucideIcon-CAM1RhH8.js";import{n as a,t as o}from"./settings-CfuLzwIw.js";import{t as s}from"./chevron-left-CytMddTB.js";import{t as c}from"./chevron-right-HU6H84S0.js";import{t as l}from"./globe-CEgs-yoc.js";import{t as u}from"./layout-grid-PPpVK0nJ.js";import{t as d}from"./message-square-zCNXaHYX.js";import{t as f}from"./monitor-B5vtTCxm.js";import{t as p}from"./search-DA3TmTuR.js";import{n as m,t as h}from"./zoom-in-BBlu4Gwn.js";import{n as g,t as _}from"./create-selectors-B-P03-8K.js";import{ct as v,f as y,h as b,r as x}from"./local-mode-CTrmCbAp.js";import{t as S}from"./is-electron-7N7iyz1y.js";import{n as C}from"./resolved-assistants-store-PdwcxGwN.js";import{nr as w}from"./sdk.gen-CsFDyJ6U.js";import{r as T}from"./utils-CrvvcikL.js";import{n as E}from"./api-errors-BRGPPSWw.js";import{A as D,D as O,I as ee,O as te,T as k,j as A}from"./auth-store-CK95leo_.js";import{et as j}from"./sdk.gen-C6q_cviY.js";import{u as M}from"./routes-bwxCYLJj.js";import{t as N}from"./use-is-org-ready-DryM43xt.js";import{a as P,i as F,r as I}from"./feature-flag-catalog-C45bOtg3.js";import{t as L}from"./client-feature-flag-store-DR6pLmyc.js";import{t as R}from"./haptics-BOyIPZDm.js";import{F as z}from"./react-query.gen-oEdI--ip.js";import{s as B}from"./chat-BIJEFb5u.js";var V=i(`contact`,[[`path`,{d:`M16 2v2`,key:`scm5qe`}],[`path`,{d:`M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2`,key:`1waht3`}],[`path`,{d:`M8 2v2`,key:`pbkmx`}],[`circle`,{cx:`12`,cy:`11`,r:`3`,key:`itu57m`}],[`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`,key:`12vinp`}]]),H=i(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),U=e(t(),1);function W({sessionStatus:e,hasPlatformSession:t}){let r=n(),i=N(),a=O.use.currentOrganizationId(),o=A(e)&&!v()&&(t||!y())&&i,s=L.use.multiPlatformAssistant();C.use.selectedAssistantId(),C.use.assistants();let c=a??k(),l=s&&!v()&&c?te(c):null,u=l&&!x().some(e=>e.assistantId===l)?l:null,{data:d}=ee({enabled:o,selectedPlatformAssistantId:u});(0,U.useEffect)(()=>{D.setInputs({sessionStatus:e,hasPlatformSession:t,queryClient:r,selectedPlatformAssistantId:u,isOrgReady:i}),D.respondToInputs()},[e,t,r,u,i]),(0,U.useEffect)(()=>{d&&D.applyServerResult(d)},[d])}var G=`0.8.5`,K=5e3,q=6e4;function J(){return T(G)?{staleTime:q,refetchInterval:!1}:{staleTime:K,refetchInterval:K}}var Y=new Set(Object.keys(I)),X=new Set(Object.keys(F));async function Z(){let{data:e,error:t,response:n}=await j({throwOnError:!1});if(E(n,t,`Failed to fetch client feature flags`),!n.ok||!e)throw Error(`Failed to fetch client feature flags: ${n.status}`);return e}function ne(e){let t={},n={};for(let[r,i]of Object.entries(e)){let e=P(r);typeof i==`boolean`&&Y.has(e)?t[e]=i:typeof i==`string`&&X.has(e)&&(n[e]=i)}return{boolFlags:t,stringFlags:n}}function re(e){let t=J(),n=e&&!b(),{data:i}=r({queryKey:z(),queryFn:Z,enabled:n,...t,retry:1});(0,U.useEffect)(()=>{if(i?.flags){let{boolFlags:e,stringFlags:t}=ne(i.flags),n=L.getState();n.setFlags(e),Object.keys(t).length>0&&n.setStringFlags(t)}},[i])}var Q=_(g((e,t)=>({isOpen:!1,open:()=>e({isOpen:!0}),close:()=>e({isOpen:!1}),toggle:()=>e({isOpen:!t().isOpen})})));async function ie(){if(!S())return!1;let e=window.vellum?.commandPalette?.open;return e?(await e(),!0):!1}async function ae(){S()&&await window.vellum?.commandPalette?.dismiss()}async function oe(e){S()&&await window.vellum?.commandPalette?.select(e)}var $={conversations:[],memories:[],schedules:[],contacts:[]};async function se(e,t,n){let r=n?.limit??20;try{let{data:i,response:a}=await w({path:{assistant_id:e},query:{q:t,limit:r,categories:`conversations,schedules,contacts`},throwOnError:!1,signal:n?.signal});return!a?.ok||!i?$:i.results}catch(n){return n instanceof DOMException&&n.name===`AbortError`||console.error(`[global-search] search failed`,{assistantId:e,query:t,err:n}),$}}var ce=150,le=2;function ue({itemCount:e,onSelect:t,assistantId:n,isOpen:r,onClose:i}){let a=Q.use.isOpen(),o=r??a,s=Q.use.open(),c=Q.use.close(),[l,u]=(0,U.useState)(``),[d,f]=(0,U.useState)(0),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(null),_=(0,U.useRef)(()=>0);(0,U.useLayoutEffect)(()=>{_.current=typeof e==`function`?e:()=>e});let v=(0,U.useRef)(null),y=(0,U.useRef)(null),b=(0,U.useCallback)(()=>{v.current&&=(clearTimeout(v.current),null),y.current?.abort(),y.current=null},[]),x=(0,U.useCallback)(()=>{s(),f(0)},[s]),S=(0,U.useCallback)(()=>{c(),u(``),f(0),m(!1),g(null),b(),i?.()},[c,b,i]),C=(0,U.useCallback)(()=>{o?S():x()},[o,S,x]);(0,U.useEffect)(()=>{o||(u(``),f(0),m(!1),g(null),b())},[o,b]);let w=(0,U.useCallback)(e=>{b();let t=e.trim();if(t.length<le||!n){m(!1),g(null);return}m(!0),v.current=setTimeout(()=>{if(!n){m(!1);return}let e=new AbortController;y.current=e,se(n,t,{signal:e.signal}).then(t=>{y.current===e&&(g(t),m(!1))}).catch(()=>{y.current===e&&m(!1)})},ce)},[b,n]),T=(0,U.useCallback)(e=>{u(e),f(0),w(e)},[w]);return(0,U.useEffect)(()=>()=>{y.current?.abort(),v.current&&clearTimeout(v.current)},[]),{isOpen:o,query:l,selectedIndex:d,isSearching:p,searchResults:h,open:x,close:S,toggle:C,setQuery:T,handleKeyDown:(0,U.useCallback)(e=>{if(e.key===`k`&&(e.metaKey||e.ctrlKey)){e.preventDefault(),S();return}let n=_.current();switch(e.key){case`ArrowDown`:e.preventDefault(),n>0&&f(e=>Math.min(e+1,n-1));break;case`ArrowUp`:e.preventDefault(),f(e=>Math.max(e-1,0));break;case`Enter`:e.preventDefault(),n>0&&t?.(d);break;case`Escape`:e.preventDefault(),S();break}},[t,d,S])}}function de(e,t){let n=[],r=e.conversations.filter(e=>!t.has(e.id)).map(e=>({id:`search-conv-${e.id}`,icon:d,title:e.title??`Untitled`,subtitle:e.excerpt}));r.length>0&&n.push({id:`search-conversations`,label:`Conversations`,items:r});let i=e.schedules.map(e=>({id:`search-schedule-${e.id}`,icon:a,title:e.name,subtitle:e.expression??e.message}));i.length>0&&n.push({id:`search-schedules`,label:`Schedules`,items:i});let o=e.contacts.map(e=>({id:`search-contact-${e.id}`,icon:V,title:e.displayName,subtitle:e.notes??void 0}));return o.length>0&&n.push({id:`search-contacts`,label:`Contacts`,items:o}),n}function fe(e){return{id:`actions`,label:`Actions`,items:[{id:`action-new-conversation`,icon:H,title:`New Conversation`,shortcutHint:S()?`⌘N`:`⌘⇧O`},{id:`action-current-conversation`,icon:f,title:`Current Conversation`,shortcutHint:`⌘⇧N`},{id:`action-settings`,icon:o,title:`Settings`,shortcutHint:`⌘,`},{id:`action-library`,icon:u,title:`Library`},{id:`action-intelligence`,icon:l,title:e},{id:`action-back`,icon:s,title:`Back`,shortcutHint:`⌘[`},{id:`action-forward`,icon:c,title:`Forward`,shortcutHint:`⌘]`},{id:`action-zoom-in`,icon:h,title:`Zoom In`,shortcutHint:`⌘+`},{id:`action-zoom-out`,icon:m,title:`Zoom Out`,shortcutHint:`⌘−`},{id:`action-actual-size`,icon:p,title:`Actual Size`,shortcutHint:`⌘0`}]}}function pe(e){return{id:`conversations`,label:`Recent`,items:e.slice(0,5).map(e=>({id:`conv-${e.conversationId}`,icon:d,title:e.title??`Untitled`,subtitle:e.lastMessageAt?B(e.lastMessageAt):void 0}))}}function me(e,t){switch(e.id){case`action-new-conversation`:t.startNewConversation();break;case`action-current-conversation`:R.light(),t.navigate(M.assistant);break;case`action-settings`:R.light(),t.navigateToSettings();break;case`action-intelligence`:R.light(),t.navigate(M.identity);break;case`action-library`:R.light(),t.navigate(M.library.root);break;case`action-back`:t.navigate(-1);break;case`action-forward`:t.navigate(1);break;case`action-zoom-in`:document.body.style.zoom=String(parseFloat(document.body.style.zoom||`1`)+.1);break;case`action-zoom-out`:document.body.style.zoom=String(Math.max(.5,parseFloat(document.body.style.zoom||`1`)-.1));break;case`action-actual-size`:document.body.style.zoom=`1`;break;default:if(e.id.startsWith(`conv-`)){let n=e.id.slice(5);t.switchConversation(n)}else if(e.id.startsWith(`search-conv-`)){let n=e.id.slice(12);t.switchConversation(n)}else e.id.startsWith(`search-schedule-`)?(R.light(),t.navigate(M.schedules.detail(e.id.slice(16)))):e.id.startsWith(`search-contact-`)&&(R.light(),t.navigate(M.identity));break}}function he({assistantId:e,assistantName:t,conversations:n,activeConversationId:r,startNewConversation:i,switchConversation:a,navigate:o,navigateToSettings:s,isOpen:c,onClose:l,onItemSelect:u}){let d=(0,U.useMemo)(()=>{let e=fe(t??`Assistant`),r=pe(n);return[e,...r.items.length>0?[r]:[]]},[n,t]),f=(0,U.useMemo)(()=>new Set(n.slice(0,5).map(e=>e.conversationId)),[n]),p=(0,U.useCallback)(e=>{if(u){u(e);return}me(e,{startNewConversation:i,switchConversation:a,navigate:o,activeConversationId:r,navigateToSettings:s})},[i,a,o,r,s,u]),m=(0,U.useRef)([]),h=(0,U.useRef)(()=>{}),g=ue({itemCount:()=>m.current.reduce((e,t)=>e+t.items.length,0),onSelect:(0,U.useCallback)(e=>{let t=e;for(let e of m.current){if(t<e.items.length){let n=e.items[t];p(n),h.current();return}t-=e.items.length}},[p]),assistantId:e,isOpen:c,onClose:l});(0,U.useLayoutEffect)(()=>{h.current=g.close});let _=(0,U.useMemo)(()=>{if(!g.query.trim())return d;let e=g.query.toLowerCase().trim();return d.map(t=>({...t,items:t.items.filter(t=>t.title.toLowerCase().includes(e))})).filter(e=>e.items.length>0)},[d,g.query]),v=(0,U.useMemo)(()=>{let e=g.searchResults?de(g.searchResults,f):[];return[..._,...e]},[_,g.searchResults,f]);return(0,U.useLayoutEffect)(()=>{m.current=v}),{commandPalette:g,mergedSections:v,handleItemSelect:(0,U.useCallback)(e=>{p(e),h.current()},[p])}}export{Q as a,W as c,oe as i,H as l,ae as n,re as o,ie as r,J as s,he as t,V as u};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./QueryClientProvider-CMu7CkQU.js";import{t as r}from"./useQuery-Bz-fbQ-m.js";import{t as i}from"./createLucideIcon-CAM1RhH8.js";import{n as a,t as o}from"./settings-CfuLzwIw.js";import{t as s}from"./chevron-left-CytMddTB.js";import{t as c}from"./chevron-right-HU6H84S0.js";import{t as l}from"./globe-CMtjL_s_.js";import{t as u}from"./layout-grid-DA_CfD6d.js";import{t as d}from"./message-square-CQGiY4zk.js";import{t as f}from"./monitor-B1y28fS1.js";import{t as p}from"./search-BVW-n8to.js";import{n as m,t as h}from"./zoom-in-CaLYwni-.js";import{n as g,t as _}from"./create-selectors-Qo7kcikX.js";import{ct as v,f as y,h as b,r as x}from"./local-mode-Ckii2tmN.js";import{t as S}from"./is-electron-m5eeGBnd.js";import{n as C}from"./resolved-assistants-store-C-PdxK8f.js";import{nr as w}from"./sdk.gen-BVAVE6A_.js";import{r as T}from"./utils-CnB60ZJN.js";import{n as E}from"./api-errors-CFiCT7Ap.js";import{A as D,D as O,I as ee,O as te,T as k,j as A}from"./auth-store-D9BqFncz.js";import{et as j}from"./sdk.gen-BIu1DgTs.js";import{u as M}from"./routes-vE-2hncW.js";import{t as N}from"./use-is-org-ready-X_98Cnx9.js";import{a as P,i as F,r as I}from"./feature-flag-catalog-BAyJlRMY.js";import{t as L}from"./client-feature-flag-store-oTfL8Oiz.js";import{t as R}from"./haptics-D9eNTUq-.js";import{F as z}from"./react-query.gen-Mwd5l-vZ.js";import{s as B}from"./chat-BrL0k2UY.js";var V=i(`contact`,[[`path`,{d:`M16 2v2`,key:`scm5qe`}],[`path`,{d:`M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2`,key:`1waht3`}],[`path`,{d:`M8 2v2`,key:`pbkmx`}],[`circle`,{cx:`12`,cy:`11`,r:`3`,key:`itu57m`}],[`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`,key:`12vinp`}]]),H=i(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),U=e(t(),1);function W({sessionStatus:e,hasPlatformSession:t}){let r=n(),i=N(),a=O.use.currentOrganizationId(),o=A(e)&&!v()&&(t||!y())&&i,s=L.use.multiPlatformAssistant();C.use.selectedAssistantId(),C.use.assistants();let c=a??k(),l=s&&!v()&&c?te(c):null,u=l&&!x().some(e=>e.assistantId===l)?l:null,{data:d}=ee({enabled:o,selectedPlatformAssistantId:u});(0,U.useEffect)(()=>{D.setInputs({sessionStatus:e,hasPlatformSession:t,queryClient:r,selectedPlatformAssistantId:u,isOrgReady:i}),D.respondToInputs()},[e,t,r,u,i]),(0,U.useEffect)(()=>{d&&D.applyServerResult(d)},[d])}var G=`0.8.5`,K=5e3,q=6e4;function J(){return T(G)?{staleTime:q,refetchInterval:!1}:{staleTime:K,refetchInterval:K}}var Y=new Set(Object.keys(I)),X=new Set(Object.keys(F));async function Z(){let{data:e,error:t,response:n}=await j({throwOnError:!1});if(E(n,t,`Failed to fetch client feature flags`),!n.ok||!e)throw Error(`Failed to fetch client feature flags: ${n.status}`);return e}function ne(e){let t={},n={};for(let[r,i]of Object.entries(e)){let e=P(r);typeof i==`boolean`&&Y.has(e)?t[e]=i:typeof i==`string`&&X.has(e)&&(n[e]=i)}return{boolFlags:t,stringFlags:n}}function re(e){let t=J(),n=e&&!b(),{data:i}=r({queryKey:z(),queryFn:Z,enabled:n,...t,retry:1});(0,U.useEffect)(()=>{if(i?.flags){let{boolFlags:e,stringFlags:t}=ne(i.flags),n=L.getState();n.setFlags(e),Object.keys(t).length>0&&n.setStringFlags(t)}},[i])}var Q=_(g((e,t)=>({isOpen:!1,open:()=>e({isOpen:!0}),close:()=>e({isOpen:!1}),toggle:()=>e({isOpen:!t().isOpen})})));async function ie(){if(!S())return!1;let e=window.vellum?.commandPalette?.open;return e?(await e(),!0):!1}async function ae(){S()&&await window.vellum?.commandPalette?.dismiss()}async function oe(e){S()&&await window.vellum?.commandPalette?.select(e)}var $={conversations:[],memories:[],schedules:[],contacts:[]};async function se(e,t,n){let r=n?.limit??20;try{let{data:i,response:a}=await w({path:{assistant_id:e},query:{q:t,limit:r,categories:`conversations,schedules,contacts`},throwOnError:!1,signal:n?.signal});return!a?.ok||!i?$:i.results}catch(n){return n instanceof DOMException&&n.name===`AbortError`||console.error(`[global-search] search failed`,{assistantId:e,query:t,err:n}),$}}var ce=150,le=2;function ue({itemCount:e,onSelect:t,assistantId:n,isOpen:r,onClose:i}){let a=Q.use.isOpen(),o=r??a,s=Q.use.open(),c=Q.use.close(),[l,u]=(0,U.useState)(``),[d,f]=(0,U.useState)(0),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(null),_=(0,U.useRef)(()=>0);(0,U.useLayoutEffect)(()=>{_.current=typeof e==`function`?e:()=>e});let v=(0,U.useRef)(null),y=(0,U.useRef)(null),b=(0,U.useCallback)(()=>{v.current&&=(clearTimeout(v.current),null),y.current?.abort(),y.current=null},[]),x=(0,U.useCallback)(()=>{s(),f(0)},[s]),S=(0,U.useCallback)(()=>{c(),u(``),f(0),m(!1),g(null),b(),i?.()},[c,b,i]),C=(0,U.useCallback)(()=>{o?S():x()},[o,S,x]);(0,U.useEffect)(()=>{o||(u(``),f(0),m(!1),g(null),b())},[o,b]);let w=(0,U.useCallback)(e=>{b();let t=e.trim();if(t.length<le||!n){m(!1),g(null);return}m(!0),v.current=setTimeout(()=>{if(!n){m(!1);return}let e=new AbortController;y.current=e,se(n,t,{signal:e.signal}).then(t=>{y.current===e&&(g(t),m(!1))}).catch(()=>{y.current===e&&m(!1)})},ce)},[b,n]),T=(0,U.useCallback)(e=>{u(e),f(0),w(e)},[w]);return(0,U.useEffect)(()=>()=>{y.current?.abort(),v.current&&clearTimeout(v.current)},[]),{isOpen:o,query:l,selectedIndex:d,isSearching:p,searchResults:h,open:x,close:S,toggle:C,setQuery:T,handleKeyDown:(0,U.useCallback)(e=>{if(e.key===`k`&&(e.metaKey||e.ctrlKey)){e.preventDefault(),S();return}let n=_.current();switch(e.key){case`ArrowDown`:e.preventDefault(),n>0&&f(e=>Math.min(e+1,n-1));break;case`ArrowUp`:e.preventDefault(),f(e=>Math.max(e-1,0));break;case`Enter`:e.preventDefault(),n>0&&t?.(d);break;case`Escape`:e.preventDefault(),S();break}},[t,d,S])}}function de(e,t){let n=[],r=e.conversations.filter(e=>!t.has(e.id)).map(e=>({id:`search-conv-${e.id}`,icon:d,title:e.title??`Untitled`,subtitle:e.excerpt}));r.length>0&&n.push({id:`search-conversations`,label:`Conversations`,items:r});let i=e.schedules.map(e=>({id:`search-schedule-${e.id}`,icon:a,title:e.name,subtitle:e.expression??e.message}));i.length>0&&n.push({id:`search-schedules`,label:`Schedules`,items:i});let o=e.contacts.map(e=>({id:`search-contact-${e.id}`,icon:V,title:e.displayName,subtitle:e.notes??void 0}));return o.length>0&&n.push({id:`search-contacts`,label:`Contacts`,items:o}),n}function fe(e){return{id:`actions`,label:`Actions`,items:[{id:`action-new-conversation`,icon:H,title:`New Conversation`,shortcutHint:S()?`⌘N`:`⌘⇧O`},{id:`action-current-conversation`,icon:f,title:`Current Conversation`,shortcutHint:`⌘⇧N`},{id:`action-settings`,icon:o,title:`Settings`,shortcutHint:`⌘,`},{id:`action-library`,icon:u,title:`Library`},{id:`action-intelligence`,icon:l,title:e},{id:`action-back`,icon:s,title:`Back`,shortcutHint:`⌘[`},{id:`action-forward`,icon:c,title:`Forward`,shortcutHint:`⌘]`},{id:`action-zoom-in`,icon:h,title:`Zoom In`,shortcutHint:`⌘+`},{id:`action-zoom-out`,icon:m,title:`Zoom Out`,shortcutHint:`⌘−`},{id:`action-actual-size`,icon:p,title:`Actual Size`,shortcutHint:`⌘0`}]}}function pe(e){return{id:`conversations`,label:`Recent`,items:e.slice(0,5).map(e=>({id:`conv-${e.conversationId}`,icon:d,title:e.title??`Untitled`,subtitle:e.lastMessageAt?B(e.lastMessageAt):void 0}))}}function me(e,t){switch(e.id){case`action-new-conversation`:t.startNewConversation();break;case`action-current-conversation`:R.light(),t.navigate(M.assistant);break;case`action-settings`:R.light(),t.navigateToSettings();break;case`action-intelligence`:R.light(),t.navigate(M.identity);break;case`action-library`:R.light(),t.navigate(M.library.root);break;case`action-back`:t.navigate(-1);break;case`action-forward`:t.navigate(1);break;case`action-zoom-in`:document.body.style.zoom=String(parseFloat(document.body.style.zoom||`1`)+.1);break;case`action-zoom-out`:document.body.style.zoom=String(Math.max(.5,parseFloat(document.body.style.zoom||`1`)-.1));break;case`action-actual-size`:document.body.style.zoom=`1`;break;default:if(e.id.startsWith(`conv-`)){let n=e.id.slice(5);t.switchConversation(n)}else if(e.id.startsWith(`search-conv-`)){let n=e.id.slice(12);t.switchConversation(n)}else e.id.startsWith(`search-schedule-`)?(R.light(),t.navigate(M.schedules.detail(e.id.slice(16)))):e.id.startsWith(`search-contact-`)&&(R.light(),t.navigate(M.identity));break}}function he({assistantId:e,assistantName:t,conversations:n,activeConversationId:r,startNewConversation:i,switchConversation:a,navigate:o,navigateToSettings:s,isOpen:c,onClose:l,onItemSelect:u}){let d=(0,U.useMemo)(()=>{let e=fe(t??`Assistant`),r=pe(n);return[e,...r.items.length>0?[r]:[]]},[n,t]),f=(0,U.useMemo)(()=>new Set(n.slice(0,5).map(e=>e.conversationId)),[n]),p=(0,U.useCallback)(e=>{if(u){u(e);return}me(e,{startNewConversation:i,switchConversation:a,navigate:o,activeConversationId:r,navigateToSettings:s})},[i,a,o,r,s,u]),m=(0,U.useRef)([]),h=(0,U.useRef)(()=>{}),g=ue({itemCount:()=>m.current.reduce((e,t)=>e+t.items.length,0),onSelect:(0,U.useCallback)(e=>{let t=e;for(let e of m.current){if(t<e.items.length){let n=e.items[t];p(n),h.current();return}t-=e.items.length}},[p]),assistantId:e,isOpen:c,onClose:l});(0,U.useLayoutEffect)(()=>{h.current=g.close});let _=(0,U.useMemo)(()=>{if(!g.query.trim())return d;let e=g.query.toLowerCase().trim();return d.map(t=>({...t,items:t.items.filter(t=>t.title.toLowerCase().includes(e))})).filter(e=>e.items.length>0)},[d,g.query]),v=(0,U.useMemo)(()=>{let e=g.searchResults?de(g.searchResults,f):[];return[..._,...e]},[_,g.searchResults,f]);return(0,U.useLayoutEffect)(()=>{m.current=v}),{commandPalette:g,mergedSections:v,handleItemSelect:(0,U.useCallback)(e=>{p(e),h.current()},[p])}}export{Q as a,W as c,oe as i,H as l,ae as n,re as o,ie as r,J as s,he as t,V as u};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./createLucideIcon-CAM1RhH8.js";import{n as i,t as a}from"./middleware-HE0NLvPl.js";import{n as o,t as s}from"./create-selectors-B-P03-8K.js";var c=r(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),l=n();function u({size:e=24,className:t,style:n}){return(0,l.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 127.14 96.36`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,l.jsx)(`path`,{d:`M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2.04a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2.04a68.68 68.68 0 0 1-10.87 5.19 77.3 77.3 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69C36.18 65.69 31 60 31 53.05c0-6.94 5.04-12.67 11.45-12.67S54 46.08 53.91 53.05c0 6.95-5.07 12.64-11.46 12.64Zm42.24 0C78.41 65.69 73.25 60 73.25 53.05c0-6.94 5.04-12.67 11.44-12.67s11.51 5.73 11.44 12.67c0 6.95-5.06 12.64-11.44 12.64Z`})})}var d=e(t(),1),f={githubStarred:!1,githubBannerDismissed:!1,githubBannerDismissedAt:0,githubFirstSeenAt:0,githubUserMessagesSeen:0,discordJoined:!1,discordBannerDismissed:!1,discordFirstSeenAt:0},p=`vellum:nudge-prefs`,m=o()(i((e,t)=>({...f,markGitHubStarred:()=>e({githubStarred:!0}),dismissGitHubBanner:()=>e({githubBannerDismissed:!0,githubBannerDismissedAt:Date.now()}),ensureGitHubFirstSeenAt:()=>{t().githubFirstSeenAt===0&&e({githubFirstSeenAt:Date.now()})},incrementGitHubUserMessagesSeen:n=>{n<=0||e({githubUserMessagesSeen:t().githubUserMessagesSeen+n})},markDiscordJoined:()=>e({discordJoined:!0}),dismissDiscordBanner:()=>e({discordBannerDismissed:!0}),ensureDiscordFirstSeenAt:()=>{t().discordFirstSeenAt===0&&e({discordFirstSeenAt:Date.now()})}}),{name:p,storage:a(()=>localStorage),partialize:e=>({githubStarred:e.githubStarred,githubBannerDismissed:e.githubBannerDismissed,githubBannerDismissedAt:e.githubBannerDismissedAt,githubFirstSeenAt:e.githubFirstSeenAt,githubUserMessagesSeen:e.githubUserMessagesSeen,discordJoined:e.discordJoined,discordBannerDismissed:e.discordBannerDismissed,discordFirstSeenAt:e.discordFirstSeenAt})})),h=s(m);typeof window<`u`&&window.addEventListener(`storage`,e=>{e.key===p&&m.persist.rehydrate()});var g=`https://github.com/vellum-ai/vellum-assistant`,_=1440*60*1e3;function v(){return h.getState().githubStarred}function y(){return h.getState().githubBannerDismissedAt}function b(){return h.getState().githubUserMessagesSeen}function x(){h.getState().ensureGitHubFirstSeenAt()}function S(e){h.getState().incrementGitHubUserMessagesSeen(e)}function C(){let e=h.use.githubStarred(),t=h.use.githubBannerDismissed(),n=h.use.githubFirstSeenAt(),r=h.use.githubUserMessagesSeen(),[i,a]=(0,d.useState)(()=>n===0?!1:Date.now()-n>=_);(0,d.useEffect)(()=>{if(n===0||i)return;let e=_-(Date.now()-n);if(e<=0){a(!0);return}let t=setTimeout(()=>a(!0),e);return()=>clearTimeout(t)},[n,i]);let o=i||r>=5,s=(0,d.useCallback)(()=>{w(),h.getState().markGitHubStarred()},[]),c=(0,d.useCallback)(()=>{h.getState().dismissGitHubBanner()},[]);return{bannerShouldShow:!e&&!t&&o,handleStar:s,handleBannerDismiss:c}}function w(){typeof window>`u`||window.open(g,`_blank`,`noopener,noreferrer`)}var T=`https://discord.gg/ZABd9V2zM8`,E=1440*60*1e3;function D(){h.getState().ensureDiscordFirstSeenAt()}function O(){return v()?!0:h.getState().githubBannerDismissed}function k(){let e=y();return e===0?!0:Date.now()-e>=E}function A(){return!0}function j(e,t){return!(!e||!O()||!A()||t<2||!k())}function M(){P(),h.getState().markDiscordJoined()}function N(e,t){let n=h.use.discordJoined(),r=h.use.discordBannerDismissed();h.use.githubStarred(),h.use.githubBannerDismissed(),h.use.discordFirstSeenAt();let i=j(e,t),a=(0,d.useCallback)(()=>{P(),h.getState().markDiscordJoined()},[]),o=(0,d.useCallback)(()=>{h.getState().dismissDiscordBanner()},[]);return{bannerShouldShow:i&&!n&&!r,handleJoin:a,handleBannerDismiss:o}}function P(){typeof window>`u`||window.open(T,`_blank`,`noopener,noreferrer`)}export{x as a,C as c,g as i,u as l,M as n,S as o,N as r,b as s,D as t,c as u};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./createLucideIcon-CAM1RhH8.js";import{n as i,t as a}from"./middleware-HE0NLvPl.js";import{n as o,t as s}from"./create-selectors-Qo7kcikX.js";var c=r(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),l=n();function u({size:e=24,className:t,style:n}){return(0,l.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 127.14 96.36`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,l.jsx)(`path`,{d:`M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2.04a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2.04a68.68 68.68 0 0 1-10.87 5.19 77.3 77.3 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69C36.18 65.69 31 60 31 53.05c0-6.94 5.04-12.67 11.45-12.67S54 46.08 53.91 53.05c0 6.95-5.07 12.64-11.46 12.64Zm42.24 0C78.41 65.69 73.25 60 73.25 53.05c0-6.94 5.04-12.67 11.44-12.67s11.51 5.73 11.44 12.67c0 6.95-5.06 12.64-11.44 12.64Z`})})}var d=e(t(),1),f={githubStarred:!1,githubBannerDismissed:!1,githubBannerDismissedAt:0,githubFirstSeenAt:0,githubUserMessagesSeen:0,discordJoined:!1,discordBannerDismissed:!1,discordFirstSeenAt:0},p=`vellum:nudge-prefs`,m=o()(i((e,t)=>({...f,markGitHubStarred:()=>e({githubStarred:!0}),dismissGitHubBanner:()=>e({githubBannerDismissed:!0,githubBannerDismissedAt:Date.now()}),ensureGitHubFirstSeenAt:()=>{t().githubFirstSeenAt===0&&e({githubFirstSeenAt:Date.now()})},incrementGitHubUserMessagesSeen:n=>{n<=0||e({githubUserMessagesSeen:t().githubUserMessagesSeen+n})},markDiscordJoined:()=>e({discordJoined:!0}),dismissDiscordBanner:()=>e({discordBannerDismissed:!0}),ensureDiscordFirstSeenAt:()=>{t().discordFirstSeenAt===0&&e({discordFirstSeenAt:Date.now()})}}),{name:p,storage:a(()=>localStorage),partialize:e=>({githubStarred:e.githubStarred,githubBannerDismissed:e.githubBannerDismissed,githubBannerDismissedAt:e.githubBannerDismissedAt,githubFirstSeenAt:e.githubFirstSeenAt,githubUserMessagesSeen:e.githubUserMessagesSeen,discordJoined:e.discordJoined,discordBannerDismissed:e.discordBannerDismissed,discordFirstSeenAt:e.discordFirstSeenAt})})),h=s(m);typeof window<`u`&&window.addEventListener(`storage`,e=>{e.key===p&&m.persist.rehydrate()});var g=`https://github.com/vellum-ai/vellum-assistant`,_=1440*60*1e3;function v(){return h.getState().githubStarred}function y(){return h.getState().githubBannerDismissedAt}function b(){return h.getState().githubUserMessagesSeen}function x(){h.getState().ensureGitHubFirstSeenAt()}function S(e){h.getState().incrementGitHubUserMessagesSeen(e)}function C(){let e=h.use.githubStarred(),t=h.use.githubBannerDismissed(),n=h.use.githubFirstSeenAt(),r=h.use.githubUserMessagesSeen(),[i,a]=(0,d.useState)(()=>n===0?!1:Date.now()-n>=_);(0,d.useEffect)(()=>{if(n===0||i)return;let e=_-(Date.now()-n);if(e<=0){a(!0);return}let t=setTimeout(()=>a(!0),e);return()=>clearTimeout(t)},[n,i]);let o=i||r>=5,s=(0,d.useCallback)(()=>{w(),h.getState().markGitHubStarred()},[]),c=(0,d.useCallback)(()=>{h.getState().dismissGitHubBanner()},[]);return{bannerShouldShow:!e&&!t&&o,handleStar:s,handleBannerDismiss:c}}function w(){typeof window>`u`||window.open(g,`_blank`,`noopener,noreferrer`)}var T=`https://discord.gg/ZABd9V2zM8`,E=1440*60*1e3;function D(){h.getState().ensureDiscordFirstSeenAt()}function O(){return v()?!0:h.getState().githubBannerDismissed}function k(){let e=y();return e===0?!0:Date.now()-e>=E}function A(){return!0}function j(e,t){return!(!e||!O()||!A()||t<2||!k())}function M(){P(),h.getState().markDiscordJoined()}function N(e,t){let n=h.use.discordJoined(),r=h.use.discordBannerDismissed();h.use.githubStarred(),h.use.githubBannerDismissed(),h.use.discordFirstSeenAt();let i=j(e,t),a=(0,d.useCallback)(()=>{P(),h.getState().markDiscordJoined()},[]),o=(0,d.useCallback)(()=>{h.getState().dismissDiscordBanner()},[]);return{bannerShouldShow:i&&!n&&!r,handleJoin:a,handleBannerDismiss:o}}function P(){typeof window>`u`||window.open(T,`_blank`,`noopener,noreferrer`)}export{x as a,C as c,g as i,u as l,M as n,S as o,N as r,b as s,D as t,c as u};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./haptics-BOyIPZDm.js";import{t as r}from"./pointer-QlIwQKYH.js";var i=e(t(),1),a=.5,o=100,s=.3,c=.7,l=10,u=.3;function d(e){return Math.min(o,e*s)}function f(e){return e*a}function p(e){return e instanceof Element?e.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"]), [data-message-text]`)!==null:!1}function m(e,t,n){return!(e>f(t)||n&&e>20)}function h(e,t){return Math.abs(t)>Math.abs(e)*c}function g(e,t){return Math.abs(e)<l&&Math.abs(t)<l?`pending`:h(e,t)||e<=0?`cancel`:`confirm`}function _(e,t){return e<=t?e:t+(e-t)*u}function v(e,t){return Math.min(0,e-t)}function y(e,t){return e>=t}function b(e,t){for(let n=0;n<e.length;n+=1){let r=e[n];if(r&&r.identifier===t)return r}return null}function x({enabled:e,onConfirm:t,onMove:a,onCommit:o,onCancel:s}){let c=(0,i.useRef)(null),l=(0,i.useRef)(e),u=(0,i.useRef)({onConfirm:t,onMove:a,onCommit:o,onCancel:s});(0,i.useLayoutEffect)(()=>{l.current=e,u.current={onConfirm:t,onMove:a,onCommit:o,onCancel:s}}),(0,i.useEffect)(()=>{if(!r())return;let e=()=>d(window.innerWidth),t=e=>{c.current=null,u.current.onCancel(e)},i=e=>{if(!l.current||c.current||e.touches.length!==1)return;let t=e.touches[0];t&&m(t.clientX,window.innerWidth,p(e.target))&&(c.current={touchId:t.identifier,startX:t.clientX,startY:t.clientY,confirmed:!1,hasFiredHaptic:!1})},a=r=>{let i=c.current;if(!i)return;if(r.touches.length>1){t(!1);return}let a=b(r.touches,i.touchId);if(!a)return;let o=a.clientX-i.startX,s=a.clientY-i.startY;if(!i.confirmed){let e=g(o,s);if(e===`pending`)return;if(e===`cancel`){t(!1);return}i.confirmed=!0,u.current.onConfirm?.()}let l=e();if(h(o,s)&&o<l){t(!0);return}o>=l&&!i.hasFiredHaptic&&(i.hasFiredHaptic=!0,n.light()),u.current.onMove(o,l,a.clientX)},o=n=>{let r=c.current;if(!r)return;let i=b(n.changedTouches,r.touchId),a=i?i.clientX-r.startX:0,o=e();r.confirmed&&y(a,o)?(c.current=null,u.current.onCommit(a,o)):r.confirmed?t(!0):t(!1)},s=()=>{t(c.current?.confirmed??!1)};return document.addEventListener(`touchstart`,i,{passive:!0}),document.addEventListener(`touchmove`,a,{passive:!0}),document.addEventListener(`touchend`,o,{passive:!0}),document.addEventListener(`touchcancel`,s,{passive:!0}),()=>{c.current=null,document.removeEventListener(`touchstart`,i),document.removeEventListener(`touchmove`,a),document.removeEventListener(`touchend`,o),document.removeEventListener(`touchcancel`,s)}},[])}export{_ as n,x as r,v as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./haptics-D9eNTUq-.js";import{t as r}from"./pointer-RLpjGG7A.js";var i=e(t(),1),a=.5,o=100,s=.3,c=.7,l=10,u=.3;function d(e){return Math.min(o,e*s)}function f(e){return e*a}function p(e){return e instanceof Element?e.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"]), [data-message-text]`)!==null:!1}function m(e,t,n){return!(e>f(t)||n&&e>20)}function h(e,t){return Math.abs(t)>Math.abs(e)*c}function g(e,t){return Math.abs(e)<l&&Math.abs(t)<l?`pending`:h(e,t)||e<=0?`cancel`:`confirm`}function _(e,t){return e<=t?e:t+(e-t)*u}function v(e,t){return Math.min(0,e-t)}function y(e,t){return e>=t}function b(e,t){for(let n=0;n<e.length;n+=1){let r=e[n];if(r&&r.identifier===t)return r}return null}function x({enabled:e,onConfirm:t,onMove:a,onCommit:o,onCancel:s}){let c=(0,i.useRef)(null),l=(0,i.useRef)(e),u=(0,i.useRef)({onConfirm:t,onMove:a,onCommit:o,onCancel:s});(0,i.useLayoutEffect)(()=>{l.current=e,u.current={onConfirm:t,onMove:a,onCommit:o,onCancel:s}}),(0,i.useEffect)(()=>{if(!r())return;let e=()=>d(window.innerWidth),t=e=>{c.current=null,u.current.onCancel(e)},i=e=>{if(!l.current||c.current||e.touches.length!==1)return;let t=e.touches[0];t&&m(t.clientX,window.innerWidth,p(e.target))&&(c.current={touchId:t.identifier,startX:t.clientX,startY:t.clientY,confirmed:!1,hasFiredHaptic:!1})},a=r=>{let i=c.current;if(!i)return;if(r.touches.length>1){t(!1);return}let a=b(r.touches,i.touchId);if(!a)return;let o=a.clientX-i.startX,s=a.clientY-i.startY;if(!i.confirmed){let e=g(o,s);if(e===`pending`)return;if(e===`cancel`){t(!1);return}i.confirmed=!0,u.current.onConfirm?.()}let l=e();if(h(o,s)&&o<l){t(!0);return}o>=l&&!i.hasFiredHaptic&&(i.hasFiredHaptic=!0,n.light()),u.current.onMove(o,l,a.clientX)},o=n=>{let r=c.current;if(!r)return;let i=b(n.changedTouches,r.touchId),a=i?i.clientX-r.startX:0,o=e();r.confirmed&&y(a,o)?(c.current=null,u.current.onCommit(a,o)):r.confirmed?t(!0):t(!1)},s=()=>{t(c.current?.confirmed??!1)};return document.addEventListener(`touchstart`,i,{passive:!0}),document.addEventListener(`touchmove`,a,{passive:!0}),document.addEventListener(`touchend`,o,{passive:!0}),document.addEventListener(`touchcancel`,s,{passive:!0}),()=>{c.current=null,document.removeEventListener(`touchstart`,i),document.removeEventListener(`touchmove`,a),document.removeEventListener(`touchend`,o),document.removeEventListener(`touchcancel`,s)}},[])}export{_ as n,x as r,v as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n,r}from"./use-edge-swipe-6PtOzG4E.js";import{t as i}from"./edge-swipe-arbiter-store-D9XJTxJJ.js";var a=e(t(),1),o=200,s=180,c=200,l=.25,u=50;function d(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function f({containerRef:e,onBack:t,enabled:f,navKey:p}){let m=(0,a.useRef)(t);(0,a.useLayoutEffect)(()=>{m.current=t},[t]);let h=(0,a.useRef)(!1),g=(0,a.useRef)(new Set),_=(0,a.useRef)(!1),v=i.use.registerBackOwner(),y=i.use.unregisterBackOwner();(0,a.useEffect)(()=>{if(f)return v(),y},[f,v,y]),(0,a.useEffect)(()=>{_.current=!1;let t=g.current;return()=>{_.current=!0;for(let e of t)clearTimeout(e);t.clear();let n=e.current;n&&d(n)}},[e]);let b=(e,t)=>{let n=setTimeout(()=>{g.current.delete(n),_.current||e()},t);g.current.add(n)},x=(e,t)=>{e.style.transform=t===0?``:`translateX(${t}px)`},S=e=>{e.style.transition=`transform ${o}ms ease-out`,x(e,0);let t=()=>{e.removeEventListener(`transitionend`,t),d(e)};e.addEventListener(`transitionend`,t,{once:!0}),b(()=>d(e),o+u)},C=e=>{e.style.transition=`transform ${s}ms ease-in`,x(e,window.innerWidth);let t=!1,n=()=>{if(t||_.current)return;t=!0,e.removeEventListener(`transitionend`,n);let r=-(window.innerWidth*l);e.style.transition=`none`,e.style.transform=`translateX(${r}px)`,e.style.opacity=`0`,e.offsetWidth,h.current=!0,m.current(),b(()=>{h.current&&(h.current=!1,d(e))},c*2)};e.addEventListener(`transitionend`,n,{once:!0}),b(n,s+u)};r({enabled:f,onConfirm:()=>{let t=e.current;t&&(t.style.transition=`none`,t.style.willChange=`transform`)},onMove:(t,r)=>{let i=e.current;i&&x(i,n(t,r))},onCommit:()=>{let t=e.current;if(!t){m.current();return}C(t)},onCancel:t=>{let n=e.current;n&&(t?S(n):d(n))}}),(0,a.useLayoutEffect)(()=>{if(!h.current)return;h.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),d(t))};t.style.transition=`transform ${c}ms ease-out, opacity ${c}ms ease-out`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,c+u);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),d(t)}},[p,e])}export{f as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n,r}from"./use-edge-swipe-DVeTYbmY.js";import{t as i}from"./edge-swipe-arbiter-store-DyemvsR-.js";var a=e(t(),1),o=200,s=180,c=200,l=.25,u=50;function d(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function f({containerRef:e,onBack:t,enabled:f,navKey:p}){let m=(0,a.useRef)(t);(0,a.useLayoutEffect)(()=>{m.current=t},[t]);let h=(0,a.useRef)(!1),g=(0,a.useRef)(new Set),_=(0,a.useRef)(!1),v=i.use.registerBackOwner(),y=i.use.unregisterBackOwner();(0,a.useEffect)(()=>{if(f)return v(),y},[f,v,y]),(0,a.useEffect)(()=>{_.current=!1;let t=g.current;return()=>{_.current=!0;for(let e of t)clearTimeout(e);t.clear();let n=e.current;n&&d(n)}},[e]);let b=(e,t)=>{let n=setTimeout(()=>{g.current.delete(n),_.current||e()},t);g.current.add(n)},x=(e,t)=>{e.style.transform=t===0?``:`translateX(${t}px)`},S=e=>{e.style.transition=`transform ${o}ms ease-out`,x(e,0);let t=()=>{e.removeEventListener(`transitionend`,t),d(e)};e.addEventListener(`transitionend`,t,{once:!0}),b(()=>d(e),o+u)},C=e=>{e.style.transition=`transform ${s}ms ease-in`,x(e,window.innerWidth);let t=!1,n=()=>{if(t||_.current)return;t=!0,e.removeEventListener(`transitionend`,n);let r=-(window.innerWidth*l);e.style.transition=`none`,e.style.transform=`translateX(${r}px)`,e.style.opacity=`0`,e.offsetWidth,h.current=!0,m.current(),b(()=>{h.current&&(h.current=!1,d(e))},c*2)};e.addEventListener(`transitionend`,n,{once:!0}),b(n,s+u)};r({enabled:f,onConfirm:()=>{let t=e.current;t&&(t.style.transition=`none`,t.style.willChange=`transform`)},onMove:(t,r)=>{let i=e.current;i&&x(i,n(t,r))},onCommit:()=>{let t=e.current;if(!t){m.current();return}C(t)},onCancel:t=>{let n=e.current;n&&(t?S(n):d(n))}}),(0,a.useLayoutEffect)(()=>{if(!h.current)return;h.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),d(t))};t.style.transition=`transform ${c}ms ease-out, opacity ${c}ms ease-out`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,c+u);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),d(t)}},[p,e])}export{f as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{l as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./typography-DEI9Ra9z.js";import{t as s}from"./createLucideIcon-CAM1RhH8.js";import{t as c}from"./chevron-up-2Qqarz0p.js";import{t as l}from"./menu-CKZtG-s_.js";import{t as u}from"./globe-CEgs-yoc.js";import{t as d}from"./loader-circle-BzJ2kz3F.js";import{n as f,t as p}from"./minimize-2-BR0ed4mI.js";import{t as m}from"./pencil-D38YNe2r.js";import{t as h}from"./x-DuBvjmAE.js";import"./src-B9F84D64.js";import{n as g,t as _}from"./panel-item-ldBYDDDs.js";import{n as v}from"./resolved-assistants-store-PdwcxGwN.js";import{t as y}from"./client.gen-Dq2brHDV.js";import{n as b}from"./event-bus-D2jlU6rm.js";import{u as x}from"./routes-bwxCYLJj.js";import{t as S}from"./conversation-store-C0tvFESx.js";import{r as C}from"./viewer-store-CLSpfTlZ.js";import{n as w}from"./use-is-mobile-Cx2xnNUx.js";import{t as T}from"./misc-CAQM4FGM.js";import{r as E,t as D}from"./edit-chat-session-BVmK2sam.js";import{n as O,t as k}from"./sandbox-bridge-BhR-nW2z.js";var A=s(`share`,[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]),j=e(t(),1),M=a();function N({appName:e,onEdit:t,isEditing:r,onShare:i,isSharing:a,onDeploy:s,isDeploying:l,onToggleFullscreen:p,onClose:g}){let _=w(),v=_&&r===!0&&t!=null,y=i!=null&&s!=null;return(0,M.jsxs)(`div`,{className:`flex items-center justify-between rounded-t-xl bg-[var(--surface-lift)] px-4 py-3`,children:[(0,M.jsx)(`div`,{className:`hidden md:flex items-center min-w-[72px]`,children:t!=null&&(0,M.jsx)(n,{onClick:t,children:r?`Close chat`:`Edit`})}),(0,M.jsx)(o,{variant:`body-large-default`,className:T(`flex-1 truncate text-left md:text-center text-[var(--content-emphasised)]`,v&&`cursor-pointer`),style:{lineHeight:1.4},onClick:v?t:void 0,children:e}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-[72px] justify-end`,children:[y?(0,M.jsx)(P,{onShare:i,isSharing:a,onDeploy:s,isDeploying:l,isMobile:_}):(0,M.jsxs)(M.Fragment,{children:[s!=null&&(0,M.jsx)(n,{variant:`outlined`,iconOnly:l?(0,M.jsx)(d,{className:`animate-spin`}):(0,M.jsx)(u,{}),onClick:s,disabled:l,tooltip:l?`Deploying…`:`Deploy`}),i!=null&&(0,M.jsx)(n,{variant:`outlined`,iconOnly:a?(0,M.jsx)(d,{className:`animate-spin`}):(0,M.jsx)(A,{}),onClick:i,disabled:a,tooltip:a?`Sharing…`:`Share`})]}),p!=null&&(0,M.jsx)(n,{variant:`outlined`,iconOnly:(0,M.jsx)(f,{}),onClick:p,tooltip:`Fullscreen`}),t!=null&&(0,M.jsx)(n,{variant:`outlined`,iconOnly:r?(0,M.jsx)(c,{}):(0,M.jsx)(m,{}),onClick:t,tooltip:r?`Open app`:`Edit`,active:r,className:`md:hidden`}),(0,M.jsx)(n,{variant:`outlined`,iconOnly:(0,M.jsx)(h,{}),onClick:g,tooltip:`Close`})]})]})}function P({onShare:e,isSharing:t,onDeploy:r,isDeploying:i,isMobile:a}){let[o,s]=(0,j.useState)(!1),c=t||i,f=c?(0,M.jsx)(d,{className:`animate-spin`}):(0,M.jsx)(A,{}),p=t?`Sharing…`:i?`Deploying…`:`Share & deploy`;return a?(0,M.jsxs)(g.Root,{open:o,onOpenChange:s,children:[(0,M.jsx)(g.Trigger,{asChild:!0,children:(0,M.jsx)(n,{variant:`outlined`,iconOnly:f,disabled:c,tooltip:p})}),(0,M.jsxs)(g.Content,{"aria-describedby":void 0,children:[(0,M.jsx)(g.Header,{className:`sr-only`,children:(0,M.jsx)(g.Title,{children:`Share & deploy`})}),(0,M.jsxs)(g.Body,{className:`pt-0`,children:[(0,M.jsx)(_,{icon:A,label:(0,M.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,M.jsx)(`span`,{children:`Share`}),(0,M.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Export as .vellum file`})]}),onSelect:()=>{s(!1),e()}}),(0,M.jsx)(_,{icon:u,label:(0,M.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,M.jsx)(`span`,{children:`Deploy to Vercel`}),(0,M.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Publish as a static page`})]}),onSelect:()=>{s(!1),r()}})]})]})]}):(0,M.jsxs)(l.Root,{open:o,onOpenChange:s,children:[(0,M.jsx)(l.Trigger,{asChild:!0,children:(0,M.jsx)(n,{variant:`outlined`,iconOnly:f,disabled:c,tooltip:p})}),(0,M.jsxs)(l.Content,{align:`end`,sideOffset:4,children:[(0,M.jsx)(l.Item,{leftIcon:(0,M.jsx)(A,{size:14}),onSelect:()=>e(),className:`whitespace-nowrap`,children:`Share`}),(0,M.jsx)(l.Item,{leftIcon:(0,M.jsx)(u,{size:14}),onSelect:()=>r(),className:`whitespace-nowrap`,children:`Deploy to Vercel`})]})]})}var F=[`assistant:`,`conversation:`,`conversations:`,`apps:`,`plugins:`,`feature-flags:`];function I(e){return F.some(t=>e.startsWith(t))}function L(e,t){if(e.length===0)return[];let n=new Set(e);return t.filter(e=>n.has(e)&&!I(e))}function R(e,t){let{frameId:n,assistantId:r,appId:i,enabled:a=!0,onAction:o,onOpenVellumLink:s}=t,c=(0,j.useRef)(new Map);(0,j.useEffect)(()=>{let t=c.current,l=async c=>{let l=c.data;if(!l||l.frameId!==n||c.source!==e.current?.contentWindow)return;if(l.type===`vellum_subscribe`){if(!a)return;let{subId:e,tags:n}=l;typeof e==`string`&&Array.isArray(n)&&t.set(e,new Set(n.filter(e=>typeof e==`string`)));return}if(l.type===`vellum_unsubscribe`){let{subId:e}=l;typeof e==`string`&&t.delete(e);return}if(l.type===`vellum_surface_action`){o?.(l.actionId,l.data);return}if(l.type===`vellum_open_link`){if(!navigator.userActivation?.isActive)return;s?.(l.href,l.linkText);return}if(l.type===`vellum_asset_request`){let{callId:t,path:n}=l,o=e.current,s=(e,t)=>{o?.contentWindow?.postMessage(e,`*`,t??[])};if(!a){s({type:`vellum_asset_response`,callId:t,error:`Asset proxy disabled`});return}if(!i){s({type:`vellum_asset_response`,callId:t,error:`No app context for assets`});return}if(typeof n!=`string`||n===``||n.includes(`..`)){s({type:`vellum_asset_response`,callId:t,error:`Invalid asset path`});return}try{let e=`/v1/assistants/${r}/apps/${i}/asset/${n.split(`/`).map(encodeURIComponent).join(`/`)}`,{data:a,response:o}=await y.get({url:e,parseAs:`blob`,throwOnError:!1});if(!o?.ok||!(a instanceof Blob)){s({type:`vellum_asset_response`,callId:t,error:`Asset fetch failed (${o?.status??0})`});return}let c=await a.arrayBuffer();s({type:`vellum_asset_response`,callId:t,buffer:c,contentType:a.type||`application/octet-stream`},[c])}catch(e){s({type:`vellum_asset_response`,callId:t,error:e instanceof Error?e.message:`Asset proxy error`})}return}if(!a||l.type!==`vellum_fetch_request`)return;let{callId:u,path:d,method:f,headers:p,body:m}=l,h=e.current,g=e=>{h?.contentWindow?.postMessage(e,`*`)};if(!k.test(d)){g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: only /v1/x/ custom routes are allowed`});return}try{let e=new URL(d,`https://placeholder`).pathname;if(!k.test(e)){g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: path traversal detected`});return}}catch{g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: invalid path`});return}let _=`/v1/assistants/${r}/${d.replace(/^\/v1\//,``)}`;try{let e={url:_,throwOnError:!1,headers:p&&Object.keys(p).length>0?p:void 0,body:m?JSON.parse(m):void 0},t=await(f===`POST`?y.post:f===`PUT`?y.put:f===`PATCH`?y.patch:f===`DELETE`?y.delete:y.get)(e),n=t.response,r=t.data??t.error,i=r==null?``:typeof r==`string`?r:JSON.stringify(r);g({type:`vellum_fetch_response`,callId:u,status:n?.status??0,statusText:n?.statusText??``,body:i})}catch(e){g({type:`vellum_fetch_response`,callId:u,error:e instanceof Error?e.message:`Fetch proxy error`})}};window.addEventListener(`message`,l);let u=b(`sse.event`,r=>{let i=r.message;if(!i||i.type!==`sync_changed`||!Array.isArray(i.tags))return;let a=e.current?.contentWindow;if(!a||t.size===0)return;let o=i.tags.filter(e=>typeof e==`string`);for(let[e,r]of t){let t=L([...r],o);t.length>0&&a.postMessage({type:`vellum_event`,frameId:n,subId:e,event:{type:`sync_changed`,tags:t}},`*`)}});return()=>{window.removeEventListener(`message`,l),u()}},[n,r,i,a,o,s,e])}function z({appId:e,appName:t,html:r,assistantId:i,onClose:a,onEdit:o,isEditing:s,onShare:c,isSharing:l,onDeploy:u,isDeploying:d,route:f,enableFullscreen:m=!1,onAction:h}){let g=(0,j.useRef)(null),[_,v]=(0,j.useState)(!1),y=(0,j.useCallback)(()=>v(e=>!e),[]);(0,j.useEffect)(()=>{v(!1)},[e]),(0,j.useEffect)(()=>{if(!_)return;let e=e=>{e.key===`Escape`&&v(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let b=(0,j.useMemo)(()=>O(r,e,{fetch:!0,route:f}),[r,e,f]),x=(0,j.useMemo)(()=>{let t=0;for(let e=0;e<r.length;e++)t=(t<<5)-t+r.charCodeAt(e)|0;return`app-${e}-${t}`},[r,e]);return R(g,{frameId:e,assistantId:i,appId:e,onAction:h}),(0,M.jsxs)(`div`,{"data-testid":`app-viewer-root`,className:T(`flex flex-col overflow-hidden bg-[var(--surface-base)]`,_?`fixed inset-0 z-[60]`:`h-full rounded-xl`),children:[!_&&(0,M.jsx)(N,{appName:t,onEdit:o,isEditing:s,onShare:c,isSharing:l,onDeploy:u,isDeploying:d,onToggleFullscreen:m?y:void 0,onClose:a}),(0,M.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[_&&(0,M.jsx)(`div`,{className:`absolute z-10`,style:{top:`max(0.75rem, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,right:`max(0.75rem, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:(0,M.jsx)(n,{variant:`primary`,iconOnly:(0,M.jsx)(p,{}),onClick:y,tooltip:`Exit fullscreen`})}),(0,M.jsx)(`iframe`,{ref:g,srcDoc:b,sandbox:`allow-scripts allow-popups allow-popups-to-escape-sandbox`,referrerPolicy:`no-referrer`,title:t,className:`h-full w-full border-none`},x)]})]})}function B(){let e=v.use.activeAssistantId(),t=w(),n=i(),{pathname:a}=r();return(0,j.useCallback)(r=>{if(!e)return;let i=D(e,r.appId)??crypto.randomUUID();E(e,r.appId,i);let o=C.getState();(o.activeAppId!==r.appId||!o.openedAppState)&&(o.openApp(r.appId),o.setLoadedApp(r)),S.getState().setEditingConversationId(i),t?o.minimizeApp():o.enterAppEditing();let s=x.conversation(i);a!==s&&n(s)},[e,t,n,a])}export{A as i,z as n,R as r,B as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{l as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./typography-DEI9Ra9z.js";import{t as s}from"./createLucideIcon-CAM1RhH8.js";import{t as c}from"./chevron-up-2Qqarz0p.js";import{t as l}from"./menu-BvjhxZo7.js";import{t as u}from"./globe-CMtjL_s_.js";import{t as d}from"./loader-circle-XREx3i4W.js";import{n as f,t as p}from"./minimize-2-CaXsUqSp.js";import{t as m}from"./pencil-D38YNe2r.js";import{t as h}from"./x-JBAsSOmg.js";import"./src-D89CNeuT.js";import{n as g,t as _}from"./panel-item-CrtoJCrd.js";import{n as v}from"./resolved-assistants-store-C-PdxK8f.js";import{t as y}from"./client.gen-CV05d-kw.js";import{n as b}from"./event-bus-DSxmBYhD.js";import{u as x}from"./routes-vE-2hncW.js";import{t as S}from"./conversation-store-bshB7nDP.js";import{r as C}from"./viewer-store-BDpZVbcr.js";import{n as w}from"./use-is-mobile-Bz2l7wPL.js";import{t as T}from"./misc-DckBb5zz.js";import{r as E,t as D}from"./edit-chat-session-yPtopwB6.js";import{n as O,t as k}from"./sandbox-bridge-DgDrAWv3.js";var A=s(`share`,[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]),j=e(t(),1),M=a();function N({appName:e,onEdit:t,isEditing:r,onShare:i,isSharing:a,onDeploy:s,isDeploying:l,onToggleFullscreen:p,onClose:g}){let _=w(),v=_&&r===!0&&t!=null,y=i!=null&&s!=null;return(0,M.jsxs)(`div`,{className:`flex items-center justify-between rounded-t-xl bg-[var(--surface-lift)] px-4 py-3`,children:[(0,M.jsx)(`div`,{className:`hidden md:flex items-center min-w-[72px]`,children:t!=null&&(0,M.jsx)(n,{onClick:t,children:r?`Close chat`:`Edit`})}),(0,M.jsx)(o,{variant:`body-large-default`,className:T(`flex-1 truncate text-left md:text-center text-[var(--content-emphasised)]`,v&&`cursor-pointer`),style:{lineHeight:1.4},onClick:v?t:void 0,children:e}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-[72px] justify-end`,children:[y?(0,M.jsx)(P,{onShare:i,isSharing:a,onDeploy:s,isDeploying:l,isMobile:_}):(0,M.jsxs)(M.Fragment,{children:[s!=null&&(0,M.jsx)(n,{variant:`outlined`,iconOnly:l?(0,M.jsx)(d,{className:`animate-spin`}):(0,M.jsx)(u,{}),onClick:s,disabled:l,tooltip:l?`Deploying…`:`Deploy`}),i!=null&&(0,M.jsx)(n,{variant:`outlined`,iconOnly:a?(0,M.jsx)(d,{className:`animate-spin`}):(0,M.jsx)(A,{}),onClick:i,disabled:a,tooltip:a?`Sharing…`:`Share`})]}),p!=null&&(0,M.jsx)(n,{variant:`outlined`,iconOnly:(0,M.jsx)(f,{}),onClick:p,tooltip:`Fullscreen`}),t!=null&&(0,M.jsx)(n,{variant:`outlined`,iconOnly:r?(0,M.jsx)(c,{}):(0,M.jsx)(m,{}),onClick:t,tooltip:r?`Open app`:`Edit`,active:r,className:`md:hidden`}),(0,M.jsx)(n,{variant:`outlined`,iconOnly:(0,M.jsx)(h,{}),onClick:g,tooltip:`Close`})]})]})}function P({onShare:e,isSharing:t,onDeploy:r,isDeploying:i,isMobile:a}){let[o,s]=(0,j.useState)(!1),c=t||i,f=c?(0,M.jsx)(d,{className:`animate-spin`}):(0,M.jsx)(A,{}),p=t?`Sharing…`:i?`Deploying…`:`Share & deploy`;return a?(0,M.jsxs)(g.Root,{open:o,onOpenChange:s,children:[(0,M.jsx)(g.Trigger,{asChild:!0,children:(0,M.jsx)(n,{variant:`outlined`,iconOnly:f,disabled:c,tooltip:p})}),(0,M.jsxs)(g.Content,{"aria-describedby":void 0,children:[(0,M.jsx)(g.Header,{className:`sr-only`,children:(0,M.jsx)(g.Title,{children:`Share & deploy`})}),(0,M.jsxs)(g.Body,{className:`pt-0`,children:[(0,M.jsx)(_,{icon:A,label:(0,M.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,M.jsx)(`span`,{children:`Share`}),(0,M.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Export as .vellum file`})]}),onSelect:()=>{s(!1),e()}}),(0,M.jsx)(_,{icon:u,label:(0,M.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,M.jsx)(`span`,{children:`Deploy to Vercel`}),(0,M.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Publish as a static page`})]}),onSelect:()=>{s(!1),r()}})]})]})]}):(0,M.jsxs)(l.Root,{open:o,onOpenChange:s,children:[(0,M.jsx)(l.Trigger,{asChild:!0,children:(0,M.jsx)(n,{variant:`outlined`,iconOnly:f,disabled:c,tooltip:p})}),(0,M.jsxs)(l.Content,{align:`end`,sideOffset:4,children:[(0,M.jsx)(l.Item,{leftIcon:(0,M.jsx)(A,{size:14}),onSelect:()=>e(),className:`whitespace-nowrap`,children:`Share`}),(0,M.jsx)(l.Item,{leftIcon:(0,M.jsx)(u,{size:14}),onSelect:()=>r(),className:`whitespace-nowrap`,children:`Deploy to Vercel`})]})]})}var F=[`assistant:`,`conversation:`,`conversations:`,`apps:`,`plugins:`,`feature-flags:`];function I(e){return F.some(t=>e.startsWith(t))}function L(e,t){if(e.length===0)return[];let n=new Set(e);return t.filter(e=>n.has(e)&&!I(e))}function R(e,t){let{frameId:n,assistantId:r,appId:i,enabled:a=!0,onAction:o,onOpenVellumLink:s}=t,c=(0,j.useRef)(new Map);(0,j.useEffect)(()=>{let t=c.current,l=async c=>{let l=c.data;if(!l||l.frameId!==n||c.source!==e.current?.contentWindow)return;if(l.type===`vellum_subscribe`){if(!a)return;let{subId:e,tags:n}=l;typeof e==`string`&&Array.isArray(n)&&t.set(e,new Set(n.filter(e=>typeof e==`string`)));return}if(l.type===`vellum_unsubscribe`){let{subId:e}=l;typeof e==`string`&&t.delete(e);return}if(l.type===`vellum_surface_action`){o?.(l.actionId,l.data);return}if(l.type===`vellum_open_link`){if(!navigator.userActivation?.isActive)return;s?.(l.href,l.linkText);return}if(l.type===`vellum_asset_request`){let{callId:t,path:n}=l,o=e.current,s=(e,t)=>{o?.contentWindow?.postMessage(e,`*`,t??[])};if(!a){s({type:`vellum_asset_response`,callId:t,error:`Asset proxy disabled`});return}if(!i){s({type:`vellum_asset_response`,callId:t,error:`No app context for assets`});return}if(typeof n!=`string`||n===``||n.includes(`..`)){s({type:`vellum_asset_response`,callId:t,error:`Invalid asset path`});return}try{let e=`/v1/assistants/${r}/apps/${i}/asset/${n.split(`/`).map(encodeURIComponent).join(`/`)}`,{data:a,response:o}=await y.get({url:e,parseAs:`blob`,throwOnError:!1});if(!o?.ok||!(a instanceof Blob)){s({type:`vellum_asset_response`,callId:t,error:`Asset fetch failed (${o?.status??0})`});return}let c=await a.arrayBuffer();s({type:`vellum_asset_response`,callId:t,buffer:c,contentType:a.type||`application/octet-stream`},[c])}catch(e){s({type:`vellum_asset_response`,callId:t,error:e instanceof Error?e.message:`Asset proxy error`})}return}if(!a||l.type!==`vellum_fetch_request`)return;let{callId:u,path:d,method:f,headers:p,body:m}=l,h=e.current,g=e=>{h?.contentWindow?.postMessage(e,`*`)};if(!k.test(d)){g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: only /v1/x/ custom routes are allowed`});return}try{let e=new URL(d,`https://placeholder`).pathname;if(!k.test(e)){g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: path traversal detected`});return}}catch{g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: invalid path`});return}let _=`/v1/assistants/${r}/${d.replace(/^\/v1\//,``)}`;try{let e={url:_,throwOnError:!1,headers:p&&Object.keys(p).length>0?p:void 0,body:m?JSON.parse(m):void 0},t=await(f===`POST`?y.post:f===`PUT`?y.put:f===`PATCH`?y.patch:f===`DELETE`?y.delete:y.get)(e),n=t.response,r=t.data??t.error,i=r==null?``:typeof r==`string`?r:JSON.stringify(r);g({type:`vellum_fetch_response`,callId:u,status:n?.status??0,statusText:n?.statusText??``,body:i})}catch(e){g({type:`vellum_fetch_response`,callId:u,error:e instanceof Error?e.message:`Fetch proxy error`})}};window.addEventListener(`message`,l);let u=b(`sse.event`,r=>{let i=r.message;if(!i||i.type!==`sync_changed`||!Array.isArray(i.tags))return;let a=e.current?.contentWindow;if(!a||t.size===0)return;let o=i.tags.filter(e=>typeof e==`string`);for(let[e,r]of t){let t=L([...r],o);t.length>0&&a.postMessage({type:`vellum_event`,frameId:n,subId:e,event:{type:`sync_changed`,tags:t}},`*`)}});return()=>{window.removeEventListener(`message`,l),u()}},[n,r,i,a,o,s,e])}function z({appId:e,appName:t,html:r,assistantId:i,onClose:a,onEdit:o,isEditing:s,onShare:c,isSharing:l,onDeploy:u,isDeploying:d,route:f,enableFullscreen:m=!1,onAction:h}){let g=(0,j.useRef)(null),[_,v]=(0,j.useState)(!1),y=(0,j.useCallback)(()=>v(e=>!e),[]);(0,j.useEffect)(()=>{v(!1)},[e]),(0,j.useEffect)(()=>{if(!_)return;let e=e=>{e.key===`Escape`&&v(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let b=(0,j.useMemo)(()=>O(r,e,{fetch:!0,route:f}),[r,e,f]),x=(0,j.useMemo)(()=>{let t=0;for(let e=0;e<r.length;e++)t=(t<<5)-t+r.charCodeAt(e)|0;return`app-${e}-${t}`},[r,e]);return R(g,{frameId:e,assistantId:i,appId:e,onAction:h}),(0,M.jsxs)(`div`,{"data-testid":`app-viewer-root`,className:T(`flex flex-col overflow-hidden bg-[var(--surface-base)]`,_?`fixed inset-0 z-[60]`:`h-full rounded-xl`),children:[!_&&(0,M.jsx)(N,{appName:t,onEdit:o,isEditing:s,onShare:c,isSharing:l,onDeploy:u,isDeploying:d,onToggleFullscreen:m?y:void 0,onClose:a}),(0,M.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[_&&(0,M.jsx)(`div`,{className:`absolute z-10`,style:{top:`max(0.75rem, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,right:`max(0.75rem, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:(0,M.jsx)(n,{variant:`primary`,iconOnly:(0,M.jsx)(p,{}),onClick:y,tooltip:`Exit fullscreen`})}),(0,M.jsx)(`iframe`,{ref:g,srcDoc:b,sandbox:`allow-scripts allow-popups allow-popups-to-escape-sandbox`,referrerPolicy:`no-referrer`,title:t,className:`h-full w-full border-none`},x)]})]})}function B(){let e=v.use.activeAssistantId(),t=w(),n=i(),{pathname:a}=r();return(0,j.useCallback)(r=>{if(!e)return;let i=D(e,r.appId)??crypto.randomUUID();E(e,r.appId,i);let o=C.getState();(o.activeAppId!==r.appId||!o.openedAppState)&&(o.openApp(r.appId),o.setLoadedApp(r)),S.getState().setEditingConversationId(i),t?o.minimizeApp():o.enterAppEditing();let s=x.conversation(i);a!==s&&n(s)},[e,t,n,a])}export{A as i,z as n,R as r,B as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{s as t}from"./device-settings-DXp9L4iB.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./use-bus-subscription-DIENjckU.js";import{t as i}from"./effective-timezone-CnKC3vj0.js";var a=e(n(),1);function o(){let[e,n]=(0,a.useState)(i),o=(0,a.useCallback)(()=>{n(e=>{let t=i();return t===e?e:t})},[]);return r(`app.resume`,o),(0,a.useEffect)(()=>{window.addEventListener(`focus`,o);let e=t(`timezone`,o);return()=>{window.removeEventListener(`focus`,o),e()}},[o]),e}export{o as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{s as t}from"./device-settings-DXp9L4iB.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./use-bus-subscription-Cu4Y9DQi.js";import{t as i}from"./effective-timezone-qiooajmO.js";var a=e(n(),1);function o(){let[e,n]=(0,a.useState)(i),o=(0,a.useCallback)(()=>{n(e=>{let t=i();return t===e?e:t})},[]);return r(`app.resume`,o),(0,a.useEffect)(()=>{window.addEventListener(`focus`,o);let e=t(`timezone`,o);return()=>{window.removeEventListener(`focus`,o),e()}},[o]),e}export{o as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./useMutation-CXGTrp4W.js";import{t as o}from"./jsx-runtime-D3ZM-ToX.js";import{t as s}from"./typography-DEI9Ra9z.js";import{c,i as l,m as u,n as d,p as f,r as p,s as m,t as h}from"./use-save-twilio-credentials-BDbv1FdS.js";import{t as g}from"./check-sC49_hjU.js";import{o as _}from"./list-row-MeHwwyA6.js";import{t as v}from"./link-2-BMNZFfWH.js";import{t as y}from"./loader-circle-BzJ2kz3F.js";import{t as b}from"./input-C-GkeWCw.js";import{t as x}from"./modal-DwsThLGg.js";import{Jt as S,Qt as C,en as w}from"./sdk.gen-CsFDyJ6U.js";import{G as T,K as E,U as D,W as O,o as k,s as A,x as j}from"./react-query.gen-CbsPBjd9.js";import{r as M}from"./utils-CrvvcikL.js";import{n as N,r as P,t as F}from"./api-errors-BRGPPSWw.js";import{n as I}from"./sdk.gen-DEFA-6EJ.js";import{t as L}from"./mutation-error--1w2EbUT.js";import{t as R}from"./a2a-invite-h0ZA9fjr.js";function z(e){return e?.trim()||`your assistant`}var B=e(t(),1),V=o(),H=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],U=`trusted_contacts`,W=new Set([`platform`,`a2a`]),G=new Set([`vellum`,`whatsapp`]);function K(e){return G.has(e)}var q={no_one:`No one`,guardian_only:`Only you`,trusted_contacts:`Verified contacts`,any_contact:`Any contact`,strangers:`Strangers`};function J(e){return{no_one:`No one can message ${e} on this channel — every message is blocked, including yours.`,guardian_only:`Only you can message ${e}. Everyone else is turned away.`,trusted_contacts:`You and the people you’ve verified can message ${e}. Anyone else is asked to verify first, and you’re notified.`,any_contact:`You and any known contact can message ${e}, including contacts you haven’t verified yet. Strangers are asked to verify first.`,strangers:`Anyone can message ${e}, including complete strangers.`}}function Y(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function X({open:e,assistantId:t,onClose:r}){let[i,o]=(0,B.useState)(!1),c=(0,B.useRef)(null),l=(0,B.useRef)(!1),u=a({...D({path:{assistant_id:t}})}),d=(0,B.useRef)(u.mutate);(0,B.useLayoutEffect)(()=>{d.current=u.mutate});let f=(0,B.useRef)(u.reset);(0,B.useLayoutEffect)(()=>{f.current=u.reset}),(0,B.useEffect)(()=>{e&&!l.current&&d.current({path:{assistant_id:t}}),l.current=e},[e,t]),(0,B.useEffect)(()=>()=>{c.current&&clearTimeout(c.current)},[]);let p=(0,B.useCallback)(()=>{f.current(),o(!1),c.current&&=(clearTimeout(c.current),null),r()},[r]),m=(0,B.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{o(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>o(!1),2e3)})},[]),h=u.isSuccess&&u.data.token?R({senderAssistantId:t,token:u.data.token}):``;return(0,V.jsx)(x.Root,{open:e,onOpenChange:e=>{e||p()},children:(0,V.jsxs)(x.Content,{size:`sm`,children:[(0,V.jsx)(x.Header,{children:(0,V.jsx)(x.Title,{children:`Share Connection Link`})}),(0,V.jsx)(x.Body,{children:u.isPending?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,V.jsx)(y,{className:`h-4 w-4 animate-spin`}),`Creating invite link…`]}):u.isError?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:`Failed to create invite link. Make sure A2A is enabled for your assistant.`}),(0,V.jsx)(n,{variant:`outlined`,onClick:()=>u.mutate({path:{assistant_id:t}}),children:`Try Again`})]}):u.isSuccess?(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,V.jsx)(s,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Share this link with another assistant owner to establish a connection.`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(b,{type:`text`,readOnly:!0,value:h,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(h),"aria-label":`Copy invite link`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-[var(--border-base)] hover:bg-[var(--surface-hover)]`,children:i?(0,V.jsx)(g,{className:`h-4 w-4`}):(0,V.jsx)(_,{className:`h-4 w-4`})})]}),u.data.expiresAt!=null&&(0,V.jsx)(s,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:Y(u.data.expiresAt)})]}):null}),(0,V.jsx)(x.Footer,{children:(0,V.jsx)(n,{variant:`outlined`,onClick:p,children:`Done`})})]})})}function Z({onClick:e}){return(0,V.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:(0,V.jsx)(v,{className:`h-3.5 w-3.5`}),onClick:e,children:`Share Connection Link`})}function Q(e){return typeof e==`string`&&H.includes(e)}function $(e){return W.has(e)}function ee(e){return(e?.policies??[]).filter(e=>!$(e.channelType)&&!K(e.channelType)).map(e=>({...e,policy:Q(e.policy)?e.policy:`trusted_contacts`}))}async function te(e,t,n,r){if($(t))throw new F(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await I({path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},throwOnError:!1});if(N(o,a,`Failed to save channel policy.`),!o.ok)throw new F(o.status,P(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new F(500,`Gateway returned no policy in response.`);return i.policy}var ne=`0.10.0`;function re(){return M(ne)}function ie(e){let t=r(),n=re(),o=(0,B.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,B.useMemo)(()=>u(o),[o]),l=i({...f(o),enabled:n,select:ee}),d=(0,B.useMemo)(()=>{let e={};for(let t of l.data??[])c(t.channelType)&&(e[t.channelType]=t.policy);return e},[l.data]),p=a({mutationFn:({channelKey:t,policy:n})=>te(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:s}),onError:L(`Failed to save channel policy`)}),m=(0,B.useCallback)((e,t)=>{p.mutate({channelKey:e,policy:t})},[p]);return n?{policies:d,savingKey:p.isPending?p.variables?.channelKey??null:null,isLoading:l.isPending,isError:l.isError,onChange:m}:{policies:void 0,savingKey:null,isLoading:!1,isError:!1,onChange:void 0}}var ae={slack:`I want to reach you on Slack. Let's set it up.`,telegram:`I want to reach you on Telegram. Let's set it up.`,phone:`I want to be able to call you. Let's set you up with a phone number.`},oe=15e3;function se({assistantId:e,onStartSetupConversation:t}){let n=r(),o=(0,B.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,B.useMemo)(()=>A(o),[o]),c=i({...k(o),enabled:!!e,refetchInterval:oe,select:e=>e.snapshots}),u=(0,B.useMemo)(()=>ce(c.data??[]),[c.data]),f=u.some(e=>e.key===`slack`&&e.status===`ready`),m=i({...O(o),enabled:f,select:e=>e.threadMode}),g=ie(e),_=(0,B.useCallback)(()=>n.invalidateQueries({queryKey:s}),[n,s]),v=a({mutationFn:async t=>{let n={path:{assistant_id:e},throwOnError:!0};t===`slack`?await S(n):t===`telegram`?await C(n):t===`phone`&&await w(n)},onSettled:(t,r,i)=>{_(),i===`slack`&&l(n,e)}}),y=d({assistantId:e}),b=p({assistantId:e}),x=h({assistantId:e}),D=a({...E(),onSuccess:()=>{n.invalidateQueries({queryKey:T(o)})}}),j=y.mutateAsync,M=(0,B.useCallback)(async e=>{await j(e)},[j]),N=b.mutate,P=(0,B.useCallback)((e,t)=>{N({botToken:e,appToken:t})},[N]),F=D.mutate,I=(0,B.useCallback)(t=>{F({path:{assistant_id:e},body:{threadMode:t}})},[F,e]),L=x.mutateAsync,R=(0,B.useCallback)(async(e,t)=>{await L({accountSid:e,authToken:t})},[L]),z=(0,B.useCallback)(e=>{t&&t(ae[e])},[t]),V=v.mutate,H=(0,B.useCallback)(e=>{V(e)},[V]);return{channels:u,pendingChannelKey:v.isPending?v.variables??null:null,slackThreadMode:m.data,slackThreadModePending:D.isPending,channelPolicies:g.policies,policySavingKey:g.savingKey,policiesLoading:g.isLoading,policiesError:g.isError,onChannelPolicyChange:g.onChange,onSetup:t?z:void 0,onDisconnect:H,onSaveTelegramToken:M,onSaveSlackConfig:P,slackSaveStatus:b.status,slackSaveError:b.error?.message??null,onSlackThreadModeChange:I,onSaveTwilioCredentials:R}}function ce(e){let t=new Map;for(let n of e)t.set(n.channel,n);return m.map(e=>{let n=t.get(e);return{key:e,status:le(n),address:n?.channelHandle??void 0}})}function le(e){return e?e.ready||e.setupStatus===`ready`?`ready`:e.setupStatus===`incomplete`?`incomplete`:`not_configured`:`not_configured`}function ue(e){let t=r(),[n,i]=(0,B.useState)(!1);return{isOpen:n,open:(0,B.useCallback)(()=>{i(!0)},[]),close:(0,B.useCallback)(()=>{i(!1),t.invalidateQueries({queryKey:j({path:{assistant_id:e}})})},[t,e])}}export{U as a,J as c,X as i,z as l,se as n,H as o,Z as r,q as s,ue as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./useMutation-CXGTrp4W.js";import{t as o}from"./jsx-runtime-D3ZM-ToX.js";import{t as s}from"./typography-DEI9Ra9z.js";import{c,i as l,m as u,n as d,p as f,r as p,s as m,t as h}from"./use-save-twilio-credentials-CUQ6gdIj.js";import{t as g}from"./check-sC49_hjU.js";import{o as _}from"./list-row-B1wPb2Au.js";import{t as v}from"./link-2-BKL8QWRX.js";import{t as y}from"./loader-circle-XREx3i4W.js";import{t as b}from"./input-hw3el2GJ.js";import{t as x}from"./modal-BR4CUFBd.js";import{Jt as S,Qt as C,en as w}from"./sdk.gen-BVAVE6A_.js";import{G as T,K as E,U as D,W as O,o as k,s as A,x as j}from"./react-query.gen-r3I6j8-1.js";import{r as M}from"./utils-CnB60ZJN.js";import{n as N,r as P,t as F}from"./api-errors-CFiCT7Ap.js";import{n as I}from"./sdk.gen-DPKrJeho.js";import{t as L}from"./mutation-error-CwYvaYnb.js";import{t as R}from"./a2a-invite-DUYZLVQb.js";function z(e){return e?.trim()||`your assistant`}var B=e(t(),1),V=o(),H=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],U=`trusted_contacts`,W=new Set([`platform`,`a2a`]),G=new Set([`vellum`,`whatsapp`]);function K(e){return G.has(e)}var q={no_one:`No one`,guardian_only:`Only you`,trusted_contacts:`Verified contacts`,any_contact:`Any contact`,strangers:`Strangers`};function J(e){return{no_one:`No one can message ${e} on this channel — every message is blocked, including yours.`,guardian_only:`Only you can message ${e}. Everyone else is turned away.`,trusted_contacts:`You and the people you’ve verified can message ${e}. Anyone else is asked to verify first, and you’re notified.`,any_contact:`You and any known contact can message ${e}, including contacts you haven’t verified yet. Strangers are asked to verify first.`,strangers:`Anyone can message ${e}, including complete strangers.`}}function Y(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function X({open:e,assistantId:t,onClose:r}){let[i,o]=(0,B.useState)(!1),c=(0,B.useRef)(null),l=(0,B.useRef)(!1),u=a({...D({path:{assistant_id:t}})}),d=(0,B.useRef)(u.mutate);(0,B.useLayoutEffect)(()=>{d.current=u.mutate});let f=(0,B.useRef)(u.reset);(0,B.useLayoutEffect)(()=>{f.current=u.reset}),(0,B.useEffect)(()=>{e&&!l.current&&d.current({path:{assistant_id:t}}),l.current=e},[e,t]),(0,B.useEffect)(()=>()=>{c.current&&clearTimeout(c.current)},[]);let p=(0,B.useCallback)(()=>{f.current(),o(!1),c.current&&=(clearTimeout(c.current),null),r()},[r]),m=(0,B.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{o(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>o(!1),2e3)})},[]),h=u.isSuccess&&u.data.token?R({senderAssistantId:t,token:u.data.token}):``;return(0,V.jsx)(x.Root,{open:e,onOpenChange:e=>{e||p()},children:(0,V.jsxs)(x.Content,{size:`sm`,children:[(0,V.jsx)(x.Header,{children:(0,V.jsx)(x.Title,{children:`Share Connection Link`})}),(0,V.jsx)(x.Body,{children:u.isPending?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,V.jsx)(y,{className:`h-4 w-4 animate-spin`}),`Creating invite link…`]}):u.isError?(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:`Failed to create invite link. Make sure A2A is enabled for your assistant.`}),(0,V.jsx)(n,{variant:`outlined`,onClick:()=>u.mutate({path:{assistant_id:t}}),children:`Try Again`})]}):u.isSuccess?(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,V.jsx)(s,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Share this link with another assistant owner to establish a connection.`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(b,{type:`text`,readOnly:!0,value:h,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(h),"aria-label":`Copy invite link`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-[var(--border-base)] hover:bg-[var(--surface-hover)]`,children:i?(0,V.jsx)(g,{className:`h-4 w-4`}):(0,V.jsx)(_,{className:`h-4 w-4`})})]}),u.data.expiresAt!=null&&(0,V.jsx)(s,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:Y(u.data.expiresAt)})]}):null}),(0,V.jsx)(x.Footer,{children:(0,V.jsx)(n,{variant:`outlined`,onClick:p,children:`Done`})})]})})}function Z({onClick:e}){return(0,V.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:(0,V.jsx)(v,{className:`h-3.5 w-3.5`}),onClick:e,children:`Share Connection Link`})}function Q(e){return typeof e==`string`&&H.includes(e)}function $(e){return W.has(e)}function ee(e){return(e?.policies??[]).filter(e=>!$(e.channelType)&&!K(e.channelType)).map(e=>({...e,policy:Q(e.policy)?e.policy:`trusted_contacts`}))}async function te(e,t,n,r){if($(t))throw new F(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await I({path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},throwOnError:!1});if(N(o,a,`Failed to save channel policy.`),!o.ok)throw new F(o.status,P(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new F(500,`Gateway returned no policy in response.`);return i.policy}var ne=`0.10.0`;function re(){return M(ne)}function ie(e){let t=r(),n=re(),o=(0,B.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,B.useMemo)(()=>u(o),[o]),l=i({...f(o),enabled:n,select:ee}),d=(0,B.useMemo)(()=>{let e={};for(let t of l.data??[])c(t.channelType)&&(e[t.channelType]=t.policy);return e},[l.data]),p=a({mutationFn:({channelKey:t,policy:n})=>te(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:s}),onError:L(`Failed to save channel policy`)}),m=(0,B.useCallback)((e,t)=>{p.mutate({channelKey:e,policy:t})},[p]);return n?{policies:d,savingKey:p.isPending?p.variables?.channelKey??null:null,isLoading:l.isPending,isError:l.isError,onChange:m}:{policies:void 0,savingKey:null,isLoading:!1,isError:!1,onChange:void 0}}var ae={slack:`I want to reach you on Slack. Let's set it up.`,telegram:`I want to reach you on Telegram. Let's set it up.`,phone:`I want to be able to call you. Let's set you up with a phone number.`},oe=15e3;function se({assistantId:e,onStartSetupConversation:t}){let n=r(),o=(0,B.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,B.useMemo)(()=>A(o),[o]),c=i({...k(o),enabled:!!e,refetchInterval:oe,select:e=>e.snapshots}),u=(0,B.useMemo)(()=>ce(c.data??[]),[c.data]),f=u.some(e=>e.key===`slack`&&e.status===`ready`),m=i({...O(o),enabled:f,select:e=>e.threadMode}),g=ie(e),_=(0,B.useCallback)(()=>n.invalidateQueries({queryKey:s}),[n,s]),v=a({mutationFn:async t=>{let n={path:{assistant_id:e},throwOnError:!0};t===`slack`?await S(n):t===`telegram`?await C(n):t===`phone`&&await w(n)},onSettled:(t,r,i)=>{_(),i===`slack`&&l(n,e)}}),y=d({assistantId:e}),b=p({assistantId:e}),x=h({assistantId:e}),D=a({...E(),onSuccess:()=>{n.invalidateQueries({queryKey:T(o)})}}),j=y.mutateAsync,M=(0,B.useCallback)(async e=>{await j(e)},[j]),N=b.mutate,P=(0,B.useCallback)((e,t)=>{N({botToken:e,appToken:t})},[N]),F=D.mutate,I=(0,B.useCallback)(t=>{F({path:{assistant_id:e},body:{threadMode:t}})},[F,e]),L=x.mutateAsync,R=(0,B.useCallback)(async(e,t)=>{await L({accountSid:e,authToken:t})},[L]),z=(0,B.useCallback)(e=>{t&&t(ae[e])},[t]),V=v.mutate,H=(0,B.useCallback)(e=>{V(e)},[V]);return{channels:u,pendingChannelKey:v.isPending?v.variables??null:null,slackThreadMode:m.data,slackThreadModePending:D.isPending,channelPolicies:g.policies,policySavingKey:g.savingKey,policiesLoading:g.isLoading,policiesError:g.isError,onChannelPolicyChange:g.onChange,onSetup:t?z:void 0,onDisconnect:H,onSaveTelegramToken:M,onSaveSlackConfig:P,slackSaveStatus:b.status,slackSaveError:b.error?.message??null,onSlackThreadModeChange:I,onSaveTwilioCredentials:R}}function ce(e){let t=new Map;for(let n of e)t.set(n.channel,n);return m.map(e=>{let n=t.get(e);return{key:e,status:le(n),address:n?.channelHandle??void 0}})}function le(e){return e?e.ready||e.setupStatus===`ready`?`ready`:e.setupStatus===`incomplete`?`incomplete`:`not_configured`:`not_configured`}function ue(e){let t=r(),[n,i]=(0,B.useState)(!1);return{isOpen:n,open:(0,B.useCallback)(()=>{i(!0)},[]),close:(0,B.useCallback)(()=>{i(!1),t.invalidateQueries({queryKey:j({path:{assistant_id:e}})})},[t,e])}}export{U as a,J as c,X as i,z as l,se as n,H as o,Z as r,q as s,ue as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,r as n,s as r,t as i}from"./local-settings-C-dW2vkq.js";import{s as a}from"./device-settings-DXp9L4iB.js";import{t as o}from"./react-BFJW0bSv.js";import{t as s}from"./button-Dy5001j6.js";import{t as c}from"./jsx-runtime-D3ZM-ToX.js";import{t as l}from"./createLucideIcon-CAM1RhH8.js";import{t as u}from"./checkbox-BY0BDJjm.js";import{t as d}from"./triangle-alert-CQfiAg_t.js";import{t as f}from"./notice-BMK7xqUw.js";import"./src-D89CNeuT.js";import{t as p}from"./modal-BR4CUFBd.js";import{i as m,t as h}from"./api-XwdNiVE9.js";import{i as g,r as _}from"./typed-storage-9Sn8tkE7.js";import{t as v}from"./client-feature-flag-store-oTfL8Oiz.js";import{n as y,r as b,t as x}from"./theme-preferences-ln8xC5zH.js";import{t as S}from"./use-bus-subscription-Cu4Y9DQi.js";import{o as C}from"./funnel-events-CK938pi2.js";var w=l(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),T=l(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]);function ee(){return v.use.stringFlags().proactiveTips??`off`}function te(e){return e===`on`}function E(e){return e===void 0||typeof e==`number`&&Number.isFinite(e)}function D(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.shownCount==`number`&&Number.isFinite(t.shownCount)&&E(t.dismissedAt)&&E(t.lastShownAt)}function O(e){let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return null;let n={};for(let[e,r]of Object.entries(t))D(r)&&(n[e]=r);return n}function k(e){let t=Number(e);return Number.isFinite(t)&&t>=0?t:null}var A=_({key:`device:tips:records`,scope:`device`,parse:O,serialize:JSON.stringify,fallback:{}}),j=_({key:`device:tips:enabled`,scope:`device`,parse:g,serialize:String,fallback:!0}),M=_({key:`device:tips:first_seen_at`,scope:`device`,parse:k,serialize:String,fallback:0});function ne(){M.load()===0&&M.save(Date.now())}function re(e,t){let n=A.load(),r=n[e];A.save({...n,[e]:{...r,lastShownAt:t,shownCount:(r?.shownCount??0)+1}})}function ie(e,t){let n=A.load(),r=n[e];A.save({...n,[e]:{...r,dismissedAt:t,shownCount:r?.shownCount??0}})}var ae=`proactive-tips-v1`,oe={impression:0,learn_more:1,dismiss:2,dont_show_again:3,click:4,completion:5};function se(e,t,n){C({stepName:t,stepIndex:oe[t]},{funnelVersion:ae,screen:e,variant:n})}var N=e(o(),1);function P(){let e=v.use.velvet(),[t,n]=(0,N.useState)(()=>y({velvetEnabled:e}));return(0,N.useEffect)(()=>{n(y({velvetEnabled:e}))},[e]),(0,N.useEffect)(()=>a(`theme`,()=>{n(y({velvetEnabled:e}))}),[e]),(0,N.useEffect)(()=>{x(t)},[t]),{theme:t,setThemePreference:e=>{n(e),b(e)}}}var F=6e4;function I(e){return!!(e?.enabled&&e.effectivelyLocked)}function L(e){return I(e)?e.acknowledged&&!e.overrideActive:!1}function R(e){return!!(e&&I(e)&&!e.acknowledged&&!e.overrideActive)}function z(e){return!!(e?.enabled&&e.state===`warning`)}function B(e){return R(e)?`acknowledgement-required`:L(e)?`cleanup`:z(e)?`warning`:`inactive`}function V({monitorEnabled:e,hasResolvedStatus:t,status:n}){return!e||!t?null:R(n)?`acknowledgement-required`:null}function H(e){return`Storage cleanup mode must be acknowledged before sending messages.`}function U(e,t){return e===t?!0:!e||!t?!1:e.enabled===t.enabled&&e.state===t.state&&e.locked===t.locked&&e.acknowledged===t.acknowledged&&e.overrideActive===t.overrideActive&&e.effectivelyLocked===t.effectivelyLocked&&e.lockId===t.lockId&&e.usagePercent===t.usagePercent&&e.thresholdPercent===t.thresholdPercent&&e.path===t.path&&e.lastCheckedAt===t.lastCheckedAt&&e.error===t.error&&e.blockedCapabilities.length===t.blockedCapabilities.length&&e.blockedCapabilities.every((e,n)=>e===t.blockedCapabilities[n])}function W(e){return e?.usagePercent==null||!Number.isFinite(e.usagePercent)?`Unknown`:`${Math.round(e.usagePercent)}%`}var G={assistantId:null,status:null,hasResolvedStatus:!1};function ce(e,t){return e instanceof Error?e:Error(t)}function le({assistantId:e,enabled:t,refreshKey:n,cadenceMs:r=F}){let[i,a]=(0,N.useState)(G),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(null),u=(0,N.useRef)(e),d=(0,N.useRef)(t),f=(0,N.useRef)(0),p=(0,N.useRef)(0);(0,N.useLayoutEffect)(()=>{u.current=e,d.current=t}),(0,N.useEffect)(()=>{f.current+=1,a(G),l(null),s(!1)},[e,t]);let g=(0,N.useCallback)((e,t)=>d.current&&u.current===e&&f.current===t,[]),_=(0,N.useCallback)((e,t,n,r)=>{g(e,r)&&a(r=>r.assistantId===e&&r.hasResolvedStatus===n&&U(r.status,t)?r:{assistantId:e,status:t,hasResolvedStatus:n})},[g]),v=(0,N.useCallback)(()=>{f.current+=1,a(G)},[]),y=(0,N.useCallback)(async()=>{let n=e;if(!t||!n){v();return}let r=f.current,i=p.current+1;p.current=i;try{let e=await m(n);if(p.current!==i)return;if(!e.ok){_(n,null,!1,r);return}_(n,e.data.status,!0,r)}catch{if(p.current!==i)return;_(n,null,!1,r)}},[e,_,v,t]);(0,N.useEffect)(()=>{if(!t||!e)return;y();let n=window.setInterval(()=>{y()},r);return()=>{window.clearInterval(n)}},[e,r,t,y,n]),S(`app.resume`,()=>{y()});let b=(0,N.useCallback)(n=>{if(!t||!e){v();return}let r=f.current+1;f.current=r,s(!1),l(null),_(e,n,!0,r)},[e,_,v,t]);S(`sse.event`,e=>{let t=e.message;t.type===`disk_pressure_status_changed`&&b(t.status)});let x=(0,N.useCallback)(async()=>{let n=e;if(!t||!n){v();return}let r=f.current+1;f.current=r,s(!0),l(null);try{let e=await h(n);if(!e.ok)throw Error(`Failed to acknowledge assistant disk pressure.`);if(!g(n,r))return;let t=f.current+1;f.current=t,_(n,e.data.status,!0,t),s(!1)}catch(e){g(n,r)&&l(ce(e,`Failed to acknowledge assistant disk pressure.`))}finally{g(n,r)&&s(!1)}},[e,_,v,t,g]),C=t&&i.assistantId===e?i.status:null,w=!!(t&&e&&i.assistantId===e&&i.hasResolvedStatus);return{status:C,mode:(0,N.useMemo)(()=>B(C),[C]),hasResolvedStatus:w,isAcknowledging:o,acknowledgeError:c,acknowledge:x,applyStatusEvent:b,refresh:y}}var K=c();function ue(e){let{status:t,mode:n,isAcknowledging:r=!1,acknowledgeError:i,onAcknowledge:a,onDismissWarning:o,onReviewWorkspaceData:c,onUpgradeStorage:l}=e,[m,h]=(0,N.useState)(!1),[g,_]=(0,N.useState)(!1),v=W(t);if(n===`warning`){let e=t.usagePercent??0;return(0,K.jsx)(f,{tone:`warning`,title:`Your storage is almost full`,icon:(0,K.jsx)(w,{className:`h-4 w-4`,"aria-hidden":`true`}),onDismiss:o?()=>o(g):void 0,className:`p-4`,"data-testid":`disk-pressure-banner`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--surface-active)]`,children:(0,K.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-300`,style:{width:`${e}%`,backgroundColor:`var(--system-mid-strong)`}})}),(0,K.jsx)(`span`,{className:`text-body-medium-default shrink-0 tabular-nums text-[color:var(--system-mid-strong)]`,children:v})]}),(0,K.jsx)(`p`,{className:`m-0`,children:`Free up space or add more storage to avoid interruptions.`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[c&&(0,K.jsx)(s,{variant:`outlined`,size:`compact`,onClick:c,children:`Manage Storage`}),l&&(0,K.jsx)(s,{variant:`outlined`,size:`compact`,onClick:l,children:`Upgrade`}),o?(0,K.jsx)(u,{className:`ml-auto`,checked:g,onCheckedChange:e=>_(e===!0),label:`Don't show again`,"data-testid":`disk-pressure-banner-dont-show-again`}):null]})]})})}if(n===`cleanup`){let e=t.usagePercent??0;return(0,K.jsx)(f,{tone:`warning`,title:`Cleanup mode is active`,icon:(0,K.jsx)(w,{className:`h-4 w-4`,"aria-hidden":`true`}),className:`p-4`,"data-testid":`disk-pressure-banner`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--surface-active)]`,children:(0,K.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-300`,style:{width:`${e}%`,backgroundColor:`var(--system-mid-strong)`}})}),(0,K.jsx)(`span`,{className:`text-body-medium-default shrink-0 tabular-nums text-[color:var(--system-mid-strong)]`,children:v})]}),(0,K.jsx)(`p`,{className:`m-0`,children:`Prompt your assistant to free up space before it runs out and enters a locked state.`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[c&&(0,K.jsx)(s,{variant:`outlined`,size:`compact`,onClick:c,children:`Manage Storage`}),l&&(0,K.jsx)(s,{variant:`outlined`,size:`compact`,onClick:l,children:`Upgrade`})]})]})})}let y=t.usagePercent??0;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(f,{tone:`error`,title:`Storage is critically low`,icon:(0,K.jsx)(w,{className:`h-4 w-4`,"aria-hidden":`true`}),className:`p-4`,"data-testid":`disk-pressure-banner`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--surface-active)]`,children:(0,K.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-300`,style:{width:`${y}%`,backgroundColor:`var(--system-negative-strong)`}})}),(0,K.jsx)(`span`,{className:`text-body-medium-default shrink-0 tabular-nums text-[color:var(--system-negative-strong)]`,children:v})]}),(0,K.jsx)(`p`,{className:`m-0`,children:`Your assistant will enter a locked state if it runs out of storage.`}),i?(0,K.jsx)(`span`,{className:`text-[var(--system-negative-strong)]`,role:`alert`,children:i}):null,(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,K.jsx)(s,{variant:`primary`,size:`compact`,onClick:()=>h(!0),children:`Review`})})]})}),(0,K.jsx)(p.Root,{open:m,onOpenChange:e=>{e||h(!1)},children:(0,K.jsxs)(p.Content,{size:`sm`,children:[(0,K.jsx)(p.Header,{children:(0,K.jsx)(p.Title,{icon:d,children:`Storage is critically low`})}),(0,K.jsx)(p.Body,{children:(0,K.jsx)(p.Description,{children:`Your assistant will enter a locked state if it runs out of storage. You should either prompt your assistant to free up space or increase your storage.`})}),(0,K.jsxs)(p.Footer,{children:[l&&(0,K.jsx)(s,{variant:`outlined`,onClick:()=>{h(!1),l()},children:`Upgrade`}),(0,K.jsx)(s,{variant:`primary`,disabled:r,onClick:()=>{a(),h(!1)},children:r?`Acknowledging...`:`Acknowledge`})]})]})})]})}var de=_({key:`device:cmd_enter_to_send`,scope:`device`,parse:g,serialize:String,fallback:!1}),q=`app.iosNudge.downloaded`,J=`app.iosNudge.bannerDismissed`,Y=`app.iosNudge.assistantTurnsSeen`,fe=`https://apps.apple.com/us/app/vellum-assistant/id6759934423`;function X(){return i(q,!1)}function Z(){t(q,!0)}function pe(){return i(J,!1)}function me(){t(J,!0)}function Q(){return Math.max(0,n(Y,0))}function he(e=1){e<=0||r(Y,Q()+e)}function ge(){let[e,t]=(0,N.useState)(!1),[n,r]=(0,N.useState)(!1);(0,N.useEffect)(()=>{t(X()),r(pe())},[]);let i=(0,N.useCallback)(()=>{$(),Z(),t(!0)},[]),a=(0,N.useCallback)(()=>{me(),r(!0)},[]);return{bannerShouldShow:!e&&!n,handleDownload:i,handleBannerDismiss:a}}function $(){window.open(fe,`_blank`,`noopener,noreferrer`)}export{w as S,j as _,Z as a,ee as b,le as c,P as d,se as f,A as g,re as h,ge as i,H as l,ie as m,$ as n,de as o,ne as p,Q as r,ue as s,he as t,V as u,M as v,T as x,te as y};
@@ -0,0 +1 @@
1
+ import{D as e,T as t,i as n}from"./auth-store-D9BqFncz.js";function r(){let r=e.use.currentOrganizationId();return e.use.status(),n()?r!=null||t()!=null:!0}export{r as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{l as n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as r}from"./is-electron-7N7iyz1y.js";import{f as i}from"./native-biometric-BBZbTKi0.js";import{u as a}from"./routes-bwxCYLJj.js";import{n as o,t as s}from"./build-state-DoiXhrgx.js";import{n as c}from"./login-flow-GvzsqmPU.js";var l=e(t(),1);function u(e){let t=n(),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(null),m=(0,l.useRef)(0);return{loading:u,error:f,login:async()=>{let n=e??o(s({sessionSettled:!0,isAuthenticated:!0}),t.pathname),r=++m.current;p(null),d(!0);try{await i(c,`${a.account.providerCallback}?returnTo=${encodeURIComponent(n)}`,{returnTo:n})}catch{if(r!==m.current)return;p(`Something went wrong. Please try again.`),d(!1)}},cancel:()=>{m.current++,d(!1),p(null),r()&&window.vellum?.auth?.cancelOAuth()}}}export{u as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{l as n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as r}from"./is-electron-m5eeGBnd.js";import{f as i}from"./native-biometric-CntdlaL-.js";import{u as a}from"./routes-vE-2hncW.js";import{n as o,t as s}from"./build-state-WR9nlRgM.js";import{n as c}from"./login-flow-BCNBNLzu.js";var l=e(t(),1);function u(e){let t=n(),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(null),m=(0,l.useRef)(0);return{loading:u,error:f,login:async()=>{let n=e??o(s({sessionSettled:!0,isAuthenticated:!0}),t.pathname),r=++m.current;p(null),d(!0);try{await i(c,`${a.account.providerCallback}?returnTo=${encodeURIComponent(n)}`,{returnTo:n})}catch{if(r!==m.current)return;p(`Something went wrong. Please try again.`),d(!1)}},cancel:()=>{m.current++,d(!1),p(null),r()&&window.vellum?.auth?.cancelOAuth()}}}export{u as t};
@@ -1 +1 @@
1
- import{f as e,m as t}from"./local-mode-CTrmCbAp.js";import{U as n,i as r}from"./auth-store-CK95leo_.js";function i(){let e=n.use.assistantState();return!!(e.kind===`self_hosted`||e.kind===`active`&&e.isLocal)}function a(){let e=n.use.assistantState();return e.kind===`active`&&!e.isLocal}function o(){let e=n.use.assistantState();return e.kind===`loading`||e.kind===`initializing`||e.kind===`cleaning_up`}function s(n={}){let a=r(),o=t(),s=i();return n.platformHostedOnly?s?`gated`:a?`full`:`disabled`:e()&&o?`gated`:a?`full`:`disabled`}export{s as i,i as n,o as r,a as t};
1
+ import{f as e,m as t}from"./local-mode-Ckii2tmN.js";import{U as n,i as r}from"./auth-store-D9BqFncz.js";function i(){let e=n.use.assistantState();return!!(e.kind===`self_hosted`||e.kind===`active`&&e.isLocal)}function a(){let e=n.use.assistantState();return e.kind===`active`&&!e.isLocal}function o(){let e=n.use.assistantState();return e.kind===`loading`||e.kind===`initializing`||e.kind===`cleaning_up`}function s(n={}){let a=r(),o=t(),s=i();return n.platformHostedOnly?s?`gated`:a?`full`:`disabled`:e()&&o?`gated`:a?`full`:`disabled`}export{s as i,i as n,o as r,a as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{c as n,l as r,u as i}from"./proxy-Ca4nD_gM.js";var a=e(t(),1);function o(){!r.current&&n();let[e]=(0,a.useState)(i.current);return e}export{o as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{c as n,l as r,u as i}from"./proxy-RtD8704m.js";var a=e(t(),1);function o(){!r.current&&n();let[e]=(0,a.useState)(i.current);return e}export{o as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./QueryClientProvider-CMu7CkQU.js";import{t as r}from"./useMutation-CXGTrp4W.js";import{t as i}from"./queryOptions-CMSBCFOf.js";import{t as a}from"./createLucideIcon-CAM1RhH8.js";import{t as o}from"./mail-DABv3_Ue.js";import{t as s}from"./message-circle-gk_DFUIg.js";import{t as c}from"./message-square-zCNXaHYX.js";import{t as l}from"./send-DHWUIK7G.js";import{$t as u,Zt as d,tn as f}from"./sdk.gen-CsFDyJ6U.js";import{Dt as p,Et as m,Tt as h,s as g,wt as _}from"./react-query.gen-CbsPBjd9.js";import{C as v,a as y,m as b,t as x}from"./sdk.gen-DEFA-6EJ.js";var S=a(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),C=a(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),w=a(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),T=(e,t,n,r)=>{let i={_id:e,baseUrl:t?.baseUrl||(t?.client??v).getConfig().baseUrl};return n&&(i._infinite=n),r&&(i.tags=r),t?.body&&(i.body=t.body),t?.headers&&(i.headers=t.headers),t?.path&&(i.path=t.path),t?.query&&(i.query=t.query),[i]},E=e=>T(`assistantChannelAdmissionPolicyList`,e),D=e=>i({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await x({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:E(e)}),O=e=>T(`assistantChannelPermissionOverridesList`,e),k=e=>i({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await y({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:O(e)}),A=e=>T(`assistantFeatureFlagsGet`,e),j=e=>i({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await b({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:A(e)}),M=e(t(),1),N={slack:`Slack`,telegram:`Telegram`,whatsapp:`WhatsApp`,phone:`Phone`,email:`Email`,a2a:`Assistant`},P={slack:C,telegram:l,whatsapp:s,phone:w,email:o,a2a:S};function F(e){return e?N[e]??e.charAt(0).toUpperCase()+e.slice(1):`channel`}function I(e){return`Open in ${F(e)}`}function L(e){return e&&P[e]?P[e]:c}function R({channelId:e,className:t}){return(0,M.createElement)(L(e),{className:t,"aria-hidden":!0})}var z=[`slack`,`telegram`,`phone`];function B(e){return z.includes(e)}function V(e){return{path:{assistant_id:e},query:{memberOnly:`true`}}}function H(e){return _(V(e))}function U(e){return h(V(e))}var W=600*1e3;function G(e){return{path:{assistant_id:e}}}function K(e){return{...m(G(e)),staleTime:W}}function q(e){return p(G(e))}function J(e,t){e.removeQueries({queryKey:U(t)}),e.removeQueries({queryKey:q(t)})}function Y({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>g({path:{assistant_id:e}}),[e]);return r({mutationFn:({botToken:t,appToken:n})=>{if(!n.trim())throw Error(`App token is required. Go back to step 2 to enter it.`);if(!t.trim())throw Error(`Bot token is required.`);return d({path:{assistant_id:e},body:{botToken:t.trim(),appToken:n.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a}),J(i,e)}})}function X({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>g({path:{assistant_id:e}}),[e]);return r({mutationFn:t=>{if(!t.trim())throw Error(`Bot token is required.`);return u({path:{assistant_id:e},body:{botToken:t.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a})}})}function Z({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>g({path:{assistant_id:e}}),[e]);return r({mutationFn:({accountSid:t,authToken:n})=>{if(!t.trim())throw Error(`Account SID is required.`);if(!n.trim())throw Error(`Auth Token is required.`);return f({path:{assistant_id:e},body:{accountSid:t.trim(),authToken:n.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a})}})}export{j as _,K as a,C as b,B as c,F as d,I as f,O as g,k as h,J as i,R as l,E as m,X as n,H as o,D as p,Y as r,z as s,Z as t,L as u,A as v,S as x,w as y};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./QueryClientProvider-CMu7CkQU.js";import{t as r}from"./useMutation-CXGTrp4W.js";import{t as i}from"./queryOptions-CMSBCFOf.js";import{t as a}from"./createLucideIcon-CAM1RhH8.js";import{t as o}from"./mail-CMdPNysl.js";import{t as s}from"./message-circle-BsH7vHtN.js";import{t as c}from"./message-square-CQGiY4zk.js";import{t as l}from"./send-Q71Exj3z.js";import{$t as u,Zt as d,tn as f}from"./sdk.gen-BVAVE6A_.js";import{Dt as p,Et as m,Tt as h,s as g,wt as _}from"./react-query.gen-r3I6j8-1.js";import{C as v,a as y,m as b,t as x}from"./sdk.gen-DPKrJeho.js";var S=a(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),C=a(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),w=a(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),T=(e,t,n,r)=>{let i={_id:e,baseUrl:t?.baseUrl||(t?.client??v).getConfig().baseUrl};return n&&(i._infinite=n),r&&(i.tags=r),t?.body&&(i.body=t.body),t?.headers&&(i.headers=t.headers),t?.path&&(i.path=t.path),t?.query&&(i.query=t.query),[i]},E=e=>T(`assistantChannelAdmissionPolicyList`,e),D=e=>i({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await x({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:E(e)}),O=e=>T(`assistantChannelPermissionOverridesList`,e),k=e=>i({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await y({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:O(e)}),A=e=>T(`assistantFeatureFlagsGet`,e),j=e=>i({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await b({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:A(e)}),M=e(t(),1),N={slack:`Slack`,telegram:`Telegram`,whatsapp:`WhatsApp`,phone:`Phone`,email:`Email`,a2a:`Assistant`},P={slack:C,telegram:l,whatsapp:s,phone:w,email:o,a2a:S};function F(e){return e?N[e]??e.charAt(0).toUpperCase()+e.slice(1):`channel`}function I(e){return`Open in ${F(e)}`}function L(e){return e&&P[e]?P[e]:c}function R({channelId:e,className:t}){return(0,M.createElement)(L(e),{className:t,"aria-hidden":!0})}var z=[`slack`,`telegram`,`phone`];function B(e){return z.includes(e)}function V(e){return{path:{assistant_id:e},query:{memberOnly:`true`}}}function H(e){return _(V(e))}function U(e){return h(V(e))}var W=600*1e3;function G(e){return{path:{assistant_id:e}}}function K(e){return{...m(G(e)),staleTime:W}}function q(e){return p(G(e))}function J(e,t){e.removeQueries({queryKey:U(t)}),e.removeQueries({queryKey:q(t)})}function Y({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>g({path:{assistant_id:e}}),[e]);return r({mutationFn:({botToken:t,appToken:n})=>{if(!n.trim())throw Error(`App token is required. Go back to step 2 to enter it.`);if(!t.trim())throw Error(`Bot token is required.`);return d({path:{assistant_id:e},body:{botToken:t.trim(),appToken:n.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a}),J(i,e)}})}function X({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>g({path:{assistant_id:e}}),[e]);return r({mutationFn:t=>{if(!t.trim())throw Error(`Bot token is required.`);return u({path:{assistant_id:e},body:{botToken:t.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a})}})}function Z({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>g({path:{assistant_id:e}}),[e]);return r({mutationFn:({accountSid:t,authToken:n})=>{if(!t.trim())throw Error(`Account SID is required.`);if(!n.trim())throw Error(`Auth Token is required.`);return f({path:{assistant_id:e},body:{accountSid:t.trim(),authToken:n.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a})}})}export{j as _,K as a,C as b,B as c,F as d,I as f,O as g,k as h,J as i,R as l,E as m,X as n,H as o,D as p,Y as r,z as s,Z as t,L as u,A as v,S as x,w as y};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./QueryClientProvider-CMu7CkQU.js";import{t as r}from"./useMutation-CXGTrp4W.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./card-DRIctGVs.js";import{t as o}from"./createLucideIcon-CAM1RhH8.js";import{t as s}from"./brain-BIzJCPA6.js";import{t as c}from"./globe-CEgs-yoc.js";import{t as l}from"./puzzle-BVC3TGko.js";import{t as u}from"./terminal-Cs_TREv-.js";import{t as d}from"./user-Dq9DUxnU.js";import"./src-B9F84D64.js";import{t as f}from"./tag-D8NAGb0r.js";import{pr as p}from"./sdk.gen-CsFDyJ6U.js";import{on as m}from"./react-query.gen-CbsPBjd9.js";import{n as h,r as g,t as _}from"./api-errors-BRGPPSWw.js";import{t as v}from"./skills-CS48H_5g.js";var y=o(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),b=e(t(),1),x=i();function S({skill:e,className:t,fallback:n=`🧩`}){let[r,i]=(0,b.useState)(!1);return e.icon&&!r?(0,x.jsx)(`img`,{src:`/assistant/skills/${e.id}/${e.icon}`,alt:``,className:`${t} object-contain`,onError:()=>i(!0)}):(0,x.jsx)(`span`,{className:t,children:e.emoji??n})}var C={vellum:{label:`Vellum`,icon:y},clawhub:{label:`Clawhub`,icon:c},skillssh:{label:`skills.sh`,icon:u},custom:{label:`Custom`,icon:d},"assistant-memory":{label:`Assistant's Memory`,icon:s}};function w({origin:e}){let t=e in C?C[e]:{label:e.replace(/-/g,` `),icon:l};return(0,x.jsx)(f,{tone:`neutral`,leftIcon:(0,b.createElement)(t.icon),className:`capitalize`,children:t.label})}function T(e){return e.kind===`installed`||e.kind===`bundled`}function E(e){return e.kind===`catalog`}function D({icon:e,iconColor:t=`var(--content-tertiary)`,title:n,subtitle:r,children:i}){return(0,x.jsx)(a.Root,{children:(0,x.jsxs)(a.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,x.jsx)(e,{className:`mb-3 h-8 w-8`,style:{color:t},"aria-hidden":!0}),(0,x.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,x.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r}),i]})})}async function O(e,t,n){let{data:r,error:i,response:a}=await p({path:{assistant_id:e},body:n?{slug:t,version:n}:{slug:t},throwOnError:!1});if(h(a,i,`Failed to install skill.`),!a.ok)throw new _(a.status,g(i,a,`Failed to install skill.`));return r??{ok:!0}}function k(e,{onRemoved:t}={}){let i=n(),[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(null),d=(0,b.useCallback)(()=>{v(i,e)},[e,i]),f=r({mutationFn:t=>O(e,t),onMutate:e=>o(e),onSettled:()=>{o(null),d()}}),p=m({onMutate:e=>c(e.path.id),onSuccess:()=>{t?.()},onSettled:()=>{c(null),d()}}),h=(0,b.useCallback)(e=>{f.mutate(e.slug??e.id)},[f]),g=(0,b.useCallback)(e=>{u(e)},[]),_=(0,b.useCallback)(()=>{l&&(p.mutate({path:{assistant_id:e,id:l.id}}),u(null))},[e,l,p]),y=(0,b.useCallback)(()=>{u(null)},[]);return{handleInstall:h,handleRemove:g,isInstallingSkill:(0,b.useCallback)(e=>a===(e.slug??e.id),[a]),isRemovingSkill:(0,b.useCallback)(e=>s===e.id,[s]),skillPendingRemoval:l,confirmRemove:_,cancelRemove:y}}export{w as a,T as i,D as n,S as o,E as r,y as s,k as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./QueryClientProvider-CMu7CkQU.js";import{t as r}from"./useMutation-CXGTrp4W.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./card-DRIctGVs.js";import{t as o}from"./createLucideIcon-CAM1RhH8.js";import{t as s}from"./brain-BIzJCPA6.js";import{t as c}from"./globe-CMtjL_s_.js";import{t as l}from"./puzzle-BVC3TGko.js";import{t as u}from"./terminal-CdCI6wMV.js";import{t as d}from"./user-_zNqL48O.js";import"./src-D89CNeuT.js";import{t as f}from"./tag-NXcyiTkK.js";import{pr as p}from"./sdk.gen-BVAVE6A_.js";import{on as m}from"./react-query.gen-r3I6j8-1.js";import{n as h,r as g,t as _}from"./api-errors-CFiCT7Ap.js";import{t as v}from"./skills-C1CAcW7T.js";var y=o(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),b=e(t(),1),x=i();function S({skill:e,className:t,fallback:n=`🧩`}){let[r,i]=(0,b.useState)(!1);return e.icon&&!r?(0,x.jsx)(`img`,{src:`/assistant/skills/${e.id}/${e.icon}`,alt:``,className:`${t} object-contain`,onError:()=>i(!0)}):(0,x.jsx)(`span`,{className:t,children:e.emoji??n})}var C={vellum:{label:`Vellum`,icon:y},clawhub:{label:`Clawhub`,icon:c},skillssh:{label:`skills.sh`,icon:u},custom:{label:`Custom`,icon:d},"assistant-memory":{label:`Assistant's Memory`,icon:s}};function w({origin:e}){let t=e in C?C[e]:{label:e.replace(/-/g,` `),icon:l};return(0,x.jsx)(f,{tone:`neutral`,leftIcon:(0,b.createElement)(t.icon),className:`capitalize`,children:t.label})}function T(e){return e.kind===`installed`||e.kind===`bundled`}function E(e){return e.kind===`catalog`}function D({icon:e,iconColor:t=`var(--content-tertiary)`,title:n,subtitle:r,children:i}){return(0,x.jsx)(a.Root,{children:(0,x.jsxs)(a.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,x.jsx)(e,{className:`mb-3 h-8 w-8`,style:{color:t},"aria-hidden":!0}),(0,x.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,x.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r}),i]})})}async function O(e,t,n){let{data:r,error:i,response:a}=await p({path:{assistant_id:e},body:n?{slug:t,version:n}:{slug:t},throwOnError:!1});if(h(a,i,`Failed to install skill.`),!a.ok)throw new _(a.status,g(i,a,`Failed to install skill.`));return r??{ok:!0}}function k(e,{onRemoved:t}={}){let i=n(),[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(null),d=(0,b.useCallback)(()=>{v(i,e)},[e,i]),f=r({mutationFn:t=>O(e,t),onMutate:e=>o(e),onSettled:()=>{o(null),d()}}),p=m({onMutate:e=>c(e.path.id),onSuccess:()=>{t?.()},onSettled:()=>{c(null),d()}}),h=(0,b.useCallback)(e=>{f.mutate(e.slug??e.id)},[f]),g=(0,b.useCallback)(e=>{u(e)},[]),_=(0,b.useCallback)(()=>{l&&(p.mutate({path:{assistant_id:e,id:l.id}}),u(null))},[e,l,p]),y=(0,b.useCallback)(()=>{u(null)},[]);return{handleInstall:h,handleRemove:g,isInstallingSkill:(0,b.useCallback)(e=>a===(e.slug??e.id),[a]),isRemovingSkill:(0,b.useCallback)(e=>s===e.id,[s]),skillPendingRemoval:l,confirmRemove:_,cancelRemove:y}}export{w as a,T as i,D as n,S as o,E as r,y as s,k as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as r}from"./useQuery-Bz-fbQ-m.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./arrow-right-B-jRJNWP.js";import{vt as o,yt as s}from"./react-query.gen-CbsPBjd9.js";import{u as c}from"./routes-bwxCYLJj.js";import{t as l}from"./misc-CAQM4FGM.js";var u=i();function d({skill:e,className:t,onNavigate:r}){return e.origin!==`assistant-memory`||!e.sourceConversationId?null:(0,u.jsxs)(n,{to:c.conversation(e.sourceConversationId),onClick:r,className:l(`inline-flex w-fit items-center gap-1 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)] hover:underline`,t),children:[`Learned from this conversation`,(0,u.jsx)(a,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0})]})}var f=e(t(),1);function p(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function m(e,t){let[n,i]=(0,f.useState)(null),a=r({...s({path:{assistant_id:e??``,id:t}}),select:e=>e??null,enabled:!!e}),c=(0,f.useMemo)(()=>a.data?.files??[],[a.data]),l=(0,f.useMemo)(()=>c.find(e=>e.name===`SKILL.md`),[c]),u=p(c,n),d=r({...o({path:{assistant_id:e??``,id:t},query:{path:u??``}}),select:e=>e??null,enabled:!!(e&&u)});return{fileEntries:c,skillMd:l,selectedPath:n,setSelectedPath:i,activePath:u,activeFile:c.find(e=>e.path===u),isFilesLoading:a.isLoading,isFilesPending:a.isPending,fileContent:d.data?.content??null,isBinary:!!d.data?.isBinary,isContentLoading:d.isLoading,isContentPending:d.isPending}}export{d as n,m as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as r}from"./useQuery-Bz-fbQ-m.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./arrow-right-B-jRJNWP.js";import{vt as o,yt as s}from"./react-query.gen-r3I6j8-1.js";import{u as c}from"./routes-vE-2hncW.js";import{t as l}from"./misc-DckBb5zz.js";var u=i();function d({skill:e,className:t,onNavigate:r}){return e.origin!==`assistant-memory`||!e.sourceConversationId?null:(0,u.jsxs)(n,{to:c.conversation(e.sourceConversationId),onClick:r,className:l(`inline-flex w-fit items-center gap-1 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)] hover:underline`,t),children:[`Learned from this conversation`,(0,u.jsx)(a,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0})]})}var f=e(t(),1);function p(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function m(e,t){let[n,i]=(0,f.useState)(null),a=r({...s({path:{assistant_id:e??``,id:t}}),select:e=>e??null,enabled:!!e}),c=(0,f.useMemo)(()=>a.data?.files??[],[a.data]),l=(0,f.useMemo)(()=>c.find(e=>e.name===`SKILL.md`),[c]),u=p(c,n),d=r({...o({path:{assistant_id:e??``,id:t},query:{path:u??``}}),select:e=>e??null,enabled:!!(e&&u)});return{fileEntries:c,skillMd:l,selectedPath:n,setSelectedPath:i,activePath:u,activeFile:c.find(e=>e.path===u),isFilesLoading:a.isLoading,isFilesPending:a.isPending,fileContent:d.data?.content??null,isBinary:!!d.data?.isBinary,isContentLoading:d.isLoading,isContentPending:d.isPending}}export{d as n,m as t};