@vellumai/web 0.10.8-staging.1 → 0.10.8-staging.2

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 (189) hide show
  1. package/dist/assets/{AnimatePresence-C8APSgIu.js → AnimatePresence-s1Z1HHWx.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-M2tkzwiz.js → BundleConfirmPage-C6bP7QB3.js} +1 -1
  3. package/dist/assets/{about-page-C-kIVb7a.js → about-page-XGv9RAQu.js} +1 -1
  4. package/dist/assets/{account-page-DOSnPXjP.js → account-page-Dno1SeJN.js} +1 -1
  5. package/dist/assets/{account-shell-74OchOxg.js → account-shell-CdhP9l8T.js} +1 -1
  6. package/dist/assets/{acp-run-detail-panel-DFoD_DVJ.js → acp-run-detail-panel-B1-zyOUe.js} +4 -4
  7. package/dist/assets/{activity-steps-panel-jztC4BRv.js → activity-steps-panel-BGyfMCXK.js} +1 -1
  8. package/dist/assets/{add-credits-modal-daNASKHJ.js → add-credits-modal-PP1PX8Qv.js} +1 -1
  9. package/dist/assets/{advanced-page-B8h5sAe5.js → advanced-page-vCbMVJsK.js} +1 -1
  10. package/dist/assets/{ai-page-BInYrZV7.js → ai-page-BIYybKux.js} +1 -1
  11. package/dist/assets/{animated-avatar-CrlodWQr.js → animated-avatar-Cqpzb8O4.js} +1 -1
  12. package/dist/assets/{api-key-screen-Cynx0r0g.js → api-key-screen-DTSP_-Da.js} +1 -1
  13. package/dist/assets/{archive-page-DqXRVFoF.js → archive-page-RZ2VP63A.js} +1 -1
  14. package/dist/assets/{assistant-feature-flag-store-CKUjJHuh.js → assistant-feature-flag-store-DA8Oj9Mf.js} +1 -1
  15. package/dist/assets/{assistant-status-panel-eNWJodpn.js → assistant-status-panel-BC0RTDls.js} +1 -1
  16. package/dist/assets/{auth-store-CD7PGb3q.js → auth-store-C09YAZEu.js} +2 -2
  17. package/dist/assets/{background-task-detail-panel-Bsi8IoaY.js → background-task-detail-panel-BfnsD-3B.js} +1 -1
  18. package/dist/assets/{billing-page-dpKYjJH3.js → billing-page-1z_L2m6q.js} +3 -3
  19. package/dist/assets/{bookmarks-page-BI92Y3eM.js → bookmarks-page-CjcavZv8.js} +1 -1
  20. package/dist/assets/{browser-BPZAXjRE.js → browser-C6a_nhhZ.js} +2 -2
  21. package/dist/assets/{build-state-DGsKGdpj.js → build-state-PUXrUU4W.js} +1 -1
  22. package/dist/assets/channels-page-route-WjNmd0sS.js +9 -0
  23. package/dist/assets/chat-markdown-message-BnX6bhgs.js +2 -0
  24. package/dist/assets/{client-feature-flag-store-C0g8zi1W.js → client-feature-flag-store-DkJl-g9A.js} +1 -1
  25. package/dist/assets/{command-palette-Dk6UsSlv.js → command-palette-6o4m7BM9.js} +1 -1
  26. package/dist/assets/{command-palette-window-page-zDow8o4K.js → command-palette-window-page-BsJlr5bh.js} +1 -1
  27. package/dist/assets/community-page-CJA4JfuC.js +1 -0
  28. package/dist/assets/{connect-page-BXTqYbdY.js → connect-page-DZgU3jCf.js} +1 -1
  29. package/dist/assets/{consent-controls-BZMxm0n3.js → consent-controls-Cnr1DzCr.js} +1 -1
  30. package/dist/assets/contacts-page-route-P0neH-PV.js +1 -0
  31. package/dist/assets/{credentials-page-0S5ifTFC.js → credentials-page-MkKE_19-.js} +1 -1
  32. package/dist/assets/debug-page-B88f4aDU.js +4 -0
  33. package/dist/assets/{deploy-dialogs-BBHNKgDi.js → deploy-dialogs-paL_zcvG.js} +1 -1
  34. package/dist/assets/{detail-card-RGTjHkZ8.js → detail-card-xKZlkbz5.js} +1 -1
  35. package/dist/assets/{detail-panel-stop-button-oIDUq-kJ.js → detail-panel-stop-button-y7O3HqJj.js} +1 -1
  36. package/dist/assets/{developer-page-Djolz4Fg.js → developer-page-BFMS6pwU.js} +1 -1
  37. package/dist/assets/{devices-page-XJJSA97y.js → devices-page-B3D5iLhD.js} +1 -1
  38. package/dist/assets/{dictation-overlay-page-cqsEjyx_.js → dictation-overlay-page-BkEBWrWm.js} +1 -1
  39. package/dist/assets/{document-viewer-page-jInmb33M.js → document-viewer-page-B631L6-3.js} +1 -1
  40. package/dist/assets/{earn-credits-modal-C_jhLLw5.js → earn-credits-modal-CFla-iKl.js} +1 -1
  41. package/dist/assets/edge-swipe-arbiter-store-BeOhrE7M.js +1 -0
  42. package/dist/assets/{emails-page-fov7ihfj.js → emails-page-7c9kVi_k.js} +1 -1
  43. package/dist/assets/{esm-Ddmch1KU.js → esm-Bzs_witt.js} +2 -2
  44. package/dist/assets/{esm-CYMQv-VS.js → esm-C5J59K0j.js} +2 -2
  45. package/dist/assets/{esm-CTXnt94k.js → esm-CT8NUp3h.js} +2 -2
  46. package/dist/assets/esm-DEu9JbAE.js +2 -0
  47. package/dist/assets/{esm-BciT3LGF.js → esm-DZkj1VLJ.js} +2 -2
  48. package/dist/assets/{esm-CvWQdH3L.js → esm-DtJz1M8R.js} +2 -2
  49. package/dist/assets/{feature-flag-catalog-CHuc71P8.js → feature-flag-catalog-GgSNKkqP.js} +1 -1
  50. package/dist/assets/{file-markdown-BXUvAQ24.js → file-markdown-Bq97tNxs.js} +1 -1
  51. package/dist/assets/{general-page-gojItIOd.js → general-page-D-Gr2lkW.js} +1 -1
  52. package/dist/assets/{haptics-DKVhthJo.js → haptics-lMERs7us.js} +2 -2
  53. package/dist/assets/hatching-screen-BlwicgIz.js +1 -0
  54. package/dist/assets/home-page-route-D24x4A0S.js +1 -0
  55. package/dist/assets/{hosting-screen-BTLHWS2M.js → hosting-screen-BZLZular.js} +1 -1
  56. package/dist/assets/identity-page-route-BwOJeenx.js +1 -0
  57. package/dist/assets/{index-BjtwYdrT.css → index-C9GrLGul.css} +1 -1
  58. package/dist/assets/{index-CSefSVJO.js → index-yu6nDHvG.js} +21 -21
  59. package/dist/assets/{inspect-page-CT8NspqC.js → inspect-page-1RejwSP_.js} +4 -4
  60. package/dist/assets/{integrations-page-DtClqS91.js → integrations-page-BV5BiHPD.js} +1 -1
  61. package/dist/assets/{intelligence-layout-D9ReVcK0.js → intelligence-layout-iQFO8in_.js} +1 -1
  62. package/dist/assets/{keyboard-shortcuts-page-CovdLPhh.js → keyboard-shortcuts-page-jt13JtxS.js} +1 -1
  63. package/dist/assets/{library-detail-page-MAsxHH08.js → library-detail-page-BAGWt1Lw.js} +1 -1
  64. package/dist/assets/{library-page-CYuSc92M.js → library-page-CqeoBhDY.js} +1 -1
  65. package/dist/assets/{login-flow-CHNlba5i.js → login-flow-B6q00uIW.js} +1 -1
  66. package/dist/assets/{login-page-CK1TxruP.js → login-page-BQVTWuQc.js} +1 -1
  67. package/dist/assets/{logout-page-W3gl_1Ax.js → logout-page-BV0URcAd.js} +1 -1
  68. package/dist/assets/{logs-layout-CR7u05YO.js → logs-layout-DO3yfZqD.js} +1 -1
  69. package/dist/assets/{memory-router-playground-page-eDjKwsbG.js → memory-router-playground-page-CQxX6mCn.js} +1 -1
  70. package/dist/assets/{metric-card-BN23geOu.js → metric-card-DvXjHVCV.js} +1 -1
  71. package/dist/assets/{mobile-sidebar-drawer-3LqMCZgK.js → mobile-sidebar-drawer-Epbt6p-k.js} +1 -1
  72. package/dist/assets/{native-file-Cn3RbQbT.js → native-file-DI99Emal.js} +2 -2
  73. package/dist/assets/{notifications-page-CtyUuC15.js → notifications-page-CXaZpD3s.js} +1 -1
  74. package/dist/assets/{oauth-complete-page-3DcY6Or3.js → oauth-complete-page-BlJm9tRJ.js} +1 -1
  75. package/dist/assets/{oauth-popup-complete-page-Cn-1bOwa.js → oauth-popup-complete-page-BqUopTat.js} +1 -1
  76. package/dist/assets/{page-shell-C2TBO8M8.js → page-shell-BUGBKCmv.js} +1 -1
  77. package/dist/assets/{pairing-page-Bb-_q_zP.js → pairing-page-B5GrCx4C.js} +1 -1
  78. package/dist/assets/{platform-loopback-page-Dfl_gjZm.js → platform-loopback-page-MZdCPXRI.js} +1 -1
  79. package/dist/assets/{plugin-detail-page-C_vv0F7O.js → plugin-detail-page-Byuqbr1N.js} +1 -1
  80. package/dist/assets/plugins-page-Ci0CoSAN.js +1 -0
  81. package/dist/assets/{prechat-route-CgCradwf.js → prechat-route-9JFn-w_1.js} +1 -1
  82. package/dist/assets/{prefs-DYaOj-dg.js → prefs-B1Y3q3c8.js} +1 -1
  83. package/dist/assets/{privacy-page-BqYdFos7.js → privacy-page-BTpvj9ZP.js} +1 -1
  84. package/dist/assets/{privacy-screen-DBMkRqiF.js → privacy-screen-CUbVcDf_.js} +1 -1
  85. package/dist/assets/{provider-callback-page-B-aDgII8.js → provider-callback-page-fB2tIyqL.js} +1 -1
  86. package/dist/assets/{provider-signup-page-CYK4VNf0.js → provider-signup-page-C4Dn-wtJ.js} +1 -1
  87. package/dist/assets/{quick-input-page-oif3WEFT.js → quick-input-page-Cv_CzapK.js} +1 -1
  88. package/dist/assets/{research-mock-page-CooZPqtv.js → research-mock-page-1T92rXz3.js} +1 -1
  89. package/dist/assets/{research-onboarding-route-BJqAsTdE.js → research-onboarding-route-CmWgwOFk.js} +3 -3
  90. package/dist/assets/{review-terms-screen-CVRYEl6e.js → review-terms-screen-DrD4vywk.js} +1 -1
  91. package/dist/assets/{risk-Dsj4oM8c.js → risk-Dopd25rc.js} +1 -1
  92. package/dist/assets/{security-page-DN5BI6Ag.js → security-page-BYI7twYM.js} +1 -1
  93. package/dist/assets/select-assistant-screen-Br-PNDO1.js +1 -0
  94. package/dist/assets/{settings-layout-BNwCqvBi.js → settings-layout-lddMUg7A.js} +1 -1
  95. package/dist/assets/share-feedback-modal-DSwfhMsV.js +1 -0
  96. package/dist/assets/{sidebar-tree-Bh-tcSsp.js → sidebar-tree-C1_LiBB9.js} +1 -1
  97. package/dist/assets/{signup-page-D6cMhBxv.js → signup-page-D6hAK-Us.js} +1 -1
  98. package/dist/assets/{signup-shell-D4Afeijm.js → signup-shell-DufHA5do.js} +1 -1
  99. package/dist/assets/{site-favicon-DSzk4cg0.js → site-favicon-fQHLTT6F.js} +1 -1
  100. package/dist/assets/{skill-detail-page-Jisds_Gs.js → skill-detail-page-BlfgTyFC.js} +1 -1
  101. package/dist/assets/{skill-detail-panel-BEJqfJig.js → skill-detail-panel-BGoRUWNU.js} +1 -1
  102. package/dist/assets/{skills-CSlvOB79.js → skills-AtSQBwXr.js} +1 -1
  103. package/dist/assets/{skills-page-Cs1EG4X5.js → skills-page-DeIiyhVc.js} +1 -1
  104. package/dist/assets/{sounds-page-ChFJ0OPm.js → sounds-page-BgLLJ-o9.js} +1 -1
  105. package/dist/assets/{src-B2IjVySQ.js → src-zsLiFPw3.js} +1 -1
  106. package/dist/assets/{subagent-detail-panel-ACj_B6Id.js → subagent-detail-panel-BGuVa8-m.js} +1 -1
  107. package/dist/assets/{system-events-page-JhzC5xhW.js → system-events-page-C1hXOYmg.js} +1 -1
  108. package/dist/assets/{tiptap-document-editor-DSny-IjF.js → tiptap-document-editor-C-eOEBR_.js} +1 -1
  109. package/dist/assets/tool-detail-panel-wAuQ7gi8.js +2 -0
  110. package/dist/assets/{upgrade-cancel-page-D_YziHQs.js → upgrade-cancel-page-BGgPmDmT.js} +1 -1
  111. package/dist/assets/{upgrade-success-page-Cg7IIDei.js → upgrade-success-page-TJBopZ0Z.js} +1 -1
  112. package/dist/assets/{usage-page-DB3LFuYw.js → usage-page-DLWFk2P0.js} +1 -1
  113. package/dist/assets/use-edge-swipe-back-B4XlZ1Iu.js +1 -0
  114. package/dist/assets/use-invite-link-dialog-BdnW1BHj.js +1 -0
  115. package/dist/assets/use-is-org-ready-jhEM-4rY.js +1 -0
  116. package/dist/assets/{use-onboarding-login-Bo_t51AV.js → use-onboarding-login-B-1jrjFL.js} +1 -1
  117. package/dist/assets/{use-reduced-motion-CcGT6CHV.js → use-reduced-motion-Cj0Z8KSf.js} +1 -1
  118. package/dist/assets/{use-skill-actions-e6TfdF23.js → use-skill-actions-BpVxiQZY.js} +1 -1
  119. package/dist/assets/{use-skill-categories-i_9x26zg.js → use-skill-categories-CCxtjMC_.js} +1 -1
  120. package/dist/assets/{use-skill-detail-files-Cu4nrHPA.js → use-skill-detail-files-Dpp521cY.js} +1 -1
  121. package/dist/assets/{voice-page-wTcwV9j9.js → voice-page-BoCTB8Jx.js} +1 -1
  122. package/dist/assets/{weather-forecast-display-C_3DSHxa.js → weather-forecast-display-Bix8rpji.js} +1 -1
  123. package/dist/assets/{web-DlbBHOna.js → web-C1L-cpPj.js} +1 -1
  124. package/dist/assets/{web-BpBQ3Cf2.js → web-RhBklijR.js} +1 -1
  125. package/dist/assets/{welcome-screen-BF3r_rfT.js → welcome-screen-CVI4Hjnt.js} +1 -1
  126. package/dist/assets/{workflow-detail-panel-DzvDXyoD.js → workflow-detail-panel-CwZH3tDl.js} +1 -1
  127. package/dist/assets/workspace-page-CwIsXk1j.js +1 -0
  128. package/dist/index.html +28 -27
  129. package/package.json +1 -1
  130. package/dist/assets/channels-page-route-6cT6U3pZ.js +0 -9
  131. package/dist/assets/chat-markdown-message-CItp7csw.js +0 -2
  132. package/dist/assets/community-page-BVJxxP10.js +0 -1
  133. package/dist/assets/contacts-page-route-WXG6_xo2.js +0 -1
  134. package/dist/assets/debug-page-C-HWHD-3.js +0 -4
  135. package/dist/assets/esm-DsIXwGm7.js +0 -2
  136. package/dist/assets/hatching-screen-C0MNyetb.js +0 -1
  137. package/dist/assets/home-page-route-X4KYSdMI.js +0 -1
  138. package/dist/assets/identity-page-route-D5xzlpim.js +0 -1
  139. package/dist/assets/plugins-page-Cv0FXn1j.js +0 -1
  140. package/dist/assets/select-assistant-screen-B63mlflD.js +0 -1
  141. package/dist/assets/share-feedback-modal-BloP-1QE.js +0 -1
  142. package/dist/assets/tool-detail-panel-z5iYNIYq.js +0 -2
  143. package/dist/assets/use-edge-swipe-back-AcKDuMrX.js +0 -1
  144. package/dist/assets/use-invite-link-dialog-CExxDwnZ.js +0 -1
  145. package/dist/assets/use-is-org-ready-BtwH2--_.js +0 -1
  146. package/dist/assets/workspace-page-DCcsRyQz.js +0 -1
  147. /package/dist/assets/{a2a-invite-BriFFHnO.js → a2a-invite-B9cylfIO.js} +0 -0
  148. /package/dist/assets/{app-info-LSjlWG3w.js → app-info-Clwt3pCt.js} +0 -0
  149. /package/dist/assets/{build.umd-wlq6sZjw.js → build.umd-CxdKgGWo.js} +0 -0
  150. /package/dist/assets/{contacts-gateway-CNqVHBQ3.js → contacts-gateway-CW5CipBv.js} +0 -0
  151. /package/dist/assets/{credential-entry-page-jJzKVnQk.js → credential-entry-page-9H2HOu88.js} +0 -0
  152. /package/dist/assets/{danger-zone-redirect-page-DL5S8CAN.js → danger-zone-redirect-page-BWg7rn8D.js} +0 -0
  153. /package/dist/assets/{definitions-alqf_FBK.js → definitions-CaYcW4Yq.js} +0 -0
  154. /package/dist/assets/{definitions-B1DK4OsQ.js → definitions-DScTW2c-.js} +0 -0
  155. /package/dist/assets/{emoji-catalog-data-D_xqkMQV.js → emoji-catalog-data-D8lRMt3A.js} +0 -0
  156. /package/dist/assets/{environment-store-fb1I8_0E.js → environment-store-C0f32873.js} +0 -0
  157. /package/dist/assets/{esm-DwTCNETa.js → esm-B54gzHCZ.js} +0 -0
  158. /package/dist/assets/{file-editor-BbrbkQCm.js → file-editor-sT7eHxsw.js} +0 -0
  159. /package/dist/assets/{format-date-BczUbfC1.js → format-date-CghpPTDc.js} +0 -0
  160. /package/dist/assets/{format-file-size-D7iZejgy.js → format-file-size-DzVEncaw.js} +0 -0
  161. /package/dist/assets/{llm-dimension-Bu_nHMF_.js → llm-dimension-DyYwG3mU.js} +0 -0
  162. /package/dist/assets/{mutation-error-CrhKyTkx.js → mutation-error-DYv0eJ_i.js} +0 -0
  163. /package/dist/assets/{onboarding-step-layout-zvLUIT7j.js → onboarding-step-layout-2XcmxqFN.js} +0 -0
  164. /package/dist/assets/{optimistic-lifecycle-DTggtDfs.js → optimistic-lifecycle-BvfDBY8o.js} +0 -0
  165. /package/dist/assets/{password-reset-page-DVIt7mWy.js → password-reset-page-BCk9Si73.js} +0 -0
  166. /package/dist/assets/{pdf-CuY9CA7Q.js → pdf-C3Qukw-J.js} +0 -0
  167. /package/dist/assets/{plugins-surface-C7NU-_rg.js → plugins-surface-z3RTZS4H.js} +0 -0
  168. /package/dist/assets/{prechat-names-b5RkG_F-.js → prechat-names-clVy5Mee.js} +0 -0
  169. /package/dist/assets/{provider-key-DBiHV_K5.js → provider-key-3AHnKoz9.js} +0 -0
  170. /package/dist/assets/{proxy-BzlH_XAe.js → proxy-o6cPThl2.js} +0 -0
  171. /package/dist/assets/{public-asset-Di3QykUd.js → public-asset-GKv5zCfZ.js} +0 -0
  172. /package/dist/assets/{schedules-Dj3YQqG5.js → schedules-BfKi12EZ.js} +0 -0
  173. /package/dist/assets/{setting-row-QKgqbQ4U.js → setting-row-CUka7_L9.js} +0 -0
  174. /package/dist/assets/{skill-icon-CEEEqpSq.js → skill-icon-cNkD2w1X.js} +0 -0
  175. /package/dist/assets/{status-badge-pill-BopXdkRS.js → status-badge-pill-0N6rTEBg.js} +0 -0
  176. /package/dist/assets/{step-indicator-dots-Cou0-IgA.js → step-indicator-dots-D03TmFKG.js} +0 -0
  177. /package/dist/assets/{system-events-redirect-page-D5EfWOEK.js → system-events-redirect-page-DbaFKRXH.js} +0 -0
  178. /package/dist/assets/{three-dot-indicator-BVtP8eei.js → three-dot-indicator-DNuHHwtA.js} +0 -0
  179. /package/dist/assets/{usage-window-Btqj3Jpn.js → usage-window-C6gWu5Qu.js} +0 -0
  180. /package/dist/assets/{use-active-assistant-id-BNRMo_Mi.js → use-active-assistant-id-BWXi63qg.js} +0 -0
  181. /package/dist/assets/{use-copy-to-clipboard-tXJpCn2M.js → use-copy-to-clipboard-BCTXSMa-.js} +0 -0
  182. /package/dist/assets/{web-CsaTwTXy.js → web-BD2N6zhd.js} +0 -0
  183. /package/dist/assets/{web-Xex3K4gk.js → web-BaubW4Pp.js} +0 -0
  184. /package/dist/assets/{web-U-rR-rZR.js → web-CJiP8Lg6.js} +0 -0
  185. /package/dist/assets/{web-D5_lKOWn.js → web-D8PpvYf_.js} +0 -0
  186. /package/dist/assets/{web-B9ZvD-Tt.js → web-Duw5A2aP.js} +0 -0
  187. /package/dist/assets/{web-Bi2V5gD3.js → web-O1LOb-o9.js} +0 -0
  188. /package/dist/assets/{xterm-D9pOJCAq.js → xterm-CBmd_y-b.js} +0 -0
  189. /package/dist/assets/{xterm-addon-fit-BTV6oL76.js → xterm-addon-fit-THPW0uy0.js} +0 -0
@@ -1,4 +1,4 @@
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{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./cn-C36Yvcac.js";import{t as l}from"./arrow-left-DI9551VI.js";import{t as u}from"./chevron-left-BMF1xNfR.js";import{t as d}from"./chevron-right-DqqmezXC.js";import{n as f,r as p,t as m}from"./animated-avatar-CrlodWQr.js";import{t as h}from"./loader-circle-Cz7opInR.js";import{t as g}from"./pencil-CUIr0IFo.js";import{t as _}from"./plus-DItfr5ux.js";import{t as v}from"./x-CkSVp1Ok.js";import{t as y}from"./tag-CV4v7fRF.js";import{t as b}from"./input-CoUmPnRU.js";import{i as x,r as S,t as C}from"./dist-CxHeCOEv.js";import{n as w,t as T}from"./create-selectors-8NePGNlX.js";import{b as E,ct as D,o as ee,p as te}from"./local-mode-grqHUoNh.js";import{Bn as O,V as k,et as A,gn as j,hn as ne,zn as re}from"./sdk.gen-BwnFjFcp.js";import{r as ie}from"./api-errors-CrWDzVca.js";import{A as ae,B as oe,L as M,R as se,n as ce,z as le}from"./auth-store-CD7PGb3q.js";import{a as ue,o as de,r as fe}from"./api-_7pKLlYA.js";import{c as pe}from"./routes-BbeIx_F9.js";import{n as me}from"./platform-detection-BrxvFUiR.js";import{c as he,l as ge}from"./prechat-P1y7ZM6C.js";import{t as N}from"./browser-timezone-2SnmKDjM.js";import{c as _e}from"./conversation-list-fetchers-DS9vmqfD.js";import{i as ve,n as ye,r as be,t as xe}from"./research-onboarding-persistence-DnuHyFyB.js";import{A as P,B as Se,C as Ce,D as we,E as Te,F as Ee,I as F,L as De,M as Oe,N as ke,O as Ae,P as I,R as je,S as L,T as R,V as z,_ as Me,a as Ne,b as Pe,d as B,f as Fe,g as Ie,i as Le,j as Re,k as ze,m as Be,o as Ve,p as He,r as Ue,s as We,t as V,v as Ge,w as Ke,x as qe,y as Je}from"./proxy-BzlH_XAe.js";import{t as Ye}from"./AnimatePresence-C8APSgIu.js";import{t as H}from"./use-reduced-motion-CcGT6CHV.js";import{_n as Xe,gt as Ze,in as Qe,ja as U,ji as $e,mt as et,nt as W,on as tt,or as nt,qt as rt,rn as it,sn as at,tt as ot}from"./index-CSefSVJO.js";import{n as st,t as ct}from"./onboarding-step-layout-zvLUIT7j.js";import{t as lt}from"./prechat-names-b5RkG_F-.js";var ut=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function dt(e,t){return Oe(e)?e[ut(0,e.length,t)]:e}var ft=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 pt(this.animations,`duration`)}get iterationDuration(){return pt(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 pt(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 mt=class extends ft{then(e,t){return this.finished.finally(e).then(()=>{})}};function ht(...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=Te(i,a,o);return t?s(r):s}function gt(e,t){return e in t}var _t=class extends We{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(gt(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 Fe()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},G=e(n(),1);function vt(e){let t=z(()=>L(e)),{isStatic:n}=(0,G.useContext)(Ue);if(n){let[,n]=(0,G.useState)(e);(0,G.useEffect)(()=>t.on(`change`,n),[])}return t}function yt(e,t){let n=vt(t()),r=()=>n.set(t());return r(),Se(()=>{let t=()=>Re.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),P(r)}}),n}function bt(e){qe.current=[],e();let t=yt(qe.current,e);return qe.current=void 0,t}function xt(e,t,n,r){if(typeof e==`function`)return bt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return Ct(e,t,n,r);let i=typeof t==`function`?t:ht(t,n,r),a=Array.isArray(e)?St(e,i):St([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 St(e,t){let n=z(()=>[]);return yt(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function Ct(e,t,n,r){let i=z(()=>Object.keys(n)),a=z(()=>({}));for(let o of i)a[o]=xt(e,t,n[o],r);return a}function wt(e){e.values.forEach(e=>e.stop())}function Tt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&Pe(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{Tt(e,t)})})}function Et(e,t){if(Array.isArray(t))return Tt(e,t);if(typeof t==`string`)return Tt(e,[t]);Pe(e,t)}function Dt(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){F(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(Me(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return F(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{Et(e,n)})},stop(){t.forEach(e=>{wt(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function Ot(e){return typeof e==`object`&&!Array.isArray(e)}function kt(e,t,n,r){return e==null?[]:typeof e==`string`&&Ot(t)?Ie(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function At(e,t,n){return e*(t+1)+n*t}function jt(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 Mt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(je(e,i),r--)}}function Nt(e,t,n,r,i,a){Mt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:ze(i,a,r[o]),easing:dt(n,o)})}function Pt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Ft(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var It=`easeInOut`,Lt=20;function Rt(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,jt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=jt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Vt(e),{delay:l=0,times:u=Ke(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=Ce(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Wt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=I(b));let r=Ae(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&R(u,T),c.length===1&&c.unshift(null),m&&De(m<Lt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Lt} or apply repeat at the sequence level instead.`),m&&m<Lt){let e=b>0?_/b:0;b=At(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`?ke(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`:dt(f,e-1))}Pt(u,m,e)}let E=w+b;Nt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Je(p)){let e=zt(p,s);_(m,h,Bt(`default`,e))}else{let e=kt(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=zt(r,s);for(let e in m)_(m[e],Ht(h,e),Bt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Ft);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(Ee(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(It)),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 zt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Bt(e,t){return t[e]||(t[e]=[]),t[e]}function Vt(e){return Array.isArray(e)?e:[e]}function Ht(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Ut=e=>typeof e==`number`,Wt=e=>e.every(Ut);function Gt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Be(e)&&!He(e)?new Ne(t):new Ve(t);n.mount(e),B.set(e,n)}function Kt(e){let t=new _t({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),B.set(e,t)}function qt(e,t){return Je(e)||typeof e==`number`||typeof e==`string`&&!Ot(t)}function Jt(e,t,n,r){let i=[];if(qt(e,t))i.push(Le(e,Ot(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=kt(e,t,r),o=a.length;F(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Gt:Kt;B.has(r)||s(r);let c=B.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ge(c,{...t,transition:l},{}))}}return i}function Yt(e,t,n){let r=[];return Rt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=L(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:we}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Jt(n,e,t))}),r}function Xt(e){return Array.isArray(e)&&e.some(Array.isArray)}function Zt(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),Xt(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Yt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Jt(e,i,{...c,...r},t)}let l=new mt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{je(t.animations,l)})),l}return i}var Qt=Zt();function $t(){let e=z(Dt);return Se(e.mount,[]),e}var en=12;function tn(e,t){let n=e.slice(0,en).map(e=>`- ${e.name} — ${e.description}`).join(`
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{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./cn-C36Yvcac.js";import{t as l}from"./arrow-left-DI9551VI.js";import{t as u}from"./chevron-left-BMF1xNfR.js";import{t as d}from"./chevron-right-DqqmezXC.js";import{n as f,r as p,t as m}from"./animated-avatar-Cqpzb8O4.js";import{t as h}from"./loader-circle-Cz7opInR.js";import{t as g}from"./pencil-CUIr0IFo.js";import{t as _}from"./plus-DItfr5ux.js";import{t as v}from"./x-CkSVp1Ok.js";import{t as y}from"./tag-CV4v7fRF.js";import{t as b}from"./input-CoUmPnRU.js";import{i as x,r as S,t as C}from"./dist-CxHeCOEv.js";import{n as w,t as T}from"./create-selectors-8NePGNlX.js";import{b as E,ct as D,o as ee,p as te}from"./local-mode-grqHUoNh.js";import{Bn as O,V as k,et as A,gn as j,hn as ne,zn as re}from"./sdk.gen-BwnFjFcp.js";import{r as ie}from"./api-errors-CrWDzVca.js";import{A as ae,B as oe,L as M,R as se,n as ce,z as le}from"./auth-store-C09YAZEu.js";import{a as ue,o as de,r as fe}from"./api-_7pKLlYA.js";import{c as pe}from"./routes-BbeIx_F9.js";import{n as me}from"./platform-detection-BrxvFUiR.js";import{c as he,l as ge}from"./prechat-P1y7ZM6C.js";import{t as N}from"./browser-timezone-2SnmKDjM.js";import{c as _e}from"./conversation-list-fetchers-DS9vmqfD.js";import{i as ve,n as ye,r as be,t as xe}from"./research-onboarding-persistence-DnuHyFyB.js";import{A as P,B as Se,C as Ce,D as we,E as Te,F as Ee,I as F,L as De,M as Oe,N as ke,O as Ae,P as I,R as je,S as L,T as R,V as z,_ as Me,a as Ne,b as Pe,d as B,f as Fe,g as Ie,i as Le,j as Re,k as ze,m as Be,o as Ve,p as He,r as Ue,s as We,t as V,v as Ge,w as Ke,x as qe,y as Je}from"./proxy-o6cPThl2.js";import{t as Ye}from"./AnimatePresence-s1Z1HHWx.js";import{t as H}from"./use-reduced-motion-Cj0Z8KSf.js";import{Aa as U,Ai as Xe,_n as Ze,ar as Qe,gt as $e,in as et,mt as tt,nt as W,on as nt,qt as rt,rn as it,sn as at,tt as ot}from"./index-yu6nDHvG.js";import{n as st,t as ct}from"./onboarding-step-layout-2XcmxqFN.js";import{t as lt}from"./prechat-names-clVy5Mee.js";var ut=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function dt(e,t){return Oe(e)?e[ut(0,e.length,t)]:e}var ft=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 pt(this.animations,`duration`)}get iterationDuration(){return pt(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 pt(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 mt=class extends ft{then(e,t){return this.finished.finally(e).then(()=>{})}};function ht(...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=Te(i,a,o);return t?s(r):s}function gt(e,t){return e in t}var _t=class extends We{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(gt(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 Fe()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},G=e(n(),1);function vt(e){let t=z(()=>L(e)),{isStatic:n}=(0,G.useContext)(Ue);if(n){let[,n]=(0,G.useState)(e);(0,G.useEffect)(()=>t.on(`change`,n),[])}return t}function yt(e,t){let n=vt(t()),r=()=>n.set(t());return r(),Se(()=>{let t=()=>Re.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),P(r)}}),n}function bt(e){qe.current=[],e();let t=yt(qe.current,e);return qe.current=void 0,t}function xt(e,t,n,r){if(typeof e==`function`)return bt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return Ct(e,t,n,r);let i=typeof t==`function`?t:ht(t,n,r),a=Array.isArray(e)?St(e,i):St([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 St(e,t){let n=z(()=>[]);return yt(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function Ct(e,t,n,r){let i=z(()=>Object.keys(n)),a=z(()=>({}));for(let o of i)a[o]=xt(e,t,n[o],r);return a}function wt(e){e.values.forEach(e=>e.stop())}function Tt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&Pe(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{Tt(e,t)})})}function Et(e,t){if(Array.isArray(t))return Tt(e,t);if(typeof t==`string`)return Tt(e,[t]);Pe(e,t)}function Dt(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){F(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(Me(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return F(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{Et(e,n)})},stop(){t.forEach(e=>{wt(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function Ot(e){return typeof e==`object`&&!Array.isArray(e)}function kt(e,t,n,r){return e==null?[]:typeof e==`string`&&Ot(t)?Ie(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function At(e,t,n){return e*(t+1)+n*t}function jt(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 Mt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(je(e,i),r--)}}function Nt(e,t,n,r,i,a){Mt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:ze(i,a,r[o]),easing:dt(n,o)})}function Pt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Ft(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var It=`easeInOut`,Lt=20;function Rt(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,jt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=jt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Vt(e),{delay:l=0,times:u=Ke(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=Ce(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Wt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=I(b));let r=Ae(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&R(u,T),c.length===1&&c.unshift(null),m&&De(m<Lt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Lt} or apply repeat at the sequence level instead.`),m&&m<Lt){let e=b>0?_/b:0;b=At(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`?ke(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`:dt(f,e-1))}Pt(u,m,e)}let E=w+b;Nt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Je(p)){let e=zt(p,s);_(m,h,Bt(`default`,e))}else{let e=kt(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=zt(r,s);for(let e in m)_(m[e],Ht(h,e),Bt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Ft);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(Ee(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(It)),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 zt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Bt(e,t){return t[e]||(t[e]=[]),t[e]}function Vt(e){return Array.isArray(e)?e:[e]}function Ht(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Ut=e=>typeof e==`number`,Wt=e=>e.every(Ut);function Gt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Be(e)&&!He(e)?new Ne(t):new Ve(t);n.mount(e),B.set(e,n)}function Kt(e){let t=new _t({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),B.set(e,t)}function qt(e,t){return Je(e)||typeof e==`number`||typeof e==`string`&&!Ot(t)}function Jt(e,t,n,r){let i=[];if(qt(e,t))i.push(Le(e,Ot(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=kt(e,t,r),o=a.length;F(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Gt:Kt;B.has(r)||s(r);let c=B.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ge(c,{...t,transition:l},{}))}}return i}function Yt(e,t,n){let r=[];return Rt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=L(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:we}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Jt(n,e,t))}),r}function Xt(e){return Array.isArray(e)&&e.some(Array.isArray)}function Zt(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),Xt(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Yt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Jt(e,i,{...c,...r},t)}let l=new mt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{je(t.animations,l)})),l}return i}var Qt=Zt();function $t(){let e=z(Dt);return Se(e.mount,[]),e}var en=12;function tn(e,t){let n=e.slice(0,en).map(e=>`- ${e.name} — ${e.description}`).join(`
2
2
  `);return n?`
3
3
  Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
4
4
  ${n}
@@ -37,7 +37,7 @@ Keep each SHORT and skimmable: under 10 words, ONE clause, ONE artifact, no list
37
37
  `:``}${d}
38
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
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 rn({hostingParam:e,localMode:t,gatewayAuthSession:n}){return t?e===null?n:e!==`vellum-cloud`:!1}var an=3e3,on=3e5,sn=`Failed to start your assistant. Please try again.`,cn=`Your assistant is taking longer than expected. Please try again.`,ln=e=>new Promise(t=>setTimeout(t,e));function un({adoptExisting:e=!1,adoptAssistantId:n}={}){let[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),l=(0,G.useRef)(!1),u=(0,G.useRef)([]),d=(0,G.useRef)(null),f=(0,G.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,G.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,G.useCallback)(()=>{if(l.current)return;l.current=!0;let r=Date.now(),i=()=>Date.now()-r>=on;(async()=>{if(e&&n){let e=ee(n);if(e){o(e.assistantId),f(e.assistantId);return}}let r=e?n:void 0;if(!e)try{let e=await de();if(e.ok)r=e.data.id,o(e.data.id);else{if(se(e.status,e.error)){p(M);return}if(!oe(e.status)){p(ie(e.error,void 0,sn));return}}}catch(e){t(e,{context:`research_background_hatch`})}let a;for(;!a;){if(i()){p(cn);return}try{let e=await fe(r);r&&!e.ok&&e.status===404&&(r=void 0,e=await fe());let t=le(e);if(t.kind===`active`&&e.ok){a=e.data.id,o(a);break}if(t.kind===`error`){p(t.message);return}}catch(e){t(e,{context:`research_background_hatch_poll`})}await ln(an)}if(e)for(;!await E();){if(i()){p(cn);return}await ln(an)}else for(;;){try{if((await ue(a)).ok)break}catch{}if(i()){p(cn);return}await ln(an)}f(a)})()},[p,f,e,n]),ready:r,assistantId:a,error:s,awaitReady:(0,G.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 dn(e,n){try{await k({path:{assistant_id:e,id:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_archive`})}}function fn(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!(!n||n.role!==`assistant`))return(n.contentBlocks??[]).filter(e=>e.type===`text`).map(e=>e.text).join(`
40
- `).trim()}return``}var pn=[`admin-copilot`],mn=[{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 hn(e){return` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()} `}function gn(e,t){return e.includes(` ${t} `)}function _n(e){let t=hn(e),n=[];for(let{plugin:e,keywords:r}of mn)r.some(e=>gn(t,e))&&n.push(e);return n}function vn(e,t){let n=[...pn,..._n(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 yn=1500,bn=12e4,xn=2;function Sn({complete:e,stableReads:t}){return e&&t>=xn}function Cn({sawCompletePayload:e}){return e?`done`:`error`}function wn({sawCompletePayload:e}){return e}var Tn=`vellum-ai`,En=new Set([`simple-memory`,`level-up`]);function Dn(e){let t=e.trim().split(/(?<=\.)\s/)[0]?.trim()??e.trim();return t.length>100?`${t.slice(0,97).trimEnd()}…`:t}function On(e){return e?.split(`/`)[0]?.trim()??``}function kn(e){let t=[],n=new Set;for(let r of e){let e=r.name?.trim(),i=r.description?.trim();!e||!i||On(r.source?.repo)===Tn&&(En.has(e)||(n.add(e),t.push({name:e,description:Dn(i)})))}return{capabilities:t,validNames:n}}async function An(e){try{return kn((await O({path:{assistant_id:e},throwOnError:!1})).data?.matches??[])}catch(e){return t(e,{context:`research_onboarding_catalog`}),{capabilities:[],validNames:new Set}}}async function jn(e,n){try{await re({path:{assistant_id:e},body:{name:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_install`})}}var Mn=e=>new Promise(t=>setTimeout(t,e));function Nn({role:e,validNames:t,modelPlugins:n}){return[...new Set([...vn(e,t),...n.filter(e=>t.has(e))])]}function Pn(){let[e,n]=(0,G.useState)({status:`idle`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),r=(0,G.useRef)(0),i=(0,G.useRef)(null),a=(0,G.useRef)(new Map),s=(0,G.useRef)(Promise.resolve()),c=o(),l=(0,G.useCallback)(({awaitAssistantId:e,subject:o,conversationTitle:l,resumeConversationId:u,onConversationCreated:d,includeSuggestions:f=!0})=>{let p=JSON.stringify(o);if(i.current===p)return;i.current=p;let m=r.current+1;r.current=m;let h=()=>r.current!==m,g=()=>{};s.current=new Promise(e=>{g=e}),a.current.clear(),n({status:`running`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),(async()=>{let r,i,s=!1;try{let t=await e();if(r=t,h())return;let{capabilities:c,validNames:p}=await An(t);if(h())return;let m=Object.fromEntries(c.map(e=>[e.name,e.description]));n(e=>({...e,pluginCatalog:m})),p.size===0&&g();let _=a.current,v=vn(o.occupation,p);for(let e of v)_.has(e)||_.set(e,jn(t,e));v.length>0&&n(e=>({...e,installedPlugins:v}));let y=async e=>{let n={conversationId:e,content:nn(o,c,{includeSuggestions:f}),sourceChannel:`vellum`,interface:`web`,clientOs:me(),clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(n.clientTimezone=e)}catch{}return!!(await j({path:{assistant_id:t},body:n,throwOnError:!1})).response?.ok},b=async()=>{let e=await A({path:{assistant_id:t},body:{conversationType:`standard`,...l?{title:l}:{}},throwOnError:!1});i=e.data?.id;let n=e.data?.id;if(!(!e.response?.ok||!n))return d?.(n),n},x;if(u){let e=await ne({path:{assistant_id:t},query:{conversationId:u},throwOnError:!1});if(h())return;if(e.response?.ok&&(x=u,i=u,!(e.data?.messages??[]).some(e=>e.role===`user`))){if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}}if(!x){if(x=await b(),h())return;if(!x){n(e=>({...e,status:`error`}));return}if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}let S=Date.now()+bn,C=``,w=0;for(;Date.now()<S;){if(await Mn(yn),h())return;let e=await ne({path:{assistant_id:t},query:{conversationId:x},throwOnError:!1});if(h())return;let r=fn(e.data?.messages??[]);if(r){let{claims:e,suggestions:i,plugins:a,pluginsResolved:c,complete:l}=tt(r),u=a.filter(e=>p.has(e));for(let e of u)_.has(e)||_.set(e,jn(t,e));if(c&&g(),n({status:`running`,claims:e,suggestions:i,installedPlugins:Nn({role:o.occupation,validNames:p,modelPlugins:u}),pluginCatalog:m}),l&&(s=!0),w=r===C?w+1:0,C=r,Sn({complete:l,stableReads:w}))break}}if(h())return;n(e=>({...e,status:Cn({sawCompletePayload:s})}))}catch(e){if(h())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}finally{g(),wn({sawCompletePayload:s})&&r&&i&&(await dn(r,i),nt(c,r))}})()},[c]),u=(0,G.useCallback)(async()=>{await s.current,await Promise.all([...a.current.values()])},[]),d=(0,G.useCallback)((e,t)=>{if(r.current+=1,n(e),t&&e.installedPlugins.length>0){let n=a.current;n.clear();for(let r of e.installedPlugins)n.set(r,(async()=>{try{await jn(await t(),r)}catch{}})())}},[]);return{...e,start:l,awaitPluginInstalls:u,hydrate:d}}function Fn({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
+ `).trim()}return``}var pn=[`admin-copilot`],mn=[{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 hn(e){return` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()} `}function gn(e,t){return e.includes(` ${t} `)}function _n(e){let t=hn(e),n=[];for(let{plugin:e,keywords:r}of mn)r.some(e=>gn(t,e))&&n.push(e);return n}function vn(e,t){let n=[...pn,..._n(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 yn=1500,bn=12e4,xn=2;function Sn({complete:e,stableReads:t}){return e&&t>=xn}function Cn({sawCompletePayload:e}){return e?`done`:`error`}function wn({sawCompletePayload:e}){return e}var Tn=`vellum-ai`,En=new Set([`simple-memory`,`level-up`]);function Dn(e){let t=e.trim().split(/(?<=\.)\s/)[0]?.trim()??e.trim();return t.length>100?`${t.slice(0,97).trimEnd()}…`:t}function On(e){return e?.split(`/`)[0]?.trim()??``}function kn(e){let t=[],n=new Set;for(let r of e){let e=r.name?.trim(),i=r.description?.trim();!e||!i||On(r.source?.repo)===Tn&&(En.has(e)||(n.add(e),t.push({name:e,description:Dn(i)})))}return{capabilities:t,validNames:n}}async function An(e){try{return kn((await O({path:{assistant_id:e},throwOnError:!1})).data?.matches??[])}catch(e){return t(e,{context:`research_onboarding_catalog`}),{capabilities:[],validNames:new Set}}}async function jn(e,n){try{await re({path:{assistant_id:e},body:{name:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_install`})}}var Mn=e=>new Promise(t=>setTimeout(t,e));function Nn({role:e,validNames:t,modelPlugins:n}){return[...new Set([...vn(e,t),...n.filter(e=>t.has(e))])]}function Pn(){let[e,n]=(0,G.useState)({status:`idle`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),r=(0,G.useRef)(0),i=(0,G.useRef)(null),a=(0,G.useRef)(new Map),s=(0,G.useRef)(Promise.resolve()),c=o(),l=(0,G.useCallback)(({awaitAssistantId:e,subject:o,conversationTitle:l,resumeConversationId:u,onConversationCreated:d,includeSuggestions:f=!0})=>{let p=JSON.stringify(o);if(i.current===p)return;i.current=p;let m=r.current+1;r.current=m;let h=()=>r.current!==m,g=()=>{};s.current=new Promise(e=>{g=e}),a.current.clear(),n({status:`running`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),(async()=>{let r,i,s=!1;try{let t=await e();if(r=t,h())return;let{capabilities:c,validNames:p}=await An(t);if(h())return;let m=Object.fromEntries(c.map(e=>[e.name,e.description]));n(e=>({...e,pluginCatalog:m})),p.size===0&&g();let _=a.current,v=vn(o.occupation,p);for(let e of v)_.has(e)||_.set(e,jn(t,e));v.length>0&&n(e=>({...e,installedPlugins:v}));let y=async e=>{let n={conversationId:e,content:nn(o,c,{includeSuggestions:f}),sourceChannel:`vellum`,interface:`web`,clientOs:me(),clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(n.clientTimezone=e)}catch{}return!!(await j({path:{assistant_id:t},body:n,throwOnError:!1})).response?.ok},b=async()=>{let e=await A({path:{assistant_id:t},body:{conversationType:`standard`,...l?{title:l}:{}},throwOnError:!1});i=e.data?.id;let n=e.data?.id;if(!(!e.response?.ok||!n))return d?.(n),n},x;if(u){let e=await ne({path:{assistant_id:t},query:{conversationId:u},throwOnError:!1});if(h())return;if(e.response?.ok&&(x=u,i=u,!(e.data?.messages??[]).some(e=>e.role===`user`))){if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}}if(!x){if(x=await b(),h())return;if(!x){n(e=>({...e,status:`error`}));return}if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}let S=Date.now()+bn,C=``,w=0;for(;Date.now()<S;){if(await Mn(yn),h())return;let e=await ne({path:{assistant_id:t},query:{conversationId:x},throwOnError:!1});if(h())return;let r=fn(e.data?.messages??[]);if(r){let{claims:e,suggestions:i,plugins:a,pluginsResolved:c,complete:l}=nt(r),u=a.filter(e=>p.has(e));for(let e of u)_.has(e)||_.set(e,jn(t,e));if(c&&g(),n({status:`running`,claims:e,suggestions:i,installedPlugins:Nn({role:o.occupation,validNames:p,modelPlugins:u}),pluginCatalog:m}),l&&(s=!0),w=r===C?w+1:0,C=r,Sn({complete:l,stableReads:w}))break}}if(h())return;n(e=>({...e,status:Cn({sawCompletePayload:s})}))}catch(e){if(h())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}finally{g(),wn({sawCompletePayload:s})&&r&&i&&(await dn(r,i),Qe(c,r))}})()},[c]),u=(0,G.useCallback)(async()=>{await s.current,await Promise.all([...a.current.values()])},[]),d=(0,G.useCallback)((e,t)=>{if(r.current+=1,n(e),t&&e.installedPlugins.length>0){let n=a.current;n.clear();for(let r of e.installedPlugins)n.set(r,(async()=>{try{await jn(await t(),r)}catch{}})())}},[]);return{...e,start:l,awaitPluginInstalls:u,hydrate:d}}function Fn({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(`
41
41
  `)}async function In({assistantId:e,conversationId:n,removedClaims:r,rejectedAll:i}){let a=Fn({removedClaims:r,rejectedAll:i});if(a){try{let t={conversationId:n,content:a,sourceChannel:`vellum`,interface:`web`,clientOs:me(),clientMessageId:crypto.randomUUID()};await j({path:{assistant_id:e},body:t,throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_correction`})}await dn(e,n)}}var Ln={companionCoworker:`companion-coworker`,genzBoomer:`genz-boomer`,executeCollaborate:`execute-collaborate`,playfulSerious:`playful-serious`,politeUnfiltered:`polite-unfiltered`},Rn=1500,zn=12e4,Bn=2;function Vn({processing:e,sawProcessing:t,hasReply:n,stableReads:r}){return e===void 0?n&&r>=Bn:!e&&(n||t)}var Hn=e=>new Promise(t=>setTimeout(t,e)),Un=e=>Math.max(0,Math.min(100,Math.round(e)));function Wn(e,t,n){let r=t=>Un(e[t]??50),i=r(Ln.companionCoworker),a=r(Ln.executeCollaborate),o=r(Ln.playfulSerious),s=r(Ln.politeUnfiltered),c=t?.trim()||`The user`,l=n?.trim(),u=l?`Your name is ${l}. Write exactly \`- **Name:** ${l}\` in IDENTITY.md — do not rename yourself or invent a different name, even if the file currently shows a placeholder or a different name. This changes your personality, not who you are.`:"Keep your existing name exactly as it is — this changes your personality, not who you are. Do not rename yourself, and if your name is already set, carry it through verbatim (don't treat it as a placeholder to fill). Whatever the name ends up being, keep it on IDENTITY.md's `- **Name:** …` line.";return`<system-message>
42
42
  ${c} wants to customize your personality.
43
43
  This is what they want you to be:
@@ -60,4 +60,4 @@ ${u}
60
60
  Each rewritten file must still be complete: SOUL.md keeps everything you operate by — how you use memory, your boundaries, your compliance stance — re-expressed in your new voice rather than dropped. When you finish, both files should read top-to-bottom as this new personality, with nothing left in the generic default voice.
61
61
  </system-message>`}async function Gn({awaitAssistantId:e,values:n,userName:r,assistantName:i}){let a,o;try{a=await e();let t=await A({path:{assistant_id:a},body:{conversationType:`standard`,title:`Updating personality`},throwOnError:!1});if(o=t.data?.id,!t.response?.ok||!o)return;let s={conversationId:o,content:Wn(n,r,i),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};if(!(await j({path:{assistant_id:a},body:s,throwOnError:!1})).response?.ok)return;let c=Date.now()+zn,l=``,u=0,d=!1;for(;Date.now()<c;){await Hn(Rn);let e=await ne({path:{assistant_id:a},query:{conversationId:o},throwOnError:!1}),t=fn(e.data?.messages??[]);if(t&&(u=t===l?u+1:0,l=t),e.data?.processing===!0&&(d=!0),Vn({processing:e.data?.processing,sawProcessing:d,hasReply:t.length>0,stableReads:u}))break}}catch(e){t(e,{context:`research_onboarding_personality`})}finally{if(a&&o)try{await k({path:{assistant_id:a,id:o},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_personality_archive`})}}}function Kn(e){let t=e?.trim();return`You're about to begin your first conversation.${t?`\nYour name is ${t} — introduce yourself as ${t}.`:``}
62
62
  Respond with a warm and engaging greeting. Be interesting, be real. This is your chance to get to know and impress the user.
63
- 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 qn(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 K=s(),Jn={w:1280,h:800};function Yn(){return typeof window>`u`?Jn:{w:window.innerWidth,h:window.innerHeight}}function Xn(){let[e,t]=(0,G.useState)(null),[n,r]=(0,G.useState)(()=>Yn());return(0,G.useLayoutEffect)(()=>{if(!e)return;let t=()=>{let t=e.getBoundingClientRect();r({w:t.width,h:t.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),{ref:t,size:n}}var Zn=(0,G.createContext)(null);function Qn({size:e,children:t}){return(0,K.jsx)(Zn.Provider,{value:e,children:t})}function $n(){let e=(0,G.useContext)(Zn),[t,n]=(0,G.useState)(()=>Yn());return(0,G.useEffect)(()=>{if(e)return;let t=()=>n(Yn());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var er={x:.5,y:.4},tr=[-8,6,9,0,7,-6,5,0,-7,4,-5,6];function nr(e){return tr[e%tr.length]??0}var rr=[1,0,1,0,1,0,1,0,1,0,0],ir=[.72,1],ar=[.4,1],or=[10,20],sr=50;function cr(e){return ir[rr[e]??1]??1}function lr(e){return ar[rr[e]??1]??1}function ur(e){return or[rr[e]??1]??20}function dr(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function fr(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function pr(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 mr(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 hr({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=$n(),u=H(),d=c<640,f=new Set([4,7,8,9,10]),p=e=>d&&f.has(e),h=dr(c,l),g=h/2,_=h/2,v=fr(c,l)/h,y=fr(c,l),b=(0,G.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),x=er.x*c,S=er.y*l,C=x-g,w=S-g,T=(0,G.useMemo)(()=>pr(c,l,_),[c,l,_]);return(0,K.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0 overflow-hidden`,children:[(0,K.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=mr(n,x,S,c,l),s=cr(i.fromSlot),u=lr(i.fromSlot);return(0,K.jsx)(V.div,{className:`absolute left-0 top-0`,style:{width:h,height:h,zIndex:sr},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,K.jsx)(m,{components:e,traits:t,size:h})},r)}if(_){if(p(a.toSlot))return null;let n=T[a.toSlot],i=mr(n,x,S,c,l),o=cr(a.toSlot),s=lr(a.toSlot);return(0,K.jsx)(V.div,{className:`absolute left-0 top-0`,style:{width:h,height:h,zIndex:ur(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,K.jsx)(`div`,{style:{transform:`rotate(${nr(a.toSlot)}deg)`},children:(0,K.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,K.jsx)(V.div,{className:`absolute left-0 top-0 ${d?``:`pointer-events-auto cursor-pointer`}`,style:{width:h,height:h,zIndex:d?sr:ur(y)},initial:!1,animate:{x:E.x-g,y:E.y-g,scale:d?v:cr(y),opacity:d?1:lr(y)},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:d?void 0:()=>s(r),children:(0,K.jsx)(`div`,{style:{transform:d?void 0:`rotate(${nr(b.get(r)??0)}deg)`},children:(0,K.jsx)(m,{components:e,traits:t,size:h,breathe:d})})},r)})]})}var gr=[{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`}],q=T(w((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:gr,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 _r(){let[e,t]=(0,G.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,G.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function vr(){let e=W(),t=q.use.characters(),n=q.use.ensureGenerated(),r=H(),{w:i,h:a}=_r();(0,G.useEffect)(()=>{e&&n(e)},[e,n]);let o=dr(i,a),s=(0,G.useMemo)(()=>pr(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,K.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=tr[i%tr.length]??0,d=o*cr(i),f=lr(i),p=ur(i);return(0,K.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,K.jsx)(`div`,{style:{opacity:f,transform:`rotate(${u}deg)`},children:(0,K.jsx)(m,{components:e,traits:t,size:d,breathe:!1})})},n)})})}var yr=c(`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)]`),br=c(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`,ct);function J(e){return e.trim().toLowerCase()}function xr(e,t,n=[],r=8){let i=J(t),a=new Set(n.map(J)),o=[];for(let t of e)if(!a.has(J(t))&&((i.length===0||J(t).includes(i))&&o.push(t),o.length>=r))break;return o}function Sr({id:e,options:t,highlighted:n,showAddHint:r,onPick:i,onHover:a}){return(0,K.jsxs)(`ul`,{id:e,role:`listbox`,className:c(`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,K.jsx)(`li`,{id:`${e}-opt-${r}`,role:`option`,"aria-selected":r===n,onMouseDown:e=>{e.preventDefault(),i(t.value)},onMouseEnter:()=>a(r),className:c(`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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_,{size:15,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,K.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Add “`,t.value,`”`]}),(0,K.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,K.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 Cr({htmlFor:e,required:t,children:n}){return(0,K.jsxs)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:[n,t?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`}):null]})}function wr(e,t){(0,G.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function Tr({label:e,placeholder:t,values:n,onChange:r,suggestions:i}){let a=(0,G.useId)(),o=`tac-${a}`,s=`tac-list-${a}`,l=(0,G.useRef)(null),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(!1),[m,h]=(0,G.useState)(-1),g=(0,G.useMemo)(()=>xr(i,u,n),[i,u,n]),_=u.trim(),v=(0,G.useMemo)(()=>{if(!_)return!1;let e=J(_);return!(n.some(t=>J(t)===e)||g.some(t=>J(t)===e))},[_,n,g]),b=(0,G.useMemo)(()=>{let e=g.map(e=>({value:e,isAdd:!1}));return v?[...e,{value:_,isAdd:!0}]:e},[g,v,_]);wr(l,()=>p(!1)),(0,G.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=>J(e)===J(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,K.jsxs)(`div`,{ref:l,className:`relative flex flex-col gap-1.5`,children:[(0,K.jsx)(Cr,{htmlFor:o,children:e}),(0,K.jsxs)(`div`,{className:c(yr,`min-h-9 flex-wrap py-1.5`),children:[(0,K.jsx)($e,{size:16,"aria-hidden":!0,className:`shrink-0 self-center text-[var(--content-tertiary)]`}),n.map(e=>(0,K.jsx)(y,{onRemove:()=>w(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,K.jsx)(`input`,{id:o,role:`combobox`,"aria-expanded":x,"aria-controls":s,"aria-autocomplete":`list`,"aria-activedescendant":m>=0?`${s}-opt-${m}`:void 0,autoComplete:`off`,className:c(br,`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,K.jsx)(Sr,{id:s,options:b,highlighted:m,showAddHint:S,onPick:C,onHover:h})]})}var Er=`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 Y(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function Dr({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[i,a]=(0,G.useState)(e),[o,s]=(0,G.useState)(t),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)([]),f=i.trim().length>0&&c.trim().length>0;function p(){f&&n({firstName:i,lastName:o,role:c,hobbies:u})}return(0,K.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,K.jsxs)(it,{showCreatureFooter:!1,children:[(0,K.jsx)(vr,{}),(0,K.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,K.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:Y(.05),children:`Let's start with you.`}),(0,K.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:Y(.12),children:`A few details so I can get to know you.`}),(0,K.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,K.jsx)(`div`,{style:Y(.2,40),children:(0,K.jsx)(b,{label:(0,K.jsxs)(K.Fragment,{children:[`What should I call you?`,(0,K.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`})]}),placeholder:`Your name`,value:i,onChange:e=>a(e.target.value),className:ct,autoFocus:!0,required:!0,fullWidth:!0})}),(0,K.jsx)(`div`,{style:Y(.27,30),children:(0,K.jsx)(b,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),className:ct,fullWidth:!0})}),(0,K.jsx)(`div`,{style:Y(.34,20),children:(0,K.jsx)(b,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:e=>l(e.target.value),className:ct,required:!0,fullWidth:!0})}),(0,K.jsx)(`div`,{style:Y(.41,10),children:(0,K.jsx)(Tr,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:u,onChange:d,suggestions:Er})})]}),(0,K.jsx)(`div`,{className:`mt-10 w-full`,style:Y(.5),children:(0,K.jsx)(r,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{size:16}),fullWidth:!0,disabled:!f,className:`h-11 text-base`,children:`Continue`})})]})]})})}var Or=`#1A1A1A`,kr=`#FFFFFF`;function Ar(e){let t=/^#?([0-9a-f]{6})$/i.exec(e);if(!t)return 0;let n=parseInt(t[1],16),r=n>>16&255,i=n>>8&255,a=n&255;return(r*299+i*587+a*114)/1e3/255}function jr(e,t){let n=/^#?([0-9a-f]{6})$/i.exec(e);if(!n)return e;let r=parseInt(n[1],16),i=e=>Math.max(0,Math.min(255,Math.round((r>>e&255)*t)));return`#${(1<<24|i(16)<<16|i(8)<<8|i(0)).toString(16).slice(1)}`}function Mr(e){let t=Ar(e)>.6;return{bg:e,isLight:t,fg:t?Or:kr,fgDeep:jr(e,.6),fgMuted:t?`rgba(0,0,0,0.6)`:`rgba(255,255,255,0.65)`,wash:t?`rgba(0,0,0,0.08)`:`rgba(255,255,255,0.12)`}}function X(){let e=W(),t=q.use.characters(),n=q.use.selectedIndex();return(0,G.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return Mr(i??`var(--surface-base)`)},[e,t,n])}function Z({onBack:e,onNext:t,tone:n}){let r=X(),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,K.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,K.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,K.jsx)(u,{className:`h-5 w-5`})}),t?(0,K.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,K.jsx)(d,{className:`h-5 w-5`})}):null]})}var Nr=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function Pr(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function Fr({onContinue:e,onBack:t,onForward:n}){let i=W(),a=q.use.characters(),o=q.use.ensureGenerated(),s=q.use.selectedIndex(),c=q.use.setSelectedIndex();(0,G.useEffect)(()=>{i&&o(i)},[i,o]);let u=a.length,[d,f]=(0,G.useState)(null),[m,h]=(0,G.useState)(``),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(!1),b=(0,G.useRef)(null),{ref:x,size:S}=Xn(),[C,w]=(0,G.useState)(null);(0,G.useEffect)(()=>{u>0&&d===null&&f(Pr(u,s))},[u,s,d]),(0,G.useEffect)(()=>{d&&c(d.centerChar)},[d,c]);let T=d?.centerChar;(0,G.useEffect)(()=>{T!=null&&!y.current&&h(Nr[T%Nr.length])},[T]),(0,G.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)%u),ee=()=>d&&E((d.centerChar-1+u)%u),te=(0,G.useMemo)(()=>d?a[d.centerChar]:void 0,[d,a]),O=!!i&&!!d&&!!te;function k(){te&&e({traits:te,name:m.trim()})}function A(){y.current=!0,h(e=>{let t=Nr.filter(t=>t!==e),n=t.length>0?t:Nr;return n[Math.floor(Math.random()*n.length)]})}let j=`pointer-events-auto z-10 flex cursor-pointer h-10 w-10 items-center justify-center rounded-full bg-[color-mix(in_srgb,var(--content-default)_10%,transparent)] text-[var(--content-default)] transition-colors duration-150 hover:bg-[color-mix(in_srgb,var(--content-default)_18%,transparent)]`;return(0,K.jsx)(`div`,{ref:x,"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,K.jsxs)(Qn,{size:S,children:[O&&(0,K.jsx)(hr,{components:i,characters:a,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,K.jsx)(Z,{tone:`light`,onBack:t,onNext:n?k:void 0}),(0,K.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,K.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:ee,className:`absolute left-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${j}`,children:(0,K.jsx)(l,{className:`h-4 w-4`})}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:D,className:`absolute right-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${j}`,children:(0,K.jsx)(U,{className:`h-4 w-4`})}),(0,K.jsxs)(`div`,{className:`absolute left-1/2 top-[51%] z-10 flex -translate-x-1/2 flex-col items-center gap-12`,children:[_?(0,K.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,K.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>v(!0),"aria-label":`Edit name`,className:`flex cursor-pointer items-center gap-2.5`,children:[(0,K.jsx)(`span`,{className:`text-3xl font-medium ${m?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:m||`Name your assistant`}),(0,K.jsx)(g,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:A,"aria-label":`Shuffle name`,title:`Shuffle name`,className:`cursor-pointer text-[var(--content-tertiary)] transition-[transform,color] duration-300 hover:rotate-180 hover:text-[var(--content-default)]`,children:(0,K.jsx)(p,{className:`h-5 w-5`})})]}),(0,K.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{size:16}),disabled:!O,onClick:k,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})})}var Ir=/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,Lr=/[MmLlHhVvCcSsQqTtAaZz][^MmLlHhVvCcSsQqTtAaZz]*/g;function Rr(e){let t=1/0,n=1/0,r=-1/0,i=-1/0,a=0,o=0,s=(e,a)=>{e<t&&(t=e),a<n&&(n=a),e>r&&(r=e),a>i&&(i=a)},c=e.match(Lr)??[];for(let e of c){let t=e[0],n=t.toUpperCase();if(n===`Z`)continue;let r=t!==n,i=(e.slice(1).match(Ir)??[]).map(Number);if(n===`H`)for(let e of i)a=r?a+e:e,s(a,o);else if(n===`V`)for(let e of i)o=r?o+e:e,s(a,o);else if(n===`A`)for(let e=0;e+7<=i.length;e+=7){let t=i[e+5],n=i[e+6];a=r?a+t:t,o=r?o+n:n,s(a,o)}else{let e=a,t=o;for(let n=0;n+2<=i.length;n+=2){let c=r?e+i[n]:i[n],l=r?t+i[n+1]:i[n+1];s(c,l),n+2>=i.length-i.length%2&&(a=c,o=l)}}}return t===1/0?{x:0,y:0,w:0,h:0}:{x:t,y:n,w:r-t,h:i-n}}function zr(e){let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.w)),i=Math.max(...e.map(e=>e.y+e.h));return{x:t,y:n,w:r-t,h:i-n}}var Br=.25,Vr=.46,Hr=.3,Ur=.85,Wr=40,Gr=14,Kr=8;function qr({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0,settleBlink:r=!0}){let i=W(),a=q.use.characters(),o=q.use.selectedIndex(),s=H(),{w:c,h:l}=$n(),[u,d]=(0,G.useState)({x:0,y:0});(0,G.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=$t();(0,G.useEffect)(()=>{n>0&&!s&&p.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,s,p]);let[m,h]=(0,G.useState)(!1),[g,_]=(0,G.useState)(!e);(0,G.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,G.useMemo)(()=>{if(!i||!v)return null;let e=i.eyeStyles.find(e=>e.id===v.eyeStyle);return e?{paths:e.paths,bbox:zr(e.paths.map(e=>Rr(e.svgPath)))}:null},[i,v]);if(!y)return null;let b=c*Ur,x=Math.min(Math.min(c,l)*Hr,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,C=(c-S)/2,w=l-(1-Br)*x,T=Wr/100*l-(w+x/2),E=(Vr-Br)*x,D=y.bbox.x+y.bbox.w/2,ee=y.bbox.y+y.bbox.h/2;return(0,K.jsx)(V.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,K.jsx)(V.div,{animate:p,children:(0,K.jsx)(`div`,{style:{transform:`translate(${u.x*Gr}px, ${u.y*Kr}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,K.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,K.jsx)(`g`,{style:{transform:m?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${D}px ${ee}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,K.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}var Jr=200,Yr=40;function Xr({firstName:e,assistantName:t,onContinue:n,onBack:i,onForward:a}){let o=W(),s=q.use.characters(),c=q.use.selectedIndex(),l=H(),{ref:u,size:{w:d,h:f}}=Xn(),p=X(),m=s.length>0?s[c]:void 0,h=(0,G.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,K.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=Jr/v,C=(Yr/100-.5)*f;return(0,K.jsx)(`div`,{ref:u,"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:(0,K.jsxs)(Qn,{size:{w:d,h:f},children:[(0,K.jsx)(V.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,K.jsx)(V.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,K.jsx)(`path`,{d:h.body.svgPath,fill:h.color})}),(0,K.jsx)(qr,{entrance:!0}),(0,K.jsx)(V.div,{initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.4,delay:1},children:(0,K.jsx)(Z,{onBack:i,onNext:a})}),(0,K.jsxs)(`div`,{className:st,children:[(0,K.jsxs)(V.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,K.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fgDeep},children:g}),(0,K.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fg},children:_})]}),(0,K.jsx)(V.div,{initial:l?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.4,delay:1.15},children:(0,K.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{size:16}),onClick:n,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})})}var Zr=.3,Qr=.85,$r=.25;function ei(){let e=W(),t=q.use.characters(),n=q.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=$n(),o=(0,G.useMemo)(()=>{if(!e||!r)return null;let t=e.eyeStyles.find(e=>e.id===r.eyeStyle);return t?{paths:t.paths,bbox:zr(t.paths.map(e=>Rr(e.svgPath)))}:null},[e,r]),s=o?Math.min(Math.min(i,a)*Zr,i*Qr*o.bbox.h/o.bbox.w):0;return{art:o,eyesW:o?s*o.bbox.w/o.bbox.h:0,eyesH:s,restCy:a-$r*s,centerX:i/2,w:i,h:a}}function ti({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=xt(i,e=>e-n/2),u=e.bbox.x+e.bbox.w/2,d=e.bbox.y+e.bbox.h/2;return(0,K.jsx)(V.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,K.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,K.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,K.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})}var ni={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 ri(e,t){let n=ni[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var ii=new Set([`orange`,`pink`,`red`]);function ai(e,t){return ii.has(e)&&ii.has(t)}function oi(e,t,n){let r=ri(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>ai(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var si=`You’ve used AI that just answers questions`,ci=`The more I help`,li=`I’m different`,ui=`The better I get`,di=`and the less you have to do`,fi=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],pi=290;function mi({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,K.jsx)(V.div,{className:`relative w-full overflow-hidden`,initial:!1,animate:{height:o?t:e},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:(0,K.jsxs)(V.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,K.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:e},children:(0,K.jsx)(V.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,K.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:t},children:(0,K.jsx)(`span`,{className:`block`,children:i})})]})})}function hi({onContinue:e,onBack:t,onForward:n}){let i=X(),a=H(),{art:o,eyesW:s,eyesH:c,restCy:l,centerX:u,w:d,h:f}=ei(),p=W(),h=q.use.characters(),g=q.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=vt(0),S=vt(1),C=(0,G.useMemo)(()=>!p||!_?`orange`:oi(_.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=vt(-220),ee=(0,G.useMemo)(()=>!p||!_?[]:oi(_.color,p.colors.map(e=>e.id),3),[p,_]),te=Math.max(.42,Math.min(d/1100,1)),O=Math.round(pi*te),k=-O*1.1,A=-O*.42,j=vt(-320),[ne,re]=(0,G.useState)(!!a),[ie,ae]=(0,G.useState)(!!a),[oe,M]=(0,G.useState)(!1),[se,ce]=(0,G.useState)(!1),[le,ue]=(0,G.useState)(!1),[de,fe]=(0,G.useState)(!1),[pe,me]=(0,G.useState)(!!a),he=Math.min(d,768)-48,ge=(0,G.useRef)(null),N=(0,G.useRef)(null),_e=(0,G.useRef)(null),ve=(0,G.useRef)(null),ye=(0,G.useRef)(null),[be,xe]=(0,G.useState)(0),[P,Se]=(0,G.useState)(0),[Ce,we]=(0,G.useState)(0),[Te,Ee]=(0,G.useState)(0),[F,De]=(0,G.useState)(0);return(0,G.useLayoutEffect)(()=>{ge.current?.offsetHeight&&xe(ge.current.offsetHeight),N.current?.offsetHeight&&Se(N.current.offsetHeight),_e.current?.offsetHeight&&we(_e.current.offsetHeight),ve.current?.offsetHeight&&Ee(ve.current.offsetHeight),ye.current?.offsetHeight&&De(ye.current.offsetHeight)},[he]),(0,G.useEffect)(()=>{x.set(l),fe(!0)},[l,x]),(0,G.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{M(!0),ce(!0),ue(!0)},1400);return()=>clearTimeout(e)},[a]),(0,G.useEffect)(()=>{if(a||!o)return;x.set(l),S.set(1),D.set(T),j.set(k),re(!1),ae(!1),M(!1),ce(!1);let e=Math.max(c*.5,f*y-36),t=[],n=[],r=!1,i=e=>(t.push(e),e),s=e=>new Promise(t=>{n.push(setTimeout(t,e))});return(async()=>{if(await s(200),r||(re(!0),await Promise.all([i(Qt(x,e,{duration:.55,ease:`easeOut`})),i(Qt(S,.55,{duration:.55,ease:`easeOut`}))]),r)||(ae(!0),await Promise.all([i(Qt(x,l,{type:`spring`,stiffness:210,damping:15})),i(Qt(S,1,{duration:.45,ease:`easeOut`}))]),r)||(await s(900),r)||(M(!0),ce(!0),await i(Qt(D,[T,E,E,T],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`})),r)||(await s(150),r))return;ue(!0);let t=i(Qt(j,[k,A,A,k],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`}));await s(700),!r&&(me(!0),await t)})(),()=>{r=!0,t.forEach(e=>e.stop()),n.forEach(clearTimeout)}},[a,o,f,y,c,l,x,S,D,T,E,j,k,A]),(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:i.fg},children:[(0,K.jsx)(Z,{onBack:t,onNext:n}),(0,K.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:he,fontFamily:`var(--font-serif)`},children:[(0,K.jsx)(`span`,{ref:ge,className:`block`,children:si}),(0,K.jsx)(`span`,{ref:N,className:`block`,children:ci}),(0,K.jsx)(`span`,{ref:_e,className:`block`,children:li}),(0,K.jsx)(`span`,{ref:ve,className:`block`,children:ui}),(0,K.jsx)(`span`,{ref:ye,className:`block`,children:di})]}),de&&o&&(0,K.jsx)(ti,{art:o,eyesW:s,eyesH:c,centerX:u,eyeCy:x,eyeScale:S,blinking:!1}),!a&&p&&(0,K.jsx)(V.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,K.jsx)(m,{components:p,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:C},size:w,breathe:!1})}),!a&&p&&(0,K.jsx)(V.div,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 top-0 z-[1] flex items-start`,style:{right:-Math.round(O*.12),y:j},children:fi.map((e,t)=>(0,K.jsx)(`div`,{style:{width:O,height:O,marginLeft:t===0?0:-O*.34,zIndex:fi.length-t},children:(0,K.jsx)(m,{components:p,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:ee[t]??`teal`},size:O,breathe:!1})},e.bodyShape))}),(0,K.jsxs)(`div`,{className:`${st.replace(`top-[30%]`,b)} max-w-3xl`,children:[(0,K.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,K.jsx)(mi,{firstH:be,secondH:P,color:i.fgDeep,firstText:si,secondText:ci,revealed:ne,carouseled:oe,revealFrom:`bottom`,revealDuration:.55,reduce:!!a}),(0,K.jsx)(mi,{firstH:Ce,secondH:Te,color:i.fg,firstText:li,secondText:ui,revealed:ie,carouseled:se,revealFrom:`top`,revealDuration:.45,reduce:!!a}),(0,K.jsx)(V.div,{className:`relative w-full overflow-hidden`,style:{color:i.fg},initial:!1,animate:{height:le?F:0},transition:a?{duration:0}:{duration:.5,ease:`easeInOut`},children:F>0&&(0,K.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:F},children:(0,K.jsx)(V.span,{className:`block`,initial:!1,animate:{clipPath:le?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:a?{duration:0}:{duration:.5,ease:`easeOut`},children:di})})})]}),pe&&(0,K.jsx)(V.div,{initial:a?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:a?{duration:0}:{duration:.4},children:(0,K.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{size:16}),onClick:e,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})}function gi({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cs-${e}`;return(0,K.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,K.jsxs)(`defs`,{children:[(0,K.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,K.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,K.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,K.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,K.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,K.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,K.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,K.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,K.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,K.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,K.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,children:[(0,K.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,K.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,K.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#F4C12A`,children:`$`})]}),(0,K.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,K.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${i})`})]})}function _i({size:e,tiltX:t=0,tiltY:n=0,shadow:r=!0,spinning:i=!1,className:a}){return(0,K.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[r&&(0,K.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,K.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,K.jsxs)(V.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,K.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(0.5px)`},children:(0,K.jsx)(gi,{idSuffix:`front`})}),(0,K.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,K.jsx)(gi,{idSuffix:`back`})})]})})]})}var vi=.3,yi=.95;function bi({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=H(),a=X(),{h:o}=$n(),[s,c]=(0,G.useState)(!1);function l(){if(!s){if(c(!0),i){e();return}window.setTimeout(t,vi*1e3)}}let u=o*.42,d=-o*.08,f=o*.9;return(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,K.jsx)(Z,{onBack:n,onNext:r}),(0,K.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,K.jsx)(`h1`,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here are some free credits to get started`}),(0,K.jsx)(`div`,{className:`mt-8 flex flex-col items-center gap-4`,children:(0,K.jsx)(V.div,{animate:s&&!i?{y:[0,u,d,f],scale:[1,1,1,.2],opacity:[1,1,1,0]}:{},transition:{duration:yi,times:[0,vi/yi,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]},onAnimationComplete:()=>{s&&e()},children:(0,K.jsx)(_i,{size:88,spinning:s&&!i})})}),!s&&(0,K.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,K.jsx)(U,{className:`h-4 w-4`})]})]})]})}ot();var xi=640,Si=[{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`}}],Ci=[`9%`,`27%`,`45%`,`62%`,`79%`],Q=50,wi=.3*.75,Ti=`rgba(36, 41, 46, 0.2)`,Ei=`#FDFDFC`,Di=.16;function Oi(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 ki(){let[e,t]=(0,G.useState)(()=>typeof window>`u`?1280:window.innerWidth);return(0,G.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Ai({components:e,traits:t,side:n,top:r,size:i,progress:a}){let o=Math.max(0,Math.min(1,a)),s=100+Di*100,c=n===`left`?-100+s*o:100-s*o;return(0,K.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,K.jsx)(m,{components:e,traits:t,size:i,breathe:!1})})}function ji({axis:e,value:t,onValueChange:n,fg:r,disabled:i}){return(0,K.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,K.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,K.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,K.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]??Q),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,K.jsx)(x,{className:`relative h-2 w-full grow rounded-full sm:h-3`,style:{backgroundColor:Ti}}),(0,K.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:Ei}})]})]})}function Mi({components:e,values:t,sideAvatars:n,size:r}){return(0,K.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10`,children:Si.map((i,a)=>{let o=t[i.id]??Q,s=Math.max(0,(Q-o)/Q),c=Math.max(0,(o-Q)/Q),l=Ci[a]??`50%`,u=n[a];return u?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Ai,{components:e,traits:u.left,side:`left`,top:l,size:r,progress:s}),(0,K.jsx)(Ai,{components:e,traits:u.right,side:`right`,top:l,size:r,progress:c})]},i.id):null})})}function Ni({values:e,onValueChange:t,locked:n,onContinue:r,onBack:i,onForward:a}){let o=X(),s=W(),c=ki(),{w:l,h:u}=$n(),d=Math.round(wi*Math.min(l,u))+12,f=c>=xi,p=q.use.characters()[q.use.selectedIndex()]?.color,m=Math.round(Math.min(300,Math.max(160,c*.16))),h=(0,G.useMemo)(()=>{let e=s?.colors.map(e=>e.id)??[],t=Oi(Si.map(e=>e.leftAvatar.color),p,e),n=Oi(Si.map(e=>e.rightAvatar.color),p,e);return Si.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,K.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:o.fg},children:[(0,K.jsx)(Z,{onBack:i,onNext:a}),f&&s&&(0,K.jsx)(Mi,{components:s,values:e,sideAvatars:h,size:m}),(0,K.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,K.jsx)(`div`,{className:`w-full min-h-14 shrink-[4]`,style:{flexBasis:Math.round(u*.14)}}),(0,K.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2`,children:[(0,K.jsx)(`h1`,{className:`text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Create my personality`}),n?(0,K.jsx)(`p`,{className:`text-center text-[15px]`,style:{color:o.fgMuted},children:`Personality locked — chat with your assistant to make any more updates`}):(0,K.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,K.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-10`}),Si.map((r,i)=>(0,K.jsxs)(G.Fragment,{children:[i>0&&(0,K.jsx)(`div`,{className:`w-full min-h-2.5 shrink basis-8 sm:basis-11`}),(0,K.jsx)(ji,{axis:r,value:e[r.id]??Q,onValueChange:e=>t(r.id,e),fg:o.fg,disabled:n})]},r.id)),(0,K.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-14`}),(0,K.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,K.jsx)(U,{className:`h-4 w-4`})]})]})]})}function Pi({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a,missingCalendarScope:o=!1,onRetry:s,hatchError:c=null}){let l=X(),{handleConnect:u,oauthInProgress:d}=rt({assistantId:e??``,onConnect:n}),f=()=>{s?.(),u()},p=!e||!t,m=p||d;return(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:l.fg},children:[(0,K.jsx)(Z,{onBack:i,onNext:a}),(0,K.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,K.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,K.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,K.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-4`,children:[(0,K.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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):d?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(!p||c)&&(0,K.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 Fi=Mr(`#17191C`);function Ii(){let[e,t]=(0,G.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,G.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Li(){let e=W(),t=q.use.characters(),n=q.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function Ri({size:e=64,isAssistantBusy:t=!1}){let{components:n,chosen:r}=Li();return!n||!r?(0,K.jsx)(`div`,{style:{width:e,height:e}}):(0,K.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,K.jsx)(m,{components:n,traits:r,size:e,isAssistantBusy:t})})}var zi=64,Bi=4500,Vi=7e3;function Hi({onDone:e,onBack:t,onForward:n,scheduledTime:r,awaitingTime:i}){let{components:a,chosen:o}=Li(),s=H(),{w:c,h:l}=Ii(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,G.useEffect)(()=>{let t=setTimeout(e,i&&!r?Vi:Bi);return()=>clearTimeout(t)},[e,i,r]);let d=(0,G.useRef)(null),[f,p]=(0,G.useState)(null);(0,G.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)/zi,g=f?c/2-f.cx:0,_=f?l*.88-f.cy:0,v=l*.05;return(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,K.jsx)(Z,{onBack:t,onNext:n,tone:`light`}),(0,K.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,K.jsx)(`div`,{ref:d,className:`relative shrink-0`,style:{width:zi,height:zi},children:a&&o&&f&&(0,K.jsx)(V.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,K.jsx)(m,{components:a,traits:o,size:zi})})}),(0,K.jsx)(V.span,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:s?!1:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:s?{duration:0}:{duration:.4,delay:.9},children:u})]})]})}var Ui=[`Searching the web to get to know you…`,`Reading public profiles…`,`Skimming the highlights…`,`Connecting the dots…`,`Piecing it together…`],Wi=[`Updating my personality…`,`Finding my voice…`,`Getting into character…`],Gi=`Almost there…`,Ki=[...Ui,Gi],qi=[...Wi,Gi],Ji=2800;function Yi({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i}){let a=Fi,[o,s]=(0,G.useState)(0);return(0,G.useEffect)(()=>{n?.(o);let t=o>=Ki.length-1;if(i&&t){let t=setTimeout(e,Ji);return()=>clearTimeout(t)}let r=setTimeout(()=>s(e=>(e+1)%Ki.length),Ji);return()=>clearTimeout(r)},[o,i,e,n]),(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,K.jsx)(Z,{onBack:t,onNext:r}),(0,K.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,K.jsx)(Ri,{isAssistantBusy:!0}),(0,K.jsx)(Ye,{mode:`wait`,children:(0,K.jsx)(V.p,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Ki[o]},o)})]})]})}function Xi({onDone:e,ready:t}){let n=Fi,[r,i]=(0,G.useState)(0);return(0,G.useEffect)(()=>{let n=qi.length-1;if(t){if(r!==n){i(n);return}let t=setTimeout(e,Ji);return()=>clearTimeout(t)}let a=setTimeout(()=>i(e=>(e+1)%qi.length),Ji);return()=>clearTimeout(a)},[r,t,e]),(0,K.jsx)(`div`,{className:`absolute inset-0 z-10`,style:{color:n.fg},children:(0,K.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,K.jsx)(Ri,{isAssistantBusy:!0}),(0,K.jsx)(Ye,{mode:`wait`,children:(0,K.jsx)(V.p,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:qi[r]},r)})]})})}function Zi({claims:e,loading:t,onContinue:n,onRejectAll:r,onBack:i,onForward:a}){let o=Fi,s=H(),[c,l]=(0,G.useState)(()=>new Set),u=e.filter(e=>!c.has(e.claim)),d=u.length>0,f=!t;return(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,K.jsx)(Z,{onBack:i,onNext:a}),(0,K.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(Ri,{}),(0,K.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`This is what I found about you`})]}),(0,K.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,K.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,K.jsx)(Ye,{children:u.map(e=>(0,K.jsxs)(V.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,K.jsx)(`span`,{children:e.claim}),(0,K.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,K.jsx)(v,{className:`h-4 w-4`})})]},e.claim))})}),d&&f&&(0,K.jsx)(`button`,{type:`button`,onClick:r,className:`mt-5 self-start cursor-pointer text-[14px] underline underline-offset-2 transition-opacity hover:opacity-80`,style:{color:o.fgMuted},children:`This is not me`}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>n([...c]),disabled:!f,className:`mt-8 flex cursor-pointer h-11 w-[200px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[f?`Continue`:`Still searching…`,f&&(0,K.jsx)(U,{className:`h-4 w-4`})]})]})]})}var $=64,Qi=$;function $i({head:e,note:t,flyToNote:n,reduce:r,onLanded:i}){let{components:a,chosen:o}=Li();if(!a||!o)return null;let s=$/2,c=n&&t?t:e,l={x:c.x-s,y:c.y-s};return(0,K.jsx)(V.div,{className:`pointer-events-none absolute left-0 top-0`,style:{width:$,height:$,transformOrigin:`center`},initial:!1,animate:l,transition:r?{duration:0}:n&&t?{type:`spring`,duration:.9,bounce:.45}:{duration:.4},onAnimationComplete:()=>{n&&t&&i()},children:(0,K.jsx)(m,{components:a,traits:o,size:$})})}function ea({installedPlugins:e=[],pluginCatalog:t={},onStart:n,onBack:r,onForward:i}){let a=Fi,o=H(),[s,c]=(0,G.useState)(!1),l=e.map(e=>({name:e,displayName:at(e),description:t[e]?.trim()??``})).filter(e=>e.displayName.length>0),u=l.length>0,d=(0,G.useRef)(null),f=(0,G.useRef)(null),p=(0,G.useRef)(null),[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(!1);(0,G.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,G.useEffect)(()=>{b===void 0||g||_(!0)},[b,g]),(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,K.jsx)(Z,{onBack:r,onNext:i}),(0,K.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,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(V.div,{ref:f,className:`shrink-0`,style:{height:$},initial:!1,animate:g?{width:0,marginRight:0}:{width:$,marginRight:12},transition:o?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,K.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`You’re all set`})]}),u&&(0,K.jsx)(`div`,{className:`mt-4 flex flex-col gap-3`,children:l.map((e,t)=>(0,K.jsxs)(V.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,K.jsx)(`div`,{className:`text-[15px] font-medium`,children:e.displayName}),e.description&&(0,K.jsx)(`div`,{className:`mt-1 text-[13px] leading-snug`,style:{color:a.fgMuted},children:e.description})]},e.name))}),(0,K.jsxs)(`div`,{className:`mt-16 flex items-center gap-3`,children:[(0,K.jsx)(`div`,{ref:p,className:`shrink-0`,style:{width:Qi}}),(0,K.jsx)(V.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,K.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,K.jsx)(U,{className:`h-4 w-4`})]}),m&&(0,K.jsx)($i,{head:m.head,note:m.note,flyToNote:g&&m.note!==void 0,reduce:o,onLanded:()=>y(!0)})]})]})}var ta=[{bodyShape:`sprout`,eyeStyle:`curious`,colorIdx:0,base:230,pos:e=>({left:-e*.32,top:`40%`})},{bodyShape:`flower`,eyeStyle:`goofy`,colorIdx:1,base:230,pos:e=>({right:-e*.32,top:`40%`})},{bodyShape:`star`,eyeStyle:`dazed`,colorIdx:2,base:240,mobile:!0,pos:e=>({left:`16%`,bottom:-e*.42}),mobilePos:e=>({left:-e*.3,bottom:-e*.3})},{bodyShape:`burst`,eyeStyle:`angry`,colorIdx:0,base:240,mobile:!0,pos:e=>({right:`16%`,bottom:-e*.42}),mobilePos:e=>({right:-e*.3,bottom:-e*.3})},{bodyShape:`blob`,eyeStyle:`gentle`,colorIdx:1,base:220,pos:e=>({left:`42%`,bottom:-e*.5})},{bodyShape:`urchin`,eyeStyle:`curious`,colorIdx:2,base:220,mobile:!0,pos:e=>({left:-e*.28,bottom:`16%`}),mobilePos:e=>({left:-e*.3,top:-e*.3})},{bodyShape:`burst`,eyeStyle:`quirky`,colorIdx:0,base:220,mobile:!0,pos:e=>({right:-e*.28,bottom:`16%`}),mobilePos:e=>({right:-e*.3,top:-e*.3})},{bodyShape:`flower`,eyeStyle:`quirky`,colorIdx:1,base:230,pos:e=>({left:`30%`,bottom:-e*.4})}],na=`#17191C`,ra=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ia=290;function aa({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0,showTopTeam:i=!1}){let a=W(),o=q.use.characters(),s=q.use.selectedIndex(),c=H(),{w:l}=$n(),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,G.useMemo)(()=>!a||!f?{bg:`var(--surface-base)`,peekColors:[]}:{bg:a.colors.find(e=>e.id===f.color)?.hex??`var(--surface-base)`,peekColors:oi(f.color,a.colors.map(e=>e.id),3)},[a,f]);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(V.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?na:p},transition:c?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,K.jsx)(qr,{bumpNonce:t,settleBlink:!1}),i&&a&&(0,K.jsx)(`div`,{className:`pointer-events-none absolute right-0 z-[1] flex items-start`,style:{top:-Math.round(ia*u)*.42,right:-Math.round(ia*u)*.12},children:ra.map((e,t)=>{let n=Math.round(ia*u);return(0,K.jsx)(V.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:ra.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,K.jsx)(m,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),a&&(0,K.jsx)(Ye,{children:(d?ta.filter(e=>e.mobile):ta).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,K.jsx)(V.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,K.jsx)(m,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}var oa={established:!1,assistantName:null};async function sa(e,n={hasAnyActiveConversation:_e,fetchAssistantIdentity:f}){try{if(!await n.hasAnyActiveConversation(e))return oa}catch(e){return t(e,{context:`research_onboarding_established_check`}),oa}let r=await n.fetchAssistantIdentity(e).catch(()=>null);return{established:!0,assistantName:(typeof r?.name==`string`?r.name.trim():``)||null}}function ca({assistantName:e,onKeep:t,onRedo:n,onBack:i}){let a=e?.trim()||``,o=a||`your assistant`,s=a?`${a}'s`:`its`;return(0,K.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-primary)`},children:[(0,K.jsx)(Z,{onBack:i,tone:`light`}),(0,K.jsxs)(`div`,{className:`${st} max-w-xl`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,K.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:a?`${a} is already up and running`:`Your assistant is already up and running`}),(0,K.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,K.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,K.jsxs)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:[`Keep `,o,` and start chatting`,(0,K.jsx)(U,{className:`h-4 w-4`})]}),(0,K.jsxs)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:n,className:`h-11 text-base`,children:[`Start over and rebuild `,s,` personality`]})]})]})]})}var la=4e3;function ua(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobby:e.hobbies.join(`, `),timezone:N()}}function da(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}ot();function fa(){let e=i(),t=ce.use.user(),n=t?.id??null,r=Xe.use.enterFocus(),o=Xe.use.exitFocus(),s=Xe.use.setPendingAvatarTraits(),c=Xe.use.requestSidebarCollapse(),[l,u]=(0,G.useState)(`form`),{ref:d,size:f}=Xn(),[p,m]=(0,G.useState)([]),[h,g]=(0,G.useState)(!1);function _(e){u(e)}function v(e,t=`completed`){Ze(et[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,G.useState)(null),w=(0,G.useRef)(null),[T,E]=(0,G.useState)(null),[ee,O]=(0,G.useState)(null),k=(0,G.useRef)(!1),[A,j]=(0,G.useState)(null),[ne,re]=(0,G.useState)({}),[ie,oe]=(0,G.useState)(!1),[M,se]=(0,G.useState)(null),[le,ue]=(0,G.useState)(null),[de,fe]=(0,G.useState)(!1),[me,N]=(0,G.useState)(!1),[_e,P]=(0,G.useState)(!1),[Se,Ce]=(0,G.useState)(0),[we,Te]=(0,G.useState)(0),[Ee]=a(),F=rn({hostingParam:Ee.get(`hosting`),localMode:te(),gatewayAuthSession:D()}),De=Ee.get(`assistant`)??void 0,Oe=F,{start:ke,ready:Ae,assistantId:I,error:je,awaitReady:L}=un({adoptExisting:F,adoptAssistantId:De}),R=Pn(),{start:z,hydrate:Me}=R,Ne=(0,G.useRef)(Promise.resolve()),Pe=(0,G.useRef)(Promise.resolve()),[B,Fe]=(0,G.useState)(!1),Ie=R.status===`idle`||R.status===`running`,Le=!Ie&&R.claims.length===0;(0,G.useEffect)(()=>{o(),s(null),ke()},[o,s,ke]),(0,G.useEffect)(()=>{if(w.current)return;let e=L().then(e=>sa(e)).catch(()=>oa);w.current=e,e.then(E)},[L]),(0,G.useLayoutEffect)(()=>{if(h||!n)return;let e=ye(n);if(e?.formValues){C(e.formValues),j(e.faceValues),ue(e.checkinTime),N(e.checkinBooked),se(e.researchConversationId??null),e.research&&Me({...e.research,pluginCatalog:e.research.pluginCatalog??{}},L);let t=be(e);u(Oe&&(t===`letschat`||t===`meeting`)?`looking`:t),m([])}g(!0)},[h,n,Me,L,Oe]),(0,G.useEffect)(()=>{!h||!S||ve(n,{step:l,formValues:S,faceValues:A,checkinTime:le,checkinBooked:me,research:R.status===`done`?{status:`done`,claims:R.claims,suggestions:R.suggestions,installedPlugins:R.installedPlugins,pluginCatalog:R.pluginCatalog}:null,...M?{researchConversationId:M}:{}})},[h,n,l,S,A,le,me,M,R.status,R.claims,R.suggestions,R.installedPlugins,R.pluginCatalog]),(0,G.useEffect)(()=>{h&&(!S||R.status!==`idle`||z({awaitAssistantId:L,subject:ua(S),conversationTitle:da(S),...M?{resumeConversationId:M}:{},onConversationCreated:se,includeSuggestions:!1}))},[h,S,M,R.status,z,L,!0]),(0,G.useEffect)(()=>{l===`results`&&Le&&(m([]),u(`suggestions`))},[l,Le]);function Re(t,i,a,{skip:o=!1,hidden:l=!1}={}){xe(n);let{firstName:u,lastName:d,role:f,hobbies:p}=t,m=[u.trim(),d.trim()].filter(Boolean).join(` `),h=u.trim(),g=!o&&a===void 0;ge({tools:[],tasks:[],tone:lt,...m?{userName:m}:{},...f.trim()?{occupation:f.trim()}:{},...o?{}:{initialMessage:a??nn({firstName:u,lastName:d,occupation:f,hobby:p.join(`, `)}),...l?{initialMessageHidden:!0}:{}},...g?{title:h?`Getting to know ${h}`:`Getting to know you`}:{},...i?.name?.trim()?{assistantName:i.name.trim()}:{}});let _=i?.name?.trim();_&&he(_),s(i?.traits??null),g&&r(),o||ae.markExpectingFirstMessage(),c(),ae.checkAssistant(I??void 0).finally(()=>{e(`${pe.assistant}?onboarding=1`,{replace:!0})})}async function ze(){S&&(await Promise.all([R.awaitPluginInstalls(),Ne.current,Pe.current]),Re(S,A,Kn(A?.name),{hidden:!0}))}function Be(e){R.start({awaitAssistantId:L,subject:ua(e),conversationTitle:da(e),onConversationCreated:se,includeSuggestions:!1})}async function Ve(e){if(!k.current&&(T??await Promise.race([w.current??Promise.resolve(null),new Promise(e=>{setTimeout(()=>e(null),la)})]))?.established){O(e),v(`existing`);return}C(e),Be(e),v(`face`)}function He(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){P(!0);return}if(P(!1),I&&S){let e=[S.firstName.trim(),S.lastName.trim()].filter(Boolean).join(` `);ue(null),N(!1),fe(!0),Qe({assistantId:I,userName:e||void 0,assistantName:A?.name?.trim()||void 0}).then(e=>{e.scheduled&&(N(!0),ue(qn(e.start,e.timeZone)))}).finally(()=>fe(!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,K.jsx)(`div`,{ref:d,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,K.jsxs)(Qn,{size:f,children:[(0,K.jsx)(aa,{eyesBumpNonce:Se,peekLevel:[`looking`,`results`,`suggestions`,`finishing`].includes(l)?we:0,darkBg:e,showBottomEyes:!e&&l!==`different`}),l===`different`&&(0,K.jsx)(hi,{onContinue:()=>v(`personality`),onBack:()=>y(`intro`),onForward:x}),l===`personality`&&(0,K.jsx)(Ni,{values:ne,onValueChange:(e,t)=>re(n=>({...n,[e]:t})),locked:ie,onContinue:()=>{ie||(Fe(!0),Pe.current=Gn({awaitAssistantId:L,values:ne,userName:S?.firstName?.trim()||void 0,assistantName:A?.name?.trim()||void 0}).finally(()=>Fe(!1)),oe(!0)),v(`integration`)},onBack:()=>y(`different`),onForward:x}),l===`integration`&&(0,K.jsx)(bi,{onClaim:()=>v(Oe?`looking`:`letschat`),onBumpEyes:()=>Ce(e=>e+1),onBack:()=>y(`personality`),onForward:x}),l===`letschat`&&(0,K.jsx)(Pi,{assistantId:I,assistantReady:Ae,hatchError:je,onConnected:He,missingCalendarScope:_e,onRetry:()=>P(!1),onSkip:()=>{P(!1),v(`looking`,`skipped`)},onBack:()=>y(`integration`),onForward:x}),l===`meeting`&&(0,K.jsx)(Hi,{scheduledTime:le??void 0,awaitingTime:de,onDone:()=>v(`looking`),onBack:()=>y(`letschat`),onForward:x}),l===`looking`&&(0,K.jsx)(Yi,{onDone:()=>v(Le?`suggestions`:`results`),onBack:()=>y(Oe?`integration`:`letschat`),onAdvance:e=>Te(Math.min(e+1,4)),onForward:x,ready:!Ie}),l===`results`&&(0,K.jsx)(Zi,{claims:R.claims,loading:Ie,onContinue:e=>{M&&I&&e.length>0&&(Ne.current=In({assistantId:I,conversationId:M,removedClaims:e,rejectedAll:!1})),v(`suggestions`)},onRejectAll:()=>{M&&I&&(Ne.current=In({assistantId:I,conversationId:M,removedClaims:R.claims.map(e=>e.claim),rejectedAll:!0})),v(`suggestions`,`skipped`)},onBack:()=>y(`looking`),onForward:x}),l===`suggestions`&&(0,K.jsx)(ea,{installedPlugins:R.installedPlugins,pluginCatalog:R.pluginCatalog,onStart:async()=>{if(Ze(et.suggestions,{userId:n,outcome:`completed`}),B){m([]),u(`finishing`);return}await ze()},onBack:()=>y(Le?`looking`:`results`),onForward:x}),l===`suggestions`&&!1,l===`finishing`&&(0,K.jsx)(Xi,{ready:!B,onDone:()=>void ze()})]})})}return l===`existing`?(0,K.jsx)(ca,{assistantName:T?.assistantName??null,onKeep:()=>{Ze(et.existing,{userId:n,outcome:`completed`}),xe(n),ae.checkAssistant(I??void 0).finally(()=>{e(pe.assistant,{replace:!0})})},onRedo:()=>{let e=ee;e&&(k.current=!0,Ze(et.existing,{userId:n,outcome:`skipped`}),C(e),Be(e),m([]),_(`face`))},onBack:()=>{O(null),y(`form`)}}):l===`intro`&&S?(0,K.jsx)(Xr,{firstName:S.firstName,assistantName:A?.name,onContinue:()=>v(`different`),onBack:()=>y(`face`),onForward:x}):l===`face`&&S?(0,K.jsx)(Fr,{onContinue:e=>{j(e),v(`intro`)},onBack:()=>y(`form`),onForward:x}):(0,K.jsx)(Dr,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:Ve})}export{fa as ResearchOnboardingRoute};
63
+ 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 qn(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 K=s(),Jn={w:1280,h:800};function Yn(){return typeof window>`u`?Jn:{w:window.innerWidth,h:window.innerHeight}}function Xn(){let[e,t]=(0,G.useState)(null),[n,r]=(0,G.useState)(()=>Yn());return(0,G.useLayoutEffect)(()=>{if(!e)return;let t=()=>{let t=e.getBoundingClientRect();r({w:t.width,h:t.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),{ref:t,size:n}}var Zn=(0,G.createContext)(null);function Qn({size:e,children:t}){return(0,K.jsx)(Zn.Provider,{value:e,children:t})}function $n(){let e=(0,G.useContext)(Zn),[t,n]=(0,G.useState)(()=>Yn());return(0,G.useEffect)(()=>{if(e)return;let t=()=>n(Yn());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var er={x:.5,y:.4},tr=[-8,6,9,0,7,-6,5,0,-7,4,-5,6];function nr(e){return tr[e%tr.length]??0}var rr=[1,0,1,0,1,0,1,0,1,0,0],ir=[.72,1],ar=[.4,1],or=[10,20],sr=50;function cr(e){return ir[rr[e]??1]??1}function lr(e){return ar[rr[e]??1]??1}function ur(e){return or[rr[e]??1]??20}function dr(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function fr(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function pr(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 mr(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 hr({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=$n(),u=H(),d=c<640,f=new Set([4,7,8,9,10]),p=e=>d&&f.has(e),h=dr(c,l),g=h/2,_=h/2,v=fr(c,l)/h,y=fr(c,l),b=(0,G.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),x=er.x*c,S=er.y*l,C=x-g,w=S-g,T=(0,G.useMemo)(()=>pr(c,l,_),[c,l,_]);return(0,K.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0 overflow-hidden`,children:[(0,K.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=mr(n,x,S,c,l),s=cr(i.fromSlot),u=lr(i.fromSlot);return(0,K.jsx)(V.div,{className:`absolute left-0 top-0`,style:{width:h,height:h,zIndex:sr},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,K.jsx)(m,{components:e,traits:t,size:h})},r)}if(_){if(p(a.toSlot))return null;let n=T[a.toSlot],i=mr(n,x,S,c,l),o=cr(a.toSlot),s=lr(a.toSlot);return(0,K.jsx)(V.div,{className:`absolute left-0 top-0`,style:{width:h,height:h,zIndex:ur(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,K.jsx)(`div`,{style:{transform:`rotate(${nr(a.toSlot)}deg)`},children:(0,K.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,K.jsx)(V.div,{className:`absolute left-0 top-0 ${d?``:`pointer-events-auto cursor-pointer`}`,style:{width:h,height:h,zIndex:d?sr:ur(y)},initial:!1,animate:{x:E.x-g,y:E.y-g,scale:d?v:cr(y),opacity:d?1:lr(y)},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:d?void 0:()=>s(r),children:(0,K.jsx)(`div`,{style:{transform:d?void 0:`rotate(${nr(b.get(r)??0)}deg)`},children:(0,K.jsx)(m,{components:e,traits:t,size:h,breathe:d})})},r)})]})}var gr=[{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`}],q=T(w((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:gr,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 _r(){let[e,t]=(0,G.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,G.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function vr(){let e=W(),t=q.use.characters(),n=q.use.ensureGenerated(),r=H(),{w:i,h:a}=_r();(0,G.useEffect)(()=>{e&&n(e)},[e,n]);let o=dr(i,a),s=(0,G.useMemo)(()=>pr(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,K.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=tr[i%tr.length]??0,d=o*cr(i),f=lr(i),p=ur(i);return(0,K.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,K.jsx)(`div`,{style:{opacity:f,transform:`rotate(${u}deg)`},children:(0,K.jsx)(m,{components:e,traits:t,size:d,breathe:!1})})},n)})})}var yr=c(`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)]`),br=c(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`,ct);function J(e){return e.trim().toLowerCase()}function xr(e,t,n=[],r=8){let i=J(t),a=new Set(n.map(J)),o=[];for(let t of e)if(!a.has(J(t))&&((i.length===0||J(t).includes(i))&&o.push(t),o.length>=r))break;return o}function Sr({id:e,options:t,highlighted:n,showAddHint:r,onPick:i,onHover:a}){return(0,K.jsxs)(`ul`,{id:e,role:`listbox`,className:c(`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,K.jsx)(`li`,{id:`${e}-opt-${r}`,role:`option`,"aria-selected":r===n,onMouseDown:e=>{e.preventDefault(),i(t.value)},onMouseEnter:()=>a(r),className:c(`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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(_,{size:15,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,K.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Add “`,t.value,`”`]}),(0,K.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,K.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 Cr({htmlFor:e,required:t,children:n}){return(0,K.jsxs)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:[n,t?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`}):null]})}function wr(e,t){(0,G.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function Tr({label:e,placeholder:t,values:n,onChange:r,suggestions:i}){let a=(0,G.useId)(),o=`tac-${a}`,s=`tac-list-${a}`,l=(0,G.useRef)(null),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(!1),[m,h]=(0,G.useState)(-1),g=(0,G.useMemo)(()=>xr(i,u,n),[i,u,n]),_=u.trim(),v=(0,G.useMemo)(()=>{if(!_)return!1;let e=J(_);return!(n.some(t=>J(t)===e)||g.some(t=>J(t)===e))},[_,n,g]),b=(0,G.useMemo)(()=>{let e=g.map(e=>({value:e,isAdd:!1}));return v?[...e,{value:_,isAdd:!0}]:e},[g,v,_]);wr(l,()=>p(!1)),(0,G.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=>J(e)===J(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,K.jsxs)(`div`,{ref:l,className:`relative flex flex-col gap-1.5`,children:[(0,K.jsx)(Cr,{htmlFor:o,children:e}),(0,K.jsxs)(`div`,{className:c(yr,`min-h-9 flex-wrap py-1.5`),children:[(0,K.jsx)(Xe,{size:16,"aria-hidden":!0,className:`shrink-0 self-center text-[var(--content-tertiary)]`}),n.map(e=>(0,K.jsx)(y,{onRemove:()=>w(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,K.jsx)(`input`,{id:o,role:`combobox`,"aria-expanded":x,"aria-controls":s,"aria-autocomplete":`list`,"aria-activedescendant":m>=0?`${s}-opt-${m}`:void 0,autoComplete:`off`,className:c(br,`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,K.jsx)(Sr,{id:s,options:b,highlighted:m,showAddHint:S,onPick:C,onHover:h})]})}var Er=`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 Y(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function Dr({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[i,a]=(0,G.useState)(e),[o,s]=(0,G.useState)(t),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)([]),f=i.trim().length>0&&c.trim().length>0;function p(){f&&n({firstName:i,lastName:o,role:c,hobbies:u})}return(0,K.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,K.jsxs)(it,{showCreatureFooter:!1,children:[(0,K.jsx)(vr,{}),(0,K.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,K.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:Y(.05),children:`Let's start with you.`}),(0,K.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:Y(.12),children:`A few details so I can get to know you.`}),(0,K.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,K.jsx)(`div`,{style:Y(.2,40),children:(0,K.jsx)(b,{label:(0,K.jsxs)(K.Fragment,{children:[`What should I call you?`,(0,K.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`})]}),placeholder:`Your name`,value:i,onChange:e=>a(e.target.value),className:ct,autoFocus:!0,required:!0,fullWidth:!0})}),(0,K.jsx)(`div`,{style:Y(.27,30),children:(0,K.jsx)(b,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),className:ct,fullWidth:!0})}),(0,K.jsx)(`div`,{style:Y(.34,20),children:(0,K.jsx)(b,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:e=>l(e.target.value),className:ct,required:!0,fullWidth:!0})}),(0,K.jsx)(`div`,{style:Y(.41,10),children:(0,K.jsx)(Tr,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:u,onChange:d,suggestions:Er})})]}),(0,K.jsx)(`div`,{className:`mt-10 w-full`,style:Y(.5),children:(0,K.jsx)(r,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{size:16}),fullWidth:!0,disabled:!f,className:`h-11 text-base`,children:`Continue`})})]})]})})}var Or=`#1A1A1A`,kr=`#FFFFFF`;function Ar(e){let t=/^#?([0-9a-f]{6})$/i.exec(e);if(!t)return 0;let n=parseInt(t[1],16),r=n>>16&255,i=n>>8&255,a=n&255;return(r*299+i*587+a*114)/1e3/255}function jr(e,t){let n=/^#?([0-9a-f]{6})$/i.exec(e);if(!n)return e;let r=parseInt(n[1],16),i=e=>Math.max(0,Math.min(255,Math.round((r>>e&255)*t)));return`#${(1<<24|i(16)<<16|i(8)<<8|i(0)).toString(16).slice(1)}`}function Mr(e){let t=Ar(e)>.6;return{bg:e,isLight:t,fg:t?Or:kr,fgDeep:jr(e,.6),fgMuted:t?`rgba(0,0,0,0.6)`:`rgba(255,255,255,0.65)`,wash:t?`rgba(0,0,0,0.08)`:`rgba(255,255,255,0.12)`}}function X(){let e=W(),t=q.use.characters(),n=q.use.selectedIndex();return(0,G.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return Mr(i??`var(--surface-base)`)},[e,t,n])}function Z({onBack:e,onNext:t,tone:n}){let r=X(),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,K.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,K.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,K.jsx)(u,{className:`h-5 w-5`})}),t?(0,K.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,K.jsx)(d,{className:`h-5 w-5`})}):null]})}var Nr=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function Pr(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function Fr({onContinue:e,onBack:t,onForward:n}){let i=W(),a=q.use.characters(),o=q.use.ensureGenerated(),s=q.use.selectedIndex(),c=q.use.setSelectedIndex();(0,G.useEffect)(()=>{i&&o(i)},[i,o]);let u=a.length,[d,f]=(0,G.useState)(null),[m,h]=(0,G.useState)(``),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(!1),b=(0,G.useRef)(null),{ref:x,size:S}=Xn(),[C,w]=(0,G.useState)(null);(0,G.useEffect)(()=>{u>0&&d===null&&f(Pr(u,s))},[u,s,d]),(0,G.useEffect)(()=>{d&&c(d.centerChar)},[d,c]);let T=d?.centerChar;(0,G.useEffect)(()=>{T!=null&&!y.current&&h(Nr[T%Nr.length])},[T]),(0,G.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)%u),ee=()=>d&&E((d.centerChar-1+u)%u),te=(0,G.useMemo)(()=>d?a[d.centerChar]:void 0,[d,a]),O=!!i&&!!d&&!!te;function k(){te&&e({traits:te,name:m.trim()})}function A(){y.current=!0,h(e=>{let t=Nr.filter(t=>t!==e),n=t.length>0?t:Nr;return n[Math.floor(Math.random()*n.length)]})}let j=`pointer-events-auto z-10 flex cursor-pointer h-10 w-10 items-center justify-center rounded-full bg-[color-mix(in_srgb,var(--content-default)_10%,transparent)] text-[var(--content-default)] transition-colors duration-150 hover:bg-[color-mix(in_srgb,var(--content-default)_18%,transparent)]`;return(0,K.jsx)(`div`,{ref:x,"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,K.jsxs)(Qn,{size:S,children:[O&&(0,K.jsx)(hr,{components:i,characters:a,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,K.jsx)(Z,{tone:`light`,onBack:t,onNext:n?k:void 0}),(0,K.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,K.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:ee,className:`absolute left-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${j}`,children:(0,K.jsx)(l,{className:`h-4 w-4`})}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:D,className:`absolute right-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${j}`,children:(0,K.jsx)(U,{className:`h-4 w-4`})}),(0,K.jsxs)(`div`,{className:`absolute left-1/2 top-[51%] z-10 flex -translate-x-1/2 flex-col items-center gap-12`,children:[_?(0,K.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,K.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>v(!0),"aria-label":`Edit name`,className:`flex cursor-pointer items-center gap-2.5`,children:[(0,K.jsx)(`span`,{className:`text-3xl font-medium ${m?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:m||`Name your assistant`}),(0,K.jsx)(g,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:A,"aria-label":`Shuffle name`,title:`Shuffle name`,className:`cursor-pointer text-[var(--content-tertiary)] transition-[transform,color] duration-300 hover:rotate-180 hover:text-[var(--content-default)]`,children:(0,K.jsx)(p,{className:`h-5 w-5`})})]}),(0,K.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{size:16}),disabled:!O,onClick:k,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})})}var Ir=/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,Lr=/[MmLlHhVvCcSsQqTtAaZz][^MmLlHhVvCcSsQqTtAaZz]*/g;function Rr(e){let t=1/0,n=1/0,r=-1/0,i=-1/0,a=0,o=0,s=(e,a)=>{e<t&&(t=e),a<n&&(n=a),e>r&&(r=e),a>i&&(i=a)},c=e.match(Lr)??[];for(let e of c){let t=e[0],n=t.toUpperCase();if(n===`Z`)continue;let r=t!==n,i=(e.slice(1).match(Ir)??[]).map(Number);if(n===`H`)for(let e of i)a=r?a+e:e,s(a,o);else if(n===`V`)for(let e of i)o=r?o+e:e,s(a,o);else if(n===`A`)for(let e=0;e+7<=i.length;e+=7){let t=i[e+5],n=i[e+6];a=r?a+t:t,o=r?o+n:n,s(a,o)}else{let e=a,t=o;for(let n=0;n+2<=i.length;n+=2){let c=r?e+i[n]:i[n],l=r?t+i[n+1]:i[n+1];s(c,l),n+2>=i.length-i.length%2&&(a=c,o=l)}}}return t===1/0?{x:0,y:0,w:0,h:0}:{x:t,y:n,w:r-t,h:i-n}}function zr(e){let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.w)),i=Math.max(...e.map(e=>e.y+e.h));return{x:t,y:n,w:r-t,h:i-n}}var Br=.25,Vr=.46,Hr=.3,Ur=.85,Wr=40,Gr=14,Kr=8;function qr({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0,settleBlink:r=!0}){let i=W(),a=q.use.characters(),o=q.use.selectedIndex(),s=H(),{w:c,h:l}=$n(),[u,d]=(0,G.useState)({x:0,y:0});(0,G.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=$t();(0,G.useEffect)(()=>{n>0&&!s&&p.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,s,p]);let[m,h]=(0,G.useState)(!1),[g,_]=(0,G.useState)(!e);(0,G.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,G.useMemo)(()=>{if(!i||!v)return null;let e=i.eyeStyles.find(e=>e.id===v.eyeStyle);return e?{paths:e.paths,bbox:zr(e.paths.map(e=>Rr(e.svgPath)))}:null},[i,v]);if(!y)return null;let b=c*Ur,x=Math.min(Math.min(c,l)*Hr,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,C=(c-S)/2,w=l-(1-Br)*x,T=Wr/100*l-(w+x/2),E=(Vr-Br)*x,D=y.bbox.x+y.bbox.w/2,ee=y.bbox.y+y.bbox.h/2;return(0,K.jsx)(V.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,K.jsx)(V.div,{animate:p,children:(0,K.jsx)(`div`,{style:{transform:`translate(${u.x*Gr}px, ${u.y*Kr}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,K.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,K.jsx)(`g`,{style:{transform:m?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${D}px ${ee}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,K.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}var Jr=200,Yr=40;function Xr({firstName:e,assistantName:t,onContinue:n,onBack:i,onForward:a}){let o=W(),s=q.use.characters(),c=q.use.selectedIndex(),l=H(),{ref:u,size:{w:d,h:f}}=Xn(),p=X(),m=s.length>0?s[c]:void 0,h=(0,G.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,K.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=Jr/v,C=(Yr/100-.5)*f;return(0,K.jsx)(`div`,{ref:u,"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:(0,K.jsxs)(Qn,{size:{w:d,h:f},children:[(0,K.jsx)(V.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,K.jsx)(V.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,K.jsx)(`path`,{d:h.body.svgPath,fill:h.color})}),(0,K.jsx)(qr,{entrance:!0}),(0,K.jsx)(V.div,{initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.4,delay:1},children:(0,K.jsx)(Z,{onBack:i,onNext:a})}),(0,K.jsxs)(`div`,{className:st,children:[(0,K.jsxs)(V.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,K.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fgDeep},children:g}),(0,K.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fg},children:_})]}),(0,K.jsx)(V.div,{initial:l?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.4,delay:1.15},children:(0,K.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{size:16}),onClick:n,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})})}var Zr=.3,Qr=.85,$r=.25;function ei(){let e=W(),t=q.use.characters(),n=q.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=$n(),o=(0,G.useMemo)(()=>{if(!e||!r)return null;let t=e.eyeStyles.find(e=>e.id===r.eyeStyle);return t?{paths:t.paths,bbox:zr(t.paths.map(e=>Rr(e.svgPath)))}:null},[e,r]),s=o?Math.min(Math.min(i,a)*Zr,i*Qr*o.bbox.h/o.bbox.w):0;return{art:o,eyesW:o?s*o.bbox.w/o.bbox.h:0,eyesH:s,restCy:a-$r*s,centerX:i/2,w:i,h:a}}function ti({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=xt(i,e=>e-n/2),u=e.bbox.x+e.bbox.w/2,d=e.bbox.y+e.bbox.h/2;return(0,K.jsx)(V.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,K.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,K.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,K.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})}var ni={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 ri(e,t){let n=ni[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var ii=new Set([`orange`,`pink`,`red`]);function ai(e,t){return ii.has(e)&&ii.has(t)}function oi(e,t,n){let r=ri(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>ai(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var si=`You’ve used AI that just answers questions`,ci=`The more I help`,li=`I’m different`,ui=`The better I get`,di=`and the less you have to do`,fi=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],pi=290;function mi({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,K.jsx)(V.div,{className:`relative w-full overflow-hidden`,initial:!1,animate:{height:o?t:e},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:(0,K.jsxs)(V.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,K.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:e},children:(0,K.jsx)(V.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,K.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:t},children:(0,K.jsx)(`span`,{className:`block`,children:i})})]})})}function hi({onContinue:e,onBack:t,onForward:n}){let i=X(),a=H(),{art:o,eyesW:s,eyesH:c,restCy:l,centerX:u,w:d,h:f}=ei(),p=W(),h=q.use.characters(),g=q.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=vt(0),S=vt(1),C=(0,G.useMemo)(()=>!p||!_?`orange`:oi(_.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=vt(-220),ee=(0,G.useMemo)(()=>!p||!_?[]:oi(_.color,p.colors.map(e=>e.id),3),[p,_]),te=Math.max(.42,Math.min(d/1100,1)),O=Math.round(pi*te),k=-O*1.1,A=-O*.42,j=vt(-320),[ne,re]=(0,G.useState)(!!a),[ie,ae]=(0,G.useState)(!!a),[oe,M]=(0,G.useState)(!1),[se,ce]=(0,G.useState)(!1),[le,ue]=(0,G.useState)(!1),[de,fe]=(0,G.useState)(!1),[pe,me]=(0,G.useState)(!!a),he=Math.min(d,768)-48,ge=(0,G.useRef)(null),N=(0,G.useRef)(null),_e=(0,G.useRef)(null),ve=(0,G.useRef)(null),ye=(0,G.useRef)(null),[be,xe]=(0,G.useState)(0),[P,Se]=(0,G.useState)(0),[Ce,we]=(0,G.useState)(0),[Te,Ee]=(0,G.useState)(0),[F,De]=(0,G.useState)(0);return(0,G.useLayoutEffect)(()=>{ge.current?.offsetHeight&&xe(ge.current.offsetHeight),N.current?.offsetHeight&&Se(N.current.offsetHeight),_e.current?.offsetHeight&&we(_e.current.offsetHeight),ve.current?.offsetHeight&&Ee(ve.current.offsetHeight),ye.current?.offsetHeight&&De(ye.current.offsetHeight)},[he]),(0,G.useEffect)(()=>{x.set(l),fe(!0)},[l,x]),(0,G.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{M(!0),ce(!0),ue(!0)},1400);return()=>clearTimeout(e)},[a]),(0,G.useEffect)(()=>{if(a||!o)return;x.set(l),S.set(1),D.set(T),j.set(k),re(!1),ae(!1),M(!1),ce(!1);let e=Math.max(c*.5,f*y-36),t=[],n=[],r=!1,i=e=>(t.push(e),e),s=e=>new Promise(t=>{n.push(setTimeout(t,e))});return(async()=>{if(await s(200),r||(re(!0),await Promise.all([i(Qt(x,e,{duration:.55,ease:`easeOut`})),i(Qt(S,.55,{duration:.55,ease:`easeOut`}))]),r)||(ae(!0),await Promise.all([i(Qt(x,l,{type:`spring`,stiffness:210,damping:15})),i(Qt(S,1,{duration:.45,ease:`easeOut`}))]),r)||(await s(900),r)||(M(!0),ce(!0),await i(Qt(D,[T,E,E,T],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`})),r)||(await s(150),r))return;ue(!0);let t=i(Qt(j,[k,A,A,k],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`}));await s(700),!r&&(me(!0),await t)})(),()=>{r=!0,t.forEach(e=>e.stop()),n.forEach(clearTimeout)}},[a,o,f,y,c,l,x,S,D,T,E,j,k,A]),(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:i.fg},children:[(0,K.jsx)(Z,{onBack:t,onNext:n}),(0,K.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:he,fontFamily:`var(--font-serif)`},children:[(0,K.jsx)(`span`,{ref:ge,className:`block`,children:si}),(0,K.jsx)(`span`,{ref:N,className:`block`,children:ci}),(0,K.jsx)(`span`,{ref:_e,className:`block`,children:li}),(0,K.jsx)(`span`,{ref:ve,className:`block`,children:ui}),(0,K.jsx)(`span`,{ref:ye,className:`block`,children:di})]}),de&&o&&(0,K.jsx)(ti,{art:o,eyesW:s,eyesH:c,centerX:u,eyeCy:x,eyeScale:S,blinking:!1}),!a&&p&&(0,K.jsx)(V.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,K.jsx)(m,{components:p,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:C},size:w,breathe:!1})}),!a&&p&&(0,K.jsx)(V.div,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 top-0 z-[1] flex items-start`,style:{right:-Math.round(O*.12),y:j},children:fi.map((e,t)=>(0,K.jsx)(`div`,{style:{width:O,height:O,marginLeft:t===0?0:-O*.34,zIndex:fi.length-t},children:(0,K.jsx)(m,{components:p,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:ee[t]??`teal`},size:O,breathe:!1})},e.bodyShape))}),(0,K.jsxs)(`div`,{className:`${st.replace(`top-[30%]`,b)} max-w-3xl`,children:[(0,K.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,K.jsx)(mi,{firstH:be,secondH:P,color:i.fgDeep,firstText:si,secondText:ci,revealed:ne,carouseled:oe,revealFrom:`bottom`,revealDuration:.55,reduce:!!a}),(0,K.jsx)(mi,{firstH:Ce,secondH:Te,color:i.fg,firstText:li,secondText:ui,revealed:ie,carouseled:se,revealFrom:`top`,revealDuration:.45,reduce:!!a}),(0,K.jsx)(V.div,{className:`relative w-full overflow-hidden`,style:{color:i.fg},initial:!1,animate:{height:le?F:0},transition:a?{duration:0}:{duration:.5,ease:`easeInOut`},children:F>0&&(0,K.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:F},children:(0,K.jsx)(V.span,{className:`block`,initial:!1,animate:{clipPath:le?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:a?{duration:0}:{duration:.5,ease:`easeOut`},children:di})})})]}),pe&&(0,K.jsx)(V.div,{initial:a?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:a?{duration:0}:{duration:.4},children:(0,K.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{size:16}),onClick:e,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})}function gi({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cs-${e}`;return(0,K.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,K.jsxs)(`defs`,{children:[(0,K.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,K.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,K.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,K.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,K.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,K.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,K.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,K.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,K.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,K.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,K.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,children:[(0,K.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,K.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,K.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#F4C12A`,children:`$`})]}),(0,K.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,K.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${i})`})]})}function _i({size:e,tiltX:t=0,tiltY:n=0,shadow:r=!0,spinning:i=!1,className:a}){return(0,K.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[r&&(0,K.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,K.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,K.jsxs)(V.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,K.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(0.5px)`},children:(0,K.jsx)(gi,{idSuffix:`front`})}),(0,K.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,K.jsx)(gi,{idSuffix:`back`})})]})})]})}var vi=.3,yi=.95;function bi({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=H(),a=X(),{h:o}=$n(),[s,c]=(0,G.useState)(!1);function l(){if(!s){if(c(!0),i){e();return}window.setTimeout(t,vi*1e3)}}let u=o*.42,d=-o*.08,f=o*.9;return(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,K.jsx)(Z,{onBack:n,onNext:r}),(0,K.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,K.jsx)(`h1`,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here are some free credits to get started`}),(0,K.jsx)(`div`,{className:`mt-8 flex flex-col items-center gap-4`,children:(0,K.jsx)(V.div,{animate:s&&!i?{y:[0,u,d,f],scale:[1,1,1,.2],opacity:[1,1,1,0]}:{},transition:{duration:yi,times:[0,vi/yi,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]},onAnimationComplete:()=>{s&&e()},children:(0,K.jsx)(_i,{size:88,spinning:s&&!i})})}),!s&&(0,K.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,K.jsx)(U,{className:`h-4 w-4`})]})]})]})}ot();var xi=640,Si=[{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`}}],Ci=[`9%`,`27%`,`45%`,`62%`,`79%`],Q=50,wi=.3*.75,Ti=`rgba(36, 41, 46, 0.2)`,Ei=`#FDFDFC`,Di=.16;function Oi(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 ki(){let[e,t]=(0,G.useState)(()=>typeof window>`u`?1280:window.innerWidth);return(0,G.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Ai({components:e,traits:t,side:n,top:r,size:i,progress:a}){let o=Math.max(0,Math.min(1,a)),s=100+Di*100,c=n===`left`?-100+s*o:100-s*o;return(0,K.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,K.jsx)(m,{components:e,traits:t,size:i,breathe:!1})})}function ji({axis:e,value:t,onValueChange:n,fg:r,disabled:i}){return(0,K.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,K.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,K.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,K.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]??Q),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,K.jsx)(x,{className:`relative h-2 w-full grow rounded-full sm:h-3`,style:{backgroundColor:Ti}}),(0,K.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:Ei}})]})]})}function Mi({components:e,values:t,sideAvatars:n,size:r}){return(0,K.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10`,children:Si.map((i,a)=>{let o=t[i.id]??Q,s=Math.max(0,(Q-o)/Q),c=Math.max(0,(o-Q)/Q),l=Ci[a]??`50%`,u=n[a];return u?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Ai,{components:e,traits:u.left,side:`left`,top:l,size:r,progress:s}),(0,K.jsx)(Ai,{components:e,traits:u.right,side:`right`,top:l,size:r,progress:c})]},i.id):null})})}function Ni({values:e,onValueChange:t,locked:n,onContinue:r,onBack:i,onForward:a}){let o=X(),s=W(),c=ki(),{w:l,h:u}=$n(),d=Math.round(wi*Math.min(l,u))+12,f=c>=xi,p=q.use.characters()[q.use.selectedIndex()]?.color,m=Math.round(Math.min(300,Math.max(160,c*.16))),h=(0,G.useMemo)(()=>{let e=s?.colors.map(e=>e.id)??[],t=Oi(Si.map(e=>e.leftAvatar.color),p,e),n=Oi(Si.map(e=>e.rightAvatar.color),p,e);return Si.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,K.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:o.fg},children:[(0,K.jsx)(Z,{onBack:i,onNext:a}),f&&s&&(0,K.jsx)(Mi,{components:s,values:e,sideAvatars:h,size:m}),(0,K.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,K.jsx)(`div`,{className:`w-full min-h-14 shrink-[4]`,style:{flexBasis:Math.round(u*.14)}}),(0,K.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2`,children:[(0,K.jsx)(`h1`,{className:`text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Create my personality`}),n?(0,K.jsx)(`p`,{className:`text-center text-[15px]`,style:{color:o.fgMuted},children:`Personality locked — chat with your assistant to make any more updates`}):(0,K.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,K.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-10`}),Si.map((r,i)=>(0,K.jsxs)(G.Fragment,{children:[i>0&&(0,K.jsx)(`div`,{className:`w-full min-h-2.5 shrink basis-8 sm:basis-11`}),(0,K.jsx)(ji,{axis:r,value:e[r.id]??Q,onValueChange:e=>t(r.id,e),fg:o.fg,disabled:n})]},r.id)),(0,K.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-14`}),(0,K.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,K.jsx)(U,{className:`h-4 w-4`})]})]})]})}function Pi({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a,missingCalendarScope:o=!1,onRetry:s,hatchError:c=null}){let l=X(),{handleConnect:u,oauthInProgress:d}=rt({assistantId:e??``,onConnect:n}),f=()=>{s?.(),u()},p=!e||!t,m=p||d;return(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:l.fg},children:[(0,K.jsx)(Z,{onBack:i,onNext:a}),(0,K.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,K.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,K.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,K.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-4`,children:[(0,K.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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):d?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(!p||c)&&(0,K.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 Fi=Mr(`#17191C`);function Ii(){let[e,t]=(0,G.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,G.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Li(){let e=W(),t=q.use.characters(),n=q.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function Ri({size:e=64,isAssistantBusy:t=!1}){let{components:n,chosen:r}=Li();return!n||!r?(0,K.jsx)(`div`,{style:{width:e,height:e}}):(0,K.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,K.jsx)(m,{components:n,traits:r,size:e,isAssistantBusy:t})})}var zi=64,Bi=4500,Vi=7e3;function Hi({onDone:e,onBack:t,onForward:n,scheduledTime:r,awaitingTime:i}){let{components:a,chosen:o}=Li(),s=H(),{w:c,h:l}=Ii(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,G.useEffect)(()=>{let t=setTimeout(e,i&&!r?Vi:Bi);return()=>clearTimeout(t)},[e,i,r]);let d=(0,G.useRef)(null),[f,p]=(0,G.useState)(null);(0,G.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)/zi,g=f?c/2-f.cx:0,_=f?l*.88-f.cy:0,v=l*.05;return(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,K.jsx)(Z,{onBack:t,onNext:n,tone:`light`}),(0,K.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,K.jsx)(`div`,{ref:d,className:`relative shrink-0`,style:{width:zi,height:zi},children:a&&o&&f&&(0,K.jsx)(V.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,K.jsx)(m,{components:a,traits:o,size:zi})})}),(0,K.jsx)(V.span,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:s?!1:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:s?{duration:0}:{duration:.4,delay:.9},children:u})]})]})}var Ui=[`Searching the web to get to know you…`,`Reading public profiles…`,`Skimming the highlights…`,`Connecting the dots…`,`Piecing it together…`],Wi=[`Updating my personality…`,`Finding my voice…`,`Getting into character…`],Gi=`Almost there…`,Ki=[...Ui,Gi],qi=[...Wi,Gi],Ji=2800;function Yi({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i}){let a=Fi,[o,s]=(0,G.useState)(0);return(0,G.useEffect)(()=>{n?.(o);let t=o>=Ki.length-1;if(i&&t){let t=setTimeout(e,Ji);return()=>clearTimeout(t)}let r=setTimeout(()=>s(e=>(e+1)%Ki.length),Ji);return()=>clearTimeout(r)},[o,i,e,n]),(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,K.jsx)(Z,{onBack:t,onNext:r}),(0,K.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,K.jsx)(Ri,{isAssistantBusy:!0}),(0,K.jsx)(Ye,{mode:`wait`,children:(0,K.jsx)(V.p,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Ki[o]},o)})]})]})}function Xi({onDone:e,ready:t}){let n=Fi,[r,i]=(0,G.useState)(0);return(0,G.useEffect)(()=>{let n=qi.length-1;if(t){if(r!==n){i(n);return}let t=setTimeout(e,Ji);return()=>clearTimeout(t)}let a=setTimeout(()=>i(e=>(e+1)%qi.length),Ji);return()=>clearTimeout(a)},[r,t,e]),(0,K.jsx)(`div`,{className:`absolute inset-0 z-10`,style:{color:n.fg},children:(0,K.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,K.jsx)(Ri,{isAssistantBusy:!0}),(0,K.jsx)(Ye,{mode:`wait`,children:(0,K.jsx)(V.p,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:qi[r]},r)})]})})}function Zi({claims:e,loading:t,onContinue:n,onRejectAll:r,onBack:i,onForward:a}){let o=Fi,s=H(),[c,l]=(0,G.useState)(()=>new Set),u=e.filter(e=>!c.has(e.claim)),d=u.length>0,f=!t;return(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,K.jsx)(Z,{onBack:i,onNext:a}),(0,K.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,K.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-y-auto`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(Ri,{}),(0,K.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`This is what I found about you`})]}),(0,K.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,K.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,K.jsx)(Ye,{children:u.map(e=>(0,K.jsxs)(V.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,K.jsx)(`span`,{children:e.claim}),(0,K.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,K.jsx)(v,{className:`h-4 w-4`})})]},e.claim))})}),d&&f&&(0,K.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,K.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,K.jsx)(U,{className:`h-4 w-4`})]})]})]})}var $=64,Qi=$;function $i({head:e,note:t,flyToNote:n,reduce:r,onLanded:i}){let{components:a,chosen:o}=Li();if(!a||!o)return null;let s=$/2,c=n&&t?t:e,l={x:c.x-s,y:c.y-s};return(0,K.jsx)(V.div,{className:`pointer-events-none absolute left-0 top-0`,style:{width:$,height:$,transformOrigin:`center`},initial:!1,animate:l,transition:r?{duration:0}:n&&t?{type:`spring`,duration:.9,bounce:.45}:{duration:.4},onAnimationComplete:()=>{n&&t&&i()},children:(0,K.jsx)(m,{components:a,traits:o,size:$})})}function ea({installedPlugins:e=[],pluginCatalog:t={},onStart:n,onBack:r,onForward:i}){let a=Fi,o=H(),[s,c]=(0,G.useState)(!1),l=e.map(e=>({name:e,displayName:at(e),description:t[e]?.trim()??``})).filter(e=>e.displayName.length>0),u=l.length>0,d=(0,G.useRef)(null),f=(0,G.useRef)(null),p=(0,G.useRef)(null),[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(!1);(0,G.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,G.useEffect)(()=>{b===void 0||g||_(!0)},[b,g]),(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,K.jsx)(Z,{onBack:r,onNext:i}),(0,K.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,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(V.div,{ref:f,className:`shrink-0`,style:{height:$},initial:!1,animate:g?{width:0,marginRight:0}:{width:$,marginRight:12},transition:o?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,K.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`You’re all set`})]}),u&&(0,K.jsx)(`div`,{className:`mt-4 flex flex-col gap-3`,children:l.map((e,t)=>(0,K.jsxs)(V.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,K.jsx)(`div`,{className:`text-[15px] font-medium`,children:e.displayName}),e.description&&(0,K.jsx)(`div`,{className:`mt-1 text-[13px] leading-snug`,style:{color:a.fgMuted},children:e.description})]},e.name))}),(0,K.jsxs)(`div`,{className:`mt-16 flex items-center gap-3`,children:[(0,K.jsx)(`div`,{ref:p,className:`shrink-0`,style:{width:Qi}}),(0,K.jsx)(V.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,K.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,K.jsx)(U,{className:`h-4 w-4`})]}),m&&(0,K.jsx)($i,{head:m.head,note:m.note,flyToNote:g&&m.note!==void 0,reduce:o,onLanded:()=>y(!0)})]})]})}var ta=[{bodyShape:`sprout`,eyeStyle:`curious`,colorIdx:0,base:230,pos:e=>({left:-e*.32,top:`40%`})},{bodyShape:`flower`,eyeStyle:`goofy`,colorIdx:1,base:230,pos:e=>({right:-e*.32,top:`40%`})},{bodyShape:`star`,eyeStyle:`dazed`,colorIdx:2,base:240,mobile:!0,pos:e=>({left:`16%`,bottom:-e*.42}),mobilePos:e=>({left:-e*.3,bottom:-e*.3})},{bodyShape:`burst`,eyeStyle:`angry`,colorIdx:0,base:240,mobile:!0,pos:e=>({right:`16%`,bottom:-e*.42}),mobilePos:e=>({right:-e*.3,bottom:-e*.3})},{bodyShape:`blob`,eyeStyle:`gentle`,colorIdx:1,base:220,pos:e=>({left:`42%`,bottom:-e*.5})},{bodyShape:`urchin`,eyeStyle:`curious`,colorIdx:2,base:220,mobile:!0,pos:e=>({left:-e*.28,bottom:`16%`}),mobilePos:e=>({left:-e*.3,top:-e*.3})},{bodyShape:`burst`,eyeStyle:`quirky`,colorIdx:0,base:220,mobile:!0,pos:e=>({right:-e*.28,bottom:`16%`}),mobilePos:e=>({right:-e*.3,top:-e*.3})},{bodyShape:`flower`,eyeStyle:`quirky`,colorIdx:1,base:230,pos:e=>({left:`30%`,bottom:-e*.4})}],na=`#17191C`,ra=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ia=290;function aa({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0,showTopTeam:i=!1}){let a=W(),o=q.use.characters(),s=q.use.selectedIndex(),c=H(),{w:l}=$n(),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,G.useMemo)(()=>!a||!f?{bg:`var(--surface-base)`,peekColors:[]}:{bg:a.colors.find(e=>e.id===f.color)?.hex??`var(--surface-base)`,peekColors:oi(f.color,a.colors.map(e=>e.id),3)},[a,f]);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(V.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?na:p},transition:c?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,K.jsx)(qr,{bumpNonce:t,settleBlink:!1}),i&&a&&(0,K.jsx)(`div`,{className:`pointer-events-none absolute right-0 z-[1] flex items-start`,style:{top:-Math.round(ia*u)*.42,right:-Math.round(ia*u)*.12},children:ra.map((e,t)=>{let n=Math.round(ia*u);return(0,K.jsx)(V.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:ra.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,K.jsx)(m,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),a&&(0,K.jsx)(Ye,{children:(d?ta.filter(e=>e.mobile):ta).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,K.jsx)(V.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,K.jsx)(m,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}var oa={established:!1,assistantName:null};async function sa(e,n={hasAnyActiveConversation:_e,fetchAssistantIdentity:f}){try{if(!await n.hasAnyActiveConversation(e))return oa}catch(e){return t(e,{context:`research_onboarding_established_check`}),oa}let r=await n.fetchAssistantIdentity(e).catch(()=>null);return{established:!0,assistantName:(typeof r?.name==`string`?r.name.trim():``)||null}}function ca({assistantName:e,onKeep:t,onRedo:n,onBack:i}){let a=e?.trim()||``,o=a||`your assistant`,s=a?`${a}'s`:`its`;return(0,K.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-primary)`},children:[(0,K.jsx)(Z,{onBack:i,tone:`light`}),(0,K.jsxs)(`div`,{className:`${st} max-w-xl`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,K.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:a?`${a} is already up and running`:`Your assistant is already up and running`}),(0,K.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,K.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,K.jsxs)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:[`Keep `,o,` and start chatting`,(0,K.jsx)(U,{className:`h-4 w-4`})]}),(0,K.jsxs)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:n,className:`h-11 text-base`,children:[`Start over and rebuild `,s,` personality`]})]})]})]})}var la=4e3;function ua(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobby:e.hobbies.join(`, `),timezone:N()}}function da(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}ot();function fa(){let e=i(),t=ce.use.user(),n=t?.id??null,r=Ze.use.enterFocus(),o=Ze.use.exitFocus(),s=Ze.use.setPendingAvatarTraits(),c=Ze.use.requestSidebarCollapse(),[l,u]=(0,G.useState)(`form`),{ref:d,size:f}=Xn(),[p,m]=(0,G.useState)([]),[h,g]=(0,G.useState)(!1);function _(e){u(e)}function v(e,t=`completed`){$e(tt[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,G.useState)(null),w=(0,G.useRef)(null),[T,E]=(0,G.useState)(null),[ee,O]=(0,G.useState)(null),k=(0,G.useRef)(!1),[A,j]=(0,G.useState)(null),[ne,re]=(0,G.useState)({}),[ie,oe]=(0,G.useState)(!1),[M,se]=(0,G.useState)(null),[le,ue]=(0,G.useState)(null),[de,fe]=(0,G.useState)(!1),[me,N]=(0,G.useState)(!1),[_e,P]=(0,G.useState)(!1),[Se,Ce]=(0,G.useState)(0),[we,Te]=(0,G.useState)(0),[Ee]=a(),F=rn({hostingParam:Ee.get(`hosting`),localMode:te(),gatewayAuthSession:D()}),De=Ee.get(`assistant`)??void 0,Oe=F,{start:ke,ready:Ae,assistantId:I,error:je,awaitReady:L}=un({adoptExisting:F,adoptAssistantId:De}),R=Pn(),{start:z,hydrate:Me}=R,Ne=(0,G.useRef)(Promise.resolve()),Pe=(0,G.useRef)(Promise.resolve()),[B,Fe]=(0,G.useState)(!1),Ie=R.status===`idle`||R.status===`running`,Le=!Ie&&R.claims.length===0;(0,G.useEffect)(()=>{o(),s(null),ke()},[o,s,ke]),(0,G.useEffect)(()=>{if(w.current)return;let e=L().then(e=>sa(e)).catch(()=>oa);w.current=e,e.then(E)},[L]),(0,G.useLayoutEffect)(()=>{if(h||!n)return;let e=ye(n);if(e?.formValues){C(e.formValues),j(e.faceValues),ue(e.checkinTime),N(e.checkinBooked),se(e.researchConversationId??null),e.research&&Me({...e.research,pluginCatalog:e.research.pluginCatalog??{}},L);let t=be(e);u(Oe&&(t===`letschat`||t===`meeting`)?`looking`:t),m([])}g(!0)},[h,n,Me,L,Oe]),(0,G.useEffect)(()=>{!h||!S||ve(n,{step:l,formValues:S,faceValues:A,checkinTime:le,checkinBooked:me,research:R.status===`done`?{status:`done`,claims:R.claims,suggestions:R.suggestions,installedPlugins:R.installedPlugins,pluginCatalog:R.pluginCatalog}:null,...M?{researchConversationId:M}:{}})},[h,n,l,S,A,le,me,M,R.status,R.claims,R.suggestions,R.installedPlugins,R.pluginCatalog]),(0,G.useEffect)(()=>{h&&(!S||R.status!==`idle`||z({awaitAssistantId:L,subject:ua(S),conversationTitle:da(S),...M?{resumeConversationId:M}:{},onConversationCreated:se,includeSuggestions:!1}))},[h,S,M,R.status,z,L,!0]),(0,G.useEffect)(()=>{l===`results`&&Le&&(m([]),u(`suggestions`))},[l,Le]);function Re(t,i,a,{skip:o=!1,hidden:l=!1}={}){xe(n);let{firstName:u,lastName:d,role:f,hobbies:p}=t,m=[u.trim(),d.trim()].filter(Boolean).join(` `),h=u.trim(),g=!o&&a===void 0;ge({tools:[],tasks:[],tone:lt,...m?{userName:m}:{},...f.trim()?{occupation:f.trim()}:{},...o?{}:{initialMessage:a??nn({firstName:u,lastName:d,occupation:f,hobby:p.join(`, `)}),...l?{initialMessageHidden:!0}:{}},...g?{title:h?`Getting to know ${h}`:`Getting to know you`}:{},...i?.name?.trim()?{assistantName:i.name.trim()}:{}});let _=i?.name?.trim();_&&he(_),s(i?.traits??null),g&&r(),o||ae.markExpectingFirstMessage(),c(),ae.checkAssistant(I??void 0).finally(()=>{e(`${pe.assistant}?onboarding=1`,{replace:!0})})}async function ze(){S&&(await Promise.all([R.awaitPluginInstalls(),Ne.current,Pe.current]),Re(S,A,Kn(A?.name),{hidden:!0}))}function Be(e){R.start({awaitAssistantId:L,subject:ua(e),conversationTitle:da(e),onConversationCreated:se,includeSuggestions:!1})}async function Ve(e){if(!k.current&&(T??await Promise.race([w.current??Promise.resolve(null),new Promise(e=>{setTimeout(()=>e(null),la)})]))?.established){O(e),v(`existing`);return}C(e),Be(e),v(`face`)}function He(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){P(!0);return}if(P(!1),I&&S){let e=[S.firstName.trim(),S.lastName.trim()].filter(Boolean).join(` `);ue(null),N(!1),fe(!0),et({assistantId:I,userName:e||void 0,assistantName:A?.name?.trim()||void 0}).then(e=>{e.scheduled&&(N(!0),ue(qn(e.start,e.timeZone)))}).finally(()=>fe(!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,K.jsx)(`div`,{ref:d,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,K.jsxs)(Qn,{size:f,children:[(0,K.jsx)(aa,{eyesBumpNonce:Se,peekLevel:[`looking`,`results`,`suggestions`,`finishing`].includes(l)?we:0,darkBg:e,showBottomEyes:!e&&l!==`different`}),l===`different`&&(0,K.jsx)(hi,{onContinue:()=>v(`personality`),onBack:()=>y(`intro`),onForward:x}),l===`personality`&&(0,K.jsx)(Ni,{values:ne,onValueChange:(e,t)=>re(n=>({...n,[e]:t})),locked:ie,onContinue:()=>{ie||(Fe(!0),Pe.current=Gn({awaitAssistantId:L,values:ne,userName:S?.firstName?.trim()||void 0,assistantName:A?.name?.trim()||void 0}).finally(()=>Fe(!1)),oe(!0)),v(`integration`)},onBack:()=>y(`different`),onForward:x}),l===`integration`&&(0,K.jsx)(bi,{onClaim:()=>v(Oe?`looking`:`letschat`),onBumpEyes:()=>Ce(e=>e+1),onBack:()=>y(`personality`),onForward:x}),l===`letschat`&&(0,K.jsx)(Pi,{assistantId:I,assistantReady:Ae,hatchError:je,onConnected:He,missingCalendarScope:_e,onRetry:()=>P(!1),onSkip:()=>{P(!1),v(`looking`,`skipped`)},onBack:()=>y(`integration`),onForward:x}),l===`meeting`&&(0,K.jsx)(Hi,{scheduledTime:le??void 0,awaitingTime:de,onDone:()=>v(`looking`),onBack:()=>y(`letschat`),onForward:x}),l===`looking`&&(0,K.jsx)(Yi,{onDone:()=>v(Le?`suggestions`:`results`),onBack:()=>y(Oe?`integration`:`letschat`),onAdvance:e=>Te(Math.min(e+1,4)),onForward:x,ready:!Ie}),l===`results`&&(0,K.jsx)(Zi,{claims:R.claims,loading:Ie,onContinue:e=>{M&&I&&e.length>0&&(Ne.current=In({assistantId:I,conversationId:M,removedClaims:e,rejectedAll:!1})),v(`suggestions`)},onRejectAll:()=>{M&&I&&(Ne.current=In({assistantId:I,conversationId:M,removedClaims:R.claims.map(e=>e.claim),rejectedAll:!0})),v(`suggestions`,`skipped`)},onBack:()=>y(`looking`),onForward:x}),l===`suggestions`&&(0,K.jsx)(ea,{installedPlugins:R.installedPlugins,pluginCatalog:R.pluginCatalog,onStart:async()=>{if($e(tt.suggestions,{userId:n,outcome:`completed`}),B){m([]),u(`finishing`);return}await ze()},onBack:()=>y(Le?`looking`:`results`),onForward:x}),l===`suggestions`&&!1,l===`finishing`&&(0,K.jsx)(Xi,{ready:!B,onDone:()=>void ze()})]})})}return l===`existing`?(0,K.jsx)(ca,{assistantName:T?.assistantName??null,onKeep:()=>{$e(tt.existing,{userId:n,outcome:`completed`}),xe(n),ae.checkAssistant(I??void 0).finally(()=>{e(pe.assistant,{replace:!0})})},onRedo:()=>{let e=ee;e&&(k.current=!0,$e(tt.existing,{userId:n,outcome:`skipped`}),C(e),Be(e),m([]),_(`face`))},onBack:()=>{O(null),y(`form`)}}):l===`intro`&&S?(0,K.jsx)(Xr,{firstName:S.firstName,assistantName:A?.name,onContinue:()=>v(`different`),onBack:()=>y(`face`),onForward:x}):l===`face`&&S?(0,K.jsx)(Fr,{onContinue:e=>{j(e),v(`intro`)},onBack:()=>y(`form`),onForward:x}):(0,K.jsx)(Dr,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:Ve})}export{fa as ResearchOnboardingRoute};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-y5bNUVyG.js";import{d as s,i as c,n as l}from"./auth-store-CD7PGb3q.js";import{t as u}from"./return-to-BwxkOGDI.js";import{c as d}from"./routes-BbeIx_F9.js";import{c as f,d as p,f as m,l as h,p as g,u as _}from"./prefs-DYaOj-dg.js";import{Oi as v,gr as y,rn as b}from"./index-CSefSVJO.js";import{n as x,t as S}from"./consent-controls-BZMxm0n3.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=r(),[t]=i(),a=l.use.user()?.id??null,w=l.use.logout(),T=o(),k=c(),[A,j]=g(),[M,N]=_(),[P,F]=p(),[I,L]=m(),[R]=f(),[z]=h(),[B]=(0,C.useState)(()=>!A),[V]=(0,C.useState)(()=>!M),[H]=(0,C.useState)(()=>!R),[U]=(0,C.useState)(()=>!z),W=!B&&!V&&!H&&!U,G=B||W,K=V||W,q=H||W,J=U||W,Y=!W&&!B&&!V,X=W?`Terms & privacy`:Y?`Review your privacy preferences`:`Updated terms`,Z=W?`Review your terms and privacy preferences anytime.`:Y?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,Q=(0,C.useCallback)(()=>{s({userId:a,tos:A,privacy:M,shareAnalytics:P,shareDiagnostics:I,hasPlatformSession:k}),e(u(t.get(`returnTo`),d.assistant),{replace:!0})},[M,k,e,t,P,I,A,a]),$=(0,C.useCallback)(async()=>{await w(),y(d.account.login)},[w]),ee=G&&!A||K&&!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)(v,{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:X}),(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:Z}),(q||J)&&(0,O.jsx)(x,{electron:T,showAnalytics:q,showDiagnostics:J,shareAnalytics:P,shareDiagnostics:I,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(K||G)&&(0,O.jsx)(S,{electron:T,showPrivacy:K,showTos:G,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:K?D(`2026-06-22`):[],tosNotes:G?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:ee,onClick:Q,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:$,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-y5bNUVyG.js";import{d as s,i as c,n as l}from"./auth-store-C09YAZEu.js";import{t as u}from"./return-to-BwxkOGDI.js";import{c as d}from"./routes-BbeIx_F9.js";import{c as f,d as p,f as m,l as h,p as g,u as _}from"./prefs-B1Y3q3c8.js";import{Di as v,hr as y,rn as b}from"./index-yu6nDHvG.js";import{n as x,t as S}from"./consent-controls-Cnr1DzCr.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=r(),[t]=i(),a=l.use.user()?.id??null,w=l.use.logout(),T=o(),k=c(),[A,j]=g(),[M,N]=_(),[P,F]=p(),[I,L]=m(),[R]=f(),[z]=h(),[B]=(0,C.useState)(()=>!A),[V]=(0,C.useState)(()=>!M),[H]=(0,C.useState)(()=>!R),[U]=(0,C.useState)(()=>!z),W=!B&&!V&&!H&&!U,G=B||W,K=V||W,q=H||W,J=U||W,Y=!W&&!B&&!V,X=W?`Terms & privacy`:Y?`Review your privacy preferences`:`Updated terms`,Z=W?`Review your terms and privacy preferences anytime.`:Y?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,Q=(0,C.useCallback)(()=>{s({userId:a,tos:A,privacy:M,shareAnalytics:P,shareDiagnostics:I,hasPlatformSession:k}),e(u(t.get(`returnTo`),d.assistant),{replace:!0})},[M,k,e,t,P,I,A,a]),$=(0,C.useCallback)(async()=>{await w(),y(d.account.login)},[w]),ee=G&&!A||K&&!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)(v,{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:X}),(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:Z}),(q||J)&&(0,O.jsx)(x,{electron:T,showAnalytics:q,showDiagnostics:J,shareAnalytics:P,shareDiagnostics:I,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(K||G)&&(0,O.jsx)(S,{electron:T,showPrivacy:K,showTos:G,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:K?D(`2026-06-22`):[],tosNotes:G?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:ee,onClick:Q,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:$,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};