@vellumai/web 0.10.3 → 0.10.4-dev.202607010119.ad15dbb
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.
- package/dist/assets/{AnimatePresence-CgXwEO42.js → AnimatePresence-uY0BR2n2.js} +2 -2
- package/dist/assets/{BundleConfirmPage-DpfvIcwl.js → BundleConfirmPage-BEQyQVeN.js} +1 -1
- package/dist/assets/{about-page-CuSnWJFo.js → about-page-Ck4iLq7E.js} +1 -1
- package/dist/assets/account-page-DQ-mhgzD.js +1 -0
- package/dist/assets/{account-shell-b6GjlQ0u.js → account-shell-YW3hfGZg.js} +1 -1
- package/dist/assets/acp-run-detail-panel-F4jGaLGr.js +5 -0
- package/dist/assets/{add-credits-modal-Dy3I3Har.js → add-credits-modal-BiXT9GCG.js} +1 -1
- package/dist/assets/advanced-page-DWy3_xJE.js +1 -0
- package/dist/assets/ai-page-DvWwWWSe.js +1 -0
- package/dist/assets/animated-avatar-DjujnGJR.js +1 -0
- package/dist/assets/{api-2kc3MHRz.js → api-Chh-fdux.js} +1 -1
- package/dist/assets/api-key-screen-BckE9IMc.js +1 -0
- package/dist/assets/{archive-page-Dl6HLIJt.js → archive-page-CFFPhMCo.js} +1 -1
- package/dist/assets/assistant-api-Dp82rdTg.js +1 -0
- package/dist/assets/{assistant-feature-flag-store-Dl92XRsM.js → assistant-feature-flag-store-B-x4UdVS.js} +1 -1
- package/dist/assets/{assistant-identity-store-CKjnoLSp.js → assistant-identity-store-E8J494ln.js} +1 -1
- package/dist/assets/{assistant-status-panel-BkIkvMYw.js → assistant-status-panel-CKqzTyXz.js} +1 -1
- package/dist/assets/auth-store-Cvj5lZ7o.js +2 -0
- package/dist/assets/background-task-detail-panel-C491zuhg.js +1 -0
- package/dist/assets/{billing-page-Cq_yLwUC.js → billing-page--ddtmJRL.js} +3 -3
- package/dist/assets/{bookmarks-page-CANlE7hP.js → bookmarks-page-Rzi8hBvA.js} +1 -1
- package/dist/assets/{browser-CKX_K5ev.js → browser-DM38C5zq.js} +2 -2
- package/dist/assets/build-state-CI7ASQH5.js +1 -0
- package/dist/assets/by-tool-use-id-index-Dbdu-8Kf.js +1 -0
- package/dist/assets/{capture-error-Hr1Yo2kx.js → capture-error-BG-GkiMq.js} +1 -1
- package/dist/assets/chat-rA5AbKPD.js +1 -0
- package/dist/assets/{client-feature-flag-store-C1kdd1EO.js → client-feature-flag-store-D7sAlDlW.js} +1 -1
- package/dist/assets/client-identity-KGlckm6M.js +1 -0
- package/dist/assets/client.gen-DU1JkKSB.js +6 -0
- package/dist/assets/{command-palette-GZu_zgQg.js → command-palette-DI2UhxPS.js} +1 -1
- package/dist/assets/{command-palette-window-page-CzWu42Ee.js → command-palette-window-page-D8V7p65K.js} +1 -1
- package/dist/assets/{community-page-Dhgypa-h.js → community-page-DcVnBmFx.js} +1 -1
- package/dist/assets/{connect-page-CDOcgzzL.js → connect-page-Cbt4JSWk.js} +1 -1
- package/dist/assets/{consent-controls-BSZV4rW3.js → consent-controls-Dsb58yGZ.js} +1 -1
- package/dist/assets/{contacts-gateway-dxw1KMN2.js → contacts-gateway-BDJYh797.js} +1 -1
- package/dist/assets/contacts-page-route-BV3-Vd6x.js +9 -0
- package/dist/assets/{conversation-list-fetchers-UPVZq_6O.js → conversation-list-fetchers-XUhw0LTH.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-CjqUKhk9.js → danger-zone-redirect-page-DK4QwO4q.js} +1 -1
- package/dist/assets/debug-page-BVIoqlde.js +4 -0
- package/dist/assets/{deploy-dialogs-jf5VL1UP.js → deploy-dialogs-D03Uk0Rn.js} +1 -1
- package/dist/assets/{detail-card-BIwpXT5F.js → detail-card-kfxLI0l_.js} +1 -1
- package/dist/assets/detail-panel-stop-button-wfqPI5Gm.js +1 -0
- package/dist/assets/detail-shell-Bv3NKx5s.js +3 -0
- package/dist/assets/{developer-page-iEL4eJ8x.js → developer-page-Cin7Aqe9.js} +1 -1
- package/dist/assets/{devices-page-RMaPGcXe.js → devices-page-B9jm7IpO.js} +1 -1
- package/dist/assets/diagnostics-ChEKet-K.js +1 -0
- package/dist/assets/{dictation-overlay-page-BxQCzLMY.js → dictation-overlay-page-CF_ElkZT.js} +1 -1
- package/dist/assets/{document-viewer-page-57OuXxYw.js → document-viewer-page-oHeSeBg_.js} +1 -1
- package/dist/assets/earn-credits-modal-Bz9ZtPne.js +1 -0
- package/dist/assets/{emails-page-0gRZqa6y.js → emails-page-Ci1A4hnA.js} +1 -1
- package/dist/assets/{emoji-catalog-data-Dlkuvec0.js → emoji-catalog-data-D8lRMt3A.js} +1 -1
- package/dist/assets/esm--RA963YO.js +2 -0
- package/dist/assets/esm-BSRBg0oR.js +2 -0
- package/dist/assets/esm-CJ8uY1wn.js +2 -0
- package/dist/assets/esm-DTj81fJQ.js +1 -0
- package/dist/assets/{esm-B3Lr4Bv0.js → esm-O9mDOR47.js} +2 -2
- package/dist/assets/esm-cB02a8J9.js +2 -0
- package/dist/assets/feature-flag-catalog-BD9vx85e.js +1 -0
- package/dist/assets/{file-editor-BNkJJbUv.js → file-editor-DEuQwSiV.js} +1 -1
- package/dist/assets/general-page-DG6oYb_H.js +1 -0
- package/dist/assets/hatching-screen-DqW9u6T7.js +1 -0
- package/dist/assets/home-page-route-Cbsx-6Pd.js +1 -0
- package/dist/assets/hosting-screen-D3PQJGnh.js +1 -0
- package/dist/assets/identity-page-route-D6LmIeV7.js +1 -0
- package/dist/assets/index-CbZDhL8R.js +130 -0
- package/dist/assets/index-pahhv1V_.css +2 -0
- package/dist/assets/{inspect-page-CWasyuSO.js → inspect-page-CF9Ayo4W.js} +9 -7
- package/dist/assets/install-PnOuSvVB.js +1 -0
- package/dist/assets/integrations-page-Cr-tXygA.js +1 -0
- package/dist/assets/intelligence-layout-BNgvJuLM.js +1 -0
- package/dist/assets/{keyboard-shortcuts-page-kiOEZKzE.js → keyboard-shortcuts-page-C2n2dsd-.js} +1 -1
- package/dist/assets/library-detail-page-D0niVoGO.js +1 -0
- package/dist/assets/{library-page-BHejhapZ.js → library-page-vhdWT6gT.js} +1 -1
- package/dist/assets/local-mode-CgrENuVf.js +39 -0
- package/dist/assets/{login-flow-DPi11n3h.js → login-flow-DONovBeX.js} +1 -1
- package/dist/assets/login-page-9t0OhjZ_.js +1 -0
- package/dist/assets/{logout-page-Bl6AD21S.js → logout-page-DicyhkqL.js} +1 -1
- package/dist/assets/{logs-layout-C9eUE1Pt.js → logs-layout-au0VXbNb.js} +1 -1
- package/dist/assets/{memory-router-playground-page-Dhi3uqxr.js → memory-router-playground-page-DCTR_mh0.js} +1 -1
- package/dist/assets/messages-xsY377mD.js +13 -0
- package/dist/assets/{status-badge-pill-DYlAnX5m.js → metric-card-BSQEvW8u.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-DqXFL0Ke.js → mobile-sidebar-drawer-dvyeQG5_.js} +1 -1
- package/dist/assets/native-biometric-BMNAVqxV.js +6 -0
- package/dist/assets/{native-file-B-MK3Ngg.js → native-file-DIJL6af-.js} +2 -2
- package/dist/assets/{notifications-page-pHiDPA0p.js → notifications-page-COTdJiXn.js} +1 -1
- package/dist/assets/{oauth-complete-page-DiGMWbOb.js → oauth-complete-page-BE-O3kQl.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-CwoZnzdc.js → oauth-popup-complete-page-BXSFGP82.js} +1 -1
- package/dist/assets/{page-shell-cEGpH3P5.js → page-shell-D0lmza98.js} +1 -1
- package/dist/assets/pairing-page-DCN7wosZ.js +1 -0
- package/dist/assets/{password-reset-page-DfYGL1Gv.js → password-reset-page-T_0pamrF.js} +1 -1
- package/dist/assets/platform-detection-CrZF23_f.js +1 -0
- package/dist/assets/platform-loopback-page-WP6ZK2og.js +1 -0
- package/dist/assets/plugin-detail-page-Bb-HIhbL.js +1 -0
- package/dist/assets/plugins-page-CgXy8wOw.js +1 -0
- package/dist/assets/plugins-surface-CbPGIeTp.js +1 -0
- package/dist/assets/prechat-route-Dlxfnhlc.js +1 -0
- package/dist/assets/{prefs-C_oq5G87.js → prefs-CDgkoxVx.js} +1 -1
- package/dist/assets/privacy-page-GobR1d9D.js +1 -0
- package/dist/assets/privacy-screen-Dc2hlvoL.js +1 -0
- package/dist/assets/provider-callback-page-6xGqU2cr.js +1 -0
- package/dist/assets/provider-key-BJ_kBwp_.js +1 -0
- package/dist/assets/provider-signup-page-CrWI2ul2.js +1 -0
- package/dist/assets/proxy-BgtfAoJj.js +1 -0
- package/dist/assets/{quick-input-page-C9jN8YtU.js → quick-input-page-CyO-UVOQ.js} +1 -1
- package/dist/assets/react-query.gen-BZr-1Xaw.js +1 -0
- package/dist/assets/{react-query.gen-rp6Krcco.js → react-query.gen-By34AU2d.js} +1 -1
- package/dist/assets/remote-gateway-session-BigLiDPm.js +1 -0
- package/dist/assets/repeat-nCGBxntG.js +1 -0
- package/dist/assets/{research-mock-page-ttrrPwo3.js → research-mock-page-CFeRg2m9.js} +1 -1
- package/dist/assets/research-onboarding-route-CPFxApXp.js +53 -0
- package/dist/assets/{resize-errors-DnJEbHn4.js → resize-errors-D1myE8D_.js} +1 -1
- package/dist/assets/{resolved-assistants-store-Cp4J43BK.js → resolved-assistants-store-Dqf0LJrA.js} +1 -1
- package/dist/assets/return-to-yMLvlnXN.js +1 -0
- package/dist/assets/{review-terms-screen-DEiifDmK.js → review-terms-screen-DlWWIPhL.js} +1 -1
- package/dist/assets/routes-C6gxiCrz.js +1 -0
- package/dist/assets/{schedules-D-4Rq6ZC.js → schedules-DJmuJMXB.js} +1 -1
- package/dist/assets/sdk.gen-7kFw36Fw.js +1 -0
- package/dist/assets/{sdk.gen-D-_js_oC.js → sdk.gen-DmWuY0SL.js} +1 -1
- package/dist/assets/select-assistant-screen-DRGlR5tq.js +1 -0
- package/dist/assets/{settings-layout-CQ3Z9Raj.js → settings-layout-CPlHwZar.js} +1 -1
- package/dist/assets/share-feedback-modal-BtexHlGh.js +1 -0
- package/dist/assets/{sidebar-tree-BJkXpCut.js → sidebar-tree-BSfeq3rN.js} +1 -1
- package/dist/assets/signup-page-CD82HLMa.js +1 -0
- package/dist/assets/{signup-shell-Bu5BM6II.js → signup-shell-DMX1tgqB.js} +1 -1
- package/dist/assets/skills-page-uPBTcfof.js +1 -0
- package/dist/assets/{sound-manager-CzslfzDO.js → sound-manager-KLJ38-0x.js} +1 -1
- package/dist/assets/{sounds-page-mens6EAJ.js → sounds-page-D5Otlu0m.js} +1 -1
- package/dist/assets/src-mai-NajT.js +293 -0
- package/dist/assets/status-badge-pill-j3ke1d9o.js +1 -0
- package/dist/assets/step-indicator-dots-Bc6X141I.js +1 -0
- package/dist/assets/subagent-detail-panel-CwrQ-fU2.js +4 -0
- package/dist/assets/subagent-store-7iuZZvpK.js +3 -0
- package/dist/assets/{system-events-page-Dro8iNrx.js → system-events-page-C97rXw7f.js} +1 -1
- package/dist/assets/{system-events-redirect-page-C1hGE6n5.js → system-events-redirect-page-C16Xg1C_.js} +1 -1
- package/dist/assets/{tiptap-document-editor-D2t4qYzv.js → tiptap-document-editor-D7FsRH57.js} +1 -1
- package/dist/assets/tool-detail-panel-C4rvmaIu.js +2 -0
- package/dist/assets/{trace-page-DRWPaAuQ.js → trace-page-DC6afHEl.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-Cwv5eMh9.js → upgrade-cancel-page-CPkecrqt.js} +1 -1
- package/dist/assets/{upgrade-success-page-DnJ8Kyyj.js → upgrade-success-page-jpqq2ebU.js} +1 -1
- package/dist/assets/{usage-page-DJHRS0lZ.js → usage-page-CYhpUzpF.js} +1 -1
- package/dist/assets/{use-active-assistant-id-C-RHQ9f6.js → use-active-assistant-id-BVzVN4_g.js} +1 -1
- package/dist/assets/{use-bus-subscription-BbiZXm1u.js → use-bus-subscription-BNaztnO7.js} +1 -1
- package/dist/assets/use-is-org-ready-BZPwjmJ0.js +1 -0
- package/dist/assets/use-onboarding-login-Cl5KRcns.js +1 -0
- package/dist/assets/use-reduced-motion-BG6r0Z46.js +1 -0
- package/dist/assets/use-skill-categories-DnGU6jFt.js +1 -0
- package/dist/assets/{utils-IBnUZTqY.js → utils-B_yHNmjr.js} +1 -1
- package/dist/assets/viewer-store-DPvYSSNt.js +1 -0
- package/dist/assets/{voice-page-kQZ2ya5j.js → voice-page-CmWbntyV.js} +1 -1
- package/dist/assets/weather-forecast-display-B5N0WiEJ.js +1 -0
- package/dist/assets/{web-M3MS-KVB.js → web-CxyEb7Lp.js} +1 -1
- package/dist/assets/{web-B0S2ynRY.js → web-DFw1Yfb1.js} +1 -1
- package/dist/assets/{web-DOKyhuGQ.js → web-DGDlV45i.js} +1 -1
- package/dist/assets/{web-DJKnWTsF.js → web-GWxiW7or.js} +1 -1
- package/dist/assets/{web-iUXw2JWQ.js → web-YggPvEM4.js} +1 -1
- package/dist/assets/{web-D0QcGl1O.js → web-b9SjJqdc.js} +1 -1
- package/dist/assets/{web-Cg8gCWpB.js → web-lNls6p99.js} +1 -1
- package/dist/assets/{welcome-screen-Bd7PCfAf.js → welcome-screen-CM2JfU7K.js} +1 -1
- package/dist/assets/workflow-detail-panel-A3Kmykm3.js +1 -0
- package/dist/assets/workspace-page-Ae6mnQRy.js +1 -0
- package/dist/index.html +83 -78
- package/package.json +1 -1
- package/dist/assets/account-page-CCYCSy2-.js +0 -1
- package/dist/assets/advanced-page-CVnT0zH-.js +0 -1
- package/dist/assets/ai-page-kEbHR7cH.js +0 -1
- package/dist/assets/api-key-screen-DGVn66y4.js +0 -1
- package/dist/assets/assistant-api-DROTS3Y9.js +0 -1
- package/dist/assets/auth-store-Kfxhs2oI.js +0 -7
- package/dist/assets/build-state-VC4tL7sK.js +0 -1
- package/dist/assets/contacts-page-route-C3QiOxjO.js +0 -9
- package/dist/assets/debug-page-CBozmAQQ.js +0 -2
- package/dist/assets/diagnostics-BEB4VPwC.js +0 -1
- package/dist/assets/earn-credits-modal-Nm1VymMp.js +0 -1
- package/dist/assets/esm-BVNBLzcW.js +0 -2
- package/dist/assets/esm-BtN-afz9.js +0 -1
- package/dist/assets/esm-D2xhPoyM.js +0 -2
- package/dist/assets/esm-DwNtkiSD.js +0 -2
- package/dist/assets/esm-pt1s0ryM.js +0 -2
- package/dist/assets/feature-flag-catalog-RK3_Ckyw.js +0 -1
- package/dist/assets/general-page-aZxTpnpI.js +0 -1
- package/dist/assets/hatching-screen-KPinlCES.js +0 -1
- package/dist/assets/home-page-route-CudtBGg1.js +0 -1
- package/dist/assets/hosting-screen-C14KAJ6m.js +0 -1
- package/dist/assets/identity-page-route-C0BFcTAF.js +0 -1
- package/dist/assets/index-Hcyzmz_5.css +0 -2
- package/dist/assets/index-PRnvH2Y1.js +0 -132
- package/dist/assets/install-C3xe8ARr.js +0 -1
- package/dist/assets/integrations-page-WhBpTYP2.js +0 -1
- package/dist/assets/intelligence-layout-CvTumtjv.js +0 -1
- package/dist/assets/library-detail-page-rPvN9G1a.js +0 -1
- package/dist/assets/local-mode-CvrNMtPF.js +0 -39
- package/dist/assets/login-page-BGLVK82t.js +0 -1
- package/dist/assets/messages-DHDZ32NT.js +0 -13
- package/dist/assets/pairing-page-clFaUgzL.js +0 -1
- package/dist/assets/platform-loopback-page-Df5bTTx8.js +0 -1
- package/dist/assets/plugin-detail-page-IRPeI4lP.js +0 -1
- package/dist/assets/plugins-page-BaYp2QOe.js +0 -1
- package/dist/assets/prechat-route-BaMWiiaf.js +0 -1
- package/dist/assets/privacy-page-BUhxrIRn.js +0 -1
- package/dist/assets/privacy-screen-BaHYtKEt.js +0 -1
- package/dist/assets/provider-callback-page-CxFC4PH1.js +0 -1
- package/dist/assets/provider-key-nA35OC4Y.js +0 -1
- package/dist/assets/provider-signup-page-CdpT28xL.js +0 -1
- package/dist/assets/proxy-DmIh4F51.js +0 -1
- package/dist/assets/react-query.gen-CQLyoqYk.js +0 -1
- package/dist/assets/reduced-motion-DYlLlcUm.js +0 -1
- package/dist/assets/research-onboarding-route-Cxai0fux.js +0 -36
- package/dist/assets/return-to-ByvaXBKr.js +0 -1
- package/dist/assets/risk-badge-BA8R-HCI.js +0 -1
- package/dist/assets/routes-DVqkwUEe.js +0 -1
- package/dist/assets/sdk.gen-1aYqVbMj.js +0 -6
- package/dist/assets/select-assistant-screen-UoixBMN2.js +0 -1
- package/dist/assets/share-feedback-modal-CTwByE7B.js +0 -1
- package/dist/assets/signup-page-CKDYl9Wb.js +0 -1
- package/dist/assets/skills-page-DVjqqfMw.js +0 -1
- package/dist/assets/src-CK6bncSg.js +0 -293
- package/dist/assets/step-indicator-dots-CEVbsP8r.js +0 -1
- package/dist/assets/subagent-detail-panel-DVQAkMjF.js +0 -4
- package/dist/assets/subagent-store-BLHGkTJR.js +0 -3
- package/dist/assets/three-dot-indicator-CLs7Rl-I.js +0 -1
- package/dist/assets/tool-call-status-DTV5jmaU.js +0 -1
- package/dist/assets/tool-detail-panel-DRD2DIMF.js +0 -2
- package/dist/assets/use-is-org-ready-BdtHeRV6.js +0 -1
- package/dist/assets/use-onboarding-login-BEOH92mZ.js +0 -1
- package/dist/assets/use-plugin-drift-Bj693x0f.js +0 -1
- package/dist/assets/use-reduced-motion-ChB7nOGe.js +0 -1
- package/dist/assets/viewer-store-Dead64xY.js +0 -1
- package/dist/assets/weather-forecast-display-Cu3W6OZF.js +0 -1
- package/dist/assets/workflow-detail-panel-CMmPPsuL.js +0 -1
- package/dist/assets/workspace-page-BR4pOxs5.js +0 -1
- package/dist/skills/meet-join/assets/icon.svg +0 -1
- /package/dist/assets/{api-errors-CveHbhgb.js → api-errors-DPruG7q9.js} +0 -0
- /package/dist/assets/{app-info-BZYaLxCg.js → app-info-DJQFoVxX.js} +0 -0
- /package/dist/assets/{avatar-bundled-components-BgAkdy0n.js → avatar-bundled-components-w37NPF4o.js} +0 -0
- /package/dist/assets/{avatar-svg-compositor-CEmN7KGI.js → avatar-svg-compositor-DG7zqpYr.js} +0 -0
- /package/dist/assets/{build.umd-B3KuSWeo.js → build.umd-4R02MPXx.js} +0 -0
- /package/dist/assets/{client.gen-Cs6pCK0s.js → client.gen-BHupOCJH.js} +0 -0
- /package/dist/assets/{composer-focus-Bp1AiP29.js → composer-focus-n921WsjZ.js} +0 -0
- /package/dist/assets/{conversation-selection-CtKjA5Ni.js → conversation-selection-DgYtLnyB.js} +0 -0
- /package/dist/assets/{conversation-store-DK-7gFAt.js → conversation-store-CWgiE5KG.js} +0 -0
- /package/dist/assets/{definitions-lQvEBMJT.js → definitions-BughTGuV.js} +0 -0
- /package/dist/assets/{dist-BTp54SIT.js → dist-Ztj3rqLK.js} +0 -0
- /package/dist/assets/{edit-chat-session-DJpqkkos.js → edit-chat-session-DcCgw5Qy.js} +0 -0
- /package/dist/assets/{effective-timezone-DrYGH2Lb.js → effective-timezone-BJxnysvd.js} +0 -0
- /package/dist/assets/{environment-store-CvH3J6fT.js → environment-store-CnVyTyZ7.js} +0 -0
- /package/dist/assets/{event-bus-Dl7-I4aL.js → event-bus-B3E3w-q2.js} +0 -0
- /package/dist/assets/{external-link-DPAtkBJ2.js → external-link-RJkZLlff.js} +0 -0
- /package/dist/assets/{file-text-CmK9LY1p.js → file-text-ClqzuFsu.js} +0 -0
- /package/dist/assets/{format-CPOur310.js → format-BDkwdD2m.js} +0 -0
- /package/dist/assets/{format-date-CLlHK5gl.js → format-date-D4tzd1DT.js} +0 -0
- /package/dist/assets/{format-file-size-BfZOpPdu.js → format-file-size-BflZ4oxc.js} +0 -0
- /package/dist/assets/{globe-DYF_lSGm.js → globe-D3P5sSKJ.js} +0 -0
- /package/dist/assets/{haptics-CXHZxyAg.js → haptics-BE_0g4mc.js} +0 -0
- /package/dist/assets/{hard-drive-D7_5VMhi.js → hard-drive-CZEg1Cqc.js} +0 -0
- /package/dist/assets/{impersonate-version-flag-n-4oNLiO.js → impersonate-version-flag-BsxCoimD.js} +0 -0
- /package/dist/assets/{info-_OtUK1cX.js → info-ciQS_i3y.js} +0 -0
- /package/dist/assets/{lib-BWRK7bT2.js → lib-BNGjysgr.js} +0 -0
- /package/dist/assets/{link-2-CaszbD7P.js → link-2-r_QPxX18.js} +0 -0
- /package/dist/assets/{llm-dimension-CQdmYu05.js → llm-dimension-8g-Go8uq.js} +0 -0
- /package/dist/assets/{loader-circle-IIzBGiwm.js → loader-circle-BFRVtR3K.js} +0 -0
- /package/dist/assets/{log-in-2iOsufxq.js → log-in-CEw63CGU.js} +0 -0
- /package/dist/assets/{minimize-2-JE_UHZlJ.js → minimize-2-dKm10qRD.js} +0 -0
- /package/dist/assets/{misc-BN2o2MEB.js → misc-CFzLzLPH.js} +0 -0
- /package/dist/assets/{monitor-D2okHi8o.js → monitor-CXU19mVX.js} +0 -0
- /package/dist/assets/{moon-CK8MXzOo.js → moon-CKINz50a.js} +0 -0
- /package/dist/assets/{mutation-error-CsyN8rYH.js → mutation-error-CK0dVo5B.js} +0 -0
- /package/dist/assets/{native-deep-link-BYNI6pkW.js → native-deep-link-C2-dXaz_.js} +0 -0
- /package/dist/assets/{pdf-pz4ipUHd.js → pdf-B-YWzK66.js} +0 -0
- /package/dist/assets/{pencil-DbB9rxpY.js → pencil-B90pDI55.js} +0 -0
- /package/dist/assets/{prechat-B28Vzu55.js → prechat-3rpjvqoE.js} +0 -0
- /package/dist/assets/{prechat-names-CRduluk-.js → prechat-names-NPlBAwCy.js} +0 -0
- /package/dist/assets/{public-asset-Fx_laYnf.js → public-asset-C2P77n3W.js} +0 -0
- /package/dist/assets/{refresh-cw-Bf6LV0kG.js → refresh-cw-Dui3Ymsb.js} +0 -0
- /package/dist/assets/{save-DEBQ_gbb.js → save-BpAesNEP.js} +0 -0
- /package/dist/assets/{semver-yC_Iq9co.js → semver-l1HADz2z.js} +0 -0
- /package/dist/assets/{setting-row-o44aWwYt.js → setting-row-BGQgDyhv.js} +0 -0
- /package/dist/assets/{sparkles-BICoewVE.js → sparkles-Bla177ar.js} +0 -0
- /package/dist/assets/{triangle-alert-DKOyShqD.js → triangle-alert-C3aHZq1F.js} +0 -0
- /package/dist/assets/{typed-storage-Dctd_K9F.js → typed-storage-DjORmu8t.js} +0 -0
- /package/dist/assets/{usage-window-Wgtgd-cv.js → usage-window-B-YOzKJi.js} +0 -0
- /package/dist/assets/{use-is-mobile-Cy10kl9u.js → use-is-mobile-jACt_z2d.js} +0 -0
- /package/dist/assets/{user-plus-C0OyQU83.js → user-plus-COoYKnWs.js} +0 -0
- /package/dist/assets/{workflow-status-DmbjJPT4.js → workflow-status-ByHycBJ_.js} +0 -0
- /package/dist/assets/{x-KVxA2ZL0.js → x-DxL-bCuT.js} +0 -0
- /package/dist/assets/{xterm-MKaw0cT7.js → xterm-B8LaLTHh.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-BFDQtfbG.js → xterm-addon-fit--RE59D-m.js} +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Hr1Yo2kx.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-D7s2Q_uG.js";import{d as i,r 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-DvW5mxZR.js";import{t as l}from"./tag-B_-QAvJF.js";import{t as u}from"./input-C8kfrq9r.js";import{n as d,t as f}from"./create-selectors-BE0_e_Ed.js";import{t as p}from"./arrow-left-CP-EhDNF.js";import{t as m}from"./chevron-left-DghyKSEE.js";import{t as h}from"./chevron-right-B6vEpVY0.js";import{t as g}from"./loader-circle-IIzBGiwm.js";import{t as _}from"./pencil-DbB9rxpY.js";import{t as v}from"./x-KVxA2ZL0.js";import{L as y,Sn as b,X as x,en as S,tn as C,xn as w}from"./sdk.gen-1aYqVbMj.js";import{r as T}from"./api-errors-CveHbhgb.js";import{Q as E,at as D,ct as O,n as k,ot as A,st as j}from"./auth-store-Kfxhs2oI.js";import{a as ee,o as te,r as ne}from"./api-2kc3MHRz.js";import{a as re}from"./routes-DVqkwUEe.js";import{t as ie}from"./client-feature-flag-store-C1kdd1EO.js";import{c as ae,l as oe}from"./prechat-B28Vzu55.js";import{A as M,C as se,D as N,E as ce,F as le,L as ue,M as de,N as P,O as fe,P as F,R as I,S as L,T as pe,_ as me,a as R,b as he,c as z,d as ge,g as _e,h as ve,i as ye,j as be,k as xe,l as Se,m as Ce,o as we,p as Te,r as Ee,s as De,t as B,u as Oe,v as ke,w as Ae,x as je,y as Me}from"./proxy-DmIh4F51.js";import{t as Ne}from"./AnimatePresence-CgXwEO42.js";import{t as V}from"./use-reduced-motion-ChB7nOGe.js";import{At as Pe,Mt as Fe,Nt as Ie,Vt as Le,kn as Re,kt as ze,lt as H,ra as U,rt as W,yt as Be}from"./index-PRnvH2Y1.js";import{t as Ve}from"./prechat-names-CRduluk-.js";var He=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function Ue(e,t){return xe(e)?e[He(0,e.length,t)]:e}var We=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 Ge(this.animations,`duration`)}get iterationDuration(){return Ge(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 Ge(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 Ke=class extends We{then(e,t){return this.finished.finally(e).then(()=>{})}};function qe(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=se(i,a,o);return t?s(r):s}function Je(e,t){return e in t}var Ye=class extends De{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Je(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 Se()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},G=e(n(),1);function Xe(e){let t=I(()=>Me(e)),{isStatic:n}=(0,G.useContext)(Ee);if(n){let[,n]=(0,G.useState)(e);(0,G.useEffect)(()=>t.on(`change`,n),[])}return t}function Ze(e,t){let n=Xe(t()),r=()=>n.set(t());return r(),ue(()=>{let t=()=>fe.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),N(r)}}),n}function Qe(e){ke.current=[],e();let t=Ze(ke.current,e);return ke.current=void 0,t}function $e(e,t,n,r){if(typeof e==`function`)return Qe(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return tt(e,t,n,r);let i=typeof t==`function`?t:qe(t,n,r),a=Array.isArray(e)?et(e,i):et([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 et(e,t){let n=I(()=>[]);return Ze(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function tt(e,t,n,r){let i=I(()=>Object.keys(n)),a=I(()=>({}));for(let o of i)a[o]=$e(e,t,n[o],r);return a}function nt(e){e.values.forEach(e=>e.stop())}function rt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&me(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{rt(e,t)})})}function it(e,t){if(Array.isArray(t))return rt(e,t);if(typeof t==`string`)return rt(e,[t]);me(e,t)}function at(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){P(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(Ce(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return P(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{it(e,n)})},stop(){t.forEach(e=>{nt(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function ot(e){return typeof e==`object`&&!Array.isArray(e)}function st(e,t,n,r){return e==null?[]:typeof e==`string`&&ot(t)?Te(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function ct(e,t,n){return e*(t+1)+n*t}function lt(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 ut(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(le(e,i),r--)}}function dt(e,t,n,r,i,a){ut(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:ce(i,a,r[o]),easing:Ue(n,o)})}function ft(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function pt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var mt=`easeInOut`,ht=20;function gt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,lt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=lt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=yt(e),{delay:l=0,times:u=je(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=he(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&St(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=be(b));let r=pe(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&&L(u,T),c.length===1&&c.unshift(null),m&&F(m<ht,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${ht} or apply repeat at the sequence level instead.`),m&&m<ht){let e=b>0?_/b:0;b=ct(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`?M(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`:Ue(f,e-1))}ft(u,m,e)}let E=w+b;dt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(_e(p)){let e=_t(p,s);_(m,h,vt(`default`,e))}else{let e=st(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=_t(r,s);for(let e in m)_(m[e],bt(h,e),vt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(pt);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(de(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(mt)),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 _t(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function vt(e,t){return t[e]||(t[e]=[]),t[e]}function yt(e){return Array.isArray(e)?e:[e]}function bt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var xt=e=>typeof e==`number`,St=e=>e.every(xt);function Ct(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ge(e)&&!Oe(e)?new R(t):new we(t);n.mount(e),z.set(e,n)}function wt(e){let t=new Ye({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),z.set(e,t)}function Tt(e,t){return _e(e)||typeof e==`number`||typeof e==`string`&&!ot(t)}function Et(e,t,n,r){let i=[];if(Tt(e,t))i.push(ye(e,ot(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=st(e,t,r),o=a.length;P(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Ct:wt;z.has(r)||s(r);let c=z.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...ve(c,{...t,transition:l},{}))}}return i}function Dt(e,t,n){let r=[];return gt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Me(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:Ae}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Et(n,e,t))}),r}function Ot(e){return Array.isArray(e)&&e.some(Array.isArray)}function kt(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),Ot(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Dt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Et(e,i,{...c,...r},t)}let l=new Ke(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{le(t.animations,l)})),l}return i}var K=kt();function At(){let e=I(at);return ue(e.mount,[]),e}var jt=12;function Mt(e){let t=e.slice(0,jt).map(e=>`- ${e.name} — ${e.description}`).join(`
|
|
2
|
-
`);return t?`
|
|
3
|
-
Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
|
|
4
|
-
${t}
|
|
5
|
-
|
|
6
|
-
Add a "plugins" array as the FIRST key in your JSON object, before "claims" and "suggestions": the 1-2 capabilities from the list above (exact names) that best fit who I am — judged by what you researched about my real role, stack, and day-to-day work. (Emit it first so setup can start while you finish the rest.) These get set up for me automatically as part of getting started, so pick by overall fit to ME, not to any single suggestion. Prefer fewer over forcing a match; use [] if nothing clearly fits. Example: "plugins": ["<exact name from the list above>"]. Don't reference the setup in the claims or suggestions text.
|
|
7
|
-
`:``}function Nt({firstName:e,lastName:t,occupation:n,hobby:r},i=[]){let a=[e.trim(),t.trim()].filter(Boolean).join(` `),o=n.trim(),s=r?.trim()??``,c=Mt(i),l=c?`"plugins": ["<exact name from the list above>"], `:``;return`${[a?`My name is ${a}.`:``,o?`I work as ${o}.`:``,s?`My hobby is ${s}.`:``].filter(Boolean).join(` `)||`I'd like you to get to know me before we start working together.`}
|
|
8
|
-
|
|
9
|
-
Get to know me. Search the web for what's publicly known about the person matching my name and role, and infer a handful of things about who I am: what I do, my role, where I'm based, what I'm into, anything that would help you assist me better. Lean on public sources (LinkedIn, company pages, social profiles, articles, personal sites, GitHub). It's fine to make reasonable inferences and label them honestly.
|
|
10
|
-
|
|
11
|
-
CRITICAL: your final reply must be ONLY a JSON object. No preamble, no explanation, no prose, nothing before or after it. Do your thinking and searching, then respond with exactly this shape and nothing else:
|
|
12
|
-
|
|
13
|
-
{ ${l}"claims": [ { "claim": "Senior engineer at an AI infra startup", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Based in Boulder, CO", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Active climber on Mountain Project", "confidence": "maybe", "sources": [] }, { "claim": "Focused on evals or model serving infrastructure", "confidence": "guessing", "sources": ["https://github.com/example-user"] } ], "suggestions": [ { "suggestion": "I'll build you a dashboard for your eval runs", "prompt": "Build me a dashboard to track my eval runs." }, { "suggestion": "I'll watch arXiv for new eval papers and brief you weekly", "prompt": "Send me a weekly brief on new eval papers from arXiv." }, { "suggestion": "Connect GitHub and I'll triage your stalest issues", "prompt": "Connect to GitHub and triage my oldest open issues." }, { "suggestion": "I'll plan a weekend climbing trip near Boulder", "prompt": "Plan me a weekend climbing trip near Boulder." } ] }
|
|
14
|
-
|
|
15
|
-
Rules for "claims":
|
|
16
|
-
|
|
17
|
-
AT MOST 5 claims, typically 3 to 4. Aim for at least one "confident" and at least one "guessing"; the rest "maybe".
|
|
18
|
-
Phrase each claim in third person as a short headline ("Senior engineer at an AI infra startup", "Based in Boulder, CO", "Active climber on Mountain Project"). No multi-clause sentences, no em-dash asides, no explanations. Good: "Contributed to Chirps (vector-DB security)". Bad: "You've done real work in vector database security. You contributed to Chirps, a tool for scanning vector DBs for sensitive data".
|
|
19
|
-
Each claim must be independently true-or-false so I can remove the ones that are wrong.
|
|
20
|
-
"confidence" is one of: "confident" (well supported by what you found), "maybe" (plausible but unverified), "guessing" (a hunch from limited signal).
|
|
21
|
-
"sources": 0 to 3 URLs you actually used as evidence for that specific claim. Use [] for pure inferences.
|
|
22
|
-
Rules for "suggestions":
|
|
23
|
-
|
|
24
|
-
Each suggestion is an object with two fields:
|
|
25
|
-
"suggestion": the offer spoken in YOUR voice (the assistant), exactly as it appears on the clickable card. First-person "I" here refers to you. This is what the user reads.
|
|
26
|
-
"prompt": the message that is sent on the user's behalf when they click that card, written from the USER's perspective in their first person — what they'd say to take you up on the offer. First-person "I"/"my" here refers to the user. Same intent as the suggestion, re-voiced as a request TO you (e.g. suggestion "I'll build you a training plan" → prompt "Build me a training plan for my next climbing trip"). Never echo the assistant-voiced wording in the prompt. Don't ask the user a question back in the prompt — it's their opening message, so state the request. Keep it natural and concise.
|
|
27
|
-
|
|
28
|
-
Generate EXACTLY 4 suggestions, each teaching me something you can do — aim to make me think "wait, you can do that?" Cover four DIFFERENT capabilities; don't repeat the same kind of task. Draw on your range: build a small app or dashboard, set up a recurring brief or monitor, draft a doc in a live editor, connect an integration (GitHub, Gmail, Calendar, Slack, Linear) and take a first action, or lean on a hobby/personal hook if research surfaced one. Pick whatever genuinely fits — don't force a fixed set of themes.
|
|
29
|
-
Ground every suggestion in what you actually learned about me during research — my real role, stack, industry, and (if given) hobby. Specific to me, not generic LLM-assistant stuff. Avoid "summarize" or "draft a post" as standalone suggestions; favor the surprising, specific capabilities (apps, monitors, doc editor, integrations).
|
|
30
|
-
Keep each suggestion SHORT and skimmable: aim for under 10 words, ONE clause, ONE artifact. No lists of three ("X, Y, and Z"), no intake question stacked in front of the offer. The reader scans four cards in a couple of seconds — a long line loses them.
|
|
31
|
-
Favor easy, fast-to-first-output tasks over big builds, so my first reply lands quickly. Prefer "I'll set up a morning brief for today's sales calls" over "I'll build a CRM to manage your deals"; prefer one weekly digest, a short plan, or a single connected action over a multi-part system. The ambitious build can come later in the conversation, not on the first card.
|
|
32
|
-
Each suggestion should be spoken in your voice, offering a service. First-person "I" in the suggestion refers to you, regardless of your name. Core sentence pattern: "I'll [verb] [specific artifact]" or "Connect me to [integration] and I'll [verb] [artifact]." Lead with the offer itself — no intake question in front of it; you gather the details in the follow-up conversation after the click. Suggestions render as clickable; clicking indicates the user wants to proceed. Refinement happens in follow-up conversation, not through the click itself.
|
|
33
|
-
${c}
|
|
34
|
-
Don't include anything sensitive or private. If you found very little, lean on "guessing" claims and broadly useful suggestions for my role.
|
|
35
|
-
Keep every string value simple so the JSON always parses: one line, no line breaks inside a value, and NO double-quote characters inside a value — use single quotes (or none) for emphasis, quoted names, or tool names. Output ONLY the JSON object. No code fence, no extra text.`}var Pt=3e3,Ft=3e5,It=`Failed to start your assistant. Please try again.`,Lt=`Your assistant is taking longer than expected. Please try again.`,Rt=e=>new Promise(t=>setTimeout(t,e));function zt(){let[e,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)(null),[a,o]=(0,G.useState)(null),s=(0,G.useRef)(!1),c=(0,G.useRef)([]),l=(0,G.useRef)(null),u=(0,G.useCallback)(e=>{if(!l.current){l.current={kind:`ready`,id:e},n(!0);for(let t of c.current)t.resolve(e);c.current=[]}},[]),d=(0,G.useCallback)(e=>{if(l.current)return;l.current={kind:`error`,message:e},o(e);let t=Error(e);for(let e of c.current)e.reject(t);c.current=[]},[]);return{start:(0,G.useCallback)(()=>{if(s.current)return;s.current=!0;let e=Date.now(),n=()=>Date.now()-e>=Ft;(async()=>{let e;try{let t=await te();if(t.ok)e=t.data.id,i(t.data.id);else{if(A(t.status,t.error)){d(D);return}if(!O(t.status)){d(T(t.error,void 0,It));return}}}catch(e){t(e,{context:`research_background_hatch`})}let r;for(;!r;){if(n()){d(Lt);return}try{let t=await ne(e);e&&!t.ok&&t.status===404&&(e=void 0,t=await ne());let n=j(t);if(n.kind===`active`&&t.ok){r=t.data.id,i(r);break}if(n.kind===`error`){d(n.message);return}}catch(e){t(e,{context:`research_background_hatch_poll`})}await Rt(Pt)}for(;;){try{if((await ee(r)).ok)break}catch{}if(n()){d(Lt);return}await Rt(Pt)}u(r)})()},[d,u]),ready:e,assistantId:r,error:a,awaitReady:(0,G.useCallback)(()=>{let e=l.current;return e?.kind===`ready`?Promise.resolve(e.id):e?.kind===`error`?Promise.reject(Error(e.message)):new Promise((e,t)=>{c.current.push({resolve:e,reject:t})})},[])}}async function Bt(e,n){try{await y({path:{assistant_id:e,id:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_archive`})}}var Vt=[`admin-copilot`],Ht=[{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 Ut(e){return` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()} `}function Wt(e,t){return e.includes(` ${t} `)}function Gt(e){let t=Ut(e),n=[];for(let{plugin:e,keywords:r}of Ht)r.some(e=>Wt(t,e))&&n.push(e);return n}function Kt(e,t){let n=[...Vt,...Gt(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 qt=1500,Jt=12e4,Yt=2;function Xt({complete:e,stableReads:t}){return e&&t>=Yt}var Zt=`vellum-ai`,Qt=new Set([`simple-memory`,`level-up`]);function $t(e){let t=e.trim().split(/(?<=\.)\s/)[0]?.trim()??e.trim();return t.length>100?`${t.slice(0,97).trimEnd()}…`:t}function en(e){return e?.split(`/`)[0]?.trim()??``}function tn(e){let t=[],n=new Set;for(let r of e){let e=r.name?.trim(),i=r.description?.trim();!e||!i||en(r.source?.repo)===Zt&&(Qt.has(e)||(n.add(e),t.push({name:e,description:$t(i)})))}return{capabilities:t,validNames:n}}async function nn(e){try{return tn((await b({path:{assistant_id:e},throwOnError:!1})).data?.matches??[])}catch(e){return t(e,{context:`research_onboarding_catalog`}),{capabilities:[],validNames:new Set}}}async function rn(e,n){try{await w({path:{assistant_id:e},body:{name:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_install`})}}var an=e=>new Promise(t=>setTimeout(t,e));function on({role:e,validNames:t,modelPlugins:n}){return[...new Set([...Kt(e,t),...n.filter(e=>t.has(e))])]}function sn(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||n.role!==`assistant`)continue;let r=n.contentBlocks;if(r&&r.length>0){let e=r.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
36
|
-
`).trim();if(e)return e}return(n.content??``).trim()}return``}function cn(){let[e,n]=(0,G.useState)({status:`idle`,claims:[],suggestions:[],installedPlugins:[]}),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})=>{let u=JSON.stringify(o);if(i.current===u)return;i.current=u;let d=r.current+1;r.current=d;let f=()=>r.current!==d,p=()=>{};s.current=new Promise(e=>{p=e}),a.current.clear(),n({status:`running`,claims:[],suggestions:[],installedPlugins:[]}),(async()=>{let r,i;try{let t=await e();if(r=t,f())return;let{capabilities:s,validNames:c}=await nn(t);if(f())return;c.size===0&&p();let u=a.current,d=Kt(o.occupation,c);for(let e of d)u.has(e)||u.set(e,rn(t,e));d.length>0&&n(e=>({...e,installedPlugins:d}));let m=await x({path:{assistant_id:t},body:{conversationType:`standard`,...l?{title:l}:{}},throwOnError:!1});if(i=m.data?.id,f())return;let h=m.data?.id;if(!m.response?.ok||!h){n(e=>({...e,status:`error`}));return}let g={conversationId:h,content:Nt(o,s),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(g.clientTimezone=e)}catch{}let _=await C({path:{assistant_id:t},body:g,throwOnError:!1});if(f())return;if(!_.response?.ok){n(e=>({...e,status:`error`}));return}let v=Date.now()+Jt,y=``,b=0;for(;Date.now()<v;){if(await an(qt),f())return;let e=await S({path:{assistant_id:t},query:{conversationId:h},throwOnError:!1});if(f())return;let r=sn(e.data?.messages??[]);if(r){let{claims:e,suggestions:i,plugins:a,pluginsResolved:s,complete:l}=Fe(r),d=a.filter(e=>c.has(e));for(let e of d)u.has(e)||u.set(e,rn(t,e));if(s&&p(),n({status:`running`,claims:e,suggestions:i,installedPlugins:on({role:o.occupation,validNames:c,modelPlugins:d})}),b=r===y?b+1:0,y=r,Xt({complete:l,stableReads:b}))break}}if(f())return;n(e=>({...e,status:`done`}))}catch(e){if(f())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}finally{p(),r&&i&&(await Bt(r,i),Re(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 rn(await t(),r)}catch{}})())}},[]);return{...e,start:l,awaitPluginInstalls:u,hydrate:d}}function ln(e){return e?`research_onboarding:${e}`:null}function un(e){let t=ln(e);if(!t)return null;try{let e=sessionStorage.getItem(t);return e?JSON.parse(e):null}catch{return null}}function dn(e,t){let n=ln(e);if(n)try{sessionStorage.setItem(n,JSON.stringify(t))}catch{}}function fn(e){let t=ln(e);if(t)try{sessionStorage.removeItem(t)}catch{}}function pn(e){return e.research?.status===`done`?`suggestions`:e.step===`meeting`?e.checkinBooked?`looking`:`letschat`:e.step}function mn(e,t){if(!e)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;try{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`,...t?{timeZone:t}:{}}).format(n)}catch{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n)}}var q=s(),hn={w:1280,h:800};function gn(){return typeof window>`u`?hn:{w:window.innerWidth,h:window.innerHeight}}function _n(){let[e,t]=(0,G.useState)(null),[n,r]=(0,G.useState)(()=>gn());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 vn=(0,G.createContext)(null);function yn({size:e,children:t}){return(0,q.jsx)(vn.Provider,{value:e,children:t})}function bn(){let e=(0,G.useContext)(vn),[t,n]=(0,G.useState)(()=>gn());return(0,G.useEffect)(()=>{if(e)return;let t=()=>n(gn());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var xn={x:.5,y:.4},Sn=[-8,6,9,0,7,-6,5,0,-7,4,-5,6];function Cn(e){return Sn[e%Sn.length]??0}function wn(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function Tn(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function En(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 Dn(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 On({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=bn(),u=V(),d=c<640,f=new Set([4,7,8,9,10]),p=e=>d&&f.has(e),m=wn(c,l),h=m/2,g=m/2,_=Tn(c,l)/m,v=Tn(c,l),y=(0,G.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),b=xn.x*c,x=xn.y*l,S=b-h,C=x-h,w=(0,G.useMemo)(()=>En(c,l,g),[c,l,g]);return(0,q.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0 overflow-hidden`,children:[(0,q.jsx)(`div`,{className:`absolute rounded-[50%] bg-[var(--aux-black,#000)] opacity-20 blur-md`,style:{width:v*.62,height:16,left:b-v*.31,top:x+v*.4}}),t.map((t,r)=>{let d=r===n,f=!u&&i?.char===r,g=!u&&a?.char===r;if(f){let n=w[i.fromSlot],a=Dn(n,b,x,c,l);return(0,q.jsx)(B.div,{className:`absolute left-0 top-0`,style:{width:m,height:m},initial:!1,animate:{x:[n.x-h,a.x-h,a.x-h,S,S,S],y:[n.y-h,a.y-h,a.y-h,C,C,C],scale:[1,1,1,_*.7,_*1.08,_],opacity:[1,1,0,0,1,1]},transition:{duration:.85,times:[0,.28,.34,.42,.72,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},onAnimationComplete:()=>o(r),children:(0,q.jsx)(H,{components:e,traits:t,size:m})},r)}if(g){if(p(a.toSlot))return null;let n=w[a.toSlot],i=Dn(n,b,x,c,l);return(0,q.jsx)(B.div,{className:`absolute left-0 top-0`,style:{width:m,height:m},initial:!1,animate:{x:[S,S,i.x-h,i.x-h,n.x-h,n.x-h],y:[C,C,i.y-h,i.y-h,n.y-h,n.y-h],scale:[_,_*.6,1,1,1.1,1],opacity:[1,0,0,1,1,1]},transition:{duration:.85,times:[0,.28,.34,.45,.78,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},children:(0,q.jsx)(`div`,{style:{transform:`rotate(${Cn(a.toSlot)}deg)`},children:(0,q.jsx)(H,{components:e,traits:t,size:m,breathe:!1})})},r)}let v=y.get(r)??0;if(!d&&p(v))return null;let T=d?{x:b,y:x}:w[v];return(0,q.jsx)(B.div,{className:`absolute left-0 top-0 ${d?``:`pointer-events-auto cursor-pointer`}`,style:{width:m,height:m},initial:!1,animate:{x:T.x-h,y:T.y-h,scale:d?_:1,opacity:1},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:d?void 0:()=>s(r),children:(0,q.jsx)(`div`,{style:{transform:d?void 0:`rotate(${Cn(y.get(r)??0)}deg)`},children:(0,q.jsx)(H,{components:e,traits:t,size:m,breathe:d})})},r)})]})}var kn=[{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`},{bodyShape:`star`,eyeStyle:`surprised`,color:`orange`},{bodyShape:`blob`,eyeStyle:`gentle`,color:`pink`},{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},{bodyShape:`urchin`,eyeStyle:`curious`,color:`pink`},{bodyShape:`burst`,eyeStyle:`quirky`,color:`orange`},{bodyShape:`ghost`,eyeStyle:`bashful`,color:`green`},{bodyShape:`sprout`,eyeStyle:`dazed`,color:`orange`},{bodyShape:`star`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`flower`,eyeStyle:`angry`,color:`pink`},{bodyShape:`cloud`,eyeStyle:`curious`,color:`yellow`}],J=f(d((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:kn,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 An(){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 jn(){let e=W(),t=J.use.characters(),n=J.use.ensureGenerated(),r=V(),{w:i,h:a}=An();(0,G.useEffect)(()=>{e&&n(e)},[e,n]);let o=wn(i,a),s=(0,G.useMemo)(()=>En(i,a,o/2),[i,a,o]),c=i<640,l=new Set([4,7,8,9,10]);return!e||t.length===0?null:(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 z-0 overflow-hidden`,children:t.map((t,n)=>{if(n===0)return null;let i=n-1;if(c&&l.has(i))return null;let a=s[i];if(!a)return null;let u=Sn[i%Sn.length]??0;return(0,q.jsx)(`div`,{className:`absolute`,style:{left:a.x-o/2,top:a.y-o/2,width:o,height:o,animation:r?void 0:`character-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) ${.1+n*.05}s both`},children:(0,q.jsx)(`div`,{style:{transform:`rotate(${u}deg)`},children:(0,q.jsx)(H,{components:e,traits:t,size:o,breathe:!1})})},n)})})}var Mn=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)]`),Nn=c(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`);function Y(e){return e.trim().toLowerCase()}function Pn(e,t,n=[],r=8){let i=Y(t),a=new Set(n.map(Y)),o=[];for(let t of e)if(!a.has(Y(t))&&((i.length===0||Y(t).includes(i))&&o.push(t),o.length>=r))break;return o}function Fn({id:e,items:t,highlighted:n,onPick:r,onHover:i}){return(0,q.jsx)(`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,a)=>(0,q.jsx)(`li`,{id:`${e}-opt-${a}`,role:`option`,"aria-selected":a===n,onMouseDown:e=>{e.preventDefault(),r(t)},onMouseEnter:()=>i(a),className:c(`cursor-pointer rounded-md px-2.5 py-1.5 text-body-medium-lighter`,`text-[var(--content-default)]`,a===n?`bg-[var(--surface-base)]`:`bg-transparent`),children:t},t))})}function In({htmlFor:e,required:t,children:n}){return(0,q.jsxs)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:[n,t?(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`}):null]})}function Ln(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 Rn({label:e,placeholder:t,value:n,onChange:r,suggestions:i,autoFocus:a,required:o}){let s=(0,G.useId)(),l=`ac-${s}`,u=`ac-list-${s}`,d=(0,G.useRef)(null),[f,p]=(0,G.useState)(!1),[m,h]=(0,G.useState)(-1),g=(0,G.useMemo)(()=>Pn(i,n),[i,n]);Ln(d,()=>p(!1)),(0,G.useEffect)(()=>{h(e=>e>=g.length?g.length-1:e)},[g.length]);let _=f&&g.length>0;function v(e){r(e),p(!1),h(-1)}function y(e){e.key===`ArrowDown`?(e.preventDefault(),p(!0),h(e=>Math.min(e+1,g.length-1))):e.key===`ArrowUp`?(e.preventDefault(),h(e=>Math.max(e-1,0))):e.key===`Enter`&&_&&m>=0?(e.preventDefault(),v(g[m])):e.key===`Escape`&&p(!1)}return(0,q.jsxs)(`div`,{ref:d,className:`relative flex flex-col gap-1.5`,children:[(0,q.jsx)(In,{htmlFor:l,required:o,children:e}),(0,q.jsx)(`div`,{className:c(Mn,`h-9`),children:(0,q.jsx)(`input`,{id:l,role:`combobox`,"aria-required":o,"aria-expanded":_,"aria-controls":u,"aria-autocomplete":`list`,"aria-activedescendant":m>=0?`${u}-opt-${m}`:void 0,autoComplete:`off`,autoFocus:a,className:Nn,placeholder:t,value:n,onChange:e=>{r(e.target.value),p(!0)},onFocus:()=>p(!0),onKeyDown:y})}),_&&(0,q.jsx)(Fn,{id:u,items:g,highlighted:m,onPick:v,onHover:h})]})}function zn({label:e,placeholder:t,values:n,onChange:r,suggestions:i}){let a=(0,G.useId)(),o=`tac-${a}`,s=`tac-list-${a}`,u=(0,G.useRef)(null),[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(-1),_=(0,G.useMemo)(()=>Pn(i,d,n),[i,d,n]);Ln(u,()=>m(!1)),(0,G.useEffect)(()=>{g(e=>e>=_.length?_.length-1:e)},[_.length]);let v=p&&_.length>0;function y(e){let t=e.trim();t&&(n.some(e=>Y(e)===Y(t))||r([...n,t]),f(``),g(-1))}function b(e){r(n.filter(t=>t!==e))}function x(e){e.key===`ArrowDown`?(e.preventDefault(),m(!0),g(e=>Math.min(e+1,_.length-1))):e.key===`ArrowUp`?(e.preventDefault(),g(e=>Math.max(e-1,0))):e.key===`Enter`?v&&h>=0?(e.preventDefault(),y(_[h])):d.trim()&&(e.preventDefault(),y(d)):e.key===`,`?(e.preventDefault(),y(d)):e.key===`Backspace`&&d.length===0&&n.length>0?b(n[n.length-1]):e.key===`Escape`&&m(!1)}return(0,q.jsxs)(`div`,{ref:u,className:`relative flex flex-col gap-1.5`,children:[(0,q.jsx)(In,{htmlFor:o,children:e}),(0,q.jsxs)(`div`,{className:c(Mn,`min-h-9 flex-wrap py-1.5`),children:[n.map(e=>(0,q.jsx)(l,{onRemove:()=>b(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,q.jsx)(`input`,{id:o,role:`combobox`,"aria-expanded":v,"aria-controls":s,"aria-autocomplete":`list`,"aria-activedescendant":h>=0?`${s}-opt-${h}`:void 0,autoComplete:`off`,className:c(Nn,`h-6 w-24`),placeholder:n.length===0?t:``,value:d,onChange:e=>{f(e.target.value),m(!0)},onFocus:()=>m(!0),onKeyDown:x})]}),v&&(0,q.jsx)(Fn,{id:s,items:_,highlighted:h,onPick:y,onHover:g})]})}var Bn=`Software Engineer.Product Manager.Product Designer.Founder / CEO.Engineering Manager.Data Scientist.Marketing Manager.Growth Marketer.Content Writer.Sales Representative.Account Executive.Customer Success Manager.Operations Manager.Project Manager.Program Manager.Business Analyst.Data Engineer.Machine Learning Engineer.DevOps Engineer.Solutions Architect.UX Researcher.Graphic Designer.Recruiter.HR Manager.Financial Analyst.Accountant.Consultant.Investor / VC.Lawyer.Teacher.Professor.Researcher.Doctor / Physician.Nurse.Real Estate Agent.Executive Assistant.Entrepreneur.Freelancer.Student`.split(`.`),Vn=`Reading.Writing.Cooking.Baking.Gardening.Photography.Painting.Drawing.Hiking.Running.Cycling.Swimming.Yoga.Climbing.Weightlifting.Gaming.Board games.Chess.Traveling.Cars.Woodworking.Knitting.Playing guitar.Playing piano.Singing.Dancing.Fishing.Camping.Surfing.Skiing.Snowboarding.Coffee.Wine.Birdwatching.Pottery.Investing.Podcasts.Movies.Soccer.Basketball.Tennis.Golf.Meditation.Volunteering.Astronomy.3D printing`.split(`.`);function X(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function Hn({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[i,a]=(0,G.useState)(e),[o,s]=(0,G.useState)(t),[c,l]=(0,G.useState)(``),[d,f]=(0,G.useState)([]),p=i.trim().length>0&&c.trim().length>0;function m(){p&&n({firstName:i,lastName:o,role:c,hobbies:d})}return(0,q.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,q.jsxs)(ze,{showCreatureFooter:!1,children:[(0,q.jsx)(jn,{}),(0,q.jsxs)(`form`,{className:`relative z-10 mx-auto flex min-h-screen w-full max-w-sm flex-col items-center justify-center px-6 py-16 text-[var(--content-default)]`,onSubmit:e=>{e.preventDefault(),m()},children:[(0,q.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:X(.05),children:`Let's start with you.`}),(0,q.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:X(.12),children:`A few details so I can get to know you.`}),(0,q.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,q.jsx)(`div`,{style:X(.2,40),children:(0,q.jsx)(u,{label:(0,q.jsxs)(q.Fragment,{children:[`What should I call you?`,(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`})]}),placeholder:`Your name`,value:i,onChange:e=>a(e.target.value),autoFocus:!0,required:!0,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.27,30),children:(0,q.jsx)(u,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.34,20),children:(0,q.jsx)(Rn,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:l,suggestions:Bn,required:!0})}),(0,q.jsx)(`div`,{style:X(.41,10),children:(0,q.jsx)(zn,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:d,onChange:f,suggestions:Vn})})]}),(0,q.jsx)(`div`,{className:`mt-10 w-full`,style:X(.5),children:(0,q.jsx)(r,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(U,{size:16}),fullWidth:!0,disabled:!p,className:`h-11 text-base`,children:`Continue`})})]})]})})}var Un=`#1A1A1A`,Wn=`#FFFFFF`;function Gn(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 Kn(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 qn(e){let t=Gn(e)>.6;return{bg:e,isLight:t,fg:t?Un:Wn,fgDeep:Kn(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 Z(){let e=W(),t=J.use.characters(),n=J.use.selectedIndex();return(0,G.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return qn(i??`var(--surface-base)`)},[e,t,n])}function Q({onBack:e,onNext:t,tone:n}){let r=Z(),i=n?n===`dark`?`#1A1A1A`:`#FFFFFF`:r.fg,a=n?n===`dark`?`rgba(0,0,0,0.08)`:`rgba(255,255,255,0.12)`:r.wash;return(0,q.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Back`,className:`flex h-8 w-8 items-center justify-center rounded-md transition-colors duration-150`,style:{color:i},onMouseEnter:e=>e.currentTarget.style.backgroundColor=a,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:(0,q.jsx)(m,{className:`h-5 w-5`})}),t?(0,q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Forward`,className:`flex h-8 w-8 items-center justify-center rounded-md transition-colors duration-150`,style:{color:i},onMouseEnter:e=>e.currentTarget.style.backgroundColor=a,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:(0,q.jsx)(h,{className:`h-5 w-5`})}):null]})}var Jn=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function Yn(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function Xn({onContinue:e,onBack:t,onForward:n}){let i=W(),a=J.use.characters(),o=J.use.ensureGenerated(),s=J.use.selectedIndex(),c=J.use.setSelectedIndex();(0,G.useEffect)(()=>{i&&o(i)},[i,o]);let l=a.length,[u,d]=(0,G.useState)(null),[f,m]=(0,G.useState)(``),[h,g]=(0,G.useState)(!1),v=(0,G.useRef)(!1),y=(0,G.useRef)(null),{ref:b,size:x}=_n(),[S,C]=(0,G.useState)(null);(0,G.useEffect)(()=>{l>0&&u===null&&d(Yn(l,s))},[l,s,u]),(0,G.useEffect)(()=>{u&&c(u.centerChar)},[u,c]);let w=u?.centerChar;(0,G.useEffect)(()=>{w!=null&&!v.current&&m(Jn[w%Jn.length])},[w]),(0,G.useEffect)(()=>{h&&(y.current?.focus(),y.current?.select())},[h]);function T(e){if(!u||e===u.centerChar)return;let t=u.edgeOrder.indexOf(e);if(t<0)return;let n=[...u.edgeOrder];n[t]=u.centerChar,C({entering:{char:e,fromSlot:t},exiting:{char:u.centerChar,toSlot:t}}),d({centerChar:e,edgeOrder:n})}let E=()=>u&&T((u.centerChar+1)%l),D=()=>u&&T((u.centerChar-1+l)%l),O=(0,G.useMemo)(()=>u?a[u.centerChar]:void 0,[u,a]),k=!!i&&!!u&&!!O;function A(){O&&e({traits:O,name:f.trim()})}let j=`pointer-events-auto z-10 flex h-10 w-10 items-center justify-center rounded-full bg-[color-mix(in_srgb,var(--content-default)_10%,transparent)] text-[var(--content-default)] transition-colors duration-150 hover:bg-[color-mix(in_srgb,var(--content-default)_18%,transparent)]`;return(0,q.jsx)(`div`,{ref:b,"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,q.jsxs)(yn,{size:x,children:[k&&(0,q.jsx)(On,{components:i,characters:a,centerChar:u.centerChar,edgeOrder:u.edgeOrder,entering:S?.entering??null,exiting:S?.exiting??null,onEnterComplete:e=>C(t=>t?.entering.char===e?null:t),onSelectChar:T}),(0,q.jsx)(Q,{tone:`light`,onBack:t,onNext:n?A:void 0}),(0,q.jsx)(`h1`,{className:`absolute left-1/2 top-[19%] z-10 -translate-x-1/2 whitespace-nowrap text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.4s ease-out both`},children:`Give me a face and a name`}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:D,className:`absolute left-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${j}`,children:(0,q.jsx)(p,{className:`h-4 w-4`})}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:E,className:`absolute right-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${j}`,children:(0,q.jsx)(U,{className:`h-4 w-4`})}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[51%] z-10 flex -translate-x-1/2 flex-col items-center gap-12`,children:[h?(0,q.jsx)(`input`,{ref:y,value:f,onChange:e=>{v.current=!0,m(e.target.value)},onBlur:()=>g(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),g(!1))},placeholder:`Name your assistant`,"aria-label":`Assistant name`,className:`w-[234px] rounded-2xl border border-[var(--border-element)] bg-transparent px-4 py-2.5 text-center text-lg text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-colors duration-150 focus:border-[var(--border-active)]`}):(0,q.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),"aria-label":`Edit name`,className:`flex items-center gap-2.5`,children:[(0,q.jsx)(`span`,{className:`text-3xl font-medium ${f?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:f||`Name your assistant`}),(0,q.jsx)(_,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,q.jsx)(r,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(U,{size:16}),disabled:!k,onClick:A,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})})}var Zn=`absolute left-1/2 top-[30%] z-10 flex w-full -translate-x-1/2 flex-col items-center gap-8 px-6 text-center`,Qn=/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,$n=/[MmLlHhVvCcSsQqTtAaZz][^MmLlHhVvCcSsQqTtAaZz]*/g;function er(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($n)??[];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(Qn)??[]).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 tr(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 nr=.25,rr=.46,ir=.3,ar=.85,or=40,sr=14,cr=8;function lr({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0,settleBlink:r=!0}){let i=W(),a=J.use.characters(),o=J.use.selectedIndex(),s=V(),{w:c,h:l}=bn(),[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=At();(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:tr(e.paths.map(e=>er(e.svgPath)))}:null},[i,v]);if(!y)return null;let b=c*ar,x=Math.min(Math.min(c,l)*ir,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,C=(c-S)/2,w=l-(1-nr)*x,T=or/100*l-(w+x/2),E=(rr-nr)*x,D=y.bbox.x+y.bbox.w/2,O=y.bbox.y+y.bbox.h/2;return(0,q.jsx)(B.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2]`,style:{left:C,top:w,width:S,height:x,transformOrigin:`center`},initial:f?{y:T,scale:.35}:!1,animate:f?{y:[T,E,0],scale:[.35,1,1]}:{y:0,scale:1},transition:f?{duration:1,delay:t,times:[0,.7,1],ease:`easeInOut`}:{duration:0},onAnimationComplete:()=>_(!0),children:(0,q.jsx)(B.div,{animate:p,children:(0,q.jsx)(`div`,{style:{transform:`translate(${u.x*sr}px, ${u.y*cr}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,q.jsx)(`svg`,{viewBox:`${y.bbox.x} ${y.bbox.y} ${y.bbox.w} ${y.bbox.h}`,width:S,height:x,style:{overflow:`visible`,display:`block`},children:(0,q.jsx)(`g`,{style:{transform:m?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${D}px ${O}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,q.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}var ur=200,dr=40;function fr({firstName:e,assistantName:t,onContinue:n,onBack:r,onForward:i}){let a=W(),o=J.use.characters(),s=J.use.selectedIndex(),c=V(),{ref:l,size:{w:u,h:d}}=_n(),f=Z(),p=o.length>0?o[s]:void 0,m=(0,G.useMemo)(()=>{if(!a||!p)return null;let e=a.bodyShapes.find(e=>e.id===p.bodyShape),t=a.colors.find(e=>e.id===p.color);return!e||!t?null:{body:e,color:t.hex}},[a,p]),h=e.trim()?`Hey, ${e.trim()}!`:`Hey!`,g=t?.trim()?`I’m ${t.trim()}, your new AI assistant`:`I’m your new AI assistant`;if(!m)return(0,q.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,style:{backgroundColor:`var(--surface-base)`}});let _=1.25*Math.max(u,d),v=_*m.body.viewBox.height/m.body.viewBox.width,y=(u-_)/2,b=(d-v)/2,x=ur/_,S=(dr/100-.5)*d;return(0,q.jsx)(`div`,{ref:l,"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:(0,q.jsxs)(yn,{size:{w:u,h:d},children:[(0,q.jsx)(B.div,{className:`absolute inset-0 z-0`,style:{backgroundColor:m.color},initial:c?!1:{opacity:0},animate:{opacity:1},transition:c?{duration:0}:{duration:.6,delay:.35}}),(0,q.jsx)(B.svg,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,viewBox:`0 0 ${m.body.viewBox.width} ${m.body.viewBox.height}`,width:_,height:v,style:{left:y,top:b,transformOrigin:`center`},initial:c?!1:{scale:x,y:S},animate:{scale:1,y:0},transition:c?{duration:0}:{type:`spring`,stiffness:78,damping:18,mass:1},children:(0,q.jsx)(`path`,{d:m.body.svgPath,fill:m.color})}),(0,q.jsx)(lr,{entrance:!0}),(0,q.jsx)(B.div,{initial:c?!1:{opacity:0},animate:{opacity:1},transition:c?{duration:0}:{duration:.4,delay:1},children:(0,q.jsx)(Q,{onBack:r,onNext:i})}),(0,q.jsxs)(`div`,{className:Zn,children:[(0,q.jsxs)(B.h1,{className:`text-center leading-[1.05]`,style:{fontFamily:`var(--font-serif)`},initial:c?!1:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:c?{duration:0}:{type:`spring`,stiffness:260,damping:11,delay:1},children:[(0,q.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:f.fgDeep},children:h}),(0,q.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:f.fg},children:g})]}),(0,q.jsxs)(B.button,{type:`button`,onClick:n,className:`flex h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] bg-black text-body-medium-default text-white transition-transform duration-150 active:scale-[0.97]`,initial:c?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:c?{duration:0}:{duration:.4,delay:1.15},children:[`Continue`,(0,q.jsx)(U,{className:`h-4 w-4`})]})]})]})})}var pr=.3,mr=.85,hr=.25;function gr(){let e=W(),t=J.use.characters(),n=J.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=bn(),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:tr(t.paths.map(e=>er(e.svgPath)))}:null},[e,r]),s=o?Math.min(Math.min(i,a)*pr,i*mr*o.bbox.h/o.bbox.w):0;return{art:o,eyesW:o?s*o.bbox.w/o.bbox.h:0,eyesH:s,restCy:a-hr*s,centerX:i/2,w:i,h:a}}function _r({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=$e(i,e=>e-n/2),u=e.bbox.x+e.bbox.w/2,d=e.bbox.y+e.bbox.h/2;return(0,q.jsx)(B.div,{"aria-hidden":`true`,className:c,style:{left:r-t/2,top:0,x:o,y:l,width:t,height:n,scale:a,transformOrigin:`center`},children:(0,q.jsx)(`svg`,{viewBox:`${e.bbox.x} ${e.bbox.y} ${e.bbox.w} ${e.bbox.h}`,width:t,height:n,style:{overflow:`visible`,display:`block`},children:(0,q.jsx)(`g`,{style:{transform:s?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${u}px ${d}px`,transition:`transform 0.13s ease-in-out`},children:e.paths.map((e,t)=>(0,q.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})}var vr={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 yr(e,t){let n=vr[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var br=new Set([`orange`,`pink`,`red`]);function xr(e,t){return br.has(e)&&br.has(t)}function Sr(e,t,n){let r=yr(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>xr(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var Cr=`You’ve used AI that just answers questions`,wr=`The more I help`,Tr=`I’m different`,Er=`The better I get`,Dr=`and the less you have to do`,Or=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],kr=290;function Ar({firstH:e,secondH:t,color:n,firstText:r,secondText:i,revealed:a,carouseled:o,revealFrom:s,revealDuration:c,reduce:l}){let u=s===`bottom`?`inset(100% 0 0 0)`:`inset(0 0 100% 0)`;return!e||!t?null:(0,q.jsx)(B.div,{className:`relative w-full overflow-hidden`,initial:!1,animate:{height:o?t:e},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:(0,q.jsxs)(B.div,{className:`flex flex-col`,style:{color:n},initial:!1,animate:{y:o?-e:0},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:[(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:e},children:(0,q.jsx)(B.span,{className:`block`,initial:!1,animate:{clipPath:a?`inset(0% 0 0% 0)`:u},transition:l?{duration:0}:{duration:c,ease:`easeOut`},children:r})}),(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:t},children:(0,q.jsx)(`span`,{className:`block`,children:i})})]})})}function jr({onContinue:e,onBack:t,onForward:n}){let r=Z(),i=V(),{art:a,eyesW:o,eyesH:s,restCy:c,centerX:l,w:u,h:d}=gr(),f=W(),p=J.use.characters(),m=J.use.selectedIndex(),h=p.length>0?p[m]:void 0,g=d>0&&d<=800,_=g?.17:.22,v=g?`top-[17%]`:`top-[22%]`,y=Xe(0),b=Xe(1),x=(0,G.useMemo)(()=>!f||!h?`orange`:Sr(h.color,f.colors.map(e=>e.id),1)[0]??`orange`,[f,h]),S=Math.min(220,Math.max(150,u*.16)),C=-S,w=-S*.4,T=Xe(-220),E=(0,G.useMemo)(()=>!f||!h?[]:Sr(h.color,f.colors.map(e=>e.id),3),[f,h]),D=Math.max(.42,Math.min(u/1100,1)),O=Math.round(kr*D),k=-O*1.1,A=-O*.42,j=Xe(-320),[ee,te]=(0,G.useState)(!!i),[ne,re]=(0,G.useState)(!!i),[ie,ae]=(0,G.useState)(!1),[oe,M]=(0,G.useState)(!1),[se,N]=(0,G.useState)(!1),[ce,le]=(0,G.useState)(!1),[ue,de]=(0,G.useState)(!!i),P=Math.min(u,768)-48,fe=(0,G.useRef)(null),F=(0,G.useRef)(null),I=(0,G.useRef)(null),L=(0,G.useRef)(null),pe=(0,G.useRef)(null),[me,R]=(0,G.useState)(0),[he,z]=(0,G.useState)(0),[ge,_e]=(0,G.useState)(0),[ve,ye]=(0,G.useState)(0),[be,xe]=(0,G.useState)(0);return(0,G.useLayoutEffect)(()=>{fe.current?.offsetHeight&&R(fe.current.offsetHeight),F.current?.offsetHeight&&z(F.current.offsetHeight),I.current?.offsetHeight&&_e(I.current.offsetHeight),L.current?.offsetHeight&&ye(L.current.offsetHeight),pe.current?.offsetHeight&&xe(pe.current.offsetHeight)},[P]),(0,G.useEffect)(()=>{y.set(c),le(!0)},[c,y]),(0,G.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>{ae(!0),M(!0),N(!0)},1400);return()=>clearTimeout(e)},[i]),(0,G.useEffect)(()=>{if(i||!a)return;y.set(c),b.set(1),T.set(C),j.set(k),te(!1),re(!1),ae(!1),M(!1);let e=Math.max(s*.5,d*_-36),t=[],n=[],r=!1,o=e=>(t.push(e),e),l=e=>new Promise(t=>{n.push(setTimeout(t,e))});return(async()=>{if(await l(200),r||(te(!0),await Promise.all([o(K(y,e,{duration:.55,ease:`easeOut`})),o(K(b,.55,{duration:.55,ease:`easeOut`}))]),r)||(re(!0),await Promise.all([o(K(y,c,{type:`spring`,stiffness:210,damping:15})),o(K(b,1,{duration:.45,ease:`easeOut`}))]),r)||(await l(900),r)||(ae(!0),M(!0),await o(K(T,[C,w,w,C],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`})),r)||(await l(150),r))return;N(!0);let t=o(K(j,[k,A,A,k],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`}));await l(700),!r&&(de(!0),await t)})(),()=>{r=!0,t.forEach(e=>e.stop()),n.forEach(clearTimeout)}},[i,a,d,_,s,c,y,b,T,C,w,j,k,A]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:r.fg},children:[(0,q.jsx)(Q,{onBack:t,onNext:n}),(0,q.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none invisible absolute -left-[9999px] top-0 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.15]`,style:{width:P,fontFamily:`var(--font-serif)`},children:[(0,q.jsx)(`span`,{ref:fe,className:`block`,children:Cr}),(0,q.jsx)(`span`,{ref:F,className:`block`,children:wr}),(0,q.jsx)(`span`,{ref:I,className:`block`,children:Tr}),(0,q.jsx)(`span`,{ref:L,className:`block`,children:Er}),(0,q.jsx)(`span`,{ref:pe,className:`block`,children:Dr})]}),ce&&a&&(0,q.jsx)(_r,{art:a,eyesW:o,eyesH:s,centerX:l,eyeCy:y,eyeScale:b,blinking:!1}),!i&&f&&(0,q.jsx)(B.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{left:Math.max(16,u*.05),top:0,y:T,width:S,height:S},children:(0,q.jsx)(H,{components:f,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:x},size:S,breathe:!1})}),!i&&f&&(0,q.jsx)(B.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:Or.map((e,t)=>(0,q.jsx)(`div`,{style:{width:O,height:O,marginLeft:t===0?0:-O*.34,zIndex:Or.length-t},children:(0,q.jsx)(H,{components:f,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:E[t]??`teal`},size:O,breathe:!1})},e.bodyShape))}),(0,q.jsxs)(`div`,{className:`${Zn.replace(`top-[30%]`,v)} max-w-3xl`,children:[(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.15]`,style:{fontFamily:`var(--font-serif)`},children:[(0,q.jsx)(Ar,{firstH:me,secondH:he,color:r.fgDeep,firstText:Cr,secondText:wr,revealed:ee,carouseled:ie,revealFrom:`bottom`,revealDuration:.55,reduce:!!i}),(0,q.jsx)(Ar,{firstH:ge,secondH:ve,color:r.fg,firstText:Tr,secondText:Er,revealed:ne,carouseled:oe,revealFrom:`top`,revealDuration:.45,reduce:!!i}),(0,q.jsx)(B.div,{className:`relative w-full overflow-hidden`,style:{color:r.fg},initial:!1,animate:{height:se?be:0},transition:i?{duration:0}:{duration:.5,ease:`easeInOut`},children:be>0&&(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:be},children:(0,q.jsx)(B.span,{className:`block`,initial:!1,animate:{clipPath:se?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:i?{duration:0}:{duration:.5,ease:`easeOut`},children:Dr})})})]}),ue&&(0,q.jsxs)(B.button,{type:`button`,onClick:e,className:`flex h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] bg-black text-body-medium-default text-white transition-transform duration-150 active:scale-[0.97]`,initial:i?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:i?{duration:0}:{duration:.4},children:[`Continue`,(0,q.jsx)(U,{className:`h-4 w-4`})]})]})]})}function Mr({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cs-${e}`;return(0,q.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,q.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,q.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,q.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,q.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,q.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`45.5`,fill:`none`,stroke:`#FFF6CF`,strokeOpacity:`0.6`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeDasharray:`70 210`,transform:`rotate(-128 50 50)`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,q.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,children:[(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#F4C12A`,children:`$`})]}),(0,q.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,q.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${i})`})]})}function Nr({size:e,tiltX:t=0,tiltY:n=0,shadow:r=!0,spinning:i=!1,className:a}){return(0,q.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[r&&(0,q.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,left:`50%`,bottom:-e*.14,width:e*.74,height:e*.16,transform:`translateX(-50%)`,background:`radial-gradient(ellipse at center, rgba(0,0,0,0.22), rgba(0,0,0,0) 70%)`,filter:`blur(2px)`}}),(0,q.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,q.jsxs)(B.div,{className:a,style:{width:e,height:e,position:`relative`,transformStyle:`preserve-3d`},initial:!1,animate:{rotateX:t,rotateY:i?[n,n+360,n+760,n+1180]:n},transition:i?{duration:.95,times:[0,.32,.62,1],ease:`easeInOut`}:{duration:0},children:[(0,q.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(0.5px)`},children:(0,q.jsx)(Mr,{idSuffix:`front`})}),(0,q.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,q.jsx)(Mr,{idSuffix:`back`})})]})})]})}var Pr=.3,Fr=.95;function Ir({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=V(),a=Z(),{h:o}=bn(),[s,c]=(0,G.useState)(!1);function l(){if(!s){if(c(!0),i){e();return}window.setTimeout(t,Pr*1e3)}}let u=o*.42,d=-o*.08,f=o*.9;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Q,{onBack:n,onNext:r}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-full max-w-xl -translate-x-1/2 flex-col items-center gap-3 px-6 text-center`,children:[(0,q.jsx)(`h1`,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here are some free credits to get started`}),(0,q.jsx)(`div`,{className:`mt-8 flex flex-col items-center gap-4`,children:(0,q.jsx)(B.div,{animate:s&&!i?{y:[0,u,d,f],scale:[1,1,1,.2],opacity:[1,1,1,0]}:{},transition:{duration:Fr,times:[0,Pr/Fr,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]},onAnimationComplete:()=>{s&&e()},children:(0,q.jsx)(Nr,{size:88,spinning:s&&!i})})}),!s&&(0,q.jsxs)(`button`,{type:`button`,onClick:l,className:`mt-6 flex h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97]`,style:{backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Claim`,(0,q.jsx)(U,{className:`h-4 w-4`})]})]})]})}function Lr({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a,missingCalendarScope:o=!1,onRetry:s}){let c=Z(),{handleConnect:l,oauthInProgress:u}=Be({assistantId:e??``,onConnect:n}),d=()=>{s?.(),l()},f=!e||!t,p=f||u;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:c.fg},children:[(0,q.jsx)(Q,{onBack:i,onNext:a}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-[360px] -translate-x-1/2 flex-col items-center gap-5 text-center`,children:[(0,q.jsx)(`h1`,{className:`text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:f?`Almost ready`:o?`Access not enabled`:`Let me make this easy`}),(0,q.jsx)(`p`,{className:`text-[16px]`,style:{color:c.fgMuted},children:f?`Your assistant is still getting ready. Calendar setup will be available in a moment.`:o?`Check the box next to the Google Calendar permission so I can book the check-in.`:`Connect your Google Calendar so I can find time to check in and start helping.`}),(0,q.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-4`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:d,disabled:p,className:`flex 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:c.isLight?`#1A1A1A`:`#FFFFFF`,color:c.isLight?`#FFFFFF`:`#1A1A1A`},children:f?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(g,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):u?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(g,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(0,q.jsx)(`button`,{type:`button`,onClick:r,disabled:u,className:`text-body-small-default transition-opacity hover:opacity-100 disabled:opacity-60`,style:{color:c.fgMuted},children:`Skip for now`})]})]})]})}var Rr=qn(`#17191C`);function zr(){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 Br(){let e=W(),t=J.use.characters(),n=J.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function Vr({size:e=64,isStreaming:t=!1}){let{components:n,chosen:r}=Br();return!n||!r?(0,q.jsx)(`div`,{style:{width:e,height:e}}):(0,q.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,q.jsx)(H,{components:n,traits:r,size:e,isStreaming:t})})}var Hr=64,Ur=4500,Wr=7e3;function Gr({onDone:e,onBack:t,onForward:n,scheduledTime:r,awaitingTime:i}){let{components:a,chosen:o}=Br(),s=V(),{w:c,h:l}=zr(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,G.useEffect)(()=>{let t=setTimeout(e,i&&!r?Wr:Ur);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 m=1.3*Math.max(c,l)/Hr,h=f?c/2-f.cx:0,g=f?l*.88-f.cy:0,_=l*.05;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,q.jsx)(Q,{onBack:t,onNext:n,tone:`light`}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(`div`,{ref:d,className:`relative shrink-0`,style:{width:Hr,height:Hr},children:a&&o&&f&&(0,q.jsx)(B.div,{className:`absolute inset-0`,style:{transformOrigin:`center`},initial:s?!1:{scale:m,x:h,y:g},animate:{x:[h,h,0,0],y:[g,g+_,0,0],scale:[m,m,1.07,1]},transition:s?{duration:0}:{duration:1.1,times:[0,.18,.82,1],ease:[`easeOut`,`easeIn`,`easeOut`]},children:(0,q.jsx)(H,{components:a,traits:o,size:Hr})})}),(0,q.jsx)(B.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 Kr=[`Searching the web to get to know you…`,`Reading public profiles…`,`Connecting the dots…`,`Almost there…`],qr=2800;function Jr({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i}){let a=Rr,[o,s]=(0,G.useState)(0);return(0,G.useEffect)(()=>{n?.(o);let t=o>=Kr.length-1;if(i&&t){let t=setTimeout(e,qr);return()=>clearTimeout(t)}let r=setTimeout(()=>s(e=>(e+1)%Kr.length),qr);return()=>clearTimeout(r)},[o,i,e,n]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Q,{onBack:t,onNext:r}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(Vr,{isStreaming:!0}),(0,q.jsx)(Ne,{mode:`wait`,children:(0,q.jsx)(B.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:Kr[o]},o)})]})]})}function Yr({claims:e,loading:t,onContinue:n,onBack:r,onForward:i}){let a=Rr,o=V(),[s,c]=(0,G.useState)(()=>new Set),l=e.filter(e=>!s.has(e.claim)),u=l.length>0,d=!t;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Q,{onBack:r,onNext:i}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(Vr,{}),(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`This is what I found about you`})]}),(0,q.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:a.fgMuted},children:u?t?`Still checking the rest. You can review these as they come in.`:`I searched the web. Feel free to remove anything that isn’t true`:t?`Still putting this together…`:`I didn’t turn up much — we can fill it in as we chat.`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,q.jsx)(Ne,{children:l.map(e=>(0,q.jsxs)(B.div,{layout:!0,initial:o?!1:{opacity:0,y:10},animate:{opacity:1,y:0},exit:o?void 0:{opacity:0,scale:.95},className:`flex items-center justify-between gap-3 rounded-2xl px-5 py-4 text-[15px]`,style:{backgroundColor:a.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,q.jsx)(`span`,{children:e.claim}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove "${e.claim}"`,onClick:()=>c(t=>new Set(t).add(e.claim)),className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full transition-opacity hover:opacity-100`,style:{color:a.fgMuted},children:(0,q.jsx)(v,{className:`h-4 w-4`})})]},e.claim))})}),(0,q.jsxs)(`button`,{type:`button`,onClick:n,disabled:!d,className:`mt-8 flex 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:[d?`Continue`:`Still searching…`,d&&(0,q.jsx)(U,{className:`h-4 w-4`})]})]})]})}var Xr=[{suggestion:`I'll build you a live dashboard to track what matters to you`,prompt:`Build me a live dashboard to track what matters to me.`},{suggestion:`I'll send a weekly briefing on news in your space`,prompt:`Set up a weekly briefing on news in my space.`},{suggestion:`I'll help you get on top of your week`,prompt:`Help me get on top of my week.`},{suggestion:`I'll draft something from a few rough notes`,prompt:`Draft something from a few rough notes I'll give you.`}];function Zr({label:e,tone:t}){return(0,q.jsx)(`span`,{className:`inline-flex items-center whitespace-nowrap rounded-full px-2.5 py-[3px] text-[12px] font-medium align-middle`,style:{backgroundColor:t.bg,color:t.fg},children:e})}function Qr(e,t){return e.map((n,r)=>{let i=``;return r>0&&(i=r===e.length-1?e.length===2?` and `:`, and `:`, `),(0,q.jsxs)(G.Fragment,{children:[i,(0,q.jsx)(Zr,{label:n,tone:t})]},n)})}var $=64,$r=$;function ei({pluginLabels:e,tone:t,pillTone:n,reduce:r,slotRef:i,revealed:a}){let o=e.length>1;return(0,q.jsxs)(`div`,{className:`mt-12 flex items-center gap-3`,children:[(0,q.jsx)(`div`,{ref:i,className:`shrink-0`,style:{width:$r,height:$r}}),(0,q.jsxs)(B.p,{className:`text-[14px]`,style:{color:t.fg},initial:!1,animate:{opacity:+!!a,x:a?0:-6},transition:r?{duration:0}:{duration:.35},children:[`Already set up the `,Qr(e,n),` plugin`,o?`s`:``,` `,`to help with your work`]})]})}function ti({head:e,note:t,flyToNote:n,reduce:r,onLanded:i}){let{components:a,chosen:o}=Br();if(!a||!o)return null;let s=$/2,c=n&&t?t:e,l={x:c.x-s,y:c.y-s};return(0,q.jsx)(B.div,{className:`pointer-events-none absolute left-0 top-0`,style:{width:$,height:$,transformOrigin:`center`},initial:!1,animate:l,transition:r?{duration:0}:n&&t?{type:`spring`,duration:.9,bounce:.45}:{duration:.4},onAnimationComplete:()=>{n&&t&&i()},children:(0,q.jsx)(H,{components:a,traits:o,size:$})})}function ni({suggestions:e,loading:t,installedPlugins:n=[],onSuggestionClick:r,onSkip:i,onBack:a,onForward:o}){let s=Rr,c=Z(),l=V(),u=e.length>0?e:t?[]:Xr,d=n.map(Ie).filter(e=>e.length>0),f=d.length>0,p=(0,G.useRef)(null),m=(0,G.useRef)(null),h=(0,G.useRef)(null),[g,_]=(0,G.useState)(null),[v,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(!1);(0,G.useLayoutEffect)(()=>{let e=()=>{let e=p.current,t=m.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=e=>({x:e.left-n.left+e.width/2,y:e.top-n.top+e.height/2}),i=h.current;_({head:r(t.getBoundingClientRect()),note:i?r(i.getBoundingClientRect()):void 0})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[u.length,f]);let S=g?.note?.y;return(0,G.useEffect)(()=>{!f||S===void 0||v||y(!0)},[f,S,v]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:s.fg},children:[(0,q.jsx)(Q,{onBack:a,onNext:o}),(0,q.jsxs)(`div`,{ref:p,className:`absolute left-1/2 top-[14%] sm:top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(B.div,{ref:m,className:`shrink-0`,style:{height:$},initial:!1,animate:v?{width:0,marginRight:0}:{width:$,marginRight:12},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here’s what we could do first`})]}),(0,q.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:s.fgMuted},children:u.length>0?(0,q.jsxs)(q.Fragment,{children:[`Pick one to jump in — or start your own thing.`,` `,(0,q.jsx)(`button`,{type:`button`,onClick:i,className:`underline underline-offset-2 transition-opacity hover:opacity-80`,style:{color:s.fg},children:`Skip to Chat`})]}):`Putting together a few ideas…`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-3`,children:u.map((e,t)=>(0,q.jsx)(B.button,{type:`button`,onClick:()=>r(e),initial:l?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.3,delay:t*.06},className:`rounded-2xl px-5 py-4 text-left text-[15px] transition-transform duration-150 hover:scale-[1.01] active:scale-[0.99]`,style:{backgroundColor:s.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:(0,q.jsx)(`span`,{children:e.suggestion})},`${t}-${e.suggestion}`))}),f&&(0,q.jsx)(ei,{pluginLabels:d,tone:s,pillTone:c,reduce:l,slotRef:h,revealed:b}),g&&(0,q.jsx)(ti,{head:g.head,note:g.note,flyToNote:v&&f&&g.note!==void 0,reduce:l,onLanded:()=>x(!0)})]})]})}var ri=[{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})}],ii=`#17191C`,ai=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],oi=290;function si({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0,showTopTeam:i=!1}){let a=W(),o=J.use.characters(),s=J.use.selectedIndex(),c=V(),{w:l}=bn(),u=Math.max(.42,Math.min(l/1100,1)),d=l<640,f=o.length>0?o[s]:void 0,{bg:p,peekColors:m}=(0,G.useMemo)(()=>!a||!f?{bg:`var(--surface-base)`,peekColors:[]}:{bg:a.colors.find(e=>e.id===f.color)?.hex??`var(--surface-base)`,peekColors:Sr(f.color,a.colors.map(e=>e.id),3)},[a,f]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(B.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?ii:p},transition:c?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,q.jsx)(lr,{bumpNonce:t,settleBlink:!1}),i&&a&&(0,q.jsx)(`div`,{className:`pointer-events-none absolute right-0 z-[1] flex items-start`,style:{top:-Math.round(oi*u)*.42,right:-Math.round(oi*u)*.12},children:ai.map((e,t)=>{let n=Math.round(oi*u);return(0,q.jsx)(B.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:ai.length-t},initial:c?!1:{y:-140,opacity:0},animate:{y:0,opacity:1},transition:c?{duration:0}:{type:`spring`,stiffness:200,damping:18,delay:t*.1},children:(0,q.jsx)(H,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:m[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),a&&(0,q.jsx)(Ne,{children:(d?ri.filter(e=>e.mobile):ri).slice(0,Math.max(0,e)).map((e,t)=>{let n=Math.round(e.base*u),r=d&&e.mobilePos?e.mobilePos(n):e.pos(n);return(0,q.jsx)(B.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{...r,width:n,height:n},initial:c?!1:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:c?void 0:{scale:0,opacity:0},transition:c?{duration:0}:{type:`spring`,stiffness:220,damping:16,delay:.1},children:(0,q.jsx)(H,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:m[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}function ci(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobby:e.hobbies.join(`, `)}}function li(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}function ui(){let e=i(),t=k.use.user(),n=t?.id??null,r=Le.use.enterFocus(),o=Le.use.exitFocus(),s=Le.use.setPendingAvatarTraits(),c=Le.use.requestSidebarCollapse(),l=ie.use.researchOnboarding(),u=ie.use.hydrated(),[d,f]=(0,G.useState)(`form`),{ref:p,size:m}=_n(),[h,g]=(0,G.useState)([]),[_,v]=(0,G.useState)(!1);function y(e){f(e)}function b(e){g([]),y(e)}function x(e){g(e=>[...e,d]),y(e)}function S(){let e=h[h.length-1];e&&(g(e=>e.slice(0,-1)),y(e))}let C=h.length>0?S:void 0,[w,T]=(0,G.useState)(null),[D,O]=(0,G.useState)(null),[A,j]=(0,G.useState)(null),[ee,te]=(0,G.useState)(!1),[ne,M]=(0,G.useState)(!1),[se,N]=(0,G.useState)(!1),[ce,le]=(0,G.useState)(0),[ue,de]=(0,G.useState)(0),{start:P,ready:fe,assistantId:F,awaitReady:I}=zt(),L=cn(),{start:pe,hydrate:me}=L,R=L.status===`idle`||L.status===`running`,he=!R&&L.claims.length===0;(0,G.useEffect)(()=>{o(),s(null),l&&u&&P()},[o,s,P,l,u]),(0,G.useLayoutEffect)(()=>{if(_||!n)return;let e=un(n);e?.formValues&&(T(e.formValues),O(e.faceValues),j(e.checkinTime),M(e.checkinBooked),e.research&&me(e.research,I),f(pn(e)),g([])),v(!0)},[_,n,me,I]),(0,G.useEffect)(()=>{!_||!w||dn(n,{step:d,formValues:w,faceValues:D,checkinTime:A,checkinBooked:ne,research:L.status===`done`?{status:`done`,claims:L.claims,suggestions:L.suggestions,installedPlugins:L.installedPlugins}:null})},[_,n,d,w,D,A,ne,L.status,L.claims,L.suggestions,L.installedPlugins]),(0,G.useEffect)(()=>{!_||!l||!u||!w||L.status!==`idle`||pe({awaitAssistantId:I,subject:ci(w),conversationTitle:li(w)})},[_,l,u,w,L.status,pe,I]),(0,G.useEffect)(()=>{d===`results`&&he&&(g([]),f(`suggestions`))},[d,he]);function z(t,i,a,{skip:o=!1}={}){fn(n);let{firstName:l,lastName:u,role:d,hobbies:f}=t,p=[l.trim(),u.trim()].filter(Boolean).join(` `),m=l.trim(),h=!o&&a===void 0;oe({tools:[],tasks:[],tone:Ve,...p?{userName:p}:{},...d.trim()?{occupation:d.trim()}:{},...o?{}:{initialMessage:a??Nt({firstName:l,lastName:u,occupation:d,hobby:f.join(`, `)})},...h?{title:m?`Getting to know ${m}`:`Getting to know you`}:{},...i?.name?.trim()?{assistantName:i.name.trim()}:{}});let g=i?.name?.trim();g&&ae(g),s(i?.traits??null),h&&r(),o||E.markExpectingFirstMessage(),c(),E.checkAssistant(F??void 0).finally(()=>{e(`${re.assistant}?onboarding=1`,{replace:!0})})}function ge(e){T(e),L.start({awaitAssistantId:I,subject:ci(e),conversationTitle:li(e)}),b(`face`)}function _e(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){N(!0);return}if(N(!1),F&&w){let e=[w.firstName.trim(),w.lastName.trim()].filter(Boolean).join(` `);j(null),M(!1),te(!0),Pe({assistantId:F,userName:e||void 0,assistantName:D?.name?.trim()||void 0}).then(e=>{e.scheduled&&(M(!0),j(mn(e.start,e.timeZone)))}).finally(()=>te(!1))}b(`meeting`)}if(!l)return u?(0,q.jsx)(a,{to:re.assistant,replace:!0}):null;if([`different`,`integration`,`letschat`,`meeting`,`looking`,`results`,`suggestions`].includes(d)&&w){let e=[`meeting`,`looking`,`results`,`suggestions`].includes(d);return(0,q.jsx)(`div`,{ref:p,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,q.jsxs)(yn,{size:m,children:[(0,q.jsx)(si,{eyesBumpNonce:ce,peekLevel:[`looking`,`results`,`suggestions`].includes(d)?ue:0,darkBg:e,showBottomEyes:!e&&d!==`different`}),d===`different`&&(0,q.jsx)(jr,{onContinue:()=>b(`integration`),onBack:()=>x(`intro`),onForward:C}),d===`integration`&&(0,q.jsx)(Ir,{onClaim:()=>b(`letschat`),onBumpEyes:()=>le(e=>e+1),onBack:()=>x(`different`),onForward:C}),d===`letschat`&&(0,q.jsx)(Lr,{assistantId:F,assistantReady:fe,onConnected:_e,missingCalendarScope:se,onRetry:()=>N(!1),onSkip:()=>{N(!1),b(`looking`)},onBack:()=>x(`integration`),onForward:C}),d===`meeting`&&(0,q.jsx)(Gr,{scheduledTime:A??void 0,awaitingTime:ee,onDone:()=>b(`looking`),onBack:()=>x(`letschat`),onForward:C}),d===`looking`&&(0,q.jsx)(Jr,{onDone:()=>b(he?`suggestions`:`results`),onBack:()=>x(`letschat`),onAdvance:e=>de(Math.min(e+1,4)),onForward:C,ready:!R}),d===`results`&&(0,q.jsx)(Yr,{claims:L.claims,loading:R,onContinue:()=>b(`suggestions`),onBack:()=>x(`looking`),onForward:C}),d===`suggestions`&&(0,q.jsx)(ni,{suggestions:L.suggestions,loading:R,installedPlugins:L.installedPlugins,onSuggestionClick:async e=>{await L.awaitPluginInstalls(),z(w,D,e.prompt)},onSkip:async()=>{await L.awaitPluginInstalls(),z(w,D,void 0,{skip:!0})},onBack:()=>x(he?`looking`:`results`),onForward:C})]})})}return d===`intro`&&w?(0,q.jsx)(fr,{firstName:w.firstName,assistantName:D?.name,onContinue:()=>b(`different`),onBack:()=>x(`face`),onForward:C}):d===`face`&&w?(0,q.jsx)(Xn,{onContinue:e=>{O(e),b(`intro`)},onBack:()=>x(`form`),onForward:C}):(0,q.jsx)(Hn,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:ge})}export{ui as ResearchOnboardingRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,nt as t,st as n}from"./local-mode-CvrNMtPF.js";var r=`/v1/remote-web/pairing-token`,i=`/v1/remote-web/pairing-challenge`,a=`/v1/guardian/refresh`,o=5,s=5e3,c=`vellum:remote-gateway:refresh-lock`,l=`vellum-remote-gateway-refresh`,u=2e4,d=2e4,f=100,p=0,m=null,h=class extends Error{status;constructor(e,t){super(t),this.name=`RemoteWebPairingError`,this.status=e}};function g(e,...t){for(let n of t){let t=e.get(n)?.trim();if(t)return t}return null}function _(e){let t=new URLSearchParams(e.search),n=e.hash.startsWith(`#`)?e.hash.slice(1):e.hash;if(n){let e=new URLSearchParams(n);for(let[n,r]of e)t.has(n)||t.set(n,r)}return t}function v(e){let t=_(typeof e==`string`?new URL(e,window.location.origin):e);return{deviceCode:g(t,`deviceCode`,`device_code`),userCode:g(t,`userCode`,`user_code`)}}function y(e=window.location){let t=/\/assistant(?:\/|$)/.exec(e.pathname);return t&&t.index>0?e.pathname.slice(0,t.index).replace(/\/+$/,``):``}function b(e,t=window.location){return`${y(t)}${e}`}function x(){return`${window.location.origin}${y()}`}function S(e){if(typeof e==`string`){let t=Date.parse(e);return Number.isFinite(t)?t:0}return e>0xe8d4a51000?e:e*1e3}function C(){return!t()||p<=0?!0:Date.now()>=p-s}function w(e){let t=e;return t?.status===`approved`&&typeof t.accessToken==`string`&&(typeof t.accessTokenExpiresAt==`string`||typeof t.accessTokenExpiresAt==`number`)&&(typeof t.refreshAfter==`string`||typeof t.refreshAfter==`number`)}function T(e){let t=e;return typeof t?.deviceCode==`string`&&typeof t.userCode==`string`&&typeof t.verificationUri==`string`&&typeof t.expiresAt==`string`&&typeof t.expiresInSeconds==`number`&&typeof t.intervalSeconds==`number`}function E(e){return new Promise(t=>setTimeout(t,e))}function D(){try{let e=localStorage.getItem(c);if(!e)return null;let t=JSON.parse(e);return typeof t.owner!=`string`||typeof t.expiresAt!=`number`?null:{owner:t.owner,expiresAt:t.expiresAt}}catch{return null}}function O(e){try{let t=D();return t&&t.expiresAt>Date.now()?!1:(localStorage.setItem(c,JSON.stringify({owner:e,expiresAt:Date.now()+u})),D()?.owner===e)}catch{return!0}}function k(e){try{D()?.owner===e&&localStorage.removeItem(c)}catch{}}async function A(e){let t=`${Date.now()}:${Math.random().toString(36).slice(2)}`,n=Date.now()+d;for(;!O(t);){if(Date.now()>=n)return e();await E(f)}try{return await e()}finally{k(t)}}async function j(e){let t=typeof navigator<`u`?navigator.locks??null:null;return t?t.request(l,e):A(e)}function M(t){p=S(t.refreshAfter),n({accessToken:t.accessToken,accessTokenExpiresAt:t.accessTokenExpiresAt}),e({url:`${window.location.origin}${y()}`,token:t.accessToken})}async function N(e,t){let n=await fetch(b(r),{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({deviceCode:e}),signal:t}),i=await n.json().catch(()=>null);if(n.status===202){let e=i??{};return{status:`pending`,expiresAt:typeof e.expiresAt==`string`?e.expiresAt:``,intervalSeconds:typeof e.intervalSeconds==`number`&&e.intervalSeconds>0?e.intervalSeconds:o}}if(!n.ok)throw new h(n.status,`Pairing token exchange failed: ${n.status}`);if(!w(i))throw new h(502,`Pairing token exchange returned an invalid response`);return i}async function P(e){let t=await fetch(b(i),{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({publicBaseUrl:x()}),signal:e}),n=await t.json().catch(()=>null);if(!t.ok)throw new h(t.status,`Pairing challenge creation failed: ${t.status}`);if(!T(n))throw new h(502,`Pairing challenge creation returned an invalid response`);return n}async function F(){if(!C())return!0;let e=await fetch(b(a),{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:`{}`});if(!e.ok)return!1;let t=await e.json().catch(()=>null);return w({...t,status:`approved`})?(M({...t,status:`approved`}),!0):!1}async function I(){return C()?(m??=j(F).finally(()=>{m=null}),m):!0}function L(e){return e===`vellum.ai`||e.endsWith(`.vellum.ai`)}var R=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//;function z(e,t){if(!e)return t;if(R.test(e)){try{let t=new URL(e);if(t.protocol===`https:`&&L(t.hostname))return e}catch{}return t}return e.startsWith(`//`)||e.includes(`\\`)||!e.startsWith(`/`)?t:e}export{N as a,y as c,P as i,h as n,v as o,M as r,I as s,z as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{r as t,s as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./typography-BscuIPxA.js";import{i as o}from"./src-CK6bncSg.js";import{n as s,t as c}from"./create-selectors-BE0_e_Ed.js";import{t as l}from"./createLucideIcon-BlMXrA59.js";import{t as ee}from"./dist-BTp54SIT.js";import{n as u}from"./typed-storage-Dctd_K9F.js";import{a as te}from"./diagnostics-BEB4VPwC.js";import{t as ne}from"./conversation-store-DK-7gFAt.js";import{s as re}from"./messages-DHDZ32NT.js";import{t as d}from"./misc-BN2o2MEB.js";import{t as ie}from"./browser-CKX_K5ev.js";import{n as ae}from"./lib-BWRK7bT2.js";var oe=l(`bolt`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),se=l(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),ce=l(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),f={phase:`idle`,pendingQueuedCount:0,activeToolCallCount:0,activeTurnId:null,lastTerminalReason:null,statusText:null,liveWebActivity:{}};function p(e){return e===`queued`||e===`thinking`||e===`streaming`||e===`awaiting_user_input`}function le(e){return e===`thinking`}function m(e){return(e.phase===`idle`||e.phase===`errored`)&&!e.activeTurnId}var h=c(s()((e,t)=>({...f,requestSend:t=>e(e=>({phase:`thinking`,activeTurnId:t??e.activeTurnId,lastTerminalReason:null,activeToolCallCount:0,statusText:null})),acceptSend:t=>e(e=>({activeTurnId:t,...e.phase===`idle`||e.phase===`errored`?{phase:`thinking`,lastTerminalReason:null}:null})),onTextDelta:()=>{let n=t();if(n.phase===`idle`||n.phase===`errored`){if(!n.activeTurnId)return;e({phase:`streaming`});return}(n.phase===`thinking`||n.phase===`queued`)&&e({phase:`streaming`})},onToolUseStart:()=>{let n=t();m(n)||e({phase:n.phase===`idle`||n.phase===`errored`||n.phase===`queued`?`thinking`:n.phase,activeToolCallCount:n.activeToolCallCount+1})},onToolResult:()=>e(e=>({activeToolCallCount:Math.max(0,e.activeToolCallCount-1)})),onToolActivityMetadata:(n,r)=>{let i=t();m(i)||e({liveWebActivity:{...i.liveWebActivity,[n]:r}})},onActivityThinking:n=>{let r=t();m(r)||r.phase!==`awaiting_user_input`&&e({phase:`thinking`,statusText:n??null})},showSurface:n=>{m(t())||n&&e({phase:`awaiting_user_input`})},updateSurface:()=>{},dismissSurface:()=>{let n=t();n.phase===`awaiting_user_input`&&n.activeToolCallCount===0&&e({phase:`thinking`})},completeSurface:()=>{let n=t();n.phase===`awaiting_user_input`&&n.activeToolCallCount===0&&e({phase:`thinking`})},onSecretRequest:()=>{m(t())||e({phase:`awaiting_user_input`})},onConfirmationRequest:()=>{m(t())||e({phase:`awaiting_user_input`})},onQuestionRequest:()=>{m(t())||e({phase:`awaiting_user_input`})},onContactRequest:()=>{m(t())||e({phase:`awaiting_user_input`})},completeTurn:()=>{e({phase:t().pendingQueuedCount>0?`queued`:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}})},handoffGeneration:()=>{m(t())||e({phase:`thinking`,activeToolCallCount:0,statusText:null})},cancelGeneration:()=>{e({phase:t().pendingQueuedCount>0?`queued`:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`cancelled`,statusText:null,liveWebActivity:{}})},onStreamError:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`error`,statusText:null,liveWebActivity:{}}),onSessionError:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`session_error`,statusText:null,liveWebActivity:{}}),onTurnTimeout:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`timeout`,statusText:null,liveWebActivity:{}}),onPollReconciled:n=>{let r=t();n&&n!==r.activeTurnId||p(r.phase)&&e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}})},resetTurn:()=>e({...f}),enqueueMessage:()=>e(e=>({pendingQueuedCount:e.pendingQueuedCount+1})),dequeueMessage:()=>{let n=t(),r=Math.max(0,n.pendingQueuedCount-1);if(m(n)){e({pendingQueuedCount:r});return}e({phase:`thinking`,pendingQueuedCount:r})},deleteQueuedMessage:()=>{let n=t(),r=Math.max(0,n.pendingQueuedCount-1);if(r===0&&n.phase===`queued`){e({phase:`idle`,pendingQueuedCount:0,activeTurnId:null,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}});return}e({pendingQueuedCount:r})}}))),g=3670016,ue=[.85,.75,.65,.5],de=2e7,fe=new Set([`image/jpeg`,`image/jpg`,`image/png`,`image/webp`,`image/heic`,`image/heif`,`image/bmp`,`image/tiff`]),pe=new Set([`jpg`,`jpeg`,`png`,`webp`,`heic`,`heif`,`bmp`,`tif`,`tiff`]);function _(e){let t=e.type.trim().toLowerCase();if(fe.has(t))return!0;let n=e.name.split(`.`).pop()?.trim().toLowerCase();return n?pe.has(n):!1}function me(e){return _(e)&&e.size>3670016}function he(e){let t=`attachment`,n=e.trim()||t;return/\.(?:jpe?g)$/i.test(n)?n:`${n.replace(/\.[^./\\]+$/,``)||t}.jpg`}async function ge(e){if(!me(e)||await ve(e))return{status:`unchanged`,file:e};if(e.size>104857600)return{status:`failed`,error:`This image is too large to process safely. Please choose a smaller image.`};let t;try{t=await _e(e)}catch{return{status:`failed`,error:`Couldn't resize this image for upload. Try a smaller image.`}}try{let n;try{n=await be(t,e.size)}catch{n=null}return!n||n.size>=e.size?{status:`failed`,error:`Couldn't resize this image for upload. Try a smaller image.`}:{status:`resized`,file:new File([n],he(e.name),{type:`image/jpeg`,lastModified:e.lastModified})}}finally{t.close()}}async function _e(e){if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e,{imageOrientation:`from-image`});return{source:t,width:t.width,height:t.height,close:()=>t.close()}}catch{}if(typeof Image>`u`)throw Error(`No browser image decoder is available.`);let t=URL.createObjectURL(e);return await new Promise((e,n)=>{let r=new Image;r.onload=()=>{e({source:r,width:r.naturalWidth||r.width,height:r.naturalHeight||r.height,close:()=>URL.revokeObjectURL(t)})},r.onerror=()=>{URL.revokeObjectURL(t),n(Error(`Image decode failed.`))},r.src=t})}async function ve(e){if(!ye(e))return!1;let t;try{t=new Uint8Array(await e.slice(0,Math.min(e.size,1024*1024)).arrayBuffer())}catch{return!0}if(!y(t,0,`RIFF`)||!y(t,8,`WEBP`))return!1;let n=v(t,`VP8X`);return n>=0&&(t[n+8]??0)&2?!0:v(t,`ANIM`)>=0||v(t,`ANMF`)>=0}function ye(e){return e.type.trim().toLowerCase()===`image/webp`||/\.webp$/i.test(e.name)}function v(e,t){for(let n=0;n<=e.length-t.length;n+=1)if(y(e,n,t))return n;return-1}function y(e,t,n){if(t+n.length>e.length)return!1;for(let r=0;r<n.length;r+=1)if(e[t+r]!==n.charCodeAt(r))return!1;return!0}async function be(e,t){let n=e.width*e.height,r=null;if(n<=de)for(let t of ue){let n=await x(e.source,e.width,e.height,t);if(r=b(r,n),n&&n.size<=3670016)return n}let i=r?.size??t,a=Math.min(Math.sqrt(g/i*.9),.95);for(let t=0;t<4;t+=1){let t=Math.max(Math.floor(e.width*a),1),n=Math.max(Math.floor(e.height*a),1),o=null;for(let i of ue){let a=await x(e.source,t,n,i);if(r=b(r,a),o=b(o,a),a&&a.size<=3670016)return a}i=o?.size??i,a*=Math.min(Math.sqrt(g/i*.9),.9)}return null}function b(e,t){return t&&(!e||t.size<e.size)?t:e}async function x(e,t,n,r){if(typeof document>`u`)return null;let i=document.createElement(`canvas`);i.width=t,i.height=n;let a=i.getContext(`2d`);if(!a||typeof i.toBlob!=`function`)return null;a.fillStyle=`#fff`,a.fillRect(0,0,t,n),a.drawImage(e,0,0,t,n);try{return await new Promise(e=>{i.toBlob(t=>e(t),`image/jpeg`,r)})}finally{i.width=0,i.height=0}}var xe=`vellum:chatDrafts:`;function S(e){return`${xe}${e}`}function Se(e){let n=t(S(e),``);if(!n)return new Map;try{let e=JSON.parse(n);return typeof e!=`object`||!e||Array.isArray(e)?new Map:new Map(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return new Map}}function C(e,t){n(S(e),JSON.stringify(Object.fromEntries(t)))}function Ce(){return`att-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function we(e){return _(e)?`100 MB`:`50 MB`}function Te(e){return e.size<=52428800?!0:_(e)&&e.size<=104857600}var w=new Map,T=null,E=new Map,D=new Set,Ee=s()((e,t)=>({input:``,restoredDraftConversationId:null,attachments:[],attachmentLastError:null,setInput:t=>{e(e=>({input:typeof t==`function`?t(e.input):t}))},saveDraft:(e,t)=>{t.trim()?w.set(e,t):w.delete(e),T&&C(T,w)},clearDraft:e=>{w.delete(e),T&&C(T,w)},handleConversationSwitch:({previousKey:n,nextKey:r})=>{if(!(n!==null&&n!==r)||!n)return;let i=t().input;i.trim()?w.set(n,i):w.delete(n);let a=(r&&w.get(r))??``;e({input:a,restoredDraftConversationId:a.length>0&&r?r:null}),T&&C(T,w)},loadAssistantDrafts:(n,r)=>{if(T&&T!==n){let n=t().input;r&&(n.trim()?w.set(r,n):w.delete(r)),C(T,w),e({input:``,restoredDraftConversationId:null})}w=Se(n),T=n},clearRestoredDraftNotice:()=>{e({restoredDraftConversationId:null})},restoreDraftIfEmpty:n=>{let r=w.get(n);r&&r.trim()&&!t().input.trim()&&e({input:r,restoredDraftConversationId:n})},addFiles:(t,n)=>{let r=Array.from(t);if(r.length===0)return;if(!n){e({attachmentLastError:`No active assistant. Please try again.`});return}let i=[],a=[];for(let e of r)Te(e)?a.push(e):i.push(e);let o=i[0];if(e(o?{attachmentLastError:i.length===1?`${o.name} is larger than ${we(o)} and can't be attached.`:`${i.length} files are too large and can't be attached.`}:{attachmentLastError:null}),a.length===0)return;let s=a.map(e=>({pending:{kind:`uploading`,localId:Ce(),filename:e.name||`attachment`,mimeType:e.type||`application/octet-stream`,sizeBytes:e.size},file:e}));e(e=>({attachments:[...e.attachments,...s.map(e=>e.pending)]}));for(let{pending:t,file:r}of s)(async()=>{try{let i=await ge(r);if(D.has(t.localId)){D.delete(t.localId);return}if(i.status===`failed`&&r.size>52428800){O(e,t.localId,i.error);return}let a=i.status===`failed`?r:i.file;if(a.size>52428800){O(e,t.localId,`This attachment is still larger than 50 MB after resizing. Try a smaller image.`);return}i.status===`resized`&&e(e=>({attachments:e.attachments.map(e=>e.localId===t.localId&&e.kind===`uploading`?{...e,filename:a.name||`attachment`,mimeType:a.type||`application/octet-stream`,sizeBytes:a.size}:e)}));let o=await re(n,a);if(D.has(t.localId)){D.delete(t.localId);return}if(!o.ok){O(e,t.localId,o.error.detail??`Upload failed`);return}let s=null;try{s=URL.createObjectURL(a),E.set(t.localId,s)}catch{s=null}e(e=>({attachments:e.attachments.map(e=>e.localId===t.localId?{kind:`uploaded`,localId:t.localId,id:o.id,filename:a.name||`attachment`,mimeType:a.type||`application/octet-stream`,sizeBytes:a.size,previewUrl:s}:e)}))}catch{if(D.has(t.localId)){D.delete(t.localId);return}O(e,t.localId,`Upload failed`)}})()},removeAttachment:t=>{e(e=>{let n=e.attachments.find(e=>e.localId===t);return n&&n.kind===`uploading`&&D.add(t),{attachments:e.attachments.filter(e=>e.localId!==t)}}),De(t)},resetAttachments:()=>{e(e=>{for(let t of e.attachments)t.kind===`uploading`&&D.add(t.localId);return{attachments:[],attachmentLastError:null}})},fullReset:()=>{e(e=>{for(let t of e.attachments)t.kind===`uploading`&&D.add(t.localId);return{attachments:[],attachmentLastError:null}}),E.forEach(e=>URL.revokeObjectURL(e)),E.clear()},dismissAttachmentError:()=>{e({attachmentLastError:null})}}));function O(e,t,n){e(e=>({attachments:e.attachments.map(e=>e.localId===t?{kind:`failed`,localId:t,filename:e.filename,mimeType:e.mimeType,sizeBytes:e.sizeBytes,error:n}:e)}))}function De(e){let t=E.get(e);t&&(URL.revokeObjectURL(t),E.delete(e))}function Oe(e){return e.reduce((e,t)=>t.kind===`uploading`?e+1:e,0)}function ke(e){return e.filter(e=>e.kind===`uploaded`).map(e=>e.id)}var k=c(Ee);function A(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Ae(e){let t=JSON.parse(e);return A(t)?t:null}function j(e,t){let n=[...e??[]],r=n.findIndex(e=>e.type===`surface`&&e.surface.surfaceId===t.surfaceId);return r===-1?n.push({type:`surface`,surface:t}):n[r]={type:`surface`,surface:t},n}function je(e,t){return e?.filter(e=>!(e.type===`surface`&&e.surface.surfaceId===t))}function Me(e,t){if(!e.surfaces?.length)return e;let n=!1,r=e.contentBlocks,i=e.surfaces.map(e=>{let i=t(e);return i!==e&&(n=!0,r=j(r,i)),i});return n?{...e,surfaces:i,contentBlocks:r}:e}function M(e,t){if(!e.surfaces?.length)return e;let n=e.surfaces.filter(t);if(n.length===e.surfaces.length)return e;let r=new Set(e.surfaces.filter(e=>!t(e)).map(e=>e.surfaceId));return{...e,surfaces:n,contentOrder:e.contentOrder?.filter(e=>!(e.type===`surface`&&r.has(e.id))),contentBlocks:e.contentBlocks?.filter(e=>!(e.type===`surface`&&r.has(e.surface.surfaceId)))}}var N=500,P=u({keyFn:e=>`vellum:dismissed-surfaces:${e}`,scope:`user`,parseValue:e=>A(e)?e:null,fallback:{},maxEntries:200});function Ne(e,t){let n=P.get(e,t);return n?new Set(n):new Set}function Pe(e,t,n){let r=Array.from(n);r.length>N&&(r=r.slice(r.length-N)),P.set(e,t,r)}function Fe(e,t){if(t.size===0)return e;let n=!1,r=e.map(e=>{let r=M(e,e=>!t.has(e.surfaceId));return r!==e&&(n=!0),r});return n?r:e}function Ie(e){if(!e||typeof e!=`object`)return!1;let t=e;return!(typeof t.tokens!=`number`||!Number.isFinite(t.tokens)||t.maxTokens!==null&&(typeof t.maxTokens!=`number`||!Number.isFinite(t.maxTokens))||t.fillRatio!==null&&(typeof t.fillRatio!=`number`||!Number.isFinite(t.fillRatio)))}var F=u({keyFn:e=>`vellum:ctxwindow:${e}`,scope:`user`,parseValue:e=>Ie(e)?e:null,fallback:{},maxEntries:200});function Le(e){return new Map(Object.entries(F.load(e)))}function Re(e,t,n){F.set(e,t,n)}var ze=`PROVIDER_BILLING`,Be=`PROVIDER_NOT_CONFIGURED`,Ve=`MANAGED_KEY_INVALID`,He=`credits_exhausted`,Ue=`provider_billing`;function We(e){return e?.errorCategory?e.errorCategory.endsWith(He):e?.code===ze}function Ge(e){return e?.errorCategory?e.errorCategory.endsWith(Ue):!1}function I(e){return We(e)?`managed_credits`:Ge(e)?`provider_billing`:null}function L(e){return I(e)!==null||e?.code===Be||e?.code===Ve||e?.displayAs===`modal`}function Ke(e){return!!e&&!L(e)}var R={pendingSecret:null,isSubmittingSecret:!1,secretSaved:!1,pendingConfirmation:null,isSubmittingConfirmation:!1,pendingContactRequest:null,isSubmittingContactRequest:!1,contactRequestAccepted:!1,pendingQuestion:null,isSubmittingQuestion:!1,isQuestionCardDismissed:!1,inlineConfirmationToolCallId:null,unknownNudgeToolCallIds:new Set},z=c(s()((e,t)=>({...R,showSecret:n=>{let{pendingSecret:r}=t();if(r&&r.requestId===n.requestId){let t={};for(let e of Object.keys(n))n[e]!==void 0&&(t[e]=n[e]);e({pendingSecret:{...r,...t}});return}e({pendingSecret:n,isSubmittingSecret:!1,secretSaved:!1})},submitSecretStart:()=>e({isSubmittingSecret:!0}),submitSecretEnd:t=>e({isSubmittingSecret:!1,secretSaved:t??!1}),dismissSecret:()=>e({pendingSecret:null,isSubmittingSecret:!1}),updateSecret:(n,r)=>{let{pendingSecret:i}=t();!i||i.requestId!==n||e({pendingSecret:{...i,...r}})},showConfirmation:t=>e({pendingConfirmation:t,isSubmittingConfirmation:!1}),submitConfirmationStart:()=>e({isSubmittingConfirmation:!0}),submitConfirmationEnd:()=>e({isSubmittingConfirmation:!1}),dismissConfirmation:()=>e({pendingConfirmation:null,isSubmittingConfirmation:!1}),dismissConfirmationIfMatches:n=>{let{pendingConfirmation:r}=t();!r||r.requestId!==n||e({pendingConfirmation:null,isSubmittingConfirmation:!1})},updateConfirmation:(n,r)=>{let{pendingConfirmation:i}=t();!i||i.requestId!==n||e({pendingConfirmation:{...i,...r}})},setInlineConfirmationToolCallId:t=>e({inlineConfirmationToolCallId:t}),showContactRequest:t=>e({pendingContactRequest:t,isSubmittingContactRequest:!1,contactRequestAccepted:!1}),submitContactRequestStart:()=>e({isSubmittingContactRequest:!0}),submitContactRequestEnd:()=>e({isSubmittingContactRequest:!1}),dismissContactRequest:()=>e({pendingContactRequest:null,isSubmittingContactRequest:!1}),acceptContactRequest:()=>e({contactRequestAccepted:!0}),showQuestion:t=>e({pendingQuestion:t,isSubmittingQuestion:!1,isQuestionCardDismissed:!1}),submitQuestionStart:()=>e({isSubmittingQuestion:!0}),submitQuestionEnd:()=>e({isSubmittingQuestion:!1}),dismissQuestion:()=>e({pendingQuestion:null,isSubmittingQuestion:!1,isQuestionCardDismissed:!1}),dismissQuestionCard:()=>e({isQuestionCardDismissed:!0}),resetSecretAndConfirmation:()=>e({pendingSecret:null,isSubmittingSecret:!1,secretSaved:!1,pendingConfirmation:null,isSubmittingConfirmation:!1,inlineConfirmationToolCallId:null}),addUnknownNudgeToolCallId:n=>{let r=t().unknownNudgeToolCallIds;r.has(n)||e({unknownNudgeToolCallIds:new Set([...r,n])})},removeUnknownNudgeToolCallId:n=>{let r=t().unknownNudgeToolCallIds;if(!r.has(n))return;let i=new Set(r);i.delete(n),e({unknownNudgeToolCallIds:i})},resetAll:()=>e(R)}))),B={hasMore:!1,oldestTimestamp:null,isLoadingOlder:!1,isPinnedToLatest:!0};function qe(){return{liveTurn:[],error:null,notice:null,isLoadingHistory:!0,transcriptPagination:{...B},contextWindowUsage:null,ephemeralMetaResults:[],compactionCircuitOpenUntil:null,dismissedSurfaceIds:new Set,streamingMessageIds:new Set,pendingQueuedMessageIds:[],requestIdToMessageId:new Map,pendingLocalDeletions:new Set,confirmationToolCallMap:new Map,expandedToolCallIds:new Set,expandedCardIds:new Map,contextWindowUsageByConversation:new Map,previousConversationId:null,previousAssistantId:null,draftConversationIdResolution:!1}}function V(e,t){return typeof t==`function`?t(e):t}var Je=c(s()((e,t)=>({...qe(),setLiveTurn:t=>e(e=>({liveTurn:V(e.liveTurn,t)})),setError:t=>e(e=>({error:V(e.error,t)})),setNotice:t=>e(e=>({notice:V(e.notice,t)})),setIsLoadingHistory:t=>e({isLoadingHistory:t}),setTranscriptPagination:t=>e(e=>({transcriptPagination:V(e.transcriptPagination,t)})),setContextWindowUsage:t=>e(e=>({contextWindowUsage:V(e.contextWindowUsage,t)})),setCompactionCircuitOpenUntil:t=>e(e=>({compactionCircuitOpenUntil:V(e.compactionCircuitOpenUntil,t)})),switchToConversation:({assistantId:n,activeConversationId:r})=>{let i=t();if(i.draftConversationIdResolution){e({draftConversationIdResolution:!1});return}let a=i.previousConversationId;if(a&&a!==r&&a){let e=z.getState();(e.pendingSecret||e.pendingConfirmation)&&ne.getState().addAttentionConversationId(a)}let o=i.previousAssistantId!==null&&i.previousAssistantId!==n,s=o||i.previousAssistantId===null;te(`conversation_switch_reset`,{assistantId:n,conversationId:r,outgoingConversationId:a??null}),k.getState().handleConversationSwitch({previousKey:a??null,nextKey:r}),h.getState().resetTurn(),z.getState().resetAll(),o?k.getState().fullReset():k.getState().resetAttachments();let c=s?Le(n):i.contextWindowUsageByConversation;e({liveTurn:[],ephemeralMetaResults:[],error:L(i.error)?i.error:null,notice:null,isLoadingHistory:!0,transcriptPagination:{...B},contextWindowUsage:c.get(r)??null,compactionCircuitOpenUntil:null,dismissedSurfaceIds:Ne(n,r),streamingMessageIds:new Set,pendingQueuedMessageIds:[],requestIdToMessageId:new Map,pendingLocalDeletions:new Set,confirmationToolCallMap:new Map,expandedToolCallIds:new Set,expandedCardIds:new Map,contextWindowUsageByConversation:c,previousConversationId:r,previousAssistantId:n,draftConversationIdResolution:!1})},markDraftResolution:()=>e({draftConversationIdResolution:!0}),setConfirmationToolCall:(t,n)=>e(e=>{let r=new Map(e.confirmationToolCallMap);return r.set(t,n),{confirmationToolCallMap:r}}),deleteConfirmationToolCall:t=>e(e=>{let n=new Map(e.confirmationToolCallMap);return n.delete(t),{confirmationToolCallMap:n}}),clearConfirmationToolCallMap:()=>e({confirmationToolCallMap:new Map}),addDismissedSurfaceId:t=>e(e=>{let n=new Set(e.dismissedSurfaceIds);return n.add(t),{dismissedSurfaceIds:n}}),addDismissedSurfaceIds:t=>e(e=>{let n=new Set(e.dismissedSurfaceIds);for(let e of t)n.add(e);return{dismissedSurfaceIds:n}}),batchUpdateStreamingMessageIds:(t,n)=>e(e=>{let r=new Set(e.streamingMessageIds);for(let e of t)r.add(e);for(let e of n)r.delete(e);return{streamingMessageIds:r}}),pushPendingQueuedMessageId:t=>e(e=>({pendingQueuedMessageIds:[...e.pendingQueuedMessageIds,t]})),shiftPendingQueuedMessageId:()=>{let n=t().pendingQueuedMessageIds;if(n.length===0)return;let[r,...i]=n;return e({pendingQueuedMessageIds:i}),r},setRequestIdMapping:(t,n)=>e(e=>{let r=new Map(e.requestIdToMessageId);return r.set(t,n),{requestIdToMessageId:r}}),popRequestIdMapping:n=>{let r=t().requestIdToMessageId,i=r.get(n);if(i!==void 0){let t=new Map(r);t.delete(n),e({requestIdToMessageId:t})}return i},addPendingLocalDeletion:t=>e(e=>{let n=new Set(e.pendingLocalDeletions);return n.add(t),{pendingLocalDeletions:n}}),consumePendingLocalDeletion:n=>{let r=t().pendingLocalDeletions;if(!r.has(n))return!1;let i=new Set(r);return i.delete(n),e({pendingLocalDeletions:i}),!0},setExpandedToolCallId:(t,n)=>e(e=>{let r=new Set(e.expandedToolCallIds);return n?r.add(t):r.delete(t),{expandedToolCallIds:r}}),setExpandedCardId:(t,n)=>e(e=>{let r=new Map(e.expandedCardIds);return r.set(t,n),{expandedCardIds:r}}),setContextWindowUsageForConversation:(t,n)=>e(e=>{let r=new Map(e.contextWindowUsageByConversation);return r.set(t,n),{contextWindowUsageByConversation:r}}),addEphemeralMetaResult:t=>e(e=>({ephemeralMetaResults:[...e.ephemeralMetaResults,t]})),clearEphemeralMetaResults:()=>e(e=>e.ephemeralMetaResults.length===0?e:{ephemeralMetaResults:[]})}))),H=e(r(),1),Ye=`width=500,height=600`;function U(e){if(!e)return null;let t;try{let n=typeof window>`u`?`http://localhost`:window.location.origin;t=new URL(e,n)}catch{return null}return t.protocol!==`https:`&&t.protocol!==`http:`?null:t}function W(e){let t=U(e);if(!t)return!1;let n=t.pathname.toLowerCase();return t.searchParams.get(`response_type`)===`code`&&t.searchParams.has(`client_id`)&&t.searchParams.has(`redirect_uri`)||t.searchParams.has(`client_id`)&&t.searchParams.has(`redirect_uri`)&&/oauth|authorize|auth/.test(n)}function Xe(e){if(typeof window>`u`)return null;let t=U(e);return!t||t.origin!==window.location.origin?null:`${t.pathname}${t.search}${t.hash}`}function G(e){return U(e)?.href??null}function K(e){if(!W(e))return!1;if(ee.isNativePlatform()){let t=G(e);return t?(ie(t),!0):!1}let t=window.open(e,`_blank`,Ye);return t===null?!1:(t.focus(),!0)}function Ze(e){return K(e)}function q(e,t,n=`…`){return e.length<=t?e:e.slice(0,t-n.length)+n}function Qe(e){if(!e)return null;let t=e.split(`/`),n=t[t.length-1];return!n||n===`.`?null:n}function J(e,t){return q(e,t,`...`)}function $e(e){if(!e)return null;let t=e.replace(/\s+/g,` `).trim().match(/(?:^|&&\s*|\|\|\s*|;\s*)(?:\S*\/)?assistant\s+browser\s+([^\s;&|]+)/i);if(!t)return null;let n=t[1].toLowerCase();return new Set([`navigate`,`click`,`type`,`screenshot`,`snapshot`,`scroll`,`hover`,`select`,`drag`,`wait`,`back`,`forward`,`refresh`,`close`,`tab`,`press_key`,`wait_for`,`extract`,`fill_credential`]).has(n)?n:`unknown`}function Y(e,t){let n=e.toLowerCase();return n!==`bash`&&n!==`host_bash`?null:$e(t)}function et(e){switch(e){case`navigate`:return`Opened a page`;case`click`:return`Clicked on the page`;case`type`:return`Typed on the page`;case`screenshot`:return`Took a screenshot`;case`snapshot`:return`Captured page snapshot`;case`scroll`:return`Scrolled the page`;case`hover`:return`Hovered on the page`;case`select`:return`Selected on the page`;case`drag`:return`Dragged on the page`;case`wait`:return`Waited for the page`;case`back`:return`Went back`;case`forward`:return`Went forward`;case`refresh`:return`Refreshed the page`;case`close`:return`Closed the tab`;case`tab`:return`Switched tabs`;case`press_key`:return`Pressed a key`;case`wait_for`:return`Waited for a condition`;case`extract`:return`Extracted page content`;case`fill_credential`:return`Filled a credential`;case`unknown`:return`Used the browser`}}function tt(e){switch(e){case`navigate`:return`Opening a page`;case`click`:return`Clicking on the page`;case`type`:return`Typing on the page`;case`screenshot`:return`Taking a screenshot`;case`snapshot`:return`Capturing page snapshot`;case`scroll`:return`Scrolling the page`;case`hover`:return`Hovering on the page`;case`select`:return`Selecting on the page`;case`drag`:return`Dragging on the page`;case`wait`:return`Waiting for the page`;case`back`:return`Going back`;case`forward`:return`Going forward`;case`refresh`:return`Refreshing the page`;case`close`:return`Closing the tab`;case`tab`:return`Switching tabs`;case`press_key`:return`Pressing a key`;case`wait_for`:return`Waiting for a condition`;case`extract`:return`Extracting page content`;case`fill_credential`:return`Filling a credential`;case`unknown`:return`Using the browser`}}function nt(e){switch(e){case`navigate`:case`back`:case`forward`:case`tab`:return`compass`;case`click`:case`hover`:case`select`:case`drag`:case`scroll`:return`compass`;case`screenshot`:case`snapshot`:return`camera`;case`type`:case`press_key`:case`fill_credential`:return`compass`;case`wait`:case`wait_for`:case`refresh`:case`close`:return`compass`;case`extract`:return`compass`;case`unknown`:return`compass`}}function rt(e,t){let n=e.toLowerCase();if(n===`bash`||n===`host_bash`){let e=t.command??t.cmd;if(typeof e==`string`)return e.replace(/\s+/g,` `).trim()}if(n===`file_read`||n===`host_file_read`||n===`file_write`||n===`host_file_write`||n===`file_edit`||n===`host_file_edit`){let e=t.file_path??t.path??t.filePath;if(typeof e==`string`)return e}if(n===`grep`||n===`glob`){let e=t.pattern??t.query;if(typeof e==`string`)return e}if(n===`web_search`){let e=t.query??t.search;if(typeof e==`string`)return e}return``}function it(e,t=``){let n=e.toLowerCase(),r=t.replace(/\s+/g,` `).trim(),i=Qe(r),a=Y(e,r);if(a)return et(a);switch(n){case`bash`:case`host_bash`:return r?`Ran \`${J(r,30)}\``:`Ran a command`;case`file_read`:case`host_file_read`:return i?`Read ${i}`:`Read a file`;case`file_write`:case`host_file_write`:return i?`Wrote ${i}`:`Wrote a file`;case`file_edit`:case`host_file_edit`:return i?`Edited ${i}`:`Edited a file`;case`grep`:return r?`Searched for '${J(r,25)}'`:`Searched files`;case`glob`:return r?`Searched for ${J(r,25)}`:`Found files`;case`web_search`:return r?`Searched '${J(r,25)}'`:`Searched the web`;case`web_fetch`:return`Fetched a webpage`;default:return`Used ${e.replace(/_/g,` `)}`}}function at(e,t=``,n){let r=Y(e,t);if(r)return tt(r);if(n){let t=e.toLowerCase();if(t===`app_create`||t===`app_refresh`||t===`app_update`)return n}switch(e.toLowerCase()){case`bash`:case`host_bash`:return`Running a command`;case`file_read`:case`host_file_read`:return`Reading a file`;case`file_write`:case`host_file_write`:return`Writing a file`;case`file_edit`:case`host_file_edit`:return`Editing a file`;case`grep`:return`Searching files`;case`glob`:return`Finding files`;case`web_search`:return`Searching the web`;case`web_fetch`:return`Fetching a webpage`;case`app_create`:return`Building your app`;case`app_refresh`:case`app_update`:return`Refreshing your app`;default:return`Running ${e.replace(/_/g,` `)}`}}function ot(e){return e.split(/[_-]+/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function st(e,t=``){let n=Y(e,t);if(n)return nt(n);switch(e.toLowerCase()){case`bash`:case`host_bash`:return`terminal`;case`file_read`:case`host_file_read`:return`file-text`;case`file_write`:case`host_file_write`:return`file-plus`;case`file_edit`:case`host_file_edit`:return`pencil`;case`grep`:case`glob`:case`web_search`:return`search`;case`web_fetch`:return`globe`;default:return`wrench`}}var ct=80;function X(e,...t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim().length>0)return t}return``}function lt(e){if(!e)return``;let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)}function ut(e){if(!e.startsWith(`mcp__`))return null;let t=e.slice(5),n=t.indexOf(`__`);if(n===-1)return null;let r=t.slice(0,n),i=t.slice(n+2);return!r||!i?null:{serverName:r,toolMethod:i}}function Z(e,t){let n=t&&typeof t==`object`?t:{},r=e.toLowerCase(),i=X(n,`activity`,`reason`),a=ut(e);if(a)return{title:`Using ${a.serverName}`,info:a.toolMethod,activity:i,iconName:`plug`};switch(r){case`bash`:case`host_bash`:return{title:`Working`,info:q(X(n,`command`,`cmd`).replace(/\s+/g,` `).trim(),ct),activity:i,iconName:`code`};case`str_replace_editor`:case`text_editor`:{let e=X(n,`command`).toLowerCase(),t=lt(X(n,`path`,`file_path`,`filePath`));return e===`view`?{title:`Reading`,info:t,activity:i,iconName:`file`}:{title:`Editing`,info:t,activity:i,iconName:`pen`}}case`computer`:return{title:`Using computer`,info:X(n,`action`),activity:i,iconName:`monitor`};case`skill_execute`:{let e=X(n,`tool`);if(e){let t=n.input,r=Z(e,t);return{...r,activity:i||r.activity}}return{title:`Using a skill`,info:X(n,`skill`,`name`,`skillName`),activity:i,iconName:`sparkle`}}case`skill`:case`skill_invoke`:case`skill_load`:return{title:`Using a skill`,info:X(n,`skill`,`name`,`skillName`),activity:i,iconName:`sparkle`};case`subagent_spawn`:return{title:`Spawning subagent`,info:X(n,`label`,`objective`,`task`),activity:i,iconName:`user-plus`};default:return{title:e?`Running ${ot(e)}`:`Running tool`,info:``,activity:i,iconName:`bolt`}}}function dt(e){return Z(e.name,e.input)}var ft=[{open:`<thinking>`,close:`</thinking>`},{open:`<think>`,close:`</think>`}];function Q(e){return ft.some(t=>e.includes(t.open))}function pt(e){if(!Q(e))return null;let t=[],n=e=>{e.trim()&&t.push({type:`text`,text:e})},r=e=>{let n=e.trim();n&&t.push({type:`thinking`,thinking:n})},i=0;for(;;){let a=-1,o;for(let t of ft){let n=e.indexOf(t.open,i);n!==-1&&(a===-1||n<a)&&(a=n,o=t)}if(!o)break;n(e.slice(i,a));let s=a+o.open.length,c=e.indexOf(o.close,s);if(c===-1)return r(e.slice(s)),t;r(e.slice(s,c)),i=c+o.close.length}return n(e.slice(i)),t}function mt(e){return typeof e.id==`string`&&e.id.length>0}function ht(e){return e.some(e=>e.type===`text`&&Q(e.text))?e.flatMap(e=>{let t=e.type===`text`?pt(e.text):null;return t?t.map(e=>e.type===`thinking`?{type:`thinking`,thinking:e.thinking}:{type:`text`,text:e.text}):[e]}):e}function gt(e,t){let n=t?.splitInlineThinking?ht(e):e,r=[],i=null,a=()=>(i||(i={type:`activity`,items:[]},r.push(i)),i);for(let e of n)if(e.type===`thinking`){let t=a(),n=t.items[t.items.length-1];n?.type===`thinking`?(n.thinking=n.thinking?`${n.thinking}\n${e.thinking}`:e.thinking,e.startedAt!=null&&(n.startedAt=n.startedAt==null?e.startedAt:Math.min(n.startedAt,e.startedAt)),e.completedAt!=null&&(n.completedAt=n.completedAt==null?e.completedAt:Math.max(n.completedAt,e.completedAt))):t.items.push({type:`thinking`,thinking:e.thinking,startedAt:e.startedAt,completedAt:e.completedAt})}else if(e.type===`tool_use`){if(!mt(e.toolCall))continue;a().items.push({type:`tool_use`,toolCall:e.toolCall})}else (e.type===`text`||e.type===`surface`)&&(i=null,r.push(e));return r}function _t(e){return!e.pendingConfirmation&&(e.name===`ui_show`||e.name===`ui_update`||e.name===`ui_dismiss`)}function vt(e){if(e.name===`subagent_spawn`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`subagent_spawn`}function yt(e){if(e.name===`run_workflow`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`run_workflow`}var $=i();function bt(e){return e!=null&&(e.startsWith(`vellum://workspace/`)||e.startsWith(`vellum://host/`))}function xt(e){return e.startsWith(`vellum://workspace/`)||e.startsWith(`vellum://host/`)?e:ae(e)}function St({href:e,children:t}){return(0,$.jsx)(`a`,{href:e,target:`_blank`,rel:W(e)?void 0:`noopener noreferrer`,onClick:t=>{Ze(e)&&t.preventDefault()},className:`text-[var(--system-positive-strong)] underline hover:opacity-80`,children:t})}var Ct=(0,H.memo)(function({content:e,className:t,hardLineBreaks:n,onVellumLinkClick:r}){return(0,$.jsx)(o,{content:e,className:t,hardLineBreaks:n,linkComponent:(0,H.useCallback)(({href:e,children:t})=>r&&bt(e)?(0,$.jsx)(`a`,{href:e,onClick:t=>{t.preventDefault(),e&&r(e,t.currentTarget.textContent??``)},className:`text-[var(--system-positive-strong)] underline hover:opacity-80 cursor-pointer`,children:t}):(0,$.jsx)(St,{href:e,children:t}),[r]),urlTransform:xt})}),wt=new Set([`low`,`medium`,`high`]);function Tt(e){let t=e?.toLowerCase();return t&&wt.has(t)?t:`medium`}function Et(e){switch(e?.toLowerCase()){case`low`:return{bg:`bg-[var(--system-positive-strong)]`,text:`text-white`,label:`Low`};case`medium`:return{bg:`bg-[var(--system-mid-strong)]`,text:`text-black`,label:`Medium`};case`high`:return{bg:`bg-[var(--system-negative-strong)]`,text:`text-white`,label:`High`};case`workspace`:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,border:`border border-[var(--border-element)]`,label:`Workspace`};default:return{bg:`bg-[var(--content-secondary)]`,text:`text-white`,label:e??`Unknown`}}}function Dt(e){switch(e?.toLowerCase()){case`low`:return{bg:`bg-[var(--system-positive-weak)]`,text:`text-[var(--system-positive-strong)]`,label:`Low`};case`medium`:return{bg:`bg-[var(--system-mid-weak)]`,text:`text-[var(--system-mid-strong)]`,label:`Medium`};case`high`:return{bg:`bg-[var(--system-negative-weak)]`,text:`text-[var(--system-negative-strong)]`,label:`High`};case`workspace`:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,label:`Workspace`};default:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,label:e?e.charAt(0).toUpperCase()+e.slice(1):`Unknown`}}}var Ot={unknown:2,low:0,medium:1,high:2},kt={none:-1,low:0,medium:1,high:2};function At(e,t,n){return e?.toLowerCase()!==`auto`||!n?!0:(Ot[(t??``).toLowerCase()]??-1)<=(kt[n.toLowerCase()]??-1)}function jt(e){switch(e){case`trust_rule_allowed`:return`· Auto-approved · Trust rule matched`;case`sandbox_auto_approve`:return null;case`platform_auto_approve`:return`· Auto-approved · Platform session`;default:return null}}function Mt(e,t){return e===`sandbox_auto_approve`?{displayLevel:`workspace`,inherentRisk:t}:{displayLevel:t??`unknown`}}function Nt({level:e,className:t,onClick:n}){if(!e)return null;let{bg:r,text:i,label:o}=Dt(e),s=d(`inline-flex items-center justify-center rounded-[100px] px-[6px] pt-[2px] pb-[3px]`,r,t);return n?(0,$.jsx)(`button`,{type:`button`,"data-testid":`risk-badge`,"data-risk-level":e,className:d(s,`cursor-pointer hover:opacity-80`),onClick:e=>{e.stopPropagation(),n()},children:(0,$.jsx)(a,{variant:`label-medium-default`,className:i,children:o})}):(0,$.jsx)(`span`,{"data-testid":`risk-badge`,"data-risk-level":e,className:s,children:(0,$.jsx)(a,{variant:`label-medium-default`,className:i,children:o})})}export{Pe as A,le as B,Je as C,L as D,Ke as E,Ae as F,ce as H,ke as I,Oe as L,Me as M,je as N,Re as O,j as P,k as R,K as S,I as T,se as U,h as V,oe as W,it as _,Tt as a,G as b,gt as c,_t as d,dt as f,st as g,at as h,Et as i,M as j,Fe as k,yt as l,rt as m,Mt as n,At as o,Z as p,jt as r,Ct as s,Nt as t,vt as u,ot as v,z as w,Xe as x,q as y,p as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./is-electron-C_ZTVhv8.js";var t=e=>e,n=(e,t)=>`${e}/${t}`,r=t(`/assistant/logs/usage`),i=`message`,a={assistant:t(`/assistant`),about:t(`/assistant/about`),bundleConfirm:t(`/assistant/bundle/confirm`),remotePair:t(`/assistant/pair`),quickInput:t(`/assistant/quick-input`),conversations:t(`/assistant/conversations`),conversation:e=>n(t(`/assistant/conversations`),e),conversationAtMessage:(e,r)=>`${n(t(`/assistant/conversations`),e)}?${i}=${encodeURIComponent(r)}`,conversationWithPrompt:(e,r,i)=>{let a=`${n(t(`/assistant/conversations`),e)}?prompt=${encodeURIComponent(r)}`;return i?`${a}&relay=${encodeURIComponent(i)}`:a},inspect:e=>`${n(t(`/assistant/conversations`),e)}/inspect`,logs:{root:t(`/assistant/logs`),trace:t(`/assistant/logs/trace`),usage:r,usageForSchedule:e=>`${r}?${new URLSearchParams({range:`7d`,groupBy:`schedule`,scheduleId:e}).toString()}`,emails:t(`/assistant/logs/emails`),systemEvents:t(`/assistant/logs/system-events`)},account:{root:t(`/account`),login:t(`/account/login`),signup:t(`/account/signup`),providerSignup:t(`/account/provider/signup`),providerCallback:t(`/account/provider/callback`),oauth:{popupComplete:t(`/account/oauth/popup-complete`),complete:t(`/account/oauth/complete`),desktopComplete:t(`/account/oauth/desktop-complete`)}},welcome:t(`/assistant/welcome`),selectAssistant:t(`/assistant/select-assistant`),reviewTerms:t(`/assistant/review-terms`),onboarding:{hosting:t(`/assistant/onboarding/hosting`),apiKey:t(`/assistant/onboarding/api-key`),privacy:t(`/assistant/onboarding/privacy`),prechat:t(`/assistant/onboarding/prechat`),hatching:t(`/assistant/onboarding/hatching`),research:t(`/assistant/onboarding/research`)},home:t(`/assistant/home`),identity:t(`/assistant/identity`),plugins:t(`/assistant/plugins`),plugin:e=>n(t(`/assistant/plugins`),e),skills:t(`/assistant/skills`),workspace:t(`/assistant/workspace`),library:{root:t(`/assistant/library`),app:e=>n(t(`/assistant/library`),e)},document:e=>n(t(`/assistant/documents`),e),connect:t(`/assistant/connect`),contacts:{root:t(`/assistant/contacts`)},settings:{root:t(`/assistant/settings`),general:t(`/assistant/settings/general`),ai:t(`/assistant/settings/ai`),integrations:t(`/assistant/settings/integrations`),notifications:t(`/assistant/settings/notifications`),keyboardShortcuts:t(`/assistant/settings/keyboard-shortcuts`),sounds:t(`/assistant/settings/sounds`),voice:t(`/assistant/settings/voice`),devices:t(`/assistant/settings/devices`),privacy:t(`/assistant/settings/privacy`),archive:t(`/assistant/settings/archive`),bookmarks:t(`/assistant/settings/bookmarks`),billing:t(`/assistant/settings/billing`),community:t(`/assistant/settings/community`),debug:t(`/assistant/settings/debug`),developer:t(`/assistant/settings/developer`),mcp:t(`/assistant/settings/mcp`),advanced:t(`/assistant/settings/advanced`),dangerZone:t(`/assistant/settings/danger-zone`),systemEvents:t(`/assistant/settings/system-events`),upgradeCancel:t(`/assistant/settings/billing/upgrade/cancel`),upgradeSuccess:t(`/assistant/settings/billing/upgrade/success`)},admin:{root:t(`/admin`)},docs:{hostingOptions:t(`/docs/hosting-options`),legal:{privacyPolicy:t(`/docs/privacy-policy`),termsOfUse:t(`/docs/vellum-terms-of-use`),dataSharing:t(`/docs/data-sharing`),prohibitedUse:t(`/docs/prohibited-use`),privacyAndData:t(`/docs/trust-security/privacy-and-data`)}}},o=`vellum.ai`;function s(e){return c(e)}function c(e){return`https://${o}${e}`}function l(){return e()?`${window.__VELLUM_CONFIG__?.webUrl??window.location.origin}${a.admin.root}`:a.admin.root}export{a,s as i,l as n,c as r,i as t};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var e=(e,t,n)=>{typeof n==`string`||n instanceof Blob?e.append(t,n):n instanceof Date?e.append(t,n.toISOString()):e.append(t,JSON.stringify(n))},t={bodySerializer:t=>{let n=new FormData;return Object.entries(t).forEach(([t,r])=>{r!=null&&(Array.isArray(r)?r.forEach(r=>e(n,t,r)):e(n,t,r))}),n}},n={bodySerializer:e=>JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t)};Object.entries({$body_:`body`,$headers_:`headers`,$path_:`path`,$query_:`query`});function r({onRequest:e,onSseError:t,onSseEvent:n,responseTransformer:r,responseValidator:i,sseDefaultRetryDelay:a,sseMaxRetryAttempts:o,sseMaxRetryDelay:s,sseSleepFn:c,url:l,...u}){let d,f=c??(e=>new Promise(t=>setTimeout(t,e)));return{stream:async function*(){let c=a??3e3,p=0,m=u.signal??new AbortController().signal;for(;!m.aborted;){p++;let a=u.headers instanceof Headers?u.headers:new Headers(u.headers);d!==void 0&&a.set(`Last-Event-ID`,d);try{let t={redirect:`follow`,...u,body:u.serializedBody,headers:a,signal:m},o=new Request(l,t);e&&(o=await e(l,t));let s=await(u.fetch??globalThis.fetch)(o);if(!s.ok)throw Error(`SSE failed: ${s.status} ${s.statusText}`);if(!s.body)throw Error(`No body in SSE response`);let f=s.body.pipeThrough(new TextDecoderStream).getReader(),p=``,h=()=>{try{f.cancel()}catch{}};m.addEventListener(`abort`,h);try{for(;;){let{done:e,value:t}=await f.read();if(e)break;p+=t,p=p.replace(/\r\n?/g,`
|
|
2
|
-
`);let a=p.split(`
|
|
3
|
-
|
|
4
|
-
`);p=a.pop()??``;for(let e of a){let t=e.split(`
|
|
5
|
-
`),a=[],o;for(let e of t)if(e.startsWith(`data:`))a.push(e.replace(/^data:\s*/,``));else if(e.startsWith(`event:`))o=e.replace(/^event:\s*/,``);else if(e.startsWith(`id:`))d=e.replace(/^id:\s*/,``);else if(e.startsWith(`retry:`)){let t=Number.parseInt(e.replace(/^retry:\s*/,``),10);Number.isNaN(t)||(c=t)}let s,l=!1;if(a.length){let e=a.join(`
|
|
6
|
-
`);try{s=JSON.parse(e),l=!0}catch{s=e}}l&&(i&&await i(s),r&&(s=await r(s))),n?.({data:s,event:o,id:d,retry:c}),a.length&&(yield s)}}}finally{m.removeEventListener(`abort`,h),f.releaseLock()}break}catch(e){if(t?.(e),o!==void 0&&p>=o)break;await f(Math.min(c*2**(p-1),s??3e4))}}}()}}var i=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},a=e=>{switch(e){case`form`:return`,`;case`pipeDelimited`:return`|`;case`spaceDelimited`:return`%20`;default:return`,`}},o=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},s=({allowReserved:e,explode:t,name:n,style:r,value:o})=>{if(!t){let t=(e?o:o.map(e=>encodeURIComponent(e))).join(a(r));switch(r){case`label`:return`.${t}`;case`matrix`:return`;${n}=${t}`;case`simple`:return t;default:return`${n}=${t}`}}let s=i(r),l=o.map(t=>r===`label`||r===`simple`?e?t:encodeURIComponent(t):c({allowReserved:e,name:n,value:t})).join(s);return r===`label`||r===`matrix`?s+l:l},c=({allowReserved:e,name:t,value:n})=>{if(n==null)return``;if(typeof n==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},l=({allowReserved:e,explode:t,name:n,style:r,value:i,valueOnly:a})=>{if(i instanceof Date)return a?i.toISOString():`${n}=${i.toISOString()}`;if(r!==`deepObject`&&!t){let t=[];Object.entries(i).forEach(([n,r])=>{t=[...t,n,e?r:encodeURIComponent(r)]});let a=t.join(`,`);switch(r){case`form`:return`${n}=${a}`;case`label`:return`.${a}`;case`matrix`:return`;${n}=${a}`;default:return a}}let s=o(r),l=Object.entries(i).map(([t,i])=>c({allowReserved:e,name:r===`deepObject`?`${n}[${t}]`:t,value:i})).join(s);return r===`label`||r===`matrix`?s+l:l},u=/\{[^{}]+\}/g,d=({path:e,url:t})=>{let n=t,r=t.match(u);if(r)for(let t of r){let r=!1,i=t.substring(1,t.length-1),a=`simple`;i.endsWith(`*`)&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(`.`)?(i=i.substring(1),a=`label`):i.startsWith(`;`)&&(i=i.substring(1),a=`matrix`);let o=e[i];if(o==null)continue;if(Array.isArray(o)){n=n.replace(t,s({explode:r,name:i,style:a,value:o}));continue}if(typeof o==`object`){n=n.replace(t,l({explode:r,name:i,style:a,value:o,valueOnly:!0}));continue}if(a===`matrix`){n=n.replace(t,`;${c({name:i,value:o})}`);continue}let u=encodeURIComponent(a===`label`?`.${o}`:o);n=n.replace(t,u)}return n},f=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let a=i.startsWith(`/`)?i:`/${i}`,o=(e??``)+a;t&&(o=d({path:t,url:o}));let s=n?r(n):``;return s.startsWith(`?`)&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function p(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return`serializedBody`in e?e.serializedBody!==void 0&&e.serializedBody!==``?e.serializedBody:null:e.body===``?null:e.body;if(t)return e.body}var m=async(e,t)=>{let n=typeof t==`function`?await t(e):t;if(n)return e.scheme===`bearer`?`Bearer ${n}`:e.scheme===`basic`?`Basic ${btoa(n)}`:n},h=({parameters:e={},...t}={})=>n=>{let r=[];if(n&&typeof n==`object`)for(let i in n){let a=n[i];if(a==null)continue;let o=e[i]||t;if(Array.isArray(a)){let e=s({allowReserved:o.allowReserved,explode:!0,name:i,style:`form`,value:a,...o.array});e&&r.push(e)}else if(typeof a==`object`){let e=l({allowReserved:o.allowReserved,explode:!0,name:i,style:`deepObject`,value:a,...o.object});e&&r.push(e)}else{let e=c({allowReserved:o.allowReserved,name:i,value:a});e&&r.push(e)}}return r.join(`&`)},ee=e=>{if(!e)return`stream`;let t=e.split(`;`)[0]?.trim();if(t){if(t.startsWith(`application/json`)||t.endsWith(`+json`))return`json`;if(t===`multipart/form-data`)return`formData`;if([`application/`,`audio/`,`image/`,`video/`].some(e=>t.startsWith(e)))return`blob`;if(t.startsWith(`text/`))return`text`}},g=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get(`Cookie`)?.includes(`${t}=`)):!1,te=async({security:e,...t})=>{for(let n of e){if(g(t,n.name))continue;let e=await m(n,t.auth);if(!e)continue;let r=n.name??`Authorization`;switch(n.in){case`query`:t.query||={},t.query[r]=e;break;case`cookie`:t.headers.append(`Cookie`,`${r}=${e}`);break;default:t.headers.set(r,e);break}}},_=e=>f({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==`function`?e.querySerializer:h(e.querySerializer),url:e.url}),v=(e,t)=>{let n={...e,...t};return n.baseUrl?.endsWith(`/`)&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=b(e.headers,t.headers),n},y=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},b=(...e)=>{let t=new Headers;for(let n of e){if(!n)continue;let e=n instanceof Headers?y(n):Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,typeof r==`object`?JSON.stringify(r):r)}return t},x=class{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){let t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e==`number`?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){let n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}},S=()=>({error:new x,request:new x,response:new x}),C=h({allowReserved:!1,array:{explode:!0,style:`form`},object:{explode:!0,style:`deepObject`}}),w={"Content-Type":`application/json`},T=(e={})=>({...n,headers:w,parseAs:`auto`,querySerializer:C,...e}),E=((e={})=>{let t=v(T(),e),n=()=>({...t}),i=e=>(t=v(t,e),n()),a=S(),o=async e=>{let n={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:b(t.headers,e.headers),serializedBody:void 0};n.security&&await te({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody===``)&&n.headers.delete(`Content-Type`);let r=n;return{opts:r,url:_(r)}},s=async e=>{let n=e.throwOnError??t.throwOnError,r=e.responseStyle??t.responseStyle,i,s;try{let{opts:t,url:n}=await o(e),r={redirect:`follow`,...t,body:p(t)};i=new Request(n,r);for(let e of a.request.fns)e&&(i=await e(i,t));let c=t.fetch;s=await c(i);for(let e of a.response.fns)e&&(s=await e(s,i,t));let l={request:i,response:s};if(s.ok){let e=(t.parseAs===`auto`?ee(s.headers.get(`Content-Type`)):t.parseAs)??`json`;if(s.status===204||s.headers.get(`Content-Length`)===`0`){let n;switch(e){case`arrayBuffer`:case`blob`:case`text`:n=await s[e]();break;case`formData`:n=new FormData;break;case`stream`:n=s.body;break;default:n={};break}return t.responseStyle===`data`?n:{data:n,...l}}let n;switch(e){case`arrayBuffer`:case`blob`:case`formData`:case`text`:n=await s[e]();break;case`json`:{let e=await s.text();n=e?JSON.parse(e):{};break}case`stream`:return t.responseStyle===`data`?s.body:{data:s.body,...l}}return e===`json`&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),t.responseStyle===`data`?n:{data:n,...l}}let u=await s.text(),d;try{d=JSON.parse(u)}catch{}throw d??u}catch(t){let o=t;for(let t of a.error.fns)t&&(o=await t(o,s,i,e));if(o||={},n)throw o;return r===`data`?void 0:{error:o,request:i,response:s}}},c=e=>t=>s({...t,method:e}),l=e=>async t=>{let{opts:n,url:i}=await o(t);return r({...n,body:n.body,method:e,onRequest:async(e,t)=>{let r=new Request(e,t);for(let e of a.request.fns)e&&(r=await e(r,n));return r},serializedBody:p(n),url:i})};return{buildUrl:e=>_({...t,...e}),connect:c(`CONNECT`),delete:c(`DELETE`),get:c(`GET`),getConfig:n,head:c(`HEAD`),interceptors:a,options:c(`OPTIONS`),patch:c(`PATCH`),post:c(`POST`),put:c(`PUT`),request:s,setConfig:i,sse:{connect:l(`CONNECT`),delete:l(`DELETE`),get:l(`GET`),head:l(`HEAD`),options:l(`OPTIONS`),patch:l(`PATCH`),post:l(`POST`),put:l(`PUT`),trace:l(`TRACE`)},trace:c(`TRACE`)}})(T()),D=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/apps`,...e}),O=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/apps/{id}/delete`,...e}),k=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/apps/{id}/open`,...e}),A=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/apps/{id}/publish`,...e}),j=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/apps/{id}/publish-status`,...e}),M=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/apps/{id}/share-cloud`,...e}),N=e=>(e.client??E).post({bodySerializer:null,url:`/v1/assistants/{assistant_id}/apps/import-bundle`,...e,headers:{"Content-Type":`application/octet-stream`,...e.headers}}),P=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/apps/shared/{token}`,...e}),F=e=>(e.client??E).post({...t,url:`/v1/assistants/{assistant_id}/attachments`,...e,headers:{"Content-Type":null,...e.headers}}),I=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/attachments/{id}/content`,...e}),L=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/avatar/character-components`,...e}),R=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/avatar/image`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),z=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/avatar/render-from-traits`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),B=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/avatar/state`,...e}),V=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/backups`,...e}),H=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/backups/create`,...e}),U=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/backups/restore`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),W=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/bookmarks`,...e}),G=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/bookmarks`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),K=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/bookmarks/by-message/{messageId}`,...e}),q=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/channels/available`,...e}),J=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/channels/readiness`,...e}),Y=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/config`,...e}),X=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Z=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/config/llm/call-sites`,...e}),Q=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/config/llm/profiles`,...e}),ne=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/confirm`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),re=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/consolidation/config`,...e}),ie=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/consolidation/run-now`,...e}),ae=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/consolidation/runs`,...e}),oe=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/contact-channels/{contactChannelId}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),se=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/contacts`,...e}),ce=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/contacts/merge`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),le=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/conversation-starters`,...e}),ue=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/conversations`,...e}),de=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),fe=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{conversationId}/slack-channel/resolve`,...e}),pe=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/conversations/{id}`,...e}),me=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/analyze`,...e}),he=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/archive`,...e}),ge=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/cancel`,...e}),_e=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/conversations/{id}/compaction`,...e}),ve=e=>(e.client??E).put({url:`/v1/assistants/{assistant_id}/conversations/{id}/inference-profile`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ye=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/conversations/{id}/name`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),be=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/slash`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),xe=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/surface`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Se=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/unarchive`,...e}),Ce=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/{id}/undo`,...e}),we=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/archive/bulk`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Te=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/fork`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ee=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/conversations/llm-context`,...e}),De=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/reorder`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Oe=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/seen`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ke=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/seen/bulk`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ae=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/conversations/unread`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),je=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/credentials/inspect`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Me=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/dictation`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ne=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/disk-pressure/acknowledge`,...e}),Pe=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/disk-pressure/status`,...e}),Fe=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/documents`,...e}),Ie=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/documents`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Le=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/documents/{id}`,...e}),Re=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/documents/{id}/comments`,...e}),ze=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/documents/{id}/comments`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Be=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/documents/{id}/comments/{commentId}`,...e}),Ve=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/documents/{id}/comments/{commentId}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),He=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/documents/{id}/conversations`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ue=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/documents/{id}/pdf`,...e}),We=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/groups`,...e}),Ge=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/groups`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ke=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/groups/{groupId}`,...e}),qe=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/groups/{groupId}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Je=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/healthz`,...e}),Ye=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/heartbeat/config`,...e}),Xe=e=>(e.client??E).put({url:`/v1/assistants/{assistant_id}/heartbeat/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ze=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/heartbeat/run-now`,...e}),Qe=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/heartbeat/runs`,...e}),$e=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/home/feed`,...e}),et=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/home/feed/{id}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),tt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/home/feed/{id}/actions/{actionId}`,...e}),nt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/home/state`,...e}),rt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/identity`,...e}),it=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/inference/chatgpt-subscription/auth`,...e}),at=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/inference/chatgpt-subscription/auth/exchange`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ot=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/inference/provider-connections`,...e}),st=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/inference/provider-connections`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ct=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/inference/provider-connections/{name}`,...e}),lt=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/inference/provider-connections/{name}`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ut=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/integrations/a2a/invite`,...e}),dt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/integrations/slack/channel/config`,...e}),ft=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/integrations/slack/channel/config`,...e}),pt=e=>(e.client??E).patch({url:`/v1/assistants/{assistant_id}/integrations/slack/channel/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),mt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/integrations/slack/channel/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),ht=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/integrations/telegram/config`,...e}),gt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/integrations/telegram/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),_t=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/integrations/twilio/credentials`,...e}),vt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/integrations/twilio/credentials`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),yt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/integrations/vercel/config`,...e}),bt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/integrations/vercel/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),xt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/llm-request-logs/{id}/context`,...e}),St=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/llm-request-logs/{id}/payload`,...e}),Ct=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/logs/export`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),wt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/memory/v2/concept-page`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Tt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/memory/v2/now-text`,...e}),Et=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/memory/v2/router-prompt-template`,...e}),Dt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/memory/v2/simulate-router`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ot=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/messages`,...e}),kt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/messages`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),At=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/messages/{id}/llm-context`,...e}),jt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/messages/queued/{id}`,...e}),Mt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/messages/queued/{id}/steer`,...e}),Nt=e=>(e.client??E).put({url:`/v1/assistants/{assistant_id}/model/image-gen`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Pt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/notification-intent-result`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Ft=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/oauth/apps`,...e}),It=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/oauth/apps`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Lt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/oauth/apps/{appId}/connect`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Rt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/oauth/apps/{appId}/connections`,...e}),zt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/oauth/apps/{id}`,...e}),Bt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/oauth/connections/{id}`,...e}),Vt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/oauth/providers`,...e}),Ht=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/oauth/providers/{providerKey}`,...e}),Ut=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/onboarding/checkin`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Wt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/pending-interactions`,...e}),Gt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/plugins`,...e}),Kt=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/plugins/{name}`,...e}),qt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/plugins/{name}`,...e}),Jt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/plugins/{name}/inspect`,...e}),Yt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/plugins/{name}/upgrade`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Xt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/plugins/install`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Zt=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/plugins/search`,...e}),Qt=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/question-response`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),$t=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/retrospective/config`,...e}),en=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/retrospective/runs`,...e}),tn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/schedules`,...e}),nn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/schedules`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),rn=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/schedules/{id}`,...e}),an=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/schedules/{id}/run`,...e}),on=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/schedules/{id}/runs`,...e}),sn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/schedules/{id}/toggle`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),cn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/schedules/usage-summary`,...e}),ln=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/search/global`,...e}),un=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/secret`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),dn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/secrets`,...e}),fn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/secrets`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),pn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/secrets/read`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),mn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/skills`,...e}),hn=e=>(e.client??E).delete({url:`/v1/assistants/{assistant_id}/skills/{id}`,...e}),gn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/skills/{id}/files`,...e}),_n=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/skills/{id}/files/content`,...e}),vn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/skills/categories`,...e}),yn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/skills/install`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),bn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/sounds/available`,...e}),xn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/sounds/config`,...e}),Sn=e=>(e.client??E).put({url:`/v1/assistants/{assistant_id}/sounds/config`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Cn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/stt/transcribe`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),wn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/subagents/{id}`,...e}),Tn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/subagents/{id}/abort`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),En=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/suggestion`,...e}),$=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/surface-actions`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Dn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/surfaces/{surfaceId}`,...e}),On=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/trace-events`,...e}),kn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/tts/providers`,...e}),An=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/usage/breakdown`,...e}),jn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/usage/daily`,...e}),Mn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/usage/series`,...e}),Nn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/usage/totals`,...e}),Pn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/workflows/runs/{id}`,...e}),Fn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/workflows/runs/{id}/abort`,...e}),In=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/workflows/runs/{id}/journal`,...e}),Ln=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/workspace/delete`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Rn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/workspace/file`,...e}),zn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/workspace/file/content`,...e}),Bn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/workspace/mkdir`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Vn=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/workspace/rename`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),Hn=e=>(e.client??E).get({url:`/v1/assistants/{assistant_id}/workspace/tree`,...e}),Un=e=>(e.client??E).post({url:`/v1/assistants/{assistant_id}/workspace/write`,...e,headers:{"Content-Type":`application/json`,...e.headers}});export{Oe as $,On as $n,At as $t,ae as A,tn as An,it as At,pe as B,gn as Bn,ht as Bt,Y as C,Qt as Cn,Qe as Ct,ne as D,an as Dn,nt as Dt,X as E,rn as En,$e as Et,fe as F,dn as Fn,ut as Ft,Se as G,xn as Gn,bt as Gt,ye as H,mn as Hn,_t as Ht,me as I,fn as In,dt as It,ue as J,Tn as Jn,Ct as Jt,Ce as K,Sn as Kn,xt as Kt,he as L,pn as Ln,ft as Lt,se as M,cn as Mn,lt as Mt,ce as N,ln as Nn,ot as Nt,re as O,on as On,rt as Ot,we as P,un as Pn,st as Pt,ke as Q,Dn as Qn,Dt as Qt,ge as R,hn as Rn,pt as Rt,J as S,Zt as Sn,Ze as St,Q as T,en as Tn,et as Tt,be as U,yn as Un,vt as Ut,ve as V,vn as Vn,gt as Vt,xe as W,bn as Wn,yt as Wt,de as X,En as Xn,Tt as Xt,Ee as Y,wn as Yn,wt as Yt,De as Z,$ as Zn,Et as Zt,U as _,qt as _n,We as _t,M as a,Pt as an,Fn as ar,Pe as at,G as b,Gt as bn,Ye as bt,P as c,zt as cn,Ln as cr,Re as ct,L as d,Bt as dn,Bn as dr,Le as dt,Ot as en,kn as er,Ae as et,R as f,Ht as fn,Vn as fr,Ue as ft,V as g,Kt as gn,qe as gt,H as h,Wt as hn,E as hr,Ke as ht,j as i,Nt as in,Nn as ir,Ne as it,oe as j,nn as jn,ct as jt,ie as k,sn as kn,at as kt,I as l,Ft as ln,zn as lr,ze as lt,B as m,Ut as mn,Un as mr,Ie as mt,k as n,jt as nn,jn as nr,je as nt,D as o,Lt as on,Pn as or,Be as ot,z as p,Vt as pn,Hn as pr,Fe as pt,Te as q,Cn as qn,St as qt,A as r,Mt as rn,Mn as rr,Me as rt,N as s,Rt as sn,In as sr,Ve as st,O as t,kt as tn,An as tr,le as tt,F as u,It as un,Rn as ur,He as ut,K as v,Jt as vn,Ge as vt,Z as w,$t as wn,tt as wt,q as x,Xt as xn,Xe as xt,W as y,Yt as yn,Je as yt,_e as z,_n as zn,mt as zt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./confirm-dialog-CfOXCE1N.js";import{t as s}from"./modal-D0Q3UWD0.js";import{D as c,M as l,et as u,k as d,ot as f,t as ee,u as p}from"./local-mode-CvrNMtPF.js";import{t as m}from"./is-electron-C_ZTVhv8.js";import{n as h}from"./resolved-assistants-store-Cp4J43BK.js";import{t as g}from"./check-D6WkI0gF.js";import{V as _,X as v,i as te,n as y}from"./auth-store-Kfxhs2oI.js";import{a as b}from"./routes-DVqkwUEe.js";import{t as ne}from"./use-onboarding-login-BEOH92mZ.js";import{bi as x,en as S,kt as C,tn as w,zi as T}from"./index-PRnvH2Y1.js";import{r as E}from"./format-date-CLlHK5gl.js";var D=e(t(),1),O=a();function k({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:c,onRetire:l}){let[u,d]=(0,D.useState)(`menu`);(0,D.useEffect)(()=>{e&&d(`menu`)},[e]);let f=i?(0,O.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,O.jsx)(o,{open:e,title:`Repair Assistant?`,message:(0,O.jsxs)(O.Fragment,{children:[`Repairing re-provisions this assistant’s authentication token. Any other devices or browser sessions connected to it will be signed out and need to reconnect.`,f]}),confirmLabel:`Repair`,isPending:r,onConfirm:c,onCancel:()=>d(`menu`)}):u===`confirm-retire`?(0,O.jsx)(S,{open:e,isPending:r,extraMessage:f,onConfirm:l,onCancel:()=>d(`menu`)}):(0,O.jsx)(s.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,O.jsxs)(s.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,O.jsx)(s.Header,{children:(0,O.jsx)(s.Title,{children:`Can’t Authenticate Assistant`})}),(0,O.jsxs)(s.Body,{children:[(0,O.jsxs)(s.Description,{children:[`The authentication token for `,t,` is missing or can no longer be refreshed, so this assistant can’t be connected. You can repair it, retire it, or pick a different assistant.`]}),f,(0,O.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,O.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-repair`),children:`Wake & Repair`}),(0,O.jsx)(n,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-retire`),children:`Retire Assistant`}),(0,O.jsx)(n,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:`Cancel`})]})]})]})})}function A(e){return e.name?e.name:e.isLocal?`Local Assistant`:`Cloud Assistant`}function j(e){if(e.hatchedAt)return`Created ${E(e.hatchedAt)}`}function M(){let e=r(),[t]=i(),a=t.get(`fromLogin`)===`1`,o=t.get(`noAutoSkip`)===`1`,s=m(),g=te(),x=h.use.assistants(),S=_.use.currentOrganizationId(),{loading:T,error:E,login:j,cancel:M}=ne(),P=e=>e.isLocal||g,F=x.filter(P),I=x.some(e=>e.isPlatformHosted)&&!g,[L,R]=(0,D.useState)(null),[z,B]=(0,D.useState)(!1),[V,H]=(0,D.useState)(!1),[U,W]=(0,D.useState)(null),[G,K]=(0,D.useState)(null),[q,J]=(0,D.useState)(!1),[Y,X]=(0,D.useState)(null);(0,D.useEffect)(()=>{if(L!=null||F.length===0)return;let e=v(S);R(F.find(t=>t.id===e)?.id??F[0].id)},[L,F,S]);let Z=async t=>{B(!0),W(null);try{t.isLocal?await y.getState().connectLocalAssistant(t.id):await y.getState().connectPlatformAssistant(t.id),e(b.assistant,{replace:!0})}catch(e){console.error(`selectAssistant.handleConnect failed`,e),t.isLocal&&c()&&(d(e)||f(e)||e instanceof ee)&&p(t.id)?K(t):W(`Failed to connect. Please try again.`),B(!1)}},Q=()=>{K(null),J(!1),X(null),H(!1)},re=async()=>{if(!(!G||q)){J(!0),X(null);try{let e=await l(G.id,{repairGuardian:!0});if(e.ok){u(),Q(),Z(G);return}X(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),X(`Repair failed. Please try again.`)}J(!1)}},ie=async()=>{if(!(!G||q)){J(!0),X(null);try{let t=await w(G.id);if(t.ok){Q(),e(t.nextRoute,{replace:!0});return}X(t.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),X(`Failed to retire assistant. Please try again.`)}J(!1)}};(0,D.useEffect)(()=>{a||o||z||V||x.length!==0&&x.length===1&&F.length===1&&(H(!0),Z(F[0]))},[x.length,F.length]);let ae=()=>{let e=x.find(e=>e.id===L);e&&Z(e)},oe=()=>{e(b.welcome)},$=E??U;return V&&!$&&!G?(0,O.jsx)(C,{children:(0,O.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Connecting to your assistant…`})})}):(0,O.jsxs)(C,{children:[(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${s?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`h1`,{className:s?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Choose an Assistant`}),(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${s?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Select which assistant you’d like to use.`}),$&&(0,O.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:$}),(0,O.jsx)(`div`,{className:`flex w-full flex-col ${s?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:x.map(e=>{let t=P(e);return(0,O.jsx)(N,{assistant:e,selected:L===e.id,disabled:!t,badge:!t&&e.isPlatformHosted?`Requires Account`:void 0,onSelect:()=>{t&&R(e.id)}},e.id)})}),(0,O.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${s?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[F.length>0&&(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:ae,disabled:!L||z,children:z?`Connecting…`:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:()=>void e(`${b.onboarding.hosting}?from=select-assistant`),disabled:z||T,children:`Create New Assistant`}),I&&(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:T?M:()=>void j(),disabled:z,children:T?`Cancel`:`Log In`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:oe,disabled:z||T,children:`Back`})]})]}),(0,O.jsx)(k,{open:G!=null,assistantName:G?A(G):``,isPending:q,errorMessage:Y??void 0,onCancel:Q,onRepair:()=>void re(),onRetire:()=>void ie()})]})}function N({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=j(e),o=m();return(0,O.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:[`group flex w-full items-center border text-left`,o?`gap-3 rounded-lg p-3`:`gap-4 rounded-2xl px-5 py-4`,`transition-all duration-200 ease-out`,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-[var(--surface-secondary)]`,t&&!n?`border-[var(--primary-base)] bg-[var(--primary-base)]/[0.08] shadow-[inset_0_0_0_1px_var(--primary-base)]`:`border-[var(--border-element)] bg-transparent`].join(` `),children:[(0,O.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,o?`h-8 w-8 rounded-lg`:`h-10 w-10 rounded-xl`,t&&!n?`bg-[var(--primary-base)]/15 text-[var(--primary-base)]`:`bg-[var(--surface-tertiary)] text-[var(--content-secondary)]`].join(` `),children:e.isLocal?(0,O.jsx)(x,{className:`h-5 w-5`}):(0,O.jsx)(T,{className:`h-5 w-5`})}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:A(e)}),r&&(0,O.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:r})]}),a&&(0,O.jsx)(`span`,{className:`mt-0.5 block text-[var(--content-tertiary)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:a})]}),!n&&(0,O.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:t&&(0,O.jsx)(g,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})}export{M as SelectAssistantScreen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{O as r,n as i,t as a}from"./button-D7s2Q_uG.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-CL8VmqrY.js";import{t as l}from"./notice-CqRgVmeL.js";import{n as u,t as d}from"./input-C8kfrq9r.js";import{t as f}from"./toggle-X_kQW5my.js";import{t as p}from"./is-electron-C_ZTVhv8.js";import{t as m}from"./bug-DDcuQ3au.js";import{t as h}from"./info-_OtUK1cX.js";import{t as ee}from"./loader-circle-IIzBGiwm.js";import{t as g}from"./x-KVxA2ZL0.js";import{Jt as _}from"./sdk.gen-1aYqVbMj.js";import{n as v}from"./auth-store-Kfxhs2oI.js";import{t as y}from"./dist-BTp54SIT.js";import{n as b}from"./diagnostics-BEB4VPwC.js";import{t as x}from"./impersonate-version-flag-n-4oNLiO.js";import{L as te}from"./react-query.gen-rp6Krcco.js";import{di as S,oi as C,pi as ne,qr as re,vi as w}from"./index-PRnvH2Y1.js";var T=e(n(),1),ie=e(r(),1),E=`vellum:debug:`;function D(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(E))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function O(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:x()},overrides:D()}}var k=t({ShareFeedbackModal:()=>z}),A=s(),j=[{value:`bug_report`,label:`Bug Report`,icon:m,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:w,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:S,includesLogsByDefault:!1}],M=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],ae=M.map(e=>({value:e.value,label:e.label})),N=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),P=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),F=10,I=50*1024*1024,oe={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function se(){return p()?`electron`:y.getPlatform()===`ios`?`ios`:`web`}function ce(e){if(e.size>I)return!1;if(e.type&&N.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?P.has(t):!1}return!1}function L(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function R(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await _({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function le(e,t,n,r){if(typeof CompressionStream>`u`)return null;let i=new Date,a=M.find(t=>t.value===e),o=i.getTime(),s=a?.cutoffMs==null?null:o-a.cutoffMs,c=s==null?null:new Date(s).toISOString(),l=null;try{l=r?.()??null}catch{l=null}let u=b(l),d={collected_at:i.toISOString(),time_range:e,cutoff:c,log_window:{start_time_ms:s,end_time_ms:o},assistant_id:t,active_conversation_id:n,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},f=new TextEncoder().encode(JSON.stringify(d,null,2)),m=new TextEncoder().encode(JSON.stringify(u,null,2)),h=[L(`web-client-context.json`,f),L(`web-chat-diagnostics.json`,m)],ee=new TextEncoder().encode(JSON.stringify(O(),null,2));h.push(L(`web-debug-flags.json`,ee));try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));h.push(L(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));h.push(L(`web-sse-liveness-triage.json`,n))}}catch{}if(p()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));h.push(L(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);h.push(L(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await R(t,{window:{startTime:s,endTime:o},activeConversationId:n});e&&h.push(L(`platform-logs.tar.gz`,e))}h.push(new Uint8Array(1024));let g=h.reduce((e,t)=>e+t.length,0),_=new Uint8Array(g),v=0;for(let e of h)_.set(e,v),v+=e.length;let y=new Blob([_.buffer]),x=await new Response(y.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([x],`web-client-logs-${i.getTime()}.tar.gz`,{type:`application/gzip`})}function z({open:e,onClose:t,initialReason:n,onSubmitted:r,assistantId:s,assistantVersion:m,activeConversationId:_,getDiagnosticsSnapshot:y}){let b=v.use.user()?.email,x=(0,T.useId)(),S=(0,T.useRef)(null),w=(0,T.useRef)(null),E=(0,T.useRef)(null),D=(0,T.useRef)(null),[O,k]=(0,T.useState)(n??`bug_report`),[M,N]=(0,T.useState)(``),[P,I]=(0,T.useState)(``),[L,R]=(0,T.useState)(j.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[z,B]=(0,T.useState)(!1),[V,H]=(0,T.useState)(`past_hour`),[U,W]=(0,T.useState)([]),[G,K]=(0,T.useState)(null),[fe,q]=(0,T.useState)(!1),[J,Y]=(0,T.useState)(!1),X=o(te()),[pe,Z]=(0,T.useState)(!1),Q=X.isPending||pe,me=!b,he=(0,T.useMemo)(()=>M.trim().length>0&&P.trim().length>0,[M,P]);(0,T.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;k(t),N(``),I(b??``),R(j.find(e=>e.value===t)?.includesLogsByDefault??!0),B(!1),H(`past_hour`),W([]),Y(!1),K(null),Z(!1),X.reset();let r=setTimeout(()=>{b?E.current?.focus():D.current?.focus()},50);return()=>clearTimeout(r)},[e]),(0,T.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let ge=e=>{k(e),z||R(j.find(t=>t.value===e)?.includesLogsByDefault??!1)},_e=()=>{R(e=>!e),B(!0)},ve=(0,T.useCallback)(e=>{e.key===`Escape`&&!Q&&t()},[t,Q]),ye=(0,T.useCallback)(e=>{e.target===S.current&&!Q&&t()},[t,Q]),$=(0,T.useCallback)(e=>{W(t=>{let n=F-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ce(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),be=e=>{e.target.files&&$(Array.from(e.target.files)),e.target.value=``},xe=e=>{e.preventDefault(),q(!1),e.dataTransfer.files?.length&&$(Array.from(e.dataTransfer.files))},Se=e=>{e.preventDefault(),q(!0)},Ce=e=>{e.preventDefault(),e.currentTarget===e.target&&q(!1)},we=e=>{W(t=>t.filter((t,n)=>n!==e))};return e?(0,ie.createPortal)((0,A.jsx)(`div`,{ref:S,role:`dialog`,"aria-modal":`true`,"aria-labelledby":x,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:ve,onClick:ye,onDrop:xe,onDragOver:Se,onDragLeave:Ce,children:(0,A.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,A.jsx)(`h2`,{id:x,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,A.jsx)(a,{variant:`ghost`,iconOnly:(0,A.jsx)(g,{}),onClick:t,disabled:Q,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${Q?`pointer-events-none opacity-60`:``}`,children:[me&&(0,A.jsx)(d,{id:`${x}-email`,ref:D,label:`Email`,type:`email`,placeholder:`you@example.com`,value:P,onChange:e=>I(e.target.value),leftIcon:(0,A.jsx)(ne,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,A.jsx)(`div`,{className:`flex gap-2`,children:j.map(e=>(0,A.jsx)(ue,{option:e,isSelected:O===e.value,onSelect:()=>ge(e.value)},e.value))})]}),(0,A.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),O===`bug_report`&&(0,A.jsxs)(l,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,A.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),O===`feature_request`&&(0,A.jsxs)(l,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,A.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,A.jsx)(u,{id:`${x}-message`,ref:E,label:O===`bug_report`?`What went wrong?`:O===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:O===`bug_report`?`What did you expect to happen, and what happened instead?`:O===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:M,onChange:e=>N(e.target.value),fullWidth:!0}),O!==`feature_request`&&(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,A.jsx)(f,{checked:L,onChange:_e,"aria-label":`Include browser diagnostics`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,A.jsx)(i,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,A.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,A.jsx)(h,{className:`h-3.5 w-3.5`})})})]}),L&&(0,A.jsx)(c,{options:ae,value:V,onChange:H,"aria-label":`Diagnostics time range`})]}),p()&&_&&O!==`feature_request`&&(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,A.jsx)(f,{checked:J,onChange:()=>Y(e=>!e),"aria-label":`Include the most recent conversation`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,U.length>0&&(0,A.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,U.length,`/`,F]})]}),(0,A.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,A.jsx)(C,{}),onClick:()=>w.current?.click(),disabled:U.length>=F,children:`Add files`}),(0,A.jsx)(`input`,{ref:w,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:be,className:`hidden`})]}),U.length>0&&(0,A.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:U.map((e,t)=>(0,A.jsx)(de,{file:e,onRemove:()=>we(t)},`${e.name}-${t}`))}),fe&&(0,A.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]}),G&&(0,A.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:G})]}),(0,A.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:Q?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,A.jsx)(ee,{className:`h-4 w-4 animate-spin`}),`Sending feedback…`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{variant:`ghost`,onClick:t,children:`Cancel`}),(0,A.jsx)(a,{variant:`primary`,leftIcon:(0,A.jsx)(re,{}),onClick:async()=>{if(!(!he||Q)){K(null),Z(!0);try{let e=L&&O!==`feature_request`?await le(V,s??null,p()?J?_??null:null:_??null,y):null;await X.mutateAsync({headers:{"Content-Type":null},body:{message:M.trim(),classification:oe[O],email:P.trim(),client:se(),client_version:void 0,...s?{assistant_id:s}:{},...m?{assistant_version:m}:{},...e?{logs_file:e}:{},...U.length?{attachments:U}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),r?.(),t()}catch(e){K(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Z(!1)}}},disabled:!he,children:`Submit`})]})})]})}),document.body):null}function ue({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,A.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,A.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,A.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function de({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,T.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,T.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,A.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,A.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,A.jsx)(C,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,A.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,A.jsx)(g,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{k as n,z as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n,t as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./is-electron-C_ZTVhv8.js";import{A as o,k as s}from"./auth-store-Kfxhs2oI.js";import{a as c}from"./routes-DVqkwUEe.js";import{n as l,r as u}from"./login-flow-DPi11n3h.js";import{t as d}from"./proxy-DmIh4F51.js";import{t as f}from"./AnimatePresence-CgXwEO42.js";import{X as p,at as m}from"./index-PRnvH2Y1.js";import{t as h}from"./signup-shell-Bu5BM6II.js";var g=e(t(),1),_=i();function v({words:e}){let[t,n]=(0,g.useState)(0),r=(0,g.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,g.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,_.jsxs)(`span`,{className:`signup__rotating`,children:[(0,_.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,_.jsx)(f,{mode:`wait`,children:(0,_.jsxs)(d.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var y=[`Personal Intelligence`,`Software Engineer`,`Finance Ops`,`Household Manager`,`GTM Engineer`,`Product Lead`],b=[{icon:(0,_.jsx)(p,{size:18}),label:`Continue with Google`,providerHint:`GoogleOAuth`},{icon:(0,_.jsx)(m,{size:18}),label:`Continue with Apple`,providerHint:`AppleOAuth`},{icon:(0,_.jsxs)(`svg`,{width:18,height:18,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,_.jsx)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}),(0,_.jsx)(`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`})]}),label:`Continue with Email`}];function x({returnTo:e}){let[t,n]=(0,g.useState)(null),i=u(e,{authIntent:`signup`}),d=t=>{n(null);let r=!!t&&!s()&&!a();o(l,i,{returnTo:e,...t?{providerHint:t}:{},...r?{}:{intent:`signup`}}).catch(e=>{console.error(`[signup] auth flow failed:`,e),n(`Something went wrong. Please try again.`)})};return(0,_.jsxs)(h,{children:[(0,_.jsxs)(`h1`,{className:`signup__title`,children:[`Meet your new`,(0,_.jsx)(`br`,{}),(0,_.jsx)(v,{words:y})]}),(0,_.jsx)(`p`,{className:`signup__subtitle`,children:`The most powerful assistant that can handle your work and life admin tasks.`}),(0,_.jsx)(`div`,{className:`signup__buttons`,children:b.map((e,t)=>(0,_.jsxs)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>d(e.providerHint),children:[t===0&&(0,_.jsx)(`span`,{className:`signup__tag`,children:`Most used`}),e.icon,e.label]},e.label))}),t&&(0,_.jsx)(`p`,{className:`signup__error`,children:t}),(0,_.jsxs)(`p`,{className:`signup__footer`,children:[`Already have an account?`,` `,(0,_.jsx)(r,{to:c.account.login,className:`signup__link`,children:`Sign in`})]}),(0,_.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,_.jsx)(m,{size:16}),`Download for macOS`]})]})}function S(){let[e]=n();return(0,_.jsx)(x,{returnTo:e.get(`returnTo`)})}export{S as SignupPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,t as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./react-DJZBPgpf.js";import{O as i,t as a}from"./button-D7s2Q_uG.js";import{h as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./card-BibIM9x3.js";import{n as f,t as p}from"./panel-item-nGTDevWP.js";import{t as m}from"./menu-C_97pis4.js";import"./src-CK6bncSg.js";import{t as ee}from"./confirm-dialog-CfOXCE1N.js";import{t as h}from"./popover-CL-JL6vG.js";import{t as g}from"./input-C8kfrq9r.js";import{n as _}from"./stat-square-B0S3fO7O.js";import{t as v}from"./createLucideIcon-BlMXrA59.js";import{t as y}from"./arrow-left-CP-EhDNF.js";import{a as b,c as x,i as S,n as C,o as w,r as T,s as E,t as te}from"./install-C3xe8ARr.js";import{t as D}from"./calendar-CpgH8CqM.js";import{t as O}from"./check-D6WkI0gF.js";import{t as k}from"./cloud-off-rAv4OHmv.js";import{t as A}from"./code-aMX9iMYa.js";import{t as j}from"./file-text-CmK9LY1p.js";import{t as M}from"./globe-DYF_lSGm.js";import{t as N}from"./link-2-CaszbD7P.js";import{t as P}from"./loader-circle-IIzBGiwm.js";import{t as F}from"./sparkles-BICoewVE.js";import{t as I}from"./triangle-alert-DKOyShqD.js";import{t as ne}from"./x-KVxA2ZL0.js";import{Gt as re,_t as ie,gt as ae,ht as oe,mt as L,pt as R}from"./react-query.gen-CQLyoqYk.js";import{n as se}from"./use-is-mobile-Cy10kl9u.js";import{$i as z,Di as B,Ir as V,Jr as H,Kr as U,L as W,Lr as ce,Or as G,Pr as le,R as K,Ur as ue,Zi as q,ci as de,di as fe,ia as J,ji as pe,pi as me,si as he,wi as ge,yi as Y}from"./index-PRnvH2Y1.js";import{t as _e}from"./use-active-assistant-id-C-RHQ9f6.js";var ve=v(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),ye=v(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),X=e(r(),1),be={mail:me,calendar:D,"message-circle":fe,globe:M,zap:G,code:A,mic:de,"shopping-cart":ue,palette:ye,heart:ge,settings:U,"link-2":N};function xe(e){return be[e]}var Z=u();function Se({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a}){let o=[...a].sort((e,t)=>e.label.localeCompare(t.label));return(0,Z.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":`Skill categories`,children:[(0,Z.jsx)(Ce,{icon:Y,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),o.map(r=>(0,Z.jsx)(Ce,{icon:xe(r.icon)??Y,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function Ce({icon:e,label:t,count:n,isActive:r,showCount:i,onClick:o}){return(0,Z.jsxs)(a,{variant:`ghost`,onClick:o,"aria-pressed":r,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:r?`var(--surface-active)`:void 0,color:r?`var(--content-default)`:`var(--content-secondary)`},children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,Z.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`text-body-medium-default`,children:t})]}),i&&(0,Z.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:n})]})}var we=e(i(),1);function Te(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function Ee(e,t){let[n,r]=(0,X.useState)(null),i=c({...L({path:{assistant_id:e,id:t}}),select:e=>e??null}),a=(0,X.useMemo)(()=>i.data?.files??[],[i.data]),o=(0,X.useMemo)(()=>a.find(e=>e.name===`SKILL.md`),[a]),s=Te(a,n),l=c({...R({path:{assistant_id:e,id:t},query:{path:s??``}}),select:e=>e??null,enabled:!!s});return{fileEntries:a,skillMd:o,selectedPath:n,setSelectedPath:r,activePath:s,activeFile:a.find(e=>e.path===s),isFilesLoading:i.isLoading,fileContent:l.data?.content??null,isBinary:!!l.data?.isBinary,isContentLoading:l.isLoading}}function De({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`}):t===null?(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,e,`.`]}):K(e,void 0)&&r===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(W,{content:t})}):(0,Z.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function Oe({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:i,isInstalling:o=!1,isRemoving:s=!1}){let c=T(t),l=b(t),{fileEntries:u,setSelectedPath:f,activePath:p,activeFile:m,isFilesLoading:ee,fileContent:h,isBinary:g,isContentLoading:v}=Ee(e,t.id),[x,S]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{S(`preview`)},[p]);let[C,te]=(0,X.useState)(null);(0,X.useEffect)(()=>{te(document.getElementById(`viewport-overlays`))},[]);let D=m?K(m.name,void 0):!1,O=D?x:`raw`,k=(0,Z.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(y,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:t.name}),(0,Z.jsx)(ke,{available:c,removable:l,isInstalling:o,isRemoving:s,onInstall:r,onRemove:i})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(E,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(w,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description})]}),(0,Z.jsx)(d.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(je,{fileEntries:u,activePath:p,activeName:m?.name??null,onSelect:f}),(0,Z.jsx)(_,{iconOnly:!0,ariaLabel:`File view mode`,value:O,onChange:S,items:[{value:`preview`,label:`Preview`,icon:(0,Z.jsx)(pe,{"aria-hidden":!0}),disabled:!D},{value:`raw`,label:`Source`,icon:(0,Z.jsx)(A,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:ee||v?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(P,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):m?(0,Z.jsx)(De,{fileName:m.name,content:h,isBinary:g,viewMode:O}):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]});return C?(0,we.createPortal)(k,C):k}function ke({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:i,onRemove:o}){return n||r?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(P,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(J,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:i,disabled:!i,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(V,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Remove skill`,onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(V,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:`Bundled skills cannot be removed`,"aria-label":`Bundled skill cannot be removed`,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function Ae(e){return(e??``).endsWith(`/directory`)}function je({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i})]}):(0,Z.jsxs)(m.Root,{children:[(0,Z.jsx)(m.Trigger,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i}),(0,Z.jsx)(z,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(m.Content,{align:`start`,children:e.map(e=>{let n=Ae(e.mimeType);return(0,Z.jsx)(m.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Z.jsx)(B,{}):(0,Z.jsx)(j,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function Me(){return(0,Z.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Z.jsx)(j,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}var Ne=[{value:`all`,label:`All`,icon:Y},{value:`installed`,label:`Installed`,icon:q},{value:`available`,label:`Available`,icon:J}],Pe=[{value:`vellum`,label:`Vellum`,icon:x},{value:`clawhub`,label:`Clawhub`,icon:M},{value:`skillssh`,label:`skills.sh`,icon:ce},{value:`custom`,label:`Custom`,icon:le}];function Fe({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u}){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(g,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search skills`,"aria-label":`Search skills`,leftIcon:(0,Z.jsx)(H,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,Z.jsx)(P,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,Z.jsx)(Ie,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u})]})}function Ie(e){let t=se(),[n,r]=(0,X.useState)(!1),i=(0,Z.jsx)(a,{type:`button`,variant:`outlined`,iconOnly:(0,Z.jsx)(ve,{"aria-hidden":!0}),"aria-label":`Filter skills`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,Z.jsx)(Le,{...e,open:n,onOpenChange:r,trigger:i}):(0,Z.jsxs)(h.Root,{open:n,onOpenChange:r,children:[(0,Z.jsx)(h.Trigger,{asChild:!0,children:i}),(0,Z.jsx)(h.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,Z.jsxs)(`ul`,{role:`listbox`,children:[(0,Z.jsx)(Re,{label:`Status`,options:Ne,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}}),(0,Z.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,Z.jsx)(Re,{label:`Source`,options:Pe,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}})]})})]})}function Le({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:i,counts:o,totalCount:s,showCounts:c,open:l,onOpenChange:u,trigger:d}){let p=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,Z.jsxs)(f.Root,{open:l,onOpenChange:u,children:[(0,Z.jsx)(f.Trigger,{asChild:!0,children:d}),(0,Z.jsxs)(f.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,Z.jsx)(f.Header,{children:(0,Z.jsx)(f.Title,{children:`Filters`})}),(0,Z.jsxs)(f.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,Z.jsx)(Q,{label:`Status`,children:Ne.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsx)(Q,{label:`Source`,children:Pe.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsxs)(Q,{label:`Categories`,children:[(0,Z.jsx)($,{icon:Y,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>i(null)}),p.map(e=>(0,Z.jsx)($,{icon:xe(e.icon)??Y,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>i(e.slug)},e.slug))]})]}),(0,Z.jsx)(f.Footer,{children:(0,Z.jsx)(a,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>u(!1),children:`Done`})})]})]})}function Q({label:e,children:t}){return(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function $({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,Z.jsx)(p,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,Z.jsx)(O,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function Re({label:e,options:t,selected:n,onSelect:r}){return(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,Z.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,Z.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,Z.jsx)(q,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}function ze({skill:e,onSelect:t,onInstall:n,onRemove:r,isInstalling:i=!1,isRemoving:o=!1}){let s=T(e),c=b(e);return(0,Z.jsx)(d.Root,{asChild:!0,children:(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,Z.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,Z.jsx)(E,{skill:e,className:`h-7 w-7`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,Z.jsx)(w,{origin:e.origin})]}),(0,Z.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),s?i?(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(P,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(J,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),n?.()},disabled:!n,"aria-label":`Install skill`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,variant:`dangerOutline`,iconOnly:o?(0,Z.jsx)(P,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(V,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!c||o||!r,"aria-label":c?`Remove skill`:`Bundled skill cannot be removed`,title:c?void 0:`Bundled skills cannot be removed`,expandOnMobile:!1})]})})}function Be(e){return c({...oe({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}function Ve(e){switch(e){case`installed`:return{kind:`installed`};case`available`:return{kind:`available`};case`vellum`:case`clawhub`:case`skillssh`:case`custom`:return{origin:e};default:return{}}}function He(e){return[...e].sort((e,t)=>{let n=S(e);return n===S(t)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function Ue(e,t){let[n,r]=(0,X.useState)(e);return(0,X.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>clearTimeout(n)},[e,t]),n}var We=300,Ge=`vellum:skills:tipDismissed`;function Ke({assistantId:e,initialSkillId:r}){let i=s(),a=se(),[o,u]=(0,X.useState)(``),d=Ue(o.trim(),We),[f,p]=(0,X.useState)(`all`),[m,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(r??null),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(null),[S,w]=(0,X.useState)(null),[T,E]=(0,X.useState)(()=>n(Ge,!1)),{data:D=[]}=Be(e),{origin:O,kind:k}=(0,X.useMemo)(()=>Ve(f),[f]),A=c({...ae({path:{assistant_id:e},query:{include:`catalog`,origin:O,kind:k,q:d||void 0,category:m??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e}),j=c({...ae({path:{assistant_id:e},query:{include:`catalog`,origin:O,kind:k,q:d||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&m!==null}),M=(0,X.useCallback)(()=>{i.invalidateQueries({queryKey:ie({path:{assistant_id:e}})})},[e,i]),N=l({mutationFn:t=>te(e,t),onMutate:e=>y(e),onSettled:()=>{y(null),M()}}),P=re({onMutate:e=>x(e.path.id),onSettled:()=>{x(null),M()}}),F=(0,X.useCallback)(e=>{N.mutate(e.slug??e.id)},[N]),I=(0,X.useCallback)(e=>{w(e)},[]),ne=(0,X.useCallback)(()=>{S&&(P.mutate({path:{assistant_id:e,id:S.id}}),w(null))},[e,S,P]),oe=(0,X.useCallback)(()=>{E(!0),t(Ge,!0)},[]),L=(0,X.useMemo)(()=>A.data?.skills??[],[A.data?.skills]),R=m===null?A.data:j.data,{counts:z,totalCount:B}=qe(R?.skills??L,R?.categoryCounts,R?.totalCount),V=(0,X.useMemo)(()=>He(L),[L]),H=(0,X.useMemo)(()=>g?L.find(e=>e.id===g)??null:null,[L,g]),U=(0,Z.jsx)(ee,{open:S!==null,title:`Remove skill`,message:S?`Remove "${S.name}" from this assistant?`:``,confirmLabel:`Remove`,destructive:!0,onConfirm:ne,onCancel:()=>w(null)});if(H){let t={assistantId:e,skill:H,onBack:()=>_(null),onInstall:()=>F(H),onRemove:()=>I(H),isInstalling:v===(H.slug??H.id),isRemoving:b===H.id};return(0,Z.jsxs)(Z.Fragment,{children:[a?(0,Z.jsx)(Oe,{...t}):(0,Z.jsx)(C,{...t}),U]})}let W=A.isFetching&&!!d;return(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!T&&(0,Z.jsx)(Je,{onDismiss:oe}),(0,Z.jsx)(Fe,{search:o,onSearchChange:u,filter:f,onFilterChange:p,isSearching:W,categories:D,category:m,onCategoryChange:h,counts:z,totalCount:B,showCounts:!W}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,Z.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto sm:block`,children:(0,Z.jsx)(Se,{selected:m,onSelect:h,counts:z,totalCount:B,showCounts:!W,categories:D})}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:A.isLoading?(0,Z.jsx)(Ye,{}):A.isError?(0,Z.jsx)(Xe,{}):V.length===0?(0,Z.jsx)(Ze,{filter:f,category:m}):(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2`,children:V.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(ze,{skill:e,onSelect:()=>_(e.id),onInstall:()=>F(e),onRemove:()=>I(e),isInstalling:v===(e.slug??e.id),isRemoving:b===e.id})},e.id))})})]}),U]})}function qe(e,t,n){return(0,X.useMemo)(()=>{if(t&&Object.keys(t).length>0)return{counts:t,totalCount:n??e.length};let r={};for(let t of e){let e=t.category??`system`;r[e]=(r[e]??0)+1}return{counts:r,totalCount:n??e.length}},[e,t,n])}function Je({onDismiss:e}){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,Z.jsx)(F,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,Z.jsx)(`p`,{className:`flex-1`,children:`You can create a new custom skill by describing what you want in chat.`}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(ne,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Ye(){return(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Z.jsx)(P,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Xe(){return(0,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(I,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load skills`}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function Ze({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=Qe(e,t);return(0,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r})]})})}function Qe(e,t){if(t)return{title:`No skills in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:Y};switch(e){case`installed`:return{title:`No Skills Installed`,subtitle:`Ask your assistant in chat to search for and install new skills.`,Icon:G};case`available`:return{title:`No Skills Available`,subtitle:`All available skills have been installed.`,Icon:q};case`vellum`:return{title:`No Vellum Skills`,subtitle:`No bundled Vellum skills found.`,Icon:he};case`clawhub`:return{title:`No Clawhub Skills`,subtitle:`No Clawhub skills found. Try searching the catalog.`,Icon:M};case`skillssh`:return{title:`No skills.sh Skills`,subtitle:`No skills.sh skills found. Try searching the catalog.`,Icon:ce};case`custom`:return{title:`No Custom Skills`,subtitle:`Create a custom skill by describing what you want in chat.`,Icon:le};default:return{title:`No Skills Available`,subtitle:`Check your connection to the Vellum catalog.`,Icon:k}}}function $e(){let e=_e(),[t]=o();return(0,Z.jsx)(Ke,{assistantId:e,initialSkillId:t.get(`skill`)??void 0})}export{$e as SkillsPage};
|