@vellumai/web 0.8.9-dev.202606091853.fbaa2ae → 0.8.9-dev.202606091926.ebb2d62
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/{account-page-DHyG65VN.js → account-page-DDXf71EJ.js} +1 -1
- package/dist/assets/{add-credits-modal-BcL-MSXn.js → add-credits-modal-Ba4Xq3mP.js} +1 -1
- package/dist/assets/{advanced-page-aj-cuPfj.js → advanced-page-D_rGd8hT.js} +1 -1
- package/dist/assets/{ai-page-k31aTHd5.js → ai-page-DOMxHHyx.js} +1 -1
- package/dist/assets/{api-DBHPdtEG.js → api-DA14D9P8.js} +1 -1
- package/dist/assets/{archive-page-CCL1x-3S.js → archive-page-CZfW23DN.js} +1 -1
- package/dist/assets/{assistant-feature-flag-store-0382ImYF.js → assistant-feature-flag-store-CRKVT3rt.js} +1 -1
- package/dist/assets/{assistant-status-panel-BfZ3oR8o.js → assistant-status-panel-DjggokJY.js} +1 -1
- package/dist/assets/{auth-store-jNrWpxgy.js → auth-store-CEYaVkBG.js} +1 -1
- package/dist/assets/{billing-page-DVfx3XmM.js → billing-page-Xywc9ybw.js} +1 -1
- package/dist/assets/{command-palette-DkI70mF4.js → command-palette-CCbik2ci.js} +1 -1
- package/dist/assets/{community-page-D9tApSlD.js → community-page-CJhP5yYL.js} +1 -1
- package/dist/assets/{connect-page-BRr2GzVB.js → connect-page-HIhq_iZu.js} +1 -1
- package/dist/assets/{contacts-page-route-DUHVQrvq.js → contacts-page-route-DY41r-ZB.js} +1 -1
- package/dist/assets/debug-page-CN5niysO.js +3 -0
- package/dist/assets/{deploy-dialogs-D03jYjda.js → deploy-dialogs-DsaGDLoe.js} +1 -1
- package/dist/assets/{developer-page-Svw_HGeh.js → developer-page-DymLhWw4.js} +1 -1
- package/dist/assets/{devices-page-Dx3KRVi4.js → devices-page-ByHiS7Hh.js} +1 -1
- package/dist/assets/{document-viewer-page-BZMcwLRH.js → document-viewer-page-Doj2ePu_.js} +1 -1
- package/dist/assets/{earn-credits-modal-Da03LlqC.js → earn-credits-modal-Dkd0Q08t.js} +1 -1
- package/dist/assets/{emails-page-Caon1ZjC.js → emails-page-BZM8Qj9H.js} +1 -1
- package/dist/assets/feature-flag-catalog-CEp3DBEM.js +1 -0
- package/dist/assets/{general-page-WH9rwkLk.js → general-page-Dzt0hIwa.js} +1 -1
- package/dist/assets/{hatching-screen-B7pXpfaO.js → hatching-screen-BgXc4QXD.js} +1 -1
- package/dist/assets/{home-page-route-BDLYaq1T.js → home-page-route-CoWif8tz.js} +1 -1
- package/dist/assets/{hosting-screen-BdNf89TF.js → hosting-screen-CSQT7_xn.js} +1 -1
- package/dist/assets/{identity-page-route-7j-DepeG.js → identity-page-route-COYOOdox.js} +1 -1
- package/dist/assets/index-BoHdS0dH.js +124 -0
- package/dist/assets/{inspect-page-C6YF68Ho.js → inspect-page-CZleugp8.js} +1 -1
- package/dist/assets/{install-SQc1Ig0h.js → install-Cr0_ROdI.js} +1 -1
- package/dist/assets/{integrations-page-rw1wY5pf.js → integrations-page-Db5NmQjH.js} +1 -1
- package/dist/assets/{intelligence-layout-D4dPznEi.js → intelligence-layout-D0yx4-8O.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-47PDw6wZ.js → keyboard-shortcuts-page-oT4iDHBY.js} +1 -1
- package/dist/assets/{library-detail-page-BkrMuxMx.js → library-detail-page-DH_-n2ZF.js} +1 -1
- package/dist/assets/library-page-DROhxP9w.js +1 -0
- package/dist/assets/{login-flow-z9z9eR90.js → login-flow-CGVhpMhL.js} +1 -1
- package/dist/assets/{login-page-QQnob3_Z.js → login-page-qWjFvdVx.js} +1 -1
- package/dist/assets/{logout-page-DAIohc86.js → logout-page-Cqdj6GbH.js} +1 -1
- package/dist/assets/{logs-layout-C6g7dftU.js → logs-layout-CzzECogM.js} +1 -1
- package/dist/assets/{memory-router-playground-page-D4u2E6Xy.js → memory-router-playground-page-C36jgrL2.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-C3MvHFnL.js → mobile-sidebar-drawer-B2ClO-zB.js} +1 -1
- package/dist/assets/{notifications-page-91BFfcwq.js → notifications-page-kcxcRxBI.js} +1 -1
- package/dist/assets/{oauth-complete-page-NfC8zPW6.js → oauth-complete-page-Bfkk9A3u.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-_o8ejGe0.js → oauth-popup-complete-page-CxbVvSEU.js} +1 -1
- package/dist/assets/{platform-loopback-page-C5TJwMVD.js → platform-loopback-page-DyXQ6NvW.js} +1 -1
- package/dist/assets/{plugin-detail-page-D42f3FT0.js → plugin-detail-page-geoYiAlT.js} +1 -1
- package/dist/assets/{plugins-page-B1lnlHSZ.js → plugins-page--NwZlb3s.js} +1 -1
- package/dist/assets/{pre-chat-flow-CddVng_l.js → pre-chat-flow-BAH62AEt.js} +1 -1
- package/dist/assets/{privacy-page-D8Dr_hAg.js → privacy-page-yLv8pxcQ.js} +1 -1
- package/dist/assets/{privacy-screen-D7KrSpRB.js → privacy-screen-CIPUbd6m.js} +1 -1
- package/dist/assets/{provider-callback-page-CrRVMgnQ.js → provider-callback-page-4baz5ZSB.js} +1 -1
- package/dist/assets/{provider-signup-page-BAvggZ7R.js → provider-signup-page-D6q9JrqN.js} +1 -1
- package/dist/assets/{review-terms-screen-Bvht34Du.js → review-terms-screen-Cdwcsfka.js} +1 -1
- package/dist/assets/{schedules-page--2w51I6B.js → schedules-page-CZ9YxyW6.js} +1 -1
- package/dist/assets/{select-assistant-screen-4g9-_3S2.js → select-assistant-screen-M-2shDA3.js} +1 -1
- package/dist/assets/settings-layout-CdqjPbK4.js +1 -0
- package/dist/assets/{share-feedback-modal-ZCInLlSJ.js → share-feedback-modal-Co_P5WuZ.js} +1 -1
- package/dist/assets/{sidebar-tree-BptYPNE2.js → sidebar-tree-BRDRNQ8Q.js} +1 -1
- package/dist/assets/{signup-page-hE4kPsb8.js → signup-page-DI04DI-C.js} +1 -1
- package/dist/assets/{skills-page-yhAeLe8Y.js → skills-page-a30JiOR9.js} +1 -1
- package/dist/assets/{sounds-page-BXGwq2xV.js → sounds-page-C115AWgu.js} +1 -1
- package/dist/assets/{step-indicator-dots-CCvfgqNq.js → step-indicator-dots-Cz4FzNR8.js} +1 -1
- package/dist/assets/{subagent-detail-panel-D6s2B2j9.js → subagent-detail-panel-Bbnyrf81.js} +1 -1
- package/dist/assets/{system-events-page-BJy_hyk3.js → system-events-page-g_xLeN_u.js} +1 -1
- package/dist/assets/{tiptap-document-editor-Cmh7Nbjq.js → tiptap-document-editor-DScdORMl.js} +1 -1
- package/dist/assets/{tool-detail-panel-Eo4Gf45J.js → tool-detail-panel-C7MN-KAI.js} +1 -1
- package/dist/assets/{trace-page-BnKKOOiI.js → trace-page-CVP6LRdX.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-EezfAVlt.js → upgrade-cancel-page-B2rtkAy-.js} +1 -1
- package/dist/assets/{upgrade-success-page-Ccli69Rs.js → upgrade-success-page-RUhJdNDa.js} +1 -1
- package/dist/assets/{usage-page-6B_i1bms.js → usage-page-nhIdLaSC.js} +1 -1
- package/dist/assets/{use-current-platform-assistant-BqGICw68.js → use-current-platform-assistant-CnWB-OXZ.js} +1 -1
- package/dist/assets/use-is-org-ready-DQ-TnmMg.js +1 -0
- package/dist/assets/{use-oauth-complete-deep-link-listener-BxmSqcXw.js → use-oauth-complete-deep-link-listener-DL4gXjh5.js} +1 -1
- package/dist/assets/{use-onboarding-login-DcJY3t-a.js → use-onboarding-login-CU8ga9dy.js} +1 -1
- package/dist/assets/{voice-page-C1YE7kLx.js → voice-page-BBwDHQfi.js} +1 -1
- package/dist/assets/{weather-forecast-display-WkG6FXYP.js → weather-forecast-display-fyM6Wp3V.js} +1 -1
- package/dist/assets/{welcome-screen-C1Koaq39.js → welcome-screen-Db5Ic4aS.js} +1 -1
- package/dist/assets/{workspace-page-BUvx07NH.js → workspace-page-DlTxEh46.js} +1 -1
- package/dist/index.html +6 -6
- package/package.json +1 -1
- package/dist/assets/debug-page-DxKFE1w_.js +0 -3
- package/dist/assets/feature-flag-catalog-D6XoH2hm.js +0 -1
- package/dist/assets/index-CEdoUEuP.js +0 -124
- package/dist/assets/library-page-DTrNJriW.js +0 -1
- package/dist/assets/settings-layout-Dd8wrP-I.js +0 -1
- package/dist/assets/use-is-org-ready-CW_NkBal.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n,t as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./card-CL5iEMJO.js";import"./src-hn7lwVCD.js";import{t as s}from"./input-Cu3PPVCq.js";import{t as c}from"./chevron-right-zTNPbA1m.js";import{t as l}from"./loader-circle-BSAFLoPH.js";import{sn as u}from"./sdk.gen-AJllUeDf.js";import{B as d,R as f}from"./react-query.gen-mIY9pJOj.js";import{i as p}from"./routes-Dk5Qeryt.js";import{t as m}from"./assistant-feature-flag-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n,t as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./card-CL5iEMJO.js";import"./src-hn7lwVCD.js";import{t as s}from"./input-Cu3PPVCq.js";import{t as c}from"./chevron-right-zTNPbA1m.js";import{t as l}from"./loader-circle-BSAFLoPH.js";import{sn as u}from"./sdk.gen-AJllUeDf.js";import{B as d,R as f}from"./react-query.gen-mIY9pJOj.js";import{i as p}from"./routes-Dk5Qeryt.js";import{t as m}from"./assistant-feature-flag-store-CRKVT3rt.js";import{Pi as h,Qi as g,ia as _}from"./index-BoHdS0dH.js";import{t as v}from"./use-active-assistant-id-BIhArlF_.js";var y=e(t(),1),b=a();function x({match:e}){let t=e.source.kind===`github`;return(0,b.jsx)(o.Root,{asChild:!0,children:(0,b.jsxs)(r,{to:p.plugin(e.name),className:`group flex cursor-pointer items-center gap-4 px-5 py-4 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,b.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:`📦`}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.name}),t&&(0,b.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-tertiary)`},children:`external`})]}),e.description&&(0,b.jsx)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.description}),(0,b.jsx)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},title:e.path,children:e.path})]}),(0,b.jsx)(c,{className:`h-5 w-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})})}function S({plugin:e}){return(0,b.jsx)(o.Root,{asChild:!0,children:(0,b.jsxs)(r,{to:p.plugin(e.name),className:`group flex cursor-pointer items-center gap-4 px-5 py-4 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,b.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:`🧩`}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.name}),e.version?(0,b.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,e.version]}):null]}),(0,b.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:e.description??`No description provided.`}),e.issues&&e.issues.length>0?(0,b.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:e.issues.join(`; `),children:[e.issues[0],e.issues.length>1?` (+${e.issues.length-1} more)`:``]}):null]}),(0,b.jsx)(c,{className:`h-5 w-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})})}var C=300*1e3;function w(e,...t){return e?t.some(t=>t?.toLowerCase().includes(e)):!0}function T({assistantId:e}){let[t,n]=(0,y.useState)(``),r=t.trim().toLowerCase(),a=i({queryKey:f({path:{assistant_id:e},query:{q:void 0}}),queryFn:async({signal:t})=>{let n=await u({path:{assistant_id:e},query:{q:void 0},signal:t,throwOnError:!1});if(n.response?.status===404)return{plugins:[]};if(!n.response?.ok)throw Error(`Failed to load plugins`);return n.data??{plugins:[]}},enabled:!!e,staleTime:C}),o=i({...d({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e,staleTime:C}),s=(0,y.useMemo)(()=>E(a.data?.plugins??[]),[a.data?.plugins]),c=(0,y.useMemo)(()=>new Set(s.map(e=>e.name)),[s]),l=(0,y.useMemo)(()=>s.filter(e=>w(r,e.name,e.description)),[s,r]),p=(0,y.useMemo)(()=>(o.data?.matches??[]).filter(e=>!c.has(e.name)&&w(r,e.name,e.description)),[o.data?.matches,c,r]),m=a.isFetching&&!a.isLoading||o.isFetching&&!o.isLoading,h=a.isLoading,g=o.isLoading,_=!h&&!a.isError&&l.length===0,v=!g&&p.length===0;return(0,b.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[(0,b.jsx)(D,{search:t,onSearchChange:n,isSearching:m}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:[(0,b.jsx)(O,{title:`Installed`}),h?(0,b.jsx)(k,{}):a.isError?(0,b.jsx)(M,{}):_?(0,b.jsx)(A,{hasQuery:!!r}):(0,b.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(S,{plugin:e})},e.id))}),(0,b.jsx)(`div`,{className:`mt-6`}),(0,b.jsx)(O,{title:`Available to install`}),g?(0,b.jsx)(k,{}):o.isError?(0,b.jsx)(N,{}):v?(0,b.jsx)(j,{hasQuery:!!r}):(0,b.jsx)(`ul`,{className:`flex flex-col gap-2`,children:p.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(x,{match:e})},e.path))})]})]})}function E(e){return[...e].sort((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:`base`}))}function D({search:e,onSearchChange:t,isSearching:n}){return(0,b.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,b.jsx)(s,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search Plugins`,"aria-label":`Search Plugins`,leftIcon:(0,b.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:n?(0,b.jsx)(l,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`})})}function O({title:e}){return(0,b.jsx)(`h3`,{className:`mb-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e})}function k(){return(0,b.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,b.jsx)(l,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function A({hasQuery:e}){let t=e?`No installed plugins match`:`No Plugins Installed`,n=e?`Try a different search term, or browse the catalog below.`:`Install a plugin with the CLI, or browse the catalog below.`,r=e?g:_;return(0,b.jsx)(o.Root,{children:(0,b.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,b.jsx)(r,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,b.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:t}),(0,b.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n})]})})}function j({hasQuery:e}){let t=e?`No catalog entries match`:`Catalog is empty`,n=e?`Try a different search term, or remove the filter to browse everything.`:`No plugins are currently published in the catalog.`;return(0,b.jsx)(o.Root,{children:(0,b.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,b.jsx)(g,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,b.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:t}),(0,b.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n})]})})}function M(){return(0,b.jsx)(o.Root,{children:(0,b.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,b.jsx)(h,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,b.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load plugins`}),(0,b.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 N(){return(0,b.jsx)(o.Root,{children:(0,b.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,b.jsx)(_,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,b.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Couldn't load catalog`}),(0,b.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Catalog browsing is temporarily unavailable. Installed plugins are still listed above.`})]})})}function P(){let e=m.use.hasHydrated(),t=m.use.externalPlugins(),r=v();return e?t?(0,b.jsx)(T,{assistantId:r}):(0,b.jsx)(n,{to:p.identity,replace:!0}):null}export{P as PluginsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./button-DdEh-9f_.js";import{t as c}from"./card-CL5iEMJO.js";import{t as l}from"./input-Cu3PPVCq.js";import{f as u,l as d,s as f,t as p}from"./resolved-assistants-store-ub66utfl.js";import{t as m}from"./is-electron-CavSPgmY.js";import{t as h}from"./loader-circle-BSAFLoPH.js";import{t as g}from"./pencil-BA9LOIzP.js";import{t as _}from"./x-BDqbYVtS.js";import{B as v,O as y,V as b,a as x,i as S,n as C}from"./auth-store-jNrWpxgy.js";import{t as w}from"./client.gen-BKAMS0D0.js";import{i as T}from"./routes-Dk5Qeryt.js";import{t as E}from"./public-asset-Dx4la7Nv.js";import{$n as D,C as O,Dt as k,Ga as A,J as j,M as ee,N as te,P as M,Qn as N,Y as ne,_o as P,c as F,er as re,gr as I,ho as L,j as ie,l as ae,o as R,s as oe,st as se,tr as ce,vr as le,w as ue,wt as z,xr as de}from"./index-CEdoUEuP.js";import{t as B}from"./onboarding-layout-BIVa2BnX.js";import{c as fe,i as pe,n as V,o as me,r as he,s as ge,t as H}from"./step-indicator-dots-CCvfgqNq.js";import{t as _e}from"./use-oauth-complete-deep-link-listener-BxmSqcXw.js";var U=e(t(),1);async function ve(){try{let{data:e,response:t}=await w.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var W=o(),ye=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function be({onComplete:e}){function t(){F(),R(),e()}return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,W.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,W.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,W.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,W.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,W.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,W.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,W.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,W.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,W.jsx)(`ul`,{className:`space-y-4`,children:ye.map((e,t)=>(0,W.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,W.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,W.jsx)(P,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,W.jsxs)(`span`,{className:`text-left`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,W.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var G=`google`,xe=[{id:`gmail`,label:`Gmail`,logoSrc:E(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:E(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:E(`/images/integrations/google-drive.svg`)}];function Se({assistantId:e,assistantName:t,onConnect:n,onSkip:i,onBack:o}){let c=m(),l=r(),u=y(),d=(0,U.useRef)(null),f=(0,U.useRef)(null),p=(0,U.useRef)(null),g=(0,U.useRef)(null),_=(0,U.useRef)(null),v=(0,U.useRef)(null),b=(0,U.useRef)(null),[x,S]=(0,U.useState)(!1),C=(0,U.useCallback)(()=>{f.current=null,S(!1)},[]),w=(0,U.useCallback)(()=>{_.current&&=(window.removeEventListener(`message`,_.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),E=(0,U.useCallback)(()=>{d.current&&!d.current.closed&&d.current.close(),d.current=null,p.current&&=(clearInterval(p.current),null),g.current&&=(clearTimeout(g.current),null)},[]),D=a({...k()});(0,U.useEffect)(()=>()=>{p.current&&clearInterval(p.current),g.current&&clearTimeout(g.current),d.current&&!d.current.closed&&d.current.close(),_.current&&window.removeEventListener(`message`,_.current),v.current&&window.removeEventListener(`storage`,v.current),b.current&&=(b.current(),null)},[]);let O=(0,U.useCallback)(async()=>{try{return(await l.fetchQuery({...z({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===G&&e.connected)??null}catch{return null}},[e,l]),A=(0,U.useCallback)(async()=>{E(),C(),n((await O())?.scopes_granted??[])},[C,E,O,n]),N=(0,U.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!f.current||e.requestId!==f.current.requestId||(e.oauthStatus===`connected`?A():(E(),C())))},[C,E,A]),P=(0,U.useCallback)(e=>{let t=f.current;if(!t)return;let n=ie(e,window.location.origin,t.requestId);n&&N(n)},[N]),F=(0,U.useCallback)(e=>{let t=f.current;if(!t)return;let n=ee(e,t.requestId);n&&(N(n),window.localStorage.removeItem(M(t.requestId)))},[N]);_e((0,U.useCallback)(e=>{let t=f.current;t&&e.requestId===t.requestId&&N({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[N]));let re=(0,U.useCallback)(()=>{let t=crypto.randomUUID();if(w(),_.current=P,v.current=F,u){S(!0),f.current={requestId:t},D.mutate({path:{assistant_id:e,provider:G},body:{requested_scopes:[],redirect_after_connect:`${T.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){j(e.connect_url)},onError(){C()}}),window.addEventListener(`message`,P),window.addEventListener(`storage`,F),b.current&&b.current();let n=ne(()=>{if(!f.current){n(),b.current=null;return}(async()=>{let e=await O();f.current&&(e?await A():C(),w(),n(),b.current=null)})()});b.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){w();return}d.current=n,S(!0),f.current={requestId:t},window.addEventListener(`message`,P),window.addEventListener(`storage`,F),p.current=setInterval(()=>{d.current&&d.current.closed&&f.current&&!g.current&&(g.current=setTimeout(async()=>{g.current=null;let e=f.current;if(!e)return;let t=window.localStorage.getItem(M(e.requestId));if(t)try{let n=JSON.parse(t);if(te(n,e.requestId)){N(n),window.localStorage.removeItem(M(e.requestId)),w();return}}catch{}let n=await O();f.current&&(n?await A():(E(),C()),w())},1e3))},100),D.mutate({path:{assistant_id:e,provider:G},body:{requested_scopes:[],redirect_after_connect:`${T.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){d.current&&!d.current.closed?d.current.location.href=e.connect_url:f.current&&(E(),C(),w())},onError(){E(),C(),w()}})},[e,C,E,O,N,P,F,A,u,w,D]),I=t||`your assistant`,ae=t||`Your assistant`;return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${c?`px-8 pt-7 pb-4 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(L,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${c?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${I} can use Gmail, Calendar, and Drive with your permission.`}),(0,W.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:xe.map(e=>(0,W.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,W.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,W.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${ae} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,W.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:re,disabled:x||D.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:x||D.isPending?(0,W.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,W.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,disabled:x||D.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}var K=[{id:`grounded`,label:`Grounded`,descriptor:`Calm and precise`,tagline:`Measured. No filler.`,names:[`Penn`,`Sage`,`Atlas`,`Orion`,`Reed`,`Quill`]},{id:`warm`,label:`Warm`,descriptor:`Warm and easy`,tagline:`Friendly and casual.`,names:[`Kit`,`Remy`,`Wren`,`Milo`,`Fenn`,`Cleo`]},{id:`energetic`,label:`Energetic`,descriptor:`Fast and direct`,tagline:`Brief. To the point.`,names:[`Nova`,`Ember`,`Cade`,`Lark`,`Vela`,`Ziggy`]},{id:`poetic`,label:`Poetic`,descriptor:`Quiet and observant`,tagline:`Listens, then replies.`,names:[`Luna`,`Iris`,`Vesper`,`Lyra`,`Juno`,`Ada`]}],Ce=6;function we(){return K.flatMap(e=>e.names)}function Te(){let e=we(),t=Math.min(Ce,e.length);for(let n=0;n<t;n+=1){let t=n+Math.floor(Math.random()*(e.length-n)),r=e[n];e[n]=e[t],e[t]=r}return e.slice(0,t)}function Ee({userName:e,assistantName:t,selectedGroupId:n,displayedAssistantNames:r,onUserNameChange:i,onAssistantNameChange:a,onGroupChange:o,onBack:c,onComplete:u,onSkip:d}){let f=m();return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`px-8 pt-11 pb-4 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,W.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(L,{className:`h-4 w-4`})}):null,(0,W.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,W.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,W.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),fullWidth:!0}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),fullWidth:!0}),(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let n=e===t;return(0,W.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,W.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:K.map(e=>(0,W.jsx)(De,{group:e,isActive:n===e.id,onToggle:()=>o(n===e.id?null:e.id)},e.id))})]})]}),(0,W.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:d,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function De({group:e,isActive:t,onToggle:n}){return(0,W.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,W.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function Oe({userName:e,assistantName:t,displayedAssistantNames:n,onUserNameChange:r,onAssistantNameChange:i,onBack:a,onContinue:o,onSkip:c,currentStep:u,totalSteps:d}){return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[a?(0,W.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,W.jsx)(L,{}),onClick:a,"aria-label":`Back`}):(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,W.jsx)(`div`,{className:`flex justify-center`,children:(0,W.jsx)(H,{current:u,total:d})}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,W.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,W.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,W.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>r(e.target.value),fullWidth:!0}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>i(e.target.value),fullWidth:!0}),(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let n=e===t;return(0,W.jsx)(`button`,{type:`button`,onClick:()=>i(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:o,className:`h-11 text-base`,children:`Continue`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var ke=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:E(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:E(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:E(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:E(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:E(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:E(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:E(`/images/prior-assistants/copilot.svg`)}];function Ae({selectedAssistants:e,onChange:t,onBack:n,onContinue:r,onSkip:i}){let a=m(),[o,u]=(0,U.useState)(()=>q(e)),[d,f]=(0,U.useState)(()=>o.length>0),p=(0,U.useRef)(Me(e));(0,U.useEffect)(()=>{let t=Me(e);if(t===p.current)return;let n=q(e);u(n),f(e=>e||n.length>0),p.current=t},[e]),(0,U.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of o.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}je(n,e)||(p.current=Me(n),t(n))},[o]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(0,U.useMemo)(()=>{let e=new Set;return o.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[o]),y=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${a?`px-8 pt-7 pb-4 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(L,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${a?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsx)(`p`,{className:`${a?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${a?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,W.jsxs)(`div`,{className:`${a?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[ke.map(t=>(0,W.jsx)(Ne,{assistant:t,selected:e.has(t.id),onToggle:()=>h(t.id)},t.id)),d?null:(0,W.jsx)(Pe,{onClick:()=>f(!0)})]}),d?(0,W.jsx)(c,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(g,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(_,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,W.jsx)(l,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:o,onChange:e=>u(e.target.value),helperText:`Separate multiple assistants with commas`,fullWidth:!0}),v.length>0?(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.map(e=>(0,W.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,W.jsxs)(`div`,{className:`${a?`mt-6`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:r,className:`${a?`h-9`:`h-11 text-base`}`,children:y}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,className:`${a?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function je(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function q(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Me(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Ne({assistant:e,selected:t,onToggle:n}){return(0,W.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(J,{assistant:e,size:32}),(0,W.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,W.jsx)(P,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Pe({onClick:e}){return(0,W.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,W.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,W.jsx)(A,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,W.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function J({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,W.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,W.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,W.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Fe({selectedTasks:e,onChange:t,onBack:n,onContinue:r,onSkip:i}){let a=m(),o=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${a?`px-8 pt-7 pb-4 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(L,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${a?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsx)(`p`,{className:`${a?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${a?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,W.jsx)(`div`,{className:`${a?`mt-6`:`mt-8`} flex w-full flex-col ${a?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:O.map(t=>{let n=ue[t.iconKey],r=e.has(t.id);return(0,W.jsxs)(`button`,{type:`button`,onClick:()=>o(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${a?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,W.jsx)(n,{className:`h-4 w-4`}):null}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,W.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,W.jsx)(P,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,W.jsxs)(`div`,{className:`${a?`mt-6`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:r,className:`${a?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,className:`${a?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Ie=new Set([`gmail`,`google-calendar`,`google-drive`]),Le=[{id:`gmail`,label:`Gmail`,logoSrc:E(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:E(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:E(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:E(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:E(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:E(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:E(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:E(`/images/integrations/github.svg`),logoSrcDark:E(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:E(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:E(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:E(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:E(`/images/integrations/apple-notes.svg`)}];function Y(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function Re({selectedTools:e,onChange:t,onBack:n,onContinue:r,onSkip:i}){let a=m(),[o,u]=(0,U.useState)(()=>Be(e)),[d,f]=(0,U.useState)(()=>o.length>0),p=(0,U.useRef)(Ve(e));(0,U.useEffect)(()=>{let t=Ve(e);if(t===p.current)return;let n=Be(e);u(n),f(e=>e||n.length>0),p.current=t},[e]),(0,U.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of o.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}ze(n,e)||(p.current=Ve(n),t(n))},[o]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(0,U.useMemo)(()=>{let e=new Set;return o.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[o]),y=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${a?`px-8 pt-7 pb-4 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full items-center ${n?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[n?(0,W.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(L,{className:`h-4 w-4`})}):null,(0,W.jsx)(`h1`,{className:`text-center ${a?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),n?(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,W.jsx)(`p`,{className:`${a?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${a?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,W.jsxs)(`div`,{className:`grid w-full gap-2 ${a?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Le.map(t=>(0,W.jsx)(X,{tool:t,selected:e.has(t.id),onToggle:()=>h(t.id),electron:a},t.id)),d?null:(0,W.jsx)(He,{onClick:()=>f(!0),electron:a})]}),d?(0,W.jsx)(c,{padding:a?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,W.jsxs)(`div`,{className:`flex flex-col ${a?`gap-2`:`gap-3`}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(g,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(_,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,W.jsx)(l,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:o,onChange:e=>u(e.target.value),helperText:`Separate multiple tools with commas`,fullWidth:!0}),v.length>0?(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.map(e=>(0,W.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,W.jsxs)(`div`,{className:`${a?`mt-6`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:r,className:`${a?`h-9`:`h-11 text-base`}`,children:y}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,className:`${a?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function ze(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Be(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Ve(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function X({tool:e,selected:t,onToggle:n,electron:r}){return(0,W.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(Ue,{tool:e,size:32}),(0,W.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,W.jsx)(P,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function He({onClick:e,electron:t}){return(0,W.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,W.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,W.jsx)(A,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,W.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ue({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,W.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,W.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,W.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function We({selectedGroupId:e,onGroupChange:t,onBack:n,onContinue:r,onSkip:i,currentStep:a,totalSteps:o}){return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,W.jsx)(L,{}),onClick:n,"aria-label":`Back`}),(0,W.jsx)(`div`,{className:`flex justify-center`,children:(0,W.jsx)(H,{current:a,total:o})}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,W.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,W.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,W.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:K.map(n=>{let r=e===n.id;return(0,W.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,W.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,W.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:r,className:`h-11 text-base`,children:`Continue`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Skip`})]})]})})}function Ge(e){let[t,n]=(0,U.useState)(()=>(e??``).trim()),r=(0,U.useRef)(!1);return(0,U.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,U.useCallback)(e=>{r.current=!0,n(e)},[])}}var Ke=[`gmail`,`google-calendar`,`google-drive`],Z=`experiment-activation-flow-2026-06-03`,Q=`BOOTSTRAP-ACTIVATION-RAIL.md`;function $(e,t,n){return t?.initialMessage?t.initialMessage:n?D(e):N}function qe(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:t===`paredDown`?{tools:r?[...Ke]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:Y([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=Z,i.bootstrapTemplate=Q);let a=e.userName.trim();a&&(i.userName=a);let o=e.assistantName.trim();return o&&(i.assistantName=o),t===`paredDown`?r&&(i.googleScopes=e.connectedScopes):t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Y([...e.selectedPriorAssistants])),i.initialMessage=$(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function Je(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Ye(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:V.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:V.controlWorkType,enabled:!t},{id:`tools`,funnelStep:V.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:V.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?V.gmailConnect:V.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:V.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Xe(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Ze=`1`;function Qe(e){return e===`nativeVibe`||e===Ze?`nativeVibe`:null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function et(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}var tt=3;function nt(){let e=d();return e?.cloud===`vellum`?e.assistantId:f()[0]?.assistantId??null}function rt(){let e=n(),t=C.use.user(),r=S(),a=x(),o=t?.id??null,s=t?.firstName??``,c=t?.lastName??``,l=y(),d=p.use.activeAssistantId(),f=u(),m=ae()&&!oe(),h=I.use.stringFlags().preChatOnboardingExperiment20260606??`control`,g=(I.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,_=I.use.selfIntroGreeting(),w=me(h),E=ge()??w,D=E===he.paredDown,O=f?nt():null,k=o?`prechat_native_screen:${o}`:null,[A,j]=(0,U.useState)(()=>l?`nativeName`:`name`),ee=(0,U.useCallback)(e=>{if(k)try{e===null?sessionStorage.removeItem(k):sessionStorage.setItem(k,e)}catch{}},[k]);(0,U.useLayoutEffect)(()=>{if(k)try{let e=Qe(sessionStorage.getItem(k));e&&j(e)}catch{}},[k]),(0,U.useEffect)(()=>{l&&ee(A===`nativeVibe`?`nativeVibe`:null)},[l,A,ee]);let te=C.use.platformSession(),M=b(te),[N,ne]=(0,U.useState)(()=>new Set),[P,F]=(0,U.useState)(()=>new Set),[L,ie]=(0,U.useState)(()=>new Set),{value:R,onChange:ue}=Ge(f&&!M?``:s||c),[z,B]=(0,U.useState)(null),[V]=(0,U.useState)(()=>Te()),[H,_e]=(0,U.useState)(``),[ye,G]=(0,U.useState)(!1),[xe,K]=(0,U.useState)([]),{data:Ce}=i({...se(),enabled:!a&&r&&(!f||M)}),{data:we,isLoading:De}=i({queryKey:[`onboarding-recipe`,o],queryFn:ve,enabled:!a&&r&&!l&&!f,staleTime:1/0}),ke=we??null,je=Ce?.id??d??O,q=Je({localMode:f,platformSession:te,hasCachedPlatformAssistant:O!==null}),Me=q,Ne=q,Pe=(0,U.useCallback)(async()=>{await v.checkAssistant(),e(`${T.assistant}?onboarding=1`,{replace:!0})},[e]),[J,Le]=(0,U.useState)(()=>a||!r?{userId:o,decision:`pending`}:{userId:o,decision:de()&&le()?`ok`:`missing`}),Y=J.decision;(0,U.useEffect)(()=>{a||!r||J.userId===o&&J.decision!==`pending`||Le({userId:o,decision:de()&&le()?`ok`:`missing`})},[J,a,r,o]),(0,U.useEffect)(()=>{if(!a){if(!r){e(T.account.login,{replace:!0});return}if(Y===`missing`&&!l){e(T.onboarding.privacy,{replace:!0});return}}},[Y,a,r,l,e,Pe,o]);let ze=a||!r||!(l||Y===`ok`)||!!De;function Be(e,t=E){pe(e,{userId:o,variant:fe(t)})}let Ve=[...N].some(e=>Ie.has(e)),X=l?Xe():Ye({paredDown:D,canOfferPriorAssistants:Ne,canOfferGoogleStep:Me,hasGoogleTool:Ve,showIOSAppStep:m});async function He(e){ce(qe({mode:D?`paredDown`:`control`,recipe:ke,selectedTools:N,selectedTasks:P,selectedPriorAssistants:e?.selectedPriorAssistants??L,tone:z??ke?.tone??`grounded`,userName:R,assistantName:H,selfIntroGreetingEnabled:_,activationFlowEnabled:g,googleConnected:ye,googleScopes:xe,connectedScopes:e?.connectedScopes}));let t=H.trim();t&&re(t),v.markExpectingFirstMessage(),await Pe()}function Ue(){ce(qe({mode:`native`,recipe:null,selectedTools:N,selectedTasks:P,selectedPriorAssistants:L,tone:z??`grounded`,userName:R,assistantName:H,selfIntroGreetingEnabled:_,googleConnected:!1,googleScopes:[]}));let t=H.trim();t&&re(t),ee(null),e(T.onboarding.privacy)}let Ke=e=>{l?Ue():He(e)},Z=(e,t)=>{e.funnelStep&&Be(e.funnelStep);let n=$e(X,e.id);n?j(n):Ke(t)},Q=e=>{let t=et(X,e);t&&j(t)};if(ze)return null;let $=X.find(e=>e.id===A)??X[0];return $?$.id===`nativeName`?(0,W.jsx)(Oe,{userName:R,assistantName:H,displayedAssistantNames:V,onUserNameChange:ue,onAssistantNameChange:_e,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:tt}):$.id===`nativeVibe`?(0,W.jsx)(We,{selectedGroupId:z,onGroupChange:B,onBack:()=>Q($.id),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:tt}):$.id===`name`?(0,W.jsx)(Ee,{userName:R,assistantName:H,selectedGroupId:z,displayedAssistantNames:V,onUserNameChange:ue,onAssistantNameChange:_e,onGroupChange:B,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,W.jsx)(Fe,{selectedTasks:P,onChange:F,onBack:()=>Q($.id),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,W.jsx)(Re,{selectedTools:N,onChange:ne,onBack:()=>Q($.id),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,W.jsx)(Ae,{selectedAssistants:L,onChange:ie,onBack:()=>Q($.id),onContinue:()=>Z($),onSkip:()=>{let e=new Set;ie(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?je?(0,W.jsx)(Se,{assistantId:je,assistantName:H,onConnect:e=>{G(!0),K(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($.id)}):null:$.id===`iosApp`?(0,W.jsx)(be,{onComplete:()=>Z($)}):null:null}export{rt as PreChatFlow};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./button-DdEh-9f_.js";import{t as c}from"./card-CL5iEMJO.js";import{t as l}from"./input-Cu3PPVCq.js";import{f as u,l as d,s as f,t as p}from"./resolved-assistants-store-ub66utfl.js";import{t as m}from"./is-electron-CavSPgmY.js";import{t as h}from"./loader-circle-BSAFLoPH.js";import{t as g}from"./pencil-BA9LOIzP.js";import{t as _}from"./x-BDqbYVtS.js";import{B as v,O as y,V as b,a as x,i as S,n as C}from"./auth-store-CEYaVkBG.js";import{t as w}from"./client.gen-BKAMS0D0.js";import{i as T}from"./routes-Dk5Qeryt.js";import{t as E}from"./public-asset-Dx4la7Nv.js";import{$n as D,C as O,Dt as k,Ga as A,J as j,M as ee,N as te,P as M,Qn as N,Y as ne,_o as P,c as F,er as re,gr as I,ho as L,j as ie,l as ae,o as R,s as oe,st as se,tr as ce,vr as le,w as ue,wt as z,xr as de}from"./index-BoHdS0dH.js";import{t as B}from"./onboarding-layout-BIVa2BnX.js";import{c as fe,i as pe,n as V,o as me,r as he,s as ge,t as H}from"./step-indicator-dots-Cz4FzNR8.js";import{t as _e}from"./use-oauth-complete-deep-link-listener-DL4gXjh5.js";var U=e(t(),1);async function ve(){try{let{data:e,response:t}=await w.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var W=o(),ye=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function be({onComplete:e}){function t(){F(),R(),e()}return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,W.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,W.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,W.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,W.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,W.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,W.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,W.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,W.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,W.jsx)(`ul`,{className:`space-y-4`,children:ye.map((e,t)=>(0,W.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,W.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,W.jsx)(P,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,W.jsxs)(`span`,{className:`text-left`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,W.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var G=`google`,xe=[{id:`gmail`,label:`Gmail`,logoSrc:E(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:E(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:E(`/images/integrations/google-drive.svg`)}];function Se({assistantId:e,assistantName:t,onConnect:n,onSkip:i,onBack:o}){let c=m(),l=r(),u=y(),d=(0,U.useRef)(null),f=(0,U.useRef)(null),p=(0,U.useRef)(null),g=(0,U.useRef)(null),_=(0,U.useRef)(null),v=(0,U.useRef)(null),b=(0,U.useRef)(null),[x,S]=(0,U.useState)(!1),C=(0,U.useCallback)(()=>{f.current=null,S(!1)},[]),w=(0,U.useCallback)(()=>{_.current&&=(window.removeEventListener(`message`,_.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),E=(0,U.useCallback)(()=>{d.current&&!d.current.closed&&d.current.close(),d.current=null,p.current&&=(clearInterval(p.current),null),g.current&&=(clearTimeout(g.current),null)},[]),D=a({...k()});(0,U.useEffect)(()=>()=>{p.current&&clearInterval(p.current),g.current&&clearTimeout(g.current),d.current&&!d.current.closed&&d.current.close(),_.current&&window.removeEventListener(`message`,_.current),v.current&&window.removeEventListener(`storage`,v.current),b.current&&=(b.current(),null)},[]);let O=(0,U.useCallback)(async()=>{try{return(await l.fetchQuery({...z({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===G&&e.connected)??null}catch{return null}},[e,l]),A=(0,U.useCallback)(async()=>{E(),C(),n((await O())?.scopes_granted??[])},[C,E,O,n]),N=(0,U.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!f.current||e.requestId!==f.current.requestId||(e.oauthStatus===`connected`?A():(E(),C())))},[C,E,A]),P=(0,U.useCallback)(e=>{let t=f.current;if(!t)return;let n=ie(e,window.location.origin,t.requestId);n&&N(n)},[N]),F=(0,U.useCallback)(e=>{let t=f.current;if(!t)return;let n=ee(e,t.requestId);n&&(N(n),window.localStorage.removeItem(M(t.requestId)))},[N]);_e((0,U.useCallback)(e=>{let t=f.current;t&&e.requestId===t.requestId&&N({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[N]));let re=(0,U.useCallback)(()=>{let t=crypto.randomUUID();if(w(),_.current=P,v.current=F,u){S(!0),f.current={requestId:t},D.mutate({path:{assistant_id:e,provider:G},body:{requested_scopes:[],redirect_after_connect:`${T.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){j(e.connect_url)},onError(){C()}}),window.addEventListener(`message`,P),window.addEventListener(`storage`,F),b.current&&b.current();let n=ne(()=>{if(!f.current){n(),b.current=null;return}(async()=>{let e=await O();f.current&&(e?await A():C(),w(),n(),b.current=null)})()});b.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){w();return}d.current=n,S(!0),f.current={requestId:t},window.addEventListener(`message`,P),window.addEventListener(`storage`,F),p.current=setInterval(()=>{d.current&&d.current.closed&&f.current&&!g.current&&(g.current=setTimeout(async()=>{g.current=null;let e=f.current;if(!e)return;let t=window.localStorage.getItem(M(e.requestId));if(t)try{let n=JSON.parse(t);if(te(n,e.requestId)){N(n),window.localStorage.removeItem(M(e.requestId)),w();return}}catch{}let n=await O();f.current&&(n?await A():(E(),C()),w())},1e3))},100),D.mutate({path:{assistant_id:e,provider:G},body:{requested_scopes:[],redirect_after_connect:`${T.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){d.current&&!d.current.closed?d.current.location.href=e.connect_url:f.current&&(E(),C(),w())},onError(){E(),C(),w()}})},[e,C,E,O,N,P,F,A,u,w,D]),I=t||`your assistant`,ae=t||`Your assistant`;return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${c?`px-8 pt-7 pb-4 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(L,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${c?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${I} can use Gmail, Calendar, and Drive with your permission.`}),(0,W.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:xe.map(e=>(0,W.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,W.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,W.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${ae} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,W.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:re,disabled:x||D.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:x||D.isPending?(0,W.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,W.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,disabled:x||D.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}var K=[{id:`grounded`,label:`Grounded`,descriptor:`Calm and precise`,tagline:`Measured. No filler.`,names:[`Penn`,`Sage`,`Atlas`,`Orion`,`Reed`,`Quill`]},{id:`warm`,label:`Warm`,descriptor:`Warm and easy`,tagline:`Friendly and casual.`,names:[`Kit`,`Remy`,`Wren`,`Milo`,`Fenn`,`Cleo`]},{id:`energetic`,label:`Energetic`,descriptor:`Fast and direct`,tagline:`Brief. To the point.`,names:[`Nova`,`Ember`,`Cade`,`Lark`,`Vela`,`Ziggy`]},{id:`poetic`,label:`Poetic`,descriptor:`Quiet and observant`,tagline:`Listens, then replies.`,names:[`Luna`,`Iris`,`Vesper`,`Lyra`,`Juno`,`Ada`]}],Ce=6;function we(){return K.flatMap(e=>e.names)}function Te(){let e=we(),t=Math.min(Ce,e.length);for(let n=0;n<t;n+=1){let t=n+Math.floor(Math.random()*(e.length-n)),r=e[n];e[n]=e[t],e[t]=r}return e.slice(0,t)}function Ee({userName:e,assistantName:t,selectedGroupId:n,displayedAssistantNames:r,onUserNameChange:i,onAssistantNameChange:a,onGroupChange:o,onBack:c,onComplete:u,onSkip:d}){let f=m();return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`px-8 pt-11 pb-4 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,W.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(L,{className:`h-4 w-4`})}):null,(0,W.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,W.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,W.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),fullWidth:!0}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),fullWidth:!0}),(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let n=e===t;return(0,W.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,W.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:K.map(e=>(0,W.jsx)(De,{group:e,isActive:n===e.id,onToggle:()=>o(n===e.id?null:e.id)},e.id))})]})]}),(0,W.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:d,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function De({group:e,isActive:t,onToggle:n}){return(0,W.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,W.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function Oe({userName:e,assistantName:t,displayedAssistantNames:n,onUserNameChange:r,onAssistantNameChange:i,onBack:a,onContinue:o,onSkip:c,currentStep:u,totalSteps:d}){return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[a?(0,W.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,W.jsx)(L,{}),onClick:a,"aria-label":`Back`}):(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,W.jsx)(`div`,{className:`flex justify-center`,children:(0,W.jsx)(H,{current:u,total:d})}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,W.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,W.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,W.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>r(e.target.value),fullWidth:!0}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>i(e.target.value),fullWidth:!0}),(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let n=e===t;return(0,W.jsx)(`button`,{type:`button`,onClick:()=>i(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:o,className:`h-11 text-base`,children:`Continue`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var ke=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:E(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:E(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:E(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:E(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:E(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:E(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:E(`/images/prior-assistants/copilot.svg`)}];function Ae({selectedAssistants:e,onChange:t,onBack:n,onContinue:r,onSkip:i}){let a=m(),[o,u]=(0,U.useState)(()=>q(e)),[d,f]=(0,U.useState)(()=>o.length>0),p=(0,U.useRef)(Me(e));(0,U.useEffect)(()=>{let t=Me(e);if(t===p.current)return;let n=q(e);u(n),f(e=>e||n.length>0),p.current=t},[e]),(0,U.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of o.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}je(n,e)||(p.current=Me(n),t(n))},[o]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(0,U.useMemo)(()=>{let e=new Set;return o.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[o]),y=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${a?`px-8 pt-7 pb-4 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(L,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${a?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsx)(`p`,{className:`${a?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${a?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,W.jsxs)(`div`,{className:`${a?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[ke.map(t=>(0,W.jsx)(Ne,{assistant:t,selected:e.has(t.id),onToggle:()=>h(t.id)},t.id)),d?null:(0,W.jsx)(Pe,{onClick:()=>f(!0)})]}),d?(0,W.jsx)(c,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(g,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(_,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,W.jsx)(l,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:o,onChange:e=>u(e.target.value),helperText:`Separate multiple assistants with commas`,fullWidth:!0}),v.length>0?(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.map(e=>(0,W.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,W.jsxs)(`div`,{className:`${a?`mt-6`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:r,className:`${a?`h-9`:`h-11 text-base`}`,children:y}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,className:`${a?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function je(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function q(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Me(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Ne({assistant:e,selected:t,onToggle:n}){return(0,W.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(J,{assistant:e,size:32}),(0,W.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,W.jsx)(P,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Pe({onClick:e}){return(0,W.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,W.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,W.jsx)(A,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,W.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function J({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,W.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,W.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,W.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Fe({selectedTasks:e,onChange:t,onBack:n,onContinue:r,onSkip:i}){let a=m(),o=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${a?`px-8 pt-7 pb-4 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(L,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${a?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsx)(`p`,{className:`${a?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${a?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,W.jsx)(`div`,{className:`${a?`mt-6`:`mt-8`} flex w-full flex-col ${a?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:O.map(t=>{let n=ue[t.iconKey],r=e.has(t.id);return(0,W.jsxs)(`button`,{type:`button`,onClick:()=>o(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${a?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,W.jsx)(n,{className:`h-4 w-4`}):null}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,W.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,W.jsx)(P,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,W.jsxs)(`div`,{className:`${a?`mt-6`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:r,className:`${a?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,className:`${a?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Ie=new Set([`gmail`,`google-calendar`,`google-drive`]),Le=[{id:`gmail`,label:`Gmail`,logoSrc:E(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:E(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:E(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:E(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:E(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:E(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:E(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:E(`/images/integrations/github.svg`),logoSrcDark:E(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:E(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:E(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:E(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:E(`/images/integrations/apple-notes.svg`)}];function Y(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function Re({selectedTools:e,onChange:t,onBack:n,onContinue:r,onSkip:i}){let a=m(),[o,u]=(0,U.useState)(()=>Be(e)),[d,f]=(0,U.useState)(()=>o.length>0),p=(0,U.useRef)(Ve(e));(0,U.useEffect)(()=>{let t=Ve(e);if(t===p.current)return;let n=Be(e);u(n),f(e=>e||n.length>0),p.current=t},[e]),(0,U.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of o.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}ze(n,e)||(p.current=Ve(n),t(n))},[o]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(0,U.useMemo)(()=>{let e=new Set;return o.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[o]),y=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${a?`px-8 pt-7 pb-4 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full items-center ${n?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[n?(0,W.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(L,{className:`h-4 w-4`})}):null,(0,W.jsx)(`h1`,{className:`text-center ${a?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),n?(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,W.jsx)(`p`,{className:`${a?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${a?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,W.jsxs)(`div`,{className:`grid w-full gap-2 ${a?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Le.map(t=>(0,W.jsx)(X,{tool:t,selected:e.has(t.id),onToggle:()=>h(t.id),electron:a},t.id)),d?null:(0,W.jsx)(He,{onClick:()=>f(!0),electron:a})]}),d?(0,W.jsx)(c,{padding:a?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,W.jsxs)(`div`,{className:`flex flex-col ${a?`gap-2`:`gap-3`}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(g,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(_,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,W.jsx)(l,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:o,onChange:e=>u(e.target.value),helperText:`Separate multiple tools with commas`,fullWidth:!0}),v.length>0?(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.map(e=>(0,W.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,W.jsxs)(`div`,{className:`${a?`mt-6`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:r,className:`${a?`h-9`:`h-11 text-base`}`,children:y}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,className:`${a?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function ze(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Be(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Ve(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function X({tool:e,selected:t,onToggle:n,electron:r}){return(0,W.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(Ue,{tool:e,size:32}),(0,W.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,W.jsx)(P,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function He({onClick:e,electron:t}){return(0,W.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,W.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,W.jsx)(A,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,W.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ue({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,W.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,W.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,W.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function We({selectedGroupId:e,onGroupChange:t,onBack:n,onContinue:r,onSkip:i,currentStep:a,totalSteps:o}){return(0,W.jsx)(B,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,W.jsx)(L,{}),onClick:n,"aria-label":`Back`}),(0,W.jsx)(`div`,{className:`flex justify-center`,children:(0,W.jsx)(H,{current:a,total:o})}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,W.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,W.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,W.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:K.map(n=>{let r=e===n.id;return(0,W.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,W.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,W.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:r,className:`h-11 text-base`,children:`Continue`}),(0,W.jsx)(s,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Skip`})]})]})})}function Ge(e){let[t,n]=(0,U.useState)(()=>(e??``).trim()),r=(0,U.useRef)(!1);return(0,U.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,U.useCallback)(e=>{r.current=!0,n(e)},[])}}var Ke=[`gmail`,`google-calendar`,`google-drive`],Z=`experiment-activation-flow-2026-06-03`,Q=`BOOTSTRAP-ACTIVATION-RAIL.md`;function $(e,t,n){return t?.initialMessage?t.initialMessage:n?D(e):N}function qe(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:t===`paredDown`?{tools:r?[...Ke]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:Y([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=Z,i.bootstrapTemplate=Q);let a=e.userName.trim();a&&(i.userName=a);let o=e.assistantName.trim();return o&&(i.assistantName=o),t===`paredDown`?r&&(i.googleScopes=e.connectedScopes):t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Y([...e.selectedPriorAssistants])),i.initialMessage=$(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function Je(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Ye(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:V.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:V.controlWorkType,enabled:!t},{id:`tools`,funnelStep:V.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:V.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?V.gmailConnect:V.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:V.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Xe(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Ze=`1`;function Qe(e){return e===`nativeVibe`||e===Ze?`nativeVibe`:null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function et(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}var tt=3;function nt(){let e=d();return e?.cloud===`vellum`?e.assistantId:f()[0]?.assistantId??null}function rt(){let e=n(),t=C.use.user(),r=S(),a=x(),o=t?.id??null,s=t?.firstName??``,c=t?.lastName??``,l=y(),d=p.use.activeAssistantId(),f=u(),m=ae()&&!oe(),h=I.use.stringFlags().preChatOnboardingExperiment20260606??`control`,g=(I.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,_=I.use.selfIntroGreeting(),w=me(h),E=ge()??w,D=E===he.paredDown,O=f?nt():null,k=o?`prechat_native_screen:${o}`:null,[A,j]=(0,U.useState)(()=>l?`nativeName`:`name`),ee=(0,U.useCallback)(e=>{if(k)try{e===null?sessionStorage.removeItem(k):sessionStorage.setItem(k,e)}catch{}},[k]);(0,U.useLayoutEffect)(()=>{if(k)try{let e=Qe(sessionStorage.getItem(k));e&&j(e)}catch{}},[k]),(0,U.useEffect)(()=>{l&&ee(A===`nativeVibe`?`nativeVibe`:null)},[l,A,ee]);let te=C.use.platformSession(),M=b(te),[N,ne]=(0,U.useState)(()=>new Set),[P,F]=(0,U.useState)(()=>new Set),[L,ie]=(0,U.useState)(()=>new Set),{value:R,onChange:ue}=Ge(f&&!M?``:s||c),[z,B]=(0,U.useState)(null),[V]=(0,U.useState)(()=>Te()),[H,_e]=(0,U.useState)(``),[ye,G]=(0,U.useState)(!1),[xe,K]=(0,U.useState)([]),{data:Ce}=i({...se(),enabled:!a&&r&&(!f||M)}),{data:we,isLoading:De}=i({queryKey:[`onboarding-recipe`,o],queryFn:ve,enabled:!a&&r&&!l&&!f,staleTime:1/0}),ke=we??null,je=Ce?.id??d??O,q=Je({localMode:f,platformSession:te,hasCachedPlatformAssistant:O!==null}),Me=q,Ne=q,Pe=(0,U.useCallback)(async()=>{await v.checkAssistant(),e(`${T.assistant}?onboarding=1`,{replace:!0})},[e]),[J,Le]=(0,U.useState)(()=>a||!r?{userId:o,decision:`pending`}:{userId:o,decision:de()&&le()?`ok`:`missing`}),Y=J.decision;(0,U.useEffect)(()=>{a||!r||J.userId===o&&J.decision!==`pending`||Le({userId:o,decision:de()&&le()?`ok`:`missing`})},[J,a,r,o]),(0,U.useEffect)(()=>{if(!a){if(!r){e(T.account.login,{replace:!0});return}if(Y===`missing`&&!l){e(T.onboarding.privacy,{replace:!0});return}}},[Y,a,r,l,e,Pe,o]);let ze=a||!r||!(l||Y===`ok`)||!!De;function Be(e,t=E){pe(e,{userId:o,variant:fe(t)})}let Ve=[...N].some(e=>Ie.has(e)),X=l?Xe():Ye({paredDown:D,canOfferPriorAssistants:Ne,canOfferGoogleStep:Me,hasGoogleTool:Ve,showIOSAppStep:m});async function He(e){ce(qe({mode:D?`paredDown`:`control`,recipe:ke,selectedTools:N,selectedTasks:P,selectedPriorAssistants:e?.selectedPriorAssistants??L,tone:z??ke?.tone??`grounded`,userName:R,assistantName:H,selfIntroGreetingEnabled:_,activationFlowEnabled:g,googleConnected:ye,googleScopes:xe,connectedScopes:e?.connectedScopes}));let t=H.trim();t&&re(t),v.markExpectingFirstMessage(),await Pe()}function Ue(){ce(qe({mode:`native`,recipe:null,selectedTools:N,selectedTasks:P,selectedPriorAssistants:L,tone:z??`grounded`,userName:R,assistantName:H,selfIntroGreetingEnabled:_,googleConnected:!1,googleScopes:[]}));let t=H.trim();t&&re(t),ee(null),e(T.onboarding.privacy)}let Ke=e=>{l?Ue():He(e)},Z=(e,t)=>{e.funnelStep&&Be(e.funnelStep);let n=$e(X,e.id);n?j(n):Ke(t)},Q=e=>{let t=et(X,e);t&&j(t)};if(ze)return null;let $=X.find(e=>e.id===A)??X[0];return $?$.id===`nativeName`?(0,W.jsx)(Oe,{userName:R,assistantName:H,displayedAssistantNames:V,onUserNameChange:ue,onAssistantNameChange:_e,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:tt}):$.id===`nativeVibe`?(0,W.jsx)(We,{selectedGroupId:z,onGroupChange:B,onBack:()=>Q($.id),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:tt}):$.id===`name`?(0,W.jsx)(Ee,{userName:R,assistantName:H,selectedGroupId:z,displayedAssistantNames:V,onUserNameChange:ue,onAssistantNameChange:_e,onGroupChange:B,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,W.jsx)(Fe,{selectedTasks:P,onChange:F,onBack:()=>Q($.id),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,W.jsx)(Re,{selectedTools:N,onChange:ne,onBack:()=>Q($.id),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,W.jsx)(Ae,{selectedAssistants:L,onChange:ie,onBack:()=>Q($.id),onContinue:()=>Z($),onSkip:()=>{let e=new Set;ie(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?je?(0,W.jsx)(Se,{assistantId:je,assistantName:H,onConnect:e=>{G(!0),K(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($.id)}):null:$.id===`iosApp`?(0,W.jsx)(be,{onComplete:()=>Z($)}):null:null}export{rt as PreChatFlow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{n as t,o as n,r}from"./device-settings-C07QvMzm.js";import{t as i}from"./react-DJZBPgpf.js";import{T as a}from"./portal-container-DIXEBWUe.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./useQuery-B45lW1Kk.js";import{t as c}from"./useMutation-Lj4VunQV.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./button-DdEh-9f_.js";import{t as d}from"./card-CL5iEMJO.js";import{t as f}from"./dropdown-CocFV5yi.js";import{t as p}from"./confirm-dialog-NYG-K9zN.js";import{t as m}from"./notice-CF2pptne.js";import{t as h}from"./tag-Ccr7Quy6.js";import{t as g}from"./input-Cu3PPVCq.js";import{t as _}from"./toggle-CEm3M86o.js";import{n as v}from"./toast-DU1nH33j.js";import{t as y}from"./chevron-right-zTNPbA1m.js";import{t as b}from"./loader-circle-BSAFLoPH.js";import{t as x}from"./pencil-BA9LOIzP.js";import{t as S}from"./x-BDqbYVtS.js";import{C,O as w,S as T,b as E,d as D,r as O,v as k,w as A,x as j,y as M}from"./auth-store-jNrWpxgy.js";import{t as ee}from"./sdk.gen-BO4vbMAj.js";import{Ii as N,Ji as P,S as F,at as I,b as L,d as R,f as te,go as ne,it as z,nt as re,ot as ie,p as ae,rt as oe,u as B,x as V}from"./index-CEdoUEuP.js";import{t as H}from"./use-active-assistant-id-BIhArlF_.js";import{t as U}from"./detail-card-B5j4Rqau.js";var W=e(i(),1),G=l();function K(){let e=z({platformHostedOnly:!0}),t=re(),n=oe(),r=o(),{data:i,isLoading:a,isError:l}=s({...I(),enabled:e===`full`&&t}),u=c({mutationFn:async e=>{let{data:t}=await ee({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{r.setQueryData(ie(),e),v.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{v.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let d=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||l||u.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow admin access to assistant data`}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`Lets Vellum administrators reach privileged data on your assistant pod for debugging — today this means tailing the daily assistant log at`,` `,(0,G.jsx)(`code`,{className:`rounded bg-[var(--surface-base)] px-1.5 font-mono text-[var(--content-secondary)] dark:bg-[var(--surface-lift)] dark:text-[var(--content-default)]`,children:`/workspace/data/logs/assistant-YYYY-MM-DD.log`}),`. Off by default. Turn on temporarily when asking support to investigate an issue, then turn off when you're done.`]}),e===`full`&&l&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,G.jsxs)(G.Fragment,{children:[(u.isPending||d)&&(0,G.jsx)(b,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,G.jsx)(_,{checked:f,disabled:p,onChange:()=>u.mutate(!f)})]})})]}),e===`disabled`&&(0,G.jsx)(m,{tone:`info`,className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function se(){let e=w(),[t,n]=(0,W.useState)(()=>j()),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(`Face ID`),[s,c]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{e&&(E().then(i),M().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)T(!1),await k(),n(!1);else{let e=A();e&&await C(e),T(!0),n(!0)}}finally{c(!1)}};return(0,G.jsx)(U,{title:`Security`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,G.jsx)(_,{checked:t,onChange:()=>void l(),disabled:s})]})})}function q(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var J=B.map(e=>({value:e.id,label:e.label,icon:(0,G.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function ce(){let e=H(),t=o(),{data:n,isError:r}=s({queryKey:[`thresholds`,e],queryFn:()=>te(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[c,l]=(0,W.useState)(`conservative`),[u,p]=(0,W.useState)(`strict`),[m,h]=(0,W.useState)(!1),g=(0,W.useRef)(!1),[_,v]=(0,W.useState)(!1),b=(0,W.useRef)(null),x=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||g.current||(a(R(n.interactive).id),l(R(n.autonomous).id),p(R(n.headless).id),v(!0))},[n]),(0,W.useEffect)(()=>()=>{b.current!==null&&(clearTimeout(b.current),b.current=null,x.current?.(),x.current=null)},[]);let S=(0,W.useCallback)((n,r,i)=>{if(!e||!_)return;let a=B.find(e=>e.id===n)?.riskThreshold,o=B.find(e=>e.id===r)?.riskThreshold,s=B.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||ae(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,_,t]),C=(0,W.useCallback)((e,t,n)=>{b.current!==null&&clearTimeout(b.current),x.current=()=>S(e,t,n),b.current=setTimeout(()=>{x.current?.(),b.current=null,x.current=null},500)},[S]),w=(0,W.useCallback)(e=>{g.current=!0,a(e),C(e,c,u)},[c,u,C]),T=(0,W.useCallback)(e=>{g.current=!0,l(e),C(i,e,u)},[i,u,C]),E=(0,W.useCallback)(e=>{g.current=!0,p(e),C(i,c,e)},[i,c,C]),D=B.find(e=>e.id===i),O=B.find(e=>e.id===c),k=B.find(e=>e.id===u),A=!e||!_;return(0,G.jsxs)(d,{children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Risk Tolerance`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your tolerance determines which levels auto-approve.`}),r&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(f,{value:i,onChange:w,options:J,disabled:A})}),D&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]}),(0,G.jsx)(q,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":m,children:[m?(0,G.jsx)(ne,{className:`h-4 w-4`}):(0,G.jsx)(y,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,G.jsxs)(`div`,{className:m?`mt-4 space-y-4`:`hidden`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(f,{value:c,onChange:T,options:J,disabled:A})}),O&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,G.jsx)(q,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(f,{value:u,onChange:E,options:J,disabled:A})}),k&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]})]})]})]})]})}var Y=e(a(),1),le=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],ue=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function de({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(t.tool),[s,c]=(0,W.useState)(t.pattern),[l,u]=(0,W.useState)(t.risk),[d,p]=(0,W.useState)(t.description??``),[h,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(null),b=s.trim(),x=b.length>0&&!h,C=(0,W.useCallback)(async n=>{if(n.preventDefault(),!x)return;let i=d.trim()||`${a} — ${b}`;_(!0),y(null);try{await F(e,t.id,{risk:l,description:i}),r()}catch(e){y(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{_(!1)}},[e,x,d,t,r,l,a,b]);return(0,Y.createPortal)((0,G.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,W.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(S,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:e=>void C(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[v&&(0,G.jsx)(m,{tone:`error`,children:v}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(f,{value:a,onChange:o,disabled:!0,options:le.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(g,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,G.jsx)(`div`,{className:`mt-2 flex gap-2`,children:ue.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,G.jsx)(g,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>p(e.target.value),placeholder:`${a} — ${b||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!x,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:h?`Saving…`:`Save`})]})]})]})}),document.body)}function fe(e){return e.origin===`default`&&!e.userModified}function pe(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function me(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function X(e){return e.charAt(0).toUpperCase()+e.slice(1)}function he({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,c]=(0,W.useState)(null),[l,d]=(0,W.useState)(null),[f,g]=(0,W.useState)(null),[v,y]=(0,W.useState)(!1),b=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([V(e),V(e,{origin:`default`})]);return pe(t,n)}return V(e)},[e]),S=(0,W.useCallback)(async()=>{o(!0);try{i(await b(v)),c(null)}catch(e){c(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[b,v]);(0,W.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await b(v);e||(i(t),c(null))}catch(t){e||c(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[b,v]);let C=(0,W.useCallback)(async()=>{if(f)try{await L(e,f.id),S()}catch(e){c(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{g(null)}},[e,f,S]);return(0,Y.createPortal)((0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,W.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(_,{checked:v,onChange:y,label:`Show all defaults`}),(0,G.jsx)(u,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(m,{tone:`error`,children:s})}),a?(0,G.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,G.jsx)(P,{className:`h-8 w-8`}),(0,G.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,G.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=fe(e);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,G.jsx)(h,{tone:me(e.risk),children:X(e.risk)}),e.origin===`default`&&(0,G.jsx)(h,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(h,{tone:`warning`,children:`Modified`})]}),(0,G.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(x,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>g(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(N,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),l&&(0,G.jsx)(de,{assistantId:e,existingRule:l,onClose:()=>d(null),onSaved:()=>{d(null),S()}}),(0,G.jsx)(p,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${X(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void C(),onCancel:()=>g(null)})]}),document.body)}function Z(){let e=H(),[t,n]=(0,W.useState)(!1);return(0,G.jsxs)(d,{children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(P,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,G.jsx)(u,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,G.jsx)(he,{assistantId:e,onClose:()=>n(!1)})]})}var ge=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],_e=`thirtyDays`;function Q({label:e,helperText:t,checked:n,onChange:r}){return(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e}),(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,G.jsx)(_,{checked:n,onChange:r,label:e})]})}function $(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function ve(){let e=z({platformHostedOnly:!0}),i=O(),[a,o]=(0,W.useState)(()=>t(`shareAnalytics`,!0)),[s,c]=(0,W.useState)(()=>t(`shareDiagnostics`,!0)),[l,u]=(0,W.useState)(()=>r(`llmLogRetention`,_e));return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(se,{}),(0,G.jsx)(Z,{}),(0,G.jsx)(ce,{}),(0,G.jsx)(U,{title:`Privacy`,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(Q,{label:`Share Analytics`,helperText:`Send anonymous product usage data. Your conversations and personal data are never included.`,checked:a,onChange:()=>{let e=!a;o(e),D(`share_analytics`,e,i)}}),(0,G.jsx)($,{}),(0,G.jsx)(Q,{label:`Share Diagnostics`,helperText:`Send crash reports and performance metrics. Your conversations and personal data are never included.`,checked:s,onChange:()=>{let e=!s;c(e),D(`share_diagnostics`,e,i)}}),(0,G.jsx)($,{}),(0,G.jsx)(K,{}),e!==`gated`&&(0,G.jsx)($,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(f,{value:l,onChange:e=>{u(e),n(`llmLogRetention`,e)},options:ge})}),(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{ve as PrivacyPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{n as t,o as n,r}from"./device-settings-C07QvMzm.js";import{t as i}from"./react-DJZBPgpf.js";import{T as a}from"./portal-container-DIXEBWUe.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./useQuery-B45lW1Kk.js";import{t as c}from"./useMutation-Lj4VunQV.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./button-DdEh-9f_.js";import{t as d}from"./card-CL5iEMJO.js";import{t as f}from"./dropdown-CocFV5yi.js";import{t as p}from"./confirm-dialog-NYG-K9zN.js";import{t as m}from"./notice-CF2pptne.js";import{t as h}from"./tag-Ccr7Quy6.js";import{t as g}from"./input-Cu3PPVCq.js";import{t as _}from"./toggle-CEm3M86o.js";import{n as v}from"./toast-DU1nH33j.js";import{t as y}from"./chevron-right-zTNPbA1m.js";import{t as b}from"./loader-circle-BSAFLoPH.js";import{t as x}from"./pencil-BA9LOIzP.js";import{t as S}from"./x-BDqbYVtS.js";import{C,O as w,S as T,b as E,d as D,r as O,v as k,w as A,x as j,y as M}from"./auth-store-CEYaVkBG.js";import{t as ee}from"./sdk.gen-BO4vbMAj.js";import{Ii as N,Ji as P,S as F,at as I,b as L,d as R,f as te,go as ne,it as z,nt as re,ot as ie,p as ae,rt as oe,u as B,x as V}from"./index-BoHdS0dH.js";import{t as H}from"./use-active-assistant-id-BIhArlF_.js";import{t as U}from"./detail-card-B5j4Rqau.js";var W=e(i(),1),G=l();function K(){let e=z({platformHostedOnly:!0}),t=re(),n=oe(),r=o(),{data:i,isLoading:a,isError:l}=s({...I(),enabled:e===`full`&&t}),u=c({mutationFn:async e=>{let{data:t}=await ee({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{r.setQueryData(ie(),e),v.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{v.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let d=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||l||u.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow admin access to assistant data`}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`Lets Vellum administrators reach privileged data on your assistant pod for debugging — today this means tailing the daily assistant log at`,` `,(0,G.jsx)(`code`,{className:`rounded bg-[var(--surface-base)] px-1.5 font-mono text-[var(--content-secondary)] dark:bg-[var(--surface-lift)] dark:text-[var(--content-default)]`,children:`/workspace/data/logs/assistant-YYYY-MM-DD.log`}),`. Off by default. Turn on temporarily when asking support to investigate an issue, then turn off when you're done.`]}),e===`full`&&l&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,G.jsxs)(G.Fragment,{children:[(u.isPending||d)&&(0,G.jsx)(b,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,G.jsx)(_,{checked:f,disabled:p,onChange:()=>u.mutate(!f)})]})})]}),e===`disabled`&&(0,G.jsx)(m,{tone:`info`,className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function se(){let e=w(),[t,n]=(0,W.useState)(()=>j()),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(`Face ID`),[s,c]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{e&&(E().then(i),M().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)T(!1),await k(),n(!1);else{let e=A();e&&await C(e),T(!0),n(!0)}}finally{c(!1)}};return(0,G.jsx)(U,{title:`Security`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,G.jsx)(_,{checked:t,onChange:()=>void l(),disabled:s})]})})}function q(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var J=B.map(e=>({value:e.id,label:e.label,icon:(0,G.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function ce(){let e=H(),t=o(),{data:n,isError:r}=s({queryKey:[`thresholds`,e],queryFn:()=>te(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[c,l]=(0,W.useState)(`conservative`),[u,p]=(0,W.useState)(`strict`),[m,h]=(0,W.useState)(!1),g=(0,W.useRef)(!1),[_,v]=(0,W.useState)(!1),b=(0,W.useRef)(null),x=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||g.current||(a(R(n.interactive).id),l(R(n.autonomous).id),p(R(n.headless).id),v(!0))},[n]),(0,W.useEffect)(()=>()=>{b.current!==null&&(clearTimeout(b.current),b.current=null,x.current?.(),x.current=null)},[]);let S=(0,W.useCallback)((n,r,i)=>{if(!e||!_)return;let a=B.find(e=>e.id===n)?.riskThreshold,o=B.find(e=>e.id===r)?.riskThreshold,s=B.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||ae(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,_,t]),C=(0,W.useCallback)((e,t,n)=>{b.current!==null&&clearTimeout(b.current),x.current=()=>S(e,t,n),b.current=setTimeout(()=>{x.current?.(),b.current=null,x.current=null},500)},[S]),w=(0,W.useCallback)(e=>{g.current=!0,a(e),C(e,c,u)},[c,u,C]),T=(0,W.useCallback)(e=>{g.current=!0,l(e),C(i,e,u)},[i,u,C]),E=(0,W.useCallback)(e=>{g.current=!0,p(e),C(i,c,e)},[i,c,C]),D=B.find(e=>e.id===i),O=B.find(e=>e.id===c),k=B.find(e=>e.id===u),A=!e||!_;return(0,G.jsxs)(d,{children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Risk Tolerance`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your tolerance determines which levels auto-approve.`}),r&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(f,{value:i,onChange:w,options:J,disabled:A})}),D&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]}),(0,G.jsx)(q,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":m,children:[m?(0,G.jsx)(ne,{className:`h-4 w-4`}):(0,G.jsx)(y,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,G.jsxs)(`div`,{className:m?`mt-4 space-y-4`:`hidden`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(f,{value:c,onChange:T,options:J,disabled:A})}),O&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,G.jsx)(q,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(f,{value:u,onChange:E,options:J,disabled:A})}),k&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]})]})]})]})]})}var Y=e(a(),1),le=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],ue=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function de({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(t.tool),[s,c]=(0,W.useState)(t.pattern),[l,u]=(0,W.useState)(t.risk),[d,p]=(0,W.useState)(t.description??``),[h,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(null),b=s.trim(),x=b.length>0&&!h,C=(0,W.useCallback)(async n=>{if(n.preventDefault(),!x)return;let i=d.trim()||`${a} — ${b}`;_(!0),y(null);try{await F(e,t.id,{risk:l,description:i}),r()}catch(e){y(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{_(!1)}},[e,x,d,t,r,l,a,b]);return(0,Y.createPortal)((0,G.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,W.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(S,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:e=>void C(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[v&&(0,G.jsx)(m,{tone:`error`,children:v}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(f,{value:a,onChange:o,disabled:!0,options:le.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(g,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,G.jsx)(`div`,{className:`mt-2 flex gap-2`,children:ue.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,G.jsx)(g,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>p(e.target.value),placeholder:`${a} — ${b||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!x,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:h?`Saving…`:`Save`})]})]})]})}),document.body)}function fe(e){return e.origin===`default`&&!e.userModified}function pe(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function me(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function X(e){return e.charAt(0).toUpperCase()+e.slice(1)}function he({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,c]=(0,W.useState)(null),[l,d]=(0,W.useState)(null),[f,g]=(0,W.useState)(null),[v,y]=(0,W.useState)(!1),b=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([V(e),V(e,{origin:`default`})]);return pe(t,n)}return V(e)},[e]),S=(0,W.useCallback)(async()=>{o(!0);try{i(await b(v)),c(null)}catch(e){c(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[b,v]);(0,W.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await b(v);e||(i(t),c(null))}catch(t){e||c(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[b,v]);let C=(0,W.useCallback)(async()=>{if(f)try{await L(e,f.id),S()}catch(e){c(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{g(null)}},[e,f,S]);return(0,Y.createPortal)((0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,W.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(_,{checked:v,onChange:y,label:`Show all defaults`}),(0,G.jsx)(u,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(m,{tone:`error`,children:s})}),a?(0,G.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,G.jsx)(P,{className:`h-8 w-8`}),(0,G.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,G.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=fe(e);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,G.jsx)(h,{tone:me(e.risk),children:X(e.risk)}),e.origin===`default`&&(0,G.jsx)(h,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(h,{tone:`warning`,children:`Modified`})]}),(0,G.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(x,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>g(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(N,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),l&&(0,G.jsx)(de,{assistantId:e,existingRule:l,onClose:()=>d(null),onSaved:()=>{d(null),S()}}),(0,G.jsx)(p,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${X(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void C(),onCancel:()=>g(null)})]}),document.body)}function Z(){let e=H(),[t,n]=(0,W.useState)(!1);return(0,G.jsxs)(d,{children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(P,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,G.jsx)(u,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,G.jsx)(he,{assistantId:e,onClose:()=>n(!1)})]})}var ge=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],_e=`thirtyDays`;function Q({label:e,helperText:t,checked:n,onChange:r}){return(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e}),(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,G.jsx)(_,{checked:n,onChange:r,label:e})]})}function $(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function ve(){let e=z({platformHostedOnly:!0}),i=O(),[a,o]=(0,W.useState)(()=>t(`shareAnalytics`,!0)),[s,c]=(0,W.useState)(()=>t(`shareDiagnostics`,!0)),[l,u]=(0,W.useState)(()=>r(`llmLogRetention`,_e));return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(se,{}),(0,G.jsx)(Z,{}),(0,G.jsx)(ce,{}),(0,G.jsx)(U,{title:`Privacy`,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(Q,{label:`Share Analytics`,helperText:`Send anonymous product usage data. Your conversations and personal data are never included.`,checked:a,onChange:()=>{let e=!a;o(e),D(`share_analytics`,e,i)}}),(0,G.jsx)($,{}),(0,G.jsx)(Q,{label:`Share Diagnostics`,helperText:`Send crash reports and performance metrics. Your conversations and personal data are never included.`,checked:s,onChange:()=>{let e=!s;c(e),D(`share_diagnostics`,e,i)}}),(0,G.jsx)($,{}),(0,G.jsx)(K,{}),e!==`gated`&&(0,G.jsx)($,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(f,{value:l,onChange:e=>{u(e),n(`llmLogRetention`,e)},options:ge})}),(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{ve as PrivacyPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./button-DdEh-9f_.js";import{t as o}from"./card-CL5iEMJO.js";import{t as s}from"./checkbox-qlcBvCFW.js";import{t as c}from"./toggle-CEm3M86o.js";import{t as l}from"./is-electron-CavSPgmY.js";import{O as u,n as d,r as f,u as p}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./button-DdEh-9f_.js";import{t as o}from"./card-CL5iEMJO.js";import{t as s}from"./checkbox-qlcBvCFW.js";import{t as c}from"./toggle-CEm3M86o.js";import{t as l}from"./is-electron-CavSPgmY.js";import{O as u,n as d,r as f,u as p}from"./auth-store-CEYaVkBG.js";import{i as m,r as h}from"./routes-Dk5Qeryt.js";import{Cr as g,Sr as _,Tr as v,Wa as y,gr as b,wr as x}from"./index-BoHdS0dH.js";import{t as S}from"./onboarding-layout-BIVa2BnX.js";import{a as C,c as w,i as T,n as E,o as D,t as O}from"./step-indicator-dots-Cz4FzNR8.js";var k=e(t(),1),A=i();function j({label:e,helperText:t,checked:n,onChange:r}){let i=(0,k.useId)();return(0,A.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,A.jsx)(c,{checked:n,onChange:r,id:i}),(0,A.jsxs)(`label`,{htmlFor:i,className:`min-w-0 flex-1 cursor-pointer`,children:[(0,A.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:e}),(0,A.jsx)(`span`,{className:`mt-1 block text-body-small-default text-[var(--content-tertiary)]`,children:t})]})]})}var M=`[&_button[data-state=checked]]:bg-[var(--primary-base)] [&_svg]:text-[var(--content-inset)]`;function N(){let e=n(),[t]=r(),i=d.use.user()?.id??null,c=l(),N=u(),P=D(b.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[F,I]=g(),[L,R]=x(),[z,B]=v(),[V,H]=_(),U=f();(0,k.useEffect)(()=>{N||C()},[N]);let W=(0,k.useCallback)(()=>{if(p({userId:i,tos:z,ai:V,shareAnalytics:F,shareDiagnostics:L,hasPlatformSession:U}),!N){let e=w(P);T(E.privacyTos,{userId:i,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let a=r.toString();e(`${m.onboarding.hatching}${a?`?${a}`:``}`)},[V,U,N,e,P,t,F,L,z,i]),G=(0,A.jsxs)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:[`I agree to the`,` `,(0,A.jsx)(`a`,{href:h(m.docs.legal.termsOfUse),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`Terms of Service`}),` `,`and`,` `,(0,A.jsx)(`a`,{href:h(m.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`Privacy Policy`})]}),K=(0,A.jsxs)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:[`I agree to the`,` `,(0,A.jsx)(`a`,{href:h(m.docs.legal.dataSharing),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`AI Data Sharing Policy`})]});return(0,A.jsx)(S,{children:(0,A.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center px-6 ${c?`pb-16`:`py-16`} text-[var(--content-default)]`,style:c?{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1.5rem)`}:void 0,children:[N&&(0,A.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,A.jsx)(O,{current:2,total:3})}),(0,A.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,children:`Before You Start`}),(0,A.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,A.jsx)(o,{padding:`md`,className:`mt-8 w-full`,children:(0,A.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,A.jsx)(j,{label:`Share Analytics`,helperText:`Send anonymous product usage data.`,checked:F,onChange:I}),(0,A.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`}),(0,A.jsx)(j,{label:`Share Diagnostics`,helperText:`Send crash reports and performance metrics.`,checked:L,onChange:R}),(0,A.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,A.jsx)(y,{className:`h-4 w-4 shrink-0`}),(0,A.jsx)(`span`,{children:`Your conversations and personal data are never included.`})]})]})}),(0,A.jsx)(`div`,{className:`mt-6 flex w-full items-start`,children:(0,A.jsx)(s,{checked:V,onCheckedChange:e=>H(e===!0),label:K,"aria-label":`I agree to the AI Data Sharing Policy`,className:M})}),(0,A.jsx)(`div`,{className:`mt-4 flex w-full items-start`,children:(0,A.jsx)(s,{checked:z,onCheckedChange:e=>B(e===!0),label:G,"aria-label":`I agree to the Terms of Service and Privacy Policy`,className:M})}),(0,A.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-2`,children:[(0,A.jsx)(a,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!z||!V,onClick:W,className:`h-11 text-base`,children:`Start`}),(0,A.jsx)(a,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:`h-11 text-base`,children:`Back`})]})]})})}export{N as PrivacyScreen};
|
package/dist/assets/{provider-callback-page-CrRVMgnQ.js → provider-callback-page-4baz5ZSB.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CZsNGL6n.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{b as s,f as c}from"./resolved-assistants-store-ub66utfl.js";import{I as l,M as u,n as d}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CZsNGL6n.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{b as s,f as c}from"./resolved-assistants-store-ub66utfl.js";import{I as l,M as u,n as d}from"./auth-store-CEYaVkBG.js";import{c as f}from"./api-DA14D9P8.js";import{i as p}from"./routes-Dk5Qeryt.js";import{K as m}from"./index-BoHdS0dH.js";import{r as h,t as g}from"./account-shell-qQqbocXz.js";import{a as _,i as v}from"./login-flow-CGVhpMhL.js";var y=e(n(),1),b=o();function x(){let[e]=i(),n=r(),o=d.use.refreshSession(),x=e.get(`error`),[S,C]=(0,y.useState)(null),w=(0,y.useRef)(!1),T=e.get(`returnTo`),E=v(e);return(0,y.useEffect)(()=>{w.current||x||(w.current=!0,(async()=>{try{let t=await l(),r=u(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),c())try{let e=await f();if(e.ok&&e.data.length>0&&(await s(e.data),!T)){n(p.assistant,{replace:!0});break}}catch{}let e=p.assistant,{destination:t,requiresFullPageNavigation:r}=_({returnTo:T,fallback:e,authIntent:E});r?window.location.href=t:n(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);n(t?`${p.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:p.account.providerSignup,{replace:!0});break}case`error`:C(r.message);break}}catch(e){t(e,{context:`provider_callback`}),C(`Something went wrong. Please try signing in again.`)}})())},[E,x,o,T,n,e]),x===`signup_closed`?(0,b.jsxs)(g,{children:[(0,b.jsx)(h,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,b.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,b.jsx)(`a`,{href:m,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-white no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,b.jsx)(a,{to:p.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):x||S?(0,b.jsxs)(g,{children:[(0,b.jsx)(h,{title:`Authentication failed`,subtitle:S??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,b.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,b.jsx)(a,{to:p.account.login,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-white no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,b.jsx)(g,{children:(0,b.jsx)(h,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{x as ProviderCallbackPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r,t as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{F as o,L as s,R as c,n as l}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r,t as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{F as o,L as s,R as c,n as l}from"./auth-store-CEYaVkBG.js";import{i as u}from"./routes-Dk5Qeryt.js";import{i as d,n as f,r as p,t as m}from"./account-shell-qQqbocXz.js";import{a as h,o as g}from"./login-flow-CGVhpMhL.js";var _=e(t(),1),v=a();function y(){let e=n(),[t]=r(),a=l.use.refreshSession(),y=t.get(`returnTo`),[b,x]=(0,_.useState)(``),[S,C]=(0,_.useState)(``),[w,T]=(0,_.useState)(null),[E,D]=(0,_.useState)(!1),[O,k]=(0,_.useState)(!0),A=(0,_.useRef)(!1);return(0,_.useEffect)(()=>{A.current||(A.current=!0,(async()=>{try{let t=await o();if(!t.ok){e(u.account.login,{replace:!0});return}x(t.data.user.email??``),C(t.data.user.username??``),k(!1)}catch{e(u.account.login,{replace:!0})}})())},[e]),O?(0,v.jsx)(m,{children:(0,v.jsx)(p,{title:`Completing signup...`,subtitle:`Please wait while we load your information.`})}):(0,v.jsxs)(m,{children:[(0,v.jsx)(p,{title:`Complete your account`,subtitle:`We need a few more details to finish setting up your account.`}),(0,v.jsxs)(f,{onSubmit:async t=>{t.preventDefault(),T(null),D(!0);try{let t=await c({email:b,username:S});if(!t.ok){if(s(t)){await a();let t=g(y,u.account.root);t.requiresFullPageNavigation?window.location.href=t.destination:e(t.destination);return}T(t.errors[0]?.message??`Failed to complete signup.`);return}await a();let n=h({returnTo:y,fallback:u.account.root,authIntent:`signup`});n.requiresFullPageNavigation?window.location.href=n.destination:e(n.destination)}catch{T(`Something went wrong. Please try again.`)}finally{D(!1)}},error:w,submitLabel:`Complete signup`,submittingLabel:`Completing...`,isSubmitting:E,footer:(0,v.jsx)(i,{to:u.account.login,className:`text-sm text-stone-400 hover:text-stone-300`,children:`← Back to sign in`}),children:[(0,v.jsx)(d,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`Email`,value:b,onChange:e=>x(e.target.value),required:!0}),(0,v.jsx)(d,{id:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:S,onChange:e=>C(e.target.value),required:!0})]})]})}export{y as ProviderSignupPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./button-DdEh-9f_.js";import{t as o}from"./checkbox-qlcBvCFW.js";import{t as s}from"./is-electron-CavSPgmY.js";import{j as c,n as l,r as u,u as d}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./button-DdEh-9f_.js";import{t as o}from"./checkbox-qlcBvCFW.js";import{t as s}from"./is-electron-CavSPgmY.js";import{j as c,n as l,r as u,u as d}from"./auth-store-CEYaVkBG.js";import{i as f,r as p}from"./routes-Dk5Qeryt.js";import{Cr as m,Sr as h,Tr as g,lr as _,wr as v}from"./index-BoHdS0dH.js";import{t as y}from"./onboarding-layout-BIVa2BnX.js";var b=e(t(),1),x=i(),S=`[&_button[data-state=checked]]:bg-[var(--primary-base)] [&_svg]:text-[var(--content-inset)]`;function C(){let e=n(),[t]=r(),i=l.use.user()?.id??null,C=l.use.logout(),w=s(),T=u(),[E,D]=g(),[O,k]=h(),[A]=m(),[j]=v(),M=(0,b.useCallback)(()=>{d({userId:i,tos:E,ai:O,shareAnalytics:A,shareDiagnostics:j,hasPlatformSession:T}),e(c(t.get(`returnTo`),f.assistant),{replace:!0})},[O,T,e,t,A,j,E,i]),N=(0,b.useCallback)(async()=>{await C(),_(f.account.login)},[C]),P=(0,x.jsxs)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:[`I agree to the`,` `,(0,x.jsx)(`a`,{href:p(f.docs.legal.termsOfUse),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`Terms of Service`}),` `,`and`,` `,(0,x.jsx)(`a`,{href:p(f.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`Privacy Policy`})]}),F=(0,x.jsxs)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:[`I agree to the`,` `,(0,x.jsx)(`a`,{href:p(f.docs.legal.dataSharing),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`AI Data Sharing Policy`})]});return(0,x.jsx)(y,{showCreatureFooter:!1,children:(0,x.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center px-6 ${w?`pb-16`:`py-16`} text-[var(--content-default)]`,style:w?{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1.5rem)`}:void 0,children:[(0,x.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,children:`Updated Terms`}),(0,x.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`We've updated our terms. Please review and re-accept to continue.`}),(0,x.jsx)(`div`,{className:`mt-8 flex w-full items-start`,children:(0,x.jsx)(o,{checked:O,onCheckedChange:e=>k(e===!0),label:F,"aria-label":`I agree to the AI Data Sharing Policy`,className:S})}),(0,x.jsx)(`div`,{className:`mt-4 flex w-full items-start`,children:(0,x.jsx)(o,{checked:E,onCheckedChange:e=>D(e===!0),label:P,"aria-label":`I agree to the Terms of Service and Privacy Policy`,className:S})}),(0,x.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-2`,children:[(0,x.jsx)(a,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!E||!O,onClick:M,className:`h-11 text-base`,children:`Continue`}),(0,x.jsx)(a,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:N,className:`h-11 text-base`,children:`Log out`})]})]})})}export{C as ReviewTermsScreen};
|