@vellumai/web 0.10.9 → 0.10.10-dev.202607170046.8482d40

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 (442) hide show
  1. package/dist/assets/{AnimatePresence-TZWSGjkI.js → AnimatePresence-DqW6iWlh.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-DwVI7U0b.js → BundleConfirmPage-CQYO7UBl.js} +1 -1
  3. package/dist/assets/{Combination-Cd_aWAsj.js → Combination-BJXmG5wD.js} +1 -1
  4. package/dist/assets/{a2a-invite-CwD3hY_-.js → a2a-invite-BgcNY6-0.js} +1 -1
  5. package/dist/assets/{about-page-vayMMPxH.js → about-page-XGv9RAQu.js} +1 -1
  6. package/dist/assets/{account-page-uVMhWTmh.js → account-page-vkxiAGOl.js} +1 -1
  7. package/dist/assets/{account-shell-DaECsri2.js → account-shell-B7umdF9x.js} +1 -1
  8. package/dist/assets/{acp-run-detail-panel-DKXp8jTf.js → acp-run-detail-panel-hcso0zce.js} +4 -4
  9. package/dist/assets/activity-steps-panel-CcBw8DS-.js +1 -0
  10. package/dist/assets/{add-credits-modal-DjQdNLWh.js → add-credits-modal-DjNvi-GP.js} +1 -1
  11. package/dist/assets/ai-page-CN2rAfL9.js +1 -0
  12. package/dist/assets/animated-avatar-g_UuqPoB.js +1 -0
  13. package/dist/assets/{api-Dfrm6N2I.js → api-Bf9f0SF-.js} +1 -1
  14. package/dist/assets/api-CAksDSJ5.js +1 -0
  15. package/dist/assets/{api-key-screen-DhFeDT-n.js → api-key-screen-D1VuOnOP.js} +1 -1
  16. package/dist/assets/app-types-XM5qKBD0.js +1 -0
  17. package/dist/assets/archive-redirect-page-CzfenZ5a.js +1 -0
  18. package/dist/assets/arrow-left-C2re-gYj.js +1 -0
  19. package/dist/assets/{assistant-feature-flag-store-BA3GR2m5.js → assistant-feature-flag-store-hJs0ZthQ.js} +1 -1
  20. package/dist/assets/assistant-identity-store-CgJwLRMd.js +1 -0
  21. package/dist/assets/assistant-status-panel-C-j2xyys.js +1 -0
  22. package/dist/assets/auth-store-6jOlH4H3.js +2 -0
  23. package/dist/assets/background-task-detail-panel-D9-rHjio.js +1 -0
  24. package/dist/assets/ban-Bvfp1f1I.js +1 -0
  25. package/dist/assets/{bell-BQLonLMp.js → bell-V9BYKY__.js} +1 -1
  26. package/dist/assets/billing-page-DqCOyq6U.js +3 -0
  27. package/dist/assets/{bookmark-CNrithFf.js → bookmark-CjHh36q4.js} +1 -1
  28. package/dist/assets/{bookmarks-page-BdcnBpJK.js → bookmarks-page-CgjhMvgV.js} +1 -1
  29. package/dist/assets/{brain-BLDXGaUy.js → brain-Ci5ws6Wl.js} +1 -1
  30. package/dist/assets/browser-ANfYdLSw.js +2 -0
  31. package/dist/assets/{bug-BsuQ5ciQ.js → bug-BMI_6ziD.js} +1 -1
  32. package/dist/assets/{build-state-D-aPe0DY.js → build-state-eUN4dUUO.js} +1 -1
  33. package/dist/assets/button-BQVYX8n_.js +1 -0
  34. package/dist/assets/card-D8zyWtZh.js +1 -0
  35. package/dist/assets/channels-page-route-B71sEakK.js +9 -0
  36. package/dist/assets/chat-BDhsGoUo.js +1 -0
  37. package/dist/assets/chat-markdown-message-DA7kD5x_.js +2 -0
  38. package/dist/assets/check-CkQjevXL.js +1 -0
  39. package/dist/assets/checkbox-DpJ6rimy.js +1 -0
  40. package/dist/assets/{chevron-down-qD-re7AW.js → chevron-down-DwIPfcCg.js} +1 -1
  41. package/dist/assets/chevron-left-mpHv5ahd.js +1 -0
  42. package/dist/assets/chevron-right-DDgSinGu.js +1 -0
  43. package/dist/assets/{chevron-up-3jCod9LW.js → chevron-up-B8xt61zY.js} +1 -1
  44. package/dist/assets/{chunk-5KNZJZUH-DdS6bb-3.js → chunk-5KNZJZUH-SU6Q_tDT.js} +1 -1
  45. package/dist/assets/{circle-alert-zOqdmf25.js → circle-alert-_RJjkRGu.js} +1 -1
  46. package/dist/assets/circle-check-DWe3QGcN.js +1 -0
  47. package/dist/assets/{client-feature-flag-store-Ri-a_LuI.js → client-feature-flag-store-BF2sLP87.js} +1 -1
  48. package/dist/assets/{client-identity-DfC94VQ4.js → client-identity-ClnkJ165.js} +1 -1
  49. package/dist/assets/{clipboard-copy-DF6K1xc6.js → clipboard-copy-sWUyFbCT.js} +1 -1
  50. package/dist/assets/clock-YYSFOsux.js +1 -0
  51. package/dist/assets/{cloud-off-Db1nySkc.js → cloud-off-Cj66Ozsp.js} +1 -1
  52. package/dist/assets/code-D1zl7aOd.js +1 -0
  53. package/dist/assets/{command-palette-Bu2Qjyle.js → command-palette-cry3DjBe.js} +1 -1
  54. package/dist/assets/{command-palette-window-page-CtQ40jMw.js → command-palette-window-page-DiYxA98-.js} +1 -1
  55. package/dist/assets/community-page-Bjrv2fFx.js +1 -0
  56. package/dist/assets/{confirm-dialog-CSkhRFRk.js → confirm-dialog-kE8y7s20.js} +1 -1
  57. package/dist/assets/{connect-page-BCb6nr8x.js → connect-page-Dg9B95NR.js} +1 -1
  58. package/dist/assets/consent-C8XzlZzW.js +1 -0
  59. package/dist/assets/{consent-controls-udcijSAB.js → consent-controls-BKoyAFQL.js} +1 -1
  60. package/dist/assets/{contacts-gateway-DfyjoqNo.js → contacts-gateway-MdTfmafh.js} +1 -1
  61. package/dist/assets/{contacts-page-route-CicU-jSI.js → contacts-page-route-CpXule5I.js} +1 -1
  62. package/dist/assets/conversation-list-fetchers-CRj2YEra.js +1 -0
  63. package/dist/assets/{cpu-BJuB2Khn.js → cpu-CEyjQpZz.js} +1 -1
  64. package/dist/assets/{credential-entry-page-CRTZY2VD.js → credential-entry-page-CINUIvT7.js} +1 -1
  65. package/dist/assets/credentials-page-Bxyd05F2.js +1 -0
  66. package/dist/assets/{credit-card-BuyWdO9t.js → credit-card-BY-vD21O.js} +1 -1
  67. package/dist/assets/danger-zone-redirect-page-D5PMgW3x.js +1 -0
  68. package/dist/assets/debug-page-DgE71O7D.js +4 -0
  69. package/dist/assets/{deploy-dialogs-C6pCnoVj.js → deploy-dialogs-IR36wqsi.js} +1 -1
  70. package/dist/assets/detail-card-BQDwZw9u.js +1 -0
  71. package/dist/assets/{detail-panel-stop-button-H9sXvWGa.js → detail-panel-stop-button-7iw57s5z.js} +1 -1
  72. package/dist/assets/developer-page-CyI9M1jH.js +1 -0
  73. package/dist/assets/{device-settings-BBwtGKJb.js → device-settings-DXp9L4iB.js} +1 -1
  74. package/dist/assets/devices-redirect-page-CULscA9R.js +1 -0
  75. package/dist/assets/{diagnostics-CUmYxbmM.js → diagnostics-BmpZegnr.js} +1 -1
  76. package/dist/assets/{dictation-overlay-page-BmLNyGeD.js → dictation-overlay-page-BtLSzNia.js} +1 -1
  77. package/dist/assets/{dist-CxHeCOEv.js → dist-Btg1osd6.js} +1 -1
  78. package/dist/assets/{dist-DqmYHxdg.js → dist-CxzJhU4a.js} +1 -1
  79. package/dist/assets/dist-Df9Kbc9v.js +1 -0
  80. package/dist/assets/{dist-HJ505Xnn.js → dist-URk13ITj.js} +1 -1
  81. package/dist/assets/document-viewer-page-D2UQkY2m.js +1 -0
  82. package/dist/assets/{domain-field-C5a2iMot.js → domain-field-DKKi4dF-.js} +1 -1
  83. package/dist/assets/{download-CAuK-nZ6.js → download-B6XjnEzx.js} +1 -1
  84. package/dist/assets/dropdown-CuE5AuVj.js +1 -0
  85. package/dist/assets/effective-timezone-Cp9o8K5B.js +1 -0
  86. package/dist/assets/emails-page-B6FMCJWC.js +1 -0
  87. package/dist/assets/esm-Bg_CV71l.js +2 -0
  88. package/dist/assets/esm-C-NQQXQk.js +1 -0
  89. package/dist/assets/esm-CfdeJFC3.js +2 -0
  90. package/dist/assets/esm-D6qOHXq4.js +2 -0
  91. package/dist/assets/esm-DhG5lsUR.js +2 -0
  92. package/dist/assets/esm-Dr3kF6_n.js +2 -0
  93. package/dist/assets/esm-M2XAj3Ql.js +2 -0
  94. package/dist/assets/{external-link-Dqpx9nRm.js → external-link-Cczz6xJ4.js} +1 -1
  95. package/dist/assets/eye-C2rSrbD-.js +1 -0
  96. package/dist/assets/eye-off-BQ9J3pF2.js +1 -0
  97. package/dist/assets/feature-flag-catalog-BYQYYM0o.js +1 -0
  98. package/dist/assets/{file-DsyJLS2u.js → file-C8pjlmtk.js} +1 -1
  99. package/dist/assets/file-editor-zaQWhFtF.js +1 -0
  100. package/dist/assets/file-markdown-CIujEAvN.js +2 -0
  101. package/dist/assets/{file-text-CYJz-GvF.js → file-text-DA128T4K.js} +1 -1
  102. package/dist/assets/folder-open-7DKBH5WB.js +1 -0
  103. package/dist/assets/general-page-CdtyNT85.js +1 -0
  104. package/dist/assets/{globe-4qSOWE2N.js → globe-inD5tOKN.js} +1 -1
  105. package/dist/assets/{haptics-BOswdY5A.js → haptics-DSy7IUf8.js} +2 -2
  106. package/dist/assets/{hard-drive-rDxhoRUm.js → hard-drive-BXh9qCfi.js} +1 -1
  107. package/dist/assets/hatching-screen-By8y8slf.js +1 -0
  108. package/dist/assets/home-page-route-D8rR127z.js +1 -0
  109. package/dist/assets/{hosting-screen-nru73FGU.js → hosting-screen-iOu5c3s2.js} +1 -1
  110. package/dist/assets/identity-page-route-qTfcZp4g.js +7 -0
  111. package/dist/assets/impersonate-version-flag-DRJTfKcP.js +1 -0
  112. package/dist/assets/index-CpdQgTZI.css +2 -0
  113. package/dist/assets/index-D_wKh03d.js +211 -0
  114. package/dist/assets/{info-DsOyuMO9.js → info-DLFMsCl-.js} +1 -1
  115. package/dist/assets/ingest-DVy2v0Mj.js +1 -0
  116. package/dist/assets/input-6HVXMszw.js +1 -0
  117. package/dist/assets/{inspect-page-DoA1sfxg.js → inspect-page-rNR7--O9.js} +4 -4
  118. package/dist/assets/integrations-page-B41K84yI.js +1 -0
  119. package/dist/assets/intelligence-layout-BtlV0p8d.js +1 -0
  120. package/dist/assets/{key-round-CD3JWrs1.js → key-round-BggUE1Ns.js} +1 -1
  121. package/dist/assets/keyboard-shortcuts-redirect-page-DrBxlgF7.js +1 -0
  122. package/dist/assets/latest-assistant-text-Qj7hDn1c.js +24 -0
  123. package/dist/assets/library-detail-page-Cfc8zZ7K.js +1 -0
  124. package/dist/assets/library-page-DDo7QO-G.js +1 -0
  125. package/dist/assets/{link-2-4bMylQ5v.js → link-2-YnZe-oMg.js} +1 -1
  126. package/dist/assets/list-row-spYsDF9a.js +1 -0
  127. package/dist/assets/loader-circle-C9QrtO3C.js +1 -0
  128. package/dist/assets/local-mode-Dydd46cS.js +39 -0
  129. package/dist/assets/local-settings-C-dW2vkq.js +1 -0
  130. package/dist/assets/{log-in--aqELu3z.js → log-in-Xv-AVlu8.js} +1 -1
  131. package/dist/assets/{login-flow-DYLpX6IU.js → login-flow-KepuOYBD.js} +1 -1
  132. package/dist/assets/login-page-DF7FczXW.js +1 -0
  133. package/dist/assets/{logout-page-xucijGcq.js → logout-page-b4fcTzGe.js} +1 -1
  134. package/dist/assets/logs-layout-C_n7Nf1x.js +1 -0
  135. package/dist/assets/memory-page-route-BpqBCX0L.js +1 -0
  136. package/dist/assets/{memory-router-playground-page-DikxzmKT.js → memory-router-playground-page-BKCeJSb5.js} +1 -1
  137. package/dist/assets/menu-B672pBEP.js +1 -0
  138. package/dist/assets/messages-D7HOlpNc.js +13 -0
  139. package/dist/assets/{metric-card-cvhtzRdM.js → metric-card-ClJWxxPO.js} +1 -1
  140. package/dist/assets/mic-Dmvwrxe8.js +1 -0
  141. package/dist/assets/{minimize-2-Clnet2W7.js → minimize-2-B8VHIj-G.js} +1 -1
  142. package/dist/assets/{misc-DnHIYCE9.js → misc-D0u5tzSd.js} +1 -1
  143. package/dist/assets/{mobile-sidebar-drawer-BaL8el3Y.js → mobile-sidebar-drawer-jzcdwotk.js} +1 -1
  144. package/dist/assets/modal-bIQsMU63.js +1 -0
  145. package/dist/assets/{monitor-DfbL8_59.js → monitor-Cy7Q70-7.js} +1 -1
  146. package/dist/assets/{moon-B8qiwjrW.js → moon-jDX7sipq.js} +1 -1
  147. package/dist/assets/mutation-error-BSB3r4np.js +1 -0
  148. package/dist/assets/{native-biometric-B2cBAQ1U.js → native-biometric-B_KQURZ4.js} +1 -1
  149. package/dist/assets/native-file-kVcoTiGR.js +2 -0
  150. package/dist/assets/notice-B8UI-BOp.js +1 -0
  151. package/dist/assets/notifications-page-D3JJkCDb.js +1 -0
  152. package/dist/assets/{oauth-complete-page-SfFEsa_M.js → oauth-complete-page-DWOIdXkU.js} +1 -1
  153. package/dist/assets/{oauth-popup-complete-page-D4Xoa-Gr.js → oauth-popup-complete-page-BWsHYRdP.js} +1 -1
  154. package/dist/assets/onboarding-store-Bxw_JVDh.js +1 -0
  155. package/dist/assets/page-empty-state-M3M-Ny7y.js +1 -0
  156. package/dist/assets/page-shell-CflRXEeM.js +1 -0
  157. package/dist/assets/{pairing-page-B5xnM6XX.js → pairing-page-B04bci4y.js} +1 -1
  158. package/dist/assets/panel-item-CegzTp_l.js +1 -0
  159. package/dist/assets/password-reset-page-CNCeaWWO.js +1 -0
  160. package/dist/assets/{pencil-CUIr0IFo.js → pencil-BOTCmXXR.js} +1 -1
  161. package/dist/assets/personality-page-tI_Bdj2g.js +1 -0
  162. package/dist/assets/platform-detection-lm9it_11.js +1 -0
  163. package/dist/assets/{platform-loopback-page-_IbNDHN2.js → platform-loopback-page-Bp8C9tZw.js} +1 -1
  164. package/dist/assets/{plugin-detail-page-_iCqtxl9.js → plugin-detail-page-Dhg5mNZ7.js} +1 -1
  165. package/dist/assets/plugins-page-DE7s-sYB.js +1 -0
  166. package/dist/assets/plugins-surface-DXytDI7x.js +1 -0
  167. package/dist/assets/plus-D54jrPDF.js +1 -0
  168. package/dist/assets/popover-rW459udD.js +1 -0
  169. package/dist/assets/prechat-jJWDBLel.js +1 -0
  170. package/dist/assets/prefs-Od3axSSC.js +1 -0
  171. package/dist/assets/privacy-page-BqinM6m5.js +1 -0
  172. package/dist/assets/privacy-screen-D9_clskP.js +1 -0
  173. package/dist/assets/{usage-window-CCdJWJ0U.js → profile-metadata-VB4MBtgt.js} +1 -1
  174. package/dist/assets/progress-bar-Wa6qo8OT.js +1 -0
  175. package/dist/assets/{provider-callback-page-BoO2JgZt.js → provider-callback-page-CCcKKz8l.js} +1 -1
  176. package/dist/assets/provider-catalogs-BFoYvfUc.js +1 -0
  177. package/dist/assets/{provider-key-B-hx1r3c.js → provider-key-DqjTE9QV.js} +1 -1
  178. package/dist/assets/{provider-signup-page-DLVKMYZh.js → provider-signup-page-UutK4KOX.js} +1 -1
  179. package/dist/assets/puzzle-0_oQwgsv.js +1 -0
  180. package/dist/assets/{quick-input-page-7z8Ti2GI.js → quick-input-page-DGAeq4rS.js} +1 -1
  181. package/dist/assets/react-query.gen-BqmzUoTX.js +1 -0
  182. package/dist/assets/react-query.gen-CWfp8GEM.js +1 -0
  183. package/dist/assets/{refresh-cw-DevIHL7J.js → refresh-cw-BkscUrbN.js} +1 -1
  184. package/dist/assets/{remote-gateway-session-CBKZhJak.js → remote-gateway-session-D-udmSfx.js} +1 -1
  185. package/dist/assets/{repeat-C8Im6j--.js → repeat-BRYsTqh_.js} +1 -1
  186. package/dist/assets/research-mock-page-D73KATjt.js +1 -0
  187. package/dist/assets/research-onboarding-route-C8B_Hf6H.js +43 -0
  188. package/dist/assets/{resize-errors-DqIkO0UI.js → resize-errors-yH10K9Qq.js} +1 -1
  189. package/dist/assets/{resolved-assistants-store-DAzPZ1eV.js → resolved-assistants-store-DdHm-7v4.js} +1 -1
  190. package/dist/assets/review-terms-screen-DyaVT7tS.js +1 -0
  191. package/dist/assets/risk-DI65iZDy.js +3 -0
  192. package/dist/assets/routes-GPGveWZ8.js +1 -0
  193. package/dist/assets/schedules-CTsHce7J.js +1 -0
  194. package/dist/assets/schedules-page-waP6mp0w.js +1 -0
  195. package/dist/assets/{sdk.gen-CFgJ4K6f.js → sdk.gen-C9GJEKYV.js} +1 -1
  196. package/dist/assets/{sdk.gen-9Cdt87h5.js → sdk.gen-DTVjciY5.js} +1 -1
  197. package/dist/assets/security-redirect-page-BjDQGfTt.js +1 -0
  198. package/dist/assets/select-assistant-screen-C0fk-Wr4.js +1 -0
  199. package/dist/assets/{setting-row-imtQqr9o.js → setting-row-BrTO4FAb.js} +1 -1
  200. package/dist/assets/settings-divider-Dm6am_vC.js +1 -0
  201. package/dist/assets/settings-layout-BtjAruk-.js +1 -0
  202. package/dist/assets/settings-wSv59mkN.js +1 -0
  203. package/dist/assets/share-feedback-modal-CSwbEpOs.js +1 -0
  204. package/dist/assets/shield-check-kgUZeU9b.js +1 -0
  205. package/dist/assets/{sidebar-tree-DWJkYLPh.js → sidebar-tree-Dryg3cOs.js} +1 -1
  206. package/dist/assets/{signup-page-D2LQXMnG.js → signup-page-CNtwdwbQ.js} +1 -1
  207. package/dist/assets/{signup-shell-DCGARCES.js → signup-shell-Cc2MDy25.js} +1 -1
  208. package/dist/assets/{site-favicon-DsYdnaxV.js → site-favicon-D57oj-aP.js} +1 -1
  209. package/dist/assets/skill-detail-page-sUN279wq.js +1 -0
  210. package/dist/assets/{skill-detail-panel-B4WEYtK9.js → skill-detail-panel-Z4ygLF6y.js} +1 -1
  211. package/dist/assets/{skills-D0rhLW1_.js → skills-Blso03pM.js} +1 -1
  212. package/dist/assets/skills-page-jO3IR1Bn.js +1 -0
  213. package/dist/assets/sounds-redirect-page-SALIbUWr.js +1 -0
  214. package/dist/assets/{sparkles-PGiR5v1g.js → sparkles-BK3KXCjl.js} +1 -1
  215. package/dist/assets/{src-DZbMXyC2.js → src-yyUuGOWG.js} +39 -39
  216. package/dist/assets/start-screen-5hBKdcez.js +1 -0
  217. package/dist/assets/subagent-detail-panel-kYsr3-Go.js +4 -0
  218. package/dist/assets/{subagent-store-B4PMGakL.js → subagent-store-BBGeZyfE.js} +1 -1
  219. package/dist/assets/system-events-page-zfJm8MVb.js +1 -0
  220. package/dist/assets/system-events-redirect-page-DCoGGk63.js +1 -0
  221. package/dist/assets/tag-D0AE0-aA.js +1 -0
  222. package/dist/assets/{theme-preferences-D1vs2UH8.js → theme-preferences-D58K1K0j.js} +1 -1
  223. package/dist/assets/{theme-stage-page-8v_hsKXd.js → theme-stage-page-CwAjRBf7.js} +1 -1
  224. package/dist/assets/{tiptap-document-editor-1QvKHdlQ.js → tiptap-document-editor-DJgv0IjA.js} +2 -2
  225. package/dist/assets/toast-CZmbu5xl.js +1 -0
  226. package/dist/assets/toggle-CWrJ2t4S.js +1 -0
  227. package/dist/assets/{tool-detail-panel-DarSpKEx.js → tool-detail-panel-BX8nhSHp.js} +1 -1
  228. package/dist/assets/{triangle-alert-Z0Gq0IuB.js → triangle-alert-CnjNKhNx.js} +1 -1
  229. package/dist/assets/typed-storage-D_VAgmkX.js +1 -0
  230. package/dist/assets/typography-Cqi8q9o7.js +1 -0
  231. package/dist/assets/{upgrade-cancel-page-wop4boqC.js → upgrade-cancel-page-Dy0QpcPX.js} +1 -1
  232. package/dist/assets/{upgrade-success-page-DWPEHzlo.js → upgrade-success-page-C4qPg39w.js} +1 -1
  233. package/dist/assets/usage-redirect-page-BRSD2lQL.js +1 -0
  234. package/dist/assets/{use-active-assistant-id-CGeH4Gl6.js → use-active-assistant-id-DwLFgABu.js} +1 -1
  235. package/dist/assets/use-assistant-identity-details-Cc0ODudZ.js +1 -0
  236. package/dist/assets/{use-edge-swipe-back-R9ItWgTp.js → use-edge-swipe-back-CPKPdejt.js} +1 -1
  237. package/dist/assets/use-invite-link-dialog-B3ek9kAR.js +1 -0
  238. package/dist/assets/use-is-org-ready-0evEMlKE.js +1 -0
  239. package/dist/assets/{use-onboarding-login-BHrngniO.js → use-onboarding-login-DCGylk8M.js} +1 -1
  240. package/dist/assets/{use-reduced-motion-BPBlq9_a.js → use-reduced-motion-ztQz2c8x.js} +1 -1
  241. package/dist/assets/use-skill-actions-Bne9ss01.js +1 -0
  242. package/dist/assets/use-skill-categories-D2KEkcRq.js +1 -0
  243. package/dist/assets/{use-skill-detail-files-DDUUobr0.js → use-skill-detail-files-CULTYS0z.js} +1 -1
  244. package/dist/assets/{user-plus-DMh4_UTz.js → user-plus-KuzSTM_D.js} +1 -1
  245. package/dist/assets/utils-DvUW9GK8.js +1 -0
  246. package/dist/assets/{viewer-store-90zmUKZ4.js → viewer-store-3OqDWGlU.js} +1 -1
  247. package/dist/assets/voice-page-adm17MvI.js +1 -0
  248. package/dist/assets/weather-forecast-display-DmxpUWDF.js +1 -0
  249. package/dist/assets/web-2Lv7tn-v.js +1 -0
  250. package/dist/assets/web-BMkUTu6e.js +1 -0
  251. package/dist/assets/web-BRNP0DmG.js +1 -0
  252. package/dist/assets/web-D9chpugB.js +1 -0
  253. package/dist/assets/web-DJgVPE0A.js +1 -0
  254. package/dist/assets/web-DL2EEVnA.js +1 -0
  255. package/dist/assets/web-DbZvx-GY.js +1 -0
  256. package/dist/assets/web-DguPzvKS.js +1 -0
  257. package/dist/assets/{welcome-screen-kc41a0yS.js → welcome-screen-CxD05qtl.js} +1 -1
  258. package/dist/assets/workflow-detail-panel-USyHIhjf.js +1 -0
  259. package/dist/assets/workspace-page-B3vckeSl.js +1 -0
  260. package/dist/assets/x-BYcSiJRX.js +1 -0
  261. package/dist/index.html +142 -144
  262. package/package.json +1 -1
  263. package/dist/assets/activity-steps-panel-Bq9yj1qu.js +0 -1
  264. package/dist/assets/advanced-page-CQPwr2B4.js +0 -1
  265. package/dist/assets/ai-page-CO4dBJpg.js +0 -1
  266. package/dist/assets/animated-avatar-DMwzREGQ.js +0 -1
  267. package/dist/assets/api-DHuLwcqq.js +0 -1
  268. package/dist/assets/archive-0aqysuyd.js +0 -1
  269. package/dist/assets/archive-page-BLEqhIZ8.js +0 -1
  270. package/dist/assets/arrow-left-DI9551VI.js +0 -1
  271. package/dist/assets/assistant-identity-store-CX03CK8q.js +0 -1
  272. package/dist/assets/assistant-status-panel-CW7lTRBE.js +0 -1
  273. package/dist/assets/auth-store-65JKPW7C.js +0 -2
  274. package/dist/assets/background-task-detail-panel-ChfmmS5C.js +0 -1
  275. package/dist/assets/ban-CVKGuUAQ.js +0 -1
  276. package/dist/assets/billing-page-CaP8_CF9.js +0 -3
  277. package/dist/assets/browser-Cnr7iqbJ.js +0 -2
  278. package/dist/assets/button-amTXFI-2.js +0 -1
  279. package/dist/assets/calendar-h-mv1itX.js +0 -1
  280. package/dist/assets/card-Bv5O5juh.js +0 -1
  281. package/dist/assets/channels-page-route-DKkdGS4b.js +0 -9
  282. package/dist/assets/chat-0L0NBUcq.js +0 -1
  283. package/dist/assets/chat-markdown-message-Cp8stHaU.js +0 -2
  284. package/dist/assets/check-DFNrQERi.js +0 -1
  285. package/dist/assets/checkbox-EdyezNqo.js +0 -1
  286. package/dist/assets/chevron-left-BMF1xNfR.js +0 -1
  287. package/dist/assets/chevron-right-DqqmezXC.js +0 -1
  288. package/dist/assets/circle-check-VSiny8yl.js +0 -1
  289. package/dist/assets/cn-C36Yvcac.js +0 -1
  290. package/dist/assets/code-Czx7d7SK.js +0 -1
  291. package/dist/assets/community-page-DL_oR63v.js +0 -1
  292. package/dist/assets/composer-focus-8EISjLd_.js +0 -1
  293. package/dist/assets/constants-BQVXM0At.js +0 -1
  294. package/dist/assets/conversation-list-fetchers-_PUdRqRZ.js +0 -1
  295. package/dist/assets/conversation-selection-CfSCgJxD.js +0 -1
  296. package/dist/assets/copy-Cn1FKrEp.js +0 -1
  297. package/dist/assets/credentials-page-DDM2V8iZ.js +0 -1
  298. package/dist/assets/danger-zone-redirect-page-BpM01x_c.js +0 -1
  299. package/dist/assets/debug-page-BGhdwv9M.js +0 -4
  300. package/dist/assets/detail-card-GPqFZVmX.js +0 -1
  301. package/dist/assets/developer-page-DZdwzLQu.js +0 -1
  302. package/dist/assets/devices-page-ChwagiFL.js +0 -1
  303. package/dist/assets/dist-BItmZQO6.js +0 -1
  304. package/dist/assets/document-viewer-page-B-ShLH6Y.js +0 -1
  305. package/dist/assets/dropdown-ByHOpeOU.js +0 -1
  306. package/dist/assets/earn-credits-modal-BILKTI_F.js +0 -1
  307. package/dist/assets/effective-timezone-DYvVVpXt.js +0 -1
  308. package/dist/assets/emails-page-D_ZdkIHT.js +0 -1
  309. package/dist/assets/esm-BC-IlNg6.js +0 -2
  310. package/dist/assets/esm-BVzHqFEK.js +0 -2
  311. package/dist/assets/esm-CE4Ehw9K.js +0 -2
  312. package/dist/assets/esm-D4S5VlIC.js +0 -2
  313. package/dist/assets/esm-Ddwl5DWt.js +0 -2
  314. package/dist/assets/esm-ZgeaRH-O.js +0 -2
  315. package/dist/assets/esm-wMYgN14J.js +0 -1
  316. package/dist/assets/feature-flag-catalog-DjfXrBPD.js +0 -1
  317. package/dist/assets/file-editor-CgjwckHX.js +0 -1
  318. package/dist/assets/file-markdown-ZKvQUuGy.js +0 -2
  319. package/dist/assets/format-date-cTplgJ8P.js +0 -1
  320. package/dist/assets/general-page-61s8VehJ.js +0 -1
  321. package/dist/assets/hatching-screen-DiUygZtk.js +0 -1
  322. package/dist/assets/home-page-route-1hEkRjdv.js +0 -1
  323. package/dist/assets/identity-page-route-CbHcVb6m.js +0 -1
  324. package/dist/assets/impersonate-version-flag-BhxfH6iZ.js +0 -1
  325. package/dist/assets/index-B4Qq7TL7.js +0 -209
  326. package/dist/assets/index-CCPsEVwr.css +0 -2
  327. package/dist/assets/input-CoUmPnRU.js +0 -1
  328. package/dist/assets/integrations-page-vFP_lh3w.js +0 -1
  329. package/dist/assets/intelligence-layout-oIGPC8W1.js +0 -1
  330. package/dist/assets/keyboard-shortcuts-page-BzeIMUpj.js +0 -1
  331. package/dist/assets/library-detail-page-D0Dv3ZLJ.js +0 -1
  332. package/dist/assets/library-page-D7I-sk41.js +0 -1
  333. package/dist/assets/list-row-D5MFdbkH.js +0 -1
  334. package/dist/assets/llm-dimension-Tz2Fx8qB.js +0 -1
  335. package/dist/assets/loader-circle-Cz7opInR.js +0 -1
  336. package/dist/assets/local-mode-Bskd5bsT.js +0 -39
  337. package/dist/assets/local-settings-lVNyIOJ_.js +0 -1
  338. package/dist/assets/login-page-UotBWZu9.js +0 -1
  339. package/dist/assets/logs-layout-JUd7Ag6q.js +0 -1
  340. package/dist/assets/memory-page-route-DqM6EMFu.js +0 -1
  341. package/dist/assets/menu-Dy5QbnTj.js +0 -1
  342. package/dist/assets/messages-B2CZAuPN.js +0 -13
  343. package/dist/assets/middleware-pbPQ0upo.js +0 -1
  344. package/dist/assets/modal-D5nLWNN9.js +0 -1
  345. package/dist/assets/mutation-error-Bk_4pjgm.js +0 -1
  346. package/dist/assets/native-file-BZDk5eyB.js +0 -2
  347. package/dist/assets/notice-DkcNAP8O.js +0 -1
  348. package/dist/assets/notifications-page-BISnBOYH.js +0 -1
  349. package/dist/assets/page-shell-1qU5DIUF.js +0 -1
  350. package/dist/assets/panel-item-CouW2A55.js +0 -1
  351. package/dist/assets/password-reset-page-NF13YMiM.js +0 -1
  352. package/dist/assets/platform-detection-DGxL0AsS.js +0 -1
  353. package/dist/assets/plugins-page-DHiFqgxf.js +0 -1
  354. package/dist/assets/plugins-surface-B3Ro34dC.js +0 -1
  355. package/dist/assets/plus-DItfr5ux.js +0 -1
  356. package/dist/assets/popover-CFL4WZTr.js +0 -1
  357. package/dist/assets/prechat-BBwYr5Qb.js +0 -1
  358. package/dist/assets/prechat-names-Cjl3JzzN.js +0 -1
  359. package/dist/assets/prechat-route-BwML3ZL1.js +0 -1
  360. package/dist/assets/prefs-DNYLVDvB.js +0 -1
  361. package/dist/assets/privacy-page-DhxWA9mA.js +0 -1
  362. package/dist/assets/privacy-screen-DRGDGj0W.js +0 -1
  363. package/dist/assets/progress-bar-Ca8gmE3B.js +0 -1
  364. package/dist/assets/react-query.gen-DV9K_z-o.js +0 -1
  365. package/dist/assets/react-query.gen-LsPzqPq6.js +0 -1
  366. package/dist/assets/research-mock-page-CoMthbl4.js +0 -1
  367. package/dist/assets/research-onboarding-route-CeTflgoE.js +0 -63
  368. package/dist/assets/review-terms-screen-DAZ66rIh.js +0 -1
  369. package/dist/assets/risk-BQ3NV8r8.js +0 -3
  370. package/dist/assets/routes-BXlWEOF0.js +0 -1
  371. package/dist/assets/save-aD5JFIZf.js +0 -1
  372. package/dist/assets/schedules-Dz6392n3.js +0 -1
  373. package/dist/assets/security-page-BS1WxY0d.js +0 -1
  374. package/dist/assets/select-assistant-screen-z3B8ngdP.js +0 -1
  375. package/dist/assets/settings-layout-DFzwR63d.js +0 -1
  376. package/dist/assets/share-feedback-modal-DH2dhWbo.js +0 -1
  377. package/dist/assets/shortcut-keys-B2EE-634.js +0 -1
  378. package/dist/assets/skill-detail-page-CcZFUjdw.js +0 -1
  379. package/dist/assets/skill-icon-CgzIQCTT.js +0 -1
  380. package/dist/assets/skills-page-Di8dGQGo.js +0 -1
  381. package/dist/assets/sound-manager-CRFoAxE4.js +0 -1
  382. package/dist/assets/sounds-page-CF3gwgc9.js +0 -1
  383. package/dist/assets/stat-square-CTHnQ1jc.js +0 -1
  384. package/dist/assets/step-indicator-dots-B-KCGh9e.js +0 -1
  385. package/dist/assets/subagent-detail-panel-BqYWP0b9.js +0 -4
  386. package/dist/assets/system-events-page-DdvtYv0_.js +0 -1
  387. package/dist/assets/system-events-redirect-page-HeBGwZCZ.js +0 -1
  388. package/dist/assets/tag-CV4v7fRF.js +0 -1
  389. package/dist/assets/toast-xTp-xwYL.js +0 -1
  390. package/dist/assets/toggle-CDfguvUz.js +0 -1
  391. package/dist/assets/typed-storage-BRvgA7pX.js +0 -1
  392. package/dist/assets/typography-D5f7kt80.js +0 -1
  393. package/dist/assets/usage-page-CB5oigmL.js +0 -1
  394. package/dist/assets/use-bus-subscription-Cslzk2dW.js +0 -1
  395. package/dist/assets/use-invite-link-dialog-_LChrtmw.js +0 -1
  396. package/dist/assets/use-is-org-ready-1Xighdsa.js +0 -1
  397. package/dist/assets/use-skill-actions-mJaMNpfO.js +0 -1
  398. package/dist/assets/use-skill-categories-Bit2V2fA.js +0 -1
  399. package/dist/assets/utils-xg2dl_KJ.js +0 -1
  400. package/dist/assets/voice-page-Dfl4T4_g.js +0 -1
  401. package/dist/assets/weather-forecast-display-DOXofTcV.js +0 -1
  402. package/dist/assets/web-6YTn0Mpt.js +0 -1
  403. package/dist/assets/web-B6BDTvZe.js +0 -1
  404. package/dist/assets/web-BEtTYpif.js +0 -1
  405. package/dist/assets/web-BrbVmY32.js +0 -1
  406. package/dist/assets/web-C3rsbCeg.js +0 -1
  407. package/dist/assets/web-CBHy41qN.js +0 -1
  408. package/dist/assets/web-CIdUPUaN.js +0 -1
  409. package/dist/assets/web-DGaEiOw7.js +0 -1
  410. package/dist/assets/workflow-detail-panel-Dctg7w-3.js +0 -1
  411. package/dist/assets/workflow-store-CDrDxW5J.js +0 -1
  412. package/dist/assets/workspace-page-BWn-Je40.js +0 -1
  413. package/dist/assets/x-CkSVp1Ok.js +0 -1
  414. /package/dist/assets/{app-info-BxdEjcok.js → app-info-Clwt3pCt.js} +0 -0
  415. /package/dist/assets/{avatar-bundled-components-CMIiT9CS.js → avatar-bundled-components-ELDcio1Z.js} +0 -0
  416. /package/dist/assets/{avatar-svg-compositor-DQyPgWSC.js → avatar-svg-compositor-D7Dy9s1k.js} +0 -0
  417. /package/dist/assets/{browser-timezone-B2VEIYkv.js → browser-timezone-viO2H3SD.js} +0 -0
  418. /package/dist/assets/{build.umd-t16r8k1T.js → build.umd-D88jX3tx.js} +0 -0
  419. /package/dist/assets/{bundle-mjs-BZt35okJ.js → bundle-mjs-CK9sN9wG.js} +0 -0
  420. /package/dist/assets/{conversation-store-CynXqAcO.js → conversation-store-CnRrUeSu.js} +0 -0
  421. /package/dist/assets/{createLucideIcon-IRfcSUxS.js → createLucideIcon-Bjb-Kuq7.js} +0 -0
  422. /package/dist/assets/{definitions-Dj7uajgZ.js → definitions-EvNC1i1H.js} +0 -0
  423. /package/dist/assets/{definitions-CK0CSdwt.js → definitions-RERkHOnv.js} +0 -0
  424. /package/dist/assets/{dist-RkT480s0.js → dist-DyRKd0bN2.js} +0 -0
  425. /package/dist/assets/{edge-swipe-arbiter-store-VEaUoy3F.js → edge-swipe-arbiter-store-a9LiewmS.js} +0 -0
  426. /package/dist/assets/{emoji-catalog-data-Cp4IpzLe.js → emoji-catalog-data-D8lRMt3A.js} +0 -0
  427. /package/dist/assets/{environment-store-Bxe2pTvW.js → environment-store-BX22hkIL.js} +0 -0
  428. /package/dist/assets/{format-file-size-BLrV7wUA.js → format-file-size-DOE-vGl6.js} +0 -0
  429. /package/dist/assets/{native-deep-link-CPCbJkSt.js → native-deep-link-CbHUZ2h_.js} +0 -0
  430. /package/dist/assets/{onboarding-step-layout-Cup_f9lB.js → onboarding-step-layout-zvLUIT7j.js} +0 -0
  431. /package/dist/assets/{optimistic-lifecycle-C4YFdBr3.js → optimistic-lifecycle-BvfDBY8o.js} +0 -0
  432. /package/dist/assets/{pdf-jCZ1S_t-.js → pdf-OTWpgOp2.js} +0 -0
  433. /package/dist/assets/{pointer-qy7F2Zff.js → pointer-DcD0Nt7Z.js} +0 -0
  434. /package/dist/assets/{proxy-Cadlowdl.js → proxy-B6mdWM9d.js} +0 -0
  435. /package/dist/assets/{public-asset-WikBpVQd.js → public-asset-Cr86Gucv.js} +0 -0
  436. /package/dist/assets/{research-onboarding-persistence-D_h0dT1o.js → research-onboarding-persistence-C4LT0Ekr.js} +0 -0
  437. /package/dist/assets/{sdk.gen-CenbOmmb.js → sdk.gen-8pCB8ehU.js} +0 -0
  438. /package/dist/assets/{status-badge-pill-B_ninpnM.js → status-badge-pill-0N6rTEBg.js} +0 -0
  439. /package/dist/assets/{three-dot-indicator-BuZzHFUJ.js → three-dot-indicator-DNuHHwtA.js} +0 -0
  440. /package/dist/assets/{use-copy-to-clipboard-Ap1ESW2j.js → use-copy-to-clipboard-BCTXSMa-.js} +0 -0
  441. /package/dist/assets/{xterm-addon-fit-BmGG02AS.js → xterm-addon-fit-DNV09uVI.js} +0 -0
  442. /package/dist/assets/{xterm-CJZcgQLM.js → xterm-fGXm5t6D.js} +0 -0
@@ -0,0 +1,43 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t}from"./local-settings-C-dW2vkq.js";import{t as n}from"./capture-error-Dhiismgm.js";import{t as r}from"./react-DJZBPgpf.js";import{P as i,t as a}from"./button-BQVYX8n_.js";import{m as o,u as s}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as c}from"./QueryClientProvider-DKhXIxGb.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"./chevron-left-mpHv5ahd.js";import{t as f}from"./chevron-right-DDgSinGu.js";import{n as p,t as m}from"./animated-avatar-g_UuqPoB.js";import{t as h}from"./loader-circle-C9QrtO3C.js";import{t as g}from"./pencil-BOTCmXXR.js";import{t as _}from"./plus-D54jrPDF.js";import{t as v}from"./x-BYcSiJRX.js";import{t as y}from"./tag-D0AE0-aA.js";import{t as b}from"./input-6HVXMszw.js";import{i as x,r as S,t as C}from"./dist-Btg1osd6.js";import{n as w,t as T}from"./create-selectors-8NePGNlX.js";import{ct as E,f as D,o as O,y as k}from"./local-mode-Dydd46cS.js";import{Bn as A,V as j,Vn as M,_n as N,et as ee,gn as te,xr as ne}from"./sdk.gen-C9GJEKYV.js";import{r as re}from"./api-errors-CrWDzVca.js";import{F as P,I as F,L as ie,R as I,k as ae,n as oe}from"./auth-store-6jOlH4H3.js";import{a as se,o as ce,r as le}from"./api-Bf9f0SF-.js";import{c as ue}from"./routes-GPGveWZ8.js";import{n as L}from"./platform-detection-lm9it_11.js";import{o as de,s as fe}from"./prechat-jJWDBLel.js";import{t as pe}from"./browser-timezone-viO2H3SD.js";import{c as R}from"./conversation-list-fetchers-CRj2YEra.js";import{i as me,n as he,r as ge,t as _e}from"./research-onboarding-persistence-C4LT0Ekr.js";import{A as ve,B as ye,C as be,D as xe,E as Se,F as Ce,I as we,L as Te,M as Ee,N as De,O as z,P as Oe,R as B,S as V,T as ke,V as Ae,a as je,d as H,f as Me,g as Ne,i as Pe,j as Fe,k as Ie,m as Le,o as Re,p as ze,r as Be,s as Ve,t as U,v as He,w as Ue,x as We,y as Ge}from"./proxy-B6mdWM9d.js";import{t as Ke}from"./AnimatePresence-DqW6iWlh.js";import{t as W}from"./use-reduced-motion-ztQz2c8x.js";import{Cn as qe,Ct as Je,Ha as G,Mn as Ye,Pn as Xe,Sn as Ze,Sr as Qe,Tn as $e,Tt as et,Yi as tt,dt as nt,ft as K,gn as rt,hn as it,in as at,jr as ot,mn as st,pn as ct}from"./index-D_wKh03d.js";import{c as lt,i as ut,l as dt,n as ft,r as pt,s as mt,t as ht}from"./latest-assistant-text-Qj7hDn1c.js";import{n as gt,t as _t}from"./onboarding-step-layout-zvLUIT7j.js";var vt=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function yt(e,t){return Ee(e)?e[vt(0,e.length,t)]:e}var bt=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 xt(this.animations,`duration`)}get iterationDuration(){return xt(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 xt(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 St=class extends bt{then(e,t){return this.finished.finally(e).then(()=>{})}};function Ct(...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=Se(i,a,o);return t?s(r):s}function wt(e,t){return e in t}var Tt=class extends Ve{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(wt(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}},q=e(r(),1);function Et(e){let t=Ae(()=>V(e)),{isStatic:n}=(0,q.useContext)(Be);if(n){let[,n]=(0,q.useState)(e);(0,q.useEffect)(()=>t.on(`change`,n),[])}return t}function Dt(e,t){let n=Et(t()),r=()=>n.set(t());return r(),ye(()=>{let t=()=>Fe.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),ve(r)}}),n}function Ot(e){We.current=[],e();let t=Dt(We.current,e);return We.current=void 0,t}function kt(e,t,n,r){if(typeof e==`function`)return Ot(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return jt(e,t,n,r);let i=typeof t==`function`?t:Ct(t,n,r),a=Array.isArray(e)?At(e,i):At([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 At(e,t){let n=Ae(()=>[]);return Dt(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function jt(e,t,n,r){let i=Ae(()=>Object.keys(n)),a=Ae(()=>({}));for(let o of i)a[o]=kt(e,t,n[o],r);return a}function Mt(e){return typeof e==`object`&&!Array.isArray(e)}function Nt(e,t,n,r){return e==null?[]:typeof e==`string`&&Mt(t)?Ne(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Pt(e,t,n){return e*(t+1)+n*t}function Ft(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 It(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(B(e,i),r--)}}function Lt(e,t,n,r,i,a){It(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Ie(i,a,r[o]),easing:yt(n,o)})}function Rt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function zt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Bt=`easeInOut`,Vt=20;function Ht(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,Ft(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Ft(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Gt(e),{delay:l=0,times:u=Ue(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=be(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Jt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=Oe(b));let r=z(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&&ke(u,T),c.length===1&&c.unshift(null),m&&Te(m<Vt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Vt} or apply repeat at the sequence level instead.`),m&&m<Vt){let e=b>0?_/b:0;b=Pt(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`?De(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`:yt(f,e-1))}Rt(u,m,e)}let E=w+b;Lt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Ge(p)){let e=Ut(p,s);_(m,h,Wt(`default`,e))}else{let e=Nt(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Ut(r,s);for(let e in m)_(m[e],Kt(h,e),Wt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(zt);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(Ce(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Bt)),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 Ut(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Wt(e,t){return t[e]||(t[e]=[]),t[e]}function Gt(e){return Array.isArray(e)?e:[e]}function Kt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var qt=e=>typeof e==`number`,Jt=e=>e.every(qt);function Yt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Le(e)&&!ze(e)?new je(t):new Re(t);n.mount(e),H.set(e,n)}function Xt(e){let t=new Tt({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),H.set(e,t)}function Zt(e,t){return Ge(e)||typeof e==`number`||typeof e==`string`&&!Mt(t)}function Qt(e,t,n,r){let i=[];if(Zt(e,t))i.push(Pe(e,Mt(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Nt(e,t,r),o=a.length;we(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Yt:Xt;H.has(r)||s(r);let c=H.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...He(c,{...t,transition:l},{}))}}return i}function $t(e,t,n){let r=[];return Ht(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=V(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:xe}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Qt(n,e,t))}),r}function en(e){return Array.isArray(e)&&e.some(Array.isArray)}function tn(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),en(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=$t(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Qt(e,i,{...c,...r},t)}let l=new St(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{B(t.animations,l)})),l}return i}var nn=tn(),rn=`grounded`,an=12;function on(e,t){let n=e.slice(0,an).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 sn({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=on(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 cn({hostingParam:e,localMode:t,gatewayAuthSession:n}){return t?e===null?n:e!==`vellum-cloud`:!1}var ln=3e3,un=3e5,dn=`Failed to start your assistant. Please try again.`,fn=`Your assistant is taking longer than expected. Please try again.`,pn=e=>new Promise(t=>setTimeout(t,e));function mn({adoptExisting:e=!1,adoptAssistantId:t}={}){let[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(null),[s,c]=(0,q.useState)(null),l=(0,q.useRef)(!1),u=(0,q.useRef)([]),d=(0,q.useRef)(null),f=(0,q.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,q.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,q.useCallback)(()=>{if(l.current)return;l.current=!0;let r=Date.now(),i=()=>Date.now()-r>=un;(async()=>{if(e&&t){let e=O(t);if(e){o(e.assistantId),f(e.assistantId);return}}let r=e?t:void 0;if(!e)try{let e=await ce();if(e.ok)r=e.data.id,o(e.data.id);else{if(F(e.status,e.error)){p(P);return}if(!I(e.status)){p(re(e.error,void 0,dn));return}}}catch(e){n(e,{context:`research_background_hatch`})}let a;for(;!a;){if(i()){p(fn);return}try{let e=await le(r);r&&!e.ok&&e.status===404&&(r=void 0,e=await le());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){n(e,{context:`research_background_hatch_poll`})}await pn(ln)}if(e)for(;!await k();){if(i()){p(fn);return}await pn(ln)}else for(;;){try{if((await se(a)).ok)break}catch{}if(i()){p(fn);return}await pn(ln)}f(a)})()},[p,f,e,t]),ready:r,assistantId:a,error:s,awaitReady:(0,q.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 hn(e,t){try{await j({path:{assistant_id:e,id:t},throwOnError:!1})}catch(e){n(e,{context:`research_onboarding_archive`})}}var gn=`vellum_pending_plugin_install`;function _n(){let e=t(gn,``);if(!e)return null;try{let t=JSON.parse(e);return typeof t?.pluginId!=`string`||!t.pluginId||typeof t.ts!=`number`||Date.now()-t.ts>36e5?null:t.pluginId}catch{return null}}function vn(){let e=_n();return e?[e]:[]}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,...vn(),...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 M({path:{assistant_id:e},throwOnError:!1})).data?.matches??[])}catch(e){return n(e,{context:`research_onboarding_catalog`}),{capabilities:[],validNames:new Set}}}async function Ln(e,t){try{await A({path:{assistant_id:e},body:{name:t},throwOnError:!1})}catch(e){n(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:t,status:r,subject:i,claims:a,suggestions:o,plugins:s,installedPlugins:c}){try{await ne({path:{assistant_id:e},body:{type:`onboarding_research`,...r===`done`?{daemon_event_id:`onboarding_research:${t}`}:{},fields:{conversation_id:t,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){n(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,t]=(0,q.useState)({status:`idle`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),r=(0,q.useRef)(0),i=(0,q.useRef)(null),a=(0,q.useRef)(new Map),o=(0,q.useRef)(Promise.resolve()),s=c(),l=(0,q.useCallback)(({awaitAssistantId:e,subject:c,conversationTitle:l,resumeConversationId:u,onConversationCreated:d,includeSuggestions:f=!0})=>{let p=JSON.stringify(c);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(),t({status:`running`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),(async()=>{let r,i,o=!1;try{let n=await e();if(r=n,h())return;let{capabilities:s,validNames:p}=await In(n);if(h())return;let m=Object.fromEntries(s.map(e=>[e.name,e.description]));t(e=>({...e,pluginCatalog:m})),p.size===0&&g();let _=a.current,v=wn(c.occupation,p);for(let e of v)_.has(e)||_.set(e,Ln(n,e));v.length>0&&t(e=>({...e,installedPlugins:v}));let y=async e=>{let t={conversationId:e,content:sn(c,s,{includeSuggestions:f}),sourceChannel:`vellum`,interface:`web`,clientOs:L(),clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(t.clientTimezone=e)}catch{}return!!(await N({path:{assistant_id:n},body:t,throwOnError:!1})).response?.ok},b=async()=>{let e=await ee({path:{assistant_id:n},body:{conversationType:`standard`,...l?{title:l}:{}},throwOnError:!1});i=e.data?.id;let t=e.data?.id;if(!(!e.response?.ok||!t))return d?.(t),t},x;if(u){let e=await te({path:{assistant_id:n},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)){t(e=>({...e,status:`error`}));return}if(h())return}}if(!x){if(x=await b(),h())return;if(!x){t(e=>({...e,status:`error`}));return}if(!await y(x)){t(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 te({path:{assistant_id:n},query:{conversationId:x},throwOnError:!1});if(h())return;let r=ht(e.data?.messages??[]);if(r){let{claims:e,suggestions:i,plugins:a,pluginsResolved:s,complete:l}=it(r),u=a.filter(e=>p.has(e));for(let e of u)_.has(e)||_.set(e,Ln(n,e));s&&g();let d=Hn({role:c.occupation,validNames:p,modelPlugins:u});if(t({status:`running`,claims:e,suggestions:i,installedPlugins:d,pluginCatalog:m}),E=e,D=i,O=a,k=d,l&&(o=!0),l&&!T&&(T=!0,Bn({assistantId:n,conversationId:x,status:`done`,subject:c,claims:e,suggestions:i,plugins:a,installedPlugins:d})),w=r===C?w+1:0,C=r,On({complete:l,stableReads:w}))break}}if(h())return;T||(T=!0,Bn({assistantId:n,conversationId:x,status:`error`,subject:c,claims:E,suggestions:D,plugins:O,installedPlugins:k})),t(e=>({...e,status:kn({sawCompletePayload:o})}))}catch(e){if(h())return;n(e,{context:`research_onboarding_runner`}),t(e=>({...e,status:`error`}))}finally{g(),An({sawCompletePayload:o})&&r&&i&&(await hn(r,i),Qe(s,r))}})()},[s]),u=(0,q.useCallback)(async()=>{await o.current,await Promise.all([...a.current.values()])},[]),d=(0,q.useCallback)((e,n)=>{if(r.current+=1,t(e),n&&e.installedPlugins.length>0){let t=a.current;t.clear();for(let r of e.installedPlugins)t.set(r,(async()=>{try{await Ln(await n(),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:t,removedClaims:r,rejectedAll:i}){let a=Wn({removedClaims:r,rejectedAll:i});if(a){try{let n={conversationId:t,content:a,sourceChannel:`vellum`,interface:`web`,clientOs:L(),clientMessageId:crypto.randomUUID()};await N({path:{assistant_id:e},body:n,throwOnError:!1})}catch(e){n(e,{context:`research_onboarding_correction`})}await hn(e,t)}}var Kn=1500,qn=12e4,Jn=e=>new Promise(t=>setTimeout(t,e));async function Yn({awaitAssistantId:e,values:t,userName:r,assistantName:i}){let a,o;try{a=await e();let n=await ee({path:{assistant_id:a},body:{conversationType:`standard`,title:`Updating personality`},throwOnError:!1});if(o=n.data?.id,!n.response?.ok||!o)return;let s={conversationId:o,content:lt(t,r,i),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};if(!(await N({path:{assistant_id:a},body:s,throwOnError:!1})).response?.ok)return;await mt(a,ut(t));let c=Date.now()+qn,l=``,u=0,d=!1;for(;Date.now()<c;){await Jn(Kn);let e=await te({path:{assistant_id:a},query:{conversationId:o},throwOnError:!1}),t=ht(e.data?.messages??[]);if(t&&(u=t===l?u+1:0,l=t),e.data?.processing===!0&&(d=!0),dt({processing:e.data?.processing,sawProcessing:d,hasReply:t.length>0,stableReads:u}))break}}catch(e){n(e,{context:`research_onboarding_personality`})}finally{if(a&&o)try{await j({path:{assistant_id:a,id:o},throwOnError:!1})}catch(e){n(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 J=l(),Qn=(0,q.createContext)(null);function $n({size:e,children:t}){return(0,J.jsx)(Qn.Provider,{value:e,children:t})}function er(){let e=(0,q.useContext)(Qn),[t,n]=(0,q.useState)(()=>pt());return(0,q.useEffect)(()=>{if(e)return;let t=()=>n(pt());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var tr={x:.5,y:.4},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;function lr(e){return ar[ir[e]??1]??1}function ur(e){return or[ir[e]??1]??1}function dr(e){return sr[ir[e]??1]??20}function fr(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function pr(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function mr(e,t,n){let r=n*.4,i=n*.48;return[{x:i,y:i},{x:e*.3,y:r},{x:e*.72,y:r},{x:e-i,y:i},{x:e-r,y:t*.72},{x:e-i,y:t-i},{x:i,y:t-i},{x:r,y:t*.5},{x:e-r,y:t*.3},{x:e*.38,y:t-r},{x:e*.62,y:t-r}]}function hr(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 gr({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=er(),u=W(),d=c<640,f=new Set([4,7,8,9,10]),p=e=>d&&f.has(e),h=fr(c,l),g=h/2,_=h/2,v=pr(c,l)/h,y=pr(c,l),b=(0,q.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),x=tr.x*c,S=tr.y*l,C=x-g,w=S-g,T=(0,q.useMemo)(()=>mr(c,l,_),[c,l,_]);return(0,J.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0 overflow-hidden`,children:[(0,J.jsx)(`div`,{className:`absolute rounded-[50%] bg-[var(--aux-black,#000)] opacity-20 blur-md`,style:{width:y*.62,height:16,left:x-y*.31,top:S+y*.4}}),t.map((t,r)=>{let d=r===n,f=!u&&i?.char===r,_=!u&&a?.char===r;if(f){let n=T[i.fromSlot],a=hr(n,x,S,c,l),s=lr(i.fromSlot),u=ur(i.fromSlot);return(0,J.jsx)(U.div,{className:`absolute left-0 top-0`,style:{width:h,height:h,zIndex:cr},initial:!1,animate:{x:[n.x-g,a.x-g,a.x-g,C,C,C],y:[n.y-g,a.y-g,a.y-g,w,w,w],scale:[s,s,s,v*.7,v*1.08,v],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,J.jsx)(m,{components:e,traits:t,size:h})},r)}if(_){if(p(a.toSlot))return null;let n=T[a.toSlot],i=hr(n,x,S,c,l),o=lr(a.toSlot),s=ur(a.toSlot);return(0,J.jsx)(U.div,{className:`absolute left-0 top-0`,style:{width:h,height:h,zIndex:dr(a.toSlot)},initial:!1,animate:{x:[C,C,i.x-g,i.x-g,n.x-g,n.x-g],y:[w,w,i.y-g,i.y-g,n.y-g,n.y-g],scale:[v,v*.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,J.jsx)(`div`,{style:{transform:`rotate(${rr(a.toSlot)}deg)`},children:(0,J.jsx)(m,{components:e,traits:t,size:h,breathe:!1})})},r)}let y=b.get(r)??0;if(!d&&p(y))return null;let E=d?{x,y:S}:T[y];return(0,J.jsx)(U.div,{className:`absolute left-0 top-0 ${d?``:`pointer-events-auto cursor-pointer`}`,style:{width:h,height:h,zIndex:d?cr:dr(y)},initial:!1,animate:{x:E.x-g,y:E.y-g,scale:d?v:lr(y),opacity:d?1:ur(y)},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:d?void 0:()=>s(r),children:(0,J.jsx)(`div`,{style:{transform:d?void 0:`rotate(${rr(b.get(r)??0)}deg)`},children:(0,J.jsx)(m,{components:e,traits:t,size:h,breathe:d})})},r)})]})}var _r=[{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`}],Y=T(w((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:_r,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 vr(){let[e,t]=(0,q.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,q.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function yr(){let e=K(),t=Y.use.characters(),n=Y.use.ensureGenerated(),r=W(),{w:i,h:a}=vr();(0,q.useEffect)(()=>{e&&n(e)},[e,n]);let o=fr(i,a),s=(0,q.useMemo)(()=>mr(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,J.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*lr(i),f=ur(i),p=dr(i);return(0,J.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,J.jsx)(`div`,{style:{opacity:f,transform:`rotate(${u}deg)`},children:(0,J.jsx)(m,{components:e,traits:t,size:d,breathe:!1})})},n)})})}var br=i(`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)]`),xr=i(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`,_t);function X(e){return e.trim().toLowerCase()}function Sr(e,t,n=[],r=8){let i=X(t),a=new Set(n.map(X)),o=[];for(let t of e)if(!a.has(X(t))&&((i.length===0||X(t).includes(i))&&o.push(t),o.length>=r))break;return o}function Cr({id:e,options:t,highlighted:n,showAddHint:r,onPick:a,onHover:o}){return(0,J.jsxs)(`ul`,{id:e,role:`listbox`,className:i(`absolute left-0 right-0 top-full z-50 mt-1.5 max-h-60 overflow-auto`,`rounded-lg bg-[var(--surface-lift)] p-1 shadow-[var(--shadow-popover)]`,`animate-[fadeInUp_0.12s_ease-out]`),children:[t.map((t,r)=>(0,J.jsx)(`li`,{id:`${e}-opt-${r}`,role:`option`,"aria-selected":r===n,onMouseDown:e=>{e.preventDefault(),a(t.value)},onMouseEnter:()=>o(r),className:i(`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5`,`text-body-medium-lighter text-[var(--content-default)]`,r===n?`bg-[var(--surface-base)]`:`bg-transparent`),children:t.isAdd?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(_,{size:15,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,J.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Add “`,t.value,`”`]}),(0,J.jsx)(`span`,{className:`ml-auto shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:`↵ Enter`})]}):t.value},t.isAdd?`__add__${t.value}`:t.value)),r&&(0,J.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 wr({htmlFor:e,required:t,children:n}){return(0,J.jsxs)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:[n,t?(0,J.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`}):null]})}function Tr(e,t){(0,q.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function Er({label:e,placeholder:t,values:n,onChange:r,suggestions:a}){let o=(0,q.useId)(),s=`tac-${o}`,c=`tac-list-${o}`,l=(0,q.useRef)(null),[u,d]=(0,q.useState)(``),[f,p]=(0,q.useState)(!1),[m,h]=(0,q.useState)(-1),g=(0,q.useMemo)(()=>Sr(a,u,n),[a,u,n]),_=u.trim(),v=(0,q.useMemo)(()=>{if(!_)return!1;let e=X(_);return!(n.some(t=>X(t)===e)||g.some(t=>X(t)===e))},[_,n,g]),b=(0,q.useMemo)(()=>{let e=g.map(e=>({value:e,isAdd:!1}));return v?[...e,{value:_,isAdd:!0}]:e},[g,v,_]);Tr(l,()=>p(!1)),(0,q.useEffect)(()=>{h(e=>e>=b.length?b.length-1:e)},[b.length]);let x=f&&b.length>0,S=!v;function C(e){let t=e.trim();t&&(n.some(e=>X(e)===X(t))||r([...n,t]),d(``),h(-1))}function w(e){r(n.filter(t=>t!==e))}function T(e){e.key===`ArrowDown`?(e.preventDefault(),p(!0),h(e=>Math.min(e+1,b.length-1))):e.key===`ArrowUp`?(e.preventDefault(),h(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,J.jsxs)(`div`,{ref:l,className:`relative flex flex-col gap-1.5`,children:[(0,J.jsx)(wr,{htmlFor:s,children:e}),(0,J.jsxs)(`div`,{className:i(br,`min-h-9 flex-wrap py-1.5`),children:[(0,J.jsx)(tt,{size:16,"aria-hidden":!0,className:`shrink-0 self-center text-[var(--content-tertiary)]`}),n.map(e=>(0,J.jsx)(y,{onRemove:()=>w(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,J.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:i(xr,`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,J.jsx)(Cr,{id:c,options:b,highlighted:m,showAddHint:S,onPick:C,onHover:h})]})}var Dr=`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 Z(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function Or({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[r,i]=(0,q.useState)(e),[o,s]=(0,q.useState)(t),[c,l]=(0,q.useState)(``),[u,d]=(0,q.useState)([]),f=r.trim().length>0&&c.trim().length>0;function p(){f&&n({firstName:r,lastName:o,role:c,hobbies:u})}return(0,J.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,J.jsxs)(ct,{showCreatureFooter:!1,children:[(0,J.jsx)(yr,{}),(0,J.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,J.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:Z(.05),children:`Let's start with you.`}),(0,J.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:Z(.12),children:`A few details so I can get to know you.`}),(0,J.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,J.jsx)(`div`,{style:Z(.2,40),children:(0,J.jsx)(b,{label:(0,J.jsxs)(J.Fragment,{children:[`What should I call you?`,(0,J.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`})]}),placeholder:`Your name`,value:r,onChange:e=>i(e.target.value),className:_t,autoFocus:!0,required:!0,fullWidth:!0})}),(0,J.jsx)(`div`,{style:Z(.27,30),children:(0,J.jsx)(b,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),className:_t,fullWidth:!0})}),(0,J.jsx)(`div`,{style:Z(.34,20),children:(0,J.jsx)(b,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:e=>l(e.target.value),className:_t,required:!0,fullWidth:!0})}),(0,J.jsx)(`div`,{style:Z(.41,10),children:(0,J.jsx)(Er,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:u,onChange:d,suggestions:Dr})})]}),(0,J.jsx)(`div`,{className:`mt-10 w-full`,style:Z(.5),children:(0,J.jsx)(a,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,J.jsx)(G,{size:16}),fullWidth:!0,disabled:!f,className:`h-11 text-base`,children:`Continue`})})]})]})})}function kr(){let e=K(),t=Y.use.characters(),n=Y.use.selectedIndex();return(0,q.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return $e(i??`var(--surface-base)`)},[e,t,n])}function Q({onBack:e,onNext:t,tone:n}){let r=kr(),i=n?n===`dark`?`#1A1A1A`:`#FFFFFF`:r.fg,a=n?n===`dark`?`rgba(0,0,0,0.08)`:`rgba(255,255,255,0.12)`:r.wash;return(0,J.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Back`,className:`flex cursor-pointer h-8 w-8 items-center justify-center rounded-md transition-colors duration-150`,style:{color:i},onMouseEnter:e=>e.currentTarget.style.backgroundColor=a,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:(0,J.jsx)(d,{className:`h-5 w-5`})}),t?(0,J.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Forward`,className:`flex cursor-pointer h-8 w-8 items-center justify-center rounded-md transition-colors duration-150`,style:{color:i},onMouseEnter:e=>e.currentTarget.style.backgroundColor=a,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:(0,J.jsx)(f,{className:`h-5 w-5`})}):null]})}var Ar=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function jr(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function Mr({onContinue:e,onBack:t,onForward:n}){let r=K(),i=Y.use.characters(),o=Y.use.ensureGenerated(),s=Y.use.selectedIndex(),c=Y.use.setSelectedIndex();(0,q.useEffect)(()=>{r&&o(r)},[r,o]);let l=i.length,[d,f]=(0,q.useState)(null),[m,h]=(0,q.useState)(``),[_,v]=(0,q.useState)(!1),y=(0,q.useRef)(!1),b=(0,q.useRef)(null),{ref:x,size:S}=ft(),[C,w]=(0,q.useState)(null);(0,q.useEffect)(()=>{l>0&&d===null&&f(jr(l,s))},[l,s,d]),(0,q.useEffect)(()=>{d&&c(d.centerChar)},[d,c]);let T=d?.centerChar;(0,q.useEffect)(()=>{T!=null&&!y.current&&h(Ar[T%Ar.length])},[T]),(0,q.useEffect)(()=>{_&&(b.current?.focus(),b.current?.select())},[_]);function E(e){if(!d||e===d.centerChar)return;let t=d.edgeOrder.indexOf(e);if(t<0)return;let n=[...d.edgeOrder];n[t]=d.centerChar,w({entering:{char:e,fromSlot:t},exiting:{char:d.centerChar,toSlot:t}}),f({centerChar:e,edgeOrder:n})}let D=()=>d&&E((d.centerChar+1)%l),O=()=>d&&E((d.centerChar-1+l)%l),k=(0,q.useMemo)(()=>d?i[d.centerChar]:void 0,[d,i]),A=!!r&&!!d&&!!k;function j(){k&&e({traits:k,name:m.trim()})}function M(){y.current=!0,h(e=>{let t=Ar.filter(t=>t!==e),n=t.length>0?t:Ar;return n[Math.floor(Math.random()*n.length)]})}let N=`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,J.jsx)(`div`,{ref:x,"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,J.jsxs)($n,{size:S,children:[A&&(0,J.jsx)(gr,{components:r,characters:i,centerChar:d.centerChar,edgeOrder:d.edgeOrder,entering:C?.entering??null,exiting:C?.exiting??null,onEnterComplete:e=>w(t=>t?.entering.char===e?null:t),onSelectChar:E}),(0,J.jsx)(Q,{tone:`light`,onBack:t,onNext:n?j:void 0}),(0,J.jsx)(`h1`,{className:`absolute left-1/2 top-[19%] z-10 -translate-x-1/2 whitespace-nowrap text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.4s ease-out both`},children:`Give me a face and a name`}),(0,J.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:O,className:`absolute left-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${N}`,children:(0,J.jsx)(u,{className:`h-4 w-4`})}),(0,J.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:D,className:`absolute right-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${N}`,children:(0,J.jsx)(G,{className:`h-4 w-4`})}),(0,J.jsxs)(`div`,{className:`absolute left-1/2 top-[51%] z-10 flex -translate-x-1/2 flex-col items-center gap-12`,children:[_?(0,J.jsx)(`input`,{ref:b,value:m,onChange:e=>{y.current=!0,h(e.target.value)},onBlur:()=>v(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v(!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,J.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>v(!0),"aria-label":`Edit name`,className:`flex cursor-pointer items-center gap-2.5`,children:[(0,J.jsx)(`span`,{className:`text-3xl font-medium ${m?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:m||`Name your assistant`}),(0,J.jsx)(g,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,J.jsx)(`button`,{type:`button`,onClick:M,"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,J.jsx)(p,{className:`h-5 w-5`})})]}),(0,J.jsx)(a,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,J.jsx)(G,{size:16}),disabled:!A,onClick:j,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})})}var Nr=.25,Pr=.46,Fr=.3,Ir=.85,Lr=40,Rr=14,zr=8;function Br({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0,settleBlink:r=!0}){let i=K(),a=Y.use.characters(),o=Y.use.selectedIndex(),s=W(),{w:c,h:l}=er(),[u,d]=(0,q.useState)({x:0,y:0});(0,q.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=Xe();(0,q.useEffect)(()=>{n>0&&!s&&p.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,s,p]);let[m,h]=(0,q.useState)(!1),[g,_]=(0,q.useState)(!e);(0,q.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,q.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=>Ze(e.svgPath)))}:null},[i,v]);if(!y)return null;let b=c*Ir,x=Math.min(Math.min(c,l)*Fr,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,C=(c-S)/2,w=l-(1-Nr)*x,T=Lr/100*l-(w+x/2),E=(Pr-Nr)*x,D=y.bbox.x+y.bbox.w/2,O=y.bbox.y+y.bbox.h/2;return(0,J.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,J.jsx)(U.div,{animate:p,children:(0,J.jsx)(`div`,{style:{transform:`translate(${u.x*Rr}px, ${u.y*zr}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,J.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,J.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,J.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}var Vr=200,Hr=40;function Ur({firstName:e,assistantName:t,onContinue:n,onBack:r,onForward:i}){let o=K(),s=Y.use.characters(),c=Y.use.selectedIndex(),l=W(),{ref:u,size:{w:d,h:f}}=ft(),p=kr(),m=s.length>0?s[c]:void 0,h=(0,q.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,J.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=Vr/v,C=(Hr/100-.5)*f;return(0,J.jsx)(`div`,{ref:u,"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:(0,J.jsxs)($n,{size:{w:d,h:f},children:[(0,J.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,J.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,J.jsx)(`path`,{d:h.body.svgPath,fill:h.color})}),(0,J.jsx)(Br,{entrance:!0}),(0,J.jsx)(U.div,{initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.4,delay:1},children:(0,J.jsx)(Q,{onBack:r,onNext:i})}),(0,J.jsxs)(`div`,{className:gt,children:[(0,J.jsxs)(U.h1,{className:`text-center leading-[1.05]`,style:{fontFamily:`var(--font-serif)`},initial:l?!1:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:l?{duration:0}:{type:`spring`,stiffness:260,damping:11,delay:1},children:[(0,J.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fgDeep},children:g}),(0,J.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fg},children:_})]}),(0,J.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,J.jsx)(a,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,J.jsx)(G,{size:16}),onClick:n,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})})}var Wr=.3,Gr=.85,Kr=.25;function qr(){let e=K(),t=Y.use.characters(),n=Y.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=er(),o=(0,q.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=>Ze(e.svgPath)))}:null},[e,r]),s=o?Math.min(Math.min(i,a)*Wr,i*Gr*o.bbox.h/o.bbox.w):0;return{art:o,eyesW:o?s*o.bbox.w/o.bbox.h:0,eyesH:s,restCy:a-Kr*s,centerX:i/2,w:i,h:a}}function Jr({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=kt(i,e=>e-n/2),u=e.bbox.x+e.bbox.w/2,d=e.bbox.y+e.bbox.h/2;return(0,J.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,J.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,J.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,J.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})}var Yr={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 Xr(e,t){let n=Yr[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var Zr=new Set([`orange`,`pink`,`red`]);function Qr(e,t){return Zr.has(e)&&Zr.has(t)}function $r(e,t,n){let r=Xr(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>Qr(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var ei=`You’ve used AI that just answers questions`,ti=`The more I help`,ni=`I’m different`,ri=`The better I get`,ii=`and the less you have to do`,ai=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],oi=290;function si({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,J.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,J.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,J.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:e},children:(0,J.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,J.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:t},children:(0,J.jsx)(`span`,{className:`block`,children:i})})]})})}function ci({onContinue:e,onBack:t,onForward:n}){let r=kr(),i=W(),{art:o,eyesW:s,eyesH:c,restCy:l,centerX:u,w:d,h:f}=qr(),p=K(),h=Y.use.characters(),g=Y.use.selectedIndex(),_=h.length>0?h[g]:void 0,v=f>0&&f<=800,y=v?.17:.22,b=v?`top-[17%]`:`top-[22%]`,x=Et(0),S=Et(1),C=(0,q.useMemo)(()=>!p||!_?`orange`:$r(_.color,p.colors.map(e=>e.id),1)[0]??`orange`,[p,_]),w=Math.min(220,Math.max(150,d*.16)),T=-w,E=-w*.4,D=Et(-220),O=(0,q.useMemo)(()=>!p||!_?[]:$r(_.color,p.colors.map(e=>e.id),3),[p,_]),k=Math.max(.42,Math.min(d/1100,1)),A=Math.round(oi*k),j=-A*1.1,M=-A*.42,N=Et(-320),[ee,te]=(0,q.useState)(!!i),[ne,re]=(0,q.useState)(!!i),[P,F]=(0,q.useState)(!1),[ie,I]=(0,q.useState)(!1),[ae,oe]=(0,q.useState)(!1),[se,ce]=(0,q.useState)(!1),[le,ue]=(0,q.useState)(!!i),L=Math.min(d,768)-48,de=(0,q.useRef)(null),fe=(0,q.useRef)(null),pe=(0,q.useRef)(null),R=(0,q.useRef)(null),me=(0,q.useRef)(null),[he,ge]=(0,q.useState)(0),[_e,ve]=(0,q.useState)(0),[ye,be]=(0,q.useState)(0),[xe,Se]=(0,q.useState)(0),[Ce,we]=(0,q.useState)(0);return(0,q.useLayoutEffect)(()=>{de.current?.offsetHeight&&ge(de.current.offsetHeight),fe.current?.offsetHeight&&ve(fe.current.offsetHeight),pe.current?.offsetHeight&&be(pe.current.offsetHeight),R.current?.offsetHeight&&Se(R.current.offsetHeight),me.current?.offsetHeight&&we(me.current.offsetHeight)},[L]),(0,q.useEffect)(()=>{x.set(l),ce(!0)},[l,x]),(0,q.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>{F(!0),I(!0),oe(!0)},1400);return()=>clearTimeout(e)},[i]),(0,q.useEffect)(()=>{if(i||!o)return;x.set(l),S.set(1),D.set(T),N.set(j),te(!1),re(!1),F(!1),I(!1);let e=Math.max(c*.5,f*y-36),t=[],n=[],r=!1,a=e=>(t.push(e),e),s=e=>new Promise(t=>{n.push(setTimeout(t,e))});return(async()=>{if(await s(200),r||(te(!0),await Promise.all([a(nn(x,e,{duration:.55,ease:`easeOut`})),a(nn(S,.55,{duration:.55,ease:`easeOut`}))]),r)||(re(!0),await Promise.all([a(nn(x,l,{type:`spring`,stiffness:210,damping:15})),a(nn(S,1,{duration:.45,ease:`easeOut`}))]),r)||(await s(900),r)||(F(!0),I(!0),await a(nn(D,[T,E,E,T],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`})),r)||(await s(150),r))return;oe(!0);let t=a(nn(N,[j,M,M,j],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`}));await s(700),!r&&(ue(!0),await t)})(),()=>{r=!0,t.forEach(e=>e.stop()),n.forEach(clearTimeout)}},[i,o,f,y,c,l,x,S,D,T,E,N,j,M]),(0,J.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:r.fg},children:[(0,J.jsx)(Q,{onBack:t,onNext:n}),(0,J.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:L,fontFamily:`var(--font-serif)`},children:[(0,J.jsx)(`span`,{ref:de,className:`block`,children:ei}),(0,J.jsx)(`span`,{ref:fe,className:`block`,children:ti}),(0,J.jsx)(`span`,{ref:pe,className:`block`,children:ni}),(0,J.jsx)(`span`,{ref:R,className:`block`,children:ri}),(0,J.jsx)(`span`,{ref:me,className:`block`,children:ii})]}),se&&o&&(0,J.jsx)(Jr,{art:o,eyesW:s,eyesH:c,centerX:u,eyeCy:x,eyeScale:S,blinking:!1}),!i&&p&&(0,J.jsx)(U.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{left:Math.max(16,d*.05),top:0,y:D,width:w,height:w},children:(0,J.jsx)(m,{components:p,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:C},size:w,breathe:!1})}),!i&&p&&(0,J.jsx)(U.div,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 top-0 z-[1] flex items-start`,style:{right:-Math.round(A*.12),y:N},children:ai.map((e,t)=>(0,J.jsx)(`div`,{style:{width:A,height:A,marginLeft:t===0?0:-A*.34,zIndex:ai.length-t},children:(0,J.jsx)(m,{components:p,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:O[t]??`teal`},size:A,breathe:!1})},e.bodyShape))}),(0,J.jsxs)(`div`,{className:`${gt.replace(`top-[30%]`,b)} max-w-3xl`,children:[(0,J.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,J.jsx)(si,{firstH:he,secondH:_e,color:r.fgDeep,firstText:ei,secondText:ti,revealed:ee,carouseled:P,revealFrom:`bottom`,revealDuration:.55,reduce:!!i}),(0,J.jsx)(si,{firstH:ye,secondH:xe,color:r.fg,firstText:ni,secondText:ri,revealed:ne,carouseled:ie,revealFrom:`top`,revealDuration:.45,reduce:!!i}),(0,J.jsx)(U.div,{className:`relative w-full overflow-hidden`,style:{color:r.fg},initial:!1,animate:{height:ae?Ce:0},transition:i?{duration:0}:{duration:.5,ease:`easeInOut`},children:Ce>0&&(0,J.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:Ce},children:(0,J.jsx)(U.span,{className:`block`,initial:!1,animate:{clipPath:ae?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:i?{duration:0}:{duration:.5,ease:`easeOut`},children:ii})})})]}),le&&(0,J.jsx)(U.div,{initial:i?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:i?{duration:0}:{duration:.4},children:(0,J.jsx)(a,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,J.jsx)(G,{size:16}),onClick:e,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})}function li({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cs-${e}`;return(0,J.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,J.jsxs)(`defs`,{children:[(0,J.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,J.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,J.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,J.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,J.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,J.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,J.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,J.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,J.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,J.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,J.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,J.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,J.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,J.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,J.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,J.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,J.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,J.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,J.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,children:[(0,J.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,J.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,J.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#F4C12A`,children:`$`})]}),(0,J.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,J.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${i})`})]})}function ui({size:e,tiltX:t=0,tiltY:n=0,shadow:r=!0,spinning:i=!1,className:a}){return(0,J.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[r&&(0,J.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,J.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,J.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,J.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(0.5px)`},children:(0,J.jsx)(li,{idSuffix:`front`})}),(0,J.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,J.jsx)(li,{idSuffix:`back`})})]})})]})}var di=.3,fi=.95;function pi({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=W(),a=kr(),{h:o}=er(),[s,c]=(0,q.useState)(!1);function l(){if(!s){if(c(!0),i){e();return}window.setTimeout(t,di*1e3)}}let u=o*.42,d=-o*.08,f=o*.9;return(0,J.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,J.jsx)(Q,{onBack:n,onNext:r}),(0,J.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,J.jsx)(`h1`,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here are some free credits to get started`}),(0,J.jsx)(`div`,{className:`mt-8 flex flex-col items-center gap-4`,children:(0,J.jsx)(U.div,{animate:s&&!i?{y:[0,u,d,f],scale:[1,1,1,.2],opacity:[1,1,1,0]}:{},transition:{duration:fi,times:[0,di/fi,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]},onAnimationComplete:()=>{s&&e()},children:(0,J.jsx)(ui,{size:88,spinning:s&&!i})})}),!s&&(0,J.jsxs)(`button`,{type:`button`,onClick:l,className:`mt-6 flex cursor-pointer h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97]`,style:{backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Claim`,(0,J.jsx)(G,{className:`h-4 w-4`})]})]})]})}nt();var mi=640,hi=[{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`}}],gi=[`9%`,`27%`,`45%`,`62%`,`79%`],$=50,_i=.3*.75,vi=`rgba(36, 41, 46, 0.2)`,yi=`#FDFDFC`,bi=.16;function xi(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 Si(){let[e,t]=(0,q.useState)(()=>typeof window>`u`?1280:window.innerWidth);return(0,q.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Ci({components:e,traits:t,side:n,top:r,size:i,progress:a}){let o=Math.max(0,Math.min(1,a)),s=100+bi*100,c=n===`left`?-100+s*o:100-s*o;return(0,J.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,J.jsx)(m,{components:e,traits:t,size:i,breathe:!1})})}function wi({axis:e,value:t,onValueChange:n,fg:r,disabled:i}){return(0,J.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,J.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,J.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,J.jsxs)(C,{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]??$),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,J.jsx)(x,{className:`relative h-2 w-full grow rounded-full sm:h-3`,style:{backgroundColor:vi}}),(0,J.jsx)(S,{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:yi}})]})]})}function Ti({components:e,values:t,sideAvatars:n,size:r}){return(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10`,children:hi.map((i,a)=>{let o=t[i.id]??$,s=Math.max(0,($-o)/$),c=Math.max(0,(o-$)/$),l=gi[a]??`50%`,u=n[a];return u?(0,J.jsxs)(`div`,{children:[(0,J.jsx)(Ci,{components:e,traits:u.left,side:`left`,top:l,size:r,progress:s}),(0,J.jsx)(Ci,{components:e,traits:u.right,side:`right`,top:l,size:r,progress:c})]},i.id):null})})}function Ei({values:e,onValueChange:t,locked:n,onContinue:r,onBack:i,onForward:a}){let o=kr(),s=K(),c=Si(),{w:l,h:u}=er(),d=Math.round(_i*Math.min(l,u))+12,f=c>=mi,p=Y.use.characters()[Y.use.selectedIndex()]?.color,m=Math.round(Math.min(300,Math.max(160,c*.16))),h=(0,q.useMemo)(()=>{let e=s?.colors.map(e=>e.id)??[],t=xi(hi.map(e=>e.leftAvatar.color),p,e),n=xi(hi.map(e=>e.rightAvatar.color),p,e);return hi.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,J.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:o.fg},children:[(0,J.jsx)(Q,{onBack:i,onNext:a}),f&&s&&(0,J.jsx)(Ti,{components:s,values:e,sideAvatars:h,size:m}),(0,J.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,J.jsx)(`div`,{className:`w-full min-h-14 shrink-[4]`,style:{flexBasis:Math.round(u*.14)}}),(0,J.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2`,children:[(0,J.jsx)(`h1`,{className:`text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Create my personality`}),n?(0,J.jsx)(`p`,{className:`text-center text-[15px]`,style:{color:o.fgMuted},children:`Personality locked — chat with your assistant to make any more updates`}):(0,J.jsx)(`p`,{className:`hidden max-w-md text-center text-[15px] sm:block`,style:{color:o.fgMuted},children:`How do you want me to talk to you? You can always ask me to change my personality later.`})]}),(0,J.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-10`}),hi.map((r,i)=>(0,J.jsxs)(q.Fragment,{children:[i>0&&(0,J.jsx)(`div`,{className:`w-full min-h-2.5 shrink basis-8 sm:basis-11`}),(0,J.jsx)(wi,{axis:r,value:e[r.id]??$,onValueChange:e=>t(r.id,e),fg:o.fg,disabled:n})]},r.id)),(0,J.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-14`}),(0,J.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,J.jsx)(G,{className:`h-4 w-4`})]})]})]})}function Di({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a,missingCalendarScope:o=!1,onRetry:s,hatchError:c=null}){let l=kr(),{handleConnect:u,oauthInProgress:d}=at({assistantId:e??``,onConnect:n}),f=()=>{s?.(),u()},p=!e||!t,m=p||d;return(0,J.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:l.fg},children:[(0,J.jsx)(Q,{onBack:i,onNext:a}),(0,J.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,J.jsx)(`h1`,{className:`text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:p?`Waking up`:o?`Access not enabled`:`Let me make this easy`}),(0,J.jsx)(`p`,{className:`text-[16px]`,style:{color:l.fgMuted},children:p?`Your assistant is getting ready`:o?`Check the box next to the Google Calendar permission so I can book the check-in.`:`Connect your Google Calendar so I can find time to check in and start helping.`}),(0,J.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-4`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:f,disabled:m,className:`flex cursor-pointer h-11 w-full items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:l.isLight?`#1A1A1A`:`#FFFFFF`,color:l.isLight?`#FFFFFF`:`#1A1A1A`},children:p?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):d?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(!p||c)&&(0,J.jsx)(`button`,{type:`button`,onClick:r,disabled:d,className:`cursor-pointer text-body-small-default transition-opacity hover:opacity-100 disabled:opacity-60`,style:{color:l.fgMuted},children:`Skip for now`})]})]})]})}var Oi=$e(`#17191C`);function ki(){let[e,t]=(0,q.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,q.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Ai(){let e=K(),t=Y.use.characters(),n=Y.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function ji({size:e=64,isAssistantBusy:t=!1}){let{components:n,chosen:r}=Ai();return!n||!r?(0,J.jsx)(`div`,{style:{width:e,height:e}}):(0,J.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,J.jsx)(m,{components:n,traits:r,size:e,isAssistantBusy:t})})}var Mi=`pt-[0.7rem] text-[2.6rem] leading-none`,Ni=64,Pi=4500,Fi=7e3;function Ii({onDone:e,onBack:t,onForward:n,scheduledTime:r,awaitingTime:i}){let{components:a,chosen:o}=Ai(),s=W(),{w:c,h:l}=ki(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,q.useEffect)(()=>{let t=setTimeout(e,i&&!r?Fi:Pi);return()=>clearTimeout(t)},[e,i,r]);let d=(0,q.useRef)(null),[f,p]=(0,q.useState)(null);(0,q.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 h=1.3*Math.max(c,l)/Ni,g=f?c/2-f.cx:0,_=f?l*.88-f.cy:0,v=l*.05;return(0,J.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,J.jsx)(Q,{onBack:t,onNext:n,tone:`light`}),(0,J.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,J.jsx)(`div`,{ref:d,className:`relative shrink-0`,style:{width:Ni,height:Ni},children:a&&o&&f&&(0,J.jsx)(U.div,{className:`absolute inset-0`,style:{transformOrigin:`center`},initial:s?!1:{scale:h,x:g,y:_},animate:{x:[g,g,0,0],y:[_,_+v,0,0],scale:[h,h,1.07,1]},transition:s?{duration:0}:{duration:1.1,times:[0,.18,.82,1],ease:[`easeOut`,`easeIn`,`easeOut`]},children:(0,J.jsx)(m,{components:a,traits:o,size:Ni})})}),(0,J.jsx)(U.span,{className:Mi,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 Li=[`Searching the web to get to know you…`,`Reading public profiles…`,`Skimming the highlights…`,`Connecting the dots…`,`Piecing it together…`],Ri=[`Updating my personality…`,`Finding my voice…`,`Getting into character…`],zi=`Almost there…`,Bi=[...Li,zi],Vi=[...Ri,zi],Hi=2800;function Ui({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i}){let a=Oi,[o,s]=(0,q.useState)(0);return(0,q.useEffect)(()=>{n?.(o);let t=o>=Bi.length-1;if(i&&t){let t=setTimeout(e,Hi);return()=>clearTimeout(t)}let r=setTimeout(()=>s(e=>(e+1)%Bi.length),Hi);return()=>clearTimeout(r)},[o,i,e,n]),(0,J.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,J.jsx)(Q,{onBack:t,onNext:r}),(0,J.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,J.jsx)(ji,{isAssistantBusy:!0}),(0,J.jsx)(Ke,{mode:`wait`,children:(0,J.jsx)(U.p,{className:Mi,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Bi[o]},o)})]})]})}function Wi({onDone:e,ready:t}){let n=Oi,[r,i]=(0,q.useState)(0);return(0,q.useEffect)(()=>{let n=Vi.length-1;if(t){if(r!==n){i(n);return}let t=setTimeout(e,Hi);return()=>clearTimeout(t)}let a=setTimeout(()=>i(e=>(e+1)%Vi.length),Hi);return()=>clearTimeout(a)},[r,t,e]),(0,J.jsx)(`div`,{className:`absolute inset-0 z-10`,style:{color:n.fg},children:(0,J.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,J.jsx)(ji,{isAssistantBusy:!0}),(0,J.jsx)(Ke,{mode:`wait`,children:(0,J.jsx)(U.p,{className:Mi,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Vi[r]},r)})]})})}function Gi({claims:e,loading:t,onContinue:n,onRejectAll:r,onBack:i,onForward:a}){let o=Oi,s=W(),[c,l]=(0,q.useState)(()=>new Set),u=e.filter(e=>!c.has(e.claim)),d=u.length>0,f=!t;return(0,J.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,J.jsx)(Q,{onBack:i,onNext:a}),(0,J.jsxs)(`div`,{className:`absolute bottom-0 left-1/2 top-[14%] sm:top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6 pb-8`,children:[(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-y-auto`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(ji,{}),(0,J.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`This is what I found about you`})]}),(0,J.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,J.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,J.jsx)(Ke,{children:u.map(e=>(0,J.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,J.jsx)(`span`,{children:e.claim}),(0,J.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,J.jsx)(v,{className:`h-4 w-4`})})]},e.claim))})}),d&&f&&(0,J.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,J.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,J.jsx)(G,{className:`h-4 w-4`})]})]})]})}var Ki=64,qi=Ki;function Ji({head:e,note:t,flyToNote:n,reduce:r,onLanded:i}){let{components:a,chosen:o}=Ai();if(!a||!o)return null;let s=Ki/2,c=n&&t?t:e,l={x:c.x-s,y:c.y-s};return(0,J.jsx)(U.div,{className:`pointer-events-none absolute left-0 top-0`,style:{width:Ki,height:Ki,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,J.jsx)(m,{components:a,traits:o,size:Ki})})}function Yi({installedPlugins:e=[],pluginCatalog:t={},onStart:n,onBack:r,onForward:i}){let a=Oi,o=W(),[s,c]=(0,q.useState)(!1),l=e.map(e=>({name:e,displayName:rt(e),description:t[e]?.trim()??``})).filter(e=>e.displayName.length>0),u=l.length>0,d=(0,q.useRef)(null),f=(0,q.useRef)(null),p=(0,q.useRef)(null),[m,h]=(0,q.useState)(null),[g,_]=(0,q.useState)(!1),[v,y]=(0,q.useState)(!1);(0,q.useLayoutEffect)(()=>{let e=()=>{let e=d.current,t=f.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=e=>({x:e.left-n.left+e.width/2,y:e.top-n.top+e.height/2}),i=p.current;h({head:r(t.getBoundingClientRect()),note:i?r(i.getBoundingClientRect()):void 0})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[l.length]);let b=m?.note?.y;return(0,q.useEffect)(()=>{b===void 0||g||_(!0)},[b,g]),(0,J.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,J.jsx)(Q,{onBack:r,onNext:i}),(0,J.jsxs)(`div`,{ref:d,className:`absolute left-1/2 top-1/2 z-10 flex w-full max-w-xl -translate-x-1/2 -translate-y-1/2 flex-col px-6`,children:[(0,J.jsxs)(`div`,{className:`flex items-center`,children:[(0,J.jsx)(U.div,{ref:f,className:`shrink-0`,style:{height:Ki},initial:!1,animate:g?{width:0,marginRight:0}:{width:Ki,marginRight:12},transition:o?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,J.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`You’re all set`})]}),u&&(0,J.jsx)(`div`,{className:`mt-4 flex flex-col gap-3`,children:l.map((e,t)=>(0,J.jsxs)(U.div,{initial:o?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:o?{duration:0}:{duration:.3,delay:t*.06},className:`rounded-2xl px-5 py-4`,style:{backgroundColor:a.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,J.jsx)(`div`,{className:`text-[15px] font-medium`,children:e.displayName}),e.description&&(0,J.jsx)(`div`,{className:`mt-1 text-[13px] leading-snug`,style:{color:a.fgMuted},children:e.description})]},e.name))}),(0,J.jsxs)(`div`,{className:`mt-16 flex items-center gap-3`,children:[(0,J.jsx)(`div`,{ref:p,className:`shrink-0`,style:{width:qi}}),(0,J.jsx)(U.p,{className:`text-[15px]`,style:{color:a.fg},initial:!1,animate:{opacity:+!!v,x:v?0:-6},transition:o?{duration:0}:{duration:.35},children:`I’ve set myself up with plugins around who you are.`})]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>{s||(c(!0),Promise.resolve().then(n).catch(()=>c(!1)))},disabled:s,className:`mt-16 flex cursor-pointer h-11 w-[200px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[s?`Starting…`:`Let's chat`,!s&&(0,J.jsx)(G,{className:`h-4 w-4`})]}),m&&(0,J.jsx)(Ji,{head:m.head,note:m.note,flyToNote:g&&m.note!==void 0,reduce:o,onLanded:()=>y(!0)})]})]})}var Xi=[{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})}],Zi=`#17191C`,Qi=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],$i=290;function ea({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0,showTopTeam:i=!1}){let a=K(),o=Y.use.characters(),s=Y.use.selectedIndex(),c=W(),{w:l}=er(),u=Math.max(.42,Math.min(l/1100,1)),d=l<640,f=o.length>0?o[s]:void 0,{bg:p,peekColors:h}=(0,q.useMemo)(()=>!a||!f?{bg:`var(--surface-base)`,peekColors:[]}:{bg:a.colors.find(e=>e.id===f.color)?.hex??`var(--surface-base)`,peekColors:$r(f.color,a.colors.map(e=>e.id),3)},[a,f]);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?Zi:p},transition:c?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,J.jsx)(Br,{bumpNonce:t,settleBlink:!1}),i&&a&&(0,J.jsx)(`div`,{className:`pointer-events-none absolute right-0 z-[1] flex items-start`,style:{top:-Math.round($i*u)*.42,right:-Math.round($i*u)*.12},children:Qi.map((e,t)=>{let n=Math.round($i*u);return(0,J.jsx)(U.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:Qi.length-t},initial:c?!1:{y:-140,opacity:0},animate:{y:0,opacity:1},transition:c?{duration:0}:{type:`spring`,stiffness:200,damping:18,delay:t*.1},children:(0,J.jsx)(m,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),a&&(0,J.jsx)(Ke,{children:(d?Xi.filter(e=>e.mobile):Xi).slice(0,Math.max(0,e)).map((e,t)=>{let n=Math.round(e.base*u),r=d&&e.mobilePos?e.mobilePos(n):e.pos(n);return(0,J.jsx)(U.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{...r,width:n,height:n},initial:c?!1:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:c?void 0:{scale:0,opacity:0},transition:c?{duration:0}:{type:`spring`,stiffness:220,damping:16,delay:.1},children:(0,J.jsx)(m,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}var ta={established:!1,assistantName:null};async function na(e,t={hasAnyActiveConversation:R,fetchAssistantIdentity:ot}){try{if(!await t.hasAnyActiveConversation(e))return ta}catch(e){return n(e,{context:`research_onboarding_established_check`}),ta}let r=await t.fetchAssistantIdentity(e).catch(()=>null);return{established:!0,assistantName:(typeof r?.name==`string`?r.name.trim():``)||null}}function ra({assistantName:e,onKeep:t,onRedo:n,onBack:r}){let i=e?.trim()||``,o=i||`your assistant`,s=i?`${i}'s`:`its`;return(0,J.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-primary)`},children:[(0,J.jsx)(Q,{onBack:r,tone:`light`}),(0,J.jsxs)(`div`,{className:`${gt} max-w-xl`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,J.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:i?`${i} is already up and running`:`Your assistant is already up and running`}),(0,J.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,J.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,J.jsxs)(a,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:[`Keep `,o,` and start chatting`,(0,J.jsx)(G,{className:`h-4 w-4`})]}),(0,J.jsxs)(a,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:n,className:`h-11 text-base`,children:[`Start over and rebuild `,s,` personality`]})]})]})]})}var ia=4e3;function aa(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobbies:e.hobbies,timezone:pe()}}function oa(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}nt();function sa(){let e=s(),t=oe.use.user(),n=t?.id??null,r=Ye.use.enterFocus(),i=Ye.use.exitFocus(),a=Ye.use.setPendingAvatarTraits(),c=Ye.use.requestSidebarCollapse(),[l,u]=(0,q.useState)(`form`),{ref:d,size:f}=ft(),[p,m]=(0,q.useState)([]),[h,g]=(0,q.useState)(!1);function _(e){u(e)}function v(e,t=`completed`){et(Je[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,C]=(0,q.useState)(null),w=(0,q.useRef)(null),[T,O]=(0,q.useState)(null),[k,A]=(0,q.useState)(null),j=(0,q.useRef)(!1),[M,N]=(0,q.useState)(null),[ee,te]=(0,q.useState)({}),[ne,re]=(0,q.useState)(!1),[P,F]=(0,q.useState)(null),[ie,I]=(0,q.useState)(null),[se,ce]=(0,q.useState)(!1),[le,L]=(0,q.useState)(!1),[pe,R]=(0,q.useState)(!1),[ve,ye]=(0,q.useState)(0),[be,xe]=(0,q.useState)(0),[Se]=o(),Ce=cn({hostingParam:Se.get(`hosting`),localMode:D(),gatewayAuthSession:E()}),we=Se.get(`assistant`)??void 0,Te=Ce,{start:Ee,ready:De,assistantId:z,error:Oe,awaitReady:B}=mn({adoptExisting:Ce,adoptAssistantId:we}),V=Un(),{start:ke,hydrate:Ae}=V,je=(0,q.useRef)(Promise.resolve()),[H,Me]=(0,q.useState)(null),Ne=(0,q.useRef)(Promise.resolve()),[Pe,Fe]=(0,q.useState)(!1),Ie=V.status===`idle`||V.status===`running`,Le=!Ie&&V.claims.length===0;(0,q.useEffect)(()=>{i(),a(null),Ee()},[i,a,Ee]),(0,q.useEffect)(()=>{if(w.current)return;let e=B().then(e=>na(e)).catch(()=>ta);w.current=e,e.then(O)},[B]),(0,q.useLayoutEffect)(()=>{if(h||!n)return;let e=he(n);if(e?.formValues){C(e.formValues),N(e.faceValues),I(e.checkinTime),L(e.checkinBooked),Me(e.keptClaims??null),F(e.researchConversationId??null),e.research&&Ae({...e.research,pluginCatalog:e.research.pluginCatalog??{}},B);let t=ge(e);u(Te&&(t===`letschat`||t===`meeting`)?`looking`:t),m([])}g(!0)},[h,n,Ae,B,Te]),(0,q.useEffect)(()=>{!h||!S||me(n,{step:l,formValues:S,faceValues:M,checkinTime:ie,checkinBooked:le,research:V.status===`done`?{status:`done`,claims:V.claims,suggestions:V.suggestions,installedPlugins:V.installedPlugins,pluginCatalog:V.pluginCatalog}:null,...P?{researchConversationId:P}:{},...H?{keptClaims:H}:{}})},[h,n,l,H,S,M,ie,le,P,V.status,V.claims,V.suggestions,V.installedPlugins,V.pluginCatalog]),(0,q.useEffect)(()=>{h&&(!S||V.status!==`idle`||ke({awaitAssistantId:B,subject:aa(S),conversationTitle:oa(S),...P?{resumeConversationId:P}:{},onConversationCreated:F,includeSuggestions:!1}))},[h,S,P,V.status,ke,B,!0]),(0,q.useEffect)(()=>{l===`results`&&Le&&(m([]),u(`suggestions`))},[l,Le]);function Re(t,i,o,{skip:s=!1,hidden:l=!1}={}){_e(n);let{firstName:u,lastName:d,role:f,hobbies:p}=t,m=[u.trim(),d.trim()].filter(Boolean).join(` `),h=u.trim(),g=!s&&o===void 0;fe({tools:[],tasks:[],tone:rn,...m?{userName:m}:{},...f.trim()?{occupation:f.trim()}:{},...s?{}:{initialMessage:o??sn({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()}:{},...H?.length?{researchFindings:H}:{}});let _=i?.name?.trim();_&&de(_),a(i?.traits??null),g&&r(),s||ae.markExpectingFirstMessage(),c(),ae.checkAssistant(z??void 0).finally(()=>{e(`${ue.assistant}?onboarding=1`,{replace:!0})})}async function ze(){S&&(await Promise.all([V.awaitPluginInstalls(),je.current,Ne.current]),Re(S,M,Xn(M?.name),{hidden:!0}))}function Be(e){V.start({awaitAssistantId:B,subject:aa(e),conversationTitle:oa(e),onConversationCreated:F,includeSuggestions:!1})}async function Ve(e){if(!j.current&&(T??await Promise.race([w.current??Promise.resolve(null),new Promise(e=>{setTimeout(()=>e(null),ia)})]))?.established){A(e),v(`existing`);return}C(e),Be(e),v(`face`)}function U(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){R(!0);return}if(R(!1),z&&S){let e=[S.firstName.trim(),S.lastName.trim()].filter(Boolean).join(` `);I(null),L(!1),ce(!0),st({assistantId:z,userName:e||void 0,assistantName:M?.name?.trim()||void 0}).then(e=>{e.scheduled&&(L(!0),I(Zn(e.start,e.timeZone)))}).finally(()=>ce(!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,J.jsx)(`div`,{ref:d,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,J.jsxs)($n,{size:f,children:[(0,J.jsx)(ea,{eyesBumpNonce:ve,peekLevel:[`looking`,`results`,`suggestions`,`finishing`].includes(l)?be:0,darkBg:e,showBottomEyes:!e&&l!==`different`}),l===`different`&&(0,J.jsx)(ci,{onContinue:()=>v(`personality`),onBack:()=>y(`intro`),onForward:x}),l===`personality`&&(0,J.jsx)(Ei,{values:ee,onValueChange:(e,t)=>te(n=>({...n,[e]:t})),locked:ne,onContinue:()=>{ne||(Fe(!0),Ne.current=Yn({awaitAssistantId:B,values:ee,userName:S?.firstName?.trim()||void 0,assistantName:M?.name?.trim()||void 0}).finally(()=>Fe(!1)),re(!0)),v(`integration`)},onBack:()=>y(`different`),onForward:x}),l===`integration`&&(0,J.jsx)(pi,{onClaim:()=>v(Te?`looking`:`letschat`),onBumpEyes:()=>ye(e=>e+1),onBack:()=>y(`personality`),onForward:x}),l===`letschat`&&(0,J.jsx)(Di,{assistantId:z,assistantReady:De,hatchError:Oe,onConnected:U,missingCalendarScope:pe,onRetry:()=>R(!1),onSkip:()=>{R(!1),v(`looking`,`skipped`)},onBack:()=>y(`integration`),onForward:x}),l===`meeting`&&(0,J.jsx)(Ii,{scheduledTime:ie??void 0,awaitingTime:se,onDone:()=>v(`looking`),onBack:()=>y(`letschat`),onForward:x}),l===`looking`&&(0,J.jsx)(Ui,{onDone:()=>v(Le?`suggestions`:`results`),onBack:()=>y(Te?`integration`:`letschat`),onAdvance:e=>xe(Math.min(e+1,4)),onForward:x,ready:!Ie}),l===`results`&&(0,J.jsx)(Gi,{claims:V.claims,loading:Ie,onContinue:e=>{let t=new Set(e);Me(V.claims.filter(e=>!t.has(e.claim)).map(e=>e.claim)),P&&z&&e.length>0&&(je.current=Gn({assistantId:z,conversationId:P,removedClaims:e,rejectedAll:!1})),v(`suggestions`)},onRejectAll:()=>{Me([]),P&&z&&(je.current=Gn({assistantId:z,conversationId:P,removedClaims:V.claims.map(e=>e.claim),rejectedAll:!0})),v(`suggestions`,`skipped`)},onBack:()=>y(`looking`),onForward:x}),l===`suggestions`&&(0,J.jsx)(Yi,{installedPlugins:V.installedPlugins,pluginCatalog:V.pluginCatalog,onStart:async()=>{if(et(Je.suggestions,{userId:n,outcome:`completed`}),Pe){m([]),u(`finishing`);return}await ze()},onBack:()=>y(Le?`looking`:`results`),onForward:x}),l===`suggestions`&&!1,l===`finishing`&&(0,J.jsx)(Wi,{ready:!Pe,onDone:()=>void ze()})]})})}return l===`existing`?(0,J.jsx)(ra,{assistantName:T?.assistantName??null,onKeep:()=>{et(Je.existing,{userId:n,outcome:`completed`}),_e(n),ae.checkAssistant(z??void 0).finally(()=>{e(ue.assistant,{replace:!0})})},onRedo:()=>{let e=k;e&&(j.current=!0,et(Je.existing,{userId:n,outcome:`skipped`}),C(e),Be(e),m([]),_(`face`))},onBack:()=>{A(null),y(`form`)}}):l===`intro`&&S?(0,J.jsx)(Ur,{firstName:S.firstName,assistantName:M?.name,onContinue:()=>v(`different`),onBack:()=>y(`face`),onForward:x}):l===`face`&&S?(0,J.jsx)(Mr,{onContinue:e=>{N(e),v(`intro`)},onBack:()=>y(`form`),onForward:x}):(0,J.jsx)(Or,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:Ve})}export{sa as ResearchOnboardingRoute};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-IRfcSUxS.js";import{r as t}from"./api-errors-CrWDzVca.js";var n=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),r={medium:[`small`,`medium`],large:[`small`,`medium`,`large`],xl:[`small`,`medium`,`large`,`extra_large`]};function i(e){return e?r[e]??[]:[]}var a={small:`Small`,medium:`Medium`,large:`Large`,extra_large:`Extra Large`},o={small:`2 vCPU, 3 GiB`,medium:`2.5 vCPU, 5 GiB`,large:`4 vCPU, 8 GiB`,extra_large:`4 vCPU, 16 GiB`},s=[`small`,`medium`,`large`,`extra_large`];function c(e){return s.indexOf(e)}function l(e,t,n){return e.map(e=>({value:e,label:`${a[e]} — ${o[e]}`,suffix:e===t?n:void 0}))}var u=new Set([`exceeds_machine_tier`,`exceeds_storage_tier`]);function d(e,n){return e&&typeof e==`object`&&!Array.isArray(e)&&`error`in e&&typeof e.error==`string`&&u.has(e.error)?`That size isn't available on your plan.`:t(e,void 0,n)}export{i as a,n as c,r as i,o as n,l as o,a as r,c as s,d as t};
1
+ import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";import{r as t}from"./api-errors-CrWDzVca.js";var n=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),r={medium:[`small`,`medium`],large:[`small`,`medium`,`large`],xl:[`small`,`medium`,`large`,`extra_large`]};function i(e){return e?r[e]??[]:[]}var a={small:`Small`,medium:`Medium`,large:`Large`,extra_large:`Extra Large`},o={small:`2 vCPU, 3 GiB`,medium:`2.5 vCPU, 5 GiB`,large:`4 vCPU, 8 GiB`,extra_large:`4 vCPU, 16 GiB`},s=[`small`,`medium`,`large`,`extra_large`];function c(e){return s.indexOf(e)}function l(e,t,n){return e.map(e=>({value:e,label:`${a[e]} — ${o[e]}`,suffix:e===t?n:void 0}))}var u=new Set([`exceeds_machine_tier`,`exceeds_storage_tier`]);function d(e,n){return e&&typeof e==`object`&&!Array.isArray(e)&&`error`in e&&typeof e.error==`string`&&u.has(e.error)?`That size isn't available on your plan.`:t(e,void 0,n)}export{i as a,n as c,r as i,o as n,l as o,a as r,c as s,d as t};
@@ -1 +1 @@
1
- import{n as e,t}from"./create-selectors-8NePGNlX.js";import{$ as n,f as r,ft as i,m as a,mt as o,p as s,pt as c}from"./local-mode-Bskd5bsT.js";function l(e,t){return e.filter(e=>e.isLocal||e.organizationId==null||e.organizationId===t)}var u=e((e,t)=>({assistants:[],activeAssistantId:null,selectedAssistantId:c(),assistantsHydrated:!1,setFromLockfile:n=>{let i=m(n),o=new Map(t().assistants.map(e=>[e.id,e]));e({assistants:n.assistants.map(e=>({id:e.assistantId,name:e.name,hatchedAt:e.hatchedAt,cloud:e.cloud,runtimeVersion:e.resources?.runtimeVersion,currentReleaseVersion:o.get(e.assistantId)?.currentReleaseVersion,releaseChannel:o.get(e.assistantId)?.releaseChannel,isActiveLockfileAssistant:i===e.assistantId,isLocal:r(e),isPlatformHosted:a(e),organizationId:e.organizationId})),assistantsHydrated:!0}),d(t,e)},setFromApi:t=>e({assistantsHydrated:!0,assistants:t.map(e=>{let t=p(e.id);return{id:e.id,name:e.name,hatchedAt:e.created,cloud:t.cloud,runtimeVersion:t.runtimeVersion,currentReleaseVersion:e.current_release_version,releaseChannel:e.release_channel,isActiveLockfileAssistant:t.isActiveLockfileAssistant,isLocal:e.is_local,isPlatformHosted:!e.is_local}})}),markHydrated:()=>e({assistantsHydrated:!0}),upsertFromApi:t=>e(e=>{let n={id:t.id,name:t.name,hatchedAt:t.created,currentReleaseVersion:t.current_release_version,releaseChannel:t.release_channel,isLocal:t.is_local,isPlatformHosted:!t.is_local},r=e.assistants.findIndex(e=>e.id===t.id);if(r>=0){let i=[...e.assistants],a=p(t.id);return i[r]={...n,cloud:a.cloud??i[r].cloud,organizationId:i[r].organizationId,runtimeVersion:a.runtimeVersion??i[r].runtimeVersion,isActiveLockfileAssistant:a.isActiveLockfileAssistant??i[r].isActiveLockfileAssistant},{assistants:i}}let i=p(t.id);return{assistants:[...e.assistants,{...n,cloud:i.cloud,organizationId:i.organizationId,runtimeVersion:i.runtimeVersion,isActiveLockfileAssistant:i.isActiveLockfileAssistant}]}}),remove:t=>e(e=>({assistants:e.assistants.filter(e=>e.id!==t)})),clear:()=>e({assistants:[]}),setActiveAssistantId:t=>e({activeAssistantId:t}),setSelectedAssistant:t=>{t==null?i():o(t),e({selectedAssistantId:t})}}));function d(e,t){let{assistants:n,selectedAssistantId:r,assistantsHydrated:a}=e();!a||r==null||n.some(e=>e.id===r)||(i(),t({selectedAssistantId:null}))}var f=t(u);function p(e){let t=n.getState().lockfile,r=t?.assistants.find(t=>t.assistantId===e),i=t?m(t):null;return{cloud:r?.cloud,organizationId:r?.organizationId,runtimeVersion:r?.resources?.runtimeVersion,isActiveLockfileAssistant:t?i===e:void 0}}function m(e){return e.activeAssistant&&e.assistants.some(t=>t.assistantId===e.activeAssistant)?e.activeAssistant:e.assistants.length===1?e.assistants[0]?.assistantId??null:null}s()&&n.subscribe(e=>{e.lockfile&&e.committed&&u.getState().setFromLockfile(e.lockfile)}),typeof window<`u`&&window.addEventListener(`storage`,e=>{(e.key===null||e.key===`vellum:selectedAssistantId`)&&u.setState({selectedAssistantId:c()})});export{f as n,l as t};
1
+ import{n as e,t}from"./create-selectors-8NePGNlX.js";import{Q as n,d as r,f as i,ft as a,mt as o,p as s,pt as c}from"./local-mode-Dydd46cS.js";function l(e,t){return e.filter(e=>e.isLocal||e.organizationId==null||e.organizationId===t)}var u=e((e,t)=>({assistants:[],activeAssistantId:null,selectedAssistantId:c(),assistantsHydrated:!1,setFromLockfile:n=>{let i=m(n),a=new Map(t().assistants.map(e=>[e.id,e]));e({assistants:n.assistants.map(e=>({id:e.assistantId,name:e.name,hatchedAt:e.hatchedAt,cloud:e.cloud,runtimeVersion:e.resources?.runtimeVersion,currentReleaseVersion:a.get(e.assistantId)?.currentReleaseVersion,releaseChannel:a.get(e.assistantId)?.releaseChannel,isActiveLockfileAssistant:i===e.assistantId,isLocal:r(e),isPlatformHosted:s(e),organizationId:e.organizationId})),assistantsHydrated:!0}),d(t,e)},setFromApi:t=>e({assistantsHydrated:!0,assistants:t.map(e=>{let t=p(e.id);return{id:e.id,name:e.name,hatchedAt:e.created,cloud:t.cloud,runtimeVersion:t.runtimeVersion,currentReleaseVersion:e.current_release_version,releaseChannel:e.release_channel,isActiveLockfileAssistant:t.isActiveLockfileAssistant,isLocal:e.is_local,isPlatformHosted:!e.is_local}})}),markHydrated:()=>e({assistantsHydrated:!0}),upsertFromApi:t=>e(e=>{let n={id:t.id,name:t.name,hatchedAt:t.created,currentReleaseVersion:t.current_release_version,releaseChannel:t.release_channel,isLocal:t.is_local,isPlatformHosted:!t.is_local},r=e.assistants.findIndex(e=>e.id===t.id);if(r>=0){let i=[...e.assistants],a=p(t.id);return i[r]={...n,cloud:a.cloud??i[r].cloud,organizationId:i[r].organizationId,runtimeVersion:a.runtimeVersion??i[r].runtimeVersion,isActiveLockfileAssistant:a.isActiveLockfileAssistant??i[r].isActiveLockfileAssistant},{assistants:i}}let i=p(t.id);return{assistants:[...e.assistants,{...n,cloud:i.cloud,organizationId:i.organizationId,runtimeVersion:i.runtimeVersion,isActiveLockfileAssistant:i.isActiveLockfileAssistant}]}}),remove:t=>e(e=>({assistants:e.assistants.filter(e=>e.id!==t)})),clear:()=>e({assistants:[]}),setActiveAssistantId:t=>e({activeAssistantId:t}),setSelectedAssistant:t=>{t==null?a():o(t),e({selectedAssistantId:t})}}));function d(e,t){let{assistants:n,selectedAssistantId:r,assistantsHydrated:i}=e();!i||r==null||n.some(e=>e.id===r)||(a(),t({selectedAssistantId:null}))}var f=t(u);function p(e){let t=n.getState().lockfile,r=t?.assistants.find(t=>t.assistantId===e),i=t?m(t):null;return{cloud:r?.cloud,organizationId:r?.organizationId,runtimeVersion:r?.resources?.runtimeVersion,isActiveLockfileAssistant:t?i===e:void 0}}function m(e){return e.activeAssistant&&e.assistants.some(t=>t.assistantId===e.activeAssistant)?e.activeAssistant:e.assistants.length===1?e.assistants[0]?.assistantId??null:null}i()&&n.subscribe(e=>{e.lockfile&&e.committed&&u.getState().setFromLockfile(e.lockfile)}),typeof window<`u`&&window.addEventListener(`storage`,e=>{(e.key===null||e.key===`vellum:selectedAssistantId`)&&u.setState({selectedAssistantId:c()})});export{f as n,l as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./shield-check-kgUZeU9b.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{d as c,i as l,n as u}from"./auth-store-6jOlH4H3.js";import{t as d}from"./return-to-ugSGJ0dm.js";import{c as f}from"./routes-GPGveWZ8.js";import{c as p,d as m,f as h,l as g,p as _,u as v}from"./prefs-Od3axSSC.js";import{Nr as y,pn as b}from"./index-D_wKh03d.js";import{n as x,t as S}from"./consent-controls-BKoyAFQL.js";var C=e(t(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function E(e){return w[e]??[]}function D(e){return T[e]??[]}var O=a();function k(){let e=i(),[t]=r(),a=u.use.user()?.id??null,w=u.use.logout(),T=s(),k=l(),[A,j]=_(),[M,N]=v(),[P,F]=m(),[I,L]=h(),[R]=p(),[z]=g(),B=P??!0,V=I??!0,[H]=(0,C.useState)(()=>!A),[U]=(0,C.useState)(()=>!M),[W]=(0,C.useState)(()=>!R),[G]=(0,C.useState)(()=>!z),K=!H&&!U&&!W&&!G,q=H||K,J=U||K,Y=W||K,X=G||K,Z=!K&&!H&&!U,Q=K?`Terms & privacy`:Z?`Review your privacy preferences`:`Updated terms`,$=K?`Review your terms and privacy preferences anytime.`:Z?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,ee=(0,C.useCallback)(()=>{c({userId:a,tos:A,privacy:M,shareAnalytics:Y?B:null,shareDiagnostics:X?V:null,hasPlatformSession:k}),e(d(t.get(`returnTo`),f.assistant),{replace:!0})},[M,k,e,t,B,V,Y,X,A,a]),te=(0,C.useCallback)(async()=>{await w(),y(f.account.login)},[w]),ne=q&&!A||J&&!M;return(0,O.jsx)(b,{showCreatureFooter:!1,children:(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${T?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,O.jsx)(o,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,O.jsx)(`h1`,{className:`mt-5 ${T?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:Q}),(0,O.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${T?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:$}),(Y||X)&&(0,O.jsx)(x,{electron:T,showAnalytics:Y,showDiagnostics:X,shareAnalytics:B,shareDiagnostics:V,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(J||q)&&(0,O.jsx)(S,{electron:T,showPrivacy:J,showTos:q,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:J?D(`2026-06-22`):[],tosNotes:q?E(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,O.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${T?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:ne,onClick:ee,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:te,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};
@@ -0,0 +1,3 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{c as t,i as n}from"./local-settings-C-dW2vkq.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./createLucideIcon-Bjb-Kuq7.js";import{n as a,t as o}from"./create-selectors-8NePGNlX.js";import{n as s}from"./typed-storage-D_VAgmkX.js";import{a as c}from"./diagnostics-BmpZegnr.js";import{l}from"./chat-markdown-message-DA7kD5x_.js";import{t as u}from"./conversation-store-CnRrUeSu.js";import{c as ee,d as te}from"./messages-D7HOlpNc.js";import{C as d,D as f,n as ne,t as re,w as ie,x as p}from"./chat-BDhsGoUo.js";var ae=i(`bolt`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),oe=i(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),se=i(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),ce=i(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),le=e(r(),1),m=1e3,ue=15,de=0,h=new Map,g=[];function fe(e){let t=`sse-${++de}`,n={id:t,abortSignal:e,initiatedAt:Date.now(),establishedAt:null,lastTrafficAt:null,lastDataAt:null,dataFrames:0,keepalives:0,endedAt:null,endReason:null};h.set(t,n),Se();let r=()=>{xe(t,`aborted`)};return e.aborted?r():e.addEventListener(`abort`,r,{once:!0}),t}function pe(e){let t=h.get(e);t&&t.establishedAt===null&&(t.establishedAt=Date.now())}function me(e,t){let n=h.get(e);if(!n)return;let r=Date.now();n.lastTrafficAt=r,t?(n.lastDataAt=r,n.dataFrames++):n.keepalives++}function he(e,t){g.push({clientId:e,receivedAt:new Date().toISOString(),...t}),g.length>m&&g.shift()}var ge=`events-tail`;function _e(e){if(e.length===0)return;let t=new Set;for(let e of g)typeof e.seq==`number`&&t.add(e.seq);for(let n of e)typeof n.seq==`number`&&t.has(n.seq)||g.push({clientId:ge,receivedAt:new Date().toISOString(),...n});for(;g.length>m;)g.shift()}function ve(){return Array.from(h.values())}function ye(e=m){let t=Math.max(0,g.length-e);return g.slice(t)}function be(e,t){if(t===null)return null;let n=1/0;for(let e of g)typeof e.seq==`number`&&(n=Math.min(n,e.seq));return n!==1/0&&n>t+1?null:g.filter(n=>n.conversationId===e&&typeof n.seq==`number`&&n.seq>t).sort((e,t)=>e.seq-t.seq)}function xe(e,t){let n=h.get(e);n&&(n.endedAt===null?(n.endedAt=Date.now(),n.endReason=t):n.endReason===`aborted`&&t!==`aborted`&&(n.endReason=t),Se())}function Se(){let e=0;for(let t of h.values())t.endedAt!==null&&e++;if(!(e<=ue))for(let[t,n]of h){if(e<=ue)break;n.endedAt!==null&&(h.delete(t),e--)}}var _={phase:`idle`,pendingQueuedCount:0,activeToolCallCount:0,activeTurnId:null,lastTerminalReason:null,statusText:null,liveWebActivity:{}};function v(e){return e===`queued`||e===`thinking`||e===`streaming`||e===`awaiting_user_input`}function Ce(e){return e===`thinking`}function y(e){return(e.phase===`idle`||e.phase===`errored`)&&!e.activeTurnId}var b=o(a()((e,t)=>({..._,requestSend:t=>e(e=>({phase:`thinking`,activeTurnId:t??e.activeTurnId,lastTerminalReason:null,activeToolCallCount:0,statusText:null})),acceptSend:t=>e(e=>({activeTurnId:t,...e.phase===`idle`||e.phase===`errored`?{phase:`thinking`,lastTerminalReason:null}:null})),onTextDelta:()=>{let n=t();if(n.phase===`idle`||n.phase===`errored`){if(!n.activeTurnId)return;e({phase:`streaming`});return}(n.phase===`thinking`||n.phase===`queued`)&&e({phase:`streaming`})},onToolUseStart:()=>{let n=t();y(n)||e({phase:n.phase===`idle`||n.phase===`errored`||n.phase===`queued`?`thinking`:n.phase,activeToolCallCount:n.activeToolCallCount+1})},onToolResult:()=>e(e=>({activeToolCallCount:Math.max(0,e.activeToolCallCount-1)})),onToolActivityMetadata:(n,r)=>{let i=t();y(i)||e({liveWebActivity:{...i.liveWebActivity,[n]:r}})},onActivityThinking:(n,r)=>{let i=t();if(y(i)){if(!r?.canStartFromIdle)return;e({phase:`thinking`,statusText:n??null,lastTerminalReason:null});return}i.phase!==`awaiting_user_input`&&e({phase:`thinking`,statusText:n??null})},showSurface:n=>{y(t())||n&&e({phase:`awaiting_user_input`})},updateSurface:()=>{},dismissSurface:()=>{let n=t();n.phase===`awaiting_user_input`&&n.activeToolCallCount===0&&e({phase:`thinking`})},completeSurface:()=>{let n=t();n.phase===`awaiting_user_input`&&n.activeToolCallCount===0&&e({phase:`thinking`})},onSecretRequest:()=>{y(t())||e({phase:`awaiting_user_input`})},onConfirmationRequest:()=>{y(t())||e({phase:`awaiting_user_input`})},onQuestionRequest:()=>{y(t())||e({phase:`awaiting_user_input`})},onContactRequest:()=>{y(t())||e({phase:`awaiting_user_input`})},completeTurn:()=>{e({phase:t().pendingQueuedCount>0?`queued`:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}})},handoffGeneration:()=>{y(t())||e({phase:`thinking`,activeToolCallCount:0,statusText:null})},cancelGeneration:()=>{e({phase:t().pendingQueuedCount>0?`queued`:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`cancelled`,statusText:null,liveWebActivity:{}})},onStreamError:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`error`,statusText:null,liveWebActivity:{}}),onSessionError:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`session_error`,statusText:null,liveWebActivity:{}}),onTurnTimeout:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`timeout`,statusText:null,liveWebActivity:{}}),onPollReconciled:n=>{let r=t();n&&n!==r.activeTurnId||v(r.phase)&&e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}})},resetTurn:()=>e({..._}),clearStaleTurn:()=>{let n=t();n.activeTurnId&&v(n.phase)||e({..._})},enqueueMessage:()=>e(e=>({pendingQueuedCount:e.pendingQueuedCount+1})),dequeueMessage:()=>{let n=t(),r=Math.max(0,n.pendingQueuedCount-1);if(y(n)){e({pendingQueuedCount:r});return}e({phase:`thinking`,pendingQueuedCount:r})},deleteQueuedMessage:()=>{let n=t(),r=Math.max(0,n.pendingQueuedCount-1);if(r===0&&n.phase===`queued`){e({phase:`idle`,pendingQueuedCount:0,activeTurnId:null,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}});return}e({pendingQueuedCount:r})}}))),we=3670016,Te=[.85,.75,.65,.5],Ee=2e7,De=new Set([`image/jpeg`,`image/jpg`,`image/png`,`image/webp`,`image/heic`,`image/heif`,`image/bmp`,`image/tiff`]),Oe=new Set([`jpg`,`jpeg`,`png`,`webp`,`heic`,`heif`,`bmp`,`tif`,`tiff`]);function x(e){let t=e.type.trim().toLowerCase();if(De.has(t))return!0;let n=e.name.split(`.`).pop()?.trim().toLowerCase();return n?Oe.has(n):!1}function ke(e){return x(e)&&e.size>3670016}function Ae(e){let t=e.type.trim().toLowerCase();if(t===`image/heic`||t===`image/heif`)return!0;let n=e.name.split(`.`).pop()?.trim().toLowerCase();return n===`heic`||n===`heif`}function je(e){return ke(e)||Ae(e)}function Me(e){let t=`attachment`,n=e.trim()||t;return/\.(?:jpe?g)$/i.test(n)?n:`${n.replace(/\.[^./\\]+$/,``)||t}.jpg`}async function Ne(e){if(!je(e)||await Fe(e))return{status:`unchanged`,file:e};if(e.size>104857600)return{status:`failed`,error:`This image is too large to process safely. Please choose a smaller image.`};let t;try{t=await Pe(e)}catch{return{status:`failed`,error:`Couldn't resize this image for upload. Try a smaller image.`}}try{let n;try{n=await Le(t,e.size)}catch{n=null}return!n||!Ae(e)&&n.size>=e.size?{status:`failed`,error:`Couldn't resize this image for upload. Try a smaller image.`}:{status:`resized`,file:new File([n],Me(e.name),{type:`image/jpeg`,lastModified:e.lastModified})}}finally{t.close()}}async function Pe(e){if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e,{imageOrientation:`from-image`});return{source:t,width:t.width,height:t.height,close:()=>t.close()}}catch{}if(typeof Image>`u`)throw Error(`No browser image decoder is available.`);let t=URL.createObjectURL(e);return await new Promise((e,n)=>{let r=new Image;r.onload=()=>{e({source:r,width:r.naturalWidth||r.width,height:r.naturalHeight||r.height,close:()=>URL.revokeObjectURL(t)})},r.onerror=()=>{URL.revokeObjectURL(t),n(Error(`Image decode failed.`))},r.src=t})}async function Fe(e){if(!Ie(e))return!1;let t;try{t=new Uint8Array(await e.slice(0,Math.min(e.size,1024*1024)).arrayBuffer())}catch{return!0}if(!C(t,0,`RIFF`)||!C(t,8,`WEBP`))return!1;let n=S(t,`VP8X`);return n>=0&&(t[n+8]??0)&2?!0:S(t,`ANIM`)>=0||S(t,`ANMF`)>=0}function Ie(e){return e.type.trim().toLowerCase()===`image/webp`||/\.webp$/i.test(e.name)}function S(e,t){for(let n=0;n<=e.length-t.length;n+=1)if(C(e,n,t))return n;return-1}function C(e,t,n){if(t+n.length>e.length)return!1;for(let r=0;r<n.length;r+=1)if(e[t+r]!==n.charCodeAt(r))return!1;return!0}async function Le(e,t){let n=e.width*e.height,r=null;if(n<=Ee)for(let t of Te){let n=await Re(e.source,e.width,e.height,t);if(r=w(r,n),n&&n.size<=3670016)return n}let i=r?.size??t,a=Math.min(Math.sqrt(we/i*.9),.95);for(let t=0;t<4;t+=1){let t=Math.max(Math.floor(e.width*a),1),n=Math.max(Math.floor(e.height*a),1),o=null;for(let i of Te){let a=await Re(e.source,t,n,i);if(r=w(r,a),o=w(o,a),a&&a.size<=3670016)return a}i=o?.size??i,a*=Math.min(Math.sqrt(we/i*.9),.9)}return null}function w(e,t){return t&&(!e||t.size<e.size)?t:e}async function Re(e,t,n,r){if(typeof document>`u`)return null;let i=document.createElement(`canvas`);i.width=t,i.height=n;let a=i.getContext(`2d`);if(!a||typeof i.toBlob!=`function`)return null;a.fillStyle=`#fff`,a.fillRect(0,0,t,n),a.drawImage(e,0,0,t,n);try{return await new Promise(e=>{i.toBlob(t=>e(t),`image/jpeg`,r)})}finally{i.width=0,i.height=0}}var ze=`vellum:chatDrafts:`;function Be(e){return`${ze}${e}`}function Ve(e){let t=n(Be(e),``);if(!t)return new Map;try{let e=JSON.parse(t);return typeof e!=`object`||!e||Array.isArray(e)?new Map:new Map(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return new Map}}function T(e,n){t(Be(e),JSON.stringify(Object.fromEntries(n)))}function He(){return`att-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Ue(e){return x(e)?`100 MB`:`50 MB`}function We(e){return e.size<=52428800?!0:x(e)&&e.size<=104857600}function Ge(e){let t=e.replace(/[/\\]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n===-1?t:t.slice(n+1)}var E=new Map,D=null,O=new Map,k=new Set,Ke=a()((e,t)=>({input:``,restoredDraftConversationId:null,attachments:[],attachmentLastError:null,setInput:t=>{e(e=>({input:typeof t==`function`?t(e.input):t}))},saveDraft:(e,t)=>{t.trim()?E.set(e,t):E.delete(e),D&&T(D,E)},clearDraft:e=>{E.delete(e),D&&T(D,E)},handleConversationSwitch:({previousKey:n,nextKey:r})=>{if(!(n!==null&&n!==r)||!n)return;let i=t().input;i.trim()?E.set(n,i):E.delete(n);let a=(r&&E.get(r))??``;e({input:a,restoredDraftConversationId:a.length>0&&r?r:null}),D&&T(D,E)},loadAssistantDrafts:(n,r)=>{if(D&&D!==n){let n=t().input;r&&(n.trim()?E.set(r,n):E.delete(r)),T(D,E),e({input:``,restoredDraftConversationId:null})}E=Ve(n),D=n},clearRestoredDraftNotice:()=>{e({restoredDraftConversationId:null})},restoreDraftIfEmpty:n=>{let r=E.get(n);r&&r.trim()&&!t().input.trim()&&e({input:r,restoredDraftConversationId:n})},addFiles:(t,n)=>{let r=Array.from(t);if(r.length===0)return;if(!n){e({attachmentLastError:`No active assistant. Please try again.`});return}let i=[],a=[];for(let e of r)We(e)?a.push(e):i.push(e);let o=i[0];if(e(o?{attachmentLastError:i.length===1?`${o.name} is larger than ${Ue(o)} and can't be attached.`:`${i.length} files are too large and can't be attached.`}:{attachmentLastError:null}),a.length===0)return;let s=a.map(e=>({pending:{kind:`uploading`,localId:He(),filename:e.name||`attachment`,mimeType:e.type||`application/octet-stream`,sizeBytes:e.size},file:e}));e(e=>({attachments:[...e.attachments,...s.map(e=>e.pending)]}));for(let{pending:t,file:r}of s)(async()=>{try{let i=await Ne(r);if(k.has(t.localId)){k.delete(t.localId);return}if(i.status===`failed`&&r.size>52428800){A(e,t.localId,i.error);return}let a=i.status===`failed`?r:i.file;if(a.size>52428800){A(e,t.localId,`This attachment is still larger than 50 MB after resizing. Try a smaller image.`);return}i.status===`resized`&&e(e=>({attachments:e.attachments.map(e=>e.localId===t.localId&&e.kind===`uploading`?{...e,filename:a.name||`attachment`,mimeType:a.type||`application/octet-stream`,sizeBytes:a.size}:e)}));let o=await ee(n,a);if(k.has(t.localId)){k.delete(t.localId);return}if(!o.ok){A(e,t.localId,o.error.detail??`Upload failed`);return}let s=a.type||`application/octet-stream`,c=o.filename??(a.name||`attachment`),u=o.mimeType??s,te=o.sizeBytes??a.size,d=a;if(u.startsWith(`image/`)&&u!==s){let e=await l(n,o.id);if(k.has(t.localId)){k.delete(t.localId);return}e&&(d=e)}let f=null;try{f=URL.createObjectURL(d),O.set(t.localId,f)}catch{f=null}e(e=>({attachments:e.attachments.map(e=>e.localId===t.localId?{kind:`uploaded`,localId:t.localId,id:o.id,filename:c,mimeType:u,sizeBytes:te,previewUrl:f,thumbnailUrl:null}:e)}))}catch{if(k.has(t.localId)){k.delete(t.localId);return}A(e,t.localId,`Upload failed`)}})()},addPathReferences:t=>{let n=[];for(let e of t){let t=e.trim();t&&n.push({kind:`path-reference`,localId:He(),path:t,filename:Ge(t)||t})}n.length!==0&&e(e=>({attachments:[...e.attachments,...n],attachmentLastError:null}))},removeAttachment:t=>{e(e=>{let n=e.attachments.find(e=>e.localId===t);return n&&n.kind===`uploading`&&k.add(t),{attachments:e.attachments.filter(e=>e.localId!==t)}}),qe(t)},resetAttachments:()=>{e(e=>{for(let t of e.attachments)t.kind===`uploading`&&k.add(t.localId);return{attachments:[],attachmentLastError:null}})},fullReset:()=>{e(e=>{for(let t of e.attachments)t.kind===`uploading`&&k.add(t.localId);return{attachments:[],attachmentLastError:null}}),O.forEach(e=>URL.revokeObjectURL(e)),O.clear()},dismissAttachmentError:()=>{e({attachmentLastError:null})}}));function A(e,t,n){e(e=>({attachments:e.attachments.map(e=>e.localId!==t||e.kind!==`uploading`?e:{kind:`failed`,localId:t,filename:e.filename,mimeType:e.mimeType,sizeBytes:e.sizeBytes,error:n})}))}function qe(e){let t=O.get(e);t&&(URL.revokeObjectURL(t),O.delete(e))}function Je(e){return e.reduce((e,t)=>t.kind===`uploading`?e+1:e,0)}function Ye(e){return e.filter(e=>e.kind===`uploaded`).map(e=>e.id)}function Xe(e){return e.filter(e=>e.kind===`path-reference`).map(e=>e.path)}var j=o(Ke);function Ze(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Qe(e){let t=JSON.parse(e);return Ze(t)?t:null}function M(e,t){let n=[...e??[]],r=n.findIndex(e=>e.type===`surface`&&e.surface.surfaceId===t.surfaceId);return r===-1?n.push({type:`surface`,surface:t}):n[r]={type:`surface`,surface:t},n}function $e(e,t){return e?.filter(e=>!(e.type===`surface`&&e.surface.surfaceId===t))}function et(e,t){if(!e.surfaces?.length)return e;let n=!1,r=e.contentBlocks,i=e.surfaces.map(e=>{let i=t(e);return i!==e&&(n=!0,r=M(r,i)),i});return n?{...e,surfaces:i,contentBlocks:r}:e}function tt(e,t){if(!e.surfaces?.length)return e;let n=e.surfaces.filter(t);if(n.length===e.surfaces.length)return e;let r=new Set(e.surfaces.filter(e=>!t(e)).map(e=>e.surfaceId));return{...e,surfaces:n,contentOrder:e.contentOrder?.filter(e=>!(e.type===`surface`&&r.has(e.id))),contentBlocks:e.contentBlocks?.filter(e=>!(e.type===`surface`&&r.has(e.surface.surfaceId)))}}var nt=500,rt=s({keyFn:e=>`vellum:dismissed-surfaces:${e}`,scope:`user`,parseValue:e=>Ze(e)?e:null,fallback:{},maxEntries:200});function it(e,t){let n=rt.get(e,t);return n?new Set(n):new Set}function at(e,t,n){let r=Array.from(n);r.length>nt&&(r=r.slice(r.length-nt)),rt.set(e,t,r)}var ot=[];function st(e,t){if(!e)return ot;if(t.size===0)return e;let n=!1,r=e.map(e=>{let r=tt(e,e=>!t.has(e.surfaceId));return r!==e&&(n=!0),r});return n?r:e}function ct(e){if(!e||typeof e!=`object`)return!1;let t=e;return!(typeof t.tokens!=`number`||!Number.isFinite(t.tokens)||t.maxTokens!==null&&(typeof t.maxTokens!=`number`||!Number.isFinite(t.maxTokens))||t.fillRatio!==null&&(typeof t.fillRatio!=`number`||!Number.isFinite(t.fillRatio)))}var lt=s({keyFn:e=>`vellum:ctxwindow:${e}`,scope:`user`,parseValue:e=>ct(e)?e:null,fallback:{},maxEntries:200});function ut(e){return new Map(Object.entries(lt.load(e)))}function dt(e,t,n){lt.set(e,t,n)}var ft=`PROVIDER_BILLING`,pt=`PROVIDER_NOT_CONFIGURED`,mt=`MANAGED_KEY_INVALID`,ht=`credits_exhausted`,gt=`provider_billing`;function _t(e){return e?.errorCategory?e.errorCategory.endsWith(ht):e?.code===ft}function vt(e){return e?.errorCategory?e.errorCategory.endsWith(gt):!1}function yt(e){return _t(e)?`managed_credits`:vt(e)?`provider_billing`:null}function N(e){return yt(e)!==null||e?.code===pt||e?.displayAs===`modal`}function bt(e){return!!e&&!N(e)}function xt(e){return e?.code===mt}var St={pendingSecret:null,isSubmittingSecret:!1,secretSaved:!1,pendingConfirmation:null,isSubmittingConfirmation:!1,pendingContactRequest:null,isSubmittingContactRequest:!1,contactRequestAccepted:!1,pendingQuestion:null,isSubmittingQuestion:!1,isQuestionCardDismissed:!1,inlineConfirmationToolCallId:null,pendingAcpConnect:null,dismissedAcpConnectToolUseIds:new Set,pendingAcpContinue:!1,unknownNudgeToolCallIds:new Set},P=o(a()((e,t)=>({...St,showSecret:n=>{let{pendingSecret:r}=t();if(r&&r.requestId===n.requestId){let t={};for(let e of Object.keys(n))n[e]!==void 0&&(t[e]=n[e]);e({pendingSecret:{...r,...t}});return}e({pendingSecret:n,isSubmittingSecret:!1,secretSaved:!1})},submitSecretStart:()=>e({isSubmittingSecret:!0}),submitSecretEnd:t=>e({isSubmittingSecret:!1,secretSaved:t??!1}),dismissSecret:()=>e({pendingSecret:null,isSubmittingSecret:!1}),updateSecret:(n,r)=>{let{pendingSecret:i}=t();!i||i.requestId!==n||e({pendingSecret:{...i,...r}})},showConfirmation:t=>e({pendingConfirmation:t,isSubmittingConfirmation:!1}),submitConfirmationStart:()=>e({isSubmittingConfirmation:!0}),submitConfirmationEnd:()=>e({isSubmittingConfirmation:!1}),dismissConfirmation:()=>e({pendingConfirmation:null,isSubmittingConfirmation:!1}),dismissConfirmationIfMatches:n=>{let{pendingConfirmation:r}=t();!r||r.requestId!==n||e({pendingConfirmation:null,isSubmittingConfirmation:!1})},updateConfirmation:(n,r)=>{let{pendingConfirmation:i}=t();!i||i.requestId!==n||e({pendingConfirmation:{...i,...r}})},setInlineConfirmationToolCallId:t=>e({inlineConfirmationToolCallId:t}),showContactRequest:t=>e({pendingContactRequest:t,isSubmittingContactRequest:!1,contactRequestAccepted:!1}),submitContactRequestStart:()=>e({isSubmittingContactRequest:!0}),submitContactRequestEnd:()=>e({isSubmittingContactRequest:!1}),dismissContactRequest:()=>e({pendingContactRequest:null,isSubmittingContactRequest:!1}),acceptContactRequest:()=>e({contactRequestAccepted:!0}),showQuestion:t=>e({pendingQuestion:t,isSubmittingQuestion:!1,isQuestionCardDismissed:!1}),submitQuestionStart:()=>e({isSubmittingQuestion:!0}),submitQuestionEnd:()=>e({isSubmittingQuestion:!1}),dismissQuestion:()=>e({pendingQuestion:null,isSubmittingQuestion:!1,isQuestionCardDismissed:!1}),dismissQuestionCard:()=>e({isQuestionCardDismissed:!0}),resetSecretAndConfirmation:()=>e({pendingSecret:null,isSubmittingSecret:!1,secretSaved:!1,pendingConfirmation:null,isSubmittingConfirmation:!1,inlineConfirmationToolCallId:null}),showAcpConnect:t=>e(e=>e.dismissedAcpConnectToolUseIds.has(t.toolUseId)?{}:{pendingAcpConnect:t}),dismissAcpConnect:()=>e(e=>({pendingAcpConnect:null,dismissedAcpConnectToolUseIds:e.pendingAcpConnect?new Set(e.dismissedAcpConnectToolUseIds).add(e.pendingAcpConnect.toolUseId):e.dismissedAcpConnectToolUseIds})),requestAcpContinue:()=>e({pendingAcpContinue:!0}),clearAcpContinue:()=>e({pendingAcpContinue:!1}),addUnknownNudgeToolCallId:n=>{let r=t().unknownNudgeToolCallIds;r.has(n)||e({unknownNudgeToolCallIds:new Set([...r,n])})},removeUnknownNudgeToolCallId:n=>{let r=t().unknownNudgeToolCallIds;if(!r.has(n))return;let i=new Set(r);i.delete(n),e({unknownNudgeToolCallIds:i})},resetAll:()=>e(St)})));function Ct(e){if(e.length===0)return``;let t=e[0]??``;for(let n=1;n<e.length;n++){let r=t[t.length-1],i=e[n][0];r&&i&&r!==` `&&r!==`
2
+ `&&r!==` `&&i!==` `&&i!==`
3
+ `&&i!==` `&&(t+=` `),t+=e[n]}return t}function wt(e){let t=[];for(let n of e?.contentBlocks??[])n.type===`text`&&t.push(n.text);return Ct(t)}function Tt(e){if(!(!e||e.length===0))return e.map(e=>{let{previewUrl:t,thumbnailUrl:n}=te(e.mimeType,e.data,e.thumbnailData,e.id!=null);return{id:e.id??e.filename,filename:e.filename,mimeType:e.mimeType,sizeBytes:e.sizeBytes??(e.data?Math.floor(e.data.length*3/4):0),previewUrl:t,thumbnailUrl:n}})}function F(e){let t=e[e.length-1];return!!t&&t.role===`assistant`}function Et(e,t){if(!t)return null;let n=e.length-1;for(;n>=0&&e[n].role===`user`&&e[n].queueStatus===`queued`;)n--;let r=e[n];return!r||r.role!==`assistant`?null:r.id}function I(e,t){return e.findIndex(e=>e.role===`assistant`&&(e.id===t||!!e.mergedMessageIds?.includes(t)))}function L(e,t){if(!t||e.id===t)return e;let n=e.mergedMessageIds??[];return n.includes(t)?e:{...e,mergedMessageIds:[...n,t]}}function R(e,t=Date.now()){if(!e.toolCalls?.some(e=>f(e)))return null;let n=t;return{toolCalls:e.toolCalls.map(e=>f(e)?{...e,completedAt:n}:e),contentBlocks:e.contentBlocks?.map(e=>e.type===`tool_use`&&f(e.toolCall)?{type:`tool_use`,toolCall:{...e.toolCall,completedAt:n}}:e)}}function Dt(e,t,n){return e.map(e=>e.id===t?{...e,queuePosition:n}:e)}function Ot(e,t){return e.map(e=>e.id===t?{...e,queueStatus:void 0,queuePosition:void 0}:e)}function kt(e,t){return e.filter(e=>e.id!==t)}function At(e,t,n,r=Date.now()){return[...e,{id:n??crypto.randomUUID(),...n?{}:{isOptimistic:!0},role:`assistant`,textSegments:[t],contentOrder:[{type:`text`,id:`0`}],contentBlocks:[{type:`text`,text:t}],timestamp:r}]}function jt(e,t,n){n&&e[e.length-1]?.type===t.type?e[e.length-1]=t:e.push(t)}function z(e,t,n,r){let i=L(e[t],r),a=[...i.textSegments??[]],o=[...i.contentOrder??[]],s=[...i.contentBlocks??[]],c=o[o.length-1]?.type===`text`&&a.length>0;c?a[a.length-1]=a[a.length-1]+n:(o.push({type:`text`,id:String(a.length)}),a.push(n)),jt(s,{type:`text`,text:a[a.length-1]},c);let l=[...e];return l[t]={...i,textSegments:a,contentOrder:o,contentBlocks:s},l}function B(e,t,n,r){let i=L(e[t],r),a=[...i.thinkingSegments??[]],o=[...i.contentOrder??[]],s=[...i.contentBlocks??[]],c=o[o.length-1]?.type===`thinking`&&a.length>0;c?a[a.length-1]=a[a.length-1]+n:(o.push({type:`thinking`,id:String(a.length)}),a.push(n)),jt(s,{type:`thinking`,thinking:a[a.length-1]},c);let l=[...e];return l[t]={...i,thinkingSegments:a,contentOrder:o,contentBlocks:s},l}function Mt(e,t,n,r,i=Date.now()){if(n){let a=I(e,n);if(a>=0)return z(e,a,t,n);if(F(e))return z(e,e.length-1,t,n);let o=r?.();return o?z([...e,o],e.length,t,n):At(e,t,n,i)}return F(e)?z(e,e.length-1,t,void 0):At(e,t,n,i)}function Nt(e,t,n,r=Date.now()){return[...e,{id:n??crypto.randomUUID(),...n?{}:{isOptimistic:!0},role:`assistant`,thinkingSegments:[t],contentOrder:[{type:`thinking`,id:`0`}],contentBlocks:[{type:`thinking`,thinking:t}],timestamp:r}]}function Pt(e,t,n,r,i=Date.now()){if(n){let a=I(e,n);if(a>=0)return B(e,a,t,n);if(F(e))return B(e,e.length-1,t,n);let o=r?.();return o?B([...e,o],e.length,t,n):Nt(e,t,n,i)}return F(e)?B(e,e.length-1,t,void 0):Nt(e,t,n,i)}function Ft(e,t=Date.now()){let n=!1,r=e.map(e=>{if(e.role!==`assistant`)return e;let r=R(e,t);return r?(n=!0,{...e,...r}):e});return n?r:e}function It(e,t,n=Date.now()){let r=e[e.length-1],i=Tt(t.attachments);if(r?.role!==`assistant`)return i?[...e,{id:t.messageId??crypto.randomUUID(),...t.messageId?{}:{isOptimistic:!0},role:`assistant`,timestamp:n,attachments:i}]:e;let a=R(r,n),o=r.isOptimistic===!0&&!!t.messageId;return[...e.slice(0,-1),{...r,...o?{id:t.messageId,isOptimistic:!1}:{},...i?{attachments:i}:{},...a??{}}]}function Lt(e,t){if(t!==void 0)return e.findIndex(e=>e.role===`user`&&e.clientMessageId===t);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.role===`user`&&n.isOptimistic===!0)return t}return-1}function Rt(e,t,n=Date.now()){let r=t.messageId;if(r!==void 0&&e.some(e=>e.role===`user`&&(e.id===r||e.mergedMessageIds?.includes(r))))return e;let i=Lt(e,t.clientMessageId);if(i!==-1){if(r===void 0)return e;let t=[...e];return t[i]={...t[i],id:r,isOptimistic:!1,queueStatus:void 0,queuePosition:void 0},t}return[...e,{id:r??crypto.randomUUID(),...r===void 0?{isOptimistic:!0}:{},...t.clientMessageId?{clientMessageId:t.clientMessageId}:{},role:`user`,textSegments:[t.text],contentOrder:[{type:`text`,id:`0`}],contentBlocks:[{type:`text`,text:t.text}],timestamp:n}]}function zt(e,t=Date.now()){let n=e.length-1,r=e[n];if(!r||r.role!==`assistant`)return e;let i=R(r,t);if(!(wt(r).trim().length>0||r.thinkingSegments!=null&&r.thinkingSegments.length>0||r.toolCalls!=null&&r.toolCalls.length>0||r.surfaces!=null&&r.surfaces.length>0))return e.slice(0,-1);let a=[...e];return a[n]={...r,...i??{}},a}function V(e,t){let n=[...e??[]],r=n.findIndex(e=>e.type===`tool_use`&&e.toolCall.id===t.id);return r===-1?n.push({type:`tool_use`,toolCall:t}):n[r]={type:`tool_use`,toolCall:t},n}function H(e,t,n,r){let i=L(e[t],r),a=i.toolCalls?.findIndex(e=>e.id===n.id)??-1,o=[...e];if(a!==-1){let e=[...i.toolCalls??[]],r={...e[a],...n};return e[a]=r,o[t]={...i,toolCalls:e,contentBlocks:V(i.contentBlocks,r)},o}return o[t]={...i,toolCalls:[...i.toolCalls??[],n],contentOrder:[...i.contentOrder??[],{type:`toolCall`,id:n.id}],contentBlocks:V(i.contentBlocks,n)},o}function Bt(e,t,n,r=Date.now()){if(n){let r=I(e,n);if(r>=0)return H(e,r,t,n);if(F(e))return H(e,e.length-1,t,n)}else if(F(e))return H(e,e.length-1,t);return[...e,{id:n??crypto.randomUUID(),...n?{}:{isOptimistic:!0},role:`assistant`,toolCalls:[t],contentOrder:[{type:`toolCall`,id:t.id}],contentBlocks:[{type:`tool_use`,toolCall:t}],timestamp:r}]}function Vt(e,t){let n=-1,r=-1;if(t.toolUseId)for(let i=e.length-1;i>=0;i--){let a=e[i];if(a?.role!==`assistant`||!a.toolCalls?.length)continue;let o=a.toolCalls.findIndex(e=>e.id===t.toolUseId);if(o!==-1){n=i,r=o;break}}if(n===-1){if(n=e.findLastIndex(e=>e.role===`assistant`&&e.toolCalls&&e.toolCalls.length>0),n===-1)return e;let t=e[n];if(!t?.toolCalls)return e;r=t.toolCalls.findLastIndex(e=>f(e))}if(r===-1)return e;let i=e[n],a=i.toolCalls[r];if(!a)return e;let o=t.imageDataList===void 0?t.imageData===void 0?void 0:[t.imageData]:t.imageDataList,s=t.imageData===void 0?o?.[0]:t.imageData,c=[...i.toolCalls],l={...a,result:t.result,isError:t.isError,riskLevel:t.riskLevel,riskReason:t.riskReason,matchedTrustRuleId:t.matchedTrustRuleId,approvalMode:t.approvalMode,approvalReason:t.approvalReason,riskThreshold:t.riskThreshold,riskAllowlistOptions:t.riskAllowlistOptions,riskScopeOptions:t.riskScopeOptions,riskDirectoryScopeOptions:t.riskDirectoryScopeOptions,...s===void 0?{}:{imageData:s},...o===void 0?{}:{imageDataList:o},...t.activityMetadata===void 0?{}:{activityMetadata:t.activityMetadata},...t.errorCode===void 0?{}:{errorCode:t.errorCode},completedAt:t.completedAt??Date.now(),streamedOutput:void 0};c[r]=l;let u=[...e];return u[n]={...i,toolCalls:c,contentBlocks:V(i.contentBlocks,l)},u}var Ht=16384;function Ut(e){return e.length<=16384?e:e.slice(e.length-Ht)}function Wt(e,t){if(!t.chunk)return e;let n=-1,r=-1;if(t.toolUseId){if(t.messageId){let i=I(e,t.messageId);if(i>=0){let a=e[i].toolCalls?.findIndex(e=>e.id===t.toolUseId)??-1;a!==-1&&(n=i,r=a)}}if(n===-1)for(let i=e.length-1;i>=0;i--){let a=e[i];if(a?.role!==`assistant`||!a.toolCalls?.length)continue;let o=a.toolCalls.findIndex(e=>e.id===t.toolUseId);if(o!==-1){n=i,r=o;break}}}else{if(n=e.findLastIndex(e=>e.role===`assistant`&&e.toolCalls&&e.toolCalls.length>0),n===-1)return e;let t=e[n];if(!t?.toolCalls)return e;r=t.toolCalls.findLastIndex(e=>f(e))}if(n===-1||r===-1)return e;let i=e[n],a=i.toolCalls[r];if(!a)return e;let o={...a,streamedOutput:Ut((a.streamedOutput??``)+t.chunk)},s=[...i.toolCalls];s[r]=o;let c=[...e];return c[n]={...i,toolCalls:s,contentBlocks:V(i.contentBlocks,o)},c}function Gt(e,t,n,r=Date.now()){let i=-1;if(n&&(i=I(e,n)),i===-1){for(let t=e.length-1;t>=0;t--)if(e[t]?.role===`assistant`){i=t;break}}let a=[...e];if(i===-1)a.push({id:n??crypto.randomUUID(),...n?{}:{isOptimistic:!0},role:`assistant`,surfaces:[t],contentOrder:[{type:`surface`,id:t.surfaceId}],contentBlocks:[{type:`surface`,surface:t}],timestamp:r});else{let r=L(e[i],n);if(r.contentOrder?.some(e=>e.type===`surface`&&e.id===t.surfaceId)||r.surfaces?.some(e=>e.surfaceId===t.surfaceId))return e;a[i]={...r,surfaces:[...r.surfaces??[],t],contentOrder:[...r.contentOrder??[],{type:`surface`,id:t.surfaceId}],contentBlocks:M(r.contentBlocks,t)}}return a}function Kt(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r],a=i.surfaces?.findIndex(e=>e.surfaceId===t)??-1;if(a===-1)continue;let o=i.surfaces[a],s={...o.data,...n};o.data.templateData&&n.templateData&&typeof o.data.templateData==`object`&&typeof n.templateData==`object`&&(s.templateData={...o.data.templateData,...n.templateData});let c={...o,data:s},l=[...e],u=[...i.surfaces];return u[a]=c,l[r]={...i,surfaces:u,contentBlocks:M(i.contentBlocks,c)},l}return e}function qt(e,t){for(let n=e.length-1;n>=0;n--){if(!e[n].surfaces?.some(e=>e.surfaceId===t))continue;let r=[...e];return r[n]={...e[n],surfaces:e[n].surfaces?.filter(e=>e.surfaceId!==t),contentOrder:e[n].contentOrder?.filter(e=>!(e.type===`surface`&&e.id===t)),contentBlocks:$e(e[n].contentBlocks,t)},r}return e}function Jt(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r].surfaces?.find(e=>e.surfaceId===t);if(!i)continue;let a={...i,completed:!0,completionSummary:n},o=[...e];return o[r]={...e[r],surfaces:e[r].surfaces?.map(e=>e.surfaceId===t?a:e),contentBlocks:M(e[r].contentBlocks,a)},o}return e}var Yt=[`choice`,`oauth_connect`,`form`,`confirmation`,`file_upload`,`card`,`list`,`table`,`browser_view`,`task_preferences`];function Xt(e){return e==null||e.hasPendingConfirmation||e.hasUncompletedVisibleSurface}function Zt(e,t){let n=!1,r=e.map(e=>{let r=p(e,e=>e.pendingConfirmation?.requestId===t?{...e,pendingConfirmation:void 0}:e);return r!==e&&(n=!0),r});return n?r:e}function Qt(e){let t=!1,n=e.map(e=>{let n=p(e,e=>e.pendingConfirmation?{...e,pendingConfirmation:void 0}:e);return n!==e&&(t=!0),n});return t?n:e}function $t(e,t){let n=new Set;for(let e of t)if(e.surfaces)for(let t of e.surfaces)ie(t)&&n.add(t.surfaceId);return n.size===0?{updatedMessages:e,dismissedIds:n}:{updatedMessages:e.map(e=>tt(e,e=>!n.has(e.surfaceId))),dismissedIds:n}}function en(e,t,n,r){for(let i=e.length-1;i>=0;i--){let a=e[i].surfaces?.find(e=>e.surfaceId===t);if(!a)continue;if(!Yt.includes(a.surfaceType))return e;let o=a.actions?.find(e=>e.id===n),s=n===`cancel`||n===`dismiss`||o?.style===`secondary`,c=[...e];return c[i]=et(e[i],e=>e.surfaceId===t?{...e,completed:!0,completionSummary:s?`Cancelled`:r??o?.label??void 0}:e),c}return e}function tn(e,t,n){return e&&re[e]||t||n}function U(e){return typeof e==`string`?e:void 0}function W(e){return typeof e==`boolean`?e:void 0}function nn(e){return Array.isArray(e)?e:void 0}function rn(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function G(e){return Array.isArray(e)?e:void 0}function an(e){return{requestId:typeof e.requestId==`string`?e.requestId:``,label:U(e.label),service:U(e.service),field:U(e.field),description:U(e.description),placeholder:U(e.placeholder),allowOneTimeSend:W(e.allowOneTimeSend),allowedTools:nn(e.allowedTools),allowedDomains:nn(e.allowedDomains),purpose:U(e.purpose)}}function on(e){let t={requestId:typeof e.requestId==`string`?e.requestId:``,title:U(e.title),description:U(e.description),toolName:U(e.toolName),riskLevel:U(e.riskLevel),riskReason:U(e.riskReason),allowlistOptions:G(e.allowlistOptions),scopeOptions:G(e.scopeOptions),directoryScopeOptions:G(e.directoryScopeOptions),persistentDecisionsAllowed:W(e.persistentDecisionsAllowed),input:rn(e.input),toolUseId:U(e.toolUseId)};return{confData:t,state:{...t,confirmLabel:U(e.confirmLabel),denyLabel:U(e.denyLabel)}}}function sn(){return`turn-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function cn(e,t){let n=Date.parse(e);return Number.isFinite(n)?n:typeof t==`number`?t:0}function ln(e,t,n){switch(t.type){case`assistant_text_delta`:return Mt(e,t.text,t.messageId,void 0,n);case`assistant_thinking_delta`:return Pt(e,t.thinking,t.messageId,void 0,n);case`message_complete`:return It(e,t,n);case`user_message_echo`:return Rt(e,{text:t.text,messageId:t.messageId,clientMessageId:t.clientMessageId},n);case`assistant_activity_state`:return t.phase===`idle`?Ft(e,n):e;case`conversation_error`:return zt(e,n);case`tool_use_preview_start`:return Bt(e,{id:t.toolUseId,name:t.toolName,input:{},previewStartedAt:typeof t.previewStartedAt==`number`?t.previewStartedAt:n},t.messageId,n);case`tool_use_start`:return Bt(e,{id:t.toolUseId??`tool-${n}`,name:t.toolName,input:t.input,startedAt:`startedAt`in t&&typeof t.startedAt==`number`?t.startedAt:n,...`previewStartedAt`in t&&typeof t.previewStartedAt==`number`?{previewStartedAt:t.previewStartedAt}:{}},t.messageId,n);case`tool_result`:return Vt(e,{toolUseId:t.toolUseId,result:t.result,isError:t.isError,riskLevel:t.riskLevel,riskReason:t.riskReason,matchedTrustRuleId:t.matchedTrustRuleId,approvalMode:t.approvalMode,approvalReason:t.approvalReason,riskThreshold:t.riskThreshold,riskAllowlistOptions:t.riskAllowlistOptions,riskScopeOptions:t.riskScopeOptions,riskDirectoryScopeOptions:t.riskDirectoryScopeOptions,imageData:t.imageData,imageDataList:t.imageDataList,activityMetadata:t.activityMetadata,errorCode:t.errorCode,completedAt:`completedAt`in t&&typeof t.completedAt==`number`?t.completedAt:n});case`tool_output_chunk`:return t.chunk?Wt(e,{chunk:t.chunk,toolUseId:t.toolUseId,messageId:t.messageId}):e;case`ui_surface_show`:{let r={surfaceId:t.surfaceId,surfaceType:t.surfaceType,title:t.title,data:t.data,actions:t.actions,display:t.display};return r.display=d(r),Gt(e,r,t.messageId,n)}case`ui_surface_update`:return Kt(e,t.surfaceId,t.data);case`ui_surface_dismiss`:return qt(e,t.surfaceId);case`ui_surface_complete`:return Jt(e,t.surfaceId,t.summary);case`confirmation_request`:return ne(e,{requestId:t.requestId,toolName:t.toolName,riskLevel:t.riskLevel,riskReason:t.riskReason,allowlistOptions:t.allowlistOptions,scopeOptions:t.scopeOptions,directoryScopeOptions:t.directoryScopeOptions,persistentDecisionsAllowed:t.persistentDecisionsAllowed,input:t.input,toolUseId:t.toolUseId}).updatedMessages;case`interaction_resolved`:return t.kind===`confirmation`||t.kind===`acp_confirmation`?Zt(e,t.requestId):e;default:return e}}function un(e,t,n){if(e!==void 0){if(typeof n!=`number`)return e;switch(t.type){case`assistant_turn_start`:case`assistant_text_delta`:case`assistant_thinking_delta`:return!0;case`assistant_activity_state`:return t.phase!==`idle`;case`message_complete`:return!1;default:return e}}}function dn(e,t){let{seq:n}=t;if(typeof n==`number`&&typeof e.seq==`number`&&n<=e.seq)return e;let r=cn(t.emittedAt,n),i=ln(e.messages,t.message,r),a=typeof n==`number`?Math.max(e.seq??-1,n):e.seq??null,o=un(e.processing,t.message,n);return{...e,messages:i,seq:a,processing:o}}function fn(e,t){return t.reduce(dn,e)}function pn(e,t){return t===null?e:fn(e,t)}function mn(e){return[...new Set([e.id,...e.mergedMessageIds??[]].filter(e=>typeof e==`string`&&e.length>0))]}function K(e){let t=mn(e);return e.clientMessageId&&!t.includes(e.clientMessageId)?[...t,e.clientMessageId]:t}var hn={hasMore:!1,oldestTimestamp:null,isLoadingOlder:!1};function gn(){return{snapshot:null,optimisticSends:[],error:null,notice:null,isLoadingHistory:!0,transcriptPagination:{...hn},contextWindowUsage:null,ephemeralMetaResults:[],compactionCircuitOpenUntil:null,dismissedSurfaceIds:new Set,streamingMessageIds:new Set,pendingQueuedMessageIds:[],requestIdToMessageId:new Map,pendingLocalDeletions:new Set,confirmationToolCallMap:new Map,expandedToolCallIds:new Set,expandedCardIds:new Map,contextWindowUsageByConversation:new Map,previousConversationId:null,previousAssistantId:null,draftConversationIdResolution:!1}}function q(e,t){return typeof t==`function`?t(e):t}function _n(e,t){if(e.length===0)return e;let n=new Map;for(let e of t)for(let t of K(e))n.has(t)||n.set(t,e);let r=e.filter(e=>{let t;for(let r of K(e))if(t=n.get(r),t)break;return t?!!e.attachments?.length&&!t.attachments?.length:!0});return r.length===e.length?e:r}var J=o(a()((e,t)=>({...gn(),seedSnapshot:(n,r)=>{let i=t().snapshot;if(r.seq==null&&i!==null&&typeof i.seq==`number`){c(`history_seed_skipped_anchorless`,{conversationId:n,liveSeq:i.seq});return}let a=be(n,r.seq??null);if(a===null&&i!==null&&typeof i.seq==`number`&&typeof r.seq==`number`&&r.seq<i.seq){c(`history_seed_skipped_stale_anchor`,{conversationId:n,liveSeq:i.seq,fetchedSeq:r.seq});return}let o=pn(r,a);e(e=>({snapshot:o,optimisticSends:_n(e.optimisticSends,o.messages)}))},applyEnvelopeToSnapshot:t=>e(e=>e.snapshot?{snapshot:dn(e.snapshot,t)}:{}),addOptimisticSend:t=>e(e=>({optimisticSends:[...e.optimisticSends,t]})),setOptimisticSends:t=>e(e=>({optimisticSends:q(e.optimisticSends,t)})),patchSnapshotMessages:t=>e(e=>e.snapshot?{snapshot:{...e.snapshot,messages:t(e.snapshot.messages)}}:{}),setError:t=>e(e=>({error:q(e.error,t)})),setNotice:t=>e(e=>({notice:q(e.notice,t)})),setIsLoadingHistory:t=>e({isLoadingHistory:t}),setTranscriptPagination:t=>e(e=>({transcriptPagination:q(e.transcriptPagination,t)})),setContextWindowUsage:t=>e(e=>({contextWindowUsage:q(e.contextWindowUsage,t)})),setCompactionCircuitOpenUntil:t=>e(e=>({compactionCircuitOpenUntil:q(e.compactionCircuitOpenUntil,t)})),switchToConversation:({assistantId:n,activeConversationId:r})=>{let i=t();if(i.draftConversationIdResolution){e({draftConversationIdResolution:!1});return}let a=i.previousConversationId;if(a&&a!==r&&a){let e=P.getState();(e.pendingSecret||e.pendingConfirmation)&&u.getState().addAttentionConversationId(a)}let o=i.previousAssistantId!==null&&i.previousAssistantId!==n,s=o||i.previousAssistantId===null;c(`conversation_switch_reset`,{assistantId:n,conversationId:r,outgoingConversationId:a??null}),j.getState().handleConversationSwitch({previousKey:a??null,nextKey:r}),b.getState().resetTurn(),P.getState().resetAll(),o?j.getState().fullReset():j.getState().resetAttachments();let l=s?ut(n):i.contextWindowUsageByConversation;e({snapshot:null,optimisticSends:[],ephemeralMetaResults:[],error:N(i.error)?i.error:null,notice:null,isLoadingHistory:!0,transcriptPagination:{...hn},contextWindowUsage:l.get(r)??null,compactionCircuitOpenUntil:null,dismissedSurfaceIds:it(n,r),streamingMessageIds:new Set,pendingQueuedMessageIds:[],requestIdToMessageId:new Map,pendingLocalDeletions:new Set,confirmationToolCallMap:new Map,expandedToolCallIds:new Set,expandedCardIds:new Map,contextWindowUsageByConversation:l,previousConversationId:r,previousAssistantId:n,draftConversationIdResolution:!1})},markDraftResolution:()=>e({draftConversationIdResolution:!0}),setConfirmationToolCall:(t,n)=>e(e=>{let r=new Map(e.confirmationToolCallMap);return r.set(t,n),{confirmationToolCallMap:r}}),deleteConfirmationToolCall:t=>e(e=>{let n=new Map(e.confirmationToolCallMap);return n.delete(t),{confirmationToolCallMap:n}}),clearConfirmationToolCallMap:()=>e({confirmationToolCallMap:new Map}),addDismissedSurfaceId:t=>e(e=>{let n=new Set(e.dismissedSurfaceIds);return n.add(t),{dismissedSurfaceIds:n}}),addDismissedSurfaceIds:t=>e(e=>{let n=new Set(e.dismissedSurfaceIds);for(let e of t)n.add(e);return{dismissedSurfaceIds:n}}),batchUpdateStreamingMessageIds:(t,n)=>e(e=>{let r=new Set(e.streamingMessageIds);for(let e of t)r.add(e);for(let e of n)r.delete(e);return{streamingMessageIds:r}}),pushPendingQueuedMessageId:t=>e(e=>({pendingQueuedMessageIds:[...e.pendingQueuedMessageIds,t]})),shiftPendingQueuedMessageId:()=>{let n=t().pendingQueuedMessageIds;if(n.length===0)return;let[r,...i]=n;return e({pendingQueuedMessageIds:i}),r},setRequestIdMapping:(t,n)=>e(e=>{let r=new Map(e.requestIdToMessageId);return r.set(t,n),{requestIdToMessageId:r}}),popRequestIdMapping:n=>{let r=t().requestIdToMessageId,i=r.get(n);if(i!==void 0){let t=new Map(r);t.delete(n),e({requestIdToMessageId:t})}return i},addPendingLocalDeletion:t=>e(e=>{let n=new Set(e.pendingLocalDeletions);return n.add(t),{pendingLocalDeletions:n}}),consumePendingLocalDeletion:n=>{let r=t().pendingLocalDeletions;if(!r.has(n))return!1;let i=new Set(r);return i.delete(n),e({pendingLocalDeletions:i}),!0},setExpandedToolCallId:(t,n)=>e(e=>{let r=new Set(e.expandedToolCallIds);return n?r.add(t):r.delete(t),{expandedToolCallIds:r}}),setExpandedCardId:(t,n)=>e(e=>{let r=new Map(e.expandedCardIds);return r.set(t,n),{expandedCardIds:r}}),setContextWindowUsageForConversation:(t,n)=>e(e=>{let r=new Map(e.contextWindowUsageByConversation);return r.set(t,n),{contextWindowUsageByConversation:r}}),addEphemeralMetaResult:t=>e(e=>({ephemeralMetaResults:[...e.ephemeralMetaResults,t]})),clearEphemeralMetaResults:()=>e(e=>e.ephemeralMetaResults.length===0?e:{ephemeralMetaResults:[]})})));function vn(e,t){if(t.length===0)return e;let n=new Map;for(let e of t)for(let t of K(e))n.has(t)||n.set(t,e);let r=[],i=new Set;for(let t of e){let e;for(let r of K(t)){let t=n.get(r);if(t){e=t;break}}if(e){i.has(e)||(r.push(e),i.add(e));continue}r.push(t)}for(let e of t)i.has(e)||r.push(e);return r}function yn(){let e=J.use.snapshot(),t=J.use.optimisticSends(),n=J.use.dismissedSurfaceIds();return(0,le.useMemo)(()=>vn(st(e?.messages,n),t),[e,t,n])}function Y(e,t,n=`…`){return e.length<=t?e:e.slice(0,t-n.length)+n}function bn(e){if(!e)return null;let t=e.split(`/`),n=t[t.length-1];return!n||n===`.`?null:n}function X(e,t){return Y(e,t,`...`)}function xn(e){if(!e)return null;let t=e.replace(/\s+/g,` `).trim().match(/(?:^|&&\s*|\|\|\s*|;\s*)(?:\S*\/)?assistant\s+browser\s+([^\s;&|]+)/i);if(!t)return null;let n=t[1].toLowerCase();return new Set([`navigate`,`click`,`type`,`screenshot`,`snapshot`,`scroll`,`hover`,`select`,`drag`,`wait`,`back`,`forward`,`refresh`,`close`,`tab`,`press_key`,`wait_for`,`extract`,`fill_credential`]).has(n)?n:`unknown`}function Z(e,t){let n=e.toLowerCase();return n!==`bash`&&n!==`host_bash`?null:xn(t)}function Sn(e){switch(e){case`navigate`:return`Opened a page`;case`click`:return`Clicked on the page`;case`type`:return`Typed on the page`;case`screenshot`:return`Took a screenshot`;case`snapshot`:return`Captured page snapshot`;case`scroll`:return`Scrolled the page`;case`hover`:return`Hovered on the page`;case`select`:return`Selected on the page`;case`drag`:return`Dragged on the page`;case`wait`:return`Waited for the page`;case`back`:return`Went back`;case`forward`:return`Went forward`;case`refresh`:return`Refreshed the page`;case`close`:return`Closed the tab`;case`tab`:return`Switched tabs`;case`press_key`:return`Pressed a key`;case`wait_for`:return`Waited for a condition`;case`extract`:return`Extracted page content`;case`fill_credential`:return`Filled a credential`;case`unknown`:return`Used the browser`}}function Cn(e){switch(e){case`navigate`:return`Opening a page`;case`click`:return`Clicking on the page`;case`type`:return`Typing on the page`;case`screenshot`:return`Taking a screenshot`;case`snapshot`:return`Capturing page snapshot`;case`scroll`:return`Scrolling the page`;case`hover`:return`Hovering on the page`;case`select`:return`Selecting on the page`;case`drag`:return`Dragging on the page`;case`wait`:return`Waiting for the page`;case`back`:return`Going back`;case`forward`:return`Going forward`;case`refresh`:return`Refreshing the page`;case`close`:return`Closing the tab`;case`tab`:return`Switching tabs`;case`press_key`:return`Pressing a key`;case`wait_for`:return`Waiting for a condition`;case`extract`:return`Extracting page content`;case`fill_credential`:return`Filling a credential`;case`unknown`:return`Using the browser`}}function wn(e){switch(e){case`navigate`:case`back`:case`forward`:case`tab`:return`compass`;case`click`:case`hover`:case`select`:case`drag`:case`scroll`:return`compass`;case`screenshot`:case`snapshot`:return`camera`;case`type`:case`press_key`:case`fill_credential`:return`compass`;case`wait`:case`wait_for`:case`refresh`:case`close`:return`compass`;case`extract`:return`compass`;case`unknown`:return`compass`}}function Tn(e,t){let n=e.toLowerCase();if(n===`bash`||n===`host_bash`){let e=t.command??t.cmd;if(typeof e==`string`)return e.replace(/\s+/g,` `).trim()}if(n===`file_read`||n===`host_file_read`||n===`file_write`||n===`host_file_write`||n===`file_edit`||n===`host_file_edit`){let e=t.file_path??t.path??t.filePath;if(typeof e==`string`)return e}if(n===`grep`||n===`glob`){let e=t.pattern??t.query;if(typeof e==`string`)return e}if(n===`web_search`){let e=t.query??t.search;if(typeof e==`string`)return e}return``}function En(e,t=``){let n=e.toLowerCase(),r=t.replace(/\s+/g,` `).trim(),i=bn(r),a=Z(e,r);if(a)return Sn(a);switch(n){case`bash`:case`host_bash`:return r?`Ran \`${X(r,30)}\``:`Ran a command`;case`file_read`:case`host_file_read`:return i?`Read ${i}`:`Read a file`;case`file_write`:case`host_file_write`:return i?`Wrote ${i}`:`Wrote a file`;case`file_edit`:case`host_file_edit`:return i?`Edited ${i}`:`Edited a file`;case`grep`:return r?`Searched for '${X(r,25)}'`:`Searched files`;case`glob`:return r?`Searched for ${X(r,25)}`:`Found files`;case`web_search`:return r?`Searched '${X(r,25)}'`:`Searched the web`;case`web_fetch`:return`Fetched a webpage`;default:return`Used ${e.replace(/_/g,` `)}`}}function Dn(e,t=``,n){let r=Z(e,t);if(r)return Cn(r);if(n){let t=e.toLowerCase();if(t===`app_create`||t===`app_refresh`||t===`app_update`)return n}switch(e.toLowerCase()){case`bash`:case`host_bash`:return`Running a command`;case`file_read`:case`host_file_read`:return`Reading a file`;case`file_write`:case`host_file_write`:return`Writing a file`;case`file_edit`:case`host_file_edit`:return`Editing a file`;case`grep`:return`Searching files`;case`glob`:return`Finding files`;case`web_search`:return`Searching the web`;case`web_fetch`:return`Fetching a webpage`;case`app_create`:return`Building your app`;case`app_refresh`:case`app_update`:return`Refreshing your app`;default:return`Running ${e.replace(/_/g,` `)}`}}function On(e){return e.split(/[_-]+/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function kn(e,t=``){let n=Z(e,t);if(n)return wn(n);switch(e.toLowerCase()){case`bash`:case`host_bash`:return`terminal`;case`file_read`:case`host_file_read`:return`file-text`;case`file_write`:case`host_file_write`:return`file-plus`;case`file_edit`:case`host_file_edit`:return`pencil`;case`grep`:case`glob`:case`web_search`:return`search`;case`web_fetch`:return`globe`;default:return`wrench`}}var An=80;function Q(e,...t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim().length>0)return t}return``}function jn(e){if(!e)return``;let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)}function Mn(e){if(!e.startsWith(`mcp__`))return null;let t=e.slice(5),n=t.indexOf(`__`);if(n===-1)return null;let r=t.slice(0,n),i=t.slice(n+2);return!r||!i?null:{serverName:r,toolMethod:i}}function $(e,t){let n=t&&typeof t==`object`?t:{},r=e.toLowerCase(),i=Q(n,`activity`,`reason`),a=Mn(e);if(a)return{title:`Using ${a.serverName}`,info:a.toolMethod,activity:i,iconName:`plug`};switch(r){case`bash`:case`host_bash`:return{title:`Working`,info:Y(Q(n,`command`,`cmd`).replace(/\s+/g,` `).trim(),An),activity:i,iconName:`terminal`};case`str_replace_editor`:case`text_editor`:{let e=Q(n,`command`).toLowerCase(),t=jn(Q(n,`path`,`file_path`,`filePath`));return e===`view`?{title:`Reading`,info:t,activity:i,iconName:`file`}:{title:`Editing`,info:t,activity:i,iconName:`pen`}}case`computer`:return{title:`Using computer`,info:Q(n,`action`),activity:i,iconName:`monitor`};case`skill_execute`:{let e=Q(n,`tool`);if(e){let t=n.input,r=$(e,t);return{...r,activity:i||r.activity}}return{title:`Using a skill`,info:Q(n,`skill`,`name`,`skillName`),activity:i,iconName:`sparkle`}}case`skill`:case`skill_invoke`:case`skill_load`:return{title:`Using a skill`,info:Q(n,`skill`,`name`,`skillName`),activity:i,iconName:`sparkle`};case`subagent_spawn`:return{title:`Spawning subagent`,info:Q(n,`label`,`objective`,`task`),activity:i,iconName:`user-plus`};default:return{title:e?`Running ${On(e)}`:`Running tool`,info:``,activity:i,iconName:`bolt`}}}function Nn(e){return $(e.name,e.input)}var Pn=[{open:`<thinking>`,close:`</thinking>`},{open:`<think>`,close:`</think>`}];function Fn(e){return Pn.some(t=>e.includes(t.open))}function In(e){if(!Fn(e))return null;let t=[],n=e=>{e.trim()&&t.push({type:`text`,text:e})},r=e=>{let n=e.trim();n&&t.push({type:`thinking`,thinking:n})},i=0;for(;;){let a=-1,o;for(let t of Pn){let n=e.indexOf(t.open,i);n!==-1&&(a===-1||n<a)&&(a=n,o=t)}if(!o)break;n(e.slice(i,a));let s=a+o.open.length,c=e.indexOf(o.close,s);if(c===-1)return r(e.slice(s)),t;r(e.slice(s,c)),i=c+o.close.length}return n(e.slice(i)),t}function Ln(e){return typeof e.id==`string`&&e.id.length>0}function Rn(e){return e.some(e=>e.type===`text`&&Fn(e.text))?e.flatMap(e=>{let t=e.type===`text`?In(e.text):null;return t?t.map(e=>e.type===`thinking`?{type:`thinking`,thinking:e.thinking}:{type:`text`,text:e.text}):[e]}):e}function zn(e,t){let n=t?.splitInlineThinking?Rn(e):e,r=[],i=null,a=()=>(i||(i={type:`activity`,items:[]},r.push(i)),i);for(let e of n)if(e.type===`thinking`){let t=a(),n=t.items[t.items.length-1];n?.type===`thinking`?(n.thinking=n.thinking?`${n.thinking}\n${e.thinking}`:e.thinking,e.startedAt!=null&&(n.startedAt=n.startedAt==null?e.startedAt:Math.min(n.startedAt,e.startedAt)),e.completedAt!=null&&(n.completedAt=n.completedAt==null?e.completedAt:Math.max(n.completedAt,e.completedAt))):t.items.push({type:`thinking`,thinking:e.thinking,startedAt:e.startedAt,completedAt:e.completedAt})}else if(e.type===`tool_use`){if(!Ln(e.toolCall))continue;a().items.push({type:`tool_use`,toolCall:e.toolCall})}else (e.type===`text`||e.type===`surface`)&&(i=null,r.push(e));return r}function Bn(e){let t=[],n=[];for(let r of e){if(r.type===`thinking`){r.thinking&&t.push({kind:`thinking`,text:r.thinking,startedAt:r.startedAt,completedAt:r.completedAt});continue}let e=r.toolCall;Vn(e)||(n.push(e),t.push({kind:`toolCall`,toolCall:e}))}return{cardItems:t,toolCalls:n}}function Vn(e){return!e.pendingConfirmation&&(e.name===`ui_show`||e.name===`ui_update`||e.name===`ui_dismiss`)}function Hn(e){if(e.name===`subagent_spawn`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`subagent_spawn`}function Un(e){if(e.name===`run_workflow`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`run_workflow`}function Wn(e){if(e.name===`acp_spawn`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`acp_spawn`}function Gn(e){if(e.name!==`bash`&&e.name!==`host_bash`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.background===!0}var Kn=new Set([`low`,`medium`,`high`]);function qn(e){let t=e?.toLowerCase();return t&&Kn.has(t)?t:`medium`}function Jn(e){switch(e?.toLowerCase()){case`low`:return{bg:`bg-[var(--system-positive-strong)]`,text:`text-white`,label:`Low`};case`medium`:return{bg:`bg-[var(--system-mid-strong)]`,text:`text-black`,label:`Medium`};case`high`:return{bg:`bg-[var(--system-negative-strong)]`,text:`text-white`,label:`High`};case`workspace`:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,border:`border border-[var(--border-element)]`,label:`Workspace`};default:return{bg:`bg-[var(--content-secondary)]`,text:`text-white`,label:e??`Unknown`}}}function Yn(e){switch(e?.toLowerCase()){case`low`:return`Auto-approved at Conservative tolerance or higher`;case`medium`:return`Auto-approved at Relaxed tolerance or higher`;case`high`:return`Auto-approved only at Full Access tolerance`;default:return}}function Xn(e){switch(e?.toLowerCase()){case`low`:return{bg:`bg-[var(--system-positive-weak)]`,text:`text-[var(--system-positive-strong)]`,label:`Low`};case`medium`:return{bg:`bg-[var(--system-mid-weak)]`,text:`text-[var(--system-mid-strong)]`,label:`Medium`};case`high`:return{bg:`bg-[var(--system-negative-weak)]`,text:`text-[var(--system-negative-strong)]`,label:`High`};case`workspace`:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,label:`Workspace`};default:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,label:e?e.charAt(0).toUpperCase()+e.slice(1):`Unknown`}}}var Zn={unknown:2,low:0,medium:1,high:2},Qn={none:-1,low:0,medium:1,high:2};function $n(e,t,n){return e?.toLowerCase()!==`auto`||!n?!0:(Zn[(t??``).toLowerCase()]??-1)<=(Qn[n.toLowerCase()]??-1)}function er(e){switch(e){case`trust_rule_allowed`:return`· Auto-approved · Trust rule matched`;case`sandbox_auto_approve`:return null;case`platform_auto_approve`:return`· Auto-approved · Platform session`;default:return null}}function tr(e,t){return e===`sandbox_auto_approve`?{displayLevel:`workspace`,inherentRisk:t}:{displayLevel:t??`unknown`}}export{Je as $,$t as A,F as B,vn as C,Zt as D,K as E,Xt as F,bt as G,P as H,Ot as I,at as J,N as K,Et as L,on as M,an as N,Qt as O,tn as P,Ye as Q,kt as R,yn as S,mn as T,yt as U,wt as V,xt as W,Qe as X,et as Y,Xe as Z,Dn as _,Yn as a,ve as at,On as b,Bn as c,pe as ct,Gn as d,fe as dt,j as et,Un as f,ce as ft,Tn as g,$ as h,ae as ht,Xn as i,xe as it,sn as j,en as k,zn as l,he as lt,Nn as m,oe as mt,er as n,Ce as nt,qn as o,ye as ot,Hn as p,se as pt,dt as q,Jn as r,b as rt,$n as s,_e as st,tr as t,v as tt,Wn as u,me as ut,kn as v,J as w,Y as x,En as y,Dt as z};
@@ -0,0 +1 @@
1
+ import{t as e}from"./is-electron-y5bNUVyG.js";var t=e=>e,n=(e,t)=>`${e}/${t}`,r=t(`/assistant/settings/billing`),i=`message`,a={assistant:t(`/assistant`),about:t(`/assistant/about`),bundleConfirm:t(`/assistant/bundle/confirm`),remotePair:t(`/assistant/pair`),credentialEntry:t(`/assistant/credentials/enter`),quickInput:t(`/assistant/quick-input`),conversations:t(`/assistant/conversations`),conversation:e=>n(t(`/assistant/conversations`),e),conversationAtMessage:(e,r)=>`${n(t(`/assistant/conversations`),e)}?${i}=${encodeURIComponent(r)}`,conversationWithPrompt:(e,r,i)=>{let a=`${n(t(`/assistant/conversations`),e)}?prompt=${encodeURIComponent(r)}`;return i?`${a}&relay=${encodeURIComponent(i)}`:a},inspect:e=>`${n(t(`/assistant/conversations`),e)}/inspect`,logs:{root:t(`/assistant/logs`),emails:t(`/assistant/logs/emails`),systemEvents:t(`/assistant/logs/system-events`)},account:{root:t(`/account`),login:t(`/account/login`),signup:t(`/account/signup`),providerSignup:t(`/account/provider/signup`),providerCallback:t(`/account/provider/callback`),oauth:{popupComplete:t(`/account/oauth/popup-complete`),complete:t(`/account/oauth/complete`),desktopComplete:t(`/account/oauth/desktop-complete`)}},welcome:t(`/assistant/welcome`),selectAssistant:t(`/assistant/select-assistant`),reviewTerms:t(`/assistant/review-terms`),onboarding:{start:t(`/assistant/onboarding/start`),hosting:t(`/assistant/onboarding/hosting`),apiKey:t(`/assistant/onboarding/api-key`),privacy:t(`/assistant/onboarding/privacy`),hatching:t(`/assistant/onboarding/hatching`),research:t(`/assistant/onboarding/research`)},home:t(`/assistant/home`),schedules:{root:t(`/assistant/schedules`),detail:e=>n(t(`/assistant/schedules`),e)},identity:t(`/assistant/identity`),personality:t(`/assistant/personality`),memory:t(`/assistant/memory`),plugins:t(`/assistant/plugins`),skills:{root:t(`/assistant/skills`),detail:e=>n(t(`/assistant/skills`),encodeURIComponent(e))},workspace:t(`/assistant/workspace`),library:{root:t(`/assistant/library`),app:e=>n(t(`/assistant/library`),e)},document:e=>n(t(`/assistant/documents`),e),connect:t(`/assistant/connect`),channels:t(`/assistant/channels`),contacts:{root:t(`/assistant/contacts`)},settings:{root:t(`/assistant/settings`),general:t(`/assistant/settings/general`),ai:t(`/assistant/settings/ai`),integrations:t(`/assistant/settings/integrations`),credentials:t(`/assistant/settings/credentials`),notifications:t(`/assistant/settings/notifications`),voice:t(`/assistant/settings/voice`),privacy:t(`/assistant/settings/privacy`),bookmarks:t(`/assistant/settings/bookmarks`),billing:r,billingUsage:`${r}?tab=usage`,usageForSchedule:e=>`${r}?${new URLSearchParams({tab:`usage`,range:`7d`,groupBy:`schedule`,scheduleId:e}).toString()}`,community:t(`/assistant/settings/community`),developer:t(`/assistant/settings/developer`),mcp:t(`/assistant/settings/mcp`),debug:t(`/assistant/settings/debug`),dangerZone:t(`/assistant/settings/danger-zone`),systemEvents:t(`/assistant/settings/system-events`),upgradeCancel:t(`/assistant/settings/billing/upgrade/cancel`),upgradeSuccess:t(`/assistant/settings/billing/upgrade/success`)},admin:{root:t(`/admin`)},docs:{hostingOptions:t(`/docs/hosting-options`),legal:{privacyPolicy:t(`/docs/privacy-policy`),termsOfUse:t(`/docs/vellum-terms-of-use`),dataSharing:t(`/docs/data-sharing`),prohibitedUse:t(`/docs/prohibited-use`),privacyAndData:t(`/docs/trust-security/privacy-and-data`)}}},o=[a.identity,a.personality,a.schedules.root,a.memory,a.plugins,a.skills.root,a.workspace,a.contacts.root,a.channels];function s(e){return o.some(t=>e===t||e.startsWith(`${t}/`))}function c(e){return e===a.assistant||e===`${a.assistant}/`||e.startsWith(`${a.conversations}/`)}function l(e){if(e===a.assistant||e===`${a.assistant}/`)return!0;let t=`${a.conversations}/`;if(!e.startsWith(t))return!1;let n=e.slice(t.length).replace(/\/+$/,``);return n.length>0&&!n.includes(`/`)}var u=`vellum.ai`;function d(e){return f(e)}function f(e){return`https://${u}${e}`}function p(){return e()?`${window.__VELLUM_CONFIG__?.webUrl??window.location.origin}${a.admin.root}`:a.admin.root}export{l as a,a as c,s as i,p as n,c as o,f as r,d as s,i as t};
@@ -0,0 +1 @@
1
+ import{Yn as e}from"./sdk.gen-C9GJEKYV.js";import{n as t,r as n,t as r}from"./api-errors-CrWDzVca.js";function i(e){let t=e,n=t.description??``;return{...e,description:n,cadenceDescription:t.cadenceDescription??n}}async function a(a){let{data:o,error:s,response:c}=await e({path:{assistant_id:a},throwOnError:!1});if(t(c,s,`Failed to load schedules.`),!c.ok)throw new r(c.status,n(s,c,`Failed to load schedules.`));return(o?.schedules??[]).map(i)}export{a as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{P as r,t as i}from"./button-BQVYX8n_.js";import{f 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"./typography-Cqi8q9o7.js";import{t as d}from"./createLucideIcon-Bjb-Kuq7.js";import{n as f,t as p}from"./settings-wSv59mkN.js";import{t as m}from"./chevron-down-DwIPfcCg.js";import{t as h}from"./chevron-right-DDgSinGu.js";import{t as g}from"./clock-YYSFOsux.js";import{t as _}from"./loader-circle-C9QrtO3C.js";import{t as v}from"./repeat-BRYsTqh_.js";import{t as y}from"./x-BYcSiJRX.js";import{t as b}from"./notice-B8UI-BOp.js";import{i as x,j as S}from"./src-yyUuGOWG.js";import{t as C}from"./tag-D0AE0-aA.js";import{n as w,t as T}from"./input-6HVXMszw.js";import{t as E}from"./toggle-CWrJ2t4S.js";import{t as D}from"./modal-bIQsMU63.js";import{t as O}from"./panel-item-CegzTp_l.js";import{n as k}from"./toast-CZmbu5xl.js";import{t as A}from"./dropdown-CuE5AuVj.js";import{Bt as j,F as M,Jt as N,M as ee,N as P,P as te,Yt as ne,_ as re,c as F,d as I,dt as ie,ft as ae,g as L,j as oe,mt as se,pt as ce,ut as le,v as ue,y as de}from"./react-query.gen-CWfp8GEM.js";import{a as R}from"./api-Bf9f0SF-.js";import{c as z}from"./routes-GPGveWZ8.js";import{t as fe}from"./effective-timezone-Cp9o8K5B.js";import{t as pe}from"./assistant-feature-flag-store-hJs0ZthQ.js";import{$i as me,Da as he,Fr as ge,Ir as _e,Ka as ve,Yn as ye,zi as be}from"./index-D_wKh03d.js";import{t as xe}from"./use-active-assistant-id-DwLFgABu.js";import{t as Se}from"./detail-card-BQDwZw9u.js";import{a as Ce,c as we,i as Te,l as Ee,n as De,o as Oe,r as ke,s as Ae,t as je,u as Me}from"./page-empty-state-M3M-Ny7y.js";import{r as Ne,t as Pe}from"./profile-metadata-VB4MBtgt.js";var Fe=d(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),B=e(n(),1),Ie={frequency:`daily`,minute:0,hour24:9,weekdays:[1],dayOfMonth:1},V=[{value:0,letter:`S`,short:`Sun`,full:`Sunday`},{value:1,letter:`M`,short:`Mon`,full:`Monday`},{value:2,letter:`T`,short:`Tue`,full:`Tuesday`},{value:3,letter:`W`,short:`Wed`,full:`Wednesday`},{value:4,letter:`T`,short:`Thu`,full:`Thursday`},{value:5,letter:`F`,short:`Fri`,full:`Friday`},{value:6,letter:`S`,short:`Sat`,full:`Saturday`}],Le=[1,2,3,4,5];function H(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function Re(e){let t=Array.from(new Set(e.map(e=>H(e,0,6)).filter(e=>Number.isInteger(e)))).sort((e,t)=>e-t);return t.length>0?t:[1]}function ze(e){let t=H(e.minute,0,59),n=H(e.hour24,0,23);switch(e.frequency){case`hourly`:return`${t} * * * *`;case`daily`:return`${t} ${n} * * *`;case`weekly`:return`${t} ${n} * * ${Re(e.weekdays).join(`,`)}`;case`monthly`:return e.dayOfMonth===`last`?`${t} ${n} L * *`:`${t} ${n} ${H(e.dayOfMonth,1,28)} * *`}}function Be(e,t){let n=H(e,0,23),r=H(t,0,59),i=n<12?`AM`:`PM`;return`${n%12==0?12:n%12}:${String(r).padStart(2,`0`)} ${i}`}function Ve(e){let t=[`th`,`st`,`nd`,`rd`],n=e%100;return`${e}${t[(n-20)%10]??t[n]??t[0]}`}function He(e){let t=Re(e),n=new Set(t);if(t.length===7)return`every day`;if(t.length===5&&Le.every(e=>n.has(e)))return`every weekday`;if(t.length===2&&n.has(0)&&n.has(6))return`every weekend`;if(t.length===1)return`every ${V[t[0]]?.full??`day`}`;let r=t.map(e=>V[e]?.short??``),i=r.pop();return`every ${r.join(`, `)} & ${i}`}function Ue(e){let t=Be(e.hour24,e.minute);switch(e.frequency){case`hourly`:{let t=H(e.minute,0,59);return`Runs every hour at :${String(t).padStart(2,`0`)}`}case`daily`:return`Runs every day at ${t}`;case`weekly`:return`Runs ${He(e.weekdays)} at ${t}`;case`monthly`:return e.dayOfMonth===`last`?`Runs on the last day of every month at ${t}`:`Runs on the ${Ve(H(e.dayOfMonth,1,28))} of every month at ${t}`}}var U=l(),We=[{value:`hourly`,label:`Hourly`},{value:`daily`,label:`Daily`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`}],Ge=Array.from({length:12},(e,t)=>{let n=t+1;return{value:String(n),label:String(n)}}),Ke=Array.from({length:12},(e,t)=>{let n=t*5,r=String(n).padStart(2,`0`);return{value:r,label:r}}),qe=[...Array.from({length:28},(e,t)=>{let n=t+1;return{value:String(n),label:Ve(n)}}),{value:`last`,label:`Last day`}],Je=[{value:`AM`,label:`AM`},{value:`PM`,label:`PM`}];function Ye(e,t){let n=e%12;return t===`PM`?n+12:n}function Xe(e){try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;return t&&t!==e?`${e} · ${t}`:e}catch{return e}}function Ze({isOpen:e,assistantId:t,onClose:n,onCreated:r}){return(0,U.jsx)(D.Root,{open:e,onOpenChange:e=>{e||n()},children:e?(0,U.jsx)(Qe,{assistantId:t,onClose:n,onCreated:r}):null})}function Qe({assistantId:e,onClose:t,onCreated:n}){let r=ye(),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(``),[d,f]=(0,B.useState)(`simple`),[p,m]=(0,B.useState)(Ie),[h,g]=(0,B.useState)(``),[_,v]=(0,B.useState)(!1),[y,b]=(0,B.useState)(null),x=a.trim(),S=s.trim(),C=l.trim(),E=h.trim(),O=(0,B.useMemo)(()=>d===`simple`?ze(p):E,[d,p,E]),k=(0,B.useMemo)(()=>d===`simple`?Ue(p):E||`Enter a cron expression to continue.`,[d,p,E]),A=(0,B.useMemo)(()=>Xe(r),[r]),j=x.length>0&&S.length>0&&C.length>0&&O.length>0&&!_;return(0,U.jsxs)(D.Content,{size:`md`,children:[(0,U.jsxs)(D.Header,{children:[(0,U.jsx)(D.Title,{children:`Create schedule`}),(0,U.jsx)(D.Description,{children:`Schedule a recurring instruction for your assistant. Runs in execute mode — the message is delivered to the assistant on each fire.`})]}),(0,U.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),j){v(!0),b(null);try{await De(e,{name:x,description:S,expression:O,message:C,timezone:r}),v(!1),n()}catch(e){b(e instanceof Error?e.message:`Failed to create schedule.`),v(!1)}}},children:[(0,U.jsx)(D.Body,{children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,U.jsx)(T,{label:`Name`,placeholder:`Morning briefing`,value:a,onChange:e=>o(e.target.value),required:!0,autoFocus:!0,fullWidth:!0}),(0,U.jsx)(w,{label:`Description`,placeholder:`What is this schedule for?`,value:s,onChange:e=>c(e.target.value),required:!0,fullWidth:!0,rows:2}),(0,U.jsx)(rt,{label:`Repeat`,children:d===`simple`?(0,U.jsx)($e,{cadence:p,onChange:m}):(0,U.jsx)(nt,{value:h,onChange:g,onUseSimple:()=>f(`simple`)})}),(0,U.jsx)(it,{summary:k,mono:d===`advanced`&&E.length>0,timezoneLabel:A}),d===`simple`?(0,U.jsx)(`button`,{type:`button`,onClick:()=>{g(e=>e||ze(p)),f(`advanced`)},className:`self-start text-body-small-default text-[var(--content-tertiary)] underline-offset-2 transition-colors hover:text-[var(--content-default)] hover:underline`,children:`Advanced — write a cron expression`}):null,(0,U.jsx)(w,{label:`Message`,placeholder:`What should the assistant do on each fire?`,value:l,onChange:e=>u(e.target.value),required:!0,fullWidth:!0,rows:4}),y?(0,U.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:y}):null]})}),(0,U.jsxs)(D.Footer,{children:[(0,U.jsx)(i,{variant:`outlined`,onClick:t,type:`button`,children:`Cancel`}),(0,U.jsx)(i,{variant:`primary`,type:`submit`,disabled:!j,children:_?`Creating…`:`Create schedule`})]})]})]})}function $e({cadence:e,onChange:t}){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(S,{items:We,value:e.frequency,onChange:n=>t({...e,frequency:n}),ariaLabel:`How often the schedule runs`}),e.frequency===`hourly`?(0,U.jsx)(W,{label:`At minute`,children:(0,U.jsx)(A,{options:Ke,value:String(e.minute).padStart(2,`0`),onChange:n=>t({...e,minute:Number(n)}),"aria-label":`Minute`,className:`w-24`})}):null,e.frequency===`weekly`?(0,U.jsx)(W,{label:`On these days`,children:(0,U.jsx)(tt,{value:e.weekdays,onChange:n=>t({...e,weekdays:n})})}):null,e.frequency===`monthly`?(0,U.jsx)(W,{label:`On day`,children:(0,U.jsx)(A,{options:qe,value:e.dayOfMonth===`last`?`last`:String(e.dayOfMonth),onChange:n=>t({...e,dayOfMonth:n===`last`?`last`:Number(n)}),"aria-label":`Day of month`,className:`w-32`})}):null,e.frequency===`hourly`?null:(0,U.jsx)(W,{label:`At time`,children:(0,U.jsx)(et,{hour24:e.hour24,minute:e.minute,onChange:(n,r)=>t({...e,hour24:n,minute:r})})})]})}function et({hour24:e,minute:t,onChange:n}){let r=e<12?`AM`:`PM`,i=e%12==0?12:e%12;return(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(A,{options:Ge,value:String(i),onChange:e=>n(Ye(Number(e),r),t),"aria-label":`Hour`,className:`w-[72px]`}),(0,U.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`:`}),(0,U.jsx)(A,{options:Ke,value:String(t).padStart(2,`0`),onChange:t=>n(e,Number(t)),"aria-label":`Minute`,className:`w-[72px]`}),(0,U.jsx)(`div`,{className:`w-[112px]`,children:(0,U.jsx)(S,{items:Je,value:r,onChange:e=>n(Ye(i,e),t),ariaLabel:`AM or PM`})})]})}function tt({value:e,onChange:t}){let n=new Set(e),i=e=>{let r=new Set(n);r.has(e)?r.size>1&&r.delete(e):r.add(e),t([...r].sort((e,t)=>e-t))};return(0,U.jsx)(`div`,{className:`flex gap-1.5`,children:V.map(e=>{let t=n.has(e.value);return(0,U.jsx)(`button`,{type:`button`,onClick:()=>i(e.value),"aria-pressed":t,"aria-label":e.full,title:e.full,className:r(`flex h-9 w-9 items-center justify-center rounded-md border text-body-medium-default transition-colors`,t?`border-[var(--border-active)] bg-[var(--surface-active)] text-[var(--content-emphasised)]`:`border-[var(--field-border)] text-[var(--content-tertiary)] hover:border-[var(--border-active)] hover:text-[var(--content-default)]`),children:e.letter},e.value)})})}function nt({value:e,onChange:t,onUseSimple:n}){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(T,{placeholder:`0 9 * * *`,value:e,onChange:e=>t(e.target.value),fullWidth:!0,className:`font-mono`,"aria-label":`Cron expression`,helperText:`Standard 5-field cron (minute hour day month weekday). RRULE expressions are also accepted.`}),(0,U.jsx)(`button`,{type:`button`,onClick:n,className:`self-start text-body-small-default text-[var(--content-tertiary)] underline-offset-2 transition-colors hover:text-[var(--content-default)] hover:underline`,children:`← Back to the simple builder`})]})}function rt({label:e,children:t}){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:e}),t]})}function W({label:e,children:t}){return(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,U.jsx)(`span`,{className:`min-w-[88px] text-body-small-default text-[var(--content-tertiary)]`,children:e}),t]})}function it({summary:e,mono:t,timezoneLabel:n}){return(0,U.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] px-3.5 py-3`,children:[(0,U.jsx)(g,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`p`,{className:r(`text-body-medium-default text-[var(--content-default)]`,t&&`break-all font-mono`),children:e}),(0,U.jsxs)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[`Times use your timezone — `,n,`.`]})]})]})}function at(e=fe(),t=Date.now()){return Ne(`7d`,e,t)}function G(e){return e?new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0}):`—`}function ot(e){return e==null?`—`:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}var st=new Intl.NumberFormat(void 0,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2});function K(e){return e==null||!Number.isFinite(e)?`—`:st.format(e)}function q(e){return`${e.toLocaleString()} ${e===1?`run`:`runs`}`}function ct(e){let t=Math.round(e/6e4);return t>=60&&t%60==0?`Every ${t/60} hr`:`Every ${t} min`}function lt(e){if(!e)return;let t=new Set,n=[];for(let r of e)for(let e of r.runs)t.has(e.id)||(t.add(e.id),n.push(e));return n}function ut(e){return!!e.conversationId&&e.conversationExists===!0&&e.conversationArchivedAt==null}function dt(e){return ut(e)?e.conversationId??null:null}function J(e){return typeof e==`string`&&e.length>0}var Y={heartbeat:`system-heartbeat`,consolidation:`system-consolidation`,retrospective:`system-memory-retrospective`};function ft(e){if(e.cronExpression)return e.timezone?`Cron: ${e.cronExpression} (${e.timezone})`:`Cron: ${e.cronExpression}`;let t=ct(e.intervalMs);return e.activeHoursStart!=null&&e.activeHoursEnd!=null&&(t+=` (${e.activeHoursStart}:00–${e.activeHoursEnd}:00)`),t}function pt(e){return ct(e.intervalMs)}var mt=`After conversation activity`;function ht(e,t){return e.status===`fired`||e.status===`cancelled`?!0:e.status===`firing`?!1:e.nextRunAt==null||!e.enabled&&e.nextRunAt<=t}function gt(e,t){let n=[],r=[],i=[];for(let a of e)a.isOneShot?ht(a,t)?i.push(a):r.push(a):n.push(a);return n.sort((e,t)=>e.enabled===t.enabled?(e.nextRunAt??1/0)-(t.nextRunAt??1/0):e.enabled?-1:1),r.sort((e,t)=>(e.nextRunAt??1/0)-(t.nextRunAt??1/0)),i.sort((e,t)=>{let n=e.lastRunAt??e.nextRunAt??0;return(t.lastRunAt??t.nextRunAt??0)-n}),{recurring:n,upcomingOneTime:r,pastOneTime:i}}function _t(e,t,n=!0){return{queryKey:[{_id:`schedulesUsagesummaryGet`,path:{assistant_id:e??``},_tz:t}],queryFn:()=>e?Ce(e,at(t)):Promise.resolve([]),enabled:n,staleTime:1e4}}function vt(e){return{scheduleId:e,runCount:0,totalEstimatedCostUsd:0,eventCount:0}}function yt(e,t,n){let r=(t??[]).filter(e=>{let t=e.startedAt??e.createdAt;return t>=n.from&&t<=n.to});return{scheduleId:e,runCount:r.length,totalEstimatedCostUsd:r.reduce((e,t)=>{let n=t.estimatedCostUsd;return typeof n==`number`&&Number.isFinite(n)?e+n:e},0),eventCount:0}}function X({status:e}){return(0,U.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full`,style:{backgroundColor:e===`ok`||e===`completed`?`var(--system-positive-strong)`:e===`error`||e===`failed`?`var(--system-negative-strong)`:`var(--content-tertiary)`},"aria-label":e??`unknown`})}function bt({scheduleName:e,usage:t,onOpenUsage:n}){if(t.status===`loading`)return(0,U.jsxs)(`div`,{"aria-label":`Loading schedule usage`,className:`flex w-[156px] shrink-0 items-center justify-end gap-3`,children:[(0,U.jsx)(`span`,{className:`h-5 w-16 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,U.jsx)(`span`,{className:`h-5 w-16 animate-pulse rounded bg-[var(--surface-muted)]`})]});let r=t.status===`error`,i=r?`--`:K(t.summary.totalEstimatedCostUsd),a=r?`--`:q(t.summary.runCount),o=t.status===`ready`&&!(t.summary.totalEstimatedCostUsd>0),s=t.status===`ready`&&t.summary.runCount===0,c=o?`text-[var(--content-tertiary)]`:`text-[var(--content-default)]`,l=s?`text-[var(--content-tertiary)]`:`text-[var(--content-default)]`;return(0,U.jsxs)(`div`,{className:`flex w-[156px] shrink-0 items-center justify-end gap-3 text-right text-body-small-default`,children:[n?(0,U.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`View usage for ${e}`,className:`min-w-[64px] cursor-pointer rounded px-1 py-0.5 text-right transition-colors hover:bg-[var(--surface-hover)] ${c}`,children:i}):(0,U.jsx)(`span`,{"aria-label":`Cost for ${e} in the last 7 days: ${i}`,className:`block min-w-[64px] px-1 py-0.5 ${c}`,children:i}),(0,U.jsx)(`span`,{"aria-label":`Runs for ${e} in the last 7 days: ${a}`,className:`block min-w-[64px] px-1 py-0.5 ${l}`,children:a})]})}function xt({name:e,subtitle:t,enabled:n,nextRunAt:r,lastRunAt:i,usage:a,helperText:o,statusLabel:s,statusTone:c=`neutral`,onClick:l}){return(0,U.jsx)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-md px-2 py-3 transition-colors hover:bg-[var(--surface-hover)] [&+&]:border-t [&+&]:border-[var(--border-base)]`,children:(0,U.jsxs)(`button`,{type:`button`,onClick:l,"aria-label":`Open ${e}`,className:`flex min-w-0 flex-1 cursor-pointer flex-wrap items-center gap-3 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,U.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e})}),(0,U.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t}),o?(0,U.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-secondary)]`,children:o}):null,(0,U.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-body-small-default text-[var(--content-tertiary)]`,children:[r?(0,U.jsxs)(`span`,{children:[`Next: `,G(r)]}):null,i?(0,U.jsxs)(`span`,{children:[`Last: `,G(i)]}):null]})]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-3`,children:[(0,U.jsx)(bt,{scheduleName:e,usage:a}),s?(0,U.jsx)(C,{tone:c,children:s}):(0,U.jsx)(`span`,{className:`h-2 w-2 rounded-full`,style:{backgroundColor:n?`var(--system-positive-strong)`:`var(--content-disabled)`},"aria-label":n?`enabled`:`disabled`}),(0,U.jsx)(h,{className:`h-4 w-4 text-[var(--content-tertiary)]`})]})]})})}function St({heartbeatConfig:e,consolidationConfig:t,retrospectiveConfig:n,heartbeatUsage:r,consolidationUsage:i,retrospectiveUsage:a,isLoading:o,hasError:s,onRetry:c,onSelectHeartbeat:l,onSelectConsolidation:u,onSelectRetrospective:d}){let f=e!=null,p=t?.available===!0,h=n?.available===!0,g=f||p||h;if(!o&&!s&&!g)return null;let v=[...f?[r]:[],...p?[i]:[],...h?[a]:[]].filter(e=>e.status===`ready`),y=v.reduce((e,t)=>e+(t.summary.totalEstimatedCostUsd??0),0),S=o?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,U.jsx)(_,{className:`h-5 w-5 animate-spin text-stone-400`})}):s&&!g?(0,U.jsxs)(b,{tone:`error`,children:[`Failed to load system jobs.`,` `,(0,U.jsx)(`button`,{type:`button`,onClick:c,className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):(0,U.jsxs)(`div`,{children:[f?(0,U.jsx)(xt,{name:`Heartbeat`,subtitle:ft(e),enabled:e.enabled,nextRunAt:e.nextRunAt,lastRunAt:e.lastRunAt,usage:r,onClick:l}):null,p?(0,U.jsx)(xt,{name:`Consolidation`,subtitle:pt(t),enabled:t.enabled,helperText:t.enabled?void 0:`Memory is off, so consolidation is paused.`,nextRunAt:t.nextRunAt,lastRunAt:t.lastRunAt,usage:i,statusLabel:t.enabled?void 0:`Paused`,statusTone:`warning`,onClick:u}):null,h?(0,U.jsx)(xt,{name:`Memory retrospective`,subtitle:mt,enabled:n.enabled,helperText:n.enabled?void 0:`Memory is off, so retrospectives are paused.`,nextRunAt:n.nextRunAt,lastRunAt:n.lastRunAt,usage:a,statusLabel:n.enabled?void 0:`Paused`,statusTone:`warning`,onClick:d}):null,s?(0,U.jsx)(`div`,{className:`pt-3 first:pt-0`,children:(0,U.jsxs)(b,{tone:`error`,children:[`Some system jobs failed to load.`,` `,(0,U.jsx)(`button`,{type:`button`,onClick:c,className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]})}):null]});return(0,U.jsx)(Se,{children:(0,U.jsx)(x.Root,{type:`multiple`,children:(0,U.jsxs)(x.Item,{value:`system-jobs`,children:[(0,U.jsxs)(x.Trigger,{className:`group justify-between gap-3`,children:[(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1 text-left`,children:[(0,U.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:`System`}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Built-in jobs managed by the assistant runtime`})]}),(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-3`,children:[v.length>0?(0,U.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[K(y),` (7d)`]}):null,(0,U.jsx)(m,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]})]}),(0,U.jsx)(x.Content,{children:(0,U.jsx)(`div`,{className:`mt-3`,children:S})})]})})})}function Z(e,t){return{id:e.id,jobId:t,status:e.status,startedAt:e.startedAt??e.scheduledFor,finishedAt:e.finishedAt,durationMs:e.durationMs,output:`skipReason`in e&&e.skipReason?`Skipped: ${e.skipReason}`:null,error:e.error,conversationId:e.conversationId,conversationExists:e.conversationExists,conversationArchivedAt:e.conversationArchivedAt,estimatedCostUsd:e.estimatedCostUsd,createdAt:e.createdAt,...`title`in e?{title:e.title}:{}}}function Ct(e){return e.runs.map(e=>Z(e,`heartbeat`))}function wt(e){return e.runs.map(e=>Z(e,`consolidation`))}function Tt(e){return e.runs.map(e=>Z(e,`retrospective`))}var Q=1e4;function Et(e,t,n,r,i){return e?{status:`loading`}:t?{status:`error`}:{status:`ready`,summary:yt(n,r,i)}}function Dt(e,n){let r=s(),i={path:{assistant_id:e??``}},{data:a,isLoading:o,isError:l,refetch:u}=c({...oe(i),enabled:!!e,staleTime:Q}),{data:d,isLoading:f,isError:p,refetch:m}=c({...L(i),enabled:!!e,staleTime:Q}),{data:h,isLoading:g,isError:_,refetch:v}=c({...le(i),enabled:!!e,staleTime:Q}),y={path:{assistant_id:e??``},query:{limit:100}},{data:b,isLoading:x,isError:S,refetch:C}=c({...M(y),select:Ct,enabled:!!e&&a!=null,staleTime:Q}),{data:w,isLoading:T,isError:E,refetch:D}=c({...de(y),select:wt,enabled:!!e&&d?.available===!0,staleTime:Q}),{data:O,isLoading:A,isError:P,refetch:re}=c({...ce(y),select:Tt,enabled:!!e&&h?.available===!0,staleTime:Q}),F=(0,B.useMemo)(()=>at(n),[n]),I=(0,B.useMemo)(()=>Et(x,S,Y.heartbeat,b,F),[b,S,x,F]),ie=(0,B.useMemo)(()=>Et(T,E,Y.consolidation,w,F),[w,E,T,F]),se=(0,B.useMemo)(()=>Et(A,P,Y.retrospective,O,F),[O,P,A,F]),R=t=>{if(!e)return;let n={heartbeat:{config:oe(i).queryKey,runs:M(y).queryKey,infinite:te(i)},consolidation:{config:L(i).queryKey,runs:de(y).queryKey,infinite:ue(i)},retrospective:{config:le(i).queryKey,runs:ce(y).queryKey,infinite:ae(i)}}[t];r.invalidateQueries({queryKey:n.config}),r.invalidateQueries({queryKey:n.runs}),r.invalidateQueries({queryKey:n.infinite})},z=ne({onSuccess:e=>{e.ran?k.success(`Heartbeat started.`):k.info(`Heartbeat skipped.`)},onError:e=>{t(e,{context:`heartbeat_run_now`}),k.error(`Failed to run heartbeat.`)},onSettled:()=>R(`heartbeat`)}),fe=j({onSuccess:e=>{e.ran?k.success(`Consolidation queued.`):k.info(`Consolidation already queued or running.`)},onError:e=>{t(e,{context:`consolidation_run_now`}),k.error(`Failed to run consolidation.`)},onSettled:()=>R(`consolidation`)}),pe=N({onSuccess:e=>{ee(r,i,e),k.success(e.enabled?`Heartbeat enabled.`:`Heartbeat disabled.`)},onError:e=>{t(e,{context:`heartbeat_toggle`}),k.error(`Failed to toggle heartbeat.`)}});return{heartbeatConfig:a,consolidationConfig:d,retrospectiveConfig:h,heartbeatUsage:I,consolidationUsage:ie,retrospectiveUsage:se,isLoading:o||f||g,hasError:l||p||_,isHeartbeatRunning:z.isPending,isConsolidationRunning:fe.isPending,isHeartbeatLoading:o,isHeartbeatError:l,isConsolidationLoading:f,isConsolidationError:p,isRetrospectiveLoading:g,isRetrospectiveError:_,refetchHeartbeat:u,refetchConsolidation:m,refetchRetrospective:v,runHeartbeatNow:()=>{e&&z.mutate({path:{assistant_id:e}})},runConsolidationNow:()=>{e&&fe.mutate({path:{assistant_id:e}})},toggleHeartbeat:t=>{e&&pe.mutate({body:{enabled:t},path:{assistant_id:e}})},refetchAll:()=>{u(),m(),v(),C(),D(),re()}}}function Ot({children:e}){return(0,U.jsx)(u,{variant:`label-small-default`,as:`div`,className:`mb-2 uppercase tracking-wider text-[var(--content-tertiary)]`,children:e})}function $({label:e,value:t}){return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-1`,children:[(0,U.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e}),(0,U.jsx)(`span`,{className:`min-w-0 text-right text-body-medium-lighter text-[var(--content-default)]`,children:t})]})}function kt({icon:e,value:t,label:n}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-[var(--border-base)] bg-[var(--surface-lift)] p-3`,children:[(0,U.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-[var(--surface-sunken)] text-[var(--content-secondary)]`,children:e}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`truncate text-body-large-default text-[var(--content-default)]`,children:t}),(0,U.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n})]})]})}function At({usage:e}){return e.status===`loading`?(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-3 pt-2`,children:Array.from({length:2},(e,t)=>(0,U.jsx)(`div`,{className:`h-[60px] animate-pulse rounded-lg bg-[var(--surface-muted)]`},t))}):e.status===`error`?null:(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 pt-2`,children:[(0,U.jsx)(kt,{icon:(0,U.jsx)(he,{className:`h-4 w-4`}),value:K(e.summary.totalEstimatedCostUsd),label:`7 Day Cost`}),(0,U.jsx)(kt,{icon:(0,U.jsx)(v,{className:`h-4 w-4`}),value:q(e.summary.runCount),label:`7 Day Runs`})]})}function jt(e){return e.exists&&e.archivedAt==null}function Mt({run:e,index:t,isExpanded:n,disableDirectOpen:i,onOpenConversation:a,onToggleDetails:o}){let s=dt(e),c=e.conversations??(s?[{id:s,title:null,exists:!0,archivedAt:null}]:[]),l=J(e.output),u=J(e.error),d=!i&&c.length===1&&jt(c[0])?c[0].id:null,f=!d&&(c.length>0||l||u),p=`schedule-run-details-${t}`,m=!!d||f,g=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(X,{status:e.status}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:G(e.startedAt)}),(0,U.jsxs)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[ot(e.durationMs),` ·`,` `,K(e.estimatedCostUsd)]}),e.status===`error`&&e.error?(0,U.jsxs)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[e.error.slice(0,120),e.error.length>120?`…`:``]}):null]}),m?(0,U.jsx)(h,{className:r(`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform`,f&&n?`rotate-90`:``)}):null]}),_=f&&n?(0,U.jsx)(`div`,{id:p,className:`px-2 pb-3`,children:(0,U.jsxs)(`div`,{className:`space-y-3 rounded-md border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3`,children:[c.length>0?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:`Conversations`}),(0,U.jsx)(`div`,{className:`space-y-1`,children:c.map(e=>jt(e)?(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(e.id),className:`block w-full truncate text-left text-body-small-default text-[var(--content-default)] hover:underline`,children:J(e.title)?e.title:`Conversation`},e.id):(0,U.jsxs)(`span`,{className:`block truncate text-body-small-default text-[var(--content-tertiary)] italic`,children:[J(e.title)?e.title:`Conversation`,` `,e.exists?`(archived)`:`(unavailable)`]},e.id))})]}):null,l?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:`Output`}),(0,U.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--content-default)]`,children:e.output})]}):null,u?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:`Error`}),(0,U.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--system-negative-strong)]`,children:e.error})]}):null]})}):null;return d?(0,U.jsx)(`div`,{children:(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(d),"aria-label":`Open conversation for run at ${G(e.startedAt)}`,className:`flex w-full cursor-pointer items-center gap-3 px-2 py-3 text-left shadow-none transition-colors hover:bg-[var(--surface-hover)] focus:outline-none`,children:g})}):f?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>o(e.id),"aria-label":`Toggle details for run at ${G(e.startedAt)}`,"aria-expanded":n,"aria-controls":p,className:`flex w-full cursor-pointer items-center gap-3 px-2 py-3 text-left shadow-none transition-colors hover:bg-[var(--surface-hover)] focus:outline-none`,children:g}),_]}):(0,U.jsx)(`div`,{className:`flex items-center gap-3 px-2 py-3`,children:g})}function Nt({runs:e,isLoading:t,disableDirectOpen:n,onOpenConversation:r}){let[i,a]=(0,B.useState)(null);return t?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-6`,children:(0,U.jsx)(_,{className:`h-5 w-5 animate-spin text-stone-400`})}):!e||e.length===0?(0,U.jsx)(`p`,{className:`py-2 text-body-medium-lighter text-[var(--content-tertiary)] italic`,children:`No runs yet.`}):(0,U.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:e.map((e,t)=>(0,U.jsx)(Mt,{run:e,index:t,isExpanded:i===e.id,disableDirectOpen:n,onOpenConversation:r,onToggleDetails:e=>a(t=>t===e?null:e)},e.id))})}function Pt({schedule:e,assistantId:n,usage:a,isMobile:s,onClose:l,onDeleted:d}){let f=o(),{data:p,isLoading:m}=c({queryKey:se({path:{assistant_id:n,id:e.id}}),queryFn:()=>Te(n,e.id),staleTime:1e4}),[h,g]=(0,B.useState)(!1),[v,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(!1),C=async()=>{g(!0);try{await Oe(n,e.id)}catch(e){t(e,{context:`schedule_run_now`}),k.error(`Failed to run schedule.`)}finally{g(!1)}},w=async()=>{S(!0);try{await ke(n,e.id),d()}catch(e){t(e,{context:`schedule_delete`}),k.error(`Failed to delete schedule.`),S(!1),b(!1)}};return(0,U.jsxs)(`div`,{className:r(`flex h-full flex-col bg-[var(--surface-overlay)]`,!s&&`rounded-[var(--radius-xl)] border border-[var(--border-base)]`),children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-base)] p-[var(--app-spacing-lg)]`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,U.jsx)(u,{variant:`title-small`,className:`truncate text-[var(--content-default)]`,children:e.name})}),(0,U.jsx)(i,{variant:`ghost`,iconOnly:(0,U.jsx)(y,{}),onClick:l,"aria-label":`Close schedule details`,tooltip:`Close`,className:`shrink-0`})]}),(0,U.jsxs)(`div`,{className:`flex-1 space-y-6 overflow-y-auto px-[var(--app-spacing-lg)] py-[var(--app-spacing-lg)]`,children:[e.description?(0,U.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e.description}):null,(0,U.jsxs)(`section`,{children:[(0,U.jsx)(Ot,{children:`Details`}),(0,U.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-lift)] px-4 py-2`,children:[e.cadenceDescription?(0,U.jsx)($,{label:`Cadence`,value:e.cadenceDescription}):null,(0,U.jsx)($,{label:`Mode`,value:e.mode}),(0,U.jsx)($,{label:`Status`,value:e.enabled?`Enabled`:`Disabled`}),(0,U.jsx)($,{label:`Next run`,value:G(e.nextRunAt)}),e.lastRunAt?(0,U.jsx)($,{label:`Last run`,value:(0,U.jsxs)(`span`,{className:`flex items-center justify-end gap-2`,children:[(0,U.jsx)(X,{status:e.lastStatus}),G(e.lastRunAt)]})}):null]})]}),(0,U.jsx)(At,{usage:a}),(0,U.jsxs)(`section`,{children:[(0,U.jsx)(Ot,{children:`Recent runs`}),(0,U.jsx)(Nt,{runs:p?.runs,isLoading:m,disableDirectOpen:e.mode===`script`,onOpenConversation:e=>f(z.conversation(e))})]})]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-t border-[var(--border-base)] p-[var(--app-spacing-lg)]`,children:[v?(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(i,{variant:`ghost`,onClick:()=>b(!1),disabled:x,children:`Cancel`}),(0,U.jsx)(i,{variant:`danger`,onClick:()=>void w(),disabled:x,children:x?`Deleting…`:`Yes, delete`})]}):(0,U.jsx)(i,{variant:`dangerOutline`,leftIcon:(0,U.jsx)(be,{className:`h-3.5 w-3.5`}),onClick:()=>b(!0),children:`Delete`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(i,{variant:`outlined`,leftIcon:(0,U.jsx)(Fe,{className:`h-3.5 w-3.5`}),onClick:()=>f(z.settings.usageForSchedule(e.id)),children:`View usage`}),e.mode===`script`?(0,U.jsx)(i,{variant:`primary`,leftIcon:h?(0,U.jsx)(_,{className:`h-3.5 w-3.5 animate-spin`}):void 0,onClick:()=>void C(),disabled:h,children:h?`Running…`:`Run now`}):null]})]})]})}function Ft(e){if(e.status===`loading`)return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`h-4 w-12 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,U.jsx)(`span`,{className:`h-4 w-10 animate-pulse rounded bg-[var(--surface-muted)]`})]});if(e.status===`error`)return(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`—`});let{summary:t}=e;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:K(t.totalEstimatedCostUsd)}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:q(t.runCount)})]})}function It({name:e,metaParts:t,usage:n,enabled:r,selected:i,onClick:a,onToggle:o,toggleAriaLabel:s}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md px-2 py-3 transition-colors [&+&]:border-t [&+&]:border-[var(--border-base)] ${i?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`}`,children:[o?(0,U.jsx)(E,{checked:r,onChange:o,"aria-label":s}):null,(0,U.jsxs)(`button`,{type:`button`,onClick:a,className:`flex min-w-0 flex-1 cursor-pointer items-center gap-4 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e}),t.length>0?(0,U.jsx)(`span`,{className:`flex min-w-0 items-center gap-2 text-label-small-default text-[var(--content-tertiary)]`,children:t.map((e,t)=>(0,U.jsxs)(B.Fragment,{children:[t>0?(0,U.jsx)(`span`,{className:`h-[3px] w-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}):null,(0,U.jsx)(`span`,{className:`truncate`,children:e})]},t))}):null]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-4`,children:[Ft(n),(0,U.jsx)(h,{className:`h-4 w-4 text-[var(--content-tertiary)]`})]})]})]})}function Lt({schedule:e,usage:t,selected:n,onClick:r,onToggle:i}){let a=e.isOneShot?``:e.cadenceDescription.trim(),o=e.lastRunAt??e.nextRunAt,s=[a,o?G(o):``].filter(Boolean);return(0,U.jsx)(It,{name:e.name,metaParts:s,usage:t,enabled:e.enabled,selected:n,onClick:r,onToggle:i,toggleAriaLabel:i?`Toggle ${e.name}`:void 0})}function Rt({recurring:e,oneTime:t,pastOneTime:n,usageForSchedule:r,isLoading:a,isError:o,refetch:s,onToggle:c,onSelectSchedule:l,selectedScheduleId:u,onStartNewChat:d,onCreateSchedule:p,pastOpen:m,onPastOpenChange:g,systemTasksSlot:_}){let v=e=>(0,U.jsx)(Lt,{schedule:e,usage:r(e.id),selected:e.id===u,onClick:()=>l(e.id),onToggle:t=>c(e.id,t)},e.id),y=e=>(0,U.jsx)(Lt,{schedule:e,usage:r(e.id),selected:e.id===u,onClick:()=>l(e.id)},e.id),S=n.length>0?(0,U.jsx)(x.Root,{type:`single`,collapsible:!0,className:`mt-3`,value:m?`past`:``,onValueChange:e=>g(e===`past`),children:(0,U.jsxs)(x.Item,{value:`past`,children:[(0,U.jsxs)(x.Trigger,{className:`group gap-[var(--app-spacing-xs)] px-2 text-label-small-default text-[var(--content-tertiary)]`,children:[(0,U.jsx)(h,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,U.jsxs)(`span`,{children:[`Past (`,n.length,`)`]})]}),(0,U.jsx)(x.Content,{children:(0,U.jsx)(`div`,{className:`pt-1`,children:n.map(y)})})]})}):null;return(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[a?(0,U.jsx)(`div`,{className:`space-y-3`,children:Array.from({length:2},(e,t)=>(0,U.jsx)(`div`,{className:`h-12 animate-pulse rounded-md bg-[var(--surface-muted)]`},t))}):o&&e.length===0?(0,U.jsx)(b,{tone:`error`,actions:(0,U.jsx)(`button`,{type:`button`,onClick:s,className:`cursor-pointer underline hover:no-underline`,children:`Retry`}),children:`Failed to load schedules.`}):e.length===0&&t.length===0&&n.length===0?(0,U.jsx)(je,{icon:f,title:`No schedules yet`,description:`Ask your assistant to set one up, or create one yourself.`,actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i,{variant:`primary`,size:`regular`,onClick:d,children:`New Conversation`}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`or`}),(0,U.jsx)(i,{variant:`outlined`,size:`regular`,onClick:p,children:`Create schedule`})]})}):(0,U.jsxs)(`div`,{children:[e.map(v),t.length>0?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`mt-3 px-2 text-label-small-default text-[var(--content-tertiary)]`,children:`One-time`}),t.map(y)]}):null,S]}),_?(0,U.jsx)(`div`,{className:`mt-[var(--app-spacing-lg)]`,children:_}):null]})}var zt=`Default (assistant's main model)`,Bt=`Custom call-site model`;function Vt(e,t){return t?.[e]?.displayName??e}function Ht(e,t){if(e==null)return;if(e.provider!=null||e.model!=null)return Bt;let n=e.profile?.trim();return n?`Override (${Vt(n,t)})`:void 0}function Ut({assistantId:e,pinnedProfile:t,defaultCallSite:n=`mainAgent`,fallbackLabel:r=zt,respectCallSiteOverride:i=!1}){let a=t==null,{data:o}=c({...F({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4}),s=(0,B.useMemo)(()=>o?Pe(o):{},[o]),{data:l}=c({...I({path:{assistant_id:e}}),enabled:!!e&&a,staleTime:6e4}),u=a&&i?Ht(o?.llm?.callSites?.[n],s):void 0,d=a?l?.callSites.find(e=>e.id===n)?.defaultProfile:void 0,f=t==null?u??(d==null?r:`Default (${Vt(d,s)})`):Vt(t,s);return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`text-[var(--content-secondary)]`,children:`Model profile`}),(0,U.jsx)(`span`,{className:`min-w-0 text-right`,children:f})]})}function Wt({runs:e,isLoading:t,emptyMessage:n=`No runs yet.`,hasMore:r=!1,isLoadingMore:a=!1,onLoadMore:s}){let c=o(),[l,u]=(0,B.useState)(null);return(0,U.jsx)(Se,{title:`Recent runs`,children:t?(0,U.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,U.jsx)(_,{className:`h-5 w-5 animate-spin text-stone-400`})}):!e||e.length===0?(0,U.jsx)(`p`,{className:`py-4 text-center text-body-medium-lighter text-[var(--content-tertiary)] italic`,children:n}):(0,U.jsxs)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:[e.map((e,t)=>{let n=dt(e),r=J(e.output),i=J(e.error),a=!n&&(r||i),o=l===e.id,s=`schedule-run-details-${t}`;return(0,U.jsxs)(`div`,{children:[(0,U.jsx)(O,{label:(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,U.jsx)(X,{status:e.status}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block truncate text-body-medium-lighter text-[var(--content-default)]`,children:J(e.title)?e.title:G(e.startedAt)}),(0,U.jsxs)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[J(e.title)?`${G(e.startedAt)} · `:``,ot(e.durationMs),` ·`,` `,K(e.estimatedCostUsd),e.status===`error`&&e.error&&(0,U.jsxs)(`span`,{className:`ml-2 text-[var(--system-negative-strong)]`,children:[e.error.slice(0,80),e.error.length>80?`…`:``]})]})]}),n||a?(0,U.jsx)(h,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform ${o?`rotate-90`:``}`}):null]}),onSelect:n?()=>c(z.conversation(n)):a?()=>u(o?null:e.id):void 0,"aria-label":`Run at ${G(e.startedAt)}`,"aria-expanded":a?o:void 0,"aria-controls":a?s:void 0,className:`h-auto py-2.5 gap-3 -mx-2 px-2`}),a&&o?(0,U.jsx)(`div`,{id:s,className:`px-2 pb-3`,children:(0,U.jsxs)(`div`,{className:`space-y-3 rounded-md border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3`,children:[r?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:`Output`}),(0,U.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--content-default)]`,children:e.output})]}):null,i?(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:`Error`}),(0,U.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--system-negative-strong)]`,children:e.error})]}):null]})}):null]},e.id)}),r&&s?(0,U.jsx)(`div`,{className:`flex justify-center pt-3`,children:(0,U.jsx)(i,{variant:`outlined`,size:`compact`,onClick:s,disabled:a,leftIcon:a?(0,U.jsx)(_,{className:`h-3.5 w-3.5 animate-spin`}):void 0,children:a?`Loading…`:`Load more`})}):null]})})}var Gt={heartbeat:`heartbeatAgent`,consolidation:`memoryV2Consolidation`,retrospective:`memoryRetrospective`};function Kt({children:e}){return(0,U.jsx)(u,{variant:`label-small-default`,as:`div`,className:`mb-2 uppercase tracking-wider text-[var(--content-tertiary)]`,children:e})}function qt({kind:e,assistantId:t,systemTasks:n,canOpenMemorySettings:a,isMobile:s,onClose:c}){let l=o(),{heartbeatConfig:d,consolidationConfig:f,retrospectiveConfig:m}=n,h,g,v,x,S,C,w;e===`heartbeat`?(h=`Heartbeat`,g=d?ft(d):``,v=d?.enabled??!1,x=d?.nextRunAt??null,S=d?.lastRunAt??null,C=n.isHeartbeatRunning,w=n.runHeartbeatNow):e===`consolidation`?(h=`Consolidation`,g=f?pt(f):``,v=f?.enabled??!1,x=f?.nextRunAt??null,S=f?.lastRunAt??null,C=n.isConsolidationRunning,w=n.runConsolidationNow):(h=`Memory retrospective`,g=mt,v=m?.enabled??!1,x=m?.nextRunAt??null,S=m?.lastRunAt??null,C=!1,w=void 0);let T=e!==`heartbeat`,D=e===`retrospective`,O=T&&!v,k=C||O,A=T?v?`On · Managed by Memory`:`Paused`:v?`Enabled`:`Disabled`,j=D?`Memory is off, so retrospectives are paused. Turn Memory back on to resume them.`:`Memory is off, so consolidation is paused. Turn Memory back on to resume consolidation.`,M=T&&v&&a,N={path:{assistant_id:t},query:{limit:25}},ee=e===`heartbeat`?P(N):e===`consolidation`?re(N):ie(N),{data:te,isLoading:ne,fetchNextPage:F,hasNextPage:I,isFetchingNextPage:ae}=ve({queryKey:ee.queryKey,queryFn:ee.queryFn,initialPageParam:{path:N.path,query:{}},getNextPageParam:e=>e.nextCursor??void 0,staleTime:1e4}),L=lt(te?.pages.map(t=>({runs:t.runs.map(t=>Z(t,e))})));return(0,U.jsxs)(`div`,{className:r(`flex h-full flex-col bg-[var(--surface-overlay)]`,!s&&`rounded-[var(--radius-xl)] border border-[var(--border-base)]`),children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-base)] p-[var(--app-spacing-lg)]`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(u,{variant:`title-small`,className:`truncate text-[var(--content-default)]`,children:h}),g?(0,U.jsx)(u,{variant:`body-small-default`,as:`p`,className:`truncate text-[var(--content-tertiary)]`,children:g}):null]}),(0,U.jsx)(i,{variant:`ghost`,iconOnly:(0,U.jsx)(y,{}),onClick:c,"aria-label":`Close schedule details`,tooltip:`Close`,className:`shrink-0`})]}),(0,U.jsxs)(`div`,{className:`flex-1 space-y-6 overflow-y-auto px-[var(--app-spacing-lg)] py-[var(--app-spacing-lg)]`,children:[(0,U.jsxs)(`section`,{children:[(0,U.jsx)(Kt,{children:`Details`}),(0,U.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-lift)] px-4 py-3 text-body-medium-lighter`,children:[(0,U.jsx)(Ut,{assistantId:t,defaultCallSite:Gt[e],fallbackLabel:`Default (system task model)`,respectCallSiteOverride:!0}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`text-[var(--content-secondary)]`,children:`Status`}),(0,U.jsxs)(`span`,{className:`flex items-center gap-2 text-[var(--content-default)]`,children:[(0,U.jsx)(`span`,{children:A}),T?null:(0,U.jsx)(E,{checked:v,onChange:n.toggleHeartbeat,"aria-label":`Toggle ${h}`})]})]}),D?null:(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`text-[var(--content-secondary)]`,children:`Next run`}),(0,U.jsx)(`span`,{className:`text-[var(--content-default)]`,children:G(x)})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`text-[var(--content-secondary)]`,children:`Last run`}),(0,U.jsx)(`span`,{className:`text-[var(--content-default)]`,children:G(S)})]})]}),O?(0,U.jsx)(b,{tone:`warning`,className:`mt-4`,actions:a?(0,U.jsx)(i,{variant:`outlined`,size:`compact`,onClick:()=>l(`${z.settings.developer}?tab=memory`),children:`Turn on Memory`}):void 0,children:j}):null]}),(0,U.jsx)(Wt,{runs:L,isLoading:ne,hasMore:I,isLoadingMore:ae,onLoadMore:()=>void F()})]}),M||w?(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-[var(--border-base)] p-[var(--app-spacing-lg)]`,children:[M?(0,U.jsx)(i,{variant:`outlined`,leftIcon:(0,U.jsx)(p,{className:`h-3.5 w-3.5`}),onClick:()=>l(`${z.settings.developer}?tab=memory`),children:`Memory settings`}):null,w?(0,U.jsx)(i,{variant:`primary`,leftIcon:C?(0,U.jsx)(_,{className:`h-3.5 w-3.5 animate-spin`}):(0,U.jsx)(me,{className:`h-3.5 w-3.5`}),onClick:w,disabled:k,children:C?`Running…`:`Run now`}):null]}):null]})}function Jt(e){let n=ye(),[r]=(0,B.useState)(()=>Date.now()),{data:i,isLoading:a,isError:o,refetch:s}=c(Ae(e)),{data:l,isLoading:u,isError:d}=c(_t(e,n,!0)),{recurring:f,oneTime:p,pastOneTime:m}=(0,B.useMemo)(()=>{let e=gt(i??[],r);return{recurring:e.recurring,oneTime:e.upcomingOneTime,pastOneTime:e.pastOneTime}},[r,i]),h=(0,B.useMemo)(()=>new Map((l??[]).map(e=>[e.scheduleId,e])),[l]);return{recurring:f,oneTime:p,pastOneTime:m,usageForSchedule:(0,B.useCallback)(e=>u?{status:`loading`}:d?{status:`error`}:{status:`ready`,summary:h.get(e)??vt(e)},[d,u,h]),handleToggle:(0,B.useCallback)(async(n,r)=>{if(e)try{await we(e,n,r),s()}catch(e){t(e,{context:`schedule_toggle`}),k.error(`Failed to toggle schedule.`)}},[e,s]),isLoading:a,isError:o,refetch:(0,B.useCallback)(()=>{s()},[s])}}function Yt(){let e=o(),{scheduleId:t}=a(),n=xe(),r=ge(),i=ye(),s=Jt(n),l=Dt(n,i),{data:u=!1}=c({queryKey:[`assistant-memory-opt-out-capability`,n],queryFn:async()=>{let e=await R(n);return e.ok&&e.data.capabilities?.memoryOptOut===!0},retry:!1,staleTime:1e4}),d=pe.use.settingsDeveloperNav(),f=u&&d===!0,[p,m]=(0,B.useState)(!1),h=t??null,[g,_]=(0,B.useState)(null),[v,y]=(0,B.useState)(!1),b=(0,B.useCallback)(t=>{e(t?z.schedules.detail(t):z.schedules.root)},[e]),x=h?s.recurring.find(e=>e.id===h)??s.oneTime.find(e=>e.id===h)??s.pastOneTime.find(e=>e.id===h)??null:null;(0,B.useEffect)(()=>{h&&!s.isLoading&&!s.isError&&!x&&b(null)},[h,x,s.isLoading,s.isError,b]);let S=g===`heartbeat`?l.heartbeatConfig!=null:g===`consolidation`?l.consolidationConfig?.available===!0:g===`retrospective`?l.retrospectiveConfig?.available===!0:!1;(0,B.useEffect)(()=>{g&&!l.isLoading&&!S&&_(null)},[g,S,l.isLoading]);let C=(0,B.useCallback)(e=>{_(null),b(e)},[b]),w=(0,B.useCallback)(e=>{h&&b(null),_(e)},[b,h]),T=(0,B.useCallback)(()=>{_e(e)},[e]),E=(x?(0,U.jsx)(Pt,{schedule:x,assistantId:n,usage:s.usageForSchedule(x.id),isMobile:r,onClose:()=>b(null),onDeleted:()=>{b(null),s.refetch()}}):null)??(g&&S?(0,U.jsx)(qt,{kind:g,assistantId:n,systemTasks:l,canOpenMemorySettings:f,isMobile:r,onClose:()=>_(null)}):null),D=(0,U.jsx)(Rt,{recurring:s.recurring,oneTime:s.oneTime,pastOneTime:s.pastOneTime,usageForSchedule:s.usageForSchedule,isLoading:s.isLoading,isError:s.isError,refetch:s.refetch,onToggle:s.handleToggle,onSelectSchedule:C,selectedScheduleId:h,onStartNewChat:T,onCreateSchedule:()=>m(!0),pastOpen:v,onPastOpenChange:y,systemTasksSlot:(0,U.jsx)(St,{heartbeatConfig:l.heartbeatConfig,consolidationConfig:l.consolidationConfig,retrospectiveConfig:l.retrospectiveConfig,heartbeatUsage:l.heartbeatUsage,consolidationUsage:l.consolidationUsage,retrospectiveUsage:l.retrospectiveUsage,isLoading:l.isLoading,hasError:l.hasError,onRetry:l.refetchAll,onSelectHeartbeat:()=>w(`heartbeat`),onSelectConsolidation:()=>w(`consolidation`),onSelectRetrospective:()=>w(`retrospective`)})});return E&&r?(0,U.jsx)(Me,{children:E}):(0,U.jsxs)(U.Fragment,{children:[E&&!r?(0,U.jsx)(Ee,{storageKey:`schedulesDetailDrawerWidth`,detailKey:h??g??void 0,section:D,detail:E}):D,(0,U.jsx)(Ze,{isOpen:p,assistantId:n,onClose:()=>m(!1),onCreated:()=>{m(!1),s.refetch()}})]})}export{Yt as SchedulesPage};