@vellumai/web 0.10.3-staging.2 → 0.10.4-staging.1

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 (309) hide show
  1. package/dist/assets/{AnimatePresence-CgXwEO42.js → AnimatePresence-Dfn9OLfv.js} +2 -2
  2. package/dist/assets/{BundleConfirmPage-DpfvIcwl.js → BundleConfirmPage-cwBrFi1K.js} +1 -1
  3. package/dist/assets/{Combination-4Qc3vrtW.js → Combination-DRz6Ez-m.js} +1 -1
  4. package/dist/assets/{QueryClientProvider-DKhXIxGb.js → QueryClientProvider-DgWA3A3c.js} +1 -1
  5. package/dist/assets/{about-page-CuSnWJFo.js → about-page-6YWjIdZL.js} +1 -1
  6. package/dist/assets/{account-page-CCYCSy2-.js → account-page-bNvk8mIC.js} +1 -1
  7. package/dist/assets/{account-shell-b6GjlQ0u.js → account-shell-B1geYjoc.js} +1 -1
  8. package/dist/assets/{add-credits-modal-Dy3I3Har.js → add-credits-modal-D-5W9e8w.js} +1 -1
  9. package/dist/assets/{advanced-page-CVnT0zH-.js → advanced-page-CuerkFrp.js} +1 -1
  10. package/dist/assets/ai-page-CsqhZcSf.js +1 -0
  11. package/dist/assets/{api-2kc3MHRz.js → api-DXPKXkDj.js} +1 -1
  12. package/dist/assets/{api-key-screen-DGVn66y4.js → api-key-screen-QS5FdtlL.js} +1 -1
  13. package/dist/assets/{app-info-BZYaLxCg.js → app-info-oX9MaK2d.js} +1 -1
  14. package/dist/assets/{archive-BFILUl9x.js → archive-Ct5g6T4N.js} +1 -1
  15. package/dist/assets/{archive-page-Dl6HLIJt.js → archive-page-Bh0LTWRp.js} +1 -1
  16. package/dist/assets/arrow-left-BPsKoNcb.js +1 -0
  17. package/dist/assets/arrow-up-CkZMv0kb.js +1 -0
  18. package/dist/assets/{assistant-api-DROTS3Y9.js → assistant-api-BdlaVxiH.js} +1 -1
  19. package/dist/assets/{assistant-feature-flag-store-Dl92XRsM.js → assistant-feature-flag-store-Ceb6N94N.js} +1 -1
  20. package/dist/assets/assistant-identity-store-ESeBny_J.js +1 -0
  21. package/dist/assets/{assistant-status-panel-BkIkvMYw.js → assistant-status-panel-DRHanMan.js} +1 -1
  22. package/dist/assets/auth-store-BzL2lSd1.js +7 -0
  23. package/dist/assets/ban-BW0pQzvY.js +1 -0
  24. package/dist/assets/{bell-DB1SrBre.js → bell-B-09xFrv.js} +1 -1
  25. package/dist/assets/{billing-page-Cq_yLwUC.js → billing-page-CEArOabV.js} +3 -3
  26. package/dist/assets/{bookmark-C3S-p0MQ.js → bookmark-B_4Mr1qd.js} +1 -1
  27. package/dist/assets/{bookmarks-page-CANlE7hP.js → bookmarks-page-BvkvZ7uy.js} +1 -1
  28. package/dist/assets/{brain-Bs6LnfHO.js → brain-CamcLepK.js} +1 -1
  29. package/dist/assets/{browser-CKX_K5ev.js → browser-CDQJAXkC.js} +2 -2
  30. package/dist/assets/{bug-DDcuQ3au.js → bug-BiiqXpDy.js} +1 -1
  31. package/dist/assets/{build-state-VC4tL7sK.js → build-state-BIN8lPRx.js} +1 -1
  32. package/dist/assets/{button-D7s2Q_uG.js → button-BvHa6F59.js} +1 -1
  33. package/dist/assets/{calendar-CpgH8CqM.js → calendar-Ba3kkcG0.js} +1 -1
  34. package/dist/assets/{capture-error-Hr1Yo2kx.js → capture-error-BaKOqBjF.js} +1 -1
  35. package/dist/assets/{card-BibIM9x3.js → card-D9_3ngHI.js} +1 -1
  36. package/dist/assets/check-DwLoiFa9.js +1 -0
  37. package/dist/assets/check-DxBmXJus.js +1 -0
  38. package/dist/assets/{checkbox-BqCzUvXM.js → checkbox-DNfwi5Hy.js} +1 -1
  39. package/dist/assets/chevron-left-CgekgptJ.js +1 -0
  40. package/dist/assets/chevron-right-DP15nqFC.js +1 -0
  41. package/dist/assets/{chevron-up-BRZN6p_l.js → chevron-up-CNrKWpd3.js} +1 -1
  42. package/dist/assets/{circle-alert-DvNg50UK.js → circle-alert-BB_iJtM8.js} +1 -1
  43. package/dist/assets/circle-check-Cwv8JCfw.js +1 -0
  44. package/dist/assets/{client-feature-flag-store-C1kdd1EO.js → client-feature-flag-store-kWvb3vtZ.js} +1 -1
  45. package/dist/assets/{cloud-off-rAv4OHmv.js → cloud-off-DpkRXr7O.js} +1 -1
  46. package/dist/assets/{cn-DvW5mxZR.js → cn-CFvi8Z0K.js} +1 -1
  47. package/dist/assets/code-7vvpMPgo.js +1 -0
  48. package/dist/assets/{command-palette-GZu_zgQg.js → command-palette-D1nNMvVX.js} +1 -1
  49. package/dist/assets/{command-palette-window-page-CzWu42Ee.js → command-palette-window-page-DrZt0RaG.js} +1 -1
  50. package/dist/assets/{community-page-Dhgypa-h.js → community-page-A8lshdka.js} +1 -1
  51. package/dist/assets/{confirm-dialog-CfOXCE1N.js → confirm-dialog-BtxNY4WU.js} +1 -1
  52. package/dist/assets/{connect-page-CDOcgzzL.js → connect-page-CuSSRk9J.js} +1 -1
  53. package/dist/assets/{consent-controls-BSZV4rW3.js → consent-controls-CYj9WfJh.js} +1 -1
  54. package/dist/assets/{contacts-gateway-dxw1KMN2.js → contacts-gateway-CHNyL-NU.js} +1 -1
  55. package/dist/assets/{contacts-page-route-C3QiOxjO.js → contacts-page-route-qsIGsjpD.js} +2 -2
  56. package/dist/assets/{conversation-list-fetchers-UPVZq_6O.js → conversation-list-fetchers-Bcp_Zesn.js} +1 -1
  57. package/dist/assets/{conversation-store-DK-7gFAt.js → conversation-store-6tz67quR.js} +1 -1
  58. package/dist/assets/{cpu-CiHv3fhs.js → cpu-PmmoD4_K.js} +1 -1
  59. package/dist/assets/{credit-card-BKRB1ZIi.js → credit-card-yPLmY1JU.js} +1 -1
  60. package/dist/assets/{danger-zone-redirect-page-CjqUKhk9.js → danger-zone-redirect-page-Dhgk9mkr.js} +1 -1
  61. package/dist/assets/debug-page-Ddv9MlOm.js +4 -0
  62. package/dist/assets/{deploy-dialogs-jf5VL1UP.js → deploy-dialogs-qdH6GTjP.js} +1 -1
  63. package/dist/assets/{detail-card-BIwpXT5F.js → detail-card-5TPdhuZN.js} +1 -1
  64. package/dist/assets/{developer-page-iEL4eJ8x.js → developer-page-BXl0qAXX.js} +1 -1
  65. package/dist/assets/{devices-page-RMaPGcXe.js → devices-page-DaZR3FC4.js} +1 -1
  66. package/dist/assets/{diagnostics-BEB4VPwC.js → diagnostics-D5xXiLo-.js} +1 -1
  67. package/dist/assets/{dictation-overlay-page-BxQCzLMY.js → dictation-overlay-page-DOdZ_KIz.js} +1 -1
  68. package/dist/assets/{dist-B0Gf-knw.js → dist-BkSUb6s0.js} +1 -1
  69. package/dist/assets/{dist-cApvLul2.js → dist-Ble8OyWO.js} +1 -1
  70. package/dist/assets/{document-viewer-page-57OuXxYw.js → document-viewer-page-XzPSoPVb.js} +1 -1
  71. package/dist/assets/{domain-field-DYwuCpup.js → domain-field-BGp08c4L.js} +1 -1
  72. package/dist/assets/{dropdown-CL8VmqrY.js → dropdown-SUNHYFiy.js} +1 -1
  73. package/dist/assets/{earn-credits-modal-Nm1VymMp.js → earn-credits-modal-D7ioWvNh.js} +1 -1
  74. package/dist/assets/{emails-page-0gRZqa6y.js → emails-page-BRnVsJnR.js} +1 -1
  75. package/dist/assets/{emoji-catalog-data-Dlkuvec0.js → emoji-catalog-data-hHp74TCA.js} +1 -1
  76. package/dist/assets/{environment-store-CvH3J6fT.js → environment-store-B5EGAqzg.js} +1 -1
  77. package/dist/assets/esm-8Mv545sP.js +2 -0
  78. package/dist/assets/esm-B35SBKTx.js +2 -0
  79. package/dist/assets/esm-B9nLiq-2.js +1 -0
  80. package/dist/assets/{esm-B3Lr4Bv0.js → esm-DQXfMjvW.js} +2 -2
  81. package/dist/assets/esm-Dz9uwqjb.js +2 -0
  82. package/dist/assets/esm-TyKOKslC.js +2 -0
  83. package/dist/assets/{external-link-DPAtkBJ2.js → external-link-h3UAe8eX.js} +1 -1
  84. package/dist/assets/{file-editor-BNkJJbUv.js → file-editor-Cy1TZHJJ.js} +1 -1
  85. package/dist/assets/{file-text-CmK9LY1p.js → file-text-Bxj0xAst.js} +1 -1
  86. package/dist/assets/funnel-events-Dz_DLI0Q.js +1 -0
  87. package/dist/assets/general-page-Dl7IYYSf.js +1 -0
  88. package/dist/assets/{globe-DYF_lSGm.js → globe-D7wvOZaZ.js} +1 -1
  89. package/dist/assets/{hard-drive-D7_5VMhi.js → hard-drive-CO7i5o4z.js} +1 -1
  90. package/dist/assets/{hatching-screen-KPinlCES.js → hatching-screen-YvbZlnsV.js} +1 -1
  91. package/dist/assets/home-page-route-B7AJU1pr.js +1 -0
  92. package/dist/assets/{hosting-screen-C14KAJ6m.js → hosting-screen-CKlP38Z3.js} +1 -1
  93. package/dist/assets/{identity-page-route-C0BFcTAF.js → identity-page-route-CZQEWoJK.js} +1 -1
  94. package/dist/assets/index-3zpPFBeR.js +132 -0
  95. package/dist/assets/index-PRuqIn_u.css +2 -0
  96. package/dist/assets/{info-_OtUK1cX.js → info-B4DDA6uP.js} +1 -1
  97. package/dist/assets/{info-BGLlcyt6.js → info-CNTT4WCe.js} +1 -1
  98. package/dist/assets/{input-C8kfrq9r.js → input-BLN3wmw2.js} +1 -1
  99. package/dist/assets/{inspect-page-CWasyuSO.js → inspect-page-AldHg0Dz.js} +4 -4
  100. package/dist/assets/{install-C3xe8ARr.js → install-D_GSceot.js} +1 -1
  101. package/dist/assets/integrations-page-b3sE-PDS.js +1 -0
  102. package/dist/assets/{intelligence-layout-CvTumtjv.js → intelligence-layout-CsM_YjdB.js} +1 -1
  103. package/dist/assets/{keyboard-shortcuts-page-kiOEZKzE.js → keyboard-shortcuts-page-Capx1ICA.js} +1 -1
  104. package/dist/assets/{lib-BWRK7bT2.js → lib-Bexzcbsy.js} +1 -1
  105. package/dist/assets/library-detail-page-DrgMdBPq.js +1 -0
  106. package/dist/assets/{library-page-BHejhapZ.js → library-page-Catpu3p0.js} +1 -1
  107. package/dist/assets/{link-2-CaszbD7P.js → link-2-DW8ruMGH.js} +1 -1
  108. package/dist/assets/{list-row-Cw9JYESP.js → list-row-l7sxQ4Tj.js} +1 -1
  109. package/dist/assets/loader-circle-cYXxWP5B.js +1 -0
  110. package/dist/assets/{local-mode-CvrNMtPF.js → local-mode-Cez1weue.js} +1 -1
  111. package/dist/assets/{log-in-2iOsufxq.js → log-in-Ci5ja9sN.js} +1 -1
  112. package/dist/assets/{login-flow-DPi11n3h.js → login-flow-DeMU71_M.js} +1 -1
  113. package/dist/assets/{login-page-BGLVK82t.js → login-page-DkNb0F3s.js} +1 -1
  114. package/dist/assets/{logout-page-Bl6AD21S.js → logout-page-POyojlS1.js} +1 -1
  115. package/dist/assets/{logs-layout-C9eUE1Pt.js → logs-layout-qJmOLDZF.js} +1 -1
  116. package/dist/assets/{memory-router-playground-page-Dhi3uqxr.js → memory-router-playground-page-DD6t0kqe.js} +1 -1
  117. package/dist/assets/{menu-C_97pis4.js → menu-_JM4udVm.js} +1 -1
  118. package/dist/assets/{messages-DHDZ32NT.js → messages-DCNfjhgv.js} +2 -2
  119. package/dist/assets/{minimize-2-JE_UHZlJ.js → minimize-2-DmC6-Woz.js} +1 -1
  120. package/dist/assets/{mobile-sidebar-drawer-DqXFL0Ke.js → mobile-sidebar-drawer-B4ol32hs.js} +1 -1
  121. package/dist/assets/{modal-D0Q3UWD0.js → modal-CH2iwSBx.js} +1 -1
  122. package/dist/assets/{monitor-D2okHi8o.js → monitor-B1YMXlZj.js} +1 -1
  123. package/dist/assets/{moon-CK8MXzOo.js → moon-DSWoApF5.js} +1 -1
  124. package/dist/assets/mutation-error-B5AKP6aC.js +1 -0
  125. package/dist/assets/{native-file-B-MK3Ngg.js → native-file-GuVJgNpB.js} +2 -2
  126. package/dist/assets/{notice-CqRgVmeL.js → notice-BhqKj_VM.js} +1 -1
  127. package/dist/assets/{notifications-page-pHiDPA0p.js → notifications-page-MRalDive.js} +1 -1
  128. package/dist/assets/{oauth-complete-page-DiGMWbOb.js → oauth-complete-page-DGOyh2u6.js} +1 -1
  129. package/dist/assets/{oauth-popup-complete-page-CwoZnzdc.js → oauth-popup-complete-page-BPxKmr_f.js} +1 -1
  130. package/dist/assets/{page-shell-cEGpH3P5.js → page-shell-cu3KBmqd.js} +1 -1
  131. package/dist/assets/{pairing-page-clFaUgzL.js → pairing-page-_ulPOW9r.js} +1 -1
  132. package/dist/assets/{panel-item-nGTDevWP.js → panel-item-DN2CyWOT.js} +1 -1
  133. package/dist/assets/{password-reset-page-DfYGL1Gv.js → password-reset-page-BfRXQpS_.js} +1 -1
  134. package/dist/assets/{pencil-DbB9rxpY.js → pencil-DUMCM9m-.js} +1 -1
  135. package/dist/assets/{platform-loopback-page-Df5bTTx8.js → platform-loopback-page-D3oAT6qE.js} +1 -1
  136. package/dist/assets/{plugin-detail-page-IRPeI4lP.js → plugin-detail-page-ClMMTrti.js} +1 -1
  137. package/dist/assets/{plugins-page-BaYp2QOe.js → plugins-page-y6Aom9qx.js} +1 -1
  138. package/dist/assets/{popover-CL-JL6vG.js → popover-BIr0nN9H.js} +1 -1
  139. package/dist/assets/prechat-route-MTnUk6MK.js +1 -0
  140. package/dist/assets/{prefs-C_oq5G87.js → prefs-C6e8pdrA.js} +1 -1
  141. package/dist/assets/{privacy-page-BUhxrIRn.js → privacy-page-gc352kAN.js} +1 -1
  142. package/dist/assets/privacy-screen-CQLPQPoM.js +1 -0
  143. package/dist/assets/{progress-bar-DIFlWPPg.js → progress-bar-ATg2lhDh.js} +1 -1
  144. package/dist/assets/{provider-callback-page-CxFC4PH1.js → provider-callback-page-BtYwaMxL.js} +1 -1
  145. package/dist/assets/{provider-key-nA35OC4Y.js → provider-key-BKR2QTfR.js} +1 -1
  146. package/dist/assets/{provider-signup-page-CdpT28xL.js → provider-signup-page-80V_D9ad.js} +1 -1
  147. package/dist/assets/proxy-T76Q62qP.js +1 -0
  148. package/dist/assets/{quick-input-page-C9jN8YtU.js → quick-input-page-B-7fTgJi.js} +1 -1
  149. package/dist/assets/{react-query.gen-CQLyoqYk.js → react-query.gen-BeTpj_Sy.js} +1 -1
  150. package/dist/assets/{react-query.gen-rp6Krcco.js → react-query.gen-breoeUVK.js} +1 -1
  151. package/dist/assets/{refresh-cw-Bf6LV0kG.js → refresh-cw-kmptQnpX.js} +1 -1
  152. package/dist/assets/{research-mock-page-ttrrPwo3.js → research-mock-page-DYPr-S2q.js} +1 -1
  153. package/dist/assets/research-onboarding-route-yYstHFq4.js +35 -0
  154. package/dist/assets/{resize-errors-DnJEbHn4.js → resize-errors-ocHCHRPn.js} +1 -1
  155. package/dist/assets/{resolved-assistants-store-Cp4J43BK.js → resolved-assistants-store-BrS8JBzC.js} +1 -1
  156. package/dist/assets/{return-to-ByvaXBKr.js → return-to-DlPFMVLx.js} +1 -1
  157. package/dist/assets/{review-terms-screen-DEiifDmK.js → review-terms-screen-DFlSm1tM.js} +1 -1
  158. package/dist/assets/risk-badge-CTIwePVV.js +1 -0
  159. package/dist/assets/{routes-DVqkwUEe.js → routes-Dzl0kj5j.js} +1 -1
  160. package/dist/assets/{save-DEBQ_gbb.js → save-DQyrotXP.js} +1 -1
  161. package/dist/assets/{schedules-D-4Rq6ZC.js → schedules-DZspBZ61.js} +1 -1
  162. package/dist/assets/{sdk.gen-D-_js_oC.js → sdk.gen-DSjI3deY.js} +1 -1
  163. package/dist/assets/{select-assistant-screen-UoixBMN2.js → select-assistant-screen-kcdnMYj7.js} +1 -1
  164. package/dist/assets/{setting-row-o44aWwYt.js → setting-row-DB3q3lgL.js} +1 -1
  165. package/dist/assets/settings-layout-DV4y_-8a.js +1 -0
  166. package/dist/assets/{share-feedback-modal-CTwByE7B.js → share-feedback-modal-CNGNLLDP.js} +1 -1
  167. package/dist/assets/{shortcut-keys-vM6sNj7W.js → shortcut-keys-D4E8qQgS.js} +1 -1
  168. package/dist/assets/{sidebar-tree-BJkXpCut.js → sidebar-tree-BCJVetMg.js} +1 -1
  169. package/dist/assets/{signup-page-CKDYl9Wb.js → signup-page-iM9szAKN.js} +1 -1
  170. package/dist/assets/{signup-shell-Bu5BM6II.js → signup-shell-GOG8-46O.js} +1 -1
  171. package/dist/assets/{skills-page-DVjqqfMw.js → skills-page-D3c3cuti.js} +1 -1
  172. package/dist/assets/{sound-manager-CzslfzDO.js → sound-manager-DwCzTycd.js} +1 -1
  173. package/dist/assets/{sounds-page-mens6EAJ.js → sounds-page-C3qbFW0l.js} +1 -1
  174. package/dist/assets/{sparkles-BICoewVE.js → sparkles-C8eL4LNF.js} +1 -1
  175. package/dist/assets/src-Dr68ou95.js +293 -0
  176. package/dist/assets/{stat-square-B0S3fO7O.js → stat-square-zBHENXcL.js} +1 -1
  177. package/dist/assets/{status-badge-pill-DYlAnX5m.js → status-badge-pill-CSitw8_5.js} +1 -1
  178. package/dist/assets/step-indicator-dots-D4A7eDFL.js +1 -0
  179. package/dist/assets/subagent-detail-panel-D3xm4yVF.js +4 -0
  180. package/dist/assets/{subagent-store-BLHGkTJR.js → subagent-store-CFwN6f1W.js} +1 -1
  181. package/dist/assets/system-events-page-CXlJ_J54.js +1 -0
  182. package/dist/assets/{system-events-redirect-page-C1hGE6n5.js → system-events-redirect-page-Bkigvq03.js} +1 -1
  183. package/dist/assets/{tag-B_-QAvJF.js → tag-64Evw5MO.js} +1 -1
  184. package/dist/assets/{three-dot-indicator-CLs7Rl-I.js → three-dot-indicator-DKd64wpF.js} +1 -1
  185. package/dist/assets/{tiptap-document-editor-D2t4qYzv.js → tiptap-document-editor-D031y5O7.js} +1 -1
  186. package/dist/assets/{toast-2TW5tj1Y.js → toast-VJ6jFKB9.js} +1 -1
  187. package/dist/assets/{toggle-X_kQW5my.js → toggle-zADptotB.js} +1 -1
  188. package/dist/assets/tool-detail-panel-Cq_SyoUG.js +2 -0
  189. package/dist/assets/{trace-page-DRWPaAuQ.js → trace-page-CEyVWa_4.js} +1 -1
  190. package/dist/assets/{triangle-alert-Bz1PpciW.js → triangle-alert-DqPPHRPD.js} +1 -1
  191. package/dist/assets/{triangle-alert-DKOyShqD.js → triangle-alert-eaW8jtCr.js} +1 -1
  192. package/dist/assets/{typography-BscuIPxA.js → typography-COqg6o2z.js} +1 -1
  193. package/dist/assets/{upgrade-cancel-page-Cwv5eMh9.js → upgrade-cancel-page-CM9JnbEO.js} +1 -1
  194. package/dist/assets/{upgrade-success-page-DnJ8Kyyj.js → upgrade-success-page-BxrXUjiP.js} +1 -1
  195. package/dist/assets/{usage-page-DJHRS0lZ.js → usage-page-DBmsLal7.js} +1 -1
  196. package/dist/assets/{use-active-assistant-id-C-RHQ9f6.js → use-active-assistant-id-jfqnc4T7.js} +1 -1
  197. package/dist/assets/{use-bus-subscription-BbiZXm1u.js → use-bus-subscription-CKWguMzy.js} +1 -1
  198. package/dist/assets/use-is-org-ready-DLZpD311.js +1 -0
  199. package/dist/assets/{use-onboarding-login-BEOH92mZ.js → use-onboarding-login-Cz1MgHw6.js} +1 -1
  200. package/dist/assets/use-plugin-drift-4-li_vW2.js +1 -0
  201. package/dist/assets/use-reduced-motion-DvKonyYy.js +1 -0
  202. package/dist/assets/{useQuery-B45lW1Kk.js → useBaseQuery-BOw_gWPH.js} +1 -1
  203. package/dist/assets/useInfiniteQuery-iPXlezAp.js +1 -0
  204. package/dist/assets/{useMutation-Lj4VunQV.js → useMutation-D3WkZnYg.js} +1 -1
  205. package/dist/assets/useQuery-cVuP8q1x.js +1 -0
  206. package/dist/assets/{user-plus-C0OyQU83.js → user-plus-CjFuXA3D.js} +1 -1
  207. package/dist/assets/{utils-IBnUZTqY.js → utils-Lep-7jRg.js} +1 -1
  208. package/dist/assets/{viewer-store-Dead64xY.js → viewer-store-Dened07w.js} +1 -1
  209. package/dist/assets/{voice-page-kQZ2ya5j.js → voice-page-C3zxM20t.js} +1 -1
  210. package/dist/assets/{weather-forecast-display-Cu3W6OZF.js → weather-forecast-display-DfsXEBSo.js} +1 -1
  211. package/dist/assets/{web-DOKyhuGQ.js → web-Broue3sZ.js} +1 -1
  212. package/dist/assets/{web-M3MS-KVB.js → web-C6Et8xNJ.js} +1 -1
  213. package/dist/assets/{web-B0S2ynRY.js → web-CNtrY6ZR.js} +1 -1
  214. package/dist/assets/{web-D0QcGl1O.js → web-CccL0uF5.js} +1 -1
  215. package/dist/assets/{web-Cg8gCWpB.js → web-CtAf2vJC.js} +1 -1
  216. package/dist/assets/{web-DJKnWTsF.js → web-Cygkn0vs.js} +1 -1
  217. package/dist/assets/{web-iUXw2JWQ.js → web-DuqCaaXx.js} +1 -1
  218. package/dist/assets/{welcome-screen-Bd7PCfAf.js → welcome-screen-RBmiq3Lq.js} +1 -1
  219. package/dist/assets/workflow-detail-panel-C2dD_hU2.js +1 -0
  220. package/dist/assets/{workspace-page-BR4pOxs5.js → workspace-page-lR8lzD2L.js} +1 -1
  221. package/dist/assets/x-649kPSQS.js +1 -0
  222. package/dist/assets/x-Bn5tweDc.js +1 -0
  223. package/dist/index.html +135 -134
  224. package/package.json +1 -1
  225. package/dist/assets/ai-page-kEbHR7cH.js +0 -1
  226. package/dist/assets/arrow-left-CP-EhDNF.js +0 -1
  227. package/dist/assets/arrow-up-nBfZxfhi.js +0 -1
  228. package/dist/assets/assistant-identity-store-CKjnoLSp.js +0 -1
  229. package/dist/assets/auth-store-Kfxhs2oI.js +0 -7
  230. package/dist/assets/ban-BpBuRCKI.js +0 -1
  231. package/dist/assets/check-CW0KmV0o.js +0 -1
  232. package/dist/assets/check-D6WkI0gF.js +0 -1
  233. package/dist/assets/chevron-left-DghyKSEE.js +0 -1
  234. package/dist/assets/chevron-right-B6vEpVY0.js +0 -1
  235. package/dist/assets/circle-check-DzlJxj_M.js +0 -1
  236. package/dist/assets/code-aMX9iMYa.js +0 -1
  237. package/dist/assets/debug-page-CBozmAQQ.js +0 -2
  238. package/dist/assets/esm-BVNBLzcW.js +0 -2
  239. package/dist/assets/esm-BtN-afz9.js +0 -1
  240. package/dist/assets/esm-D2xhPoyM.js +0 -2
  241. package/dist/assets/esm-DwNtkiSD.js +0 -2
  242. package/dist/assets/esm-pt1s0ryM.js +0 -2
  243. package/dist/assets/general-page-aZxTpnpI.js +0 -1
  244. package/dist/assets/home-page-route-CudtBGg1.js +0 -1
  245. package/dist/assets/index-Hcyzmz_5.css +0 -2
  246. package/dist/assets/index-PRnvH2Y1.js +0 -132
  247. package/dist/assets/integrations-page-WhBpTYP2.js +0 -1
  248. package/dist/assets/library-detail-page-rPvN9G1a.js +0 -1
  249. package/dist/assets/loader-circle-IIzBGiwm.js +0 -1
  250. package/dist/assets/mutation-error-CsyN8rYH.js +0 -1
  251. package/dist/assets/prechat-route-BaMWiiaf.js +0 -1
  252. package/dist/assets/privacy-screen-BaHYtKEt.js +0 -1
  253. package/dist/assets/proxy-DmIh4F51.js +0 -1
  254. package/dist/assets/reduced-motion-DYlLlcUm.js +0 -1
  255. package/dist/assets/research-onboarding-route-Cxai0fux.js +0 -36
  256. package/dist/assets/risk-badge-BA8R-HCI.js +0 -1
  257. package/dist/assets/settings-layout-CQ3Z9Raj.js +0 -1
  258. package/dist/assets/src-CK6bncSg.js +0 -293
  259. package/dist/assets/step-indicator-dots-CEVbsP8r.js +0 -1
  260. package/dist/assets/subagent-detail-panel-DVQAkMjF.js +0 -4
  261. package/dist/assets/system-events-page-Dro8iNrx.js +0 -1
  262. package/dist/assets/tool-detail-panel-DRD2DIMF.js +0 -2
  263. package/dist/assets/use-is-org-ready-BdtHeRV6.js +0 -1
  264. package/dist/assets/use-plugin-drift-Bj693x0f.js +0 -1
  265. package/dist/assets/use-reduced-motion-ChB7nOGe.js +0 -1
  266. package/dist/assets/workflow-detail-panel-CMmPPsuL.js +0 -1
  267. package/dist/assets/x-C8bCmIhD.js +0 -1
  268. package/dist/assets/x-KVxA2ZL0.js +0 -1
  269. /package/dist/assets/{api-errors-CveHbhgb.js → api-errors-B-g6gvNv.js} +0 -0
  270. /package/dist/assets/{avatar-bundled-components-BgAkdy0n.js → avatar-bundled-components-DoxUXsZB.js} +0 -0
  271. /package/dist/assets/{avatar-svg-compositor-CEmN7KGI.js → avatar-svg-compositor-Bzno7teV.js} +0 -0
  272. /package/dist/assets/{build.umd-B3KuSWeo.js → build.umd-C56vswwO.js} +0 -0
  273. /package/dist/assets/{client.gen-Cs6pCK0s.js → client.gen-BnoNy2w0.js} +0 -0
  274. /package/dist/assets/{composer-focus-Bp1AiP29.js → composer-focus-BZr63Cvs.js} +0 -0
  275. /package/dist/assets/{conversation-selection-CtKjA5Ni.js → conversation-selection-BV7USWf2.js} +0 -0
  276. /package/dist/assets/{create-selectors-BE0_e_Ed.js → create-selectors-BTyhO-eS.js} +0 -0
  277. /package/dist/assets/{createLucideIcon-Bjb-Kuq7.js → createLucideIcon-6rJ6BdB7.js} +0 -0
  278. /package/dist/assets/{createLucideIcon-BlMXrA59.js → createLucideIcon-D8roAprb.js} +0 -0
  279. /package/dist/assets/{definitions-lQvEBMJT.js → definitions-CtVlh_R5.js} +0 -0
  280. /package/dist/assets/{dist-BTp54SIT.js → dist-CzyDxYAs.js} +0 -0
  281. /package/dist/assets/{edit-chat-session-DJpqkkos.js → edit-chat-session-BYvbyTwd.js} +0 -0
  282. /package/dist/assets/{effective-timezone-DrYGH2Lb.js → effective-timezone-DAkNzd21.js} +0 -0
  283. /package/dist/assets/{event-bus-Dl7-I4aL.js → event-bus-CBil9JQT.js} +0 -0
  284. /package/dist/assets/{feature-flag-catalog-RK3_Ckyw.js → feature-flag-catalog-Br-v70vR.js} +0 -0
  285. /package/dist/assets/{format-CPOur310.js → format-HKnibeVj.js} +0 -0
  286. /package/dist/assets/{format-date-CLlHK5gl.js → format-date-DyMQp2_m.js} +0 -0
  287. /package/dist/assets/{format-file-size-BfZOpPdu.js → format-file-size-DOcXaUaE.js} +0 -0
  288. /package/dist/assets/{haptics-CXHZxyAg.js → haptics-CKwMH4eq.js} +0 -0
  289. /package/dist/assets/{impersonate-version-flag-n-4oNLiO.js → impersonate-version-flag-XVa1Tm2F.js} +0 -0
  290. /package/dist/assets/{infiniteQueryOptions-C6p49ZmI.js → infiniteQueryOptions-DTCCTa10.js} +0 -0
  291. /package/dist/assets/{is-electron-C_ZTVhv8.js → is-electron-URCUw74P.js} +0 -0
  292. /package/dist/assets/{jsx-runtime-CVSDxk6A.js → jsx-runtime-B-mvcaJS.js} +0 -0
  293. /package/dist/assets/{llm-dimension-CQdmYu05.js → llm-dimension-Dx3xIzPP.js} +0 -0
  294. /package/dist/assets/{misc-BN2o2MEB.js → misc-CBD9JJCY.js} +0 -0
  295. /package/dist/assets/{native-deep-link-BYNI6pkW.js → native-deep-link-DmJ7Ty6z.js} +0 -0
  296. /package/dist/assets/{pdf-pz4ipUHd.js → pdf-DNWhOzmB.js} +0 -0
  297. /package/dist/assets/{prechat-B28Vzu55.js → prechat-BuuzFtal.js} +0 -0
  298. /package/dist/assets/{prechat-names-CRduluk-.js → prechat-names-Bo5bdzfH.js} +0 -0
  299. /package/dist/assets/{public-asset-Fx_laYnf.js → public-asset-BTisO-cB.js} +0 -0
  300. /package/dist/assets/{queryOptions-BtNi-_9H.js → queryOptions-DGyQTr3e.js} +0 -0
  301. /package/dist/assets/{sdk.gen-1aYqVbMj.js → sdk.gen-CC1iYdd0.js} +0 -0
  302. /package/dist/assets/{semver-yC_Iq9co.js → semver-DpADL11z.js} +0 -0
  303. /package/dist/assets/{tool-call-status-DTV5jmaU.js → tool-call-status-DNS6Y_vi.js} +0 -0
  304. /package/dist/assets/{typed-storage-Dctd_K9F.js → typed-storage-Chj38wph.js} +0 -0
  305. /package/dist/assets/{usage-window-Wgtgd-cv.js → usage-window-dm_mRqGo.js} +0 -0
  306. /package/dist/assets/{use-is-mobile-Cy10kl9u.js → use-is-mobile-BF5x8sr8.js} +0 -0
  307. /package/dist/assets/{workflow-status-DmbjJPT4.js → workflow-status-B53qU9DS.js} +0 -0
  308. /package/dist/assets/{xterm-MKaw0cT7.js → xterm-CQ7wuPsS.js} +0 -0
  309. /package/dist/assets/{xterm-addon-fit-BFDQtfbG.js → xterm-addon-fit-CamgTlEH.js} +0 -0
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{n as s,t as c}from"./panel-item-nGTDevWP.js";import{t as l}from"./menu-C_97pis4.js";import{t as u}from"./notice-CqRgVmeL.js";import{t as d}from"./popover-CL-JL6vG.js";import{t as f}from"./input-C8kfrq9r.js";import{n as p}from"./toast-2TW5tj1Y.js";import{t as m}from"./createLucideIcon-BlMXrA59.js";import{t as h}from"./bell-DB1SrBre.js";import{t as g}from"./check-D6WkI0gF.js";import{t as _}from"./loader-circle-IIzBGiwm.js";import{t as v}from"./moon-CK8MXzOo.js";import{t as y}from"./triangle-alert-DKOyShqD.js";import{a as b}from"./routes-DVqkwUEe.js";import{n as x}from"./use-is-mobile-Cy10kl9u.js";import{ct as S,dt as C,ft as w,lt as T,mt as E,pt as D,ut as O}from"./react-query.gen-rp6Krcco.js";import{an as k,in as A,rn as j,x as M}from"./index-PRnvH2Y1.js";import{t as N}from"./mutation-error-CsyN8rYH.js";import{r as P}from"./format-date-CLlHK5gl.js";var F=m(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=m(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),L=e(t(),1);function R(e){e.invalidateQueries({queryKey:O()}),e.invalidateQueries({queryKey:E()})}function z(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var B=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],V=o();function H({notificationId:e,currentlySnoozed:t,children:n}){let i=r(),o=a(D()),u=x(),[d,f]=(0,L.useState)(!1),p=()=>R(i),m=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:p,onError:N(`Failed to snooze notification`)})},h=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:p,onError:N(`Failed to clear snooze`)})};return u?(0,V.jsxs)(s.Root,{open:d,onOpenChange:f,children:[(0,V.jsx)(s.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(s.Content,{children:[(0,V.jsx)(s.Header,{children:(0,V.jsx)(s.Title,{children:`Snooze until…`})}),(0,V.jsxs)(s.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(c,{label:e,onSelect:()=>{o.isPending||(f(!1),m(t))}},e)),t&&(0,V.jsx)(c,{label:`Clear snooze`,onSelect:()=>{o.isPending||(f(!1),h())}})]})]})]}):(0,V.jsxs)(l.Root,{open:d,onOpenChange:f,children:[(0,V.jsx)(l.Trigger,{children:n}),(0,V.jsxs)(l.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(l.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(l.Item,{disabled:o.isPending,onSelect:()=>m(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l.Separator,{}),(0,V.jsx)(l.Item,{disabled:o.isPending,onSelect:()=>h(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(C()),l=a(w()),[u,d]=(0,L.useState)(``),p=()=>R(s),m=()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();c.mutate({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:u.trim()||`User requested pause`,expires_at:e}},{onSuccess:e=>{n(e),p(),t()},onError:N(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),p(),t()},onError:N(`Failed to resume alerts`)})},g=c.isPending||l.isPending;return(0,V.jsxs)(`div`,{children:[!o&&(0,V.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,V.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,P(e.expires_at)]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>h(e.id),disabled:g,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,V.jsx)(f,{type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:g,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsx)(_,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function W({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=z(e),a=!e.is_read;return(0,V.jsxs)(`div`,{className:`relative rounded-lg border border-[var(--border-base)] p-4`,style:{background:e.is_resolved?`var(--surface-base)`:`var(--surface-lift)`,opacity:e.is_resolved?.75:1},children:[(0,V.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-negative-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,V.jsx)(y,{className:`h-3 w-3`}),`Alert`]}),i&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--surface-base)] px-2 py-0.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsx)(v,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-positive-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,children:[(0,V.jsx)(g,{className:`h-3 w-3`}),`Resolved`]})]}),(0,V.jsx)(`h3`,{className:`text-body-medium-default leading-tight`,style:{color:e.is_resolved?`var(--content-secondary)`:`var(--content-default)`},children:e.title}),e.body&&(0,V.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsxs)(`span`,{children:[`Last seen `,P(e.last_seen_at)]}),e.occurrence_count>1&&(0,V.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id,a),disabled:n,className:`flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-body-small-default transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,style:{background:a?`var(--primary-base)`:`var(--surface-base)`,color:a?`var(--content-inset)`:`var(--content-secondary)`},children:[n?(0,V.jsx)(_,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(g,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,V.jsx)(H,{notificationId:e.id,currentlySnoozed:i,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,children:[(0,V.jsx)(v,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=k({platformHostedOnly:!0}),t=j(),o=A(),c=r(),l=x(),[f,m]=(0,L.useState)(`open`),[g,v]=(0,L.useState)(!1),[y,C]=(0,L.useState)([]),{data:w,isLoading:E,isError:D,refetch:O}=i({...T({query:{status:f}}),enabled:e===`full`&&t}),N=e===`full`&&o||(t?E:!1);(0,L.useEffect)(()=>{!t&&g&&v(!1)},[t,g]);let P=t?D:!1,z=t?w?.results??[]:[],B=z.filter(e=>!e.is_read&&!e.is_resolved),H=a(S()),[G,K]=(0,L.useState)(new Set),[q,J]=(0,L.useState)(!1),Y=(0,L.useCallback)(()=>R(c),[c]),X=async(e,t)=>{K(t=>new Set(t).add(e));try{await H.mutateAsync({path:{id:e},body:{acknowledged:t}}),Y()}catch(e){p.error(e instanceof Error?e.message:`Failed to update notification`)}finally{K(t=>{let n=new Set(t);return n.delete(e),n})}},Z=async()=>{if(!(B.length===0||q)){J(!0);try{await Promise.allSettled(B.map(e=>H.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{Y(),J(!1)}}},Q=(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,title:`Pause alerts`,children:[(0,V.jsx)(F,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),$=(0,V.jsx)(U,{existingRules:y,onClose:()=>v(!1),onPauseCreated:e=>C(t=>[...t,e]),onPauseDeleted:e=>C(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,V.jsx)(n,{replace:!0,to:b.settings.general}):e===`disabled`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(h,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,V.jsx)(M,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(h,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(l?(0,V.jsxs)(s.Root,{open:g,onOpenChange:v,children:[(0,V.jsx)(s.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(s.Content,{children:[(0,V.jsx)(s.Header,{children:(0,V.jsx)(s.Title,{children:`Pause alerts`})}),(0,V.jsx)(s.Body,{children:(0,V.jsx)(U,{existingRules:y,onClose:()=>v(!1),onPauseCreated:e=>C(t=>[...t,e]),onPauseDeleted:e=>C(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(d.Root,{open:g,onOpenChange:v,children:[(0,V.jsx)(d.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(d.Content,{align:`end`,className:`w-72`,children:$})]}))]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-1`,children:[`open`,`resolved`].map(e=>{let t=f===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(e),className:`cursor-pointer rounded px-3 py-1 text-body-small-default capitalize transition-colors`,style:{background:t?`var(--surface-lift)`:`transparent`,color:t?`var(--content-default)`:`var(--content-secondary)`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.08)`:void 0},children:e},e)})}),f===`open`&&B.length>1&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>void Z(),disabled:q,className:`ml-auto flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-transparent px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:[q?(0,V.jsx)(_,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(I,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),N?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,V.jsx)(_,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(u,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void O(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):z.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,V.jsx)(h,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,V.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,f,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:f===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:z.map(e=>(0,V.jsx)(W,{notification:e,onAck:(e,t)=>void X(e,t),isAcking:G.has(e.id)},e.id))})]})}export{G as NotificationsPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as r}from"./QueryClientProvider-DgWA3A3c.js";import{t as i}from"./useMutation-D3WkZnYg.js";import{t as a}from"./jsx-runtime-B-mvcaJS.js";import{t as o}from"./useQuery-cVuP8q1x.js";import{n as s,t as c}from"./panel-item-DN2CyWOT.js";import{t as l}from"./menu-_JM4udVm.js";import{t as u}from"./notice-BhqKj_VM.js";import{t as d}from"./popover-BIr0nN9H.js";import{t as f}from"./input-BLN3wmw2.js";import{n as p}from"./toast-VJ6jFKB9.js";import{t as m}from"./createLucideIcon-D8roAprb.js";import{t as h}from"./bell-B-09xFrv.js";import{t as g}from"./check-DwLoiFa9.js";import{t as _}from"./loader-circle-cYXxWP5B.js";import{t as v}from"./moon-DSWoApF5.js";import{t as y}from"./triangle-alert-DqPPHRPD.js";import{a as b}from"./routes-Dzl0kj5j.js";import{n as x}from"./use-is-mobile-BF5x8sr8.js";import{ct as S,dt as C,ft as w,lt as T,mt as E,pt as D,ut as O}from"./react-query.gen-breoeUVK.js";import{in as k,nn as A,rn as j,x as M}from"./index-3zpPFBeR.js";import{t as N}from"./mutation-error-B5AKP6aC.js";import{r as P}from"./format-date-DyMQp2_m.js";var F=m(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=m(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),L=e(t(),1);function R(e){e.invalidateQueries({queryKey:O()}),e.invalidateQueries({queryKey:E()})}function z(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var B=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],V=a();function H({notificationId:e,currentlySnoozed:t,children:n}){let a=r(),o=i(D()),u=x(),[d,f]=(0,L.useState)(!1),p=()=>R(a),m=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:p,onError:N(`Failed to snooze notification`)})},h=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:p,onError:N(`Failed to clear snooze`)})};return u?(0,V.jsxs)(s.Root,{open:d,onOpenChange:f,children:[(0,V.jsx)(s.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(s.Content,{children:[(0,V.jsx)(s.Header,{children:(0,V.jsx)(s.Title,{children:`Snooze until…`})}),(0,V.jsxs)(s.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(c,{label:e,onSelect:()=>{o.isPending||(f(!1),m(t))}},e)),t&&(0,V.jsx)(c,{label:`Clear snooze`,onSelect:()=>{o.isPending||(f(!1),h())}})]})]})]}):(0,V.jsxs)(l.Root,{open:d,onOpenChange:f,children:[(0,V.jsx)(l.Trigger,{children:n}),(0,V.jsxs)(l.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(l.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(l.Item,{disabled:o.isPending,onSelect:()=>m(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l.Separator,{}),(0,V.jsx)(l.Item,{disabled:o.isPending,onSelect:()=>h(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:a,hideTitle:o=!1}){let s=r(),c=i(C()),l=i(w()),[u,d]=(0,L.useState)(``),p=()=>R(s),m=()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();c.mutate({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:u.trim()||`User requested pause`,expires_at:e}},{onSuccess:e=>{n(e),p(),t()},onError:N(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{a(e),p(),t()},onError:N(`Failed to resume alerts`)})},g=c.isPending||l.isPending;return(0,V.jsxs)(`div`,{children:[!o&&(0,V.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,V.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,P(e.expires_at)]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>h(e.id),disabled:g,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,V.jsx)(f,{type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:g,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsx)(_,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function W({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=z(e),a=!e.is_read;return(0,V.jsxs)(`div`,{className:`relative rounded-lg border border-[var(--border-base)] p-4`,style:{background:e.is_resolved?`var(--surface-base)`:`var(--surface-lift)`,opacity:e.is_resolved?.75:1},children:[(0,V.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-negative-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,V.jsx)(y,{className:`h-3 w-3`}),`Alert`]}),i&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--surface-base)] px-2 py-0.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsx)(v,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-positive-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,children:[(0,V.jsx)(g,{className:`h-3 w-3`}),`Resolved`]})]}),(0,V.jsx)(`h3`,{className:`text-body-medium-default leading-tight`,style:{color:e.is_resolved?`var(--content-secondary)`:`var(--content-default)`},children:e.title}),e.body&&(0,V.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsxs)(`span`,{children:[`Last seen `,P(e.last_seen_at)]}),e.occurrence_count>1&&(0,V.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id,a),disabled:n,className:`flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-body-small-default transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,style:{background:a?`var(--primary-base)`:`var(--surface-base)`,color:a?`var(--content-inset)`:`var(--content-secondary)`},children:[n?(0,V.jsx)(_,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(g,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,V.jsx)(H,{notificationId:e.id,currentlySnoozed:i,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,children:[(0,V.jsx)(v,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=k({platformHostedOnly:!0}),t=A(),a=j(),c=r(),l=x(),[f,m]=(0,L.useState)(`open`),[g,v]=(0,L.useState)(!1),[y,C]=(0,L.useState)([]),{data:w,isLoading:E,isError:D,refetch:O}=o({...T({query:{status:f}}),enabled:e===`full`&&t}),N=e===`full`&&a||(t?E:!1);(0,L.useEffect)(()=>{!t&&g&&v(!1)},[t,g]);let P=t?D:!1,z=t?w?.results??[]:[],B=z.filter(e=>!e.is_read&&!e.is_resolved),H=i(S()),[G,K]=(0,L.useState)(new Set),[q,J]=(0,L.useState)(!1),Y=(0,L.useCallback)(()=>R(c),[c]),X=async(e,t)=>{K(t=>new Set(t).add(e));try{await H.mutateAsync({path:{id:e},body:{acknowledged:t}}),Y()}catch(e){p.error(e instanceof Error?e.message:`Failed to update notification`)}finally{K(t=>{let n=new Set(t);return n.delete(e),n})}},Z=async()=>{if(!(B.length===0||q)){J(!0);try{await Promise.allSettled(B.map(e=>H.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{Y(),J(!1)}}},Q=(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,title:`Pause alerts`,children:[(0,V.jsx)(F,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),$=(0,V.jsx)(U,{existingRules:y,onClose:()=>v(!1),onPauseCreated:e=>C(t=>[...t,e]),onPauseDeleted:e=>C(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,V.jsx)(n,{replace:!0,to:b.settings.general}):e===`disabled`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(h,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,V.jsx)(M,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(h,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(l?(0,V.jsxs)(s.Root,{open:g,onOpenChange:v,children:[(0,V.jsx)(s.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(s.Content,{children:[(0,V.jsx)(s.Header,{children:(0,V.jsx)(s.Title,{children:`Pause alerts`})}),(0,V.jsx)(s.Body,{children:(0,V.jsx)(U,{existingRules:y,onClose:()=>v(!1),onPauseCreated:e=>C(t=>[...t,e]),onPauseDeleted:e=>C(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(d.Root,{open:g,onOpenChange:v,children:[(0,V.jsx)(d.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(d.Content,{align:`end`,className:`w-72`,children:$})]}))]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-1`,children:[`open`,`resolved`].map(e=>{let t=f===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(e),className:`cursor-pointer rounded px-3 py-1 text-body-small-default capitalize transition-colors`,style:{background:t?`var(--surface-lift)`:`transparent`,color:t?`var(--content-default)`:`var(--content-secondary)`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.08)`:void 0},children:e},e)})}),f===`open`&&B.length>1&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>void Z(),disabled:q,className:`ml-auto flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-transparent px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:[q?(0,V.jsx)(_,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(I,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),N?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,V.jsx)(_,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(u,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void O(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):z.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,V.jsx)(h,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,V.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,f,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:f===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:z.map(e=>(0,V.jsx)(W,{notification:e,onAck:(e,t)=>void X(e,t),isAcking:G.has(e.id)},e.id))})]})}export{G as NotificationsPage};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{Et as i}from"./index-PRnvH2Y1.js";var a=e(t(),1),o=r();function s(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,o.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function c(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var l=`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-B-mvcaJS.js";import{Et as i}from"./index-3zpPFBeR.js";var a=e(t(),1),o=r();function s(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,o.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function c(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var l=`
2
2
  :root {
3
3
  --oauth-surface: #F5F3EB;
4
4
  --oauth-surface-card: #FFFFFF;
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{n as i,r as a}from"./native-deep-link-BYNI6pkW.js";import{Et as o}from"./index-PRnvH2Y1.js";var s=e(t(),1),c=r();function l(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,c.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function u(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var d=`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-B-mvcaJS.js";import{n as i,r as a}from"./native-deep-link-DmJ7Ty6z.js";import{Et as o}from"./index-3zpPFBeR.js";var s=e(t(),1),c=r();function l(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,c.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function u(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var d=`
2
2
  :root {
3
3
  --oauth-surface: #F5F3EB;
4
4
  --oauth-surface-card: #FFFFFF;
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./cn-DvW5mxZR.js";import"./src-CK6bncSg.js";var n=e();function r({children:e,className:r}){return(0,n.jsx)(`div`,{className:t(`flex min-h-0 flex-1 flex-col rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-6 py-5`,r),children:e})}export{r as t};
1
+ import{t as e}from"./jsx-runtime-B-mvcaJS.js";import{t}from"./cn-CFvi8Z0K.js";import"./src-Dr68ou95.js";var n=e();function r({children:e,className:r}){return(0,n.jsx)(`div`,{className:t(`flex min-h-0 flex-1 flex-col rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-6 py-5`,r),children:e})}export{r as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{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
+ 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-B-mvcaJS.js";import{h as a}from"./local-mode-Cez1weue.js";import{t as o}from"./circle-alert-BB_iJtM8.js";import{t as s}from"./circle-check-Cwv8JCfw.js";import{t as c}from"./loader-circle-cYXxWP5B.js";import{a as l,i as u,n as d,o as f,r as p,t as m}from"./return-to-DlPFMVLx.js";import{a as h}from"./routes-Dzl0kj5j.js";import{t as g}from"./index-3zpPFBeR.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 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{C as n,E as r,S as i,a,o,y as s}from"./button-D7s2Q_uG.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{a as l,o as u,r as d,t as f}from"./cn-DvW5mxZR.js";import{t as p}from"./createLucideIcon-Bjb-Kuq7.js";import{n as m}from"./dist-cApvLul2.js";import{a as h,c as g,i as _,n as v,o as y,r as b,s as x,t as S}from"./dist-B0Gf-knw.js";var C=p(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),w=e(t(),1),T=c();function E(e){let t=D(e),n=w.forwardRef((e,n)=>{let{children:r,...i}=e,a=w.Children.toArray(r),o=a.find(k);if(o){let e=o.props.children,r=a.map(t=>t===o?w.Children.count(e)>1?w.Children.only(null):w.isValidElement(e)?e.props.children:null:t);return(0,T.jsx)(t,{...i,ref:n,children:w.isValidElement(e)?w.cloneElement(e,void 0,r):null})}return(0,T.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function D(e){let t=w.forwardRef((e,t)=>{let{children:n,...r}=e;if(w.isValidElement(n)){let e=j(n),i=A(r,n.props);return n.type!==w.Fragment&&(i.ref=t?l(t,e):e),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var O=Symbol(`radix.slottable`);function k(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===O}function A(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function j(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function M(e){let t=e+`CollectionProvider`,[n,i]=r(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:n}=e,r=w.useRef(null),i=w.useRef(new Map).current;return(0,T.jsx)(a,{scope:t,itemMap:i,collectionRef:r,children:n})};s.displayName=t;let c=e+`CollectionSlot`,l=E(c),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,T.jsx)(l,{ref:u(t,o(c,n).collectionRef),children:r})});d.displayName=c;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=E(f),h=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=w.useRef(null),s=u(t,a),c=o(f,n);return w.useEffect(()=>(c.itemMap.set(a,{ref:a,...i}),()=>void c.itemMap.delete(a))),(0,T.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=o(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:s,Slot:d,ItemSlot:h},g,i]}var N=w.createContext(void 0);function P(e){let t=w.useContext(N);return e||t||`ltr`}var F=`rovingFocusGroup.onEntryFocus`,I={bubbles:!1,cancelable:!0},L=`RovingFocusGroup`,[R,z,B]=M(L),[ee,te]=r(L,[B]),[ne,V]=ee(L),H=w.forwardRef((e,t)=>(0,T.jsx)(R.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(R.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(U,{...e,ref:t})})}));H.displayName=L;var U=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:a,loop:s=!1,dir:c,currentTabStopId:l,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:p,preventScrollOnEntryFocus:h=!1,...g}=e,_=w.useRef(null),v=u(t,_),y=P(c),[b,x]=o({prop:l,defaultProp:d??null,onChange:f,caller:L}),[S,C]=w.useState(!1),E=i(p),D=z(r),O=w.useRef(!1),[k,A]=w.useState(0);return w.useEffect(()=>{let e=_.current;if(e)return e.addEventListener(F,E),()=>e.removeEventListener(F,E)},[E]),(0,T.jsx)(ne,{scope:r,orientation:a,dir:y,loop:s,currentTabStopId:b,onItemFocus:w.useCallback(e=>x(e),[x]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>A(e=>e+1),[]),onFocusableItemRemove:w.useCallback(()=>A(e=>e-1),[]),children:(0,T.jsx)(n.div,{tabIndex:S||k===0?-1:0,"data-orientation":a,...g,ref:v,style:{outline:`none`,...e.style},onMouseDown:m(e.onMouseDown,()=>{O.current=!0}),onFocus:m(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!S){let t=new CustomEvent(F,I);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);Y([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),h)}}O.current=!1}),onBlur:m(e.onBlur,()=>C(!1))})})}),W=`RovingFocusGroupItem`,G=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:i=!0,active:a=!1,tabStopId:o,children:c,...l}=e,u=s(),d=o||u,f=V(W,r),p=f.currentTabStopId===d,h=z(r),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:v}=f;return w.useEffect(()=>{if(i)return g(),()=>_()},[i,g,_]),(0,T.jsx)(R.ItemSlot,{scope:r,id:d,focusable:i,active:a,children:(0,T.jsx)(n.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:m(e.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:m(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:m(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=J(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?X(n,r+1):n.slice(r+1)}setTimeout(()=>Y(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:v!=null}):c})})});G.displayName=W;var K={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function q(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function J(e,t,n){let r=q(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return K[r]}function Y(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function X(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Z=H,re=G,Q=(0,w.createContext)({});function ie({onOpenChange:e,...t}){return(0,T.jsx)(Q,{value:{onOpenChange:e},children:(0,T.jsx)(y,{onOpenChange:e,...t})})}function ae(e){return(0,T.jsx)(g,{"data-slot":`bottom-sheet-trigger`,...e})}function oe({overlayClassName:e,className:t,children:n,ref:r,...i}){let o=a(),{onOpenChange:s}=(0,w.useContext)(Q);return(0,T.jsxs)(h,{container:o??void 0,children:[(0,T.jsx)(_,{"data-slot":`bottom-sheet-overlay`,className:f(`fixed inset-0 z-50 bg-black/50`,e),onClick:()=>s?.(!1)}),(0,T.jsx)(v,{ref:r,"data-slot":`bottom-sheet-content`,className:f(`fixed inset-x-0 bottom-0 z-50 flex w-full flex-col rounded-t-[24px] border-t bg-[var(--surface-lift)] border-[var(--border-base)] shadow-xl focus:outline-none`,`max-h-[50dvh]`,`data-[state=open]:animate-[bottomSheetIn_180ms_ease-out]`,t),...i,children:(0,T.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-4 pt-4 pb-[calc(16px+var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)))]`,children:n})})]})}function se({icon:e,className:t,children:n,ref:r,...i}){return(0,T.jsxs)(x,{ref:r,"data-slot":`bottom-sheet-title`,className:f(`flex items-center gap-3 text-title-medium text-[var(--content-default)]`,t),...i,children:[e?(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--primary-base) 16%, transparent)`},children:(0,T.jsx)(e,{className:`h-5 w-5 text-[var(--primary-base)]`})}):null,(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:n})]})}function ce({className:e,children:t,ref:n,...r}){return(0,T.jsx)(b,{ref:n,"data-slot":`bottom-sheet-description`,className:f(`mt-1 whitespace-pre-line text-body-medium-lighter text-[var(--content-secondary)]`,e),...r,children:t})}function le(e){return(0,T.jsx)(S,{"data-slot":`bottom-sheet-close`,...e})}function ue({className:e,children:t,...n}){return(0,T.jsx)(`div`,{"data-slot":`bottom-sheet-header`,className:f(`flex flex-col gap-1`,e),...n,children:t})}function de({className:e,children:t,...n}){return(0,T.jsx)(`div`,{"data-slot":`bottom-sheet-body`,className:f(`flex-1 overflow-y-auto pt-4 text-[var(--content-default)]`,e),...n,children:t})}function fe({className:e,children:t,...n}){return(0,T.jsx)(`div`,{"data-slot":`bottom-sheet-footer`,className:f(`flex justify-end gap-2 pt-4`,e),...n,children:t})}var pe={Root:ie,Trigger:ae,Content:oe,Title:se,Description:ce,Close:le,Header:ue,Body:de,Footer:fe},me=50,he=2e3,ge=.8;function _e({children:e,className:t}){let n=(0,w.useRef)(null),r=(0,w.useRef)(null),[i,a]=(0,w.useState)(0);(0,w.useEffect)(()=>{let e=n.current,t=r.current;if(!e||!t)return;let i=()=>{let n=t.scrollWidth-e.clientWidth;a(n>0?n:0)};i();let o=new ResizeObserver(i);return o.observe(e),o.observe(t),()=>o.disconnect()},[e]);let o=i>0,s=Math.max(he,Math.round(i*2/me*1e3)),c=Math.round(s/ge);return(0,T.jsxs)(`span`,{"data-slot":`marquee-text`,ref:n,className:f(`relative min-w-0 flex-1 overflow-hidden`,t),children:[(0,T.jsx)(`span`,{className:`block truncate motion-safe:group-hover:invisible`,children:e}),(0,T.jsx)(`span`,{ref:r,"aria-hidden":!0,className:f(`absolute top-0 left-0 invisible block whitespace-nowrap`,`motion-safe:group-hover:visible`,o&&`motion-safe:group-hover:animate-panelitem-marquee`),style:o?{"--panelitem-marquee-distance":`${i}px`,"--panelitem-marquee-duration":`${c}ms`}:void 0,children:e})]})}var ve=[`group relative`,`flex h-8 max-md:h-auto w-full items-center justify-between`,`rounded-[6px] p-[8px] max-md:py-3 gap-[4px]`,`text-left text-body-medium-lighter max-md:text-body-large-default`,`transition-colors`,`bg-transparent`,`text-[var(--content-secondary)]`,`outline-none`].join(` `),ye=[`hover:bg-[var(--surface-hover)]`,`keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)]`,`cursor-pointer select-none`].join(` `),be=[`aria-[current=page]:bg-[var(--surface-active)]`,`aria-[current=page]:text-[var(--content-emphasised)]`].join(` `),$=[`aria-[current=page]:bg-[color-mix(in_oklab,var(--primary-base)_10%,transparent)]`,`aria-[current=page]:text-[var(--primary-base)]`,`aria-[current=page]:font-medium`].join(` `),xe=`flex min-w-0 flex-1 items-center gap-[8px]`,Se=[`shrink-0`,`text-[var(--content-tertiary)]`,`group-hover:text-[var(--content-secondary)]`].join(` `),Ce=`group-aria-[current=page]:text-[var(--content-default)]`,we=`group-aria-[current=page]:text-[var(--primary-base)]`,Te=`min-w-0 flex-1 truncate`,Ee=`shrink-0 text-[var(--content-tertiary)]`,De=`flex items-center gap-2 shrink-0`,Oe=[`inline-flex items-center justify-center shrink-0`,`text-label-small-default leading-none`,`text-[var(--content-tertiary)]`,`rounded-[4px] bg-[var(--surface-base)] px-[4px] py-[2px]`,`group-hover:bg-transparent group-hover:rounded-none`,`group-hover:px-0 group-hover:py-0`,`group-aria-[current=page]:bg-transparent group-aria-[current=page]:rounded-none`,`group-aria-[current=page]:px-0 group-aria-[current=page]:py-0`].join(` `),ke=[`flex items-center shrink-0`,`opacity-0 transition-opacity`,`group-hover:opacity-100`,`group-aria-[current=page]:opacity-100`].join(` `);function Ae({icon:e,leadingSlot:t,label:n,expandChevron:r,badge:i,trailingAction:a,active:o=!1,activeVariant:s=`default`,disabled:c=!1,onSelect:l,href:u,marqueeOnHover:p=!1,className:m,"aria-label":h,asChild:g=!1,children:_,ref:v,...y}){let b=o?`page`:void 0,x=h??(typeof n==`string`?n:void 0),S=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`span`,{className:xe,children:[t===void 0?e?(0,T.jsx)(e,{size:14,"aria-hidden":!0,className:f(`max-md:size-4`,Se,s===`branded`?we:Ce)}):null:t,p?(0,T.jsx)(_e,{children:n}):(0,T.jsx)(`span`,{className:Te,children:n}),r?(0,T.jsx)(r,{size:12,"aria-hidden":!0,className:Ee}):null]}),(0,T.jsxs)(`span`,{className:De,children:[i==null?null:(0,T.jsx)(`span`,{className:Oe,children:i}),a?(0,T.jsx)(`span`,{className:ke,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:a}):null]})]}),C=f(ve,(g||!!u||!!l)&&ye,s===`branded`?$:be,m);if(g)return(0,T.jsx)(d,{"data-slot":`panel-item`,ref:v,className:C,"aria-current":b,"aria-label":x,...y,children:_});if(u){let{onClick:e,...t}=y;return(0,T.jsx)(`a`,{...t,"data-slot":`panel-item`,ref:v,href:u,className:C,"aria-current":b,"aria-label":x,onClick:t=>{e?.(t),t.defaultPrevented||l?.()},children:S})}if(l){let{onClick:e,onKeyDown:t,...n}=y,r=t=>{if(c){t.preventDefault();return}e?.(t),t.defaultPrevented||l()},i=e=>{c||(t?.(e),!e.defaultPrevented&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l()))};return(0,T.jsx)(`div`,{...n,"data-slot":`panel-item`,ref:v,role:`button`,tabIndex:c?-1:0,"aria-disabled":c||void 0,className:C,"aria-current":b,"aria-label":x,onClick:r,onKeyDown:i,children:S})}return(0,T.jsx)(`div`,{"data-slot":`panel-item`,ref:v,className:C,"aria-current":b,"aria-label":x,...y,children:S})}export{te as a,C as c,Z as i,pe as n,P as o,re as r,M as s,Ae as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{C as n,E as r,S as i,a,o,y as s}from"./button-BvHa6F59.js";import{t as c}from"./jsx-runtime-B-mvcaJS.js";import{a as l,o as u,r as d,t as f}from"./cn-CFvi8Z0K.js";import{t as p}from"./createLucideIcon-6rJ6BdB7.js";import{n as m}from"./dist-Ble8OyWO.js";import{a as h,c as g,i as _,n as v,o as y,r as b,s as x,t as S}from"./dist-BkSUb6s0.js";var C=p(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),w=e(t(),1),T=c();function E(e){let t=D(e),n=w.forwardRef((e,n)=>{let{children:r,...i}=e,a=w.Children.toArray(r),o=a.find(k);if(o){let e=o.props.children,r=a.map(t=>t===o?w.Children.count(e)>1?w.Children.only(null):w.isValidElement(e)?e.props.children:null:t);return(0,T.jsx)(t,{...i,ref:n,children:w.isValidElement(e)?w.cloneElement(e,void 0,r):null})}return(0,T.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function D(e){let t=w.forwardRef((e,t)=>{let{children:n,...r}=e;if(w.isValidElement(n)){let e=j(n),i=A(r,n.props);return n.type!==w.Fragment&&(i.ref=t?l(t,e):e),w.cloneElement(n,i)}return w.Children.count(n)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var O=Symbol(`radix.slottable`);function k(e){return w.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===O}function A(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function j(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function M(e){let t=e+`CollectionProvider`,[n,i]=r(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:n}=e,r=w.useRef(null),i=w.useRef(new Map).current;return(0,T.jsx)(a,{scope:t,itemMap:i,collectionRef:r,children:n})};s.displayName=t;let c=e+`CollectionSlot`,l=E(c),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,T.jsx)(l,{ref:u(t,o(c,n).collectionRef),children:r})});d.displayName=c;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=E(f),h=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=w.useRef(null),s=u(t,a),c=o(f,n);return w.useEffect(()=>(c.itemMap.set(a,{ref:a,...i}),()=>void c.itemMap.delete(a))),(0,T.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=o(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:s,Slot:d,ItemSlot:h},g,i]}var N=w.createContext(void 0);function P(e){let t=w.useContext(N);return e||t||`ltr`}var F=`rovingFocusGroup.onEntryFocus`,I={bubbles:!1,cancelable:!0},L=`RovingFocusGroup`,[R,z,B]=M(L),[ee,te]=r(L,[B]),[ne,V]=ee(L),H=w.forwardRef((e,t)=>(0,T.jsx)(R.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(R.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(U,{...e,ref:t})})}));H.displayName=L;var U=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:a,loop:s=!1,dir:c,currentTabStopId:l,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:p,preventScrollOnEntryFocus:h=!1,...g}=e,_=w.useRef(null),v=u(t,_),y=P(c),[b,x]=o({prop:l,defaultProp:d??null,onChange:f,caller:L}),[S,C]=w.useState(!1),E=i(p),D=z(r),O=w.useRef(!1),[k,A]=w.useState(0);return w.useEffect(()=>{let e=_.current;if(e)return e.addEventListener(F,E),()=>e.removeEventListener(F,E)},[E]),(0,T.jsx)(ne,{scope:r,orientation:a,dir:y,loop:s,currentTabStopId:b,onItemFocus:w.useCallback(e=>x(e),[x]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>A(e=>e+1),[]),onFocusableItemRemove:w.useCallback(()=>A(e=>e-1),[]),children:(0,T.jsx)(n.div,{tabIndex:S||k===0?-1:0,"data-orientation":a,...g,ref:v,style:{outline:`none`,...e.style},onMouseDown:m(e.onMouseDown,()=>{O.current=!0}),onFocus:m(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!S){let t=new CustomEvent(F,I);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);Y([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),h)}}O.current=!1}),onBlur:m(e.onBlur,()=>C(!1))})})}),W=`RovingFocusGroupItem`,G=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:i=!0,active:a=!1,tabStopId:o,children:c,...l}=e,u=s(),d=o||u,f=V(W,r),p=f.currentTabStopId===d,h=z(r),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:v}=f;return w.useEffect(()=>{if(i)return g(),()=>_()},[i,g,_]),(0,T.jsx)(R.ItemSlot,{scope:r,id:d,focusable:i,active:a,children:(0,T.jsx)(n.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:m(e.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:m(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:m(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=J(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?X(n,r+1):n.slice(r+1)}setTimeout(()=>Y(n))}}),children:typeof c==`function`?c({isCurrentTabStop:p,hasTabStop:v!=null}):c})})});G.displayName=W;var K={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function q(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function J(e,t,n){let r=q(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return K[r]}function Y(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function X(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Z=H,re=G,Q=(0,w.createContext)({});function ie({onOpenChange:e,...t}){return(0,T.jsx)(Q,{value:{onOpenChange:e},children:(0,T.jsx)(y,{onOpenChange:e,...t})})}function ae(e){return(0,T.jsx)(g,{"data-slot":`bottom-sheet-trigger`,...e})}function oe({overlayClassName:e,className:t,children:n,ref:r,...i}){let o=a(),{onOpenChange:s}=(0,w.useContext)(Q);return(0,T.jsxs)(h,{container:o??void 0,children:[(0,T.jsx)(_,{"data-slot":`bottom-sheet-overlay`,className:f(`fixed inset-0 z-50 bg-black/50`,e),onClick:()=>s?.(!1)}),(0,T.jsx)(v,{ref:r,"data-slot":`bottom-sheet-content`,className:f(`fixed inset-x-0 bottom-0 z-50 flex w-full flex-col rounded-t-[24px] border-t bg-[var(--surface-lift)] border-[var(--border-base)] shadow-xl focus:outline-none`,`max-h-[50dvh]`,`data-[state=open]:animate-[bottomSheetIn_180ms_ease-out]`,t),...i,children:(0,T.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-4 pt-4 pb-[calc(16px+var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)))]`,children:n})})]})}function se({icon:e,className:t,children:n,ref:r,...i}){return(0,T.jsxs)(x,{ref:r,"data-slot":`bottom-sheet-title`,className:f(`flex items-center gap-3 text-title-medium text-[var(--content-default)]`,t),...i,children:[e?(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--primary-base) 16%, transparent)`},children:(0,T.jsx)(e,{className:`h-5 w-5 text-[var(--primary-base)]`})}):null,(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:n})]})}function ce({className:e,children:t,ref:n,...r}){return(0,T.jsx)(b,{ref:n,"data-slot":`bottom-sheet-description`,className:f(`mt-1 whitespace-pre-line text-body-medium-lighter text-[var(--content-secondary)]`,e),...r,children:t})}function le(e){return(0,T.jsx)(S,{"data-slot":`bottom-sheet-close`,...e})}function ue({className:e,children:t,...n}){return(0,T.jsx)(`div`,{"data-slot":`bottom-sheet-header`,className:f(`flex flex-col gap-1`,e),...n,children:t})}function de({className:e,children:t,...n}){return(0,T.jsx)(`div`,{"data-slot":`bottom-sheet-body`,className:f(`flex-1 overflow-y-auto pt-4 text-[var(--content-default)]`,e),...n,children:t})}function fe({className:e,children:t,...n}){return(0,T.jsx)(`div`,{"data-slot":`bottom-sheet-footer`,className:f(`flex justify-end gap-2 pt-4`,e),...n,children:t})}var pe={Root:ie,Trigger:ae,Content:oe,Title:se,Description:ce,Close:le,Header:ue,Body:de,Footer:fe},me=50,he=2e3,ge=.8;function _e({children:e,className:t}){let n=(0,w.useRef)(null),r=(0,w.useRef)(null),[i,a]=(0,w.useState)(0);(0,w.useEffect)(()=>{let e=n.current,t=r.current;if(!e||!t)return;let i=()=>{let n=t.scrollWidth-e.clientWidth;a(n>0?n:0)};i();let o=new ResizeObserver(i);return o.observe(e),o.observe(t),()=>o.disconnect()},[e]);let o=i>0,s=Math.max(he,Math.round(i*2/me*1e3)),c=Math.round(s/ge);return(0,T.jsxs)(`span`,{"data-slot":`marquee-text`,ref:n,className:f(`relative min-w-0 flex-1 overflow-hidden`,t),children:[(0,T.jsx)(`span`,{className:`block truncate motion-safe:group-hover:invisible`,children:e}),(0,T.jsx)(`span`,{ref:r,"aria-hidden":!0,className:f(`absolute top-0 left-0 invisible block whitespace-nowrap`,`motion-safe:group-hover:visible`,o&&`motion-safe:group-hover:animate-panelitem-marquee`),style:o?{"--panelitem-marquee-distance":`${i}px`,"--panelitem-marquee-duration":`${c}ms`}:void 0,children:e})]})}var ve=[`group relative`,`flex h-8 max-md:h-auto w-full items-center justify-between`,`rounded-[6px] p-[8px] max-md:py-3 gap-[4px]`,`text-left text-body-medium-lighter max-md:text-body-large-default`,`transition-colors`,`bg-transparent`,`text-[var(--content-secondary)]`,`outline-none`].join(` `),ye=[`hover:bg-[var(--surface-hover)]`,`keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)]`,`cursor-pointer select-none`].join(` `),be=[`aria-[current=page]:bg-[var(--surface-active)]`,`aria-[current=page]:text-[var(--content-emphasised)]`].join(` `),$=[`aria-[current=page]:bg-[color-mix(in_oklab,var(--primary-base)_10%,transparent)]`,`aria-[current=page]:text-[var(--primary-base)]`,`aria-[current=page]:font-medium`].join(` `),xe=`flex min-w-0 flex-1 items-center gap-[8px]`,Se=[`shrink-0`,`text-[var(--content-tertiary)]`,`group-hover:text-[var(--content-secondary)]`].join(` `),Ce=`group-aria-[current=page]:text-[var(--content-default)]`,we=`group-aria-[current=page]:text-[var(--primary-base)]`,Te=`min-w-0 flex-1 truncate`,Ee=`shrink-0 text-[var(--content-tertiary)]`,De=`flex items-center gap-2 shrink-0`,Oe=[`inline-flex items-center justify-center shrink-0`,`text-label-small-default leading-none`,`text-[var(--content-tertiary)]`,`rounded-[4px] bg-[var(--surface-base)] px-[4px] py-[2px]`,`group-hover:bg-transparent group-hover:rounded-none`,`group-hover:px-0 group-hover:py-0`,`group-aria-[current=page]:bg-transparent group-aria-[current=page]:rounded-none`,`group-aria-[current=page]:px-0 group-aria-[current=page]:py-0`].join(` `),ke=[`flex items-center shrink-0`,`opacity-0 transition-opacity`,`group-hover:opacity-100`,`group-aria-[current=page]:opacity-100`].join(` `);function Ae({icon:e,leadingSlot:t,label:n,expandChevron:r,badge:i,trailingAction:a,active:o=!1,activeVariant:s=`default`,disabled:c=!1,onSelect:l,href:u,marqueeOnHover:p=!1,className:m,"aria-label":h,asChild:g=!1,children:_,ref:v,...y}){let b=o?`page`:void 0,x=h??(typeof n==`string`?n:void 0),S=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`span`,{className:xe,children:[t===void 0?e?(0,T.jsx)(e,{size:14,"aria-hidden":!0,className:f(`max-md:size-4`,Se,s===`branded`?we:Ce)}):null:t,p?(0,T.jsx)(_e,{children:n}):(0,T.jsx)(`span`,{className:Te,children:n}),r?(0,T.jsx)(r,{size:12,"aria-hidden":!0,className:Ee}):null]}),(0,T.jsxs)(`span`,{className:De,children:[i==null?null:(0,T.jsx)(`span`,{className:Oe,children:i}),a?(0,T.jsx)(`span`,{className:ke,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:a}):null]})]}),C=f(ve,(g||!!u||!!l)&&ye,s===`branded`?$:be,m);if(g)return(0,T.jsx)(d,{"data-slot":`panel-item`,ref:v,className:C,"aria-current":b,"aria-label":x,...y,children:_});if(u){let{onClick:e,...t}=y;return(0,T.jsx)(`a`,{...t,"data-slot":`panel-item`,ref:v,href:u,className:C,"aria-current":b,"aria-label":x,onClick:t=>{e?.(t),t.defaultPrevented||l?.()},children:S})}if(l){let{onClick:e,onKeyDown:t,...n}=y,r=t=>{if(c){t.preventDefault();return}e?.(t),t.defaultPrevented||l()},i=e=>{c||(t?.(e),!e.defaultPrevented&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),l()))};return(0,T.jsx)(`div`,{...n,"data-slot":`panel-item`,ref:v,role:`button`,tabIndex:c?-1:0,"aria-disabled":c||void 0,className:C,"aria-current":b,"aria-label":x,onClick:r,onKeyDown:i,children:S})}return(0,T.jsx)(`div`,{"data-slot":`panel-item`,ref:v,className:C,"aria-current":b,"aria-label":x,...y,children:S})}export{te as a,C as c,Z as i,pe as n,P as o,re as r,M as s,Ae as t};
@@ -1 +1 @@
1
- import{r as e}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import{a as n}from"./routes-DVqkwUEe.js";var r=t();function i(){return(0,r.jsx)(e,{to:n.account.login,replace:!0})}export{i as PasswordResetPage};
1
+ import{r as e}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t}from"./jsx-runtime-B-mvcaJS.js";import{a as n}from"./routes-Dzl0kj5j.js";var r=t();function i(){return(0,r.jsx)(e,{to:n.account.login,replace:!0})}export{i as PasswordResetPage};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-BlMXrA59.js";var t=e(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-D8roAprb.js";var t=e(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);export{t};
@@ -1 +1 @@
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
+ 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-B-mvcaJS.js";import{O as a,S as o}from"./local-mode-Cez1weue.js";import{N as s,V as c,n as l}from"./auth-store-BzL2lSd1.js";import{c as u}from"./api-DXPKXkDj.js";import{a as d}from"./routes-Dzl0kj5j.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 +1 @@
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
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BvHa6F59.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-DgWA3A3c.js";import{t as c}from"./jsx-runtime-B-mvcaJS.js";import{t as l}from"./useQuery-cVuP8q1x.js";import{t as u}from"./card-D9_3ngHI.js";import"./src-Dr68ou95.js";import{t as d}from"./confirm-dialog-BtxNY4WU.js";import{n as f}from"./toast-VJ6jFKB9.js";import{t as p}from"./arrow-left-BPsKoNcb.js";import{t as m}from"./external-link-h3UAe8eX.js";import{t as h}from"./loader-circle-cYXxWP5B.js";import{t as g}from"./triangle-alert-DqPPHRPD.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-BeTpj_Sy.js";import{a as T}from"./routes-Dzl0kj5j.js";import{t as E}from"./assistant-feature-flag-store-Ceb6N94N.js";import{Fi as D,Ir as O,L as k,Qi as A,ia as j}from"./index-3zpPFBeR.js";import{t as M}from"./use-active-assistant-id-jfqnc4T7.js";import{n as N,r as P,t as F}from"./use-plugin-drift-4-li_vW2.js";var I=e(t(),1),L=c();function R(e){return e?e.slice(0,7):`unknown`}function z(){let e=E.use.hasHydrated(),t=E.use.externalPlugins(),c=M(),{name:m}=i(),h=r(),g=s(),[D,O]=(0,I.useState)(!1),[A,j]=(0,I.useState)(!1),P=l({...y({path:{assistant_id:c,name:m??``}}),enabled:!!c&&!!m}),z=P.data?.installed??!1,G=N({assistantId:c,name:m??``,enabled:z}).data,K=(0,I.useCallback)(()=>{g.invalidateQueries({queryKey:C({path:{assistant_id:c}})}),g.invalidateQueries({queryKey:S({path:{assistant_id:c}})}),m&&(g.invalidateQueries({queryKey:_({path:{assistant_id:c,name:m}})}),g.invalidateQueries({queryKey:w({path:{assistant_id:c,name:m}})}))},[c,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:c},body:{name:m}})},Z=()=>{O(!1),J.mutate({path:{assistant_id:c,name:m}})},Q=()=>{Y.mutate({path:{assistant_id:c,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 +1 @@
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
+ 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"./jsx-runtime-B-mvcaJS.js";import{t as a}from"./useQuery-cVuP8q1x.js";import{t as o}from"./card-D9_3ngHI.js";import"./src-Dr68ou95.js";import{t as s}from"./input-BLN3wmw2.js";import{t as c}from"./chevron-right-DP15nqFC.js";import{t as l}from"./loader-circle-cYXxWP5B.js";import{t as u}from"./triangle-alert-DqPPHRPD.js";import{bn as d}from"./sdk.gen-CC1iYdd0.js";import{nt as f,rt as p}from"./react-query.gen-BeTpj_Sy.js";import{a as m}from"./routes-Dzl0kj5j.js";import{t as h}from"./assistant-feature-flag-store-Ceb6N94N.js";import{$r as g,Jr as _}from"./index-3zpPFBeR.js";import{t as v}from"./use-active-assistant-id-jfqnc4T7.js";import{n as y,r as b}from"./use-plugin-drift-4-li_vW2.js";var x=e(t(),1),S=i();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(),i=a({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=a({...p({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e,staleTime:T}),s=(0,x.useMemo)(()=>O(i.data?.plugins??[]),[i.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=i.isFetching&&!i.isLoading||o.isFetching&&!o.isLoading,h=i.isLoading,g=o.isLoading,_=!h&&!i.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,{}):i.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 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{C as n,E as r,S as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,l as p,m,o as h,p as ee,s as te,u as ne,v as re,y as g}from"./button-D7s2Q_uG.js";import{t as _}from"./jsx-runtime-CVSDxk6A.js";import{a as v,o as y,t as b}from"./cn-DvW5mxZR.js";import{n as x,t as S}from"./dist-cApvLul2.js";import{a as ie,i as ae,n as C,r as oe,t as w}from"./Combination-4Qc3vrtW.js";var T=e(t(),1),E=_(),D=`Popper`,[O,k]=r(D),[se,A]=O(D),j=e=>{let{__scopePopper:t,children:n}=e,[r,i]=T.useState(null);return(0,E.jsx)(se,{scope:t,anchor:r,onAnchorChange:i,children:n})};j.displayName=D;var M=`PopperAnchor`,N=T.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:i,...a}=e,o=A(M,r),s=T.useRef(null),c=y(t,s),l=T.useRef(null);return T.useEffect(()=>{let e=l.current;l.current=i?.current||s.current,e!==l.current&&o.onAnchorChange(l.current)}),i?null:(0,E.jsx)(n.div,{...a,ref:c})});N.displayName=M;var P=`PopperContent`,[ce,F]=O(P),I=T.forwardRef((e,t)=>{let{__scopePopper:r,side:o=`bottom`,sideOffset:p=0,align:h=`center`,alignOffset:te=0,arrowPadding:g=0,avoidCollisions:_=!0,collisionBoundary:v=[],collisionPadding:b=0,sticky:x=`partial`,hideWhenDetached:S=!1,updatePositionStrategy:ie=`optimized`,onPlaced:ae,...C}=e,oe=A(P,r),[w,D]=T.useState(null),O=y(t,e=>D(e)),[k,se]=T.useState(null),j=c(k),M=j?.width??0,N=j?.height??0,F=o+(h===`center`?``:`-`+h),I=typeof b==`number`?b:{top:0,right:0,bottom:0,left:0,...b},L=Array.isArray(v)?v:[v],le=L.length>0,R={padding:I,boundary:L.filter(ue),altBoundary:le},{refs:B,floatingStyles:V,placement:H,isPositioned:U,middlewareData:W}=a({strategy:`fixed`,placement:F,whileElementsMounted:(...e)=>re(...e,{animationFrame:ie===`always`}),elements:{reference:oe.anchor},middleware:[m({mainAxis:p+N,alignmentAxis:te}),_&&f({mainAxis:!0,crossAxis:!1,limiter:x===`partial`?ee():void 0,...R}),_&&l({...R}),d({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),k&&ne({element:k,padding:g}),de({arrowWidth:M,arrowHeight:N}),S&&u({strategy:`referenceHidden`,...R})]}),[G,fe]=z(H),K=i(ae);s(()=>{U&&K?.()},[U,K]);let pe=W.arrow?.x,me=W.arrow?.y,q=W.arrow?.centerOffset!==0,[J,he]=T.useState();return s(()=>{w&&he(window.getComputedStyle(w).zIndex)},[w]),(0,E.jsx)(`div`,{ref:B.setFloating,"data-radix-popper-content-wrapper":``,style:{...V,transform:U?V.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:J,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(` `),...W.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,E.jsx)(ce,{scope:r,placedSide:G,onArrowChange:se,arrowX:pe,arrowY:me,shouldHideArrow:q,children:(0,E.jsx)(n.div,{"data-side":G,"data-align":fe,...C,ref:O,style:{...C.style,animation:U?void 0:`none`}})})})});I.displayName=P;var L=`PopperArrow`,le={top:`bottom`,right:`left`,bottom:`top`,left:`right`},R=T.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=F(L,n),a=le[i.placedSide];return(0,E.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,E.jsx)(p,{...r,ref:t,style:{...r.style,display:`block`}})})});R.displayName=L;function ue(e){return e!==null}var de=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=z(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function z(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var B=j,V=N,H=I,U=R;function W(e){let t=G(e),n=T.forwardRef((e,n)=>{let{children:r,...i}=e,a=T.Children.toArray(r),o=a.find(K);if(o){let e=o.props.children,r=a.map(t=>t===o?T.Children.count(e)>1?T.Children.only(null):T.isValidElement(e)?e.props.children:null:t);return(0,E.jsx)(t,{...i,ref:n,children:T.isValidElement(e)?T.cloneElement(e,void 0,r):null})}return(0,E.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function G(e){let t=T.forwardRef((e,t)=>{let{children:n,...r}=e;if(T.isValidElement(n)){let e=me(n),i=pe(r,n.props);return n.type!==T.Fragment&&(i.ref=t?v(t,e):e),T.cloneElement(n,i)}return T.Children.count(n)>1?T.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fe=Symbol(`radix.slottable`);function K(e){return T.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===fe}function pe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function me(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var q=`Popover`,[J,he]=r(q,[k]),Y=k(),[ge,X]=J(q),Z=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Y(t),c=T.useRef(null),[l,u]=T.useState(!1),[d,f]=h({prop:r,defaultProp:i??!1,onChange:a,caller:q});return(0,E.jsx)(B,{...s,children:(0,E.jsx)(ge,{scope:t,contentId:g(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:T.useCallback(()=>u(!0),[]),onCustomAnchorRemove:T.useCallback(()=>u(!1),[]),modal:o,children:n})})};Z.displayName=q;var _e=`PopoverAnchor`,ve=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=X(_e,n),a=Y(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return T.useEffect(()=>(o(),()=>s()),[o,s]),(0,E.jsx)(V,{...a,...r,ref:t})});ve.displayName=_e;var ye=`PopoverTrigger`,be=T.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=X(ye,r),o=Y(r),s=y(t,a.triggerRef),c=(0,E.jsx)(n.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ne(a.open),...i,ref:s,onClick:x(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,E.jsx)(V,{asChild:!0,...o,children:c})});be.displayName=ye;var Q=`PopoverPortal`,[xe,Se]=J(Q,{forceMount:void 0}),Ce=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=X(Q,t);return(0,E.jsx)(xe,{scope:t,forceMount:n,children:(0,E.jsx)(S,{present:n||a.open,children:(0,E.jsx)(te,{asChild:!0,container:i,children:r})})})};Ce.displayName=Q;var $=`PopoverContent`,we=T.forwardRef((e,t)=>{let n=Se($,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=X($,e.__scopePopover);return(0,E.jsx)(S,{present:r||a.open,children:a.modal?(0,E.jsx)(Ee,{...i,ref:t}):(0,E.jsx)(De,{...i,ref:t})})});we.displayName=$;var Te=W(`PopoverContent.RemoveScroll`),Ee=T.forwardRef((e,t)=>{let n=X($,e.__scopePopover),r=T.useRef(null),i=y(t,r),a=T.useRef(!1);return T.useEffect(()=>{let e=r.current;if(e)return C(e)},[]),(0,E.jsx)(w,{as:Te,allowPinchZoom:!0,children:(0,E.jsx)(Oe,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:x(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),De=T.forwardRef((e,t)=>{let n=X($,e.__scopePopover),r=T.useRef(!1),i=T.useRef(!1);return(0,E.jsx)(Oe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Oe=T.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=X($,n),p=Y(n);return ae(),(0,E.jsx)(oe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,E.jsx)(ie,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,E.jsx)(H,{"data-state":Ne(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),ke=`PopoverClose`,Ae=T.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=X(ke,r);return(0,E.jsx)(n.button,{type:`button`,...i,ref:t,onClick:x(e.onClick,()=>a.onOpenChange(!1))})});Ae.displayName=ke;var je=`PopoverArrow`,Me=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Y(n);return(0,E.jsx)(U,{...i,...r,ref:t})});Me.displayName=je;function Ne(e){return e?`open`:`closed`}var Pe=Z,Fe=ve,Ie=be,Le=Ce,Re=we,ze=Ae,Be=Pe;function Ve(e){return(0,E.jsx)(Ie,{"data-slot":`popover-trigger`,...e})}function He(e){return(0,E.jsx)(ze,{"data-slot":`popover-close`,...e})}function Ue(e){return(0,E.jsx)(Fe,{"data-slot":`popover-anchor`,...e})}function We({className:e,children:t,sideOffset:n=6,align:r=`center`,ref:i,...a}){let s=o();return(0,E.jsx)(Le,{container:s??void 0,children:(0,E.jsx)(Re,{ref:i,"data-slot":`popover-content`,align:r,sideOffset:n,className:b(`z-50 rounded-lg bg-[var(--surface-lift)] p-2 shadow-[var(--shadow-popover)] outline-none`,`text-[color:var(--content-default)]`,`data-[state=open]:animate-[popoverIn_120ms_ease-out]`,e),...a,children:t})})}var Ge={Root:Be,Trigger:Ve,Content:We,Close:He,Anchor:Ue};export{B as a,H as i,V as n,k as o,U as r,Ge as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{C as n,E as r,S as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,l as p,m,o as h,p as ee,s as te,u as ne,v as re,y as g}from"./button-BvHa6F59.js";import{t as _}from"./jsx-runtime-B-mvcaJS.js";import{a as v,o as y,t as b}from"./cn-CFvi8Z0K.js";import{n as x,t as S}from"./dist-Ble8OyWO.js";import{a as ie,i as ae,n as C,r as oe,t as w}from"./Combination-DRz6Ez-m.js";var T=e(t(),1),E=_(),D=`Popper`,[O,k]=r(D),[se,A]=O(D),j=e=>{let{__scopePopper:t,children:n}=e,[r,i]=T.useState(null);return(0,E.jsx)(se,{scope:t,anchor:r,onAnchorChange:i,children:n})};j.displayName=D;var M=`PopperAnchor`,N=T.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:i,...a}=e,o=A(M,r),s=T.useRef(null),c=y(t,s),l=T.useRef(null);return T.useEffect(()=>{let e=l.current;l.current=i?.current||s.current,e!==l.current&&o.onAnchorChange(l.current)}),i?null:(0,E.jsx)(n.div,{...a,ref:c})});N.displayName=M;var P=`PopperContent`,[ce,F]=O(P),I=T.forwardRef((e,t)=>{let{__scopePopper:r,side:o=`bottom`,sideOffset:p=0,align:h=`center`,alignOffset:te=0,arrowPadding:g=0,avoidCollisions:_=!0,collisionBoundary:v=[],collisionPadding:b=0,sticky:x=`partial`,hideWhenDetached:S=!1,updatePositionStrategy:ie=`optimized`,onPlaced:ae,...C}=e,oe=A(P,r),[w,D]=T.useState(null),O=y(t,e=>D(e)),[k,se]=T.useState(null),j=c(k),M=j?.width??0,N=j?.height??0,F=o+(h===`center`?``:`-`+h),I=typeof b==`number`?b:{top:0,right:0,bottom:0,left:0,...b},L=Array.isArray(v)?v:[v],le=L.length>0,R={padding:I,boundary:L.filter(ue),altBoundary:le},{refs:B,floatingStyles:V,placement:H,isPositioned:U,middlewareData:W}=a({strategy:`fixed`,placement:F,whileElementsMounted:(...e)=>re(...e,{animationFrame:ie===`always`}),elements:{reference:oe.anchor},middleware:[m({mainAxis:p+N,alignmentAxis:te}),_&&f({mainAxis:!0,crossAxis:!1,limiter:x===`partial`?ee():void 0,...R}),_&&l({...R}),d({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),k&&ne({element:k,padding:g}),de({arrowWidth:M,arrowHeight:N}),S&&u({strategy:`referenceHidden`,...R})]}),[G,fe]=z(H),K=i(ae);s(()=>{U&&K?.()},[U,K]);let pe=W.arrow?.x,me=W.arrow?.y,q=W.arrow?.centerOffset!==0,[J,he]=T.useState();return s(()=>{w&&he(window.getComputedStyle(w).zIndex)},[w]),(0,E.jsx)(`div`,{ref:B.setFloating,"data-radix-popper-content-wrapper":``,style:{...V,transform:U?V.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:J,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(` `),...W.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,E.jsx)(ce,{scope:r,placedSide:G,onArrowChange:se,arrowX:pe,arrowY:me,shouldHideArrow:q,children:(0,E.jsx)(n.div,{"data-side":G,"data-align":fe,...C,ref:O,style:{...C.style,animation:U?void 0:`none`}})})})});I.displayName=P;var L=`PopperArrow`,le={top:`bottom`,right:`left`,bottom:`top`,left:`right`},R=T.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=F(L,n),a=le[i.placedSide];return(0,E.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,E.jsx)(p,{...r,ref:t,style:{...r.style,display:`block`}})})});R.displayName=L;function ue(e){return e!==null}var de=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=z(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function z(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var B=j,V=N,H=I,U=R;function W(e){let t=G(e),n=T.forwardRef((e,n)=>{let{children:r,...i}=e,a=T.Children.toArray(r),o=a.find(K);if(o){let e=o.props.children,r=a.map(t=>t===o?T.Children.count(e)>1?T.Children.only(null):T.isValidElement(e)?e.props.children:null:t);return(0,E.jsx)(t,{...i,ref:n,children:T.isValidElement(e)?T.cloneElement(e,void 0,r):null})}return(0,E.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function G(e){let t=T.forwardRef((e,t)=>{let{children:n,...r}=e;if(T.isValidElement(n)){let e=me(n),i=pe(r,n.props);return n.type!==T.Fragment&&(i.ref=t?v(t,e):e),T.cloneElement(n,i)}return T.Children.count(n)>1?T.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fe=Symbol(`radix.slottable`);function K(e){return T.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===fe}function pe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function me(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var q=`Popover`,[J,he]=r(q,[k]),Y=k(),[ge,X]=J(q),Z=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Y(t),c=T.useRef(null),[l,u]=T.useState(!1),[d,f]=h({prop:r,defaultProp:i??!1,onChange:a,caller:q});return(0,E.jsx)(B,{...s,children:(0,E.jsx)(ge,{scope:t,contentId:g(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:T.useCallback(()=>u(!0),[]),onCustomAnchorRemove:T.useCallback(()=>u(!1),[]),modal:o,children:n})})};Z.displayName=q;var _e=`PopoverAnchor`,ve=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=X(_e,n),a=Y(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return T.useEffect(()=>(o(),()=>s()),[o,s]),(0,E.jsx)(V,{...a,...r,ref:t})});ve.displayName=_e;var ye=`PopoverTrigger`,be=T.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=X(ye,r),o=Y(r),s=y(t,a.triggerRef),c=(0,E.jsx)(n.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ne(a.open),...i,ref:s,onClick:x(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,E.jsx)(V,{asChild:!0,...o,children:c})});be.displayName=ye;var Q=`PopoverPortal`,[xe,Se]=J(Q,{forceMount:void 0}),Ce=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=X(Q,t);return(0,E.jsx)(xe,{scope:t,forceMount:n,children:(0,E.jsx)(S,{present:n||a.open,children:(0,E.jsx)(te,{asChild:!0,container:i,children:r})})})};Ce.displayName=Q;var $=`PopoverContent`,we=T.forwardRef((e,t)=>{let n=Se($,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=X($,e.__scopePopover);return(0,E.jsx)(S,{present:r||a.open,children:a.modal?(0,E.jsx)(Ee,{...i,ref:t}):(0,E.jsx)(De,{...i,ref:t})})});we.displayName=$;var Te=W(`PopoverContent.RemoveScroll`),Ee=T.forwardRef((e,t)=>{let n=X($,e.__scopePopover),r=T.useRef(null),i=y(t,r),a=T.useRef(!1);return T.useEffect(()=>{let e=r.current;if(e)return C(e)},[]),(0,E.jsx)(w,{as:Te,allowPinchZoom:!0,children:(0,E.jsx)(Oe,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:x(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),De=T.forwardRef((e,t)=>{let n=X($,e.__scopePopover),r=T.useRef(!1),i=T.useRef(!1);return(0,E.jsx)(Oe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Oe=T.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=X($,n),p=Y(n);return ae(),(0,E.jsx)(oe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,E.jsx)(ie,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,E.jsx)(H,{"data-state":Ne(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),ke=`PopoverClose`,Ae=T.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=X(ke,r);return(0,E.jsx)(n.button,{type:`button`,...i,ref:t,onClick:x(e.onClick,()=>a.onOpenChange(!1))})});Ae.displayName=ke;var je=`PopoverArrow`,Me=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Y(n);return(0,E.jsx)(U,{...i,...r,ref:t})});Me.displayName=je;function Ne(e){return e?`open`:`closed`}var Pe=Z,Fe=ve,Ie=be,Le=Ce,Re=we,ze=Ae,Be=Pe;function Ve(e){return(0,E.jsx)(Ie,{"data-slot":`popover-trigger`,...e})}function He(e){return(0,E.jsx)(ze,{"data-slot":`popover-close`,...e})}function Ue(e){return(0,E.jsx)(Fe,{"data-slot":`popover-anchor`,...e})}function We({className:e,children:t,sideOffset:n=6,align:r=`center`,ref:i,...a}){let s=o();return(0,E.jsx)(Le,{container:s??void 0,children:(0,E.jsx)(Re,{ref:i,"data-slot":`popover-content`,align:r,sideOffset:n,className:b(`z-50 rounded-lg bg-[var(--surface-lift)] p-2 shadow-[var(--shadow-popover)] outline-none`,`text-[color:var(--content-default)]`,`data-[state=open]:animate-[popoverIn_120ms_ease-out]`,e),...a,children:t})})}var Ge={Root:Be,Trigger:Ve,Content:We,Close:He,Anchor:Ue};export{B as a,H as i,V as n,k as o,U as r,Ge as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BvHa6F59.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DgWA3A3c.js";import{t as o}from"./jsx-runtime-B-mvcaJS.js";import{t as s}from"./useQuery-cVuP8q1x.js";import{t as c}from"./card-D9_3ngHI.js";import{t as l}from"./input-BLN3wmw2.js";import{c as u,f as d,o as f}from"./local-mode-Cez1weue.js";import{t as p}from"./is-electron-URCUw74P.js";import{n as m}from"./resolved-assistants-store-BrS8JBzC.js";import{t as h}from"./check-DwLoiFa9.js";import{t as g}from"./chevron-left-CgekgptJ.js";import{t as _}from"./loader-circle-cYXxWP5B.js";import{t as v}from"./pencil-DUMCM9m-.js";import{t as y}from"./x-Bn5tweDc.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-BzL2lSd1.js";import{t as T}from"./client.gen-BnoNy2w0.js";import{a as E}from"./routes-Dzl0kj5j.js";import{o as D,r as O}from"./prefs-C6e8pdrA.js";import{t as k}from"./client-feature-flag-store-kWvb3vtZ.js";import{c as A,l as j,n as M,t as ne}from"./prechat-BuuzFtal.js";import{b as re,r as ie,yt as ae}from"./react-query.gen-breoeUVK.js";import{n as oe,t as se}from"./browser-CDQJAXkC.js";import{t as N}from"./public-asset-BTisO-cB.js";import{Ct as P,Et as F,J as ce,Ni as le,Ot as ue,Tt as I,c as de,d as fe,kt as L,l as pe,q as R,s as z,wt as B}from"./index-3zpPFBeR.js";import{c as me,i as he,l as ge,n as _e,s as ve,t as V}from"./funnel-events-Dz_DLI0Q.js";import{n as H,r as ye}from"./prechat-names-Bo5bdzfH.js";import{t as U}from"./step-indicator-dots-D4A7eDFL.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=o(),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(){pe(),z(),e()}return(0,G.jsx)(L,{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:N(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:N(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:N(`/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=ae();(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({...re({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=P(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(F(t.requestId)))},[k]);ue((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 M=(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){se(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(F(e.requestId));if(t)try{let n=JSON.parse(t);if(I(n,e.requestId)){k(n),window.localStorage.removeItem(F(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]),ne=t||`your assistant`,ie=t||`Your assistant`;return(0,G.jsx)(L,{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, ${ne} 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:`${ie} 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:M,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)(L,{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:H.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)(L,{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)(U,{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:N(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:N(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:N(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:N(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:N(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:N(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:N(`/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)(L,{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)(le,{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)(L,{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:R.map(t=>{let n=ce[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:N(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:N(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:N(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:N(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:N(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:N(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:N(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:N(`/images/integrations/github.svg`),logoSrcDark:N(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:N(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:N(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:N(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:N(`/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)(L,{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)(le,{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)(L,{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)(U,{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:H.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?M(e):ne}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(),o=S(),c=w(),l=a?.id??null,u=a?.firstName??``,f=a?.lastName??``,p=te(),h=m.use.activeAssistantId(),g=d(),_=fe()&&!de(),v=k.use.stringFlags().preChatOnboardingExperiment20260606??`control`,y=(k.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,ee=k.use.selfIntroGreeting(),T=ve(v),D=me()??T,O=D===_e.paredDown,M=g?rt():null,ne=et(),{currentStep:re,setCurrentStep:ae,clearPersistedStep:oe}=tt(l,p),se=C.use.platformSession(),N=b(se),[P,F]=(0,W.useState)(()=>new Set),[ce,le]=(0,W.useState)(()=>new Set),[ue,I]=(0,W.useState)(()=>new Set),{value:L,onChange:pe}=Ve(g&&!N?``:u||f),[R,z]=(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}=s({...ie(),enabled:!c&&o&&(!g||N)}),{data:Oe,isLoading:Ae}=s({queryKey:[`onboarding-recipe`,l],queryFn:be,enabled:!c&&o&&!p&&!g,staleTime:1/0}),q=Oe??null,J=Ee?.id??h??M,je=qe({localMode:g,platformSession:se,hasCachedPlatformAssistant:M!==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:ge(t)})}let ze=[...P].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}j(Ke({mode:p?`native`:O?`paredDown`:`control`,recipe:p?null:q,selectedTools:P,selectedTasks:ce,selectedPriorAssistants:t?.selectedPriorAssistants??ue,tone:R??q?.tone??`grounded`,userName:L,assistantName:V,selfIntroGreetingEnabled:ee,activationFlowEnabled:p?void 0:y,googleConnected:U,googleScopes:K,connectedScopes:t?.connectedScopes}));let r=V.trim();r&&A(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?ae(n):X(t)},Q=e=>{let t=$e(Y,e.id);t&&ae(t)};if(!ne||Ae)return null;let $=Y.find(e=>e.id===re)??Y[0];return $?$.id===`nativeName`?(0,G.jsx)(De,{userName:L,assistantName:V,displayedAssistantNames:B,onUserNameChange:pe,onAssistantNameChange:H,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:nt}):$.id===`nativeVibe`?(0,G.jsx)(Be,{selectedGroupId:R,onGroupChange:z,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:nt}):$.id===`name`?(0,G.jsx)(Te,{userName:L,assistantName:V,selectedGroupId:R,displayedAssistantNames:B,onUserNameChange:pe,onAssistantNameChange:H,onGroupChange:z,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,G.jsx)(Pe,{selectedTasks:ce,onChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,G.jsx)(Re,{selectedTools:P,onChange:F,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,G.jsx)(ke,{selectedAssistants:ue,onChange:I,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;I(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 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{n as i}from"./device-settings-BBwtGKJb.js";import{t as a}from"./react-DJZBPgpf.js";import{p as o}from"./auth-store-Kfxhs2oI.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.privacyConsent(),(0,s.useCallback)(e=>{o.getState().setPrivacyConsent(e)},[])]}function p(){return[o.use.analyticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setAnalyticsConsentCurrent(e)},[])]}function m(){return[o.use.diagnosticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setDiagnosticsConsentCurrent(e)},[])]}function h(){return o.getState().tosAccepted}function g(){return o.getState().privacyConsent}function _(){return o.getState().analyticsConsentCurrent}function v(){return o.getState().diagnosticsConsentCurrent}function y(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function b(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function x(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{y as a,m as c,u as d,d as f,b as i,f as l,v as n,h as o,x as p,g as r,p as s,_ as t,l as u};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{n as i}from"./device-settings-BBwtGKJb.js";import{t as a}from"./react-DJZBPgpf.js";import{p as o}from"./auth-store-BzL2lSd1.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.privacyConsent(),(0,s.useCallback)(e=>{o.getState().setPrivacyConsent(e)},[])]}function p(){return[o.use.analyticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setAnalyticsConsentCurrent(e)},[])]}function m(){return[o.use.diagnosticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setDiagnosticsConsentCurrent(e)},[])]}function h(){return o.getState().tosAccepted}function g(){return o.getState().privacyConsent}function _(){return o.getState().analyticsConsentCurrent}function v(){return o.getState().diagnosticsConsentCurrent}function y(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function b(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function x(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{y as a,m as c,u as d,d as f,b as i,f as l,v as n,h as o,x as p,g as r,p as s,_ as t,l as u};