@vellumai/web 0.10.6-staging.1 → 0.10.6

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 (252) hide show
  1. package/dist/assets/{AnimatePresence-uY0BR2n2.js → AnimatePresence-VF_hIZFD.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-BehDAEHu.js → BundleConfirmPage-DOUpVq0Q.js} +1 -1
  3. package/dist/assets/a2a-invite-Bv0xGbPM.js +1 -0
  4. package/dist/assets/{about-page-Ck4iLq7E.js → about-page-ci8HgT8u.js} +1 -1
  5. package/dist/assets/{account-page-TeIlHDQk.js → account-page-BiUlH7g9.js} +1 -1
  6. package/dist/assets/acp-run-detail-panel-B2ycT_78.js +5 -0
  7. package/dist/assets/{add-credits-modal-FyFjNQKM.js → add-credits-modal-BpZFOp84.js} +1 -1
  8. package/dist/assets/advanced-page-BClLCzBA.js +1 -0
  9. package/dist/assets/{ai-page-DpaOJJxh.js → ai-page-DnocNQmY.js} +1 -1
  10. package/dist/assets/{animated-avatar-CEC1DGcI.js → animated-avatar-FIuLddxJ.js} +1 -1
  11. package/dist/assets/{api-5fuWyrd5.js → api-DvthVfI2.js} +1 -1
  12. package/dist/assets/{api-key-screen-DP7UJY7P.js → api-key-screen-BMj30LHe.js} +1 -1
  13. package/dist/assets/{archive-page-nIOXwfyT.js → archive-page-aRD_FLfQ.js} +1 -1
  14. package/dist/assets/{assistant-feature-flag-store-D80P_lXI.js → assistant-feature-flag-store-B440uAh9.js} +1 -1
  15. package/dist/assets/{assistant-identity-store-cODRsfVo.js → assistant-identity-store-DP4B8mmA.js} +1 -1
  16. package/dist/assets/{assistant-status-panel-qHMHJPNI.js → assistant-status-panel-8WiPtFrO.js} +1 -1
  17. package/dist/assets/{auth-store-DGyzz5Ha.js → auth-store-B8KDWYi4.js} +2 -2
  18. package/dist/assets/{background-task-detail-panel-BBC1IgTy.js → background-task-detail-panel-IILCVufr.js} +1 -1
  19. package/dist/assets/{billing-page-f9MFi6zD.js → billing-page-q1D1xspC.js} +3 -3
  20. package/dist/assets/{bookmarks-page-C-gfC6Gu.js → bookmarks-page-D5XLE9A7.js} +1 -1
  21. package/dist/assets/{browser-DM38C5zq.js → browser-DdI2GrPw.js} +2 -2
  22. package/dist/assets/{build-state-CMTAZxqg.js → build-state-DAcnY2g_.js} +1 -1
  23. package/dist/assets/{capture-error-BG-GkiMq.js → capture-error-8raDoxFL.js} +1 -1
  24. package/dist/assets/channels-page-route-m_HALkI5.js +1 -0
  25. package/dist/assets/{client-feature-flag-store-CWOJ-CVU.js → client-feature-flag-store-D3f7L4rr.js} +1 -1
  26. package/dist/assets/clipboard-copy-cZENPJ25.js +1 -0
  27. package/dist/assets/{command-palette-BAhczobN.js → command-palette-BHVjkDPP.js} +1 -1
  28. package/dist/assets/{command-palette-window-page-BjRshjsQ.js → command-palette-window-page-C8htNOF6.js} +1 -1
  29. package/dist/assets/{community-page-BrzFK4eo.js → community-page-BvBiiBNT.js} +1 -1
  30. package/dist/assets/connect-page-65umesqK.js +1 -0
  31. package/dist/assets/consent-controls-CoeCtvwh.js +1 -0
  32. package/dist/assets/contacts-gateway-_mvlDweU.js +1 -0
  33. package/dist/assets/contacts-page-route-CQXKgYfo.js +1 -0
  34. package/dist/assets/{conversation-list-fetchers-COStMaVO.js → conversation-list-fetchers-D5PpdmFr.js} +1 -1
  35. package/dist/assets/{danger-zone-redirect-page-DFSAHVUO.js → danger-zone-redirect-page-BLyU56iI.js} +1 -1
  36. package/dist/assets/debug-page-BfYzZTih.js +4 -0
  37. package/dist/assets/{deploy-dialogs-BGPr7tRt.js → deploy-dialogs-DyZ__q_z.js} +1 -1
  38. package/dist/assets/{detail-panel-stop-button-CcFyjiHA.js → detail-panel-stop-button-DXQQXCtp.js} +1 -1
  39. package/dist/assets/{detail-shell-DAQXFf5u.js → detail-shell-C--69S4R.js} +2 -2
  40. package/dist/assets/{developer-page-DKbPtnYa.js → developer-page-LlFmliRP.js} +1 -1
  41. package/dist/assets/devices-page-C65LYzPc.js +1 -0
  42. package/dist/assets/{diagnostics-BAjanSbk.js → diagnostics-BQUtALh-.js} +1 -1
  43. package/dist/assets/{dictation-overlay-page-Ma56ZEas.js → dictation-overlay-page-D5pUTXA9.js} +1 -1
  44. package/dist/assets/{document-viewer-page-CDdKsz0G.js → document-viewer-page-mRBDn4Gc.js} +1 -1
  45. package/dist/assets/{earn-credits-modal-DrXTt13d.js → earn-credits-modal-DVUdlw2V.js} +1 -1
  46. package/dist/assets/{emails-page-JJZnddma.js → emails-page--1HEyMqD.js} +1 -1
  47. package/dist/assets/esm-BKCTntwk.js +2 -0
  48. package/dist/assets/esm-CNMouzMT.js +2 -0
  49. package/dist/assets/{esm-O9mDOR47.js → esm-CSgBiYzF.js} +2 -2
  50. package/dist/assets/esm-CccIkVyz.js +2 -0
  51. package/dist/assets/esm-CpbLh3YJ.js +2 -0
  52. package/dist/assets/esm-DlsDcixX.js +1 -0
  53. package/dist/assets/{feature-flag-catalog-C8w5_UfU.js → feature-flag-catalog-CRFA909Q.js} +1 -1
  54. package/dist/assets/{file-editor-BCSV9IJF.js → file-editor-PNZ9cTI-.js} +1 -1
  55. package/dist/assets/{general-page-BQw5GWs9.js → general-page-DL3fu61f.js} +1 -1
  56. package/dist/assets/{hatching-screen-Bn68JemT.js → hatching-screen-Bc0QiEVj.js} +1 -1
  57. package/dist/assets/{home-page-route-DMa33Zrx.js → home-page-route-CR3ajpvl.js} +1 -1
  58. package/dist/assets/{hosting-screen-DQ2oChnD.js → hosting-screen--GdpAsIo.js} +1 -1
  59. package/dist/assets/identity-page-route-z0mc5jGO.js +1 -0
  60. package/dist/assets/{index-CQhaX_6y.js → index-CWzNQ8A_.js} +31 -31
  61. package/dist/assets/{inspect-page-DY4rwOh6.js → inspect-page-C-fq5PsM.js} +4 -4
  62. package/dist/assets/{install-BrkjCsCo.js → install-DKnSvyt9.js} +1 -1
  63. package/dist/assets/integrations-page-BeTfBE7R.js +1 -0
  64. package/dist/assets/intelligence-layout-ShKSJFRX.js +1 -0
  65. package/dist/assets/{keyboard-shortcuts-page-D0RdK4J1.js → keyboard-shortcuts-page-DiFBwxwl.js} +1 -1
  66. package/dist/assets/{library-detail-page-aRT1yf6F.js → library-detail-page-BE-B5vd3.js} +1 -1
  67. package/dist/assets/{library-page-B7t6lth_.js → library-page-COsPjT0P.js} +1 -1
  68. package/dist/assets/{login-flow-l71HNHLV.js → login-flow-COr5zRoB.js} +1 -1
  69. package/dist/assets/{login-page-Bp6w7NSU.js → login-page-B_AWg_-m.js} +1 -1
  70. package/dist/assets/logout-page-B-vCELzg.js +1 -0
  71. package/dist/assets/logs-layout-Bb2Ki85T.js +1 -0
  72. package/dist/assets/{memory-router-playground-page-D_meczLa.js → memory-router-playground-page-rPz9hfL9.js} +1 -1
  73. package/dist/assets/{messages-ChEiS3wF.js → messages-Doco46Z6.js} +1 -1
  74. package/dist/assets/{metric-card-FIohvQ13.js → metric-card-DejhOUyM.js} +1 -1
  75. package/dist/assets/{mobile-sidebar-drawer-DzYe9XUj.js → mobile-sidebar-drawer-DwE65WjT.js} +1 -1
  76. package/dist/assets/{native-biometric-BK6_QtW5.js → native-biometric-C5AdTx4r.js} +1 -1
  77. package/dist/assets/{native-file-DIJL6af-.js → native-file-swemzdL9.js} +2 -2
  78. package/dist/assets/{notifications-page-C2lwkT1N.js → notifications-page-D3Gip5vS.js} +1 -1
  79. package/dist/assets/{oauth-complete-page-CHOh6OEp.js → oauth-complete-page-DAuZqgBq.js} +1 -1
  80. package/dist/assets/{oauth-popup-complete-page-BE3T_diS.js → oauth-popup-complete-page-CvOB8DyR.js} +1 -1
  81. package/dist/assets/{pairing-page-CxHUjMx8.js → pairing-page-CSXR4O5_.js} +1 -1
  82. package/dist/assets/{password-reset-page-T_0pamrF.js → password-reset-page-BCyMJkWQ.js} +1 -1
  83. package/dist/assets/{platform-detection-Ceodt3Hu.js → platform-detection-B1WOWEur.js} +1 -1
  84. package/dist/assets/{platform-loopback-page-D9aM6fRr.js → platform-loopback-page-DViSSCNq.js} +1 -1
  85. package/dist/assets/{plugin-detail-page-3mf9oR80.js → plugin-detail-page-D_0rFOJ7.js} +1 -1
  86. package/dist/assets/plugins-page-DnsCa0ka.js +1 -0
  87. package/dist/assets/plugins-surface-CAUFbZFj.js +1 -0
  88. package/dist/assets/plus-CzwTg9D8.js +1 -0
  89. package/dist/assets/prechat-route-BRLg12I0.js +1 -0
  90. package/dist/assets/{prefs-vU63K0uX.js → prefs-BK4ReLBx.js} +1 -1
  91. package/dist/assets/{privacy-page-B70Xm8aR.js → privacy-page-DK_E5UDG.js} +1 -1
  92. package/dist/assets/{privacy-screen-ByIZxuz7.js → privacy-screen-VCEt0iH8.js} +1 -1
  93. package/dist/assets/{provider-callback-page-BWlbojMH.js → provider-callback-page-DSqK6K5B.js} +1 -1
  94. package/dist/assets/{provider-key-Bf5qJwbE.js → provider-key-DSBs9REL.js} +1 -1
  95. package/dist/assets/{provider-signup-page-DKWEdYx6.js → provider-signup-page-CuLVID0r.js} +1 -1
  96. package/dist/assets/{quick-input-page-CyO-UVOQ.js → quick-input-page-DITr3SKX.js} +1 -1
  97. package/dist/assets/{react-query.gen-BwkZCSTW.js → react-query.gen-Bxy9zjSn.js} +1 -1
  98. package/dist/assets/{react-query.gen-BpYo64Cd.js → react-query.gen-DQUX56Gs.js} +1 -1
  99. package/dist/assets/research-mock-page-D0KTjYOI.js +1 -0
  100. package/dist/assets/research-onboarding-route-CoGKBjAq.js +61 -0
  101. package/dist/assets/{resize-errors-D1myE8D_.js → resize-errors-CN02qg8O.js} +1 -1
  102. package/dist/assets/{review-terms-screen-1hI3KOuo.js → review-terms-screen-C2mUaOA6.js} +1 -1
  103. package/dist/assets/{routes-C6gxiCrz.js → routes-CCywyokq.js} +1 -1
  104. package/dist/assets/{schedules-D_sclJNA.js → schedules-CQOSfZg8.js} +1 -1
  105. package/dist/assets/{sdk.gen-zA5ns5LT.js → sdk.gen-B3Z8klU-.js} +1 -1
  106. package/dist/assets/{sdk.gen-pUYA4291.js → sdk.gen-Ec1nF7iZ.js} +1 -1
  107. package/dist/assets/select-assistant-screen-DkgCyv2V.js +1 -0
  108. package/dist/assets/{settings-layout-B257Z9LB.js → settings-layout-BLjA2_fl.js} +1 -1
  109. package/dist/assets/{share-feedback-modal-BfJQ9SbJ.js → share-feedback-modal-34O8UomD.js} +1 -1
  110. package/dist/assets/{sidebar-tree-BrIPzTJO.js → sidebar-tree-DJnIQnXc.js} +1 -1
  111. package/dist/assets/{signup-page-DfU1fVg6.js → signup-page-CJeIDhFC.js} +1 -1
  112. package/dist/assets/{signup-shell-DMX1tgqB.js → signup-shell-Bw9OFI-z.js} +1 -1
  113. package/dist/assets/skills-page-CcrxOAfG.js +1 -0
  114. package/dist/assets/{sound-manager-45n1b-Bl.js → sound-manager-DtzFjWmP.js} +1 -1
  115. package/dist/assets/{sounds-page-7_3U-dlg.js → sounds-page-BHhIVuV0.js} +1 -1
  116. package/dist/assets/subagent-detail-panel-Cj7wlfR3.js +4 -0
  117. package/dist/assets/{subagent-store-CN-NNj3H.js → subagent-store-BmGtlv6O.js} +1 -1
  118. package/dist/assets/{system-events-page-CPI3qkPm.js → system-events-page-B9LdpkBg.js} +1 -1
  119. package/dist/assets/{system-events-redirect-page-BuXE12UE.js → system-events-redirect-page-Dnoz3v9J.js} +1 -1
  120. package/dist/assets/{tiptap-document-editor-OSLOFGRH.js → tiptap-document-editor-jcHGSIJg.js} +1 -1
  121. package/dist/assets/{tool-detail-panel-CS3NNWPR.js → tool-detail-panel-B3u6-K3R.js} +1 -1
  122. package/dist/assets/{trace-page-BGoPPByx.js → trace-page-D-2QJklH.js} +1 -1
  123. package/dist/assets/{upgrade-cancel-page-eP-xr_rP.js → upgrade-cancel-page-CgX8IYAL.js} +1 -1
  124. package/dist/assets/{upgrade-success-page-BQuUJsbC.js → upgrade-success-page-DKKw3H1x.js} +1 -1
  125. package/dist/assets/{usage-page-9F1P16Dv.js → usage-page-obI_HCGk.js} +1 -1
  126. package/dist/assets/{use-bus-subscription-BNaztnO7.js → use-bus-subscription-Cv9Js5_J.js} +1 -1
  127. package/dist/assets/use-is-org-ready-CXt7jaER.js +1 -0
  128. package/dist/assets/use-onboarding-login-DgxS4dsO.js +1 -0
  129. package/dist/assets/{use-reduced-motion-BG6r0Z46.js → use-reduced-motion-BlCAREB8.js} +1 -1
  130. package/dist/assets/use-setup-channel-param-CNNd-gJV.js +9 -0
  131. package/dist/assets/{use-skill-categories-D2tZfqBc.js → use-skill-categories-CRMzRD6m.js} +1 -1
  132. package/dist/assets/{utils-P-AuKiE9.js → utils-ChLzMd8R.js} +1 -1
  133. package/dist/assets/{viewer-store-BR99G-Ii.js → viewer-store-D7cH9LQF.js} +1 -1
  134. package/dist/assets/{voice-page-LgaYUztu.js → voice-page-BT_3N22n.js} +1 -1
  135. package/dist/assets/{weather-forecast-display-CfCoDHyw.js → weather-forecast-display-C0Zvm9vl.js} +1 -1
  136. package/dist/assets/{web-DGDlV45i.js → web-60vPNzAv.js} +1 -1
  137. package/dist/assets/{web-DFw1Yfb1.js → web-BZF5Krzc.js} +1 -1
  138. package/dist/assets/{web-CxyEb7Lp.js → web-BfGgEMt3.js} +1 -1
  139. package/dist/assets/{web-GWxiW7or.js → web-Bqls6sCO.js} +1 -1
  140. package/dist/assets/{web-YggPvEM4.js → web-DF-93Ff2.js} +1 -1
  141. package/dist/assets/{web-b9SjJqdc.js → web-Dw05M3EW.js} +1 -1
  142. package/dist/assets/{web-lNls6p99.js → web-IVArvzQ-.js} +1 -1
  143. package/dist/assets/{welcome-screen-BNZvYh2g.js → welcome-screen-Dx4jNLFF.js} +1 -1
  144. package/dist/assets/{workflow-detail-panel-CP2JbBXr.js → workflow-detail-panel-CvbzHGzG.js} +1 -1
  145. package/dist/assets/workspace-page-DDNf-ykG.js +1 -0
  146. package/dist/index.html +84 -82
  147. package/package.json +1 -1
  148. package/dist/assets/acp-run-detail-panel-zJfy8qiw.js +0 -5
  149. package/dist/assets/advanced-page-Cpo1TLOb.js +0 -1
  150. package/dist/assets/connect-page-NvjuA4Dj.js +0 -1
  151. package/dist/assets/consent-controls-DRPdeZXw.js +0 -1
  152. package/dist/assets/contacts-gateway-BDJYh797.js +0 -1
  153. package/dist/assets/contacts-page-route-DpCrCofB.js +0 -9
  154. package/dist/assets/debug-page-lUWhh0uD.js +0 -4
  155. package/dist/assets/devices-page-ClysCgSb.js +0 -1
  156. package/dist/assets/esm--RA963YO.js +0 -2
  157. package/dist/assets/esm-BSRBg0oR.js +0 -2
  158. package/dist/assets/esm-CJ8uY1wn.js +0 -2
  159. package/dist/assets/esm-DTj81fJQ.js +0 -1
  160. package/dist/assets/esm-cB02a8J9.js +0 -2
  161. package/dist/assets/identity-page-route-DBYOwn0S.js +0 -1
  162. package/dist/assets/integrations-page-CcdA6N2s.js +0 -1
  163. package/dist/assets/intelligence-layout-VkKSilP1.js +0 -1
  164. package/dist/assets/logout-page-CaaPZSIH.js +0 -1
  165. package/dist/assets/logs-layout-CaUiCN-a.js +0 -1
  166. package/dist/assets/plugins-page-CeBV1IVq.js +0 -1
  167. package/dist/assets/plugins-surface-gCrqfOas.js +0 -1
  168. package/dist/assets/prechat-route-C8zgjI3Q.js +0 -1
  169. package/dist/assets/research-mock-page-DaY250XG.js +0 -1
  170. package/dist/assets/research-onboarding-route-BX-HEXnC.js +0 -61
  171. package/dist/assets/select-assistant-screen-nRxexeHI.js +0 -1
  172. package/dist/assets/skills-page-Bx5LerU3.js +0 -1
  173. package/dist/assets/subagent-detail-panel-Pn3ub3nM.js +0 -4
  174. package/dist/assets/use-is-org-ready-f4GMUYIe.js +0 -1
  175. package/dist/assets/use-onboarding-login-NYeSGUNo.js +0 -1
  176. package/dist/assets/workspace-page-u1KJogzb.js +0 -1
  177. /package/dist/assets/{account-shell-CyP9etTv.js → account-shell-D0ubbqxG.js} +0 -0
  178. /package/dist/assets/{api-errors-DPruG7q9.js → api-errors-CPc5p2r9.js} +0 -0
  179. /package/dist/assets/{app-info-DJQFoVxX.js → app-info-Dtc98M-e.js} +0 -0
  180. /package/dist/assets/{avatar-bundled-components-DVlFbr6O.js → avatar-bundled-components-DMC1S-8P.js} +0 -0
  181. /package/dist/assets/{avatar-svg-compositor-CNy1XmWD.js → avatar-svg-compositor-D6G3Y6hA.js} +0 -0
  182. /package/dist/assets/{build.umd-4R02MPXx.js → build.umd-gY3Uzz96.js} +0 -0
  183. /package/dist/assets/{by-tool-use-id-index-Dbdu-8Kf.js → by-tool-use-id-index-KHuXlFNc.js} +0 -0
  184. /package/dist/assets/{chat-rA5AbKPD.js → chat-C19ZjAL3.js} +0 -0
  185. /package/dist/assets/{client-identity-KGlckm6M.js → client-identity-DiDHLoNp.js} +0 -0
  186. /package/dist/assets/{client.gen-DU1JkKSB.js → client.gen-CbVuiseX.js} +0 -0
  187. /package/dist/assets/{client.gen-BHupOCJH.js → client.gen-nWvCdeJb.js} +0 -0
  188. /package/dist/assets/{cloud-off-rAv4OHmv.js → cloud-off-fMC5iwVY.js} +0 -0
  189. /package/dist/assets/{code-aMX9iMYa.js → code-BhoMjTYO.js} +0 -0
  190. /package/dist/assets/{composer-focus-n921WsjZ.js → composer-focus-Clt7vN-2.js} +0 -0
  191. /package/dist/assets/{conversation-selection-CNssqGbG.js → conversation-selection-jLLIV1vI.js} +0 -0
  192. /package/dist/assets/{conversation-store-B8D6wE18.js → conversation-store-BheNrWpL.js} +0 -0
  193. /package/dist/assets/{cpu-CiHv3fhs.js → cpu-D1r7PLan.js} +0 -0
  194. /package/dist/assets/{credit-card-BKRB1ZIi.js → credit-card-BwN95biV.js} +0 -0
  195. /package/dist/assets/{definitions-BughTGuV.js → definitions-DeG2sRFv.js} +0 -0
  196. /package/dist/assets/{detail-card-DRXR3fb7.js → detail-card-DXLMG-Zw.js} +0 -0
  197. /package/dist/assets/{dist-Ztj3rqLK.js → dist-CNEsSZUe.js} +0 -0
  198. /package/dist/assets/{domain-field-DYwuCpup.js → domain-field-CNW1t3OC.js} +0 -0
  199. /package/dist/assets/{edit-chat-session-DcCgw5Qy.js → edit-chat-session-RMvGKcHJ.js} +0 -0
  200. /package/dist/assets/{effective-timezone-B99h9zr7.js → effective-timezone-DrYGH2Lb.js} +0 -0
  201. /package/dist/assets/{emoji-catalog-data-D8lRMt3A.js → emoji-catalog-data-ClLxfwNZ.js} +0 -0
  202. /package/dist/assets/{environment-store-B83Xai7l.js → environment-store-CN3UaYQg.js} +0 -0
  203. /package/dist/assets/{event-bus-B3E3w-q2.js → event-bus-ULoEgfFr.js} +0 -0
  204. /package/dist/assets/{external-link-RJkZLlff.js → external-link-BgOnp59e.js} +0 -0
  205. /package/dist/assets/{file-text-ClqzuFsu.js → file-text-D4wmdFsJ.js} +0 -0
  206. /package/dist/assets/{format-BDkwdD2m.js → format-DuvgAcxs.js} +0 -0
  207. /package/dist/assets/{format-date-D4tzd1DT.js → format-date-CmX7EYBN.js} +0 -0
  208. /package/dist/assets/{format-file-size-CBQjPwkk.js → format-file-size-D7iZejgy.js} +0 -0
  209. /package/dist/assets/{globe-D3P5sSKJ.js → globe-CRuerXYx.js} +0 -0
  210. /package/dist/assets/{haptics-BE_0g4mc.js → haptics-DUNUKgg4.js} +0 -0
  211. /package/dist/assets/{hard-drive-CZEg1Cqc.js → hard-drive-DsJ64Fuu.js} +0 -0
  212. /package/dist/assets/{impersonate-version-flag-DyVWQf97.js → impersonate-version-flag-BpzPjXeb.js} +0 -0
  213. /package/dist/assets/{info-ciQS_i3y.js → info-C9uyv2bI.js} +0 -0
  214. /package/dist/assets/{lib-BNGjysgr.js → lib-DWRDi23Z.js} +0 -0
  215. /package/dist/assets/{link-2-r_QPxX18.js → link-2-BIp7l4R9.js} +0 -0
  216. /package/dist/assets/{llm-dimension-8g-Go8uq.js → llm-dimension-DyYwG3mU.js} +0 -0
  217. /package/dist/assets/{loader-circle-BFRVtR3K.js → loader-circle-BITX1qOw.js} +0 -0
  218. /package/dist/assets/{log-in-CEw63CGU.js → log-in-BCOweEUO.js} +0 -0
  219. /package/dist/assets/{minimize-2-dKm10qRD.js → minimize-2-BQKYHW0m.js} +0 -0
  220. /package/dist/assets/{misc-CFzLzLPH.js → misc-GIyc06fS.js} +0 -0
  221. /package/dist/assets/{monitor-CXU19mVX.js → monitor-xGqXetuk.js} +0 -0
  222. /package/dist/assets/{moon-CKINz50a.js → moon-rIyEhhAK.js} +0 -0
  223. /package/dist/assets/{mutation-error-CAO3gDr-.js → mutation-error-BN5zz5X4.js} +0 -0
  224. /package/dist/assets/{native-deep-link-C2-dXaz_.js → native-deep-link-CkFNpKqQ.js} +0 -0
  225. /package/dist/assets/{onboarding-step-layout-B65Rny5V.js → onboarding-step-layout-2XcmxqFN.js} +0 -0
  226. /package/dist/assets/{page-shell-sPPJY6qa.js → page-shell-C3-rU99a.js} +0 -0
  227. /package/dist/assets/{pdf-B-YWzK66.js → pdf-Cuv7mg8b.js} +0 -0
  228. /package/dist/assets/{pencil-B90pDI55.js → pencil-CtYlsDsm.js} +0 -0
  229. /package/dist/assets/{prechat-RG0Q0UrS.js → prechat-BzdosDIx.js} +0 -0
  230. /package/dist/assets/{prechat-names-Bmsq0aXB.js → prechat-names-DPum8sFP.js} +0 -0
  231. /package/dist/assets/{proxy-BgtfAoJj.js → proxy-BzcB2wP4.js} +0 -0
  232. /package/dist/assets/{public-asset-C2P77n3W.js → public-asset-DYtCQInw.js} +0 -0
  233. /package/dist/assets/{refresh-cw-Dui3Ymsb.js → refresh-cw-Dlu2vgR6.js} +0 -0
  234. /package/dist/assets/{remote-gateway-session-BigLiDPm.js → remote-gateway-session-C2xcV9Z_.js} +0 -0
  235. /package/dist/assets/{repeat-nCGBxntG.js → repeat-MDHTMmlC.js} +0 -0
  236. /package/dist/assets/{return-to-yMLvlnXN.js → return-to-DnS1UWHr.js} +0 -0
  237. /package/dist/assets/{save-BpAesNEP.js → save-C03NWAqR.js} +0 -0
  238. /package/dist/assets/{semver-0cyB3qXO.js → semver-DMpUdXpu.js} +0 -0
  239. /package/dist/assets/{setting-row-7y2HT-DP.js → setting-row-Ci9YIJwu.js} +0 -0
  240. /package/dist/assets/{sparkles-Bla177ar.js → sparkles-Bkcjn8HQ.js} +0 -0
  241. /package/dist/assets/{status-badge-pill-j3ke1d9o.js → status-badge-pill-CXey_r2B.js} +0 -0
  242. /package/dist/assets/{step-indicator-dots-WlYRNQOd.js → step-indicator-dots-CvPP_zNN.js} +0 -0
  243. /package/dist/assets/{triangle-alert-C3aHZq1F.js → triangle-alert-BcZY_IvR.js} +0 -0
  244. /package/dist/assets/{typed-storage-DjORmu8t.js → typed-storage-BGMPjrzL.js} +0 -0
  245. /package/dist/assets/{usage-window-B-YOzKJi.js → usage-window-C6gWu5Qu.js} +0 -0
  246. /package/dist/assets/{use-active-assistant-id-BVzVN4_g.js → use-active-assistant-id-iCLBbJXU.js} +0 -0
  247. /package/dist/assets/{use-is-mobile-jACt_z2d.js → use-is-mobile-Cqknxs2C.js} +0 -0
  248. /package/dist/assets/{user-plus-COoYKnWs.js → user-plus-D30zPuGV.js} +0 -0
  249. /package/dist/assets/{workflow-status-ByHycBJ_.js → workflow-status-BF9EOzZI.js} +0 -0
  250. /package/dist/assets/{x-DxL-bCuT.js → x-B0gfyRAR.js} +0 -0
  251. /package/dist/assets/{xterm-B8LaLTHh.js → xterm-BPl0dA68.js} +0 -0
  252. /package/dist/assets/{xterm-addon-fit--RE59D-m.js → xterm-addon-fit-BCzoNVYn.js} +0 -0
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./card-BibIM9x3.js";import{t as l}from"./input-D4W4p0pZ.js";import{c as u,f as d,o as f}from"./local-mode-CgrENuVf.js";import{t as p}from"./is-electron-C_ZTVhv8.js";import{n as m}from"./resolved-assistants-store-Dqf0LJrA.js";import{t as h}from"./check-D6WkI0gF.js";import{t as g}from"./chevron-left-DghyKSEE.js";import{t as _}from"./loader-circle-BFRVtR3K.js";import{t as v}from"./pencil-B90pDI55.js";import{t as y}from"./x-DxL-bCuT.js";import{A as b,C as ee,a as x,j as S,n as C,o as w}from"./auth-store-DGyzz5Ha.js";import{t as T}from"./client.gen-BHupOCJH.js";import{m as E}from"./native-biometric-BK6_QtW5.js";import{a as D}from"./routes-C6gxiCrz.js";import{r as O}from"./platform-detection-Ceodt3Hu.js";import{o as k,r as A}from"./prefs-vU63K0uX.js";import{t as j}from"./client-feature-flag-store-CWOJ-CVU.js";import{c as M,l as te,n as N,t as ne}from"./prechat-RG0Q0UrS.js";import{b as re,r as ie,yt as ae}from"./react-query.gen-BpYo64Cd.js";import{n as oe,t as P}from"./browser-DM38C5zq.js";import{t as F}from"./public-asset-C2P77n3W.js";import{$t as I,Ct as se,J as ce,Qt as le,Tt as ue,Zt as de,_t as L,bt as fe,ca as R,d as z,en as B,l as V,nn as pe,q as me,rn as H,u as he,vt as ge,wt as _e}from"./index-CQhaX_6y.js";import{t as U}from"./onboarding-step-layout-B65Rny5V.js";import{n as ve,r as ye}from"./prechat-names-Bmsq0aXB.js";import{t as be}from"./step-indicator-dots-WlYRNQOd.js";var W=e(t(),1);async function xe(){try{let{data:e,response:t}=await T.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var G=s(),Se=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function Ce({onComplete:e}){function t(){z(),V(),e()}return(0,G.jsx)(H,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,G.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,G.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,G.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,G.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,G.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,G.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,G.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,G.jsx)(`ul`,{className:`space-y-4`,children:Se.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,G.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,G.jsx)(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`,we=[{id:`gmail`,label:`Gmail`,logoSrc:F(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:F(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:F(`/images/integrations/google-drive.svg`)}];function Te({assistantId:e,assistantName:t,onConnect:r,onSkip:i,onBack:o}){let s=p(),c=a(),l=E(),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 O=(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]),k=(0,W.useCallback)(async()=>{let e=d.current?.platformAssistantId;w(),S(),r((e?await O(e):null)?.scopes_granted??[])},[S,w,O,r]),A=(0,W.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!d.current||e.requestId!==d.current.requestId||(e.oauthStatus===`connected`?k():(w(),S())))},[S,w,k]),j=(0,W.useCallback)(e=>{let t=d.current;if(!t)return;let n=de(e,window.location.origin,t.requestId);n&&A(n)},[A]),M=(0,W.useCallback)(e=>{let t=d.current;if(!t)return;let n=le(e,t.requestId);n&&(A(n),window.localStorage.removeItem(B(t.requestId)))},[A]);pe((0,W.useCallback)(e=>{let t=d.current;t&&e.requestId===t.requestId&&A({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[A]));let te=(0,W.useCallback)(()=>{let t=crypto.randomUUID();if(C(),h.current=j,v.current=M,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:`${D.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){P(e.connect_url)},onError(){S()}})})(),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),y.current&&y.current();let n=oe(()=>{let e=d.current;if(!e){n(),y.current=null;return}(async()=>{let t=await O(e.platformAssistantId);d.current&&(t?await k():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`,j),window.addEventListener(`storage`,M),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(B(e.requestId));if(t)try{let n=JSON.parse(t);if(I(n,e.requestId)){A(n),window.localStorage.removeItem(B(e.requestId)),C();return}}catch{}let n=await O(e.platformAssistantId);d.current&&(n?await k():(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:`${D.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,O,A,j,M,k,l,C,T]),N=t||`your assistant`,ne=t||`Your assistant`;return(0,G.jsx)(H,{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, ${N} can use Gmail, Calendar, and Drive with your permission.`}),(0,G.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:we.map(e=>(0,G.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,G.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,G.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${ne} 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:te,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 Ee({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)(H,{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),className:U,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),className:U,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:ve.map(e=>(0,G.jsx)(De,{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 De({group:e,isActive:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,G.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function Oe({userName:e,assistantName:t,displayedAssistantNames:r,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:u,totalSteps:d}){return(0,G.jsx)(H,{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)(be,{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),className:U,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),className:U,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 ke=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:F(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:F(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:F(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:F(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:F(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:F(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:F(`/images/prior-assistants/copilot.svg`)}];function Ae({selectedAssistants:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,W.useState)(()=>J(e)),[d,f]=(0,W.useState)(()=>s.length>0),m=(0,W.useRef)(Y(e));(0,W.useEffect)(()=>{let t=Y(e);if(t===m.current)return;let n=J(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}`)))}q(n,e)||(m.current=Y(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)(H,{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:[ke.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`,className:U,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 q(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function J(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function je({assistant:e,selected:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(Ne,{assistant:e,size:32}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(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)(R,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ne({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Pe({selectedTasks:e,onChange:t,onBack: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)(H,{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:me.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:F(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:F(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:F(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:F(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:F(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:F(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:F(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:F(`/images/integrations/github.svg`),logoSrcDark:F(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:F(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:F(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:F(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:F(`/images/integrations/apple-notes.svg`)}];function Le(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function Re({selectedTools:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,W.useState)(()=>ze(e)),[d,f]=(0,W.useState)(()=>s.length>0),m=(0,W.useRef)(Z(e));(0,W.useEffect)(()=>{let t=Z(e);if(t===m.current)return;let n=ze(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}`)))}X(n,e)||(m.current=Z(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)(H,{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)(Q,{tool:t,selected:e.has(t.id),onToggle:()=>h(t.id),electron:o},t.id)),d?null:(0,G.jsx)($,{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`,className:U,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 X(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ze(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Z(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Q({tool:e,selected:t,onToggle:n,electron:r}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(Be,{tool:e,size:32}),(0,G.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(h,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function $({onClick:e,electron:t}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(R,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Be({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Ve({selectedGroupId:e,onGroupChange:t,onBack:r,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,G.jsx)(H,{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)(be,{current:o,total:s})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,G.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,G.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:ve.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 He(e){let[t,n]=(0,W.useState)(()=>(e??``).trim()),r=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,W.useCallback)(e=>{r.current=!0,n(e)},[])}}var Ue=[`gmail`,`google-calendar`,`google-drive`],We=`experiment-activation-flow-2026-06-03`,Ge=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ke(e,t,n){return t?.initialMessage?t.initialMessage:n?N(e):ne}function qe(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:t===`paredDown`?{tools:r?[...Ue]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:Le([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=We,i.bootstrapTemplate=Ge);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),t===`paredDown`?r&&(i.googleScopes=e.connectedScopes):t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Le([...e.selectedPriorAssistants])),i.initialMessage=Ke(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function Je(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Ye(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:L.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:L.controlWorkType,enabled:!t},{id:`tools`,funnelStep:L.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:L.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?L.gmailConnect:L.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:L.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Xe(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Ze=`1`;function Qe(e){return e===`nativeVibe`||e===Ze?`nativeVibe`:null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function et(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function tt(){let e=r(),t=E(),n=k()&&A();return(0,W.useEffect)(()=>{!n&&!t&&e(D.onboarding.privacy,{replace:!0})},[n,t,e]),t||n}function nt(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,W.useState)(()=>t?`nativeName`:`name`),a=(0,W.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,W.useLayoutEffect)(()=>{if(n)try{let e=Qe(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,W.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,W.useCallback)(()=>{a(null)},[a])}}var rt=3;function it(){let e=u();return e?.cloud===`vellum`?e.assistantId:f()[0]?.assistantId??null}function at(){let e=r(),[t]=i(),n=t.get(`preview`)===`true`,a=C.use.user(),s=x(),c=w(),l=a?.id??null,u=a?.firstName??``,f=a?.lastName??``,p=E(),h=m.use.activeAssistantId(),g=d(),_=O()&&!he(),v=j.use.stringFlags().preChatOnboardingExperiment20260606??`control`,y=(j.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,ee=j.use.selfIntroGreeting(),T=se(v),k=_e()??T,A=k===ge.paredDown,N=g?it():null,ne=tt(),{currentStep:re,setCurrentStep:ae,clearPersistedStep:oe}=nt(l,p),P=C.use.platformSession(),F=S(P),[I,ce]=(0,W.useState)(()=>new Set),[le,de]=(0,W.useState)(()=>new Set),[L,R]=(0,W.useState)(()=>new Set),{value:z,onChange:B}=He(g&&!F?``:u||f),[V,pe]=(0,W.useState)(null),[me]=(0,W.useState)(()=>ye()),[H,U]=(0,W.useState)(``),[ve,be]=(0,W.useState)(!1),[Se,K]=(0,W.useState)([]),{data:we}=o({...ie(),enabled:!c&&s&&(!g||F)}),{data:De,isLoading:ke}=o({queryKey:[`onboarding-recipe`,l],queryFn:xe,enabled:!c&&s&&!p&&!g,staleTime:1/0}),q=De??null,J=we?.id??h??N,Y=Je({localMode:g,platformSession:P,hasCachedPlatformAssistant:N!==null}),je=Y,Me=Y,Ne=async()=>{await b.checkAssistant(),e(`${D.assistant}?onboarding=1`,{replace:!0})};function Ie(e,t=k){n||fe(e,{userId:l,variant:ue(t)})}let Le=[...I].some(e=>Fe.has(e)),X=p?Xe():Ye({paredDown:A,canOfferPriorAssistants:Me,canOfferGoogleStep:n?!1:je,hasGoogleTool:Le,showIOSAppStep:_});function ze(t){if(n){e(-1);return}te(qe({mode:p?`native`:A?`paredDown`:`control`,recipe:p?null:q,selectedTools:I,selectedTasks:le,selectedPriorAssistants:t?.selectedPriorAssistants??L,tone:V??q?.tone??`grounded`,userName:z,assistantName:H,selfIntroGreetingEnabled:ee,activationFlowEnabled:p?void 0:y,googleConnected:ve,googleScopes:Se,connectedScopes:t?.connectedScopes}));let r=H.trim();r&&M(r),p?(oe(),e(D.onboarding.privacy)):(b.markExpectingFirstMessage(),Ne())}let Z=(e,t)=>{e.funnelStep&&Ie(e.funnelStep);let n=$e(X,e.id);n?ae(n):ze(t)},Q=e=>{let t=et(X,e.id);t&&ae(t)};if(!ne||ke)return null;let $=X.find(e=>e.id===re)??X[0];return $?$.id===`nativeName`?(0,G.jsx)(Oe,{userName:z,assistantName:H,displayedAssistantNames:me,onUserNameChange:B,onAssistantNameChange:U,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:rt}):$.id===`nativeVibe`?(0,G.jsx)(Ve,{selectedGroupId:V,onGroupChange:pe,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:rt}):$.id===`name`?(0,G.jsx)(Ee,{userName:z,assistantName:H,selectedGroupId:V,displayedAssistantNames:me,onUserNameChange:B,onAssistantNameChange:U,onGroupChange:pe,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,G.jsx)(Pe,{selectedTasks:le,onChange:de,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,G.jsx)(Re,{selectedTools:I,onChange:ce,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,G.jsx)(Ae,{selectedAssistants:L,onChange:R,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;R(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?J?(0,G.jsx)(Te,{assistantId:J,assistantName:H,onConnect:e=>{be(!0),K(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,G.jsx)(Ce,{onComplete:()=>Z($)}):null:null}function ot(){return(0,G.jsx)(at,{})}export{ot as PreChatRoute};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-C6gxiCrz.js";import{t as s}from"./client-feature-flag-store-CWOJ-CVU.js";import{t as c}from"./conversation-store-B8D6wE18.js";import{t as l}from"./conversation-selection-CNssqGbG.js";import{an as u}from"./index-CQhaX_6y.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[{suggestion:`I'll summarize this week's AI model releases for you`,prompt:`Summarize this week's AI model releases for me.`},{suggestion:`I'll draft a technical blog post from your latest notes`,prompt:`Draft a technical blog post from my latest notes.`},{suggestion:`I'll build you a tracker for competitor product launches`,prompt:`Build me a tracker for competitor product launches.`},{suggestion:`I'll analyze a CSV of metrics and surface the trends`,prompt:`Analyze a CSV of metrics for me and surface the trends.`}];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),y=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:y,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showSuggestions:!0,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};
@@ -1,61 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BG-GkiMq.js";import{t as n}from"./react-DJZBPgpf.js";import{O as r,t as i}from"./button-D-AX8Voo.js";import{d as a,r as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{t as l}from"./cn-DvW5mxZR.js";import{t as u}from"./tag-CW6WC4fE.js";import{t as d}from"./input-D4W4p0pZ.js";import{n as f,t as p}from"./create-selectors-BE0_e_Ed.js";import{t as m}from"./arrow-left-CP-EhDNF.js";import{t as h}from"./chevron-left-DghyKSEE.js";import{t as g}from"./chevron-right-B6vEpVY0.js";import{n as _,t as v}from"./animated-avatar-CEC1DGcI.js";import{t as y}from"./loader-circle-BFRVtR3K.js";import{t as b}from"./pencil-B90pDI55.js";import{t as x}from"./x-DxL-bCuT.js";import{$ as S,An as C,B as w,cn as T,jn as E,sn as D}from"./sdk.gen-zA5ns5LT.js";import{r as ee}from"./api-errors-DPruG7q9.js";import{A as te,B as O,L as k,R as A,n as j,z as ne}from"./auth-store-DGyzz5Ha.js";import{a as M,o as re,r as N}from"./api-5fuWyrd5.js";import{a as ie}from"./routes-C6gxiCrz.js";import{t as P}from"./platform-detection-Ceodt3Hu.js";import{t as ae}from"./client-feature-flag-store-CWOJ-CVU.js";import{c as oe,l as se}from"./prechat-RG0Q0UrS.js";import{A as ce,B as le,C as ue,D as de,E as fe,F,I,L as pe,M as me,N as he,O as ge,P as _e,R as L,S as ve,T as R,V as z,_ as ye,a as be,b as B,d as V,f as xe,g as Se,i as Ce,j as we,k as Te,m as Ee,o as De,p as Oe,r as ke,s as Ae,t as H,v as je,w as Me,x as Ne,y as Pe}from"./proxy-BgtfAoJj.js";import{t as Fe}from"./AnimatePresence-uY0BR2n2.js";import{t as U}from"./use-reduced-motion-BG6r0Z46.js";import{$n as Ie,Ma as W,Si as Le,hn as Re,in as ze,it as G,ki as Be,on as Ve,qt as He,rn as Ue,rt as We,sn as Ge,xt as Ke,yt as qe}from"./index-CQhaX_6y.js";import{n as Je,t as Ye}from"./onboarding-step-layout-B65Rny5V.js";import{t as Xe}from"./prechat-names-Bmsq0aXB.js";var Ze=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function Qe(e,t){return me(e)?e[Ze(0,e.length,t)]:e}var $e=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return et(this.animations,`duration`)}get iterationDuration(){return et(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function et(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var tt=class extends $e{then(e,t){return this.finished.finally(e).then(()=>{})}};function nt(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=fe(i,a,o);return t?s(r):s}function rt(e,t){return e in t}var it=class extends Ae{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(rt(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return xe()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},K=e(n(),1);function at(e){let t=z(()=>ve(e)),{isStatic:n}=(0,K.useContext)(ke);if(n){let[,n]=(0,K.useState)(e);(0,K.useEffect)(()=>t.on(`change`,n),[])}return t}function ot(e,t){let n=at(t()),r=()=>n.set(t());return r(),le(()=>{let t=()=>we.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),ce(r)}}),n}function st(e){Ne.current=[],e();let t=ot(Ne.current,e);return Ne.current=void 0,t}function ct(e,t,n,r){if(typeof e==`function`)return st(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return ut(e,t,n,r);let i=typeof t==`function`?t:nt(t,n,r),a=Array.isArray(e)?lt(e,i):lt([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function lt(e,t){let n=z(()=>[]);return ot(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function ut(e,t,n,r){let i=z(()=>Object.keys(n)),a=z(()=>({}));for(let o of i)a[o]=ct(e,t,n[o],r);return a}function dt(e){e.values.forEach(e=>e.stop())}function ft(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&B(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{ft(e,t)})})}function pt(e,t){if(Array.isArray(t))return ft(e,t);if(typeof t==`string`)return ft(e,[t]);B(e,t)}function mt(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){I(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(ye(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return I(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{pt(e,n)})},stop(){t.forEach(e=>{dt(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function ht(e){return typeof e==`object`&&!Array.isArray(e)}function gt(e,t,n,r){return e==null?[]:typeof e==`string`&&ht(t)?Se(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function _t(e,t,n){return e*(t+1)+n*t}function vt(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function yt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(L(e,i),r--)}}function bt(e,t,n,r,i,a){yt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Te(i,a,r[o]),easing:Qe(n,o)})}function xt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function St(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Ct=`easeInOut`,wt=20;function Tt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,vt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=vt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Ot(e),{delay:l=0,times:u=Me(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=ue(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&jt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=_e(b));let r=ge(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&R(u,T),c.length===1&&c.unshift(null),m&&pe(m<wt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${wt} or apply repeat at the sequence level instead.`),m&&m<wt){let e=b>0?_/b:0;b=_t(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?he(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:Qe(f,e-1))}xt(u,m,e)}let E=w+b;bt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Pe(p)){let e=Et(p,s);_(m,h,Dt(`default`,e))}else{let e=gt(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Et(r,s);for(let e in m)_(m[e],kt(h,e),Dt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(St);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(F(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Ct)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Et(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Dt(e,t){return t[e]||(t[e]=[]),t[e]}function Ot(e){return Array.isArray(e)?e:[e]}function kt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var At=e=>typeof e==`number`,jt=e=>e.every(At);function Mt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Ee(e)&&!Oe(e)?new be(t):new De(t);n.mount(e),V.set(e,n)}function Nt(e){let t=new it({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),V.set(e,t)}function Pt(e,t){return Pe(e)||typeof e==`number`||typeof e==`string`&&!ht(t)}function Ft(e,t,n,r){let i=[];if(Pt(e,t))i.push(Ce(e,ht(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=gt(e,t,r),o=a.length;I(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Mt:Nt;V.has(r)||s(r);let c=V.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...je(c,{...t,transition:l},{}))}}return i}function It(e,t,n){let r=[];return Tt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=ve(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:de}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Ft(n,e,t))}),r}function Lt(e){return Array.isArray(e)&&e.some(Array.isArray)}function Rt(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),Lt(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=It(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Ft(e,i,{...c,...r},t)}let l=new tt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{L(t.animations,l)})),l}return i}var zt=Rt();function Bt(){let e=z(mt);return le(e.mount,[]),e}var Vt=12;function Ht(e,t){let n=e.slice(0,Vt).map(e=>`- ${e.name} — ${e.description}`).join(`
2
- `);return n?`
3
- Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
4
- ${n}
5
-
6
- Add a "plugins" array as the FIRST key in your JSON object, ${t?`before "claims" and "suggestions"`:`before "claims"`}: the 1-2 capabilities from the list above (exact names) that best fit who I am — judged by what you researched about my real role, stack, and day-to-day work. (Emit it first so setup can start while you finish the rest.) These get set up for me automatically as part of getting started, so pick by overall fit to ME, not to any single suggestion. Prefer fewer over forcing a match; use [] if nothing clearly fits. Example: "plugins": ["<exact name from the list above>"]. ${t?`Don't reference the setup in the claims or suggestions text.`:`Don't reference the setup in the claims text.`}
7
- `:``}function Ut({firstName:e,lastName:t,occupation:n,hobby:r},i=[],{includeSuggestions:a=!0}={}){let o=[e.trim(),t.trim()].filter(Boolean).join(` `),s=n.trim(),c=r?.trim()??``,l=Ht(i,a),u=l?`"plugins": ["<exact name from the list above>"], `:``,d=[o?`My name is ${o}.`:``,s?`I work as ${s}.`:``,c?`My hobby is ${c}.`:``].filter(Boolean).join(` `)||`I'd like you to get to know me before we start working together.`,f=a?` "suggestions": [ { "suggestion": "I'll find the 3 newest arXiv eval papers worth your time", "prompt": "Find me the 3 newest arXiv eval papers worth reading." }, { "suggestion": "I'll draft a crisp summary of the latest model-serving trade-offs", "prompt": "Draft me a short summary of the latest model-serving trade-offs." }, { "suggestion": "Connect GitHub and I'll triage your stalest issues", "prompt": "Connect to GitHub and triage my oldest open issues." }, { "suggestion": "I'll plan a weekend climbing trip near Boulder", "prompt": "Plan me a weekend climbing trip near Boulder." } ]`:``,p=`{ ${u}"claims": [ { "claim": "Senior engineer at an AI infra startup", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Based in Boulder, CO", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Active climber on Mountain Project", "confidence": "maybe", "sources": [] }, { "claim": "Focused on evals or model serving infrastructure", "confidence": "guessing", "sources": ["https://github.com/example-user"] } ]${f?`,${f}`:``} }`;return`${d}
8
-
9
- Get to know me. Search the web for what's publicly known about the person matching my name and role, and infer a handful of things about who I am: what I do, my role, where I'm based, what I'm into, anything that would help you assist me better. Lean on public sources (LinkedIn, company pages, social profiles, articles, personal sites, GitHub). It's fine to make reasonable inferences and label them honestly.
10
-
11
- Treat the name, role, and hobby I provided above as first-party context from me. Use public sources to enrich that context, not to override or correct it. If public sources use a different title or omit part of my stated role, do not frame my stated role as wrong; mention the public title only as supporting nuance when it is useful, and keep ${a?`claims and suggestions`:`claims`} aligned with my stated role.
12
-
13
- CRITICAL: your final reply must be ONLY a JSON object. No preamble, no explanation, no prose, nothing before or after it. Do your thinking and searching, then respond with exactly this shape and nothing else:
14
-
15
- ${p}
16
-
17
- Rules for "claims":
18
-
19
- AT MOST 5 claims, typically 3 to 4. Aim for at least one "confident" and at least one "guessing"; the rest "maybe".
20
- Phrase each claim in third person as a short headline ("Senior engineer at an AI infra startup", "Based in Boulder, CO", "Active climber on Mountain Project"). No multi-clause sentences, no em-dash asides, no explanations. Good: "Contributed to Chirps (vector-DB security)". Bad: "You've done real work in vector database security. You contributed to Chirps, a tool for scanning vector DBs for sensitive data".
21
- Each claim must be independently true-or-false so I can remove the ones that are wrong.
22
- "confidence" is one of: "confident" (well supported by what you found), "maybe" (plausible but unverified), "guessing" (a hunch from limited signal).
23
- "sources": 0 to 3 URLs you actually used as evidence for that specific claim. Use [] for pure inferences.
24
- ${a?`Rules for "suggestions":
25
-
26
- Each suggestion is an object with two fields:
27
- "suggestion": the offer in YOUR voice (the assistant), exactly as it appears on the clickable card — first-person "I" refers to you (whatever your name). Pattern: "I'll [verb] [specific artifact]" or "Connect me to [integration] and I'll [verb] [artifact]." Lead with the offer; no intake question in front of it — you gather the details in the follow-up conversation after the click.
28
- "prompt": the same offer re-voiced as the message sent on the user's behalf when they click, in the USER's first person ("I"/"my" = the user) — what they'd say to take you up on it (suggestion "I'll find you 3 papers" → prompt "Find me 3 papers worth reading"). State the request; don't echo the assistant-voiced wording and don't ask a question back.
29
-
30
- Generate EXACTLY 4 suggestions covering four DIFFERENT capabilities, each making me think "wait, you can do that?" Draw on your range — a quick researched answer, a recurring brief or monitor, a doc drafted in a live editor, an integration (GitHub, Gmail, Calendar, Slack, Linear) connected with a first action, or a hobby hook if research surfaced one — but pick what genuinely fits; don't force a fixed set.
31
- Ground every suggestion in what you actually learned about me — my real role, stack, industry, and (if given) hobby. Specific to me, not generic assistant stuff; skip bare "summarize" or "draft a post."
32
- CRITICAL: every suggestion must be a fast win you can deliver in the first reply, never a long-running build. NEVER suggest building an app, dashboard, tool, site, or tracker, or any multi-step "build me a ___" project — those kill the first impression. The ambitious build can come later in the conversation, never on the first card.
33
- Keep each SHORT and skimmable: under 10 words, ONE clause, ONE artifact, no lists of three ("X, Y, and Z"). The reader scans four cards in seconds — a long line loses them.
34
- `:``}${l}
35
- ${a?`Don't include anything sensitive or private. If you found very little, lean on "guessing" claims and broadly useful suggestions for my role.`:`Don't include anything sensitive or private. If you found very little, lean on "guessing" claims.`}
36
- Keep every string value simple so the JSON always parses: one line, no line breaks inside a value, and NO double-quote characters inside a value — use single quotes (or none) for emphasis, quoted names, or tool names. Output ONLY the JSON object. No code fence, no extra text.`}var Wt=3e3,Gt=3e5,Kt=`Failed to start your assistant. Please try again.`,qt=`Your assistant is taking longer than expected. Please try again.`,Jt=e=>new Promise(t=>setTimeout(t,e));function Yt(){let[e,n]=(0,K.useState)(!1),[r,i]=(0,K.useState)(null),[a,o]=(0,K.useState)(null),s=(0,K.useRef)(!1),c=(0,K.useRef)([]),l=(0,K.useRef)(null),u=(0,K.useCallback)(e=>{if(!l.current){l.current={kind:`ready`,id:e},n(!0);for(let t of c.current)t.resolve(e);c.current=[]}},[]),d=(0,K.useCallback)(e=>{if(l.current)return;l.current={kind:`error`,message:e},o(e);let t=Error(e);for(let e of c.current)e.reject(t);c.current=[]},[]);return{start:(0,K.useCallback)(()=>{if(s.current)return;s.current=!0;let e=Date.now(),n=()=>Date.now()-e>=Gt;(async()=>{let e;try{let t=await re();if(t.ok)e=t.data.id,i(t.data.id);else{if(A(t.status,t.error)){d(k);return}if(!O(t.status)){d(ee(t.error,void 0,Kt));return}}}catch(e){t(e,{context:`research_background_hatch`})}let r;for(;!r;){if(n()){d(qt);return}try{let t=await N(e);e&&!t.ok&&t.status===404&&(e=void 0,t=await N());let n=ne(t);if(n.kind===`active`&&t.ok){r=t.data.id,i(r);break}if(n.kind===`error`){d(n.message);return}}catch(e){t(e,{context:`research_background_hatch_poll`})}await Jt(Wt)}for(;;){try{if((await M(r)).ok)break}catch{}if(n()){d(qt);return}await Jt(Wt)}u(r)})()},[d,u]),ready:e,assistantId:r,error:a,awaitReady:(0,K.useCallback)(()=>{let e=l.current;return e?.kind===`ready`?Promise.resolve(e.id):e?.kind===`error`?Promise.reject(Error(e.message)):new Promise((e,t)=>{c.current.push({resolve:e,reject:t})})},[])}}async function Xt(e,n){try{await w({path:{assistant_id:e,id:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_archive`})}}var Zt=[`admin-copilot`],Qt=[{plugin:`marketing-expert`,keywords:[`founder`,`cofounder`,`co founder`,`ceo`,`cmo`,`chief executive`,`chief marketing`,`entrepreneur`,`marketing`,`marketer`,`growth`,`brand`,`content`,`copywriter`,`copywriting`,`seo`,`demand gen`,`demand generation`,`sales`,`account executive`,`business development`,`creator`,`social media`,`community manager`]},{plugin:`git-workflow`,keywords:`developer.swe.programmer.coder.devops.dev ops.sre.site reliability.software engineer.software architect.backend engineer.back end engineer.frontend engineer.front end engineer.full stack engineer.fullstack engineer.platform engineer.infrastructure engineer.data engineer.machine learning engineer.ml engineer.qa engineer.embedded engineer.security engineer.staff engineer.principal engineer.solutions architect.tech lead.technical lead.engineering manager.engineering lead.head of engineering.director of engineering.vp of engineering.vp engineering.cto`.split(`.`)}];function $t(e){return` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()} `}function en(e,t){return e.includes(` ${t} `)}function tn(e){let t=$t(e),n=[];for(let{plugin:e,keywords:r}of Qt)r.some(e=>en(t,e))&&n.push(e);return n}function nn(e,t){let n=[...Zt,...tn(e)],r=new Set,i=[];for(let e of n)!t.has(e)||r.has(e)||(r.add(e),i.push(e));return i}var rn=1500,an=12e4,on=2;function sn({complete:e,stableReads:t}){return e&&t>=on}function cn({sawCompletePayload:e}){return e?`done`:`error`}function ln({sawCompletePayload:e}){return e}var un=`vellum-ai`,dn=new Set([`simple-memory`,`level-up`]);function fn(e){let t=e.trim().split(/(?<=\.)\s/)[0]?.trim()??e.trim();return t.length>100?`${t.slice(0,97).trimEnd()}…`:t}function pn(e){return e?.split(`/`)[0]?.trim()??``}function mn(e){let t=[],n=new Set;for(let r of e){let e=r.name?.trim(),i=r.description?.trim();!e||!i||pn(r.source?.repo)===un&&(dn.has(e)||(n.add(e),t.push({name:e,description:fn(i)})))}return{capabilities:t,validNames:n}}async function hn(e){try{return mn((await E({path:{assistant_id:e},throwOnError:!1})).data?.matches??[])}catch(e){return t(e,{context:`research_onboarding_catalog`}),{capabilities:[],validNames:new Set}}}async function gn(e,n){try{await C({path:{assistant_id:e},body:{name:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_install`})}}var _n=e=>new Promise(t=>setTimeout(t,e));function vn({role:e,validNames:t,modelPlugins:n}){return[...new Set([...nn(e,t),...n.filter(e=>t.has(e))])]}function yn(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||n.role!==`assistant`)continue;let r=n.contentBlocks;if(r&&r.length>0){let e=r.filter(e=>e.type===`text`).map(e=>e.text).join(`
37
- `).trim();if(e)return e}return(n.content??``).trim()}return``}function bn(){let[e,n]=(0,K.useState)({status:`idle`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),r=(0,K.useRef)(0),i=(0,K.useRef)(null),a=(0,K.useRef)(new Map),o=(0,K.useRef)(Promise.resolve()),c=s(),l=(0,K.useCallback)(({awaitAssistantId:e,subject:s,conversationTitle:l,resumeConversationId:u,onConversationCreated:d,includeSuggestions:f=!0})=>{let p=JSON.stringify(s);if(i.current===p)return;i.current=p;let m=r.current+1;r.current=m;let h=()=>r.current!==m,g=()=>{};o.current=new Promise(e=>{g=e}),a.current.clear(),n({status:`running`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),(async()=>{let r,i,o=!1;try{let t=await e();if(r=t,h())return;let{capabilities:c,validNames:p}=await hn(t);if(h())return;let m=Object.fromEntries(c.map(e=>[e.name,e.description]));n(e=>({...e,pluginCatalog:m})),p.size===0&&g();let _=a.current,v=nn(s.occupation,p);for(let e of v)_.has(e)||_.set(e,gn(t,e));v.length>0&&n(e=>({...e,installedPlugins:v}));let y=async e=>{let n={conversationId:e,content:Ut(s,c,{includeSuggestions:f}),sourceChannel:`vellum`,interface:`web`,clientOs:P(),clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(n.clientTimezone=e)}catch{}return!!(await T({path:{assistant_id:t},body:n,throwOnError:!1})).response?.ok},b=async()=>{let e=await S({path:{assistant_id:t},body:{conversationType:`standard`,...l?{title:l}:{}},throwOnError:!1});i=e.data?.id;let n=e.data?.id;if(!(!e.response?.ok||!n))return d?.(n),n},x;if(u){let e=await D({path:{assistant_id:t},query:{conversationId:u},throwOnError:!1});if(h())return;if(e.response?.ok&&(x=u,i=u,!(e.data?.messages??[]).some(e=>e.role===`user`))){if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}}if(!x){if(x=await b(),h())return;if(!x){n(e=>({...e,status:`error`}));return}if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}let C=Date.now()+an,w=``,E=0;for(;Date.now()<C;){if(await _n(rn),h())return;let e=await D({path:{assistant_id:t},query:{conversationId:x},throwOnError:!1});if(h())return;let r=yn(e.data?.messages??[]);if(r){let{claims:e,suggestions:i,plugins:a,pluginsResolved:c,complete:l}=Ve(r),u=a.filter(e=>p.has(e));for(let e of u)_.has(e)||_.set(e,gn(t,e));if(c&&g(),n({status:`running`,claims:e,suggestions:i,installedPlugins:vn({role:s.occupation,validNames:p,modelPlugins:u}),pluginCatalog:m}),l&&(o=!0),E=r===w?E+1:0,w=r,sn({complete:l,stableReads:E}))break}}if(h())return;n(e=>({...e,status:cn({sawCompletePayload:o})}))}catch(e){if(h())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}finally{g(),ln({sawCompletePayload:o})&&r&&i&&(await Xt(r,i),Ie(c,r))}})()},[c]),u=(0,K.useCallback)(async()=>{await o.current,await Promise.all([...a.current.values()])},[]),d=(0,K.useCallback)((e,t)=>{if(r.current+=1,n(e),t&&e.installedPlugins.length>0){let n=a.current;n.clear();for(let r of e.installedPlugins)n.set(r,(async()=>{try{await gn(await t(),r)}catch{}})())}},[]);return{...e,start:l,awaitPluginInstalls:u,hydrate:d}}function xn({removedClaims:e,rejectedAll:t}){if(t)return[`Correction: none of what you found in that web search is actually me —`,`it looks like you matched someone else with a similar name. Please`,`disregard everything from that search and don't remember any of it as`,`true about me. We'll build up what you actually know about me from here,`,`as we talk.`].join(` `);let n=e.map(e=>e.trim()).filter(Boolean);return n.length===0?null:[`Quick correction on what you found about me — these aren't true, so please`,`disregard them and don't remember them as facts about me:`,``,...n.map(e=>`- ${e}`)].join(`
38
- `)}async function Sn({assistantId:e,conversationId:n,removedClaims:r,rejectedAll:i}){let a=xn({removedClaims:r,rejectedAll:i});if(a){try{let t={conversationId:n,content:a,sourceChannel:`vellum`,interface:`web`,clientOs:P(),clientMessageId:crypto.randomUUID()};await T({path:{assistant_id:e},body:t,throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_correction`})}await Xt(e,n)}}var Cn={companionCoworker:`companion-coworker`,genzBoomer:`genz-boomer`,executeCollaborate:`execute-collaborate`,playfulSerious:`playful-serious`,politeUnfiltered:`polite-unfiltered`},wn=1500,Tn=12e4,En=2,Dn=e=>new Promise(t=>setTimeout(t,e)),On=e=>Math.max(0,Math.min(100,Math.round(e)));function kn(e,t){let n=t=>On(e[t]??50),r=n(Cn.companionCoworker),i=n(Cn.executeCollaborate),a=n(Cn.playfulSerious),o=n(Cn.politeUnfiltered);return`<system-message>
39
- ${t?.trim()||`The user`} wants to customize your personality.
40
- This is what they want you to be:
41
- Companion (0-100): ${100-r}
42
- Coworker (0-100): ${r}
43
- Voice Style (0 = Gen Z, 100 = Boomer): ${n(Cn.genzBoomer)}
44
- Execute Independently (0 - 100): ${100-i}
45
- Collaborative (0 - 100): ${i}
46
- Playfulness (0 - 100): ${100-a}
47
- Seriousness (0 - 100): ${a}
48
- Politeness (0 - 100): ${100-o}
49
- Unfiltered Rawness/Crassness (0 - 100): ${o}
50
-
51
- Rewrite your own identity files (IDENTITY.md and SOUL.md) to reflect your new personality — first person, in a voice and style that matches it. Do not touch users/guardian.md or anything else under users/: that is your user's profile (their name, work, preferences), not your identity.
52
-
53
- Overwrite each file completely with file_write: write the whole file fresh in one pass. This is a from-scratch rewrite, not an edit — do not append to what's already there, do not patch individual lines, and leave none of the current default wording behind. Fill in every IDENTITY.md placeholder (the _(not yet chosen)_ / _(not yet established)_ fields).
54
-
55
- Keep your existing name exactly as it is — this changes your personality, not who you are. Do not rename yourself, and if your name is already set, carry it through verbatim (don't treat it as a placeholder to fill).
56
-
57
- Each rewritten file must still be complete: SOUL.md keeps everything you operate by — how you use memory, your boundaries, your compliance stance — re-expressed in your new voice rather than dropped. When you finish, both files should read top-to-bottom as this new personality, with nothing left in the generic default voice.
58
- </system-message>`}function An(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||n.role!==`assistant`)continue;let r=n.contentBlocks;if(r&&r.length>0){let e=r.filter(e=>e.type===`text`).map(e=>e.text).join(`
59
- `).trim();if(e)return e}return(n.content??``).trim()}return``}async function jn({awaitAssistantId:e,values:n,userName:r}){let i,a;try{i=await e();let t=await S({path:{assistant_id:i},body:{conversationType:`standard`,title:`Updating personality`},throwOnError:!1});if(a=t.data?.id,!t.response?.ok||!a)return;let o={conversationId:a,content:kn(n,r),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};if(!(await T({path:{assistant_id:i},body:o,throwOnError:!1})).response?.ok)return;let s=Date.now()+Tn,c=``,l=0;for(;Date.now()<s;){await Dn(wn);let e=An((await D({path:{assistant_id:i},query:{conversationId:a},throwOnError:!1})).data?.messages??[]);if(e&&(l=e===c?l+1:0,c=e,l>=En))break}}catch(e){t(e,{context:`research_onboarding_personality`})}finally{if(i&&a)try{await w({path:{assistant_id:i,id:a},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_personality_archive`})}}}function Mn(e){return e?`research_onboarding:${e}`:null}function Nn(e){let t=Mn(e);if(!t)return null;try{let e=localStorage.getItem(t);return e?JSON.parse(e):null}catch{return null}}function Pn(e,t){let n=Mn(e);if(n)try{localStorage.setItem(n,JSON.stringify(t))}catch{}}function Fn(e){let t=Mn(e);if(t)try{localStorage.removeItem(t)}catch{}}function In(e){return e.research?.status===`done`?`suggestions`:e.step===`meeting`?e.checkinBooked?`looking`:`letschat`:e.step}function Ln(e,t){if(!e)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;try{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`,...t?{timeZone:t}:{}}).format(n)}catch{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n)}}var q=c(),Rn={w:1280,h:800};function zn(){return typeof window>`u`?Rn:{w:window.innerWidth,h:window.innerHeight}}function Bn(){let[e,t]=(0,K.useState)(null),[n,r]=(0,K.useState)(()=>zn());return(0,K.useLayoutEffect)(()=>{if(!e)return;let t=()=>{let t=e.getBoundingClientRect();r({w:t.width,h:t.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),{ref:t,size:n}}var Vn=(0,K.createContext)(null);function Hn({size:e,children:t}){return(0,q.jsx)(Vn.Provider,{value:e,children:t})}function Un(){let e=(0,K.useContext)(Vn),[t,n]=(0,K.useState)(()=>zn());return(0,K.useEffect)(()=>{if(e)return;let t=()=>n(zn());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var Wn={x:.5,y:.4},Gn=[-8,6,9,0,7,-6,5,0,-7,4,-5,6];function Kn(e){return Gn[e%Gn.length]??0}var qn=[1,0,1,0,1,0,1,0,1,0,0],Jn=[.72,1],Yn=[.4,1],Xn=[10,20],Zn=50;function Qn(e){return Jn[qn[e]??1]??1}function $n(e){return Yn[qn[e]??1]??1}function er(e){return Xn[qn[e]??1]??20}function tr(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function nr(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function rr(e,t,n){let r=n*.4,i=n*.48;return[{x:i,y:i},{x:e*.3,y:r},{x:e*.72,y:r},{x:e-i,y:i},{x:e-r,y:t*.72},{x:e-i,y:t-i},{x:i,y:t-i},{x:r,y:t*.5},{x:e-r,y:t*.3},{x:e*.38,y:t-r},{x:e*.62,y:t-r}]}function ir(e,t,n,r,i){let a=e.x-t,o=e.y-n,s=Math.hypot(a,o)||1,c=Math.max(r,i);return{x:e.x+a/s*c,y:e.y+o/s*c}}function ar({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=Un(),u=U(),d=c<640,f=new Set([4,7,8,9,10]),p=e=>d&&f.has(e),m=tr(c,l),h=m/2,g=m/2,_=nr(c,l)/m,y=nr(c,l),b=(0,K.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),x=Wn.x*c,S=Wn.y*l,C=x-h,w=S-h,T=(0,K.useMemo)(()=>rr(c,l,g),[c,l,g]);return(0,q.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0 overflow-hidden`,children:[(0,q.jsx)(`div`,{className:`absolute rounded-[50%] bg-[var(--aux-black,#000)] opacity-20 blur-md`,style:{width:y*.62,height:16,left:x-y*.31,top:S+y*.4}}),t.map((t,r)=>{let d=r===n,f=!u&&i?.char===r,g=!u&&a?.char===r;if(f){let n=T[i.fromSlot],a=ir(n,x,S,c,l),s=Qn(i.fromSlot),u=$n(i.fromSlot);return(0,q.jsx)(H.div,{className:`absolute left-0 top-0`,style:{width:m,height:m,zIndex:Zn},initial:!1,animate:{x:[n.x-h,a.x-h,a.x-h,C,C,C],y:[n.y-h,a.y-h,a.y-h,w,w,w],scale:[s,s,s,_*.7,_*1.08,_],opacity:[u,u,0,0,1,1]},transition:{duration:.85,times:[0,.28,.34,.42,.72,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},onAnimationComplete:()=>o(r),children:(0,q.jsx)(v,{components:e,traits:t,size:m})},r)}if(g){if(p(a.toSlot))return null;let n=T[a.toSlot],i=ir(n,x,S,c,l),o=Qn(a.toSlot),s=$n(a.toSlot);return(0,q.jsx)(H.div,{className:`absolute left-0 top-0`,style:{width:m,height:m,zIndex:er(a.toSlot)},initial:!1,animate:{x:[C,C,i.x-h,i.x-h,n.x-h,n.x-h],y:[w,w,i.y-h,i.y-h,n.y-h,n.y-h],scale:[_,_*.6,o,o,o*1.1,o],opacity:[1,0,0,s,s,s]},transition:{duration:.85,times:[0,.28,.34,.45,.78,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},children:(0,q.jsx)(`div`,{style:{transform:`rotate(${Kn(a.toSlot)}deg)`},children:(0,q.jsx)(v,{components:e,traits:t,size:m,breathe:!1})})},r)}let y=b.get(r)??0;if(!d&&p(y))return null;let E=d?{x,y:S}:T[y];return(0,q.jsx)(H.div,{className:`absolute left-0 top-0 ${d?``:`pointer-events-auto cursor-pointer`}`,style:{width:m,height:m,zIndex:d?Zn:er(y)},initial:!1,animate:{x:E.x-h,y:E.y-h,scale:d?_:Qn(y),opacity:d?1:$n(y)},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:d?void 0:()=>s(r),children:(0,q.jsx)(`div`,{style:{transform:d?void 0:`rotate(${Kn(b.get(r)??0)}deg)`},children:(0,q.jsx)(v,{components:e,traits:t,size:m,breathe:d})})},r)})]})}var or=[{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`},{bodyShape:`star`,eyeStyle:`surprised`,color:`orange`},{bodyShape:`blob`,eyeStyle:`gentle`,color:`pink`},{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},{bodyShape:`urchin`,eyeStyle:`curious`,color:`pink`},{bodyShape:`burst`,eyeStyle:`quirky`,color:`orange`},{bodyShape:`ghost`,eyeStyle:`bashful`,color:`green`},{bodyShape:`sprout`,eyeStyle:`dazed`,color:`orange`},{bodyShape:`star`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`flower`,eyeStyle:`angry`,color:`pink`},{bodyShape:`cloud`,eyeStyle:`curious`,color:`yellow`}],J=p(f((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:or,selectedIndex:0})},setSelectedIndex:t=>e({selectedIndex:t}),selectNext:()=>e(e=>({selectedIndex:e.characters.length===0?0:(e.selectedIndex+1)%e.characters.length})),selectPrev:()=>e(e=>({selectedIndex:e.characters.length===0?0:(e.selectedIndex-1+e.characters.length)%e.characters.length}))})));function sr(){let[e,t]=(0,K.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,K.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function cr(){let e=G(),t=J.use.characters(),n=J.use.ensureGenerated(),r=U(),{w:i,h:a}=sr();(0,K.useEffect)(()=>{e&&n(e)},[e,n]);let o=tr(i,a),s=(0,K.useMemo)(()=>rr(i,a,o/2),[i,a,o]),c=i<640,l=new Set([4,7,8,9,10]);return!e||t.length===0?null:(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 z-0 overflow-hidden`,children:t.map((t,n)=>{if(n===0)return null;let i=n-1;if(c&&l.has(i))return null;let a=s[i];if(!a)return null;let u=Gn[i%Gn.length]??0,d=o*Qn(i),f=$n(i),p=er(i);return(0,q.jsx)(`div`,{className:`absolute`,style:{left:a.x-d/2,top:a.y-d/2,width:d,height:d,zIndex:p,animation:r?void 0:`character-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) ${.1+n*.05}s both`},children:(0,q.jsx)(`div`,{style:{opacity:f,transform:`rotate(${u}deg)`},children:(0,q.jsx)(v,{components:e,traits:t,size:d,breathe:!1})})},n)})})}var lr=l(`flex w-full items-center gap-1.5 rounded-md border bg-[var(--field-bg)] px-3`,`border-[var(--field-border)] transition-[border-color,background-color] duration-150 ease-out`,`focus-within:border-[var(--border-active)]`),ur=l(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`,Ye);function Y(e){return e.trim().toLowerCase()}function dr(e,t,n=[],r=8){let i=Y(t),a=new Set(n.map(Y)),o=[];for(let t of e)if(!a.has(Y(t))&&((i.length===0||Y(t).includes(i))&&o.push(t),o.length>=r))break;return o}function fr({id:e,options:t,highlighted:n,showAddHint:r,onPick:i,onHover:a}){return(0,q.jsxs)(`ul`,{id:e,role:`listbox`,className:l(`absolute left-0 right-0 top-full z-50 mt-1.5 max-h-60 overflow-auto`,`rounded-lg bg-[var(--surface-lift)] p-1 shadow-[var(--shadow-popover)]`,`animate-[fadeInUp_0.12s_ease-out]`),children:[t.map((t,r)=>(0,q.jsx)(`li`,{id:`${e}-opt-${r}`,role:`option`,"aria-selected":r===n,onMouseDown:e=>{e.preventDefault(),i(t.value)},onMouseEnter:()=>a(r),className:l(`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5`,`text-body-medium-lighter text-[var(--content-default)]`,r===n?`bg-[var(--surface-base)]`:`bg-transparent`),children:t.isAdd?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Be,{size:15,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,q.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Add “`,t.value,`”`]}),(0,q.jsx)(`span`,{className:`ml-auto shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:`↵ Enter`})]}):t.value},t.isAdd?`__add__${t.value}`:t.value)),r&&(0,q.jsx)(`li`,{role:`presentation`,className:`mt-0.5 border-t border-[var(--border-base)] px-2.5 pb-0.5 pt-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Type anything and press ↵ to add your own`})]})}function pr({htmlFor:e,required:t,children:n}){return(0,q.jsxs)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:[n,t?(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`}):null]})}function mr(e,t){(0,K.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function hr({label:e,placeholder:t,values:n,onChange:r,suggestions:i}){let a=(0,K.useId)(),o=`tac-${a}`,s=`tac-list-${a}`,c=(0,K.useRef)(null),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(-1),_=(0,K.useMemo)(()=>dr(i,d,n),[i,d,n]),v=d.trim(),y=(0,K.useMemo)(()=>{if(!v)return!1;let e=Y(v);return!(n.some(t=>Y(t)===e)||_.some(t=>Y(t)===e))},[v,n,_]),b=(0,K.useMemo)(()=>{let e=_.map(e=>({value:e,isAdd:!1}));return y?[...e,{value:v,isAdd:!0}]:e},[_,y,v]);mr(c,()=>m(!1)),(0,K.useEffect)(()=>{g(e=>e>=b.length?b.length-1:e)},[b.length]);let x=p&&b.length>0,S=!y;function C(e){let t=e.trim();t&&(n.some(e=>Y(e)===Y(t))||r([...n,t]),f(``),g(-1))}function w(e){r(n.filter(t=>t!==e))}function T(e){e.key===`ArrowDown`?(e.preventDefault(),m(!0),g(e=>Math.min(e+1,b.length-1))):e.key===`ArrowUp`?(e.preventDefault(),g(e=>Math.max(e-1,0))):e.key===`Enter`?x&&h>=0?(e.preventDefault(),C(b[h].value)):d.trim()&&(e.preventDefault(),C(d)):e.key===`,`?(e.preventDefault(),C(d)):e.key===`Backspace`&&d.length===0&&n.length>0?w(n[n.length-1]):e.key===`Escape`&&m(!1)}return(0,q.jsxs)(`div`,{ref:c,className:`relative flex flex-col gap-1.5`,children:[(0,q.jsx)(pr,{htmlFor:o,children:e}),(0,q.jsxs)(`div`,{className:l(lr,`min-h-9 flex-wrap py-1.5`),children:[(0,q.jsx)(Le,{size:16,"aria-hidden":!0,className:`shrink-0 self-center text-[var(--content-tertiary)]`}),n.map(e=>(0,q.jsx)(u,{onRemove:()=>w(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,q.jsx)(`input`,{id:o,role:`combobox`,"aria-expanded":x,"aria-controls":s,"aria-autocomplete":`list`,"aria-activedescendant":h>=0?`${s}-opt-${h}`:void 0,autoComplete:`off`,className:l(ur,`h-6 w-24`),placeholder:n.length===0?t:``,value:d,onChange:e=>{f(e.target.value),m(!0)},onFocus:()=>m(!0),onKeyDown:T})]}),x&&(0,q.jsx)(fr,{id:s,options:b,highlighted:h,showAddHint:S,onPick:C,onHover:g})]})}var gr=`Reading.Writing.Cooking.Baking.Gardening.Photography.Painting.Drawing.Hiking.Running.Cycling.Swimming.Yoga.Climbing.Weightlifting.Gaming.Board games.Chess.Traveling.Cars.Woodworking.Knitting.Playing guitar.Playing piano.Singing.Dancing.Fishing.Camping.Surfing.Skiing.Snowboarding.Coffee.Wine.Birdwatching.Pottery.Investing.Podcasts.Movies.Soccer.Basketball.Tennis.Golf.Meditation.Volunteering.Astronomy.3D printing`.split(`.`);function X(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function _r({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[r,a]=(0,K.useState)(e),[o,s]=(0,K.useState)(t),[c,l]=(0,K.useState)(``),[u,f]=(0,K.useState)([]),p=r.trim().length>0&&c.trim().length>0;function m(){p&&n({firstName:r,lastName:o,role:c,hobbies:u})}return(0,q.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,q.jsxs)(Ue,{showCreatureFooter:!1,children:[(0,q.jsx)(cr,{}),(0,q.jsxs)(`form`,{className:`relative z-10 mx-auto flex min-h-screen w-full max-w-sm flex-col items-center justify-center px-6 py-16 text-[var(--content-default)]`,onSubmit:e=>{e.preventDefault(),m()},children:[(0,q.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:X(.05),children:`Let's start with you.`}),(0,q.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:X(.12),children:`A few details so I can get to know you.`}),(0,q.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,q.jsx)(`div`,{style:X(.2,40),children:(0,q.jsx)(d,{label:(0,q.jsxs)(q.Fragment,{children:[`What should I call you?`,(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`})]}),placeholder:`Your name`,value:r,onChange:e=>a(e.target.value),className:Ye,autoFocus:!0,required:!0,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.27,30),children:(0,q.jsx)(d,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),className:Ye,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.34,20),children:(0,q.jsx)(d,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:e=>l(e.target.value),className:Ye,required:!0,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.41,10),children:(0,q.jsx)(hr,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:u,onChange:f,suggestions:gr})})]}),(0,q.jsx)(`div`,{className:`mt-10 w-full`,style:X(.5),children:(0,q.jsx)(i,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),fullWidth:!0,disabled:!p,className:`h-11 text-base`,children:`Continue`})})]})]})})}var vr=`#1A1A1A`,yr=`#FFFFFF`;function br(e){let t=/^#?([0-9a-f]{6})$/i.exec(e);if(!t)return 0;let n=parseInt(t[1],16),r=n>>16&255,i=n>>8&255,a=n&255;return(r*299+i*587+a*114)/1e3/255}function xr(e,t){let n=/^#?([0-9a-f]{6})$/i.exec(e);if(!n)return e;let r=parseInt(n[1],16),i=e=>Math.max(0,Math.min(255,Math.round((r>>e&255)*t)));return`#${(1<<24|i(16)<<16|i(8)<<8|i(0)).toString(16).slice(1)}`}function Sr(e){let t=br(e)>.6;return{bg:e,isLight:t,fg:t?vr:yr,fgDeep:xr(e,.6),fgMuted:t?`rgba(0,0,0,0.6)`:`rgba(255,255,255,0.65)`,wash:t?`rgba(0,0,0,0.08)`:`rgba(255,255,255,0.12)`}}function Cr(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex();return(0,K.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return Sr(i??`var(--surface-base)`)},[e,t,n])}function Z({onBack:e,onNext:t,tone:n}){let r=Cr(),i=n?n===`dark`?`#1A1A1A`:`#FFFFFF`:r.fg,a=n?n===`dark`?`rgba(0,0,0,0.08)`:`rgba(255,255,255,0.12)`:r.wash;return(0,q.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Back`,className:`flex cursor-pointer h-8 w-8 items-center justify-center rounded-md transition-colors duration-150`,style:{color:i},onMouseEnter:e=>e.currentTarget.style.backgroundColor=a,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:(0,q.jsx)(h,{className:`h-5 w-5`})}),t?(0,q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Forward`,className:`flex cursor-pointer h-8 w-8 items-center justify-center rounded-md transition-colors duration-150`,style:{color:i},onMouseEnter:e=>e.currentTarget.style.backgroundColor=a,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:(0,q.jsx)(g,{className:`h-5 w-5`})}):null]})}var wr=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function Tr(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function Er({onContinue:e,onBack:t,onForward:n}){let r=G(),a=J.use.characters(),o=J.use.ensureGenerated(),s=J.use.selectedIndex(),c=J.use.setSelectedIndex();(0,K.useEffect)(()=>{r&&o(r)},[r,o]);let l=a.length,[u,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(``),[h,g]=(0,K.useState)(!1),v=(0,K.useRef)(!1),y=(0,K.useRef)(null),{ref:x,size:S}=Bn(),[C,w]=(0,K.useState)(null);(0,K.useEffect)(()=>{l>0&&u===null&&d(Tr(l,s))},[l,s,u]),(0,K.useEffect)(()=>{u&&c(u.centerChar)},[u,c]);let T=u?.centerChar;(0,K.useEffect)(()=>{T!=null&&!v.current&&p(wr[T%wr.length])},[T]),(0,K.useEffect)(()=>{h&&(y.current?.focus(),y.current?.select())},[h]);function E(e){if(!u||e===u.centerChar)return;let t=u.edgeOrder.indexOf(e);if(t<0)return;let n=[...u.edgeOrder];n[t]=u.centerChar,w({entering:{char:e,fromSlot:t},exiting:{char:u.centerChar,toSlot:t}}),d({centerChar:e,edgeOrder:n})}let D=()=>u&&E((u.centerChar+1)%l),ee=()=>u&&E((u.centerChar-1+l)%l),te=(0,K.useMemo)(()=>u?a[u.centerChar]:void 0,[u,a]),O=!!r&&!!u&&!!te;function k(){te&&e({traits:te,name:f.trim()})}function A(){v.current=!0,p(e=>{let t=wr.filter(t=>t!==e),n=t.length>0?t:wr;return n[Math.floor(Math.random()*n.length)]})}let j=`pointer-events-auto z-10 flex cursor-pointer h-10 w-10 items-center justify-center rounded-full bg-[color-mix(in_srgb,var(--content-default)_10%,transparent)] text-[var(--content-default)] transition-colors duration-150 hover:bg-[color-mix(in_srgb,var(--content-default)_18%,transparent)]`;return(0,q.jsx)(`div`,{ref:x,"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,q.jsxs)(Hn,{size:S,children:[O&&(0,q.jsx)(ar,{components:r,characters:a,centerChar:u.centerChar,edgeOrder:u.edgeOrder,entering:C?.entering??null,exiting:C?.exiting??null,onEnterComplete:e=>w(t=>t?.entering.char===e?null:t),onSelectChar:E}),(0,q.jsx)(Z,{tone:`light`,onBack:t,onNext:n?k:void 0}),(0,q.jsx)(`h1`,{className:`absolute left-1/2 top-[19%] z-10 -translate-x-1/2 whitespace-nowrap text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.4s ease-out both`},children:`Give me a face and a name`}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:ee,className:`absolute left-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${j}`,children:(0,q.jsx)(m,{className:`h-4 w-4`})}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:D,className:`absolute right-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${j}`,children:(0,q.jsx)(W,{className:`h-4 w-4`})}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[51%] z-10 flex -translate-x-1/2 flex-col items-center gap-12`,children:[h?(0,q.jsx)(`input`,{ref:y,value:f,onChange:e=>{v.current=!0,p(e.target.value)},onBlur:()=>g(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),g(!1))},placeholder:`Name your assistant`,"aria-label":`Assistant name`,className:`w-[234px] rounded-2xl border border-[var(--border-element)] bg-transparent px-4 py-2.5 text-center text-lg text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-colors duration-150 focus:border-[var(--border-active)]`}):(0,q.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),"aria-label":`Edit name`,className:`flex cursor-pointer items-center gap-2.5`,children:[(0,q.jsx)(`span`,{className:`text-3xl font-medium ${f?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:f||`Name your assistant`}),(0,q.jsx)(b,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,q.jsx)(`button`,{type:`button`,onClick:A,"aria-label":`Shuffle name`,title:`Shuffle name`,className:`cursor-pointer text-[var(--content-tertiary)] transition-[transform,color] duration-300 hover:rotate-180 hover:text-[var(--content-default)]`,children:(0,q.jsx)(_,{className:`h-5 w-5`})})]}),(0,q.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),disabled:!O,onClick:k,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})})}var Dr=/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,Or=/[MmLlHhVvCcSsQqTtAaZz][^MmLlHhVvCcSsQqTtAaZz]*/g;function kr(e){let t=1/0,n=1/0,r=-1/0,i=-1/0,a=0,o=0,s=(e,a)=>{e<t&&(t=e),a<n&&(n=a),e>r&&(r=e),a>i&&(i=a)},c=e.match(Or)??[];for(let e of c){let t=e[0],n=t.toUpperCase();if(n===`Z`)continue;let r=t!==n,i=(e.slice(1).match(Dr)??[]).map(Number);if(n===`H`)for(let e of i)a=r?a+e:e,s(a,o);else if(n===`V`)for(let e of i)o=r?o+e:e,s(a,o);else if(n===`A`)for(let e=0;e+7<=i.length;e+=7){let t=i[e+5],n=i[e+6];a=r?a+t:t,o=r?o+n:n,s(a,o)}else{let e=a,t=o;for(let n=0;n+2<=i.length;n+=2){let c=r?e+i[n]:i[n],l=r?t+i[n+1]:i[n+1];s(c,l),n+2>=i.length-i.length%2&&(a=c,o=l)}}}return t===1/0?{x:0,y:0,w:0,h:0}:{x:t,y:n,w:r-t,h:i-n}}function Ar(e){let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.w)),i=Math.max(...e.map(e=>e.y+e.h));return{x:t,y:n,w:r-t,h:i-n}}var jr=.25,Mr=.46,Nr=.3,Pr=.85,Fr=40,Ir=14,Lr=8;function Rr({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0,settleBlink:r=!0}){let i=G(),a=J.use.characters(),o=J.use.selectedIndex(),s=U(),{w:c,h:l}=Un(),[u,d]=(0,K.useState)({x:0,y:0});(0,K.useEffect)(()=>{if(s)return;let e=e=>{d({x:(e.clientX/window.innerWidth-.5)*2,y:(e.clientY/window.innerHeight-.5)*2})};return window.addEventListener(`mousemove`,e),()=>window.removeEventListener(`mousemove`,e)},[s]);let f=e&&!s,p=Bt();(0,K.useEffect)(()=>{n>0&&!s&&p.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,s,p]);let[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)(!e);(0,K.useEffect)(()=>{if(s||!g)return;let e=!1,t,n=n=>{e||(h(!0),t=setTimeout(()=>{e||(h(!1),t=setTimeout(n,140))},140))},i=()=>{t=setTimeout(()=>n(i),2500+Math.random()*4e3)};return r?n(()=>n(i)):i(),()=>{e=!0,clearTimeout(t)}},[s,g,r]);let v=a.length>0?a[o]:void 0,y=(0,K.useMemo)(()=>{if(!i||!v)return null;let e=i.eyeStyles.find(e=>e.id===v.eyeStyle);return e?{paths:e.paths,bbox:Ar(e.paths.map(e=>kr(e.svgPath)))}:null},[i,v]);if(!y)return null;let b=c*Pr,x=Math.min(Math.min(c,l)*Nr,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,C=(c-S)/2,w=l-(1-jr)*x,T=Fr/100*l-(w+x/2),E=(Mr-jr)*x,D=y.bbox.x+y.bbox.w/2,ee=y.bbox.y+y.bbox.h/2;return(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2]`,style:{left:C,top:w,width:S,height:x,transformOrigin:`center`},initial:f?{y:T,scale:.35}:!1,animate:f?{y:[T,E,0],scale:[.35,1,1]}:{y:0,scale:1},transition:f?{duration:1,delay:t,times:[0,.7,1],ease:`easeInOut`}:{duration:0},onAnimationComplete:()=>_(!0),children:(0,q.jsx)(H.div,{animate:p,children:(0,q.jsx)(`div`,{style:{transform:`translate(${u.x*Ir}px, ${u.y*Lr}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,q.jsx)(`svg`,{viewBox:`${y.bbox.x} ${y.bbox.y} ${y.bbox.w} ${y.bbox.h}`,width:S,height:x,style:{overflow:`visible`,display:`block`},children:(0,q.jsx)(`g`,{style:{transform:m?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${D}px ${ee}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,q.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}var zr=200,Br=40;function Vr({firstName:e,assistantName:t,onContinue:n,onBack:r,onForward:a}){let o=G(),s=J.use.characters(),c=J.use.selectedIndex(),l=U(),{ref:u,size:{w:d,h:f}}=Bn(),p=Cr(),m=s.length>0?s[c]:void 0,h=(0,K.useMemo)(()=>{if(!o||!m)return null;let e=o.bodyShapes.find(e=>e.id===m.bodyShape),t=o.colors.find(e=>e.id===m.color);return!e||!t?null:{body:e,color:t.hex}},[o,m]),g=e.trim()?`Hey, ${e.trim()}!`:`Hey!`,_=t?.trim()?`I’m ${t.trim()}, your new AI assistant`:`I’m your new AI assistant`;if(!h)return(0,q.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,style:{backgroundColor:`var(--surface-base)`}});let v=1.25*Math.max(d,f),y=v*h.body.viewBox.height/h.body.viewBox.width,b=(d-v)/2,x=(f-y)/2,S=zr/v,C=(Br/100-.5)*f;return(0,q.jsx)(`div`,{ref:u,"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:(0,q.jsxs)(Hn,{size:{w:d,h:f},children:[(0,q.jsx)(H.div,{className:`absolute inset-0 z-0`,style:{backgroundColor:h.color},initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.6,delay:.35}}),(0,q.jsx)(H.svg,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,viewBox:`0 0 ${h.body.viewBox.width} ${h.body.viewBox.height}`,width:v,height:y,style:{left:b,top:x,transformOrigin:`center`},initial:l?!1:{scale:S,y:C},animate:{scale:1,y:0},transition:l?{duration:0}:{type:`spring`,stiffness:78,damping:18,mass:1},children:(0,q.jsx)(`path`,{d:h.body.svgPath,fill:h.color})}),(0,q.jsx)(Rr,{entrance:!0}),(0,q.jsx)(H.div,{initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.4,delay:1},children:(0,q.jsx)(Z,{onBack:r,onNext:a})}),(0,q.jsxs)(`div`,{className:Je,children:[(0,q.jsxs)(H.h1,{className:`text-center leading-[1.05]`,style:{fontFamily:`var(--font-serif)`},initial:l?!1:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:l?{duration:0}:{type:`spring`,stiffness:260,damping:11,delay:1},children:[(0,q.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fgDeep},children:g}),(0,q.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fg},children:_})]}),(0,q.jsx)(H.div,{initial:l?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.4,delay:1.15},children:(0,q.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),onClick:n,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})})}var Hr=.3,Ur=.85,Wr=.25;function Gr(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=Un(),o=(0,K.useMemo)(()=>{if(!e||!r)return null;let t=e.eyeStyles.find(e=>e.id===r.eyeStyle);return t?{paths:t.paths,bbox:Ar(t.paths.map(e=>kr(e.svgPath)))}:null},[e,r]),s=o?Math.min(Math.min(i,a)*Hr,i*Ur*o.bbox.h/o.bbox.w):0;return{art:o,eyesW:o?s*o.bbox.w/o.bbox.h:0,eyesH:s,restCy:a-Wr*s,centerX:i/2,w:i,h:a}}function Kr({art:e,eyesW:t,eyesH:n,centerX:r,eyeCy:i,eyeScale:a,eyeX:o,blinking:s,className:c=`pointer-events-none absolute top-0 z-0`}){let l=ct(i,e=>e-n/2),u=e.bbox.x+e.bbox.w/2,d=e.bbox.y+e.bbox.h/2;return(0,q.jsx)(H.div,{"aria-hidden":`true`,className:c,style:{left:r-t/2,top:0,x:o,y:l,width:t,height:n,scale:a,transformOrigin:`center`},children:(0,q.jsx)(`svg`,{viewBox:`${e.bbox.x} ${e.bbox.y} ${e.bbox.w} ${e.bbox.h}`,width:t,height:n,style:{overflow:`visible`,display:`block`},children:(0,q.jsx)(`g`,{style:{transform:s?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${u}px ${d}px`,transition:`transform 0.13s ease-in-out`},children:e.paths.map((e,t)=>(0,q.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})}var qr={green:[`pink`,`purple`,`orange`,`yellow`],orange:[`teal`,`purple`,`green`,`yellow`],pink:[`teal`,`green`,`yellow`,`purple`],purple:[`yellow`,`teal`,`green`,`orange`],teal:[`pink`,`orange`,`yellow`,`purple`],yellow:[`purple`,`teal`,`pink`,`green`]};function Jr(e,t){let n=qr[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var Yr=new Set([`orange`,`pink`,`red`]);function Xr(e,t){return Yr.has(e)&&Yr.has(t)}function Zr(e,t,n){let r=Jr(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>Xr(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var Qr=`You’ve used AI that just answers questions`,$r=`The more I help`,ei=`I’m different`,ti=`The better I get`,ni=`and the less you have to do`,ri=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ii=290;function ai({firstH:e,secondH:t,color:n,firstText:r,secondText:i,revealed:a,carouseled:o,revealFrom:s,revealDuration:c,reduce:l}){let u=s===`bottom`?`inset(100% 0 0 0)`:`inset(0 0 100% 0)`;return!e||!t?null:(0,q.jsx)(H.div,{className:`relative w-full overflow-hidden`,initial:!1,animate:{height:o?t:e},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:(0,q.jsxs)(H.div,{className:`flex flex-col`,style:{color:n},initial:!1,animate:{y:o?-e:0},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:[(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:e},children:(0,q.jsx)(H.span,{className:`block`,initial:!1,animate:{clipPath:a?`inset(0% 0 0% 0)`:u},transition:l?{duration:0}:{duration:c,ease:`easeOut`},children:r})}),(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:t},children:(0,q.jsx)(`span`,{className:`block`,children:i})})]})})}function oi({onContinue:e,onBack:t,onForward:n}){let r=Cr(),a=U(),{art:o,eyesW:s,eyesH:c,restCy:l,centerX:u,w:d,h:f}=Gr(),p=G(),m=J.use.characters(),h=J.use.selectedIndex(),g=m.length>0?m[h]:void 0,_=f>0&&f<=800,y=_?.17:.22,b=_?`top-[17%]`:`top-[22%]`,x=at(0),S=at(1),C=(0,K.useMemo)(()=>!p||!g?`orange`:Zr(g.color,p.colors.map(e=>e.id),1)[0]??`orange`,[p,g]),w=Math.min(220,Math.max(150,d*.16)),T=-w,E=-w*.4,D=at(-220),ee=(0,K.useMemo)(()=>!p||!g?[]:Zr(g.color,p.colors.map(e=>e.id),3),[p,g]),te=Math.max(.42,Math.min(d/1100,1)),O=Math.round(ii*te),k=-O*1.1,A=-O*.42,j=at(-320),[ne,M]=(0,K.useState)(!!a),[re,N]=(0,K.useState)(!!a),[ie,P]=(0,K.useState)(!1),[ae,oe]=(0,K.useState)(!1),[se,ce]=(0,K.useState)(!1),[le,ue]=(0,K.useState)(!1),[de,fe]=(0,K.useState)(!!a),F=Math.min(d,768)-48,I=(0,K.useRef)(null),pe=(0,K.useRef)(null),me=(0,K.useRef)(null),he=(0,K.useRef)(null),ge=(0,K.useRef)(null),[_e,L]=(0,K.useState)(0),[ve,R]=(0,K.useState)(0),[z,ye]=(0,K.useState)(0),[be,B]=(0,K.useState)(0),[V,xe]=(0,K.useState)(0);return(0,K.useLayoutEffect)(()=>{I.current?.offsetHeight&&L(I.current.offsetHeight),pe.current?.offsetHeight&&R(pe.current.offsetHeight),me.current?.offsetHeight&&ye(me.current.offsetHeight),he.current?.offsetHeight&&B(he.current.offsetHeight),ge.current?.offsetHeight&&xe(ge.current.offsetHeight)},[F]),(0,K.useEffect)(()=>{x.set(l),ue(!0)},[l,x]),(0,K.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{P(!0),oe(!0),ce(!0)},1400);return()=>clearTimeout(e)},[a]),(0,K.useEffect)(()=>{if(a||!o)return;x.set(l),S.set(1),D.set(T),j.set(k),M(!1),N(!1),P(!1),oe(!1);let e=Math.max(c*.5,f*y-36),t=[],n=[],r=!1,i=e=>(t.push(e),e),s=e=>new Promise(t=>{n.push(setTimeout(t,e))});return(async()=>{if(await s(200),r||(M(!0),await Promise.all([i(zt(x,e,{duration:.55,ease:`easeOut`})),i(zt(S,.55,{duration:.55,ease:`easeOut`}))]),r)||(N(!0),await Promise.all([i(zt(x,l,{type:`spring`,stiffness:210,damping:15})),i(zt(S,1,{duration:.45,ease:`easeOut`}))]),r)||(await s(900),r)||(P(!0),oe(!0),await i(zt(D,[T,E,E,T],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`})),r)||(await s(150),r))return;ce(!0);let t=i(zt(j,[k,A,A,k],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`}));await s(700),!r&&(fe(!0),await t)})(),()=>{r=!0,t.forEach(e=>e.stop()),n.forEach(clearTimeout)}},[a,o,f,y,c,l,x,S,D,T,E,j,k,A]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:r.fg},children:[(0,q.jsx)(Z,{onBack:t,onNext:n}),(0,q.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none invisible absolute -left-[9999px] top-0 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.15]`,style:{width:F,fontFamily:`var(--font-serif)`},children:[(0,q.jsx)(`span`,{ref:I,className:`block`,children:Qr}),(0,q.jsx)(`span`,{ref:pe,className:`block`,children:$r}),(0,q.jsx)(`span`,{ref:me,className:`block`,children:ei}),(0,q.jsx)(`span`,{ref:he,className:`block`,children:ti}),(0,q.jsx)(`span`,{ref:ge,className:`block`,children:ni})]}),le&&o&&(0,q.jsx)(Kr,{art:o,eyesW:s,eyesH:c,centerX:u,eyeCy:x,eyeScale:S,blinking:!1}),!a&&p&&(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{left:Math.max(16,d*.05),top:0,y:D,width:w,height:w},children:(0,q.jsx)(v,{components:p,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:C},size:w,breathe:!1})}),!a&&p&&(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 top-0 z-[1] flex items-start`,style:{right:-Math.round(O*.12),y:j},children:ri.map((e,t)=>(0,q.jsx)(`div`,{style:{width:O,height:O,marginLeft:t===0?0:-O*.34,zIndex:ri.length-t},children:(0,q.jsx)(v,{components:p,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:ee[t]??`teal`},size:O,breathe:!1})},e.bodyShape))}),(0,q.jsxs)(`div`,{className:`${Je.replace(`top-[30%]`,b)} max-w-3xl`,children:[(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.15]`,style:{fontFamily:`var(--font-serif)`},children:[(0,q.jsx)(ai,{firstH:_e,secondH:ve,color:r.fgDeep,firstText:Qr,secondText:$r,revealed:ne,carouseled:ie,revealFrom:`bottom`,revealDuration:.55,reduce:!!a}),(0,q.jsx)(ai,{firstH:z,secondH:be,color:r.fg,firstText:ei,secondText:ti,revealed:re,carouseled:ae,revealFrom:`top`,revealDuration:.45,reduce:!!a}),(0,q.jsx)(H.div,{className:`relative w-full overflow-hidden`,style:{color:r.fg},initial:!1,animate:{height:se?V:0},transition:a?{duration:0}:{duration:.5,ease:`easeInOut`},children:V>0&&(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:V},children:(0,q.jsx)(H.span,{className:`block`,initial:!1,animate:{clipPath:se?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:a?{duration:0}:{duration:.5,ease:`easeOut`},children:ni})})})]}),de&&(0,q.jsx)(H.div,{initial:a?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:a?{duration:0}:{duration:.4},children:(0,q.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),onClick:e,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})}function si({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cs-${e}`;return(0,q.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,q.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,q.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,q.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,q.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,q.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`45.5`,fill:`none`,stroke:`#FFF6CF`,strokeOpacity:`0.6`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeDasharray:`70 210`,transform:`rotate(-128 50 50)`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,q.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,children:[(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#F4C12A`,children:`$`})]}),(0,q.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,q.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${i})`})]})}function ci({size:e,tiltX:t=0,tiltY:n=0,shadow:r=!0,spinning:i=!1,className:a}){return(0,q.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[r&&(0,q.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,left:`50%`,bottom:-e*.14,width:e*.74,height:e*.16,transform:`translateX(-50%)`,background:`radial-gradient(ellipse at center, rgba(0,0,0,0.22), rgba(0,0,0,0) 70%)`,filter:`blur(2px)`}}),(0,q.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,q.jsxs)(H.div,{className:a,style:{width:e,height:e,position:`relative`,transformStyle:`preserve-3d`},initial:!1,animate:{rotateX:t,rotateY:i?[n,n+360,n+760,n+1180]:n},transition:i?{duration:.95,times:[0,.32,.62,1],ease:`easeInOut`}:{duration:0},children:[(0,q.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(0.5px)`},children:(0,q.jsx)(si,{idSuffix:`front`})}),(0,q.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,q.jsx)(si,{idSuffix:`back`})})]})})]})}var li=.3,ui=.95;function di({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=U(),a=Cr(),{h:o}=Un(),[s,c]=(0,K.useState)(!1);function l(){if(!s){if(c(!0),i){e();return}window.setTimeout(t,li*1e3)}}let u=o*.42,d=-o*.08,f=o*.9;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Z,{onBack:n,onNext:r}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-full max-w-xl -translate-x-1/2 flex-col items-center gap-3 px-6 text-center`,children:[(0,q.jsx)(`h1`,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here are some free credits to get started`}),(0,q.jsx)(`div`,{className:`mt-8 flex flex-col items-center gap-4`,children:(0,q.jsx)(H.div,{animate:s&&!i?{y:[0,u,d,f],scale:[1,1,1,.2],opacity:[1,1,1,0]}:{},transition:{duration:ui,times:[0,li/ui,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]},onAnimationComplete:()=>{s&&e()},children:(0,q.jsx)(ci,{size:88,spinning:s&&!i})})}),!s&&(0,q.jsxs)(`button`,{type:`button`,onClick:l,className:`mt-6 flex cursor-pointer h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97]`,style:{backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Claim`,(0,q.jsx)(W,{className:`h-4 w-4`})]})]})]})}function fi(e,[t,n]){return Math.min(n,Math.max(t,e))}typeof window<`u`&&window.document&&window.document.createElement;function pi(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function mi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function hi(...e){return t=>{let n=!1,r=e.map(e=>{let r=mi(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():mi(e[t],null)}}}}function Q(...e){return K.useCallback(hi(...e),e)}function gi(e,t=[]){let n=[];function r(t,r){let i=K.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=K.useMemo(()=>o,Object.values(o));return(0,q.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=K.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>K.createContext(e));return function(n){let r=n?.[e]||t;return K.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,_i(i,...t)]}function _i(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return K.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var vi=globalThis?.document?K.useLayoutEffect:()=>{},yi=K.useInsertionEffect||vi;function bi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=xi({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=K.useRef(e!==void 0);K.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,K.useCallback(t=>{if(s){let n=Si(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function xi({defaultProp:e,onChange:t}){let[n,r]=K.useState(e),i=K.useRef(n),a=K.useRef(t);return yi(()=>{a.current=t},[t]),K.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Si(e){return typeof e==`function`}var Ci=K.createContext(void 0);function wi(e){let t=K.useContext(Ci);return e||t||`ltr`}function Ti(e){let t=K.useRef({value:e,previous:e});return K.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ei(e){let[t,n]=K.useState(void 0);return vi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}r();function Di(e){let t=Oi(e),n=K.forwardRef((e,n)=>{let{children:r,...i}=e,a=K.Children.toArray(r),o=a.find(Ai);if(o){let e=o.props.children,r=a.map(t=>t===o?K.Children.count(e)>1?K.Children.only(null):K.isValidElement(e)?e.props.children:null:t);return(0,q.jsx)(t,{...i,ref:n,children:K.isValidElement(e)?K.cloneElement(e,void 0,r):null})}return(0,q.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Oi(e){let t=K.forwardRef((e,t)=>{let{children:n,...r}=e;if(K.isValidElement(n)){let e=Mi(n),i=ji(r,n.props);return n.type!==K.Fragment&&(i.ref=t?hi(t,e):e),K.cloneElement(n,i)}return K.Children.count(n)>1?K.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ki=Symbol(`radix.slottable`);function Ai(e){return K.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ki}function ji(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 Mi(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 Ni=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Di(`Primitive.${t}`),r=K.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Pi(e){let t=Fi(e),n=K.forwardRef((e,n)=>{let{children:r,...i}=e,a=K.Children.toArray(r),o=a.find(Li);if(o){let e=o.props.children,r=a.map(t=>t===o?K.Children.count(e)>1?K.Children.only(null):K.isValidElement(e)?e.props.children:null:t);return(0,q.jsx)(t,{...i,ref:n,children:K.isValidElement(e)?K.cloneElement(e,void 0,r):null})}return(0,q.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Fi(e){let t=K.forwardRef((e,t)=>{let{children:n,...r}=e;if(K.isValidElement(n)){let e=zi(n),i=Ri(r,n.props);return n.type!==K.Fragment&&(i.ref=t?hi(t,e):e),K.cloneElement(n,i)}return K.Children.count(n)>1?K.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ii=Symbol(`radix.slottable`);function Li(e){return K.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ii}function Ri(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 zi(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 Bi(e){let t=e+`CollectionProvider`,[n,r]=gi(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=K.useRef(null),a=K.useRef(new Map).current;return(0,q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Pi(s),l=K.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,q.jsx)(c,{ref:Q(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Pi(u),p=K.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=K.useRef(null),s=Q(t,o),c=a(u,n);return K.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,q.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return K.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));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:o,Slot:l,ItemSlot:p},m,r]}var Vi=[`PageUp`,`PageDown`],Hi=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Ui={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Wi=`Slider`,[Gi,Ki,qi]=Bi(Wi),[Ji,Yi]=gi(Wi,[qi]),[Xi,Zi]=Ji(Wi),Qi=K.forwardRef((e,t)=>{let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:m,...h}=e,g=K.useRef(new Set),_=K.useRef(0),v=o===`horizontal`?ta:na,[y=[],b]=bi({prop:u,defaultProp:l,onChange:e=>{[...g.current][_.current]?.focus(),d(e)}}),x=K.useRef(y);function S(e){T(e,ga(y,e))}function C(e){T(e,_.current)}function w(){let e=x.current[_.current];y[_.current]!==e&&f(y)}function T(e,t,{commit:n}={commit:!1}){let o=xa(a),s=fi(Sa(Math.round((e-r)/a)*a+r,o),[r,i]);b((e=[])=>{let r=pa(e,s,t);if(ya(r,c*a)){_.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}else return e})}return(0,q.jsx)(Xi,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:_,thumbs:g.current,values:y,orientation:o,form:m,children:(0,q.jsx)(Gi.Provider,{scope:e.__scopeSlider,children:(0,q.jsx)(Gi.Slot,{scope:e.__scopeSlider,children:(0,q.jsx)(v,{"aria-disabled":s,"data-disabled":s?``:void 0,...h,ref:t,onPointerDown:pi(h.onPointerDown,()=>{s||(x.current=y)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:S,onSlideMove:s?void 0:C,onSlideEnd:s?void 0:w,onHomeKeyDown:()=>!s&&T(r,0,{commit:!0}),onEndKeyDown:()=>!s&&T(i,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){let n=Vi.includes(e.key)||e.shiftKey&&Hi.includes(e.key)?10:1,r=_.current,i=y[r];T(i+a*n*t,r,{commit:!0})}}})})})})});Qi.displayName=Wi;var[$i,ea]=Ji(Wi,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),ta=K.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=K.useState(null),p=Q(t,e=>f(e)),m=K.useRef(void 0),h=wi(i),g=h===`ltr`,_=g&&!a||!g&&a;function v(e){let t=m.current||d.getBoundingClientRect(),i=ba([0,t.width],_?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return(0,q.jsx)($i,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:(0,q.jsx)(ra,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=Ui[_?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),na=K.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=K.useRef(null),d=Q(t,u),f=K.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=ba([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return(0,q.jsx)($i,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,q.jsx)(ra,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=Ui[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),ra=K.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Zi(Wi,n);return(0,q.jsx)(Ni.span,{...l,ref:t,onKeyDown:pi(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Vi.concat(Hi).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:pi(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:pi(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:pi(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),ia=`SliderTrack`,aa=K.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Zi(ia,n);return(0,q.jsx)(Ni.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});aa.displayName=ia;var oa=`SliderRange`,sa=K.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Zi(oa,n),a=ea(oa,n),o=Q(t,K.useRef(null)),s=i.values.length,c=i.values.map(e=>ma(e,i.min,i.max)),l=s>1?Math.min(...c):0,u=100-Math.max(...c);return(0,q.jsx)(Ni.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:o,style:{...e.style,[a.startEdge]:l+`%`,[a.endEdge]:u+`%`}})});sa.displayName=oa;var ca=`SliderThumb`,la=K.forwardRef((e,t)=>{let n=Ki(e.__scopeSlider),[r,i]=K.useState(null),a=Q(t,e=>i(e)),o=K.useMemo(()=>r?n().findIndex(e=>e.ref.current===r):-1,[n,r]);return(0,q.jsx)(ua,{...e,ref:a,index:o})}),ua=K.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=Zi(ca,n),s=ea(ca,n),[c,l]=K.useState(null),u=Q(t,e=>l(e)),d=c?o.form||!!c.closest(`form`):!0,f=Ei(c),p=o.values[r],m=p===void 0?0:ma(p,o.min,o.max),h=ha(r,o.values.length),g=f?.[s.size],_=g?_a(g,m,s.direction):0;return K.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),(0,q.jsxs)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${m}% + ${_}px)`},children:[(0,q.jsx)(Gi.ItemSlot,{scope:e.__scopeSlider,children:(0,q.jsx)(Ni.span,{role:`slider`,"aria-label":e[`aria-label`]||h,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,tabIndex:o.disabled?void 0:0,...a,ref:u,style:p===void 0?{display:`none`}:e.style,onFocus:pi(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&(0,q.jsx)(fa,{name:i??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),form:o.form,value:p},r)]})});la.displayName=ca;var da=`RadioBubbleInput`,fa=K.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=K.useRef(null),a=Q(i,r),o=Ti(t);return K.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`input`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,q.jsx)(Ni.input,{style:{display:`none`},...n,ref:a,defaultValue:t})});fa.displayName=da;function pa(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function ma(e,t,n){return fi(100/(n-t)*(e-t),[0,100])}function ha(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function ga(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function _a(e,t,n){let r=e/2;return(r-ba([0,50],[0,r])(t)*n)*n}function va(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function ya(e,t){if(t>0){let n=va(e);return Math.min(...n)>=t}return!0}function ba(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function xa(e){return(String(e).split(`.`)[1]||``).length}function Sa(e,t){let n=10**t;return Math.round(e*n)/n}var Ca=Qi,wa=aa,Ta=la;We();var Ea=640,Da=[{id:`companion-coworker`,left:`Companion`,right:`Coworker`,leftAvatar:{bodyShape:`blob`,eyeStyle:`gentle`,color:`pink`},rightAvatar:{bodyShape:`ninja`,eyeStyle:`curious`,color:`purple`}},{id:`genz-boomer`,left:`Gen Z`,right:`Baby Boomer`,leftAvatar:{bodyShape:`burst`,eyeStyle:`quirky`,color:`yellow`},rightAvatar:{bodyShape:`cloud`,eyeStyle:`dazed`,color:`green`}},{id:`execute-collaborate`,left:`Independent`,right:`Collaborative`,leftAvatar:{bodyShape:`star`,eyeStyle:`angry`,color:`orange`},rightAvatar:{bodyShape:`flower`,eyeStyle:`goofy`,color:`teal`}},{id:`playful-serious`,left:`Playful`,right:`Serious`,leftAvatar:{bodyShape:`star`,eyeStyle:`goofy`,color:`yellow`},rightAvatar:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`}},{id:`polite-unfiltered`,left:`Polite`,right:`Unfiltered`,leftAvatar:{bodyShape:`sprout`,eyeStyle:`bashful`,color:`green`},rightAvatar:{bodyShape:`urchin`,eyeStyle:`surprised`,color:`orange`}}],Oa=[`9%`,`27%`,`45%`,`62%`,`79%`],ka=50,Aa=`rgba(36, 41, 46, 0.2)`,ja=`#FDFDFC`,Ma=.16;function Na(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=r[i-1],o=e[i+1],s=e[i]??``,c=e=>e===t||e===a;if(!c(s)){r.push(s);continue}let l=n.find(e=>!c(e)&&e!==o)??n.find(e=>!c(e))??s;r.push(l)}return r}function Pa(){let[e,t]=(0,K.useState)(()=>typeof window>`u`?1280:window.innerWidth);return(0,K.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Fa({components:e,traits:t,side:n,top:r,size:i,progress:a}){let o=Math.max(0,Math.min(1,a)),s=100+Ma*100,c=n===`left`?-100+s*o:100-s*o;return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute`,style:{[n]:`calc(50% - 50vw)`,top:r,width:i,height:i,opacity:Math.min(1,o*1.6),transform:`translate(${c}%, -50%) scale(${.8+.2*o})`,transformOrigin:`${n} center`,transition:`transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease`,willChange:`transform, opacity`},children:(0,q.jsx)(v,{components:e,traits:t,size:i,breathe:!1})})}function Ia({axis:e,value:t,onValueChange:n,fg:r,disabled:i}){return(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1.5 sm:flex-nowrap`,children:[(0,q.jsx)(`span`,{className:`order-1 flex-1 text-left text-base sm:w-32 sm:flex-none sm:text-right sm:text-[17px]`,style:{color:r},children:e.left}),(0,q.jsx)(`span`,{className:`order-2 flex-1 text-right text-base sm:order-3 sm:w-32 sm:flex-none sm:text-left sm:text-[17px]`,style:{color:r},children:e.right}),(0,q.jsxs)(Ca,{className:`relative order-3 flex h-6 w-full touch-none items-center select-none sm:order-2 sm:w-auto sm:flex-1`,value:[t],onValueChange:e=>n(e[0]??ka),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,q.jsx)(wa,{className:`relative h-3 w-full grow rounded-full`,style:{backgroundColor:Aa}}),(0,q.jsx)(Ta,{className:`block h-6 w-6 cursor-grab rounded-full shadow-sm transition-transform active:scale-95 active:cursor-grabbing keyboard-focus:outline-none keyboard-focus:ring-2 keyboard-focus:ring-white/70 data-[disabled]:cursor-not-allowed data-[disabled]:active:scale-100`,style:{backgroundColor:ja}})]})]})}function La({components:e,values:t,sideAvatars:n,size:r}){return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10`,children:Da.map((i,a)=>{let o=t[i.id]??ka,s=Math.max(0,(ka-o)/ka),c=Math.max(0,(o-ka)/ka),l=Oa[a]??`50%`,u=n[a];return u?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Fa,{components:e,traits:u.left,side:`left`,top:l,size:r,progress:s}),(0,q.jsx)(Fa,{components:e,traits:u.right,side:`right`,top:l,size:r,progress:c})]},i.id):null})})}function Ra({values:e,onValueChange:t,locked:n,onContinue:r,onBack:i,onForward:a}){let o=Cr(),s=G(),c=Pa(),l=c>=Ea,u=J.use.characters()[J.use.selectedIndex()]?.color,d=Math.round(Math.min(300,Math.max(160,c*.16))),f=(0,K.useMemo)(()=>{let e=s?.colors.map(e=>e.id)??[],t=Na(Da.map(e=>e.leftAvatar.color),u,e),n=Na(Da.map(e=>e.rightAvatar.color),u,e);return Da.map((e,r)=>({left:{...e.leftAvatar,color:t[r]??e.leftAvatar.color},right:{...e.rightAvatar,color:n[r]??e.rightAvatar.color}}))},[s,u]);return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:o.fg},children:[(0,q.jsx)(Z,{onBack:i,onNext:a}),l&&s&&(0,q.jsx)(La,{components:s,values:e,sideAvatars:f,size:d}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] flex w-full max-w-2xl -translate-x-1/2 flex-col items-center gap-10 px-6`,children:[(0,q.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,q.jsx)(`h1`,{className:`text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Create my personality`}),n?(0,q.jsx)(`p`,{className:`text-center text-[15px]`,style:{color:o.fgMuted},children:`Personality locked — chat with your assistant to make any more updates`}):(0,q.jsx)(`p`,{className:`max-w-md text-center text-[15px]`,style:{color:o.fgMuted},children:`How do you want me to talk to you? You can always ask me to change my personality later.`})]}),(0,q.jsx)(`div`,{className:`flex w-full flex-col gap-8 sm:gap-11`,style:{opacity:n?.7:1},children:Da.map(r=>(0,q.jsx)(Ia,{axis:r,value:e[r.id]??ka,onValueChange:e=>t(r.id,e),fg:o.fg,disabled:n},r.id))}),(0,q.jsxs)(`button`,{type:`button`,onClick:r,className:`mt-4 flex h-11 w-[234px] cursor-pointer items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97]`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Continue`,(0,q.jsx)(W,{className:`h-4 w-4`})]})]})]})}function za({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a,missingCalendarScope:o=!1,onRetry:s,hatchError:c=null}){let l=Cr(),{handleConnect:u,oauthInProgress:d}=He({assistantId:e??``,onConnect:n}),f=()=>{s?.(),u()},p=!e||!t,m=p||d;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:l.fg},children:[(0,q.jsx)(Z,{onBack:i,onNext:a}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-[360px] -translate-x-1/2 flex-col items-center gap-5 text-center`,children:[(0,q.jsx)(`h1`,{className:`text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:p?`Waking up`:o?`Access not enabled`:`Let me make this easy`}),(0,q.jsx)(`p`,{className:`text-[16px]`,style:{color:l.fgMuted},children:p?`Your assistant is getting ready`:o?`Check the box next to the Google Calendar permission so I can book the check-in.`:`Connect your Google Calendar so I can find time to check in and start helping.`}),(0,q.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-4`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:f,disabled:m,className:`flex cursor-pointer h-11 w-full items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:l.isLight?`#1A1A1A`:`#FFFFFF`,color:l.isLight?`#FFFFFF`:`#1A1A1A`},children:p?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(y,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):d?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(y,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(!p||c)&&(0,q.jsx)(`button`,{type:`button`,onClick:r,disabled:d,className:`cursor-pointer text-body-small-default transition-opacity hover:opacity-100 disabled:opacity-60`,style:{color:l.fgMuted},children:`Skip for now`})]})]})]})}var Ba=Sr(`#17191C`);function Va(){let[e,t]=(0,K.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,K.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Ha(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function Ua({size:e=64,isStreaming:t=!1}){let{components:n,chosen:r}=Ha();return!n||!r?(0,q.jsx)(`div`,{style:{width:e,height:e}}):(0,q.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,q.jsx)(v,{components:n,traits:r,size:e,isStreaming:t})})}var Wa=64,Ga=4500,Ka=7e3;function qa({onDone:e,onBack:t,onForward:n,scheduledTime:r,awaitingTime:i}){let{components:a,chosen:o}=Ha(),s=U(),{w:c,h:l}=Va(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,K.useEffect)(()=>{let t=setTimeout(e,i&&!r?Ka:Ga);return()=>clearTimeout(t)},[e,i,r]);let d=(0,K.useRef)(null),[f,p]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{let e=()=>{let e=d.current?.getBoundingClientRect();e&&p({cx:e.left+e.width/2,cy:e.top+e.height/2})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[u]);let m=1.3*Math.max(c,l)/Wa,h=f?c/2-f.cx:0,g=f?l*.88-f.cy:0,_=l*.05;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,q.jsx)(Z,{onBack:t,onNext:n,tone:`light`}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(`div`,{ref:d,className:`relative shrink-0`,style:{width:Wa,height:Wa},children:a&&o&&f&&(0,q.jsx)(H.div,{className:`absolute inset-0`,style:{transformOrigin:`center`},initial:s?!1:{scale:m,x:h,y:g},animate:{x:[h,h,0,0],y:[g,g+_,0,0],scale:[m,m,1.07,1]},transition:s?{duration:0}:{duration:1.1,times:[0,.18,.82,1],ease:[`easeOut`,`easeIn`,`easeOut`]},children:(0,q.jsx)(v,{components:a,traits:o,size:Wa})})}),(0,q.jsx)(H.span,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:s?!1:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:s?{duration:0}:{duration:.4,delay:.9},children:u})]})]})}var Ja=[`Searching the web to get to know you…`,`Reading public profiles…`,`Skimming the highlights…`,`Connecting the dots…`,`Piecing it together…`],Ya=[`Updating my personality…`,`Finding my voice…`,`Getting into character…`],Xa=`Almost there…`,Za=[...Ja,Xa],Qa=[...Ya,Xa],$a=2800;function eo({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i}){let a=Ba,[o,s]=(0,K.useState)(0);return(0,K.useEffect)(()=>{n?.(o);let t=o>=Za.length-1;if(i&&t){let t=setTimeout(e,$a);return()=>clearTimeout(t)}let r=setTimeout(()=>s(e=>(e+1)%Za.length),$a);return()=>clearTimeout(r)},[o,i,e,n]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Z,{onBack:t,onNext:r}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(Ua,{isStreaming:!0}),(0,q.jsx)(Fe,{mode:`wait`,children:(0,q.jsx)(H.p,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Za[o]},o)})]})]})}function to({onDone:e,ready:t}){let n=Ba,[r,i]=(0,K.useState)(0);return(0,K.useEffect)(()=>{let n=Qa.length-1;if(t){if(r!==n){i(n);return}let t=setTimeout(e,$a);return()=>clearTimeout(t)}let a=setTimeout(()=>i(e=>(e+1)%Qa.length),$a);return()=>clearTimeout(a)},[r,t,e]),(0,q.jsx)(`div`,{className:`absolute inset-0 z-10`,style:{color:n.fg},children:(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(Ua,{isStreaming:!0}),(0,q.jsx)(Fe,{mode:`wait`,children:(0,q.jsx)(H.p,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Qa[r]},r)})]})})}function no({claims:e,loading:t,onContinue:n,onRejectAll:r,onBack:i,onForward:a}){let o=Ba,s=U(),[c,l]=(0,K.useState)(()=>new Set),u=e.filter(e=>!c.has(e.claim)),d=u.length>0,f=!t;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,q.jsx)(Z,{onBack:i,onNext:a}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(Ua,{}),(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`This is what I found about you`})]}),(0,q.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:o.fgMuted},children:d?t?`Still checking the rest. You can review these as they come in.`:`I searched the web. Feel free to remove anything that isn’t true`:t?`Still putting this together…`:`I didn’t turn up much — we can fill it in as we chat.`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,q.jsx)(Fe,{children:u.map(e=>(0,q.jsxs)(H.div,{layout:!0,initial:s?!1:{opacity:0,y:10},animate:{opacity:1,y:0},exit:s?void 0:{opacity:0,scale:.95},className:`flex items-center justify-between gap-3 rounded-2xl px-5 py-4 text-[15px]`,style:{backgroundColor:o.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,q.jsx)(`span`,{children:e.claim}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove "${e.claim}"`,onClick:()=>l(t=>new Set(t).add(e.claim)),className:`flex cursor-pointer h-6 w-6 shrink-0 items-center justify-center rounded-full transition-opacity hover:opacity-100`,style:{color:o.fgMuted},children:(0,q.jsx)(x,{className:`h-4 w-4`})})]},e.claim))})}),d&&f&&(0,q.jsx)(`button`,{type:`button`,onClick:r,className:`mt-5 self-start cursor-pointer text-[14px] underline underline-offset-2 transition-opacity hover:opacity-80`,style:{color:o.fgMuted},children:`This is not me`}),(0,q.jsxs)(`button`,{type:`button`,onClick:()=>n([...c]),disabled:!f,className:`mt-8 flex cursor-pointer h-11 w-[200px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[f?`Continue`:`Still searching…`,f&&(0,q.jsx)(W,{className:`h-4 w-4`})]})]})]})}var ro=[{suggestion:`I'll pull together a quick brief on what's new in your field`,prompt:`Give me a quick brief on what's new in my field right now.`},{suggestion:`I'll send a weekly briefing on news in your space`,prompt:`Set up a weekly briefing on news in my space.`},{suggestion:`I'll help you get on top of your week`,prompt:`Help me get on top of my week.`},{suggestion:`I'll draft something from a few rough notes`,prompt:`Draft something from a few rough notes I'll give you.`}];function io({label:e,tone:t}){return(0,q.jsx)(`span`,{className:`inline-flex items-center whitespace-nowrap rounded-full px-2.5 py-[3px] text-[12px] font-medium align-middle`,style:{backgroundColor:t.bg,color:t.fg},children:e})}function ao(e,t){return e.map((n,r)=>{let i=``;return r>0&&(i=r===e.length-1?e.length===2?` and `:`, and `:`, `),(0,q.jsxs)(K.Fragment,{children:[i,(0,q.jsx)(io,{label:n,tone:t})]},n)})}var $=64,oo=$;function so({pluginLabels:e,tone:t,pillTone:n,reduce:r,slotRef:i,revealed:a}){let o=e.length>1;return(0,q.jsxs)(`div`,{className:`mt-12 flex items-center gap-3`,children:[(0,q.jsx)(`div`,{ref:i,className:`shrink-0`,style:{width:oo,height:oo}}),(0,q.jsxs)(H.p,{className:`text-[14px]`,style:{color:t.fg},initial:!1,animate:{opacity:+!!a,x:a?0:-6},transition:r?{duration:0}:{duration:.35},children:[`Already set up the `,ao(e,n),` plugin`,o?`s`:``,` `,`to help with your work`]})]})}function co({head:e,note:t,flyToNote:n,reduce:r,onLanded:i}){let{components:a,chosen:o}=Ha();if(!a||!o)return null;let s=$/2,c=n&&t?t:e,l={x:c.x-s,y:c.y-s};return(0,q.jsx)(H.div,{className:`pointer-events-none absolute left-0 top-0`,style:{width:$,height:$,transformOrigin:`center`},initial:!1,animate:l,transition:r?{duration:0}:n&&t?{type:`spring`,duration:.9,bounce:.45}:{duration:.4},onAnimationComplete:()=>{n&&t&&i()},children:(0,q.jsx)(v,{components:a,traits:o,size:$})})}function lo({suggestions:e,loading:t,installedPlugins:n=[],onSuggestionClick:r,onSkip:i,onBack:a,onForward:o}){let s=Ba,c=Cr(),l=U(),u=e.length>0?e:t?[]:ro,d=n.map(Ge).filter(e=>e.length>0),f=d.length>0,p=(0,K.useRef)(null),m=(0,K.useRef)(null),h=(0,K.useRef)(null),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!1);(0,K.useLayoutEffect)(()=>{let e=()=>{let e=p.current,t=m.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=e=>({x:e.left-n.left+e.width/2,y:e.top-n.top+e.height/2}),i=h.current;_({head:r(t.getBoundingClientRect()),note:i?r(i.getBoundingClientRect()):void 0})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[u.length,f]);let S=g?.note?.y;return(0,K.useEffect)(()=>{!f||S===void 0||v||y(!0)},[f,S,v]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:s.fg},children:[(0,q.jsx)(Z,{onBack:a,onNext:o}),(0,q.jsxs)(`div`,{ref:p,className:`absolute left-1/2 top-[14%] sm:top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(H.div,{ref:m,className:`shrink-0`,style:{height:$},initial:!1,animate:v?{width:0,marginRight:0}:{width:$,marginRight:12},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here’s what we could do first`})]}),(0,q.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:s.fgMuted},children:u.length>0?(0,q.jsxs)(q.Fragment,{children:[`Pick one to jump in — or start your own thing.`,` `,(0,q.jsx)(`button`,{type:`button`,onClick:i,className:`cursor-pointer underline underline-offset-2 transition-opacity hover:opacity-80`,style:{color:s.fg},children:`Skip to Chat`})]}):`Putting together a few ideas…`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-3`,children:u.map((e,t)=>(0,q.jsx)(H.button,{type:`button`,onClick:()=>r(e),initial:l?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.3,delay:t*.06},className:`cursor-pointer rounded-2xl px-5 py-4 text-left text-[15px] transition-transform duration-150 hover:scale-[1.01] active:scale-[0.99]`,style:{backgroundColor:s.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:(0,q.jsx)(`span`,{children:e.suggestion})},`${t}-${e.suggestion}`))}),f&&(0,q.jsx)(so,{pluginLabels:d,tone:s,pillTone:c,reduce:l,slotRef:h,revealed:b}),g&&(0,q.jsx)(co,{head:g.head,note:g.note,flyToNote:v&&f&&g.note!==void 0,reduce:l,onLanded:()=>x(!0)})]})]})}function uo({installedPlugins:e=[],pluginCatalog:t={},onStart:n,onBack:r,onForward:i}){let a=Ba,o=U(),[s,c]=(0,K.useState)(!1),l=e.map(e=>({name:e,displayName:Ge(e),description:t[e]?.trim()??``})).filter(e=>e.displayName.length>0),u=l.length>0,d=(0,K.useRef)(null),f=(0,K.useRef)(null),p=(0,K.useRef)(null),[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(!1);(0,K.useLayoutEffect)(()=>{let e=()=>{let e=d.current,t=f.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=e=>({x:e.left-n.left+e.width/2,y:e.top-n.top+e.height/2}),i=p.current;h({head:r(t.getBoundingClientRect()),note:i?r(i.getBoundingClientRect()):void 0})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[l.length]);let b=m?.note?.y;return(0,K.useEffect)(()=>{b===void 0||g||_(!0)},[b,g]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Z,{onBack:r,onNext:i}),(0,q.jsxs)(`div`,{ref:d,className:`absolute left-1/2 top-1/2 z-10 flex w-full max-w-xl -translate-x-1/2 -translate-y-1/2 flex-col px-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(H.div,{ref:f,className:`shrink-0`,style:{height:$},initial:!1,animate:g?{width:0,marginRight:0}:{width:$,marginRight:12},transition:o?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`You’re all set`})]}),u&&(0,q.jsx)(`div`,{className:`mt-4 flex flex-col gap-3`,children:l.map((e,t)=>(0,q.jsxs)(H.div,{initial:o?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:o?{duration:0}:{duration:.3,delay:t*.06},className:`rounded-2xl px-5 py-4`,style:{backgroundColor:a.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,q.jsx)(`div`,{className:`text-[15px] font-medium`,children:e.displayName}),e.description&&(0,q.jsx)(`div`,{className:`mt-1 text-[13px] leading-snug`,style:{color:a.fgMuted},children:e.description})]},e.name))}),(0,q.jsxs)(`div`,{className:`mt-16 flex items-center gap-3`,children:[(0,q.jsx)(`div`,{ref:p,className:`shrink-0`,style:{width:oo}}),(0,q.jsx)(H.p,{className:`text-[15px]`,style:{color:a.fg},initial:!1,animate:{opacity:+!!v,x:v?0:-6},transition:o?{duration:0}:{duration:.35},children:`I’ve set myself up with plugins around who you are.`})]}),(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{s||(c(!0),Promise.resolve().then(n).catch(()=>c(!1)))},disabled:s,className:`mt-16 flex cursor-pointer h-11 w-[200px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[s?`Starting…`:`Let's chat`,!s&&(0,q.jsx)(W,{className:`h-4 w-4`})]}),m&&(0,q.jsx)(co,{head:m.head,note:m.note,flyToNote:g&&m.note!==void 0,reduce:o,onLanded:()=>y(!0)})]})]})}var fo=[{bodyShape:`sprout`,eyeStyle:`curious`,colorIdx:0,base:230,pos:e=>({left:-e*.32,top:`40%`})},{bodyShape:`flower`,eyeStyle:`goofy`,colorIdx:1,base:230,pos:e=>({right:-e*.32,top:`40%`})},{bodyShape:`star`,eyeStyle:`dazed`,colorIdx:2,base:240,mobile:!0,pos:e=>({left:`16%`,bottom:-e*.42}),mobilePos:e=>({left:-e*.3,bottom:-e*.3})},{bodyShape:`burst`,eyeStyle:`angry`,colorIdx:0,base:240,mobile:!0,pos:e=>({right:`16%`,bottom:-e*.42}),mobilePos:e=>({right:-e*.3,bottom:-e*.3})},{bodyShape:`blob`,eyeStyle:`gentle`,colorIdx:1,base:220,pos:e=>({left:`42%`,bottom:-e*.5})},{bodyShape:`urchin`,eyeStyle:`curious`,colorIdx:2,base:220,mobile:!0,pos:e=>({left:-e*.28,bottom:`16%`}),mobilePos:e=>({left:-e*.3,top:-e*.3})},{bodyShape:`burst`,eyeStyle:`quirky`,colorIdx:0,base:220,mobile:!0,pos:e=>({right:-e*.28,bottom:`16%`}),mobilePos:e=>({right:-e*.3,top:-e*.3})},{bodyShape:`flower`,eyeStyle:`quirky`,colorIdx:1,base:230,pos:e=>({left:`30%`,bottom:-e*.4})}],po=`#17191C`,mo=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ho=290;function go({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0,showTopTeam:i=!1}){let a=G(),o=J.use.characters(),s=J.use.selectedIndex(),c=U(),{w:l}=Un(),u=Math.max(.42,Math.min(l/1100,1)),d=l<640,f=o.length>0?o[s]:void 0,{bg:p,peekColors:m}=(0,K.useMemo)(()=>!a||!f?{bg:`var(--surface-base)`,peekColors:[]}:{bg:a.colors.find(e=>e.id===f.color)?.hex??`var(--surface-base)`,peekColors:Zr(f.color,a.colors.map(e=>e.id),3)},[a,f]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(H.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?po:p},transition:c?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,q.jsx)(Rr,{bumpNonce:t,settleBlink:!1}),i&&a&&(0,q.jsx)(`div`,{className:`pointer-events-none absolute right-0 z-[1] flex items-start`,style:{top:-Math.round(ho*u)*.42,right:-Math.round(ho*u)*.12},children:mo.map((e,t)=>{let n=Math.round(ho*u);return(0,q.jsx)(H.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:mo.length-t},initial:c?!1:{y:-140,opacity:0},animate:{y:0,opacity:1},transition:c?{duration:0}:{type:`spring`,stiffness:200,damping:18,delay:t*.1},children:(0,q.jsx)(v,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:m[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),a&&(0,q.jsx)(Fe,{children:(d?fo.filter(e=>e.mobile):fo).slice(0,Math.max(0,e)).map((e,t)=>{let n=Math.round(e.base*u),r=d&&e.mobilePos?e.mobilePos(n):e.pos(n);return(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{...r,width:n,height:n},initial:c?!1:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:c?void 0:{scale:0,opacity:0},transition:c?{duration:0}:{type:`spring`,stiffness:220,damping:16,delay:.1},children:(0,q.jsx)(v,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:m[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}var _o=`You're about to begin your first conversation.
60
- Respond with a warm and engaging greeting. Be interesting, be real. This is your chance to get to know and impress the user.
61
- Keep it short! For this opening greeting only, don't use \`recall\` or read any files — just say hello. (This applies to the greeting alone; use your tools normally for everything the user asks afterward.)`;function vo(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobby:e.hobbies.join(`, `)}}function yo(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}We();function bo(){let e=a(),t=j.use.user(),n=t?.id??null,r=Re.use.enterFocus(),i=Re.use.exitFocus(),s=Re.use.setPendingAvatarTraits(),c=Re.use.requestSidebarCollapse(),l=ae.use.researchOnboarding(),u=ae.use.personalityOnboarding(),d=ae.use.hydrated(),[f,p]=(0,K.useState)(`form`),{ref:m,size:h}=Bn(),[g,_]=(0,K.useState)([]),[v,y]=(0,K.useState)(!1);function b(e){p(e)}function x(e,t=`completed`){Ke(qe[f],{userId:n,outcome:t}),_([]),b(e)}function S(e){_(e=>[...e,f]),b(e)}function C(){let e=g[g.length-1];e&&(_(e=>e.slice(0,-1)),b(e))}let w=g.length>0?C:void 0,[T,E]=(0,K.useState)(null),[D,ee]=(0,K.useState)(null),[O,k]=(0,K.useState)({}),[A,ne]=(0,K.useState)(!1),[M,re]=(0,K.useState)(null),[N,P]=(0,K.useState)(null),[ce,le]=(0,K.useState)(!1),[ue,de]=(0,K.useState)(!1),[fe,F]=(0,K.useState)(!1),[I,pe]=(0,K.useState)(0),[me,he]=(0,K.useState)(0),{start:ge,ready:_e,assistantId:L,error:ve,awaitReady:R}=Yt(),z=bn(),{start:ye,hydrate:be}=z,B=(0,K.useRef)(Promise.resolve()),V=(0,K.useRef)(Promise.resolve()),[xe,Se]=(0,K.useState)(!1),Ce=z.status===`idle`||z.status===`running`,we=!Ce&&z.claims.length===0;(0,K.useEffect)(()=>{i(),s(null),l&&d&&ge()},[i,s,ge,l,d]),(0,K.useLayoutEffect)(()=>{if(v||!n)return;let e=Nn(n);e?.formValues&&(E(e.formValues),ee(e.faceValues),P(e.checkinTime),de(e.checkinBooked),re(e.researchConversationId??null),e.research&&be({...e.research,pluginCatalog:e.research.pluginCatalog??{}},R),p(In(e)),_([])),y(!0)},[v,n,be,R]),(0,K.useEffect)(()=>{!v||!T||Pn(n,{step:f,formValues:T,faceValues:D,checkinTime:N,checkinBooked:ue,research:z.status===`done`?{status:`done`,claims:z.claims,suggestions:z.suggestions,installedPlugins:z.installedPlugins,pluginCatalog:z.pluginCatalog}:null,...M?{researchConversationId:M}:{}})},[v,n,f,T,D,N,ue,M,z.status,z.claims,z.suggestions,z.installedPlugins,z.pluginCatalog]),(0,K.useEffect)(()=>{!v||!l||!d||!T||z.status!==`idle`||ye({awaitAssistantId:R,subject:vo(T),conversationTitle:yo(T),...M?{resumeConversationId:M}:{},onConversationCreated:re,includeSuggestions:!u})},[v,l,d,T,M,z.status,ye,R,u]),(0,K.useEffect)(()=>{f===`results`&&we&&(_([]),p(`suggestions`))},[f,we]);function Te(t,i,a,{skip:o=!1,hidden:l=!1}={}){Fn(n);let{firstName:u,lastName:d,role:f,hobbies:p}=t,m=[u.trim(),d.trim()].filter(Boolean).join(` `),h=u.trim(),g=!o&&a===void 0;se({tools:[],tasks:[],tone:Xe,...m?{userName:m}:{},...f.trim()?{occupation:f.trim()}:{},...o?{}:{initialMessage:a??Ut({firstName:u,lastName:d,occupation:f,hobby:p.join(`, `)}),...l?{initialMessageHidden:!0}:{}},...g?{title:h?`Getting to know ${h}`:`Getting to know you`}:{},...i?.name?.trim()?{assistantName:i.name.trim()}:{}});let _=i?.name?.trim();_&&oe(_),s(i?.traits??null),g&&r(),o||te.markExpectingFirstMessage(),c(),te.checkAssistant(L??void 0).finally(()=>{e(`${ie.assistant}?onboarding=1`,{replace:!0})})}async function Ee(){T&&(await Promise.all([z.awaitPluginInstalls(),B.current,V.current]),Te(T,D,_o,{hidden:!0}))}function De(e){E(e),z.start({awaitAssistantId:R,subject:vo(e),conversationTitle:yo(e),onConversationCreated:re,includeSuggestions:!u}),x(`face`)}function Oe(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){F(!0);return}if(F(!1),L&&T){let e=[T.firstName.trim(),T.lastName.trim()].filter(Boolean).join(` `);P(null),de(!1),le(!0),ze({assistantId:L,userName:e||void 0,assistantName:D?.name?.trim()||void 0}).then(e=>{e.scheduled&&(de(!0),P(Ln(e.start,e.timeZone)))}).finally(()=>le(!1))}x(`meeting`)}if(!l)return d?(0,q.jsx)(o,{to:ie.assistant,replace:!0}):null;if([`different`,`personality`,`integration`,`letschat`,`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(f)&&T){let e=[`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(f);return(0,q.jsx)(`div`,{ref:m,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,q.jsxs)(Hn,{size:h,children:[(0,q.jsx)(go,{eyesBumpNonce:I,peekLevel:[`looking`,`results`,`suggestions`,`finishing`].includes(f)?me:0,darkBg:e,showBottomEyes:!e&&f!==`different`}),f===`different`&&(0,q.jsx)(oi,{onContinue:()=>x(u?`personality`:`integration`),onBack:()=>S(`intro`),onForward:w}),f===`personality`&&(0,q.jsx)(Ra,{values:O,onValueChange:(e,t)=>k(n=>({...n,[e]:t})),locked:A,onContinue:()=>{A||(Se(!0),V.current=jn({awaitAssistantId:R,values:O,userName:T?.firstName?.trim()||void 0}).finally(()=>Se(!1)),ne(!0)),x(`integration`)},onBack:()=>S(`different`),onForward:w}),f===`integration`&&(0,q.jsx)(di,{onClaim:()=>x(`letschat`),onBumpEyes:()=>pe(e=>e+1),onBack:()=>S(u?`personality`:`different`),onForward:w}),f===`letschat`&&(0,q.jsx)(za,{assistantId:L,assistantReady:_e,hatchError:ve,onConnected:Oe,missingCalendarScope:fe,onRetry:()=>F(!1),onSkip:()=>{F(!1),x(`looking`,`skipped`)},onBack:()=>S(`integration`),onForward:w}),f===`meeting`&&(0,q.jsx)(qa,{scheduledTime:N??void 0,awaitingTime:ce,onDone:()=>x(`looking`),onBack:()=>S(`letschat`),onForward:w}),f===`looking`&&(0,q.jsx)(eo,{onDone:()=>x(we?`suggestions`:`results`),onBack:()=>S(`letschat`),onAdvance:e=>he(Math.min(e+1,4)),onForward:w,ready:!Ce}),f===`results`&&(0,q.jsx)(no,{claims:z.claims,loading:Ce,onContinue:e=>{M&&L&&e.length>0&&(B.current=Sn({assistantId:L,conversationId:M,removedClaims:e,rejectedAll:!1})),x(`suggestions`)},onRejectAll:()=>{M&&L&&(B.current=Sn({assistantId:L,conversationId:M,removedClaims:z.claims.map(e=>e.claim),rejectedAll:!0})),x(`suggestions`,`skipped`)},onBack:()=>S(`looking`),onForward:w}),f===`suggestions`&&u&&(0,q.jsx)(uo,{installedPlugins:z.installedPlugins,pluginCatalog:z.pluginCatalog,onStart:async()=>{if(Ke(qe.suggestions,{userId:n,outcome:`completed`}),xe){_([]),p(`finishing`);return}await Ee()},onBack:()=>S(we?`looking`:`results`),onForward:w}),f===`suggestions`&&!u&&(0,q.jsx)(lo,{suggestions:z.suggestions,loading:Ce,installedPlugins:z.installedPlugins,onSuggestionClick:async e=>{Ke(qe.suggestions,{userId:n,outcome:`completed`}),await Promise.all([z.awaitPluginInstalls(),B.current]),Te(T,D,e.prompt)},onSkip:async()=>{Ke(qe.suggestions,{userId:n,outcome:`skipped`}),await Promise.all([z.awaitPluginInstalls(),B.current]),Te(T,D,void 0,{skip:!0})},onBack:()=>S(we?`looking`:`results`),onForward:w}),f===`finishing`&&(0,q.jsx)(to,{ready:!xe,onDone:()=>void Ee()})]})})}return f===`intro`&&T?(0,q.jsx)(Vr,{firstName:T.firstName,assistantName:D?.name,onContinue:()=>x(`different`),onBack:()=>S(`face`),onForward:w}):f===`face`&&T?(0,q.jsx)(Er,{onContinue:e=>{ee(e),x(`intro`)},onBack:()=>S(`form`),onForward:w}):(0,q.jsx)(_r,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:De})}export{bo as ResearchOnboardingRoute};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./confirm-dialog-bfBx6UYv.js";import{t as s}from"./modal-BNAVT2FK.js";import{A as c,N as l,O as u,st as d,t as f,tt as p,u as ee}from"./local-mode-CgrENuVf.js";import{t as m}from"./is-electron-C_ZTVhv8.js";import{n as h}from"./resolved-assistants-store-Dqf0LJrA.js";import{t as g}from"./check-D6WkI0gF.js";import{D as _,O as v,i as y,n as b}from"./auth-store-DGyzz5Ha.js";import{a as x}from"./routes-C6gxiCrz.js";import{t as S}from"./use-onboarding-login-NYeSGUNo.js";import{Dn as C,On as te,Yi as w,pa as T,rn as E}from"./index-CQhaX_6y.js";import{r as D}from"./format-date-D4tzd1DT.js";var O=e(t(),1),k=a();function A({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:c,onRetire:l}){let[u,d]=(0,O.useState)(`menu`);(0,O.useEffect)(()=>{e&&d(`menu`)},[e]);let f=i?(0,k.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,k.jsx)(o,{open:e,title:`Repair Assistant?`,message:(0,k.jsxs)(k.Fragment,{children:[`Repairing re-provisions this assistant’s authentication token. Any other devices or browser sessions connected to it will be signed out and need to reconnect.`,f]}),confirmLabel:`Repair`,isPending:r,onConfirm:c,onCancel:()=>d(`menu`)}):u===`confirm-retire`?(0,k.jsx)(C,{open:e,isPending:r,extraMessage:f,onConfirm:l,onCancel:()=>d(`menu`)}):(0,k.jsx)(s.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,k.jsxs)(s.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,k.jsx)(s.Header,{children:(0,k.jsx)(s.Title,{children:`Can’t Authenticate Assistant`})}),(0,k.jsxs)(s.Body,{children:[(0,k.jsxs)(s.Description,{children:[`The authentication token for `,t,` is missing or can no longer be refreshed, so this assistant can’t be connected. You can repair it, retire it, or pick a different assistant.`]}),f,(0,k.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,k.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-repair`),children:`Wake & Repair`}),(0,k.jsx)(n,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-retire`),children:`Retire Assistant`}),(0,k.jsx)(n,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:`Cancel`})]})]})]})})}function j(e){return e.name?e.name:e.isLocal?`Local Assistant`:`Cloud Assistant`}function M(e){if(e.hatchedAt)return`Created ${D(e.hatchedAt)}`}function N(){let e=r(),[t]=i(),a=t.get(`fromLogin`)===`1`,o=t.get(`noAutoSkip`)===`1`,s=m(),g=y(),C=h.use.assistants(),w=_.use.currentOrganizationId(),{loading:T,error:D,login:M,cancel:N}=S(),F=e=>e.isLocal||g,I=C.filter(F),L=C.some(e=>e.isPlatformHosted)&&!g,[R,z]=(0,O.useState)(null),[B,V]=(0,O.useState)(!1),[H,U]=(0,O.useState)(!1),[W,G]=(0,O.useState)(null),[K,q]=(0,O.useState)(null),[J,Y]=(0,O.useState)(!1),[ne,X]=(0,O.useState)(null);(0,O.useEffect)(()=>{if(R!=null||I.length===0)return;let e=v(w);z(I.find(t=>t.id===e)?.id??I[0].id)},[R,I,w]);let Z=async t=>{V(!0),G(null);try{t.isLocal?await b.getState().connectLocalAssistant(t.id):await b.getState().connectPlatformAssistant(t.id),e(x.assistant,{replace:!0})}catch(e){console.error(`selectAssistant.handleConnect failed`,e),t.isLocal&&u()&&(c(e)||d(e)||e instanceof f)&&ee(t.id)?q(t):G(`Failed to connect. Please try again.`),V(!1)}},Q=()=>{q(null),Y(!1),X(null),U(!1)},re=async()=>{if(!(!K||J)){Y(!0),X(null);try{let e=await l(K.id,{repairGuardian:!0});if(e.ok){p(),Q(),Z(K);return}X(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),X(`Repair failed. Please try again.`)}Y(!1)}},ie=async()=>{if(!(!K||J)){Y(!0),X(null);try{let t=await te(K.id);if(t.ok){Q(),e(t.nextRoute,{replace:!0});return}X(t.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),X(`Failed to retire assistant. Please try again.`)}Y(!1)}};(0,O.useEffect)(()=>{a||o||B||H||C.length!==0&&C.length===1&&I.length===1&&(U(!0),Z(I[0]))},[C.length,I.length]);let ae=()=>{let e=C.find(e=>e.id===R);e&&Z(e)},oe=()=>{e(x.welcome)},$=D??W;return H&&!$&&!K?(0,k.jsx)(E,{children:(0,k.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Connecting to your assistant…`})})}):(0,k.jsxs)(E,{children:[(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${s?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,k.jsx)(`h1`,{className:s?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Choose an Assistant`}),(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${s?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Select which assistant you’d like to use.`}),$&&(0,k.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:$}),(0,k.jsx)(`div`,{className:`flex w-full flex-col ${s?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:C.map(e=>{let t=F(e);return(0,k.jsx)(P,{assistant:e,selected:R===e.id,disabled:!t,badge:!t&&e.isPlatformHosted?`Requires Account`:void 0,onSelect:()=>{t&&z(e.id)}},e.id)})}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${s?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[I.length>0&&(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:ae,disabled:!R||B,children:B?`Connecting…`:`Continue`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:()=>void e(`${x.onboarding.hosting}?from=select-assistant`),disabled:B||T,children:`Create New Assistant`}),L&&(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:T?N:()=>void M(),disabled:B,children:T?`Cancel`:`Log In`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:oe,disabled:B||T,children:`Back`})]})]}),(0,k.jsx)(A,{open:K!=null,assistantName:K?j(K):``,isPending:J,errorMessage:ne??void 0,onCancel:Q,onRepair:()=>void re(),onRetire:()=>void ie()})]})}function P({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=M(e),o=m();return(0,k.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:[`group flex w-full items-center border text-left`,o?`gap-3 rounded-lg p-3`:`gap-4 rounded-2xl px-5 py-4`,`transition-all duration-200 ease-out`,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-[var(--surface-secondary)]`,t&&!n?`border-[var(--primary-base)] bg-[var(--primary-base)]/[0.08] shadow-[inset_0_0_0_1px_var(--primary-base)]`:`border-[var(--border-element)] bg-transparent`].join(` `),children:[(0,k.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,o?`h-8 w-8 rounded-lg`:`h-10 w-10 rounded-xl`,t&&!n?`bg-[var(--primary-base)]/15 text-[var(--primary-base)]`:`bg-[var(--surface-tertiary)] text-[var(--content-secondary)]`].join(` `),children:e.isLocal?(0,k.jsx)(w,{className:`h-5 w-5`}):(0,k.jsx)(T,{className:`h-5 w-5`})}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:j(e)}),r&&(0,k.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:r})]}),a&&(0,k.jsx)(`span`,{className:`mt-0.5 block text-[var(--content-tertiary)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:a})]}),!n&&(0,k.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:t&&(0,k.jsx)(g,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})}export{N as SelectAssistantScreen};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,t as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./react-DJZBPgpf.js";import{O as i,t as a}from"./button-D-AX8Voo.js";import{h 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"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./card-BibIM9x3.js";import{n as f,t as p}from"./panel-item-Q1g7DFJw.js";import{t as m}from"./menu-BLJEjTFD.js";import"./src-CUycEQpW.js";import{t as h}from"./confirm-dialog-bfBx6UYv.js";import{t as g}from"./popover-BUj2v1xo.js";import{t as _}from"./input-D4W4p0pZ.js";import{n as v}from"./stat-square-8mff1dLC.js";import{t as y}from"./arrow-left-CP-EhDNF.js";import{a as b,c as x,i as S,n as C,o as w,r as T,s as E,t as D}from"./install-BrkjCsCo.js";import{t as O}from"./brain-Bs6LnfHO.js";import{t as k}from"./check-D6WkI0gF.js";import{t as A}from"./cloud-off-rAv4OHmv.js";import{t as j}from"./code-aMX9iMYa.js";import{t as M}from"./file-text-ClqzuFsu.js";import{i as ee,n as te,r as N,t as ne}from"./use-skill-categories-D2tZfqBc.js";import{t as P}from"./globe-D3P5sSKJ.js";import{t as F}from"./loader-circle-BFRVtR3K.js";import{t as I}from"./sparkles-Bla177ar.js";import{t as L}from"./triangle-alert-C3aHZq1F.js";import{t as R}from"./x-DxL-bCuT.js";import{Yt as re,gt as z,ht as B,vt as V,yt as ie}from"./react-query.gen-BwkZCSTW.js";import{n as ae}from"./use-is-mobile-jACt_z2d.js";import{Ea as H,Fi as U,Ji as W,L as G,Oa as K,Pa as q,R as J,Si as oe,ci as se,di as ce,na as le,ni as ue,oa as de,ui as Y}from"./index-CQhaX_6y.js";import{t as fe}from"./use-active-assistant-id-BVzVN4_g.js";var pe=e(i(),1),X=e(r(),1);function me(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function he(e,t){let[n,r]=(0,X.useState)(null),i=c({...z({path:{assistant_id:e,id:t}}),select:e=>e??null}),a=(0,X.useMemo)(()=>i.data?.files??[],[i.data]),o=(0,X.useMemo)(()=>a.find(e=>e.name===`SKILL.md`),[a]),s=me(a,n),l=c({...B({path:{assistant_id:e,id:t},query:{path:s??``}}),select:e=>e??null,enabled:!!s});return{fileEntries:a,skillMd:o,selectedPath:n,setSelectedPath:r,activePath:s,activeFile:a.find(e=>e.path===s),isFilesLoading:i.isLoading,fileContent:l.data?.content??null,isBinary:!!l.data?.isBinary,isContentLoading:l.isLoading}}var Z=u();function ge({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`}):t===null?(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,e,`.`]}):J(e,void 0)&&r===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(G,{content:t})}):(0,Z.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function _e({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:i,isInstalling:o=!1,isRemoving:s=!1}){let c=T(t),l=b(t),{fileEntries:u,setSelectedPath:f,activePath:p,activeFile:m,isFilesLoading:h,fileContent:g,isBinary:_,isContentLoading:x}=he(e,t.id),[S,C]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{C(`preview`)},[p]);let[D,O]=(0,X.useState)(null);(0,X.useEffect)(()=>{O(document.getElementById(`viewport-overlays`))},[]);let k=m?J(m.name,void 0):!1,A=k?S:`raw`,M=(0,Z.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(y,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:t.name}),(0,Z.jsx)(ve,{available:c,removable:l,isInstalling:o,isRemoving:s,onInstall:r,onRemove:i})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(E,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(w,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description})]}),(0,Z.jsx)(d.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(be,{fileEntries:u,activePath:p,activeName:m?.name??null,onSelect:f}),(0,Z.jsx)(v,{iconOnly:!0,ariaLabel:`File view mode`,value:A,onChange:C,items:[{value:`preview`,label:`Preview`,icon:(0,Z.jsx)(de,{"aria-hidden":!0}),disabled:!k},{value:`raw`,label:`Source`,icon:(0,Z.jsx)(j,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:h||x?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(F,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):m?(0,Z.jsx)(ge,{fileName:m.name,content:g,isBinary:_,viewMode:A}):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]});return D?(0,pe.createPortal)(M,D):M}function ve({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:i,onRemove:o}){return n||r?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(F,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(q,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:i,disabled:!i,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(Y,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Remove skill`,onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(Y,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:`Bundled skills cannot be removed`,"aria-label":`Bundled skill cannot be removed`,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function ye(e){return(e??``).endsWith(`/directory`)}function be({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)(xe,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i})]}):(0,Z.jsxs)(m.Root,{children:[(0,Z.jsx)(m.Trigger,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)(xe,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i}),(0,Z.jsx)(K,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(m.Content,{align:`start`,children:e.map(e=>{let n=ye(e.mimeType);return(0,Z.jsx)(m.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Z.jsx)(le,{}):(0,Z.jsx)(M,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function xe(){return(0,Z.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Z.jsx)(M,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}var Se=[{value:`all`,label:`All`,icon:W},{value:`installed`,label:`Installed`,icon:H},{value:`available`,label:`Available`,icon:q}],Ce=[{value:`vellum`,label:`Vellum`,icon:x},{value:`clawhub`,label:`Clawhub`,icon:P},{value:`skillssh`,label:`skills.sh`,icon:ce},{value:`custom`,label:`Custom`,icon:se},{value:`assistant-memory`,label:`Assistant's Memory`,icon:O}];function we({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u}){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(_,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search skills`,"aria-label":`Search skills`,leftIcon:(0,Z.jsx)(oe,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,Z.jsx)(F,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,Z.jsx)(Te,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u})]})}function Te(e){let t=ae(),[n,r]=(0,X.useState)(!1),i=(0,Z.jsx)(a,{type:`button`,variant:`outlined`,iconOnly:(0,Z.jsx)(ee,{"aria-hidden":!0}),"aria-label":`Filter skills`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,Z.jsx)(Ee,{...e,open:n,onOpenChange:r,trigger:i}):(0,Z.jsxs)(g.Root,{open:n,onOpenChange:r,children:[(0,Z.jsx)(g.Trigger,{asChild:!0,children:i}),(0,Z.jsx)(g.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,Z.jsxs)(`ul`,{role:`listbox`,children:[(0,Z.jsx)(De,{label:`Status`,options:Se,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}}),(0,Z.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,Z.jsx)(De,{label:`Source`,options:Ce,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}})]})})]})}function Ee({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:i,counts:o,totalCount:s,showCounts:c,open:l,onOpenChange:u,trigger:d}){let p=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,Z.jsxs)(f.Root,{open:l,onOpenChange:u,children:[(0,Z.jsx)(f.Trigger,{asChild:!0,children:d}),(0,Z.jsxs)(f.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,Z.jsx)(f.Header,{children:(0,Z.jsx)(f.Title,{children:`Filters`})}),(0,Z.jsxs)(f.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,Z.jsx)(Q,{label:`Status`,children:Se.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsx)(Q,{label:`Source`,children:Ce.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsxs)(Q,{label:`Categories`,children:[(0,Z.jsx)($,{icon:W,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>i(null)}),p.map(e=>(0,Z.jsx)($,{icon:N(e.icon)??W,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>i(e.slug)},e.slug))]})]}),(0,Z.jsx)(f.Footer,{children:(0,Z.jsx)(a,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>u(!1),children:`Done`})})]})]})}function Q({label:e,children:t}){return(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function $({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,Z.jsx)(p,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,Z.jsx)(k,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function De({label:e,options:t,selected:n,onSelect:r}){return(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,Z.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,Z.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,Z.jsx)(H,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}function Oe({skill:e,onSelect:t,onInstall:n,onRemove:r,isInstalling:i=!1,isRemoving:o=!1}){let s=T(e),c=b(e);return(0,Z.jsx)(d.Root,{asChild:!0,children:(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,Z.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,Z.jsx)(E,{skill:e,className:`h-7 w-7`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,Z.jsx)(w,{origin:e.origin})]}),(0,Z.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),s?i?(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(F,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(q,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),n?.()},disabled:!n,"aria-label":`Install skill`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,variant:`dangerOutline`,iconOnly:o?(0,Z.jsx)(F,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(Y,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!c||o||!r,"aria-label":c?`Remove skill`:`Bundled skill cannot be removed`,title:c?void 0:`Bundled skills cannot be removed`,expandOnMobile:!1})]})})}function ke(e){switch(e){case`installed`:return{kind:`installed`};case`available`:return{kind:`available`};case`vellum`:case`clawhub`:case`skillssh`:case`custom`:case`assistant-memory`:return{origin:e};default:return{}}}function Ae(e){return[...e].sort((e,t)=>{let n=S(e);return n===S(t)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function je(e,t){let[n,r]=(0,X.useState)(e);return(0,X.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>clearTimeout(n)},[e,t]),n}var Me=300,Ne=`vellum:skills:tipDismissed`;function Pe({assistantId:e,initialSkillId:r}){let i=s(),a=ae(),[o,u]=(0,X.useState)(``),d=je(o.trim(),Me),[f,p]=(0,X.useState)(`all`),[m,g]=(0,X.useState)(null),[_,v]=(0,X.useState)(r??null),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(null),[w,T]=(0,X.useState)(null),[E,O]=(0,X.useState)(()=>n(Ne,!1)),{data:k=[]}=ne(e),{origin:A,kind:j}=(0,X.useMemo)(()=>ke(f),[f]),M=c({...V({path:{assistant_id:e},query:{include:`catalog`,origin:A,kind:j,q:d||void 0,category:m??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e}),ee=c({...V({path:{assistant_id:e},query:{include:`catalog`,origin:A,kind:j,q:d||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&m!==null}),N=(0,X.useCallback)(()=>{i.invalidateQueries({queryKey:ie({path:{assistant_id:e}})})},[e,i]),P=l({mutationFn:t=>D(e,t),onMutate:e=>b(e),onSettled:()=>{b(null),N()}}),F=re({onMutate:e=>S(e.path.id),onSettled:()=>{S(null),N()}}),I=(0,X.useCallback)(e=>{P.mutate(e.slug??e.id)},[P]),L=(0,X.useCallback)(e=>{T(e)},[]),R=(0,X.useCallback)(()=>{w&&(F.mutate({path:{assistant_id:e,id:w.id}}),T(null))},[e,w,F]),z=(0,X.useCallback)(()=>{O(!0),t(Ne,!0)},[]),B=(0,X.useMemo)(()=>M.data?.skills??[],[M.data?.skills]),H=m===null?M.data:ee.data,{counts:U,totalCount:W}=Fe(H?.skills??B,H?.categoryCounts,H?.totalCount),G=(0,X.useMemo)(()=>Ae(B),[B]),K=(0,X.useMemo)(()=>_?B.find(e=>e.id===_)??null:null,[B,_]),q=(0,Z.jsx)(h,{open:w!==null,title:`Remove skill`,message:w?`Remove "${w.name}" from this assistant?`:``,confirmLabel:`Remove`,destructive:!0,onConfirm:R,onCancel:()=>T(null)});if(K){let t={assistantId:e,skill:K,onBack:()=>v(null),onInstall:()=>I(K),onRemove:()=>L(K),isInstalling:y===(K.slug??K.id),isRemoving:x===K.id};return(0,Z.jsxs)(Z.Fragment,{children:[a?(0,Z.jsx)(_e,{...t}):(0,Z.jsx)(C,{...t}),q]})}let J=M.isFetching&&!!d;return(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!E&&(0,Z.jsx)(Ie,{onDismiss:z}),(0,Z.jsx)(we,{search:o,onSearchChange:u,filter:f,onFilterChange:p,isSearching:J,categories:k,category:m,onCategoryChange:g,counts:U,totalCount:W,showCounts:!J}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,Z.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto sm:block`,children:(0,Z.jsx)(te,{selected:m,onSelect:g,counts:U,totalCount:W,showCounts:!J,categories:k})}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:M.isLoading?(0,Z.jsx)(Le,{}):M.isError?(0,Z.jsx)(Re,{}):G.length===0?(0,Z.jsx)(ze,{filter:f,category:m}):(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2`,children:G.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(Oe,{skill:e,onSelect:()=>v(e.id),onInstall:()=>I(e),onRemove:()=>L(e),isInstalling:y===(e.slug??e.id),isRemoving:x===e.id})},e.id))})})]}),q]})}function Fe(e,t,n){return(0,X.useMemo)(()=>{if(t&&Object.keys(t).length>0)return{counts:t,totalCount:n??e.length};let r={};for(let t of e){let e=t.category??`system`;r[e]=(r[e]??0)+1}return{counts:r,totalCount:n??e.length}},[e,t,n])}function Ie({onDismiss:e}){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,Z.jsx)(I,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,Z.jsx)(`p`,{className:`flex-1`,children:`You can create a new custom skill by describing what you want in chat.`}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(R,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Le(){return(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Z.jsx)(F,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Re(){return(0,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(L,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load skills`}),(0,Z.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 ze({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=Be(e,t);return(0,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r})]})})}function Be(e,t){if(t)return{title:`No skills in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:W};switch(e){case`installed`:return{title:`No Skills Installed`,subtitle:`Ask your assistant in chat to search for and install new skills.`,Icon:ue};case`available`:return{title:`No Skills Available`,subtitle:`All available skills have been installed.`,Icon:H};case`vellum`:return{title:`No Vellum Skills`,subtitle:`No bundled Vellum skills found.`,Icon:U};case`clawhub`:return{title:`No Clawhub Skills`,subtitle:`No Clawhub skills found. Try searching the catalog.`,Icon:P};case`skillssh`:return{title:`No skills.sh Skills`,subtitle:`No skills.sh skills found. Try searching the catalog.`,Icon:ce};case`custom`:return{title:`No Custom Skills`,subtitle:`Create a custom skill by describing what you want in chat.`,Icon:se};default:return{title:`No Skills Available`,subtitle:`Check your connection to the Vellum catalog.`,Icon:A}}}function Ve(){let e=fe(),[t]=o();return(0,Z.jsx)(Pe,{assistantId:e,initialSkillId:t.get(`skill`)??void 0})}export{Ve as SkillsPage};
@@ -1,4 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-BscuIPxA.js";import"./src-CUycEQpW.js";import{t as a}from"./arrow-left-CP-EhDNF.js";import{n as o,r as s,t as c}from"./metric-card-FIohvQ13.js";import{gt as l,h as u}from"./detail-shell-DAQXFf5u.js";import{t as d}from"./brain-Bs6LnfHO.js";import{t as f}from"./chevron-right-B6vEpVY0.js";import{t as p}from"./globe-D3P5sSKJ.js";import{t as m}from"./x-DxL-bCuT.js";import{t as h}from"./misc-CFzLzLPH.js";import{a as g,i as _,r as v}from"./subagent-store-CN-NNj3H.js";import{t as y}from"./proxy-BgtfAoJj.js";import{t as b}from"./AnimatePresence-uY0BR2n2.js";import{t as x}from"./use-reduced-motion-BG6r0Z46.js";import{$ as S,A as C,C as w,D as T,E,M as D,N as O,O as k,Oa as A,P as j,Pa as M,Q as N,S as P,T as F,Z as I,at as L,dt as R,et as z,ft as B,it as V,j as H,k as U,nt as ee,tt as W,w as G}from"./index-CQhaX_6y.js";import{t as te}from"./status-badge-pill-j3ke1d9o.js";import{t as ne}from"./detail-panel-stop-button-CcFyjiHA.js";import{CodeBlock as K,ToolDetailBody as q}from"./tool-detail-panel-CS3NNWPR.js";var J=e(t(),1),Y=r();function X({status:e}){return(0,Y.jsx)(te,{color:_(e),label:g(e)})}function re(e,t){let n=e.steps[0];return`${t}-${e.label}-${n?D(n,t):``}`}function ie(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`tool`&&n.status===`running`||n.kind===`web_search`&&n.title===`Searching the web`)return n}}function ae(e,t){return e&&e.kind===`tool`&&(e.activity||e.info)||t}function oe(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`web_search`&&n.query)return n.query}}function se(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`thinking`&&n.text)return n.text}}function Z(e){if(e.kind===`tool`)return e.toolCallId||void 0;if(e.kind===`thinking`||e.kind===`web_search`||e.kind===`web_search_error`)return e.detailKey}function ce({steps:e,onStepDetailClick:t,expandedKeys:n,onExpandedKeysChange:r,isRunning:i=!1}){let[a,o]=(0,J.useState)(new Set),s=n??a,c=(0,J.useCallback)(e=>{let t=t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n};if(r){r(t);return}o(t)},[r]),l=(0,J.useMemo)(()=>C(e),[e]);return l.length===0?null:(0,Y.jsx)(`div`,{className:`flex w-full flex-col`,children:l.map((e,n)=>{let r=re(e,n),a=n===l.length-1;return(0,Y.jsx)(le,{section:e,isLast:a,isActiveTail:a&&i,expanded:s.has(r),sectionKeyValue:r,onToggle:c,onStepDetailClick:t},r)})})}var le=(0,J.memo)(function({section:e,isLast:t,isActiveTail:n,expanded:r,sectionKeyValue:a,onToggle:o,onStepDetailClick:s}){let c=x(),l=H(e.steps),u=l===`running`&&!n?`completed`:l,f=u===`running`||n,m=e.steps[0]?.kind===`thinking`,g=e.steps.length,_=e.label===`Searching the web`,v=_?oe(e):void 0,S=g>=2,C=e.steps.some(e=>O(e)||!!s&&!!Z(e)),T=u===`running`?``:j(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),A=u===`running`?ie(e):void 0,M=u===`running`&&!_?ae(A,e.label):``,N=_&&(u===`running`||!!v),P=v??e.label,I=m&&f,L=I?se(e)??e.label:void 0,R=u===`running`||N||I||!!T,z=`${g} step${g===1?``:`s`}`;return(0,Y.jsxs)(`div`,{"data-testid":`subagent-phase-section`,"data-phase-label":e.label,className:h(`relative flex flex-col gap-2`,!t&&`pb-4`),children:[!t&&(0,Y.jsx)(k,{className:`top-[17.5px] -bottom-[4.5px]`}),(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`subagent-phase-header`,disabled:!C,onClick:C?()=>o(a):void 0,className:h(`flex h-[22px] w-full items-center gap-2 text-left`,C&&`cursor-pointer`),children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,Y.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}),(0,Y.jsx)(U,{status:f?`running`:u,isThinking:m&&!f}),(0,Y.jsx)(i,{variant:`body-medium-default`,className:`shrink-0 text-[var(--content-default)]`,children:e.label}),R&&(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 leading-none text-[var(--content-tertiary)] opacity-10`,children:`|`}),N?(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Y.jsx)(p,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Y.jsx)(B,{currentStepTitle:``,currentStepInfo:P})]}):I?(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Y.jsx)(d,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Y.jsx)(B,{currentStepTitle:``,currentStepInfo:L??e.label})]}):u===`running`?(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Y.jsx)(d,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Y.jsx)(B,{currentStepTitle:``,currentStepInfo:M})]}):T?(0,Y.jsx)(i,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:`Worked for ${T}`}):null,C&&S&&(0,Y.jsx)(`span`,{"data-testid":`subagent-phase-step-count`,className:`ml-auto inline-flex shrink-0 items-center self-stretch whitespace-nowrap rounded-full bg-[var(--surface-base)] px-2`,children:(0,Y.jsx)(i,{variant:`body-small-default`,className:`whitespace-nowrap text-[var(--content-secondary)]`,children:z})})]}),(0,Y.jsx)(b,{initial:!1,children:C&&r&&(0,Y.jsx)(y.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:c?{duration:0}:{duration:.25,ease:[.16,1,.3,1]},className:`overflow-hidden`,children:(0,Y.jsx)(`div`,{className:`flex flex-col items-start gap-1 pl-[22px]`,children:e.steps.map((e,t)=>{let n=s?Z(e):void 0;if(n&&s){if(e.kind===`tool`)return(0,Y.jsx)(F,{variant:`tool`,iconName:e.iconName,label:e.activity||e.info||e.title,riskLevel:e.riskLevel,tone:e.status===`error`||e.status===`denied`?`error`:`default`,ariaLabel:`View tool details`,onClick:()=>s(n)},D(e,t));if(e.kind===`thinking`)return(0,Y.jsx)(F,{variant:`tool`,iconName:`brain`,label:e.text,ariaLabel:`View reasoning`,onClick:()=>s(n)},D(e,t));if(e.kind===`web_search`)return(0,Y.jsx)(F,{variant:`tool`,iconName:`globe`,label:e.query||e.title,ariaLabel:`View search details`,onClick:()=>s(n)},D(e,t));if(e.kind===`web_search_error`)return(0,Y.jsx)(F,{variant:`tool`,iconName:`globe`,label:e.errorMessage,tone:`error`,ariaLabel:`View search error`,onClick:()=>s(n)},D(e,t))}return e.kind===`web_search`?(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[e.query?(0,Y.jsx)(i,{variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:`"${e.query}"`}):null,(0,Y.jsx)(G,{step:e})]},D(e,t)):e.kind===`web_search_error`?(0,Y.jsx)(w,{step:e},D(e,t)):(0,Y.jsx)(E,{step:e},D(e,t))})})},`phase-steps`)})]})}),ue=`
2
- Content:
3
- `;function de(e){return S(e)||e}function fe(e,t){let n=e??``,r=n.indexOf(ue),i=r>=0?n.slice(0,r):``,a=r>=0?n.slice(r+10):n,o=e=>{let t=i.match(RegExp(`^${e}:[ \\t]*(.+)$`,`m`));return t?t[1].trim():null},s=[],c=i.indexOf(`Notices:`);if(c>=0)for(let e of i.slice(c).split(`
4
- `)){let t=e.match(/^\s*-\s+(.*)$/);t&&t[1].trim()&&s.push(t[1].trim())}a=a.trim();let l=null,u=a.match(/^<external_content\b([^>]*)>\s*/);if(u){let e=u[1].match(/origin="([^"]+)"/);e&&(l=e[1]),a=a.slice(u[0].length).replace(/\s*<\/external_content>\s*$/,``)}return{url:o(`Final URL`)||o(`Requested URL`)||l||t||null,status:o(`Status`),notices:s,content:a.trim()}}function pe({url:e,status:t}){let n=de(e),r=t?/^\s*2\d\d/.test(t):!1;return(0,Y.jsxs)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3 transition-colors hover:border-[var(--border-hover)]`,children:[(0,Y.jsx)(P,{domain:n,title:n}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Y.jsx)(i,{variant:`body-medium-default`,as:`span`,className:`truncate text-[var(--content-default)]`,children:n}),(0,Y.jsx)(i,{variant:`body-small-default`,as:`span`,className:`truncate text-[var(--content-tertiary)]`,children:e})]}),t&&(0,Y.jsx)(`span`,{className:`shrink-0 rounded-[6px] px-2 py-0.5 text-body-small-emphasised ${r?`text-[var(--system-positive-strong)]`:`text-[var(--content-tertiary)]`}`,children:t})]})}function me({detail:e}){let[t,n]=(0,J.useState)(!1),r=typeof e.input?.url==`string`?e.input.url:void 0,a=(0,J.useMemo)(()=>fe(e.result??``,r),[e.result,r]);return e.status===`error`?(0,Y.jsx)(K,{text:e.result??`Fetch failed.`}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[a.url&&(0,Y.jsx)(pe,{url:a.url,status:a.status}),a.notices.length>0&&(0,Y.jsx)(`div`,{className:`flex flex-col gap-1 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:a.notices.map((e,t)=>(0,Y.jsx)(i,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:e},t))}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`text-[var(--content-emphasised)]`,children:t?`Raw result`:`Content`}),e.result&&(0,Y.jsx)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`cursor-pointer text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:(0,Y.jsx)(i,{variant:`label-small-default`,as:`span`,children:t?`View extracted`:`View raw`})})]}),t?(0,Y.jsx)(K,{text:e.result??``}):a.content?(0,Y.jsx)(I,{content:a.content}):(0,Y.jsx)(i,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:e.status===`running`?`Fetching…`:`No content extracted.`})]})]})}function Q({detail:e}){let t=e.searchQuery??``,n=e.searchResults??[];return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[t?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`text-[var(--content-emphasised)]`,children:`Query`}),(0,Y.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`break-words leading-relaxed text-[var(--content-default)]`,children:`"${t}"`})]}):null,(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`text-[var(--content-emphasised)]`,children:n.length>0?`Sources (${n.length})`:`Sources`}),n.length>0?(0,Y.jsx)(G,{step:{kind:`web_search`,title:`Searched the web`,durationLabel:``,linkCount:n.length,results:n}}):(0,Y.jsx)(i,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:`No sources found.`})]})]})}function $(e){return new Map(e.map(e=>[e.toolCallId,e]))}function he(e=N){let t=null,n=[],r=[],i=new Map;function a(a){let o=[],s=[];for(let t of a)e(o,s,t);return t=a,n=o,r=s,i=$(n),i}function o(o){let s=W(t,o);switch(s.kind){case`identity`:return i;case`first`:return a(o);case`append`:{let a=o.length,c=n.slice(),l=r.slice();for(let t=s.from;t<a;t++)e(c,l,o[t]);return t=o,n=c,r=l,i=$(n),i}case`mutate-last`:{let a=o.length,s=n.slice(),c=r.slice(),l=s[s.length-1];return l&&l.kind===`thinking`&&l.toolCallId===o[a-1].id&&(s.pop(),c.pop()),e(s,c,o[a-1]),t=o,n=s,r=c,i=$(n),i}case`fallback`:return a(o)}}return{project:o}}function ge(e){let t=(0,J.useRef)(null);return t.current??=he(),t.current.project(e)}function _e(e){return e.kind===`web_search`?`globe`:e.kind===`thinking`?`brain`:u(e.toolName,e.input).iconName}function ve({detail:e}){return e.status===`running`?(0,Y.jsx)(R,{className:`shrink-0`,"data-testid":`nested-detail-running`}):(0,Y.jsx)(T[_e(e)]??l,{"aria-hidden":!0,className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`})}function ye({entry:e,onClose:t,onStop:r,onRequestDetail:l}){let u=v(e.status),d=x(),p=V(),h=(0,J.useMemo)(()=>ee(e.subagentId),[e.subagentId]),{steps:g}=z(e.events),_=ge(e.events),[b,S]=(0,J.useState)(null),C=(0,J.useRef)(_);C.current=_;let w=(0,J.useCallback)(e=>{C.current.has(e)&&S(e)},[]),[T,E]=(0,J.useState)(new Set),[D,O]=(0,J.useState)(!1),[k,j]=(0,J.useState)(!1),N=(0,J.useRef)(null),[P,F]=(0,J.useState)(e.subagentId);P!==e.subagentId&&(F(e.subagentId),O(!1),j(!1),S(null),E(new Set)),(0,J.useLayoutEffect)(()=>{if(D)return;let e=N.current;e&&j(e.scrollHeight>e.clientHeight)},[e.subagentId,e.objective,D]),(0,J.useEffect)(()=>{l&&e.conversationId&&e.events.length===0&&l(e.subagentId)},[e.subagentId,e.conversationId,e.events.length,l]);let R=b?_.get(b):void 0,B=(0,J.useCallback)(()=>S(null),[]),H=R?R.activity||R.title:``,U=R?H:e.label;return(0,Y.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[R&&(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,Y.jsx)(`button`,{type:`button`,onClick:B,title:e.label,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,Y.jsx)(i,{variant:`body-small-default`,as:`span`,children:e.label})}),(0,Y.jsx)(f,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,Y.jsx)(i,{variant:`body-small-default`,as:`span`,title:H,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:H})]}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-hover)] px-5 py-4`,children:[R&&(0,Y.jsx)(n,{variant:`outlined`,iconOnly:(0,Y.jsx)(a,{}),onClick:B,"aria-label":`Back to timeline`,tooltip:`Back`,className:`shrink-0 rounded-lg`}),R?(0,Y.jsx)(ve,{detail:R}):p?(0,Y.jsx)(L,{components:p,bodyShapeId:h.bodyShape,eyeStyleId:h.eyeStyle,colorId:h.color,size:32}):(0,Y.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0}),(0,Y.jsx)(i,{variant:`title-medium`,title:U,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:U}),(0,Y.jsx)(X,{status:e.status}),(0,Y.jsx)(`span`,{className:`flex-1`}),u&&r&&(0,Y.jsx)(ne,{onStop:()=>r(e.subagentId),ariaLabel:`Stop subagent`}),(0,Y.jsx)(n,{variant:`outlined`,iconOnly:(0,Y.jsx)(m,{}),onClick:t,"aria-label":`Close subagent detail`,tooltip:`Close`,className:`shrink-0 rounded-lg`})]}),(0,Y.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:(0,Y.jsx)(y.div,{initial:{opacity:0},animate:{opacity:1},transition:d?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:R?(0,Y.jsx)(Y.Fragment,{children:R.kind===`thinking`?(0,Y.jsx)(I,{content:R.thinkingText??``,hardLineBreaks:!0}):R.kind===`web_search`&&R.status!==`error`?(0,Y.jsx)(Q,{detail:R}):R.toolName===`web_fetch`?(0,Y.jsx)(me,{detail:R}):(0,Y.jsx)(q,{detail:R,showTechnicalDetailsLabel:!1})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,Y.jsx)(c,{icon:(0,Y.jsx)(M,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>o(Math.round(e)),label:`Input`}),(0,Y.jsx)(c,{icon:(0,Y.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>o(Math.round(e)),label:`Output`})]}),e.objective&&(0,Y.jsxs)(`div`,{className:`mb-5`,children:[(0,Y.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:`Objective`}),(0,Y.jsx)(i,{ref:N,variant:`body-medium-lighter`,as:`p`,tabIndex:D?0:void 0,role:D?`region`:void 0,"aria-label":D?`Objective`:void 0,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)] ${D?`max-h-[280px] overflow-y-auto`:`line-clamp-5`}`,children:e.objective}),k&&(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>O(e=>!e),className:`mt-1.5 flex cursor-pointer items-center gap-1 text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:[(0,Y.jsx)(i,{variant:`label-small-default`,children:D?`Show less`:`Show more`}),(0,Y.jsx)(A,{className:`h-3.5 w-3.5 transition-transform ${D?`rotate-180`:``}`,"aria-hidden":!0})]}),(0,Y.jsx)(`div`,{className:`mt-5 h-px w-full bg-[var(--border-hover)]`})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(i,{variant:`title-medium`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:`Timeline`}),e.events.length>0?(0,Y.jsx)(ce,{steps:g,expandedKeys:T,onExpandedKeysChange:E,onStepDetailClick:w,isRunning:u},e.subagentId):(0,Y.jsx)(i,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No events yet`})]})]})},R?`detail`:`list`)})]})}export{ye as SubagentDetailPanel};
@@ -1 +0,0 @@
1
- import{D as e,i as t}from"./auth-store-DGyzz5Ha.js";function n(){let n=e.use.currentOrganizationId();return!t()||n!=null}export{n as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{u as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./is-electron-C_ZTVhv8.js";import{f as i}from"./native-biometric-BK6_QtW5.js";import{a}from"./routes-C6gxiCrz.js";import{n as o,t as s}from"./build-state-CMTAZxqg.js";import{n as c}from"./login-flow-l71HNHLV.js";var l=e(t(),1);function u(e){let t=n(),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(null),m=(0,l.useRef)(0);return{loading:u,error:f,login:async()=>{let n=e??o(s({sessionSettled:!0,isAuthenticated:!0}),t.pathname),r=++m.current;p(null),d(!0);try{await i(c,`${a.account.providerCallback}?returnTo=${encodeURIComponent(n)}`,{returnTo:n})}catch{if(r!==m.current)return;p(`Something went wrong. Please try again.`),d(!1)}},cancel:()=>{m.current++,d(!1),p(null),r()&&window.vellum?.auth?.cancelOAuth()}}}export{u as t};