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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/assets/{account-page-DcjAe3ze.js → account-page-va3jsKG3.js} +1 -1
  2. package/dist/assets/{add-credits-modal-BRZVeZOI.js → add-credits-modal-BJQfpHmv.js} +1 -1
  3. package/dist/assets/{advanced-page-axzblMww.js → advanced-page-BQEEMqUJ.js} +1 -1
  4. package/dist/assets/{ai-page-DrDDpvgG.js → ai-page-C2gOM0fO.js} +1 -1
  5. package/dist/assets/{api-key-screen-CM-BLcGz.js → api-key-screen-D3pD0rPG.js} +1 -1
  6. package/dist/assets/{archive-page-DabK-GNm.js → archive-page-CDaGKTY2.js} +1 -1
  7. package/dist/assets/{assistant-status-panel-Cm8ComZV.js → assistant-status-panel-Byd6c2GD.js} +1 -1
  8. package/dist/assets/auth-store-Cc0c0sQk.js +7 -0
  9. package/dist/assets/billing-page-GeeUd8nR.js +3 -0
  10. package/dist/assets/{bookmarks-page-CvfOEvF0.js → bookmarks-page-vJb4HXNp.js} +1 -1
  11. package/dist/assets/{build-state-CjVnPOtQ.js → build-state-WKs9Ht8_.js} +1 -1
  12. package/dist/assets/{command-palette-AsmJHeEk.js → command-palette-K6nK6F7f.js} +1 -1
  13. package/dist/assets/{command-palette-window-page-DrgvLRov.js → command-palette-window-page-BTGDdcg4.js} +1 -1
  14. package/dist/assets/{community-page-sWODbqYS.js → community-page-UxhAQFV9.js} +1 -1
  15. package/dist/assets/{connect-page-DsRXJyfd.js → connect-page-BgPgIb-F.js} +1 -1
  16. package/dist/assets/contacts-page-route-CM06poQB.js +1 -0
  17. package/dist/assets/{conversation-queries-Hwr6Ce8U.js → conversation-queries-Bm61s1He.js} +1 -1
  18. package/dist/assets/{debug-page-BeqbpC6w.js → debug-page-BVMoMpUg.js} +1 -1
  19. package/dist/assets/{deploy-dialogs-CDE1JAyP.js → deploy-dialogs-BJI2X201.js} +1 -1
  20. package/dist/assets/{developer-page-Bh9POaRZ.js → developer-page-9X_iqAuN.js} +1 -1
  21. package/dist/assets/{devices-page-br5aQnJ6.js → devices-page-Byr7kUNa.js} +1 -1
  22. package/dist/assets/{dictation-overlay-page-D_kPOJmY.js → dictation-overlay-page-CN6yGveG.js} +1 -1
  23. package/dist/assets/{document-viewer-page-BWNgq5A7.js → document-viewer-page-CRnBN1cE.js} +1 -1
  24. package/dist/assets/{earn-credits-modal-BQlDvHQX.js → earn-credits-modal-DevPS5jN.js} +1 -1
  25. package/dist/assets/{emails-page-DCEa8uJF.js → emails-page-B0dZDuR-.js} +1 -1
  26. package/dist/assets/{file-editor-D0SuRz-y.js → file-editor-DqNMJEa4.js} +1 -1
  27. package/dist/assets/general-page-B83wb3Tj.js +1 -0
  28. package/dist/assets/hatching-screen-Cok0yK9s.js +1 -0
  29. package/dist/assets/{home-page-route-CAziCmHd.js → home-page-route-C_dx1nVl.js} +1 -1
  30. package/dist/assets/{hosting-screen-DVJZyhOt.js → hosting-screen-CsavWom3.js} +1 -1
  31. package/dist/assets/identity-page-route-Bly29wqM.js +1 -0
  32. package/dist/assets/index-DhxGhfwI.js +155 -0
  33. package/dist/assets/{inspect-page-CBpmIz3n.js → inspect-page-C_hXwcho.js} +3 -3
  34. package/dist/assets/install-Gyq-nEic.js +1 -0
  35. package/dist/assets/integrations-page-Dz67PdC8.js +1 -0
  36. package/dist/assets/{intelligence-layout-BzBg1Kci.js → intelligence-layout-CgcnfjDK.js} +1 -1
  37. package/dist/assets/{keyboard-shortcuts-page-CfAeD2Ca.js → keyboard-shortcuts-page-BhTucwGW.js} +1 -1
  38. package/dist/assets/{library-detail-page-D6RDZtML.js → library-detail-page-DK89d-u4.js} +1 -1
  39. package/dist/assets/{library-page-CrI--_3N.js → library-page-vrFk-Rt1.js} +1 -1
  40. package/dist/assets/{login-flow-sr2DI9LC.js → login-flow-CzPVmpoB.js} +1 -1
  41. package/dist/assets/{login-page-JTaRfldA.js → login-page-Csy9gwOa.js} +1 -1
  42. package/dist/assets/{logout-page-DjT8j4Lw.js → logout-page-Dz800OIa.js} +1 -1
  43. package/dist/assets/{logs-layout-DsCE83mN.js → logs-layout-BwgQ_S4K.js} +1 -1
  44. package/dist/assets/{mcp-page-BgOwigD-.js → mcp-page-5PXJCl5X.js} +1 -1
  45. package/dist/assets/{memory-router-playground-page-BFeqOyw_.js → memory-router-playground-page-BVhLOinh.js} +1 -1
  46. package/dist/assets/{mobile-sidebar-drawer-ChpPfZ8u.js → mobile-sidebar-drawer-rYD2VIdb.js} +1 -1
  47. package/dist/assets/{notifications-page-Bg_7pXfR.js → notifications-page-CVB7NSmc.js} +1 -1
  48. package/dist/assets/{oauth-complete-page-BuJCcg8E.js → oauth-complete-page-CzvAQxVm.js} +1 -1
  49. package/dist/assets/{oauth-popup-complete-page-Cfh_5DAx.js → oauth-popup-complete-page-e67O6LPS.js} +1 -1
  50. package/dist/assets/{pairing-page-Jt95f3cN.js → pairing-page-B6gfw_Dk.js} +1 -1
  51. package/dist/assets/{platform-loopback-page-B3Q7OUNO.js → platform-loopback-page-BtfoD3mE.js} +1 -1
  52. package/dist/assets/{plugin-detail-page-C4bk1LvY.js → plugin-detail-page-CTQIvdhJ.js} +1 -1
  53. package/dist/assets/{plugins-page-CtHfLqtX.js → plugins-page-CVnC0QSh.js} +1 -1
  54. package/dist/assets/prechat-route-y6KNH7Qp.js +1 -0
  55. package/dist/assets/{prefs-CrgkSe-_.js → prefs-BQY2Hl9H.js} +1 -1
  56. package/dist/assets/privacy-page-Bbc8BtbS.js +1 -0
  57. package/dist/assets/{privacy-screen-CXDDLFzO.js → privacy-screen-CEH2JNQv.js} +1 -1
  58. package/dist/assets/{provider-callback-page-D2guKVyJ.js → provider-callback-page-C7misZDP.js} +1 -1
  59. package/dist/assets/{provider-signup-page-DiyM7dV8.js → provider-signup-page-PWsQh0Yg.js} +1 -1
  60. package/dist/assets/{research-mock-page-DB4eGyYW.js → research-mock-page-C9A3-fDP.js} +1 -1
  61. package/dist/assets/{research-onboarding-route-BCepmvL-.js → research-onboarding-route-efpyR7DJ.js} +2 -2
  62. package/dist/assets/resolved-assistants-store-lkSgU__i.js +1 -0
  63. package/dist/assets/{review-terms-screen-BdGybDri.js → review-terms-screen-CDfWU0ZO.js} +1 -1
  64. package/dist/assets/{select-assistant-screen-CHBqN3LE.js → select-assistant-screen-ZJ9IYyUk.js} +1 -1
  65. package/dist/assets/{settings-layout-CLYztcN0.js → settings-layout-Cp1jKtid.js} +1 -1
  66. package/dist/assets/{share-feedback-modal-CRvX8jqz.js → share-feedback-modal-pEDXaPEK.js} +1 -1
  67. package/dist/assets/{sidebar-tree-CLtH7ULI.js → sidebar-tree-B24zaatU.js} +1 -1
  68. package/dist/assets/{signup-page-Bh-8V-o6.js → signup-page-Bf1Etxe9.js} +1 -1
  69. package/dist/assets/skills-page-A9JPglEX.js +1 -0
  70. package/dist/assets/{sounds-page-wAXxaGjk.js → sounds-page-D9PLU10T.js} +1 -1
  71. package/dist/assets/{step-indicator-dots-JQQwRvNU.js → step-indicator-dots-CE4dEV3k.js} +1 -1
  72. package/dist/assets/{subagent-detail-panel-Csn2eZm-.js → subagent-detail-panel-DdynnGgr.js} +2 -2
  73. package/dist/assets/{system-events-page-CY9869ly.js → system-events-page-CapsfcLj.js} +1 -1
  74. package/dist/assets/{tiptap-document-editor-B-jptvl0.js → tiptap-document-editor-Bmxs-PZ9.js} +2 -2
  75. package/dist/assets/{tool-detail-panel-TULCfc-h.js → tool-detail-panel-BqCxmSox.js} +2 -2
  76. package/dist/assets/trace-page-CniuHbEK.js +1 -0
  77. package/dist/assets/{upgrade-cancel-page-DDp_V51G.js → upgrade-cancel-page-DBjzADY1.js} +1 -1
  78. package/dist/assets/{upgrade-success-page-jXr4wakw.js → upgrade-success-page-VewnS1PS.js} +1 -1
  79. package/dist/assets/{usage-page-giUgsD1Z.js → usage-page-XZramSoz.js} +1 -1
  80. package/dist/assets/{use-active-assistant-id-DOx36WGk.js → use-active-assistant-id-DTsVl8b7.js} +1 -1
  81. package/dist/assets/use-is-org-ready-BL-GcZZw.js +1 -0
  82. package/dist/assets/{use-onboarding-login-Bp9jhDR4.js → use-onboarding-login-vAFdm7Pu.js} +1 -1
  83. package/dist/assets/{voice-page-BV-46kzi.js → voice-page-DiP4QkZU.js} +1 -1
  84. package/dist/assets/{weather-forecast-display-CdImQdck.js → weather-forecast-display-3wTH0LJ0.js} +1 -1
  85. package/dist/assets/{welcome-screen-TWxcbCdx.js → welcome-screen-DVEKTxnJ.js} +1 -1
  86. package/dist/assets/{workflow-detail-panel-FzbZ4bE5.js → workflow-detail-panel-Djzb5VDE.js} +1 -1
  87. package/dist/assets/workspace-page-DvdkgVub.js +1 -0
  88. package/dist/index.html +9 -9
  89. package/package.json +1 -1
  90. package/dist/assets/auth-store-6CnXVIAL.js +0 -7
  91. package/dist/assets/billing-page-CvQeoBjS.js +0 -3
  92. package/dist/assets/contacts-page-route-eK-_KwLV.js +0 -1
  93. package/dist/assets/general-page-Cxl-qtRp.js +0 -1
  94. package/dist/assets/hatching-screen-CHqDiHaW.js +0 -1
  95. package/dist/assets/identity-page-route-DmpOhvmv.js +0 -1
  96. package/dist/assets/index-Chr1kHBM.js +0 -155
  97. package/dist/assets/install-CFvX5wtl.js +0 -1
  98. package/dist/assets/integrations-page-C2AgksrD.js +0 -1
  99. package/dist/assets/prechat-route-CEPNmia4.js +0 -1
  100. package/dist/assets/privacy-page-BX4CkH3k.js +0 -1
  101. package/dist/assets/resolved-assistants-store-IMxY1_w9.js +0 -1
  102. package/dist/assets/skills-page-B5SANwyR.js +0 -1
  103. package/dist/assets/trace-page-CHASnwBH.js +0 -1
  104. package/dist/assets/use-is-org-ready-D3HBLwJJ.js +0 -1
  105. package/dist/assets/workspace-page-C4tstjYv.js +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{h as a}from"./local-mode-Bg6wpc5q.js";import{t as o}from"./circle-alert-D58pfVBz.js";import{t as s}from"./circle-check-BKkxjdE1.js";import{t as c}from"./loader-circle-YAV9sMh_.js";import{a as l,i as u,n as d,o as f,r as p,t as m}from"./return-to-BcgKmS7W.js";import{a as h}from"./routes-BLyehs4B.js";import{t as g}from"./index-Chr1kHBM.js";var _=e(t(),1),v=i();function y(e){switch(e.kind){case`starting`:return{title:`Starting pairing`,body:`Creating a code for this browser.`};case`approved`:return{title:`Connected`,body:`Opening your assistant.`};case`expired`:return{title:`Pairing expired`,body:`Start a new web pairing from the local assistant.`};case`error`:return{title:`Pairing failed`,body:e.message};case`polling`:return{title:`Waiting for approval`,body:`Confirm this code on the machine running your assistant.`}}}function b({state:e}){return e.kind===`approved`?(0,v.jsx)(s,{className:`h-5 w-5 text-green-600`,"aria-hidden":!0}):e.kind===`starting`||e.kind===`polling`?(0,v.jsx)(c,{className:`h-5 w-5 animate-spin text-blue-600`,"aria-hidden":!0}):(0,v.jsx)(o,{className:`h-5 w-5 text-red-600`,"aria-hidden":!0})}function x(){let e=r(),t=n(),i=a(),o=(0,_.useMemo)(()=>m(new URLSearchParams(e.search).get(`returnTo`),h.assistant),[e.search]),s=(0,_.useMemo)(()=>f(`${e.pathname}${e.search}${e.hash}`),[e.pathname,e.search,e.hash]),[c,x]=(0,_.useState)(()=>s.deviceCode?{deviceCode:s.deviceCode,userCode:s.userCode}:null),[S,C]=(0,_.useState)(c?{kind:`polling`,expiresAt:null}:{kind:`starting`});if((0,_.useEffect)(()=>{if(!i||c)return;let e=new AbortController;return(async()=>{try{let t=await u(e.signal);x({deviceCode:t.deviceCode,userCode:t.userCode}),C({kind:`polling`,expiresAt:t.expiresAt})}catch{if(e.signal.aborted)return;C({kind:`error`,message:`The assistant could not start pairing. Refresh the page to try again.`})}})(),()=>{e.abort()}},[i,c]),(0,_.useEffect)(()=>{if(!i||!c?.deviceCode)return;let e=new AbortController,n=null,r=async()=>{try{let i=await l(c.deviceCode,e.signal);if(i.status===`pending`){C({kind:`polling`,expiresAt:i.expiresAt||null}),n=setTimeout(()=>void r(),Math.max(1,i.intervalSeconds)*1e3);return}p(i),C({kind:`approved`}),n=setTimeout(()=>t(o,{replace:!0}),250)}catch(t){if(e.signal.aborted)return;if(t instanceof d&&t.status===401){C({kind:`expired`});return}C({kind:`error`,message:`The assistant could not complete pairing. Try starting a new pairing.`})}};return r(),()=>{e.abort(),n&&clearTimeout(n)}},[i,c?.deviceCode,t,o]),!i)return(0,v.jsx)(g,{});let w=y(S);return(0,v.jsx)(`main`,{className:`flex min-h-svh items-center justify-center bg-[var(--background-default)] px-6 py-10 text-[var(--content-primary)]`,children:(0,v.jsxs)(`section`,{className:`w-full max-w-md rounded-lg border border-[var(--border-default)] bg-[var(--background-surface)] p-8 shadow-sm`,children:[(0,v.jsxs)(`div`,{className:`mb-5 flex items-center gap-3`,children:[(0,v.jsx)(b,{state:S}),(0,v.jsx)(`h1`,{className:`text-xl font-semibold`,children:w.title})]}),c?.userCode?(0,v.jsxs)(`div`,{className:`mb-5 rounded-md border border-[var(--border-subtle)] bg-[var(--background-muted)] p-4 text-center`,children:[(0,v.jsx)(`div`,{className:`text-xs font-medium uppercase text-[var(--content-secondary)]`,children:`Pairing code`}),(0,v.jsx)(`div`,{className:`mt-2 font-mono text-3xl font-semibold tracking-[0.18em]`,children:c.userCode})]}):null,(0,v.jsx)(`p`,{className:`text-sm leading-6 text-[var(--content-secondary)]`,children:w.body}),S.kind===`polling`&&S.expiresAt?(0,v.jsxs)(`p`,{className:`mt-4 text-xs text-[var(--content-tertiary)]`,children:[`Expires `,new Date(S.expiresAt).toLocaleTimeString(),`.`]}):null]})})}export{x as RemoteWebPairingPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{h as a}from"./local-mode-Bg6wpc5q.js";import{t as o}from"./circle-alert-D58pfVBz.js";import{t as s}from"./circle-check-BKkxjdE1.js";import{t as c}from"./loader-circle-YAV9sMh_.js";import{a as l,i as u,n as d,o as f,r as p,t as m}from"./return-to-BcgKmS7W.js";import{a as h}from"./routes-BLyehs4B.js";import{t as g}from"./index-DhxGhfwI.js";var _=e(t(),1),v=i();function y(e){switch(e.kind){case`starting`:return{title:`Starting pairing`,body:`Creating a code for this browser.`};case`approved`:return{title:`Connected`,body:`Opening your assistant.`};case`expired`:return{title:`Pairing expired`,body:`Start a new web pairing from the local assistant.`};case`error`:return{title:`Pairing failed`,body:e.message};case`polling`:return{title:`Waiting for approval`,body:`Confirm this code on the machine running your assistant.`}}}function b({state:e}){return e.kind===`approved`?(0,v.jsx)(s,{className:`h-5 w-5 text-green-600`,"aria-hidden":!0}):e.kind===`starting`||e.kind===`polling`?(0,v.jsx)(c,{className:`h-5 w-5 animate-spin text-blue-600`,"aria-hidden":!0}):(0,v.jsx)(o,{className:`h-5 w-5 text-red-600`,"aria-hidden":!0})}function x(){let e=r(),t=n(),i=a(),o=(0,_.useMemo)(()=>m(new URLSearchParams(e.search).get(`returnTo`),h.assistant),[e.search]),s=(0,_.useMemo)(()=>f(`${e.pathname}${e.search}${e.hash}`),[e.pathname,e.search,e.hash]),[c,x]=(0,_.useState)(()=>s.deviceCode?{deviceCode:s.deviceCode,userCode:s.userCode}:null),[S,C]=(0,_.useState)(c?{kind:`polling`,expiresAt:null}:{kind:`starting`});if((0,_.useEffect)(()=>{if(!i||c)return;let e=new AbortController;return(async()=>{try{let t=await u(e.signal);x({deviceCode:t.deviceCode,userCode:t.userCode}),C({kind:`polling`,expiresAt:t.expiresAt})}catch{if(e.signal.aborted)return;C({kind:`error`,message:`The assistant could not start pairing. Refresh the page to try again.`})}})(),()=>{e.abort()}},[i,c]),(0,_.useEffect)(()=>{if(!i||!c?.deviceCode)return;let e=new AbortController,n=null,r=async()=>{try{let i=await l(c.deviceCode,e.signal);if(i.status===`pending`){C({kind:`polling`,expiresAt:i.expiresAt||null}),n=setTimeout(()=>void r(),Math.max(1,i.intervalSeconds)*1e3);return}p(i),C({kind:`approved`}),n=setTimeout(()=>t(o,{replace:!0}),250)}catch(t){if(e.signal.aborted)return;if(t instanceof d&&t.status===401){C({kind:`expired`});return}C({kind:`error`,message:`The assistant could not complete pairing. Try starting a new pairing.`})}};return r(),()=>{e.abort(),n&&clearTimeout(n)}},[i,c?.deviceCode,t,o]),!i)return(0,v.jsx)(g,{});let w=y(S);return(0,v.jsx)(`main`,{className:`flex min-h-svh items-center justify-center bg-[var(--background-default)] px-6 py-10 text-[var(--content-primary)]`,children:(0,v.jsxs)(`section`,{className:`w-full max-w-md rounded-lg border border-[var(--border-default)] bg-[var(--background-surface)] p-8 shadow-sm`,children:[(0,v.jsxs)(`div`,{className:`mb-5 flex items-center gap-3`,children:[(0,v.jsx)(b,{state:S}),(0,v.jsx)(`h1`,{className:`text-xl font-semibold`,children:w.title})]}),c?.userCode?(0,v.jsxs)(`div`,{className:`mb-5 rounded-md border border-[var(--border-subtle)] bg-[var(--background-muted)] p-4 text-center`,children:[(0,v.jsx)(`div`,{className:`text-xs font-medium uppercase text-[var(--content-secondary)]`,children:`Pairing code`}),(0,v.jsx)(`div`,{className:`mt-2 font-mono text-3xl font-semibold tracking-[0.18em]`,children:c.userCode})]}):null,(0,v.jsx)(`p`,{className:`text-sm leading-6 text-[var(--content-secondary)]`,children:w.body}),S.kind===`polling`&&S.expiresAt?(0,v.jsxs)(`p`,{className:`mt-4 text-xs text-[var(--content-tertiary)]`,children:[`Expires `,new Date(S.expiresAt).toLocaleTimeString(),`.`]}):null]})})}export{x as RemoteWebPairingPage};
@@ -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{D as a,S as o}from"./local-mode-Bg6wpc5q.js";import{I as s,l as c,n as l}from"./auth-store-6CnXVIAL.js";import{c as u}from"./api-kMnfZUPa.js";import{a as d}from"./routes-BLyehs4B.js";var f=e(t(),1),p=i(),m=`vellum:loopback:state`,h=`vellum:loopback:returnTo`;function g(){let[e]=r(),t=n(),[i,g]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let n=e.get(`state`),r=e.get(`session_token`),i=sessionStorage.getItem(m),f=sessionStorage.getItem(h)||d.assistant;if(sessionStorage.removeItem(m),sessionStorage.removeItem(h),!n||n!==i){g(`Login failed: state mismatch. Please try again.`);return}if(!r){g(`Login failed: no session token received. Please try again.`);return}if(!/^[a-zA-Z0-9]+$/.test(r)){g(`Login failed: invalid session token.`);return}(async()=>{if(!await a(r)){g(`Login failed: couldn't reach the local Vellum server to store the session. Please try again.`);return}await l.getState().initSession(),await s(!0);try{let e=await u();if(e.ok&&e.data.length>0){await o(e.data,c.getState().currentOrganizationId??void 0),t(d.assistant,{replace:!0});return}}catch{}t(f,{replace:!0})})()},[e,t]),i?(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:i}),(0,p.jsx)(`button`,{type:`button`,className:`mt-4 rounded-lg border border-[var(--border-disabled)] px-4 py-2 text-sm hover:bg-[var(--surface-lift)]`,onClick:()=>void t(d.welcome),children:`Back to Welcome`})]})}):(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:`Completing login...`})})}export{g as PlatformLoopbackPage};
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{D as a,S as o}from"./local-mode-Bg6wpc5q.js";import{I as s,l as c,n as l}from"./auth-store-Cc0c0sQk.js";import{c as u}from"./api-kMnfZUPa.js";import{a as d}from"./routes-BLyehs4B.js";var f=e(t(),1),p=i(),m=`vellum:loopback:state`,h=`vellum:loopback:returnTo`;function g(){let[e]=r(),t=n(),[i,g]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let n=e.get(`state`),r=e.get(`session_token`),i=sessionStorage.getItem(m),f=sessionStorage.getItem(h)||d.assistant;if(sessionStorage.removeItem(m),sessionStorage.removeItem(h),!n||n!==i){g(`Login failed: state mismatch. Please try again.`);return}if(!r){g(`Login failed: no session token received. Please try again.`);return}if(!/^[a-zA-Z0-9]+$/.test(r)){g(`Login failed: invalid session token.`);return}(async()=>{if(!await a(r)){g(`Login failed: couldn't reach the local Vellum server to store the session. Please try again.`);return}await l.getState().initSession(),await s(!0);try{let e=await u();if(e.ok&&e.data.length>0){await o(e.data,c.getState().currentOrganizationId??void 0),t(d.assistant,{replace:!0});return}}catch{}t(f,{replace:!0})})()},[e,t]),i?(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:i}),(0,p.jsx)(`button`,{type:`button`,className:`mt-4 rounded-lg border border-[var(--border-disabled)] px-4 py-2 text-sm hover:bg-[var(--surface-lift)]`,onClick:()=>void t(d.welcome),children:`Back to Welcome`})]})}):(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:`Completing login...`})})}export{g as PlatformLoopbackPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,p as i,r as a,t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./card-BibIM9x3.js";import"./src-BJj2O5XB.js";import{t as d}from"./confirm-dialog-SpCsmAdG.js";import{n as f}from"./toast-CxaZ5f1d.js";import{t as p}from"./arrow-left-CEu7Dsda.js";import{t as m}from"./external-link-CyRCaWBE.js";import{t as h}from"./loader-circle-YAV9sMh_.js";import{t as g}from"./triangle-alert-CoIDviBm.js";import{$ as _,Ht as v,Q as ee,Ut as y,Wt as b,it as x,nt as S,tt as C}from"./react-query.gen-DfnbKPpc.js";import{a as w}from"./routes-BLyehs4B.js";import{t as T}from"./assistant-feature-flag-store-BD9zTDcP.js";import{$i as E,A as D,Ii as O,Mr as k,sa as A}from"./index-Chr1kHBM.js";import{t as j}from"./use-active-assistant-id-DOx36WGk.js";import{n as M,r as N,t as P}from"./use-plugin-drift-B5uLDuHi.js";var F=e(t(),1),I=l();function L(e){return e?e.slice(0,7):`unknown`}function R(){let e=T.use.hasHydrated(),t=T.use.externalPlugins(),l=j(),{name:m}=i(),h=r(),g=s(),[E,O]=(0,F.useState)(!1),[k,A]=(0,F.useState)(!1),N=c({...ee({path:{assistant_id:l,name:m??``}}),enabled:!!l&&!!m}),R=N.data?.installed??!1,W=M({assistantId:l,name:m??``,enabled:R}).data,G=(0,F.useCallback)(()=>{g.invalidateQueries({queryKey:S({path:{assistant_id:l}})}),g.invalidateQueries({queryKey:x({path:{assistant_id:l}})}),m&&(g.invalidateQueries({queryKey:_({path:{assistant_id:l,name:m}})}),g.invalidateQueries({queryKey:C({path:{assistant_id:l,name:m}})}))},[l,m,g]),K=b({onSuccess:()=>{G(),f.success(`Installed ${m??`plugin`}`)}}),q=v({onSuccess:()=>{G(),h(w.plugins)}}),J=y({onSuccess:e=>{G(),f.success(e.outcome===`already-up-to-date`?`${m??`Plugin`} is already up to date`:`Upgraded ${m??`plugin`} to ${L(e.toCommit)}`)}});if(!e)return null;if(!t)return(0,I.jsx)(a,{to:w.identity,replace:!0});if(!m)return(0,I.jsx)(a,{to:w.plugins,replace:!0});let Y=()=>{K.mutate({path:{assistant_id:l},body:{name:m}})},X=()=>{O(!1),q.mutate({path:{assistant_id:l,name:m}})},Z=()=>{J.mutate({path:{assistant_id:l,name:m},body:{}})},Q=()=>{if(P(W)){A(!0);return}Z()},te=()=>{A(!1),Z()},$=N.data??null;return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,I.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,I.jsx)(n,{asChild:!0,variant:`ghost`,children:(0,I.jsx)(o,{to:w.plugins,"aria-label":`Back to plugins`,children:(0,I.jsx)(p,{"aria-hidden":!0})})}),(0,I.jsx)(z,{name:m,plugin:$,drift:W,onInstall:Y,onRemove:()=>O(!0),onUpgrade:Q,isInstalling:K.isPending,isRemoving:q.isPending,isUpgrading:J.isPending})]}),(K.isError||q.isError||J.isError)&&(0,I.jsx)(U,{message:K.isError?`Failed to install plugin. Please try again.`:q.isError?`Failed to remove plugin. Please try again.`:`Failed to upgrade plugin. Please try again.`}),(0,I.jsx)(u.Root,{asChild:!0,children:(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:N.isLoading?(0,I.jsx)(V,{}):N.isError||!$?(0,I.jsx)(H,{}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(B,{plugin:$}),$.readme?(0,I.jsx)(D,{content:$.readme}):(0,I.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})}),(0,I.jsx)(d,{open:E,title:`Remove plugin`,message:`Remove "${$?.name??m}" from this assistant?`,confirmLabel:`Remove`,destructive:!0,onConfirm:X,onCancel:()=>O(!1)}),(0,I.jsx)(d,{open:k,title:`Upgrade plugin`,message:`"${$?.name??m}" has local edits that will be overwritten by the upgrade. Continue?`,confirmLabel:`Upgrade anyway`,destructive:!0,onConfirm:te,onCancel:()=>A(!1)})]})}function z({name:e,plugin:t,drift:r,onInstall:i,onRemove:a,onUpgrade:o,isInstalling:s,isRemoving:c,isUpgrading:l}){let u=t?.installed??!1,d=t?.source?.kind===`github`,f=t?.artifact??null,p=r?.status===`update-available`,m=p?`Upgrade ${L(r?.local?.commit??null)} \u2192 ${L(r?.remote?.commit??null)}`:void 0;return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:d?`📦`:`🧩`}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,I.jsx)(`h2`,{className:`truncate text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,I.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,d?(0,I.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`}):null,p?(0,I.jsx)(N,{}):null]}),t?.description?(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?u?(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[f?(0,I.jsx)(n,{asChild:!0,leftIcon:(0,I.jsx)(O,{"aria-hidden":!0}),children:(0,I.jsx)(`a`,{href:f.url,download:!0,children:f.label??`Download`})}):null,p?(0,I.jsx)(n,{type:`button`,onClick:o,disabled:l,title:m,leftIcon:l?(0,I.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,I.jsx)(E,{"aria-hidden":!0}),children:`Upgrade`}):null,(0,I.jsx)(n,{type:`button`,variant:`dangerOutline`,onClick:a,disabled:c,leftIcon:c?(0,I.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,I.jsx)(k,{"aria-hidden":!0}),children:`Remove`})]}):(0,I.jsx)(n,{type:`button`,onClick:i,disabled:s,leftIcon:s?(0,I.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,I.jsx)(A,{"aria-hidden":!0}),children:`Install`}):null]})}function B({plugin:e}){let t=[{label:`Source`,value:e.source?.kind===`github`?e.source.repo:`Local`,href:(e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null)??void 0}];return e.homepage&&t.push({label:`Homepage`,value:e.homepage,href:e.homepage}),e.license&&t.push({label:`License`,value:e.license}),(0,I.jsx)(`dl`,{className:`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,style:{borderColor:`var(--border-base)`},children:t.map(e=>(0,I.jsxs)(`div`,{className:`contents`,children:[(0,I.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,I.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,I.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 underline`,style:{color:`var(--primary-base, #60a5fa)`},children:[e.value,(0,I.jsx)(m,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function V(){return(0,I.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,I.jsx)(h,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function H(){return(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,I.jsx)(g,{className:`h-6 w-6`,"aria-hidden":!0}),(0,I.jsx)(`p`,{className:`text-body-medium-default`,children:`We couldn't load this plugin.`}),(0,I.jsx)(`p`,{className:`text-body-small-default`,children:`It may not exist, or your assistant may be on an older build.`})]})}function U({message:e}){return(0,I.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,I.jsx)(g,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),e]})}export{R as PluginDetailPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,p as i,r as a,t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./card-BibIM9x3.js";import"./src-BJj2O5XB.js";import{t as d}from"./confirm-dialog-SpCsmAdG.js";import{n as f}from"./toast-CxaZ5f1d.js";import{t as p}from"./arrow-left-CEu7Dsda.js";import{t as m}from"./external-link-CyRCaWBE.js";import{t as h}from"./loader-circle-YAV9sMh_.js";import{t as g}from"./triangle-alert-CoIDviBm.js";import{$ as _,Ht as v,Q as ee,Ut as y,Wt as b,it as x,nt as S,tt as C}from"./react-query.gen-DfnbKPpc.js";import{a as w}from"./routes-BLyehs4B.js";import{t as T}from"./assistant-feature-flag-store-BD9zTDcP.js";import{A as E,Li as D,Nr as O,ca as k,ea as A}from"./index-DhxGhfwI.js";import{t as j}from"./use-active-assistant-id-DTsVl8b7.js";import{n as M,r as N,t as P}from"./use-plugin-drift-B5uLDuHi.js";var F=e(t(),1),I=l();function L(e){return e?e.slice(0,7):`unknown`}function R(){let e=T.use.hasHydrated(),t=T.use.externalPlugins(),l=j(),{name:m}=i(),h=r(),g=s(),[D,O]=(0,F.useState)(!1),[k,A]=(0,F.useState)(!1),N=c({...ee({path:{assistant_id:l,name:m??``}}),enabled:!!l&&!!m}),R=N.data?.installed??!1,W=M({assistantId:l,name:m??``,enabled:R}).data,G=(0,F.useCallback)(()=>{g.invalidateQueries({queryKey:S({path:{assistant_id:l}})}),g.invalidateQueries({queryKey:x({path:{assistant_id:l}})}),m&&(g.invalidateQueries({queryKey:_({path:{assistant_id:l,name:m}})}),g.invalidateQueries({queryKey:C({path:{assistant_id:l,name:m}})}))},[l,m,g]),K=b({onSuccess:()=>{G(),f.success(`Installed ${m??`plugin`}`)}}),q=v({onSuccess:()=>{G(),h(w.plugins)}}),J=y({onSuccess:e=>{G(),f.success(e.outcome===`already-up-to-date`?`${m??`Plugin`} is already up to date`:`Upgraded ${m??`plugin`} to ${L(e.toCommit)}`)}});if(!e)return null;if(!t)return(0,I.jsx)(a,{to:w.identity,replace:!0});if(!m)return(0,I.jsx)(a,{to:w.plugins,replace:!0});let Y=()=>{K.mutate({path:{assistant_id:l},body:{name:m}})},X=()=>{O(!1),q.mutate({path:{assistant_id:l,name:m}})},Z=()=>{J.mutate({path:{assistant_id:l,name:m},body:{}})},Q=()=>{if(P(W)){A(!0);return}Z()},te=()=>{A(!1),Z()},$=N.data??null;return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,I.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,I.jsx)(n,{asChild:!0,variant:`ghost`,children:(0,I.jsx)(o,{to:w.plugins,"aria-label":`Back to plugins`,children:(0,I.jsx)(p,{"aria-hidden":!0})})}),(0,I.jsx)(z,{name:m,plugin:$,drift:W,onInstall:Y,onRemove:()=>O(!0),onUpgrade:Q,isInstalling:K.isPending,isRemoving:q.isPending,isUpgrading:J.isPending})]}),(K.isError||q.isError||J.isError)&&(0,I.jsx)(U,{message:K.isError?`Failed to install plugin. Please try again.`:q.isError?`Failed to remove plugin. Please try again.`:`Failed to upgrade plugin. Please try again.`}),(0,I.jsx)(u.Root,{asChild:!0,children:(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:N.isLoading?(0,I.jsx)(V,{}):N.isError||!$?(0,I.jsx)(H,{}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(B,{plugin:$}),$.readme?(0,I.jsx)(E,{content:$.readme}):(0,I.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})}),(0,I.jsx)(d,{open:D,title:`Remove plugin`,message:`Remove "${$?.name??m}" from this assistant?`,confirmLabel:`Remove`,destructive:!0,onConfirm:X,onCancel:()=>O(!1)}),(0,I.jsx)(d,{open:k,title:`Upgrade plugin`,message:`"${$?.name??m}" has local edits that will be overwritten by the upgrade. Continue?`,confirmLabel:`Upgrade anyway`,destructive:!0,onConfirm:te,onCancel:()=>A(!1)})]})}function z({name:e,plugin:t,drift:r,onInstall:i,onRemove:a,onUpgrade:o,isInstalling:s,isRemoving:c,isUpgrading:l}){let u=t?.installed??!1,d=t?.source?.kind===`github`,f=t?.artifact??null,p=r?.status===`update-available`,m=p?`Upgrade ${L(r?.local?.commit??null)} \u2192 ${L(r?.remote?.commit??null)}`:void 0;return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:d?`📦`:`🧩`}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,I.jsx)(`h2`,{className:`truncate text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,I.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,d?(0,I.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`}):null,p?(0,I.jsx)(N,{}):null]}),t?.description?(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?u?(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[f?(0,I.jsx)(n,{asChild:!0,leftIcon:(0,I.jsx)(D,{"aria-hidden":!0}),children:(0,I.jsx)(`a`,{href:f.url,download:!0,children:f.label??`Download`})}):null,p?(0,I.jsx)(n,{type:`button`,onClick:o,disabled:l,title:m,leftIcon:l?(0,I.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,I.jsx)(A,{"aria-hidden":!0}),children:`Upgrade`}):null,(0,I.jsx)(n,{type:`button`,variant:`dangerOutline`,onClick:a,disabled:c,leftIcon:c?(0,I.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,I.jsx)(O,{"aria-hidden":!0}),children:`Remove`})]}):(0,I.jsx)(n,{type:`button`,onClick:i,disabled:s,leftIcon:s?(0,I.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,I.jsx)(k,{"aria-hidden":!0}),children:`Install`}):null]})}function B({plugin:e}){let t=[{label:`Source`,value:e.source?.kind===`github`?e.source.repo:`Local`,href:(e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null)??void 0}];return e.homepage&&t.push({label:`Homepage`,value:e.homepage,href:e.homepage}),e.license&&t.push({label:`License`,value:e.license}),(0,I.jsx)(`dl`,{className:`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,style:{borderColor:`var(--border-base)`},children:t.map(e=>(0,I.jsxs)(`div`,{className:`contents`,children:[(0,I.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,I.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,I.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 underline`,style:{color:`var(--primary-base, #60a5fa)`},children:[e.value,(0,I.jsx)(m,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function V(){return(0,I.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,I.jsx)(h,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function H(){return(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,I.jsx)(g,{className:`h-6 w-6`,"aria-hidden":!0}),(0,I.jsx)(`p`,{className:`text-body-medium-default`,children:`We couldn't load this plugin.`}),(0,I.jsx)(`p`,{className:`text-body-small-default`,children:`It may not exist, or your assistant may be on an older build.`})]})}function U({message:e}){return(0,I.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,I.jsx)(g,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),e]})}export{R as PluginDetailPage};
@@ -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-BibIM9x3.js";import"./src-BJj2O5XB.js";import{t as s}from"./input-Ch7OC6ME.js";import{t as c}from"./chevron-right-Cc3NZhAF.js";import{t as l}from"./loader-circle-YAV9sMh_.js";import{t as u}from"./triangle-alert-CoIDviBm.js";import{yn as d}from"./sdk.gen-W0KlW-sG.js";import{nt as f,rt as p}from"./react-query.gen-DfnbKPpc.js";import{a as m}from"./routes-BLyehs4B.js";import{t as h}from"./assistant-feature-flag-store-BD9zTDcP.js";import{Gr as g,Xr as _}from"./index-Chr1kHBM.js";import{t as v}from"./use-active-assistant-id-DOx36WGk.js";import{n as y,r as b}from"./use-plugin-drift-B5uLDuHi.js";var x=e(t(),1),S=a();function C({match:e}){return(0,S.jsx)(o.Root,{asChild:!0,children:(0,S.jsxs)(r,{to:m.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,S.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:`📦`}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,S.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.name})}),e.description&&(0,S.jsx)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.description}),(0,S.jsx)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},title:e.path,children:e.path})]}),(0,S.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 w({plugin:e,assistantId:t}){let n=y({assistantId:t,name:e.name}).data?.status===`update-available`;return(0,S.jsx)(o.Root,{asChild:!0,children:(0,S.jsxs)(r,{to:m.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,S.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:`🧩`}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.name}),e.version?(0,S.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,e.version]}):null,n?(0,S.jsx)(b,{}):null]}),(0,S.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,S.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,S.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 T=300*1e3;function E(e,...t){return e?t.some(t=>t?.toLowerCase().includes(e)):!0}function D({assistantId:e}){let[t,n]=(0,x.useState)(``),r=t.trim().toLowerCase(),a=i({queryKey:f({path:{assistant_id:e},query:{q:void 0}}),queryFn:async({signal:t})=>{let n=await d({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:T}),o=i({...p({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e,staleTime:T}),s=(0,x.useMemo)(()=>O(a.data?.plugins??[]),[a.data?.plugins]),c=(0,x.useMemo)(()=>new Set(s.map(e=>e.name)),[s]),l=(0,x.useMemo)(()=>s.filter(e=>E(r,e.name,e.description)),[s,r]),u=(0,x.useMemo)(()=>(o.data?.matches??[]).filter(e=>!c.has(e.name)&&E(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&&u.length===0;return(0,S.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[(0,S.jsx)(k,{search:t,onSearchChange:n,isSearching:m}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:[(0,S.jsx)(A,{title:`Installed`}),h?(0,S.jsx)(j,{}):a.isError?(0,S.jsx)(P,{}):_?(0,S.jsx)(M,{hasQuery:!!r}):(0,S.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.map(t=>(0,S.jsx)(`li`,{children:(0,S.jsx)(w,{plugin:t,assistantId:e})},t.id))}),(0,S.jsx)(`div`,{className:`mt-6`}),(0,S.jsx)(A,{title:`Available to install`}),g?(0,S.jsx)(j,{}):o.isError?(0,S.jsx)(F,{}):v?(0,S.jsx)(N,{hasQuery:!!r}):(0,S.jsx)(`ul`,{className:`flex flex-col gap-2`,children:u.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsx)(C,{match:e})},e.path))})]})]})}function O(e){return[...e].sort((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:`base`}))}function k({search:e,onSearchChange:t,isSearching:n}){return(0,S.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,S.jsx)(s,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search Plugins`,"aria-label":`Search Plugins`,leftIcon:(0,S.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:n?(0,S.jsx)(l,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`})})}function A({title:e}){return(0,S.jsx)(`h3`,{className:`mb-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e})}function j(){return(0,S.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,S.jsx)(l,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function M({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,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(r,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:t}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n})]})})}function N({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,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(g,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:t}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n})]})})}function P(){return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(u,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load plugins`}),(0,S.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 F(){return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(_,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Couldn't load catalog`}),(0,S.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 I(){let e=h.use.hasHydrated(),t=h.use.externalPlugins(),r=v();return e?t?(0,S.jsx)(D,{assistantId:r}):(0,S.jsx)(n,{to:m.identity,replace:!0}):null}export{I as PluginsPage};
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-BibIM9x3.js";import"./src-BJj2O5XB.js";import{t as s}from"./input-Ch7OC6ME.js";import{t as c}from"./chevron-right-Cc3NZhAF.js";import{t as l}from"./loader-circle-YAV9sMh_.js";import{t as u}from"./triangle-alert-CoIDviBm.js";import{yn as d}from"./sdk.gen-W0KlW-sG.js";import{nt as f,rt as p}from"./react-query.gen-DfnbKPpc.js";import{a as m}from"./routes-BLyehs4B.js";import{t as h}from"./assistant-feature-flag-store-BD9zTDcP.js";import{Kr as g,Zr as _}from"./index-DhxGhfwI.js";import{t as v}from"./use-active-assistant-id-DTsVl8b7.js";import{n as y,r as b}from"./use-plugin-drift-B5uLDuHi.js";var x=e(t(),1),S=a();function C({match:e}){return(0,S.jsx)(o.Root,{asChild:!0,children:(0,S.jsxs)(r,{to:m.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,S.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:`📦`}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,S.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.name})}),e.description&&(0,S.jsx)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.description}),(0,S.jsx)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},title:e.path,children:e.path})]}),(0,S.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 w({plugin:e,assistantId:t}){let n=y({assistantId:t,name:e.name}).data?.status===`update-available`;return(0,S.jsx)(o.Root,{asChild:!0,children:(0,S.jsxs)(r,{to:m.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,S.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:`🧩`}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.name}),e.version?(0,S.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,e.version]}):null,n?(0,S.jsx)(b,{}):null]}),(0,S.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,S.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,S.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 T=300*1e3;function E(e,...t){return e?t.some(t=>t?.toLowerCase().includes(e)):!0}function D({assistantId:e}){let[t,n]=(0,x.useState)(``),r=t.trim().toLowerCase(),a=i({queryKey:f({path:{assistant_id:e},query:{q:void 0}}),queryFn:async({signal:t})=>{let n=await d({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:T}),o=i({...p({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e,staleTime:T}),s=(0,x.useMemo)(()=>O(a.data?.plugins??[]),[a.data?.plugins]),c=(0,x.useMemo)(()=>new Set(s.map(e=>e.name)),[s]),l=(0,x.useMemo)(()=>s.filter(e=>E(r,e.name,e.description)),[s,r]),u=(0,x.useMemo)(()=>(o.data?.matches??[]).filter(e=>!c.has(e.name)&&E(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&&u.length===0;return(0,S.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[(0,S.jsx)(k,{search:t,onSearchChange:n,isSearching:m}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:[(0,S.jsx)(A,{title:`Installed`}),h?(0,S.jsx)(j,{}):a.isError?(0,S.jsx)(P,{}):_?(0,S.jsx)(M,{hasQuery:!!r}):(0,S.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.map(t=>(0,S.jsx)(`li`,{children:(0,S.jsx)(w,{plugin:t,assistantId:e})},t.id))}),(0,S.jsx)(`div`,{className:`mt-6`}),(0,S.jsx)(A,{title:`Available to install`}),g?(0,S.jsx)(j,{}):o.isError?(0,S.jsx)(F,{}):v?(0,S.jsx)(N,{hasQuery:!!r}):(0,S.jsx)(`ul`,{className:`flex flex-col gap-2`,children:u.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsx)(C,{match:e})},e.path))})]})]})}function O(e){return[...e].sort((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:`base`}))}function k({search:e,onSearchChange:t,isSearching:n}){return(0,S.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,S.jsx)(s,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search Plugins`,"aria-label":`Search Plugins`,leftIcon:(0,S.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:n?(0,S.jsx)(l,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`})})}function A({title:e}){return(0,S.jsx)(`h3`,{className:`mb-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e})}function j(){return(0,S.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,S.jsx)(l,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function M({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,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(r,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:t}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n})]})})}function N({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,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(g,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:t}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n})]})})}function P(){return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(u,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load plugins`}),(0,S.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 F(){return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(_,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Couldn't load catalog`}),(0,S.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 I(){let e=h.use.hasHydrated(),t=h.use.externalPlugins(),r=v();return e?t?(0,S.jsx)(D,{assistantId:r}):(0,S.jsx)(n,{to:m.identity,replace:!0}):null}export{I as PluginsPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./card-BibIM9x3.js";import{t as l}from"./input-Ch7OC6ME.js";import{c as u,f as d,o as f}from"./local-mode-Bg6wpc5q.js";import{t as p}from"./is-electron-CcgCla1v.js";import{n as m}from"./resolved-assistants-store-lkSgU__i.js";import{t as h}from"./chevron-left-BFX62ERI.js";import{t as g}from"./loader-circle-YAV9sMh_.js";import{t as _}from"./pencil-Cyrr5VNX.js";import{t as v}from"./x-b3o2p6YU.js";import{F as y,X as b,Y as x,a as S,n as C,o as w}from"./auth-store-Cc0c0sQk.js";import{t as T}from"./client.gen-DzaL5PKF.js";import{a as E}from"./routes-BLyehs4B.js";import{o as D,r as O}from"./prefs-BQY2Hl9H.js";import{t as k}from"./client-feature-flag-store-DjN8fxHA.js";import{b as ee,r as A,yt as te}from"./react-query.gen-CRARj4mG.js";import{t as j}from"./public-asset-CH9GPeL_.js";import{B as M,Ct as ne,Fi as N,H as re,V as P,_n as F,_t as I,c as ie,d as ae,dt as oe,ft as L,gn as se,gt as ce,l as le,mt as R,na as z,pt as B,s as ue,vn as de,wt as fe,yn as pe}from"./index-DhxGhfwI.js";import{c as me,i as he,n as V,o as ge,r as _e,s as ve,t as H}from"./step-indicator-dots-CE4dEV3k.js";import{n as ye,r as be}from"./prechat-names-CkLrL-Jh.js";var U=e(t(),1);async function xe(){try{let{data:e,response:t}=await T.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=s(),Se=[{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 Ce({onComplete:e}){function t(){le(),ue(),e()}return(0,W.jsx)(I,{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:Se.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)(z,{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)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var G=`google`,we=[{id:`gmail`,label:`Gmail`,logoSrc:j(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:j(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:j(`/images/integrations/google-drive.svg`)}];function Te({assistantId:e,assistantName:t,onConnect:r,onSkip:i,onBack:o}){let s=p(),c=a(),l=y(),u=(0,U.useRef)(null),d=(0,U.useRef)(null),f=(0,U.useRef)(null),m=(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)(()=>{d.current=null,S(!1)},[]),w=(0,U.useCallback)(()=>{_.current&&=(window.removeEventListener(`message`,_.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),T=(0,U.useCallback)(()=>{u.current&&!u.current.closed&&u.current.close(),u.current=null,f.current&&=(clearInterval(f.current),null),m.current&&=(clearTimeout(m.current),null)},[]),D=te();(0,U.useEffect)(()=>()=>{f.current&&clearInterval(f.current),m.current&&clearTimeout(m.current),u.current&&!u.current.closed&&u.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 e=>{try{return(await c.fetchQuery({...ee({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===G&&e.connected)??null}catch{return null}},[c]),k=(0,U.useCallback)(async()=>{let e=d.current?.platformAssistantId;T(),C(),r((e?await O(e):null)?.scopes_granted??[])},[C,T,O,r]),A=(0,U.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!d.current||e.requestId!==d.current.requestId||(e.oauthStatus===`connected`?k():(T(),C())))},[C,T,k]),j=(0,U.useCallback)(e=>{let t=d.current;if(!t)return;let n=oe(e,window.location.origin,t.requestId);n&&A(n)},[A]),M=(0,U.useCallback)(e=>{let t=d.current;if(!t)return;let n=L(e,t.requestId);n&&(A(n),window.localStorage.removeItem(R(t.requestId)))},[A]);ce((0,U.useCallback)(e=>{let t=d.current;t&&e.requestId===t.requestId&&A({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[A]));let N=(0,U.useCallback)(()=>{let t=crypto.randomUUID();if(w(),_.current=j,v.current=M,l){S(!0),(async()=>{let n;try{n=await re(e)}catch{C();return}d.current={requestId:t,platformAssistantId:n},D.mutate({path:{assistant_id:n,provider:G},body:{requested_scopes:[],redirect_after_connect:`${E.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){ne(e.connect_url)},onError(){C()}})})(),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),b.current&&b.current();let n=fe(()=>{let e=d.current;if(!e){n(),b.current=null;return}(async()=>{let t=await O(e.platformAssistantId);d.current&&(t?await k():C(),w(),n(),b.current=null)})()});b.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){w();return}u.current=n,S(!0),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),f.current=setInterval(()=>{u.current&&u.current.closed&&d.current&&!m.current&&(m.current=setTimeout(async()=>{m.current=null;let e=d.current;if(!e)return;let t=window.localStorage.getItem(R(e.requestId));if(t)try{let n=JSON.parse(t);if(B(n,e.requestId)){A(n),window.localStorage.removeItem(R(e.requestId)),w();return}}catch{}let n=await O(e.platformAssistantId);d.current&&(n?await k():(T(),C()),w())},1e3))},100),(async()=>{let n;try{n=await re(e)}catch{T(),C(),w();return}d.current={requestId:t,platformAssistantId:n},D.mutate({path:{assistant_id:n,provider:G},body:{requested_scopes:[],redirect_after_connect:`${E.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){u.current&&!u.current.closed?u.current.location.href=e.connect_url:d.current&&(T(),C(),w())},onError(){T(),C(),w()}})})()},[e,C,T,O,A,j,M,k,l,w,D]),P=t||`your assistant`,F=t||`Your assistant`;return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${s?`min-h-full px-8 pt-11 pb-8 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)(h,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${s?`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, ${P} 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:we.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:`${F} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,W.jsxs)(`div`,{className:`${s?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:N,disabled:x||D.isPending,className:`${s?`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)(g,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,disabled:x||D.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function Ee({userName:e,assistantName:t,selectedGroupId:r,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:u,onSkip:d}){let f=p();return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`min-h-full px-8 pt-11 pb-8 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)(h,{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=>a(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=>o(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:i.map(e=>{let n=e===t;return(0,W.jsx)(`button`,{type:`button`,onClick:()=>o(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:ye.map(e=>(0,W.jsx)(De,{group:e,isActive:r===e.id,onToggle:()=>s(r===e.id?null:e.id)},e.id))})]})]}),(0,W.jsxs)(`div`,{className:`${f?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,W.jsx)(n,{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:r,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:u,totalSteps:d}){return(0,W.jsx)(I,{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:[o?(0,W.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,W.jsx)(h,{}),onClick:o,"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=>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 w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var ke=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:j(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:j(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:j(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:j(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:j(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:j(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:j(`/images/prior-assistants/copilot.svg`)}];function Ae({selectedAssistants:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,U.useState)(()=>K(e)),[d,f]=(0,U.useState)(()=>s.length>0),m=(0,U.useRef)(q(e));(0,U.useEffect)(()=>{let t=q(e);if(t===m.current)return;let n=K(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,U.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}je(n,e)||(m.current=q(n),t(n))},[s]);let g=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},y=(0,U.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 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:r,"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)(h,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${o?`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:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`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:`${o?`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)(Me,{assistant:t,selected:e.has(t.id),onToggle:()=>g(t.id)},t.id)),d?null:(0,W.jsx)(Ne,{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)(_,{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)(v,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,W.jsx)(l,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple assistants with commas`,fullWidth:!0}),y.length>0?(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:y.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:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`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 K(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function q(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Me({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)(Pe,{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)(z,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Ne({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)(N,{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 Pe({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:r,onContinue:i,onSkip:a}){let o=p(),s=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 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:r,"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)(h,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${o?`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:`${o?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`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:`${o?`mt-6`:`mt-8`} flex w-full flex-col ${o?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:M.map(t=>{let n=P[t.iconKey],r=e.has(t.id);return(0,W.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${o?`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)(z,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,W.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`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:j(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:j(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:j(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:j(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:j(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:j(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:j(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:j(`/images/integrations/github.svg`),logoSrcDark:j(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:j(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:j(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:j(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:j(`/images/integrations/apple-notes.svg`)}];function J(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:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,U.useState)(()=>Y(e)),[d,f]=(0,U.useState)(()=>s.length>0),m=(0,U.useRef)(X(e));(0,U.useEffect)(()=>{let t=X(e);if(t===m.current)return;let n=Y(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,U.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}ze(n,e)||(m.current=X(n),t(n))},[s]);let g=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},y=(0,U.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full items-center ${r?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[r?(0,W.jsx)(`button`,{type:`button`,onClick:r,"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)(h,{className:`h-4 w-4`})}):null,(0,W.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),r?(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,W.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`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 ${o?`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)(Z,{tool:t,selected:e.has(t.id),onToggle:()=>g(t.id),electron:o},t.id)),d?null:(0,W.jsx)(Q,{onClick:()=>f(!0),electron:o})]}),d?(0,W.jsx)(c,{padding:o?`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 ${o?`gap-2`:`gap-3`}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(_,{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)(v,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,W.jsx)(l,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple tools with commas`,fullWidth:!0}),y.length>0?(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:y.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:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`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 Y(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function X(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Z({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)($,{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)(z,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Q({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)(N,{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 $({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 Be({selectedGroupId:e,onGroupChange:t,onBack:r,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,W.jsx)(I,{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)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,W.jsx)(h,{}),onClick:r,"aria-label":`Back`}),(0,W.jsx)(`div`,{className:`flex justify-center`,children:(0,W.jsx)(H,{current:o,total:s})}),(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:ye.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)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function Ve(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 He=[`gmail`,`google-calendar`,`google-drive`],Ue=`experiment-activation-flow-2026-06-03`,We=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ge(e,t,n){return t?.initialMessage?t.initialMessage:n?F(e):se}function Ke(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?[...He]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:J([...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=Ue,i.bootstrapTemplate=We);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),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=J([...e.selectedPriorAssistants])),i.initialMessage=Ge(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function qe(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Je(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 Ye(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Xe=`1`;function Ze(e){return e===`nativeVibe`||e===Xe?`nativeVibe`:null}function Qe(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function et(){let e=r(),t=y(),n=D()&&O();return(0,U.useEffect)(()=>{!n&&!t&&e(E.onboarding.privacy,{replace:!0})},[n,t,e]),t||n}function tt(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,U.useState)(()=>t?`nativeName`:`name`),a=(0,U.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,U.useLayoutEffect)(()=>{if(n)try{let e=Ze(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,U.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,U.useCallback)(()=>{a(null)},[a])}}var nt=3;function rt(){let e=u();return e?.cloud===`vellum`?e.assistantId:f()[0]?.assistantId??null}function it(){let e=r(),[t]=i(),n=t.get(`preview`)===`true`,a=C.use.user(),s=S(),c=w(),l=a?.id??null,u=a?.firstName??``,f=a?.lastName??``,p=y(),h=m.use.activeAssistantId(),g=d(),_=ae()&&!ie(),v=k.use.stringFlags().preChatOnboardingExperiment20260606??`control`,T=(k.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,D=k.use.selfIntroGreeting(),O=ge(v),ee=ve()??O,te=ee===_e.paredDown,j=g?rt():null,M=et(),{currentStep:ne,setCurrentStep:N,clearPersistedStep:re}=tt(l,p),P=C.use.platformSession(),F=b(P),[I,oe]=(0,U.useState)(()=>new Set),[L,se]=(0,U.useState)(()=>new Set),[ce,le]=(0,U.useState)(()=>new Set),{value:R,onChange:z}=Ve(g&&!F?``:u||f),[B,ue]=(0,U.useState)(null),[fe]=(0,U.useState)(()=>be()),[V,H]=(0,U.useState)(``),[ye,Se]=(0,U.useState)(!1),[G,we]=(0,U.useState)([]),{data:De}=o({...A(),enabled:!c&&s&&(!g||F)}),{data:ke,isLoading:je}=o({queryKey:[`onboarding-recipe`,l],queryFn:xe,enabled:!c&&s&&!p&&!g,staleTime:1/0}),K=ke??null,q=De?.id??h??j,Me=qe({localMode:g,platformSession:P,hasCachedPlatformAssistant:j!==null}),Ne=Me,Pe=Me,Le=async()=>{await x.checkAssistant(),e(`${E.assistant}?onboarding=1`,{replace:!0})};function J(e,t=ee){n||he(e,{userId:l,variant:me(t)})}let ze=[...I].some(e=>Ie.has(e)),Y=p?Ye():Je({paredDown:te,canOfferPriorAssistants:Pe,canOfferGoogleStep:n?!1:Ne,hasGoogleTool:ze,showIOSAppStep:_});function X(t){if(n){e(-1);return}pe(Ke({mode:p?`native`:te?`paredDown`:`control`,recipe:p?null:K,selectedTools:I,selectedTasks:L,selectedPriorAssistants:t?.selectedPriorAssistants??ce,tone:B??K?.tone??`grounded`,userName:R,assistantName:V,selfIntroGreetingEnabled:D,activationFlowEnabled:p?void 0:T,googleConnected:ye,googleScopes:G,connectedScopes:t?.connectedScopes}));let r=V.trim();r&&de(r),p?(re(),e(E.onboarding.privacy)):(x.markExpectingFirstMessage(),Le())}let Z=(e,t)=>{e.funnelStep&&J(e.funnelStep);let n=Qe(Y,e.id);n?N(n):X(t)},Q=e=>{let t=$e(Y,e.id);t&&N(t)};if(!M||je)return null;let $=Y.find(e=>e.id===ne)??Y[0];return $?$.id===`nativeName`?(0,W.jsx)(Oe,{userName:R,assistantName:V,displayedAssistantNames:fe,onUserNameChange:z,onAssistantNameChange:H,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:nt}):$.id===`nativeVibe`?(0,W.jsx)(Be,{selectedGroupId:B,onGroupChange:ue,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:nt}):$.id===`name`?(0,W.jsx)(Ee,{userName:R,assistantName:V,selectedGroupId:B,displayedAssistantNames:fe,onUserNameChange:z,onAssistantNameChange:H,onGroupChange:ue,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,W.jsx)(Fe,{selectedTasks:L,onChange:se,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,W.jsx)(Re,{selectedTools:I,onChange:oe,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,W.jsx)(Ae,{selectedAssistants:ce,onChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;le(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?q?(0,W.jsx)(Te,{assistantId:q,assistantName:V,onConnect:e=>{Se(!0),we(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,W.jsx)(Ce,{onComplete:()=>Z($)}):null:null}function at(){return(0,W.jsx)(it,{})}export{at as PreChatRoute};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{n as i}from"./device-settings-BBwtGKJb.js";import{t as a}from"./react-DJZBPgpf.js";import{g as o}from"./auth-store-6CnXVIAL.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.privacyConsent(),(0,s.useCallback)(e=>{o.getState().setPrivacyConsent(e)},[])]}function p(){return[o.use.analyticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setAnalyticsConsentCurrent(e)},[])]}function m(){return[o.use.diagnosticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setDiagnosticsConsentCurrent(e)},[])]}function h(){return o.getState().tosAccepted}function g(){return o.getState().privacyConsent}function _(){return o.getState().analyticsConsentCurrent}function v(){return o.getState().diagnosticsConsentCurrent}function y(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function b(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function x(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{y as a,m as c,u as d,d as f,b as i,f as l,v as n,h as o,x as p,g as r,p as s,_ as t,l as u};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{n as i}from"./device-settings-BBwtGKJb.js";import{t as a}from"./react-DJZBPgpf.js";import{g as o}from"./auth-store-Cc0c0sQk.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.privacyConsent(),(0,s.useCallback)(e=>{o.getState().setPrivacyConsent(e)},[])]}function p(){return[o.use.analyticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setAnalyticsConsentCurrent(e)},[])]}function m(){return[o.use.diagnosticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setDiagnosticsConsentCurrent(e)},[])]}function h(){return o.getState().tosAccepted}function g(){return o.getState().privacyConsent}function _(){return o.getState().analyticsConsentCurrent}function v(){return o.getState().diagnosticsConsentCurrent}function y(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function b(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function x(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{y as a,m as c,u as d,d as f,b as i,f as l,v as n,h as o,x as p,g as r,p as s,_ as t,l as u};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-BBwtGKJb.js";import{t as o}from"./react-DJZBPgpf.js";import{O as s,t as c}from"./button-D7s2Q_uG.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./useMutation-Lj4VunQV.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./cn-DvW5mxZR.js";import{t as m}from"./card-BibIM9x3.js";import{t as h}from"./dropdown-yOV5eJnU.js";import"./src-BJj2O5XB.js";import{t as g}from"./confirm-dialog-SpCsmAdG.js";import{t as _}from"./notice-CynJKEow.js";import{t as v}from"./tag-CE_o2aao.js";import{t as y}from"./input-Ch7OC6ME.js";import{t as b}from"./toggle-95p73HGd.js";import{n as x}from"./toast-CxaZ5f1d.js";import{t as S}from"./chevron-right-Cc3NZhAF.js";import{t as C}from"./loader-circle-YAV9sMh_.js";import{t as w}from"./pencil-Cyrr5VNX.js";import{t as T}from"./x-b3o2p6YU.js";import{n as E,r as D,t as O}from"./api-errors-C3sAdlZQ.js";import{A as k,D as A,E as ee,F as te,O as ne,T as re,h as j,j as ie,k as M,n as ae,r as oe}from"./auth-store-Cc0c0sQk.js";import{t as N}from"./client.gen-DzaL5PKF.js";import{t as se}from"./sdk.gen-0RzHFsEa.js";import{a as ce,i as le}from"./routes-BLyehs4B.js";import{t as ue}from"./assistant-feature-flag-store-BD9zTDcP.js";import{n as de,t as fe}from"./react-query.gen-CRARj4mG.js";import{Bt as pe,F as me,Hr as P,Jt as F,Kt as he,N as ge,Nr as _e,P as I,Qt as ve,Ur as ye,Xt as be,Zt as xe,g as Se,h as Ce,m as L,p as R,qt as we,ta as Te,x as Ee}from"./index-DhxGhfwI.js";import{t as z}from"./use-active-assistant-id-DTsVl8b7.js";import{t as B}from"./detail-card-QPVpO5cj.js";import{t as V}from"./setting-row-BHlMSre_.js";var H=e(o(),1),U=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],De=new Set([`platform`,`a2a`]),Oe=new Set([`vellum`,`whatsapp`]);function ke(e){return Oe.has(e)}var Ae={no_one:`No one (kill switch)`,guardian_only:`Guardian only`,trusted_contacts:`Trusted contacts`,any_contact:`Any contact`,strangers:`Strangers`},je={no_one:`Hard-deny every inbound message on this channel.`,guardian_only:`Only messages from the guardian are admitted.`,trusted_contacts:`Admit verified contacts and the guardian; deny everyone else.`,any_contact:`Admit any matched contact (verified or pending) and the guardian.`,strangers:`Admit everyone, including unrecognised senders.`};function Me(e){return typeof e==`string`&&U.includes(e)}function W(e){return De.has(e)}async function Ne(e){let{data:t,error:n,response:r}=await N.get({url:`/v1/assistants/{assistant_id}/channel-admission-policy/`,path:{assistant_id:e},throwOnError:!1});if(E(r,n,`Failed to load channel policies.`),!r.ok)throw new O(r.status,D(n,r,`Failed to load channel policies.`));return(t?.policies??[]).filter(e=>!W(e.channelType)&&!ke(e.channelType)).map(e=>({...e,policy:Me(e.policy)?e.policy:`trusted_contacts`}))}async function Pe(e,t,n,r){if(W(t))throw new O(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await N.put({url:`/v1/assistants/{assistant_id}/channel-admission-policy/{channel_type}`,path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},headers:{"Content-Type":`application/json`},throwOnError:!1});if(E(o,a,`Failed to save channel policy.`),!o.ok)throw new O(o.status,D(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new O(500,`Gateway returned no policy in response.`);return i.policy}var G=f(),Fe=U.map(e=>({value:e,label:Ae[e]}));function K(e){return{telegram:`Telegram`,phone:`Phone`,whatsapp:`WhatsApp`,slack:`Slack`,email:`Email`}[e]??e.charAt(0).toUpperCase()+e.slice(1)}function Ie(){let e=z(),[t,n]=(0,H.useState)(null),[r,i]=(0,H.useState)(!0),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(null),[l,u]=(0,H.useState)(null),d=(0,H.useCallback)(async()=>{i(!0),o(null);try{n(await Ne(e))}catch(e){o(e instanceof O?e.message:`Failed to load channel policies.`)}finally{i(!1)}},[e]);(0,H.useEffect)(()=>{d()},[d]);let f=(0,H.useCallback)(async(t,r)=>{c(t),o(null),n(e=>e&&e.map(e=>e.channelType===t?{...e,policy:r}:e));try{let i=await Pe(e,t,r);n(e=>e&&e.map(e=>e.channelType===t?i:e))}catch(e){o(e instanceof O?e.message:`Failed to save channel policy.`),await d()}finally{c(null)}},[e,d]),p=(0,H.useCallback)((e,t)=>{if(t===`no_one`){u({channelType:e,label:K(e)});return}f(e,t)},[f]),_=(0,H.useCallback)(()=>{if(!l)return;let{channelType:e}=l;u(null),f(e,`no_one`)},[l,f]),v=(0,H.useCallback)(()=>{u(null)},[]),y=(0,H.useMemo)(()=>t??[],[t]);return(0,G.jsxs)(m,{children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(ye,{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:`Channel Trust Floors`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Choose who can reach the assistant on each channel. Internal channels are managed automatically and not shown here.`})]})]}),a&&(0,G.jsx)(`div`,{role:`alert`,className:`mt-4 rounded-md border border-[var(--border-negative)] bg-[var(--surface-negative-subtle)] px-3 py-2 text-body-small-default text-[var(--content-negative)]`,children:a}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-3`,"data-testid":`channel-policy-list`,children:[r&&!t&&(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Loading…`}),!r&&y.length===0&&(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`No client-controllable channels found.`}),y.map(e=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,"data-testid":`channel-policy-row-${e.channelType}`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:K(e.channelType)}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:je[e.policy]})]}),(0,G.jsx)(`div`,{style:{minWidth:220},children:(0,G.jsx)(h,{value:e.policy,onChange:t=>p(e.channelType,t),options:Fe,disabled:s===e.channelType,"aria-label":`Floor for ${K(e.channelType)}`,"data-testid":`channel-policy-dropdown-${e.channelType}`})})]},e.channelType))]}),(0,G.jsx)(g,{open:l!==null,title:`Block all inbound messages?`,message:l?`Setting ${l.label} to "No one" will hard-deny every inbound message on this channel. You can reverse this at any time.`:``,confirmLabel:`Block all`,destructive:!0,onConfirm:_,onCancel:v})]})}var q=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],Le=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function Re(){let[e,t]=(0,H.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function ze(){let[e,r]=(0,H.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,H.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||pe(0)}]}function Be({row:e,onToggle:t}){return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(b,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,G.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,G.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Ve(){return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function He({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=ve(),{pendingKind:o,run:s}=Re(),[c,l]=ze(),u=(0,H.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of q){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,H.useMemo)(()=>{let e=q.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=Le.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await be(e.sourceKind):await xe(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,G.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,G.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,G.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,G.jsx)(Ve,{}),`Checking permissions...`]}):(0,G.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,G.jsx)(Be,{row:e,onToggle:p},e.id))}),r&&(0,G.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Ue(){let e=F({platformHostedOnly:!0}),t=he(),n=we(),r=l(),{data:i,isLoading:a,isError:o}=u({...fe(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await se({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{de(r,void 0,e),x.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{x.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow 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`&&o&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,G.jsxs)(G.Fragment,{children:[(s.isPending||c)&&(0,G.jsx)(C,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,G.jsx)(b,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,G.jsx)(Ee,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function We(){let e=te(),[t,n]=(0,H.useState)(()=>ne()),[r,i]=(0,H.useState)(!1),[a,o]=(0,H.useState)(`Face ID`),[s,c]=(0,H.useState)(!1);if((0,H.useEffect)(()=>{e&&(A().then(i),ee().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)M(!1),await re(),n(!1);else{let e=ie();e&&await k(e),M(!0),n(!0)}}finally{c(!1)}};return(0,G.jsx)(B,{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)(b,{checked:t,onChange:()=>void l(),disabled:s})]})})}function J(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=R.map(e=>({value:e.id,label:e.label,icon:(0,G.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function X(){let e=z(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>Ce(e),staleTime:3e4}),[i,a]=(0,H.useState)(`relaxed`),[o,s]=(0,H.useState)(`conservative`),[c,d]=(0,H.useState)(`strict`),[f,p]=(0,H.useState)(!1),g=(0,H.useRef)(!1),[_,v]=(0,H.useState)(!1),y=(0,H.useRef)(null),b=(0,H.useRef)(null);(0,H.useEffect)(()=>{!n||g.current||(a(L(n.interactive).id),s(L(n.autonomous).id),d(L(n.headless).id),v(!0))},[n]),(0,H.useEffect)(()=>()=>{y.current!==null&&(clearTimeout(y.current),y.current=null,b.current?.(),b.current=null)},[]);let x=(0,H.useCallback)((n,r,i)=>{if(!e||!_)return;let a=R.find(e=>e.id===n)?.riskThreshold,o=R.find(e=>e.id===r)?.riskThreshold,s=R.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||Se(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,_,t]),C=(0,H.useCallback)((e,t,n)=>{y.current!==null&&clearTimeout(y.current),b.current=()=>x(e,t,n),y.current=setTimeout(()=>{b.current?.(),y.current=null,b.current=null},500)},[x]),w=(0,H.useCallback)(e=>{g.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,H.useCallback)(e=>{g.current=!0,s(e),C(i,e,c)},[i,c,C]),E=(0,H.useCallback)(e=>{g.current=!0,d(e),C(i,o,e)},[i,o,C]),D=R.find(e=>e.id===i),O=R.find(e=>e.id===o),k=R.find(e=>e.id===c),A=!e||!_;return(0,G.jsxs)(m,{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)(h,{value:i,onChange:w,options:Y,disabled:A})}),D&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,G.jsx)(Te,{className:`h-4 w-4`}):(0,G.jsx)(S,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,G.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(h,{value:o,onChange:T,options:Y,disabled:A})}),O&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.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)(h,{value:c,onChange:E,options:Y,disabled:A})}),k&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]})]})]})]})]})}var Z=e(s(),1),Ge=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Ke=[{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 qe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,H.useRef)(null),[a,o]=(0,H.useState)(t.tool),[s,c]=(0,H.useState)(t.pattern),[l,u]=(0,H.useState)(t.risk),[d,f]=(0,H.useState)(t.description??``),[p,m]=(0,H.useState)(!1),[g,v]=(0,H.useState)(null),b=s.trim(),x=b.length>0&&!p,S=(0,H.useCallback)(async n=>{if(n.preventDefault(),!x)return;let i=d.trim()||`${a} — ${b}`;m(!0),v(null);try{await me(e,t.id,{risk:l,description:i}),r()}catch(e){v(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,x,d,t,r,l,a,b]);return(0,Z.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,H.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,H.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)(T,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:e=>void S(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[g&&(0,G.jsx)(_,{tone:`error`,children:g}),(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)(h,{value:a,onChange:o,disabled:!0,options:Ge.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(y,{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:Ke.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)(y,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(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:p?`Saving…`:`Save`})]})]})]})}),document.body)}function Je(e){return e.origin===`default`&&!e.userModified}function Ye(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 Xe(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ze({assistantId:e,onClose:t}){let n=(0,H.useRef)(null),[r,i]=(0,H.useState)([]),[a,o]=(0,H.useState)(!0),[s,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(!1),y=(0,H.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([I(e),I(e,{origin:`default`})]);return Ye(t,n)}return I(e)},[e]),x=(0,H.useCallback)(async()=>{o(!0);try{i(await y(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[y,m]);(0,H.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await y(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[y,m]);let S=(0,H.useCallback)(async()=>{if(f)try{await ge(e,f.id),x()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,x]);return(0,Z.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,H.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,H.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)(b,{checked:m,onChange:h,label:`Show all defaults`}),(0,G.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(_,{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=Je(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)(v,{tone:Xe(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,G.jsx)(v,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(v,{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)(w,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(_e,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,G.jsx)(qe,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),x()}}),(0,G.jsx)(g,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void S(),onCancel:()=>p(null)})]}),document.body)}function Qe(){let e=z(),[t,n]=(0,H.useState)(!1);return(0,G.jsxs)(m,{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)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,G.jsx)(Ze,{assistantId:e,onClose:()=>n(!1)})]})}var $e=[{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`}],et=`thirtyDays`;function $(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function tt(){let e=F({platformHostedOnly:!0}),t=ue.use.channelTrustFloors(),a=oe(),o=a,s=ae.use.user()?.id??null,[c,l]=(0,H.useState)(()=>n(`shareAnalytics`,!0)),[u,d]=(0,H.useState)(()=>n(`shareDiagnostics`,!0)),[f,p]=(0,H.useState)(()=>i(`llmLogRetention`,et));return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(We,{}),(0,G.jsx)(He,{}),(0,G.jsx)(Qe,{}),t&&(0,G.jsx)(Ie,{}),(0,G.jsx)(X,{}),(0,G.jsx)(B,{title:`Privacy`,subtitle:a?(0,G.jsxs)(G.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,G.jsx)(`a`,{href:le(ce.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:c,onChange:()=>{let e=!c;l(e),j(`share_analytics`,e,{userId:s,hasPlatformSession:a})},variant:`toggle-trailing`}),(0,G.jsx)($,{}),(0,G.jsx)(V,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:u,onChange:()=>{let e=!u;d(e),j(`share_diagnostics`,e,{userId:s,hasPlatformSession:a})},variant:`toggle-trailing`}),(0,G.jsx)($,{})]}),(0,G.jsx)(Ue,{}),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)(h,{value:f,onChange:e=>{p(e),r(`llmLogRetention`,e)},options:$e})}),(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{tt as PrivacyPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-CcgCla1v.js";import{F as s,i as c,m as l,n as u}from"./auth-store-6CnXVIAL.js";import{a as d}from"./routes-BLyehs4B.js";import{d as f,f as p,l as m,u as h}from"./prefs-CrgkSe-_.js";import{t as g}from"./client-feature-flag-store-DjN8fxHA.js";import{_t as _}from"./index-Chr1kHBM.js";import{a as v,c as y,i as b,n as x,o as S,t as C}from"./step-indicator-dots-JQQwRvNU.js";import{n as w,t as T}from"./consent-controls-Bk8etO5C.js";var E=e(t(),1),D=a();function O(){let e=r(),[t]=i(),a=u.use.user()?.id??null,O=o(),k=s(),A=S(g.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[j,M]=h(),[N,P]=f(),[F,I]=p(),[L,R]=m(),z=c();(0,E.useEffect)(()=>{k||v()},[k]);let B=t.get(`preview`)===`true`,V=(0,E.useCallback)(e=>{},[]),H=B?V:M,U=B?V:P,W=B?V:I,G=B?V:R,K=(0,E.useCallback)(()=>{if(B){e(`${d.onboarding.prechat}?preview=true`);return}if(l({userId:a,tos:F,privacy:L,shareAnalytics:j,shareDiagnostics:N,hasPlatformSession:z}),!k){let e=y(A);b(x.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${d.onboarding.hatching}${i?`?${i}`:``}`)},[L,z,k,B,e,A,t,j,N,F,a]);return(0,D.jsx)(_,{children:(0,D.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${O?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[k&&(0,D.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,D.jsx)(C,{current:2,total:3})}),(0,D.jsx)(`h1`,{className:O?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,D.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${O?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,D.jsx)(w,{electron:O,shareAnalytics:j,shareDiagnostics:N,onShareAnalyticsChange:H,onShareDiagnosticsChange:U,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,D.jsx)(T,{electron:O,privacyConsent:L,tosAccepted:F,onPrivacyChange:G,onTosChange:W,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,D.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${O?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,D.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!F||!L,onClick:K,className:O?void 0:`h-11 text-base`,children:`Start`}),(0,D.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:O?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{O as PrivacyScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-CcgCla1v.js";import{F as s,i as c,m as l,n as u}from"./auth-store-Cc0c0sQk.js";import{a as d}from"./routes-BLyehs4B.js";import{d as f,f as p,l as m,u as h}from"./prefs-BQY2Hl9H.js";import{t as g}from"./client-feature-flag-store-DjN8fxHA.js";import{_t as _}from"./index-DhxGhfwI.js";import{a as v,c as y,i as b,n as x,o as S,t as C}from"./step-indicator-dots-CE4dEV3k.js";import{n as w,t as T}from"./consent-controls-Bk8etO5C.js";var E=e(t(),1),D=a();function O(){let e=r(),[t]=i(),a=u.use.user()?.id??null,O=o(),k=s(),A=S(g.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[j,M]=h(),[N,P]=f(),[F,I]=p(),[L,R]=m(),z=c();(0,E.useEffect)(()=>{k||v()},[k]);let B=t.get(`preview`)===`true`,V=(0,E.useCallback)(e=>{},[]),H=B?V:M,U=B?V:P,W=B?V:I,G=B?V:R,K=(0,E.useCallback)(()=>{if(B){e(`${d.onboarding.prechat}?preview=true`);return}if(l({userId:a,tos:F,privacy:L,shareAnalytics:j,shareDiagnostics:N,hasPlatformSession:z}),!k){let e=y(A);b(x.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${d.onboarding.hatching}${i?`?${i}`:``}`)},[L,z,k,B,e,A,t,j,N,F,a]);return(0,D.jsx)(_,{children:(0,D.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${O?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[k&&(0,D.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,D.jsx)(C,{current:2,total:3})}),(0,D.jsx)(`h1`,{className:O?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,D.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${O?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,D.jsx)(w,{electron:O,shareAnalytics:j,shareDiagnostics:N,onShareAnalyticsChange:H,onShareDiagnosticsChange:U,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,D.jsx)(T,{electron:O,privacyConsent:L,tosAccepted:F,onPrivacyChange:G,onTosChange:W,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,D.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${O?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,D.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!F||!L,onClick:K,className:O?void 0:`h-11 text-base`,children:`Start`}),(0,D.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:O?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{O as PrivacyScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CN7ObyIk.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{S as s,f as c}from"./local-mode-Bg6wpc5q.js";import{R as l,U as u,l as d,n as f}from"./auth-store-6CnXVIAL.js";import{c as p}from"./api-kMnfZUPa.js";import{a as m}from"./routes-BLyehs4B.js";import{a as h,i as g}from"./login-flow-sr2DI9LC.js";import{n as _}from"./index-Chr1kHBM.js";import{r as v,t as y}from"./account-shell-BBL0HqTX.js";var b=e(n(),1),x=o();function S(){let[e]=i(),n=r(),o=f.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let t=await u(),r=l(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),c())try{let e=await p();if(e.ok&&e.data.length>0&&(await s(e.data,d.getState().currentOrganizationId??void 0),!E)){n(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:r}=h({returnTo:E,fallback:e,authIntent:D});r?window.location.href=t:n(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);n(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(r.message);break}}catch(e){t(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,o,E,n,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,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-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(a,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(a,{to:m.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-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S as ProviderCallbackPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CN7ObyIk.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{S as s,f as c}from"./local-mode-Bg6wpc5q.js";import{R as l,U as u,l as d,n as f}from"./auth-store-Cc0c0sQk.js";import{c as p}from"./api-kMnfZUPa.js";import{a as m}from"./routes-BLyehs4B.js";import{a as h,i as g}from"./login-flow-CzPVmpoB.js";import{n as _}from"./index-DhxGhfwI.js";import{r as v,t as y}from"./account-shell-BBL0HqTX.js";var b=e(n(),1),x=o();function S(){let[e]=i(),n=r(),o=f.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let t=await u(),r=l(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),c())try{let e=await p();if(e.ok&&e.data.length>0&&(await s(e.data,d.getState().currentOrganizationId??void 0),!E)){n(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:r}=h({returnTo:E,fallback:e,authIntent:D});r?window.location.href=t:n(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);n(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(r.message);break}}catch(e){t(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,o,E,n,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,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-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(a,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(a,{to:m.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-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S 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{G as o,H as s,W as c,n as l}from"./auth-store-6CnXVIAL.js";import{a as u}from"./routes-BLyehs4B.js";import{a as d,o as f}from"./login-flow-sr2DI9LC.js";import{i as p,n as m,r as h,t as g}from"./account-shell-BBL0HqTX.js";import{t as _}from"./signup-shell-CEJE1QSw.js";var v=e(t(),1),y=a();function b(){let e=n(),[t]=r(),a=l.use.refreshSession(),b=t.get(`returnTo`),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!0),L=(0,v.useRef)(!1);(0,v.useEffect)(()=>{L.current||(L.current=!0,(async()=>{try{let t=await s();if(!t.ok){e(u.account.login,{replace:!0});return}S(t.data.user.email??``),w(t.data.user.username??``),E(t.data.user.first_name??``),O(t.data.user.last_name??``),I(!1)}catch{e(u.account.login,{replace:!0})}})())},[e]);let R=async()=>{let t=await o({email:x,username:C});if(!t.ok){if(c(t)){await a();let t=f(b,u.account.root);t.requiresFullPageNavigation?window.location.href=t.destination:e(t.destination);return}M(t.errors[0]?.message??`Failed to complete signup.`);return}await a();let n=d({returnTo:b,fallback:u.account.root,authIntent:`signup`});n.requiresFullPageNavigation?window.location.href=n.destination:e(n.destination)},z=async e=>{e.preventDefault(),M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}},B=async e=>{if(e.preventDefault(),k.trim()){M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}}};if(F)return(0,y.jsx)(g,{children:(0,y.jsx)(h,{title:`Completing signup...`,subtitle:`Please wait while we load your information.`})});if(x&&C){let e=k.trim().length>0&&!N;return(0,y.jsx)(_,{children:(0,y.jsxs)(`form`,{onSubmit:B,className:`signup-details__thread`,children:[(0,y.jsxs)(`h2`,{className:`signup-details__heading`,children:[`Almost there,`,(0,y.jsx)(`br`,{}),`one more detail`]}),j&&(0,y.jsx)(`p`,{className:`signup-details__error`,children:j}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`What should I call you? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`First name`,value:T,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`And your last name? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`Last name`,value:D,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`Your role `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,autoComplete:`organization-title`,placeholder:`e.g. Software Engineer`,value:k,onChange:e=>A(e.target.value),autoFocus:!0})]}),(0,y.jsx)(`div`,{className:`signup-details__step`,children:(0,y.jsx)(`button`,{type:`submit`,className:`signup-details__continue`,disabled:!e,children:N?`Setting up…`:`Continue →`})})]})})}return(0,y.jsxs)(g,{children:[(0,y.jsx)(h,{title:`Complete your account`,subtitle:`We need a few more details to finish setting up your account.`}),(0,y.jsxs)(m,{onSubmit:z,error:j,submitLabel:`Complete signup`,submittingLabel:`Completing...`,isSubmitting:N,footer:(0,y.jsx)(i,{to:u.account.login,className:`text-sm text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:`← Back to sign in`}),children:[(0,y.jsx)(p,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`Email`,value:x,onChange:e=>S(e.target.value),required:!0}),(0,y.jsx)(p,{id:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:C,onChange:e=>w(e.target.value),required:!0})]})]})}export{b as ProviderSignupPage};
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{G as o,H as s,W as c,n as l}from"./auth-store-Cc0c0sQk.js";import{a as u}from"./routes-BLyehs4B.js";import{a as d,o as f}from"./login-flow-CzPVmpoB.js";import{i as p,n as m,r as h,t as g}from"./account-shell-BBL0HqTX.js";import{t as _}from"./signup-shell-CEJE1QSw.js";var v=e(t(),1),y=a();function b(){let e=n(),[t]=r(),a=l.use.refreshSession(),b=t.get(`returnTo`),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!0),L=(0,v.useRef)(!1);(0,v.useEffect)(()=>{L.current||(L.current=!0,(async()=>{try{let t=await s();if(!t.ok){e(u.account.login,{replace:!0});return}S(t.data.user.email??``),w(t.data.user.username??``),E(t.data.user.first_name??``),O(t.data.user.last_name??``),I(!1)}catch{e(u.account.login,{replace:!0})}})())},[e]);let R=async()=>{let t=await o({email:x,username:C});if(!t.ok){if(c(t)){await a();let t=f(b,u.account.root);t.requiresFullPageNavigation?window.location.href=t.destination:e(t.destination);return}M(t.errors[0]?.message??`Failed to complete signup.`);return}await a();let n=d({returnTo:b,fallback:u.account.root,authIntent:`signup`});n.requiresFullPageNavigation?window.location.href=n.destination:e(n.destination)},z=async e=>{e.preventDefault(),M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}},B=async e=>{if(e.preventDefault(),k.trim()){M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}}};if(F)return(0,y.jsx)(g,{children:(0,y.jsx)(h,{title:`Completing signup...`,subtitle:`Please wait while we load your information.`})});if(x&&C){let e=k.trim().length>0&&!N;return(0,y.jsx)(_,{children:(0,y.jsxs)(`form`,{onSubmit:B,className:`signup-details__thread`,children:[(0,y.jsxs)(`h2`,{className:`signup-details__heading`,children:[`Almost there,`,(0,y.jsx)(`br`,{}),`one more detail`]}),j&&(0,y.jsx)(`p`,{className:`signup-details__error`,children:j}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`What should I call you? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`First name`,value:T,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`And your last name? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`Last name`,value:D,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`Your role `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,autoComplete:`organization-title`,placeholder:`e.g. Software Engineer`,value:k,onChange:e=>A(e.target.value),autoFocus:!0})]}),(0,y.jsx)(`div`,{className:`signup-details__step`,children:(0,y.jsx)(`button`,{type:`submit`,className:`signup-details__continue`,disabled:!e,children:N?`Setting up…`:`Continue →`})})]})})}return(0,y.jsxs)(g,{children:[(0,y.jsx)(h,{title:`Complete your account`,subtitle:`We need a few more details to finish setting up your account.`}),(0,y.jsxs)(m,{onSubmit:z,error:j,submitLabel:`Complete signup`,submittingLabel:`Completing...`,isSubmitting:N,footer:(0,y.jsx)(i,{to:u.account.login,className:`text-sm text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:`← Back to sign in`}),children:[(0,y.jsx)(p,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`Email`,value:x,onChange:e=>S(e.target.value),required:!0}),(0,y.jsx)(p,{id:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:C,onChange:e=>w(e.target.value),required:!0})]})]})}export{b as ProviderSignupPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-BLyehs4B.js";import{t as s}from"./client-feature-flag-store-DjN8fxHA.js";import{t as c}from"./conversation-store-I2d3A6Tv.js";import{t as l}from"./conversation-selection-CrdMTnwx.js";import{yt as u}from"./index-Chr1kHBM.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[{suggestion:`I'll summarize this week's AI model releases for you`,prompt:`Summarize this week's AI model releases for me.`},{suggestion:`I'll draft a technical blog post from your latest notes`,prompt:`Draft a technical blog post from my latest notes.`},{suggestion:`I'll build you a tracker for competitor product launches`,prompt:`Build me a tracker for competitor product launches.`},{suggestion:`I'll analyze a CSV of metrics and surface the trends`,prompt:`Analyze a CSV of metrics for me and surface the trends.`}];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),y=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:y,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showSuggestions:!0,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-BLyehs4B.js";import{t as s}from"./client-feature-flag-store-DjN8fxHA.js";import{t as c}from"./conversation-store-I2d3A6Tv.js";import{t as l}from"./conversation-selection-CrdMTnwx.js";import{yt as u}from"./index-DhxGhfwI.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[{suggestion:`I'll summarize this week's AI model releases for you`,prompt:`Summarize this week's AI model releases for me.`},{suggestion:`I'll draft a technical blog post from your latest notes`,prompt:`Draft a technical blog post from my latest notes.`},{suggestion:`I'll build you a tracker for competitor product launches`,prompt:`Build me a tracker for competitor product launches.`},{suggestion:`I'll analyze a CSV of metrics and surface the trends`,prompt:`Analyze a CSV of metrics for me and surface the trends.`}];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),y=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:y,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showSuggestions:!0,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};