@vellumai/web 0.10.11-dev.202607221933.baa2119 → 0.10.11-dev.202607222129.31c06e5

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 (232) hide show
  1. package/dist/assets/{AnimatePresence-C8APSgIu.js → AnimatePresence-C42g9zWi.js} +3 -3
  2. package/dist/assets/{BundleConfirmPage-DNYvq-iC.js → BundleConfirmPage-3mylM4ZL.js} +1 -1
  3. package/dist/assets/{Combination-CRZ7Bg3f.js → Combination-DXrVEfaA.js} +1 -1
  4. package/dist/assets/{about-page-XGv9RAQu.js → about-page-CDdCEGZl.js} +1 -1
  5. package/dist/assets/{account-page-BTuXazxB.js → account-page-CzZuoekz.js} +1 -1
  6. package/dist/assets/{account-shell-CGkhTBfc.js → account-shell-Bw5tLjak.js} +1 -1
  7. package/dist/assets/{acp-run-detail-panel-MmrH2dwd.js → acp-run-detail-panel-DssICbn8.js} +4 -4
  8. package/dist/assets/{activity-steps-panel-CTrABRV1.js → activity-steps-panel-CeLVlAeY.js} +1 -1
  9. package/dist/assets/{add-credits-modal-F52jjB45.js → add-credits-modal-BFTdUmH6.js} +1 -1
  10. package/dist/assets/ai-page-ukSnDSJr.js +1 -0
  11. package/dist/assets/{animated-avatar-D36iTfMF.js → animated-avatar-6bSYRHZr.js} +1 -1
  12. package/dist/assets/{api-DkdVwOxT.js → api-CxAtNZ-r.js} +1 -1
  13. package/dist/assets/api-DqHVnn1b.js +1 -0
  14. package/dist/assets/{api-key-screen-Cr6tOl8S.js → api-key-screen-DD_TJKco.js} +1 -1
  15. package/dist/assets/{assistant-feature-flag-store-DuuDCLuS.js → assistant-feature-flag-store-Bh-_qc7v.js} +1 -1
  16. package/dist/assets/{assistant-status-panel-BhJkFBTi.js → assistant-status-panel-gpwr0glD.js} +1 -1
  17. package/dist/assets/auth-store-Lzg3kiaw.js +2 -0
  18. package/dist/assets/{background-task-detail-panel-_Bw4wSRH.js → background-task-detail-panel-BCXH3MXV.js} +1 -1
  19. package/dist/assets/billing-page-BZwgqWS1.js +3 -0
  20. package/dist/assets/{bookmarks-page-BhNbOYSg.js → bookmarks-page-B-PbfvFN.js} +1 -1
  21. package/dist/assets/{browser-CUpmd8oz.js → browser-Cvy3lr__.js} +2 -2
  22. package/dist/assets/{build-state-IyDyesd2.js → build-state-Bo2Ut5Js.js} +1 -1
  23. package/dist/assets/button-CW7wKp2r.js +1 -0
  24. package/dist/assets/{card-D8zyWtZh.js → card-Cf8bWrcq.js} +1 -1
  25. package/dist/assets/{channels-page-route-Ca1iWSkL.js → channels-page-route-DEwl411M.js} +2 -2
  26. package/dist/assets/chat-CNlH625o.js +1 -0
  27. package/dist/assets/chat-markdown-message-CjK8FRpm.js +2 -0
  28. package/dist/assets/{checkbox-1DytZ46G.js → checkbox-D5aqx2QZ.js} +1 -1
  29. package/dist/assets/{client-feature-flag-store-BI4z6UOY.js → client-feature-flag-store-BOcAh56y.js} +1 -1
  30. package/dist/assets/{command-palette-C18hRHXB.js → command-palette-DNujIsf0.js} +1 -1
  31. package/dist/assets/{command-palette-window-page-Bs7nyUOe.js → command-palette-window-page-mWNMMe4I.js} +1 -1
  32. package/dist/assets/{community-page-Bf7YWY7S.js → community-page-DEcDCjsQ.js} +1 -1
  33. package/dist/assets/{confirm-dialog-Zyfei9GV.js → confirm-dialog-DxBl6zcI.js} +1 -1
  34. package/dist/assets/{connect-page-BPS-ZbTc.js → connect-page-DuBhY8KD.js} +1 -1
  35. package/dist/assets/{consent-controls-a3lLNrbR.js → consent-controls-HYKKj225.js} +1 -1
  36. package/dist/assets/contacts-page-route-BS2duMoh.js +1 -0
  37. package/dist/assets/{credential-entry-page-Bo9MyWJX.js → credential-entry-page-CVOU9a8m.js} +1 -1
  38. package/dist/assets/{credentials-page-DZTud37s.js → credentials-page-DDgYexAA.js} +1 -1
  39. package/dist/assets/{debug-page-CXd4HoJ7.js → debug-page-B_us491I.js} +3 -3
  40. package/dist/assets/{deploy-dialogs-B2KiWrEe.js → deploy-dialogs-CB5PSyxZ.js} +1 -1
  41. package/dist/assets/{detail-card-BXVPDa5J.js → detail-card-CAHT277C.js} +1 -1
  42. package/dist/assets/{detail-panel-stop-button-ChKf-46C.js → detail-panel-stop-button-26G26Tqs.js} +1 -1
  43. package/dist/assets/developer-page-Dqug_k0U.js +1 -0
  44. package/dist/assets/{dictation-overlay-page-CZRUD9qJ.js → dictation-overlay-page-Rz3bqW3f.js} +1 -1
  45. package/dist/assets/{dist-Krx5xY9z.js → dist-B_4-HXSm.js} +1 -1
  46. package/dist/assets/{dist-y8XVYHzD.js → dist-D7fbUVVD.js} +1 -1
  47. package/dist/assets/{dist-CO5a5--H.js → dist-V7BKcICH.js} +1 -1
  48. package/dist/assets/{dist-Cul7ysiV.js → dist-kYT5dDAe.js} +1 -1
  49. package/dist/assets/{document-viewer-page-cHXNfErr.js → document-viewer-page-DmHPShuz.js} +1 -1
  50. package/dist/assets/{dropdown-BxYrCXBS.js → dropdown-DQozlhbb.js} +1 -1
  51. package/dist/assets/{emails-page-DgmWq23T.js → emails-page-s9TxP6jP.js} +1 -1
  52. package/dist/assets/{esm-CtFJECNT.js → esm-BGZHdoYP.js} +2 -2
  53. package/dist/assets/{esm-BvREcXsb.js → esm-CZhfXk6a.js} +2 -2
  54. package/dist/assets/{esm-CABHbixu.js → esm-Da6ZHZYd.js} +2 -2
  55. package/dist/assets/{esm-u9ag4ek2.js → esm-DcTPJLRl.js} +2 -2
  56. package/dist/assets/esm-LOX7qY3n.js +2 -0
  57. package/dist/assets/{esm-Dy0d6BZB.js → esm-hFTNI1fw.js} +2 -2
  58. package/dist/assets/feature-flag-catalog-W5kYlNH2.js +1 -0
  59. package/dist/assets/{file-editor-CmUOlTjl.js → file-editor-BdFicqX_.js} +1 -1
  60. package/dist/assets/{file-markdown-BXMDJYDD.js → file-markdown-BCMtcYze.js} +1 -1
  61. package/dist/assets/{general-page-BVWKFUsd.js → general-page-DsrG3cM2.js} +1 -1
  62. package/dist/assets/{haptics-CXVXviY1.js → haptics-ThOnpgA-.js} +2 -2
  63. package/dist/assets/{hatching-screen-DPCeV75d.js → hatching-screen-CuzULcU_.js} +1 -1
  64. package/dist/assets/home-page-route-Cc3ksf3X.js +1 -0
  65. package/dist/assets/{hosting-screen-Cb6yCWrz.js → hosting-screen-DufVMlwF.js} +1 -1
  66. package/dist/assets/identity-page-route-CUrEsO_0.js +7 -0
  67. package/dist/assets/index-BRSW3eiH.css +2 -0
  68. package/dist/assets/index-C7ix_asE.js +217 -0
  69. package/dist/assets/{input-ZpyYt_a0.js → input-D3MhHg0d.js} +1 -1
  70. package/dist/assets/{inspect-page-DMtLyfeS.js → inspect-page-BUAbv6xj.js} +4 -4
  71. package/dist/assets/{integrations-page-CB4Tc_d1.js → integrations-page-9JcrAORp.js} +1 -1
  72. package/dist/assets/{intelligence-layout-CxxCLiFO.js → intelligence-layout-DJjUScCy.js} +1 -1
  73. package/dist/assets/{library-detail-page-IhOT4Jph.js → library-detail-page-BCAZmbR6.js} +1 -1
  74. package/dist/assets/{library-page-BpHOV3jv.js → library-page-CiTHHvZ5.js} +1 -1
  75. package/dist/assets/{list-row-CFyYr-FU.js → list-row-CVw67M2Z.js} +1 -1
  76. package/dist/assets/{login-flow-xM94yfZy.js → login-flow-DYrO-od6.js} +1 -1
  77. package/dist/assets/{login-page-hM0g8LFI.js → login-page-DAFzFbRp.js} +1 -1
  78. package/dist/assets/{logout-page-CNz1LTSY.js → logout-page-CsPkQ-4I.js} +1 -1
  79. package/dist/assets/{logs-layout-DioKpdeF.js → logs-layout-DBJaWlOK.js} +1 -1
  80. package/dist/assets/memory-page-route-CpPfBU9j.js +2 -0
  81. package/dist/assets/{memory-router-playground-page-BCfQ2zWi.js → memory-router-playground-page-DfGhXcZW.js} +1 -1
  82. package/dist/assets/{menu-C9SOvGlk.js → menu-DSB0wFjY.js} +1 -1
  83. package/dist/assets/{metric-card-DDHse5we.js → metric-card-TrndloL3.js} +1 -1
  84. package/dist/assets/{misc-D0u5tzSd.js → misc-BMp6WHdm.js} +1 -1
  85. package/dist/assets/{mobile-sidebar-drawer-D9v0PpYI.js → mobile-sidebar-drawer-CVT3O8os.js} +1 -1
  86. package/dist/assets/{modal-BtcwNEBj.js → modal-D_Y2RPD5.js} +1 -1
  87. package/dist/assets/mutation-error-CSy2D6ry.js +1 -0
  88. package/dist/assets/native-anchor-ChGbTnsU.js +1 -0
  89. package/dist/assets/{native-file-CIQQYbIp.js → native-file-CKFw72Il.js} +2 -2
  90. package/dist/assets/{notice-DkAWz47A.js → notice-CvJ7MBx5.js} +1 -1
  91. package/dist/assets/{notifications-page-BS2GmBjD.js → notifications-page-DcHyVoSk.js} +1 -1
  92. package/dist/assets/{oauth-complete-page-mxqE6rCA.js → oauth-complete-page-DjKBNbdN.js} +1 -1
  93. package/dist/assets/{oauth-popup-complete-page-Cpf2kPNU.js → oauth-popup-complete-page-2KKVC5zM.js} +1 -1
  94. package/dist/assets/{page-empty-state-Co5e7lOF.js → page-empty-state-DhwyXbFT.js} +1 -1
  95. package/dist/assets/{page-shell-CAoXXReY.js → page-shell-BUD21prh.js} +1 -1
  96. package/dist/assets/{pairing-page-DNPxREzR.js → pairing-page-7NMcVDJj.js} +1 -1
  97. package/dist/assets/{panel-item-An-BBeyL.js → panel-item-D1WbMkez.js} +1 -1
  98. package/dist/assets/{personality-page-Ce_Qm2cp.js → personality-page-CwaMBzXV.js} +1 -1
  99. package/dist/assets/plans-page-Cre3Gpys.js +1 -0
  100. package/dist/assets/{platform-loopback-page-DRElW55V.js → platform-loopback-page-CIcVs3UP.js} +1 -1
  101. package/dist/assets/{plugin-detail-page-DAlLoybE.js → plugin-detail-page-R7HOcOd1.js} +1 -1
  102. package/dist/assets/{popover-Bl6742nZ.js → popover-BglbovUA.js} +1 -1
  103. package/dist/assets/privacy-page-CTQpOjs-.js +1 -0
  104. package/dist/assets/{privacy-screen-C05Qf8-3.js → privacy-screen-DgHmBdN-.js} +1 -1
  105. package/dist/assets/{progress-bar-Bqv7D4mZ.js → progress-bar-DrwFU9Ti.js} +1 -1
  106. package/dist/assets/{provider-callback-page-7lCx-5li.js → provider-callback-page-kcYxB4WF.js} +1 -1
  107. package/dist/assets/{provider-signup-page-BMAi3lou.js → provider-signup-page-D9aI4WFt.js} +1 -1
  108. package/dist/assets/{proxy-BzlH_XAe.js → proxy-DoUA9mK6.js} +1 -1
  109. package/dist/assets/{quick-input-page-LVkv3KP4.js → quick-input-page-D2Bqa3St.js} +1 -1
  110. package/dist/assets/{research-mock-page-7srDoNvK.js → research-mock-page-C6zrZtBI.js} +1 -1
  111. package/dist/assets/research-onboarding-route-AYDHEowO.js +43 -0
  112. package/dist/assets/{review-terms-screen-Dsntd0nU.js → review-terms-screen-BSa9jNvG.js} +1 -1
  113. package/dist/assets/{risk-DIRsQZCZ.js → risk-C-ZyBTAb.js} +1 -1
  114. package/dist/assets/{schedules-page-ANwXBbHw.js → schedules-page-gqD1Tbf8.js} +1 -1
  115. package/dist/assets/{select-assistant-screen-Byptt05K.js → select-assistant-screen-CFvCmydl.js} +1 -1
  116. package/dist/assets/{setting-row-BL-mNsNh.js → setting-row-DbMFAasE.js} +1 -1
  117. package/dist/assets/settings-divider-RhnS0iml.js +1 -0
  118. package/dist/assets/{settings-layout-Cm34rPj8.js → settings-layout-XYxLMpW0.js} +1 -1
  119. package/dist/assets/share-feedback-modal-Bjh3dK-n.js +1 -0
  120. package/dist/assets/{shared-ui-BQzVwlXn.js → shared-ui-CUd8SsYi.js} +1 -1
  121. package/dist/assets/{sidebar-tree-DrzE0Jyv.js → sidebar-tree-CDqUGPSK.js} +1 -1
  122. package/dist/assets/{signup-page-CCUuskkM.js → signup-page-DgYRwrxX.js} +1 -1
  123. package/dist/assets/{signup-shell-C--ZjbjA.js → signup-shell-BXZMEgBY.js} +1 -1
  124. package/dist/assets/{site-favicon-DewrgH-a.js → site-favicon-DHBOONR1.js} +1 -1
  125. package/dist/assets/{skill-detail-page-D_PcInrM.js → skill-detail-page-Dnh8ep5N.js} +1 -1
  126. package/dist/assets/{skill-detail-panel-QoaxPpCX.js → skill-detail-panel-DIn7RLCC.js} +1 -1
  127. package/dist/assets/{skills-C7LCNEFA.js → skills-BFnEzvAC.js} +1 -1
  128. package/dist/assets/{src-BNYQ8guL.js → src-BT0gNVcT.js} +2 -2
  129. package/dist/assets/{start-screen-BWJii2no.js → start-screen-CJb-0lgs.js} +1 -1
  130. package/dist/assets/{subagent-detail-panel-BsPcIQ85.js → subagent-detail-panel-V44LtNl6.js} +1 -1
  131. package/dist/assets/{subagent-store-Dr3FrKiG.js → subagent-store-CPEG25fH.js} +1 -1
  132. package/dist/assets/superpowers-page-X0kSM_TF.js +1 -0
  133. package/dist/assets/{system-events-page-BARlmsdY.js → system-events-page-Duos2ubJ.js} +1 -1
  134. package/dist/assets/{tag-B6WeUtBW.js → tag-CJyI1Y2J.js} +1 -1
  135. package/dist/assets/{theme-stage-page-eXVxLFfi.js → theme-stage-page-BU-Gj4c2.js} +1 -1
  136. package/dist/assets/tier-upgrade-resize-modal-CbRtJhAf.js +1 -0
  137. package/dist/assets/{tiptap-document-editor-CM8rLP9w.js → tiptap-document-editor-D1aVS6nK.js} +2 -2
  138. package/dist/assets/{toast-Be8FEQ-I.js → toast-zHo1wvF9.js} +1 -1
  139. package/dist/assets/{toggle-QSEiPr3k.js → toggle-Ca1aoG-l.js} +1 -1
  140. package/dist/assets/{tool-detail-panel-BLLGFD3k.js → tool-detail-panel-C-O4opDs.js} +1 -1
  141. package/dist/assets/typography-1kyF_Eu1.js +1 -0
  142. package/dist/assets/{upgrade-cancel-page-BN873SsM.js → upgrade-cancel-page-UaVSwAVr.js} +1 -1
  143. package/dist/assets/{upgrade-success-page-DhPly3fp.js → upgrade-success-page-CBs03tVb.js} +1 -1
  144. package/dist/assets/{use-assistant-identity-details-D2HgphdP.js → use-assistant-identity-details-CKel0e_r.js} +1 -1
  145. package/dist/assets/{use-edge-swipe-back-DDRGGiWx.js → use-edge-swipe-back-Dv1ShCT7.js} +1 -1
  146. package/dist/assets/use-invite-link-dialog-BfVPh6F5.js +1 -0
  147. package/dist/assets/use-is-org-ready-Ba5vxuqM.js +1 -0
  148. package/dist/assets/{use-onboarding-login-DxALcEIP.js → use-onboarding-login-DMLLDHRX.js} +1 -1
  149. package/dist/assets/{use-reduced-motion-CcGT6CHV.js → use-reduced-motion-DpK6cQN-.js} +1 -1
  150. package/dist/assets/{use-skill-actions-_fTnRmQu.js → use-skill-actions-DPXX5qWL.js} +1 -1
  151. package/dist/assets/{use-skill-detail-files-DSYS5cni.js → use-skill-detail-files-CuoCiyOy.js} +1 -1
  152. package/dist/assets/voice-page-DdjI8A76.js +1 -0
  153. package/dist/assets/{weather-forecast-display-CuVMLDZg.js → weather-forecast-display-0GtxW555.js} +1 -1
  154. package/dist/assets/{web-C_RyjuPn.js → web-BgxqKmFT.js} +1 -1
  155. package/dist/assets/{web-D1Wdlc7e.js → web-TTULY5zV.js} +1 -1
  156. package/dist/assets/{welcome-screen-BsESWnlC.js → welcome-screen-DZhajJW3.js} +1 -1
  157. package/dist/assets/{workflow-detail-panel-Di6HXfLP.js → workflow-detail-panel-Cw0kRLTK.js} +1 -1
  158. package/dist/assets/workspace-page-7j1DZUlp.js +1 -0
  159. package/dist/index.html +52 -51
  160. package/package.json +1 -1
  161. package/dist/assets/ai-page-Cnqe_MF7.js +0 -1
  162. package/dist/assets/api-zOKpkRT4.js +0 -1
  163. package/dist/assets/auth-store-yYPy4QuG.js +0 -2
  164. package/dist/assets/billing-page-GwV110rl.js +0 -3
  165. package/dist/assets/button-BQVYX8n_.js +0 -1
  166. package/dist/assets/chat-BDhsGoUo.js +0 -1
  167. package/dist/assets/chat-markdown-message-DdvPHLTI.js +0 -2
  168. package/dist/assets/contacts-page-route-DvE4cWB1.js +0 -1
  169. package/dist/assets/developer-page-DuGuTkuS.js +0 -1
  170. package/dist/assets/esm-B-GaVjH1.js +0 -2
  171. package/dist/assets/feature-flag-catalog-XCUDf5iL.js +0 -1
  172. package/dist/assets/home-page-route-GRWsjnoO.js +0 -1
  173. package/dist/assets/identity-page-route-Cekp7lb1.js +0 -7
  174. package/dist/assets/index-CtMfDVgi.css +0 -2
  175. package/dist/assets/index-D5iUyXUl.js +0 -217
  176. package/dist/assets/memory-page-route-BChNkOHd.js +0 -2
  177. package/dist/assets/mutation-error-C9sr8Rue.js +0 -1
  178. package/dist/assets/plans-page-CyFzFPMf.js +0 -1
  179. package/dist/assets/privacy-page-CKLXEI25.js +0 -1
  180. package/dist/assets/research-onboarding-route-B4MdewsW.js +0 -43
  181. package/dist/assets/settings-divider-jsYVGphg.js +0 -1
  182. package/dist/assets/share-feedback-modal-Do56cx6v.js +0 -1
  183. package/dist/assets/superpowers-page-DttFOVF5.js +0 -1
  184. package/dist/assets/tier-upgrade-resize-modal-BTi56abH.js +0 -1
  185. package/dist/assets/typography-Cqi8q9o7.js +0 -1
  186. package/dist/assets/use-invite-link-dialog-B7jUrCaY.js +0 -1
  187. package/dist/assets/use-is-org-ready-CoKP2L8w.js +0 -1
  188. package/dist/assets/voice-page-D5c_WgX8.js +0 -1
  189. package/dist/assets/workspace-page-BAX94prH.js +0 -1
  190. /package/dist/assets/{a2a-invite-VS3p3CfD.js → a2a-invite-sGxHSsPS.js} +0 -0
  191. /package/dist/assets/{app-info-Clwt3pCt.js → app-info-DDWMarAq.js} +0 -0
  192. /package/dist/assets/{app-types-XM5qKBD0.js → app-types-CR9QB0-8.js} +0 -0
  193. /package/dist/assets/{archive-redirect-page-Brvq3ES5.js → archive-redirect-page-emWqj2aZ.js} +0 -0
  194. /package/dist/assets/{billing-redirect-page-B3C0OqCH.js → billing-redirect-page-BFcz_1bP.js} +0 -0
  195. /package/dist/assets/{build.umd-Cygy7skA.js → build.umd-CW7LiBLq.js} +0 -0
  196. /package/dist/assets/{contacts-gateway-C1Oif2mf.js → contacts-gateway-C1Yhfk72.js} +0 -0
  197. /package/dist/assets/{danger-zone-redirect-page-DjzXSO6Q.js → danger-zone-redirect-page-CKqC2kf5.js} +0 -0
  198. /package/dist/assets/{definitions-yU7UnVpH.js → definitions-BUCExH-9.js} +0 -0
  199. /package/dist/assets/{definitions-BEx8SBhF.js → definitions-DpZNNWA7.js} +0 -0
  200. /package/dist/assets/{devices-redirect-page-aDimdAFs.js → devices-redirect-page-BBmdT-cM.js} +0 -0
  201. /package/dist/assets/{emoji-catalog-data-D8lRMt3A.js → emoji-catalog-data-Do3FUA8t.js} +0 -0
  202. /package/dist/assets/{environment-store-R_3zZFKL.js → environment-store-geigPfHz.js} +0 -0
  203. /package/dist/assets/{esm-BhZb3XhL.js → esm-BNfE-1QY.js} +0 -0
  204. /package/dist/assets/{format-file-size-BSrdQr7P.js → format-file-size-B9DWgk-8.js} +0 -0
  205. /package/dist/assets/{get-memory-stats-KWGzIlTp.js → get-memory-stats-CswQQLY0.js} +0 -0
  206. /package/dist/assets/{keyboard-shortcuts-redirect-page-Cwga2alP.js → keyboard-shortcuts-redirect-page-BlXA_79i.js} +0 -0
  207. /package/dist/assets/{latest-assistant-text-BKts4hYK.js → latest-assistant-text-CQ8YGbvQ.js} +0 -0
  208. /package/dist/assets/{link-click-Cw5JZikw.js → link-click-B_ZqHynd.js} +0 -0
  209. /package/dist/assets/{onboarding-step-layout-2XcmxqFN.js → onboarding-step-layout-CEt9JOpN.js} +0 -0
  210. /package/dist/assets/{password-reset-page-BJ68aXQ5.js → password-reset-page-DzLdCWhJ.js} +0 -0
  211. /package/dist/assets/{pdf-aq5Mn3GZ.js → pdf-BFBTGjwO.js} +0 -0
  212. /package/dist/assets/{plugin-attribution-6W3_ulYk.js → plugin-attribution-meUNq3wV.js} +0 -0
  213. /package/dist/assets/{plugins-page-DbqKT2CS.js → plugins-page-CeEkVNFM.js} +0 -0
  214. /package/dist/assets/{profile-metadata-CMym5q9r.js → profile-metadata-C6i7Ro9a.js} +0 -0
  215. /package/dist/assets/{provider-key-ACM9xzKs.js → provider-key-BPINSkGG.js} +0 -0
  216. /package/dist/assets/{schedules-CqDlgP0M.js → schedules-CL3Ox7Jc.js} +0 -0
  217. /package/dist/assets/{security-redirect-page-x1aDP81r.js → security-redirect-page-DYh8CKKb.js} +0 -0
  218. /package/dist/assets/{skills-page-bdypLibR.js → skills-page-CX46pcIo.js} +0 -0
  219. /package/dist/assets/{sounds-redirect-page-Blt0vV_7.js → sounds-redirect-page-DfVvXEAS.js} +0 -0
  220. /package/dist/assets/{status-badge-pill-0N6rTEBg.js → status-badge-pill-j3ke1d9o.js} +0 -0
  221. /package/dist/assets/{system-events-redirect-page-CMriM4T-.js → system-events-redirect-page-BHASNLky.js} +0 -0
  222. /package/dist/assets/{three-dot-indicator-CwchtNVS.js → three-dot-indicator-BuZzHFUJ.js} +0 -0
  223. /package/dist/assets/{usage-redirect-page-CYLunqbd.js → usage-redirect-page-1zbr09t0.js} +0 -0
  224. /package/dist/assets/{use-copy-to-clipboard-D3nUm_6n.js → use-copy-to-clipboard-Ap1ESW2j.js} +0 -0
  225. /package/dist/assets/{web-DwtkFwhF.js → web-Cfu1-OYV.js} +0 -0
  226. /package/dist/assets/{web-DE01jWtm.js → web-CpMgd0X0.js} +0 -0
  227. /package/dist/assets/{web-D2t1-p2V.js → web-D5EBYCt2.js} +0 -0
  228. /package/dist/assets/{web-DNkvgjT6.js → web-DT7Uml3n.js} +0 -0
  229. /package/dist/assets/{web-DK4RzUrM.js → web-D_z4FjB0.js} +0 -0
  230. /package/dist/assets/{web-DoV8m3zw.js → web-F3CAps0-.js} +0 -0
  231. /package/dist/assets/{xterm-DUb6-aPw.js → xterm-BSc05cUt.js} +0 -0
  232. /package/dist/assets/{xterm-addon-fit-D82wciIP.js → xterm-addon-fit-CW_qH798.js} +0 -0
@@ -1,2 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{u as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./queryOptions-BtNi-_9H.js";import{t as c}from"./typography-Cqi8q9o7.js";import{t as l}from"./chevron-down-DpYf9Gwq.js";import{t as u}from"./chevron-left-B_RAz34t.js";import{t as d}from"./chevron-up-DHI-QRpz.js";import{t as f}from"./loader-circle-Ck8fq3yv.js";import{n as p,t as m}from"./minimize-2-dsDfFPkN.js";import{t as h}from"./plus-DZZypDUF.js";import{t as g}from"./sparkles-BK3KXCjl.js";import{t as _}from"./x-CswtfvgS.js";import{j as v}from"./src-BNYQ8guL.js";import{n as y}from"./input-ZpyYt_a0.js";import{t as b}from"./modal-BtcwNEBj.js";import{n as x}from"./toast-Be8FEQ-I.js";import{t as ee}from"./file-markdown-BXMDJYDD.js";import{_n as te,cn as ne,vn as S}from"./sdk.gen-BR-xXIZm.js";import{n as C,r as w,t as T}from"./api-errors-CoE1wFl2.js";import{t as E}from"./consent-CbUJxlho.js";import{t as D}from"./ingest-CCvgooq8.js";import{Ao as re,Ha as O,J as k,Xo as ie,Yo as A,ko as ae,os as j}from"./index-D5iUyXUl.js";import{t as M}from"./get-memory-stats-KWGzIlTp.js";var N=e(t(),1),P={x:600,y:450},F=`Failed to load the memory graph.`;function I(e){return s({queryKey:[`memory-graph`,e],staleTime:5*6e4,queryFn:async()=>{let{data:t,error:n,response:r}=await te({path:{assistant_id:e},throwOnError:!1});if(C(r,n,F),r.status===404)return{kind:`unsupported`};if(!r.ok)throw new T(r.status,w(n,r,F));return!t||t.supported===!1?{kind:`unsupported`}:{kind:`ready`,graph:t}}})}var oe=`memory_tab_v1`,L=crypto.randomUUID();function R(e){typeof window>`u`||E()&&D([{type:`onboarding`,daemon_event_id:crypto.randomUUID(),recorded_at:Date.now(),screen:`memory`,session_id:L,step_name:e,funnel_version:oe}])}var z=Math.PI*(3-Math.sqrt(5)),B=7,V=2.4,H=34,U=10;function se(e){return Math.min(H,B+V*Math.sqrt(e))}function W(e){return e===`concept`||e===`skill`||e===`capability`||e===`pending`?e:`other`}function G(e){return e===`link`||e===`learned`?e:`other`}function ce(e,t={}){let n=t.center??P,r=e.nodes,i=r.length;if(i===0)return{nodes:[],edges:[]};let a=new Map;r.forEach((e,t)=>a.set(e.id,t));let o=e.edges.filter(e=>e.source!==e.target&&a.has(e.source)&&a.has(e.target)),s=Array(i).fill(0),c=[];for(let e of o){let t=a.get(e.source),n=a.get(e.target);s[t]++,s[n]++,c.push([t,n])}let l=r.map((e,t)=>se(s[t])),u=70+26*Math.sqrt(i),d=r.map((e,t)=>{let r=(t+.5)/i,a=Math.acos(1-2*r),o=t*z,s=u*Math.cbrt(r),c=Math.sin(a);return{x:n.x+s*c*Math.cos(o),y:n.y+s*c*Math.sin(o),z:s*Math.cos(a),vx:0,vy:0,vz:0}}),f=t.iterations??Math.max(90,Math.min(340,Math.round(46e3/i))),p=.011,m=.82,h=.5,g=1,_=1-.001**(1/f);for(let e=0;e<f;e++){for(let e=0;e<i;e++){let t=d[e];for(let n=e+1;n<i;n++){let r=d[n],i=t.x-r.x,a=t.y-r.y,o=t.z-r.z,s=i*i+a*a+o*o;s<.01&&(i=(e-n)*.1+.1,a=.1,o=.05,s=i*i+a*a+o*o);let c=Math.sqrt(s),l=6400/s,u=i/c*l,f=a/c*l,p=o/c*l;t.vx+=u,t.vy+=f,t.vz+=p,r.vx-=u,r.vy-=f,r.vz-=p}}for(let[e,t]of c){let n=d[e],r=d[t],i=r.x-n.x,a=r.y-n.y,o=r.z-n.z,s=Math.sqrt(i*i+a*a+o*o)||.01,c=.05*(s-140),l=i/s*c,u=a/s*c,f=o/s*c;n.vx+=l,n.vy+=u,n.vz+=f,r.vx-=l,r.vy-=u,r.vz-=f}for(let e=0;e<i;e++){let t=d[e];t.vx+=(n.x-t.x)*p,t.vy+=(n.y-t.y)*p,t.vz+=(0-t.z)*p,t.x+=t.vx*g*h,t.y+=t.vy*g*h,t.z+=t.vz*g*h,t.vx*=m,t.vy*=m,t.vz*=m}g*=1-_}for(let e=0;e<10;e++){let e=!1;for(let t=0;t<i;t++){let n=d[t];for(let r=t+1;r<i;r++){let i=d[r],a=i.x-n.x,o=i.y-n.y,s=i.z-n.z,c=Math.sqrt(a*a+o*o+s*s),u=l[t]+l[r]+U;if(c>=u)continue;c<.01&&(a=(r-t)*.1+.1,o=.1,s=.05,c=Math.sqrt(a*a+o*o+s*s));let f=(u-c)/2,p=a/c*f,m=o/c*f,h=s/c*f;n.x-=p,n.y-=m,n.z-=h,i.x+=p,i.y+=m,i.z+=h,e=!0}}if(!e)break}return{nodes:r.map((e,t)=>{let n={id:e.id,x:d[t].x,y:d[t].y,z:d[t].z,radius:l[t],label:e.label,kind:W(e.kind),degree:s[t]};return e.summary&&(n.summary=e.summary),e.updatedAtMs!==void 0&&(n.updatedAtMs=e.updatedAtMs),n}),edges:o.map((e,t)=>{let n={id:`${e.source}__${e.target}__${t}`,fromId:e.source,toId:e.target,kind:G(e.kind),directed:e.directed??!1};return e.description&&(n.description=e.description),n})}}var K=`Failed to load this concept.`;function le(e,t){return s({queryKey:[`memory-graph-node`,e,t],enabled:!!(e&&t),queryFn:async()=>{let{data:n,error:r,response:i}=await S({path:{assistant_id:e},query:{id:t??``},throwOnError:!1});if(C(i,r,K),!i.ok)throw new T(i.status,w(r,i,K));return n??{found:!1}}})}var ue={concept:`#467CC8`,skill:`#DB4B77`,capability:`#0E9B8B`,pending:`#F1B21E`,other:`#8D99A5`},de=[`#467CC8`,`#E86B40`,`#7A5AF5`,`#22B8CF`,`#3DB85E`,`#E9C91A`,`#E83F5B`,`#6ECF87`,`#F39B74`,`#F5C94E`],fe={concept:`Concept`,skill:`Skill`,capability:`Capability`,pending:`Pending`,other:`Other`},pe=`#F1B21E`,q=o();function J(e){if(e.length<=4)return e.map((e,t)=>({node:e,index:t}));let t=e.slice(-3).map((t,n)=>({node:t,index:e.length-3+n}));return[{node:e[0],index:0},`ellipsis`,...t]}function Y(e){return e?new Date(e).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`}):null}var me=600;function he(e){let t=e.slice(0,me),n=t.lastIndexOf(`
2
- `);return n>me/2?e.slice(0,n):t}function ge({content:e}){let[t,r]=(0,N.useState)(!1);return e.length<=me?(0,q.jsx)(ee,{content:e}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ee,{content:t?e:he(e)}),(0,q.jsx)(n,{variant:`ghost`,size:`compact`,className:`-ml-2 mt-1`,onClick:()=>r(e=>!e),rightIcon:t?(0,q.jsx)(d,{size:16,"aria-hidden":!0}):(0,q.jsx)(l,{size:16,"aria-hidden":!0}),children:t?`Show less`:`Read full note`})]})}function _e({assistantId:e,node:t,trail:r,neighbors:i,onTravel:o,onCrumb:s,onClose:c,onOpenThread:l}){let d=a(le(e,t.id)),f=d.data,p=Y(t.updatedAtMs),m=f?.title??t.label,h=J(r);return(0,N.useEffect)(()=>{let e=e=>{e.key===`Escape`&&c()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c]),(0,q.jsxs)(`div`,{"data-graph-panel":!0,className:`absolute inset-0 z-20 flex justify-end`,onPointerDown:e=>e.stopPropagation(),onPointerMove:e=>e.stopPropagation(),onPointerUp:e=>e.stopPropagation(),children:[(0,q.jsx)(`div`,{className:`absolute inset-0`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 16%, transparent)`},onClick:c}),(0,q.jsxs)(`aside`,{className:`relative flex h-full min-h-0 w-full max-w-md flex-col overflow-hidden`,style:{backgroundColor:`var(--surface-lift)`,borderLeft:`1px solid var(--border-base)`},children:[r.length>1?(0,q.jsxs)(`nav`,{"aria-label":`Concept trail`,className:`flex shrink-0 items-center gap-1 overflow-hidden border-b px-5 py-2 text-body-small-default`,style:{borderColor:`var(--border-base)`,color:`var(--content-tertiary)`},children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>s(r.length-2),"aria-label":`Back`,className:`-ml-1 mr-0.5 flex shrink-0 items-center rounded p-0.5 hover:bg-[color-mix(in_srgb,var(--content-tertiary)_14%,transparent)]`,style:{color:`var(--content-tertiary)`},children:(0,q.jsx)(u,{size:16,"aria-hidden":!0})}),h.map((e,t)=>(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[t>0?(0,q.jsx)(`span`,{"aria-hidden":!0,children:`›`}):null,e===`ellipsis`?(0,q.jsx)(`span`,{"aria-hidden":!0,children:`…`}):e.index===r.length-1?(0,q.jsx)(`span`,{"aria-current":`page`,className:`max-w-[9rem] truncate`,style:{color:`var(--content-default)`},children:e.node.label}):(0,q.jsx)(`button`,{type:`button`,onClick:()=>s(e.index),className:`max-w-[8rem] truncate rounded hover:underline`,style:{color:`var(--content-tertiary)`},children:e.node.label})]},e===`ellipsis`?`ellipsis`:e.index))]}):null,(0,q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-3 border-b px-5 py-4`,style:{borderColor:`var(--border-base)`},children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`h2`,{className:`truncate text-title-small`,style:{color:`var(--content-default)`},title:f?.title??t.label,children:f?.title??t.label}),p?(0,q.jsxs)(`p`,{className:`mt-0.5 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`Updated `,p]}):null]}),(0,q.jsx)(n,{variant:`ghost`,iconOnly:(0,q.jsx)(_,{"aria-hidden":!0}),onClick:c,"aria-label":`Close`,tintColor:`var(--content-tertiary)`})]}),(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,style:{touchAction:`pan-y`},children:[d.isLoading?(0,q.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,q.jsx)(`div`,{className:`h-5 w-5 animate-spin rounded-full border-2`,style:{borderColor:`var(--border-base)`,borderTopColor:`var(--content-tertiary)`}})}):d.isError?(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Couldn't load this concept. Try again in a moment.`}):f?.found&&f.content?.trim()?(0,q.jsx)(ge,{content:f.content},t.id):(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This concept doesn't have written content yet — it exists as a link in the graph, but its page is empty.`}),i.length>0?(0,q.jsxs)(`section`,{className:`mt-6 border-t pt-4`,style:{borderColor:`var(--border-base)`},children:[(0,q.jsxs)(`div`,{className:`mb-2 flex items-baseline justify-between gap-2`,children:[(0,q.jsx)(`h3`,{className:`text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:`Wired to`}),(0,q.jsxs)(`span`,{className:`text-body-small-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:[i.length,` connection`,i.length===1?``:`s`]})]}),(0,q.jsx)(`ul`,{className:`flex list-none flex-col gap-0.5`,children:i.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,onClick:()=>o({id:e.id,label:e.label}),className:`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-body-medium-default hover:bg-[color-mix(in_srgb,var(--content-tertiary)_12%,transparent)]`,style:{color:`var(--content-default)`},children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`h-1.5 w-1.5 shrink-0 rounded-full`,style:{backgroundColor:e.kind===`learned`?pe:`var(--content-tertiary)`}}),(0,q.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.id))})]}):null]}),l?(0,q.jsxs)(`footer`,{className:`flex shrink-0 gap-2 border-t px-5 py-3`,style:{borderColor:`var(--border-base)`},children:[(0,q.jsx)(n,{variant:`outlined`,size:`regular`,className:`flex-1`,leftIcon:(0,q.jsx)(j,{size:16,"aria-hidden":!0}),onClick:()=>l(`Tell me what you remember about "${m}" and how it connects to the rest of what you know.`),children:`Ask about this`}),(0,q.jsx)(n,{variant:`primary`,size:`regular`,className:`flex-1`,leftIcon:(0,q.jsx)(g,{size:16,"aria-hidden":!0}),onClick:()=>l(`I want to refine what you remember about "${m}". Ask me what's off and we'll correct it together.`),children:`Refine`})]}):null]})]})}function ve({onDismiss:e}){return(0,q.jsxs)(`div`,{"data-graph-control":!0,className:`pointer-events-auto absolute left-1/2 top-4 z-10 flex w-[min(30rem,calc(100%-6rem))] -translate-x-1/2 items-start gap-3 rounded-xl px-4 py-3`,style:{backgroundColor:`var(--surface-lift)`,border:`1px solid var(--border-base)`,boxShadow:`0 4px 12px rgba(0, 0, 0, 0.25)`},children:[(0,q.jsx)(`span`,{className:`mt-0.5 shrink-0`,style:{color:`var(--primary-base)`},"aria-hidden":!0,children:(0,q.jsx)(g,{size:18})}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`p`,{className:`text-body-medium-emphasised`,style:{color:`var(--content-default)`},children:`This is your assistant's mind`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:`Every idea it learns — and the links it draws between them — shows up here. The map grows and rearranges itself as you talk, so the more you share, the richer it gets.`})]}),(0,q.jsx)(n,{variant:`ghost`,iconOnly:(0,q.jsx)(_,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss`,tintColor:`var(--content-tertiary)`})]})}var X=8;function ye({nodeKinds:e,coloredByTheme:t,themes:n,hasLinks:r,hasLearned:i,onToggleLink:a,onToggleLearned:o,linkActive:s,learnedActive:c}){return(0,q.jsxs)(`div`,{"data-graph-control":!0,className:`pointer-events-none absolute bottom-4 left-4 flex flex-col gap-1.5 rounded-lg px-3 py-2`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 78%, transparent)`,border:`1px solid var(--border-base)`},children:[e.map(e=>(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`inline-block h-2.5 w-2.5 rounded-full`,style:{backgroundColor:ue[e]}}),(0,q.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--content-tertiary)`},children:fe[e]})]},e)),t&&(n&&n.length>0?(0,q.jsxs)(q.Fragment,{children:[n.slice(0,X).map((e,t)=>(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`inline-block h-2.5 w-2.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),(0,q.jsx)(`span`,{className:`max-w-[9rem] truncate text-[11px]`,style:{color:`var(--content-tertiary)`},title:e.concepts?.join(` · `)??e.name,children:e.name})]},t)),n.length>X&&(0,q.jsxs)(`span`,{className:`text-[11px]`,style:{color:`var(--content-tertiary)`},children:[`+`,n.length-X,` more`]})]}):(0,q.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--content-tertiary)`},children:`Colored by theme`})),(e.length>0||t)&&(r||i)&&(0,q.jsx)(`div`,{className:`mt-0.5 border-t pt-1.5`,style:{borderColor:`var(--border-base)`}}),r&&(0,q.jsx)(Z,{swatchStyle:{borderTop:`2px solid var(--content-tertiary)`},label:`Link`,onToggle:a,active:s}),i&&(0,q.jsx)(Z,{swatchStyle:{borderTop:`2px dashed #F1B21E`},label:`Learned`,onToggle:o,active:c})]})}function Z({swatchStyle:e,label:t,onToggle:n,active:r}){let i=(0,q.jsx)(`span`,{className:`inline-block h-0 w-4`,style:e}),a=(0,q.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--content-tertiary)`},children:t});return n?(0,q.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":r,className:`pointer-events-auto flex cursor-pointer items-center gap-2 border-0 bg-transparent p-0 transition-opacity`,style:{opacity:r===!1?.4:1},children:[i,a]}):(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,a]})}var be=8;function xe(e,t){let n=e.length;if(n===0)return new Map;let r=new Map;e.forEach((e,t)=>r.set(e.id,t));let i=e.map(()=>[]);for(let e of t){let t=r.get(e.fromId),n=r.get(e.toId);t===void 0||n===void 0||t===n||(i[t].push(n),i[n].push(t))}let a=e.map((e,t)=>t);for(let e=0;e<be;e++)for(let e=0;e<n;e++){let t=i[e];if(t.length===0)continue;let n=new Map;for(let e of t)n.set(a[e],(n.get(a[e])??0)+1);let r=a[e],o=-1;for(let[e,t]of n)(t>o||t===o&&e<r)&&(r=e,o=t);a[e]=r}let o=new Map,s=new Map;return e.forEach((e,t)=>{let n=a[t],r=o.get(n);r===void 0&&(r=o.size,o.set(n,r)),s.set(e.id,r)}),s}var Se=[{value:`all`,label:`All`},{value:`month`,label:`Month`},{value:`week`,label:`Week`}];function Ce({value:e,onChange:t}){return(0,q.jsx)(v,{ariaLabel:`Recency window`,items:Se,value:e,onChange:t,className:`!w-auto [&>*]:!flex-none`})}var we=`vellum:memoryGraph:introDismissed:`;function Te(e){return`${we}${e}`}function Q(e){if(!e)return!0;try{return window.localStorage.getItem(Te(e))===`1`}catch{return!0}}function Ee(e){let[t,n]=(0,N.useState)(()=>Q(e));return(0,N.useEffect)(()=>{n(Q(e))},[e]),[t,(0,N.useCallback)(()=>{n(!0);try{window.localStorage.setItem(Te(e),`1`)}catch{}},[e])]}var De=[`concept`,`skill`,`capability`,`pending`,`other`],Oe=.13,ke=2600,Ae=.006,je=1.15,Me=3,Ne=.32,Pe=.45,Fe=3,Ie=4,Le=1440*60*1e3,Re=14*Le,ze=12,Be=2*Le,Ve=80,He=340,Ue=.12,We=.05,Ge=.03,Ke=12;function qe(e){let t=getComputedStyle(e);return{content:t.getPropertyValue(`--content-default`).trim()||`#e5e7eb`,tertiary:t.getPropertyValue(`--content-tertiary`).trim()||`#8792a0`}}function Je(e){return e.kind===`learned`?`Learned association`:e.description??`Linked concepts`}function Ye(e,t,n){return t==null?!1:e==null||n-e>t}function Xe(e,t){let n=t?e.get(t):void 0;return e=>t!=null&&(e===t||(n?.has(e)??!1))}function Ze({title:e,detail:t}){return(0,q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,q.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),t?(0,q.jsx)(`p`,{className:`max-w-sm text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t}):null]})}function Qe({assistantId:e,className:t,isFullscreen:r,onToggleFullscreen:i,onOpenThread:o}){let s=(0,N.useRef)(null),c=(0,N.useRef)(null),l=a(I(e)),u=l.data?.kind===`ready`?l.data.graph:null,d=(0,N.useMemo)(()=>u?ce(u):{nodes:[],edges:[]},[u]),f=l.data?.kind===`ready`&&d.nodes.length>0,h=(0,N.useMemo)(()=>xe(d.nodes,d.edges),[d.nodes,d.edges]),g=(0,N.useMemo)(()=>{let e=new Map;for(let t of d.nodes){let n=h.get(t.id);if(n==null||t.degree===0)continue;let r=e.get(n);r?r.push(t):e.set(n,[t])}return[...e.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>t.degree-e.degree||(e.id<t.id?-1:1)).slice(0,3);return{hubId:n[0].id,color:de[e%de.length],name:n[0].label,concepts:n.map(e=>e.label),size:t.length}}).sort((e,t)=>t.size-e.size)},[h,d.nodes]),v=(0,N.useMemo)(()=>new Set(g.map(e=>e.hubId)),[g]),y=(0,N.useMemo)(()=>{let e=new Map,t=(t,n)=>{let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)};for(let e of d.edges)t(e.fromId,e.toId),t(e.toId,e.fromId);return e},[d.edges]),b=(0,N.useMemo)(()=>{if(d.nodes.length===0)return 1;let e=d.nodes.map(e=>{let t=e.x-P.x,n=e.y-P.y;return Math.sqrt(t*t+n*n+e.z*e.z)+e.radius}).sort((e,t)=>e-t),t=Math.min(e.length-1,Math.floor(e.length*.92));return Math.max(1,e[t])},[d.nodes]),x=(0,N.useRef)({yaw:.5,pitch:.32,zoom:1,hoveredId:null,dragging:!1,moved:!1,lastX:0,lastY:0,lastInteractAt:-1/0,dirty:!0}),ee=(0,N.useRef)([]),te=(0,N.useRef)([]),ne=(0,N.useRef)({content:`#e5e7eb`,tertiary:`#8792a0`}),S=(0,N.useRef)(null),C=(0,N.useRef)(!1),[w,T]=(0,N.useState)(null),[E,D]=(0,N.useState)(null),[O,k]=(0,N.useState)([]),j=O.at(-1)??null,M=(0,N.useCallback)(e=>{R(`node_opened`),k(t=>[...t,e])},[]),F=(0,N.useRef)(null);(0,N.useEffect)(()=>{F.current=j?.id??null,x.current.dirty=!0},[j?.id]);let[oe,L]=Ee(e),[z,B]=(0,N.useState)(``),V=(0,N.useRef)(!1),H=z.trim().toLowerCase(),U=(0,N.useMemo)(()=>{if(!H)return null;let e=new Set;for(let t of d.nodes)t.label.toLowerCase().includes(H)&&e.add(t.id);return e},[H,d.nodes]),se=(0,N.useRef)({active:!1,matches:null});(0,N.useEffect)(()=>{se.current={active:!!U,matches:U},x.current.dirty=!0},[U]),(0,N.useEffect)(()=>{z.trim()||(V.current=!1)},[z]);let W=(0,N.useMemo)(()=>!U||U.size===0?[]:d.nodes.filter(e=>U.has(e.id)).sort((e,t)=>t.degree-e.degree).slice(0,8),[U,d.nodes]),[G,K]=(0,N.useState)(`all`),le=(0,N.useRef)(null);(0,N.useEffect)(()=>{le.current=G===`week`?7*Le:G===`month`?30*Le:null,x.current.dirty=!0},[G]);let fe=(0,N.useMemo)(()=>d.nodes.some(e=>e.updatedAtMs!=null),[d.nodes]);(0,N.useEffect)(()=>{!fe&&G!==`all`&&K(`all`)},[fe,G]);let[J,Y]=(0,N.useState)({link:!0,learned:!0}),me=(0,N.useRef)(J);(0,N.useEffect)(()=>{me.current=J,x.current.dirty=!0},[J]),(0,N.useEffect)(()=>{B(``),K(`all`),Y({link:!0,learned:!0}),k([]),V.current=!1},[e]);let he=(0,N.useCallback)(()=>{let e=x.current;e.yaw=.5,e.pitch=.32,e.zoom=1,e.lastInteractAt=-1/0,e.dirty=!0,T(null)},[]),ge=(0,N.useCallback)(e=>{let t=x.current;t.zoom=Math.max(Pe,Math.min(Fe,t.zoom*e)),t.lastInteractAt=performance.now(),t.dirty=!0},[]),X=(0,N.useCallback)(e=>{S.current=e,x.current.lastInteractAt=performance.now(),x.current.dirty=!0},[]),Z=(0,N.useCallback)(e=>{M(e),X(e.id)},[M,X]),be=(0,N.useCallback)(()=>{k([]),B(``),T(null),S.current=null,C.current=!0},[]),Se=(0,N.useCallback)(e=>{B(``);let t=O.slice(0,e+1);k(t);let n=t.at(-1);n?X(n.id):T(null)},[O,X]),we=(0,N.useCallback)(e=>{B(``),Z(e)},[Z]),Te=(0,N.useMemo)(()=>{let e=j?.id;if(!e)return[];let t=y.get(e);if(!t||t.size===0)return[];let n=new Map(d.nodes.map(e=>[e.id,e.label])),r=new Map;for(let t of d.edges)t.fromId===e?r.set(t.toId,t.kind):t.toId===e&&r.set(t.fromId,t.kind);let i=[];for(let e of t){let t=n.get(e);t!=null&&i.push({id:e,label:t,kind:r.get(e)})}return i.sort((e,t)=>e.label.localeCompare(t.label)),i},[j?.id,y,d.nodes,d.edges]);(0,N.useEffect)(()=>{if(!f)return;let e=c.current,t=s.current;if(!e||!t)return;let n=e.getContext(`2d`);if(!n)return;let r=d.nodes,i=d.edges,a=h,o=v,l=y,u=new Set(r.map(e=>e.id)),p=b,m=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;ne.current=qe(t);let g=Math.min(window.devicePixelRatio||1,2),_=0,w=0,T=()=>{let n=t.getBoundingClientRect();_=n.width,w=n.height,g=Math.min(window.devicePixelRatio||1,2),e.width=Math.max(1,Math.round(_*g)),e.height=Math.max(1,Math.round(w*g)),e.style.width=`${_}px`,e.style.height=`${w}px`,ne.current=qe(t),x.current.dirty=!0};T();let E=new ResizeObserver(T);E.observe(t);let D=0,re=0,O=e=>{let t=re?Math.min(.05,(e-re)/1e3):0;re=e;let s=x.current,c=ne.current,d=Date.now(),f=S.current;if(!s.dragging&&e-s.lastInteractAt>ke&&!m&&!f&&(s.yaw+=Oe*t),f){let e=r.find(e=>e.id===f);if(!e)S.current=null;else{let t=e.x-P.x,n=e.y-P.y,r=e.z,i=-Math.atan2(t,r),a=Math.hypot(t,r),o=Math.max(-je,Math.min(je,Math.atan2(n,a))),c=Math.min(Fe,1.6),l=m?1:.15,u=i-s.yaw;u=Math.atan2(Math.sin(u),Math.cos(u)),s.yaw+=u*l,s.pitch+=(o-s.pitch)*l,s.zoom+=(c-s.zoom)*l,s.dirty=!0,Math.abs(u)<.01&&Math.abs(o-s.pitch)<.01&&Math.abs(c-s.zoom)<.02&&(S.current=null)}}if(C.current&&!s.dragging){let e=m?1:.15;s.pitch+=(.32-s.pitch)*e,s.zoom+=(1-s.zoom)*e,s.dirty=!0,Math.abs(.32-s.pitch)<.01&&Math.abs(1-s.zoom)<.02&&(C.current=!1)}if(m&&!s.dirty){D=requestAnimationFrame(O);return}s.dirty=!1;let h=Math.cos(s.yaw),v=Math.sin(s.yaw),y=Math.cos(s.pitch),b=Math.sin(s.pitch),T=Me*p,E=Math.min(_,w)*.88/(2*p)*s.zoom,k=_/2,ie=w/2;n.setTransform(g,0,0,g,0,0),n.clearRect(0,0,_,w);let A=s.hoveredId,ae=A?l.get(A):void 0,j=e=>!A||e===A||(ae?.has(e)??!1),M=se.current,N=M.active,I=e=>!N||(M.matches?.has(e)??!1),oe=le.current,L=e=>Ye(e.updatedAtMs,oe,d),R=me.current,z=F.current,B=z!=null&&u.has(z),V=Xe(l,B?z:null),H=r.length<=Ve?1:Math.max(Ue,1-(r.length-Ve)/(He-Ve)*(1-Ue)),U=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e],n=t.x-P.x,i=t.y-P.y,a=t.z,o=n*h+a*v,s=-n*v+a*h,c=i*y-s*b,l=i*b+s*y,u=T/(T-l);U[e]={node:t,sx:k+o*E*u,sy:ie+c*E*u,sr:Math.max(1.2,t.radius*E*u),depth:Math.max(0,Math.min(1,(l+p)/(2*p)))}}let W=U.map((e,t)=>t).sort((e,t)=>U[e].depth-U[t].depth),G=new Map;for(let e of U)G.set(e.node.id,e);let ce=[];n.lineCap=`round`;for(let e of i){let t=G.get(e.fromId),r=G.get(e.toId);if(!t||!r)continue;let i=e.kind===`learned`,a=z!=null&&(e.fromId===z||e.toId===z);if(!a&&(i?!R.learned:!R.link))continue;let o=N&&(!I(e.fromId)||!I(e.toId))||!a&&(L(t.node)||L(r.node)),s=A!=null&&(e.fromId===A||e.toId===A),l=(t.depth+r.depth)/2;!o&&(!B||a)&&ce.push({ax:t.sx,ay:t.sy,bx:r.sx,by:r.sy,kind:e.kind,description:e.description,depth:l});let u=(i?.34:.28)*(.4+.6*l),d=i?u*H:u,f;f=o?.03:B?a?.9:Ge:A==null?d:s?.9:j(e.fromId)&&j(e.toId)?u:.05,n.globalAlpha=f,n.strokeStyle=i?pe:c.tertiary,n.lineWidth=(s||B&&a?2:1)*(.6+.6*l),n.setLineDash(i?[4,4]:[]),n.beginPath(),n.moveTo(t.sx,t.sy),n.lineTo(r.sx,r.sy),n.stroke()}n.setLineDash([]);for(let t of W){let r=U[t],i=r.node,o=i.kind===`concept`?de[(a.get(i.id)??0)%de.length]:ue[i.kind],s=N&&!I(i.id),c=V(i.id),l=s||L(i)&&!c,u=B?c&&!l:!l&&j(i.id),f=i.id===A,p=Ne+(1-Ne)*r.depth,h=B&&!c?p*We:l?p*.08:u?p:p*.18,g=(f?16:i.degree>=Ie?8:4)*r.depth,_=i.updatedAtMs;if(_){let n=d-_,i=Math.max(0,1-n/Re);if(i>0){let a=i*ze;!m&&n<Be&&(a*=.55+.45*Math.sin(e/420+t*1.7)),g+=a*r.depth}}n.shadowColor=o,n.shadowBlur=u?g:0;let v=i.kind===`pending`;n.globalAlpha=h*(v?.3:.55),n.fillStyle=o,n.beginPath(),n.arc(r.sx,r.sy,r.sr,0,Math.PI*2),n.fill(),n.shadowBlur=0,n.globalAlpha=h,n.lineWidth=f?2.5:1.4,n.strokeStyle=o,n.setLineDash(v?[3,3]:[]),n.stroke(),n.setLineDash([])}n.shadowBlur=0,n.textAlign=`center`,n.textBaseline=`top`,n.font=`11px ui-sans-serif, system-ui, sans-serif`;for(let e of W){let t=U[e],r=t.node,i=V(r.id);if(N&&!I(r.id)||L(r)&&!i||!(B?i:N?t.depth>.3:A==null?o.has(r.id)||r.degree>=Ie&&t.depth>.55:j(r.id)))continue;n.globalAlpha=(r.id===A||r.id===z?1:.85)*(.4+.6*t.depth),n.fillStyle=c.content;let a=r.label.length>22?`${r.label.slice(0,21)}…`:r.label;n.fillText(a,t.sx,t.sy+t.sr+3)}n.globalAlpha=1,ee.current=U.map(e=>({id:e.node.id,sx:e.sx,sy:e.sy,sr:e.sr,depth:e.depth,updatedAtMs:e.node.updatedAtMs})),te.current=ce,D=requestAnimationFrame(O)};return D=requestAnimationFrame(O),()=>{cancelAnimationFrame(D),E.disconnect()}},[f,d,y,b,h,v]);let Q=(0,N.useCallback)((e,t)=>{let n=se.current,r=le.current,i=Xe(y,F.current),a=Date.now(),o=null,s=-1;for(let c of ee.current){if(n.active&&!(n.matches?.has(c.id)??!1)||!i(c.id)&&Ye(c.updatedAtMs,r,a))continue;let l=e-c.sx,u=t-c.sy;l*l+u*u<=(c.sr+5)*(c.sr+5)&&c.depth>s&&(o=c.id,s=c.depth)}return o},[y]),Qe=(0,N.useCallback)((e,t)=>{let n=null,r=1/0,i=-1;for(let a of te.current){let o=a.bx-a.ax,s=a.by-a.ay,c=o*o+s*s,l=0;c>0&&(l=((e-a.ax)*o+(t-a.ay)*s)/c,l=Math.max(0,Math.min(1,l)));let u=e-(a.ax+l*o),d=t-(a.ay+l*s),f=Math.sqrt(u*u+d*d);f>5||(f<r||f===r&&a.depth>i)&&(n={kind:a.kind,description:a.description},r=f,i=a.depth)}return n},[]),$e=e=>{let t=s.current.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},et=(0,N.useCallback)(e=>{if(e.button!==0||e.target.closest(`[data-graph-control]`))return;let t=x.current;S.current=null,t.dragging=!0,t.moved=!1,t.lastX=e.clientX,t.lastY=e.clientY,t.lastInteractAt=performance.now(),e.currentTarget.setPointerCapture(e.pointerId)},[]),tt=(0,N.useCallback)(e=>{let t=x.current;if(t.dragging){let n=e.clientX-t.lastX,r=e.clientY-t.lastY;(Math.abs(n)>2||Math.abs(r)>2)&&(t.moved=!0),t.yaw+=n*Ae,t.pitch=Math.max(-je,Math.min(je,t.pitch+r*Ae)),t.lastX=e.clientX,t.lastY=e.clientY,t.lastInteractAt=performance.now(),t.dirty=!0;return}let{x:n,y:r}=$e(e),i=Q(n,r);if(i!==t.hoveredId&&(t.hoveredId=i,t.dirty=!0),i)D(null);else{let e=Qe(n,r);D(e?Je(e):null)}},[Q,Qe]),nt=(0,N.useCallback)(e=>{let t=x.current;if(!t.dragging)return;t.dragging=!1,t.lastInteractAt=performance.now(),t.dirty=!0;let n=e.currentTarget;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),!t.moved){let{x:t,y:n}=$e(e),r=Q(t,n);if(r){let e=d.nodes.find(e=>e.id===r);e&&Z({id:e.id,label:e.label,updatedAtMs:e.updatedAtMs})}else T(null)}},[Q,d.nodes,Z]),rt=(0,N.useCallback)(()=>{let e=x.current;D(null),!(e.dragging||e.hoveredId==null)&&(e.hoveredId=null,e.dirty=!0,T(null))},[]);(0,N.useEffect)(()=>{let e=s.current;if(!e||!f)return;let t=e=>{if(e.target.closest?.(`[data-graph-panel]`))return;e.preventDefault();let t=x.current;t.zoom=Math.max(Pe,Math.min(Fe,t.zoom*(1-e.deltaY/500))),t.lastInteractAt=performance.now(),t.dirty=!0};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[f]);let it=(0,N.useMemo)(()=>{let e=new Set(d.nodes.map(e=>e.kind));return De.filter(t=>e.has(t))},[d.nodes]),at=(0,N.useMemo)(()=>d.edges.some(e=>e.kind===`learned`),[d.edges]),ot=(0,N.useMemo)(()=>d.edges.some(e=>e.kind!==`learned`),[d.edges]);(0,N.useEffect)(()=>{!(ot&&at)&&(!J.link||!J.learned)&&Y({link:!0,learned:!0})},[ot,at,J]);let st=l.data?.kind===`ready`&&!oe,$;if(l.isLoading)$=(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,q.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2`,style:{borderColor:`var(--border-base)`,borderTopColor:`var(--content-tertiary)`}})});else if(l.isError)$=(0,q.jsx)(Ze,{title:`Couldn't load the memory graph`,detail:`Something went wrong fetching your assistant's memory. Try again in a moment.`});else if(l.data?.kind===`unsupported`)$=(0,q.jsx)(Ze,{title:`Memory graph isn't available`,detail:`The active memory backend doesn't expose a concept graph.`});else if(!f)$=(0,q.jsx)(Ze,{title:`No concepts yet`,detail:`As your assistant learns and links ideas, they'll appear here as a living map of its memory.`});else{let e=d.nodes.length,t=d.edges.length,r=new Set(h.values()).size,a=(e,t)=>`${e} ${t}${e===1?``:`s`}`;$=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`canvas`,{ref:c,className:`absolute inset-0 h-full w-full`}),!st&&w==null&&E==null?(0,q.jsxs)(`div`,{"data-graph-control":!0,className:`absolute left-1/2 top-4 -translate-x-1/2 rounded-full px-3 py-1 text-[11px] tabular-nums`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 82%, transparent)`,border:`1px solid var(--border-base)`,color:`var(--content-tertiary)`},children:[a(e,`neuron`),` · `,a(t,`synapse`),` ·`,` `,a(r,`lobe`)]}):null,d.nodes.length>Ke||z?(0,q.jsxs)(`div`,{"data-graph-control":!0,className:`absolute top-4 z-20 ${i?`left-16`:`left-4`}`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-full px-2.5 py-1`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 82%, transparent)`,border:`1px solid var(--border-base)`},children:[(0,q.jsx)(A,{size:14,"aria-hidden":!0,style:{color:`var(--content-tertiary)`}}),(0,q.jsx)(`input`,{type:`text`,value:z,onChange:e=>{let t=e.target.value;t.trim()&&!V.current&&(R(`search`),V.current=!0),B(t)},onKeyDown:e=>{e.key===`Escape`?B(``):e.key===`Enter`&&W.length>0&&(e.preventDefault(),X(W[0].id))},placeholder:`Search concepts…`,"aria-label":`Search concepts`,className:`w-36 bg-transparent text-[12px] outline-none placeholder:text-[var(--content-tertiary)]`,style:{color:`var(--content-default)`}}),z?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`text-[11px] tabular-nums`,style:{color:`var(--content-tertiary)`},children:U?.size??0}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>B(``),"aria-label":`Clear search`,className:`flex items-center`,style:{color:`var(--content-tertiary)`},children:(0,q.jsx)(_,{size:13})})]}):null]}),z&&W.length>0?(0,q.jsx)(`ul`,{className:`mt-1.5 flex max-h-56 w-52 list-none flex-col overflow-y-auto rounded-xl py-1`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 92%, transparent)`,border:`1px solid var(--border-base)`},children:W.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsx)(`button`,{type:`button`,onClick:()=>Z({id:e.id,label:e.label,updatedAtMs:e.updatedAtMs}),className:`block w-full truncate px-3 py-1 text-left text-[12px] hover:bg-[color-mix(in_srgb,var(--content-tertiary)_14%,transparent)]`,style:{color:`var(--content-default)`},children:e.label})},e.id))}):null]}):null,(d.nodes.length>Ke||G!==`all`)&&fe?(0,q.jsx)(`div`,{"data-graph-control":!0,className:`absolute top-14 z-10 ${i?`left-16`:`left-4`}`,children:(0,q.jsx)(Ce,{value:G,onChange:K})}):null,(0,q.jsx)(ye,{nodeKinds:it.filter(e=>e!==`concept`),coloredByTheme:it.includes(`concept`),themes:g,hasLinks:ot,hasLearned:at,...ot&&at?{onToggleLink:()=>Y(e=>({...e,link:!e.link})),onToggleLearned:()=>Y(e=>({...e,learned:!e.learned})),linkActive:J.link,learnedActive:J.learned}:{}}),(w??E)&&!st?(0,q.jsx)(`div`,{className:`pointer-events-none absolute left-1/2 top-4 max-w-[80%] -translate-x-1/2 truncate rounded-full px-3 py-1 text-[12px]`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 82%, transparent)`,border:`1px solid var(--border-base)`,color:`var(--content-default)`},children:w??E}):null,(0,q.jsx)(`div`,{className:`pointer-events-none absolute bottom-4 right-4 text-[11px]`,style:{color:`var(--content-tertiary)`},children:`drag to rotate · scroll to zoom`}),u?.truncated?(0,q.jsxs)(`div`,{className:`pointer-events-none absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full px-3 py-1 text-[11px]`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 82%, transparent)`,border:`1px solid var(--border-base)`,color:`var(--content-tertiary)`},children:[`Showing the `,d.nodes.length,` most-connected concepts`]}):null,(0,q.jsxs)(`div`,{"data-graph-control":!0,className:`absolute right-4 top-4 flex flex-col gap-1`,children:[(0,q.jsx)(n,{variant:`ghost`,iconOnly:(0,q.jsx)(ae,{}),onClick:()=>ge(1.25),"aria-label":`Zoom in`,tooltip:`Zoom in`}),(0,q.jsx)(n,{variant:`ghost`,iconOnly:(0,q.jsx)(re,{}),onClick:()=>ge(.8),"aria-label":`Zoom out`,tooltip:`Zoom out`}),(0,q.jsx)(n,{variant:`ghost`,iconOnly:(0,q.jsx)(ie,{}),onClick:he,"aria-label":`Reset view`,tooltip:`Reset view`})]})]})}return(0,q.jsxs)(`div`,{ref:s,className:`relative select-none overflow-hidden rounded-xl ${t??``}`,style:{backgroundColor:`var(--surface-base)`,backgroundImage:`radial-gradient(circle at center, color-mix(in srgb, var(--content-tertiary) 8%, transparent), transparent 62%)`,touchAction:`none`,cursor:f?`grab`:`default`},onPointerDown:f?et:void 0,onPointerMove:f?tt:void 0,onPointerUp:f?nt:void 0,onPointerCancel:f?nt:void 0,onPointerLeave:f?rt:void 0,children:[i?(0,q.jsx)(`div`,{className:`absolute left-4 top-4 z-10`,"data-graph-control":!0,children:(0,q.jsx)(n,{variant:`ghost`,iconOnly:r?(0,q.jsx)(m,{}):(0,q.jsx)(p,{}),onClick:i,"aria-label":r?`Exit fullscreen`:`Enter fullscreen`,tooltip:r?`Exit fullscreen`:`Enter fullscreen`})}):null,st?(0,q.jsx)(ve,{onDismiss:L}):null,$,f&&j?(0,q.jsx)(_e,{assistantId:e,node:j,trail:O,neighbors:Te,onTravel:we,onCrumb:Se,onClose:be,onOpenThread:o}):null]})}async function $e(e,t){let{data:n}=await ne({path:{assistant_id:e},body:{content:t},throwOnError:!0});return n}function et({open:e,onOpenChange:t,assistantId:r}){let a=i(),[o,s]=(0,N.useState)(``),[l,u]=(0,N.useState)(!1),d=(0,N.useCallback)(async()=>{let e=o.trim();if(e){u(!0);try{let n=await $e(r,e);if(!n.success){x.error(n.message||`Couldn't save that memory.`);return}x.success(`Got it — it's on your map while I file it away.`),s(``),t(!1),await Promise.all([a.invalidateQueries({queryKey:I(r).queryKey}),a.invalidateQueries({queryKey:M(r).queryKey})])}catch(e){let t=e instanceof Error?e.message:`Failed to create memory.`;x.error(t)}finally{u(!1)}}},[r,o,t,a]);return(0,q.jsx)(b.Root,{open:e,onOpenChange:t,children:(0,q.jsxs)(b.Content,{size:`sm`,children:[(0,q.jsx)(b.Header,{children:(0,q.jsx)(b.Title,{children:`New memory`})}),(0,q.jsx)(b.Body,{children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,q.jsx)(y,{label:`What should I remember?`,placeholder:`e.g. I prefer concise, bulleted summaries.`,value:o,onChange:e=>s(e.target.value),disabled:l,rows:3,fullWidth:!0}),(0,q.jsx)(c,{as:`p`,variant:`body-medium-lighter`,className:`text-(--content-secondary)`,children:`It lands on the map right away, then settles into a concept as it's filed.`})]})}),(0,q.jsxs)(b.Footer,{children:[(0,q.jsx)(b.Close,{asChild:!0,children:(0,q.jsx)(n,{variant:`outlined`,disabled:l,children:`Cancel`})}),(0,q.jsx)(n,{variant:`primary`,onClick:d,disabled:l||!o.trim(),leftIcon:l?(0,q.jsx)(f,{className:`animate-spin`}):void 0,children:l?`Creating…`:`Create memory`})]})]})})}function tt({onOpenThread:e}){let t=k(),[r,i]=(0,N.useState)(!1),o=a(I(t)),s=a(M(t)),c=o.data?.kind===`ready`&&s.data?.kind===`ready`,l=(0,N.useRef)(!1);return(0,N.useEffect)(()=>{l.current||(l.current=!0,R(`opened`))},[]),(0,q.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[(0,q.jsx)(Qe,{assistantId:t,className:`h-full w-full`,onOpenThread:e}),c?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(n,{variant:`primary`,size:`compact`,leftIcon:(0,q.jsx)(h,{}),onClick:()=>i(!0),className:`absolute right-16 top-4 z-10`,children:`Create memory`}),(0,q.jsx)(et,{open:r,onOpenChange:i,assistantId:t})]}):null]})}function nt(){let e=r();return(0,q.jsx)(tt,{onOpenThread:t=>{R(`chat_from_node`),O(e,{prompt:t})}},k())}export{nt as MemoryPageRoute};
@@ -1 +0,0 @@
1
- import{n as e}from"./toast-Be8FEQ-I.js";function t(t){return n=>{e.error(n instanceof Error?n.message:t)}}export{t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{u as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./arrow-left-C2re-gYj.js";import{t as l}from"./circle-check-DqvTjWle.js";import{B as u,C as d,S as f,a as p,c as m,d as h,f as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,x as T,y as E,z as D}from"./tier-upgrade-resize-modal-BTi56abH.js";import{t as ee}from"./hard-drive-DVmyHlZR.js";import{t as te}from"./loader-circle-Ck8fq3yv.js";import{i as O}from"./resize-errors-ORrW5M6r.js";import{t as k}from"./sliders-horizontal-MqeLCMh3.js";import{t as A}from"./tag-B6WeUtBW.js";import{t as j}from"./modal-BtcwNEBj.js";import{n as M}from"./toast-Be8FEQ-I.js";import{t as N}from"./dropdown-BxYrCXBS.js";import{t as ne}from"./is-electron-y5bNUVyG.js";import{u as P}from"./routes-D4ff4ONd.js";import{t as F}from"./use-is-org-ready-CoKP2L8w.js";import{t as re}from"./browser-CUpmd8oz.js";import{Gi as I,Ii as L,Ji as ie,Ki as ae,Li as oe,Os as R,Ri as z,Vi as se,Wi as B,_t as V,co as ce,lo as le,qi as H,uo as ue,zi as U}from"./index-D5iUyXUl.js";var W=e(t(),1),G=s(),K=`__none__`;function q(e){return(0,G.jsxs)(`span`,{className:`text-[12px] font-medium text-[var(--content-disabled)]`,children:[`+`,f(e)]})}function de({open:e,proPlan:t,pending:r,currentStorageGib:i,initialSelection:a,onClose:o,onContinue:s}){let[c,d]=(0,W.useState)(``),[p,m]=(0,W.useState)(``),[h,g]=(0,W.useState)(``);(0,W.useEffect)(()=>{if(!e){d(``),m(``),g(``);return}a&&(d(a.machineTier??``),m(a.storageTier),g(a.creditTier??K))},[e,a]);let _=t.machine_tiers,v=(0,W.useMemo)(()=>t.storage_tiers.filter(e=>!e.legacy),[t.storage_tiers]),y=t.credit_tiers??[],b=_.map(e=>({value:e.tier,label:e.description,icon:(0,G.jsx)(u,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:q(e.price_cents),disabled:E(e)})),x=v.map(e=>({value:e.tier,label:e.label,icon:(0,G.jsx)(ee,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:q(e.price_cents),disabled:E(e)||i!=null&&e.storage_gib<i})),S=[{value:K,label:`No extra credits`,icon:(0,G.jsx)(R,{className:`h-4 w-4`,"aria-hidden":!0})},...y.map(e=>({value:e.tier,label:e.label,icon:(0,G.jsx)(R,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:q(e.price_cents)}))],C=_.find(e=>e.tier===c)??null,w=v.find(e=>e.tier===p)??null,D=h&&h!==K?y.find(e=>e.tier===h)??null:null,te=C!=null&&w!=null&&h!==``,O=t.base_price_cents+(C?.price_cents??0)+(w?.price_cents??0)+(D?.price_cents??0),A=[`Pro base plan — ${f(t.base_price_cents)}`,C?.description,w?`${w.storage_gib} GB storage`:null,h===K?`No extra credits`:D?`${T(D.credits_usd*100)} of bundled credits`:null].filter(e=>e!=null);return(0,G.jsx)(j.Root,{open:e,onOpenChange:e=>{e||o()},children:(0,G.jsx)(j.Content,{size:`lg`,"data-theme":`light`,hideCloseButton:!0,overlayClassName:`backdrop-blur-[2px]`,className:`max-w-[820px] md:min-h-[min(608px,calc(100vh-4rem))]`,children:(0,G.jsx)(j.Body,{className:`p-6`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-8 md:flex-row md:gap-12`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-8 md:w-[440px] md:shrink-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--surface-active)] p-[14px]`,children:(0,G.jsx)(k,{className:`h-6 w-6 text-[var(--content-emphasised)]`,"aria-hidden":!0})}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,G.jsx)(j.Title,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Create a custom plan`}),(0,G.jsx)(j.Description,{className:`mt-0 text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:`Just better.`})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Select a machine size:`}),(0,G.jsx)(N,{"aria-label":`Machine size`,placeholder:`Select a machine size`,value:c,onChange:d,options:b})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Select storage:`}),(0,G.jsx)(N,{"aria-label":`Storage`,placeholder:`Select storage`,value:p,onChange:m,options:x})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Bundle some credits:`}),(0,G.jsx)(N,{"aria-label":`Credit bundle`,placeholder:`Select a credit bundle`,value:h,onChange:g,options:S})]})]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5 md:pt-[3px]`,children:[(0,G.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Recap`}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:f(O)}),(0,G.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Total`})]}),(0,G.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Your selection:`}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-2`,children:A.map(e=>(0,G.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`text-[14px] font-medium leading-[18px] text-[var(--content-secondary)]`,children:e})]},e))}),(0,G.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:!te||r,onClick:()=>{!C||!w||h===``||r||s({machineTier:C.tier,storageTier:w.tier,creditTier:h===K?null:h})},children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,fullWidth:!0,disabled:r,onClick:o,children:`Cancel`})]})]})})})})}function fe({className:e,onConfigure:t,configureDisabled:r}){return(0,G.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-8 ${e??``}`,children:[(0,G.jsx)(`p`,{className:`text-center text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Need something more tailored to your needs?`}),(0,G.jsxs)(`div`,{className:`flex w-[840px] max-w-full flex-col items-start gap-4 rounded-2xl bg-[var(--surface-lift)] p-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,G.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--content-disabled)] p-[14px]`,children:(0,G.jsx)(k,{className:`h-6 w-6 text-[var(--aux-white)]`,"aria-hidden":!0})}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Custom Plan`}),(0,G.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-tertiary)]`,children:`Select custom CPU power, Ram and Storage. Or just throw in some tokens.`})]})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Billed monthly`}),(0,G.jsx)(n,{variant:`outlined`,onClick:t,disabled:r,children:`Configure`})]})]})]})}function pe({tierKey:e,name:t,tagline:r,priceLabel:i,priceCaption:a,ctaLabel:o,features:s,mostPopular:c=!1,tone:u=`dark`,isCurrent:d,intent:f=`upgrade`,pending:p,onCta:m}){return(0,G.jsxs)(`div`,{"data-theme":u,className:`flex w-full flex-col gap-4 rounded-2xl bg-[var(--surface-lift)] p-4`,children:[(0,G.jsx)(S,{tier:e,size:50}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-[20px] font-medium text-[var(--content-emphasised)]`,children:t}),c?(0,G.jsx)(A,{className:`bg-[var(--feed-digest-weak)] text-[12px] font-semibold uppercase text-[var(--credits-accent)]`,children:`Most Popular`}):null]}),(0,G.jsx)(`p`,{className:`h-9 overflow-hidden text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:r})]}),(0,G.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:i}),(0,G.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:a})]}),(0,G.jsx)(n,{variant:f===`downgrade`&&!d?`outlined`:`primary`,fullWidth:!0,disabled:d||p,onClick:m,children:d?`Current Plan`:o}),(0,G.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Includes:`}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-2`,children:s.map(e=>(0,G.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-secondary)]`,children:e})]},e))})]})]})}function me({enabled:e=!0}={}){let t=i(),n=F(),r=e&&n,s=a({...ae(),enabled:r}).data,c=s!=null&&s.plan_id!==`base`,l=a({...B(),enabled:r&&c}),u=a({...L(),enabled:r&&c}).data?.plans.find(e=>e.id===`pro`)?.machine_tiers??[],d=e=>u.find(t=>t.tier===e)?.price_cents??null,f=o(U()),p=o(se()),m=o(z()),h={machineTier:l.data?.max_machine_tier??null,storageTier:l.data?.selected_storage_tier??null,storageGib:l.data?.selected_storage_gib??null,creditTier:s?.selected_credit_tier??null},_=s!=null&&s.plan_id!==`base`&&s.status!=null&&g.has(s.status)&&s.cancel_at_period_end!==!0&&!s.cancel_at,v=!c||!l.isPending,y=f.isPending||p.isPending||m.isPending,b=()=>Promise.all([t.invalidateQueries({queryKey:H()}),t.invalidateQueries({queryKey:I()}),t.invalidateQueries({queryKey:oe()})]);return{changeTiers:async e=>{let t=e.machineTier!==h.machineTier,n=e.storageTier!==h.storageTier,r=e.creditTier!==h.creditTier,i=d(e.machineTier),a=d(h.machineTier),o=t&&i!=null&&a!=null&&i<a,s=[];if(t&&s.push(new Promise(t=>{f.mutate({body:{machine_tier:e.machineTier}},{onSuccess:()=>t({dimension:`machine`,ok:!0}),onError:e=>t({dimension:`machine`,ok:!1,error:e})})})),n&&s.push(new Promise(t=>{p.mutate({body:{storage_tier:e.storageTier}},{onSuccess:()=>t({dimension:`storage`,ok:!0}),onError:e=>t({dimension:`storage`,ok:!1,error:e})})})),r&&s.push(new Promise(t=>{m.mutate({body:{credit_tier:e.creditTier}},{onSuccess:()=>t({dimension:`credit`,ok:!0}),onError:e=>t({dimension:`credit`,ok:!1,error:e})})})),s.length===0)return{needsResize:!1};let c=await Promise.all(s);await b();let l=c.some(e=>e.ok&&e.dimension===`machine`)&&!o,u=c.some(e=>e.ok&&e.dimension===`storage`),g=l||u,_=c.filter(e=>!e.ok);if(_.length>0){let e=_.map(e=>x(e.error,`Failed to update ${e.dimension} tier.`)).join(` `);return M.error(e),g?{needsResize:!0}:null}return{needsResize:g}},isPending:y,current:h,eligible:_,currentReady:v}}var he=`#0A0A0B`,ge=`https://www.vellum.ai/docs/pricing`;V();var _e=[`Small Computer`,`4 GB Storage`,`Pay-as-you-go credits`];function ve(e){return`${T(e)}/month`}function J(e){let t=e.machine_size;return`${t?O[t]??t:`Small`} Computer`}function ye(e,t){let n=e.credits_usd??0;return[J(e),`${e.storage_gib} GB Storage`,`${T(n*100)} in credits per month`,...t]}function Y(){let e=r(),t=i(),s=ne(),l=ue({platformHostedOnly:!0}),u=ce(),f=le(),g=l===`full`&&u,S=l===`full`&&f,T=a({...ae(),enabled:g}),E=a({...L(),enabled:g}),ee=o(ie()),{changePackage:O,isPending:k}=m(),{changeTiers:A,isPending:j,current:N,eligible:F,currentReady:I}=me({enabled:g});y();let[R,z]=(0,W.useState)(!1),[se,B]=(0,W.useState)(!1),[V,U]=(0,W.useState)(null),[K,q]=(0,W.useState)(!1),J=T.data,Y=E.data?.plans.find(e=>e.id===`pro`),X=Y?.packages??[],be=X.length>0,Z=J?.plan_id===`pro`,xe=(0,W.useMemo)(()=>!Z||N.storageTier==null?null:{machineTier:N.machineTier,storageTier:N.storageTier,creditTier:N.creditTier},[Z,N.machineTier,N.storageTier,N.creditTier]),Se=(0,W.useMemo)(()=>{if(!Z||!Y)return!1;let e=N.machineTier==null||Y.machine_tiers.some(e=>e.tier===N.machineTier),t=Y.storage_tiers.some(e=>!e.legacy&&e.tier===N.storageTier),n=N.creditTier==null||(Y.credit_tiers??[]).some(e=>e.tier===N.creditTier);return e&&t&&n},[Z,Y,N.machineTier,N.storageTier,N.creditTier]),Ce=!g&&!S,we=g&&!E.isLoading&&!be,Q=Ce||T.isError||we;(0,W.useEffect)(()=>{Q&&e(P.settings.usageBilling,{replace:!0})},[Q,e]);let Te=()=>{(window.history.state?.idx??0)>0?e(-1):e(P.settings.usageBilling)},Ee=async e=>{z(!0);try{let n=await ee.mutateAsync({body:{...e,return_target:d()}});n.status===`redirect`&&n.checkout_url?(D(e.package?{kind:`package`,packageKey:e.package}:{kind:`custom`,machineTier:e.machine_tier??null,storageTier:e.storage_tier??null,creditTier:e.credit_tier??null}),re(n.checkout_url)):(await t.invalidateQueries({queryKey:H()}),await t.invalidateQueries({queryKey:oe()}))}catch(e){M.error(x(e,`Failed to start the upgrade checkout. Please try again.`))}finally{z(!1)}},$;if(J&&Y&&be){let t=J.plan_id===`base`?`free`:J.package?.key??null,n=n=>{if(Z){if(n===`free`){e(`${P.settings.usage}?tab=billing&adjust_plan`);return}let r=X.find(e=>e.key===n);if(!r||h(t,r.key)===`current`)return;if(!v(J)){e(`${P.settings.usage}?tab=billing&adjust_plan`);return}U(r);return}n!==`free`&&Ee({target_plan_id:`pro`,package:n,confirm:!0})},r=async()=>{if(!V)return;let e=V,n=h(t,e.key),r=await O(e.key);if(r){if(U(null),r.status===`no_op`){M.success(`You're already on this plan.`);return}n===`downgrade`?M.success(`Downgraded to ${e.name}.`):q(!0)}},i=V?h(t,V.key):`upgrade`,a=e=>Ee({target_plan_id:`pro`,confirm:!0,machine_tier:e.machineTier,storage_tier:e.storageTier,credit_tier:e.creditTier}),o=async e=>{let t=await A(e);t&&(B(!1),t.needsResize?q(!0):M.success(`Plan updated.`))},s=()=>{if(Z){if(F&&!I)return;if(F&&Se){B(!0);return}e(`${P.settings.usage}?tab=billing&adjust_plan`);return}B(!0)},c=[...X].sort((e,t)=>_.indexOf(e.key)-_.indexOf(t.key)),l=C(`free`),u=h(t,`free`);$=(0,G.jsxs)(`div`,{className:`my-auto flex w-full flex-col items-center`,children:[(0,G.jsxs)(`header`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,G.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:{fontFamily:`var(--font-serif)`,fontSize:`60px`,fontWeight:400,lineHeight:1.2,letterSpacing:`1.2px`},children:`Plans designed to empower you`}),(0,G.jsx)(`p`,{className:`text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Start free. Upgrade when you actually need more.`})]}),(0,G.jsxs)(`div`,{className:`mt-10 grid w-full max-w-[1312px] grid-cols-1 items-start gap-6 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,G.jsx)(pe,{tierKey:`free`,name:`Free`,tagline:l?.tagline??``,priceLabel:`$0/month`,priceCaption:l?.priceCaption??`Forever`,ctaLabel:u===`downgrade`?b(`Free`):l?.cta??`Start Free`,features:_e,tone:`dark`,isCurrent:t===`free`,intent:u,pending:R||k,onCta:()=>n(`free`)}),c.map(e=>{let r=C(e.key),i=h(t,e.key);return(0,G.jsx)(pe,{tierKey:e.key,name:e.name,tagline:r?.tagline??``,priceLabel:ve(e.total_price_cents),priceCaption:r?.priceCaption??`Billed monthly`,ctaLabel:i===`downgrade`?b(e.name):r?.cta??e.name,features:ye(e,r?.extraFeatures??[]),mostPopular:r?.mostPopular,tone:r?.mostPopular?`light`:`dark`,isCurrent:t===e.key,intent:i,pending:R||k,onCta:()=>n(e.key)},e.key)})]}),(0,G.jsx)(fe,{className:`mt-10`,onConfigure:s,configureDisabled:Z&&F&&!I}),(0,G.jsx)(de,{open:se,proPlan:Y,pending:R||j,currentStorageGib:Z?N.storageGib:null,initialSelection:xe,onClose:()=>B(!1),onContinue:e=>{Z?o(e):a(e)}}),(0,G.jsx)(p,{open:V!==null,relation:i===`downgrade`?`downgrade`:`upgrade`,packageName:V?.name??``,pending:k,onCancel:()=>U(null),onConfirm:()=>void r()}),(0,G.jsx)(w,{open:K,onClose:()=>q(!1)}),(0,G.jsxs)(`p`,{className:`mt-10 text-center text-[12px] font-medium text-[var(--content-tertiary)]`,children:[`You can cancel or change your plan anytime you want. To learn more`,` `,(0,G.jsx)(`a`,{href:ge,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--content-default)] underline`,children:`Read our Docs.`})]})]})}else $=(0,G.jsx)(`div`,{className:`my-auto flex items-center justify-center`,children:(0,G.jsx)(te,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading plans`})});return(0,G.jsxs)(`div`,{"data-theme":`dark`,className:`plans-takeover-canvas-enter relative h-full w-full overflow-y-auto`,style:{backgroundColor:he},children:[(0,G.jsx)(`div`,{className:`absolute left-8 z-10 [-webkit-app-region:no-drag]`,style:{top:s?`3rem`:`2rem`},children:(0,G.jsx)(n,{variant:`outlined`,leftIcon:(0,G.jsx)(c,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:Te,className:`[-webkit-app-region:no-drag]`,children:`Back`})}),(0,G.jsx)(`div`,{className:`plans-takeover-content-enter flex min-h-full flex-col items-center px-6 pb-8`,style:{paddingTop:s?`5rem`:`4rem`},children:$})]})}export{Y as PlansPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-DXp9L4iB.js";import{t as o}from"./react-DJZBPgpf.js";import{P as s,t as c,z as l}from"./button-BQVYX8n_.js";import{n as u}from"./QueryClientProvider-DKhXIxGb.js";import{t as d}from"./useQuery-B45lW1Kk.js";import{t as f}from"./useMutation-Lj4VunQV.js";import{t as p}from"./jsx-runtime-CVSDxk6A.js";import{t as m}from"./card-D8zyWtZh.js";import{t as h}from"./chevron-down-DpYf9Gwq.js";import{r as g}from"./panel-item-An-BBeyL.js";import{t as _}from"./loader-circle-Ck8fq3yv.js";import{t as v}from"./pencil-CsnkG5VN.js";import{t as y}from"./shield-check-C3mmA0Pk.js";import{t as b}from"./x-CswtfvgS.js";import{t as x}from"./notice-DkAWz47A.js";import{t as S}from"./tag-B6WeUtBW.js";import{t as C}from"./input-ZpyYt_a0.js";import{t as w}from"./toggle-QSEiPr3k.js";import{n as T}from"./toast-Be8FEQ-I.js";import{t as E}from"./confirm-dialog-Zyfei9GV.js";import{t as D}from"./dropdown-BxYrCXBS.js";import{n as O,p as k,r as A}from"./auth-store-yYPy4QuG.js";import{t as j}from"./sdk.gen-BCFkwLHb.js";import{c as ee,i as te,m as ne,n as re,o as M,r as ie,s as ae,t as oe}from"./native-biometric-DG8Pfu_V.js";import{l as se,u as ce}from"./routes-D4ff4ONd.js";import{d as le,f as ue}from"./prefs-CzauL-hH.js";import{Br as de,F as N,H as fe,I as pe,J as P,L as me,P as F,Vr as he,at as I,co as L,cr as R,lo as ge,lr as _e,nr as ve,ot as z,st as ye,uo as B,ur as be,zo as V}from"./index-D5iUyXUl.js";import{t as H}from"./detail-card-BXVPDa5J.js";import{t as U}from"./setting-row-BL-mNsNh.js";import{t as xe}from"./settings-divider-jsYVGphg.js";var W=e(o(),1),G=p(),K=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],Se=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function Ce(){let[e,t]=(0,W.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function we(){let[e,r]=(0,W.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,W.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||ve(0)}]}function Te({row:e,onToggle:t}){return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(w,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:s(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,G.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,G.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Ee(){return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function De({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=be(),{pendingKind:o,run:s}=Ce(),[c,l]=we(),u=(0,W.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of K){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,W.useMemo)(()=>{let e=K.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=Se.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await R(e.sourceKind):await _e(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,G.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,G.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,G.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,G.jsx)(Ee,{}),`Checking permissions...`]}):(0,G.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,G.jsx)(Te,{row:e,onToggle:p},e.id))}),r&&(0,G.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Oe(){let e=B({platformHostedOnly:!0}),t=L(),n=ge(),r=u(),{data:i,isLoading:a,isError:o}=d({...de(),enabled:e===`full`&&t}),s=f({mutationFn:async e=>{let{data:t}=await j({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{he(r,void 0,e),T.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{T.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,l=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,G.jsxs)(G.Fragment,{children:[(s.isPending||c)&&(0,G.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,G.jsx)(w,{checked:l,disabled:p,onChange:()=>s.mutate(!l)})]})})]}),e===`disabled`&&(0,G.jsx)(fe,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function ke(){let e=ne(),[t,n]=(0,W.useState)(()=>te()),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(`Face ID`),[s,c]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{e&&(ie().then(i),re().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)M(!1),await oe(),n(!1);else{let e=ee();e&&await ae(e),M(!0),n(!0)}}finally{c(!1)}};return(0,G.jsx)(H,{title:`Security`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,G.jsx)(w,{checked:t,onChange:()=>void l(),disabled:s})]})})}var q=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function Ae(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...q]}function je(){return n(`mediaEmbedsEnabled`,!0)}function Me(){let e=i(`mediaEmbedDomains`,``);return e?Ae(e):[...q]}function Ne(){let[e,n]=(0,W.useState)(()=>je()),[i,a]=(0,W.useState)(()=>Me()),[o,s]=(0,W.useState)(!1),[l,u]=(0,W.useState)(``),d=(0,W.useMemo)(()=>l.trim().toLowerCase(),[l]),f=e=>{n(e),t(`mediaEmbedsEnabled`,e)},p=e=>{a(e),r(`mediaEmbedDomains`,JSON.stringify(e))},m=()=>{if(d){if(i.includes(d)){u(``);return}p([...i,d]),u(``)}},_=e=>{p(i.filter(t=>t!==e))},v=()=>{p([...q])},y=i.length===q.length&&i.every((e,t)=>e===q[t]);return(0,G.jsxs)(H,{title:`Media Embeds`,subtitle:`Automatically embed images, videos, and other media shared in chat messages.`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Auto Media Embeds`}),(0,G.jsx)(w,{checked:e,onChange:f})]}),e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`mt-4`,children:(0,G.jsx)(xe,{})}),(0,G.jsxs)(c,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,G.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0}):(0,G.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0}),`Video Domain Allowlist`]}),(0,G.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[i.length,` domain`,i.length===1?``:`s`]})]}),o&&(0,G.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsx)(C,{label:`Add Domain`,type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),m())},placeholder:`Add domain (e.g. example.com)`,fullWidth:!0,wrapperClassName:`flex-1`}),(0,G.jsx)(c,{variant:`primary`,size:`compact`,onClick:m,disabled:!d,children:`Add`})]}),i.length>0&&(0,G.jsx)(`div`,{className:`flex justify-end`,children:(0,G.jsx)(c,{type:`button`,variant:`ghost`,size:`compact`,onClick:v,disabled:y,tintColor:`var(--content-tertiary)`,children:`Reset to Defaults`})}),i.length>0&&(0,G.jsx)(`ul`,{className:`space-y-2`,children:i.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] px-3 py-2 text-body-medium-lighter`,children:[(0,G.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:e}),(0,G.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,G.jsx)(V,{}),onClick:()=>_(e),"aria-label":`Remove ${e}`})]},e))})]})]})]})}function J(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=F.map(e=>({value:e.id,label:e.label,icon:(0,G.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Pe(){let e=P(),t=u(),{data:n,isError:r}=d({queryKey:[`thresholds`,e],queryFn:()=>pe(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[o,s]=(0,W.useState)(`conservative`),[c,l]=(0,W.useState)(`strict`),[f,p]=(0,W.useState)(!1),_=(0,W.useRef)(!1),[v,y]=(0,W.useState)(!1),b=(0,W.useRef)(null),x=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||_.current||(a(N(n.interactive).id),s(N(n.autonomous).id),l(N(n.headless).id),y(!0))},[n]),(0,W.useEffect)(()=>()=>{b.current!==null&&(clearTimeout(b.current),b.current=null,x.current?.(),x.current=null)},[]);let S=(0,W.useCallback)((n,r,i)=>{if(!e||!v)return;let a=F.find(e=>e.id===n)?.riskThreshold,o=F.find(e=>e.id===r)?.riskThreshold,s=F.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||me(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,v,t]),C=(0,W.useCallback)((e,t,n)=>{b.current!==null&&clearTimeout(b.current),x.current=()=>S(e,t,n),b.current=setTimeout(()=>{x.current?.(),b.current=null,x.current=null},500)},[S]),w=(0,W.useCallback)(e=>{_.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,W.useCallback)(e=>{_.current=!0,s(e),C(i,e,c)},[i,c,C]),E=(0,W.useCallback)(e=>{_.current=!0,l(e),C(i,o,e)},[i,o,C]),O=F.find(e=>e.id===i),k=F.find(e=>e.id===o),A=F.find(e=>e.id===c),j=!e||!v;return(0,G.jsxs)(m,{children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:i,onChange:w,options:Y,disabled:j})}),O&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,G.jsx)(h,{className:`h-4 w-4`}):(0,G.jsx)(g,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,G.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:o,onChange:T,options:Y,disabled:j})}),k&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:c,onChange:E,options:Y,disabled:j})}),A&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:A.description})]})]})]})]})]})}var X=e(l(),1),Fe=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Ie=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Z({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(t.tool),[s,c]=(0,W.useState)(t.pattern),[l,u]=(0,W.useState)(t.risk),[d,f]=(0,W.useState)(t.description??``),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,W.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await ye(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,X.createPortal)((0,G.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,W.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(b,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,G.jsx)(x,{tone:`error`,children:h}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(D,{value:a,onChange:o,disabled:!0,options:Fe.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(C,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,G.jsx)(`div`,{className:`mt-2 flex gap-2`,children:Ie.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,G.jsx)(C,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function Le(e){return e.origin===`default`&&!e.userModified}function Re(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function ze(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Be({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(!1),g=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([z(e),z(e,{origin:`default`})]);return Re(t,n)}return z(e)},[e]),_=(0,W.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,W.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[g,m]);let b=(0,W.useCallback)(async()=>{if(f)try{await I(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,X.createPortal)((0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,W.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(w,{checked:m,onChange:h,label:`Show all defaults`}),(0,G.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(x,{tone:`error`,children:s})}),a?(0,G.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,G.jsx)(y,{className:`h-8 w-8`}),(0,G.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,G.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=Le(e);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,G.jsx)(S,{tone:ze(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,G.jsx)(S,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(S,{tone:`warning`,children:`Modified`})]}),(0,G.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(v,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(V,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,G.jsx)(Z,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,G.jsx)(E,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void b(),onCancel:()=>p(null)})]}),document.body)}function Ve(){let e=P(),[t,n]=(0,W.useState)(!1);return(0,G.jsxs)(m,{children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(y,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,G.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,G.jsx)(Be,{assistantId:e,onClose:()=>n(!1)})]})}var He=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Ue=`thirtyDays`;function $(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function We(){let e=B({platformHostedOnly:!0}),t=A(),n=t,a=O.use.user()?.id??null,[o]=le(),[s]=ue(),c=o??!0,l=s??!0,[u,d]=(0,W.useState)(()=>i(`llmLogRetention`,Ue));return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(ke,{}),(0,G.jsx)(De,{}),(0,G.jsx)(Ve,{}),(0,G.jsx)(Pe,{}),(0,G.jsx)(Ne,{}),(0,G.jsx)(H,{title:`Privacy`,subtitle:t?(0,G.jsxs)(G.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,G.jsx)(`a`,{href:se(ce.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(U,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:c,onChange:()=>{k(`share_analytics`,!c,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{}),(0,G.jsx)(U,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{k(`share_diagnostics`,!l,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{})]}),(0,G.jsx)(Oe,{}),e!==`gated`&&(0,G.jsx)($,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:u,onChange:e=>{d(e),r(`llmLogRetention`,e)},options:He})}),(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{We as PrivacyPage};
@@ -1,43 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-anSemq95.js";import{t as n}from"./react-DJZBPgpf.js";import{P as r,t as i}from"./button-BQVYX8n_.js";import{m as a,u as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./arrow-left-C2re-gYj.js";import{t as d}from"./loader-circle-Ck8fq3yv.js";import{t as f}from"./pencil-CsnkG5VN.js";import{t as p}from"./plus-DZZypDUF.js";import{t as m}from"./x-CswtfvgS.js";import{t as h}from"./tag-B6WeUtBW.js";import{t as g}from"./input-ZpyYt_a0.js";import{i as _,r as v,t as y}from"./dist-Cul7ysiV.js";import{n as b}from"./toast-Be8FEQ-I.js";import{n as x,t as S}from"./create-selectors-8NePGNlX.js";import{ct as C,f as w,o as T,y as E}from"./local-mode-Dydd46cS.js";import{Gn as D,Or as O,Tr as k,V as A,Wn as j,bn as M,tt as N,xn as P}from"./sdk.gen-BR-xXIZm.js";import{r as ee}from"./api-errors-CoE1wFl2.js";import{A as F,B as te,L as I,R as ne,n as re,z as ie}from"./auth-store-yYPy4QuG.js";import{a as L,o as R,r as ae}from"./api-DkdVwOxT.js";import{u as oe}from"./routes-D4ff4ONd.js";import{n as se}from"./platform-detection-BBQ3eUv5.js";import{a as ce}from"./feature-flag-catalog-XCUDf5iL.js";import{o as le,s as ue}from"./prechat-mDxOfWth.js";import{t as de}from"./browser-timezone-2SnmKDjM.js";import{c as fe}from"./conversation-list-fetchers-DKtnmlFF.js";import{i as pe,n as me,r as he,t as ge}from"./research-onboarding-persistence-C4LT0Ekr.js";import{A as _e,B as ve,C as ye,D as be,E as xe,F as Se,I as Ce,L as we,M as Te,N as Ee,O as De,P as Oe,R as ke,S as z,T as Ae,V as B,a as je,d as V,f as Me,g as Ne,i as Pe,j as Fe,k as Ie,m as Le,o as H,p as Re,r as ze,s as Be,t as U,v as Ve,w as He,x as W,y as Ue}from"./proxy-BzlH_XAe.js";import{t as We}from"./AnimatePresence-C8APSgIu.js";import{t as G}from"./use-reduced-motion-CcGT6CHV.js";import{t as K}from"./animated-avatar-D36iTfMF.js";import{Da as Ge,Ea as Ke,En as qe,Es as Je,Fn as Ye,Fo as Xe,Ia as Ze,Kn as Qe,Nn as $e,On as et,Rr as tt,Tn as nt,Ws as q,Yo as rt,_n as it,_t as at,gn as ot,kn as st,sn as ct,vn as lt,vt as J,yn as ut}from"./index-D5iUyXUl.js";import{c as dt,i as ft,l as pt,n as mt,r as ht,s as gt,t as _t}from"./latest-assistant-text-BKts4hYK.js";import{n as vt,t as yt}from"./onboarding-step-layout-2XcmxqFN.js";import{n as bt}from"./plugin-attribution-6W3_ulYk.js";var xt=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function St(e,t){return Te(e)?e[xt(0,e.length,t)]:e}var Ct=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 wt(this.animations,`duration`)}get iterationDuration(){return wt(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 wt(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 Ct{then(e,t){return this.finished.finally(e).then(()=>{})}};function Et(...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=xe(i,a,o);return t?s(r):s}function Dt(e,t){return e in t}var Ot=class extends Be{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Dt(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 Me()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},Y=e(n(),1);function kt(e){let t=B(()=>z(e)),{isStatic:n}=(0,Y.useContext)(ze);if(n){let[,n]=(0,Y.useState)(e);(0,Y.useEffect)(()=>t.on(`change`,n),[])}return t}function At(e,t){let n=kt(t()),r=()=>n.set(t());return r(),ve(()=>{let t=()=>Fe.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),_e(r)}}),n}function jt(e){W.current=[],e();let t=At(W.current,e);return W.current=void 0,t}function Mt(e,t,n,r){if(typeof e==`function`)return jt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return Pt(e,t,n,r);let i=typeof t==`function`?t:Et(t,n,r),a=Array.isArray(e)?Nt(e,i):Nt([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 Nt(e,t){let n=B(()=>[]);return At(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function Pt(e,t,n,r){let i=B(()=>Object.keys(n)),a=B(()=>({}));for(let o of i)a[o]=Mt(e,t,n[o],r);return a}function Ft(e){return typeof e==`object`&&!Array.isArray(e)}function It(e,t,n,r){return e==null?[]:typeof e==`string`&&Ft(t)?Ne(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Lt(e,t,n){return e*(t+1)+n*t}function Rt(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 zt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(ke(e,i),r--)}}function Bt(e,t,n,r,i,a){zt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Ie(i,a,r[o]),easing:St(n,o)})}function Vt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Ht(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Ut=`easeInOut`,Wt=20;function Gt(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,Rt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Rt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Jt(e),{delay:l=0,times:u=He(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=ye(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Zt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=Oe(b));let r=De(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&&Ae(u,T),c.length===1&&c.unshift(null),m&&we(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=Lt(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`?Ee(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`:St(f,e-1))}Vt(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(Ue(p)){let e=Kt(p,s);_(m,h,qt(`default`,e))}else{let e=It(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Kt(r,s);for(let e in m)_(m[e],Yt(h,e),qt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Ht);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(Se(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Ut)),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 Kt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function qt(e,t){return t[e]||(t[e]=[]),t[e]}function Jt(e){return Array.isArray(e)?e:[e]}function Yt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Xt=e=>typeof e==`number`,Zt=e=>e.every(Xt);function Qt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Le(e)&&!Re(e)?new je(t):new H(t);n.mount(e),V.set(e,n)}function $t(e){let t=new Ot({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),V.set(e,t)}function en(e,t){return Ue(e)||typeof e==`number`||typeof e==`string`&&!Ft(t)}function tn(e,t,n,r){let i=[];if(en(e,t))i.push(Pe(e,Ft(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=It(e,t,r),o=a.length;Ce(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Qt:$t;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(...Ve(c,{...t,transition:l},{}))}}return i}function nn(e,t,n){let r=[];return Gt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=z(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:be}).forEach(({keyframes:e,transition:t},n)=>{r.push(...tn(n,e,t))}),r}function rn(e){return Array.isArray(e)&&e.some(Array.isArray)}function an(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),rn(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=nn(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=tn(e,i,{...c,...r},t)}let l=new Tt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{ke(t.animations,l)})),l}return i}var on=an(),sn=`grounded`,cn=12;function ln(e,t){let n=e.slice(0,cn).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 un({firstName:e,lastName:t,occupation:n,hobbies:r,timezone:i},a=[],{includeSuggestions:o=!0}={}){let s=[e.trim(),t.trim()].filter(Boolean).join(` `),c=n.trim(),l=(r??[]).map(e=>e.trim()).filter(Boolean).join(`, `),u=i?.trim()??``,d=ln(a,o),f=d?`"plugins": ["<exact name from the list above>"], `:``,p=[s?`My name is ${s}.`:``,c?`I work as ${c}.`:``,l?`My hobby is ${l}.`:``].filter(Boolean).join(` `),m=p?[p,u?`My timezone is ${u}.`:``].filter(Boolean).join(` `):`I'd like you to get to know me before we start working together.`,h=o?` "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." } ]`:``,g=`{ ${f}"claims": [ { "claim": "Senior engineer at an AI infra startup", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user", "https://example-infra.com/about"] }, { "claim": "Based in Boulder, CO", "confidence": "maybe", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Into climbing and the outdoors", "confidence": "guessing", "sources": [] } ]${h?`,${h}`:``} }`;return`${m}
8
-
9
- Get to know me. Search the web for what's publicly known about me, 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. Prefer sources people author about themselves — LinkedIn, a personal site, GitHub, an employer's team page, published work, public social profiles. Never fetch or cite people-search or background-check aggregators (Instant Checkmate, Spokeo, BeenVerified, TruePeopleSearch, Whitepages, and similar); data-broker directories (ZoomInfo, RocketReach, Apollo) may corroborate another source but must never be a claim's only basis.
10
-
11
- IDENTITY GATE — decide who a page is about before you use it: a name match alone is NEVER enough to attribute a page to me. Attribute it to me only when it also corroborates something I stated — my role, my hobby, or a location consistent with my timezone if I gave one. If several people share my name and none clears that bar, or you find no verifiable match at all, then I have no public profile you can use: return ONLY inferences from what I stated above, each labeled "guessing" with "sources": []. An honest near-empty card beats a stranger's biography. If my details above read as placeholder or joke input rather than a real identity, skip the web search and return an empty claims array.
12
-
13
- 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 ${o?`claims and suggestions`:`claims`} aligned with my stated role.
14
-
15
- 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:
16
-
17
- ${g}
18
-
19
- Rules for "claims":
20
-
21
- AT MOST 5 claims, typically 3 to 4. Never pad the list or inflate a confidence tier to seem thorough.
22
- 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".
23
- Each claim must be independently true-or-false so I can remove the ones that are wrong.
24
- Every specific in a claim (employer, title, publication, city) must appear in a source you actually fetched this turn — never synthesize or embellish specifics a source doesn't state.
25
- "confidence" is earned per the identity gate: "confident" needs 2+ independent gate-passing sources, "maybe" needs exactly one, and a claim with no sources is an inference from my stated details and must be "guessing".
26
- "sources": 0 to 3 URLs you actually used as evidence for that specific claim. Use [] for pure inferences.
27
- ${o?`Rules for "suggestions":
28
-
29
- Each suggestion is an object with two fields:
30
- "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.
31
- "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.
32
-
33
- 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.
34
- 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."
35
- 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.
36
- 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.
37
- `:``}${d}
38
- ${o?`Don't include anything sensitive or private. If the identity gate leaves you with very little, return only the honest "guessing" claims my stated details support, and lean on broadly useful suggestions for my role.`:`Don't include anything sensitive or private. If the identity gate leaves you with very little, return only the honest "guessing" claims my stated details support.`}
39
- 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.`}function dn({hostingParam:e,localMode:t,gatewayAuthSession:n}){return t?e===null?n:e!==`vellum-cloud`:!1}var fn=3e3,pn=3e5,mn=`Failed to start your assistant. Please try again.`,hn=`Your assistant is taking longer than expected. Please try again.`,gn=e=>new Promise(t=>setTimeout(t,e));function _n({adoptExisting:e=!1,adoptAssistantId:n}={}){let[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),l=(0,Y.useRef)(!1),u=(0,Y.useRef)([]),d=(0,Y.useRef)(null),f=(0,Y.useCallback)(e=>{if(!d.current){d.current={kind:`ready`,id:e},i(!0);for(let t of u.current)t.resolve(e);u.current=[]}},[]),p=(0,Y.useCallback)(e=>{if(d.current)return;d.current={kind:`error`,message:e},c(e);let t=Error(e);for(let e of u.current)e.reject(t);u.current=[]},[]);return{start:(0,Y.useCallback)(()=>{if(l.current)return;l.current=!0;let r=Date.now(),i=()=>Date.now()-r>=pn;(async()=>{if(e&&n){let e=T(n);if(e){o(e.assistantId),f(e.assistantId);return}}let r=e?n:void 0;if(!e)try{let e=await R();if(e.ok)r=e.data.id,o(e.data.id);else{if(ne(e.status,e.error)){p(I);return}if(!te(e.status)){p(ee(e.error,void 0,mn));return}}}catch(e){t(e,{context:`research_background_hatch`})}let a;for(;!a;){if(i()){p(hn);return}try{let e=await ae(r);r&&!e.ok&&e.status===404&&(r=void 0,e=await ae());let t=ie(e);if(t.kind===`active`&&e.ok){a=e.data.id,o(a);break}if(t.kind===`error`){p(t.message);return}}catch(e){t(e,{context:`research_background_hatch_poll`})}await gn(fn)}if(e)for(;!await E();){if(i()){p(hn);return}await gn(fn)}else for(;;){try{if((await L(a)).ok)break}catch{}if(i()){p(hn);return}await gn(fn)}f(a)})()},[p,f,e,n]),ready:r,assistantId:a,error:s,awaitReady:(0,Y.useCallback)(()=>{let e=d.current;return e?.kind===`ready`?Promise.resolve(e.id):e?.kind===`error`?Promise.reject(Error(e.message)):new Promise((e,t)=>{u.current.push({resolve:e,reject:t})})},[])}}async function vn(e,n){try{await A({path:{assistant_id:e,id:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_archive`})}}var yn=[`admin-copilot`],bn=[{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 xn(e){return` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()} `}function Sn(e,t){return e.includes(` ${t} `)}function Cn(e){let t=xn(e),n=[];for(let{plugin:e,keywords:r}of bn)r.some(e=>Sn(t,e))&&n.push(e);return n}function wn(e,t){let n=[...yn,...bt(),...Cn(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 Tn=1500,En=12e4,Dn=2;function On({complete:e,stableReads:t}){return e&&t>=Dn}function kn({sawCompletePayload:e}){return e?`done`:`error`}function An({sawCompletePayload:e}){return e}var jn=`vellum-ai`,Mn=new Set([`simple-memory`,`level-up`]);function Nn(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 Fn(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)===jn&&(Mn.has(e)||(n.add(e),t.push({name:e,description:Nn(i)})))}return{capabilities:t,validNames:n}}async function In(e){try{return Fn((await D({path:{assistant_id:e},throwOnError:!1})).data?.matches??[])}catch(e){return t(e,{context:`research_onboarding_catalog`}),{capabilities:[],validNames:new Set}}}async function Ln(e,n){try{await j({path:{assistant_id:e},body:{name:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_install`})}}var Rn=32;function zn(e,t){return e.filter(e=>e.confidence===t).length}async function Bn({assistantId:e,conversationId:n,status:r,subject:i,claims:a,suggestions:o,plugins:s,installedPlugins:c}){try{await k({path:{assistant_id:e},body:{type:`onboarding_research`,...r===`done`?{daemon_event_id:`onboarding_research:${n}`}:{},fields:{conversation_id:n,status:r,self_reported_occupation:i.occupation,self_reported_hobbies:(i.hobbies??[]).slice(0,Rn),self_reported_timezone:i.timezone,claims:a,claim_count:a.length,claims_confident:zn(a,`confident`),claims_maybe:zn(a,`maybe`),claims_guessing:zn(a,`guessing`),suggestions:o,suggestion_count:o.length,plugins:s,installed_plugins:c}},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_telemetry`})}}var Vn=e=>new Promise(t=>setTimeout(t,e));function Hn({role:e,validNames:t,modelPlugins:n}){return[...new Set([...wn(e,t),...n.filter(e=>t.has(e))])]}function Un(){let[e,n]=(0,Y.useState)({status:`idle`,claims:[],droppedClaims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),r=(0,Y.useRef)(0),i=(0,Y.useRef)(null),a=(0,Y.useRef)(new Map),o=(0,Y.useRef)(Promise.resolve()),c=s(),l=(0,Y.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:[],droppedClaims:[],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 In(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=wn(s.occupation,p);for(let e of v)_.has(e)||_.set(e,Ln(t,e));v.length>0&&n(e=>({...e,installedPlugins:v}));let y=async e=>{let n={conversationId:e,content:un(s,c,{includeSuggestions:f}),sourceChannel:`vellum`,interface:`web`,clientOs:se(),clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(n.clientTimezone=e)}catch{}return!!(await P({path:{assistant_id:t},body:n,throwOnError:!1})).response?.ok},b=async()=>{let e=await N({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 M({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 S=Date.now()+En,C=``,w=0,T=!1,E=[],D=[],O=[],k=v;for(;Date.now()<S;){if(await Vn(Tn),h())return;let e=await M({path:{assistant_id:t},query:{conversationId:x},throwOnError:!1});if(h())return;let r=_t(e.data?.messages??[]);if(r){let{claims:e,droppedClaims:i,suggestions:a,plugins:c,pluginsResolved:l,complete:u}=lt(r),d=c.filter(e=>p.has(e));for(let e of d)_.has(e)||_.set(e,Ln(t,e));l&&g();let f=Hn({role:s.occupation,validNames:p,modelPlugins:d});if(n({status:`running`,claims:e,droppedClaims:i,suggestions:a,installedPlugins:f,pluginCatalog:m}),E=e,D=a,O=c,k=f,u&&(o=!0),u&&!T&&(T=!0,Bn({assistantId:t,conversationId:x,status:`done`,subject:s,claims:e,suggestions:a,plugins:c,installedPlugins:f})),w=r===C?w+1:0,C=r,On({complete:u,stableReads:w}))break}}if(h())return;T||(T=!0,Bn({assistantId:t,conversationId:x,status:`error`,subject:s,claims:E,suggestions:D,plugins:O,installedPlugins:k})),n(e=>({...e,status:kn({sawCompletePayload:o})}))}catch(e){if(h())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}finally{g(),An({sawCompletePayload:o})&&r&&i&&(await vn(r,i),Ge(c,r))}})()},[c]),u=(0,Y.useCallback)(async()=>{await o.current,await Promise.all([...a.current.values()])},[]),d=(0,Y.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 Ln(await t(),r)}catch{}})())}},[]);return{...e,start:l,awaitPluginInstalls:u,hydrate:d}}function Wn({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(`
40
- `)}async function Gn({assistantId:e,conversationId:n,removedClaims:r,rejectedAll:i}){let a=Wn({removedClaims:r,rejectedAll:i});if(a){try{let t={conversationId:n,content:a,sourceChannel:`vellum`,interface:`web`,clientOs:se(),clientMessageId:crypto.randomUUID()};await P({path:{assistant_id:e},body:t,throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_correction`})}await vn(e,n)}}var Kn=1500,qn=12e4,Jn=e=>new Promise(t=>setTimeout(t,e));async function Yn({awaitAssistantId:e,values:n,userName:r,assistantName:i}){let a,o;try{a=await e();let t=await N({path:{assistant_id:a},body:{conversationType:`standard`,title:`Updating personality`},throwOnError:!1});if(o=t.data?.id,!t.response?.ok||!o)return;let s={conversationId:o,content:dt(n,r,i),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};if(!(await P({path:{assistant_id:a},body:s,throwOnError:!1})).response?.ok)return;await gt(a,ft(n));let c=Date.now()+qn,l=``,u=0,d=!1;for(;Date.now()<c;){await Jn(Kn);let e=await M({path:{assistant_id:a},query:{conversationId:o},throwOnError:!1}),t=_t(e.data?.messages??[]);if(t&&(u=t===l?u+1:0,l=t),e.data?.processing===!0&&(d=!0),pt({processing:e.data?.processing,sawProcessing:d,hasReply:t.length>0,stableReads:u}))break}}catch(e){t(e,{context:`research_onboarding_personality`})}finally{if(a&&o)try{await A({path:{assistant_id:a,id:o},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_personality_archive`})}}}function Xn(e){let t=e?.trim();return`You're about to begin your first conversation.${t?`\nYour name is ${t} — introduce yourself as ${t}.`:``}
41
- Respond with a warm and engaging greeting. Be interesting, be real. This is your chance to get to know and impress the user.
42
- End with exactly one short question about something specific you already know about them (see your Onboarding Context) — a question they can answer in five words or less. If you know almost nothing about them yet, ask one specific, concrete question anyway (still five-word-answerable). Never ask what they want to do, what you're getting into, or anything else open-ended: an open question hands a stranger a blank page.
43
- 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 Zn(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 X=l(),Qn=(0,Y.createContext)(null);function $n({size:e,children:t}){return(0,X.jsx)(Qn.Provider,{value:e,children:t})}function er(){let e=(0,Y.useContext)(Qn),[t,n]=(0,Y.useState)(()=>ht());return(0,Y.useEffect)(()=>{if(e)return;let t=()=>n(ht());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var tr={x:.5,y:.43},nr=[-8,6,9,0,7,-6,5,0,-7,4,-5,6];function rr(e){return nr[e%nr.length]??0}var ir=[1,0,1,0,1,0,1,0,1,0,0],ar=[.72,1],or=[.4,1],sr=[10,20],cr=50,lr={6:1.1};function ur(e){return(ar[ir[e]??1]??1)*(lr[e]??1)}function dr(e){return or[ir[e]??1]??1}function fr(e){return sr[ir[e]??1]??20}function pr(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function mr(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function hr(e,t,n){let r=n*.4,i=n*.48;return[{x:i,y:i},{x:e*.3,y:r-t*.03},{x:e*.72,y:r-t*.1},{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*.28,y:t-r+t*.05},{x:e*.77,y:t-r}]}function gr(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 _r({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=er(),u=G(),d=c<640,f=new Set([4,7,8,9,10]),p=e=>d&&f.has(e),m=pr(c,l),h=m/2,g=m/2,_=mr(c,l)/m,v=mr(c,l),y=(0,Y.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),b=tr.x*c,x=tr.y*l,S=b-h,C=x-h,w=(0,Y.useMemo)(()=>hr(c,l,g),[c,l,g]);return(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0 overflow-hidden`,children:[(0,X.jsx)(`div`,{className:`absolute rounded-[50%] bg-[var(--aux-black,#000)] opacity-20 blur-md`,style:{width:v*.62,height:16,left:b-v*.31,top:x+v*.4}}),t.map((t,r)=>{let d=r===n,f=!u&&i?.char===r,g=!u&&a?.char===r;if(f){let n=w[i.fromSlot],a=gr(n,b,x,c,l),s=ur(i.fromSlot),u=dr(i.fromSlot);return(0,X.jsx)(U.div,{className:`absolute left-0 top-0`,style:{width:m,height:m,zIndex:cr},initial:!1,animate:{x:[n.x-h,a.x-h,a.x-h,S,S,S],y:[n.y-h,a.y-h,a.y-h,C,C,C],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,X.jsx)(K,{components:e,traits:t,size:m})},r)}if(g){if(p(a.toSlot))return null;let n=w[a.toSlot],i=gr(n,b,x,c,l),o=ur(a.toSlot),s=dr(a.toSlot);return(0,X.jsx)(U.div,{className:`absolute left-0 top-0`,style:{width:m,height:m,zIndex:fr(a.toSlot)},initial:!1,animate:{x:[S,S,i.x-h,i.x-h,n.x-h,n.x-h],y:[C,C,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,X.jsx)(`div`,{style:{transform:`rotate(${rr(a.toSlot)}deg)`},children:(0,X.jsx)(K,{components:e,traits:t,size:m,breathe:!1})})},r)}let v=y.get(r)??0;if(!d&&p(v))return null;let T=d?{x:b,y:x}:w[v];return(0,X.jsx)(U.div,{className:`absolute left-0 top-0 ${d?``:`pointer-events-auto cursor-pointer`}`,style:{width:m,height:m,zIndex:d?cr:fr(v)},initial:!1,animate:{x:T.x-h,y:T.y-h,scale:d?_:ur(v),opacity:d?1:dr(v)},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:d?void 0:()=>s(r),children:(0,X.jsx)(`div`,{style:{transform:d?void 0:`rotate(${rr(y.get(r)??0)}deg)`},children:(0,X.jsx)(K,{components:e,traits:t,size:m,breathe:d})})},r)})]})}var vr=[{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`}],Z=S(x((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:vr,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 yr(){let[e,t]=(0,Y.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,Y.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function br(){let e=J(),t=Z.use.characters(),n=Z.use.ensureGenerated(),r=G(),{w:i,h:a}=yr();(0,Y.useEffect)(()=>{e&&n(e)},[e,n]);let o=pr(i,a),s=(0,Y.useMemo)(()=>hr(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,X.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=nr[i%nr.length]??0,d=o*ur(i),f=dr(i),p=fr(i);return(0,X.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,X.jsx)(`div`,{style:{opacity:f,transform:`rotate(${u}deg)`},children:(0,X.jsx)(K,{components:e,traits:t,size:d,breathe:!1})})},n)})})}var xr=r(`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)]`),Sr=r(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`,yt);function Q(e){return e.trim().toLowerCase()}function Cr(e,t,n=[],r=8){let i=Q(t),a=new Set(n.map(Q)),o=[];for(let t of e)if(!a.has(Q(t))&&((i.length===0||Q(t).includes(i))&&o.push(t),o.length>=r))break;return o}function wr({id:e,options:t,highlighted:n,showAddHint:i,onPick:a,onHover:o}){return(0,X.jsxs)(`ul`,{id:e,role:`listbox`,className:r(`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,i)=>(0,X.jsx)(`li`,{id:`${e}-opt-${i}`,role:`option`,"aria-selected":i===n,onMouseDown:e=>{e.preventDefault(),a(t.value)},onMouseEnter:()=>o(i),className:r(`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5`,`text-body-medium-lighter text-[var(--content-default)]`,i===n?`bg-[var(--surface-base)]`:`bg-transparent`),children:t.isAdd?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(p,{size:15,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Add “`,t.value,`”`]}),(0,X.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)),i&&(0,X.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 Tr({htmlFor:e,required:t,children:n}){return(0,X.jsxs)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:[n,t?(0,X.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`}):null]})}function Er(e,t){(0,Y.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function Dr({label:e,placeholder:t,values:n,onChange:i,suggestions:a}){let o=(0,Y.useId)(),s=`tac-${o}`,c=`tac-list-${o}`,l=(0,Y.useRef)(null),[u,d]=(0,Y.useState)(``),[f,p]=(0,Y.useState)(!1),[m,g]=(0,Y.useState)(-1),_=(0,Y.useMemo)(()=>Cr(a,u,n),[a,u,n]),v=u.trim(),y=(0,Y.useMemo)(()=>{if(!v)return!1;let e=Q(v);return!(n.some(t=>Q(t)===e)||_.some(t=>Q(t)===e))},[v,n,_]),b=(0,Y.useMemo)(()=>{let e=_.map(e=>({value:e,isAdd:!1}));return y?[...e,{value:v,isAdd:!0}]:e},[_,y,v]);Er(l,()=>p(!1)),(0,Y.useEffect)(()=>{g(e=>e>=b.length?b.length-1:e)},[b.length]);let x=f&&b.length>0,S=!y;function C(e){let t=e.trim();t&&(n.some(e=>Q(e)===Q(t))||i([...n,t]),d(``),g(-1))}function w(e){i(n.filter(t=>t!==e))}function T(e){e.key===`ArrowDown`?(e.preventDefault(),p(!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&&m>=0?(e.preventDefault(),C(b[m].value)):u.trim()&&(e.preventDefault(),C(u)):e.key===`,`?(e.preventDefault(),C(u)):e.key===`Backspace`&&u.length===0&&n.length>0?w(n[n.length-1]):e.key===`Escape`&&p(!1)}return(0,X.jsxs)(`div`,{ref:l,className:`relative flex flex-col gap-1.5`,children:[(0,X.jsx)(Tr,{htmlFor:s,children:e}),(0,X.jsxs)(`div`,{className:r(xr,`min-h-9 flex-wrap py-1.5`),children:[(0,X.jsx)(rt,{size:16,"aria-hidden":!0,className:`shrink-0 self-center text-[var(--content-tertiary)]`}),n.map(e=>(0,X.jsx)(h,{onRemove:()=>w(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,X.jsx)(`input`,{id:s,role:`combobox`,"aria-expanded":x,"aria-controls":c,"aria-autocomplete":`list`,"aria-activedescendant":m>=0?`${c}-opt-${m}`:void 0,autoComplete:`off`,className:r(Sr,`h-6 w-24`),placeholder:n.length===0?t:``,value:u,onChange:e=>{d(e.target.value),p(!0)},onFocus:()=>p(!0),onKeyDown:T})]}),x&&(0,X.jsx)(wr,{id:c,options:b,highlighted:m,showAddHint:S,onPick:C,onHover:g})]})}var Or=`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 kr(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function Ar({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[r,a]=(0,Y.useState)(e),[o,s]=(0,Y.useState)(t),[c,l]=(0,Y.useState)(``),[u,d]=(0,Y.useState)([]),f=r.trim().length>0&&c.trim().length>0;function p(){f&&n({firstName:r,lastName:o,role:c,hobbies:u})}return(0,X.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,X.jsxs)(ot,{showCreatureFooter:!1,children:[(0,X.jsx)(br,{}),(0,X.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(),p()},children:[(0,X.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:kr(.05),children:`Let's start with you.`}),(0,X.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:kr(.12),children:`A few details so I can get to know you.`}),(0,X.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,X.jsx)(`div`,{style:kr(.2,40),children:(0,X.jsx)(g,{label:(0,X.jsxs)(X.Fragment,{children:[`What should I call you?`,(0,X.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`})]}),placeholder:`Your name`,value:r,onChange:e=>a(e.target.value),className:yt,autoFocus:!0,required:!0,fullWidth:!0})}),(0,X.jsx)(`div`,{style:kr(.27,30),children:(0,X.jsx)(g,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),className:yt,fullWidth:!0})}),(0,X.jsx)(`div`,{style:kr(.34,20),children:(0,X.jsx)(g,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:e=>l(e.target.value),className:yt,required:!0,fullWidth:!0})}),(0,X.jsx)(`div`,{style:kr(.41,10),children:(0,X.jsx)(Dr,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:u,onChange:d,suggestions:Or})})]}),(0,X.jsx)(`div`,{className:`mt-10 w-full`,style:kr(.5),children:(0,X.jsx)(i,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,X.jsx)(q,{size:16}),fullWidth:!0,disabled:!f,className:`h-11 text-base`,children:`Continue`})})]})]})})}function jr(){let e=J(),t=Z.use.characters(),n=Z.use.selectedIndex();return(0,Y.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return et(i??`var(--surface-base)`)},[e,t,n])}function $({onBack:e,onNext:t,tone:n}){let r=jr(),i=n?n===`dark`?`#1A1A1A`:`#FFFFFF`:r.fg,a=`color-mix(in srgb, ${i} 10%, transparent)`,o=`color-mix(in srgb, ${i} 18%, transparent)`;return(0,X.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Back`,className:`flex cursor-pointer h-10 w-10 items-center justify-center rounded-full transition-colors duration-150`,style:{color:i,backgroundColor:a},onMouseEnter:e=>e.currentTarget.style.backgroundColor=o,onMouseLeave:e=>e.currentTarget.style.backgroundColor=a,children:(0,X.jsx)(u,{className:`h-4 w-4`})}),t?(0,X.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Forward`,className:`flex cursor-pointer h-10 w-10 items-center justify-center rounded-full transition-colors duration-150`,style:{color:i,backgroundColor:a},onMouseEnter:e=>e.currentTarget.style.backgroundColor=o,onMouseLeave:e=>e.currentTarget.style.backgroundColor=a,children:(0,X.jsx)(q,{className:`h-4 w-4`})}):null]})}async function Mr(e,t){try{let{data:n,error:r,response:i}=await O({path:{assistant_id:e},body:{text:t},parseAs:`blob`,throwOnError:!1});return r||!i?.ok||!n?null:n}catch{return null}}var Nr=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function Pr(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function Fr({onContinue:e,onBack:t,onForward:n,voiceEnabled:r=!1,assistantId:a=null}){let o=J(),s=Z.use.characters(),c=Z.use.ensureGenerated(),l=Z.use.selectedIndex(),p=Z.use.setSelectedIndex();(0,Y.useEffect)(()=>{o&&c(o)},[o,c]);let m=s.length,[h,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(``),[y,x]=(0,Y.useState)(!1),S=(0,Y.useRef)(!1),C=(0,Y.useRef)(null),{ref:w,size:T}=mt(),[E,D]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{m>0&&h===null&&g(Pr(m,l))},[m,l,h]),(0,Y.useEffect)(()=>{h&&p(h.centerChar)},[h,p]);let O=h?.centerChar;(0,Y.useEffect)(()=>{O!=null&&!S.current&&v(Nr[O%Nr.length])},[O]),(0,Y.useEffect)(()=>{y&&(C.current?.focus(),C.current?.select())},[y]);function k(e){if(!h||e===h.centerChar)return;let t=h.edgeOrder.indexOf(e);if(t<0)return;let n=[...h.edgeOrder];n[t]=h.centerChar,D({entering:{char:e,fromSlot:t},exiting:{char:h.centerChar,toSlot:t}}),g({centerChar:e,edgeOrder:n})}let A=()=>h&&k((h.centerChar+1)%m),j=()=>h&&k((h.centerChar-1+m)%m),M=(0,Y.useMemo)(()=>h?s[h.centerChar]:void 0,[h,s]),N=!!o&&!!h&&!!M;function P(){M&&e({traits:M,name:_.trim()})}let[ee,F]=(0,Y.useState)(!1),te=(0,Y.useRef)(null),I=(0,Y.useRef)(null),ne=(0,Y.useRef)(0);function re(){te.current?.pause(),te.current=null,I.current&&=(URL.revokeObjectURL(I.current),null)}(0,Y.useEffect)(()=>()=>{ne.current++,re()},[]);async function ie(){if(!a){b.error(`Your assistant is still warming up — try again in a moment.`);return}re();let e=++ne.current,t=()=>ne.current===e;F(!0);try{let e=_.trim(),n=await Mr(a,e?`Hi! It's ${e}. This is how I sound.`:`Hi there! This is how I sound.`);if(!t())return;if(!n){b.error(`Couldn't play a sample just now — give it another try.`);return}let r=URL.createObjectURL(n);I.current=r;let i=new Audio(r);te.current=i,i.onended=()=>re(),await i.play()}catch{t()&&b.error(`Couldn't play a sample just now — give it another try.`)}finally{t()&&F(!1)}}function L(){S.current=!0,v(e=>{let t=Nr.filter(t=>t!==e),n=t.length>0?t:Nr;return n[Math.floor(Math.random()*n.length)]})}let R=`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,X.jsx)(`div`,{ref:w,"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,X.jsxs)($n,{size:T,children:[N&&(0,X.jsx)(_r,{components:o,characters:s,centerChar:h.centerChar,edgeOrder:h.edgeOrder,entering:E?.entering??null,exiting:E?.exiting??null,onEnterComplete:e=>D(t=>t?.entering.char===e?null:t),onSelectChar:k}),(0,X.jsx)($,{tone:`light`,onBack:t,onNext:n?P:void 0}),(0,X.jsx)(`h1`,{className:`absolute left-1/2 top-[22%] z-10 -translate-x-1/2 whitespace-nowrap text-center text-[2.6rem] leading-none max-md:w-[90vw] max-md:whitespace-normal max-md:text-[2.08rem]`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.4s ease-out both`},children:`Give me a face and a name`}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:j,className:`absolute left-[calc(50%-170px)] top-[43%] -translate-y-1/2 ${R}`,children:(0,X.jsx)(u,{className:`h-4 w-4`})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:A,className:`absolute right-[calc(50%-170px)] top-[43%] -translate-y-1/2 ${R}`,children:(0,X.jsx)(q,{className:`h-4 w-4`})}),(0,X.jsxs)(`div`,{className:`absolute left-1/2 top-[58%] z-10 flex -translate-x-1/2 flex-col items-center gap-10 max-md:top-[54%]`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[y?(0,X.jsx)(`input`,{ref:C,value:_,onChange:e=>{S.current=!0,v(e.target.value)},onBlur:()=>x(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),x(!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,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>x(!0),"aria-label":`Edit name`,className:`flex cursor-pointer items-center gap-2.5`,children:[(0,X.jsx)(`span`,{className:`text-2xl font-medium ${_?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:_||`Name your assistant`}),(0,X.jsx)(f,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,X.jsx)(`button`,{type:`button`,onClick:L,"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,X.jsx)(Je,{className:`h-5 w-5`})})]}),r&&(0,X.jsxs)(`button`,{type:`button`,onClick:ie,disabled:ee,title:`Hear my voice`,"aria-label":`Hear my voice`,className:`flex cursor-pointer items-center gap-2 rounded-full border border-[color-mix(in_srgb,var(--content-default)_22%,transparent)] px-4 py-2 text-sm text-[var(--content-default)] transition-colors duration-150 hover:bg-[color-mix(in_srgb,var(--content-default)_10%,transparent)] disabled:cursor-default disabled:opacity-70`,children:[ee?(0,X.jsx)(d,{className:`h-4 w-4 animate-spin`}):(0,X.jsx)(Xe,{className:`h-4 w-4`}),`Hear my voice`]})]}),(0,X.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,X.jsx)(q,{size:16}),disabled:!N,onClick:P,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})})}function Ir(e){let t=tt(),{data:n}=c({...Ke({path:{assistant_id:e??``}}),enabled:e!==null,...t,retry:1});return n?.flags?.some(e=>ce(e.key)===`voiceMode`&&e.enabled===!0)??!1}var Lr=.25,Rr=.46,zr=.3,Br=.85,Vr=40,Hr=14,Ur=8;function Wr({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0,settleBlink:r=!0}){let i=J(),a=Z.use.characters(),o=Z.use.selectedIndex(),s=G(),{w:c,h:l}=er(),[u,d]=(0,Y.useState)({x:0,y:0});(0,Y.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=st();(0,Y.useEffect)(()=>{n>0&&!s&&p.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,s,p]);let[m,h]=(0,Y.useState)(!1),[g,_]=(0,Y.useState)(!e);(0,Y.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,Y.useMemo)(()=>{if(!i||!v)return null;let e=i.eyeStyles.find(e=>e.id===v.eyeStyle);return e?{paths:e.paths,bbox:qe(e.paths.map(e=>nt(e.svgPath)))}:null},[i,v]);if(!y)return null;let b=c*Br,x=Math.min(Math.min(c,l)*zr,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,C=(c-S)/2,w=l-(1-Lr)*x+l*.05,T=Vr/100*l-(w+x/2),E=(Rr-Lr)*x,D=y.bbox.x+y.bbox.w/2,O=y.bbox.y+y.bbox.h/2;return(0,X.jsx)(U.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,X.jsx)(U.div,{animate:p,children:(0,X.jsx)(`div`,{style:{transform:`translate(${u.x*Hr}px, ${u.y*Ur}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,X.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,X.jsx)(`g`,{style:{transform:m?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${D}px ${O}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,X.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}var Gr=200,Kr=40;function qr({firstName:e,assistantName:t,onContinue:n,onBack:r,onForward:a}){let o=J(),s=Z.use.characters(),c=Z.use.selectedIndex(),l=G(),{ref:u,size:{w:d,h:f}}=mt(),p=jr(),m=s.length>0?s[c]:void 0,h=(0,Y.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,X.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=Gr/v,C=(Kr/100-.5)*f;return(0,X.jsx)(`div`,{ref:u,"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:(0,X.jsxs)($n,{size:{w:d,h:f},children:[(0,X.jsx)(U.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,X.jsx)(U.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,X.jsx)(`path`,{d:h.body.svgPath,fill:h.color})}),(0,X.jsx)(Wr,{entrance:!0}),(0,X.jsx)(U.div,{initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.4,delay:1},children:(0,X.jsx)($,{onBack:r,onNext:a})}),(0,X.jsxs)(`div`,{className:vt,children:[(0,X.jsxs)(U.h1,{className:`text-center leading-[1.15] max-md:leading-[1.25]`,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,X.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fgDeep},children:g}),(0,X.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fg},children:_})]}),(0,X.jsx)(U.div,{initial:l?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.4,delay:1.15},children:(0,X.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,X.jsx)(q,{size:16}),onClick:n,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})})}var Jr=.3,Yr=.85,Xr=.25;function Zr(){let e=J(),t=Z.use.characters(),n=Z.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=er(),o=(0,Y.useMemo)(()=>{if(!e||!r)return null;let t=e.eyeStyles.find(e=>e.id===r.eyeStyle);return t?{paths:t.paths,bbox:qe(t.paths.map(e=>nt(e.svgPath)))}:null},[e,r]),s=o?Math.min(Math.min(i,a)*Jr,i*Yr*o.bbox.h/o.bbox.w):0;return{art:o,eyesW:o?s*o.bbox.w/o.bbox.h:0,eyesH:s,restCy:a-Xr*s,centerX:i/2,w:i,h:a}}function Qr({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=Mt(i,e=>e-n/2),u=e.bbox.x+e.bbox.w/2,d=e.bbox.y+e.bbox.h/2;return(0,X.jsx)(U.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,X.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,X.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,X.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})}var $r={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 ei(e,t){let n=$r[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var ti=new Set([`orange`,`pink`,`red`]);function ni(e,t){return ti.has(e)&&ti.has(t)}function ri(e,t,n){let r=ei(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>ni(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var ii=`You’ve used AI that just answers questions.`,ai=`The more I help,`,oi=`I’m different.`,si=`the better I get,`,ci=`and the less you have to do.`,li=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ui=290;function di({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,X.jsx)(U.div,{className:`relative w-full overflow-hidden`,initial:!1,animate:{height:o?t:e},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:(0,X.jsxs)(U.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,X.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:e},children:(0,X.jsx)(U.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,X.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:t},children:(0,X.jsx)(`span`,{className:`block`,children:i})})]})})}function fi({onContinue:e,onBack:t,onForward:n}){let r=jr(),a=G(),{art:o,eyesW:s,eyesH:c,restCy:l,centerX:u,w:d,h:f}=Zr(),p=J(),m=Z.use.characters(),h=Z.use.selectedIndex(),g=m.length>0?m[h]:void 0,_=f>0&&f<=800,v=_?.17:.22,y=_?`top-[17%]`:`top-[22%]`,b=kt(0),x=kt(1),S=(0,Y.useMemo)(()=>!p||!g?`orange`:ri(g.color,p.colors.map(e=>e.id),1)[0]??`orange`,[p,g]),C=Math.min(220,Math.max(150,d*.16)),w=-C,T=-C*.4,E=kt(-220),D=(0,Y.useMemo)(()=>!p||!g?[]:ri(g.color,p.colors.map(e=>e.id),3),[p,g]),O=Math.max(.42,Math.min(d/1100,1)),k=Math.round(ui*O),A=-k*1.1,j=-k*.42,M=kt(-320),[N,P]=(0,Y.useState)(!!a),[ee,F]=(0,Y.useState)(!!a),[te,I]=(0,Y.useState)(!1),[ne,re]=(0,Y.useState)(!1),[ie,L]=(0,Y.useState)(!1),[R,ae]=(0,Y.useState)(!1),[oe,se]=(0,Y.useState)(!!a),ce=Math.min(d,768)-48,le=(0,Y.useRef)(null),ue=(0,Y.useRef)(null),de=(0,Y.useRef)(null),fe=(0,Y.useRef)(null),pe=(0,Y.useRef)(null),[me,he]=(0,Y.useState)(0),[ge,_e]=(0,Y.useState)(0),[ve,ye]=(0,Y.useState)(0),[be,xe]=(0,Y.useState)(0),[Se,Ce]=(0,Y.useState)(0);return(0,Y.useLayoutEffect)(()=>{le.current?.offsetHeight&&he(le.current.offsetHeight),ue.current?.offsetHeight&&_e(ue.current.offsetHeight),de.current?.offsetHeight&&ye(de.current.offsetHeight),fe.current?.offsetHeight&&xe(fe.current.offsetHeight),pe.current?.offsetHeight&&Ce(pe.current.offsetHeight)},[ce]),(0,Y.useEffect)(()=>{b.set(l),ae(!0)},[l,b]),(0,Y.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{I(!0),re(!0),L(!0)},1400);return()=>clearTimeout(e)},[a]),(0,Y.useEffect)(()=>{if(a||!o)return;b.set(l),x.set(1),E.set(w),M.set(A),P(!1),F(!1),I(!1),re(!1);let e=Math.max(c*.5,f*v-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||(P(!0),await Promise.all([i(on(b,e,{duration:.55,ease:`easeOut`})),i(on(x,.55,{duration:.55,ease:`easeOut`}))]),r)||(F(!0),await Promise.all([i(on(b,l,{type:`spring`,stiffness:210,damping:15})),i(on(x,1,{duration:.45,ease:`easeOut`}))]),r)||(await s(900),r)||(I(!0),re(!0),await i(on(E,[w,T,T,w],{duration:1.5,times:[0,.28,.62,1],ease:[`easeOut`,`easeInOut`,`easeInOut`]})),r)||(await s(150),r))return;L(!0);let t=i(on(M,[A,j,j,A],{duration:1.5,times:[0,.28,.62,1],ease:[`easeOut`,`easeInOut`,`easeInOut`]}));await s(700),!r&&(se(!0),await t)})(),()=>{r=!0,t.forEach(e=>e.stop()),n.forEach(clearTimeout)}},[a,o,f,v,c,l,b,x,E,w,T,M,A,j]),(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:r.fg},children:[(0,X.jsx)($,{onBack:t,onNext:n}),(0,X.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:ce,fontFamily:`var(--font-serif)`},children:[(0,X.jsx)(`span`,{ref:le,className:`block`,children:ii}),(0,X.jsx)(`span`,{ref:ue,className:`block`,children:ai}),(0,X.jsx)(`span`,{ref:de,className:`block`,children:oi}),(0,X.jsx)(`span`,{ref:fe,className:`block`,children:si}),(0,X.jsx)(`span`,{ref:pe,className:`block`,children:ci})]}),R&&o&&(0,X.jsx)(Qr,{art:o,eyesW:s,eyesH:c,centerX:u,eyeCy:b,eyeScale:x,blinking:!1}),!a&&p&&(0,X.jsx)(U.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{left:Math.max(16,d*.05),top:0,y:E,width:C,height:C},children:(0,X.jsx)(K,{components:p,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:S},size:C,breathe:!1})}),!a&&p&&(0,X.jsx)(U.div,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 top-0 z-[1] flex items-start`,style:{right:-Math.round(k*.12),y:M},children:li.map((e,t)=>(0,X.jsx)(`div`,{style:{width:k,height:k,marginLeft:t===0?0:-k*.34,zIndex:li.length-t},children:(0,X.jsx)(K,{components:p,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:D[t]??`teal`},size:k,breathe:!1})},e.bodyShape))}),(0,X.jsxs)(`div`,{className:`${vt.replace(`top-[30%]`,y)} max-w-3xl max-md:top-[34%]`,children:[(0,X.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,X.jsx)(di,{firstH:me,secondH:ge,color:r.fgDeep,firstText:ii,secondText:ai,revealed:N,carouseled:te,revealFrom:`bottom`,revealDuration:.55,reduce:!!a}),(0,X.jsx)(di,{firstH:ve,secondH:be,color:r.fg,firstText:oi,secondText:si,revealed:ee,carouseled:ne,revealFrom:`top`,revealDuration:.45,reduce:!!a}),(0,X.jsx)(U.div,{className:`relative w-full overflow-hidden`,style:{color:r.fg},initial:!1,animate:{height:ie?Se:0},transition:a?{duration:0}:{duration:.5,ease:`easeInOut`},children:Se>0&&(0,X.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:Se},children:(0,X.jsx)(U.span,{className:`block`,initial:!1,animate:{clipPath:ie?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:a?{duration:0}:{duration:.5,ease:`easeOut`},children:ci})})})]}),oe&&(0,X.jsx)(U.div,{initial:a?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:a?{duration:0}:{duration:.4},children:(0,X.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,X.jsx)(q,{size:16}),onClick:e,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})}function pi({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cs-${e}`;return(0,X.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,X.jsxs)(`defs`,{children:[(0,X.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,X.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,X.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,X.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,X.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,X.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,X.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,X.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,X.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,X.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,X.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,X.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,X.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,X.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,X.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,X.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,X.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,X.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,X.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,children:[(0,X.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,X.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,X.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#F4C12A`,children:`$`})]}),(0,X.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,X.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${i})`})]})}function mi({size:e,tiltX:t=0,tiltY:n=0,shadow:r=!0,spinning:i=!1,className:a}){return(0,X.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[r&&(0,X.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,X.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,X.jsxs)(U.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,X.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(0.5px)`},children:(0,X.jsx)(pi,{idSuffix:`front`})}),(0,X.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,X.jsx)(pi,{idSuffix:`back`})})]})})]})}var hi=.3,gi=.95;function _i({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=G(),a=jr(),{h:o}=er(),[s,c]=(0,Y.useState)(!1);function l(){if(!s){if(c(!0),i){e();return}window.setTimeout(t,hi*1e3)}}let u=o*.42,d=-o*.08,f=o*.9;return(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,X.jsx)($,{onBack:n,onNext:r}),(0,X.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,X.jsxs)(`h1`,{className:`text-[2.6rem] leading-[1.1] max-md:max-w-[80vw]`,style:{fontFamily:`var(--font-serif)`},children:[`Here are some free credits`,(0,X.jsx)(`br`,{className:`max-md:hidden`}),` to get started.`]}),(0,X.jsx)(`div`,{className:`mt-10 flex flex-col items-center gap-4`,children:(0,X.jsx)(U.div,{animate:s&&!i?{y:[0,u,d,f],scale:[1,1,1,.2],opacity:[1,1,1,0]}:{},transition:{duration:gi,times:[0,hi/gi,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]},onAnimationComplete:()=>{s&&e()},children:(0,X.jsx)(mi,{size:88,spinning:s&&!i})})}),!s&&(0,X.jsxs)(`button`,{type:`button`,onClick:l,className:`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:{marginTop:Math.round(24+o*.05),backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Claim`,(0,X.jsx)(q,{className:`h-4 w-4`})]})]})]})}at();var vi=640,yi=[{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`}}],bi=[`9%`,`27%`,`45%`,`62%`,`79%`],xi=50,Si=.3*.75,Ci=`rgba(36, 41, 46, 0.2)`,wi=`#FDFDFC`,Ti=.16;function Ei(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 Di(){let[e,t]=(0,Y.useState)(()=>typeof window>`u`?1280:window.innerWidth);return(0,Y.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Oi({components:e,traits:t,side:n,top:r,size:i,progress:a}){let o=Math.max(0,Math.min(1,a)),s=100+Ti*100,c=n===`left`?-100+s*o:100-s*o;return(0,X.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,X.jsx)(K,{components:e,traits:t,size:i,breathe:!1})})}function ki({axis:e,value:t,onValueChange:n,fg:r,disabled:i}){return(0,X.jsxs)(`div`,{className:`flex w-full shrink-0 flex-wrap items-center gap-x-5 gap-y-1.5 sm:flex-nowrap`,style:{opacity:i?.7:1},children:[(0,X.jsx)(`span`,{className:`order-1 flex-1 text-left text-sm sm:w-32 sm:flex-none sm:text-right sm:text-[17px]`,style:{color:r},children:e.left}),(0,X.jsx)(`span`,{className:`order-2 flex-1 text-right text-sm sm:order-3 sm:w-32 sm:flex-none sm:text-left sm:text-[17px]`,style:{color:r},children:e.right}),(0,X.jsxs)(y,{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]??xi),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,X.jsx)(_,{className:`relative h-2 w-full grow rounded-full sm:h-3`,style:{backgroundColor:Ci}}),(0,X.jsx)(v,{className:`block h-5 w-5 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 sm:h-6 sm:w-6`,style:{backgroundColor:wi}})]})]})}function Ai({components:e,values:t,sideAvatars:n,size:r}){return(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10`,children:yi.map((i,a)=>{let o=t[i.id]??xi,s=Math.max(0,(xi-o)/xi),c=Math.max(0,(o-xi)/xi),l=bi[a]??`50%`,u=n[a];return u?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(Oi,{components:e,traits:u.left,side:`left`,top:l,size:r,progress:s}),(0,X.jsx)(Oi,{components:e,traits:u.right,side:`right`,top:l,size:r,progress:c})]},i.id):null})})}function ji({values:e,onValueChange:t,locked:n,onContinue:r,onBack:i,onForward:a}){let o=jr(),s=J(),c=Di(),{w:l,h:u}=er(),d=Math.round(Si*Math.min(l,u))+12,f=c>=vi,p=Z.use.characters()[Z.use.selectedIndex()]?.color,m=Math.round(Math.min(300,Math.max(160,c*.16))),h=(0,Y.useMemo)(()=>{let e=s?.colors.map(e=>e.id)??[],t=Ei(yi.map(e=>e.leftAvatar.color),p,e),n=Ei(yi.map(e=>e.rightAvatar.color),p,e);return yi.map((e,r)=>({left:{...e.leftAvatar,color:t[r]??e.leftAvatar.color},right:{...e.rightAvatar,color:n[r]??e.rightAvatar.color}}))},[s,p]);return(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:o.fg},children:[(0,X.jsx)($,{onBack:i,onNext:a}),f&&s&&(0,X.jsx)(Ai,{components:s,values:e,sideAvatars:h,size:m}),(0,X.jsxs)(`div`,{className:`absolute inset-x-0 top-0 bottom-0 mx-auto flex w-full max-w-2xl flex-col items-center overflow-y-auto px-6`,style:{paddingBottom:d},children:[(0,X.jsx)(`div`,{className:`w-full min-h-14 shrink-[4]`,style:{flexBasis:Math.round(u*.14)}}),(0,X.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-4`,children:[(0,X.jsx)(`h1`,{className:`text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Create my personality`}),n?(0,X.jsx)(`p`,{className:`text-center text-[15px]`,style:{color:o.fgMuted},children:`Personality locked — chat with your assistant to make any more updates`}):null]}),(0,X.jsx)(`div`,{className:`w-full min-h-3 shrink-[2]`,style:{flexBasis:Math.round(40+u*.03)}}),yi.map((r,i)=>(0,X.jsxs)(Y.Fragment,{children:[i>0&&(0,X.jsx)(`div`,{className:`w-full min-h-2.5 shrink basis-8 sm:basis-11`}),(0,X.jsx)(ki,{axis:r,value:e[r.id]??xi,onValueChange:e=>t(r.id,e),fg:o.fg,disabled:n})]},r.id)),(0,X.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-14`}),(0,X.jsxs)(`button`,{type:`button`,onClick:r,className:`flex h-11 w-[234px] shrink-0 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,X.jsx)(q,{className:`h-4 w-4`})]})]})]})}function Mi({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a,missingCalendarScope:o=!1,onRetry:s,hatchError:c=null}){let l=jr(),{handleConnect:u,oauthInProgress:f}=ct({assistantId:e??``,onConnect:n}),p=()=>{s?.(),u()},m=!e||!t,h=m||f;return(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:l.fg},children:[(0,X.jsx)($,{onBack:i,onNext:a}),(0,X.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,X.jsx)(`h1`,{className:`text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:m?`Waking up`:o?`Access not enabled`:`Let me make this easy`}),(0,X.jsx)(`p`,{className:`text-[16px]`,style:{color:l.fgMuted},children:m?`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,X.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-4`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:p,disabled:h,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:m?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(d,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(d,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(!m||c)&&(0,X.jsx)(`button`,{type:`button`,onClick:r,disabled:f,className:`cursor-pointer text-body-small-default transition-opacity hover:opacity-100 disabled:opacity-60`,style:{color:l.fgMuted},children:`Skip for now`})]})]})]})}var Ni=et(`#17191C`);function Pi(){let[e,t]=(0,Y.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,Y.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Fi(){let e=J(),t=Z.use.characters(),n=Z.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function Ii({size:e=64,isAssistantBusy:t=!1}){let{components:n,chosen:r}=Fi();return!n||!r?(0,X.jsx)(`div`,{style:{width:e,height:e}}):(0,X.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,X.jsx)(K,{components:n,traits:r,size:e,isAssistantBusy:t})})}var Li=`pt-[0.7rem] text-[2.6rem] leading-none`,Ri=64,zi=4500,Bi=7e3;function Vi({onDone:e,onBack:t,onForward:n,scheduledTime:r,awaitingTime:i}){let{components:a,chosen:o}=Fi(),s=G(),{w:c,h:l}=Pi(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,Y.useEffect)(()=>{let t=setTimeout(e,i&&!r?Bi:zi);return()=>clearTimeout(t)},[e,i,r]);let d=(0,Y.useRef)(null),[f,p]=(0,Y.useState)(null);(0,Y.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)/Ri,h=f?c/2-f.cx:0,g=f?l*.88-f.cy:0,_=l*.05;return(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,X.jsx)($,{onBack:t,onNext:n,tone:`light`}),(0,X.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,X.jsx)(`div`,{ref:d,className:`relative shrink-0`,style:{width:Ri,height:Ri},children:a&&o&&f&&(0,X.jsx)(U.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,X.jsx)(K,{components:a,traits:o,size:Ri})})}),(0,X.jsx)(U.span,{className:Li,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 Hi=[`Searching the web to get to know you…`,`Reading public profiles…`,`Skimming the highlights…`,`Connecting the dots…`,`Piecing it together…`],Ui=[`Updating my personality…`,`Finding my voice…`,`Getting into character…`],Wi=`Almost there…`,Gi=[...Hi,Wi],Ki=[...Ui,Wi],qi=2800;function Ji({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i}){let a=Ni,[o,s]=(0,Y.useState)(0);return(0,Y.useEffect)(()=>{n?.(o);let t=o>=Gi.length-1;if(i&&t){let t=setTimeout(e,qi);return()=>clearTimeout(t)}let r=setTimeout(()=>s(e=>(e+1)%Gi.length),qi);return()=>clearTimeout(r)},[o,i,e,n]),(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,X.jsx)($,{onBack:t,onNext:r}),(0,X.jsxs)(`div`,{className:`absolute left-1/2 top-1/2 flex w-full max-w-xl -translate-x-1/2 -translate-y-1/2 items-center gap-3 px-6`,children:[(0,X.jsx)(Ii,{isAssistantBusy:!0}),(0,X.jsx)(We,{mode:`wait`,children:(0,X.jsx)(U.p,{className:`${Li} flex min-h-[4.4rem] items-center !pt-0 !text-[2.08rem]`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Gi[o]},o)})]})]})}function Yi({onDone:e,ready:t}){let n=Ni,[r,i]=(0,Y.useState)(0);return(0,Y.useEffect)(()=>{let n=Ki.length-1;if(t){if(r!==n){i(n);return}let t=setTimeout(e,qi);return()=>clearTimeout(t)}let a=setTimeout(()=>i(e=>(e+1)%Ki.length),qi);return()=>clearTimeout(a)},[r,t,e]),(0,X.jsx)(`div`,{className:`absolute inset-0 z-10`,style:{color:n.fg},children:(0,X.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,X.jsx)(Ii,{isAssistantBusy:!0}),(0,X.jsx)(We,{mode:`wait`,children:(0,X.jsx)(U.p,{className:Li,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Ki[r]},r)})]})})}function Xi({claims:e,loading:t,onContinue:n,onRejectAll:r,onBack:i,onForward:a}){let o=Ni,s=G(),[c,l]=(0,Y.useState)(()=>new Set),u=e.filter(e=>!c.has(e.claim)),d=u.length>0,f=!t;return(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,X.jsx)($,{onBack:i,onNext:a}),(0,X.jsxs)(`div`,{className:`absolute bottom-0 left-1/2 top-[11%] sm:top-[8%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6 pb-8`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [scrollbar-width:none]`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(Ii,{}),(0,X.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`This is what I found about you`})]}),(0,X.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,X.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,X.jsx)(We,{children:u.map(e=>(0,X.jsxs)(U.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,X.jsx)(`span`,{children:e.claim}),(0,X.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,X.jsx)(m,{className:`h-4 w-4`})})]},e.claim))})}),d&&f&&(0,X.jsx)(`button`,{type:`button`,onClick:r,className:`mt-5 self-start shrink-0 cursor-pointer text-[14px] underline underline-offset-2 transition-opacity hover:opacity-80`,style:{color:o.fgMuted},children:`This is not me`})]}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>n([...c]),disabled:!f,className:`mt-8 flex cursor-pointer h-11 w-[200px] shrink-0 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,X.jsx)(q,{className:`h-4 w-4`})]})]})]})}var Zi=38,Qi=Zi;function $i({head:e,note:t,flyToNote:n,reduce:r,onLanded:i}){let{components:a,chosen:o}=Fi();if(!a||!o)return null;let s=Zi/2,c=n&&t?t:e,l={x:c.x-s,y:c.y-s};return(0,X.jsx)(U.div,{className:`pointer-events-none absolute left-0 top-0`,style:{width:Zi,height:Zi,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,X.jsx)(K,{components:a,traits:o,size:Zi})})}function ea({installedPlugins:e=[],pluginCatalog:t={},onStart:n,onBack:r,onForward:i,disabled:a=!1}){let o=Ni,s=G(),[c,l]=(0,Y.useState)(!1),{components:u,chosen:d}=Fi(),{h:f}=Pi(),p=e.map(e=>({name:e,displayName:ut(e),description:t[e]?.trim()??``})).filter(e=>e.displayName.length>0),m=p.length>0,h=(0,Y.useRef)(null),g=(0,Y.useRef)(null),_=(0,Y.useRef)(null),[v,y]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)(!1),w=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{w.current=b},[b]),(0,Y.useLayoutEffect)(()=>{let e=h.current,t=g.current;if(!e||!t)return;let n=()=>{if(w.current)return;let n=e.getBoundingClientRect(),r=e=>({x:e.left-n.left+e.width/2,y:e.top-n.top+e.height/2}),i=_.current;y({head:r(t.getBoundingClientRect()),note:i?r(i.getBoundingClientRect()):void 0})};n();let r=new ResizeObserver(n);return r.observe(e),window.addEventListener(`resize`,n),()=>{r.disconnect(),window.removeEventListener(`resize`,n)}},[]);let T=v?.note?.y;return(0,Y.useEffect)(()=>{T===void 0||b||x(!0)},[T,b]),(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,X.jsx)($,{onBack:r,onNext:i}),(0,X.jsxs)(`div`,{ref:h,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,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(U.div,{ref:g,className:`shrink-0`,style:{height:Zi},initial:!1,animate:b?{width:0,marginRight:0}:{width:Zi,marginRight:12},transition:s?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,X.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`You’re all set`})]}),(0,X.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[S&&u&&d?(0,X.jsx)(`div`,{className:`shrink-0`,children:(0,X.jsx)(K,{components:u,traits:d,size:Qi})}):(0,X.jsx)(`div`,{ref:_,className:`shrink-0`,style:{width:Qi,height:Qi}}),(0,X.jsx)(U.p,{className:`text-[15px]`,style:{color:o.fg},initial:!1,animate:{opacity:+!!S,x:S?0:-6},transition:s?{duration:0}:{duration:.35},children:`I’ve set myself up with plugins around who you are.`})]}),m&&(0,X.jsx)(`div`,{className:`flex flex-col gap-3`,style:{marginTop:Math.round(64-f*.02)},children:p.map((e,t)=>(0,X.jsxs)(U.div,{initial:s?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:s?{duration:0}:{duration:.3,delay:t*.06},className:`rounded-2xl px-5 py-4`,style:{backgroundColor:o.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,X.jsx)(`div`,{className:`text-[15px] font-medium`,children:e.displayName}),e.description&&(0,X.jsx)(`div`,{className:`mt-1 text-[13px] leading-snug`,style:{color:o.fgMuted},children:e.description})]},e.name))}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{c||a||(l(!0),Promise.resolve().then(n).catch(()=>l(!1)))},disabled:c||a,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:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[c?`Starting…`:`Let's chat`,!c&&(0,X.jsx)(q,{className:`h-4 w-4`})]}),v&&!S&&(0,X.jsx)($i,{head:v.head,note:v.note,flyToNote:b&&v.note!==void 0,reduce:s,onLanded:()=>C(!0)})]})]})}var ta=[{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})}],na=`#17191C`,ra=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ia=290;function aa({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0,showTopTeam:i=!1,eyesEntrance:a=!1}){let o=J(),s=Z.use.characters(),c=Z.use.selectedIndex(),l=G(),{w:u}=er(),d=Math.max(.42,Math.min(u/1100,1)),f=u<640,p=s.length>0?s[c]:void 0,{bg:m,peekColors:h}=(0,Y.useMemo)(()=>!o||!p?{bg:`var(--surface-base)`,peekColors:[]}:{bg:o.colors.find(e=>e.id===p.color)?.hex??`var(--surface-base)`,peekColors:ri(p.color,o.colors.map(e=>e.id),3)},[o,p]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(U.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?na:m},transition:l?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,X.jsx)(Wr,{bumpNonce:t,settleBlink:a,entrance:a}),i&&o&&(0,X.jsx)(`div`,{className:`pointer-events-none absolute right-0 z-[1] flex items-start`,style:{top:-Math.round(ia*d)*.42,right:-Math.round(ia*d)*.12},children:ra.map((e,t)=>{let n=Math.round(ia*d);return(0,X.jsx)(U.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:ra.length-t},initial:l?!1:{y:-140,opacity:0},animate:{y:0,opacity:1},transition:l?{duration:0}:{type:`spring`,stiffness:200,damping:18,delay:t*.1},children:(0,X.jsx)(K,{components:o,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),o&&(0,X.jsx)(We,{children:(f?ta.filter(e=>e.mobile):ta).slice(0,Math.max(0,e)).map((e,t)=>{let n=Math.round(e.base*d),r=f&&e.mobilePos?e.mobilePos(n):e.pos(n);return(0,X.jsx)(U.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{...r,width:n,height:n},initial:l?!1:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:l?void 0:{scale:0,opacity:0},transition:l?{duration:0}:{type:`spring`,stiffness:220,damping:16,delay:.1},children:(0,X.jsx)(K,{components:o,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}var oa={established:!1,assistantName:null};async function sa(e,n={hasAnyActiveConversation:fe,fetchAssistantIdentity:Ze}){try{if(!await n.hasAnyActiveConversation(e))return oa}catch(e){return t(e,{context:`research_onboarding_established_check`}),oa}let r=await n.fetchAssistantIdentity(e).catch(()=>null);return{established:!0,assistantName:(typeof r?.name==`string`?r.name.trim():``)||null}}function ca({assistantName:e,onKeep:t,onRedo:n,onBack:r}){let a=e?.trim()||``,o=a||`your assistant`,s=a?`${a}'s`:`its`;return(0,X.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-primary)`},children:[(0,X.jsx)($,{onBack:r,tone:`light`}),(0,X.jsxs)(`div`,{className:`${vt} max-w-xl`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,X.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:a?`${a} is already up and running`:`Your assistant is already up and running`}),(0,X.jsxs)(`p`,{className:`text-[15px]`,style:{color:`var(--content-secondary)`},children:[`You two have history — a personality, memories, and past conversations. Running setup again would overwrite who `,o,` is now.`]})]}),(0,X.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,X.jsxs)(i,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:[`Keep `,o,` and start chatting`,(0,X.jsx)(q,{className:`h-4 w-4`})]}),(0,X.jsxs)(i,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:n,className:`h-11 text-base`,children:[`Start over and rebuild `,s,` personality`]})]})]})]})}var la=4e3;function ua(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobbies:e.hobbies,timezone:de()}}function da(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}at();function fa(){let e=o(),t=re.use.user(),n=t?.id??null,r=Qe.use.enterFocus(),i=Qe.use.exitFocus(),s=Qe.use.setPendingAvatarTraits(),c=Qe.use.requestSidebarCollapse(),[l,u]=(0,Y.useState)(`form`),{ref:d,size:f}=mt(),[p,m]=(0,Y.useState)([]),[h,g]=(0,Y.useState)(!1);function _(e){u(e)}function v(e,t=`completed`){Ye($e[l],{userId:n,outcome:t}),m([]),_(e)}function y(e){m(e=>[...e,l]),_(e)}function b(){let e=p[p.length-1];e&&(m(e=>e.slice(0,-1)),_(e))}let x=p.length>0?b:void 0,[S,T]=(0,Y.useState)(null),E=(0,Y.useRef)(null),[D,O]=(0,Y.useState)(null),[k,A]=(0,Y.useState)(null),j=(0,Y.useRef)(!1),[M,N]=(0,Y.useState)(!1),[P,ee]=(0,Y.useState)(null),[te,I]=(0,Y.useState)({}),[ne,ie]=(0,Y.useState)(!1),[L,R]=(0,Y.useState)(null),[ae,se]=(0,Y.useState)(null),[ce,de]=(0,Y.useState)(!1),[fe,_e]=(0,Y.useState)(!1),[ve,ye]=(0,Y.useState)(!1),[be,xe]=(0,Y.useState)(0),[Se,Ce]=(0,Y.useState)(0),[we]=a(),Te=dn({hostingParam:we.get(`hosting`),localMode:w(),gatewayAuthSession:C()}),Ee=we.get(`assistant`)??void 0,De=Te,{start:Oe,ready:ke,assistantId:z,error:Ae,awaitReady:B}=_n({adoptExisting:Te,adoptAssistantId:Ee}),je=Ir(z),V=Un(),{start:Me,hydrate:Ne}=V,Pe=(0,Y.useRef)(Promise.resolve()),Fe=(0,Y.useRef)(!1),[Ie,Le]=(0,Y.useState)(!1),H=(0,Y.useCallback)(e=>{Fe.current=e,Le(e)},[]),[Re,ze]=(0,Y.useState)(null),Be=(0,Y.useRef)(Promise.resolve()),[U,Ve]=(0,Y.useState)(!1),He=V.status===`idle`||V.status===`running`,W=!He&&V.claims.length===0;(0,Y.useEffect)(()=>{i(),s(null),Oe()},[i,s,Oe]),(0,Y.useEffect)(()=>{if(E.current)return;let e=B().then(e=>sa(e)).catch(()=>oa);E.current=e,e.then(O)},[B]);let Ue=(0,Y.useCallback)(()=>Promise.race([E.current??Promise.resolve(null),new Promise(e=>{setTimeout(()=>e(null),la)})]),[]);(0,Y.useLayoutEffect)(()=>{if(h||!n)return;let e=me(n);if(e?.formValues){T(e.formValues),ee(e.faceValues),se(e.checkinTime),_e(e.checkinBooked),ze(e.keptClaims??null),R(e.researchConversationId??null),e.research&&(Ne({...e.research,pluginCatalog:e.research.pluginCatalog??{},droppedClaims:e.research.droppedClaims??[]},B),H(e.droppedClaimsScrubbed??!1),N(!0));let t=he(e);u(De&&(t===`letschat`||t===`meeting`)?`looking`:t),m([])}g(!0)},[h,n,Ne,B,De,H]),(0,Y.useEffect)(()=>{!h||!S||pe(n,{step:l,formValues:S,faceValues:P,checkinTime:ae,checkinBooked:fe,research:V.status===`done`?{status:`done`,claims:V.claims,droppedClaims:V.droppedClaims,suggestions:V.suggestions,installedPlugins:V.installedPlugins,pluginCatalog:V.pluginCatalog}:null,...L?{researchConversationId:L}:{},...Re?{keptClaims:Re}:{},...Ie?{droppedClaimsScrubbed:!0}:{}})},[h,n,l,Re,S,P,ae,fe,L,V.status,V.claims,V.droppedClaims,V.suggestions,V.installedPlugins,V.pluginCatalog,Ie]),(0,Y.useEffect)(()=>{if(!h||!S||V.status!==`idle`&&V.status!==`done`)return;let e=V.status===`idle`,t=S,n=!1;return(async()=>{if(!j.current){let e=await Ue();if(n)return;if(e?.established){A(t),m([]),T(null),u(`existing`),N(!1);return}}N(!1),e&&Me({awaitAssistantId:B,subject:ua(t),conversationTitle:da(t),...L?{resumeConversationId:L}:{},onConversationCreated:R,includeSuggestions:!1})})(),()=>{n=!0,N(!1)}},[h,S,L,V.status,Me,B,!0,Ue]),(0,Y.useEffect)(()=>{l===`results`&&W&&(m([]),u(`suggestions`))},[l,W]),(0,Y.useEffect)(()=>{Fe.current||He||V.droppedClaims.length!==0&&(!L||!z||V.claims.length>0&&l!==`suggestions`||(H(!0),Pe.current=Gn({assistantId:z,conversationId:L,removedClaims:V.droppedClaims,rejectedAll:!1})))},[He,V.claims.length,V.droppedClaims,L,z,l,H]);function We(t,i,a,{skip:o=!1,hidden:l=!1}={}){ge(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;ue({tools:[],tasks:[],tone:sn,...m?{userName:m}:{},...f.trim()?{occupation:f.trim()}:{},...o?{}:{initialMessage:a??un({firstName:u,lastName:d,occupation:f,hobbies:p}),...l?{initialMessageHidden:!0}:{}},...g?{title:h?`Getting to know ${h}`:`Getting to know you`}:{},...i?.name?.trim()?{assistantName:i.name.trim()}:{},...Re?.length?{researchFindings:Re}:{}});let _=i?.name?.trim();_&&le(_),s(i?.traits??null),g&&r(),o||F.markExpectingFirstMessage(),c(),F.checkAssistant(z??void 0).finally(()=>{e(`${oe.assistant}?onboarding=1`,{replace:!0})})}async function G(){S&&(await Promise.all([V.awaitPluginInstalls(),Pe.current,Be.current]),We(S,P,Xn(P?.name),{hidden:!0}))}function K(e){H(!1),V.start({awaitAssistantId:B,subject:ua(e),conversationTitle:da(e),onConversationCreated:R,includeSuggestions:!1})}async function Ge(e){if(!j.current&&(await Ue())?.established){A(e),v(`existing`);return}T(e),K(e),v(`face`)}function Ke(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){ye(!0);return}if(ye(!1),z&&S){let e=[S.firstName.trim(),S.lastName.trim()].filter(Boolean).join(` `);se(null),_e(!1),de(!0),it({assistantId:z,userName:e||void 0,assistantName:P?.name?.trim()||void 0}).then(e=>{e.scheduled&&(_e(!0),se(Zn(e.start,e.timeZone)))}).finally(()=>de(!1))}v(`meeting`)}if([`different`,`personality`,`integration`,`letschat`,`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(l)&&S){let e=[`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(l);return(0,X.jsx)(`div`,{ref:d,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,X.jsxs)($n,{size:f,children:[(0,X.jsx)(aa,{eyesBumpNonce:be,peekLevel:[`looking`,`results`,`suggestions`,`finishing`].includes(l)?Se:0,darkBg:e,showBottomEyes:!e&&l!==`different`,eyesEntrance:l===`personality`}),l===`different`&&(0,X.jsx)(fi,{onContinue:()=>v(`personality`),onBack:()=>y(`intro`),onForward:x}),l===`personality`&&(0,X.jsx)(ji,{values:te,onValueChange:(e,t)=>I(n=>({...n,[e]:t})),locked:ne,onContinue:()=>{ne||(Ve(!0),Be.current=Yn({awaitAssistantId:B,values:te,userName:S?.firstName?.trim()||void 0,assistantName:P?.name?.trim()||void 0}).finally(()=>Ve(!1)),ie(!0)),v(`integration`)},onBack:()=>y(`different`),onForward:x}),l===`integration`&&(0,X.jsx)(_i,{onClaim:()=>v(De?`looking`:`letschat`),onBumpEyes:()=>xe(e=>e+1),onBack:()=>y(`personality`),onForward:x}),l===`letschat`&&(0,X.jsx)(Mi,{assistantId:z,assistantReady:ke,hatchError:Ae,onConnected:Ke,missingCalendarScope:ve,onRetry:()=>ye(!1),onSkip:()=>{ye(!1),v(`looking`,`skipped`)},onBack:()=>y(`integration`),onForward:x}),l===`meeting`&&(0,X.jsx)(Vi,{scheduledTime:ae??void 0,awaitingTime:ce,onDone:()=>v(`looking`),onBack:()=>y(`letschat`),onForward:x}),l===`looking`&&(0,X.jsx)(Ji,{onDone:()=>v(W?`suggestions`:`results`),onBack:()=>y(De?`integration`:`letschat`),onAdvance:e=>Ce(Math.min(e+1,4)),onForward:x,ready:!He}),l===`results`&&(0,X.jsx)(Xi,{claims:V.claims,loading:He,onContinue:e=>{let t=new Set(e);ze(V.claims.filter(e=>!t.has(e.claim)).map(e=>e.claim));let n=Fe.current?[]:V.droppedClaims,r=[...e,...n];L&&z&&r.length>0&&(n.length>0&&H(!0),Pe.current=Gn({assistantId:z,conversationId:L,removedClaims:r,rejectedAll:!1})),v(`suggestions`)},onRejectAll:()=>{ze([]),L&&z&&(H(!0),Pe.current=Gn({assistantId:z,conversationId:L,removedClaims:V.claims.map(e=>e.claim),rejectedAll:!0})),v(`suggestions`,`skipped`)},onBack:()=>y(`looking`),onForward:x}),l===`suggestions`&&(0,X.jsx)(ea,{installedPlugins:V.installedPlugins,pluginCatalog:V.pluginCatalog,disabled:M,onStart:async()=>{if(Ye($e.suggestions,{userId:n,outcome:`completed`}),U){m([]),u(`finishing`);return}await G()},onBack:()=>y(W?`looking`:`results`),onForward:x}),l===`suggestions`&&!1,l===`finishing`&&(0,X.jsx)(Yi,{ready:!U,onDone:()=>void G()})]})})}return l===`existing`?(0,X.jsx)(ca,{assistantName:D?.assistantName??null,onKeep:()=>{Ye($e.existing,{userId:n,outcome:`completed`}),ge(n),F.checkAssistant(z??void 0).finally(()=>{e(oe.assistant,{replace:!0})})},onRedo:()=>{let e=k;e&&(j.current=!0,Ye($e.existing,{userId:n,outcome:`skipped`}),T(e),K(e),m([]),_(`face`))},onBack:()=>{A(null),y(`form`)}}):l===`intro`&&S?(0,X.jsx)(qr,{firstName:S.firstName,assistantName:P?.name,onContinue:()=>v(`different`),onBack:()=>y(`face`),onForward:x}):l===`face`&&S?(0,X.jsx)(Fr,{voiceEnabled:je,assistantId:z,onContinue:e=>{ee(e),v(`intro`)},onBack:()=>y(`form`),onForward:x}):(0,X.jsx)(Ar,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:Ge})}export{fa as ResearchOnboardingRoute};
@@ -1 +0,0 @@
1
- import{P as e}from"./button-BQVYX8n_.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import"./src-BNYQ8guL.js";var n=t();function r({className:t}){return(0,n.jsx)(`div`,{role:`presentation`,className:e(`h-px w-full bg-[var(--border-base)]`,t)})}export{r as t};
@@ -1 +0,0 @@
1
- import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{n as r,t as i,z as a}from"./button-BQVYX8n_.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./bug-BMI_6ziD.js";import{t as l}from"./download-B6XjnEzx.js";import{t as u}from"./info-CqgkBvyS.js";import{t as d}from"./loader-circle-Ck8fq3yv.js";import{t as f}from"./x-CswtfvgS.js";import{t as p}from"./notice-DkAWz47A.js";import{n as ee,t as m}from"./input-ZpyYt_a0.js";import{t as h}from"./toggle-QSEiPr3k.js";import{t as g}from"./dropdown-BxYrCXBS.js";import{t as _}from"./is-electron-y5bNUVyG.js";import{sn as v}from"./sdk.gen-BR-xXIZm.js";import{t as y}from"./impersonate-version-flag-DRJTfKcP.js";import{n as te}from"./auth-store-yYPy4QuG.js";import{t as b}from"./dist-DyRKd0bN2.js";import{n as x}from"./diagnostics-DbnQqLDx.js";import{Jo as S,bi as ne,cs as re,ms as C,os as w,rs as ie}from"./index-D5iUyXUl.js";var T=e(n(),1),ae=e(a(),1),E=`vellum:debug:`;function oe(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(E))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function D(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:y()},overrides:oe()}}var O=t({ShareFeedbackModal:()=>z}),k=s(),A=[{value:`bug_report`,label:`Bug Report`,icon:c,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:C,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:w,includesLogsByDefault:!1}],j=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],se=j.map(e=>({value:e.value,label:e.label})),M=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),N=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),P=10,F=50*1024*1024,ce={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function le(){return _()?`electron`:b.getPlatform()===`ios`?`ios`:`web`}function ue(e){if(e.size>F)return!1;if(e.type&&M.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?N.has(t):!1}return!1}function I(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function L(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await v({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function R(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,s=new Date,c=j.find(t=>t.value===e),l=s.getTime(),u=c?.cutoffMs==null?null:l-c.cutoffMs,d=u==null?null:new Date(u).toISOString(),f=null;try{f=i?.()??null}catch{f=null}let p=x(f),ee={collected_at:s.toISOString(),time_range:e,cutoff:d,log_window:{start_time_ms:u,end_time_ms:l},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},m=new TextEncoder,h=m.encode(JSON.stringify(ee,null,2)),g=m.encode(JSON.stringify(p,null,2)),v=[I(`web-client-context.json`,h),I(`web-chat-diagnostics.json`,g)],y=new TextEncoder().encode(JSON.stringify(D(),null,2));v.push(I(`web-debug-flags.json`,y));for(let e of o){let t=e.contents.trim();t&&v.push(I(e.filename,m.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));v.push(I(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));v.push(I(`web-sse-liveness-triage.json`,n))}}catch{}if(_()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));v.push(I(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);v.push(I(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await L(t,{window:{startTime:u,endTime:l},activeConversationId:n});e&&v.push(I(`platform-logs.tar.gz`,e))}v.push(new Uint8Array(1024));let te=v.reduce((e,t)=>e+t.length,0),b=new Uint8Array(te),S=0;for(let e of v)b.set(e,S),S+=e.length;let ne=new Blob([b.buffer]),re=await new Response(ne.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([re],`web-client-logs-${s.getTime()}.tar.gz`,{type:`application/gzip`})}function z({open:e,onClose:t,initialReason:n,initialMessage:a,onSubmitted:s,assistantId:c,assistantVersion:v,activeConversationId:y,doctorSessionId:b,doctorSessionLog:x,getDiagnosticsSnapshot:C}){let w=te.use.user(),E=w?.email,oe=w?.isStaff??!1,D=(0,T.useId)(),O=(0,T.useRef)(null),j=(0,T.useRef)(null),M=(0,T.useRef)(null),N=(0,T.useRef)(null),[F,I]=(0,T.useState)(n??`bug_report`),[L,z]=(0,T.useState)(``),[B,pe]=(0,T.useState)(``),[V,H]=(0,T.useState)(A.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[me,he]=(0,T.useState)(!1),[U,W]=(0,T.useState)(`past_hour`),[G,K]=(0,T.useState)([]),[ge,q]=(0,T.useState)(null),[_e,J]=(0,T.useState)(!1),[Y,ve]=(0,T.useState)(!1),[X,ye]=(0,T.useState)(!1),Z=o(ne()),[be,Q]=(0,T.useState)(!1),$=Z.isPending||be,xe=!E,Se=(0,T.useMemo)(()=>L.trim().length>0&&B.trim().length>0,[L,B]);(0,T.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;I(t),z(a??``),pe(E??``),H(A.find(e=>e.value===t)?.includesLogsByDefault??!0),he(!1),W(`past_hour`),K([]),ve(!1),ye(!1),q(null),Q(!1),Z.reset();let r=setTimeout(()=>{E?M.current?.focus():N.current?.focus()},50);return()=>clearTimeout(r)},[e]),(0,T.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let Ce=e=>{I(e),me||H(A.find(t=>t.value===e)?.includesLogsByDefault??!1)},we=()=>{H(e=>!e),he(!0)},Te=x?.trim()?[{filename:`doctor-session.txt`,contents:x}]:[],Ee=(0,T.useCallback)(e=>{e.key===`Escape`&&!$&&t()},[t,$]),De=(0,T.useCallback)(e=>{e.target===O.current&&!$&&t()},[t,$]),Oe=(0,T.useCallback)(e=>{K(t=>{let n=P-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ue(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),ke=e=>{e.target.files&&Oe(Array.from(e.target.files)),e.target.value=``},Ae=e=>{e.preventDefault(),J(!1),e.dataTransfer.files?.length&&Oe(Array.from(e.dataTransfer.files))},je=e=>{e.preventDefault(),J(!0)},Me=e=>{e.preventDefault(),e.currentTarget===e.target&&J(!1)},Ne=e=>{K(t=>t.filter((t,n)=>n!==e))};return e?(0,ae.createPortal)((0,k.jsx)(`div`,{ref:O,role:`dialog`,"aria-modal":`true`,"aria-labelledby":D,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:Ee,onClick:De,onDrop:Ae,onDragOver:je,onDragLeave:Me,children:(0,k.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,k.jsx)(`h2`,{id:D,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,k.jsx)(i,{variant:`ghost`,iconOnly:(0,k.jsx)(f,{}),onClick:t,disabled:$,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[oe&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,k.jsx)(h,{checked:X,onChange:()=>ye(e=>!e),"aria-label":`Download diagnostics directly`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Download diagnostics directly`})]}),(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Admin only — builds the diagnostics archive locally and downloads it instead of submitting feedback or notifying Slack.`})]}),X?(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Time range`}),(0,k.jsx)(g,{options:se,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}):(0,k.jsxs)(k.Fragment,{children:[xe&&(0,k.jsx)(m,{id:`${D}-email`,ref:N,label:`Email`,type:`email`,placeholder:`you@example.com`,value:B,onChange:e=>pe(e.target.value),leftIcon:(0,k.jsx)(re,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,k.jsx)(`div`,{className:`flex gap-2`,children:A.map(e=>(0,k.jsx)(de,{option:e,isSelected:F===e.value,onSelect:()=>Ce(e.value)},e.value))})]}),(0,k.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),F===`bug_report`&&(0,k.jsxs)(p,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,k.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),F===`feature_request`&&(0,k.jsxs)(p,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,k.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,k.jsx)(ee,{id:`${D}-message`,ref:M,label:F===`bug_report`?`What went wrong?`:F===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:F===`bug_report`?`What did you expect to happen, and what happened instead?`:F===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:L,onChange:e=>z(e.target.value),fullWidth:!0}),F!==`feature_request`&&(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(h,{checked:V,onChange:we,"aria-label":`Include browser diagnostics`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,k.jsx)(r,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,k.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,k.jsx)(u,{className:`h-3.5 w-3.5`})})})]}),V&&(0,k.jsx)(g,{options:se,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}),_()&&y&&F!==`feature_request`&&(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(h,{checked:Y,onChange:()=>ve(e=>!e),"aria-label":`Include the most recent conversation`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,G.length>0&&(0,k.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,G.length,`/`,P]})]}),(0,k.jsx)(i,{variant:`outlined`,size:`compact`,leftIcon:(0,k.jsx)(ie,{}),onClick:()=>j.current?.click(),disabled:G.length>=P,children:`Add files`}),(0,k.jsx)(`input`,{ref:j,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:ke,className:`hidden`})]}),G.length>0&&(0,k.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:G.map((e,t)=>(0,k.jsx)(fe,{file:e,onRemove:()=>Ne(t)},`${e.name}-${t}`))}),_e&&(0,k.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]})]}),ge&&(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:ge})]}),(0,k.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,k.jsx)(d,{className:`h-4 w-4 animate-spin`}),X?`Preparing diagnostics…`:`Sending feedback…`]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(i,{variant:`ghost`,onClick:t,children:`Cancel`}),X?(0,k.jsx)(i,{variant:`primary`,leftIcon:(0,k.jsx)(l,{}),onClick:async()=>{if(!$){q(null),Q(!0);try{let e=await R(U,c??null,_()?Y?y??null:null:y??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te});if(!e){q(`Diagnostics export isn't supported in this browser.`);return}let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0),t()}catch(e){q(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:`Download diagnostics`}):(0,k.jsx)(i,{variant:`primary`,leftIcon:(0,k.jsx)(S,{}),onClick:async()=>{if(!(!Se||$)){q(null),Q(!0);try{let e=V&&F!==`feature_request`?await R(U,c??null,_()?Y?y??null:null:y??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te}):null;await Z.mutateAsync({headers:{"Content-Type":null},body:{message:L.trim(),classification:ce[F],email:B.trim(),client:le(),client_version:void 0,...c?{assistant_id:c}:{},...v?{assistant_version:v}:{},...b?{doctor_session_id:b}:{},...e?{logs_file:e}:{},...G.length?{attachments:G}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),s?.(),t()}catch(e){q(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!Se,children:`Submit`})]})})]})}),document.body):null}function de({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,k.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,k.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,k.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function fe({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,T.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,T.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,k.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,k.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,k.jsx)(ie,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,k.jsx)(i,{variant:`ghost`,size:`compact`,iconOnly:(0,k.jsx)(f,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{O as n,z as t};