@vellumai/web 0.11.1 → 0.11.2-staging.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (565) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/{AnimatePresence-D23js3-M.js → AnimatePresence-CHo6D7IH.js} +1 -1
  3. package/dist/assets/{BundleConfirmPage-C1-BZKI9.js → BundleConfirmPage-j6ko1Z2E.js} +1 -1
  4. package/dist/assets/{a2a-invite-CfhpXDTT.js → a2a-invite-Bld7VHkJ.js} +1 -1
  5. package/dist/assets/{about-page-Dtg-I99x.js → about-page-BBS2ZLwu.js} +1 -1
  6. package/dist/assets/access-CVnesk0m.js +1 -0
  7. package/dist/assets/{account-page-DP2HVinz.js → account-page-mMG1nL1O.js} +1 -1
  8. package/dist/assets/{account-shell-BxZ339N3.js → account-shell-BmH96-Ie.js} +1 -1
  9. package/dist/assets/{acp-run-actions-BGbBYETY.js → acp-run-actions-zSUs8U3N.js} +1 -1
  10. package/dist/assets/acp-run-detail-panel-SN6NIuW5.js +5 -0
  11. package/dist/assets/{acp-run-store-CmGaPJm1.js → acp-run-store-DdzY8U9Y.js} +1 -1
  12. package/dist/assets/activity-steps-panel-bduSS8_d.js +1 -0
  13. package/dist/assets/{add-credential-modal-DQZ43BJU.js → add-credential-modal-4zzd0MPK.js} +1 -1
  14. package/dist/assets/add-credits-modal-DNYP2NMD.js +1 -0
  15. package/dist/assets/ai-page-BMqECtJX.js +1 -0
  16. package/dist/assets/android-consumption-only-D3L1Nc41.js +1 -0
  17. package/dist/assets/{animated-avatar-CDeJNhwm.js → animated-avatar-B0vCEKkY.js} +1 -1
  18. package/dist/assets/{api-C8TlQNEU.js → api-CGsj1Pig.js} +1 -1
  19. package/dist/assets/{api-key-screen-CoLZh8vw.js → api-key-screen-tqtaQUVf.js} +1 -1
  20. package/dist/assets/api-pN-AgY8Q.js +1 -0
  21. package/dist/assets/{app-card-DgDV-yMd.js → app-card-BJigGog3.js} +1 -1
  22. package/dist/assets/{app-info-Bdfw54u1.js → app-info-BDq_9VB8.js} +1 -1
  23. package/dist/assets/archive-BQ3zdIPv.js +1 -0
  24. package/dist/assets/{archive-redirect-page-CWJIEUlH.js → archive-redirect-page-Cxcg7zGt.js} +1 -1
  25. package/dist/assets/{assistant-feature-flag-store-CMUNSAPL.js → assistant-feature-flag-store-BvLDPeej.js} +1 -1
  26. package/dist/assets/assistant-identity-store-B51BX78j.js +1 -0
  27. package/dist/assets/{assistant-status-panel-Bt_19-BI.js → assistant-status-panel-DyjhJvK6.js} +1 -1
  28. package/dist/assets/auth-store-C9aYqB9U.js +2 -0
  29. package/dist/assets/{avatar-random-IysJ0Bdt.js → avatar-random-BR8w4F35.js} +1 -1
  30. package/dist/assets/{avatar-renderer-3EVhZ7TB.js → avatar-renderer-TpNgmnU1.js} +1 -1
  31. package/dist/assets/background-task-actions-DmocXKSr.js +1 -0
  32. package/dist/assets/{background-task-detail-panel-DqXuwo9q.js → background-task-detail-panel-DCtBOnvF.js} +1 -1
  33. package/dist/assets/{background-task-store-CN04oS2z.js → background-task-store-DpOSZFT8.js} +1 -1
  34. package/dist/assets/billing-page-TF_LgX6K.js +3 -0
  35. package/dist/assets/{billing-redirect-page-CiHoDQHE.js → billing-redirect-page-QFlD3jYy.js} +1 -1
  36. package/dist/assets/{bookmarks-page-Bk04EUIg.js → bookmarks-page-Brvj5Jf6.js} +1 -1
  37. package/dist/assets/browser-CcdNg0HN.js +2 -0
  38. package/dist/assets/build-state-9uUe0jN5.js +1 -0
  39. package/dist/assets/{capture-error-FWzaVb8P.js → capture-error-CqtAGHQu.js} +1 -1
  40. package/dist/assets/channels-page-route-8vJJE2LN.js +9 -0
  41. package/dist/assets/{chat-avatar-CIF_o6y5.js → chat-avatar-B5fx9Xm3.js} +1 -1
  42. package/dist/assets/{chat-layout-slots-store-C325hn1X.js → chat-layout-slots-store-DP8MgnXi.js} +1 -1
  43. package/dist/assets/chat-markdown-message-B7qvlO44.js +1 -0
  44. package/dist/assets/checkbox-PU47Djxg.js +1 -0
  45. package/dist/assets/checkout-continuation-CYDyrqci.js +1 -0
  46. package/dist/assets/checkout-page-MpIPAAgf.js +1 -0
  47. package/dist/assets/checkout-return-target-BStfEab4.js +1 -0
  48. package/dist/assets/{client-feature-flag-store-Bg5XEI2b.js → client-feature-flag-store-Cw39NfCq.js} +1 -1
  49. package/dist/assets/{client-identity-bdtPpHZK.js → client-identity-BZBfwdGQ.js} +1 -1
  50. package/dist/assets/{command-palette-B3TVIQUH.js → command-palette-Bd1GTwZQ.js} +1 -1
  51. package/dist/assets/command-palette-window-page-CoweYsZl.js +1 -0
  52. package/dist/assets/{community-page-BZmxfsXK.js → community-page-BWMwSeEZ.js} +1 -1
  53. package/dist/assets/{confirm-dialog-DZX6LhLy.js → confirm-dialog-j9o2h3xs.js} +1 -1
  54. package/dist/assets/{connect-page-D_I1YM62.js → connect-page-BxSNhZ8N.js} +1 -1
  55. package/dist/assets/{consent-controls-CiKmEzBn.js → consent-controls-Bs63UL5k.js} +1 -1
  56. package/dist/assets/consent-logPJwKV.js +1 -0
  57. package/dist/assets/{contacts-gateway-C628mrY_.js → contacts-gateway-DRzp5PC6.js} +1 -1
  58. package/dist/assets/{contacts-page-route--hTzWT8X.js → contacts-page-route-BOpVOsYK.js} +1 -1
  59. package/dist/assets/{conversation-cache-BzPdBPXN.js → conversation-cache-D1AJdwZd.js} +1 -1
  60. package/dist/assets/{conversation-list-fetchers-BZnx9EMN.js → conversation-list-fetchers-C6W8PkvR.js} +1 -1
  61. package/dist/assets/conversation-navigation-Bf3cDRKh.js +1 -0
  62. package/dist/assets/{conversation-queries-3taor2DZ.js → conversation-queries-BBj4FfQn.js} +1 -1
  63. package/dist/assets/{conversation-store-C0tvFESx.js → conversation-store-CTMy9QPV.js} +1 -1
  64. package/dist/assets/{copy-to-clipboard-DaTa8Tbi.js → copy-to-clipboard-DgY-nZpm.js} +1 -1
  65. package/dist/assets/{credential-entry-page-BCAYmsDK.js → credential-entry-page-CreYYbwf.js} +1 -1
  66. package/dist/assets/credentials-page-DBLT8nUI.js +1 -0
  67. package/dist/assets/csv-preview-cEf_PW-P.js +4 -0
  68. package/dist/assets/{danger-zone-redirect-page-BcdEHbAX.js → danger-zone-redirect-page-CIt8Y6Rf.js} +1 -1
  69. package/dist/assets/debug-page-DfPZPo6D.js +4 -0
  70. package/dist/assets/{deploy-dialogs-CpUMrpHq.js → deploy-dialogs-CuaO05wL.js} +1 -1
  71. package/dist/assets/{deploy-store-BJ-njgv-.js → deploy-store-BDIOP-i9.js} +1 -1
  72. package/dist/assets/{detail-card-D-5EWmAS.js → detail-card-BElAV1cp.js} +1 -1
  73. package/dist/assets/{detail-drawer-BglFkWVa.js → detail-drawer-Cd_EQJkJ.js} +1 -1
  74. package/dist/assets/detail-panel-stop-button-Bhew_kym.js +1 -0
  75. package/dist/assets/{detail-shell-D9L3L7AM.js → detail-shell-BjqibXNX.js} +1 -1
  76. package/dist/assets/developer-page-DwBmhm09.js +1 -0
  77. package/dist/assets/{device-settings-DXp9L4iB.js → device-settings-CUIsZfaf.js} +1 -1
  78. package/dist/assets/{devices-redirect-page-BNpxDctf.js → devices-redirect-page-DePzNUvG.js} +1 -1
  79. package/dist/assets/{diagnostics-CLHyv7Xw.js → diagnostics-DykDXmF3.js} +1 -1
  80. package/dist/assets/{dictation-overlay-w1YHEfFR.js → dictation-overlay-CnPWVnXc.js} +1 -1
  81. package/dist/assets/{dictation-overlay-page-DUWJ13of.js → dictation-overlay-page-C9yp3YUN.js} +1 -1
  82. package/dist/assets/{dist-BswnB-bR.js → dist-BDdp8zqz.js} +1 -1
  83. package/dist/assets/{dist-CQN0ZAOZ.js → dist-C68qFSny.js} +1 -1
  84. package/dist/assets/doctor-handoff-store-CvOwsVRo.js +1 -0
  85. package/dist/assets/document-viewer-container-iB63ww7P.js +2 -0
  86. package/dist/assets/document-viewer-page-CA1ParJ6.js +1 -0
  87. package/dist/assets/{domains-OaR_FpOR.js → domains-Cwi5sL0m.js} +1 -1
  88. package/dist/assets/{dropdown-DswWMJhz.js → dropdown-B3FHWc_n.js} +1 -1
  89. package/dist/assets/{edge-swipe-arbiter-store-D9XJTxJJ.js → edge-swipe-arbiter-store-BwC23ScO.js} +1 -1
  90. package/dist/assets/effective-timezone-BX46fWmk.js +1 -0
  91. package/dist/assets/{emails-page-Bqr8Buvt.js → emails-page-Bo0Bwem2.js} +1 -1
  92. package/dist/assets/{environment-store-Bbx4f6SQ.js → environment-store-DxX3xxt2.js} +1 -1
  93. package/dist/assets/esm-754moU0G.js +2 -0
  94. package/dist/assets/esm-Bek1ps3d.js +2 -0
  95. package/dist/assets/esm-CMkpCv1_.js +2 -0
  96. package/dist/assets/esm-ChJ8E5v0.js +1 -0
  97. package/dist/assets/esm-DjeyDwcY.js +2 -0
  98. package/dist/assets/esm-Jw5qNk7q.js +2 -0
  99. package/dist/assets/esm-S7iZcDlp.js +1 -0
  100. package/dist/assets/esm-Tsd0irpJ.js +2 -0
  101. package/dist/assets/esm-UxVM8v-Z.js +2 -0
  102. package/dist/assets/{feature-flag-catalog-CWHnoWvT.js → feature-flag-catalog-CpyCubJW.js} +1 -1
  103. package/dist/assets/file-DOePafLU.js +1 -0
  104. package/dist/assets/file-editor-BfJR0ScX.js +1 -0
  105. package/dist/assets/file-markdown-DnVLY_b_.js +2 -0
  106. package/dist/assets/{first-run-scope-7wWjJ4Tn.js → first-run-scope-CPJpXaWU.js} +1 -1
  107. package/dist/assets/{funnel-events-RT_kdQHK.js → funnel-events-B9hFLlxs.js} +1 -1
  108. package/dist/assets/general-page-BXeIQDGi.js +1 -0
  109. package/dist/assets/{get-memory-stats-CthVfpul.js → get-memory-stats-BnRGtUPT.js} +1 -1
  110. package/dist/assets/{haptics-rJpeBta-.js → haptics-C4p_Rjba.js} +2 -2
  111. package/dist/assets/hatching-screen-BUpSlvBy.js +1 -0
  112. package/dist/assets/home-page-route-BPht0PNp.js +1 -0
  113. package/dist/assets/hosting-screen-DxtyBx0I.js +1 -0
  114. package/dist/assets/identity-BplXBnQ5.js +1 -0
  115. package/dist/assets/{identity-page-route-CvxG-nhn.js → identity-page-route-DgmrXhhV.js} +2 -2
  116. package/dist/assets/index-C7_04HXM.css +2 -0
  117. package/dist/assets/index-CPeIfypI.js +11 -0
  118. package/dist/assets/{ingest-BbV11WbG.js → ingest-BzFSv_f8.js} +1 -1
  119. package/dist/assets/{inspect-page-D_9E5ham.js → inspect-page-C8aLJOd6.js} +4 -4
  120. package/dist/assets/{installed-plugins-query-6u0jUM-L.js → installed-plugins-query-3ACToZeY.js} +1 -1
  121. package/dist/assets/{integration-icon-tiuVoy54.js → integration-icon-B1G4FQT2.js} +1 -1
  122. package/dist/assets/integrations-page-Bp2Q81Qt.js +1 -0
  123. package/dist/assets/{intelligence-layout-CVzq_bDm.js → intelligence-layout-BRC0qkZ7.js} +1 -1
  124. package/dist/assets/{invalidate-memory-queries-BPL6t0Cu.js → invalidate-memory-queries-DonPN3eH.js} +1 -1
  125. package/dist/assets/{invalidate-plugin-queries-QmmXCyiN.js → invalidate-plugin-queries-B0OpJSUW.js} +1 -1
  126. package/dist/assets/{keyboard-shortcuts-redirect-page-D_Rf5W7f.js → keyboard-shortcuts-redirect-page-DTabmI62.js} +1 -1
  127. package/dist/assets/latest-assistant-text-CwHBWP6s.js +24 -0
  128. package/dist/assets/{library-detail-page-CKWN2cc7.js → library-detail-page-gC4yIWnV.js} +1 -1
  129. package/dist/assets/{library-page-CuNX2WgS.js → library-page-B10gnbXU.js} +1 -1
  130. package/dist/assets/{paperclip-DVE0scjU.js → lightbulb-NdZMkb6Y.js} +1 -1
  131. package/dist/assets/{local-mode-9zpgPNoq.js → local-mode-DHueA-BJ.js} +2 -2
  132. package/dist/assets/local-runtime-upgrade-CnY-6TiF.js +1 -0
  133. package/dist/assets/local-settings-Bx7FsNo5.js +1 -0
  134. package/dist/assets/{login-flow-llpmkEjN.js → login-flow-CQhvCbQQ.js} +1 -1
  135. package/dist/assets/{login-page-SG4TPVDu.js → login-page-CbWRbJDE.js} +1 -1
  136. package/dist/assets/{logout-page-CBGk_cSN.js → logout-page-DCyzi0V6.js} +1 -1
  137. package/dist/assets/{logs-layout-B4EPBuaC.js → logs-layout-CYkqau4S.js} +1 -1
  138. package/dist/assets/media-preview-D9t2Q84i.js +1 -0
  139. package/dist/assets/memory-page-route-j_3602nh.js +6 -0
  140. package/dist/assets/{memory-router-playground-page-ftfbkFhf.js → memory-router-playground-page-x5X662qi.js} +1 -1
  141. package/dist/assets/{menu-CKZtG-s_.js → menu-wESJw6y3.js} +1 -1
  142. package/dist/assets/message-content-B6_GZQl9.js +1 -0
  143. package/dist/assets/message-files-panel-C8JokH6e.js +1 -0
  144. package/dist/assets/messages-Dyp1xUqz.js +13 -0
  145. package/dist/assets/{metric-card-B-Tt9p-1.js → metric-card-DpZFp8-q.js} +1 -1
  146. package/dist/assets/mobile-sidebar-drawer-BwCIAm23.js +1 -0
  147. package/dist/assets/{modal-DwsThLGg.js → modal-xr_vw1ZO.js} +1 -1
  148. package/dist/assets/mutation-error-YLfUU5XL.js +1 -0
  149. package/dist/assets/native-anchor-D1Sy2PbD.js +1 -0
  150. package/dist/assets/native-biometric-DetUqtjl.js +6 -0
  151. package/dist/assets/native-file-B71h3csB.js +2 -0
  152. package/dist/assets/{navigation-resolver-Lxhf-tbn.js → navigation-resolver-CzEY-5nE.js} +1 -1
  153. package/dist/assets/{not-found-p1VhZpMs.js → not-found-Bh7ZsdAo.js} +1 -1
  154. package/dist/assets/notice-Dslxs3H6.js +1 -0
  155. package/dist/assets/notifications-BTG4cTbF.js +1 -0
  156. package/dist/assets/notifications-page-BA2BW5y6.js +1 -0
  157. package/dist/assets/{oauth-complete-page-KSpFlPD6.js → oauth-complete-page-3xYlafpb.js} +1 -1
  158. package/dist/assets/{oauth-connection-utils-D9CTptlA.js → oauth-connection-utils-BrGz4Zc5.js} +1 -1
  159. package/dist/assets/{oauth-popup-complete-page-C5cG_z3A.js → oauth-popup-complete-page-BtwDCi5P.js} +1 -1
  160. package/dist/assets/{onboarding-layout-K7X9fV8B.js → onboarding-layout-iPzXbZk1.js} +1 -1
  161. package/dist/assets/onboarding-store-BiTZenvP.js +1 -0
  162. package/dist/assets/open-workspace-file-CivxJWcw.js +2 -0
  163. package/dist/assets/{page-empty-state-B0da-Sm9.js → page-empty-state-D-y7eP1V.js} +1 -1
  164. package/dist/assets/{page-shell-CN7ioeP_.js → page-shell-ZNQR4ZTn.js} +1 -1
  165. package/dist/assets/pairing-page-P5ghxF0M.js +1 -0
  166. package/dist/assets/{panel-item-DGs4s9r-.js → panel-item-CJh95P_q.js} +1 -1
  167. package/dist/assets/paperclip--f908Kg3.js +1 -0
  168. package/dist/assets/{password-reset-page-Bq3ehgjW.js → password-reset-page-SsfAE_J-.js} +1 -1
  169. package/dist/assets/pdf-file-preview-Dj8vmmw-.js +1 -0
  170. package/dist/assets/pdf-preview-pscVmtvX.js +2 -0
  171. package/dist/assets/{personality-page-DeZSBQ6W.js → personality-page-Bz_rNBSs.js} +1 -1
  172. package/dist/assets/plans-page-BfyCgy38.js +1 -0
  173. package/dist/assets/platform-detection-AHYibqOx.js +1 -0
  174. package/dist/assets/{platform-login-notice-D-yQLWUo.js → platform-login-notice-DFmjUE9q.js} +1 -1
  175. package/dist/assets/platform-loopback-page-BGF_H8f_.js +1 -0
  176. package/dist/assets/{plugin-detail-page-DF9vmm23.js → plugin-detail-page-UUM9vxvV.js} +1 -1
  177. package/dist/assets/{plugins-page-BDZiCqWZ.js → plugins-page-Dae3rghA.js} +1 -1
  178. package/dist/assets/plugins-surface-C_pFzsVo.js +1 -0
  179. package/dist/assets/{popover-BFL-uOLh.js → popover-B-3isZCV.js} +1 -1
  180. package/dist/assets/{prefs-B6fvTCOn.js → prefs-CfRaGUUx.js} +1 -1
  181. package/dist/assets/preview-error-BrLE2D3A.js +1 -0
  182. package/dist/assets/preview-skeleton-Biw3dosM.js +1 -0
  183. package/dist/assets/privacy-page-BhEGh78C.js +1 -0
  184. package/dist/assets/{privacy-screen-D2EBZTX8.js → privacy-screen-CWVCI_KU.js} +1 -1
  185. package/dist/assets/provider-callback-page-DP5cKqPE.js +1 -0
  186. package/dist/assets/{provider-key-w3CzmGtq.js → provider-key-CgC-RLmR.js} +1 -1
  187. package/dist/assets/{provider-signup-page-D5mOXHww.js → provider-signup-page-BjiiJWS_.js} +1 -1
  188. package/dist/assets/{provisioning-targets-CT4slXZJ.js → provisioning-targets-Cah9jNBe.js} +1 -1
  189. package/dist/assets/{quick-input-page-COgnUnT_.js → quick-input-page-BYf7UWY4.js} +1 -1
  190. package/dist/assets/radio-card-nav-C_pSc4PD.js +1 -0
  191. package/dist/assets/{react-query.gen-BVTEjHsw.js → react-query.gen-BtYBixpk.js} +1 -1
  192. package/dist/assets/react-query.gen-C7om930f.js +1 -0
  193. package/dist/assets/{remote-gateway-session-CgxYHgOD.js → remote-gateway-session-C8pRadB2.js} +1 -1
  194. package/dist/assets/{research-facts-BcW4fghT.js → research-facts-BUfgocIh.js} +1 -1
  195. package/dist/assets/{research-mock-page-BFm8-rLU.js → research-mock-page-CGkqkXHp.js} +1 -1
  196. package/dist/assets/{research-onboarding-persistence-BN6g1lF7.js → research-onboarding-persistence-DwV372yy.js} +1 -1
  197. package/dist/assets/research-onboarding-route-DZF-B2Rk.js +50 -0
  198. package/dist/assets/{research-results-view-BBf2iyCA.js → research-results-view-BFZFPpev.js} +1 -1
  199. package/dist/assets/{resolved-assistants-store-8HQDfxZh.js → resolved-assistants-store-C6oDdTxB.js} +1 -1
  200. package/dist/assets/retire-confirm-dialog-8xlq4bkx.js +1 -0
  201. package/dist/assets/{review-terms-screen-zzdu4AQi.js → review-terms-screen-C5BAI3Rx.js} +1 -1
  202. package/dist/assets/{routes-GmNvdtLW.js → routes-DrfnNoYS.js} +1 -1
  203. package/dist/assets/routes-uGHUgv4F.js +23 -0
  204. package/dist/assets/runtime-upgrade-banner-DjFuJawk.js +2 -0
  205. package/dist/assets/{sandbox-bridge-CjHMJYTZ.js → sandbox-bridge-B5H4c27m.js} +84 -2
  206. package/dist/assets/{schedules-B6KivAAT.js → schedules-_ofAwdnr.js} +1 -1
  207. package/dist/assets/{schedules-page-BQSGUmn5.js → schedules-page-3ZE1nR6I.js} +1 -1
  208. package/dist/assets/{sdk.gen-BySz4QYj.js → sdk.gen-CjtCuSlS.js} +1 -1
  209. package/dist/assets/{sdk.gen-DVW3wpbx.js → sdk.gen-ies09CqM.js} +1 -1
  210. package/dist/assets/{security-redirect-page-T1J6IoOb.js → security-redirect-page-B9T_2mcB.js} +1 -1
  211. package/dist/assets/select-assistant-screen-D4WHHv61.js +1 -0
  212. package/dist/assets/semver-Bfq1LtyW.js +1 -0
  213. package/dist/assets/{setting-row-DEyL7IUP.js → setting-row-C4jX7c_4.js} +1 -1
  214. package/dist/assets/{settings-divider-Bf5WJ9ve.js → settings-divider-BkLQFMlW.js} +1 -1
  215. package/dist/assets/settings-layout-BmOglXDq.js +1 -0
  216. package/dist/assets/settings-navigation-CyH-twYD.js +1 -0
  217. package/dist/assets/share-feedback-modal-Rwuho_1S.js +2 -0
  218. package/dist/assets/{sidebar-tree-D6fHs4GK.js → sidebar-tree-Dxx5qLMQ.js} +1 -1
  219. package/dist/assets/{signup-page-DqfStkXZ.js → signup-page-BAEo45pt.js} +1 -1
  220. package/dist/assets/{signup-shell-CMXUBUal.js → signup-shell-Dwuv81sx.js} +1 -1
  221. package/dist/assets/site-favicon-CDH0mg6Q.js +1 -0
  222. package/dist/assets/{skill-detail-page-SvM2JKKY.js → skill-detail-page-DswXTTyb.js} +1 -1
  223. package/dist/assets/{skill-detail-panel-Cpl1Z7V3.js → skill-detail-panel-DhQFBAFF.js} +1 -1
  224. package/dist/assets/{skills-BL4RgwAd.js → skills-CbF2uKXV.js} +1 -1
  225. package/dist/assets/{skills-page-BYtAFZzb.js → skills-page-CNYM3Qsj.js} +1 -1
  226. package/dist/assets/{slack-setup-wizard-dVkbEE6P.js → slack-setup-wizard-DPzdheN0.js} +1 -1
  227. package/dist/assets/{sound-manager-DUo0lHGZ.js → sound-manager-Bv6Sc7Ut.js} +1 -1
  228. package/dist/assets/{sounds-page-CfeiEoJP.js → sounds-page-Bpeq0MQn.js} +1 -1
  229. package/dist/assets/src-Da9g8qsW.js +293 -0
  230. package/dist/assets/{start-screen-CqbeEmEE.js → start-screen-CSxaBn88.js} +1 -1
  231. package/dist/assets/subagent-detail-panel-CidisBCf.js +4 -0
  232. package/dist/assets/{subagent-store-DyKwOIj_.js → subagent-store-DibRR9Ij.js} +2 -2
  233. package/dist/assets/{superpowers-page-DltosgGe.js → superpowers-page-BouZK3P4.js} +1 -1
  234. package/dist/assets/{system-events-page-Cg0uMSMs.js → system-events-page-BrvTNeiN.js} +1 -1
  235. package/dist/assets/{system-events-redirect-page-C44suO-c.js → system-events-redirect-page-CKNhBiUK.js} +1 -1
  236. package/dist/assets/{tag-D8NAGb0r.js → tag-gOOX7fbA.js} +1 -1
  237. package/dist/assets/text-preview-DwgKh8PW.js +1 -0
  238. package/dist/assets/{theme-preferences-LQuLaIA6.js → theme-preferences-B2X7Xgir.js} +1 -1
  239. package/dist/assets/{theme-stage-page-CnKpq5QT.js → theme-stage-page-LIhQbqRQ.js} +1 -1
  240. package/dist/assets/{threshold-presets-B-gOdjC4.js → threshold-presets-B-RqvhUM.js} +1 -1
  241. package/dist/assets/{tiptap-document-editor-D-lwPWrV.js → tiptap-document-editor-BvGaiGeN.js} +1 -1
  242. package/dist/assets/{toast-DR7D7Uma.js → toast-BtFgiPe3.js} +1 -1
  243. package/dist/assets/tool-detail-panel-B2CIRZkB.js +2 -0
  244. package/dist/assets/transcript-message-body-shared-BfKwS5qD.js +1 -0
  245. package/dist/assets/{trust-rules-api-iUGCiDDM.js → trust-rules-api-Dbyz25hE.js} +1 -1
  246. package/dist/assets/typed-storage-OO7emDaU.js +1 -0
  247. package/dist/assets/{upgrade-cancel-page-D8is9-gw.js → upgrade-cancel-page-DjeqfvTa.js} +1 -1
  248. package/dist/assets/{upgrade-success-page-3W1VuHqB.js → upgrade-success-page-B4TCn340.js} +1 -1
  249. package/dist/assets/{usage-redirect-page-C6qXe-4h.js → usage-redirect-page-Cd58Bed0.js} +1 -1
  250. package/dist/assets/{use-active-assistant-id-CjvzlL4t.js → use-active-assistant-id-JLsAfn3e.js} +1 -1
  251. package/dist/assets/{use-app-theme-BLGjiz96.js → use-app-theme-yiZ38i4_.js} +1 -1
  252. package/dist/assets/{use-assistant-avatar--4s_vvar.js → use-assistant-avatar-Bjqx8JUy.js} +1 -1
  253. package/dist/assets/{use-assistant-capability-BaZVGuCu.js → use-assistant-capability-CnI3VItU.js} +1 -1
  254. package/dist/assets/use-assistant-identity-details-D-7oN9gr.js +1 -0
  255. package/dist/assets/use-attachment-preview-CQjpDfsc.js +2 -0
  256. package/dist/assets/use-attachment-squares-8Hx-p8ls.js +1 -0
  257. package/dist/assets/{use-avatar-accent-var-BaftJG7F.js → use-avatar-accent-var-BafXGBXW.js} +1 -1
  258. package/dist/assets/{use-bookmarks-B6Y60m9F.js → use-bookmarks-DO9wmU-2.js} +1 -1
  259. package/dist/assets/{use-bundled-avatar-components-IQw2k8-g.js → use-bundled-avatar-components-BcyasJwu.js} +2 -2
  260. package/dist/assets/{use-bus-subscription-CyRPH_gr.js → use-bus-subscription-DiCq1_ki.js} +1 -1
  261. package/dist/assets/use-checkout-dismiss-refresh-CV_H4uEB.js +1 -0
  262. package/dist/assets/use-command-palette-sections-BshFMe0w.js +1 -0
  263. package/dist/assets/{use-discord-nudge-CRU-lEHV.js → use-discord-nudge-DED9TaIm.js} +1 -1
  264. package/dist/assets/{use-edge-swipe-Gst62FjL.js → use-edge-swipe-CRkrRNLg.js} +1 -1
  265. package/dist/assets/{use-edge-swipe-back-D12vbvly.js → use-edge-swipe-back-Dk2xXjh4.js} +1 -1
  266. package/dist/assets/use-edit-app-Bd1eXXFq.js +1 -0
  267. package/dist/assets/{use-effective-timezone-Bx9QaO25.js → use-effective-timezone-BM5B7KHp.js} +1 -1
  268. package/dist/assets/use-invite-link-dialog-TNGI1l4g.js +1 -0
  269. package/dist/assets/{use-ios-app-nudge-CrBEIZ8w.js → use-ios-app-nudge-CadXZRJC.js} +1 -1
  270. package/dist/assets/use-is-org-ready-3vHDbj4G.js +1 -0
  271. package/dist/assets/use-local-file-info-D2-ycwyJ.js +1 -0
  272. package/dist/assets/{use-onboarding-login-X8pB53cV.js → use-onboarding-login-CiQyxJLM.js} +1 -1
  273. package/dist/assets/{use-platform-assistant-id-CIoqMsyh.js → use-platform-assistant-id-DgrNmSy2.js} +1 -1
  274. package/dist/assets/{use-platform-gate-CqEOGZtI.js → use-platform-gate-C5bNA5Pn.js} +1 -1
  275. package/dist/assets/{use-reduced-motion-bjjt6x6d.js → use-reduced-motion-fR0m_opJ.js} +1 -1
  276. package/dist/assets/{use-return-to-short-circuit-B295pgoV.js → use-return-to-short-circuit-g88hMnN8.js} +1 -1
  277. package/dist/assets/{use-save-twilio-credentials-CCp1iqBf.js → use-save-twilio-credentials-yqA7lnzq.js} +1 -1
  278. package/dist/assets/{use-skill-actions-BLHTDn21.js → use-skill-actions-B_tz3CI7.js} +1 -1
  279. package/dist/assets/{use-skill-detail-files-BVBb8uoK.js → use-skill-detail-files-DdWFIu5-.js} +1 -1
  280. package/dist/assets/use-sticky-profiles-D5TVHOgw.js +1 -0
  281. package/dist/assets/use-subagent-card-data-bjGydvhR.js +1 -0
  282. package/dist/assets/{use-supports-bookmarks-DbG5HZ6P.js → use-supports-bookmarks-DwTpI8uM.js} +1 -1
  283. package/dist/assets/use-supports-credentials-settings-3jGHR8fw.js +1 -0
  284. package/dist/assets/{use-swipe-engine-RAFE-Hrf.js → use-swipe-engine-Bkqjs1Zk.js} +1 -1
  285. package/dist/assets/use-transcript-message-by-id-BgyP3Ki5.js +1 -0
  286. package/dist/assets/use-transcript-messages-C2uwkjKL.js +3 -0
  287. package/dist/assets/{utils-Ction0uF.js → utils-3IBGVjNS.js} +1 -1
  288. package/dist/assets/utils-DtVy-_pB.js +1 -0
  289. package/dist/assets/viewer-store-DbIS4l8d.js +1 -0
  290. package/dist/assets/{voice-list-CCLkiF-c.js → voice-list-D26Lzbpv.js} +1 -1
  291. package/dist/assets/{voice-page-Bvgm-7L8.js → voice-page-CQ2Vp8p4.js} +1 -1
  292. package/dist/assets/{voice-providers-note-g4IBSHFm.js → voice-providers-note-Ck7hNTfp.js} +1 -1
  293. package/dist/assets/{weather-forecast-display-Bg_OjY6Q.js → weather-forecast-display-DrJp8zrP.js} +1 -1
  294. package/dist/assets/web-CDfRXQwd.js +1 -0
  295. package/dist/assets/web-Ccq6YqQk.js +1 -0
  296. package/dist/assets/web-Cw8N9FBf.js +1 -0
  297. package/dist/assets/web-Cwkvk3kH.js +1 -0
  298. package/dist/assets/web-KS3MoLo7.js +1 -0
  299. package/dist/assets/web-PODqCw-i.js +1 -0
  300. package/dist/assets/web-aKLBqXiN.js +1 -0
  301. package/dist/assets/web-vlqDFmAp.js +1 -0
  302. package/dist/assets/welcome-screen-CdsjDVfi.js +1 -0
  303. package/dist/assets/{workflow-detail-panel-BNzNSNAT.js → workflow-detail-panel-CsRhUrbM.js} +1 -1
  304. package/dist/assets/{workflow-store-Cbd3x6KN.js → workflow-store-zCcRcvi8.js} +1 -1
  305. package/dist/assets/workspace-page-CFuSxp5s.js +1 -0
  306. package/dist/assets/workspace-path-links-vDBIljq_.js +1 -0
  307. package/dist/assets/workspace-tree-query-Dfkrp_rV.js +1 -0
  308. package/dist/index.html +282 -271
  309. package/package.json +1 -1
  310. package/dist/assets/access-BJiXpwUJ.js +0 -1
  311. package/dist/assets/acp-run-detail-panel-C_M19m8P.js +0 -5
  312. package/dist/assets/activity-steps-panel-BsmwWzP1.js +0 -1
  313. package/dist/assets/add-credits-modal-3Rsd1ZeS.js +0 -1
  314. package/dist/assets/ai-page-B9mJkV_p.js +0 -1
  315. package/dist/assets/api-DDKNgE8n.js +0 -1
  316. package/dist/assets/assistant-identity-store-BczULg2T.js +0 -1
  317. package/dist/assets/auth-store-BwKMFgpK.js +0 -2
  318. package/dist/assets/background-task-actions-DX0pUvY9.js +0 -1
  319. package/dist/assets/billing-page-CED96NEp.js +0 -3
  320. package/dist/assets/browser-Bses4IN3.js +0 -2
  321. package/dist/assets/build-state-DPMhQpLB.js +0 -1
  322. package/dist/assets/channels-page-route-BooWFQMp.js +0 -9
  323. package/dist/assets/chat-markdown-message-f4cLJfax.js +0 -2
  324. package/dist/assets/checkbox-BZTUJtxM.js +0 -1
  325. package/dist/assets/checkout-continuation-CcuqWhhp.js +0 -1
  326. package/dist/assets/checkout-page-BateK-Nf.js +0 -1
  327. package/dist/assets/checkout-return-target-Cib3fzdY.js +0 -1
  328. package/dist/assets/command-palette-window-page-Bp9WplfA.js +0 -1
  329. package/dist/assets/consent-s5g0Gmb2.js +0 -1
  330. package/dist/assets/conversation-navigation-D63NJmBl.js +0 -1
  331. package/dist/assets/credentials-page-CYBmOQhl.js +0 -1
  332. package/dist/assets/debug-page-CHuby9yt.js +0 -4
  333. package/dist/assets/detail-panel-stop-button-DgKaA6yz.js +0 -1
  334. package/dist/assets/developer-page-CUJqTs2_.js +0 -1
  335. package/dist/assets/dist-BKxs5XmY.js +0 -1
  336. package/dist/assets/doctor-handoff-store-DWNbuW3P.js +0 -1
  337. package/dist/assets/document-viewer-container-Doc7G7NK.js +0 -2
  338. package/dist/assets/document-viewer-page-_jndOS7P.js +0 -1
  339. package/dist/assets/effective-timezone-CnKC3vj0.js +0 -1
  340. package/dist/assets/esm-B2M2kM_8.js +0 -2
  341. package/dist/assets/esm-BgRAHqeR.js +0 -2
  342. package/dist/assets/esm-CXX8rcv3.js +0 -2
  343. package/dist/assets/esm-Chh8mHmh.js +0 -1
  344. package/dist/assets/esm-Cl2UNC_o.js +0 -2
  345. package/dist/assets/esm-ClO8yhvi.js +0 -2
  346. package/dist/assets/esm-DOATKqE3.js +0 -2
  347. package/dist/assets/esm-UUuqyyp5.js +0 -1
  348. package/dist/assets/file-editor-DcH2Os5o.js +0 -1
  349. package/dist/assets/file-markdown-DBLxtb0M.js +0 -2
  350. package/dist/assets/general-page-DoAKoumC.js +0 -1
  351. package/dist/assets/handle-logout-BTgnSSUm.js +0 -1
  352. package/dist/assets/hatching-screen-Q59qvj8_.js +0 -1
  353. package/dist/assets/home-page-route-TPR5p3LW.js +0 -1
  354. package/dist/assets/hosting-screen-DRrmkmoO.js +0 -1
  355. package/dist/assets/identity-Cb4xS1Kk.js +0 -1
  356. package/dist/assets/index-Ch9eoFem.js +0 -11
  357. package/dist/assets/index-D8Xiv4z3.css +0 -2
  358. package/dist/assets/integrations-page-CnjTLjpf.js +0 -1
  359. package/dist/assets/latest-assistant-text-DPm0HIWu.js +0 -24
  360. package/dist/assets/list-row-BYrmPIC4.js +0 -1
  361. package/dist/assets/local-runtime-upgrade-JwVgn034.js +0 -1
  362. package/dist/assets/local-settings-C-dW2vkq.js +0 -1
  363. package/dist/assets/memory-page-route-C8nIc6Mb.js +0 -6
  364. package/dist/assets/messages-BzNSqJQx.js +0 -13
  365. package/dist/assets/mobile-sidebar-drawer-BnxfQaDB.js +0 -1
  366. package/dist/assets/mutation-error-CXV1BKlB.js +0 -1
  367. package/dist/assets/native-anchor-BiuEQHcy.js +0 -1
  368. package/dist/assets/native-biometric-B96mgKGP.js +0 -6
  369. package/dist/assets/native-file-BvwfoU6A.js +0 -2
  370. package/dist/assets/notice-DCp7WO3L.js +0 -1
  371. package/dist/assets/notifications-page-BAYd0t-0.js +0 -1
  372. package/dist/assets/onboarding-store-OVV4wyh5.js +0 -1
  373. package/dist/assets/open-workspace-file-DucrTmt3.js +0 -2
  374. package/dist/assets/pairing-page-BRPUYbzJ.js +0 -1
  375. package/dist/assets/plans-page-BxebYucs.js +0 -1
  376. package/dist/assets/platform-detection-a_IB3-0w.js +0 -1
  377. package/dist/assets/platform-loopback-page-DESnWJYO.js +0 -1
  378. package/dist/assets/plugins-surface-C4peMNec.js +0 -1
  379. package/dist/assets/privacy-page-sZhcJ3uB.js +0 -1
  380. package/dist/assets/provider-callback-page-BZlfsT4J.js +0 -1
  381. package/dist/assets/react-query.gen-0mspArBl.js +0 -1
  382. package/dist/assets/research-onboarding-route-ZOwRvfGs.js +0 -50
  383. package/dist/assets/retire-confirm-dialog-m6ORm5Pq.js +0 -1
  384. package/dist/assets/risk-uPLh5W5z.js +0 -3
  385. package/dist/assets/routes-BP00Ewbf.js +0 -23
  386. package/dist/assets/runtime-upgrade-banner-yZYtWxoJ.js +0 -2
  387. package/dist/assets/select-assistant-screen-B5N_TUcG.js +0 -1
  388. package/dist/assets/session-corner-action-vhb51vd3.js +0 -1
  389. package/dist/assets/settings-layout-BtT0532M.js +0 -1
  390. package/dist/assets/settings-navigation-BDpUXrOI.js +0 -1
  391. package/dist/assets/share-feedback-modal-DO6_oaZg.js +0 -2
  392. package/dist/assets/site-favicon-Dh1OTgFr.js +0 -1
  393. package/dist/assets/src-BAS7a2RG.js +0 -293
  394. package/dist/assets/subagent-detail-panel-jp0r0ZFk.js +0 -4
  395. package/dist/assets/tool-detail-panel-CXcjfDGo.js +0 -2
  396. package/dist/assets/transcript-message-body-shared-woOFNF_q.js +0 -1
  397. package/dist/assets/typed-storage-C-R1po3l.js +0 -1
  398. package/dist/assets/use-assistant-identity-details-C99kNyQf.js +0 -1
  399. package/dist/assets/use-checkout-dismiss-refresh-BkIzNk6B.js +0 -1
  400. package/dist/assets/use-command-palette-sections-CAmbyguu.js +0 -1
  401. package/dist/assets/use-edit-app-BF9YK7AV.js +0 -1
  402. package/dist/assets/use-invite-link-dialog-DN2IHVZE.js +0 -1
  403. package/dist/assets/use-is-org-ready-zouQ5CN4.js +0 -1
  404. package/dist/assets/use-sticky-profiles-bdq2XW7H.js +0 -1
  405. package/dist/assets/use-subagent-card-data-B8JTa5rQ.js +0 -1
  406. package/dist/assets/use-supports-credentials-settings-CgWfA2eQ.js +0 -1
  407. package/dist/assets/utils-C-YNXdkX.js +0 -1
  408. package/dist/assets/viewer-store--hIQLNm5.js +0 -1
  409. package/dist/assets/web-BEtLqoWJ.js +0 -1
  410. package/dist/assets/web-C8NouSk8.js +0 -1
  411. package/dist/assets/web-Cv3bLSQ5.js +0 -1
  412. package/dist/assets/web-D82T2zyn.js +0 -1
  413. package/dist/assets/web-RKFLO25W.js +0 -1
  414. package/dist/assets/web-XmQWRS1M.js +0 -1
  415. package/dist/assets/web-ZsA8B5nq.js +0 -1
  416. package/dist/assets/web-s9eE6ZyC.js +0 -1
  417. package/dist/assets/welcome-screen-Cga6YuF9.js +0 -1
  418. package/dist/assets/workspace-page-BFJO59Ch.js +0 -1
  419. package/dist/assets/workspace-tree-query-CqcOBNKw.js +0 -1
  420. /package/dist/assets/{Combination-C7TWRLS7.js → Combination-CWTYp834.js} +0 -0
  421. /package/dist/assets/{api-errors-SZKDzMLE.js → api-errors-BRGPPSWw.js} +0 -0
  422. /package/dist/assets/{app-types-o5Qc-xkK.js → app-types-BGJfNjSJ.js} +0 -0
  423. /package/dist/assets/{apple-logo-Cg-KnqW2.js → apple-logo-BOBq3-Sn.js} +0 -0
  424. /package/dist/assets/{arrow-down-to-line-Bh_5sIPp.js → arrow-down-to-line-DMGjBlMw.js} +0 -0
  425. /package/dist/assets/{arrow-left-C2ylPLHq.js → arrow-left-W84B6oJL.js} +0 -0
  426. /package/dist/assets/{arrow-right-B-jRJNWP.js → arrow-right-ChqGeAaW.js} +0 -0
  427. /package/dist/assets/{arrow-up-BNd4Gpy7.js → arrow-up-CWzHzcyU.js} +0 -0
  428. /package/dist/assets/{avatar-bundled-components-CTd294ra.js → avatar-bundled-components-BvKt7I7O.js} +0 -0
  429. /package/dist/assets/{avatar-subagent-BpXST4nO.js → avatar-subagent-tkmKhEWI.js} +0 -0
  430. /package/dist/assets/{avatar-svg-compositor-DclcUb1M.js → avatar-svg-compositor-axSwKFvf.js} +0 -0
  431. /package/dist/assets/{avatar-tone-4L7foPzW.js → avatar-tone-D99t9DAP.js} +0 -0
  432. /package/dist/assets/{ban-B__z3LwE.js → ban-BKp90l-0.js} +0 -0
  433. /package/dist/assets/{bell-Ct4a9v6Y.js → bell-2SnK9BVD.js} +0 -0
  434. /package/dist/assets/{brain-BIzJCPA6.js → brain-CN4zzNgU.js} +0 -0
  435. /package/dist/assets/{browser-timezone-DGz-HvxU.js → browser-timezone-Br-HawKV.js} +0 -0
  436. /package/dist/assets/{bug-VUcJFHwN.js → bug-DdmWJIkz.js} +0 -0
  437. /package/dist/assets/{build.umd-oXvZOmIf.js → build.umd-CaLt9YHe.js} +0 -0
  438. /package/dist/assets/{by-tool-use-id-index-DcsiqOhc.js → by-tool-use-id-index-CUFuQqHz.js} +0 -0
  439. /package/dist/assets/{calendar-RYdAv74D.js → calendar-qrPKlf1H.js} +0 -0
  440. /package/dist/assets/{chart-column-BLKW3sjY.js → chart-column-k8S2UYq8.js} +0 -0
  441. /package/dist/assets/{chat-BIJEFb5u.js → chat-Dy2BC2i1.js} +0 -0
  442. /package/dist/assets/{check-sC49_hjU.js → check-Dt2rQhdg.js} +0 -0
  443. /package/dist/assets/{chevron-down-B5A-0g8A.js → chevron-down-BNidRDh1.js} +0 -0
  444. /package/dist/assets/{chevron-left-CytMddTB.js → chevron-left-CrxnPze-.js} +0 -0
  445. /package/dist/assets/{chevron-right-HU6H84S0.js → chevron-right-CANAtgGn.js} +0 -0
  446. /package/dist/assets/{chevron-up-2Qqarz0p.js → chevron-up-DofScvyy.js} +0 -0
  447. /package/dist/assets/{circle-alert-DVCpoZrc.js → circle-alert-DQMH8VJH.js} +0 -0
  448. /package/dist/assets/{circle-check-CjGnAahM.js → circle-check-DvrCdroD.js} +0 -0
  449. /package/dist/assets/{circle-check-big-DSsDH5_6.js → circle-check-big-DtV6IJuh.js} +0 -0
  450. /package/dist/assets/{circle-minus-DNfBAj4g.js → circle-minus-BBDKV6k6.js} +0 -0
  451. /package/dist/assets/{circle-x-17dBxF06.js → circle-x-DTjJzoQl.js} +0 -0
  452. /package/dist/assets/{client.gen-DHOmbzD9.js → client.gen-Dq2brHDV.js} +0 -0
  453. /package/dist/assets/{clipboard-copy-JwIceweN.js → clipboard-copy-BYpgEh2O.js} +0 -0
  454. /package/dist/assets/{clock-BYTc0Ds9.js → clock-DeynsyYL.js} +0 -0
  455. /package/dist/assets/{cloud-off-BCBGTmt0.js → cloud-off-BFACQbO0.js} +0 -0
  456. /package/dist/assets/{cloud-RlApB3rO.js → cloud-q4J30bVb.js} +0 -0
  457. /package/dist/assets/{code-qafFA0_-.js → code-D6SOwRrI.js} +0 -0
  458. /package/dist/assets/{coins-Hrmb9tmj.js → coins-CcTuNVlN.js} +0 -0
  459. /package/dist/assets/{conversation-selection-B954w311.js → conversation-selection-CJs3Fnse.js} +0 -0
  460. /package/dist/assets/{create-selectors-B-P03-8K.js → create-selectors-BfxF8Sx_.js} +0 -0
  461. /package/dist/assets/{definitions-CL6e7nYF.js → definitions-BfdxiZ6b.js} +0 -0
  462. /package/dist/assets/{definitions-BD-g60mP.js → definitions-Rm_PEX9e.js} +0 -0
  463. /package/dist/assets/{dices-DcuIF52A.js → dices-C3diFTyP.js} +0 -0
  464. /package/dist/assets/{dist-CKLJHt4Z.js → dist-EanpjdWC.js} +0 -0
  465. /package/dist/assets/{dist-CFSiz2ry2.js → dist-an0Z446E.js} +0 -0
  466. /package/dist/assets/{download-CywcQLB2.js → download-Cnb8zZrK.js} +0 -0
  467. /package/dist/assets/{edit-chat-session-Beky6Vpg.js → edit-chat-session-DVzLQLWl.js} +0 -0
  468. /package/dist/assets/{ellipsis-BRJI5_P1.js → ellipsis-C5fQnusC.js} +0 -0
  469. /package/dist/assets/{ellipsis-vertical-nov0xhhF.js → ellipsis-vertical-qQRDY5dB.js} +0 -0
  470. /package/dist/assets/{emoji-catalog-data-5pJaL_3N.js → emoji-catalog-data-Cjooln6g.js} +0 -0
  471. /package/dist/assets/{event-bus-CvZyJQ26.js → event-bus-CbDg1VDt.js} +0 -0
  472. /package/dist/assets/{external-link-CAce-RVu.js → external-link-GPGZ1LGU.js} +0 -0
  473. /package/dist/assets/{external-urls-97O9n0lb.js → external-urls-BL9qY0s8.js} +0 -0
  474. /package/dist/assets/{eye-DTyDWiqu.js → eye-B_jBDDRn.js} +0 -0
  475. /package/dist/assets/{eye-bbox-DE8r0Vt3.js → eye-bbox-CRs175_n.js} +0 -0
  476. /package/dist/assets/{eye-off-fuOP4Lij.js → eye-off-DQ4xakzN.js} +0 -0
  477. /package/dist/assets/{file-code-DD3K2kve.js → file-code-CrtJR2ax.js} +0 -0
  478. /package/dist/assets/{file-plus-Dq2xo7Ic.js → file-plus-DjC7wnGp.js} +0 -0
  479. /package/dist/assets/{file-text-BCsUYVEF.js → file-text-CwGsMgaa.js} +0 -0
  480. /package/dist/assets/{folder-g06qTW2O.js → folder-_l8GIyQp.js} +0 -0
  481. /package/dist/assets/{folder-open-CAb0DLYq.js → folder-open-BTlvhHNO.js} +0 -0
  482. /package/dist/assets/{format-date-CKGQir4m.js → format-date-CQUMvfqf.js} +0 -0
  483. /package/dist/assets/{format-file-size-Eu-Z0CxL.js → format-file-size-C5XdzvvA.js} +0 -0
  484. /package/dist/assets/{globe-BDvXuPkw.js → globe-CdLn4IX7.js} +0 -0
  485. /package/dist/assets/{hard-drive-CncrDZ7V.js → hard-drive-sI2ZzmqM.js} +0 -0
  486. /package/dist/assets/{hard-navigate-V2EFapkk.js → hard-navigate-BYoBFmE4.js} +0 -0
  487. /package/dist/assets/{heart-2AHOP0tB.js → heart-DFD4eqW-.js} +0 -0
  488. /package/dist/assets/{inbox-DXYIwUrn.js → inbox-OC3STytq.js} +0 -0
  489. /package/dist/assets/{info-CYiVdnQV.js → info-DkhVkzmK.js} +0 -0
  490. /package/dist/assets/{input-C-GkeWCw.js → input-tXUFa7Eo.js} +0 -0
  491. /package/dist/assets/{is-electron-7N7iyz1y.js → is-electron-DIlIrdJX.js} +0 -0
  492. /package/dist/assets/{key-round-CSc3w5ka.js → key-round-BFkuiQGH.js} +0 -0
  493. /package/dist/assets/{laptop-ByoaxLxg.js → laptop-BGOychmC.js} +0 -0
  494. /package/dist/assets/{layout-grid-PPpVK0nJ.js → layout-grid-Ct4RT2Ea.js} +0 -0
  495. /package/dist/assets/{link-2-BMNZFfWH.js → link-2-DhyrrFaE.js} +0 -0
  496. /package/dist/assets/{link-CowyzCIZ.js → link-DOobzBVg.js} +0 -0
  497. /package/dist/assets/{link-click-BEiniqcG.js → link-click-aVk_YdAp.js} +0 -0
  498. /package/dist/assets/{list-CDyb1CGV.js → list-D2LnQ7lS.js} +0 -0
  499. /package/dist/assets/{loader-circle-BzJ2kz3F.js → loader-circle-DWWXcfTQ.js} +0 -0
  500. /package/dist/assets/{log-in-Bhye1kwc.js → log-in-D4nsqRbG.js} +0 -0
  501. /package/dist/assets/{log-out-BLE632qu.js → log-out-CF9mMMsz.js} +0 -0
  502. /package/dist/assets/{machine-sizes-D0oAlF9f.js → machine-sizes-B9nt_h-U.js} +0 -0
  503. /package/dist/assets/{mail-DABv3_Ue.js → mail-DyUf40pu.js} +0 -0
  504. /package/dist/assets/{message-circle-gk_DFUIg.js → message-circle-ByXBaIaq.js} +0 -0
  505. /package/dist/assets/{message-square-zCNXaHYX.js → message-square-CHUvAEY9.js} +0 -0
  506. /package/dist/assets/{message-square-text-asdoy3SW.js → message-square-text-CN_v46So.js} +0 -0
  507. /package/dist/assets/{mic-DZrWtAAu.js → mic-BZZo0R22.js} +0 -0
  508. /package/dist/assets/{middleware-HE0NLvPl.js → middleware-Bxr-mmHu.js} +0 -0
  509. /package/dist/assets/{minimize-2-BR0ed4mI.js → minimize-2-Dj9FY4aF.js} +0 -0
  510. /package/dist/assets/{misc-CAQM4FGM.js → misc-BBsGq1IU.js} +0 -0
  511. /package/dist/assets/{monitor-B5vtTCxm.js → monitor-RX4oi4Nj.js} +0 -0
  512. /package/dist/assets/{moon-DSdti3GO.js → moon-CHW45huN.js} +0 -0
  513. /package/dist/assets/{native-deep-link-BJjxOpZm.js → native-deep-link-jXO4XsVj.js} +0 -0
  514. /package/dist/assets/{oauth-popup-Ql5xgtlO.js → oauth-popup-DAMkjCsP.js} +0 -0
  515. /package/dist/assets/{onboarding-step-layout-DGtbhZJb.js → onboarding-step-layout-Bsc_5btV.js} +0 -0
  516. /package/dist/assets/{optimistic-lifecycle-50vNA6dY.js → optimistic-lifecycle-GoMZsAsc.js} +0 -0
  517. /package/dist/assets/{pdf-8fO1Wz7e.js → pdf-OYDWiYl0.js} +0 -0
  518. /package/dist/assets/{pencil-CLJIvYKH.js → pencil-Cm5DdeRM.js} +0 -0
  519. /package/dist/assets/{play-CCT817Ah.js → play-Dh6Bw5AP.js} +0 -0
  520. /package/dist/assets/{plugin-attribution-Hjqz10My.js → plugin-attribution-DAf_69AU.js} +0 -0
  521. /package/dist/assets/{plus-JG7kWjHA.js → plus-EJu6s6xR.js} +0 -0
  522. /package/dist/assets/{pointer-QlIwQKYH.js → pointer-CQ4DXHXb.js} +0 -0
  523. /package/dist/assets/{prechat-EVefdGcO.js → prechat-C4MZwKWX.js} +0 -0
  524. /package/dist/assets/{profile-metadata-BksFtHNq.js → profile-metadata-CA6wxcVJ.js} +0 -0
  525. /package/dist/assets/{progress-bar-CJxkStgF.js → progress-bar-3GUUAhXi.js} +0 -0
  526. /package/dist/assets/{proxy-CNtrhN4q.js → proxy-DrtKRLtr.js} +0 -0
  527. /package/dist/assets/{public-asset-CD3ouSWU.js → public-asset-OTnPMErp.js} +0 -0
  528. /package/dist/assets/{puzzle-CtM3jM-f.js → puzzle-4NgH5snP.js} +0 -0
  529. /package/dist/assets/{refresh-cw-Ci7hSykC.js → refresh-cw-EZQqnaxp.js} +0 -0
  530. /package/dist/assets/{repeat-CIQpv9Nd.js → repeat-CP_vsQPN.js} +0 -0
  531. /package/dist/assets/{rotate-ccw-Da_2DvhY.js → rotate-ccw-CL6IkaAI.js} +0 -0
  532. /package/dist/assets/{sdk.gen-DEFA-6EJ.js → sdk.gen-BpJ1vF7l.js} +0 -0
  533. /package/dist/assets/{search-DA3TmTuR.js → search-DL-2uX3K.js} +0 -0
  534. /package/dist/assets/{send-DHWUIK7G.js → send-Bdmy_GSE.js} +0 -0
  535. /package/dist/assets/{settings-DyEBEqeQ.js → settings-6_RIT4kT.js} +0 -0
  536. /package/dist/assets/{shield-9aFTFyT9.js → shield-CAWgGAqm.js} +0 -0
  537. /package/dist/assets/{shield-check-z7CU-gBq.js → shield-check-CNsbiH1v.js} +0 -0
  538. /package/dist/assets/{sliders-horizontal-slneqAyY.js → sliders-horizontal-BwdOIxz8.js} +0 -0
  539. /package/dist/assets/{smartphone-BbK6bGuE.js → smartphone-CIrxb2NM.js} +0 -0
  540. /package/dist/assets/{sparkles-DC8kqYjt.js → sparkles-DfEFn3Bh.js} +0 -0
  541. /package/dist/assets/{square-Bn3X6ZlO.js → square-DTFrgbZb.js} +0 -0
  542. /package/dist/assets/{status-badge-pill-ZNNoKV1T.js → status-badge-pill-CFoeNqKo.js} +0 -0
  543. /package/dist/assets/{sun-BKEPYS7Q.js → sun-BauGiwdK.js} +0 -0
  544. /package/dist/assets/{surface-parse-helpers-CEJ3tQ9Q.js → surface-parse-helpers-iPHZ9D7N.js} +0 -0
  545. /package/dist/assets/{target-cdw7WP5q.js → target-CJU4DUFo.js} +0 -0
  546. /package/dist/assets/{terminal-Cs_TREv-.js → terminal-BucMVaPU.js} +0 -0
  547. /package/dist/assets/{three-dot-indicator-CfjkCgEH.js → three-dot-indicator-CeTxs9-J.js} +0 -0
  548. /package/dist/assets/{toggle-D776PTw-.js → toggle-BEPV0rQM.js} +0 -0
  549. /package/dist/assets/{trash-2-De6X8YiM.js → trash-2-DfVRfykB.js} +0 -0
  550. /package/dist/assets/{triangle-alert--e3n47gm.js → triangle-alert-D6bAGtMw.js} +0 -0
  551. /package/dist/assets/{upload-Bdbyo_ok.js → upload-DsWG9TbD.js} +0 -0
  552. /package/dist/assets/{use-copy-to-clipboard-BarKTY4m.js → use-copy-to-clipboard-RUBxQIiE.js} +0 -0
  553. /package/dist/assets/{use-is-mobile-Cx2xnNUx.js → use-is-mobile-MmHo-OM6.js} +0 -0
  554. /package/dist/assets/{user-Dq9DUxnU.js → user-DHC7OLPE.js} +0 -0
  555. /package/dist/assets/{user-plus-CXMJ1x_5.js → user-plus-DjxxnQ8G.js} +0 -0
  556. /package/dist/assets/{users-DWDkv8ju.js → users-OcC3p9Jn.js} +0 -0
  557. /package/dist/assets/{video-CQJlht8Q.js → video-Dtwi0MD9.js} +0 -0
  558. /package/dist/assets/{volume-2-Bj3y3ZBJ.js → volume-2-BXDl4IEg.js} +0 -0
  559. /package/dist/assets/{workflow-DbPANJpf.js → workflow-Bsy5y3W0.js} +0 -0
  560. /package/dist/assets/{workflow-status-CgrMMiJT.js → workflow-status-D0bBEpGp.js} +0 -0
  561. /package/dist/assets/{workspace-theme-tokens-bLqHFK0a.js → workspace-theme-tokens-dJKcMIdP.js} +0 -0
  562. /package/dist/assets/{wrench-tjOqvzJ2.js → wrench-DhynFba1.js} +0 -0
  563. /package/dist/assets/{x-DuBvjmAE.js → x-D4O9yIS7.js} +0 -0
  564. /package/dist/assets/{xterm-Ip5qSQfD.js → xterm-DARAJ0SV.js} +0 -0
  565. /package/dist/assets/{xterm-addon-fit-BbxIpbO2.js → xterm-addon-fit-BDf8Eu9n.js} +0 -0
@@ -1 +1 @@
1
- import{t as e}from"./useQuery-Bz-fbQ-m.js";import{n as t}from"./resolved-assistants-store-8HQDfxZh.js";import{a as n}from"./api-C8TlQNEU.js";function r(r){let i=t.use.activeAssistantId(),{data:a=!1}=e({queryKey:[`assistant-capability`,r,i],enabled:i!=null,queryFn:async()=>{if(!i)return!1;let e=await n(i);return e.ok&&e.data.capabilities?.[r]===!0},retry:!1,staleTime:6e4});return a}export{r as t};
1
+ import{t as e}from"./useQuery-Bz-fbQ-m.js";import{n as t}from"./resolved-assistants-store-C6oDdTxB.js";import{a as n}from"./api-CGsj1Pig.js";function r(r){let i=t.use.activeAssistantId(),{data:a=!1}=e({queryKey:[`assistant-capability`,r,i],enabled:i!=null,queryFn:async()=>{if(!i)return!1;let e=await n(i);return e.ok&&e.data.capabilities?.[r]===!0},retry:!1,staleTime:6e4});return a}export{r as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CqtAGHQu.js";import{t as n}from"./react-BFJW0bSv.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"./cn-CJf7MmLX.js";import"./src-Da9g8qsW.js";import{Cn as o,Sn as s,V as c,tt as l}from"./sdk.gen-CjtCuSlS.js";import{r as u}from"./api-CGsj1Pig.js";import{t as d}from"./identity-BplXBnQ5.js";import{t as f}from"./proxy-DrtKRLtr.js";import{t as p}from"./use-reduced-motion-fR0m_opJ.js";import{i as m}from"./avatar-tone-D99t9DAP.js";import{n as h,t as g}from"./eye-bbox-CRs175_n.js";import{n as _,r as v,t as y,u as b}from"./latest-assistant-text-CwHBWP6s.js";var x=e(n(),1),S=i(),C=.25,w=.46,T=.3,E=.85,D=.4,O=14,k=8;function A({components:e,traits:t,stage:n,entrance:r=!1,entranceDelay:i=0}){let a=p(),{w:o,h:s}=n,[c,l]=(0,x.useState)({x:0,y:0});(0,x.useEffect)(()=>{if(a)return;let e=e=>{l({x:(e.clientX/window.innerWidth-.5)*2,y:(e.clientY/window.innerHeight-.5)*2})};return window.addEventListener(`mousemove`,e),()=>window.removeEventListener(`mousemove`,e)},[a]);let u=r&&!a,[d,m]=(0,x.useState)(!1),[_,v]=(0,x.useState)(!r);(0,x.useEffect)(()=>{if(a||!_)return;let e=!1,t,n=n=>{e||(m(!0),t=setTimeout(()=>{e||(m(!1),t=setTimeout(n,140))},140))},i=()=>{t=setTimeout(()=>n(i),2500+Math.random()*4e3)};return r?n(()=>n(i)):i(),()=>{e=!0,clearTimeout(t)}},[a,_,r]);let y=(0,x.useMemo)(()=>{let n=e.eyeStyles.find(e=>e.id===t.eyeStyle);return n?{paths:n.paths,bbox:h(n.paths.map(e=>g(e.svgPath)))}:null},[e,t.eyeStyle]);if(!y||o===0||s===0)return null;let b=o*E,A=Math.min(Math.min(o,s)*T,b*y.bbox.h/y.bbox.w),j=A*y.bbox.w/y.bbox.h,M=(o-j)/2,N=s-(1-C)*A,P=D*s-(N+A/2),F=(w-C)*A,I=y.bbox.x+y.bbox.w/2,L=y.bbox.y+y.bbox.h/2;return(0,S.jsx)(f.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2]`,style:{left:M,top:N,width:j,height:A,transformOrigin:`center`},initial:u?{y:P,scale:.35}:!1,animate:u?{y:[P,F,0],scale:[.35,1,1]}:{y:0,scale:1},transition:u?{duration:1,delay:i,times:[0,.7,1],ease:`easeInOut`}:{duration:0},onAnimationComplete:()=>v(!0),children:(0,S.jsx)(`div`,{style:{transform:`translate(${c.x*O}px, ${c.y*k}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,S.jsx)(`svg`,{viewBox:`${y.bbox.x} ${y.bbox.y} ${y.bbox.w} ${y.bbox.h}`,width:j,height:A,style:{overflow:`visible`,display:`block`},children:(0,S.jsx)(`g`,{style:{transform:d?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${I}px ${L}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,S.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})}var j=T*(1-C),M=`#17191C`,N=24,P=.2,F=96,I=160,L=(0,x.createContext)(null);function R(){let e=(0,x.useContext)(L);if(!e)throw Error(`useAssistantStage must be used inside <AssistantStage>`);return e}function z(e,t){return!e||!t?null:e.colors.find(e=>e.id===t.color)?.hex??null}function B({components:e,traits:t,customImageUrl:n,entrance:r=!1,children:i,className:o}){let{ref:s,size:c}=v(),l=z(e,t)??M,u=m(l),d=!!(e&&t),f=!d&&!!n,p=Math.round(Math.min(I,Math.max(F,Math.min(c.w,c.h)*P))),h=c.h-p-N,g=d?Math.round(j*Math.min(c.w,c.h))+16:f?p+N+16:24;return(0,S.jsxs)(`div`,{ref:s,className:a(`relative flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-[var(--border-base)]`,o),style:{backgroundColor:l,color:u.fg},children:[d&&e&&t&&(0,S.jsx)(A,{components:e,traits:t,stage:c,entrance:r}),f&&n&&(0,S.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2] overflow-hidden rounded-full ring-4 ring-white/25`,style:{left:(c.w-p)/2,top:h,width:p,height:p},children:(0,S.jsx)(`img`,{src:n,alt:``,className:`h-full w-full object-cover`,draggable:!1})}),(0,S.jsx)(L.Provider,{value:{stage:c,tone:u,bottomReserve:g},children:(0,S.jsx)(`div`,{className:`relative z-10 flex min-h-0 flex-1 flex-col`,children:i})})]})}var V=[{id:`companion-coworker`,left:`Companion`,right:`Coworker`},{id:`genz-boomer`,left:`Gen Z`,right:`Baby Boomer`},{id:`execute-collaborate`,left:`Independent`,right:`Collaborative`},{id:`playful-serious`,left:`Playful`,right:`Serious`},{id:`polite-unfiltered`,left:`Polite`,right:`Unfiltered`}],H=50,U=1500,W=12e4,G=e=>new Promise(t=>setTimeout(t,e));async function K({assistantId:e,content:n,title:r,context:i}){let a,u=!1;try{let t=await l({path:{assistant_id:e},body:{conversationType:`standard`,title:r},throwOnError:!1});if(a=t.data?.id,!t.response?.ok||!a)return!1;let i=_({conversationId:a,content:n,transport:`vellum`});if(!(await o({path:{assistant_id:e},body:i,throwOnError:!1})).response?.ok)return!1;let c=Date.now()+W,d=``,f=0,p=!1;for(;Date.now()<c;){await G(U);let t=await s({path:{assistant_id:e},query:{conversationId:a},throwOnError:!1}),n=y(t.data?.messages??[]);if(n&&(f=n===d?f+1:0,d=n),t.data?.processing===!0&&(p=!0),b({processing:t.data?.processing,sawProcessing:p,hasReply:n.length>0,stableReads:f})){u=!0;break}}}catch(e){t(e,{context:i})}finally{if(a)try{await c({path:{assistant_id:e,id:a},throwOnError:!1})}catch(e){t(e,{context:`${i}_archive`})}}return u}function q(e){return[`assistant-identity-details`,e]}function J(e){return r({queryKey:q(e),queryFn:async()=>{let[t,n]=await Promise.all([d(e),u(e).catch(()=>({ok:!1,status:0,error:{}}))]);return{identity:t,createdAt:n.ok?n.data.created:null}}})}export{H as a,R as c,V as i,J as n,B as o,K as r,z as s,q as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-file-B71h3csB.js","assets/chunk-jRWAZmH_.js","assets/preload-helper-Cv2QeVDK.js","assets/is-electron-DIlIrdJX.js","assets/dist-an0Z446E.js"])))=>i.map(i=>d[i]);
2
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CqtAGHQu.js";import{t as n}from"./react-BFJW0bSv.js";import{F as r,t as i}from"./button-Dy5001j6.js";import{t as a}from"./preload-helper-Cv2QeVDK.js";import{t as o}from"./useQuery-Bz-fbQ-m.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"./chevron-left-CrxnPze-.js";import{t as d}from"./chevron-right-CANAtgGn.js";import"./src-Da9g8qsW.js";import{t as f}from"./download-Cnb8zZrK.js";import{t as ee}from"./file-DOePafLU.js";import{t as p}from"./loader-circle-DWWXcfTQ.js";import{t as m}from"./x-D4O9yIS7.js";import{n as h,t as g}from"./file-markdown-DnVLY_b_.js";import{l as _}from"./sdk.gen-CjtCuSlS.js";import{t as v}from"./haptics-C4p_Rjba.js";import{t as y}from"./edge-swipe-arbiter-store-BwC23ScO.js";import{a as b,r as x,t as S}from"./pdf-preview-pscVmtvX.js";var C=l(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),w=l(`file-headphone`,[[`path`,{d:`M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343`,key:`1vfytu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0`,key:`1etmh7`}]]),T=l(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),E=l(`file-play`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z`,key:`1tzo1f`}]]),D=l(`file-spreadsheet`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),O=l(`file-type-corner`,[[`path`,{d:`M12 22h6a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6`,key:`15usau`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M3 16v-1.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5V16`,key:`s1gz5`}],[`path`,{d:`M6 22h2`,key:`194x9m`}],[`path`,{d:`M7 14v8`,key:`11ixej`}]]),k=e(n(),1),A=e(r(),1);async function j(e,t){if(!t||t.startsWith(`rehydrated:`))return null;try{let{data:n,error:r}=await _({path:{assistant_id:e,id:t},parseAs:`blob`,throwOnError:!1});return!r&&n instanceof Blob?n:null}catch{return null}}async function M(e,t){let{saveFile:n}=await a(async()=>{let{saveFile:e}=await import(`./native-file-B71h3csB.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3,4]));if(t){let r=await j(t,e.id);if(r){await n(r,e.filename);return}}e.previewUrl&&await n(e.previewUrl,e.filename)}var N=s();function P({message:e,filename:t,onDownload:n,downloadDisabled:r=!1}){return(0,N.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:[(0,N.jsx)(`p`,{className:`text-body-medium-lighter text-white/80`,children:e}),(0,N.jsx)(i,{variant:`ghost`,leftIcon:(0,N.jsx)(f,{}),onClick:n,disabled:r,"aria-label":`Download ${t}`,className:`mt-4 text-white/70 hover:bg-white/10 hover:text-white max-md:bg-transparent`,tintColor:`currentColor`,children:`Download`})]})}var F=class extends Error{};async function I(e,t,n){if(t>204800)throw new F;if(e.startsWith(`data:`)){let t=x(e);if(!t)throw Error(`Malformed data URI`);return new TextDecoder().decode(t)}let r=await fetch(e,{signal:n});if(!r.ok)throw Error(`Failed to load file: ${r.status}`);let i=await r.blob();if(i.size>204800)throw new F;return i.text()}function L({url:e,filename:n,mimeType:r,sizeBytes:i}){let[o,s]=(0,k.useState)({status:`loading`});return(0,k.useEffect)(()=>{let n=new AbortController;return s({status:`loading`}),I(e,i,n.signal).then(e=>{n.signal.aborted||s({status:`ready`,text:e})}).catch(e=>{if(n.signal.aborted)return;let r=e instanceof F;r||t(e,{context:`attachment-text-preview`,bestEffort:!0}),s({status:`error`,tooLarge:r})}),()=>n.abort()},[e,i]),o.status===`loading`?(0,N.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,N.jsx)(p,{className:`h-8 w-8 animate-spin text-white/70`})}):o.status===`error`?(0,N.jsx)(P,{message:o.tooLarge?`File too large to preview inline.`:`Failed to load preview.`,filename:n,onDownload:async()=>{let{saveFile:t}=await a(async()=>{let{saveFile:e}=await import(`./native-file-B71h3csB.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3,4]));await t(e,n)}}):(0,N.jsx)(`div`,{className:`max-h-[80vh] w-[min(90vw,800px)] overflow-auto rounded-lg p-6`,style:{backgroundColor:`var(--surface-overlay)`,color:`var(--content-default)`},children:(0,N.jsx)(R,{text:o.text,filename:n,mimeType:r})})}function R({text:e,filename:t,mimeType:n}){return h(t,n)?(0,N.jsx)(g,{content:e}):(0,N.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-body-small-default`,children:e})}var z=60,B=.8,V=8,H=.35;function U({enabled:e,onPrev:t,onNext:n}){let[r,i]=(0,k.useState)(0),[a,o]=(0,k.useState)(!1),s=(0,k.useRef)(null),c=(0,k.useCallback)(()=>{s.current=null,i(0),o(!1)},[]);return{dragOffset:r,isDragging:a,onTouchStart:(0,k.useCallback)(t=>{if(!e)return;if(t.touches.length!==1){c();return}let n=t.touches[0];s.current={touchId:n.identifier,startX:n.clientX,startY:n.clientY,axis:`undecided`,lastDx:0}},[e,c]),onTouchMove:(0,k.useCallback)(e=>{let t=s.current;if(!t)return;if(e.touches.length!==1){c();return}let n=e.touches[0];if(n.identifier!==t.touchId)return;let r=n.clientX-t.startX,a=n.clientY-t.startY;if(t.lastDx=r,t.axis===`undecided`){if(Math.abs(r)<V&&Math.abs(a)<V)return;if(Math.abs(a)>Math.abs(r)*B){s.current=null;return}t.axis=`horizontal`,o(!0)}if(t.axis!==`horizontal`)return;if(Math.abs(r)<z&&Math.abs(a)>Math.abs(r)*B){c();return}let l=Math.sign(r),u=Math.abs(r);i(l*(u<=z?u:z+(u-z)*H))},[c]),onTouchEnd:(0,k.useCallback)(e=>{let r=s.current;if(!r||r.axis!==`horizontal`){c();return}if(e.touches.length>0){c();return}let i=Array.from(e.changedTouches).find(e=>e.identifier===r.touchId),a=i?i.clientX-r.startX:r.lastDx;a<=-z?(v.light(),n()):a>=z&&(v.light(),t()),c()},[n,t,c]),onTouchCancel:c}}var W=new Set([`ts`,`tsx`,`js`,`jsx`,`py`,`json`,`md`,`sh`,`bash`,`html`,`css`,`yaml`,`yml`,`txt`]),G=new Set([`application/json`,`application/javascript`,`application/xml`]),K=e=>{let t=e.lastIndexOf(`.`);return t===-1||t===e.length-1?``:e.slice(t+1).toLowerCase()},q=({open:e,onClose:t,attachment:n,assistantId:r,siblingAttachments:s,onNavigate:l})=>{let h=(0,k.useRef)(null);(0,k.useEffect)(()=>{e&&h.current?.focus()},[e]);let g=y.use.registerBackOwner(),_=y.use.unregisterBackOwner();(0,k.useEffect)(()=>{if(e)return g(),()=>_()},[e,g,_]);let v=!n.previewUrl&&n.id.startsWith(`rehydrated:`),x=e&&!n.previewUrl&&!!r&&!!n.id&&!v,{data:C,isError:w}=o({queryKey:[`attachmentContent`,r,n.id],queryFn:async()=>{let e=await j(r,n.id);if(!e)throw Error(`Failed to load file`);return e},enabled:x,staleTime:1/0,retry:!1}),[T,E]=(0,k.useState)(null);(0,k.useEffect)(()=>{if(!C){E(null);return}let e=URL.createObjectURL(C);return E(e),()=>{URL.revokeObjectURL(e),E(null)}},[C]);let D=n.previewUrl??T,[O,M]=(0,k.useState)(null),F=x&&!T&&!w,I=v?`Preview unavailable — file content was not preserved in chat history.`:w?`Failed to load preview.`:null,R=(0,k.useMemo)(()=>!s||s.length<=1?-1:s.findIndex(e=>e.id===n.id),[s,n.id]),z=R!==-1&&s!=null&&s.length>1,B=(0,k.useCallback)(()=>{!z||!s||!l||l(s[(R-1+s.length)%s.length])},[z,s,R,l]),V=(0,k.useCallback)(()=>{!z||!s||!l||l(s[(R+1)%s.length])},[z,s,R,l]),{dragOffset:H,isDragging:q,onTouchStart:J,onTouchMove:Y,onTouchEnd:X,onTouchCancel:Z}=U({enabled:z,onPrev:B,onNext:V}),te=(0,k.useCallback)(e=>{e.key===`Escape`?(e.preventDefault(),t()):e.key===`ArrowLeft`&&z?(e.preventDefault(),B()):e.key===`ArrowRight`&&z&&(e.preventDefault(),V())},[t,B,V,z]),ne=(0,k.useCallback)(e=>{e.target===h.current&&t()},[t]),Q=(0,k.useCallback)(async()=>{if(!D)return;let{saveFile:e}=await a(async()=>{let{saveFile:e}=await import(`./native-file-B71h3csB.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3,4]));await e(D,n.filename)},[D,n.filename]);if(!e)return null;let $=n.mimeType.toLowerCase(),re=$.startsWith(`image/`),ie=$.startsWith(`video/`),ae=$===`application/pdf`||$===`application/octet-stream`&&n.filename.toLowerCase().endsWith(`.pdf`),oe=K(n.filename),se=$.startsWith(`text/`)||G.has($)||W.has(oe);return(0,A.createPortal)((0,N.jsxs)(`div`,{ref:h,role:`dialog`,"aria-modal":`true`,"aria-label":`Preview of ${n.filename}`,tabIndex:-1,className:`fixed inset-0 z-50 flex flex-col items-center justify-center bg-black/80 outline-none [-webkit-app-region:no-drag]`,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,paddingRight:`var(--safe-area-inset-right, env(safe-area-inset-right, 0px))`},onKeyDown:te,onClick:ne,children:[(0,N.jsxs)(`div`,{className:`absolute inset-x-0 top-0 z-10 flex items-center gap-3 px-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`},children:[(0,N.jsx)(c,{variant:`body-small-default`,className:`w-11 shrink-0 truncate text-white/50`,children:b(n.sizeBytes)}),(0,N.jsx)(c,{as:`div`,variant:`body-medium-lighter`,className:`min-w-0 flex-1 truncate text-center text-white/90`,children:n.filename}),(0,N.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,N.jsx)(i,{variant:`ghost`,iconOnly:(0,N.jsx)(f,{}),expandOnMobile:!1,onClick:Q,disabled:!D,"aria-label":`Download ${n.filename}`,className:`h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`}),(0,N.jsx)(i,{variant:`ghost`,iconOnly:(0,N.jsx)(m,{}),expandOnMobile:!1,onClick:t,"aria-label":`Close preview`,className:`h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`})]})]}),z&&(0,N.jsxs)(`div`,{className:`pointer-events-none absolute inset-x-0 top-1/2 z-10 flex -translate-y-1/2 items-center justify-between px-4`,children:[(0,N.jsx)(i,{variant:`ghost`,iconOnly:(0,N.jsx)(u,{}),expandOnMobile:!1,onClick:B,"aria-label":`Previous attachment`,className:`pointer-events-auto h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`}),(0,N.jsx)(i,{variant:`ghost`,iconOnly:(0,N.jsx)(d,{}),expandOnMobile:!1,onClick:V,"aria-label":`Next attachment`,className:`pointer-events-auto h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`})]}),(0,N.jsx)(`div`,{className:`flex items-center justify-center`,style:{transform:`translateX(${H}px)`,transition:q?`none`:`transform 200ms ease-out`,touchAction:`pan-y`},onClick:e=>e.stopPropagation(),onTouchStart:J,onTouchMove:Y,onTouchEnd:X,onTouchCancel:Z,children:F?(0,N.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,N.jsx)(p,{className:`h-8 w-8 animate-spin text-white/70`})}):I?(0,N.jsx)(P,{message:I,filename:n.filename,onDownload:Q,downloadDisabled:!D}):ae&&D?(0,N.jsx)(S,{url:D}):re&&D&&O!==D?(0,N.jsx)(`img`,{src:D,alt:n.filename,onError:()=>M(D),className:`max-h-[80vh] max-w-[90vw] rounded object-contain`}):ie&&D?(0,N.jsx)(`video`,{"data-testid":`video-preview`,src:D,poster:n.thumbnailUrl??void 0,controls:!0,className:`max-h-[80vh] max-w-[90vw] rounded`}):se&&D?(0,N.jsx)(L,{url:D,filename:n.filename,mimeType:n.mimeType,sizeBytes:n.sizeBytes}):(0,N.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:[(0,N.jsx)(ee,{className:`h-16 w-16 text-white/60`}),(0,N.jsx)(`p`,{className:`mt-4 text-body-medium-default text-white/90`,children:n.filename}),(0,N.jsx)(`p`,{className:`mt-1 text-body-small-default text-white/60`,children:b(n.sizeBytes)}),(0,N.jsx)(i,{variant:`ghost`,leftIcon:(0,N.jsx)(f,{}),onClick:Q,disabled:!D,"aria-label":`Download ${n.filename}`,className:`mt-4 text-white/70 hover:bg-white/10 hover:text-white max-md:bg-transparent`,tintColor:`currentColor`,children:`Download`})]})}),z&&(0,N.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 z-10 flex justify-center`,style:{paddingBottom:`calc(var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)) + 2rem)`},onClick:e=>e.stopPropagation(),children:(0,N.jsxs)(c,{variant:`body-small-default`,className:`text-white/50`,children:[R+1,` / `,s.length]})})]}),document.body)};function J(e,t){let[n,r]=(0,k.useState)(null),i=(0,k.useCallback)(e=>r(e),[]),a=(0,k.useCallback)(()=>r(null),[]),o=(0,k.useCallback)(e=>r(e),[]);return{openPreview:i,previewModal:n?(0,N.jsx)(q,{open:!0,onClose:a,attachment:n,assistantId:e,siblingAttachments:t,onNavigate:o}):null}}export{O as a,T as c,j as i,w as l,q as n,D as o,M as r,E as s,J as t,C as u};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./button-Dy5001j6.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{t as i}from"./typography-DEI9Ra9z.js";import{t as a}from"./archive-BQ3zdIPv.js";import{a as o,c as s,l as c,o as l,r as u,s as d,t as f,u as p}from"./use-attachment-preview-CQjpDfsc.js";import"./src-Da9g8qsW.js";import{t as m}from"./download-Cnb8zZrK.js";import{t as h}from"./file-text-CwGsMgaa.js";import{t as g}from"./file-DOePafLU.js";import{m as _}from"./native-biometric-DetUqtjl.js";import{a as v,n as y,o as b}from"./pdf-preview-pscVmtvX.js";var x=e(t(),1),S=r(),C=`h-16 w-16 shrink-0 rounded-lg`,w={image:(0,S.jsx)(s,{className:`h-6 w-6`}),video:(0,S.jsx)(d,{className:`h-6 w-6`}),audio:(0,S.jsx)(c,{className:`h-6 w-6`}),pdf:(0,S.jsx)(o,{className:`h-6 w-6`}),code:(0,S.jsx)(p,{className:`h-6 w-6`}),archive:(0,S.jsx)(a,{className:`h-6 w-6`}),spreadsheet:(0,S.jsx)(l,{className:`h-6 w-6`}),document:(0,S.jsx)(h,{className:`h-6 w-6`}),text:(0,S.jsx)(h,{className:`h-6 w-6`}),file:(0,S.jsx)(g,{className:`h-6 w-6`})};function T({attachment:e,onPreview:t,onDownload:r,onPreviewError:a}){let{filename:o,mimeType:s,sizeBytes:c,previewUrl:l,thumbnailUrl:u}=e,d=y(s,o),f=d===`image`&&l!==null,p=d===`video`&&u!=null?u:null,h=!f&&p===null,g=t!=null,T=b(o,18),E=v(c),D=_(),O=(0,x.useCallback)(e=>{e.stopPropagation(),r?.()},[r]);return(0,S.jsxs)(`div`,{role:g?`button`:f?`img`:void 0,"aria-label":o,title:o,tabIndex:g?0:void 0,onClick:g?t:void 0,onKeyDown:g?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t?.())}:void 0,className:`group/square flex flex-col gap-1${g?` cursor-pointer`:``}`,children:[(0,S.jsxs)(`div`,{className:`relative w-fit`,children:[(0,S.jsx)(`div`,{className:`${C} flex items-center justify-center overflow-hidden bg-[var(--surface-lift)] bg-cover bg-center text-[var(--content-secondary)]${h?` border border-[var(--border-element)]`:``}`,style:p?{backgroundImage:`url(${JSON.stringify(p)})`}:void 0,children:f?(0,S.jsx)(`img`,{src:l,alt:``,"aria-hidden":!0,onError:a,className:`h-full w-full object-cover`}):p?null:w[d]}),r&&(0,S.jsx)(`div`,{className:`pointer-events-none absolute inset-0 rounded-lg bg-black/50 opacity-0 transition-opacity group-hover/square:pointer-events-auto group-hover/square:opacity-100 group-focus-within/square:pointer-events-auto group-focus-within/square:opacity-100`,children:(0,S.jsx)(n,{content:`Download`,children:(0,S.jsx)(`button`,{type:`button`,onClick:O,onKeyDown:e=>e.stopPropagation(),"aria-label":`Download ${o}`,className:`absolute bottom-1 right-1 flex h-6 w-6 items-center justify-center rounded-md text-white/80 transition-colors hover:bg-white/20 hover:text-white`,children:(0,S.jsx)(m,{className:`h-3.5 w-3.5`})})})})]}),(0,S.jsx)(i,{variant:`label-small-default`,className:`max-w-[64px] truncate text-[var(--content-tertiary)]`,children:T}),!D&&(0,S.jsx)(i,{variant:`label-small-default`,className:`text-[var(--content-disabled)]`,children:E})]})}function E({attachments:e,assistantId:t}){let[n,r]=(0,x.useState)(new Set),i=(0,x.useCallback)(e=>{r(t=>t.has(e)?t:new Set(t).add(e))},[]),a=(0,x.useMemo)(()=>n.size===0?e:e.map(e=>n.has(e.id)?{...e,previewUrl:null}:e),[e,n]),{openPreview:o,previewModal:s}=f(t,a);return{displayAttachments:a,renderSquare:(0,x.useCallback)((n,r)=>(0,S.jsx)(T,{attachment:n,onPreview:()=>o(n),onDownload:()=>void u(e[r]??n,t),onPreviewError:()=>i(n.id)},n.id),[e,t,o,i]),openPreview:o,markImageFailed:i,previewModal:s}}export{C as n,E as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./avatar-bundled-components-CTd294ra.js";var r=e(t(),1),i=`--avatar-accent`;function a(e,t){let r=t?.color;return r?(e?.colors??n.colors).find(e=>e.id===r)?.hex??null:null}function o(e,t,n){return n?null:a(e,t)??e?.colors?.[0]?.hex??null}var s=null;function c(){return s}function l(e,t,n){let c=a(e,t);(0,r.useEffect)(()=>{let e=document.documentElement;return c?e.style.setProperty(i,c):e.style.removeProperty(i),()=>{e.style.removeProperty(i)}},[c]);let l=o(e,t,n);(0,r.useEffect)(()=>{s=l},[l])}export{l as a,o as i,c as n,a as r,i as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./avatar-bundled-components-BvKt7I7O.js";var r=e(t(),1),i=`--avatar-accent`;function a(e,t){let r=t?.color;return r?(e?.colors??n.colors).find(e=>e.id===r)?.hex??null:null}function o(e,t,n){return n?null:a(e,t)??e?.colors?.[0]?.hex??null}var s=null;function c(){return s}function l(e,t,n){let c=a(e,t);(0,r.useEffect)(()=>{let e=document.documentElement;return c?e.style.setProperty(i,c):e.style.removeProperty(i),()=>{e.style.removeProperty(i)}},[c]);let l=o(e,t,n);(0,r.useEffect)(()=>{s=l},[l])}export{l as a,o as i,c as n,a as r,i as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-FWzaVb8P.js";import{t as n}from"./react-BFJW0bSv.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./use-supports-bookmarks-DbG5HZ6P.js";import"./src-BAS7a2RG.js";import{n as o}from"./toast-DR7D7Uma.js";import{n as s}from"./resolved-assistants-store-8HQDfxZh.js";import{S as c,b as l}from"./sdk.gen-BySz4QYj.js";import{i as u,r as d}from"./react-query.gen-0mspArBl.js";var f=e(n(),1),p=[];function m(){let e=s.use.activeAssistantId();return{assistantId:e,enabled:a(e)&&!!e}}function h(){let{assistantId:e,enabled:t}=m(),n=i({...d({path:{assistant_id:e??``}}),enabled:t});return{bookmarks:n.data?.bookmarks??p,isLoading:n.isLoading,isError:n.isError,refetch:()=>{n.refetch()}}}function g(e){let{assistantId:t,enabled:n}=m();return i({...d({path:{assistant_id:t??``}}),enabled:n,select:t=>e?t.bookmarks.some(t=>t.messageId===e):!1}).data??!1}function _(e,t){return a(s.use.activeAssistantId())&&!!t&&!!e.id&&!e.isOptimistic}function v(){let e=s.use.activeAssistantId(),n=r();return(0,f.useCallback)(async(r,i,a)=>{if(!e)return;let s=u({path:{assistant_id:e}});await n.cancelQueries({queryKey:s});let d=n.getQueryData(s);n.setQueryData(s,e=>{let t=e?.bookmarks??[];if(a)return{bookmarks:t.filter(e=>e.messageId!==r)};if(t.some(e=>e.messageId===r))return e;let n=Date.now();return{bookmarks:[{id:`optimistic-${r}`,messageId:r,conversationId:i,conversationTitle:null,messagePreview:``,messageRole:``,messageCreatedAt:n,createdAt:n},...t]}});try{a?await l({path:{assistant_id:e,messageId:r},throwOnError:!0}):await c({path:{assistant_id:e},body:{messageId:r,conversationId:i},throwOnError:!0})}catch(e){d!==void 0&&n.setQueryData(s,d),t(e,{context:`bookmark_toggle`}),o.error(a?`Failed to remove bookmark.`:`Failed to bookmark message.`)}finally{n.invalidateQueries({queryKey:s})}},[e,n])}export{g as i,h as n,_ as r,v as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CqtAGHQu.js";import{t as n}from"./react-BFJW0bSv.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./use-supports-bookmarks-DwTpI8uM.js";import"./src-Da9g8qsW.js";import{n as o}from"./toast-BtFgiPe3.js";import{n as s}from"./resolved-assistants-store-C6oDdTxB.js";import{S as c,b as l}from"./sdk.gen-CjtCuSlS.js";import{i as u,r as d}from"./react-query.gen-C7om930f.js";var f=e(n(),1),p=[];function m(){let e=s.use.activeAssistantId();return{assistantId:e,enabled:a(e)&&!!e}}function h(){let{assistantId:e,enabled:t}=m(),n=i({...d({path:{assistant_id:e??``}}),enabled:t});return{bookmarks:n.data?.bookmarks??p,isLoading:n.isLoading,isError:n.isError,refetch:()=>{n.refetch()}}}function g(e){let{assistantId:t,enabled:n}=m();return i({...d({path:{assistant_id:t??``}}),enabled:n,select:t=>e?t.bookmarks.some(t=>t.messageId===e):!1}).data??!1}function _(e,t){return a(s.use.activeAssistantId())&&!!t&&!!e.id&&!e.isOptimistic}function v(){let e=s.use.activeAssistantId(),n=r();return(0,f.useCallback)(async(r,i,a)=>{if(!e)return;let s=u({path:{assistant_id:e}});await n.cancelQueries({queryKey:s});let d=n.getQueryData(s);n.setQueryData(s,e=>{let t=e?.bookmarks??[];if(a)return{bookmarks:t.filter(e=>e.messageId!==r)};if(t.some(e=>e.messageId===r))return e;let n=Date.now();return{bookmarks:[{id:`optimistic-${r}`,messageId:r,conversationId:i,conversationTitle:null,messagePreview:``,messageRole:``,messageCreatedAt:n,createdAt:n},...t]}});try{a?await l({path:{assistant_id:e,messageId:r},throwOnError:!0}):await c({path:{assistant_id:e},body:{messageId:r,conversationId:i},throwOnError:!0})}catch(e){d!==void 0&&n.setQueryData(s,d),t(e,{context:`bookmark_toggle`}),o.error(a?`Failed to remove bookmark.`:`Failed to bookmark message.`)}finally{n.invalidateQueries({queryKey:s})}},[e,n])}export{g as i,h as n,_ as r,v as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/avatar-bundled-components-CTd294ra.js","assets/chunk-jRWAZmH_.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./preload-helper-Cv2QeVDK.js";var r=e(t(),1),i=null,a=null,o=new Set,s=3e3,c=!1;function l(){return i?Promise.resolve(i):a||(a=n(()=>import(`./avatar-bundled-components-CTd294ra.js`).then(e=>e.n).then(e=>{i=e.BUNDLED_COMPONENTS,a=null;for(let e of o)e();return i}),__vite__mapDeps([0,1])).catch(e=>{throw a=null,!c&&o.size>0&&(c=!0,setTimeout(()=>{!i&&o.size>0&&l().catch(()=>{})},s)),e}),a)}function u(){l().catch(()=>{})}function d(){let[,e]=(0,r.useState)(0);return(0,r.useEffect)(()=>{if(i)return;let t=!1,n=()=>{t||e(e=>e+1)};return o.add(n),l().catch(()=>{}),()=>{t=!0,o.delete(n)}},[]),i}export{d as n,u as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/avatar-bundled-components-BvKt7I7O.js","assets/chunk-jRWAZmH_.js"])))=>i.map(i=>d[i]);
2
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./preload-helper-Cv2QeVDK.js";var r=e(t(),1),i=null,a=null,o=new Set,s=3e3,c=!1;function l(){return i?Promise.resolve(i):a||(a=n(()=>import(`./avatar-bundled-components-BvKt7I7O.js`).then(e=>e.n).then(e=>{i=e.BUNDLED_COMPONENTS,a=null;for(let e of o)e();return i}),__vite__mapDeps([0,1])).catch(e=>{throw a=null,!c&&o.size>0&&(c=!0,setTimeout(()=>{!i&&o.size>0&&l().catch(()=>{})},s)),e}),a)}function u(){l().catch(()=>{})}function d(){let[,e]=(0,r.useState)(0);return(0,r.useEffect)(()=>{if(i)return;let t=!1,n=()=>{t||e(e=>e+1)};return o.add(n),l().catch(()=>{}),()=>{t=!0,o.delete(n)}},[]),i}export{d as n,u as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./event-bus-CvZyJQ26.js";var r=e(t(),1);function i(e,t){let i=(0,r.useRef)(t);(0,r.useLayoutEffect)(()=>{i.current=t}),(0,r.useEffect)(()=>n(e,e=>{i.current(e)}),[e])}export{i as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./event-bus-CbDg1VDt.js";var r=e(t(),1);function i(e,t){let i=(0,r.useRef)(t);(0,r.useLayoutEffect)(()=>{i.current=t}),(0,r.useEffect)(()=>n(e,e=>{i.current(e)}),[e])}export{i as t};
@@ -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{n as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{c as a,g as o,n as s}from"./QueryClientProvider-CMu7CkQU.js";import{t as c}from"./useQuery-Bz-fbQ-m.js";import{t as l}from"./useMutation-CXGTrp4W.js";import{t as u}from"./jsx-runtime-D3ZM-ToX.js";import{t as d}from"./typography-DEI9Ra9z.js";import{t as f}from"./createLucideIcon-CAM1RhH8.js";import{t as p}from"./arrow-right-ChqGeAaW.js";import{t as m}from"./check-Dt2rQhdg.js";import{t as h}from"./circle-alert-DQMH8VJH.js";import{t as g}from"./circle-check-DvrCdroD.js";import{t as _}from"./coins-CcTuNVlN.js";import{n as v,t as y}from"./sliders-horizontal-BwdOIxz8.js";import{t as b}from"./hard-drive-sI2ZzmqM.js";import{t as x}from"./info-DkhVkzmK.js";import{t as S}from"./loader-circle-DWWXcfTQ.js";import{t as C}from"./triangle-alert-D6bAGtMw.js";import{t as w}from"./notice-Dslxs3H6.js";import{t as T}from"./modal-xr_vw1ZO.js";import{n as E}from"./toast-BtFgiPe3.js";import{t as ee}from"./confirm-dialog-j9o2h3xs.js";import{t as D}from"./dropdown-B3FHWc_n.js";import{n as O}from"./resolved-assistants-store-C6oDdTxB.js";import{at as k,d as A,f as j,l as te,tt as M,u as N}from"./auth-store-C9aYqB9U.js";import{S as ne,b as re}from"./native-biometric-DetUqtjl.js";import{d as ie}from"./routes-DrfnNoYS.js";import{d as P}from"./platform-detection-AHYibqOx.js";import{n as F}from"./use-assistant-avatar-Bjqx8JUy.js";import{r as ae}from"./use-is-org-ready-3vHDbj4G.js";import{n as oe,r as I}from"./browser-CcdNg0HN.js";import{$ as se,C as ce,O as le,at as ue,c as de,ct as L,et as R,it as fe,jt as z,l as pe,lt as me,nt as he,ot as ge,r as _e,rt as ve,st as ye,tt as be,ut as B,y as xe}from"./react-query.gen-BtYBixpk.js";import{t as V}from"./avatar-bundled-components-BvKt7I7O.js";import{r as Se}from"./use-avatar-accent-var-BafXGBXW.js";import{t as H}from"./misc-BBsGq1IU.js";import{n as Ce,t as we}from"./avatar-tone-D99t9DAP.js";import{t as Te}from"./chat-avatar-B5fx9Xm3.js";import{t as Ee}from"./avatar-renderer-TpNgmnU1.js";import{n as U}from"./use-bundled-avatar-components-BcyasJwu.js";import{t as De}from"./android-consumption-only-D3L1Nc41.js";import{c as Oe,i as W,l as ke,n as G,r as Ae,t as je}from"./machine-sizes-B9nt_h-U.js";import{a as Me,i as Ne,n as Pe,r as Fe,t as Ie}from"./provisioning-targets-Cah9jNBe.js";import{t as Le}from"./environment-store-DxX3xxt2.js";var Re=f(`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`}]]),K=u();function ze({children:e,redirectToBilling:t=!1}){return P()?t?(0,K.jsx)(r,{replace:!0,to:ie.settings.usageBilling}):(0,K.jsx)(w,{tone:`info`,children:De}):e}var q=e(t(),1);function Be({icon:e}){return(0,K.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,K.jsx)(e,{className:`h-5 w-5`,style:{color:`var(--system-negative-strong)`},"aria-hidden":`true`})})}var J={fontFamily:`var(--font-serif)`,fontSize:`32px`,fontWeight:400,lineHeight:1.2,letterSpacing:`0.64px`};function Y({title:e,subtitle:t}){return(0,K.jsxs)(`header`,{className:`flex flex-col items-center gap-2 pt-12 text-center`,children:[(0,K.jsx)(`h2`,{className:`text-[var(--content-emphasised)]`,style:J,children:e}),t&&(0,K.jsx)(`p`,{className:`text-[14px] font-normal text-[var(--content-secondary)]`,children:t})]})}var Ve=[{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}],He=[{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 Ue({variant:e=`full`}){let t=U();return t?(0,K.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`creature-corners`,className:`pointer-events-none absolute inset-0 select-none`,children:(e===`top`?He:Ve).map((e,n)=>(0,K.jsx)(`span`,{className:`absolute ${e.position}`,style:{rotate:`${e.rotate}deg`},children:(0,K.jsx)(Ee,{components:t,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:e.size})},n))}):null}var X={waitingStatus:`Upgrading your assistant…`,snagStatus:`We hit a snag upgrading your assistant`,snagCaption:`Retry in the background and we'll keep working on your upgrade.`,confirmingStatus:`Confirming your upgrade…`,confirmTimeoutStatus:`Still confirming your upgrade`,confirmTimeoutCaption:`Your payment went through safely. This can take a minute.`,backgroundConfirmMessage:`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.`,backgroundExitToast:`Your upgrade continues in the background.`,backgroundRetryToast:`We'll retry your upgrade in the background.`,completeSubtitle:`Enjoy the new found power.`,fetchErrorBody:`We hit a problem checking your subscription. Your upgrade may still be processing. Return to billing to refresh.`},Z={waitingStatus:`Updating your assistant…`,snagStatus:`We hit a snag updating your assistant`,snagCaption:`Retry in the background and we'll keep working on your plan change.`,confirmingStatus:`Confirming your plan change…`,confirmTimeoutStatus:`Still confirming your plan change`,confirmTimeoutCaption:`Your plan change was submitted. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still updating. 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.`,backgroundExitToast:`Your plan change continues in the background.`,backgroundRetryToast:`We'll retry your plan change in the background.`,completeSubtitle:`Your plan changes are live.`,fetchErrorBody:`We hit a problem checking your subscription. Your plan change may still be processing. Return to billing to refresh.`},Q={upgrade:X,downgrade:Z,change:Z};function We(e=`upgrade`){return Q[e]}function Ge(e,t=!0){let{data:n}=c({..._e(),enabled:t&&e==null}),{data:r}=c({...le({path:{id:e??``}}),enabled:t&&e!=null});return e==null?n:r}function Ke({assistantId:e,direction:t}){let r=i(),a=Ge(e,ae())?.name||`your assistant`;return(0,K.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,K.jsx)(Ue,{variant:`full`}),(0,K.jsxs)(`div`,{className:`relative flex w-full flex-col items-center`,children:[(0,K.jsx)(Y,{title:`You're all set!`,subtitle:We(t).completeSubtitle}),(0,K.jsx)(`div`,{className:`mt-10 flex w-full flex-col items-center gap-10`,children:(0,K.jsxs)(n,{variant:`primary`,"data-testid":`onboarding-complete-return`,onClick:()=>{e!=null&&M(e),r(ie.assistant,{replace:!0})},children:[`Return to `,a]})})]})]})}function qe(e=!0,t){let n=Ge(t,e),r=t??n?.id,{data:i,isError:a,isFetching:o,dataUpdatedAt:s,errorUpdatedAt:l}=c({...de({path:{assistant_id:r??``}}),enabled:e&&!!r});return{assistant:n,assistantId:r,domains:i,domainsError:a,domainsFetching:o,domainsUpdatedAt:s,domainsErrorUpdatedAt:l}}var Je=1e3,Ye=1e4,Xe=2500,Ze=2e3,Qe=1e4,$e=[`machine_size`,`subdomain`,`non_field_errors`],et={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.`,no_provisionable_assistants:`We couldn't find an assistant to upgrade yet. Try again in a moment.`},tt={provisioning_submission_failed:`We couldn't queue your plan change just now. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to update yet. Try again in a moment.`};function nt(e,t,n=`upgrade`){if(e&&typeof e==`object`){let t=e;if(typeof t.error==`string`){let e=(n===`upgrade`?void 0:tt[t.error])??et[t.error];if(e)return e}for(let e of $e){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 rt=`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`,it=`text-[11px] font-medium text-[var(--content-secondary)]`;function at({onExit:e,machineBusy:t=!1,assistantId:r}){let i=s(),a=Le.use.emailRootDomain(),{assistant:o,assistantId:c,domains:u}=qe(!0,r),d=u?.results[0],[f,p]=(0,q.useState)(``),[m,h]=(0,q.useState)(`hi`),[g,_]=(0,q.useState)(!1);(0,q.useEffect)(()=>{if(!g){if(d){p(d.subdomain),_(!0);return}!o?.handle||f||(p(o.handle),_(!0))}},[o?.handle,d,g,f]);let[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(!1),S=l(ue()),C=!!d||b,E=S.isPending||b;return(0,q.useEffect)(()=>{if(!b)return;let t=setTimeout(e,800);return()=>clearTimeout(t)},[b,e]),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(T.Body,{className:`animate-[onboarding-step-in_350ms_ease-out] space-y-6 pb-0 motion-reduce:animate-none`,children:[(0,K.jsx)(Ue,{variant:`top`}),(0,K.jsx)(Y,{title:`Assistant Email`,subtitle:`Set up an email for your assistant.`}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`label`,{htmlFor:`onboarding-email-prefix`,className:it,children:`Prefix`}),(0,K.jsx)(`input`,{id:`onboarding-email-prefix`,value:m,onChange:e=>h(e.target.value.toLowerCase().trim()),disabled:E||C,readOnly:C,placeholder:`hi`,className:`${rt} w-24`})]}),(0,K.jsx)(`span`,{className:`flex h-8 items-center text-[var(--content-secondary)]`,children:`@`}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,K.jsx)(`label`,{htmlFor:`onboarding-email-handle`,className:it,children:`Handle (public)`}),(0,K.jsx)(`input`,{id:`onboarding-email-handle`,value:f,onChange:e=>{p(e.target.value.toLowerCase().trim()),v&&y(null)},disabled:E||C,readOnly:C,autoFocus:!0,placeholder:`my-assistant`,"aria-invalid":!!v,className:`${rt} w-full min-w-0`})]}),(0,K.jsxs)(`span`,{className:`flex h-8 shrink-0 items-center text-[14px] text-[var(--content-tertiary)]`,children:[`.`,a]})]}),v&&(0,K.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:v}),C&&(0,K.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`This domain has been set and cannot be changed.`})]}),t&&!C&&(0,K.jsx)(w,{tone:`neutral`,children:`Your assistant is restarting — you can set the domain in a moment.`}),!C&&(0,K.jsx)(w,{tone:`info`,className:`border-transparent bg-[var(--surface-active)]`,children:(0,K.jsx)(`span`,{className:`font-medium text-[var(--content-tertiary)]`,children:`You won't be able to change the handle once set.`})}),b?(0,K.jsx)(w,{tone:`success`,children:`Domain set — redirecting…`}):null]}),(0,K.jsx)(T.Footer,{className:`items-center pt-6`,children:C?(0,K.jsx)(n,{variant:`primary`,"data-testid":`onboarding-domain-continue`,onClick:e,children:`Continue`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(n,{variant:`outlined`,"data-testid":`onboarding-domain-skip`,disabled:E,onClick:()=>{E||S.mutate({body:{skipped:!0}},{onSuccess:e,onError:()=>e()})},children:`Skip`}),(0,K.jsx)(n,{variant:`primary`,"data-testid":`onboarding-domain-set`,disabled:!f||E||t,onClick:()=>{E||t||!f||S.mutate({body:{subdomain:f,...m?{email_username:m}:{}}},{onSuccess:()=>{y(null),x(!0),i.invalidateQueries({queryKey:xe()}),i.invalidateQueries({queryKey:pe({path:{assistant_id:c??``}})}),i.invalidateQueries({queryKey:L()})},onError:e=>{y(nt(e,`Couldn't register that subdomain. Try a different one.`))}})},children:`Next`})]})})]})}function ot({onGoToBilling:e,direction:t}){return(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-6 py-10 text-center`,children:[(0,K.jsx)(Be,{icon:h}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(d,{variant:`title-small`,as:`h1`,children:`Couldn't reach billing`}),(0,K.jsx)(d,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:We(t).fetchErrorBody})]}),(0,K.jsx)(n,{variant:`primary`,"data-testid":`onboarding-go-to-billing`,onClick:e,children:`Go to billing`})]})}function st(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function $(e){return`${st(e)}/mo`}function ct(e){return`${e>0?`+`:`−`}${st(Math.abs(e))}/mo`}function lt(e){return`${e} GB storage`}function ut(e){return`${st(e*100)} of bundled credits`}function dt(e){let{targets:t,fromSnapshot:n,machineFloor:r,credits:i}=e,a=[];return t.machineSize==null?r!=null&&n.machineSize!=null&&n.machineSize!==r&&a.push({key:`machine`,label:`Machine`,from:W[n.machineSize],to:W[r]}):n.machineSize!==t.machineSize&&a.push({key:`machine`,label:`Machine`,from:n.machineSize==null?void 0:W[n.machineSize],to:W[t.machineSize]}),t.storageGib!=null&&(n.storageGib==null||t.storageGib>n.storageGib)&&a.push({key:`storage`,label:`Storage`,from:n.storageGib==null?void 0:`${n.storageGib} GB`,to:`${t.storageGib} GB`}),i!=null&&a.push({key:`credits`,label:`Credits`,from:i.from,to:i.to}),a}var ft=60,pt=ft*2;function mt({imageUrl:e,animateIn:t=!0}){return(0,K.jsxs)(`div`,{"aria-hidden":!0,"data-testid":`takeover-backdrop`,className:`pointer-events-none absolute inset-0 overflow-hidden${t?` provision-avatar-reveal`:``}`,children:[(0,K.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(${ft}px)`,width:`calc(100% + ${pt*2}px)`,height:`calc(100% + ${pt*2}px)`}}),(0,K.jsx)(`div`,{className:`absolute inset-0 bg-black/55`})]})}function ht(e){let t=e?.match(/^credits_(\d+)$/)?.[1];return t==null?null:Number(t)}function gt(e,t){if(t!=null)return e?.credit_tiers?.find(e=>e.tier===t)}function _t(e){let t=ae(),{data:n}=c({...se(),enabled:t&&e});return n?.plans.find(e=>e.id===`pro`)}function vt(e,t){return t==null?0:gt(e,t)?.credits_usd??ht(t)}function yt(e){let t=_t(e!=null);if(e==null||t==null)return null;let n;if(e.kind===`package`){let r=t.packages.find(t=>t.key===e.packageKey);n=r?.credits_usd??gt(t,r?.credit_tier)?.credits_usd}else n=gt(t,e.creditTier)?.credits_usd;return n==null?null:{fromUsd:0,toUsd:n}}function bt(e){let t=_t(e!=null);if(e==null)return null;let n=vt(t,e.fromTier),r=vt(t,e.toTier);return n==null||r==null?null:{fromUsd:n,toUsd:r}}function xt(e){let t=O.use.activeAssistantId(),n=e===void 0?t:e,{components:r,traits:i,customImageUrl:a,isLoading:o}=F(n),s=(0,q.useMemo)(()=>A(),[j()]),c=s!=null&&N(s)?s:null,l=n!=null&&!o,u=c!=null&&(n==null||n===c.assistantId),d=u&&!(l&&(r!=null||i!=null||a!=null))?c:null,f=d?d.components:r,p=d?d.traits:i,m=d?null:a,h=l||u,g=Se(f,p)??(m?null:(f??V).colors?.[0]?.hex??null);return{tintHex:h&&g?Ce(g):we,backdropImageUrl:h?m:null,ready:h,avatar:{components:f,traits:p,customImageUrl:m}}}function St(e,t){let[n,r]=(0,q.useState)(e),i=(0,q.useRef)(0);return(0,q.useEffect)(()=>{i.current=performance.now()},[]),(0,q.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 Ct=`--takeover-surface`,wt=`var(${Ct},${we})`,Tt=`color-mix(in srgb, var(--content-emphasised) 10%, transparent)`,Et=240,Dt=1.414,Ot=[{minHeight:680,size:Et},{minHeight:600,size:184}],kt=132;function At(e){for(let t of Ot)if(e>=t.minHeight)return t.size;return kt}function jt(){let[e,t]=(0,q.useState)(()=>At(typeof window>`u`?1/0:window.innerHeight));return(0,q.useEffect)(()=>{let e=()=>t(At(window.innerHeight));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var Mt={machine:v,storage:b,credits:_},Nt={idle:``,working:` is-working`,settling:` is-settling`,stalled:` is-stalled`,grown:` is-evolved`};function Pt(e,t){return e===`DONE`||e===`NOT_APPLICABLE`?`grown`:e===`STALLED`?`stalled`:e===`WAITING`||e===`RESIZING`?t?`settling`:`working`:`idle`}function Ft({assistantId:e,mode:t,downsizing:n=!1}){let{avatar:r,ready:i}=xt(e),a=U(),o=jt(),s=t===`working`||t===`settling`;return(0,K.jsxs)(`div`,{"aria-hidden":!0,className:`provision-avatar-evolve relative z-10 flex flex-col items-center${Nt[i?t:`idle`]}${n?` is-downsizing`:``}`,style:{"--provision-avatar-size":`${o}px`,"--provision-avatar-growth":Dt},children:[(0,K.jsxs)(`div`,{className:`provision-avatar-stage`,children:[(0,K.jsx)(`div`,{"data-testid":`provision-avatar-placeholder`,className:`provision-avatar-placeholder${i?` is-resolved`:``}`}),(0,K.jsx)(`div`,{className:`provision-avatar-layer`,children:(0,K.jsx)(`div`,{className:`provision-avatar-current`,children:(0,K.jsx)(`div`,{className:`provision-avatar-strain`,children:i&&(0,K.jsx)(`div`,{className:`provision-avatar-reveal`,children:(0,K.jsx)(Te,{components:r.components??a,traits:r.traits,customImageUrl:r.customImageUrl,size:o,isAssistantBusy:s})})})})})]}),(0,K.jsx)(`div`,{className:`provision-avatar-shadow`})]})}function It({status:e,caption:t}){return(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,K.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:J,children:e}),t&&(0,K.jsx)(d,{variant:`body-medium-lighter`,as:`p`,className:`max-w-sm text-[var(--content-secondary)]`,children:t})]})}function Lt({icon:e,label:t,from:n,to:r,done:i=!1,pending:a=!1,testId:o}){let s=null;return i?s=`Complete`:a&&(s=`Pending`),(0,K.jsxs)(`div`,{"data-testid":o,className:`flex min-w-0 flex-auto items-center gap-2 rounded-lg px-2 py-1.5${a?` opacity-70`:``}`,style:{backgroundColor:Tt},children:[(0,K.jsx)(`span`,{className:`hidden h-6 w-6 shrink-0 items-center justify-center min-[420px]:flex`,children:(0,K.jsx)(e,{className:`h-3.5 w-3.5 text-[var(--content-tertiary)]`,"aria-hidden":`true`})}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 text-left wrap-anywhere`,children:[(0,K.jsx)(`span`,{className:`text-[12px] font-medium leading-tight text-[var(--content-tertiary)]`,children:t}),(0,K.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5 text-[14px] font-medium leading-[18px] text-[var(--content-emphasised)]`,children:[n&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{children:n}),(0,K.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,K.jsx)(p,{className:`h-3 w-3 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":`true`})]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{children:r}),i?(0,K.jsx)(m,{"data-testid":`chip-check`,className:`h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`,"aria-hidden":`true`}):a&&(0,K.jsx)(S,{"data-testid":`chip-spinner`,className:`h-3.5 w-3.5 shrink-0 animate-spin text-[var(--content-tertiary)] motion-reduce:animate-none`,"aria-hidden":`true`})]}),s&&(0,K.jsx)(`span`,{className:`sr-only`,children:s})]})]})]})}function Rt({label:e}){return(0,K.jsx)(`span`,{className:`rounded-lg px-3 py-2 text-[14px] text-[var(--content-emphasised)]`,style:{backgroundColor:Tt},children:e})}function zt({children:e,wide:t=!1,testId:n}){return(0,K.jsx)(`div`,{"data-testid":n,className:`flex w-full ${t?`max-w-2xl`:`max-w-sm`} items-stretch justify-center gap-2`,children:e})}function Bt(e,t){return e===`credits`?!0:t?.[e]===!0}function Vt({intent:e,creditsChange:t,targets:n,fromSnapshot:r,machineFloor:i,landed:a,allDone:o=!1,creditsOnly:s=!1}){let c=yt(e),l=bt(t),u=c??l,d=dt({targets:n,fromSnapshot:r,machineFloor:i,credits:u==null?null:{from:$(u.fromUsd*100),to:$(u.toUsd*100)}}),f=s?d.filter(e=>e.key===`credits`):d,p=f.filter(e=>o||Bt(e.key,a)).map(e=>e.label).join(`, `),[m]=(0,q.useState)(p),h=p===m?``:`${p} complete`;return f.length===0?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(zt,{testId:`resource-chips`,wide:f.length>=3,children:f.map(e=>{let t=o||Bt(e.key,a);return(0,K.jsx)(Lt,{testId:`chip-${e.key}`,icon:Mt[e.key],label:e.label,from:e.from,to:e.to,done:t,pending:!t},e.key)})}),(0,K.jsx)(`p`,{"aria-live":`polite`,className:`sr-only`,"data-testid":`chip-announcement`,children:h})]})}function Ht({intent:e}){if(e.kind===`package`)return(0,K.jsx)(zt,{children:(0,K.jsx)(Rt,{label:`${e.packageKey.charAt(0).toUpperCase()+e.packageKey.slice(1)} package`})});let t=[e.machineTier,e.storageTier,e.creditTier].filter(e=>e!=null).length;return(0,K.jsxs)(zt,{wide:t>=3,children:[e.machineTier!=null&&(0,K.jsx)(Lt,{icon:v,label:`Machine`,to:G[e.machineTier]??e.machineTier}),e.storageTier!=null&&(0,K.jsx)(Lt,{icon:b,label:`Storage`,to:e.storageTier.toUpperCase()}),e.creditTier!=null&&(0,K.jsx)(Rt,{label:`${e.creditTier.replace(`credits_`,``)} credits`})]})}function Ut({state:e,direction:t,softWaiting:r,intent:i,creditsChange:a,targets:o,fromSnapshot:s,machineFloor:c,landed:l,celebrating:u,onCelebrationEnd:d,assistantId:f,escapeAvailable:p,onEscape:m,onPhaseChange:h,kickError:g,confirm:_,dwellMs:v=Xe,phaseMinMs:y=900}){let b=We(t),x=(0,q.useRef)(d);(0,q.useEffect)(()=>{x.current=d},[d]);let S=St(e,y),C=S===`DONE`||S===`NOT_APPLICABLE`,w=S===`RESIZING`?`WAITING`:S,T=(0,q.useRef)(h);(0,q.useEffect)(()=>{T.current=h},[h]),(0,q.useEffect)(()=>{T.current?.(S)},[S]);let{tintHex:E,backdropImageUrl:ee}=xt(f),D=u&&C;return(0,q.useEffect)(()=>{if(!D)return;let e=setTimeout(()=>x.current(),v);return()=>clearTimeout(e)},[D,v]),(0,K.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:{[Ct]:E,backgroundColor:wt},children:[ee&&(0,K.jsx)(mt,{imageUrl:ee}),(0,K.jsx)(Ft,{assistantId:f,mode:Pt(S,r),downsizing:t===`downgrade`}),(0,K.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:A()},w)]});function O(e=`Continue in the background`){return p?(0,K.jsx)(n,{variant:`ghost`,"data-testid":`provisioning-escape`,onClick:m,children:e}):null}function k({allDone:e=!1,creditsOnly:t=!1}={}){return(0,K.jsx)(Vt,{intent:i,creditsChange:a,targets:o,fromSnapshot:s,machineFloor:c,landed:l,allDone:e,creditsOnly:t})}function A(){if(S===`CONFIRMING`)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(It,{status:b.confirmingStatus,caption:`This might take a couple seconds.`}),i&&(0,K.jsx)(Ht,{intent:i}),O()]});if(S===`WAITING`||S===`RESIZING`)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(It,{status:b.waitingStatus,caption:r?`Still working — this can take a minute or two.`:`This might take a couple seconds.`}),k(),O()]});if(S===`DONE`)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(It,{status:`All done!`}),k({allDone:!0})]});if(S===`NOT_APPLICABLE`)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(It,{status:`Your plan is ready`}),k({allDone:!0,creditsOnly:!0})]});if(S===`STALLED`){let e=g!=null;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(It,{status:e?b.snagStatus:`This is taking longer than expected`,caption:e?nt(g,b.snagCaption,t):`This may take a couple of minutes.`}),k(),e?O(`Retry in the background`):O()]})}return S===`CONFIRM_TIMEOUT`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(It,{status:b.confirmTimeoutStatus,caption:b.confirmTimeoutCaption}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,K.jsx)(n,{variant:`outlined`,"data-testid":`onboarding-go-to-billing`,onClick:_.onGoToBilling,children:`Go to billing`}),(0,K.jsx)(n,{variant:`primary`,"data-testid":`onboarding-retry`,onClick:_.onRetry,children:`Try again`})]})]}):null}}function Wt(e){let{planId:t,targets:n,actuals:r,initialActuals:i,resizeOperationInFlight:a,sawOperation:o,msSinceWatchStart:s,confirmExpired:c,serverVerdict:l=null,statusObservedSinceTargetsMet:u=!0,targetsProveNoop:d=!0}=e;if(t!==`pro`)return{state:c?`CONFIRM_TIMEOUT`:`CONFIRMING`,softWaiting:!1};let f=o||a,p=l===`started`||l===`in_progress`,m=o||d&&u;if(!a){let e=p?m:f||l===`already_done`||i!=null&&!Me(n,i);if(Me(n,r)){if(e)return{state:`DONE`,softWaiting:!1};if(!p&&(d||l===`not_applicable`))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}:f||l===`started`||l===`in_progress`?{state:`RESIZING`,softWaiting:!1}:{state:`WAITING`,softWaiting:s!=null&&s>=3e4}}var Gt=2e3,Kt=1e3,qt=[`DONE`,`NOT_APPLICABLE`,`CONFIRM_TIMEOUT`],Jt={assistantId:null,machine:null,storage:null};function Yt({open:e,canLowerResources:t=!1,verdictRecheckMs:n=Qe}){let r=s(),i=ae(),[u,d]=(0,q.useState)(!1),[f,p]=(0,q.useState)(0),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(null),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(null),[S,C]=(0,q.useState)(null),[w,T]=(0,q.useState)(null),[E,ee]=(0,q.useState)(Jt),[D,O]=(0,q.useState)(null),[A,j]=(0,q.useState)(!1),te=(0,q.useRef)(!1),M=(0,q.useRef)(!1),N=(0,q.useRef)(0),[ne,re]=(0,q.useState)(!1),[ie,P]=(0,q.useState)(null),[F,oe]=(0,q.useState)(null),[I,se]=(0,q.useState)(null),[ue,de]=(0,q.useState)(()=>Date.now()),[R,fe]=(0,q.useState)(!0);(0,q.useEffect)(()=>{e||(d(!1),p(0),h(null),_(null),y(null),re(!1),P(null),oe(null),se(null),fe(!0),x(null),C(null),T(null),ee(Jt),O(null),j(!1),te.current=!1,M.current=!1,N.current+=1)},[e]),(0,q.useEffect)(()=>{e&&(h(Date.now()),r.invalidateQueries({queryKey:B()}),r.invalidateQueries({queryKey:L()}))},[e,r]);let z=g!=null,pe=c({...me(),refetchInterval:e=>e.state.data?.plan_id===`pro`||u?!1:Je,refetchIntervalInBackground:!1,enabled:e&&i&&!z}),he=(m!=null&&pe.dataUpdatedAt>=m?pe.data?.plan_id:null)??null;(0,q.useEffect)(()=>{if(!e||z||he!==`pro`)return;let t=Date.now();_(t),de(t)},[e,z,he]),(0,q.useEffect)(()=>{if(!e||z)return;let t=setTimeout(()=>d(!0),Ye);return()=>clearTimeout(t)},[e,z,f]);let ve=(0,q.useCallback)(()=>{d(!1),p(e=>e+1),k.getState().fetchOrganizations(),r.invalidateQueries({queryKey:B()})},[r]),be=(0,q.useCallback)(()=>{let e=Date.now();y(e),de(e)},[]),{mutate:xe}=l(ge()),V=(0,q.useCallback)(e=>{let t=N.current;xe({},{onSuccess:n=>{t===N.current&&(O(null),Pe(n)?M.current?O({error:n.reason??`no_active_pro`}):(M.current=!0,j(!0),e===`escape`&&be()):(x(n.state),e===`escape`&&be()))},onError:e=>{t===N.current&&O(e)}})},[xe,be]);(0,q.useEffect)(()=>{!e||!i||!z||te.current||(te.current=!0,V(`auto`))},[e,i,z,V]),(0,q.useEffect)(()=>{if(!A)return;let e=N.current,t=setTimeout(()=>{j(!1),e===N.current&&V(`auto`)},Ze);return()=>clearTimeout(t)},[A,V]);let Se=(0,q.useCallback)(()=>V(`escape`),[V]),H=c({...ye(),enabled:e&&i&&z}),Ce=R?Gt:!1,we=c({..._e(),enabled:e&&i&&z,refetchInterval:e=>e.state.data?.id==null?Ce:!1,retry:!1}),Te=z&&m!=null&&H.dataUpdatedAt>=m,Ee=Te&&!H.isPending&&!H.isFetching,U=(Te?H.data?.primary_assistant_id:null)??(H.isPending?null:we.data?.id??null),De=c({...le({path:{id:U??`unresolved`}}),enabled:e&&i&&z&&U!=null,refetchInterval:Ce,retry:!1}),W=ce({path:{id:U??`unresolved`}}),G=c({...W,enabled:e&&i&&z&&U!=null,refetchInterval:Ce,retry:!1}),Ae=(0,q.useRef)(0),[Le,Re]=(0,q.useState)(0),K=o(W.queryKey);(0,q.useEffect)(()=>r.getQueryCache().subscribe(t=>{if(!(t.type!==`updated`||t.query.queryHash!==K)){if(t.action.type===`fetch`)Ae.current+=1;else if(t.action.type===`success`&&!t.action.manual){let n=Ae.current,r=e&&Fe(t.action.data);a.schedule(()=>{Re(n),r&&(re(!0),P(U))})}}}),[r,K,e,U]);let ze=Fe(G.data),Be=ie===U,J=H.data,Y=(0,q.useMemo)(()=>J?{machineSize:Oe(J.max_machine_tier),storageGib:J.selected_storage_gib??null}:null,[J]),Ve=J!=null&&J.max_machine_tier==null?je:null,He=J?J.domain_setup_available&&J.primary_assistant_id!=null:void 0,Ue=De.data,X=(0,q.useMemo)(()=>Ue?{machineSize:Ue.machine_size??null,storageGib:Ue.provisioned_storage_gib??null}:null,[Ue]),Z=I===U,Q=(0,q.useMemo)(()=>{let e=Ie(Y,X),t=Y?.machineSize??Ve;if(t==null)return e;let n=X?.machineSize??null;if(n==null)return{...e,machine:!1};let r=(Z?F?.machineSize:null)??n,i=ke(t)<ke(r);return{...e,machine:i?ke(n)<=ke(t):ke(n)>=ke(t)}},[Y,X,F,Z,Ve]),We=Me(Y,X),Ge=w===U;(0,q.useEffect)(()=>{e&&(We?(C(e=>e!=null&&Ge?e:Date.now()),T(U)):(C(null),T(null)))},[e,We,U,Ge]);let Ke=E.assistantId===U;(0,q.useEffect)(()=>{if(!e)return;let t=Ae.current;ee(e=>{let n=e.assistantId===U?e:Jt,r=Q.machine?n.machine??t:null,i=Q.storage?n.storage??t:null;return e.assistantId===U&&e.machine===r&&e.storage===i?e:{assistantId:U,machine:r,storage:i}})},[e,Q,U]);let qe=(0,q.useMemo)(()=>{let e=Ne(G.data),t=e=>e!=null&&Ke&&Le>e;return{machine:Q.machine&&!e.machine&&t(E.machine),storage:Q.storage&&!e.storage&&t(E.storage)}},[Q,E,Ke,Le,G.data]);(0,q.useEffect)(()=>{!e||!X||F!=null&&Z||(oe(X),se(U))},[e,X,U,F,Z]);let Xe=v??g,$e=Xe==null?null:Math.max(0,ue-Xe),et=!t,{state:tt,softWaiting:nt}=Wt({planId:z?`pro`:he,targets:Y,actuals:X,initialActuals:Z?F:null,resizeOperationInFlight:ze,sawOperation:ne&&Be,msSinceWatchStart:$e,confirmExpired:u,serverVerdict:b,statusObservedSinceTargetsMet:S!=null&&Ge&&G.dataUpdatedAt>S,targetsProveNoop:et}),rt=qt.includes(tt),it=e&&z&&!rt;(0,q.useEffect)(()=>{fe(it)},[it]),(0,q.useEffect)(()=>{if(!e||!z||rt)return;let t=setInterval(()=>de(Date.now()),Kt);return()=>clearInterval(t)},[e,z,rt]);let at=!et&&(b===`started`||b===`in_progress`)&&!(ne&&Be);return(0,q.useEffect)(()=>{if(!e||!z||rt||!at)return;let t=setInterval(()=>V(`auto`),n);return()=>clearInterval(t)},[e,z,rt,at,n,V]),{state:tt,softWaiting:nt,targets:Y,actualsSnapshot:F,machineFloor:Ve,landed:qe,assistantId:U,domainStepAvailable:He,onboardingSettled:Ee,confirmError:!z&&pe.isError,targetsError:z&&H.isError&&(!J||!Te),escapeEligible:$e!=null&&$e>=6e4,retryConfirm:ve,kickProvisioning:Se,kickError:D}}var Xt=200,Zt=380;function Qt(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}var $t=e=>e===`WAITING`||e===`RESIZING`||e===`STALLED`,en=e=>e===`DONE`||e===`NOT_APPLICABLE`,tn={machineSize:null,storageGib:null};function nn({open:e,onClose:t,dwellMs:n,phaseMinMs:r,mode:i=`checkout`,resizeContext:a}){let o=i===`resize`,c=s(),[l,u]=(0,q.useState)(`provisioning`),[d,f]=(0,q.useState)(`idle`),p=(0,q.useRef)([]),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(null),[v,y]=(0,q.useState)(null),[b,x]=(0,q.useState)(!1),S=o?a?.direction:void 0,C=We(S),w=Yt({open:e,canLowerResources:o?a?.canLowerResources===!0:!1}),D=(0,q.useRef)(!1);(0,q.useEffect)(()=>{if(e){D.current=!0,h(o?null:ne()),y(e=>e??Date.now());return}p.current.forEach(clearTimeout),p.current=[],u(`provisioning`),f(`idle`),_(null),y(null),x(!1),D.current&&(D.current=!1,te())},[e,o]),(0,q.useEffect)(()=>()=>{p.current.forEach(clearTimeout)},[]),(0,q.useEffect)(()=>{l===`complete`&&re()},[l]);let O=$t(w.state),k=en(g??w.state),{targets:A,assistantId:j,domainStepAvailable:M,onboardingSettled:N}=w,ie=o?a?.fromSnapshot:void 0,P=w.actualsSnapshot,F={machineSize:ie?.machineSize??P?.machineSize??null,storageGib:ie?.storageGib??P?.storageGib??null},{tintHex:ae,backdropImageUrl:oe}=xt(j),I=o&&M===!0,{domains:se,domainsError:ce,domainsFetching:le,domainsUpdatedAt:ue,domainsErrorUpdatedAt:de}=qe(e&&I,j),L=(se?.results.length??0)>0,R=(0,q.useRef)(null);(0,q.useEffect)(()=>{if(!e){R.current=null;return}!I||j==null||R.current!==j&&(R.current=j,c.invalidateQueries({queryKey:pe({path:{assistant_id:j}})}))},[e,I,j,c]);let fe=!le&&(v!=null&&ue>=v||v!=null&&!!ce&&de>=v),[z,me]=(0,q.useState)(!1),he=N&&(!I||fe);(0,q.useEffect)(()=>{if(!e){me(!1);return}he&&me(!0)},[e,he]);let ge=(0,q.useCallback)(()=>{let e=o?M===!0&&!L?`domain`:`complete`:M===!1?`complete`:`domain`;if(Qt()){u(e);return}f(`covering`),p.current.push(setTimeout(()=>{u(e),f(`revealing`),p.current.push(setTimeout(()=>f(`idle`),Zt))},Xt))},[M,o,L]),_e=(0,q.useCallback)(()=>{x(!0)},[]),ve=(0,q.useCallback)(()=>{w.kickProvisioning(),E.info(w.kickError==null?C.backgroundExitToast:C.backgroundRetryToast),x(!1),t()},[w,t,C]),ye=(0,q.useCallback)(()=>{x(!1)},[]),be=l===`provisioning`&&(w.confirmError||w.targetsError),B=l===`provisioning`&&!be,xe=B&&!k,V=`transition-[background-color] duration-300 ease-out${B?` bg-black p-0`:``}`,Se=B?`[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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(T.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,K.jsxs)(T.Content,{size:`md`,hideCloseButton:l!==`complete`,dismissOnOverlayClick:!xe,onEscapeKeyDown:xe?e=>e.preventDefault():void 0,onInteractOutside:xe?e=>e.preventDefault():void 0,"data-theme":B?`dark`:void 0,overlayClassName:V,className:B?`overflow-y-auto inset-0 max-w-none w-screen h-screen max-h-none rounded-none border-0`:`overflow-hidden`,style:{[Ct]:ae},children:[(0,K.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col motion-reduce:[animation:none] ${Se}`,children:H()},l),d!==`idle`&&(0,K.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:wt},children:oe&&(0,K.jsx)(mt,{imageUrl:oe,animateIn:!1})})]})}),(0,K.jsx)(ee,{open:b&&O,title:`Continue in the background?`,message:C.backgroundConfirmMessage,confirmLabel:`Continue`,cancelLabel:`Keep waiting`,onConfirm:ve,onCancel:ye})]});function H(){return l===`provisioning`?w.confirmError||w.targetsError?(0,K.jsx)(ot,{onGoToBilling:t,direction:S}):(0,K.jsx)(Ut,{state:w.state,direction:S,softWaiting:w.softWaiting,intent:m,creditsChange:o?a?.credits:void 0,targets:A??tn,fromSnapshot:F,machineFloor:w.machineFloor,landed:w.landed,celebrating:z,onCelebrationEnd:ge,assistantId:j,escapeAvailable:O&&w.escapeEligible,onEscape:_e,onPhaseChange:_,kickError:w.kickError,confirm:{onRetry:w.retryConfirm,onGoToBilling:t},dwellMs:n,phaseMinMs:r}):l===`domain`?(0,K.jsx)(at,{machineBusy:O,assistantId:j,onExit:()=>u(`complete`)}):(0,K.jsx)(Ke,{assistantId:j,direction:S})}}function rn(e){return e!=null&&!e.customized}function an(e){return rn(e)?e.name:`Custom`}var on=[`mighty`,`super`,`ultra`],sn=[`free`,...on];function cn(e){return sn.indexOf(e)}function ln(e,t){if(e===null)return`upgrade`;let n=cn(e),r=cn(t);return n===-1||r===-1?`upgrade`:r===n?`current`:r<n?`downgrade`:`upgrade`}function un(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>on.indexOf(e.key)-on.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 dn={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 fn({tier:e,size:t=40}){let n=dn[e]??dn.free,r=U();return(0,K.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,K.jsx)(Ee,{components:r,bodyShapeId:n.bodyShape,colorId:n.color,size:t}):(0,K.jsx)(`div`,{style:{width:t,height:t}})})}var pn=`Small`;function mn(e){return e?.machine_size?W[e.machine_size]??e.machine_size:pn}function hn(e){let t=e?.credits_usd??0,n=e?.storage_gib??4;return[{icon:Re,label:`${mn(e)} Machine`},{icon:_,label:`${st(t*100)} credits`},{icon:b,label:`${n} GB`}]}function gn(e,t=[]){let n=e?.credits_usd??0,r=e?.storage_gib??4,i=Ae[e?.machine_size??`small`];return[`${mn(e)} machine${i?` (${i})`:``}`,lt(r),ut(n),...t]}var _n={machine:`Configurable machine size`,storage:`Configurable storage`,credits:`Pay-as-you-go and bundled credits`};function vn(e,t){let n=[`${e.machineTier?G[e.machineTier]??t.machine_tiers.find(t=>t.tier===e.machineTier)?.label??e.machineTier:pn} Machine`];if(e.storageGib!=null&&n.push(`${e.storageGib} GB`),e.creditTier!=null){let r=gt(t,e.creditTier)?.credits_usd??ht(e.creditTier);n.push(r==null?`Credit bundle`:`${r} credits/mo`)}return n}function yn(e,t){let n=new Set([_n.machine]);return e.storageGib!=null&&n.add(_n.storage),e.creditTier!=null&&n.add(_n.credits),[...vn(e,t),...t.included_features.filter(e=>!n.has(e))]}var bn=`billing-portal-return-snapshot`;function xn(e){try{sessionStorage.removeItem(bn),sessionStorage.setItem(bn,JSON.stringify(e))}catch{}}function Sn(){if(typeof sessionStorage>`u`)return null;try{let e=sessionStorage.getItem(bn);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 Cn(){try{sessionStorage.removeItem(bn)}catch{}}function wn(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 Tn(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function En(e){return e?e.cancel_at??e.current_period_end??null:null}function Dn(e){let t=s();return(0,q.useEffect)(()=>I(()=>{t.invalidateQueries(me())}),[t]),z({onSuccess:t=>{e&&xn(e),oe(t.portal_url)},onError:()=>{E.error(`Couldn't open the billing portal. Please try again.`,{id:`billing-portal-session-error`})}})}function On(e){return e.disabled===!0}function kn({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:r,onMachineTierChange:i,onStorageTierChange:a,currentMachinePriceCents:o,currentStoragePriceCents:s}){let c=(0,q.useMemo)(()=>e.map(e=>{let t=G[e.tier]??e.label,n=o==null?`+${$(e.price_cents)}`:e.price_cents===o?`(${$(e.price_cents)}, current)`:ct(e.price_cents-o);return{value:e.tier,label:`${t} ${n}`,disabled:On(e)}}),[e,o]),l=(0,q.useMemo)(()=>t.map(e=>{let t=s==null?`+${$(e.price_cents)}`:e.price_cents===s?`(${$(e.price_cents)}, current)`:ct(e.price_cents-s);return{value:e.tier,label:`${e.storage_gib} GB ${t}`,disabled:On(e)}}),[t,s]);return(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(d,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Machine`}),(0,K.jsx)(`span`,{title:`Determines the CPU and memory allocated to your assistant`,children:(0,K.jsx)(x,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,K.jsx)(D,{"aria-label":`Machine tier`,placeholder:`Select a machine tier`,value:n??``,onChange:i,options:c})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(d,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Storage`}),(0,K.jsx)(`span`,{title:`Persistent disk space for your assistant's files and data`,children:(0,K.jsx)(x,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,K.jsx)(D,{"aria-label":`Storage tier`,placeholder:`Select a storage tier`,value:r??``,onChange:a,options:l})]})]})}var An=new Set([`active`,`trialing`,`past_due`]);function jn(e){return e.plan_id!==`base`&&e.cancel_at_period_end!==!0&&!e.cancel_at&&e.status!=null&&An.has(e.status)}var Mn=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`package`,`non_field_errors`];function Nn(e,t){if(e&&typeof e==`object`){for(let t of Mn)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 Pn(e,t){let n=e.filter(e=>!On(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function Fn(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function In(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}function Ln(){let e=s(),t=l(ve());return{changePackage:async n=>{try{let r=await t.mutateAsync({body:{package:n}});return await Promise.all([e.invalidateQueries({queryKey:B()}),e.invalidateQueries({queryKey:R()}),e.invalidateQueries({queryKey:L()})]),r}catch(e){return E.error(Nn(e,`Failed to change your plan. Please try again.`)),null}},isPending:t.isPending}}function Rn({enabled:e=!0}={}){let t=s(),n=ae(),r=e&&n,i=c({...me(),enabled:r}),a=i.data,o=a!=null&&a.plan_id!==`base`,u=c({...ye(),enabled:r&&o}),d=c({...se(),enabled:r&&o}).data?.plans.find(e=>e.id===`pro`)?.machine_tiers??[],f=e=>d.find(t=>t.tier===e)?.price_cents??null,p=l(he()),m=l(fe()),h=l(be()),g={machineTier:u.data?.max_machine_tier??null,storageTier:u.data?.selected_storage_tier??null,storageGib:u.data?.selected_storage_gib??null,creditTier:a?.selected_credit_tier??null},_=a!=null&&a.plan_id!==`base`&&a.status!=null&&An.has(a.status)&&a.cancel_at_period_end!==!0&&!a.cancel_at,v=!o||!u.isPending,y=!o||u.isSuccess&&u.data!=null&&!u.isFetching&&u.dataUpdatedAt>=i.dataUpdatedAt,b=p.isPending||m.isPending||h.isPending,x=()=>Promise.all([t.invalidateQueries({queryKey:B()}),t.invalidateQueries({queryKey:L()}),t.invalidateQueries({queryKey:R()})]);return{changeTiers:async e=>{let t=e.machineTier!==g.machineTier,n=e.storageTier!==g.storageTier,r=e.creditTier!==g.creditTier,i=f(e.machineTier),a=f(g.machineTier),o=t&&i!=null&&a!=null&&i<a,s=[];if(t&&s.push(new Promise(t=>{p.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=>{m.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=>{h.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 x();let l=c.some(e=>e.ok&&e.dimension===`machine`)&&!o,u=c.some(e=>e.ok&&e.dimension===`storage`),d=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=>Nn(e.error,`Failed to update ${e.dimension} tier.`)).join(` `);return E.error(e),d||_?{needsResize:d,creditChanged:_}:null}return{needsResize:d,creditChanged:_}},isPending:b,current:g,eligible:_,currentReady:v,currentKnown:y,primaryAssistantId:y?u.data?.primary_assistant_id??null:null}}var zn=`__none__`,Bn=`No extra credits`;function Vn(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:`Platform fee: ${$(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:lt(u.storage_gib),previousLabel:e&&p!=null?lt(p.storage_gib):void 0,changed:e})}let v=a===`__none__`?Bn:d==null?null:ut(d.credits_usd);if(v!=null){let e=n!=null&&(n.creditTier??`__none__`)!==a,t=n?.creditTier==null?Bn:m==null?void 0:ut(m.credits_usd);_.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 Hn(e){return(0,K.jsxs)(`span`,{className:`text-[12px] font-medium text-[var(--content-disabled)]`,children:[`+`,$(e)]})}function Un({open:e,proPlan:t,pending:r,currentStorageGib:i,initialSelection:a,onClose:o,onContinue:s}){let c=e?a??null:null,[l,u]=(0,q.useState)(()=>c?.machineTier??``),[d,f]=(0,q.useState)(()=>c?.storageTier??``),[p,m]=(0,q.useState)(()=>c?c.creditTier??`__none__`:``),[h,v]=(0,q.useState)({open:e,initialSelection:a});(h.open!==e||h.initialSelection!==a)&&(v({open:e,initialSelection:a}),u(c?.machineTier??``),f(c?.storageTier??``),m(c?c.creditTier??`__none__`:``));let x=t.machine_tiers,S=(0,q.useMemo)(()=>t.storage_tiers.filter(e=>!e.legacy||e.tier===a?.storageTier),[t.storage_tiers,a?.storageTier]),C=t.credit_tiers??[],w=(0,q.useMemo)(()=>(t.credit_tiers??[]).filter(e=>!e.legacy),[t.credit_tiers]),E=e=>On(e)||e.legacy&&e.tier!==a?.storageTier||i!=null&&e.storage_gib<i,ee=x.map(e=>({value:e.tier,label:e.description,icon:(0,K.jsx)(Re,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:Hn(e.price_cents),disabled:On(e)})),O=S.map(e=>({value:e.tier,label:e.label,icon:(0,K.jsx)(b,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:Hn(e.price_cents),disabled:E(e)})),k=p&&p!==`__none__`?C.find(e=>e.tier===p)??null:null,A=k?.legacy?k:null,j=[{value:zn,label:Bn,icon:(0,K.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0})},...w.map(e=>({value:e.tier,label:e.label,icon:(0,K.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:Hn(e.price_cents)})),...A?[{value:A.tier,label:A.label,icon:(0,K.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:Hn(A.price_cents),disabled:!0}]:[]],te=x.find(e=>e.tier===l)??null,M=d!==``&&d===a?.storageTier,N=S.find(e=>e.tier===d&&(M||!E(e)))??null,ne=p===`__none__`||p===a?.creditTier||w.some(e=>e.tier===p),re=p!==``&&ne?p:null,ie=te!=null&&N!=null&&re!=null,P=a!=null&&l===(a.machineTier??``)&&d===a.storageTier&&p===(a.creditTier??`__none__`),F=(0,q.useMemo)(()=>Vn({proPlan:t,seed:a??null,machineTier:l,storageTier:d,creditChoice:p}),[t,a,l,d,p]);return(0,K.jsx)(T.Root,{open:e,onOpenChange:e=>{e||o()},children:(0,K.jsx)(T.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,K.jsx)(T.Body,{className:`p-4`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-8 md:flex-row md:gap-12`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6 md:flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--surface-active)] p-[14px]`,children:(0,K.jsx)(y,{className:`h-6 w-6 text-[var(--content-emphasised)]`,"aria-hidden":!0})}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,K.jsx)(T.Title,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Create a custom plan`}),(0,K.jsx)(T.Description,{className:`mt-0 text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:`Just better.`})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Select a machine size:`}),(0,K.jsx)(D,{"aria-label":`Machine size`,placeholder:`Select a machine size`,value:l,onChange:u,options:ee})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Select storage:`}),(0,K.jsx)(D,{"aria-label":`Storage`,placeholder:`Select storage`,value:d,onChange:f,options:O})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Bundle some credits:`}),(0,K.jsx)(D,{"aria-label":`Credit bundle`,placeholder:`Select a credit bundle`,value:p,onChange:m,options:j})]})]}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-16 md:pt-[5px]`,children:[(0,K.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Recap`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:$(F.totalCents)}),F.deltaCents!=null&&F.deltaCents!==0&&F.previousTotalCents!=null&&(0,K.jsxs)(`span`,{className:`text-[12px] font-medium ${F.deltaCents>0?`text-[var(--system-positive-strong)]`:`text-[var(--system-negative-strong)]`}`,children:[ct(F.deltaCents),` compared to previous (`,st(F.previousTotalCents),`)`]}),(0,K.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Total`})]}),(0,K.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,K.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Your selection:`}),(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:F.rows.map(e=>(0,K.jsxs)(`li`,{className:`flex flex-col gap-2`,children:[e.previousLabel!=null&&(0,K.jsxs)(`div`,{className:`relative flex w-fit items-start gap-2`,children:[(0,K.jsx)(g,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-disabled)]`,"aria-hidden":!0}),(0,K.jsx)(`s`,{className:`text-[14px] font-medium leading-[18px] text-[var(--content-disabled)] no-underline`,children:e.previousLabel}),(0,K.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute -left-1 right-0 top-[9px] h-px bg-[var(--content-disabled)]`})]}),(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(g,{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,K.jsx)(`span`,{className:`text-[14px] font-medium leading-[18px] text-[var(--content-secondary)]`,children:e.label})]})]},e.key))}),(0,K.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:!ie||P||r,onClick:()=>{!ie||P||r||s({machineTier:te.tier,storageTier:N.tier,creditTier:re===`__none__`?null:re})},children:`Continue`}),(0,K.jsx)(n,{variant:`ghost`,fullWidth:!0,disabled:r,onClick:o,children:`Cancel`})]})]})]})})})})}function Wn({className:e,"data-testid":t,children:n}){return(0,K.jsx)(`div`,{"aria-hidden":!0,"data-testid":t,className:H(`flex size-[52px] shrink-0 items-center justify-center rounded-xl`,e),children:n})}var Gn=32;function Kn(){let{ready:e,avatar:t}=xt();return(0,K.jsx)(Wn,{"data-testid":`assistant-avatar-tile`,className:`bg-[var(--surface-active)]`,children:e?(0,K.jsx)(Te,{components:t.components,traits:t.traits,customImageUrl:t.customImageUrl,size:Gn}):null})}var qn={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},super:{tagline:`Do more, think less about the how.`,cta:`Go Super`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Your second brain, running full speed.`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function Jn(e){return qn[e]}function Yn(e){return`Downgrade to ${e}`}var Xn=`Billed monthly · prorated difference charged today`,Zn=`Billed monthly · prorated difference charged today or credited next invoice`,Qn=`Billed monthly · prorated credit on your next invoice`,$n=`Your machine downsizes now and your storage stays. No refund.`,er=`Continue`,tr=`The plan includes`,nr=`Your plan will include`;function rr(e,t,n){let r=n?Jn(n)?.tagline??``:``;switch(e){case`downgrade`:return{title:Yn(t),subtitle:``,priceCaption:Qn,checklistHeading:nr,note:$n,confirmLabel:Yn(t),destructive:!0};case`switch`:return{title:`Switch to ${t}`,subtitle:r,priceCaption:Zn,checklistHeading:tr,note:``,confirmLabel:er,destructive:!1};default:return{title:`Upgrade to ${t}`,subtitle:r,priceCaption:Xn,checklistHeading:tr,note:``,confirmLabel:er,destructive:!1}}}function ir({open:e,relation:t,packageName:r,targetPackage:i,pending:a,onCancel:o,onConfirm:s}){let c=(0,q.useRef)(null),l=(0,q.useId)(),u=rr(t,r,i?.key??null),f=i?{price:$(i.total_price_cents),highlights:gn(i,Jn(i.key)?.extraFeatures??[])}:null,p=u.subtitle,m=u.note?{"aria-describedby":l}:p?{}:{"aria-describedby":void 0};return(0,K.jsx)(T.Root,{open:e,onOpenChange:e=>{!e&&!a&&o()},children:(0,K.jsxs)(T.Content,{size:`sm`,hideCloseButton:!0,className:`gap-4 p-4 max-w-[421px]`,onOpenAutoFocus:e=>{e.preventDefault(),c.current?.focus()},...m,children:[(0,K.jsxs)(T.Header,{className:`flex-row items-center gap-3 p-0 pb-2`,children:[u.destructive?(0,K.jsx)(Wn,{"data-testid":`package-switch-warning-tile`,className:`bg-[var(--system-negative-weak)]`,children:(0,K.jsx)(C,{className:`size-6 text-[var(--system-negative-strong)]`})}):(0,K.jsx)(Kn,{}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,K.jsx)(T.Title,{className:`text-title-small text-[var(--content-emphasised)] [&>span]:whitespace-normal`,children:u.title}),p?(0,K.jsx)(T.Description,{className:`mt-0 text-body-medium-default text-[var(--content-tertiary)]`,children:p}):null]})]}),f?(0,K.jsxs)(T.Body,{className:`flex flex-col gap-4 p-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsx)(d,{as:`p`,variant:`title-large`,className:`text-[var(--content-default)]`,children:f.price}),(0,K.jsx)(d,{as:`p`,variant:`label-medium-default`,className:`leading-[15px] text-[var(--content-tertiary)]`,children:u.priceCaption})]}),(0,K.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,K.jsx)(d,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:u.checklistHeading}),(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:f.highlights.map(e=>(0,K.jsxs)(`li`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(g,{className:`size-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,K.jsx)(d,{as:`span`,variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e})]},e))})]}):null,u.note?(0,K.jsx)(d,{id:l,as:`p`,variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:u.note}):null,(0,K.jsxs)(T.Footer,{className:`flex-col gap-4 p-0`,children:[(0,K.jsx)(n,{fullWidth:!0,variant:u.destructive?`danger`:`primary`,onClick:s,disabled:a,"data-testid":`confirm-package-switch-button`,children:u.confirmLabel}),(0,K.jsx)(n,{ref:c,fullWidth:!0,variant:`ghost`,onClick:o,disabled:a,children:`Cancel`})]})]})})}function ar(){let e=s();(0,q.useEffect)(()=>I(()=>{e.invalidateQueries({queryKey:B()}),e.invalidateQueries({queryKey:R()}),e.invalidateQueries({queryKey:L()})}),[e])}export{ln as A,mn as C,rn as D,on as E,qe as F,Ge as I,ze as L,ct as M,st as N,un as O,$ as P,vn as S,fn as T,Tn as _,Un as a,Dn as b,An as c,In as d,Fn as f,Cn as g,wn as h,Jn as i,nn as j,an as k,Nn as l,kn as m,ir as n,Rn as o,Pn as p,Yn as r,Ln as s,ar as t,jn as u,En as v,hn as w,yn as x,Sn as y};
@@ -0,0 +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{t as a}from"./calendar-qrPKlf1H.js";import{t as o}from"./globe-CdLn4IX7.js";import{t as s}from"./layout-grid-Ct4RT2Ea.js";import{t as c}from"./message-square-CHUvAEY9.js";import{t as l}from"./monitor-RX4oi4Nj.js";import{t as u}from"./settings-6_RIT4kT.js";import{n as d,t as f}from"./create-selectors-BfxF8Sx_.js";import{dt as p,f as m,h,r as g}from"./local-mode-DHueA-BJ.js";import{t as _}from"./is-electron-DIlIrdJX.js";import{n as v}from"./resolved-assistants-store-C6oDdTxB.js";import{i as y}from"./utils-DtVy-_pB.js";import{i as b,n as x}from"./api-errors-BRGPPSWw.js";import{lt as S,mt as C,nt as w,st as T}from"./auth-store-C9aYqB9U.js";import{nt as E}from"./sdk.gen-ies09CqM.js";import{ir as D}from"./sdk.gen-CjtCuSlS.js";import{a as O,i as k,r as A}from"./feature-flag-catalog-CpyCubJW.js";import{t as j}from"./client-feature-flag-store-Cw39NfCq.js";import{d as M}from"./routes-DrfnNoYS.js";import{i as ee,r as N}from"./use-is-org-ready-3vHDbj4G.js";import{t as P}from"./haptics-C4p_Rjba.js";import{F}from"./react-query.gen-BtYBixpk.js";import{s as te}from"./chat-Dy2BC2i1.js";var I=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`}]]),L=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`}]]),R=e(t(),1);function z({sessionStatus:e,hasPlatformSession:t}){let r=n(),i=N(),a=S(e)&&!p()&&(t||!m())&&i;v.use.assistants();let o=w(),s=o&&!g().some(e=>e.assistantId===o)?o:null,{data:c}=C({enabled:a,selectedPlatformAssistantId:s});(0,R.useEffect)(()=>{T.setInputs({sessionStatus:e,hasPlatformSession:t,queryClient:r,selectedPlatformAssistantId:s,isOrgReady:i}),T.respondToInputs()},[e,t,r,s,i]),(0,R.useEffect)(()=>{c&&T.applyServerResult(c)},[c])}var B=`0.8.5`,V=5e3,H=6e4;function U(e,t=!0){return y(B)&&t?{staleTime:e,refetchInterval:!1}:{staleTime:V,refetchInterval:V}}function W(){return U(H)}function G(e){return U(1/0,e)}var K=new Set(Object.keys(A)),q=new Set(Object.keys(k));async function J(e){let t=j.getState().scopeKey,{data:n,error:r,response:i}=await E({throwOnError:!1,signal:e});if(x(i,r,`Failed to fetch client feature flags`),!i.ok||!n)throw b(r,i);return{scopeKey:t,flags:n.flags}}function Y(e){let t={},n={};for(let[r,i]of Object.entries(e)){let e=O(r);typeof i==`boolean`&&K.has(e)?t[e]=i:typeof i==`string`&&q.has(e)&&(n[e]=i)}return{boolFlags:t,stringFlags:n}}function X(e,t=!1){let n=G(t),i=ee(),a=j.use.scopeKey(),o=e&&!h(),s=o&&i===`ready`,{data:c,isError:l}=r({queryKey:F(),queryFn:({signal:e})=>J(e),enabled:s,...n,refetchOnWindowFocus:!1,refetchOnReconnect:!1});(0,R.useEffect)(()=>{if(c?.flags){let{boolFlags:e,stringFlags:t}=Y(c.flags),n=j.getState();n.setFlags(e,c.scopeKey),Object.keys(t).length>0&&n.setStringFlags(t,c.scopeKey);return}e&&(!o||i===`unavailable`||l)&&j.getState().settleWithoutServerValues(a)},[a,c,e,l,o,i])}var Z=f(d((e,t)=>({isOpen:!1,open:()=>e({isOpen:!0}),close:()=>e({isOpen:!1}),toggle:()=>e({isOpen:!t().isOpen})})));async function ne(){if(!_())return!1;let e=window.vellum?.commandPalette?.open;return e?(await e(),!0):!1}async function re(){_()&&await window.vellum?.commandPalette?.dismiss()}async function ie(e){_()&&await window.vellum?.commandPalette?.select(e)}var Q={query:``,queryTokens:[],results:{conversations:[],memories:[],schedules:[],contacts:[]}};function ae(e,t){return e||t.split(/\s+/).filter(e=>e.length>0)}async function oe(e,t,n){let r=n?.limit??10;try{let{data:i,response:a}=await D({path:{assistant_id:e},query:{q:t,limit:r,categories:`conversations,schedules,contacts`},throwOnError:!1,signal:n?.signal});return!a?.ok||!i?Q:{query:i.query,queryTokens:ae(i.queryTokens,i.query),results:i.results}}catch(n){return n instanceof DOMException&&n.name===`AbortError`||console.error(`[global-search] search failed`,{assistantId:e,query:t,err:n}),Q}}var se=150,ce=2,$=[];function le({itemCount:e,onSelect:t,assistantId:n,isOpen:r,onClose:i}){let a=Z.use.isOpen(),o=r??a,s=Z.use.open(),c=Z.use.close(),[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(0),[p,m]=(0,R.useState)(!1),[h,g]=(0,R.useState)(null),[_,v]=(0,R.useState)($),y=(0,R.useRef)(()=>0);(0,R.useLayoutEffect)(()=>{y.current=typeof e==`function`?e:()=>e});let b=(0,R.useRef)(null),x=(0,R.useRef)(null),S=(0,R.useCallback)(()=>{b.current&&=(clearTimeout(b.current),null),x.current?.abort(),x.current=null},[]),C=(0,R.useCallback)(()=>{s(),f(0)},[s]),w=(0,R.useCallback)(()=>{c(),u(``),f(0),m(!1),g(null),v($),S(),i?.()},[c,S,i]),T=(0,R.useCallback)(()=>{o?w():C()},[o,w,C]);(0,R.useEffect)(()=>{o||(u(``),f(0),m(!1),g(null),v($),S())},[o,S]);let E=(0,R.useCallback)(e=>{S();let t=e.trim();if(t.length<ce||!n){m(!1),g(null),v($);return}m(!0),b.current=setTimeout(()=>{if(!n){m(!1);return}let e=new AbortController;x.current=e,oe(n,t,{signal:e.signal}).then(t=>{x.current===e&&(g(t.results),v(t.queryTokens),m(!1))}).catch(()=>{x.current===e&&m(!1)})},se)},[S,n]),D=(0,R.useCallback)(e=>{u(e),f(0),E(e)},[E]);return(0,R.useEffect)(()=>()=>{x.current?.abort(),b.current&&clearTimeout(b.current)},[]),{isOpen:o,query:l,selectedIndex:d,isSearching:p,searchResults:h,searchTokens:_,open:C,close:w,toggle:T,setQuery:D,handleKeyDown:(0,R.useCallback)(e=>{if(e.key===`k`&&(e.metaKey||e.ctrlKey)){e.preventDefault(),w();return}let n=y.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(),w();break}},[t,d,w])}}function ue(e){return{id:`actions`,label:`Actions`,items:[{id:`action-new-conversation`,icon:L,title:`New Conversation`,shortcutHint:_()?`⌘N`:`⌘⇧O`},{id:`action-current-conversation`,icon:l,title:`Current Conversation`,shortcutHint:`⌘⇧N`},{id:`action-settings`,icon:u,title:`Settings`,shortcutHint:`⌘,`},{id:`action-library`,icon:s,title:`Library`},{id:`action-intelligence`,icon:o,title:e}]}}function de(e,t){let n=[],r=e.conversations.filter(e=>!t.has(e.id)).map(e=>({id:`search-conv-${e.id}`,icon:c,title:e.title??`Untitled`,snippet:e.excerpt||void 0}));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:I,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:`conversations`,label:`Recent`,items:e.slice(0,5).map(e=>({id:`conv-${e.conversationId}`,icon:c,title:e.title??`Untitled`,subtitle:e.lastMessageAt?te(e.lastMessageAt):void 0}))}}function pe(e,t){switch(e.id){case`action-new-conversation`:t.startNewConversation();break;case`action-current-conversation`:P.light(),t.navigate(M.assistant);break;case`action-settings`:P.light(),t.navigateToSettings();break;case`action-intelligence`:P.light(),t.navigate(M.identity);break;case`action-library`:P.light(),t.navigate(M.library.root);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-`)?(P.light(),t.navigate(M.schedules.detail(e.id.slice(16)))):e.id.startsWith(`search-contact-`)&&(P.light(),t.navigate(M.identity));break}}function me({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,R.useMemo)(()=>{let e=ue(t??`Assistant`),r=fe(n);return[e,...r.items.length>0?[r]:[]]},[n,t]),f=(0,R.useMemo)(()=>new Set(n.slice(0,5).map(e=>e.conversationId)),[n]),p=(0,R.useCallback)(e=>{if(u){u(e);return}pe(e,{startNewConversation:i,switchConversation:a,navigate:o,activeConversationId:r,navigateToSettings:s})},[i,a,o,r,s,u]),m=(0,R.useRef)([]),h=(0,R.useRef)(()=>{}),g=le({itemCount:()=>m.current.reduce((e,t)=>e+t.items.length,0),onSelect:(0,R.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,R.useLayoutEffect)(()=>{h.current=g.close});let _=(0,R.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,R.useMemo)(()=>{let e=g.searchResults?de(g.searchResults,f):[];return[..._,...e]},[_,g.searchResults,f]);return(0,R.useLayoutEffect)(()=>{m.current=v}),{commandPalette:g,mergedSections:v,handleItemSelect:(0,R.useCallback)(e=>{p(e),h.current()},[p])}}export{Z as a,z as c,ie as i,L as l,re as n,X as o,ne as r,W as s,me as t,I 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-Bxr-mmHu.js";import{n as o,t as s}from"./create-selectors-BfxF8Sx_.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-rJpeBta-.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-C4p_Rjba.js";import{t as r}from"./pointer-CQ4DXHXb.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-Gst62FjL.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-CRkrRNLg.js";import{t as i}from"./edge-swipe-arbiter-store-BwC23ScO.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};
@@ -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{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-DofScvyy.js";import{t as l}from"./menu-wESJw6y3.js";import"./src-Da9g8qsW.js";import{t as u}from"./globe-CdLn4IX7.js";import{t as d}from"./loader-circle-DWWXcfTQ.js";import{n as f,t as p}from"./minimize-2-Dj9FY4aF.js";import{t as m}from"./pencil-Cm5DdeRM.js";import{t as h}from"./x-D4O9yIS7.js";import{n as g,t as _}from"./panel-item-CJh95P_q.js";import{n as v}from"./resolved-assistants-store-C6oDdTxB.js";import{t as y}from"./client.gen-Dq2brHDV.js";import{n as b}from"./event-bus-CbDg1VDt.js";import{d as x}from"./routes-DrfnNoYS.js";import{t as S}from"./conversation-store-CTMy9QPV.js";import{i as C}from"./viewer-store-DbIS4l8d.js";import{n as w}from"./use-is-mobile-MmHo-OM6.js";import{t as T}from"./misc-BBsGq1IU.js";import{r as E,t as D}from"./edit-chat-session-DVzLQLWl.js";import{n as O,t as k}from"./sandbox-bridge-B5H4c27m.js";var A=s(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),j=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`}]]),M=a(),N=e(t(),1),P=`_vellumDebug`,F=`apps`,I=`disableIframeSandbox`,L=!1,R=new Set;function z(){return L}function B(e){let t=e===!0;if(t!==L){L=t,t?console.warn(`[vellumDebug] ${F}.${I} = true: app iframes render without the sandbox attribute. App HTML runs same-origin with the host and can reach its DOM, storage, and cookies. Open apps reload to pick this up. Set it back to false, or reload the page, to restore the sandbox.`):console.info(`[vellumDebug] ${F}.${I} = false: app iframes are sandboxed again.`);for(let e of R)e()}}function V(e){return R.add(e),()=>{R.delete(e)}}function H(){return(0,N.useSyncExternalStore)(V,z,()=>!1)}function U(){if(typeof window>`u`)return;let e=window,t=e[P]??{},n=t[F]??{};Object.defineProperty(n,I,{configurable:!0,enumerable:!0,get:z,set:B}),t[F]=n,e[P]=t}function W({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&&(r?(0,M.jsx)(n,{variant:`outlined`,iconOnly:(0,M.jsx)(A,{}),onClick:t,tooltip:`Expand app`,"aria-label":`Expand app`}):(0,M.jsx)(n,{onClick:t,children:`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)(G,{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`,"aria-label":l?`Deploying…`:`Deploy`}),i!=null&&(0,M.jsx)(n,{variant:`outlined`,iconOnly:a?(0,M.jsx)(d,{className:`animate-spin`}):(0,M.jsx)(j,{}),onClick:i,disabled:a,tooltip:a?`Sharing…`:`Share`,"aria-label":a?`Sharing…`:`Share`})]}),p!=null&&(0,M.jsx)(n,{variant:`outlined`,iconOnly:(0,M.jsx)(f,{}),onClick:p,tooltip:`Fullscreen`,"aria-label":`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`,"aria-label":r?`Open app`:`Edit`,active:r,className:`md:hidden`}),(0,M.jsx)(n,{variant:`outlined`,iconOnly:(0,M.jsx)(h,{}),onClick:g,tooltip:`Close`,"aria-label":`Close`})]})]})}function G({onShare:e,isSharing:t,onDeploy:r,isDeploying:i,isMobile:a}){let[o,s]=(0,N.useState)(!1),c=t||i,f=c?(0,M.jsx)(d,{className:`animate-spin`}):(0,M.jsx)(j,{}),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,"aria-label":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:j,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,"aria-label":p})}),(0,M.jsxs)(l.Content,{align:`end`,sideOffset:4,children:[(0,M.jsx)(l.Item,{leftIcon:(0,M.jsx)(j,{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 K=[`assistant:`,`conversation:`,`conversations:`,`apps:`,`plugins:`,`feature-flags:`];function q(e){return K.some(t=>e.startsWith(t))}function J(e,t){if(e.length===0)return[];let n=new Set(e);return t.filter(e=>n.has(e)&&!q(e))}function Y(e,t){let{frameId:n,assistantId:r,appId:i,enabled:a=!0,onAction:o,onOpenVellumLink:s}=t,c=(0,N.useRef)(new Map);(0,N.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=J([...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])}var X=`allow-scripts allow-popups allow-popups-to-escape-sandbox`;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,N.useRef)(null),[_,v]=(0,N.useState)(!1),y=(0,N.useCallback)(()=>v(e=>!e),[]);(0,N.useEffect)(()=>{v(!1)},[e]),(0,N.useEffect)(()=>{if(!_)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),v(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let b=(0,N.useMemo)(()=>O(r,e,{fetch:!0,route:f}),[r,e,f]),x=H(),S=(0,N.useMemo)(()=>{let t=0;for(let e=0;e<r.length;e++)t=(t<<5)-t+r.charCodeAt(e)|0;return`app-${e}-${t}${x?`-nosandbox`:``}`},[r,e,x]);return Y(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)(W,{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:x?void 0:X,referrerPolicy:`no-referrer`,title:t,className:`h-full w-full border-none`},S)]})]})}function Q(){let e=v.use.activeAssistantId(),t=w(),n=i(),{pathname:a}=r();return(0,N.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{j as a,U as i,Z as n,Y as r,Q 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-CyRPH_gr.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-CUIsZfaf.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./use-bus-subscription-DiCq1_ki.js";import{t as i}from"./effective-timezone-BX46fWmk.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};
@@ -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{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,h as l,i as u,m as d,n as f,r as p,s as m,t as h}from"./use-save-twilio-credentials-yqA7lnzq.js";import{t as g}from"./check-Dt2rQhdg.js";import{B as _}from"./src-Da9g8qsW.js";import{t as v}from"./link-2-DhyrrFaE.js";import{t as y}from"./loader-circle-DWWXcfTQ.js";import{t as b}from"./input-tXUFa7Eo.js";import{t as x}from"./modal-xr_vw1ZO.js";import{i as S}from"./utils-DtVy-_pB.js";import{n as C,r as w,t as T}from"./api-errors-BRGPPSWw.js";import{Xt as E,en as D,nn as O}from"./sdk.gen-CjtCuSlS.js";import{G as k,J as A,K as j,o as M,q as ee,s as N,x as P}from"./react-query.gen-C7om930f.js";import{n as F}from"./sdk.gen-BpJ1vF7l.js";import{t as I}from"./copy-to-clipboard-DgY-nZpm.js";import{t as L}from"./mutation-error-YLfUU5XL.js";import{t as R}from"./a2a-invite-Bld7VHkJ.js";var z=e(t(),1),B=o(),V=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],H=`trusted_contacts`,U=new Set([`platform`,`a2a`]),W=new Set([`vellum`,`whatsapp`,`discord`]);function G(e){return W.has(e)}var K={no_one:`No one`,guardian_only:`Only you`,trusted_contacts:`Verified contacts`,any_contact:`Any contact`,strangers:`Strangers`};function q(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 J(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 Y({open:e,assistantId:t,onClose:r}){let[i,o]=(0,z.useState)(!1),c=(0,z.useRef)(null),l=(0,z.useRef)(!1),u=a({...k({path:{assistant_id:t}})}),d=(0,z.useRef)(u.mutate);(0,z.useLayoutEffect)(()=>{d.current=u.mutate});let f=(0,z.useRef)(u.reset);(0,z.useLayoutEffect)(()=>{f.current=u.reset}),(0,z.useEffect)(()=>{e&&!l.current&&d.current({path:{assistant_id:t}}),l.current=e},[e,t]),(0,z.useEffect)(()=>()=>{c.current&&clearTimeout(c.current)},[]);let p=(0,z.useCallback)(()=>{f.current(),o(!1),c.current&&=(clearTimeout(c.current),null),r()},[r]),m=(0,z.useCallback)(e=>{I(e,{errorMessage:`Couldn't copy the invite link.`,onCopied:()=>{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,B.jsx)(x.Root,{open:e,onOpenChange:e=>{e||p()},children:(0,B.jsxs)(x.Content,{size:`sm`,children:[(0,B.jsx)(x.Header,{children:(0,B.jsx)(x.Title,{children:`Share Connection Link`})}),(0,B.jsx)(x.Body,{children:u.isPending?(0,B.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,B.jsx)(y,{className:`h-4 w-4 animate-spin`}),`Creating invite link…`]}):u.isError?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.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,B.jsx)(n,{variant:`outlined`,onClick:()=>u.mutate({path:{assistant_id:t}}),children:`Try Again`})]}):u.isSuccess?(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsx)(s,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Share this link with another assistant owner to establish a connection.`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(b,{type:`text`,readOnly:!0,value:h,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,B.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,B.jsx)(g,{className:`h-4 w-4`}):(0,B.jsx)(_,{className:`h-4 w-4`})})]}),u.data.expiresAt!=null&&(0,B.jsx)(s,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:J(u.data.expiresAt)})]}):null}),(0,B.jsx)(x.Footer,{children:(0,B.jsx)(n,{variant:`outlined`,onClick:p,children:`Done`})})]})})}function X({onClick:e}){return(0,B.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:(0,B.jsx)(v,{className:`h-3.5 w-3.5`}),onClick:e,children:`Share Connection Link`})}function Z(e){return typeof e==`string`&&V.includes(e)}function Q(e){return U.has(e)}function te(e){return(e?.policies??[]).filter(e=>!Q(e.channelType)&&!G(e.channelType)).map(e=>({...e,policy:Z(e.policy)?e.policy:`trusted_contacts`}))}async function ne(e,t,n,r){if(Q(t))throw new T(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await F({path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},throwOnError:!1});if(C(o,a,`Failed to save channel policy.`),!o.ok)throw new T(o.status,w(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new T(500,`Gateway returned no policy in response.`);return i.policy}var re=`0.10.0`;function $(){return S(re)}function ie(e){let t=r(),n=$(),o=(0,z.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,z.useMemo)(()=>l(o),[o]),u=i({...d(o),enabled:n,select:te}),f=(0,z.useMemo)(()=>{let e={};for(let t of u.data??[])c(t.channelType)&&(e[t.channelType]=t.policy);return e},[u.data]),p=a({mutationFn:({channelKey:t,policy:n})=>ne(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:s}),onError:L(`Failed to save channel policy`)}),m=(0,z.useCallback)((e,t)=>{p.mutate({channelKey:e,policy:t})},[p]);return n?{policies:f,savingKey:p.isPending?p.variables?.channelKey??null:null,isLoading:u.isPending,isError:u.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,z.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,z.useMemo)(()=>N(o),[o]),c=i({...M(o),enabled:!!e,refetchInterval:oe,select:e=>e.snapshots}),l=(0,z.useMemo)(()=>ce(c.data??[]),[c.data]),d=l.some(e=>e.key===`slack`&&e.status===`ready`),m=i({...j(o),enabled:d,select:e=>e.threadMode}),g=ie(e),_=(0,z.useCallback)(()=>n.invalidateQueries({queryKey:s}),[n,s]),v=a({mutationFn:async t=>{let n={path:{assistant_id:e},throwOnError:!0};t===`slack`?await E(n):t===`telegram`?await D(n):t===`phone`&&await O(n)},onSettled:(t,r,i)=>{_(),i===`slack`&&u(n,e)}}),y=f({assistantId:e}),b=p({assistantId:e}),x=h({assistantId:e}),S=a({...A(),onSuccess:()=>{n.invalidateQueries({queryKey:ee(o)})}}),C=y.mutateAsync,w=(0,z.useCallback)(async e=>{await C(e)},[C]),T=b.mutate,k=(0,z.useCallback)((e,t)=>{T({botToken:e,appToken:t})},[T]),P=S.mutate,F=(0,z.useCallback)(t=>{P({path:{assistant_id:e},body:{threadMode:t}})},[P,e]),I=x.mutateAsync,L=(0,z.useCallback)(async(e,t)=>{await I({accountSid:e,authToken:t})},[I]),R=(0,z.useCallback)(e=>{t&&t(ae[e])},[t]),B=v.mutate,V=(0,z.useCallback)(e=>{B(e)},[B]);return{channels:l,pendingChannelKey:v.isPending?v.variables??null:null,slackThreadMode:m.data,slackThreadModePending:S.isPending,channelPolicies:g.policies,policySavingKey:g.savingKey,policiesLoading:g.isLoading,policiesError:g.isError,onChannelPolicyChange:g.onChange,onSetup:t?R:void 0,onDisconnect:V,onSaveTelegramToken:w,onSaveSlackConfig:k,slackSaveStatus:b.status,slackSaveError:b.error?.message??null,onSlackThreadModeChange:F,onSaveTwilioCredentials:L}}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,z.useState)(!1);return{isOpen:n,open:(0,z.useCallback)(()=>{i(!0)},[]),close:(0,z.useCallback)(()=>{i(!1),t.invalidateQueries({queryKey:P({path:{assistant_id:e}})})},[t,e])}}export{H as a,q as c,Y as i,se as n,V as o,X as r,K as s,ue as t};
@@ -1 +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-BZTUJtxM.js";import{t as d}from"./triangle-alert--e3n47gm.js";import{t as f}from"./notice-DCp7WO3L.js";import"./src-BAS7a2RG.js";import{t as p}from"./modal-DwsThLGg.js";import{i as m,t as h}from"./api-C8TlQNEU.js";import{i as g,r as _}from"./typed-storage-C-R1po3l.js";import{t as v}from"./client-feature-flag-store-Bg5XEI2b.js";import{n as y,r as b,t as x}from"./theme-preferences-LQuLaIA6.js";import{t as S}from"./use-bus-subscription-CyRPH_gr.js";import{o as C}from"./funnel-events-RT_kdQHK.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:{}}),ne=_({key:`device:tips:enabled`,scope:`device`,parse:g,serialize:String,fallback:!0}),j=_({key:`device:tips:first_seen_at`,scope:`device`,parse:k,serialize:String,fallback:0});function re(){j.load()===0&&j.save(Date.now())}function ie(e,t){let n=A.load(),r=n[e];A.save({...n,[e]:{...r,lastShownAt:t,shownCount:(r?.shownCount??0)+1}})}function ae(e,t){let n=A.load(),r=n[e];A.save({...n,[e]:{...r,dismissedAt:t,shownCount:r?.shownCount??0}})}var oe=`proactive-tips-v1`,se={impression:0,learn_more:1,dismiss:2,dont_show_again:3,click:4,completion:5};function M(e,t,n){C({stepName:t,stepIndex:se[t]},{funnelVersion:oe,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}),fe=_({key:`device:show_context_window_indicator`,scope:`device`,parse:g,serialize:String,fallback:!1}),q=`app.iosNudge.downloaded`,J=`app.iosNudge.bannerDismissed`,Y=`app.iosNudge.assistantTurnsSeen`,pe=`https://apps.apple.com/us/app/vellum-assistant/id6759934423`;function me(){return i(q,!1)}function X(){t(q,!0)}function he(){return i(J,!1)}function Z(){t(J,!0)}function Q(){return Math.max(0,n(Y,0))}function ge(e=1){e<=0||r(Y,Q()+e)}function _e(){let[e,t]=(0,N.useState)(!1),[n,r]=(0,N.useState)(!1);(0,N.useEffect)(()=>{t(me()),r(he())},[]);let i=(0,N.useCallback)(()=>{$(),X(),t(!0)},[]),a=(0,N.useCallback)(()=>{Z(),r(!0)},[]);return{bannerShouldShow:!e&&!n,handleDownload:i,handleBannerDismiss:a}}function $(){window.open(pe,`_blank`,`noopener,noreferrer`)}export{w as C,T as S,A as _,X as a,te as b,ue as c,V as d,P as f,ie as g,ae as h,_e as i,le as l,re as m,$ as n,de as o,M as p,Q as r,fe as s,ge as t,H as u,ne as v,ee as x,j as y};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{c as t,r as n,s as r,t as i}from"./local-settings-Bx7FsNo5.js";import{s as a}from"./device-settings-CUIsZfaf.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"./src-Da9g8qsW.js";import{t as u}from"./checkbox-PU47Djxg.js";import{t as d}from"./triangle-alert-D6bAGtMw.js";import{t as f}from"./notice-Dslxs3H6.js";import{t as p}from"./modal-xr_vw1ZO.js";import{i as m,t as h}from"./api-CGsj1Pig.js";import{t as g}from"./client-feature-flag-store-Cw39NfCq.js";import{a as _,i as v}from"./typed-storage-OO7emDaU.js";import{n as y,r as b,t as x}from"./theme-preferences-B2X7Xgir.js";import{t as S}from"./use-bus-subscription-DiCq1_ki.js";import{o as C}from"./funnel-events-B9hFLlxs.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 g.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=v({key:`device:tips:records`,scope:`device`,parse:O,serialize:JSON.stringify,fallback:{}}),ne=v({key:`device:tips:enabled`,scope:`device`,parse:_,serialize:String,fallback:!0}),j=v({key:`device:tips:first_seen_at`,scope:`device`,parse:k,serialize:String,fallback:0});function re(){j.load()===0&&j.save(Date.now())}function ie(e,t){let n=A.load(),r=n[e];A.save({...n,[e]:{...r,lastShownAt:t,shownCount:(r?.shownCount??0)+1}})}function ae(e,t){let n=A.load(),r=n[e];A.save({...n,[e]:{...r,dismissedAt:t,shownCount:r?.shownCount??0}})}var oe=`proactive-tips-v1`,se={impression:0,learn_more:1,dismiss:2,dont_show_again:3,click:4,completion:5};function M(e,t,n){C({stepName:t,stepIndex:se[t]},{funnelVersion:oe,screen:e,variant:n})}var N=e(o(),1);function P(){let e=g.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:l?`Free up space or add more storage to avoid interruptions.`:`Free up space 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=v({key:`device:cmd_enter_to_send`,scope:`device`,parse:_,serialize:String,fallback:!1}),fe=v({key:`device:show_context_window_indicator`,scope:`device`,parse:_,serialize:String,fallback:!1}),q=`app.iosNudge.downloaded`,J=`app.iosNudge.bannerDismissed`,Y=`app.iosNudge.assistantTurnsSeen`,pe=`https://apps.apple.com/us/app/vellum-assistant/id6759934423`;function me(){return i(q,!1)}function X(){r(q,!0)}function he(){return i(J,!1)}function Z(){r(J,!0)}function Q(){return Math.max(0,n(Y,0))}function ge(e=1){e<=0||t(Y,Q()+e)}function _e(){let[e,t]=(0,N.useState)(!1),[n,r]=(0,N.useState)(!1);(0,N.useEffect)(()=>{t(me()),r(he())},[]);let i=(0,N.useCallback)(()=>{$(),X(),t(!0)},[]),a=(0,N.useCallback)(()=>{Z(),r(!0)},[]);return{bannerShouldShow:!e&&!n,handleDownload:i,handleBannerDismiss:a}}function $(){window.open(pe,`_blank`,`noopener,noreferrer`)}export{w as C,T as S,A as _,X as a,te as b,ue as c,V as d,P as f,ie as g,ae as h,_e as i,le as l,re as m,$ as n,de as o,M as p,Q as r,fe as s,ge as t,H as u,ne as v,ee as x,j as y};
@@ -0,0 +1 @@
1
+ import{at as e,ct as t,i as n,n as r,ot as i,rt as a}from"./auth-store-C9aYqB9U.js";var o=5e3;function s(e,t,n){return!n||e!=null?`ready`:t===`error`?`unavailable`:`resolving`}function c(){return s(i(),e.use.status(),n())}function l(){return s(a(),e.getState().status,t(r.getState().platformSession))}function u(){return c()===`ready`}export{c as i,l as n,u as r,o as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./useQuery-Bz-fbQ-m.js";import{Br as r}from"./sdk.gen-CjtCuSlS.js";import{o as i}from"./workspace-path-links-vDBIljq_.js";var a=e(t(),1),o={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,mp3:`audio/mpeg`,wav:`audio/wav`,m4a:`audio/mp4`,aac:`audio/aac`,ogg:`audio/ogg`,flac:`audio/flac`,mp4:`video/mp4`,mov:`video/quicktime`,m4v:`video/mp4`,webm:`video/webm`,pdf:`application/pdf`},s={docx:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,pptx:`application/vnd.openxmlformats-officedocument.presentationml.presentation`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`},c=new Set([`application/octet-stream`,`binary/octet-stream`]),l=256,u=1024;function d(e,t,n=0){if(e.length<n+t.length)return!1;for(let r=0;r<t.length;r+=1)if(e[n+r]!==t[r])return!1;return!0}function f(e,t,n){let r=Math.min(e.length,t+n),i=``;for(let n=t;n<r;n+=1)i+=String.fromCharCode(e[n]);return i}function p(e){if(e.length<2)return!1;let t=e[0],n=e[1];if(t!==255||(n&224)!=224)return!1;let r=n>>3&3,i=n>>1&3;return r!==1&&i!==0}function m(e){let t=e.trim().toLowerCase();return t.startsWith(`m4a`)||t.startsWith(`m4b`)||t.startsWith(`m4p`)||t.startsWith(`f4a`)?`audio/mp4`:t.startsWith(`qt`)?`video/quicktime`:`video/mp4`}function h(e){let t=new TextDecoder(`utf-8`).decode(e.subarray(0,u)).replace(/^\uFEFF/,``).trimStart();return t.startsWith(`<`)&&/<svg\b/i.test(t)?`image/svg+xml`:null}function g(e){if(e.length===0)return null;if(d(e,[137,80,78,71,13,10,26,10]))return`image/png`;if(d(e,[255,216,255]))return`image/jpeg`;let t=f(e,0,6);if(t===`GIF87a`||t===`GIF89a`)return`image/gif`;if(f(e,0,4)===`RIFF`){let t=f(e,8,4);if(t===`WEBP`)return`image/webp`;if(t===`WAVE`)return`audio/wav`}return f(e,0,4)===`%PDF`?`application/pdf`:f(e,0,3)===`ID3`?`audio/mpeg`:f(e,4,4)===`ftyp`?m(f(e,8,4)):d(e,[26,69,223,163])?f(e,0,l).includes(`webm`)?`video/webm`:`video/x-matroska`:f(e,0,4)===`OggS`?`audio/ogg`:f(e,0,4)===`fLaC`?`audio/flac`:d(e,[80,75,3,4])?`application/zip`:d(e,[66,77])?`image/bmp`:p(e)?`audio/mpeg`:h(e)}function _(e){if(!e)return null;let t=e.split(`;`)[0].trim().toLowerCase();return t.length>0?t:null}function v(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?``:t.slice(n+1).toLowerCase()}function y(e){return e?e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:e===`application/pdf`?`pdf`:`file`:`file`}function b(e){let t=v(e.filename),n=o[t]??null,r=_(e.sniffedMime),i=r===`image/svg+xml`&&t!==`svg`,a=r===`application/zip`?s[t]??null:null,l=i?null:a??r,u=_(e.serverMime),d=u&&!c.has(u)?u:null,f=l??d??n??u??null;return{mime:f,kind:y(f)}}var x=512,S=`bytes=0-${x-1}`,C=3e4;async function w(e,t){if(!e)return new Uint8Array;let n=e.getReader(),r=[],i=0;try{for(;i<t;){let{done:e,value:t}=await n.read();if(e)break;t&&t.byteLength>0&&(r.push(t),i+=t.byteLength)}}finally{n.cancel().catch(()=>{})}let a=new Uint8Array(Math.min(i,t)),o=0;for(let e of r){if(o>=a.length)break;let t=e.subarray(0,a.length-o);a.set(t,o),o+=t.byteLength}return a}function T(e){let t=e.headers.get(`Content-Range`);if(t){let e=/\/\s*(\d+)\s*$/.exec(t)?.[1];return e?Number(e):null}let n=e.headers.get(`Content-Length`);return n&&/^\d+$/.test(n.trim())?Number(n.trim()):null}async function E(e,t){try{let{data:n,error:a,response:o}=await r({path:{assistant_id:e},query:{path:t},headers:{Range:S},parseAs:`stream`,throwOnError:!1});if(a||!o?.ok)return{ok:!1,reason:o?.status===404?`missing`:`error`};let{mime:s,kind:c}=b({sniffedMime:g(await w(n,x)),serverMime:o.headers.get(`Content-Type`),filename:i(t)});return{ok:!0,kind:c,mime:s,sizeBytes:T(o)}}catch{return{ok:!1,reason:`error`}}}function D(e,t){return[`local-file-info`,t??null,e]}function O(e,t){return[`local-file-blob`,t??null,e]}function k(e,t){let r=e!==null&&!!t,o=n({queryKey:D(e,t),queryFn:()=>E(t,e),enabled:r,staleTime:C,retry:!1}),s=o.data,c=o.isError;return(0,a.useMemo)(()=>e===null?{status:`unavailable`,reason:`outside-workspace`}:s?s.ok?{status:`ready`,kind:s.kind,mime:s.mime,sizeBytes:s.sizeBytes,workspacePath:e,filename:i(e)}:{status:`unavailable`,reason:s.reason}:c?{status:`unavailable`,reason:`error`}:{status:`loading`},[e,s,c])}function A(e,t){return{queryKey:O(e,t),queryFn:async()=>{let{data:n,error:i}=await r({path:{assistant_id:t},query:{path:e},parseAs:`blob`,throwOnError:!1});if(i||!(n instanceof Blob))throw Error(`Failed to load workspace file`);return n},staleTime:1/0,retry:!1}}function j(e,t){let[n,r]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e){r(null);return}let n=new Blob([e],{type:t??void 0}),i=URL.createObjectURL(n);return r(i),()=>{URL.revokeObjectURL(i),r(null)}},[e,t]),n}function M(e){let{workspacePath:t,mime:r,enabled:i,assistantId:a}=e,o=i&&t!==null&&!!a,{data:s,isError:c}=n({...A(t,a),enabled:o});return{url:j(s,r),isError:c}}export{M as a,g as c,k as i,D as n,A as o,j as r,b as s,O 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{p as i}from"./native-biometric-B96mgKGP.js";import{d as a}from"./routes-GmNvdtLW.js";import{i as o}from"./navigation-resolver-Lxhf-tbn.js";import{t as s}from"./build-state-DPMhQpLB.js";import{n as c}from"./login-flow-llpmkEjN.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-DIlIrdJX.js";import{f as i}from"./native-biometric-DetUqtjl.js";import{d as a}from"./routes-DrfnNoYS.js";import{i as o}from"./navigation-resolver-CzEY-5nE.js";import{t as s}from"./build-state-9uUe0jN5.js";import{n as c}from"./login-flow-CQhvCbQQ.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{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{q as n}from"./auth-store-BwKMFgpK.js";var r=e(t(),1);function i(e,t){let[i,a]=(0,r.useState)({platformAssistantId:null,isLoading:!1,error:null});return(0,r.useEffect)(()=>{if(!t||!e){a({platformAssistantId:null,isLoading:!1,error:null});return}let r=!0;return a({platformAssistantId:null,isLoading:!0,error:null}),n(e).then(e=>{r&&a({platformAssistantId:e,isLoading:!1,error:null})}).catch(e=>{r&&a({platformAssistantId:null,isLoading:!1,error:e instanceof Error?e:Error(String(e))})}),()=>{r=!1}},[e,t]),i}export{i as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{Q as n}from"./auth-store-C9aYqB9U.js";var r=e(t(),1);function i(e,t){let[i,a]=(0,r.useState)({platformAssistantId:null,isLoading:!1,error:null});return(0,r.useEffect)(()=>{if(!t||!e){a({platformAssistantId:null,isLoading:!1,error:null});return}let r=!0;return a({platformAssistantId:null,isLoading:!0,error:null}),n(e).then(e=>{r&&a({platformAssistantId:e,isLoading:!1,error:null})}).catch(e=>{r&&a({platformAssistantId:null,isLoading:!1,error:e instanceof Error?e:Error(String(e))})}),()=>{r=!1}},[e,t]),i}export{i as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{f as n,m as r}from"./local-mode-9zpgPNoq.js";import{ht as i,i as a,o}from"./auth-store-BwKMFgpK.js";var s=e(t(),1);function c(){let e=i.use.assistantState();return!!(e.kind===`self_hosted`||e.kind===`active`&&e.isLocal)}function l(){let e=i.use.assistantState();return e.kind===`active`&&!e.isLocal}function u(){let e=i.use.assistantState();return e.kind===`loading`||e.kind===`initializing`||e.kind===`cleaning_up`}function d(e={}){let t=p(e);return t===`pending`?`disabled`:t}function f(e={}){let t=p(e),n=m(t===`pending`,e.settleTimeoutMs??5e3);return t===`pending`&&n?`disabled`:t}function p(e){let t=a(),i=o(),s=r(),l=c(),u=i?`disabled`:`pending`;return e.platformHostedOnly?l?`gated`:t?`full`:u:n()&&s?`gated`:t?`full`:u}function m(e,t){let[n,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(!e){r(!1);return}let n=setTimeout(()=>r(!0),t);return()=>{clearTimeout(n)}},[e,t]),n}export{f as a,d as i,c as n,u as r,l as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{f as n,m as r}from"./local-mode-DHueA-BJ.js";import{i,o as a,xt as o}from"./auth-store-C9aYqB9U.js";var s=e(t(),1);function c(){let e=o.use.assistantState();return!!(e.kind===`self_hosted`||e.kind===`active`&&e.isLocal)}function l(){let e=o.use.assistantState();return e.kind===`active`&&!e.isLocal}function u(){let e=o.use.assistantState();return e.kind===`loading`||e.kind===`initializing`||e.kind===`cleaning_up`}function d(e={}){let t=p(e);return t===`pending`?`disabled`:t}function f(e={}){let t=p(e),n=m(t===`pending`,e.settleTimeoutMs??5e3);return t===`pending`&&n?`disabled`:t}function p(e){let t=i(),o=a(),s=r(),l=c(),u=o?`disabled`:`pending`;return e.platformHostedOnly?l?`gated`:t?`full`:u:n()&&s?`gated`:t?`full`:u}function m(e,t){let[n,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(!e){r(!1);return}let n=setTimeout(()=>r(!0),t);return()=>{clearTimeout(n)}},[e,t]),n}export{f as a,d as i,c as n,u as r,l as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{d as n,l as r,u as i}from"./proxy-CNtrhN4q.js";var a=e(t(),1);function o(){!i.current&&r();let[e]=(0,a.useState)(n.current);return e}export{o as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{d as n,l as r,u as i}from"./proxy-DrtKRLtr.js";var a=e(t(),1);function o(){!i.current&&r();let[e]=(0,a.useState)(n.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{m as n,n as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./loader-circle-BzJ2kz3F.js";import{a as o,s}from"./auth-store-BwKMFgpK.js";import{T as c}from"./native-biometric-B96mgKGP.js";import{d as l}from"./routes-GmNvdtLW.js";import{a as u}from"./use-platform-gate-CqEOGZtI.js";import{t as d}from"./hard-navigate-V2EFapkk.js";import{a as f,o as p}from"./login-flow-llpmkEjN.js";var m=i();function h(){return(0,m.jsx)(a,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading`})}var g=e(t(),1);function _({to:e}){let t=f(e);return(0,g.useEffect)(()=>{t&&d(e)},[t,e]),t?null:(0,m.jsx)(r,{to:e,replace:!0})}function v(){let[e]=n(),t=o(),r=s(),i=u(),a=e.get(`returnTo`),d=c(a,l.assistant);if(!a)return{kind:`proceed`,returnTo:null};if(r)return{kind:`wait`};if(!t)return{kind:`proceed`,returnTo:d};if(p(d)){if(i===`pending`)return{kind:`wait`};if(i===`disabled`)return{kind:`proceed`,returnTo:d}}return{kind:`redirect`,node:(0,m.jsx)(_,{to:d})}}export{h as n,v as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{m as n,n as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./loader-circle-DWWXcfTQ.js";import{a as o,s}from"./auth-store-C9aYqB9U.js";import{w as c}from"./native-biometric-DetUqtjl.js";import{d as l}from"./routes-DrfnNoYS.js";import{a as u}from"./use-platform-gate-C5bNA5Pn.js";import{t as d}from"./hard-navigate-BYoBFmE4.js";import{a as f,o as p}from"./login-flow-CQhvCbQQ.js";var m=i();function h(){return(0,m.jsx)(a,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading`})}var g=e(t(),1);function _({to:e}){let t=f(e);return(0,g.useEffect)(()=>{t&&d(e)},[t,e]),t?null:(0,m.jsx)(r,{to:e,replace:!0})}function v(){let[e]=n(),t=o(),r=s(),i=u(),a=e.get(`returnTo`),d=c(a,l.assistant);if(!a)return{kind:`proceed`,returnTo:null};if(r)return{kind:`wait`};if(!t)return{kind:`proceed`,returnTo:d};if(p(d)){if(i===`pending`)return{kind:`wait`};if(i===`disabled`)return{kind:`proceed`,returnTo:d}}return{kind:`redirect`,node:(0,m.jsx)(_,{to:d})}}export{h as n,v 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{Qt as u,en as d,nn as f}from"./sdk.gen-BySz4QYj.js";import{Dt as p,Et as m,Ot as h,kt as g,s as _}from"./react-query.gen-0mspArBl.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})}function z(e){return e?.trim()||`your assistant`}var B=[`slack`,`telegram`,`phone`];function V(e){return B.includes(e)}function H(e){return{path:{assistant_id:e},query:{memberOnly:`true`}}}function U(e){return m(H(e))}function W(e){return p(H(e))}var G=600*1e3;function K(e){return{path:{assistant_id:e}}}function q(e){return{...h(K(e)),staleTime:G}}function J(e){return g(K(e))}function Y(e,t){e.removeQueries({queryKey:W(t)}),e.removeQueries({queryKey:J(t)})}function X({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>_({path:{assistant_id:e}}),[e]);return r({mutationFn:({botToken:t,appToken:n})=>{if(!n.trim())throw Error(`App token is required. Copy the xapp- token from Slack's install screen.`);if(!t.trim())throw Error(`Bot token is required.`);return u({path:{assistant_id:e},body:{botToken:t.trim(),appToken:n.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a}),Y(i,e)}})}function Z({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>_({path:{assistant_id:e}}),[e]);return r({mutationFn:t=>{if(!t.trim())throw Error(`Bot token is required.`);return d({path:{assistant_id:e},body:{botToken:t.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a})}})}function Q({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>_({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{S,O as _,q as a,w as b,V as c,L as d,F as f,k as g,E as h,Y as i,z as l,D as m,Z as n,U as o,I as p,X as r,B as s,Q as t,R as u,j as v,C as x,A 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-DyUf40pu.js";import{t as s}from"./message-circle-ByXBaIaq.js";import{t as c}from"./message-square-CHUvAEY9.js";import{t as l}from"./send-Bdmy_GSE.js";import{$t as u,rn as d,tn as f}from"./sdk.gen-CjtCuSlS.js";import{Dt as p,Et as m,Ot as h,kt as g,s as _}from"./react-query.gen-C7om930f.js";import{C as v,a as y,m as b,t as x}from"./sdk.gen-BpJ1vF7l.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})}function z(e){return e?.trim()||`your assistant`}var B=[`slack`,`telegram`,`phone`];function V(e){return B.includes(e)}function H(e){return{path:{assistant_id:e},query:{memberOnly:`true`}}}function U(e){return m(H(e))}function W(e){return p(H(e))}var G=600*1e3;function K(e){return{path:{assistant_id:e}}}function q(e){return{...h(K(e)),staleTime:G}}function J(e){return g(K(e))}function Y(e,t){e.removeQueries({queryKey:W(t)}),e.removeQueries({queryKey:J(t)})}function X({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>_({path:{assistant_id:e}}),[e]);return r({mutationFn:({botToken:t,appToken:n})=>{if(!n.trim())throw Error(`App token is required. Copy the xapp- token from Slack's install screen.`);if(!t.trim())throw Error(`Bot token is required.`);return u({path:{assistant_id:e},body:{botToken:t.trim(),appToken:n.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a}),Y(i,e)}})}function Z({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>_({path:{assistant_id:e}}),[e]);return r({mutationFn:t=>{if(!t.trim())throw Error(`Bot token is required.`);return f({path:{assistant_id:e},body:{botToken:t.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a})}})}function Q({assistantId:e,onSuccess:t}){let i=n(),a=(0,M.useMemo)(()=>_({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 d({path:{assistant_id:e},body:{accountSid:t.trim(),authToken:n.trim()},throwOnError:!0})},onSuccess:t,onSettled:()=>{i.invalidateQueries({queryKey:a})}})}export{S,O as _,q as a,w as b,V as c,L as d,F as f,k as g,E as h,Y as i,z as l,D as m,Z as n,U as o,I as p,X as r,B as s,Q as t,R as u,j as v,C as x,A 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-BDvXuPkw.js";import{t as l}from"./puzzle-CtM3jM-f.js";import{t as u}from"./terminal-Cs_TREv-.js";import{t as d}from"./user-Dq9DUxnU.js";import"./src-BAS7a2RG.js";import{t as f}from"./tag-D8NAGb0r.js";import{n as p,r as m,t as h}from"./api-errors-SZKDzMLE.js";import{mr as g}from"./sdk.gen-BySz4QYj.js";import{ln as _}from"./react-query.gen-0mspArBl.js";import{t as v}from"./skills-BL4RgwAd.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 g({path:{assistant_id:e},body:n?{slug:t,version:n}:{slug:t},throwOnError:!1});if(p(a,i,`Failed to install skill.`),!a.ok)throw new h(a.status,m(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=_({onMutate:e=>c(e.path.id),onSuccess:()=>{t?.()},onSettled:()=>{c(null),d()}}),m=(0,b.useCallback)(e=>{f.mutate(e.slug??e.id)},[f]),h=(0,b.useCallback)(e=>{u(e)},[]),g=(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:m,handleRemove:h,isInstallingSkill:(0,b.useCallback)(e=>a===(e.slug??e.id),[a]),isRemovingSkill:(0,b.useCallback)(e=>s===e.id,[s]),skillPendingRemoval:l,confirmRemove:g,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-CN4zzNgU.js";import"./src-Da9g8qsW.js";import{t as c}from"./globe-CdLn4IX7.js";import{t as l}from"./puzzle-4NgH5snP.js";import{t as u}from"./terminal-BucMVaPU.js";import{t as d}from"./user-DHC7OLPE.js";import{t as f}from"./tag-gOOX7fbA.js";import{n as p,r as m,t as h}from"./api-errors-BRGPPSWw.js";import{hr as g}from"./sdk.gen-CjtCuSlS.js";import{ln as _}from"./react-query.gen-C7om930f.js";import{t as v}from"./skills-CbF2uKXV.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 g({path:{assistant_id:e},body:n?{slug:t,version:n}:{slug:t},throwOnError:!1});if(p(a,i,`Failed to install skill.`),!a.ok)throw new h(a.status,m(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=_({onMutate:e=>c(e.path.id),onSuccess:()=>{t?.()},onSettled:()=>{c(null),d()}}),m=(0,b.useCallback)(e=>{f.mutate(e.slug??e.id)},[f]),h=(0,b.useCallback)(e=>{u(e)},[]),g=(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:m,handleRemove:h,isInstallingSkill:(0,b.useCallback)(e=>a===(e.slug??e.id),[a]),isRemovingSkill:(0,b.useCallback)(e=>s===e.id,[s]),skillPendingRemoval:l,confirmRemove:g,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{d as o}from"./routes-GmNvdtLW.js";import{bt as s,xt as c}from"./react-query.gen-0mspArBl.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:o.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({...c({path:{assistant_id:e??``,id:t}}),select:e=>e??null,enabled:!!e}),o=(0,f.useMemo)(()=>a.data?.files??[],[a.data]),l=(0,f.useMemo)(()=>o.find(e=>e.name===`SKILL.md`),[o]),u=p(o,n),d=r({...s({path:{assistant_id:e??``,id:t},query:{path:u??``}}),select:e=>e??null,enabled:!!(e&&u)});return{fileEntries:o,skillMd:l,selectedPath:n,setSelectedPath:i,activePath:u,activeFile:o.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-ChqGeAaW.js";import{d as o}from"./routes-DrfnNoYS.js";import{bt as s,xt as c}from"./react-query.gen-C7om930f.js";import{t as l}from"./misc-BBsGq1IU.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:o.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({...c({path:{assistant_id:e??``,id:t}}),select:e=>e??null,enabled:!!e}),o=(0,f.useMemo)(()=>a.data?.files??[],[a.data]),l=(0,f.useMemo)(()=>o.find(e=>e.name===`SKILL.md`),[o]),u=p(o,n),d=r({...s({path:{assistant_id:e??``,id:t},query:{path:u??``}}),select:e=>e??null,enabled:!!(e&&u)});return{fileEntries:o,skillMd:l,selectedPath:n,setSelectedPath:i,activePath:u,activeFile:o.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};