@vellumai/web 0.10.3 → 0.10.4-dev.202607010028.1a4efcc

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 (282) hide show
  1. package/dist/assets/{AnimatePresence-CgXwEO42.js → AnimatePresence-v8rrAm7n.js} +2 -2
  2. package/dist/assets/{BundleConfirmPage-DpfvIcwl.js → BundleConfirmPage-BEQyQVeN.js} +1 -1
  3. package/dist/assets/{about-page-CuSnWJFo.js → about-page-Ck4iLq7E.js} +1 -1
  4. package/dist/assets/account-page-BYTIe1XI.js +1 -0
  5. package/dist/assets/{account-shell-b6GjlQ0u.js → account-shell-YW3hfGZg.js} +1 -1
  6. package/dist/assets/acp-run-detail-panel-DSh8Ovx2.js +5 -0
  7. package/dist/assets/{add-credits-modal-Dy3I3Har.js → add-credits-modal-FPXxOAMb.js} +1 -1
  8. package/dist/assets/advanced-page-UPgcMIra.js +1 -0
  9. package/dist/assets/ai-page-CGEA7pTY.js +1 -0
  10. package/dist/assets/animated-avatar-Dt3HMkLe.js +1 -0
  11. package/dist/assets/{api-2kc3MHRz.js → api-CwV4YyjT.js} +1 -1
  12. package/dist/assets/api-key-screen-D1quwCLW.js +1 -0
  13. package/dist/assets/{archive-page-Dl6HLIJt.js → archive-page-KY7n-0Qw.js} +1 -1
  14. package/dist/assets/assistant-api-DsiQd51V.js +1 -0
  15. package/dist/assets/{assistant-feature-flag-store-Dl92XRsM.js → assistant-feature-flag-store-9j2-Kf63.js} +1 -1
  16. package/dist/assets/{assistant-identity-store-CKjnoLSp.js → assistant-identity-store-E8J494ln.js} +1 -1
  17. package/dist/assets/{assistant-status-panel-BkIkvMYw.js → assistant-status-panel-D1hbDikl.js} +1 -1
  18. package/dist/assets/auth-store-DhoDi3Ka.js +2 -0
  19. package/dist/assets/background-task-detail-panel-BssEr931.js +1 -0
  20. package/dist/assets/billing-page-KDeiZ67m.js +3 -0
  21. package/dist/assets/{bookmarks-page-CANlE7hP.js → bookmarks-page-DnLy6VIU.js} +1 -1
  22. package/dist/assets/{browser-CKX_K5ev.js → browser-BtcMMWcD.js} +2 -2
  23. package/dist/assets/build-state-D10hicGm.js +1 -0
  24. package/dist/assets/{capture-error-Hr1Yo2kx.js → capture-error-BG-GkiMq.js} +1 -1
  25. package/dist/assets/chat-rA5AbKPD.js +1 -0
  26. package/dist/assets/{client-feature-flag-store-C1kdd1EO.js → client-feature-flag-store-Co2Hhr3q.js} +1 -1
  27. package/dist/assets/client-identity-KGlckm6M.js +1 -0
  28. package/dist/assets/client.gen-DU1JkKSB.js +6 -0
  29. package/dist/assets/{command-palette-GZu_zgQg.js → command-palette-B1B3JFxY.js} +1 -1
  30. package/dist/assets/{command-palette-window-page-CzWu42Ee.js → command-palette-window-page-Cg49NRQN.js} +1 -1
  31. package/dist/assets/{community-page-Dhgypa-h.js → community-page-C1LspNF5.js} +1 -1
  32. package/dist/assets/{connect-page-CDOcgzzL.js → connect-page-C4TuRCyq.js} +1 -1
  33. package/dist/assets/{consent-controls-BSZV4rW3.js → consent-controls-Dsb58yGZ.js} +1 -1
  34. package/dist/assets/{contacts-gateway-dxw1KMN2.js → contacts-gateway-BDJYh797.js} +1 -1
  35. package/dist/assets/contacts-page-route-CUppjd6B.js +9 -0
  36. package/dist/assets/{conversation-list-fetchers-UPVZq_6O.js → conversation-list-fetchers-XUhw0LTH.js} +1 -1
  37. package/dist/assets/{danger-zone-redirect-page-CjqUKhk9.js → danger-zone-redirect-page-DK4QwO4q.js} +1 -1
  38. package/dist/assets/debug-page-BU9E2Zpp.js +4 -0
  39. package/dist/assets/{deploy-dialogs-jf5VL1UP.js → deploy-dialogs-BffsSWHa.js} +1 -1
  40. package/dist/assets/{detail-card-BIwpXT5F.js → detail-card-kfxLI0l_.js} +1 -1
  41. package/dist/assets/detail-panel-stop-button-D0KsydFR.js +1 -0
  42. package/dist/assets/detail-shell-BPCWck_r.js +3 -0
  43. package/dist/assets/{developer-page-iEL4eJ8x.js → developer-page-CnUodPF4.js} +1 -1
  44. package/dist/assets/{devices-page-RMaPGcXe.js → devices-page-BBKhaTRg.js} +1 -1
  45. package/dist/assets/diagnostics-Dd5CfP37.js +1 -0
  46. package/dist/assets/{dictation-overlay-page-BxQCzLMY.js → dictation-overlay-page-Dz04r9UQ.js} +1 -1
  47. package/dist/assets/{document-viewer-page-57OuXxYw.js → document-viewer-page-DJq7Ygvy.js} +1 -1
  48. package/dist/assets/earn-credits-modal-fcQSixir.js +1 -0
  49. package/dist/assets/{emails-page-0gRZqa6y.js → emails-page-wd0TRGg5.js} +1 -1
  50. package/dist/assets/{emoji-catalog-data-Dlkuvec0.js → emoji-catalog-data-D8lRMt3A.js} +1 -1
  51. package/dist/assets/esm--RA963YO.js +2 -0
  52. package/dist/assets/esm-BSRBg0oR.js +2 -0
  53. package/dist/assets/esm-CJ8uY1wn.js +2 -0
  54. package/dist/assets/esm-DTj81fJQ.js +1 -0
  55. package/dist/assets/{esm-B3Lr4Bv0.js → esm-O9mDOR47.js} +2 -2
  56. package/dist/assets/esm-cB02a8J9.js +2 -0
  57. package/dist/assets/feature-flag-catalog-DV82F0L3.js +1 -0
  58. package/dist/assets/{file-editor-BNkJJbUv.js → file-editor-DOP89Gof.js} +1 -1
  59. package/dist/assets/general-page-CPBHVyTD.js +1 -0
  60. package/dist/assets/hatching-screen-DY3K0JOi.js +1 -0
  61. package/dist/assets/home-page-route-DONg99uG.js +1 -0
  62. package/dist/assets/{hosting-screen-C14KAJ6m.js → hosting-screen-CVc_n57L.js} +1 -1
  63. package/dist/assets/identity-page-route-ppulI5aE.js +1 -0
  64. package/dist/assets/index-BX26FZ8C.css +2 -0
  65. package/dist/assets/index-DbPUHSMl.js +130 -0
  66. package/dist/assets/{inspect-page-CWasyuSO.js → inspect-page-Bumwp983.js} +9 -7
  67. package/dist/assets/install-WYTcfmdN.js +1 -0
  68. package/dist/assets/integrations-page-BsTax_30.js +1 -0
  69. package/dist/assets/intelligence-layout-D6U1Copv.js +1 -0
  70. package/dist/assets/{keyboard-shortcuts-page-kiOEZKzE.js → keyboard-shortcuts-page-D_GqzGiY.js} +1 -1
  71. package/dist/assets/library-detail-page-Bw131lov.js +1 -0
  72. package/dist/assets/{library-page-BHejhapZ.js → library-page-jSdqmt8d.js} +1 -1
  73. package/dist/assets/{login-flow-DPi11n3h.js → login-flow-Bu_R77mO.js} +1 -1
  74. package/dist/assets/login-page-DPfXjBWn.js +1 -0
  75. package/dist/assets/{logout-page-Bl6AD21S.js → logout-page-AznF3yAS.js} +1 -1
  76. package/dist/assets/{logs-layout-C9eUE1Pt.js → logs-layout-BYJ41Qya.js} +1 -1
  77. package/dist/assets/{memory-router-playground-page-Dhi3uqxr.js → memory-router-playground-page-Dm3TiSY7.js} +1 -1
  78. package/dist/assets/messages-qxyeoKYS.js +13 -0
  79. package/dist/assets/{status-badge-pill-DYlAnX5m.js → metric-card-CderFn_K.js} +1 -1
  80. package/dist/assets/{mobile-sidebar-drawer-DqXFL0Ke.js → mobile-sidebar-drawer-CfI8ihQa.js} +1 -1
  81. package/dist/assets/native-biometric-CBWaVg3Q.js +6 -0
  82. package/dist/assets/{native-file-B-MK3Ngg.js → native-file-Djc1KZs3.js} +2 -2
  83. package/dist/assets/{notifications-page-pHiDPA0p.js → notifications-page-B8rJ9VKw.js} +1 -1
  84. package/dist/assets/{oauth-complete-page-DiGMWbOb.js → oauth-complete-page-z8o1ui13.js} +1 -1
  85. package/dist/assets/{oauth-popup-complete-page-CwoZnzdc.js → oauth-popup-complete-page-Tkc-rQX9.js} +1 -1
  86. package/dist/assets/{page-shell-cEGpH3P5.js → page-shell-D0lmza98.js} +1 -1
  87. package/dist/assets/pairing-page-m0oxNDQ9.js +1 -0
  88. package/dist/assets/{password-reset-page-DfYGL1Gv.js → password-reset-page-T_0pamrF.js} +1 -1
  89. package/dist/assets/platform-detection-ByImsPTf.js +1 -0
  90. package/dist/assets/platform-loopback-page-D2HL9AUX.js +1 -0
  91. package/dist/assets/plugin-detail-page-Bb-HIhbL.js +1 -0
  92. package/dist/assets/plugins-page-DRvAzmXd.js +1 -0
  93. package/dist/assets/plugins-surface-CbPGIeTp.js +1 -0
  94. package/dist/assets/prechat-route-BH3zTo60.js +1 -0
  95. package/dist/assets/{prefs-C_oq5G87.js → prefs-BJa0q2Gz.js} +1 -1
  96. package/dist/assets/privacy-page-B_IftswZ.js +1 -0
  97. package/dist/assets/privacy-screen-RyAPZfA7.js +1 -0
  98. package/dist/assets/provider-callback-page-D3_-eNaE.js +1 -0
  99. package/dist/assets/provider-key-BJ_kBwp_.js +1 -0
  100. package/dist/assets/provider-signup-page-DHI17XiE.js +1 -0
  101. package/dist/assets/proxy-E3RRrfO5.js +1 -0
  102. package/dist/assets/{quick-input-page-C9jN8YtU.js → quick-input-page-DX5Rrr0p.js} +1 -1
  103. package/dist/assets/react-query.gen-BZr-1Xaw.js +1 -0
  104. package/dist/assets/{react-query.gen-rp6Krcco.js → react-query.gen-By34AU2d.js} +1 -1
  105. package/dist/assets/{return-to-ByvaXBKr.js → remote-gateway-session-znfqX8Fi.js} +1 -1
  106. package/dist/assets/repeat-nCGBxntG.js +1 -0
  107. package/dist/assets/{research-mock-page-ttrrPwo3.js → research-mock-page-DYca4sbx.js} +1 -1
  108. package/dist/assets/research-onboarding-route-Ba74KUBl.js +53 -0
  109. package/dist/assets/{resize-errors-DnJEbHn4.js → resize-errors-D1myE8D_.js} +1 -1
  110. package/dist/assets/return-to-yMLvlnXN.js +1 -0
  111. package/dist/assets/{review-terms-screen-DEiifDmK.js → review-terms-screen-D4lBqvba.js} +1 -1
  112. package/dist/assets/routes-C6gxiCrz.js +1 -0
  113. package/dist/assets/{schedules-D-4Rq6ZC.js → schedules-DJmuJMXB.js} +1 -1
  114. package/dist/assets/sdk.gen-7kFw36Fw.js +1 -0
  115. package/dist/assets/{sdk.gen-D-_js_oC.js → sdk.gen-DmWuY0SL.js} +1 -1
  116. package/dist/assets/{select-assistant-screen-UoixBMN2.js → select-assistant-screen-C0FcoktK.js} +1 -1
  117. package/dist/assets/settings-layout-D9gcFAQr.js +1 -0
  118. package/dist/assets/share-feedback-modal-CFO00NHT.js +1 -0
  119. package/dist/assets/{sidebar-tree-BJkXpCut.js → sidebar-tree-BFvRtzPm.js} +1 -1
  120. package/dist/assets/signup-page-CW6PcJ-3.js +1 -0
  121. package/dist/assets/{signup-shell-Bu5BM6II.js → signup-shell-DOF8aXn0.js} +1 -1
  122. package/dist/assets/skills-page-BUy5sEoN.js +1 -0
  123. package/dist/assets/{sound-manager-CzslfzDO.js → sound-manager-KLJ38-0x.js} +1 -1
  124. package/dist/assets/{sounds-page-mens6EAJ.js → sounds-page-g_BwlxnY.js} +1 -1
  125. package/dist/assets/src-mai-NajT.js +293 -0
  126. package/dist/assets/status-badge-pill-j3ke1d9o.js +1 -0
  127. package/dist/assets/step-indicator-dots-Bc6X141I.js +1 -0
  128. package/dist/assets/subagent-detail-panel-DZMGVqEM.js +4 -0
  129. package/dist/assets/{subagent-store-BLHGkTJR.js → subagent-store-uyvG6X03.js} +1 -1
  130. package/dist/assets/{system-events-page-Dro8iNrx.js → system-events-page-BP8qivQM.js} +1 -1
  131. package/dist/assets/{system-events-redirect-page-C1hGE6n5.js → system-events-redirect-page-C16Xg1C_.js} +1 -1
  132. package/dist/assets/three-dot-indicator-BOWJCSsU.js +1 -0
  133. package/dist/assets/{tiptap-document-editor-D2t4qYzv.js → tiptap-document-editor-BlIwazbg.js} +2 -2
  134. package/dist/assets/tool-detail-panel-bEz99Rub.js +2 -0
  135. package/dist/assets/trace-page-7kxcQ5q9.js +1 -0
  136. package/dist/assets/{upgrade-cancel-page-Cwv5eMh9.js → upgrade-cancel-page-D4-wJgCa.js} +1 -1
  137. package/dist/assets/{upgrade-success-page-DnJ8Kyyj.js → upgrade-success-page-BMxaY6Um.js} +1 -1
  138. package/dist/assets/{usage-page-DJHRS0lZ.js → usage-page-qqfsQlxg.js} +1 -1
  139. package/dist/assets/{use-bus-subscription-BbiZXm1u.js → use-bus-subscription-BNaztnO7.js} +1 -1
  140. package/dist/assets/use-is-org-ready-DGnWseqw.js +1 -0
  141. package/dist/assets/use-onboarding-login-DwVCJ7DH.js +1 -0
  142. package/dist/assets/use-reduced-motion-D32BDyn0.js +1 -0
  143. package/dist/assets/use-skill-categories-CZml3JEH.js +1 -0
  144. package/dist/assets/{utils-IBnUZTqY.js → utils-B_yHNmjr.js} +1 -1
  145. package/dist/assets/viewer-store-BSiJen54.js +1 -0
  146. package/dist/assets/{voice-page-kQZ2ya5j.js → voice-page-CNB9Pxor.js} +1 -1
  147. package/dist/assets/weather-forecast-display-270rsUDb.js +1 -0
  148. package/dist/assets/{web-M3MS-KVB.js → web-CxyEb7Lp.js} +1 -1
  149. package/dist/assets/{web-B0S2ynRY.js → web-DFw1Yfb1.js} +1 -1
  150. package/dist/assets/{web-DOKyhuGQ.js → web-DGDlV45i.js} +1 -1
  151. package/dist/assets/{web-DJKnWTsF.js → web-GWxiW7or.js} +1 -1
  152. package/dist/assets/{web-iUXw2JWQ.js → web-YggPvEM4.js} +1 -1
  153. package/dist/assets/{web-D0QcGl1O.js → web-b9SjJqdc.js} +1 -1
  154. package/dist/assets/{web-Cg8gCWpB.js → web-lNls6p99.js} +1 -1
  155. package/dist/assets/{welcome-screen-Bd7PCfAf.js → welcome-screen-Cqkp2VuN.js} +1 -1
  156. package/dist/assets/workflow-detail-panel-Dl3mqk0u.js +1 -0
  157. package/dist/assets/workspace-page-DBZwYmVn.js +1 -0
  158. package/dist/index.html +81 -76
  159. package/package.json +1 -1
  160. package/dist/assets/account-page-CCYCSy2-.js +0 -1
  161. package/dist/assets/advanced-page-CVnT0zH-.js +0 -1
  162. package/dist/assets/ai-page-kEbHR7cH.js +0 -1
  163. package/dist/assets/api-key-screen-DGVn66y4.js +0 -1
  164. package/dist/assets/assistant-api-DROTS3Y9.js +0 -1
  165. package/dist/assets/auth-store-Kfxhs2oI.js +0 -7
  166. package/dist/assets/billing-page-Cq_yLwUC.js +0 -3
  167. package/dist/assets/build-state-VC4tL7sK.js +0 -1
  168. package/dist/assets/contacts-page-route-C3QiOxjO.js +0 -9
  169. package/dist/assets/debug-page-CBozmAQQ.js +0 -2
  170. package/dist/assets/diagnostics-BEB4VPwC.js +0 -1
  171. package/dist/assets/earn-credits-modal-Nm1VymMp.js +0 -1
  172. package/dist/assets/esm-BVNBLzcW.js +0 -2
  173. package/dist/assets/esm-BtN-afz9.js +0 -1
  174. package/dist/assets/esm-D2xhPoyM.js +0 -2
  175. package/dist/assets/esm-DwNtkiSD.js +0 -2
  176. package/dist/assets/esm-pt1s0ryM.js +0 -2
  177. package/dist/assets/feature-flag-catalog-RK3_Ckyw.js +0 -1
  178. package/dist/assets/general-page-aZxTpnpI.js +0 -1
  179. package/dist/assets/hatching-screen-KPinlCES.js +0 -1
  180. package/dist/assets/home-page-route-CudtBGg1.js +0 -1
  181. package/dist/assets/identity-page-route-C0BFcTAF.js +0 -1
  182. package/dist/assets/index-Hcyzmz_5.css +0 -2
  183. package/dist/assets/index-PRnvH2Y1.js +0 -132
  184. package/dist/assets/install-C3xe8ARr.js +0 -1
  185. package/dist/assets/integrations-page-WhBpTYP2.js +0 -1
  186. package/dist/assets/intelligence-layout-CvTumtjv.js +0 -1
  187. package/dist/assets/library-detail-page-rPvN9G1a.js +0 -1
  188. package/dist/assets/login-page-BGLVK82t.js +0 -1
  189. package/dist/assets/messages-DHDZ32NT.js +0 -13
  190. package/dist/assets/pairing-page-clFaUgzL.js +0 -1
  191. package/dist/assets/platform-loopback-page-Df5bTTx8.js +0 -1
  192. package/dist/assets/plugin-detail-page-IRPeI4lP.js +0 -1
  193. package/dist/assets/plugins-page-BaYp2QOe.js +0 -1
  194. package/dist/assets/prechat-route-BaMWiiaf.js +0 -1
  195. package/dist/assets/privacy-page-BUhxrIRn.js +0 -1
  196. package/dist/assets/privacy-screen-BaHYtKEt.js +0 -1
  197. package/dist/assets/provider-callback-page-CxFC4PH1.js +0 -1
  198. package/dist/assets/provider-key-nA35OC4Y.js +0 -1
  199. package/dist/assets/provider-signup-page-CdpT28xL.js +0 -1
  200. package/dist/assets/proxy-DmIh4F51.js +0 -1
  201. package/dist/assets/react-query.gen-CQLyoqYk.js +0 -1
  202. package/dist/assets/reduced-motion-DYlLlcUm.js +0 -1
  203. package/dist/assets/research-onboarding-route-Cxai0fux.js +0 -36
  204. package/dist/assets/risk-badge-BA8R-HCI.js +0 -1
  205. package/dist/assets/routes-DVqkwUEe.js +0 -1
  206. package/dist/assets/sdk.gen-1aYqVbMj.js +0 -6
  207. package/dist/assets/settings-layout-CQ3Z9Raj.js +0 -1
  208. package/dist/assets/share-feedback-modal-CTwByE7B.js +0 -1
  209. package/dist/assets/signup-page-CKDYl9Wb.js +0 -1
  210. package/dist/assets/skills-page-DVjqqfMw.js +0 -1
  211. package/dist/assets/src-CK6bncSg.js +0 -293
  212. package/dist/assets/step-indicator-dots-CEVbsP8r.js +0 -1
  213. package/dist/assets/subagent-detail-panel-DVQAkMjF.js +0 -4
  214. package/dist/assets/three-dot-indicator-CLs7Rl-I.js +0 -1
  215. package/dist/assets/tool-call-status-DTV5jmaU.js +0 -1
  216. package/dist/assets/tool-detail-panel-DRD2DIMF.js +0 -2
  217. package/dist/assets/trace-page-DRWPaAuQ.js +0 -1
  218. package/dist/assets/use-is-org-ready-BdtHeRV6.js +0 -1
  219. package/dist/assets/use-onboarding-login-BEOH92mZ.js +0 -1
  220. package/dist/assets/use-plugin-drift-Bj693x0f.js +0 -1
  221. package/dist/assets/use-reduced-motion-ChB7nOGe.js +0 -1
  222. package/dist/assets/viewer-store-Dead64xY.js +0 -1
  223. package/dist/assets/weather-forecast-display-Cu3W6OZF.js +0 -1
  224. package/dist/assets/workflow-detail-panel-CMmPPsuL.js +0 -1
  225. package/dist/assets/workspace-page-BR4pOxs5.js +0 -1
  226. package/dist/skills/meet-join/assets/icon.svg +0 -1
  227. /package/dist/assets/{api-errors-CveHbhgb.js → api-errors-DPruG7q9.js} +0 -0
  228. /package/dist/assets/{app-info-BZYaLxCg.js → app-info-DJQFoVxX.js} +0 -0
  229. /package/dist/assets/{avatar-bundled-components-BgAkdy0n.js → avatar-bundled-components-w37NPF4o.js} +0 -0
  230. /package/dist/assets/{avatar-svg-compositor-CEmN7KGI.js → avatar-svg-compositor-DG7zqpYr.js} +0 -0
  231. /package/dist/assets/{build.umd-B3KuSWeo.js → build.umd-4R02MPXx.js} +0 -0
  232. /package/dist/assets/{client.gen-Cs6pCK0s.js → client.gen-BHupOCJH.js} +0 -0
  233. /package/dist/assets/{composer-focus-Bp1AiP29.js → composer-focus-n921WsjZ.js} +0 -0
  234. /package/dist/assets/{conversation-selection-CtKjA5Ni.js → conversation-selection-DgYtLnyB.js} +0 -0
  235. /package/dist/assets/{conversation-store-DK-7gFAt.js → conversation-store-CWgiE5KG.js} +0 -0
  236. /package/dist/assets/{definitions-lQvEBMJT.js → definitions-BughTGuV.js} +0 -0
  237. /package/dist/assets/{dist-BTp54SIT.js → dist-Ztj3rqLK.js} +0 -0
  238. /package/dist/assets/{edit-chat-session-DJpqkkos.js → edit-chat-session-TX_J-I33.js} +0 -0
  239. /package/dist/assets/{effective-timezone-DrYGH2Lb.js → effective-timezone-BJxnysvd.js} +0 -0
  240. /package/dist/assets/{environment-store-CvH3J6fT.js → environment-store-CnVyTyZ7.js} +0 -0
  241. /package/dist/assets/{event-bus-Dl7-I4aL.js → event-bus-B3E3w-q2.js} +0 -0
  242. /package/dist/assets/{external-link-DPAtkBJ2.js → external-link-RJkZLlff.js} +0 -0
  243. /package/dist/assets/{file-text-CmK9LY1p.js → file-text-ClqzuFsu.js} +0 -0
  244. /package/dist/assets/{format-CPOur310.js → format-BDkwdD2m.js} +0 -0
  245. /package/dist/assets/{format-date-CLlHK5gl.js → format-date-D4tzd1DT.js} +0 -0
  246. /package/dist/assets/{format-file-size-BfZOpPdu.js → format-file-size-BflZ4oxc.js} +0 -0
  247. /package/dist/assets/{globe-DYF_lSGm.js → globe-D3P5sSKJ.js} +0 -0
  248. /package/dist/assets/{haptics-CXHZxyAg.js → haptics-BE_0g4mc.js} +0 -0
  249. /package/dist/assets/{hard-drive-D7_5VMhi.js → hard-drive-CZEg1Cqc.js} +0 -0
  250. /package/dist/assets/{impersonate-version-flag-n-4oNLiO.js → impersonate-version-flag-BsxCoimD.js} +0 -0
  251. /package/dist/assets/{info-_OtUK1cX.js → info-ciQS_i3y.js} +0 -0
  252. /package/dist/assets/{lib-BWRK7bT2.js → lib-BNGjysgr.js} +0 -0
  253. /package/dist/assets/{link-2-CaszbD7P.js → link-2-r_QPxX18.js} +0 -0
  254. /package/dist/assets/{llm-dimension-CQdmYu05.js → llm-dimension-8g-Go8uq.js} +0 -0
  255. /package/dist/assets/{loader-circle-IIzBGiwm.js → loader-circle-BFRVtR3K.js} +0 -0
  256. /package/dist/assets/{log-in-2iOsufxq.js → log-in-CEw63CGU.js} +0 -0
  257. /package/dist/assets/{minimize-2-JE_UHZlJ.js → minimize-2-dKm10qRD.js} +0 -0
  258. /package/dist/assets/{misc-BN2o2MEB.js → misc-CFzLzLPH.js} +0 -0
  259. /package/dist/assets/{monitor-D2okHi8o.js → monitor-CXU19mVX.js} +0 -0
  260. /package/dist/assets/{moon-CK8MXzOo.js → moon-CKINz50a.js} +0 -0
  261. /package/dist/assets/{mutation-error-CsyN8rYH.js → mutation-error-CK0dVo5B.js} +0 -0
  262. /package/dist/assets/{native-deep-link-BYNI6pkW.js → native-deep-link-ODdFH_Wn.js} +0 -0
  263. /package/dist/assets/{pdf-pz4ipUHd.js → pdf-B-YWzK66.js} +0 -0
  264. /package/dist/assets/{pencil-DbB9rxpY.js → pencil-B90pDI55.js} +0 -0
  265. /package/dist/assets/{prechat-B28Vzu55.js → prechat-3rpjvqoE.js} +0 -0
  266. /package/dist/assets/{prechat-names-CRduluk-.js → prechat-names-NPlBAwCy.js} +0 -0
  267. /package/dist/assets/{public-asset-Fx_laYnf.js → public-asset-B5BQLOj3.js} +0 -0
  268. /package/dist/assets/{refresh-cw-Bf6LV0kG.js → refresh-cw-Dui3Ymsb.js} +0 -0
  269. /package/dist/assets/{save-DEBQ_gbb.js → save-BpAesNEP.js} +0 -0
  270. /package/dist/assets/{semver-yC_Iq9co.js → semver-l1HADz2z.js} +0 -0
  271. /package/dist/assets/{setting-row-o44aWwYt.js → setting-row-BGQgDyhv.js} +0 -0
  272. /package/dist/assets/{sparkles-BICoewVE.js → sparkles-Bla177ar.js} +0 -0
  273. /package/dist/assets/{triangle-alert-DKOyShqD.js → triangle-alert-C3aHZq1F.js} +0 -0
  274. /package/dist/assets/{typed-storage-Dctd_K9F.js → typed-storage-DjORmu8t.js} +0 -0
  275. /package/dist/assets/{usage-window-Wgtgd-cv.js → usage-window-B-YOzKJi.js} +0 -0
  276. /package/dist/assets/{use-active-assistant-id-C-RHQ9f6.js → use-active-assistant-id-ZxDeBTfL.js} +0 -0
  277. /package/dist/assets/{use-is-mobile-Cy10kl9u.js → use-is-mobile-jACt_z2d.js} +0 -0
  278. /package/dist/assets/{user-plus-C0OyQU83.js → user-plus-COoYKnWs.js} +0 -0
  279. /package/dist/assets/{workflow-status-DmbjJPT4.js → workflow-status-BuGeg_Pe.js} +0 -0
  280. /package/dist/assets/{x-KVxA2ZL0.js → x-DxL-bCuT.js} +0 -0
  281. /package/dist/assets/{xterm-MKaw0cT7.js → xterm-B8LaLTHh.js} +0 -0
  282. /package/dist/assets/{xterm-addon-fit-BFDQtfbG.js → xterm-addon-fit--RE59D-m.js} +0 -0
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Hr1Yo2kx.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-D7s2Q_uG.js";import{d as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./card-BibIM9x3.js";import"./src-CK6bncSg.js";import{t as l}from"./tag-B_-QAvJF.js";import{t as u}from"./createLucideIcon-BlMXrA59.js";import{t as d}from"./arrow-left-CP-EhDNF.js";import{t as f}from"./external-link-DPAtkBJ2.js";import{t as p}from"./file-text-CmK9LY1p.js";import{t as m}from"./globe-DYF_lSGm.js";import{t as h}from"./loader-circle-IIzBGiwm.js";import{Un as g}from"./sdk.gen-1aYqVbMj.js";import{Kt as _,mt as v,pt as y}from"./react-query.gen-CQLyoqYk.js";import{n as b,r as x,t as S}from"./api-errors-CveHbhgb.js";import{a as C}from"./routes-DVqkwUEe.js";import{$r as w,Di as T,Ir as E,L as D,Lr as O,Pr as k,R as A,ia as j}from"./index-PRnvH2Y1.js";import{i as M,n as N,r as P,t as F}from"./file-editor-BNkJJbUv.js";var I=u(`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`}]]),L=e(n(),1),R=s();function z({skill:e,className:t,fallback:n=`🧩`}){let[r,i]=(0,L.useState)(!1);return e.icon&&!r?(0,R.jsx)(`img`,{src:`/assistant/skills/${e.id}/${e.icon}`,alt:``,className:`${t} object-contain`,onError:()=>i(!0)}):(0,R.jsx)(`span`,{className:t,children:e.emoji??n})}var B={vellum:{label:`Vellum`,icon:I},clawhub:{label:`Clawhub`,icon:m},skillssh:{label:`skills.sh`,icon:O},custom:{label:`Custom`,icon:k}};function V({origin:e}){let t=e in B?B[e]:{label:e.replace(/-/g,` `),icon:w};return(0,R.jsx)(l,{tone:`neutral`,leftIcon:(0,L.createElement)(t.icon),className:`capitalize`,children:t.label})}function H(e){return e.kind===`installed`||e.kind===`bundled`}function U(e){return e.kind===`catalog`}function W(e){return e.kind===`installed`}function G({assistantId:e,skill:t,onBack:n,onInstall:i,onRemove:a,isInstalling:s=!1,isRemoving:l=!1}){let[u,f]=(0,L.useState)(null),m=U(t),g=W(t),_=o({...v({path:{assistant_id:e,id:t.id}}),select:e=>e??null}),b=(0,L.useMemo)(()=>_.data?.files??[],[_.data]),x=(0,L.useMemo)(()=>b.find(e=>e.name===`SKILL.md`),[b]),S=u??x?.path??null,C=o({...y({path:{assistant_id:e,id:t.id},query:{path:S??``}}),select:e=>e??null,enabled:!!S}),w=b.find(e=>e.path===S);return(0,R.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] flex-col`,children:[(0,R.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,R.jsx)(r,{type:`button`,variant:`ghost`,iconOnly:(0,R.jsx)(d,{"aria-hidden":!0}),"aria-label":`Back to skills`,onClick:n}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,R.jsx)(z,{skill:t,className:`h-8 w-8 text-3xl`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,R.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t.name}),(0,R.jsx)(V,{origin:t.origin})]}),(0,R.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description})]})]}),m?s?(0,R.jsx)(`div`,{className:`flex h-9 items-center px-3`,children:(0,R.jsx)(h,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):(0,R.jsx)(r,{type:`button`,onClick:i,disabled:!i,leftIcon:(0,R.jsx)(j,{"aria-hidden":!0}),children:`Install`}):(0,R.jsx)(r,{type:`button`,variant:g?`dangerOutline`:`outlined`,onClick:a,disabled:!g||l||!a,leftIcon:l?(0,R.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,R.jsx)(E,{"aria-hidden":!0}),children:`Remove`})]})]}),(0,R.jsx)(c.Root,{asChild:!0,noPadding:!0,children:(0,R.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden sm:grid`,style:{gridTemplateColumns:`240px 1fr`},children:[(0,R.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto border-b p-2 sm:max-h-none sm:border-b-0 sm:border-r`,style:{borderColor:`var(--border-base)`},children:_.isLoading?(0,R.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,R.jsx)(h,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):b.length===0?(0,R.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files available.`}):b.map(e=>{let t=S===e.path,n=(e.mimeType??``).endsWith(`/directory`);return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>f(e.path),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:t?`var(--primary-base)`:`var(--content-default)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:void 0},children:[n?(0,R.jsx)(T,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-mid-strong)`}}):(0,R.jsx)(p,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:C.isLoading?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,R.jsx)(h,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):w?(0,R.jsx)(K,{assistantId:e,skillId:t.id,fileName:w.name,filePath:w.path,content:C.data?.content??null,isBinary:!!C.data?.isBinary,editable:t.kind===`installed`},`${t.id}/${w.path}`):(0,R.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]})}function K({assistantId:e,skillId:n,fileName:o,filePath:s,content:c,isBinary:l,editable:u}){let d=i(),p=a(),[m,h]=(0,L.useState)(!1),[g,v]=(0,L.useState)(``),y=`skills/${n}/${s}`,b=_({onSuccess:()=>{h(!1),v(``),p.invalidateQueries({queryKey:[{_id:`skillsByIdFilesContentGet`}]}),p.invalidateQueries({queryKey:[{_id:`skillsByIdFilesGet`}]}),s===`SKILL.md`&&p.invalidateQueries({queryKey:[{_id:`skillsGet`}]})},onError:e=>{t(e,{context:`skill-file-save`,bestEffort:!0})}}),x=m&&g!==(c??``),S=(0,L.useCallback)(()=>{!x||b.isPending||b.mutate({path:{assistant_id:e},body:{path:y,content:g,encoding:`utf8`}})},[x,b,e,y,g]),w=(0,L.useCallback)(()=>{h(!0),v(c??``),b.reset()},[c,b]),T=(0,L.useCallback)(()=>{h(!1),v(``),b.reset()},[b]);if(l)return(0,R.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`});if(c===null)return(0,R.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,o,`.`]});let E=u?(0,R.jsx)(r,{variant:`ghost`,size:`regular`,iconOnly:(0,R.jsx)(f,{"aria-hidden":!0}),onClick:()=>d(`${C.workspace}?file=${encodeURIComponent(y)}`),"aria-label":`Open in Workspace`,className:`hover:bg-[var(--surface-base)]`}):void 0;return A(o,void 0)&&!m?(0,R.jsx)(`div`,{className:`relative flex h-full flex-col`,children:(0,R.jsxs)(`div`,{className:`relative flex-1 overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:[(0,R.jsx)(F,{content:c,fileName:o,showEdit:u,isEditing:!1,onToggleEdit:w,extraActions:E}),(0,R.jsx)(D,{content:c})]})}):(0,R.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,R.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,R.jsx)(F,{content:m?g:c,fileName:o,showEdit:u,isEditing:m,onToggleEdit:()=>m?T():w(),extraActions:E}),m?(0,R.jsx)(P,{value:g,onChange:v,onSave:S}):(0,R.jsx)(M,{content:c,readOnly:!u,onStartEdit:w})]}),m&&(0,R.jsx)(N,{isDirty:x,isSaving:b.isPending,error:b.isError?`Save failed`:null,onSave:S,onDiscard:T})]})}async function q(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(b(a,i,`Failed to install skill.`),!a.ok)throw new S(a.status,x(i,a,`Failed to install skill.`));return r??{ok:!0}}export{W as a,I as c,H as i,G as n,V as o,U as r,z as s,q as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{r as t,s as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./capture-error-Hr1Yo2kx.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-D7s2Q_uG.js";import{d as o,h as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{N as c,O as l,S as u,T as d,c as f,n as p}from"./QueryClientProvider-DKhXIxGb.js";import{a as m,c as h,d as g,i as _,l as v,o as y,r as b,s as x,t as S,u as C}from"./useQuery-B45lW1Kk.js";import{t as w}from"./jsx-runtime-CVSDxk6A.js";import{t as T}from"./card-BibIM9x3.js";import{n as E,t as D}from"./panel-item-nGTDevWP.js";import{t as O}from"./confirm-dialog-CfOXCE1N.js";import{t as k}from"./notice-CqRgVmeL.js";import{t as A}from"./popover-CL-JL6vG.js";import{t as j}from"./input-C8kfrq9r.js";import{t as M}from"./toggle-X_kQW5my.js";import{n as N,t as P}from"./list-row-Cw9JYESP.js";import{t as F}from"./modal-D0Q3UWD0.js";import{n as I}from"./toast-2TW5tj1Y.js";import{t as L}from"./createLucideIcon-BlMXrA59.js";import{t as ee}from"./check-D6WkI0gF.js";import{t as R}from"./chevron-right-B6vEpVY0.js";import{t as z}from"./circle-alert-DvNg50UK.js";import{t as B}from"./circle-check-DzlJxj_M.js";import{t as V}from"./external-link-DPAtkBJ2.js";import{t as H}from"./loader-circle-IIzBGiwm.js";import{t as U}from"./log-in-2iOsufxq.js";import{t as W}from"./pencil-DbB9rxpY.js";import{t as te}from"./refresh-cw-Bf6LV0kG.js";import{t as ne}from"./sparkles-BICoewVE.js";import{t as re}from"./x-KVxA2ZL0.js";import{hr as G}from"./sdk.gen-1aYqVbMj.js";import{Bt as ie,J as ae,K as oe,Rt as se,Vt as ce,X as le,Y as ue,Z as de,q as fe,zt as pe}from"./react-query.gen-CQLyoqYk.js";import{r as me}from"./api-errors-CveHbhgb.js";import{L as he,M as ge}from"./auth-store-Kfxhs2oI.js";import{r as _e}from"./api-2kc3MHRz.js";import{a as ve}from"./routes-DVqkwUEe.js";import{n as ye}from"./use-is-mobile-Cy10kl9u.js";import{t as be}from"./assistant-feature-flag-store-Dl92XRsM.js";import{S as xe,b as K,vt as Se,x as Ce,yt as we}from"./react-query.gen-rp6Krcco.js";import{n as Te,t as Ee}from"./browser-CKX_K5ev.js";import{$i as q,Ct as De,Dt as Oe,Et as ke,Ht as Ae,Ir as J,Jr as je,Li as Me,Ot as Ne,St as Pe,Y,an as Fe,bt as Ie,ei as Le,mi as Re,qi as ze,rn as Be,ti as X,wt as Ve,x as He,xi as Ue,xt as We}from"./index-PRnvH2Y1.js";import{t as Ge}from"./use-active-assistant-id-C-RHQ9f6.js";function Ke(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function qe(e,t,n){let r=e.slice(0);return r[t]=n,r}var Je=class extends c{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,f.batch(()=>{let e=this.#i,t=this.#f(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!l(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Ke(e,n).forEach(e=>{e.destroy()}),Ke(n,e).forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#f(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=d(this.#a,t(e))),this.#a}return e}#f(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new g(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#p(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=qe(this.#t,n,t),this.#m())}#m(){if(this.hasListeners()){let e=this.#a,t=this.#u(this.#t,this.#l);e!==this.#d(t,this.#r?.combine)&&f.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Z=e(i(),1);function Ye({queries:e,...t},n){let r=p(n),i=C(),a=v(),o=Z.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{b(e),y(e,a,r.getQueryCache().get(e.queryHash))}),h(a);let[s]=Z.useState(()=>new Je(r,o,t)),[c,l,d]=s.getOptimisticResult(o,t.combine),S=!i&&t.subscribed!==!1;Z.useSyncExternalStore(Z.useCallback(e=>S?s.subscribe(f.batchCalls(e)):u,[s,S]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),Z.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let w=c.some((e,t)=>m(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&m(n,e)?_(n,new g(r,n),a):[]}):[];if(w.length>0)throw Promise.all(w);let T=c.find((e,t)=>{let n=o[t];return n&&x({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(T?.error)throw T.error;return l(d())}var Xe=L(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),Ze=L(`calendar-plus`,[[`path`,{d:`M16 19h6`,key:`xwg31i`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M19 16v6`,key:`tddt3s`}],[`path`,{d:`M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5`,key:`1glfrc`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]);function Qe({assistantId:e,providerKey:t,displayName:n,managedAvailable:r,connectionsQueryKey:i,allConnections:a}){let o=p(),s=ge(),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null),u=(0,Z.useRef)(null),d=(0,Z.useRef)(null),[f,m]=(0,Z.useState)(!1),h=()=>{l.current=null,m(!1)},g=()=>{c.current&&!c.current.closed&&c.current.close(),c.current=null,u.current&&=(clearInterval(u.current),null),d.current&&=(clearTimeout(d.current),null)},_=(0,Z.useCallback)(e=>{if(e.type!==`vellum:oauth-complete`||!l.current||e.requestId!==l.current.requestId)return;let{oauthStatus:t,oauthCode:r}=e;if(g(),h(),t===`connected`)I.success(`${n} account connected.`),o.invalidateQueries({queryKey:i});else{let e=r?`Error: ${r}`:`Authorization failed`;I.error(`${n} ${e}`)}},[i,n,o]),v=(0,Z.useCallback)(async(e,n)=>{if(!r)return!1;for(let r=0;r<8;r+=1){r>0&&await Pe(750);try{if(o.invalidateQueries({queryKey:i}),We(await o.fetchQuery({...K({path:{assistant_id:e}}),staleTime:0}),t,n))return!0}catch{}}return!1},[i,r,t,o]);(0,Z.useEffect)(()=>{let e=e=>{let t=l.current;if(!t)return;let n=De(e,window.location.origin,t.requestId);n&&_(n)},t=e=>{let t=l.current;if(!t)return;let n=Ve(e,t.requestId);n&&(_(n),window.localStorage.removeItem(ke(t.requestId)))};return window.addEventListener(`message`,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(`message`,e),window.removeEventListener(`storage`,t)}},[_]),Ne((0,Z.useCallback)(e=>{let t=l.current;t&&e.requestId===t.requestId&&_({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[_])),(0,Z.useEffect)(()=>Te(()=>{let e=l.current;e&&(async()=>{let t=await v(e.platformAssistantId,e.baselineConnectionSignatures);l.current&&(h(),t&&I.success(`${n} account connected.`))})()}),[v,n]),(0,Z.useEffect)(()=>()=>{u.current&&clearInterval(u.current),d.current&&clearTimeout(d.current),c.current&&!c.current.closed&&c.current.close()},[]);let y=we();return{handleConnect:(i=[])=>{if(!r)return;let f=crypto.randomUUID();m(!0);let p=async r=>{let c;try{c=await he(e)}catch(e){g(),h(),I.error(e instanceof Error?e.message:`Failed to start ${n} authorization.`);return}let u=Ie(await o.fetchQuery({...K({path:{assistant_id:c}}),staleTime:0}).catch(()=>c===e?a??[]:[]),t);l.current={requestId:f,provider:t,platformAssistantId:c,baselineConnectionSignatures:u},y.mutate({path:{assistant_id:c,provider:t},body:{requested_scopes:i,redirect_after_connect:`${ve.account.oauth.popupComplete}?requestId=${f}${s?`&native=1`:``}`}},{onSuccess(e){if(s){Ee(e.connect_url);return}r&&!r.closed?r.location.href=e.connect_url:l.current&&(g(),h(),I.error(`${n} connection failed: popup closed.`))},onError(e){g(),h();let t=me(e,void 0,`Failed to start ${n} authorization.`);I.error(t)}})};if(s){p(null);return}let b=window.open(``,`_blank`,`width=500,height=600`);if(b===null){h(),I.error(`Popup blocked. Please enable popups and try again.`);return}c.current=b,u.current=setInterval(()=>{c.current&&c.current.closed&&l.current&&!d.current&&(d.current=setTimeout(async()=>{d.current=null;let e=l.current;if(!e)return;let t=window.localStorage.getItem(ke(e.requestId));if(t){let n=Oe(t);if(n&&n.requestId===e.requestId){_(n),window.localStorage.removeItem(ke(e.requestId));return}}let r=await v(e.platformAssistantId,e.baselineConnectionSignatures);if(l.current){if(r){g(),h(),I.success(`${n} account connected.`);return}g(),h(),I.error(`${n} connection failed: authorization popup closed.`)}},1e3))},100),p(b)},oauthInProgress:f,startOAuthPending:y.isPending}}var Q=w();function $e({displayName:e,providerKey:t,logoUrl:n,connections:r,connectionsLoading:i,startPending:o,oauthInProgress:s,disconnectingId:c,onConnect:l,onDisconnect:u,connectPresets:d=[]}){let f=o||s;return i?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,Q.jsx)(H,{className:`h-5 w-5 animate-spin text-[var(--content-disabled)]`})}):r.length===0?o||s?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10`,children:[(0,Q.jsx)(Y,{providerKey:t,displayName:e,logoUrl:n,size:48}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(H,{className:`h-3.5 w-3.5 animate-spin`}),`Waiting for authorization...`]})]}):(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10`,children:[(0,Q.jsx)(Y,{providerKey:t,displayName:e,logoUrl:n,size:48}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:`Connect Account to continue`}),(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,Q.jsx)(a,{variant:`primary`,size:`compact`,leftIcon:(0,Q.jsx)(X,{}),onClick:()=>l(),disabled:f,children:`Connect Account`}),d.map(e=>(0,Q.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,Q.jsx)(Ze,{}),onClick:()=>l(e.scopes),disabled:f,children:e.label},e.id))]})]}):(0,Q.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)]`,children:[(0,Q.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(r=>{let i=c===r.id;return(0,Q.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,Q.jsx)(Y,{providerKey:t,displayName:e,logoUrl:n,size:20}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:r.account_label??`${e} Account`}),(0,Q.jsx)(a,{variant:`dangerOutline`,size:`compact`,iconOnly:i?(0,Q.jsx)(H,{className:`animate-spin`}):(0,Q.jsx)(J,{}),onClick:()=>u(r),disabled:i,"aria-label":`Disconnect ${r.account_label??`${e} account`}`})]},r.id)})}),(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-base)] px-4 py-3 dark:border-[var(--border-base)]`,children:f?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(H,{className:`h-3.5 w-3.5 animate-spin`}),`Waiting for authorization...`]}):(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(a,{variant:`primary`,size:`compact`,leftIcon:(0,Q.jsx)(V,{}),onClick:()=>l(),disabled:f,children:`Connect account`}),d.map(e=>(0,Q.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,Q.jsx)(Ze,{}),onClick:()=>l(e.scopes),disabled:f,children:e.label},e.id))]})})]})}function et(e){return e.length>16?`${e.slice(0,12)}…${e.slice(-4)}`:e.length>8?`${e.slice(0,8)}…`:e}function tt(e){try{return new Date(e).toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}catch{return``}}function nt({assistantId:e,providerKey:t,displayName:n,logoUrl:r}){let i=p(),o=S({...ae({path:{assistant_id:e},query:{provider_key:t}}),select:e=>e.apps}),s=S({...le({path:{assistant_id:e,providerKey:t}}),select:e=>e.oauth_callback_url}),c=o.data??[],l=s.data??null,u=Ye({queries:c.map(t=>({...oe({path:{assistant_id:e,appId:t.id}}),select:e=>e.connections}))}),d={};c.forEach((e,t)=>{d[e.id]=u[t]?.data??[]});let f=ue({path:{assistant_id:e},query:{provider_key:t}}),m=ie({onSuccess:()=>{i.invalidateQueries({queryKey:f}),x(``),w(``),y(!1),I.success(`${n} OAuth app added.`)},onError:e=>{I.error(e.message||`Failed to create OAuth app`)}}),h=pe({onSuccess:()=>{i.invalidateQueries({queryKey:f}),I.success(`OAuth app deleted.`)},onError:e=>{I.error(e.message||`Failed to delete OAuth app`)}}),g=se({onSuccess:e=>{`auth_url`in e&&(window.location.href=e.auth_url)},onError:e=>{I.error(e.message||`Failed to start OAuth flow`)}}),_=ce(),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(``),[C,w]=(0,Z.useState)(``),[E,D]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(null),[M,N]=(0,Z.useState)(null),P=m.isPending,F=h.isPending?h.variables?.path?.id??null:null,L=g.isPending?g.variables?.path?.appId??null:null,R=_.isPending?_.variables?.path?.id??null:null,z=()=>{let n=b.trim(),r=C.trim();!n||!r||m.mutate({path:{assistant_id:e},body:{provider_key:t,client_id:n,client_secret:r}})},B=()=>{let t=k;A(null),t&&h.mutate({path:{assistant_id:e,id:t.id}})},U=t=>{g.mutate({path:{assistant_id:e,appId:t.id},body:{callback_transport:`gateway`,scopes:[]}})};return o.isLoading?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,Q.jsx)(H,{className:`h-5 w-5 animate-spin text-[var(--content-disabled)]`})}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[c.length===0||v?(0,Q.jsx)(T.Root,{children:(0,Q.jsxs)(T.Body,{className:`flex flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:c.length===0?`Add your own ${n} OAuth app`:`Add another ${n} OAuth app`}),(0,Q.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-tertiary)]`,children:`Credentials are stored encrypted on the assistant and are never sent to Vellum.`})]}),l?(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Redirect URL`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(j,{type:`text`,value:l,readOnly:!0,fullWidth:!0}),(0,Q.jsx)(a,{type:`button`,variant:`outlined`,size:`compact`,onClick:()=>{navigator.clipboard.writeText(l).then(()=>{D(!0),I.success(`Copied to clipboard!`),setTimeout(()=>D(!1),2e3)})},"aria-label":E?`Copied`:`Copy redirect URL`,iconOnly:E?(0,Q.jsx)(ee,{"aria-hidden":!0}):(0,Q.jsx)(Me,{"aria-hidden":!0})})]}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Add this URL to your OAuth app's redirect settings.`})]}):null,(0,Q.jsx)(j,{label:`Client ID`,type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:`Enter your client ID`,fullWidth:!0}),(0,Q.jsx)(j,{label:`Client Secret`,type:`password`,value:C,onChange:e=>w(e.target.value),placeholder:`Enter your client secret`,fullWidth:!0}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-2 pt-1`,children:[c.length>0?(0,Q.jsx)(a,{type:`button`,variant:`outlined`,size:`compact`,onClick:()=>{y(!1),x(``),w(``)},disabled:P,children:`Cancel`}):null,(0,Q.jsx)(a,{type:`button`,size:`compact`,onClick:z,disabled:P||!b.trim()||!C.trim(),leftIcon:P?(0,Q.jsx)(H,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(X,{"aria-hidden":!0}),children:`Add App`})]})]})}):null,c.map(e=>{let i=d[e.id]??[],o=F===e.id,s=L===e.id;return(0,Q.jsx)(T.Root,{children:(0,Q.jsxs)(T.Body,{className:`flex flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,Q.jsx)(`p`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:et(e.client_id)}),(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Added `,tt(e.created_at)]})]}),(0,Q.jsx)(a,{type:`button`,variant:`dangerOutline`,size:`compact`,onClick:()=>A(e),disabled:o,"aria-label":`Delete OAuth app ${et(e.client_id)}`,iconOnly:o?(0,Q.jsx)(H,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(J,{"aria-hidden":!0})})]}),i.length>0?(0,Q.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)] overflow-hidden rounded-md border border-[var(--border-base)] dark:divide-[var(--border-base)] dark:border-[var(--border-base)]`,children:i.map(i=>{let o=R===i.id;return(0,Q.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-2`,children:[(0,Q.jsx)(Y,{providerKey:t,displayName:n,logoUrl:r,size:18}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-lighter text-[var(--content-default)]`,children:i.account_info??`${n} Account`}),(0,Q.jsx)(a,{type:`button`,variant:`dangerOutline`,size:`compact`,onClick:()=>N({appId:e.id,connection:i}),disabled:o,"aria-label":`Disconnect ${i.account_info??`${n} account`}`,iconOnly:o?(0,Q.jsx)(H,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(J,{"aria-hidden":!0})})]},i.id)})}):null,(0,Q.jsx)(a,{type:`button`,size:`compact`,onClick:()=>U(e),disabled:s,className:`w-full`,leftIcon:s?(0,Q.jsx)(H,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(V,{"aria-hidden":!0}),children:s?`Waiting for authorization...`:`Connect account`})]})},e.id)}),c.length>0&&!v?(0,Q.jsx)(a,{type:`button`,variant:`outlined`,size:`compact`,onClick:()=>y(!0),className:`w-full border-dashed`,leftIcon:(0,Q.jsx)(X,{"aria-hidden":!0}),children:`Add Another App`}):null,(0,Q.jsx)(O,{open:k!==null,title:`Delete OAuth app`,message:k?`Delete OAuth app '${et(k.client_id)}'? This will disconnect all linked accounts.`:``,confirmLabel:`Delete`,destructive:!0,onConfirm:B,onCancel:()=>A(null)}),(0,Q.jsx)(O,{open:M!==null,title:`Disconnect ${n}?`,message:M?`Disconnect ${M.connection.account_info??`${n} Account`}? You can reconnect later.`:``,confirmLabel:`Disconnect`,destructive:!0,onConfirm:()=>{let t=M;N(null),t&&_.mutate({path:{assistant_id:e,id:t.connection.id}},{onSuccess:()=>{let r=fe({path:{assistant_id:e,appId:t.appId}});i.invalidateQueries({queryKey:r}),i.invalidateQueries({queryKey:f}),I.success(`${n} account disconnected.`)},onError:e=>{I.error(e.message||`Failed to disconnect account`)}})},onCancel:()=>N(null)})]})}var rt={};function it(e){return rt[e]??[]}function at({assistantId:e,platformAssistantId:t,providerKey:n,displayName:r,description:i,logoUrl:o,platformGate:s,onClose:c}){let l=p(),u=s===`full`,d=!Be(),[f,m]=(0,Z.useState)(s===`gated`&&d?`your-own`:`managed`);(0,Z.useEffect)(()=>{!d&&f===`your-own`&&m(`managed`)},[d,f]);let[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(null),y=Ce({path:{assistant_id:t}}),{data:b,isLoading:x}=S({...K({path:{assistant_id:t}}),enabled:u}),C=(b??[]).filter(e=>e.provider===n&&e.connected),{handleConnect:w,oauthInProgress:T,startOAuthPending:E}=Qe({assistantId:e,providerKey:n,displayName:r,managedAvailable:u,connectionsQueryKey:y,allConnections:b}),D={path:{assistant_id:t}},k=Se({onSuccess(e,t){I.success(`${r} account disconnected.`);let n=t.path.connection_id;xe(l,D,e=>e?.filter(e=>e.id!==n)),l.invalidateQueries({queryKey:y}),g(null)},onError(e){let t=me(e,void 0,`Failed to disconnect ${r} account.`);I.error(t),g(null)}});(0,Z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&c()};document.addEventListener(`keydown`,e);let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.removeEventListener(`keydown`,e),document.body.style.overflow=t}},[c]);let A=e=>{v(e)},j=()=>{let e=_;v(null),e&&(g(e.id),k.mutate({path:{assistant_id:t,connection_id:e.id}}))},M=i?`Configure ${r} OAuth for ${i}`:`Configure ${r} OAuth`;return(0,Q.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4`,children:[(0,Q.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`integration-modal-title`,className:`flex w-full max-w-[520px] flex-col overflow-hidden rounded-xl bg-white shadow-xl dark:bg-[var(--surface-lift)]`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-[var(--border-base)] px-5 py-4 dark:border-[var(--border-base)]`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(Y,{providerKey:n,displayName:r,logoUrl:o,size:32}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`h2`,{id:`integration-modal-title`,className:`text-title-small text-[var(--content-default)]`,children:[r,` OAuth`]}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:M})]})]}),(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(re,{}),"aria-label":`Close`,onClick:c})]}),(0,Q.jsxs)(`div`,{className:`space-y-4 px-5 py-4`,children:[s!==`gated`&&d&&(0,Q.jsxs)(`div`,{role:`tablist`,"aria-label":`OAuth mode`,className:`flex w-full rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-0.5 dark:border-[var(--border-base)] dark:bg-[var(--surface-base)]/40`,children:[(0,Q.jsx)(ot,{active:f===`managed`,onClick:()=>m(`managed`),children:`Managed`}),(0,Q.jsx)(ot,{active:f===`your-own`,onClick:()=>m(`your-own`),children:`Your Own`})]}),f===`managed`&&s!==`gated`?s===`disabled`?(0,Q.jsx)(He,{children:`Log in to the Vellum platform to manage OAuth connections.`}):(0,Q.jsx)($e,{displayName:r,providerKey:n,logoUrl:o,connections:C,connectionsLoading:x,startPending:E,oauthInProgress:T,disconnectingId:k.isPending?h:null,onConnect:w,onDisconnect:A,connectPresets:it(n)}):d?(0,Q.jsx)(nt,{assistantId:e,providerKey:n,displayName:r,logoUrl:o}):null]}),(0,Q.jsx)(`div`,{className:`flex justify-end border-t border-[var(--border-base)] px-5 py-3 dark:border-[var(--border-base)]`,children:(0,Q.jsx)(a,{variant:`outlined`,size:`compact`,onClick:c,children:`Confirm`})})]}),(0,Q.jsx)(O,{open:_!==null,title:`Disconnect ${r}?`,message:_?`Disconnect ${_.account_label??`${r} Account`}? You can reconnect later.`:``,confirmLabel:`Disconnect`,destructive:!0,onConfirm:j,onCancel:()=>v(null)})]})}function ot({active:e,onClick:t,children:n}){return(0,Q.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e,onClick:t,className:`flex-1 cursor-pointer rounded-[5px] px-3 py-1.5 text-body-medium-default transition-colors ${e?`bg-white text-[var(--content-default)] shadow-sm dark:bg-[var(--surface-lift)] dark:text-[var(--content-default)]`:`text-[var(--content-secondary)] hover:text-[var(--content-default)] dark:text-[var(--content-disabled)] dark:hover:text-[var(--content-default)]`}`,children:n})}function st({platformAssistantId:e,providerKey:t,displayName:n,description:r,logoUrl:i,connection:o,platformGate:s,onConfigure:c}){let l=p(),u=!!o?.connected,[d,f]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(!1),g=ye(),_=Ce({path:{assistant_id:e}}),v={path:{assistant_id:e}},y=Se({onSuccess(e,t){I.success(`${n} account disconnected.`);let r=t.path.connection_id;xe(l,v,e=>e?.filter(e=>e.id!==r)),l.invalidateQueries({queryKey:_})},onError(e){let t=me(e,void 0,`Failed to disconnect ${n} account.`);I.error(t)}}),b=()=>{o?.id&&h(!0)};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(T.Root,{children:(0,Q.jsxs)(T.Body,{padding:`sm`,className:`flex items-center gap-4 px-4`,children:[(0,Q.jsx)(Y,{providerKey:t,displayName:n,logoUrl:i,size:32}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-title-small text-[var(--content-default)]`,children:n}),r&&(0,Q.jsx)(`p`,{className:`truncate text-body-medium-lighter text-[var(--content-tertiary)]`,children:r})]}),u&&s===`full`?(0,Q.jsx)(`div`,{className:`shrink-0`,children:(0,Q.jsx)(ct,{displayName:n,open:d,onOpenChange:f,onEditConnections:()=>{f(!1),c()},onDisable:()=>{f(!1),b()},disablePending:y.isPending,isMobile:g})}):(0,Q.jsx)(a,{variant:`primary`,onClick:c,className:`shrink-0`,children:`Enable`})]})}),(0,Q.jsx)(O,{open:m,title:`Disconnect ${n}?`,message:`Disconnect your ${n} account? You can reconnect it later.`,confirmLabel:`Disconnect`,destructive:!0,onConfirm:()=>{h(!1),o?.id&&y.mutate({path:{assistant_id:e,connection_id:o.id}})},onCancel:()=>h(!1)})]})}function ct({displayName:e,open:t,onOpenChange:n,onEditConnections:r,onDisable:i,disablePending:o,isMobile:s}){return s?(0,Q.jsxs)(E.Root,{open:t,onOpenChange:n,children:[(0,Q.jsx)(E.Trigger,{asChild:!0,children:(0,Q.jsx)(a,{variant:`outlined`,rightIcon:(0,Q.jsx)(q,{}),"aria-haspopup":`menu`,"aria-expanded":t,children:`Configure`})}),(0,Q.jsxs)(E.Content,{children:[(0,Q.jsx)(E.Header,{children:(0,Q.jsx)(E.Title,{children:e})}),(0,Q.jsxs)(E.Body,{children:[(0,Q.jsx)(D,{icon:W,label:`Edit connections`,onSelect:r}),(0,Q.jsx)(D,{icon:o?H:ze,label:`Disable`,onSelect:()=>{o||i()}})]})]})]}):(0,Q.jsxs)(A.Root,{open:t,onOpenChange:n,children:[(0,Q.jsx)(A.Trigger,{asChild:!0,children:(0,Q.jsx)(a,{variant:`outlined`,rightIcon:(0,Q.jsx)(q,{}),"aria-haspopup":`menu`,"aria-expanded":t,children:`Configure`})}),(0,Q.jsxs)(A.Content,{align:`end`,sideOffset:4,role:`menu`,className:`w-56 overflow-hidden p-0`,children:[(0,Q.jsx)(a,{type:`button`,role:`menuitem`,variant:`ghost`,onClick:r,className:`w-full justify-start rounded-none`,leftIcon:(0,Q.jsx)(W,{"aria-hidden":!0}),children:`Edit connections`}),(0,Q.jsx)(a,{type:`button`,role:`menuitem`,variant:`dangerGhost`,onClick:i,disabled:o,className:`w-full justify-start rounded-none`,leftIcon:o?(0,Q.jsx)(H,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(ze,{"aria-hidden":!0}),children:`Disable`})]})]})}var lt=[{value:`none`,label:`None`},{value:`oauth`,label:`OAuth`},{value:`bearer`,label:`Bearer Token`},{value:`api-key`,label:`API Key`}],ut=[{value:`sse`,label:`SSE`},{value:`streamable-http`,label:`Streamable HTTP`},{value:`stdio`,label:`Stdio (command)`}];function dt({open:e,onClose:t,onAdd:n,isPending:r}){let[i,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(`sse`),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(`none`),[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)(`X-API-Key`),[x,S]=(0,Z.useState)(``),C=(0,Z.useCallback)(()=>{o(``),c(`sse`),u(``),f(``),m(``),g(`none`),v(``),b(`X-API-Key`),S(``)},[]),w=(0,Z.useCallback)(()=>{r||(C(),t())},[r,C,t]),T=(0,Z.useCallback)(()=>{let e=i.trim();if(!e)return;let t={name:e,transportType:s};if(s===`stdio`){let e=d.trim();if(!e)return;t.command=e;let n=p.trim();n&&(t.args=n.split(/\s+/))}else{let e=l.trim();if(!e)return;t.url=e,h===`bearer`&&_.trim()?t.headers={Authorization:`Bearer ${_.trim()}`}:h===`api-key`&&y.trim()&&x.trim()?t.headers={[y.trim()]:x.trim()}:h===`oauth`&&(t.autoAuth=!0)}n(t)},[i,s,l,d,p,h,_,y,x,n]),E=s===`stdio`,D=i.trim()&&(E?d.trim():l.trim());return(0,Q.jsx)(F.Root,{open:e,onOpenChange:e=>{e||w()},children:(0,Q.jsxs)(F.Content,{size:`md`,children:[(0,Q.jsxs)(F.Header,{children:[(0,Q.jsx)(F.Title,{icon:Xe,children:`Add MCP Server`}),(0,Q.jsx)(F.Description,{children:`Connect to a Model Context Protocol server to extend available tools.`})]}),(0,Q.jsx)(F.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-name`,children:`Server name`}),(0,Q.jsx)(j,{id:`mcp-name`,type:`text`,value:i,onChange:e=>o(e.target.value),placeholder:`my-server`,fullWidth:!0,autoFocus:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-transport`,children:`Transport`}),(0,Q.jsx)(`select`,{id:`mcp-transport`,value:s,onChange:e=>c(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:ut.map(e=>(0,Q.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),E?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-command`,children:`Command`}),(0,Q.jsx)(j,{id:`mcp-command`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`npx -y @modelcontextprotocol/server-example`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-args`,children:`Arguments (space-separated)`}),(0,Q.jsx)(j,{id:`mcp-args`,type:`text`,value:p,onChange:e=>m(e.target.value),placeholder:`--port 3000`,fullWidth:!0})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-url`,children:`Server URL`}),(0,Q.jsx)(j,{id:`mcp-url`,type:`url`,value:l,onChange:e=>u(e.target.value),placeholder:`https://example.com/mcp`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-auth`,children:`Authentication`}),(0,Q.jsx)(`select`,{id:`mcp-auth`,value:h,onChange:e=>g(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:lt.map(e=>(0,Q.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),h===`oauth`?(0,Q.jsx)(`p`,{className:`rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-3 py-2 text-body-small-default text-[var(--content-tertiary)]`,children:`OAuth credentials will be configured through a browser-based authorization flow after the server is added.`}):null,h===`bearer`?(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-bearer`,children:`Bearer token`}),(0,Q.jsx)(j,{id:`mcp-bearer`,type:`password`,value:_,onChange:e=>v(e.target.value),placeholder:`tok_...`,fullWidth:!0})]}):null,h===`api-key`?(0,Q.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-apikey-header`,children:`Header name`}),(0,Q.jsx)(j,{id:`mcp-apikey-header`,type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`X-API-Key`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-apikey-value`,children:`API key`}),(0,Q.jsx)(j,{id:`mcp-apikey-value`,type:`password`,value:x,onChange:e=>S(e.target.value),placeholder:`sk_...`,fullWidth:!0})]})]}):null]})]})}),(0,Q.jsxs)(F.Footer,{children:[(0,Q.jsx)(a,{variant:`ghost`,onClick:w,disabled:r,children:`Cancel`}),(0,Q.jsx)(a,{variant:`primary`,onClick:T,disabled:!D||r,children:r?`Adding...`:`Add Server`})]})]})})}async function ft(e){let{data:t,response:n}=await G.get({url:`/v1/assistants/{assistant_id}/internal/mcp/list`,path:{assistant_id:e}});if(!n?.ok)throw Error(`Failed to fetch MCP servers: ${n?.status}`);return t}async function pt(e){let{data:t,response:n}=await G.get({url:`/v1/assistants/{assistant_id}/internal/mcp/tools-summary`,path:{assistant_id:e}});if(!n?.ok)throw Error(`Failed to fetch MCP tools summary: ${n?.status}`);return t}async function mt(e,t){let{response:n}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/update`,path:{assistant_id:e},body:t});if(!n?.ok)throw Error(`Failed to update MCP server: ${n?.status}`)}async function ht(e,t){let{response:n}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/add`,path:{assistant_id:e},body:t});if(!n?.ok)throw Error(`Failed to add MCP server: ${n?.status}`)}async function gt(e,t){let{response:n}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/remove`,path:{assistant_id:e},body:{name:t}});if(!n?.ok)throw Error(`Failed to remove MCP server: ${n?.status}`)}async function _t(e,t){let{data:n,response:r}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/auth/start`,path:{assistant_id:e},body:{serverId:t}});if(!r?.ok)throw Error(`Failed to start MCP auth: ${r?.status}`);return n}async function vt(e,t){let{data:n,response:r}=await G.get({url:`/v1/assistants/{assistant_id}/internal/mcp/auth/status/${encodeURIComponent(t)}`,path:{assistant_id:e}});if(!r?.ok)throw Error(`Failed to poll MCP auth status: ${r?.status}`);return n}async function yt(e,t){let{response:n}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/auth/revoke`,path:{assistant_id:e},body:{serverId:t}});if(!n?.ok)throw Error(`Failed to revoke OAuth for ${t}: ${n?.status}`)}async function bt(e){let{response:t}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/reload`,path:{assistant_id:e},body:{}});if(!t?.ok)throw Error(`Failed to reload MCP servers: ${t?.status}`)}var xt={connected:{icon:B,label:`Connected`,className:`text-[var(--system-positive-strong)]`},"needs-auth":{icon:Ue,label:`Needs Auth`,className:`text-[var(--system-warning-strong)]`},disabled:{icon:Le,label:`Disabled`,className:`text-[var(--content-tertiary)]`}},St={icon:z,label:`Error`,className:`text-[var(--system-negative-strong)]`};function Ct({server:e,toolsSummary:t,onToggleEnabled:n,onRemove:r,onConfigure:i,onAuthenticate:o,onRevokeOAuth:s,isUpdating:c,isAuthenticating:l,isRevoking:u}){let[d,f]=(0,Z.useState)(!1),p=xt[e.status]??St,m=p.icon,h=(0,Z.useCallback)(t=>n(e.id,t),[n,e.id]),g=(0,Z.useCallback)(()=>r(e.id),[r,e.id]),_=(0,Z.useCallback)(()=>i(e.id),[i,e.id]),v=(0,Z.useCallback)(()=>o(e.id),[o,e.id]),y=(0,Z.useCallback)(()=>s(e.id),[s,e.id]),b=(0,Z.useCallback)(()=>f(e=>!e),[]);return(0,Q.jsx)(T.Root,{children:(0,Q.jsxs)(T.Body,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e.id}),(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-label-medium-default ${p.className}`,children:[(0,Q.jsx)(m,{className:`h-3.5 w-3.5`}),p.label]}),e.hasOAuth?(0,Q.jsx)(`span`,{className:`rounded-full bg-[var(--surface-lift)] px-2 py-0.5 text-label-small-default text-[var(--content-secondary)]`,children:`OAuth`}):null]}),(0,Q.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(`span`,{children:e.transport.type}),t?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Q.jsxs)(`span`,{children:[t.toolCount,` `,t.toolCount===1?`tool`:`tools`]}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Q.jsxs)(`span`,{children:[`~`,t.estimatedTokens.toLocaleString(),` tokens`]})]}):null]})]})}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c||l?(0,Q.jsx)(H,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}):null,e.status===`needs-auth`&&e.transport.type!==`stdio`&&!e.hasOAuth?(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,leftIcon:(0,Q.jsx)(U,{}),onClick:v,disabled:l,children:l?`Authenticating...`:`Authenticate`}):null,e.hasOAuth?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,leftIcon:(0,Q.jsx)(te,{}),onClick:v,disabled:l,tooltip:`Re-authenticate OAuth`,children:`Re-auth`}),(0,Q.jsx)(a,{variant:`dangerGhost`,size:`compact`,leftIcon:(0,Q.jsx)(Re,{}),onClick:y,disabled:u,tooltip:`Revoke OAuth credentials`,children:u?`Revoking...`:`Revoke`})]}):null,(0,Q.jsx)(M,{checked:e.enabled,onChange:h,disabled:c,"aria-label":`${e.enabled?`Disable`:`Enable`} ${e.id}`}),(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,onClick:_,tooltip:`Configure`,children:`Configure`}),(0,Q.jsx)(a,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(J,{}),onClick:g,tooltip:`Remove server`,"aria-label":`Remove ${e.id}`})]})]}),t&&t.tools.length>0?(0,Q.jsxs)(`div`,{className:`mt-3 border-t border-[var(--border-base)] pt-2`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:b,className:`flex w-full cursor-pointer items-center gap-1 text-body-small-default text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:[d?(0,Q.jsx)(q,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(R,{className:`h-3.5 w-3.5`}),t.toolCount,` registered `,t.toolCount===1?`tool`:`tools`]}),d?(0,Q.jsx)(`div`,{className:`mt-2 max-h-60 overflow-y-auto`,children:t.tools.map(e=>(0,Q.jsx)(P,{title:e.name,subtitle:e.description||void 0,trailing:(0,Q.jsxs)(`span`,{className:`whitespace-nowrap text-body-small-default text-[var(--content-secondary)]`,children:[`~`,e.estimatedTokens.toLocaleString(),` tok`]})},e.name))}):null]}):null]})})}var wt=[{value:`none`,label:`None`},{value:`bearer`,label:`Bearer Token`},{value:`api-key`,label:`API Key`}],Tt=[`low`,`medium`,`high`];function Et({server:e,toolsSummary:t,onClose:n,onSave:r,isPending:i}){let[o,s]=(0,Z.useState)(`medium`),[c,l]=(0,Z.useState)(`none`),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(`X-API-Key`),[m,h]=(0,Z.useState)(``);(0,Z.useEffect)(()=>{e&&(s(e.defaultRiskLevel),l(e.authType),d(``),p(e.authHeaderName??`X-API-Key`),h(``))},[e]);let g=(0,Z.useCallback)(()=>{if(!e)return;let t=c!==e.authType,n=c===`bearer`&&u.trim()!==``,i=c===`api-key`&&f.trim()!==``&&m.trim()!==``,a=t||n||i,s;s=a?c===`none`?null:c===`bearer`&&u.trim()?{Authorization:`Bearer ${u.trim()}`}:c===`api-key`&&f.trim()&&m.trim()?{[f.trim()]:m.trim()}:void 0:void 0,r(e.id,{name:e.id,defaultRiskLevel:o,...s===void 0?{}:{headers:s}})},[e,o,c,u,f,m,r]),_=(0,Z.useCallback)(()=>{i||n()},[i,n]);return e?(0,Q.jsx)(F.Root,{open:!!e,onOpenChange:e=>{e||_()},children:(0,Q.jsxs)(F.Content,{size:`lg`,children:[(0,Q.jsxs)(F.Header,{children:[(0,Q.jsx)(F.Title,{icon:Xe,children:e.id}),(0,Q.jsxs)(F.Description,{children:[e.transport.type,` transport · `,e.status]})]}),(0,Q.jsx)(F.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-risk`,children:`Default risk level`}),(0,Q.jsx)(`select`,{id:`mcp-risk`,value:o,onChange:e=>s(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:Tt.map(e=>(0,Q.jsx)(`option`,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),e.transport.type===`stdio`?null:(0,Q.jsxs)(Q.Fragment,{children:[e.hasOAuth?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-3 py-2`,children:[(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Authentication`}),(0,Q.jsx)(`span`,{className:`rounded-full bg-[var(--surface-lift)] px-2 py-0.5 text-label-small-default text-[var(--content-default)]`,children:`OAuth`}),(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`— managed via OAuth flow`})]}):null,e.hasOAuth?null:(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-auth`,children:`Authentication`}),(0,Q.jsx)(`select`,{id:`mcp-detail-auth`,value:c,onChange:e=>l(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:wt.map(e=>(0,Q.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),c===`bearer`&&!e.hasOAuth?(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-bearer`,children:`Bearer token`}),(0,Q.jsx)(j,{id:`mcp-detail-bearer`,type:`password`,value:u,onChange:e=>d(e.target.value),placeholder:e.hasStaticAuth&&e.authType===`bearer`?`•••••••• (leave blank to keep current)`:`tok_...`,fullWidth:!0})]}):null,c===`api-key`&&!e.hasOAuth?(0,Q.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-apikey-header`,children:`Header name`}),(0,Q.jsx)(j,{id:`mcp-detail-apikey-header`,type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:`X-API-Key`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-apikey-value`,children:`API key`}),(0,Q.jsx)(j,{id:`mcp-detail-apikey-value`,type:`password`,value:m,onChange:e=>h(e.target.value),placeholder:e.hasStaticAuth&&e.authType===`api-key`?`•••••••• (leave blank to keep current)`:`sk_...`,fullWidth:!0})]})]}):null]}),t&&t.tools.length>0?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`h3`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Registered tools (`,t.toolCount,`)`]}),(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Total estimated token overhead: ~`,t.estimatedTokens.toLocaleString(),` tokens`]}),(0,Q.jsx)(`div`,{className:`max-h-64 overflow-y-auto rounded-lg border border-[var(--border-base)]`,children:(0,Q.jsxs)(`table`,{className:`w-full text-body-small-default`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{className:`border-b border-[var(--border-base)] bg-[var(--surface-base)]`,children:[(0,Q.jsx)(`th`,{className:`px-3 py-2 text-left font-medium text-[var(--content-secondary)]`,children:`Tool`}),(0,Q.jsx)(`th`,{className:`px-3 py-2 text-left font-medium text-[var(--content-secondary)]`,children:`Description`}),(0,Q.jsx)(`th`,{className:`px-3 py-2 text-right font-medium text-[var(--content-secondary)]`,children:`Tokens`})]})}),(0,Q.jsx)(`tbody`,{children:t.tools.map(e=>(0,Q.jsxs)(`tr`,{className:`border-b border-[var(--border-base)] last:border-b-0`,children:[(0,Q.jsx)(`td`,{className:`px-3 py-2 font-medium text-[var(--content-default)]`,children:e.name}),(0,Q.jsx)(`td`,{className:`max-w-xs truncate px-3 py-2 text-[var(--content-tertiary)]`,children:e.description||`—`}),(0,Q.jsxs)(`td`,{className:`px-3 py-2 text-right text-[var(--content-tertiary)]`,children:[`~`,e.estimatedTokens.toLocaleString()]})]},e.name))})]})})]}):null]})}),(0,Q.jsxs)(F.Footer,{children:[(0,Q.jsx)(a,{variant:`ghost`,onClick:_,disabled:i,children:`Cancel`}),(0,Q.jsx)(a,{variant:`primary`,onClick:g,disabled:i,children:i?`Saving...`:`Save`})]})]})}):null}var Dt=`mcp-servers`,Ot=`mcp-tools-summary`,kt=`Help me set up an MCP server to extend you with external tools.`;function At(){let e=Ge(),t=p(),n=o(),r=be.use.mcpAddServer(),i=be.use.hasHydrated(),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(null),[d,f]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(new Set),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(null),[D,k]=(0,Z.useState)(null),{data:A,isLoading:j,isError:M}=S({queryKey:[Dt,e],queryFn:()=>ft(e)}),{data:N}=S({queryKey:[Ot,e],queryFn:()=>pt(e)}),P=(0,Z.useCallback)(()=>{t.invalidateQueries({queryKey:[Dt,e]}),t.invalidateQueries({queryKey:[Ot,e]})},[t,e]),F=(0,Z.useMemo)(()=>{let e=new Map;if(N)for(let t of N.servers)e.set(t.serverId,t);return e},[N]),L=(0,Z.useMemo)(()=>!l||!A?null:A.servers.find(e=>e.id===l)??null,[l,A]),ee=(0,Z.useCallback)(async(t,n)=>{h(e=>new Set(e).add(t));try{await mt(e,{name:t,enabled:n}),P()}catch{I.error(`Failed to ${n?`enable`:`disable`} ${t}`)}finally{h(e=>{let n=new Set(e);return n.delete(t),n})}},[e,P]),R=(0,Z.useCallback)(async()=>{if(d){y(!0);try{await gt(e,d),P(),I.success(`Removed ${d}`),f(null)}catch{I.error(`Failed to remove ${d}`)}finally{y(!1)}}},[d,e,P]),z=(0,Z.useCallback)(async t=>{E(t);let n;try{n=await _t(e,t)}catch{I.error(`Failed to start authentication for ${t}`),E(null);return}try{if(n.already_authenticated){I.success(`${t} is already authenticated`),P();return}window.open(n.auth_url,`_blank`,`noopener,noreferrer`);for(let n=0;n<60;n++){await new Promise(e=>setTimeout(e,3e3));let n=await vt(e,t);if(n.status===`complete`){I.success(`${t} authenticated successfully`),P();return}if(n.status===`error`){I.error(n.error??`Authentication failed for ${t}`);return}}I.error(`Authentication timed out for ${t}`)}catch{I.error(`Authentication polling failed for ${t}`)}finally{E(null),P()}},[e,P]),B=(0,Z.useCallback)(async t=>{k(t);try{await yt(e,t),P(),I.success(`OAuth credentials revoked for ${t}`)}catch{I.error(`Failed to revoke OAuth for ${t}`)}finally{k(null)}},[e,P]),V=(0,Z.useCallback)(async t=>{let n=t.autoAuth?window.open(`about:blank`,`_blank`,`noopener`):null;_(!0);try{await ht(e,t),P(),I.success(`Added ${t.name}`),c(!1)}catch{I.error(`Failed to add ${t.name}`),n?.close(),_(!1);return}if(_(!1),t.autoAuth){E(t.name);try{let r=await _t(e,t.name);if(r.already_authenticated){n?.close(),I.success(`${t.name} is already authenticated`),P();return}n?n.location.href=r.auth_url:window.open(r.auth_url,`_blank`,`noopener,noreferrer`);for(let n=0;n<60;n++){await new Promise(e=>setTimeout(e,3e3));let n=await vt(e,t.name);if(n.status===`complete`){I.success(`${t.name} authenticated successfully`),P();return}if(n.status===`error`){I.error(n.error??`Authentication failed for ${t.name}`);return}}I.error(`Authentication timed out for ${t.name}`)}catch{n?.close(),I.error(`Failed to start authentication for ${t.name}`)}finally{E(null),P()}}},[e,P]),U=(0,Z.useCallback)(async(t,n)=>{x(!0);try{await mt(e,n),P(),I.success(`Updated ${t}`),u(null)}catch{I.error(`Failed to update ${t}`)}finally{x(!1)}},[e,P]),W=(0,Z.useCallback)(async()=>{w(!0);try{await bt(e),P(),I.success(`MCP servers reloaded`)}catch{I.error(`Failed to reload MCP servers`)}finally{w(!1)}},[e,P]),ne=(0,Z.useCallback)(()=>{r?c(!0):Ae(n,{prompt:kt})},[r,n]),re=A?.servers??[];return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`text-title-small text-[var(--content-default)]`,children:`MCP Servers`}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Manage Model Context Protocol server connections and their registered tools.`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(te,{className:C?`animate-spin`:``}),onClick:W,disabled:C,tooltip:`Reload all servers`,"aria-label":`Reload MCP servers`}),r?(0,Q.jsx)(a,{variant:`primary`,size:`compact`,leftIcon:(0,Q.jsx)(X,{}),onClick:()=>c(!0),children:`Add Server`}):null]})]}),N?(0,Q.jsxs)(`div`,{className:`flex gap-4 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsxs)(`span`,{children:[N.totalToolCount,` total `,N.totalToolCount===1?`tool`:`tools`]}),(0,Q.jsxs)(`span`,{children:[`~`,N.totalEstimatedTokens.toLocaleString(),` total tokens`]})]}):null,j?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(H,{className:`h-4 w-4 animate-spin`}),(0,Q.jsx)(`span`,{children:`Loading MCP servers...`})]}):M?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Failed to load MCP servers. Check that an assistant is running.`}):re.length===0?(0,Q.jsxs)(`button`,{type:`button`,onClick:ne,disabled:!i,className:`flex w-full flex-col items-center gap-2 rounded-lg border border-dashed border-[var(--border-element)] px-4 py-12 text-center transition-colors hover:border-[var(--border-active)] hover:bg-[var(--surface-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:pointer-events-none`,children:[(0,Q.jsx)(Xe,{className:`h-6 w-6 text-[var(--content-disabled)]`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`No MCP Servers`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:r?`Add an MCP server to extend your assistant with external tools.`:`Chat with your assistant to set up an MCP server.`})]}):(0,Q.jsx)(`div`,{className:`space-y-2`,children:re.map(e=>(0,Q.jsx)(Ct,{server:e,toolsSummary:F.get(e.id),onToggleEnabled:ee,onRemove:f,onConfigure:u,onAuthenticate:z,onRevokeOAuth:B,isUpdating:m.has(e.id),isAuthenticating:T===e.id,isRevoking:D===e.id},e.id))}),r?(0,Q.jsx)(dt,{open:s,onClose:()=>c(!1),onAdd:V,isPending:g}):null,(0,Q.jsx)(Et,{server:L,toolsSummary:l?F.get(l):void 0,onClose:()=>u(null),onSave:U,isPending:b}),(0,Q.jsx)(O,{open:!!d,title:`Remove MCP Server`,message:`Are you sure you want to remove "${d}"? This will disconnect all tools provided by this server.`,confirmLabel:`Remove`,destructive:!0,isPending:v,onConfirm:R,onCancel:()=>f(null)})]})}function jt(){return(0,Q.jsx)(At,{})}function Mt(e,t){let[n,r]=(0,Z.useState)({platformAssistantId:null,isLoading:!1,error:null});return(0,Z.useEffect)(()=>{if(!t||!e){r({platformAssistantId:null,isLoading:!1,error:null});return}let n=!0;return r({platformAssistantId:null,isLoading:!0,error:null}),he(e).then(e=>{n&&r({platformAssistantId:e,isLoading:!1,error:null})}).catch(e=>{n&&r({platformAssistantId:null,isLoading:!1,error:e instanceof Error?e:Error(String(e))})}),()=>{n=!1}},[e,t]),n}var Nt=`vellum:integrations:bannerDismissed`,Pt=[{value:`all`,label:`All`},{value:`enabled`,label:`Enabled`},{value:`not-enabled`,label:`Not Enabled`}];function $(e,t){return e?.find(e=>e.provider===t)??null}function Ft(e){return e===`mcp`?`mcp`:`oauth`}function It(){let[e]=s(),i=o(),a=Fe(),[c,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(!0),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(`all`),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!0),[b,x]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{y(t(Nt,`false`)===`true`)},[]);let C=()=>{y(!0),n(Nt,`true`)};(0,Z.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await _e();e&&t.ok&&l(t.data)}catch(e){r(e,{context:`integrations.getAssistant`})}finally{e&&d(!1)}})(),()=>{e=!1}},[]);let{platformAssistantId:w,isLoading:T}=Mt(c?.id,a===`full`),{data:E,isLoading:D,isError:O}=S({...de({path:{assistant_id:c?.id??``}}),select:e=>e.providers,enabled:!!c}),{data:M,isLoading:N}=S({...K({path:{assistant_id:w??``}}),enabled:!!w&&a===`full`});(0,Z.useEffect)(()=>{let t=e.get(`oauth_status`);if(!t)return;let n=e.get(`oauth_provider`),r=n?n.charAt(0).toUpperCase()+n.slice(1):null;if(t===`connected`)I.success(r?`${r} account connected successfully.`:`Account connected successfully.`);else if(t===`error`){let t=e.get(`oauth_code`)??`unknown`;I.error({denied:`Authorization was denied. Please try again.`,state_invalid:`Authorization state was invalid. Please try again.`,state_expired:`Authorization expired. Please try again.`,exchange_failed:`Failed to complete authorization. Please try again.`,identity_failed:`Failed to verify account identity. Please try again.`}[t]??(r?`Failed to connect ${r}.`:`Failed to connect. Please try again.`))}i(ve.settings.integrations,{replace:!0})},[e,i]);let P=(0,Z.useMemo)(()=>E?.filter(e=>e.supports_managed_mode)??[],[E]),F=(0,Z.useMemo)(()=>{let e=f.trim().toLowerCase(),t=P.filter(t=>{if(!e)return!0;let n=(t.display_name??t.provider_key).toLowerCase(),r=(t.description??``).toLowerCase();return n.includes(e)||r.includes(e)});return m!==`all`&&(t=t.filter(e=>{let t=!!$(M,e.provider_key)?.connected;return m===`enabled`?t:!t})),[...t].sort((e,t)=>{let n=!!$(M,e.provider_key)?.connected;if(n!==!!$(M,t.provider_key)?.connected)return n?-1:1;let r=(e.display_name??e.provider_key).toLowerCase(),i=(t.display_name??t.provider_key).toLowerCase();return r.localeCompare(i)})},[P,M,f,m]),L=u||D||N||T,ee=Pt.find(e=>e.value===m)?.label??`All`,R=(()=>{if(f.trim())return`No integrations matched`;switch(m){case`enabled`:return`No Enabled Integrations`;case`not-enabled`:return`All Integrations Are Enabled`;default:return`No Integrations Available`}})(),z=(()=>{if(f.trim())return`No integrations matched "${f.trim()}"`;switch(m){case`enabled`:return`Connect an integration to get started.`;case`not-enabled`:return`All available integrations have been connected.`;default:return`Check your connection and try again.`}})(),B=(0,Z.useMemo)(()=>b?P.find(e=>e.provider_key===b)??null:null,[P,b]);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[!v&&(0,Q.jsxs)(k,{tone:`info`,icon:(0,Q.jsx)(ne,{className:`h-3.5 w-3.5`}),onDismiss:C,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default`,children:`Tip:`}),` You can enable integrations by mentioning them in chat.`]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(j,{type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:`Search Integrations`,"aria-label":`Search integrations`,leftIcon:(0,Q.jsx)(je,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,wrapperClassName:`flex-1`}),(0,Q.jsxs)(A.Root,{open:g,onOpenChange:_,children:[(0,Q.jsx)(A.Trigger,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":g,className:`flex w-36 cursor-pointer items-center justify-between gap-2 rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] transition-colors hover:bg-[var(--ghost-hover)]`,children:[(0,Q.jsx)(`span`,{children:ee}),(0,Q.jsx)(q,{className:`h-3.5 w-3.5`})]})}),(0,Q.jsx)(A.Content,{align:`end`,sideOffset:4,className:`w-36 overflow-hidden p-0`,children:(0,Q.jsx)(`div`,{role:`listbox`,children:Pt.map(e=>{let t=e.value===m;return(0,Q.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>{h(e.value),_(!1)},className:`flex w-full cursor-pointer items-center px-3 py-1.5 text-left hover:bg-[var(--ghost-hover)] ${t?`text-body-medium-default text-[var(--content-default)]`:`text-body-medium-lighter text-[var(--content-default)]`}`,children:e.label},e.value)})})})]})]}),(0,Q.jsx)(`div`,{children:L?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(H,{className:`h-4 w-4 animate-spin`}),(0,Q.jsx)(`span`,{children:`Loading...`})]}):O?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Failed to load integrations. Please try again.`}):c?F.length===0?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-2 rounded-lg border border-dashed border-[var(--border-element)] px-4 py-12 text-center`,children:[(0,Q.jsx)(je,{className:`h-6 w-6 text-[var(--content-disabled)]`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:R}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:z})]}):(0,Q.jsx)(`div`,{className:`space-y-2`,children:F.map(e=>(0,Q.jsx)(st,{platformAssistantId:w??c.id,providerKey:e.provider_key,displayName:e.display_name??e.provider_key,description:e.description,logoUrl:e.logo_url,connection:$(M,e.provider_key),platformGate:a,onConfigure:()=>x(e.provider_key)},e.provider_key))}):(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No assistant found. Hatch an assistant to connect integrations.`})}),B&&c&&(0,Q.jsx)(at,{assistantId:c.id,platformAssistantId:w??c.id,providerKey:B.provider_key,displayName:B.display_name??B.provider_key,description:B.description,logoUrl:B.logo_url,platformGate:a,onClose:()=>x(null)})]})}function Lt(){let[e,t]=s(),n=Ft(e.get(`tab`));return(0,Q.jsx)(`div`,{className:`space-y-6`,children:(0,Q.jsxs)(N.Root,{value:n,onValueChange:n=>{let r=Ft(n),i=new URLSearchParams(e);r===`mcp`?i.set(`tab`,`mcp`):i.delete(`tab`),t(i,{replace:!0})},children:[(0,Q.jsxs)(N.List,{children:[(0,Q.jsx)(N.Trigger,{value:`oauth`,children:`OAuth`}),(0,Q.jsx)(N.Trigger,{value:`mcp`,children:`MCP`})]}),(0,Q.jsx)(N.Panel,{value:`oauth`,className:`pt-4`,children:(0,Q.jsx)(Z.Suspense,{children:(0,Q.jsx)(It,{})})}),(0,Q.jsx)(N.Panel,{value:`mcp`,className:`pt-4`,children:(0,Q.jsx)(jt,{})})]})})}export{Lt as IntegrationsPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{i as n,n as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./cn-DvW5mxZR.js";import{t as s}from"./typography-BscuIPxA.js";import"./src-CK6bncSg.js";import{a as c}from"./routes-DVqkwUEe.js";import{n as l}from"./use-is-mobile-Cy10kl9u.js";import{t as u}from"./assistant-identity-store-CKjnoLSp.js";import{t as d}from"./assistant-feature-flag-store-Dl92XRsM.js";import{Qt as f}from"./index-PRnvH2Y1.js";import{t as p}from"./page-shell-cEGpH3P5.js";var m=e(t(),1),h=a(),g=[{label:`Identity`,to:c.identity},{label:`Skills`,to:c.skills},{label:`Workspace`,to:c.workspace},{label:`Contacts`,to:c.contacts.root}],_={label:`Plugins`,to:c.plugins};function v(){let e=u.use.name(),t=d.use.hasHydrated(),a=d.use.externalPlugins(),{pathname:c}=i(),v=l(),y=f.use.setTopBarCenter();(0,m.useEffect)(()=>(y(v?(0,h.jsxs)(s,{variant:`body-medium-default`,className:`truncate text-[var(--content-secondary)]`,children:[`About `,e||`Assistant`]}):null),()=>{y(null)}),[v,e,y]);let b=t&&a?[g[0],_,...g.slice(1)]:g;return(0,h.jsxs)(p,{children:[(0,h.jsxs)(`h1`,{className:`mb-4 shrink-0 text-title-large text-[var(--content-default)] max-md:hidden`,children:[`About `,e||`Assistant`]}),(0,h.jsx)(`nav`,{className:`mb-4 flex shrink-0 items-center overflow-x-auto border-b border-[var(--border-base)]`,style:{scrollbarWidth:`none`,WebkitOverflowScrolling:`touch`},"aria-label":`About assistant sections`,children:b.map(({label:e,to:t})=>{let n=c===t||c.startsWith(t+`/`);return(0,h.jsx)(r,{to:t,className:o(`relative -mb-px inline-flex cursor-pointer items-center gap-1.5 border-b-2 border-transparent bg-transparent px-2.5 py-[7px]`,`text-body-medium-default whitespace-nowrap`,`text-[var(--content-secondary)] transition-colors`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-0`,`hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`,n&&`border-[var(--border-active)] text-[var(--primary-active)]`,n&&`hover:bg-transparent`),children:e},t)})}),(0,h.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:(0,h.jsx)(n,{})})]})}export{v as IntelligenceLayout};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,p as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import"./src-CK6bncSg.js";import{n as a}from"./toast-2TW5tj1Y.js";import{t as o}from"./loader-circle-IIzBGiwm.js";import{n as s}from"./sdk.gen-1aYqVbMj.js";import{a as c}from"./routes-DVqkwUEe.js";import{a as l}from"./viewer-store-Dead64xY.js";import{_t as u,dt as d,r as f}from"./index-PRnvH2Y1.js";import{t as p}from"./use-active-assistant-id-C-RHQ9f6.js";var m=e(t(),1),h=i();function g(){let{appId:e}=r(),t=p(),i=n(),[g,_]=(0,m.useState)(null),[v,y]=(0,m.useState)(null),[b,x]=(0,m.useState)(!1),S=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(e)return S.current=e,_(null),y(null),s({path:{assistant_id:t,id:e},throwOnError:!0}).then(({data:n})=>{S.current===e&&(l(t,n.appId,n.html),_({appId:n.appId,dirName:n.dirName,name:n.name,html:n.html}))}).catch(t=>{S.current===e&&y(t instanceof Error?t.message:`Failed to open app`)}),()=>{S.current=null}},[t,e]);let C=(0,m.useCallback)(()=>{i(c.library.root)},[i]),w=f(),T=(0,m.useCallback)(()=>{g&&w(g)},[g,w]),E=(0,m.useCallback)(async()=>{if(!(!g||b)){x(!0);try{await u(t,g.appId,g.name),a.success(`App exported`,{description:`${g.name}.vellum`})}catch(e){a.error(`Failed to share app`,{description:e instanceof Error?e.message:void 0})}finally{x(!1)}}},[t,g,b]);return e?v?(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-4`,children:[(0,h.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:v}),(0,h.jsx)(`button`,{type:`button`,onClick:C,className:`text-body-medium-default text-[var(--primary-base)] underline`,children:`Back to Library`})]}):g?(0,h.jsx)(d,{appId:g.appId,appName:g.name,html:g.html,assistantId:t,onClose:C,onEdit:T,onShare:E,isSharing:b,enableFullscreen:!0}):(0,h.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,h.jsx)(o,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}):null}export{g as LibraryDetailPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{h as r,t as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./cn-DvW5mxZR.js";import"./src-CK6bncSg.js";import{A as s,M as c,j as l}from"./auth-store-Kfxhs2oI.js";import{a as u}from"./routes-DVqkwUEe.js";import{n as d,r as f}from"./login-flow-DPi11n3h.js";import{t as p}from"./public-asset-Fx_laYnf.js";import{X as m,at as h,pi as g}from"./index-PRnvH2Y1.js";var _=e(t(),1),v=a();function y({children:e}){return(0,v.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:[(0,v.jsx)(`img`,{src:p(`/vellum-logo.svg`),alt:`Vellum`,width:220,height:66,className:`block dark:hidden`}),(0,v.jsx)(`img`,{src:p(`/vellum-logo-white.svg`),alt:`Vellum`,width:220,height:66,className:`hidden dark:block`}),e,(0,v.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute left-1/2 w-full max-w-[900px] -translate-x-1/2`,style:{bottom:0},children:(0,v.jsx)(`img`,{src:p(`/login-background-characters.svg`),alt:``,width:880,height:182,className:`h-auto w-full`})})]})}function b(){return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`div`,{className:`pointer-events-none absolute top-[120px] left-1/2 z-0 -translate-x-1/2`,children:(0,v.jsx)(`img`,{src:p(`/vellum-logo-white.svg`),alt:`Vellum`,width:92,height:28})}),(0,v.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-0 bottom-0 left-1/2 z-0 w-full max-w-[1100px] -translate-x-1/2`,children:(0,v.jsx)(`img`,{src:p(`/login-background-characters.svg`),alt:``,width:880,height:182,className:`h-auto w-full`})})]})}var x=`flex w-full max-w-[448px] flex-col gap-6 rounded-lg border border-[var(--border-disabled)] bg-[var(--surface-lift)] p-6`;function S({children:e}){return(0,v.jsx)(`div`,{className:x,children:e})}function C({children:e}){return(0,v.jsx)(`h1`,{className:`text-title-large text-center text-[var(--content-emphasised)]`,children:e})}function w({children:e,className:t}){return(0,v.jsx)(`p`,{className:o(`text-body-small-default text-center text-[var(--system-negative-strong)]`,t),children:e})}function T({children:e}){return(0,v.jsx)(`div`,{className:`dark`,children:(0,v.jsxs)(`div`,{className:`relative min-h-screen overflow-x-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:[(0,v.jsx)(b,{}),(0,v.jsx)(`div`,{className:`relative z-10 flex min-h-screen flex-col items-center justify-center px-4`,children:e})]})})}function E({signUpHref:e}){return(0,v.jsxs)(`p`,{className:`text-body-small-default flex justify-center gap-1`,children:[(0,v.jsx)(`span`,{className:`text-[var(--content-secondary)]`,children:`Don't have an account?`}),(0,v.jsx)(i,{to:e,className:`font-medium text-[var(--content-emphasised)] hover:underline`,children:`Sign up`})]})}function D({returnTo:e,loading:t,errorMessage:r,onProviderClick:i}){let a=e?`${u.account.signup}?returnTo=${encodeURIComponent(e)}`:u.account.signup;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(C,{children:`Sign in to Vellum`}),r&&(0,v.jsx)(w,{children:r}),(0,v.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,v.jsx)(n,{type:`button`,variant:`outlined`,fullWidth:!0,onClick:()=>i(`AppleOAuth`),disabled:t,leftIcon:(0,v.jsx)(h,{}),className:`max-w-[300px] gap-3`,children:`Continue with Apple`}),(0,v.jsx)(n,{type:`button`,variant:`outlined`,fullWidth:!0,onClick:()=>i(`GoogleOAuth`),disabled:t,leftIcon:(0,v.jsx)(m,{}),className:`max-w-[300px] gap-3`,children:`Continue with Google`}),(0,v.jsx)(n,{type:`button`,variant:`outlined`,fullWidth:!0,onClick:()=>i(),disabled:t,leftIcon:(0,v.jsx)(g,{}),className:`max-w-[300px] gap-3`,children:`Continue with Email`})]}),(0,v.jsx)(E,{signUpHref:a})]})}var O={signup_closed:`Sign-ups are currently closed. Visit vellum.ai/community to request access.`};function k({returnTo:e}){let[t,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(!1),o=async()=>{r(null),a(!0);try{await l({returnTo:e??null})}catch(e){let t=e&&typeof e==`object`&&`code`in e?e.code:void 0;if(t===`USER_CANCELLED`){a(!1);return}if(t===`AUTH_ERROR`){let t=e&&typeof e==`object`&&`data`in e&&e.data&&typeof e.data==`object`&&`authError`in e.data&&typeof e.data.authError==`string`?e.data.authError:void 0;r((t&&O[t])??`Something went wrong. Please try again.`)}else console.error(`[native-auth] auth flow failed:`,e),r(`Something went wrong. Please try again.`);a(!1)}};return(0,v.jsx)(y,{children:(0,v.jsxs)(`div`,{className:`z-10 mt-8 flex w-full max-w-[320px] flex-col items-center gap-3`,children:[t&&(0,v.jsx)(w,{className:`max-w-[280px]`,children:t}),(0,v.jsx)(n,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>{o()},disabled:i,className:`max-w-[300px]`,children:`Sign in`})]})})}function A({returnTo:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!1),a=f(e),o=async t=>{n(null),i(!0);try{await s(d,a,{...t?{providerHint:t}:{},returnTo:e})}catch(e){console.error(`[web-login] auth flow failed:`,e),n(`Something went wrong. Please try again.`),i(!1)}};return(0,v.jsx)(T,{children:(0,v.jsx)(S,{children:(0,v.jsx)(D,{returnTo:e,loading:r,errorMessage:t,onProviderClick:e=>{o(e)}})})})}function j(){let[e]=r(),t=c(),n=e.get(`returnTo`);return t?(0,v.jsx)(k,{returnTo:n}):(0,v.jsx)(A,{returnTo:n})}export{j as LoginPage};
@@ -1,13 +0,0 @@
1
- import{t as e}from"./capture-error-Hr1Yo2kx.js";import{en as t,mr as n,nn as r,rn as i,tn as a,u as o,ur as s}from"./sdk.gen-1aYqVbMj.js";import{n as c,r as l}from"./api-errors-CveHbhgb.js";import{t as u}from"./assistant-identity-store-CKjnoLSp.js";import{r as d,t as f}from"./semver-yC_Iq9co.js";import{a as p,s as m}from"./prechat-B28Vzu55.js";import{t as h}from"./effective-timezone-DrYGH2Lb.js";var g=/^\[File attachment\] (.+?), type=([^,\n]+?)(?:, size=([^\n]+))?$/,_=/^([\d.]+)\s*(B|KB|MB|GB)$/;function v(e){let t=_.exec(e.trim());if(!t)return 0;let n=Number.parseFloat(t[1]);if(!Number.isFinite(n))return 0;switch(t[2]){case`B`:return Math.round(n);case`KB`:return Math.round(n*1024);case`MB`:return Math.round(n*1024*1024);case`GB`:return Math.round(n*1024*1024*1024);default:return 0}}function y(e){let t=e.indexOf(`[File attachment] `);if(t<0||!(t===0||e[t-1]===`
2
- `))return{cleanedContent:e,attachments:void 0};let n=t>0&&e[t-1]===`
3
- `?e.slice(0,t-1):e.slice(0,t),r=[];for(let n of e.slice(t).split(`
4
- `)){let e=g.exec(n);if(!e)continue;let[,t,i,a]=e;r.push({id:`rehydrated:${r.length}`,filename:t,mimeType:i,sizeBytes:a?v(a):0,previewUrl:null})}return{cleanedContent:n,attachments:r.length>0?r:void 0}}var b=[`users/guardian.md`,`users/default.md`],x=`## Onboarding Context`;function S(e){let t=[x,``];return e.preferredName&&t.push(`- **Preferred name:** ${e.preferredName}`),e.occupation&&t.push(`- **Role:** ${e.occupation}`),e.commonWork.length>0&&t.push(`- **Common work:** ${e.commonWork.join(`; `)}`),e.dailyTools.length>0&&t.push(`- **Daily tools:** ${e.dailyTools.join(`, `)}`),t.push(``),t.join(`
5
- `)}function C(e,t){let n=e??`# User Profile
6
-
7
- `,r=n.indexOf(x);if(r!==-1){let e=n.indexOf(`
8
- `,r),i=e===-1?``:n.slice(e+1),a=i.match(/^## /m),o=n.slice(0,r),s=a?i.slice(a.index):``;return o+t+s}return n.endsWith(`
9
- `)||(n+=`
10
- `),n.endsWith(`
11
-
12
- `)||(n+=`
13
- `),n+t}async function w(e,t){let{data:n,error:r,response:i}=await s({path:{assistant_id:e},query:{path:t},throwOnError:!1});if(c(i,r,`Failed to fetch onboarding profile file`),i.status===404)return null;if(!i.ok)throw Error(`Failed to fetch onboarding profile file (${i.status})`);if(n?.isBinary)throw Error(`Onboarding profile file is binary`);return typeof n?.content==`string`?n.content:null}async function T(e,t,r){let{error:i,response:a}=await n({path:{assistant_id:e},body:{path:t,content:r},throwOnError:!1});if(c(a,i,`Failed to write onboarding profile file`),!a.ok)throw Error(`Failed to write onboarding profile file (${a.status})`)}async function E(e,t,n){await T(e,t,C(await w(e,t),n))}async function D(e,t){let n=S(m(t));await Promise.allSettled(b.map(t=>E(e,t,n)))}function O(e){return e.map(e=>{let t=null;return e.data?t=`data:${e.mimeType};base64,${e.data}`:e.thumbnailData&&(t=`data:image/jpeg;base64,${e.thumbnailData}`),{id:e.id,filename:e.filename,mimeType:e.mimeType,sizeBytes:e.sizeBytes,previewUrl:t}})}function k(e){return e===`inline`||e===`panel`?e:void 0}function A(e){return{surfaceId:e.surfaceId,surfaceType:e.surfaceType,title:e.title,data:e.data,actions:e.actions,display:k(e.display),completed:e.completed,completionSummary:e.completionSummary,toolCallId:e.toolCallId}}function j(e){return e.map(A)}function M(e){if(typeof e==`number`)return e;if(typeof e==`string`){let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}}function N(e){if(!e||e.length===0)return{segments:void 0,attachments:void 0};let t=[];return{segments:e.map(e=>{let{cleanedContent:n,attachments:r}=y(e);return r&&t.push(...r),n}),attachments:t.length>0?t.map((e,t)=>({...e,id:`rehydrated:${t}`})):void 0}}function P(e){let{segments:t,attachments:n}=N(e.textSegments&&e.textSegments.length>0?e.textSegments:void 0),r=e.attachments&&e.attachments.length>0?O(e.attachments):void 0,i=H(e.contentOrder),a=U(e),o=e.toolCalls&&e.toolCalls.length>0?B(e.toolCalls,e.id):void 0,s=M(e.timestamp),c=e.thinkingSegments&&e.thinkingSegments.length>0?e.thinkingSegments:void 0,l={id:e.id,role:e.role};e.mergedMessageIds?.length&&(l.mergedMessageIds=e.mergedMessageIds),e.clientMessageId&&(l.clientMessageId=e.clientMessageId),e.surfaces&&(l.surfaces=j(e.surfaces)),a&&(l.contentBlocks=a),t&&(l.textSegments=t),i&&(l.contentOrder=i),c&&(l.thinkingSegments=c),e.subagentNotification&&(l.isSubagentNotification=!0),e.slackMessage&&(l.slackMessage=e.slackMessage),o&&(l.toolCalls=o),s!=null&&(l.timestamp=s);let u=r??n;return u&&(l.attachments=u),l}var F=`0.8.6`;function I(){let e=u.getState().version;if(!e)return`conversationKey`;let t=d(e),n=d(F);return!t||!n?`conversationKey`:f({...t,pre:null},n)>=0?`conversationId`:`conversationKey`}var L=1e3,R=12e4;async function z(e,n,r){let i=Date.now()+R;for(;Date.now()<i;){let{data:i,error:a,response:o}=await t({path:{assistant_id:e},query:{conversationId:r},throwOnError:!1});if(c(o,a,`Failed to poll for messages`),!o.ok){let e=l(a,o,`Failed to poll for messages`);throw Error(e)}let s=i?.messages??[],u=s.findIndex(e=>e.id===n);if(u>=0){let e=s.slice(u+1).find(e=>e.role===`assistant`);if(e)return e}await new Promise(e=>setTimeout(e,L))}return null}function B(e,t){return e.map((e,n)=>{let{confirmationDecision:r,...i}=e;return{...i,id:e.id??`tool-history-${t}-${n}`,...r===void 0?{}:{confirmationDecision:r}}})}function V(e){if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e;if(typeof t.type==`string`&&typeof t.id==`string`)return{type:t.type,id:t.id}}if(typeof e==`string`){let t=e.indexOf(`:`);if(t>0)return{type:e.slice(0,t),id:e.slice(t+1)}}return null}function H(e){if(!e||e.length===0)return;let t=[];for(let n of e){let e=V(n);e&&t.push(e)}return t.length>0?t:void 0}function U(e){if(e.contentBlocks!==void 0)return e.contentBlocks;let t=H(e.contentOrder);if(!t)return;let n=[];for(let{type:r,id:i}of t){let t=Number.parseInt(i,10);if(!Number.isNaN(t))switch(r){case`text`:{let r=e.textSegments?.[t];if(r==null)break;let{cleanedContent:i}=y(r);i.trim().length>0&&n.push({type:`text`,text:i});break}case`thinking`:{let r=e.thinkingSegments?.[t];r!=null&&n.push({type:`thinking`,thinking:r});break}case`tool`:case`toolCall`:{let r=e.toolCalls?.[t];r&&n.push({type:`tool_use`,toolCall:{...r,id:r.id??`tool-history-${e.id}-${t}`}});break}case`surface`:{let r=e.surfaces?.[t];r&&n.push({type:`surface`,surface:r});break}case`attachment`:{let r=e.attachments[t];r&&n.push({type:`attachment`,attachment:r});break}}}return n.length>0?n:void 0}async function W(e,n){let{data:r,error:i,response:a}=await t({path:{assistant_id:e},query:{conversationId:n},throwOnError:!1});if(c(a,i,`Failed to fetch conversation messages`),!a.ok)throw Error(`Failed to fetch conversation messages (HTTP ${a.status})`);return r}async function G(e,t){let n=t.name||`attachment`,r=t.type||`application/octet-stream`,{data:i,error:a,response:s}=await o({path:{assistant_id:e},body:{file:t,filename:n,mimeType:r},throwOnError:!1});if(c(s,a,`Failed to upload attachment`),!s.ok){let e=a&&typeof a==`object`&&!Array.isArray(a)?a:{},t=(typeof e.detail==`string`?e.detail:void 0)??(typeof e.error==`string`?e.error:void 0)??`HTTP ${s.status}`;return{ok:!1,status:s.status,error:{detail:t}}}let l=i?.id;return l?{ok:!0,id:l}:{ok:!1,status:422,error:{detail:`Upload response did not include an attachment id.`}}}async function K(t,n,r,i=[],o,s,l){let u={content:r,sourceChannel:`vellum`,interface:`vellum`},d=h();d&&(u.clientTimezone=d);let f=I();(n!==null||f!==`conversationId`)&&(u[f]=n),i.length>0&&(u.attachmentIds=i),s&&(u.clientMessageId=s),l&&(u.inferenceProfile=l);let m=o?p(o):void 0;if(m){let e={tools:m.tools,tasks:m.tasks,tone:m.tone};m.userName!==void 0&&(e.userName=m.userName),m.occupation!==void 0&&(e.occupation=m.occupation),m.assistantName!==void 0&&(e.assistantName=m.assistantName),m.googleConnected!==void 0&&(e.googleConnected=m.googleConnected),m.googleScopes!==void 0&&(e.googleScopes=m.googleScopes),m.priorAssistants!==void 0&&(e.priorAssistants=m.priorAssistants),m.cohort!==void 0&&(e.cohort=m.cohort),m.bootstrapTemplate!==void 0&&(e.bootstrapTemplate=m.bootstrapTemplate),m.initialMessage!==void 0&&m.initialMessage.trim().toLowerCase().replace(/[.!?]+$/,``)!==`wake up, my friend`&&(e.initialMessage=m.initialMessage),m.skills!==void 0&&(e.skills=m.skills),m.title!==void 0&&(e.title=m.title),u.onboarding=e}m&&D(t,m).catch(t=>e(t,{context:`persistPreChatOnboardingProfile`}));let{data:g,error:_,response:v}=await a({path:{assistant_id:t},body:u,throwOnError:!1});if(c(v,_,`Failed to send chat message`),!v.ok){let e=_&&typeof _==`object`&&!Array.isArray(_)?_:{},t=e.error&&typeof e.error==`object`&&!Array.isArray(e.error)?e.error:{};return{ok:!1,status:v.status,error:{code:typeof e.code==`string`?e.code:typeof t.code==`string`?t.code:typeof e.error==`string`?e.error:void 0,detail:(typeof e.detail==`string`?e.detail:void 0)??(typeof e.message==`string`?e.message:void 0)??(typeof t.message==`string`?t.message:void 0)??`HTTP ${v.status}`}}}let y=g;if(!y?.accepted)return{ok:!1,status:422,error:{detail:`Message was not accepted by the assistant.`}};let b=typeof y.conversationId==`string`?y.conversationId:void 0;return b===void 0?{ok:!1,status:422,error:{detail:`Assistant accepted the message but did not return a conversation id.`}}:y.queued?{ok:!0,queued:!0,assistantId:t,conversationId:b,requestId:typeof y.requestId==`string`?y.requestId:void 0}:typeof y.messageId==`string`?{ok:!0,assistantId:t,conversationId:b,messageId:y.messageId}:{ok:!1,status:422,error:{detail:`Message was not accepted by the assistant.`}}}async function q(e,t,n){try{let{response:r}=await i({path:{assistant_id:e,id:n},query:{conversationId:t},throwOnError:!1});return r?.ok??!1}catch{return!1}}async function J(e,t,n){try{let{response:i}=await r({path:{assistant_id:e,id:n},query:{conversationId:t},throwOnError:!1});return i?.ok??!1}catch{return!1}}export{K as a,P as c,z as i,A as l,W as n,q as o,U as r,G as s,J as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{h as a}from"./local-mode-CvrNMtPF.js";import{t as o}from"./circle-alert-DvNg50UK.js";import{t as s}from"./circle-check-DzlJxj_M.js";import{t as c}from"./loader-circle-IIzBGiwm.js";import{a as l,i as u,n as d,o as f,r as p,t as m}from"./return-to-ByvaXBKr.js";import{a as h}from"./routes-DVqkwUEe.js";import{t as g}from"./index-PRnvH2Y1.js";var _=e(t(),1),v=i();function y(e){switch(e.kind){case`starting`:return{title:`Starting pairing`,body:`Creating a code for this browser.`};case`approved`:return{title:`Connected`,body:`Opening your assistant.`};case`expired`:return{title:`Pairing expired`,body:`Start a new web pairing from the local assistant.`};case`error`:return{title:`Pairing failed`,body:e.message};case`polling`:return{title:`Waiting for approval`,body:`Confirm this code on the machine running your assistant.`}}}function b({state:e}){return e.kind===`approved`?(0,v.jsx)(s,{className:`h-5 w-5 text-green-600`,"aria-hidden":!0}):e.kind===`starting`||e.kind===`polling`?(0,v.jsx)(c,{className:`h-5 w-5 animate-spin text-blue-600`,"aria-hidden":!0}):(0,v.jsx)(o,{className:`h-5 w-5 text-red-600`,"aria-hidden":!0})}function x(){let e=r(),t=n(),i=a(),o=(0,_.useMemo)(()=>m(new URLSearchParams(e.search).get(`returnTo`),h.assistant),[e.search]),s=(0,_.useMemo)(()=>f(`${e.pathname}${e.search}${e.hash}`),[e.pathname,e.search,e.hash]),[c,x]=(0,_.useState)(()=>s.deviceCode?{deviceCode:s.deviceCode,userCode:s.userCode}:null),[S,C]=(0,_.useState)(c?{kind:`polling`,expiresAt:null}:{kind:`starting`});if((0,_.useEffect)(()=>{if(!i||c)return;let e=new AbortController;return(async()=>{try{let t=await u(e.signal);x({deviceCode:t.deviceCode,userCode:t.userCode}),C({kind:`polling`,expiresAt:t.expiresAt})}catch{if(e.signal.aborted)return;C({kind:`error`,message:`The assistant could not start pairing. Refresh the page to try again.`})}})(),()=>{e.abort()}},[i,c]),(0,_.useEffect)(()=>{if(!i||!c?.deviceCode)return;let e=new AbortController,n=null,r=async()=>{try{let i=await l(c.deviceCode,e.signal);if(i.status===`pending`){C({kind:`polling`,expiresAt:i.expiresAt||null}),n=setTimeout(()=>void r(),Math.max(1,i.intervalSeconds)*1e3);return}p(i),C({kind:`approved`}),n=setTimeout(()=>t(o,{replace:!0}),250)}catch(t){if(e.signal.aborted)return;if(t instanceof d&&t.status===401){C({kind:`expired`});return}C({kind:`error`,message:`The assistant could not complete pairing. Try starting a new pairing.`})}};return r(),()=>{e.abort(),n&&clearTimeout(n)}},[i,c?.deviceCode,t,o]),!i)return(0,v.jsx)(g,{});let w=y(S);return(0,v.jsx)(`main`,{className:`flex min-h-svh items-center justify-center bg-[var(--background-default)] px-6 py-10 text-[var(--content-primary)]`,children:(0,v.jsxs)(`section`,{className:`w-full max-w-md rounded-lg border border-[var(--border-default)] bg-[var(--background-surface)] p-8 shadow-sm`,children:[(0,v.jsxs)(`div`,{className:`mb-5 flex items-center gap-3`,children:[(0,v.jsx)(b,{state:S}),(0,v.jsx)(`h1`,{className:`text-xl font-semibold`,children:w.title})]}),c?.userCode?(0,v.jsxs)(`div`,{className:`mb-5 rounded-md border border-[var(--border-subtle)] bg-[var(--background-muted)] p-4 text-center`,children:[(0,v.jsx)(`div`,{className:`text-xs font-medium uppercase text-[var(--content-secondary)]`,children:`Pairing code`}),(0,v.jsx)(`div`,{className:`mt-2 font-mono text-3xl font-semibold tracking-[0.18em]`,children:c.userCode})]}):null,(0,v.jsx)(`p`,{className:`text-sm leading-6 text-[var(--content-secondary)]`,children:w.body}),S.kind===`polling`&&S.expiresAt?(0,v.jsxs)(`p`,{className:`mt-4 text-xs text-[var(--content-tertiary)]`,children:[`Expires `,new Date(S.expiresAt).toLocaleTimeString(),`.`]}):null]})})}export{x as RemoteWebPairingPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{O as a,S as o}from"./local-mode-CvrNMtPF.js";import{N as s,V as c,n as l}from"./auth-store-Kfxhs2oI.js";import{c as u}from"./api-2kc3MHRz.js";import{a as d}from"./routes-DVqkwUEe.js";var f=e(t(),1),p=i(),m=`vellum:loopback:state`,h=`vellum:loopback:returnTo`;function g(){let[e]=r(),t=n(),[i,g]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let n=e.get(`state`),r=e.get(`session_token`),i=sessionStorage.getItem(m),f=sessionStorage.getItem(h)||d.assistant;if(sessionStorage.removeItem(m),sessionStorage.removeItem(h),!n||n!==i){g(`Login failed: state mismatch. Please try again.`);return}if(!r){g(`Login failed: no session token received. Please try again.`);return}if(!/^[a-zA-Z0-9]+$/.test(r)){g(`Login failed: invalid session token.`);return}(async()=>{if(!await a(r)){g(`Login failed: couldn't reach the local Vellum server to store the session. Please try again.`);return}await l.getState().initSession(),await s(!0);try{let e=await u();if(e.ok&&e.data.length>0){await o(e.data,c.getState().currentOrganizationId??void 0),t(d.assistant,{replace:!0});return}}catch{}t(f,{replace:!0})})()},[e,t]),i?(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:i}),(0,p.jsx)(`button`,{type:`button`,className:`mt-4 rounded-lg border border-[var(--border-disabled)] px-4 py-2 text-sm hover:bg-[var(--surface-lift)]`,onClick:()=>void t(d.welcome),children:`Back to Welcome`})]})}):(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:`Completing login...`})})}export{g as PlatformLoopbackPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,p as i,r as a,t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./card-BibIM9x3.js";import"./src-CK6bncSg.js";import{t as d}from"./confirm-dialog-CfOXCE1N.js";import{n as f}from"./toast-2TW5tj1Y.js";import{t as p}from"./arrow-left-CP-EhDNF.js";import{t as m}from"./external-link-DPAtkBJ2.js";import{t as h}from"./loader-circle-IIzBGiwm.js";import{t as g}from"./triangle-alert-DKOyShqD.js";import{$ as _,Ht as v,Q as y,Ut as b,Wt as x,it as S,nt as C,tt as w}from"./react-query.gen-CQLyoqYk.js";import{a as T}from"./routes-DVqkwUEe.js";import{t as E}from"./assistant-feature-flag-store-Dl92XRsM.js";import{Fi as D,Ir as O,L as k,Qi as A,ia as j}from"./index-PRnvH2Y1.js";import{t as M}from"./use-active-assistant-id-C-RHQ9f6.js";import{n as N,r as P,t as F}from"./use-plugin-drift-Bj693x0f.js";var I=e(t(),1),L=l();function R(e){return e?e.slice(0,7):`unknown`}function z(){let e=E.use.hasHydrated(),t=E.use.externalPlugins(),l=M(),{name:m}=i(),h=r(),g=s(),[D,O]=(0,I.useState)(!1),[A,j]=(0,I.useState)(!1),P=c({...y({path:{assistant_id:l,name:m??``}}),enabled:!!l&&!!m}),z=P.data?.installed??!1,G=N({assistantId:l,name:m??``,enabled:z}).data,K=(0,I.useCallback)(()=>{g.invalidateQueries({queryKey:C({path:{assistant_id:l}})}),g.invalidateQueries({queryKey:S({path:{assistant_id:l}})}),m&&(g.invalidateQueries({queryKey:_({path:{assistant_id:l,name:m}})}),g.invalidateQueries({queryKey:w({path:{assistant_id:l,name:m}})}))},[l,m,g]),q=x({onSuccess:()=>{K(),f.success(`Installed ${m??`plugin`}`)}}),J=v({onSuccess:()=>{K(),h(T.plugins)}}),Y=b({onSuccess:e=>{K(),f.success(e.outcome===`already-up-to-date`?`${m??`Plugin`} is already up to date`:`Upgraded ${m??`plugin`} to ${R(e.toCommit)}`)}});if(!e)return null;if(!t)return(0,L.jsx)(a,{to:T.identity,replace:!0});if(!m)return(0,L.jsx)(a,{to:T.plugins,replace:!0});let X=()=>{q.mutate({path:{assistant_id:l},body:{name:m}})},Z=()=>{O(!1),J.mutate({path:{assistant_id:l,name:m}})},Q=()=>{Y.mutate({path:{assistant_id:l,name:m},body:{}})},ee=()=>{if(F(G)){j(!0);return}Q()},te=()=>{j(!1),Q()},$=P.data??null;return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,L.jsx)(n,{asChild:!0,variant:`ghost`,children:(0,L.jsx)(o,{to:T.plugins,"aria-label":`Back to plugins`,children:(0,L.jsx)(p,{"aria-hidden":!0})})}),(0,L.jsx)(B,{name:m,plugin:$,drift:G,onInstall:X,onRemove:()=>O(!0),onUpgrade:ee,isInstalling:q.isPending,isRemoving:J.isPending,isUpgrading:Y.isPending})]}),(q.isError||J.isError||Y.isError)&&(0,L.jsx)(W,{message:q.isError?`Failed to install plugin. Please try again.`:J.isError?`Failed to remove plugin. Please try again.`:`Failed to upgrade plugin. Please try again.`}),(0,L.jsx)(u.Root,{asChild:!0,children:(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:P.isLoading?(0,L.jsx)(H,{}):P.isError||!$?(0,L.jsx)(U,{}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(V,{plugin:$}),$.readme?(0,L.jsx)(k,{content:$.readme}):(0,L.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})}),(0,L.jsx)(d,{open:D,title:`Remove plugin`,message:`Remove "${$?.name??m}" from this assistant?`,confirmLabel:`Remove`,destructive:!0,onConfirm:Z,onCancel:()=>O(!1)}),(0,L.jsx)(d,{open:A,title:`Upgrade plugin`,message:`"${$?.name??m}" has local edits that will be overwritten by the upgrade. Continue?`,confirmLabel:`Upgrade anyway`,destructive:!0,onConfirm:te,onCancel:()=>j(!1)})]})}function B({name:e,plugin:t,drift:r,onInstall:i,onRemove:a,onUpgrade:o,isInstalling:s,isRemoving:c,isUpgrading:l}){let u=t?.installed??!1,d=t?.source?.kind===`github`,f=t?.artifact??null,p=r?.status===`update-available`,m=p?`Upgrade ${R(r?.local?.commit??null)} \u2192 ${R(r?.remote?.commit??null)}`:void 0;return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,L.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:d?`📦`:`🧩`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,L.jsx)(`h2`,{className:`truncate text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,L.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,d?(0,L.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-tertiary)`},children:`external`}):null,p?(0,L.jsx)(P,{}):null]}),t?.description?(0,L.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?u?(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[f?(0,L.jsx)(n,{asChild:!0,leftIcon:(0,L.jsx)(D,{"aria-hidden":!0}),children:(0,L.jsx)(`a`,{href:f.url,download:!0,children:f.label??`Download`})}):null,p?(0,L.jsx)(n,{type:`button`,onClick:o,disabled:l,title:m,leftIcon:l?(0,L.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,L.jsx)(A,{"aria-hidden":!0}),children:`Upgrade`}):null,(0,L.jsx)(n,{type:`button`,variant:`dangerOutline`,onClick:a,disabled:c,leftIcon:c?(0,L.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,L.jsx)(O,{"aria-hidden":!0}),children:`Remove`})]}):(0,L.jsx)(n,{type:`button`,onClick:i,disabled:s,leftIcon:s?(0,L.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,L.jsx)(j,{"aria-hidden":!0}),children:`Install`}):null]})}function V({plugin:e}){let t=[{label:`Source`,value:e.source?.kind===`github`?e.source.repo:`Local`,href:(e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null)??void 0}];return e.homepage&&t.push({label:`Homepage`,value:e.homepage,href:e.homepage}),e.license&&t.push({label:`License`,value:e.license}),(0,L.jsx)(`dl`,{className:`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,style:{borderColor:`var(--border-base)`},children:t.map(e=>(0,L.jsxs)(`div`,{className:`contents`,children:[(0,L.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,L.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,L.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 underline`,style:{color:`var(--primary-base, #60a5fa)`},children:[e.value,(0,L.jsx)(m,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function H(){return(0,L.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,L.jsx)(h,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function U(){return(0,L.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,L.jsx)(g,{className:`h-6 w-6`,"aria-hidden":!0}),(0,L.jsx)(`p`,{className:`text-body-medium-default`,children:`We couldn't load this plugin.`}),(0,L.jsx)(`p`,{className:`text-body-small-default`,children:`It may not exist, or your assistant may be on an older build.`})]})}function W({message:e}){return(0,L.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,L.jsx)(g,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),e]})}export{z as PluginDetailPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n,t as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./card-BibIM9x3.js";import"./src-CK6bncSg.js";import{t as s}from"./input-C8kfrq9r.js";import{t as c}from"./chevron-right-B6vEpVY0.js";import{t as l}from"./loader-circle-IIzBGiwm.js";import{t as u}from"./triangle-alert-DKOyShqD.js";import{bn as d}from"./sdk.gen-1aYqVbMj.js";import{nt as f,rt as p}from"./react-query.gen-CQLyoqYk.js";import{a as m}from"./routes-DVqkwUEe.js";import{t as h}from"./assistant-feature-flag-store-Dl92XRsM.js";import{$r as g,Jr as _}from"./index-PRnvH2Y1.js";import{t as v}from"./use-active-assistant-id-C-RHQ9f6.js";import{n as y,r as b}from"./use-plugin-drift-Bj693x0f.js";var x=e(t(),1),S=a();function C({match:e}){return(0,S.jsx)(o.Root,{asChild:!0,children:(0,S.jsxs)(r,{to:m.plugin(e.name),className:`group flex cursor-pointer items-center gap-4 px-5 py-4 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,S.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:`📦`}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,S.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.name})}),e.description&&(0,S.jsx)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.description}),(0,S.jsx)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},title:e.path,children:e.path})]}),(0,S.jsx)(c,{className:`h-5 w-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})})}function w({plugin:e,assistantId:t}){let n=y({assistantId:t,name:e.name}).data?.status===`update-available`;return(0,S.jsx)(o.Root,{asChild:!0,children:(0,S.jsxs)(r,{to:m.plugin(e.name),className:`group flex cursor-pointer items-center gap-4 px-5 py-4 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,S.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:`🧩`}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.name}),e.version?(0,S.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,e.version]}):null,n?(0,S.jsx)(b,{}):null]}),(0,S.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:e.description??`No description provided.`}),e.issues&&e.issues.length>0?(0,S.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:e.issues.join(`; `),children:[e.issues[0],e.issues.length>1?` (+${e.issues.length-1} more)`:``]}):null]}),(0,S.jsx)(c,{className:`h-5 w-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})})}var T=300*1e3;function E(e,...t){return e?t.some(t=>t?.toLowerCase().includes(e)):!0}function D({assistantId:e}){let[t,n]=(0,x.useState)(``),r=t.trim().toLowerCase(),a=i({queryKey:f({path:{assistant_id:e},query:{q:void 0}}),queryFn:async({signal:t})=>{let n=await d({path:{assistant_id:e},query:{q:void 0},signal:t,throwOnError:!1});if(n.response?.status===404)return{plugins:[]};if(!n.response?.ok)throw Error(`Failed to load plugins`);return n.data??{plugins:[]}},enabled:!!e,staleTime:T}),o=i({...p({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e,staleTime:T}),s=(0,x.useMemo)(()=>O(a.data?.plugins??[]),[a.data?.plugins]),c=(0,x.useMemo)(()=>new Set(s.map(e=>e.name)),[s]),l=(0,x.useMemo)(()=>s.filter(e=>E(r,e.name,e.description)),[s,r]),u=(0,x.useMemo)(()=>(o.data?.matches??[]).filter(e=>!c.has(e.name)&&E(r,e.name,e.description)),[o.data?.matches,c,r]),m=a.isFetching&&!a.isLoading||o.isFetching&&!o.isLoading,h=a.isLoading,g=o.isLoading,_=!h&&!a.isError&&l.length===0,v=!g&&u.length===0;return(0,S.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[(0,S.jsx)(k,{search:t,onSearchChange:n,isSearching:m}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:[(0,S.jsx)(A,{title:`Installed`}),h?(0,S.jsx)(j,{}):a.isError?(0,S.jsx)(P,{}):_?(0,S.jsx)(M,{hasQuery:!!r}):(0,S.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.map(t=>(0,S.jsx)(`li`,{children:(0,S.jsx)(w,{plugin:t,assistantId:e})},t.id))}),(0,S.jsx)(`div`,{className:`mt-6`}),(0,S.jsx)(A,{title:`Available to install`}),g?(0,S.jsx)(j,{}):o.isError?(0,S.jsx)(F,{}):v?(0,S.jsx)(N,{hasQuery:!!r}):(0,S.jsx)(`ul`,{className:`flex flex-col gap-2`,children:u.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsx)(C,{match:e})},e.path))})]})]})}function O(e){return[...e].sort((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:`base`}))}function k({search:e,onSearchChange:t,isSearching:n}){return(0,S.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,S.jsx)(s,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search Plugins`,"aria-label":`Search Plugins`,leftIcon:(0,S.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:n?(0,S.jsx)(l,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`})})}function A({title:e}){return(0,S.jsx)(`h3`,{className:`mb-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e})}function j(){return(0,S.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,S.jsx)(l,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function M({hasQuery:e}){let t=e?`No installed plugins match`:`No Plugins Installed`,n=e?`Try a different search term, or browse the catalog below.`:`Install a plugin with the CLI, or browse the catalog below.`,r=e?_:g;return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(r,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:t}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n})]})})}function N({hasQuery:e}){let t=e?`No catalog entries match`:`Catalog is empty`,n=e?`Try a different search term, or remove the filter to browse everything.`:`No plugins are currently published in the catalog.`;return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(_,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:t}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n})]})})}function P(){return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(u,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load plugins`}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function F(){return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(g,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Couldn't load catalog`}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Catalog browsing is temporarily unavailable. Installed plugins are still listed above.`})]})})}function I(){let e=h.use.hasHydrated(),t=h.use.externalPlugins(),r=v();return e?t?(0,S.jsx)(D,{assistantId:r}):(0,S.jsx)(n,{to:m.identity,replace:!0}):null}export{I as PluginsPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./card-BibIM9x3.js";import{t as l}from"./input-C8kfrq9r.js";import{c as u,f as d,o as f}from"./local-mode-CvrNMtPF.js";import{t as p}from"./is-electron-C_ZTVhv8.js";import{n as m}from"./resolved-assistants-store-Cp4J43BK.js";import{t as h}from"./check-D6WkI0gF.js";import{t as g}from"./chevron-left-DghyKSEE.js";import{t as _}from"./loader-circle-IIzBGiwm.js";import{t as v}from"./pencil-DbB9rxpY.js";import{t as y}from"./x-KVxA2ZL0.js";import{$ as b,L as ee,M as te,Q as x,a as S,n as C,o as w}from"./auth-store-Kfxhs2oI.js";import{t as T}from"./client.gen-Cs6pCK0s.js";import{a as E}from"./routes-DVqkwUEe.js";import{o as D,r as O}from"./prefs-C_oq5G87.js";import{t as k}from"./client-feature-flag-store-C1kdd1EO.js";import{b as ne,r as A,yt as re}from"./react-query.gen-rp6Krcco.js";import{c as j,l as ie,n as ae,t as M}from"./prechat-B28Vzu55.js";import{n as oe,t as N}from"./browser-CKX_K5ev.js";import{t as P}from"./public-asset-Fx_laYnf.js";import{Ct as F,Et as I,J as L,Ni as se,Ot as ce,Tt as le,c as ue,d as de,kt as R,l as fe,q as z,s as pe,wt as B}from"./index-PRnvH2Y1.js";import{c as me,i as he,n as V,o as ge,r as _e,s as ve,t as H}from"./step-indicator-dots-CEVbsP8r.js";import{n as U,r as ye}from"./prechat-names-CRduluk-.js";var W=e(t(),1);async function be(){try{let{data:e,response:t}=await T.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var G=s(),xe=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function Se({onComplete:e}){function t(){fe(),pe(),e()}return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,G.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,G.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,G.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,G.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,G.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,G.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,G.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,G.jsx)(`ul`,{className:`space-y-4`,children:xe.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,G.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,G.jsx)(h,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,G.jsxs)(`span`,{className:`text-left`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,G.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var K=`google`,Ce=[{id:`gmail`,label:`Gmail`,logoSrc:P(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:P(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:P(`/images/integrations/google-drive.svg`)}];function we({assistantId:e,assistantName:t,onConnect:r,onSkip:i,onBack:o}){let s=p(),c=a(),l=te(),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)(null),m=(0,W.useRef)(null),h=(0,W.useRef)(null),v=(0,W.useRef)(null),y=(0,W.useRef)(null),[b,x]=(0,W.useState)(!1),S=(0,W.useCallback)(()=>{d.current=null,x(!1)},[]),C=(0,W.useCallback)(()=>{h.current&&=(window.removeEventListener(`message`,h.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),w=(0,W.useCallback)(()=>{u.current&&!u.current.closed&&u.current.close(),u.current=null,f.current&&=(clearInterval(f.current),null),m.current&&=(clearTimeout(m.current),null)},[]),T=re();(0,W.useEffect)(()=>()=>{f.current&&clearInterval(f.current),m.current&&clearTimeout(m.current),u.current&&!u.current.closed&&u.current.close(),h.current&&window.removeEventListener(`message`,h.current),v.current&&window.removeEventListener(`storage`,v.current),y.current&&=(y.current(),null)},[]);let D=(0,W.useCallback)(async e=>{try{return(await c.fetchQuery({...ne({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===K&&e.connected)??null}catch{return null}},[c]),O=(0,W.useCallback)(async()=>{let e=d.current?.platformAssistantId;w(),S(),r((e?await D(e):null)?.scopes_granted??[])},[S,w,D,r]),k=(0,W.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!d.current||e.requestId!==d.current.requestId||(e.oauthStatus===`connected`?O():(w(),S())))},[S,w,O]),A=(0,W.useCallback)(e=>{let t=d.current;if(!t)return;let n=F(e,window.location.origin,t.requestId);n&&k(n)},[k]),j=(0,W.useCallback)(e=>{let t=d.current;if(!t)return;let n=B(e,t.requestId);n&&(k(n),window.localStorage.removeItem(I(t.requestId)))},[k]);ce((0,W.useCallback)(e=>{let t=d.current;t&&e.requestId===t.requestId&&k({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[k]));let ie=(0,W.useCallback)(()=>{let t=crypto.randomUUID();if(C(),h.current=A,v.current=j,l){x(!0),(async()=>{let n;try{n=await ee(e)}catch{S();return}d.current={requestId:t,platformAssistantId:n},T.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${E.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){N(e.connect_url)},onError(){S()}})})(),window.addEventListener(`message`,A),window.addEventListener(`storage`,j),y.current&&y.current();let n=oe(()=>{let e=d.current;if(!e){n(),y.current=null;return}(async()=>{let t=await D(e.platformAssistantId);d.current&&(t?await O():S(),C(),n(),y.current=null)})()});y.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){C();return}u.current=n,x(!0),window.addEventListener(`message`,A),window.addEventListener(`storage`,j),f.current=setInterval(()=>{u.current&&u.current.closed&&d.current&&!m.current&&(m.current=setTimeout(async()=>{m.current=null;let e=d.current;if(!e)return;let t=window.localStorage.getItem(I(e.requestId));if(t)try{let n=JSON.parse(t);if(le(n,e.requestId)){k(n),window.localStorage.removeItem(I(e.requestId)),C();return}}catch{}let n=await D(e.platformAssistantId);d.current&&(n?await O():(w(),S()),C())},1e3))},100),(async()=>{let n;try{n=await ee(e)}catch{w(),S(),C();return}d.current={requestId:t,platformAssistantId:n},T.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${E.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){u.current&&!u.current.closed?u.current.location.href=e.connect_url:d.current&&(w(),S(),C())},onError(){w(),S(),C()}})})()},[e,S,w,D,k,A,j,O,l,C,T]),ae=t||`your assistant`,M=t||`Your assistant`;return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${s?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${s?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${ae} can use Gmail, Calendar, and Drive with your permission.`}),(0,G.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:Ce.map(e=>(0,G.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,G.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,G.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${M} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,G.jsxs)(`div`,{className:`${s?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:ie,disabled:b||T.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:b||T.isPending?(0,G.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,G.jsx)(_,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,disabled:b||T.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function Te({userName:e,assistantName:t,selectedGroupId:r,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:u,onSkip:d}){let f=p();return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,G.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>o(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:U.map(e=>(0,G.jsx)(Ee,{group:e,isActive:r===e.id,onToggle:()=>s(r===e.id?null:e.id)},e.id))})]})]}),(0,G.jsxs)(`div`,{className:`${f?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:d,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function Ee({group:e,isActive:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,G.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function De({userName:e,assistantName:t,displayedAssistantNames:r,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:u,totalSteps:d}){return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[o?(0,G.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(g,{}),onClick:o,"aria-label":`Back`}):(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(H,{current:u,total:d})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var Oe=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:P(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:P(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:P(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:P(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:P(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:P(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:P(`/images/prior-assistants/copilot.svg`)}];function ke({selectedAssistants:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,W.useState)(()=>q(e)),[d,f]=(0,W.useState)(()=>s.length>0),m=(0,W.useRef)(J(e));(0,W.useEffect)(()=>{let t=J(e);if(t===m.current)return;let n=q(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}Ae(n,e)||(m.current=J(n),t(n))},[s]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},_=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,G.jsxs)(`div`,{className:`${o?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Oe.map(t=>(0,G.jsx)(je,{assistant:t,selected:e.has(t.id),onToggle:()=>h(t.id)},t.id)),d?null:(0,G.jsx)(Me,{onClick:()=>f(!0)})]}),d?(0,G.jsx)(c,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(v,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(y,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(l,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple assistants with commas`,fullWidth:!0}),_.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function Ae(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function q(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function J(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function je({assistant:e,selected:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(Ne,{assistant:e,size:32}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(h,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Me({onClick:e}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(se,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ne({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Pe({selectedTasks:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),s=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,G.jsx)(`div`,{className:`${o?`mt-6`:`mt-8`} flex w-full flex-col ${o?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:z.map(t=>{let n=L[t.iconKey],r=e.has(t.id);return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${o?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,G.jsx)(n,{className:`h-4 w-4`}):null}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,G.jsx)(h,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Fe=new Set([`gmail`,`google-calendar`,`google-drive`]),Ie=[{id:`gmail`,label:`Gmail`,logoSrc:P(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:P(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:P(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:P(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:P(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:P(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:P(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:P(`/images/integrations/github.svg`),logoSrcDark:P(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:P(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:P(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:P(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:P(`/images/integrations/apple-notes.svg`)}];function Le(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function Re({selectedTools:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,W.useState)(()=>Y(e)),[d,f]=(0,W.useState)(()=>s.length>0),m=(0,W.useRef)(X(e));(0,W.useEffect)(()=>{let t=X(e);if(t===m.current)return;let n=Y(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}ze(n,e)||(m.current=X(n),t(n))},[s]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},_=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${r?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[r?(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),r?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,G.jsxs)(`div`,{className:`grid w-full gap-2 ${o?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Ie.map(t=>(0,G.jsx)(Z,{tool:t,selected:e.has(t.id),onToggle:()=>h(t.id),electron:o},t.id)),d?null:(0,G.jsx)(Q,{onClick:()=>f(!0),electron:o})]}),d?(0,G.jsx)(c,{padding:o?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col ${o?`gap-2`:`gap-3`}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(v,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(y,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(l,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple tools with commas`,fullWidth:!0}),_.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function ze(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function X(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Z({tool:e,selected:t,onToggle:n,electron:r}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)($,{tool:e,size:32}),(0,G.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(h,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Q({onClick:e,electron:t}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(se,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function $({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Be({selectedGroupId:e,onGroupChange:t,onBack:r,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(g,{}),onClick:r,"aria-label":`Back`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(H,{current:o,total:s})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,G.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,G.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:U.map(n=>{let r=e===n.id;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,G.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,G.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function Ve(e){let[t,n]=(0,W.useState)(()=>(e??``).trim()),r=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,W.useCallback)(e=>{r.current=!0,n(e)},[])}}var He=[`gmail`,`google-calendar`,`google-drive`],Ue=`experiment-activation-flow-2026-06-03`,We=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ge(e,t,n){return t?.initialMessage?t.initialMessage:n?ae(e):M}function Ke(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:t===`paredDown`?{tools:r?[...He]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:Le([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=Ue,i.bootstrapTemplate=We);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),t===`paredDown`?r&&(i.googleScopes=e.connectedScopes):t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Le([...e.selectedPriorAssistants])),i.initialMessage=Ge(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function qe(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Je(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:V.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:V.controlWorkType,enabled:!t},{id:`tools`,funnelStep:V.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:V.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?V.gmailConnect:V.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:V.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Ye(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Xe=`1`;function Ze(e){return e===`nativeVibe`||e===Xe?`nativeVibe`:null}function Qe(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function et(){let e=r(),t=te(),n=D()&&O();return(0,W.useEffect)(()=>{!n&&!t&&e(E.onboarding.privacy,{replace:!0})},[n,t,e]),t||n}function tt(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,W.useState)(()=>t?`nativeName`:`name`),a=(0,W.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,W.useLayoutEffect)(()=>{if(n)try{let e=Ze(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,W.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,W.useCallback)(()=>{a(null)},[a])}}var nt=3;function rt(){let e=u();return e?.cloud===`vellum`?e.assistantId:f()[0]?.assistantId??null}function it(){let e=r(),[t]=i(),n=t.get(`preview`)===`true`,a=C.use.user(),s=S(),c=w(),l=a?.id??null,u=a?.firstName??``,f=a?.lastName??``,p=te(),h=m.use.activeAssistantId(),g=d(),_=de()&&!ue(),v=k.use.stringFlags().preChatOnboardingExperiment20260606??`control`,y=(k.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,ee=k.use.selfIntroGreeting(),T=ge(v),D=ve()??T,O=D===_e.paredDown,ne=g?rt():null,re=et(),{currentStep:ae,setCurrentStep:M,clearPersistedStep:oe}=tt(l,p),N=C.use.platformSession(),P=b(N),[F,I]=(0,W.useState)(()=>new Set),[L,se]=(0,W.useState)(()=>new Set),[ce,le]=(0,W.useState)(()=>new Set),{value:R,onChange:fe}=Ve(g&&!P?``:u||f),[z,pe]=(0,W.useState)(null),[B]=(0,W.useState)(()=>ye()),[V,H]=(0,W.useState)(``),[U,xe]=(0,W.useState)(!1),[K,Ce]=(0,W.useState)([]),{data:Ee}=o({...A(),enabled:!c&&s&&(!g||P)}),{data:Oe,isLoading:Ae}=o({queryKey:[`onboarding-recipe`,l],queryFn:be,enabled:!c&&s&&!p&&!g,staleTime:1/0}),q=Oe??null,J=Ee?.id??h??ne,je=qe({localMode:g,platformSession:N,hasCachedPlatformAssistant:ne!==null}),Me=je,Ne=je,Ie=async()=>{await x.checkAssistant(),e(`${E.assistant}?onboarding=1`,{replace:!0})};function Le(e,t=D){n||he(e,{userId:l,variant:me(t)})}let ze=[...F].some(e=>Fe.has(e)),Y=p?Ye():Je({paredDown:O,canOfferPriorAssistants:Ne,canOfferGoogleStep:n?!1:Me,hasGoogleTool:ze,showIOSAppStep:_});function X(t){if(n){e(-1);return}ie(Ke({mode:p?`native`:O?`paredDown`:`control`,recipe:p?null:q,selectedTools:F,selectedTasks:L,selectedPriorAssistants:t?.selectedPriorAssistants??ce,tone:z??q?.tone??`grounded`,userName:R,assistantName:V,selfIntroGreetingEnabled:ee,activationFlowEnabled:p?void 0:y,googleConnected:U,googleScopes:K,connectedScopes:t?.connectedScopes}));let r=V.trim();r&&j(r),p?(oe(),e(E.onboarding.privacy)):(x.markExpectingFirstMessage(),Ie())}let Z=(e,t)=>{e.funnelStep&&Le(e.funnelStep);let n=Qe(Y,e.id);n?M(n):X(t)},Q=e=>{let t=$e(Y,e.id);t&&M(t)};if(!re||Ae)return null;let $=Y.find(e=>e.id===ae)??Y[0];return $?$.id===`nativeName`?(0,G.jsx)(De,{userName:R,assistantName:V,displayedAssistantNames:B,onUserNameChange:fe,onAssistantNameChange:H,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:nt}):$.id===`nativeVibe`?(0,G.jsx)(Be,{selectedGroupId:z,onGroupChange:pe,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:nt}):$.id===`name`?(0,G.jsx)(Te,{userName:R,assistantName:V,selectedGroupId:z,displayedAssistantNames:B,onUserNameChange:fe,onAssistantNameChange:H,onGroupChange:pe,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,G.jsx)(Pe,{selectedTasks:L,onChange:se,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,G.jsx)(Re,{selectedTools:F,onChange:I,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,G.jsx)(ke,{selectedAssistants:ce,onChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;le(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?J?(0,G.jsx)(we,{assistantId:J,assistantName:V,onConnect:e=>{xe(!0),Ce(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,G.jsx)(Se,{onComplete:()=>Z($)}):null:null}function at(){return(0,G.jsx)(it,{})}export{at as PreChatRoute};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-BBwtGKJb.js";import{t as o}from"./react-DJZBPgpf.js";import{O as s,t as c}from"./button-D7s2Q_uG.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./useMutation-Lj4VunQV.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./cn-DvW5mxZR.js";import{t as m}from"./card-BibIM9x3.js";import{t as h}from"./dropdown-CL8VmqrY.js";import{t as g}from"./confirm-dialog-CfOXCE1N.js";import{t as _}from"./notice-CqRgVmeL.js";import{t as v}from"./tag-B_-QAvJF.js";import{t as y}from"./input-C8kfrq9r.js";import{t as b}from"./toggle-X_kQW5my.js";import{n as x}from"./toast-2TW5tj1Y.js";import{t as S}from"./chevron-right-B6vEpVY0.js";import{t as C}from"./loader-circle-IIzBGiwm.js";import{t as w}from"./pencil-DbB9rxpY.js";import{t as T}from"./x-KVxA2ZL0.js";import{C as E,D,E as O,M as k,O as A,S as ee,T as te,f as j,n as ne,r as re,w as ie}from"./auth-store-Kfxhs2oI.js";import{t as ae}from"./sdk.gen-D-_js_oC.js";import{a as oe,i as se}from"./routes-DVqkwUEe.js";import{n as ce,t as le}from"./react-query.gen-rp6Krcco.js";import{$i as ue,B as de,Gr as M,H as fe,Ir as pe,V as N,Zt as me,an as P,cn as F,g as I,h as L,in as R,ln as z,m as B,p as V,rn as he,sn as ge,x as _e}from"./index-PRnvH2Y1.js";import{t as H}from"./use-active-assistant-id-C-RHQ9f6.js";import{t as U}from"./detail-card-BIwpXT5F.js";import{t as W}from"./setting-row-o44aWwYt.js";var G=e(o(),1),K=f(),q=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],ve=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ye(){let[e,t]=(0,G.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function be(){let[e,r]=(0,G.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,G.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||me(0)}]}function xe({row:e,onToggle:t}){return(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(b,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,K.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,K.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Se(){return(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function Ce({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=z(),{pendingKind:o,run:s}=ye(),[c,l]=be(),u=(0,G.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of q){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,G.useMemo)(()=>{let e=q.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=ve.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await ge(e.sourceKind):await F(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,K.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,K.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,K.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,K.jsx)(Se,{}),`Checking permissions...`]}):(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,K.jsx)(xe,{row:e,onToggle:p},e.id))}),r&&(0,K.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function we(){let e=P({platformHostedOnly:!0}),t=he(),n=R(),r=l(),{data:i,isLoading:a,isError:o}=u({...le(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await ae({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{ce(r,void 0,e),x.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{x.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,K.jsxs)(K.Fragment,{children:[(s.isPending||c)&&(0,K.jsx)(C,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,K.jsx)(b,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,K.jsx)(_e,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function Te(){let e=k(),[t,n]=(0,G.useState)(()=>te()),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(`Face ID`),[s,c]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{e&&(ie().then(i),E().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)O(!1),await ee(),n(!1);else{let e=A();e&&await D(e),O(!0),n(!0)}}finally{c(!1)}};return(0,K.jsx)(U,{title:`Security`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,K.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,K.jsx)(b,{checked:t,onChange:()=>void l(),disabled:s})]})})}function J(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=V.map(e=>({value:e.id,label:e.label,icon:(0,K.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Ee(){let e=H(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>L(e),staleTime:3e4}),[i,a]=(0,G.useState)(`relaxed`),[o,s]=(0,G.useState)(`conservative`),[c,d]=(0,G.useState)(`strict`),[f,p]=(0,G.useState)(!1),g=(0,G.useRef)(!1),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(null),b=(0,G.useRef)(null);(0,G.useEffect)(()=>{!n||g.current||(a(B(n.interactive).id),s(B(n.autonomous).id),d(B(n.headless).id),v(!0))},[n]),(0,G.useEffect)(()=>()=>{y.current!==null&&(clearTimeout(y.current),y.current=null,b.current?.(),b.current=null)},[]);let x=(0,G.useCallback)((n,r,i)=>{if(!e||!_)return;let a=V.find(e=>e.id===n)?.riskThreshold,o=V.find(e=>e.id===r)?.riskThreshold,s=V.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||I(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,_,t]),C=(0,G.useCallback)((e,t,n)=>{y.current!==null&&clearTimeout(y.current),b.current=()=>x(e,t,n),y.current=setTimeout(()=>{b.current?.(),y.current=null,b.current=null},500)},[x]),w=(0,G.useCallback)(e=>{g.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,G.useCallback)(e=>{g.current=!0,s(e),C(i,e,c)},[i,c,C]),E=(0,G.useCallback)(e=>{g.current=!0,d(e),C(i,o,e)},[i,o,C]),D=V.find(e=>e.id===i),O=V.find(e=>e.id===o),k=V.find(e=>e.id===c),A=!e||!_;return(0,K.jsxs)(m,{children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Risk Tolerance`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your tolerance determines which levels auto-approve.`}),r&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:i,onChange:w,options:Y,disabled:A})}),D&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]}),(0,K.jsx)(J,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,K.jsx)(ue,{className:`h-4 w-4`}):(0,K.jsx)(S,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,K.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:o,onChange:T,options:Y,disabled:A})}),O&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,K.jsx)(J,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:c,onChange:E,options:Y,disabled:A})}),k&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]})]})]})]})]})}var X=e(s(),1),Z=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],De=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,G.useRef)(null),[a,o]=(0,G.useState)(t.tool),[s,c]=(0,G.useState)(t.pattern),[l,u]=(0,G.useState)(t.risk),[d,f]=(0,G.useState)(t.description??``),[p,m]=(0,G.useState)(!1),[g,v]=(0,G.useState)(null),b=s.trim(),x=b.length>0&&!p,S=(0,G.useCallback)(async n=>{if(n.preventDefault(),!x)return;let i=d.trim()||`${a} — ${b}`;m(!0),v(null);try{await fe(e,t.id,{risk:l,description:i}),r()}catch(e){v(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,x,d,t,r,l,a,b]);return(0,X.createPortal)((0,K.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,G.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,G.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,K.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,K.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,K.jsx)(T,{className:`h-4 w-4`})})]}),(0,K.jsxs)(`form`,{onSubmit:e=>void S(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[g&&(0,K.jsx)(_,{tone:`error`,children:g}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,K.jsx)(`div`,{className:`mt-1`,children:(0,K.jsx)(h,{value:a,onChange:o,disabled:!0,options:Z.map(e=>({value:e,label:e}))})})]}),(0,K.jsx)(y,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,K.jsx)(`div`,{className:`mt-2 flex gap-2`,children:De.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,K.jsx)(`div`,{children:e.label}),(0,K.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,K.jsx)(y,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${b||`pattern`}`}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,K.jsx)(`button`,{type:`submit`,disabled:!x,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function ke(e){return e.origin===`default`&&!e.userModified}function Ae(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function je(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Me({assistantId:e,onClose:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(!0),[s,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)(null),[m,h]=(0,G.useState)(!1),y=(0,G.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([N(e),N(e,{origin:`default`})]);return Ae(t,n)}return N(e)},[e]),x=(0,G.useCallback)(async()=>{o(!0);try{i(await y(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[y,m]);(0,G.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await y(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[y,m]);let S=(0,G.useCallback)(async()=>{if(f)try{await de(e,f.id),x()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,x]);return(0,X.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,G.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,G.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,K.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(b,{checked:m,onChange:h,label:`Show all defaults`}),(0,K.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,K.jsx)(`div`,{className:`mb-3`,children:(0,K.jsx)(_,{tone:`error`,children:s})}),a?(0,K.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,K.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,K.jsx)(M,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,K.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,K.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,K.jsx)(v,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,K.jsx)(v,{tone:`neutral`,children:`Default`}),e.userModified&&(0,K.jsx)(v,{tone:`warning`,children:`Modified`})]}),(0,K.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,K.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,K.jsx)(w,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,K.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,K.jsx)(pe,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,K.jsx)(Oe,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),x()}}),(0,K.jsx)(g,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void S(),onCancel:()=>p(null)})]}),document.body)}function Ne(){let e=H(),[t,n]=(0,G.useState)(!1);return(0,K.jsxs)(m,{children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(M,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,K.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,K.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Fe=`thirtyDays`;function $(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=P({platformHostedOnly:!0}),t=re(),a=t,o=ne.use.user()?.id??null,[s,c]=(0,G.useState)(()=>n(`shareAnalytics`,!0)),[l,u]=(0,G.useState)(()=>n(`shareDiagnostics`,!0)),[d,f]=(0,G.useState)(()=>i(`llmLogRetention`,Fe));return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(Te,{}),(0,K.jsx)(Ce,{}),(0,K.jsx)(Ne,{}),(0,K.jsx)(Ee,{}),(0,K.jsx)(U,{title:`Privacy`,subtitle:t?(0,K.jsxs)(K.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,K.jsx)(`a`,{href:se(oe.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:s,onChange:()=>{let e=!s;c(e),j(`share_analytics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,K.jsx)($,{}),(0,K.jsx)(W,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),j(`share_diagnostics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,K.jsx)($,{})]}),(0,K.jsx)(we,{}),e!==`gated`&&(0,K.jsx)($,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:d,onChange:e=>{f(e),r(`llmLogRetention`,e)},options:Pe})}),(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{Ie as PrivacyPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{f as o}from"./local-mode-CvrNMtPF.js";import{t as s}from"./is-electron-C_ZTVhv8.js";import{M as c,d as l,i as u,n as d}from"./auth-store-Kfxhs2oI.js";import{a as f}from"./routes-DVqkwUEe.js";import{d as p,f as m,l as h,u as g}from"./prefs-C_oq5G87.js";import{t as _}from"./client-feature-flag-store-C1kdd1EO.js";import{kt as v}from"./index-PRnvH2Y1.js";import{a as y,c as b,i as x,n as S,o as C,t as w}from"./step-indicator-dots-CEVbsP8r.js";import{n as T,t as E}from"./consent-controls-BSZV4rW3.js";var D=e(t(),1);function O({researchOnboardingEnabled:e,isNative:t,isLocalMode:n}){return e&&!t&&!n?f.onboarding.research:f.onboarding.hatching}var k=a();function A(){let e=r(),[t]=i(),a=d.use.user()?.id??null,A=s(),j=c(),M=_.use.stringFlags().preChatOnboardingExperiment20260606??`control`,N=_.use.researchOnboarding(),P=C(M),[F,I]=g(),[L,R]=p(),[z,B]=m(),[V,H]=h(),U=u();(0,D.useEffect)(()=>{j||y()},[j]);let W=t.get(`preview`)===`true`,G=(0,D.useCallback)(e=>{},[]),K=W?G:I,q=W?G:R,J=W?G:B,Y=W?G:H,X=(0,D.useCallback)(()=>{if(W){e(`${f.onboarding.prechat}?preview=true`);return}if(l({userId:a,tos:z,privacy:V,shareAnalytics:F,shareDiagnostics:L,hasPlatformSession:U}),!j){let e=b(P);x(S.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${O({researchOnboardingEnabled:N,isNative:j,isLocalMode:o()})}${i?`?${i}`:``}`)},[V,U,j,W,e,P,N,t,F,L,z,a]);return(0,k.jsx)(v,{children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${A?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[j&&(0,k.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,k.jsx)(w,{current:2,total:3})}),(0,k.jsx)(`h1`,{className:A?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,k.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${A?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,k.jsx)(T,{electron:A,shareAnalytics:F,shareDiagnostics:L,onShareAnalyticsChange:K,onShareDiagnosticsChange:q,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,k.jsx)(E,{electron:A,privacyConsent:V,tosAccepted:z,onPrivacyChange:Y,onTosChange:J,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${A?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!z||!V,onClick:X,className:A?void 0:`h-11 text-base`,children:`Start`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:A?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{A as PrivacyScreen};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Hr1Yo2kx.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{S as s,f as c}from"./local-mode-CvrNMtPF.js";import{F as l,K as u,V as d,n as f}from"./auth-store-Kfxhs2oI.js";import{c as p}from"./api-2kc3MHRz.js";import{a as m}from"./routes-DVqkwUEe.js";import{a as h,i as g}from"./login-flow-DPi11n3h.js";import{n as _}from"./index-PRnvH2Y1.js";import{r as v,t as y}from"./account-shell-b6GjlQ0u.js";var b=e(n(),1),x=o();function S(){let[e]=i(),n=r(),o=f.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let t=await u(),r=l(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),c())try{let e=await p();if(e.ok&&e.data.length>0&&(await s(e.data,d.getState().currentOrganizationId??void 0),!E)){n(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:r}=h({returnTo:E,fallback:e,authIntent:D});r?window.location.href=t:n(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);n(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(r.message);break}}catch(e){t(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,o,E,n,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(a,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(a,{to:m.account.login,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S as ProviderCallbackPage};
@@ -1 +0,0 @@
1
- import{In as e,Pt as t}from"./sdk.gen-1aYqVbMj.js";var n=`onboarding.providerKey`;function r(e){try{if(e===null){sessionStorage.removeItem(n);return}sessionStorage.setItem(n,JSON.stringify(e))}catch{}}function i(e){return typeof e==`object`&&!!e&&`provider`in e&&typeof e.provider==`string`&&`key`in e&&typeof e.key==`string`}function a(){try{let e=sessionStorage.getItem(n);if(!e)return null;let t=JSON.parse(e);return i(t)?t:null}catch{return null}}function o(){let e=a();try{sessionStorage.removeItem(n)}catch{}return e}async function s(t,n,r){let{response:i}=await e({path:{assistant_id:t},body:{type:`api_key`,name:n,value:r},throwOnError:!1});if(!i?.ok)throw Object.assign(Error(`Failed to write provider secret`),{status:i?.status})}async function c(e,n,r){let i=r?{type:`api_key`,credential:`credential/${n}/api_key`}:{type:`none`},{response:a}=await t({path:{assistant_id:e},body:{name:n,provider:n,auth:i},throwOnError:!1});if(!a?.ok)throw Object.assign(Error(`Failed to create provider connection`),{status:a?.status})}async function l(e){let t=o();if(!t)return;let n=t.key.trim(),r=n.length>0;r&&await s(e,t.provider,n),await c(e,t.provider,r)}export{a as n,r,l as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r,t as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{G as o,J as s,n as c,q as l}from"./auth-store-Kfxhs2oI.js";import{a as u}from"./routes-DVqkwUEe.js";import{a as d,o as f}from"./login-flow-DPi11n3h.js";import{i as p,n as m,r as h,t as g}from"./account-shell-b6GjlQ0u.js";import{t as _}from"./signup-shell-Bu5BM6II.js";var v=e(t(),1),y=a();function b(){let e=n(),[t]=r(),a=c.use.refreshSession(),b=t.get(`returnTo`),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!0),L=(0,v.useRef)(!1);(0,v.useEffect)(()=>{L.current||(L.current=!0,(async()=>{try{let t=await o();if(!t.ok){e(u.account.login,{replace:!0});return}S(t.data.user.email??``),w(t.data.user.username??``),E(t.data.user.first_name??``),O(t.data.user.last_name??``),I(!1)}catch{e(u.account.login,{replace:!0})}})())},[e]);let R=async()=>{let t=await s({email:x,username:C});if(!t.ok){if(l(t)){await a();let t=f(b,u.account.root);t.requiresFullPageNavigation?window.location.href=t.destination:e(t.destination);return}M(t.errors[0]?.message??`Failed to complete signup.`);return}await a();let n=d({returnTo:b,fallback:u.account.root,authIntent:`signup`});n.requiresFullPageNavigation?window.location.href=n.destination:e(n.destination)},z=async e=>{e.preventDefault(),M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}},B=async e=>{if(e.preventDefault(),k.trim()){M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}}};if(F)return(0,y.jsx)(g,{children:(0,y.jsx)(h,{title:`Completing signup...`,subtitle:`Please wait while we load your information.`})});if(x&&C){let e=k.trim().length>0&&!N;return(0,y.jsx)(_,{children:(0,y.jsxs)(`form`,{onSubmit:B,className:`signup-details__thread`,children:[(0,y.jsxs)(`h2`,{className:`signup-details__heading`,children:[`Almost there,`,(0,y.jsx)(`br`,{}),`one more detail`]}),j&&(0,y.jsx)(`p`,{className:`signup-details__error`,children:j}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`What should I call you? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`First name`,value:T,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`And your last name? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`Last name`,value:D,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`Your role `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,autoComplete:`organization-title`,placeholder:`e.g. Software Engineer`,value:k,onChange:e=>A(e.target.value),autoFocus:!0})]}),(0,y.jsx)(`div`,{className:`signup-details__step`,children:(0,y.jsx)(`button`,{type:`submit`,className:`signup-details__continue`,disabled:!e,children:N?`Setting up…`:`Continue →`})})]})})}return(0,y.jsxs)(g,{children:[(0,y.jsx)(h,{title:`Complete your account`,subtitle:`We need a few more details to finish setting up your account.`}),(0,y.jsxs)(m,{onSubmit:z,error:j,submitLabel:`Complete signup`,submittingLabel:`Completing...`,isSubmitting:N,footer:(0,y.jsx)(i,{to:u.account.login,className:`text-sm text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:`← Back to sign in`}),children:[(0,y.jsx)(p,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`Email`,value:x,onChange:e=>S(e.target.value),required:!0}),(0,y.jsx)(p,{id:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:C,onChange:e=>w(e.target.value),required:!0})]})]})}export{b as ProviderSignupPage};