@vellumai/web 0.10.8-dev.202607130516.157ae8a → 0.10.8-dev.202607131107.073396f

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 (85) hide show
  1. package/dist/assets/{account-page-UU87NTst.js → account-page-B67xFKjm.js} +1 -1
  2. package/dist/assets/{acp-run-detail-panel-DVigkJ3N.js → acp-run-detail-panel-BEnETelW.js} +1 -1
  3. package/dist/assets/{activity-steps-panel-U_gKoMYV.js → activity-steps-panel-DMsLr2uV.js} +1 -1
  4. package/dist/assets/advanced-page-Bvn9JSkD.js +1 -0
  5. package/dist/assets/{ai-page-Dc6ZkcRu.js → ai-page-0BJ8t9t5.js} +1 -1
  6. package/dist/assets/{api-key-screen-CgLh1AgF.js → api-key-screen-JmzpzkXU.js} +1 -1
  7. package/dist/assets/{archive-page-8kZtqi4J.js → archive-page-BOTTpmhV.js} +1 -1
  8. package/dist/assets/{background-task-detail-panel-987qMmXb.js → background-task-detail-panel-D1R5Gt1o.js} +1 -1
  9. package/dist/assets/{billing-page-CVEGF4xu.js → billing-page-BTZrOF6Z.js} +1 -1
  10. package/dist/assets/{bookmarks-page-BsaqP8bd.js → bookmarks-page-Bnyq2PrZ.js} +1 -1
  11. package/dist/assets/{channels-page-route-BITEvtWC.js → channels-page-route-B4I54Hlh.js} +1 -1
  12. package/dist/assets/{command-palette-BRG7p3d3.js → command-palette-C-0sQNrv.js} +1 -1
  13. package/dist/assets/{command-palette-window-page-CCuDQ8yT.js → command-palette-window-page-DrUa3Q2F.js} +1 -1
  14. package/dist/assets/{community-page-B7zbsnWc.js → community-page-CgAJFZNK.js} +1 -1
  15. package/dist/assets/{contacts-page-route-DfDgxRhr.js → contacts-page-route-CWbVfl5E.js} +1 -1
  16. package/dist/assets/{credentials-page-6OzHjgOl.js → credentials-page-pxVj-Uhn.js} +1 -1
  17. package/dist/assets/{debug-page-DjVLqSsP.js → debug-page-DzEi2hun.js} +1 -1
  18. package/dist/assets/{deploy-dialogs-BuaLNuIF.js → deploy-dialogs-BN6e216c.js} +1 -1
  19. package/dist/assets/{detail-panel-stop-button-B_gN09QB.js → detail-panel-stop-button-DvrlIwGa.js} +1 -1
  20. package/dist/assets/{developer-page-CtbAjQ01.js → developer-page-DtzoMLif.js} +1 -1
  21. package/dist/assets/{devices-page-CzrEId9_.js → devices-page-BziUD9Iq.js} +1 -1
  22. package/dist/assets/{dictation-overlay-page-MgsYi7qB.js → dictation-overlay-page-DGQtwqBJ.js} +1 -1
  23. package/dist/assets/{document-viewer-page-lipFhePS.js → document-viewer-page-DzVnrcGq.js} +1 -1
  24. package/dist/assets/{earn-credits-modal-BZv8KPY_.js → earn-credits-modal-DL7lfK6t.js} +1 -1
  25. package/dist/assets/{emails-page-DziOOHlk.js → emails-page-D8GSgBLY.js} +1 -1
  26. package/dist/assets/{general-page-DtuPOASz.js → general-page-CiWyAF5P.js} +1 -1
  27. package/dist/assets/{hatching-screen-D0Agbpdq.js → hatching-screen-ailefwrE.js} +1 -1
  28. package/dist/assets/{home-page-route-DY1AJULD.js → home-page-route-CylhN3gG.js} +1 -1
  29. package/dist/assets/{hosting-screen-CrIrr7mq.js → hosting-screen-YMMLNHga.js} +1 -1
  30. package/dist/assets/{identity-page-route-D0EaKgXT.js → identity-page-route-PSzRLEe-.js} +1 -1
  31. package/dist/assets/{index-RjTgjtTV.js → index-DZAcojtQ.js} +7 -7
  32. package/dist/assets/{inspect-page-D-S9Ra2c.js → inspect-page-g6y4i5zi.js} +1 -1
  33. package/dist/assets/{integrations-page-C2trjkg8.js → integrations-page-Du0F3Ua7.js} +1 -1
  34. package/dist/assets/{intelligence-layout-BHgcBpNy.js → intelligence-layout-Bba5MZF7.js} +1 -1
  35. package/dist/assets/{keyboard-shortcuts-page-CM9iWfga.js → keyboard-shortcuts-page-CTb_Vety.js} +1 -1
  36. package/dist/assets/{library-detail-page-BrPf4P72.js → library-detail-page-CKGG9pVO.js} +1 -1
  37. package/dist/assets/{library-page-D98-vEZ0.js → library-page-Fq7jxL5c.js} +1 -1
  38. package/dist/assets/{logout-page-DwRkr0Ll.js → logout-page-4N_BNkhc.js} +1 -1
  39. package/dist/assets/{logs-layout-C-lBgxOg.js → logs-layout-C4N_HD_G.js} +1 -1
  40. package/dist/assets/{memory-router-playground-page-CA8Z85_u.js → memory-router-playground-page-BG1rEtqt.js} +1 -1
  41. package/dist/assets/{mobile-sidebar-drawer-5UcOVnnQ.js → mobile-sidebar-drawer-pUdMI0nM.js} +1 -1
  42. package/dist/assets/{notifications-page-COYD_xli.js → notifications-page-DXEZUbks.js} +1 -1
  43. package/dist/assets/{oauth-complete-page-BnpquKqe.js → oauth-complete-page-CqHxojfu.js} +1 -1
  44. package/dist/assets/{oauth-popup-complete-page-ZrRK9-cQ.js → oauth-popup-complete-page-2I2d9rcr.js} +1 -1
  45. package/dist/assets/{pairing-page-DLM_4IgB.js → pairing-page-WAsvnehl.js} +1 -1
  46. package/dist/assets/{plugins-page-D-p7zFRr.js → plugins-page-4teaAuVM.js} +1 -1
  47. package/dist/assets/{prechat-route-CWKxgYYD.js → prechat-route-HxZdIW5I.js} +1 -1
  48. package/dist/assets/{privacy-page-D8fMhz6c.js → privacy-page-BCzzz-IJ.js} +1 -1
  49. package/dist/assets/{privacy-screen-Byw47xQ6.js → privacy-screen-CCLy3Ir_.js} +1 -1
  50. package/dist/assets/{provider-callback-page-jipvOSTr.js → provider-callback-page-Du2X2TQs.js} +1 -1
  51. package/dist/assets/{quick-input-page-BazYwlo9.js → quick-input-page-CTBO1nKc.js} +1 -1
  52. package/dist/assets/{research-mock-page-BWoKWBPA.js → research-mock-page-BOec_5uX.js} +1 -1
  53. package/dist/assets/{research-onboarding-route-CcCRJt6_.js → research-onboarding-route-D3xtPwAg.js} +1 -1
  54. package/dist/assets/{review-terms-screen-CbLdPZfl.js → review-terms-screen--rmGv19B.js} +1 -1
  55. package/dist/assets/{security-page-ZEB54DPw.js → security-page-D90hoGUL.js} +1 -1
  56. package/dist/assets/{select-assistant-screen-CHKkEZUx.js → select-assistant-screen-CeLqmAZq.js} +1 -1
  57. package/dist/assets/{settings-layout-uK-Lpqba.js → settings-layout-C3gSCos2.js} +1 -1
  58. package/dist/assets/{share-feedback-modal-DG2r1qqN.js → share-feedback-modal-B6IobSaG.js} +1 -1
  59. package/dist/assets/{sidebar-tree-DDUEsAa4.js → sidebar-tree-BZf-fXXQ.js} +1 -1
  60. package/dist/assets/{signup-page-CVz_aWrx.js → signup-page-D0ttNeK8.js} +1 -1
  61. package/dist/assets/{skill-detail-page-CFU0jrZM.js → skill-detail-page-BwGLZ6Ir.js} +1 -1
  62. package/dist/assets/{skill-detail-panel-I2VWbqAo.js → skill-detail-panel-BuEo14Fm.js} +1 -1
  63. package/dist/assets/{skills-page-C3PhHEgJ.js → skills-page-CilXonLL.js} +1 -1
  64. package/dist/assets/{sounds-page-DgYrB7pS.js → sounds-page-Cj5HBP8M.js} +1 -1
  65. package/dist/assets/{subagent-detail-panel-Bw63q_Dd.js → subagent-detail-panel-B8sWapcO.js} +1 -1
  66. package/dist/assets/{system-events-page-LYtpCXvB.js → system-events-page-_-6CuelL.js} +1 -1
  67. package/dist/assets/{theme-stage-page-Dk-HbOXU.js → theme-stage-page-BQXyG45_.js} +1 -1
  68. package/dist/assets/{tiptap-document-editor-BaW3QmDp.js → tiptap-document-editor-BQB6DhNb.js} +1 -1
  69. package/dist/assets/{tool-detail-panel-CCQlm9BO.js → tool-detail-panel-BdvoDAc2.js} +1 -1
  70. package/dist/assets/{upgrade-cancel-page-BZNW20Qh.js → upgrade-cancel-page-D6AO1Dz2.js} +1 -1
  71. package/dist/assets/{upgrade-success-page-Ctct25DK.js → upgrade-success-page-BnoD0JID.js} +1 -1
  72. package/dist/assets/{usage-page-DmIP57yv.js → usage-page-CLW0y6Sj.js} +1 -1
  73. package/dist/assets/{use-edge-swipe-back-BYWAzQmV.js → use-edge-swipe-back-DYSaS9WM.js} +1 -1
  74. package/dist/assets/{use-invite-link-dialog-BtmP79fG.js → use-invite-link-dialog-Cfjjavpg.js} +1 -1
  75. package/dist/assets/{use-skill-actions-BPNpVrzC.js → use-skill-actions-CYhk4mEs.js} +1 -1
  76. package/dist/assets/{use-skill-categories-BO2u03Xu.js → use-skill-categories-veSnULDv.js} +1 -1
  77. package/dist/assets/{use-skill-detail-files-iXFvM76E.js → use-skill-detail-files-DROqozrr.js} +1 -1
  78. package/dist/assets/{voice-page-D9-Pw5kg.js → voice-page-Dz_Gph0z.js} +1 -1
  79. package/dist/assets/{weather-forecast-display-IOKkzlZQ.js → weather-forecast-display-DxWFsOIg.js} +1 -1
  80. package/dist/assets/{welcome-screen-B9bJeuZV.js → welcome-screen-BOEMLIps.js} +1 -1
  81. package/dist/assets/{workflow-detail-panel-DOS1dpe8.js → workflow-detail-panel-B-53KW59.js} +1 -1
  82. package/dist/assets/{workspace-page-NtATtw_E.js → workspace-page-B2N85fT0.js} +1 -1
  83. package/dist/index.html +1 -1
  84. package/package.json +1 -1
  85. package/dist/assets/advanced-page-h6aomSQb.js +0 -1
@@ -1 +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{F as s,t as c}from"./button-amTXFI-2.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-C36Yvcac.js";import{t as m}from"./card-Bv5O5juh.js";import{t as h}from"./chevron-down-qD-re7AW.js";import{t as g}from"./chevron-right-DqqmezXC.js";import{t as _}from"./loader-circle-Cz7opInR.js";import{t as v}from"./pencil-CUIr0IFo.js";import{t as y}from"./x-CkSVp1Ok.js";import{t as b}from"./notice-DkcNAP8O.js";import{t as x}from"./tag-CV4v7fRF.js";import{t as S}from"./input-CoUmPnRU.js";import{t as C}from"./toggle-CDfguvUz.js";import{n as w}from"./toast-xTp-xwYL.js";import{t as T}from"./confirm-dialog-CSkhRFRk.js";import{t as E}from"./dropdown-ByHOpeOU.js";import{f as D,n as O,r as k}from"./auth-store-CahendZw.js";import{t as A}from"./sdk.gen-CmKfVpgB.js";import{c as j,i as ee,m as te,n as M,o as N,r as ne,s as re,t as ie}from"./native-biometric-Dy5Vb7o0.js";import{c as ae,s as oe}from"./routes-DYcJgn9k.js";import{n as se,t as P}from"./react-query.gen-GVQbBTEp.js";import{An as F,B as ce,D as le,Di as I,H as ue,Hr as de,In as fe,Ln as pe,Rn as L,S as R,Ur as z,V as B,Vr as me,b as V,vi as he,x as ge,y as H}from"./index-RjTgjtTV.js";import{t as U}from"./use-active-assistant-id-CGeH4Gl6.js";import{t as W}from"./detail-card-GPqFZVmX.js";import{t as G}from"./setting-row-imtQqr9o.js";var K=e(o(),1),q=f(),J=[{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.`}],_e=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ve(){let[e,t]=(0,K.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function ye(){let[e,r]=(0,K.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,K.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||F(0)}]}function be({row:e,onToggle:t}){return(0,q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,q.jsx)(C,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.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,q.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,q.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function xe(){return(0,q.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 Se({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=L(),{pendingKind:o,run:s}=ve(),[c,l]=ye(),u=(0,K.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of J){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,K.useMemo)(()=>{let e=J.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=_e.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 fe(e.sourceKind):await pe(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,q.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,q.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,q.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,q.jsx)(xe,{}),`Checking permissions...`]}):(0,q.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,q.jsx)(be,{row:e,onToggle:p},e.id))}),r&&(0,q.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 Ce(){let e=z({platformHostedOnly:!0}),t=me(),n=de(),r=l(),{data:i,isLoading:a,isError:o}=u({...P(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await A({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{se(r,void 0,e),w.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{w.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,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,q.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,q.jsxs)(q.Fragment,{children:[(s.isPending||c)&&(0,q.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,q.jsx)(C,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,q.jsx)(le,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function we(){let e=te(),[t,n]=(0,K.useState)(()=>ee()),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(`Face ID`),[s,c]=(0,K.useState)(!1);if((0,K.useEffect)(()=>{e&&(ne().then(i),M().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)N(!1),await ie(),n(!1);else{let e=j();e&&await re(e),N(!0),n(!0)}}finally{c(!1)}};return(0,q.jsx)(W,{title:`Security`,children:(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,q.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,q.jsx)(C,{checked:t,onChange:()=>void l(),disabled:s})]})})}function Y(){return(0,q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var X=H.map(e=>({value:e.id,label:e.label,icon:(0,q.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Te(){let e=U(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>ge(e),staleTime:3e4}),[i,a]=(0,K.useState)(`relaxed`),[o,s]=(0,K.useState)(`conservative`),[c,d]=(0,K.useState)(`strict`),[f,p]=(0,K.useState)(!1),_=(0,K.useRef)(!1),[v,y]=(0,K.useState)(!1),b=(0,K.useRef)(null),x=(0,K.useRef)(null);(0,K.useEffect)(()=>{!n||_.current||(a(V(n.interactive).id),s(V(n.autonomous).id),d(V(n.headless).id),y(!0))},[n]),(0,K.useEffect)(()=>()=>{b.current!==null&&(clearTimeout(b.current),b.current=null,x.current?.(),x.current=null)},[]);let S=(0,K.useCallback)((n,r,i)=>{if(!e||!v)return;let a=H.find(e=>e.id===n)?.riskThreshold,o=H.find(e=>e.id===r)?.riskThreshold,s=H.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||R(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,v,t]),C=(0,K.useCallback)((e,t,n)=>{b.current!==null&&clearTimeout(b.current),x.current=()=>S(e,t,n),b.current=setTimeout(()=>{x.current?.(),b.current=null,x.current=null},500)},[S]),w=(0,K.useCallback)(e=>{_.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,K.useCallback)(e=>{_.current=!0,s(e),C(i,e,c)},[i,c,C]),D=(0,K.useCallback)(e=>{_.current=!0,d(e),C(i,o,e)},[i,o,C]),O=H.find(e=>e.id===i),k=H.find(e=>e.id===o),A=H.find(e=>e.id===c),j=!e||!v;return(0,q.jsxs)(m,{children:[(0,q.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,q.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 access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,q.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,q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(E,{value:i,onChange:w,options:X,disabled:j})}),O&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,q.jsx)(Y,{}),(0,q.jsxs)(`div`,{children:[(0,q.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,q.jsx)(h,{className:`h-4 w-4`}):(0,q.jsx)(g,{className:`h-4 w-4`}),(0,q.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,q.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,q.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,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(E,{value:o,onChange:T,options:X,disabled:j})}),k&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]}),(0,q.jsx)(Y,{}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(E,{value:c,onChange:D,options:X,disabled:j})}),A&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:A.description})]})]})]})]})]})}var Z=e(s(),1),Ee=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],De=[{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 Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,K.useRef)(null),[a,o]=(0,K.useState)(t.tool),[s,c]=(0,K.useState)(t.pattern),[l,u]=(0,K.useState)(t.risk),[d,f]=(0,K.useState)(t.description??``),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(null),_=s.trim(),v=_.length>0&&!p,x=(0,K.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await ue(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,Z.createPortal)((0,q.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,K.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,K.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,q.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,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,q.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,q.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,q.jsx)(y,{className:`h-4 w-4`})})]}),(0,q.jsxs)(`form`,{onSubmit:e=>void x(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,q.jsx)(b,{tone:`error`,children:h}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,q.jsx)(`div`,{className:`mt-1`,children:(0,q.jsx)(E,{value:a,onChange:o,disabled:!0,options:Ee.map(e=>({value:e,label:e}))})})]}),(0,q.jsx)(S,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,q.jsx)(`div`,{className:`mt-2 flex gap-2`,children:De.map(e=>(0,q.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,q.jsx)(`div`,{children:e.label}),(0,q.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,q.jsx)(S,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,q.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,q.jsx)(`button`,{type:`submit`,disabled:!v,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 ke(e){return e.origin===`default`&&!e.userModified}function Ae(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 je(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 Me({assistantId:e,onClose:t}){let n=(0,K.useRef)(null),[r,i]=(0,K.useState)([]),[a,o]=(0,K.useState)(!0),[s,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(!1),g=(0,K.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([B(e),B(e,{origin:`default`})]);return Ae(t,n)}return B(e)},[e]),_=(0,K.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,K.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(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}},[g,m]);let y=(0,K.useCallback)(async()=>{if(f)try{await ce(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,Z.createPortal)((0,q.jsxs)(q.Fragment,{children:[(0,q.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,K.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,K.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,q.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,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,q.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(C,{checked:m,onChange:h,label:`Show all defaults`}),(0,q.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,q.jsx)(`div`,{className:`mb-3`,children:(0,q.jsx)(b,{tone:`error`,children:s})}),a?(0,q.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,q.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,q.jsx)(I,{className:`h-8 w-8`}),(0,q.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,q.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,q.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,q.jsx)(x,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,q.jsx)(x,{tone:`neutral`,children:`Default`}),e.userModified&&(0,q.jsx)(x,{tone:`warning`,children:`Modified`})]}),(0,q.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,q.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,q.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,q.jsx)(v,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,q.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,q.jsx)(he,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,q.jsx)(Oe,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,q.jsx)(T,{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 y(),onCancel:()=>p(null)})]}),document.body)}function Ne(){let e=U(),[t,n]=(0,K.useState)(!1);return(0,q.jsxs)(m,{children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,q.jsx)(I,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,q.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,q.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,q.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{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`}],Fe=`thirtyDays`;function $(){return(0,q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=z({platformHostedOnly:!0}),t=k(),a=t,o=O.use.user()?.id??null,[s,c]=(0,K.useState)(()=>n(`shareAnalytics`,!0)),[l,u]=(0,K.useState)(()=>n(`shareDiagnostics`,!0)),[d,f]=(0,K.useState)(()=>i(`llmLogRetention`,Fe));return(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(we,{}),(0,q.jsx)(Se,{}),(0,q.jsx)(Ne,{}),(0,q.jsx)(Te,{}),(0,q.jsx)(W,{title:`Privacy`,subtitle:t?(0,q.jsxs)(q.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,q.jsx)(`a`,{href:oe(ae.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,q.jsxs)(`div`,{className:`space-y-4`,children:[a&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(G,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:s,onChange:()=>{let e=!s;c(e),D(`share_analytics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,q.jsx)($,{}),(0,q.jsx)(G,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),D(`share_diagnostics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,q.jsx)($,{})]}),(0,q.jsx)(Ce,{}),e!==`gated`&&(0,q.jsx)($,{}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(E,{value:d,onChange:e=>{f(e),r(`llmLogRetention`,e)},options:Pe})}),(0,q.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{Ie as PrivacyPage};
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{F as s,t as c}from"./button-amTXFI-2.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-C36Yvcac.js";import{t as m}from"./card-Bv5O5juh.js";import{t as h}from"./chevron-down-qD-re7AW.js";import{t as g}from"./chevron-right-DqqmezXC.js";import{t as _}from"./loader-circle-Cz7opInR.js";import{t as v}from"./pencil-CUIr0IFo.js";import{t as y}from"./x-CkSVp1Ok.js";import{t as b}from"./notice-DkcNAP8O.js";import{t as x}from"./tag-CV4v7fRF.js";import{t as S}from"./input-CoUmPnRU.js";import{t as C}from"./toggle-CDfguvUz.js";import{n as w}from"./toast-xTp-xwYL.js";import{t as T}from"./confirm-dialog-CSkhRFRk.js";import{t as E}from"./dropdown-ByHOpeOU.js";import{f as D,n as O,r as k}from"./auth-store-CahendZw.js";import{t as A}from"./sdk.gen-CmKfVpgB.js";import{c as j,i as ee,m as te,n as M,o as N,r as ne,s as re,t as ie}from"./native-biometric-Dy5Vb7o0.js";import{c as ae,s as oe}from"./routes-DYcJgn9k.js";import{n as se,t as P}from"./react-query.gen-GVQbBTEp.js";import{An as F,B as ce,D as le,Di as I,H as ue,Hr as de,In as fe,Ln as pe,Rn as L,S as R,Ur as z,V as B,Vr as me,b as V,vi as he,x as ge,y as H}from"./index-DZAcojtQ.js";import{t as U}from"./use-active-assistant-id-CGeH4Gl6.js";import{t as W}from"./detail-card-GPqFZVmX.js";import{t as G}from"./setting-row-imtQqr9o.js";var K=e(o(),1),q=f(),J=[{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.`}],_e=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ve(){let[e,t]=(0,K.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function ye(){let[e,r]=(0,K.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,K.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||F(0)}]}function be({row:e,onToggle:t}){return(0,q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,q.jsx)(C,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.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,q.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,q.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function xe(){return(0,q.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 Se({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=L(),{pendingKind:o,run:s}=ve(),[c,l]=ye(),u=(0,K.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of J){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,K.useMemo)(()=>{let e=J.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=_e.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 fe(e.sourceKind):await pe(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,q.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,q.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,q.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,q.jsx)(xe,{}),`Checking permissions...`]}):(0,q.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,q.jsx)(be,{row:e,onToggle:p},e.id))}),r&&(0,q.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 Ce(){let e=z({platformHostedOnly:!0}),t=me(),n=de(),r=l(),{data:i,isLoading:a,isError:o}=u({...P(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await A({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{se(r,void 0,e),w.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{w.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,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,q.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,q.jsxs)(q.Fragment,{children:[(s.isPending||c)&&(0,q.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,q.jsx)(C,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,q.jsx)(le,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function we(){let e=te(),[t,n]=(0,K.useState)(()=>ee()),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(`Face ID`),[s,c]=(0,K.useState)(!1);if((0,K.useEffect)(()=>{e&&(ne().then(i),M().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)N(!1),await ie(),n(!1);else{let e=j();e&&await re(e),N(!0),n(!0)}}finally{c(!1)}};return(0,q.jsx)(W,{title:`Security`,children:(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,q.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,q.jsx)(C,{checked:t,onChange:()=>void l(),disabled:s})]})})}function Y(){return(0,q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var X=H.map(e=>({value:e.id,label:e.label,icon:(0,q.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Te(){let e=U(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>ge(e),staleTime:3e4}),[i,a]=(0,K.useState)(`relaxed`),[o,s]=(0,K.useState)(`conservative`),[c,d]=(0,K.useState)(`strict`),[f,p]=(0,K.useState)(!1),_=(0,K.useRef)(!1),[v,y]=(0,K.useState)(!1),b=(0,K.useRef)(null),x=(0,K.useRef)(null);(0,K.useEffect)(()=>{!n||_.current||(a(V(n.interactive).id),s(V(n.autonomous).id),d(V(n.headless).id),y(!0))},[n]),(0,K.useEffect)(()=>()=>{b.current!==null&&(clearTimeout(b.current),b.current=null,x.current?.(),x.current=null)},[]);let S=(0,K.useCallback)((n,r,i)=>{if(!e||!v)return;let a=H.find(e=>e.id===n)?.riskThreshold,o=H.find(e=>e.id===r)?.riskThreshold,s=H.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||R(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,v,t]),C=(0,K.useCallback)((e,t,n)=>{b.current!==null&&clearTimeout(b.current),x.current=()=>S(e,t,n),b.current=setTimeout(()=>{x.current?.(),b.current=null,x.current=null},500)},[S]),w=(0,K.useCallback)(e=>{_.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,K.useCallback)(e=>{_.current=!0,s(e),C(i,e,c)},[i,c,C]),D=(0,K.useCallback)(e=>{_.current=!0,d(e),C(i,o,e)},[i,o,C]),O=H.find(e=>e.id===i),k=H.find(e=>e.id===o),A=H.find(e=>e.id===c),j=!e||!v;return(0,q.jsxs)(m,{children:[(0,q.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,q.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 access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,q.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,q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(E,{value:i,onChange:w,options:X,disabled:j})}),O&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,q.jsx)(Y,{}),(0,q.jsxs)(`div`,{children:[(0,q.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,q.jsx)(h,{className:`h-4 w-4`}):(0,q.jsx)(g,{className:`h-4 w-4`}),(0,q.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,q.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,q.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,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(E,{value:o,onChange:T,options:X,disabled:j})}),k&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]}),(0,q.jsx)(Y,{}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(E,{value:c,onChange:D,options:X,disabled:j})}),A&&(0,q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:A.description})]})]})]})]})]})}var Z=e(s(),1),Ee=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],De=[{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 Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,K.useRef)(null),[a,o]=(0,K.useState)(t.tool),[s,c]=(0,K.useState)(t.pattern),[l,u]=(0,K.useState)(t.risk),[d,f]=(0,K.useState)(t.description??``),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(null),_=s.trim(),v=_.length>0&&!p,x=(0,K.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await ue(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,Z.createPortal)((0,q.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,K.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,K.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,q.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,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,q.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,q.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,q.jsx)(y,{className:`h-4 w-4`})})]}),(0,q.jsxs)(`form`,{onSubmit:e=>void x(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,q.jsx)(b,{tone:`error`,children:h}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,q.jsx)(`div`,{className:`mt-1`,children:(0,q.jsx)(E,{value:a,onChange:o,disabled:!0,options:Ee.map(e=>({value:e,label:e}))})})]}),(0,q.jsx)(S,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,q.jsx)(`div`,{className:`mt-2 flex gap-2`,children:De.map(e=>(0,q.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,q.jsx)(`div`,{children:e.label}),(0,q.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,q.jsx)(S,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,q.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,q.jsx)(`button`,{type:`submit`,disabled:!v,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 ke(e){return e.origin===`default`&&!e.userModified}function Ae(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 je(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 Me({assistantId:e,onClose:t}){let n=(0,K.useRef)(null),[r,i]=(0,K.useState)([]),[a,o]=(0,K.useState)(!0),[s,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(!1),g=(0,K.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([B(e),B(e,{origin:`default`})]);return Ae(t,n)}return B(e)},[e]),_=(0,K.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,K.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(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}},[g,m]);let y=(0,K.useCallback)(async()=>{if(f)try{await ce(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,Z.createPortal)((0,q.jsxs)(q.Fragment,{children:[(0,q.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,K.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,K.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,q.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,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,q.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(C,{checked:m,onChange:h,label:`Show all defaults`}),(0,q.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,q.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,q.jsx)(`div`,{className:`mb-3`,children:(0,q.jsx)(b,{tone:`error`,children:s})}),a?(0,q.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,q.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,q.jsx)(I,{className:`h-8 w-8`}),(0,q.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,q.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,q.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,q.jsx)(x,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,q.jsx)(x,{tone:`neutral`,children:`Default`}),e.userModified&&(0,q.jsx)(x,{tone:`warning`,children:`Modified`})]}),(0,q.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,q.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,q.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,q.jsx)(v,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,q.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,q.jsx)(he,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,q.jsx)(Oe,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,q.jsx)(T,{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 y(),onCancel:()=>p(null)})]}),document.body)}function Ne(){let e=U(),[t,n]=(0,K.useState)(!1);return(0,q.jsxs)(m,{children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,q.jsx)(I,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,q.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,q.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,q.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{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`}],Fe=`thirtyDays`;function $(){return(0,q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=z({platformHostedOnly:!0}),t=k(),a=t,o=O.use.user()?.id??null,[s,c]=(0,K.useState)(()=>n(`shareAnalytics`,!0)),[l,u]=(0,K.useState)(()=>n(`shareDiagnostics`,!0)),[d,f]=(0,K.useState)(()=>i(`llmLogRetention`,Fe));return(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(we,{}),(0,q.jsx)(Se,{}),(0,q.jsx)(Ne,{}),(0,q.jsx)(Te,{}),(0,q.jsx)(W,{title:`Privacy`,subtitle:t?(0,q.jsxs)(q.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,q.jsx)(`a`,{href:oe(ae.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,q.jsxs)(`div`,{className:`space-y-4`,children:[a&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(G,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:s,onChange:()=>{let e=!s;c(e),D(`share_analytics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,q.jsx)($,{}),(0,q.jsx)(G,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),D(`share_diagnostics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,q.jsx)($,{})]}),(0,q.jsx)(Ce,{}),e!==`gated`&&(0,q.jsx)($,{}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,q.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,q.jsx)(E,{value:d,onChange:e=>{f(e),r(`llmLogRetention`,e)},options:Pe})}),(0,q.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{Ie 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-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{p as o}from"./local-mode-Bskd5bsT.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{d as c,i as l,n as u}from"./auth-store-CahendZw.js";import{m as d}from"./native-biometric-Dy5Vb7o0.js";import{c as f}from"./routes-DYcJgn9k.js";import{d as p,f as m,p as h,u as g}from"./prefs-BmHgesBi.js";import{t as _}from"./client-feature-flag-store-Bm7cFUky.js";import{_t as v,bt as y,ft as b,ht as x,in as S,vt as C}from"./index-RjTgjtTV.js";import{t as w}from"./step-indicator-dots-B-KCGh9e.js";import{n as T,t as E}from"./consent-controls-C7ZF8P6y.js";var D=e(t(),1);function O({isNative:e,isLocalHatch:t}){return e||t?f.onboarding.hatching:f.onboarding.research}var k=a();function A(){let e=r(),[t]=i(),a=u.use.user()?.id??null,A=s(),j=d(),M=C(_.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[N,P]=p(),[F,I]=m(),[L,R]=h(),[z,B]=g(),V=l();(0,D.useEffect)(()=>{j||v()},[j]);let H=t.get(`preview`)===`true`,U=(0,D.useCallback)(e=>{},[]),W=H?U:P,G=H?U:I,K=H?U:R,q=H?U:B,J=(0,D.useCallback)(()=>{if(H){e(`${f.onboarding.prechat}?preview=true`);return}if(c({userId:a,tos:L,privacy:z,shareAnalytics:N,shareDiagnostics:F,hasPlatformSession:V}),!j){let e=y(M);x(b.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${O({isNative:j,isLocalHatch:o()&&n!==null&&n!==`vellum-cloud`})}${i?`?${i}`:``}`)},[z,V,j,H,e,M,t,N,F,L,a]);return(0,k.jsx)(S,{children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${A?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[j&&(0,k.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,k.jsx)(w,{current:2,total:3})}),(0,k.jsx)(`h1`,{className:A?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,k.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${A?`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,k.jsx)(T,{electron:A,shareAnalytics:N,shareDiagnostics:F,onShareAnalyticsChange:W,onShareDiagnosticsChange:G,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,k.jsx)(E,{electron:A,privacyConsent:z,tosAccepted:L,onPrivacyChange:q,onTosChange:K,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${A?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!L||!z,onClick:J,className:A?void 0:`h-11 text-base`,children:`Start`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:A?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{A as PrivacyScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{p as o}from"./local-mode-Bskd5bsT.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{d as c,i as l,n as u}from"./auth-store-CahendZw.js";import{m as d}from"./native-biometric-Dy5Vb7o0.js";import{c as f}from"./routes-DYcJgn9k.js";import{d as p,f as m,p as h,u as g}from"./prefs-BmHgesBi.js";import{t as _}from"./client-feature-flag-store-Bm7cFUky.js";import{_t as v,bt as y,ft as b,ht as x,in as S,vt as C}from"./index-DZAcojtQ.js";import{t as w}from"./step-indicator-dots-B-KCGh9e.js";import{n as T,t as E}from"./consent-controls-C7ZF8P6y.js";var D=e(t(),1);function O({isNative:e,isLocalHatch:t}){return e||t?f.onboarding.hatching:f.onboarding.research}var k=a();function A(){let e=r(),[t]=i(),a=u.use.user()?.id??null,A=s(),j=d(),M=C(_.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[N,P]=p(),[F,I]=m(),[L,R]=h(),[z,B]=g(),V=l();(0,D.useEffect)(()=>{j||v()},[j]);let H=t.get(`preview`)===`true`,U=(0,D.useCallback)(e=>{},[]),W=H?U:P,G=H?U:I,K=H?U:R,q=H?U:B,J=(0,D.useCallback)(()=>{if(H){e(`${f.onboarding.prechat}?preview=true`);return}if(c({userId:a,tos:L,privacy:z,shareAnalytics:N,shareDiagnostics:F,hasPlatformSession:V}),!j){let e=y(M);x(b.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${O({isNative:j,isLocalHatch:o()&&n!==null&&n!==`vellum-cloud`})}${i?`?${i}`:``}`)},[z,V,j,H,e,M,t,N,F,L,a]);return(0,k.jsx)(S,{children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${A?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[j&&(0,k.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,k.jsx)(w,{current:2,total:3})}),(0,k.jsx)(`h1`,{className:A?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,k.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${A?`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,k.jsx)(T,{electron:A,shareAnalytics:N,shareDiagnostics:F,onShareAnalyticsChange:W,onShareDiagnosticsChange:G,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,k.jsx)(E,{electron:A,privacyConsent:z,tosAccepted:L,onPrivacyChange:q,onTosChange:K,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${A?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!L||!z,onClick:J,className:A?void 0:`h-11 text-base`,children:`Start`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:A?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{A as PrivacyScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{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{p as s,w as c}from"./local-mode-Bskd5bsT.js";import{D as l,n as u}from"./auth-store-CahendZw.js";import{c as d}from"./api-Y8JHO-Hz.js";import{S as f,_ as p}from"./native-biometric-Dy5Vb7o0.js";import{c as m}from"./routes-DYcJgn9k.js";import{a as h,i as g}from"./login-flow-D2FFf5y7.js";import{n as _}from"./index-RjTgjtTV.js";import{r as v,t as y}from"./account-shell-DaECsri2.js";var b=e(n(),1),x=o();function S(){let[e]=i(),n=r(),o=u.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 f(),r=p(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),s())try{let e=await d();if(e.ok&&e.data.length>0&&(await c(e.data,l.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-Dhiismgm.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{p as s,w as c}from"./local-mode-Bskd5bsT.js";import{D as l,n as u}from"./auth-store-CahendZw.js";import{c as d}from"./api-Y8JHO-Hz.js";import{S as f,_ as p}from"./native-biometric-Dy5Vb7o0.js";import{c as m}from"./routes-DYcJgn9k.js";import{a as h,i as g}from"./login-flow-D2FFf5y7.js";import{n as _}from"./index-DZAcojtQ.js";import{r as v,t as y}from"./account-shell-DaECsri2.js";var b=e(n(),1),x=o();function S(){let[e]=i(),n=r(),o=u.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 f(),r=p(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),s())try{let e=await d();if(e.ok&&e.data.length>0&&(await c(e.data,l.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{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{t as i}from"./public-asset-WikBpVQd.js";import{ka as a}from"./index-RjTgjtTV.js";var o=e(t(),1);async function s(e){r()&&await window.vellum?.quickInput?.submit(e)}async function c(){r()&&await window.vellum?.quickInput?.dismiss()}var l=n();function u(){let[e,t]=(0,o.useState)(``),n=(0,o.useRef)(null);(0,o.useEffect)(()=>{n.current?.focus()},[]);let r=(0,o.useCallback)(n=>{n.preventDefault();let r=e.trim();r&&(s(r),t(``))},[e]),u=(0,o.useCallback)(e=>{e.key===`Escape`&&(e.preventDefault(),c())},[]);return(0,l.jsx)(`div`,{className:`flex h-screen w-screen items-center justify-center bg-transparent p-2`,children:(0,l.jsxs)(`form`,{onSubmit:r,className:`flex w-full items-center gap-3 rounded-2xl border border-[var(--border-default)] bg-[var(--surface-base)] px-4 py-3 shadow-lg`,children:[(0,l.jsx)(`img`,{src:i(`/vellum-logo.svg`),alt:`Vellum`,width:24,height:24,className:`shrink-0 dark:hidden`,draggable:!1}),(0,l.jsx)(`img`,{src:i(`/vellum-logo-white.svg`),alt:`Vellum`,width:24,height:24,className:`hidden shrink-0 dark:block`,draggable:!1}),(0,l.jsx)(`input`,{ref:n,type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:u,placeholder:`Ask Vellum anything...`,className:`min-w-0 flex-1 bg-transparent text-sm text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,l.jsx)(`button`,{type:`submit`,disabled:!e.trim(),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--surface-accent)] text-[var(--content-on-accent)] transition-opacity disabled:opacity-30`,children:(0,l.jsx)(a,{size:16})})]})})}export{u as QuickInputPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{t as i}from"./public-asset-WikBpVQd.js";import{ka as a}from"./index-DZAcojtQ.js";var o=e(t(),1);async function s(e){r()&&await window.vellum?.quickInput?.submit(e)}async function c(){r()&&await window.vellum?.quickInput?.dismiss()}var l=n();function u(){let[e,t]=(0,o.useState)(``),n=(0,o.useRef)(null);(0,o.useEffect)(()=>{n.current?.focus()},[]);let r=(0,o.useCallback)(n=>{n.preventDefault();let r=e.trim();r&&(s(r),t(``))},[e]),u=(0,o.useCallback)(e=>{e.key===`Escape`&&(e.preventDefault(),c())},[]);return(0,l.jsx)(`div`,{className:`flex h-screen w-screen items-center justify-center bg-transparent p-2`,children:(0,l.jsxs)(`form`,{onSubmit:r,className:`flex w-full items-center gap-3 rounded-2xl border border-[var(--border-default)] bg-[var(--surface-base)] px-4 py-3 shadow-lg`,children:[(0,l.jsx)(`img`,{src:i(`/vellum-logo.svg`),alt:`Vellum`,width:24,height:24,className:`shrink-0 dark:hidden`,draggable:!1}),(0,l.jsx)(`img`,{src:i(`/vellum-logo-white.svg`),alt:`Vellum`,width:24,height:24,className:`hidden shrink-0 dark:block`,draggable:!1}),(0,l.jsx)(`input`,{ref:n,type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:u,placeholder:`Ask Vellum anything...`,className:`min-w-0 flex-1 bg-transparent text-sm text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,l.jsx)(`button`,{type:`submit`,disabled:!e.trim(),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--surface-accent)] text-[var(--content-on-accent)] transition-opacity disabled:opacity-30`,children:(0,l.jsx)(a,{size:16})})]})})}export{u as QuickInputPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{c as o}from"./routes-DYcJgn9k.js";import{t as s}from"./client-feature-flag-store-Bm7cFUky.js";import{t as c}from"./conversation-store-CynXqAcO.js";import{t as l}from"./conversation-selection-CfSCgJxD.js";import{on as u}from"./index-RjTgjtTV.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-amTXFI-2.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{c as o}from"./routes-DYcJgn9k.js";import{t as s}from"./client-feature-flag-store-Bm7cFUky.js";import{t as c}from"./conversation-store-CynXqAcO.js";import{t as l}from"./conversation-selection-CfSCgJxD.js";import{on as u}from"./index-DZAcojtQ.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,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./cn-C36Yvcac.js";import{t as l}from"./arrow-left-DI9551VI.js";import{t as u}from"./chevron-left-BMF1xNfR.js";import{t as d}from"./chevron-right-DqqmezXC.js";import{n as f,r as p,t as m}from"./animated-avatar-CZyC3QaF.js";import{t as h}from"./loader-circle-Cz7opInR.js";import{t as g}from"./pencil-CUIr0IFo.js";import{t as _}from"./plus-DItfr5ux.js";import{t as v}from"./x-CkSVp1Ok.js";import{t as y}from"./tag-CV4v7fRF.js";import{t as b}from"./input-CoUmPnRU.js";import{i as x,r as S,t as C}from"./dist-CxHeCOEv.js";import{n as w,t as T}from"./create-selectors-8NePGNlX.js";import{b as E,ct as D,o as ee,p as te}from"./local-mode-Bskd5bsT.js";import{Bn as O,V as k,et as A,gn as j,hn as ne,zn as re}from"./sdk.gen-BwnFjFcp.js";import{r as ie}from"./api-errors-CrWDzVca.js";import{A as ae,B as oe,L as M,R as se,n as ce,z as le}from"./auth-store-CahendZw.js";import{a as ue,o as de,r as fe}from"./api-Y8JHO-Hz.js";import{c as pe}from"./routes-DYcJgn9k.js";import{n as me}from"./platform-detection-BrUDCnmd.js";import{c as he,l as ge}from"./prechat-BBwYr5Qb.js";import{t as N}from"./browser-timezone-B2VEIYkv.js";import{c as _e}from"./conversation-list-fetchers-UfflrX4K.js";import{i as ve,n as ye,r as be,t as xe}from"./research-onboarding-persistence-D_h0dT1o.js";import{A as P,B as Se,C as Ce,D as we,E as Te,F as Ee,I as F,L as De,M as Oe,N as ke,O as Ae,P as I,R as je,S as L,T as R,V as z,_ as Me,a as Ne,b as Pe,d as B,f as Fe,g as Ie,i as Le,j as Re,k as ze,m as Be,o as Ve,p as He,r as Ue,s as We,t as V,v as Ge,w as Ke,x as qe,y as Je}from"./proxy-Cadlowdl.js";import{t as Ye}from"./AnimatePresence-TZWSGjkI.js";import{t as H}from"./use-reduced-motion-BPBlq9_a.js";import{Aa as U,Ai as Xe,Jt as Ze,an as Qe,cn as $e,cr as et,gt as tt,in as nt,mt as rt,nt as W,sn as it,tt as at,yn as ot}from"./index-RjTgjtTV.js";import{n as st,t as ct}from"./onboarding-step-layout-Cup_f9lB.js";import{t as lt}from"./prechat-names-Cjl3JzzN.js";var ut=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function dt(e,t){return Oe(e)?e[ut(0,e.length,t)]:e}var ft=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return pt(this.animations,`duration`)}get iterationDuration(){return pt(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function pt(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var mt=class extends ft{then(e,t){return this.finished.finally(e).then(()=>{})}};function ht(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=Te(i,a,o);return t?s(r):s}function gt(e,t){return e in t}var _t=class extends We{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(gt(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Fe()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},G=e(n(),1);function vt(e){let t=z(()=>L(e)),{isStatic:n}=(0,G.useContext)(Ue);if(n){let[,n]=(0,G.useState)(e);(0,G.useEffect)(()=>t.on(`change`,n),[])}return t}function yt(e,t){let n=vt(t()),r=()=>n.set(t());return r(),Se(()=>{let t=()=>Re.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),P(r)}}),n}function bt(e){qe.current=[],e();let t=yt(qe.current,e);return qe.current=void 0,t}function xt(e,t,n,r){if(typeof e==`function`)return bt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return Ct(e,t,n,r);let i=typeof t==`function`?t:ht(t,n,r),a=Array.isArray(e)?St(e,i):St([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function St(e,t){let n=z(()=>[]);return yt(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function Ct(e,t,n,r){let i=z(()=>Object.keys(n)),a=z(()=>({}));for(let o of i)a[o]=xt(e,t,n[o],r);return a}function wt(e){e.values.forEach(e=>e.stop())}function Tt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&Pe(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{Tt(e,t)})})}function Et(e,t){if(Array.isArray(t))return Tt(e,t);if(typeof t==`string`)return Tt(e,[t]);Pe(e,t)}function Dt(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){F(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(Me(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return F(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{Et(e,n)})},stop(){t.forEach(e=>{wt(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function Ot(e){return typeof e==`object`&&!Array.isArray(e)}function kt(e,t,n,r){return e==null?[]:typeof e==`string`&&Ot(t)?Ie(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function At(e,t,n){return e*(t+1)+n*t}function jt(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function Mt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(je(e,i),r--)}}function Nt(e,t,n,r,i,a){Mt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:ze(i,a,r[o]),easing:dt(n,o)})}function Pt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Ft(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var It=`easeInOut`,Lt=20;function Rt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,jt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=jt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Vt(e),{delay:l=0,times:u=Ke(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Ce(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Wt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=I(b));let r=Ae(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&R(u,T),c.length===1&&c.unshift(null),m&&De(m<Lt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Lt} or apply repeat at the sequence level instead.`),m&&m<Lt){let e=b>0?_/b:0;b=At(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?ke(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:dt(f,e-1))}Pt(u,m,e)}let E=w+b;Nt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Je(p)){let e=zt(p,s);_(m,h,Bt(`default`,e))}else{let e=kt(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=zt(r,s);for(let e in m)_(m[e],Ht(h,e),Bt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Ft);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Ee(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(It)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function zt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Bt(e,t){return t[e]||(t[e]=[]),t[e]}function Vt(e){return Array.isArray(e)?e:[e]}function Ht(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Ut=e=>typeof e==`number`,Wt=e=>e.every(Ut);function Gt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Be(e)&&!He(e)?new Ne(t):new Ve(t);n.mount(e),B.set(e,n)}function Kt(e){let t=new _t({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),B.set(e,t)}function qt(e,t){return Je(e)||typeof e==`number`||typeof e==`string`&&!Ot(t)}function Jt(e,t,n,r){let i=[];if(qt(e,t))i.push(Le(e,Ot(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=kt(e,t,r),o=a.length;F(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Gt:Kt;B.has(r)||s(r);let c=B.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ge(c,{...t,transition:l},{}))}}return i}function Yt(e,t,n){let r=[];return Rt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=L(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:we}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Jt(n,e,t))}),r}function Xt(e){return Array.isArray(e)&&e.some(Array.isArray)}function Zt(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),Xt(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Yt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Jt(e,i,{...c,...r},t)}let l=new mt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{je(t.animations,l)})),l}return i}var Qt=Zt();function $t(){let e=z(Dt);return Se(e.mount,[]),e}var en=12;function tn(e,t){let n=e.slice(0,en).map(e=>`- ${e.name} — ${e.description}`).join(`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./cn-C36Yvcac.js";import{t as l}from"./arrow-left-DI9551VI.js";import{t as u}from"./chevron-left-BMF1xNfR.js";import{t as d}from"./chevron-right-DqqmezXC.js";import{n as f,r as p,t as m}from"./animated-avatar-CZyC3QaF.js";import{t as h}from"./loader-circle-Cz7opInR.js";import{t as g}from"./pencil-CUIr0IFo.js";import{t as _}from"./plus-DItfr5ux.js";import{t as v}from"./x-CkSVp1Ok.js";import{t as y}from"./tag-CV4v7fRF.js";import{t as b}from"./input-CoUmPnRU.js";import{i as x,r as S,t as C}from"./dist-CxHeCOEv.js";import{n as w,t as T}from"./create-selectors-8NePGNlX.js";import{b as E,ct as D,o as ee,p as te}from"./local-mode-Bskd5bsT.js";import{Bn as O,V as k,et as A,gn as j,hn as ne,zn as re}from"./sdk.gen-BwnFjFcp.js";import{r as ie}from"./api-errors-CrWDzVca.js";import{A as ae,B as oe,L as M,R as se,n as ce,z as le}from"./auth-store-CahendZw.js";import{a as ue,o as de,r as fe}from"./api-Y8JHO-Hz.js";import{c as pe}from"./routes-DYcJgn9k.js";import{n as me}from"./platform-detection-BrUDCnmd.js";import{c as he,l as ge}from"./prechat-BBwYr5Qb.js";import{t as N}from"./browser-timezone-B2VEIYkv.js";import{c as _e}from"./conversation-list-fetchers-UfflrX4K.js";import{i as ve,n as ye,r as be,t as xe}from"./research-onboarding-persistence-D_h0dT1o.js";import{A as P,B as Se,C as Ce,D as we,E as Te,F as Ee,I as F,L as De,M as Oe,N as ke,O as Ae,P as I,R as je,S as L,T as R,V as z,_ as Me,a as Ne,b as Pe,d as B,f as Fe,g as Ie,i as Le,j as Re,k as ze,m as Be,o as Ve,p as He,r as Ue,s as We,t as V,v as Ge,w as Ke,x as qe,y as Je}from"./proxy-Cadlowdl.js";import{t as Ye}from"./AnimatePresence-TZWSGjkI.js";import{t as H}from"./use-reduced-motion-BPBlq9_a.js";import{Aa as U,Ai as Xe,Jt as Ze,an as Qe,cn as $e,cr as et,gt as tt,in as nt,mt as rt,nt as W,sn as it,tt as at,yn as ot}from"./index-DZAcojtQ.js";import{n as st,t as ct}from"./onboarding-step-layout-Cup_f9lB.js";import{t as lt}from"./prechat-names-Cjl3JzzN.js";var ut=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function dt(e,t){return Oe(e)?e[ut(0,e.length,t)]:e}var ft=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return pt(this.animations,`duration`)}get iterationDuration(){return pt(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function pt(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var mt=class extends ft{then(e,t){return this.finished.finally(e).then(()=>{})}};function ht(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=Te(i,a,o);return t?s(r):s}function gt(e,t){return e in t}var _t=class extends We{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(gt(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Fe()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},G=e(n(),1);function vt(e){let t=z(()=>L(e)),{isStatic:n}=(0,G.useContext)(Ue);if(n){let[,n]=(0,G.useState)(e);(0,G.useEffect)(()=>t.on(`change`,n),[])}return t}function yt(e,t){let n=vt(t()),r=()=>n.set(t());return r(),Se(()=>{let t=()=>Re.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),P(r)}}),n}function bt(e){qe.current=[],e();let t=yt(qe.current,e);return qe.current=void 0,t}function xt(e,t,n,r){if(typeof e==`function`)return bt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return Ct(e,t,n,r);let i=typeof t==`function`?t:ht(t,n,r),a=Array.isArray(e)?St(e,i):St([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function St(e,t){let n=z(()=>[]);return yt(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function Ct(e,t,n,r){let i=z(()=>Object.keys(n)),a=z(()=>({}));for(let o of i)a[o]=xt(e,t,n[o],r);return a}function wt(e){e.values.forEach(e=>e.stop())}function Tt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&Pe(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{Tt(e,t)})})}function Et(e,t){if(Array.isArray(t))return Tt(e,t);if(typeof t==`string`)return Tt(e,[t]);Pe(e,t)}function Dt(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){F(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(Me(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return F(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{Et(e,n)})},stop(){t.forEach(e=>{wt(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function Ot(e){return typeof e==`object`&&!Array.isArray(e)}function kt(e,t,n,r){return e==null?[]:typeof e==`string`&&Ot(t)?Ie(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function At(e,t,n){return e*(t+1)+n*t}function jt(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function Mt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(je(e,i),r--)}}function Nt(e,t,n,r,i,a){Mt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:ze(i,a,r[o]),easing:dt(n,o)})}function Pt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Ft(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var It=`easeInOut`,Lt=20;function Rt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,jt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=jt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Vt(e),{delay:l=0,times:u=Ke(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Ce(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Wt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=I(b));let r=Ae(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&R(u,T),c.length===1&&c.unshift(null),m&&De(m<Lt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Lt} or apply repeat at the sequence level instead.`),m&&m<Lt){let e=b>0?_/b:0;b=At(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?ke(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:dt(f,e-1))}Pt(u,m,e)}let E=w+b;Nt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Je(p)){let e=zt(p,s);_(m,h,Bt(`default`,e))}else{let e=kt(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=zt(r,s);for(let e in m)_(m[e],Ht(h,e),Bt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Ft);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Ee(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(It)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function zt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Bt(e,t){return t[e]||(t[e]=[]),t[e]}function Vt(e){return Array.isArray(e)?e:[e]}function Ht(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Ut=e=>typeof e==`number`,Wt=e=>e.every(Ut);function Gt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Be(e)&&!He(e)?new Ne(t):new Ve(t);n.mount(e),B.set(e,n)}function Kt(e){let t=new _t({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),B.set(e,t)}function qt(e,t){return Je(e)||typeof e==`number`||typeof e==`string`&&!Ot(t)}function Jt(e,t,n,r){let i=[];if(qt(e,t))i.push(Le(e,Ot(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=kt(e,t,r),o=a.length;F(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Gt:Kt;B.has(r)||s(r);let c=B.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ge(c,{...t,transition:l},{}))}}return i}function Yt(e,t,n){let r=[];return Rt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=L(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:we}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Jt(n,e,t))}),r}function Xt(e){return Array.isArray(e)&&e.some(Array.isArray)}function Zt(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),Xt(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Yt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Jt(e,i,{...c,...r},t)}let l=new mt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{je(t.animations,l)})),l}return i}var Qt=Zt();function $t(){let e=z(Dt);return Se(e.mount,[]),e}var en=12;function tn(e,t){let n=e.slice(0,en).map(e=>`- ${e.name} — ${e.description}`).join(`
2
2
  `);return n?`
3
3
  Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
4
4
  ${n}
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-y5bNUVyG.js";import{d as s,i as c,n as l}from"./auth-store-CahendZw.js";import{t as u}from"./return-to-ugSGJ0dm.js";import{c as d}from"./routes-DYcJgn9k.js";import{c as f,d as p,f as m,l as h,p as g,u as _}from"./prefs-BmHgesBi.js";import{Di as v,in as y,vr as b}from"./index-RjTgjtTV.js";import{n as x,t as S}from"./consent-controls-C7ZF8P6y.js";var C=e(t(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function E(e){return w[e]??[]}function D(e){return T[e]??[]}var O=a();function k(){let e=r(),[t]=i(),a=l.use.user()?.id??null,w=l.use.logout(),T=o(),k=c(),[A,j]=g(),[M,N]=_(),[P,F]=p(),[I,L]=m(),[R]=f(),[z]=h(),[B]=(0,C.useState)(()=>!A),[V]=(0,C.useState)(()=>!M),[H]=(0,C.useState)(()=>!R),[U]=(0,C.useState)(()=>!z),W=!B&&!V&&!H&&!U,G=B||W,K=V||W,q=H||W,J=U||W,Y=!W&&!B&&!V,X=W?`Terms & privacy`:Y?`Review your privacy preferences`:`Updated terms`,Z=W?`Review your terms and privacy preferences anytime.`:Y?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,Q=(0,C.useCallback)(()=>{s({userId:a,tos:A,privacy:M,shareAnalytics:P,shareDiagnostics:I,hasPlatformSession:k}),e(u(t.get(`returnTo`),d.assistant),{replace:!0})},[M,k,e,t,P,I,A,a]),$=(0,C.useCallback)(async()=>{await w(),b(d.account.login)},[w]),ee=G&&!A||K&&!M;return(0,O.jsx)(y,{showCreatureFooter:!1,children:(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${T?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,O.jsx)(v,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,O.jsx)(`h1`,{className:`mt-5 ${T?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:X}),(0,O.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${T?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:Z}),(q||J)&&(0,O.jsx)(x,{electron:T,showAnalytics:q,showDiagnostics:J,shareAnalytics:P,shareDiagnostics:I,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(K||G)&&(0,O.jsx)(S,{electron:T,showPrivacy:K,showTos:G,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:K?D(`2026-06-22`):[],tosNotes:G?E(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,O.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${T?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:ee,onClick:Q,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:$,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-y5bNUVyG.js";import{d as s,i as c,n as l}from"./auth-store-CahendZw.js";import{t as u}from"./return-to-ugSGJ0dm.js";import{c as d}from"./routes-DYcJgn9k.js";import{c as f,d as p,f as m,l as h,p as g,u as _}from"./prefs-BmHgesBi.js";import{Di as v,in as y,vr as b}from"./index-DZAcojtQ.js";import{n as x,t as S}from"./consent-controls-C7ZF8P6y.js";var C=e(t(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function E(e){return w[e]??[]}function D(e){return T[e]??[]}var O=a();function k(){let e=r(),[t]=i(),a=l.use.user()?.id??null,w=l.use.logout(),T=o(),k=c(),[A,j]=g(),[M,N]=_(),[P,F]=p(),[I,L]=m(),[R]=f(),[z]=h(),[B]=(0,C.useState)(()=>!A),[V]=(0,C.useState)(()=>!M),[H]=(0,C.useState)(()=>!R),[U]=(0,C.useState)(()=>!z),W=!B&&!V&&!H&&!U,G=B||W,K=V||W,q=H||W,J=U||W,Y=!W&&!B&&!V,X=W?`Terms & privacy`:Y?`Review your privacy preferences`:`Updated terms`,Z=W?`Review your terms and privacy preferences anytime.`:Y?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,Q=(0,C.useCallback)(()=>{s({userId:a,tos:A,privacy:M,shareAnalytics:P,shareDiagnostics:I,hasPlatformSession:k}),e(u(t.get(`returnTo`),d.assistant),{replace:!0})},[M,k,e,t,P,I,A,a]),$=(0,C.useCallback)(async()=>{await w(),b(d.account.login)},[w]),ee=G&&!A||K&&!M;return(0,O.jsx)(y,{showCreatureFooter:!1,children:(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${T?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,O.jsx)(v,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,O.jsx)(`h1`,{className:`mt-5 ${T?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:X}),(0,O.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${T?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:Z}),(q||J)&&(0,O.jsx)(x,{electron:T,showAnalytics:q,showDiagnostics:J,shareAnalytics:P,shareDiagnostics:I,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(K||G)&&(0,O.jsx)(S,{electron:T,showPrivacy:K,showTos:G,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:K?D(`2026-06-22`):[],tosNotes:G?E(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,O.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${T?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:ee,onClick:Q,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:$,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./copy-Cn1FKrEp.js";import{t as c}from"./loader-circle-Cz7opInR.js";import{t as l}from"./notice-DkcNAP8O.js";import{t as u}from"./input-CoUmPnRU.js";import{t as d}from"./modal-D5nLWNN9.js";import{n as f}from"./toast-xTp-xwYL.js";import{t as p}from"./confirm-dialog-CSkhRFRk.js";import{Pt as m}from"./sdk.gen-CmKfVpgB.js";import{c as h}from"./routes-DYcJgn9k.js";import{t as g}from"./client-feature-flag-store-Bm7cFUky.js";import{At as _,Mt as v,Nt as y,jt as b,kt as x}from"./react-query.gen-GVQbBTEp.js";import{D as S,Ur as C,wi as w}from"./index-RjTgjtTV.js";import{t as T}from"./detail-card-GPqFZVmX.js";var E=e(t(),1);function D(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`)return t}}var O=o();function k({open:e,onOpenChange:t}){let r=i(),[a,o]=(0,E.useState)(null),[l,p]=(0,E.useState)(``),[h,g]=(0,E.useState)(null),_=(0,E.useRef)(!1),v=(0,E.useRef)(e),S=()=>r.invalidateQueries({queryKey:y()}),C=e=>{m({path:{id:e}}).catch(()=>void 0).finally(()=>void S())},w=x({onSuccess:e=>{if(!v.current){C(e.factor_id);return}o(e)},onError:e=>{let n=D(e);n===`no_workos_account`?f.error(`Two-factor authentication is only available for Vellum platform accounts.`):n===`throttled`||n===`workos_rate_limited`?f.error(`Too many attempts. Try again in a minute.`):n===`factor_limit_reached`?f.error(`An authenticator app is already set up. Remove it before adding another.`):f.error(`Failed to start setup. Please try again.`),t(!1)}}),T=b({onSuccess:e=>{e.valid?(_.current=!0,f.success(`Two-factor authentication is on.`),S(),t(!1)):g(`That code didn't match. Check your authenticator app and try again.`)},onError:e=>{let n=D(e);if(n===`challenge_already_verified`){_.current=!0,f.success(`Two-factor authentication is on.`),S(),t(!1);return}if(n===`challenge_expired`||n===`challenge_not_found`){a&&C(a.factor_id),o(null),p(``),g(`This setup session expired. Scan the new QR code and try again.`),w.mutate({});return}if(n===`throttled`||n===`workos_rate_limited`){g(`Too many attempts. Wait a minute and try again.`);return}g(`Couldn't verify the code. Wait a moment and try again.`)}});(0,E.useEffect)(()=>{v.current=e,e&&(_.current=!1,o(null),p(``),g(null),w.mutate({}))},[e]);let k=e=>{!e&&T.isPending||(!e&&a&&!_.current&&C(a.factor_id),t(e))},A=()=>{a&&navigator.clipboard.writeText(a.secret).then(()=>f.success(`Setup key copied.`)).catch(()=>f.error(`Couldn't copy the setup key.`))},j=()=>{!a||l.length!==6||T.isPending||(g(null),T.mutate({body:{challenge_id:a.challenge_id,code:l}}))};return(0,O.jsx)(d.Root,{open:e,onOpenChange:k,children:(0,O.jsxs)(d.Content,{size:`sm`,children:[(0,O.jsxs)(d.Header,{children:[(0,O.jsx)(d.Title,{children:`Set up authenticator app`}),(0,O.jsx)(d.Description,{children:`Scan the QR code with an authenticator app such as Google Authenticator or 1Password, then enter the 6-digit code it shows.`})]}),(0,O.jsx)(d.Body,{children:a===null?(0,O.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,O.jsx)(c,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,O.jsxs)(`form`,{className:`flex flex-col items-center gap-4`,onSubmit:e=>{e.preventDefault(),j()},children:[(0,O.jsx)(`img`,{src:a.qr_code,alt:`QR code for your authenticator app`,className:`h-44 w-44 rounded-lg bg-white p-2`}),(0,O.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,O.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Can't scan it? Enter this setup key manually:`}),(0,O.jsxs)(`button`,{type:`button`,onClick:A,className:`flex cursor-pointer items-center gap-2 self-start font-mono text-body-small-default text-[var(--content-default)] hover:text-[var(--content-emphasised)]`,children:[(0,O.jsx)(`span`,{className:`break-all text-left`,children:a.secret}),(0,O.jsx)(s,{className:`h-3.5 w-3.5 shrink-0`})]})]}),(0,O.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,O.jsx)(`label`,{htmlFor:`totp-code`,className:`text-body-small-default text-[var(--content-tertiary)]`,children:`6-digit code`}),(0,O.jsx)(u,{id:`totp-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,placeholder:`123456`,value:l,onChange:e=>p(e.target.value.replace(/\D/g,``).slice(0,6))}),h&&(0,O.jsx)(`p`,{role:`alert`,className:`text-body-small-default text-[var(--system-negative-strong)]`,children:h})]})]})}),(0,O.jsxs)(d.Footer,{children:[(0,O.jsx)(n,{variant:`outlined`,onClick:()=>k(!1),disabled:T.isPending,children:`Cancel`}),(0,O.jsx)(n,{onClick:j,disabled:a===null||l.length!==6||T.isPending,children:T.isPending?`Verifying…`:`Verify`})]})]})})}function A(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function j(){let e=i(),[t,r]=(0,E.useState)(!1),[o,s]=(0,E.useState)(null),u=a({...v()}),d=u.data??[],m=()=>e.invalidateQueries({queryKey:y()}),h=_({onSuccess:()=>{f.success(`Authenticator app removed.`),m()},onError:e=>{if(D(e)===`factor_not_found`){m();return}f.error(`Failed to remove the authenticator app. Please try again.`)}});return(0,O.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u.isPending?(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,O.jsx)(c,{className:`h-4 w-4 animate-spin`}),(0,O.jsx)(`span`,{className:`text-body-medium-default`,children:`Loading authenticator apps…`})]}):u.isError?(0,O.jsxs)(l,{tone:`error`,children:[`Couldn't load your authenticator apps.`,` `,(0,O.jsx)(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>void u.refetch(),children:`Try again`})]}):d.length===0?(0,O.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`No authenticator app is set up. Add one to require a one-time code at sign-in.`}):(0,O.jsx)(`ul`,{className:`flex flex-col divide-y divide-[var(--border-base)]`,children:d.map(e=>(0,O.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-3`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,O.jsx)(w,{className:`h-5 w-5 shrink-0 text-[var(--content-tertiary)]`}),(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Authenticator app`}),(0,O.jsxs)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:[e.user,e.created_at?` · Added ${A(e.created_at)}`:``]})]})]}),(0,O.jsx)(n,{variant:`dangerOutline`,onClick:()=>s(e),disabled:h.isPending,children:`Remove`})]},e.id))}),!u.isPending&&!u.isError&&d.length===0&&(0,O.jsx)(n,{onClick:()=>r(!0),className:`self-start`,children:`Add authenticator app`}),(0,O.jsx)(k,{open:t,onOpenChange:r}),(0,O.jsx)(p,{open:o!==null,title:`Remove authenticator app`,message:`Signing in will no longer ask for a code from this app. You can set up a new authenticator app at any time.`,confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{o&&h.mutate({path:{id:o.id}}),s(null)},onCancel:()=>s(null)})]})}function M(){let e=g.use.accountMfa(),t=g.use.hydrated(),n=C();return t&&!e?(0,O.jsx)(r,{replace:!0,to:h.settings.general}):!e||n===`gated`?null:(0,O.jsx)(`div`,{className:`space-y-4`,children:(0,O.jsx)(T,{title:`Two-Factor Authentication`,subtitle:`Require a code from an authenticator app when you sign in.`,children:n===`disabled`?(0,O.jsx)(S,{children:`Log in to the Vellum platform to manage two-factor authentication.`}):(0,O.jsx)(j,{})})})}export{M as SecurityPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./copy-Cn1FKrEp.js";import{t as c}from"./loader-circle-Cz7opInR.js";import{t as l}from"./notice-DkcNAP8O.js";import{t as u}from"./input-CoUmPnRU.js";import{t as d}from"./modal-D5nLWNN9.js";import{n as f}from"./toast-xTp-xwYL.js";import{t as p}from"./confirm-dialog-CSkhRFRk.js";import{Pt as m}from"./sdk.gen-CmKfVpgB.js";import{c as h}from"./routes-DYcJgn9k.js";import{t as g}from"./client-feature-flag-store-Bm7cFUky.js";import{At as _,Mt as v,Nt as y,jt as b,kt as x}from"./react-query.gen-GVQbBTEp.js";import{D as S,Ur as C,wi as w}from"./index-DZAcojtQ.js";import{t as T}from"./detail-card-GPqFZVmX.js";var E=e(t(),1);function D(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`)return t}}var O=o();function k({open:e,onOpenChange:t}){let r=i(),[a,o]=(0,E.useState)(null),[l,p]=(0,E.useState)(``),[h,g]=(0,E.useState)(null),_=(0,E.useRef)(!1),v=(0,E.useRef)(e),S=()=>r.invalidateQueries({queryKey:y()}),C=e=>{m({path:{id:e}}).catch(()=>void 0).finally(()=>void S())},w=x({onSuccess:e=>{if(!v.current){C(e.factor_id);return}o(e)},onError:e=>{let n=D(e);n===`no_workos_account`?f.error(`Two-factor authentication is only available for Vellum platform accounts.`):n===`throttled`||n===`workos_rate_limited`?f.error(`Too many attempts. Try again in a minute.`):n===`factor_limit_reached`?f.error(`An authenticator app is already set up. Remove it before adding another.`):f.error(`Failed to start setup. Please try again.`),t(!1)}}),T=b({onSuccess:e=>{e.valid?(_.current=!0,f.success(`Two-factor authentication is on.`),S(),t(!1)):g(`That code didn't match. Check your authenticator app and try again.`)},onError:e=>{let n=D(e);if(n===`challenge_already_verified`){_.current=!0,f.success(`Two-factor authentication is on.`),S(),t(!1);return}if(n===`challenge_expired`||n===`challenge_not_found`){a&&C(a.factor_id),o(null),p(``),g(`This setup session expired. Scan the new QR code and try again.`),w.mutate({});return}if(n===`throttled`||n===`workos_rate_limited`){g(`Too many attempts. Wait a minute and try again.`);return}g(`Couldn't verify the code. Wait a moment and try again.`)}});(0,E.useEffect)(()=>{v.current=e,e&&(_.current=!1,o(null),p(``),g(null),w.mutate({}))},[e]);let k=e=>{!e&&T.isPending||(!e&&a&&!_.current&&C(a.factor_id),t(e))},A=()=>{a&&navigator.clipboard.writeText(a.secret).then(()=>f.success(`Setup key copied.`)).catch(()=>f.error(`Couldn't copy the setup key.`))},j=()=>{!a||l.length!==6||T.isPending||(g(null),T.mutate({body:{challenge_id:a.challenge_id,code:l}}))};return(0,O.jsx)(d.Root,{open:e,onOpenChange:k,children:(0,O.jsxs)(d.Content,{size:`sm`,children:[(0,O.jsxs)(d.Header,{children:[(0,O.jsx)(d.Title,{children:`Set up authenticator app`}),(0,O.jsx)(d.Description,{children:`Scan the QR code with an authenticator app such as Google Authenticator or 1Password, then enter the 6-digit code it shows.`})]}),(0,O.jsx)(d.Body,{children:a===null?(0,O.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,O.jsx)(c,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,O.jsxs)(`form`,{className:`flex flex-col items-center gap-4`,onSubmit:e=>{e.preventDefault(),j()},children:[(0,O.jsx)(`img`,{src:a.qr_code,alt:`QR code for your authenticator app`,className:`h-44 w-44 rounded-lg bg-white p-2`}),(0,O.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,O.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Can't scan it? Enter this setup key manually:`}),(0,O.jsxs)(`button`,{type:`button`,onClick:A,className:`flex cursor-pointer items-center gap-2 self-start font-mono text-body-small-default text-[var(--content-default)] hover:text-[var(--content-emphasised)]`,children:[(0,O.jsx)(`span`,{className:`break-all text-left`,children:a.secret}),(0,O.jsx)(s,{className:`h-3.5 w-3.5 shrink-0`})]})]}),(0,O.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,O.jsx)(`label`,{htmlFor:`totp-code`,className:`text-body-small-default text-[var(--content-tertiary)]`,children:`6-digit code`}),(0,O.jsx)(u,{id:`totp-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,placeholder:`123456`,value:l,onChange:e=>p(e.target.value.replace(/\D/g,``).slice(0,6))}),h&&(0,O.jsx)(`p`,{role:`alert`,className:`text-body-small-default text-[var(--system-negative-strong)]`,children:h})]})]})}),(0,O.jsxs)(d.Footer,{children:[(0,O.jsx)(n,{variant:`outlined`,onClick:()=>k(!1),disabled:T.isPending,children:`Cancel`}),(0,O.jsx)(n,{onClick:j,disabled:a===null||l.length!==6||T.isPending,children:T.isPending?`Verifying…`:`Verify`})]})]})})}function A(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function j(){let e=i(),[t,r]=(0,E.useState)(!1),[o,s]=(0,E.useState)(null),u=a({...v()}),d=u.data??[],m=()=>e.invalidateQueries({queryKey:y()}),h=_({onSuccess:()=>{f.success(`Authenticator app removed.`),m()},onError:e=>{if(D(e)===`factor_not_found`){m();return}f.error(`Failed to remove the authenticator app. Please try again.`)}});return(0,O.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u.isPending?(0,O.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,O.jsx)(c,{className:`h-4 w-4 animate-spin`}),(0,O.jsx)(`span`,{className:`text-body-medium-default`,children:`Loading authenticator apps…`})]}):u.isError?(0,O.jsxs)(l,{tone:`error`,children:[`Couldn't load your authenticator apps.`,` `,(0,O.jsx)(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>void u.refetch(),children:`Try again`})]}):d.length===0?(0,O.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`No authenticator app is set up. Add one to require a one-time code at sign-in.`}):(0,O.jsx)(`ul`,{className:`flex flex-col divide-y divide-[var(--border-base)]`,children:d.map(e=>(0,O.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-3`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,O.jsx)(w,{className:`h-5 w-5 shrink-0 text-[var(--content-tertiary)]`}),(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Authenticator app`}),(0,O.jsxs)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:[e.user,e.created_at?` · Added ${A(e.created_at)}`:``]})]})]}),(0,O.jsx)(n,{variant:`dangerOutline`,onClick:()=>s(e),disabled:h.isPending,children:`Remove`})]},e.id))}),!u.isPending&&!u.isError&&d.length===0&&(0,O.jsx)(n,{onClick:()=>r(!0),className:`self-start`,children:`Add authenticator app`}),(0,O.jsx)(k,{open:t,onOpenChange:r}),(0,O.jsx)(p,{open:o!==null,title:`Remove authenticator app`,message:`Signing in will no longer ask for a code from this app. You can set up a new authenticator app at any time.`,confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{o&&h.mutate({path:{id:o.id}}),s(null)},onCancel:()=>s(null)})]})}function M(){let e=g.use.accountMfa(),t=g.use.hydrated(),n=C();return t&&!e?(0,O.jsx)(r,{replace:!0,to:h.settings.general}):!e||n===`gated`?null:(0,O.jsx)(`div`,{className:`space-y-4`,children:(0,O.jsx)(T,{title:`Two-Factor Authentication`,subtitle:`Require a code from an authenticator app when you sign in.`,children:n===`disabled`?(0,O.jsx)(S,{children:`Log in to the Vellum platform to manage two-factor authentication.`}):(0,O.jsx)(j,{})})})}export{M as SecurityPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./check-DFNrQERi.js";import{t as s}from"./modal-D5nLWNN9.js";import{t as c}from"./confirm-dialog-CSkhRFRk.js";import{A as l,F as u,M as d,d as f,lt as p,rt as ee,t as m}from"./local-mode-Bskd5bsT.js";import{t as h}from"./is-electron-y5bNUVyG.js";import{n as g}from"./resolved-assistants-store-DAzPZ1eV.js";import{D as _,O as v,i as te,n as y}from"./auth-store-CahendZw.js";import{c as b}from"./routes-DYcJgn9k.js";import{t as x}from"./use-onboarding-login-DHS-9ToL.js";import{Mn as S,Nn as C,ha as w,in as T,ta as E}from"./index-RjTgjtTV.js";import{r as D}from"./format-date-cTplgJ8P.js";var O=e(t(),1),k=a();function A({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:o,onRetire:l}){let[u,d]=(0,O.useState)(`menu`);(0,O.useEffect)(()=>{e&&d(`menu`)},[e]);let f=i?(0,k.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,k.jsx)(c,{open:e,title:`Repair Assistant?`,message:(0,k.jsxs)(k.Fragment,{children:[`Repairing re-provisions this assistant’s authentication token. Any other devices or browser sessions connected to it will be signed out and need to reconnect.`,f]}),confirmLabel:`Repair`,isPending:r,onConfirm:o,onCancel:()=>d(`menu`)}):u===`confirm-retire`?(0,k.jsx)(S,{open:e,isPending:r,extraMessage:f,onConfirm:l,onCancel:()=>d(`menu`)}):(0,k.jsx)(s.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,k.jsxs)(s.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,k.jsx)(s.Header,{children:(0,k.jsx)(s.Title,{children:`Can’t Authenticate Assistant`})}),(0,k.jsxs)(s.Body,{children:[(0,k.jsxs)(s.Description,{children:[`The authentication token for `,t,` is missing or can no longer be refreshed, so this assistant can’t be connected. You can repair it, retire it, or pick a different assistant.`]}),f,(0,k.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,k.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-repair`),children:`Wake & Repair`}),(0,k.jsx)(n,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-retire`),children:`Retire Assistant`}),(0,k.jsx)(n,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:`Cancel`})]})]})]})})}function j(e){return e.name?e.name:e.isLocal?`Local Assistant`:`Cloud Assistant`}function M(e){if(e.hatchedAt)return`Created ${D(e.hatchedAt)}`}function N(){let e=r(),[t]=i(),a=t.get(`fromLogin`)===`1`,o=t.get(`noAutoSkip`)===`1`,s=h(),c=te(),S=g.use.assistants(),w=_.use.currentOrganizationId(),{loading:E,error:D,login:M,cancel:N}=x(),F=e=>e.isLocal||c,I=S.filter(F),L=S.some(e=>e.isPlatformHosted)&&!c,[R,z]=(0,O.useState)(null),[B,V]=(0,O.useState)(!1),[H,U]=(0,O.useState)(!1),[W,G]=(0,O.useState)(null),[K,q]=(0,O.useState)(null),[J,Y]=(0,O.useState)(!1),[ne,X]=(0,O.useState)(null);(0,O.useEffect)(()=>{if(R!=null||I.length===0)return;let e=v(w);z(I.find(t=>t.id===e)?.id??I[0].id)},[R,I,w]);let Z=async t=>{V(!0),G(null);try{t.isLocal?await y.getState().connectLocalAssistant(t.id):await y.getState().connectPlatformAssistant(t.id),e(b.assistant,{replace:!0})}catch(e){console.error(`selectAssistant.handleConnect failed`,e),t.isLocal&&l()&&(d(e)||p(e)||e instanceof m)&&f(t.id)?q(t):G(`Failed to connect. Please try again.`),V(!1)}},Q=()=>{q(null),Y(!1),X(null),U(!1)},re=async()=>{if(!(!K||J)){Y(!0),X(null);try{let e=await u(K.id,{repairGuardian:!0});if(e.ok){ee(),Q(),Z(K);return}X(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),X(`Repair failed. Please try again.`)}Y(!1)}},ie=async()=>{if(!(!K||J)){Y(!0),X(null);try{let t=await C(K.id);if(t.ok){Q(),e(t.nextRoute,{replace:!0});return}X(t.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),X(`Failed to retire assistant. Please try again.`)}Y(!1)}};(0,O.useEffect)(()=>{a||o||B||H||S.length!==0&&S.length===1&&I.length===1&&(U(!0),Z(I[0]))},[S.length,I.length]);let ae=()=>{let e=S.find(e=>e.id===R);e&&Z(e)},oe=()=>{e(b.welcome)},$=D??W;return H&&!$&&!K?(0,k.jsx)(T,{children:(0,k.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Connecting to your assistant…`})})}):(0,k.jsxs)(T,{children:[(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${s?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,k.jsx)(`h1`,{className:s?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Choose an Assistant`}),(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${s?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Select which assistant you’d like to use.`}),$&&(0,k.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:$}),(0,k.jsx)(`div`,{className:`flex w-full flex-col ${s?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:S.map(e=>{let t=F(e);return(0,k.jsx)(P,{assistant:e,selected:R===e.id,disabled:!t,badge:!t&&e.isPlatformHosted?`Requires Account`:void 0,onSelect:()=>{t&&z(e.id)}},e.id)})}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${s?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[I.length>0&&(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:ae,disabled:!R||B,children:B?`Connecting…`:`Continue`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:()=>void e(`${b.onboarding.hosting}?from=select-assistant`),disabled:B||E,children:`Create New Assistant`}),L&&(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:E?N:()=>void M(),disabled:B,children:E?`Cancel`:`Log In`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:oe,disabled:B||E,children:`Back`})]})]}),(0,k.jsx)(A,{open:K!=null,assistantName:K?j(K):``,isPending:J,errorMessage:ne??void 0,onCancel:Q,onRepair:()=>void re(),onRetire:()=>void ie()})]})}function P({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=M(e),s=h();return(0,k.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:[`group flex w-full items-center border text-left`,s?`gap-3 rounded-lg p-3`:`gap-4 rounded-2xl px-5 py-4`,`transition-all duration-200 ease-out`,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-[var(--surface-secondary)]`,t&&!n?`border-[var(--primary-base)] bg-[var(--primary-base)]/[0.08] shadow-[inset_0_0_0_1px_var(--primary-base)]`:`border-[var(--border-element)] bg-transparent`].join(` `),children:[(0,k.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,s?`h-8 w-8 rounded-lg`:`h-10 w-10 rounded-xl`,t&&!n?`bg-[var(--primary-base)]/15 text-[var(--primary-base)]`:`bg-[var(--surface-tertiary)] text-[var(--content-secondary)]`].join(` `),children:e.isLocal?(0,k.jsx)(E,{className:`h-5 w-5`}):(0,k.jsx)(w,{className:`h-5 w-5`})}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:j(e)}),r&&(0,k.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${s?`text-label-medium-default`:`text-body-small-default`}`,children:r})]}),a&&(0,k.jsx)(`span`,{className:`mt-0.5 block text-[var(--content-tertiary)] ${s?`text-label-medium-default`:`text-body-small-default`}`,children:a})]}),!n&&(0,k.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:t&&(0,k.jsx)(o,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})}export{N as SelectAssistantScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./check-DFNrQERi.js";import{t as s}from"./modal-D5nLWNN9.js";import{t as c}from"./confirm-dialog-CSkhRFRk.js";import{A as l,F as u,M as d,d as f,lt as p,rt as ee,t as m}from"./local-mode-Bskd5bsT.js";import{t as h}from"./is-electron-y5bNUVyG.js";import{n as g}from"./resolved-assistants-store-DAzPZ1eV.js";import{D as _,O as v,i as te,n as y}from"./auth-store-CahendZw.js";import{c as b}from"./routes-DYcJgn9k.js";import{t as x}from"./use-onboarding-login-DHS-9ToL.js";import{Mn as S,Nn as C,ha as w,in as T,ta as E}from"./index-DZAcojtQ.js";import{r as D}from"./format-date-cTplgJ8P.js";var O=e(t(),1),k=a();function A({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:o,onRetire:l}){let[u,d]=(0,O.useState)(`menu`);(0,O.useEffect)(()=>{e&&d(`menu`)},[e]);let f=i?(0,k.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,k.jsx)(c,{open:e,title:`Repair Assistant?`,message:(0,k.jsxs)(k.Fragment,{children:[`Repairing re-provisions this assistant’s authentication token. Any other devices or browser sessions connected to it will be signed out and need to reconnect.`,f]}),confirmLabel:`Repair`,isPending:r,onConfirm:o,onCancel:()=>d(`menu`)}):u===`confirm-retire`?(0,k.jsx)(S,{open:e,isPending:r,extraMessage:f,onConfirm:l,onCancel:()=>d(`menu`)}):(0,k.jsx)(s.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,k.jsxs)(s.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,k.jsx)(s.Header,{children:(0,k.jsx)(s.Title,{children:`Can’t Authenticate Assistant`})}),(0,k.jsxs)(s.Body,{children:[(0,k.jsxs)(s.Description,{children:[`The authentication token for `,t,` is missing or can no longer be refreshed, so this assistant can’t be connected. You can repair it, retire it, or pick a different assistant.`]}),f,(0,k.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,k.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-repair`),children:`Wake & Repair`}),(0,k.jsx)(n,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-retire`),children:`Retire Assistant`}),(0,k.jsx)(n,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:`Cancel`})]})]})]})})}function j(e){return e.name?e.name:e.isLocal?`Local Assistant`:`Cloud Assistant`}function M(e){if(e.hatchedAt)return`Created ${D(e.hatchedAt)}`}function N(){let e=r(),[t]=i(),a=t.get(`fromLogin`)===`1`,o=t.get(`noAutoSkip`)===`1`,s=h(),c=te(),S=g.use.assistants(),w=_.use.currentOrganizationId(),{loading:E,error:D,login:M,cancel:N}=x(),F=e=>e.isLocal||c,I=S.filter(F),L=S.some(e=>e.isPlatformHosted)&&!c,[R,z]=(0,O.useState)(null),[B,V]=(0,O.useState)(!1),[H,U]=(0,O.useState)(!1),[W,G]=(0,O.useState)(null),[K,q]=(0,O.useState)(null),[J,Y]=(0,O.useState)(!1),[ne,X]=(0,O.useState)(null);(0,O.useEffect)(()=>{if(R!=null||I.length===0)return;let e=v(w);z(I.find(t=>t.id===e)?.id??I[0].id)},[R,I,w]);let Z=async t=>{V(!0),G(null);try{t.isLocal?await y.getState().connectLocalAssistant(t.id):await y.getState().connectPlatformAssistant(t.id),e(b.assistant,{replace:!0})}catch(e){console.error(`selectAssistant.handleConnect failed`,e),t.isLocal&&l()&&(d(e)||p(e)||e instanceof m)&&f(t.id)?q(t):G(`Failed to connect. Please try again.`),V(!1)}},Q=()=>{q(null),Y(!1),X(null),U(!1)},re=async()=>{if(!(!K||J)){Y(!0),X(null);try{let e=await u(K.id,{repairGuardian:!0});if(e.ok){ee(),Q(),Z(K);return}X(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),X(`Repair failed. Please try again.`)}Y(!1)}},ie=async()=>{if(!(!K||J)){Y(!0),X(null);try{let t=await C(K.id);if(t.ok){Q(),e(t.nextRoute,{replace:!0});return}X(t.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),X(`Failed to retire assistant. Please try again.`)}Y(!1)}};(0,O.useEffect)(()=>{a||o||B||H||S.length!==0&&S.length===1&&I.length===1&&(U(!0),Z(I[0]))},[S.length,I.length]);let ae=()=>{let e=S.find(e=>e.id===R);e&&Z(e)},oe=()=>{e(b.welcome)},$=D??W;return H&&!$&&!K?(0,k.jsx)(T,{children:(0,k.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Connecting to your assistant…`})})}):(0,k.jsxs)(T,{children:[(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${s?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,k.jsx)(`h1`,{className:s?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Choose an Assistant`}),(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${s?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Select which assistant you’d like to use.`}),$&&(0,k.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:$}),(0,k.jsx)(`div`,{className:`flex w-full flex-col ${s?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:S.map(e=>{let t=F(e);return(0,k.jsx)(P,{assistant:e,selected:R===e.id,disabled:!t,badge:!t&&e.isPlatformHosted?`Requires Account`:void 0,onSelect:()=>{t&&z(e.id)}},e.id)})}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${s?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[I.length>0&&(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:ae,disabled:!R||B,children:B?`Connecting…`:`Continue`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:()=>void e(`${b.onboarding.hosting}?from=select-assistant`),disabled:B||E,children:`Create New Assistant`}),L&&(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:E?N:()=>void M(),disabled:B,children:E?`Cancel`:`Log In`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:oe,disabled:B||E,children:`Back`})]})]}),(0,k.jsx)(A,{open:K!=null,assistantName:K?j(K):``,isPending:J,errorMessage:ne??void 0,onCancel:Q,onRepair:()=>void re(),onRetire:()=>void ie()})]})}function P({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=M(e),s=h();return(0,k.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:[`group flex w-full items-center border text-left`,s?`gap-3 rounded-lg p-3`:`gap-4 rounded-2xl px-5 py-4`,`transition-all duration-200 ease-out`,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-[var(--surface-secondary)]`,t&&!n?`border-[var(--primary-base)] bg-[var(--primary-base)]/[0.08] shadow-[inset_0_0_0_1px_var(--primary-base)]`:`border-[var(--border-element)] bg-transparent`].join(` `),children:[(0,k.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,s?`h-8 w-8 rounded-lg`:`h-10 w-10 rounded-xl`,t&&!n?`bg-[var(--primary-base)]/15 text-[var(--primary-base)]`:`bg-[var(--surface-tertiary)] text-[var(--content-secondary)]`].join(` `),children:e.isLocal?(0,k.jsx)(E,{className:`h-5 w-5`}):(0,k.jsx)(w,{className:`h-5 w-5`})}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:j(e)}),r&&(0,k.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${s?`text-label-medium-default`:`text-body-small-default`}`,children:r})]}),a&&(0,k.jsx)(`span`,{className:`mt-0.5 block text-[var(--content-tertiary)] ${s?`text-label-medium-default`:`text-body-small-default`}`,children:a})]}),!n&&(0,k.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:t&&(0,k.jsx)(o,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})}export{N as SelectAssistantScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,i as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./log-in--aqELu3z.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{i as c}from"./auth-store-CahendZw.js";import{c as l}from"./routes-DYcJgn9k.js";import{t as u}from"./client-feature-flag-store-Bm7cFUky.js";import{t as d}from"./use-onboarding-login-DHS-9ToL.js";import{t as f}from"./assistant-feature-flag-store-4edQKaeq.js";import{Ft as p,Ji as m,Ur as h,_r as g}from"./index-RjTgjtTV.js";import{n as _,t as v}from"./sidebar-tree-DDUEsAa4.js";var y=e(t(),1),b=a();function x(){let e=f.use.settingsDeveloperNav(),t=f.use.credentialsSettings(),a=u.use.platformNotifications(),x=u.use.bookmarks(),S=u.use.accountMfa(),C=h({platformHostedOnly:!0}),w=h(),{pathname:T}=i(),E=n(),D=c(),{login:O}=d(),k=(0,y.useMemo)(()=>p.filter(e=>!(e.id===`notifications`&&(!a||C===`gated`)||e.id===`billing`&&w!==`full`||e.id===`security`&&(!S||w===`gated`)||e.id===`bookmarks`&&!x||e.id===`credentials`&&!t||e.id===`devices`&&C===`gated`||e.id===`keyboard-shortcuts`&&!s()||e.id===`developer`)),[a,C,w,x,S,t]),A=(0,y.useMemo)(()=>{let t=[];return e&&t.push(...p.filter(e=>e.id===`developer`)),t.push(D?{id:`logout`,label:`Log Out`,icon:m,onSelect:()=>void g(E)}:{id:`login`,label:`Log In`,icon:o,onSelect:()=>void O()}),t},[e,D,E,O]),j=(0,y.useMemo)(()=>{if(T===l.settings.root)return`Settings`;let e=p.find(e=>T===e.href||T.startsWith(e.href+`/`));return e?e.label:`Settings`},[T]);return(0,b.jsx)(_,{backHref:l.assistant,sidebar:(0,b.jsx)(v,{items:k,bottomItems:A,indexPath:l.settings.root}),title:j,children:(0,b.jsx)(r,{})})}export{x as SettingsLayout};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,i as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./log-in--aqELu3z.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{i as c}from"./auth-store-CahendZw.js";import{c as l}from"./routes-DYcJgn9k.js";import{t as u}from"./client-feature-flag-store-Bm7cFUky.js";import{t as d}from"./use-onboarding-login-DHS-9ToL.js";import{t as f}from"./assistant-feature-flag-store-4edQKaeq.js";import{Ft as p,Ji as m,Ur as h,_r as g}from"./index-DZAcojtQ.js";import{n as _,t as v}from"./sidebar-tree-BZf-fXXQ.js";var y=e(t(),1),b=a();function x(){let e=f.use.settingsDeveloperNav(),t=f.use.credentialsSettings(),a=u.use.platformNotifications(),x=u.use.bookmarks(),S=u.use.accountMfa(),C=h({platformHostedOnly:!0}),w=h(),{pathname:T}=i(),E=n(),D=c(),{login:O}=d(),k=(0,y.useMemo)(()=>p.filter(e=>!(e.id===`notifications`&&(!a||C===`gated`)||e.id===`billing`&&w!==`full`||e.id===`security`&&(!S||w===`gated`)||e.id===`bookmarks`&&!x||e.id===`credentials`&&!t||e.id===`devices`&&C===`gated`||e.id===`keyboard-shortcuts`&&!s()||e.id===`developer`)),[a,C,w,x,S,t]),A=(0,y.useMemo)(()=>{let t=[];return e&&t.push(...p.filter(e=>e.id===`developer`)),t.push(D?{id:`logout`,label:`Log Out`,icon:m,onSelect:()=>void g(E)}:{id:`login`,label:`Log In`,icon:o,onSelect:()=>void O()}),t},[e,D,E,O]),j=(0,y.useMemo)(()=>{if(T===l.settings.root)return`Settings`;let e=p.find(e=>T===e.href||T.startsWith(e.href+`/`));return e?e.label:`Settings`},[T]);return(0,b.jsx)(_,{backHref:l.assistant,sidebar:(0,b.jsx)(v,{items:k,bottomItems:A,indexPath:l.settings.root}),title:j,children:(0,b.jsx)(r,{})})}export{x as SettingsLayout};
@@ -1 +1 @@
1
- import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{F as r,n as i,t as a}from"./button-amTXFI-2.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./bug-BsuQ5ciQ.js";import{t as l}from"./download-CAuK-nZ6.js";import{t as u}from"./info-DsOyuMO9.js";import{t as ee}from"./loader-circle-Cz7opInR.js";import{t as d}from"./x-CkSVp1Ok.js";import{t as f}from"./notice-DkcNAP8O.js";import{n as te,t as p}from"./input-CoUmPnRU.js";import{t as m}from"./toggle-CDfguvUz.js";import{t as h}from"./dropdown-ByHOpeOU.js";import{t as g}from"./is-electron-y5bNUVyG.js";import{in as _}from"./sdk.gen-BwnFjFcp.js";import{t as v}from"./impersonate-version-flag-BhxfH6iZ.js";import{n as y}from"./auth-store-CahendZw.js";import{t as b}from"./dist-RkT480s0.js";import{n as x}from"./diagnostics-BN1L7gE8.js";import{L as S}from"./react-query.gen-GVQbBTEp.js";import{$i as C,Bi as w,Gi as T,ki as ne,qi as re}from"./index-RjTgjtTV.js";var E=e(n(),1),ie=e(r(),1),D=`vellum:debug:`;function ae(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(D))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function O(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:v()},overrides:ae()}}var k=t({ShareFeedbackModal:()=>z}),A=s(),j=[{value:`bug_report`,label:`Bug Report`,icon:c,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:C,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:T,includesLogsByDefault:!1}],M=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],oe=M.map(e=>({value:e.value,label:e.label})),N=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),P=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),F=10,I=50*1024*1024,se={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function ce(){return g()?`electron`:b.getPlatform()===`ios`?`ios`:`web`}function le(e){if(e.size>I)return!1;if(e.type&&N.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?P.has(t):!1}return!1}function L(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function R(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await _({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function ue(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,s=new Date,c=M.find(t=>t.value===e),l=s.getTime(),u=c?.cutoffMs==null?null:l-c.cutoffMs,ee=u==null?null:new Date(u).toISOString(),d=null;try{d=i?.()??null}catch{d=null}let f=x(d),te={collected_at:s.toISOString(),time_range:e,cutoff:ee,log_window:{start_time_ms:u,end_time_ms:l},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},p=new TextEncoder,m=p.encode(JSON.stringify(te,null,2)),h=p.encode(JSON.stringify(f,null,2)),_=[L(`web-client-context.json`,m),L(`web-chat-diagnostics.json`,h)],v=new TextEncoder().encode(JSON.stringify(O(),null,2));_.push(L(`web-debug-flags.json`,v));for(let e of o){let t=e.contents.trim();t&&_.push(L(e.filename,p.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));_.push(L(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));_.push(L(`web-sse-liveness-triage.json`,n))}}catch{}if(g()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));_.push(L(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);_.push(L(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await R(t,{window:{startTime:u,endTime:l},activeConversationId:n});e&&_.push(L(`platform-logs.tar.gz`,e))}_.push(new Uint8Array(1024));let y=_.reduce((e,t)=>e+t.length,0),b=new Uint8Array(y),S=0;for(let e of _)b.set(e,S),S+=e.length;let C=new Blob([b.buffer]),w=await new Response(C.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([w],`web-client-logs-${s.getTime()}.tar.gz`,{type:`application/gzip`})}function z({open:e,onClose:t,initialReason:n,initialMessage:r,onSubmitted:s,assistantId:c,assistantVersion:_,activeConversationId:v,doctorSessionId:b,doctorSessionLog:x,getDiagnosticsSnapshot:C}){let T=y.use.user(),D=T?.email,ae=T?.isStaff??!1,O=(0,E.useId)(),k=(0,E.useRef)(null),M=(0,E.useRef)(null),N=(0,E.useRef)(null),P=(0,E.useRef)(null),[I,L]=(0,E.useState)(n??`bug_report`),[R,z]=(0,E.useState)(``),[B,pe]=(0,E.useState)(``),[V,H]=(0,E.useState)(j.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[me,he]=(0,E.useState)(!1),[U,W]=(0,E.useState)(`past_hour`),[G,K]=(0,E.useState)([]),[ge,q]=(0,E.useState)(null),[_e,J]=(0,E.useState)(!1),[Y,ve]=(0,E.useState)(!1),[X,ye]=(0,E.useState)(!1),Z=o(S()),[be,Q]=(0,E.useState)(!1),$=Z.isPending||be,xe=!D,Se=(0,E.useMemo)(()=>R.trim().length>0&&B.trim().length>0,[R,B]);(0,E.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;L(t),z(r??``),pe(D??``),H(j.find(e=>e.value===t)?.includesLogsByDefault??!0),he(!1),W(`past_hour`),K([]),ve(!1),ye(!1),q(null),Q(!1),Z.reset();let i=setTimeout(()=>{D?N.current?.focus():P.current?.focus()},50);return()=>clearTimeout(i)},[e]),(0,E.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let Ce=e=>{L(e),me||H(j.find(t=>t.value===e)?.includesLogsByDefault??!1)},we=()=>{H(e=>!e),he(!0)},Te=x?.trim()?[{filename:`doctor-session.txt`,contents:x}]:[],Ee=(0,E.useCallback)(e=>{e.key===`Escape`&&!$&&t()},[t,$]),De=(0,E.useCallback)(e=>{e.target===k.current&&!$&&t()},[t,$]),Oe=(0,E.useCallback)(e=>{K(t=>{let n=F-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!le(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),ke=e=>{e.target.files&&Oe(Array.from(e.target.files)),e.target.value=``},Ae=e=>{e.preventDefault(),J(!1),e.dataTransfer.files?.length&&Oe(Array.from(e.dataTransfer.files))},je=e=>{e.preventDefault(),J(!0)},Me=e=>{e.preventDefault(),e.currentTarget===e.target&&J(!1)},Ne=e=>{K(t=>t.filter((t,n)=>n!==e))};return e?(0,ie.createPortal)((0,A.jsx)(`div`,{ref:k,role:`dialog`,"aria-modal":`true`,"aria-labelledby":O,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:Ee,onClick:De,onDrop:Ae,onDragOver:je,onDragLeave:Me,children:(0,A.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,A.jsx)(`h2`,{id:O,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,A.jsx)(a,{variant:`ghost`,iconOnly:(0,A.jsx)(d,{}),onClick:t,disabled:$,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[ae&&(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,A.jsx)(m,{checked:X,onChange:()=>ye(e=>!e),"aria-label":`Download diagnostics directly`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Download diagnostics directly`})]}),(0,A.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Admin only — builds the diagnostics archive locally and downloads it instead of submitting feedback or notifying Slack.`})]}),X?(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Time range`}),(0,A.jsx)(h,{options:oe,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}):(0,A.jsxs)(A.Fragment,{children:[xe&&(0,A.jsx)(p,{id:`${O}-email`,ref:P,label:`Email`,type:`email`,placeholder:`you@example.com`,value:B,onChange:e=>pe(e.target.value),leftIcon:(0,A.jsx)(re,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,A.jsx)(`div`,{className:`flex gap-2`,children:j.map(e=>(0,A.jsx)(de,{option:e,isSelected:I===e.value,onSelect:()=>Ce(e.value)},e.value))})]}),(0,A.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),I===`bug_report`&&(0,A.jsxs)(f,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,A.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),I===`feature_request`&&(0,A.jsxs)(f,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,A.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,A.jsx)(te,{id:`${O}-message`,ref:N,label:I===`bug_report`?`What went wrong?`:I===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:I===`bug_report`?`What did you expect to happen, and what happened instead?`:I===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:R,onChange:e=>z(e.target.value),fullWidth:!0}),I!==`feature_request`&&(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,A.jsx)(m,{checked:V,onChange:we,"aria-label":`Include browser diagnostics`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,A.jsx)(i,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,A.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,A.jsx)(u,{className:`h-3.5 w-3.5`})})})]}),V&&(0,A.jsx)(h,{options:oe,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}),g()&&v&&I!==`feature_request`&&(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,A.jsx)(m,{checked:Y,onChange:()=>ve(e=>!e),"aria-label":`Include the most recent conversation`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,G.length>0&&(0,A.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,G.length,`/`,F]})]}),(0,A.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,A.jsx)(w,{}),onClick:()=>M.current?.click(),disabled:G.length>=F,children:`Add files`}),(0,A.jsx)(`input`,{ref:M,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:ke,className:`hidden`})]}),G.length>0&&(0,A.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:G.map((e,t)=>(0,A.jsx)(fe,{file:e,onRemove:()=>Ne(t)},`${e.name}-${t}`))}),_e&&(0,A.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]})]}),ge&&(0,A.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:ge})]}),(0,A.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,A.jsx)(ee,{className:`h-4 w-4 animate-spin`}),X?`Preparing diagnostics…`:`Sending feedback…`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{variant:`ghost`,onClick:t,children:`Cancel`}),X?(0,A.jsx)(a,{variant:`primary`,leftIcon:(0,A.jsx)(l,{}),onClick:async()=>{if(!$){q(null),Q(!0);try{let e=await ue(U,c??null,g()?Y?v??null:null:v??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te});if(!e){q(`Diagnostics export isn't supported in this browser.`);return}let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0),t()}catch(e){q(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:`Download diagnostics`}):(0,A.jsx)(a,{variant:`primary`,leftIcon:(0,A.jsx)(ne,{}),onClick:async()=>{if(!(!Se||$)){q(null),Q(!0);try{let e=V&&I!==`feature_request`?await ue(U,c??null,g()?Y?v??null:null:v??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te}):null;await Z.mutateAsync({headers:{"Content-Type":null},body:{message:R.trim(),classification:se[I],email:B.trim(),client:ce(),client_version:void 0,...c?{assistant_id:c}:{},..._?{assistant_version:_}:{},...b?{doctor_session_id:b}:{},...e?{logs_file:e}:{},...G.length?{attachments:G}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),s?.(),t()}catch(e){q(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!Se,children:`Submit`})]})})]})}),document.body):null}function de({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,A.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,A.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,A.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function fe({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,E.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,E.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,A.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,A.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,A.jsx)(w,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,A.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,A.jsx)(d,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{k as n,z as t};
1
+ import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{F as r,n as i,t as a}from"./button-amTXFI-2.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./bug-BsuQ5ciQ.js";import{t as l}from"./download-CAuK-nZ6.js";import{t as u}from"./info-DsOyuMO9.js";import{t as ee}from"./loader-circle-Cz7opInR.js";import{t as d}from"./x-CkSVp1Ok.js";import{t as f}from"./notice-DkcNAP8O.js";import{n as te,t as p}from"./input-CoUmPnRU.js";import{t as m}from"./toggle-CDfguvUz.js";import{t as h}from"./dropdown-ByHOpeOU.js";import{t as g}from"./is-electron-y5bNUVyG.js";import{in as _}from"./sdk.gen-BwnFjFcp.js";import{t as v}from"./impersonate-version-flag-BhxfH6iZ.js";import{n as y}from"./auth-store-CahendZw.js";import{t as b}from"./dist-RkT480s0.js";import{n as x}from"./diagnostics-BN1L7gE8.js";import{L as S}from"./react-query.gen-GVQbBTEp.js";import{$i as C,Bi as w,Gi as T,ki as ne,qi as re}from"./index-DZAcojtQ.js";var E=e(n(),1),ie=e(r(),1),D=`vellum:debug:`;function ae(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(D))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function O(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:v()},overrides:ae()}}var k=t({ShareFeedbackModal:()=>z}),A=s(),j=[{value:`bug_report`,label:`Bug Report`,icon:c,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:C,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:T,includesLogsByDefault:!1}],M=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],oe=M.map(e=>({value:e.value,label:e.label})),N=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),P=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),F=10,I=50*1024*1024,se={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function ce(){return g()?`electron`:b.getPlatform()===`ios`?`ios`:`web`}function le(e){if(e.size>I)return!1;if(e.type&&N.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?P.has(t):!1}return!1}function L(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function R(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await _({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function ue(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,s=new Date,c=M.find(t=>t.value===e),l=s.getTime(),u=c?.cutoffMs==null?null:l-c.cutoffMs,ee=u==null?null:new Date(u).toISOString(),d=null;try{d=i?.()??null}catch{d=null}let f=x(d),te={collected_at:s.toISOString(),time_range:e,cutoff:ee,log_window:{start_time_ms:u,end_time_ms:l},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},p=new TextEncoder,m=p.encode(JSON.stringify(te,null,2)),h=p.encode(JSON.stringify(f,null,2)),_=[L(`web-client-context.json`,m),L(`web-chat-diagnostics.json`,h)],v=new TextEncoder().encode(JSON.stringify(O(),null,2));_.push(L(`web-debug-flags.json`,v));for(let e of o){let t=e.contents.trim();t&&_.push(L(e.filename,p.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));_.push(L(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));_.push(L(`web-sse-liveness-triage.json`,n))}}catch{}if(g()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));_.push(L(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);_.push(L(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await R(t,{window:{startTime:u,endTime:l},activeConversationId:n});e&&_.push(L(`platform-logs.tar.gz`,e))}_.push(new Uint8Array(1024));let y=_.reduce((e,t)=>e+t.length,0),b=new Uint8Array(y),S=0;for(let e of _)b.set(e,S),S+=e.length;let C=new Blob([b.buffer]),w=await new Response(C.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([w],`web-client-logs-${s.getTime()}.tar.gz`,{type:`application/gzip`})}function z({open:e,onClose:t,initialReason:n,initialMessage:r,onSubmitted:s,assistantId:c,assistantVersion:_,activeConversationId:v,doctorSessionId:b,doctorSessionLog:x,getDiagnosticsSnapshot:C}){let T=y.use.user(),D=T?.email,ae=T?.isStaff??!1,O=(0,E.useId)(),k=(0,E.useRef)(null),M=(0,E.useRef)(null),N=(0,E.useRef)(null),P=(0,E.useRef)(null),[I,L]=(0,E.useState)(n??`bug_report`),[R,z]=(0,E.useState)(``),[B,pe]=(0,E.useState)(``),[V,H]=(0,E.useState)(j.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[me,he]=(0,E.useState)(!1),[U,W]=(0,E.useState)(`past_hour`),[G,K]=(0,E.useState)([]),[ge,q]=(0,E.useState)(null),[_e,J]=(0,E.useState)(!1),[Y,ve]=(0,E.useState)(!1),[X,ye]=(0,E.useState)(!1),Z=o(S()),[be,Q]=(0,E.useState)(!1),$=Z.isPending||be,xe=!D,Se=(0,E.useMemo)(()=>R.trim().length>0&&B.trim().length>0,[R,B]);(0,E.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;L(t),z(r??``),pe(D??``),H(j.find(e=>e.value===t)?.includesLogsByDefault??!0),he(!1),W(`past_hour`),K([]),ve(!1),ye(!1),q(null),Q(!1),Z.reset();let i=setTimeout(()=>{D?N.current?.focus():P.current?.focus()},50);return()=>clearTimeout(i)},[e]),(0,E.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let Ce=e=>{L(e),me||H(j.find(t=>t.value===e)?.includesLogsByDefault??!1)},we=()=>{H(e=>!e),he(!0)},Te=x?.trim()?[{filename:`doctor-session.txt`,contents:x}]:[],Ee=(0,E.useCallback)(e=>{e.key===`Escape`&&!$&&t()},[t,$]),De=(0,E.useCallback)(e=>{e.target===k.current&&!$&&t()},[t,$]),Oe=(0,E.useCallback)(e=>{K(t=>{let n=F-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!le(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),ke=e=>{e.target.files&&Oe(Array.from(e.target.files)),e.target.value=``},Ae=e=>{e.preventDefault(),J(!1),e.dataTransfer.files?.length&&Oe(Array.from(e.dataTransfer.files))},je=e=>{e.preventDefault(),J(!0)},Me=e=>{e.preventDefault(),e.currentTarget===e.target&&J(!1)},Ne=e=>{K(t=>t.filter((t,n)=>n!==e))};return e?(0,ie.createPortal)((0,A.jsx)(`div`,{ref:k,role:`dialog`,"aria-modal":`true`,"aria-labelledby":O,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:Ee,onClick:De,onDrop:Ae,onDragOver:je,onDragLeave:Me,children:(0,A.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,A.jsx)(`h2`,{id:O,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,A.jsx)(a,{variant:`ghost`,iconOnly:(0,A.jsx)(d,{}),onClick:t,disabled:$,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[ae&&(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,A.jsx)(m,{checked:X,onChange:()=>ye(e=>!e),"aria-label":`Download diagnostics directly`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Download diagnostics directly`})]}),(0,A.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Admin only — builds the diagnostics archive locally and downloads it instead of submitting feedback or notifying Slack.`})]}),X?(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Time range`}),(0,A.jsx)(h,{options:oe,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}):(0,A.jsxs)(A.Fragment,{children:[xe&&(0,A.jsx)(p,{id:`${O}-email`,ref:P,label:`Email`,type:`email`,placeholder:`you@example.com`,value:B,onChange:e=>pe(e.target.value),leftIcon:(0,A.jsx)(re,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,A.jsx)(`div`,{className:`flex gap-2`,children:j.map(e=>(0,A.jsx)(de,{option:e,isSelected:I===e.value,onSelect:()=>Ce(e.value)},e.value))})]}),(0,A.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),I===`bug_report`&&(0,A.jsxs)(f,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,A.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),I===`feature_request`&&(0,A.jsxs)(f,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,A.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,A.jsx)(te,{id:`${O}-message`,ref:N,label:I===`bug_report`?`What went wrong?`:I===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:I===`bug_report`?`What did you expect to happen, and what happened instead?`:I===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:R,onChange:e=>z(e.target.value),fullWidth:!0}),I!==`feature_request`&&(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,A.jsx)(m,{checked:V,onChange:we,"aria-label":`Include browser diagnostics`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,A.jsx)(i,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,A.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,A.jsx)(u,{className:`h-3.5 w-3.5`})})})]}),V&&(0,A.jsx)(h,{options:oe,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}),g()&&v&&I!==`feature_request`&&(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,A.jsx)(m,{checked:Y,onChange:()=>ve(e=>!e),"aria-label":`Include the most recent conversation`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,G.length>0&&(0,A.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,G.length,`/`,F]})]}),(0,A.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,A.jsx)(w,{}),onClick:()=>M.current?.click(),disabled:G.length>=F,children:`Add files`}),(0,A.jsx)(`input`,{ref:M,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:ke,className:`hidden`})]}),G.length>0&&(0,A.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:G.map((e,t)=>(0,A.jsx)(fe,{file:e,onRemove:()=>Ne(t)},`${e.name}-${t}`))}),_e&&(0,A.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]})]}),ge&&(0,A.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:ge})]}),(0,A.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,A.jsx)(ee,{className:`h-4 w-4 animate-spin`}),X?`Preparing diagnostics…`:`Sending feedback…`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{variant:`ghost`,onClick:t,children:`Cancel`}),X?(0,A.jsx)(a,{variant:`primary`,leftIcon:(0,A.jsx)(l,{}),onClick:async()=>{if(!$){q(null),Q(!0);try{let e=await ue(U,c??null,g()?Y?v??null:null:v??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te});if(!e){q(`Diagnostics export isn't supported in this browser.`);return}let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0),t()}catch(e){q(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:`Download diagnostics`}):(0,A.jsx)(a,{variant:`primary`,leftIcon:(0,A.jsx)(ne,{}),onClick:async()=>{if(!(!Se||$)){q(null),Q(!0);try{let e=V&&I!==`feature_request`?await ue(U,c??null,g()?Y?v??null:null:v??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te}):null;await Z.mutateAsync({headers:{"Content-Type":null},body:{message:R.trim(),classification:se[I],email:B.trim(),client:ce(),client_version:void 0,...c?{assistant_id:c}:{},..._?{assistant_version:_}:{},...b?{doctor_session_id:b}:{},...e?{logs_file:e}:{},...G.length?{attachments:G}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),s?.(),t()}catch(e){q(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!Se,children:`Submit`})]})})]})}),document.body):null}function de({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,A.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,A.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,A.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function fe({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,E.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,E.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,A.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,A.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,A.jsx)(w,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,A.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,A.jsx)(d,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{k as n,z as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,t as i,u as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-D5f7kt80.js";import{t as c}from"./arrow-left-DI9551VI.js";import{t as l}from"./chevron-right-DqqmezXC.js";import{i as u}from"./src-DZbMXyC2.js";import{t as d}from"./is-electron-y5bNUVyG.js";import{c as f}from"./routes-DYcJgn9k.js";import{Pn as p,br as m,mn as h}from"./index-RjTgjtTV.js";import{t as g}from"./use-edge-swipe-back-BYWAzQmV.js";var _=e(t(),1),v=o();function y({sidebar:e,children:t,actions:o,backHref:l,title:u=`Settings`,menuRoute:y=f.settings.root}){let{pathname:b}=a(),x=r(),S=b===y,C=m(),w=(0,_.useRef)(null),T=(0,_.useRef)(null);(0,_.useLayoutEffect)(()=>{T.current?.scrollTo(0,0)},[b]);let E=S?l:y;g({containerRef:w,onBack:(0,_.useCallback)(()=>{x(E)},[x,E]),enabled:C,navKey:b});let D=d(),O=S?`Back from ${u}`:`Back to ${u} menu`,k=(0,v.jsx)(n,{variant:`ghost`,iconOnly:(0,v.jsx)(c,{}),"aria-label":O,tintColor:`var(--content-secondary)`,onClick:()=>x(E)}),A=(0,v.jsx)(n,{asChild:!0,variant:`outlined`,"aria-label":`Back from ${u}`,className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,v.jsx)(i,{to:l,className:`flex items-center justify-center no-underline`,children:(0,v.jsx)(c,{size:16,"aria-hidden":`true`})})});return(0,v.jsxs)(`div`,{ref:w,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:D?`3.75rem`:`1rem`},children:[(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[k,(0,v.jsx)(s,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:u}),(0,v.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),D?(0,v.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,v.jsx)(p,{placement:`electron`,className:`px-0 pt-0`}),(0,v.jsx)(h,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,v.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,v.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[A,(0,v.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:u})]}),(0,v.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,v.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,v.jsx)(`aside`,{className:`hidden w-64 shrink-0 overflow-y-auto md:block`,"aria-label":`${u} navigation`,children:e}),S?(0,v.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pb-6 md:hidden`,children:e}):null,(0,v.jsx)(`main`,{ref:T,className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto overflow-x-hidden pb-6 md:flex md:px-6 md:pt-0 ${S?`hidden`:`flex`}`,children:t})]})]})]})}function b({items:e,bottomItems:t,indexPath:n}){let{pathname:i}=a(),o=r(),s=m(),c=(e,t,r)=>{let{href:a,onSelect:c}=e,d=a!=null&&(i===a||i.startsWith(a+`/`)||!s&&r&&n!=null&&i===n);return(0,v.jsxs)(_.Fragment,{children:[(0,v.jsx)(u.Item,{icon:e.icon,label:e.label,active:d,trailingIcon:a==null?void 0:l,trailingIconClassName:a==null?void 0:`md:hidden`,href:a,onSelect:c,onClick:a==null?void 0:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),o(a))}}),!t&&(0,v.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,v.jsxs)(`nav`,{"aria-label":`Sidebar navigation`,className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>c(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`div`,{className:`flex-1`}),(0,v.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>c(e,n===t.length-1,!1))]})]})}export{y as n,b as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,t as i,u as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-D5f7kt80.js";import{t as c}from"./arrow-left-DI9551VI.js";import{t as l}from"./chevron-right-DqqmezXC.js";import{i as u}from"./src-DZbMXyC2.js";import{t as d}from"./is-electron-y5bNUVyG.js";import{c as f}from"./routes-DYcJgn9k.js";import{Pn as p,br as m,mn as h}from"./index-DZAcojtQ.js";import{t as g}from"./use-edge-swipe-back-DYSaS9WM.js";var _=e(t(),1),v=o();function y({sidebar:e,children:t,actions:o,backHref:l,title:u=`Settings`,menuRoute:y=f.settings.root}){let{pathname:b}=a(),x=r(),S=b===y,C=m(),w=(0,_.useRef)(null),T=(0,_.useRef)(null);(0,_.useLayoutEffect)(()=>{T.current?.scrollTo(0,0)},[b]);let E=S?l:y;g({containerRef:w,onBack:(0,_.useCallback)(()=>{x(E)},[x,E]),enabled:C,navKey:b});let D=d(),O=S?`Back from ${u}`:`Back to ${u} menu`,k=(0,v.jsx)(n,{variant:`ghost`,iconOnly:(0,v.jsx)(c,{}),"aria-label":O,tintColor:`var(--content-secondary)`,onClick:()=>x(E)}),A=(0,v.jsx)(n,{asChild:!0,variant:`outlined`,"aria-label":`Back from ${u}`,className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,v.jsx)(i,{to:l,className:`flex items-center justify-center no-underline`,children:(0,v.jsx)(c,{size:16,"aria-hidden":`true`})})});return(0,v.jsxs)(`div`,{ref:w,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:D?`3.75rem`:`1rem`},children:[(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[k,(0,v.jsx)(s,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:u}),(0,v.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),D?(0,v.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,v.jsx)(p,{placement:`electron`,className:`px-0 pt-0`}),(0,v.jsx)(h,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,v.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,v.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[A,(0,v.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:u})]}),(0,v.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,v.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,v.jsx)(`aside`,{className:`hidden w-64 shrink-0 overflow-y-auto md:block`,"aria-label":`${u} navigation`,children:e}),S?(0,v.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pb-6 md:hidden`,children:e}):null,(0,v.jsx)(`main`,{ref:T,className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto overflow-x-hidden pb-6 md:flex md:px-6 md:pt-0 ${S?`hidden`:`flex`}`,children:t})]})]})]})}function b({items:e,bottomItems:t,indexPath:n}){let{pathname:i}=a(),o=r(),s=m(),c=(e,t,r)=>{let{href:a,onSelect:c}=e,d=a!=null&&(i===a||i.startsWith(a+`/`)||!s&&r&&n!=null&&i===n);return(0,v.jsxs)(_.Fragment,{children:[(0,v.jsx)(u.Item,{icon:e.icon,label:e.label,active:d,trailingIcon:a==null?void 0:l,trailingIconClassName:a==null?void 0:`md:hidden`,href:a,onSelect:c,onClick:a==null?void 0:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),o(a))}}),!t&&(0,v.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,v.jsxs)(`nav`,{"aria-label":`Sidebar navigation`,className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>c(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`div`,{className:`flex-1`}),(0,v.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>c(e,n===t.length-1,!1))]})]})}export{y as n,b as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{f as i}from"./native-biometric-Dy5Vb7o0.js";import{n as a,r as o}from"./login-flow-D2FFf5y7.js";import{t as s}from"./proxy-Cadlowdl.js";import{t as c}from"./AnimatePresence-TZWSGjkI.js";import{lt as l}from"./index-RjTgjtTV.js";import{t as u}from"./signup-shell-DCGARCES.js";var d=e(t(),1),f=r();function p({words:e}){let[t,n]=(0,d.useState)(0),r=(0,d.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,d.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,f.jsxs)(`span`,{className:`signup__rotating`,children:[(0,f.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,f.jsx)(c,{mode:`wait`,children:(0,f.jsxs)(s.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var m=[`Personal Intelligence`,`Software Engineer`,`Finance Ops`,`Household Manager`,`GTM Engineer`,`Product Lead`];function h({returnTo:e}){let[t,n]=(0,d.useState)(null),r=o(e,{authIntent:`signup`});return(0,f.jsxs)(u,{children:[(0,f.jsxs)(`h1`,{className:`signup__title`,children:[`Meet your new`,(0,f.jsx)(`br`,{}),(0,f.jsx)(p,{words:m})]}),(0,f.jsx)(`p`,{className:`signup__subtitle`,children:`The most powerful assistant that can handle your work and life admin tasks.`}),(0,f.jsx)(`div`,{className:`signup__buttons`,children:(0,f.jsx)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>{n(null),i(a,r,{returnTo:e,intent:`signup`}).catch(e=>{console.error(`[signup] auth flow failed:`,e),n(`Something went wrong. Please try again.`)})},children:`Continue`})}),t&&(0,f.jsx)(`p`,{className:`signup__error`,children:t}),(0,f.jsxs)(`p`,{className:`signup__footer`,children:[`Already have an account?`,` `,(0,f.jsx)(`button`,{type:`button`,className:`signup__link`,onClick:()=>{n(null),i(a,o(e),{returnTo:e}).catch(e=>{console.error(`[signup] sign-in flow failed:`,e),n(`Something went wrong. Please try again.`)})},children:`Sign in`})]}),(0,f.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,f.jsx)(l,{size:16}),`Download for macOS`]})]})}function g(){let[e]=n();return(0,f.jsx)(h,{returnTo:e.get(`returnTo`)})}export{g as SignupPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{f as i}from"./native-biometric-Dy5Vb7o0.js";import{n as a,r as o}from"./login-flow-D2FFf5y7.js";import{t as s}from"./proxy-Cadlowdl.js";import{t as c}from"./AnimatePresence-TZWSGjkI.js";import{lt as l}from"./index-DZAcojtQ.js";import{t as u}from"./signup-shell-DCGARCES.js";var d=e(t(),1),f=r();function p({words:e}){let[t,n]=(0,d.useState)(0),r=(0,d.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,d.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,f.jsxs)(`span`,{className:`signup__rotating`,children:[(0,f.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,f.jsx)(c,{mode:`wait`,children:(0,f.jsxs)(s.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var m=[`Personal Intelligence`,`Software Engineer`,`Finance Ops`,`Household Manager`,`GTM Engineer`,`Product Lead`];function h({returnTo:e}){let[t,n]=(0,d.useState)(null),r=o(e,{authIntent:`signup`});return(0,f.jsxs)(u,{children:[(0,f.jsxs)(`h1`,{className:`signup__title`,children:[`Meet your new`,(0,f.jsx)(`br`,{}),(0,f.jsx)(p,{words:m})]}),(0,f.jsx)(`p`,{className:`signup__subtitle`,children:`The most powerful assistant that can handle your work and life admin tasks.`}),(0,f.jsx)(`div`,{className:`signup__buttons`,children:(0,f.jsx)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>{n(null),i(a,r,{returnTo:e,intent:`signup`}).catch(e=>{console.error(`[signup] auth flow failed:`,e),n(`Something went wrong. Please try again.`)})},children:`Continue`})}),t&&(0,f.jsx)(`p`,{className:`signup__error`,children:t}),(0,f.jsxs)(`p`,{className:`signup__footer`,children:[`Already have an account?`,` `,(0,f.jsx)(`button`,{type:`button`,className:`signup__link`,onClick:()=>{n(null),i(a,o(e),{returnTo:e}).catch(e=>{console.error(`[signup] sign-in flow failed:`,e),n(`Something went wrong. Please try again.`)})},children:`Sign in`})]}),(0,f.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,f.jsx)(l,{size:16}),`Download for macOS`]})]})}function g(){let[e]=n();return(0,f.jsx)(h,{returnTo:e.get(`returnTo`)})}export{g as SignupPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{F as r,t as i}from"./button-amTXFI-2.js";import{d as a,p as o,r as s,u as c}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./jsx-runtime-CVSDxk6A.js";import{t as f}from"./card-Bv5O5juh.js";import{t as p}from"./createLucideIcon-IRfcSUxS.js";import{t as m}from"./arrow-left-DI9551VI.js";import{a as h,i as g,n as _,r as v,s as y,t as b}from"./use-skill-actions-BPNpVrzC.js";import{t as x}from"./chevron-down-qD-re7AW.js";import{t as S}from"./menu-Dy5QbnTj.js";import{t as C}from"./code-Czx7d7SK.js";import{t as w}from"./external-link-Dqpx9nRm.js";import{t as T}from"./file-text-CYJz-GvF.js";import{t as E}from"./loader-circle-Cz7opInR.js";import"./src-DZbMXyC2.js";import{n as D}from"./stat-square-CTHnQ1jc.js";import{n as O,t as k}from"./file-markdown-ZKvQUuGy.js";import{St as A,bt as j,on as M}from"./react-query.gen-C6wVk6Rw.js";import{c as N}from"./routes-DYcJgn9k.js";import{Ma as P,br as F,sa as I,ua as L,vi as R}from"./index-RjTgjtTV.js";import{t as z}from"./use-active-assistant-id-CGeH4Gl6.js";import{n as B,t as V}from"./use-skill-detail-files-iXFvM76E.js";import{n as H,r as U,t as ee}from"./skills-DSdrs4Rb.js";import{t as te}from"./use-edge-swipe-back-BYWAzQmV.js";import{i as W,n as G,r as K,t as q}from"./file-editor-CgjwckHX.js";import{t as J}from"./skill-icon-CgzIQCTT.js";var Y=p(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),X=e(n(),1),Z=d();function ne({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:a,isInstalling:o=!1,isRemoving:s=!1,sourceConversationId:c}){let l=h(t),u=H(t),{fileEntries:d,setSelectedPath:p,activePath:g,activeFile:_,isFilesLoading:v,fileContent:b,isBinary:x,isContentLoading:S}=V(e,t.id);return(0,Z.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] flex-col`,children:[(0,Z.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,Z.jsx)(i,{type:`button`,variant:`ghost`,iconOnly:(0,Z.jsx)(m,{"aria-hidden":!0}),"aria-label":`Back to skills`,onClick:n}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,Z.jsx)(J,{skill:t,className:`h-8 w-8 text-3xl`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Z.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t.name}),(0,Z.jsx)(y,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}),(0,Z.jsx)(B,{skill:{origin:t.origin,sourceConversationId:c},className:`mt-1`})]})]}),l?o?(0,Z.jsx)(`div`,{className:`flex h-9 items-center px-3`,children:(0,Z.jsx)(E,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):(0,Z.jsx)(i,{type:`button`,onClick:r,disabled:!r,leftIcon:(0,Z.jsx)(P,{"aria-hidden":!0}),children:`Install`}):(0,Z.jsx)(i,{type:`button`,variant:u?`dangerOutline`:`outlined`,onClick:a,disabled:!u||s||!a,leftIcon:s?(0,Z.jsx)(E,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(R,{"aria-hidden":!0}),children:`Remove`})]})]}),(0,Z.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden sm:grid`,style:{gridTemplateColumns:`240px 1fr`},children:[(0,Z.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto border-b p-2 sm:max-h-none sm:border-b-0 sm:border-r`,style:{borderColor:`var(--border-base)`},children:v?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Z.jsx)(E,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):d.length===0?(0,Z.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files available.`}):d.map(e=>{let t=g===e.path,n=(e.mimeType??``).endsWith(`/directory`);return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>p(e.path),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:t?`var(--primary-base)`:`var(--content-default)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:void 0},children:[n?(0,Z.jsx)(I,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-mid-strong)`}}):(0,Z.jsx)(T,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)})}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:S?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(E,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):_?(0,Z.jsx)(re,{assistantId:e,skillId:t.id,fileName:_.name,filePath:_.path,content:b,isBinary:x,editable:t.kind===`installed`},`${t.id}/${_.path}`):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]})}function re({assistantId:e,skillId:n,fileName:r,filePath:o,content:s,isBinary:c,editable:u}){let d=a(),f=l(),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(``),_=`skills/${n}/${o}`,v=M({onSuccess:()=>{m(!1),g(``),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesContentGet`}]}),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesGet`}]}),o===`SKILL.md`&&ee(f,e)},onError:e=>{t(e,{context:`skill-file-save`,bestEffort:!0})}}),y=p&&h!==(s??``),b=(0,X.useCallback)(()=>{!y||v.isPending||v.mutate({path:{assistant_id:e},body:{path:_,content:h,encoding:`utf8`}})},[y,v,e,_,h]),x=(0,X.useCallback)(()=>{m(!0),g(s??``),v.reset()},[s,v]),S=(0,X.useCallback)(()=>{m(!1),g(``),v.reset()},[v]);if(c)return(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`});if(s===null)return(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,r,`.`]});let C=u?(0,Z.jsx)(i,{variant:`ghost`,size:`regular`,iconOnly:(0,Z.jsx)(w,{"aria-hidden":!0}),onClick:()=>d(`${N.workspace}?file=${encodeURIComponent(_)}`),"aria-label":`Open in Workspace`,className:`hover:bg-[var(--surface-base)]`}):void 0;return O(r,void 0)&&!p?(0,Z.jsx)(`div`,{className:`relative flex h-full flex-col`,children:(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:[(0,Z.jsx)(q,{content:s,fileName:r,showEdit:u,isEditing:!1,onToggleEdit:x,extraActions:C}),(0,Z.jsx)(k,{content:s})]})}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(q,{content:p?h:s,fileName:r,showEdit:u,isEditing:p,onToggleEdit:()=>p?S():x(),extraActions:C}),p?(0,Z.jsx)(K,{value:h,onChange:g,onSave:b}):(0,Z.jsx)(W,{content:s,readOnly:!u,onStartEdit:x})]}),p&&(0,Z.jsx)(G,{isDirty:y,isSaving:v.isPending,error:v.isError?`Save failed`:null,onSave:b,onDiscard:S})]})}var ie=e(r(),1);function ae({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`}):t===null?(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,e,`.`]}):O(e,void 0)&&r===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(k,{content:t})}):(0,Z.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function Q({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:a,isInstalling:o=!1,isRemoving:s=!1,swipeContainerRef:c,sourceConversationId:l}){let u=h(t),d=H(t),{fileEntries:p,setSelectedPath:g,activePath:_,activeFile:v,isFilesLoading:b,fileContent:x,isBinary:S,isContentLoading:w}=V(e,t.id),[T,k]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{k(`preview`)},[_]);let[A,j]=(0,X.useState)(null);(0,X.useEffect)(()=>{j(document.getElementById(`viewport-overlays`))},[]);let M=v?O(v.name,void 0):!1,N=M?T:`raw`,P=(0,Z.jsxs)(`div`,{ref:c,className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(m,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:t.name}),(0,Z.jsx)(oe,{available:u,removable:d,isInstalling:o,isRemoving:s,onInstall:r,onRemove:a})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(J,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(y,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description}),(0,Z.jsx)(B,{skill:{origin:t.origin,sourceConversationId:l}})]}),(0,Z.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(ce,{fileEntries:p,activePath:_,activeName:v?.name??null,onSelect:g}),(0,Z.jsx)(D,{iconOnly:!0,ariaLabel:`File view mode`,value:N,onChange:k,items:[{value:`preview`,label:`Preview`,icon:(0,Z.jsx)(L,{"aria-hidden":!0}),disabled:!M},{value:`raw`,label:`Source`,icon:(0,Z.jsx)(C,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:b||w?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(E,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):v?(0,Z.jsx)(ae,{fileName:v.name,content:x,isBinary:S,viewMode:N}):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]});return A?(0,ie.createPortal)(P,A):P}function oe({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:a,onRemove:o}){return n||r?(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(E,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(P,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:a,disabled:!a,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(i,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Remove skill`,onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Z.jsx)(i,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:`Bundled skills cannot be removed`,"aria-label":`Bundled skill cannot be removed`,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function se(e){return(e??``).endsWith(`/directory`)}function ce({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)($,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i})]}):(0,Z.jsxs)(S.Root,{children:[(0,Z.jsx)(S.Trigger,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)($,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i}),(0,Z.jsx)(x,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(S.Content,{align:`start`,children:e.map(e=>{let n=se(e.mimeType);return(0,Z.jsx)(S.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Z.jsx)(I,{}):(0,Z.jsx)(T,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function $(){return(0,Z.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Z.jsx)(T,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}function le(){let e=z(),{skillId:t}=o(),n=a(),r=c(),{pathname:l}=r,d=F(),f=(0,X.useRef)(null),p=r.state,h=typeof p?.listSearch==`string`?p.listSearch:``,y=u({...A({path:{assistant_id:e},query:{include:`catalog`}}),select:e=>e.skills,refetchOnMount:`always`}),x=(0,X.useCallback)(()=>{n(`${N.skills.root}${h}`,{replace:!0})},[n,h]);te({containerRef:f,onBack:x,enabled:d,navKey:l});let{handleInstall:S,handleRemove:C,isInstallingSkill:w,isRemovingSkill:T,skillPendingRemoval:E,confirmRemove:D,cancelRemove:O}=b(e,{onRemoved:x}),k=y.data,M=(0,X.useMemo)(()=>k?.find(e=>e.id===t)??null,[k,t]),P=u({...j({path:{assistant_id:e,id:t??``}}),enabled:!!t&&M?.origin===`assistant-memory`,select:e=>e.skill.origin===`assistant-memory`?e.skill.sourceConversationId??null:null});if(!t)return(0,Z.jsx)(s,{to:N.skills.root,replace:!0});if(y.isLoading)return(0,Z.jsx)(_,{});if(y.isError&&!M)return(0,Z.jsx)(v,{});if(!M&&y.isFetching)return(0,Z.jsx)(_,{});if(!M)return(0,Z.jsx)(g,{icon:Y,title:`Skill not found`,subtitle:`This skill may have been removed, or the link is out of date.`,children:(0,Z.jsx)(i,{type:`button`,variant:`outlined`,className:`mt-4`,leftIcon:(0,Z.jsx)(m,{"aria-hidden":!0}),onClick:x,children:`Back to skills`})});let I={assistantId:e,skill:M,onBack:x,onInstall:()=>S(M),onRemove:()=>C(M),isInstalling:w(M),isRemoving:T(M),sourceConversationId:P.data??void 0};return(0,Z.jsxs)(Z.Fragment,{children:[d?(0,Z.jsx)(Q,{...I,swipeContainerRef:f}):(0,Z.jsx)(ne,{...I}),(0,Z.jsx)(U,{skillName:E?.name??null,onConfirm:D,onCancel:O})]})}export{le as SkillDetailPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{F as r,t as i}from"./button-amTXFI-2.js";import{d as a,p as o,r as s,u as c}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./jsx-runtime-CVSDxk6A.js";import{t as f}from"./card-Bv5O5juh.js";import{t as p}from"./createLucideIcon-IRfcSUxS.js";import{t as m}from"./arrow-left-DI9551VI.js";import{a as h,i as g,n as _,r as v,s as y,t as b}from"./use-skill-actions-CYhk4mEs.js";import{t as x}from"./chevron-down-qD-re7AW.js";import{t as S}from"./menu-Dy5QbnTj.js";import{t as C}from"./code-Czx7d7SK.js";import{t as w}from"./external-link-Dqpx9nRm.js";import{t as T}from"./file-text-CYJz-GvF.js";import{t as E}from"./loader-circle-Cz7opInR.js";import"./src-DZbMXyC2.js";import{n as D}from"./stat-square-CTHnQ1jc.js";import{n as O,t as k}from"./file-markdown-ZKvQUuGy.js";import{St as A,bt as j,on as M}from"./react-query.gen-C6wVk6Rw.js";import{c as N}from"./routes-DYcJgn9k.js";import{Ma as P,br as F,sa as I,ua as L,vi as R}from"./index-DZAcojtQ.js";import{t as z}from"./use-active-assistant-id-CGeH4Gl6.js";import{n as B,t as V}from"./use-skill-detail-files-DROqozrr.js";import{n as H,r as U,t as ee}from"./skills-DSdrs4Rb.js";import{t as te}from"./use-edge-swipe-back-DYSaS9WM.js";import{i as W,n as G,r as K,t as q}from"./file-editor-CgjwckHX.js";import{t as J}from"./skill-icon-CgzIQCTT.js";var Y=p(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),X=e(n(),1),Z=d();function ne({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:a,isInstalling:o=!1,isRemoving:s=!1,sourceConversationId:c}){let l=h(t),u=H(t),{fileEntries:d,setSelectedPath:p,activePath:g,activeFile:_,isFilesLoading:v,fileContent:b,isBinary:x,isContentLoading:S}=V(e,t.id);return(0,Z.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] flex-col`,children:[(0,Z.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,Z.jsx)(i,{type:`button`,variant:`ghost`,iconOnly:(0,Z.jsx)(m,{"aria-hidden":!0}),"aria-label":`Back to skills`,onClick:n}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,Z.jsx)(J,{skill:t,className:`h-8 w-8 text-3xl`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Z.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t.name}),(0,Z.jsx)(y,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}),(0,Z.jsx)(B,{skill:{origin:t.origin,sourceConversationId:c},className:`mt-1`})]})]}),l?o?(0,Z.jsx)(`div`,{className:`flex h-9 items-center px-3`,children:(0,Z.jsx)(E,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):(0,Z.jsx)(i,{type:`button`,onClick:r,disabled:!r,leftIcon:(0,Z.jsx)(P,{"aria-hidden":!0}),children:`Install`}):(0,Z.jsx)(i,{type:`button`,variant:u?`dangerOutline`:`outlined`,onClick:a,disabled:!u||s||!a,leftIcon:s?(0,Z.jsx)(E,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(R,{"aria-hidden":!0}),children:`Remove`})]})]}),(0,Z.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden sm:grid`,style:{gridTemplateColumns:`240px 1fr`},children:[(0,Z.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto border-b p-2 sm:max-h-none sm:border-b-0 sm:border-r`,style:{borderColor:`var(--border-base)`},children:v?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Z.jsx)(E,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):d.length===0?(0,Z.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files available.`}):d.map(e=>{let t=g===e.path,n=(e.mimeType??``).endsWith(`/directory`);return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>p(e.path),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:t?`var(--primary-base)`:`var(--content-default)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:void 0},children:[n?(0,Z.jsx)(I,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-mid-strong)`}}):(0,Z.jsx)(T,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)})}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:S?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(E,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):_?(0,Z.jsx)(re,{assistantId:e,skillId:t.id,fileName:_.name,filePath:_.path,content:b,isBinary:x,editable:t.kind===`installed`},`${t.id}/${_.path}`):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]})}function re({assistantId:e,skillId:n,fileName:r,filePath:o,content:s,isBinary:c,editable:u}){let d=a(),f=l(),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(``),_=`skills/${n}/${o}`,v=M({onSuccess:()=>{m(!1),g(``),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesContentGet`}]}),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesGet`}]}),o===`SKILL.md`&&ee(f,e)},onError:e=>{t(e,{context:`skill-file-save`,bestEffort:!0})}}),y=p&&h!==(s??``),b=(0,X.useCallback)(()=>{!y||v.isPending||v.mutate({path:{assistant_id:e},body:{path:_,content:h,encoding:`utf8`}})},[y,v,e,_,h]),x=(0,X.useCallback)(()=>{m(!0),g(s??``),v.reset()},[s,v]),S=(0,X.useCallback)(()=>{m(!1),g(``),v.reset()},[v]);if(c)return(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`});if(s===null)return(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,r,`.`]});let C=u?(0,Z.jsx)(i,{variant:`ghost`,size:`regular`,iconOnly:(0,Z.jsx)(w,{"aria-hidden":!0}),onClick:()=>d(`${N.workspace}?file=${encodeURIComponent(_)}`),"aria-label":`Open in Workspace`,className:`hover:bg-[var(--surface-base)]`}):void 0;return O(r,void 0)&&!p?(0,Z.jsx)(`div`,{className:`relative flex h-full flex-col`,children:(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:[(0,Z.jsx)(q,{content:s,fileName:r,showEdit:u,isEditing:!1,onToggleEdit:x,extraActions:C}),(0,Z.jsx)(k,{content:s})]})}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(q,{content:p?h:s,fileName:r,showEdit:u,isEditing:p,onToggleEdit:()=>p?S():x(),extraActions:C}),p?(0,Z.jsx)(K,{value:h,onChange:g,onSave:b}):(0,Z.jsx)(W,{content:s,readOnly:!u,onStartEdit:x})]}),p&&(0,Z.jsx)(G,{isDirty:y,isSaving:v.isPending,error:v.isError?`Save failed`:null,onSave:b,onDiscard:S})]})}var ie=e(r(),1);function ae({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`}):t===null?(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,e,`.`]}):O(e,void 0)&&r===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(k,{content:t})}):(0,Z.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function Q({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:a,isInstalling:o=!1,isRemoving:s=!1,swipeContainerRef:c,sourceConversationId:l}){let u=h(t),d=H(t),{fileEntries:p,setSelectedPath:g,activePath:_,activeFile:v,isFilesLoading:b,fileContent:x,isBinary:S,isContentLoading:w}=V(e,t.id),[T,k]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{k(`preview`)},[_]);let[A,j]=(0,X.useState)(null);(0,X.useEffect)(()=>{j(document.getElementById(`viewport-overlays`))},[]);let M=v?O(v.name,void 0):!1,N=M?T:`raw`,P=(0,Z.jsxs)(`div`,{ref:c,className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(m,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:t.name}),(0,Z.jsx)(oe,{available:u,removable:d,isInstalling:o,isRemoving:s,onInstall:r,onRemove:a})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(J,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(y,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description}),(0,Z.jsx)(B,{skill:{origin:t.origin,sourceConversationId:l}})]}),(0,Z.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(ce,{fileEntries:p,activePath:_,activeName:v?.name??null,onSelect:g}),(0,Z.jsx)(D,{iconOnly:!0,ariaLabel:`File view mode`,value:N,onChange:k,items:[{value:`preview`,label:`Preview`,icon:(0,Z.jsx)(L,{"aria-hidden":!0}),disabled:!M},{value:`raw`,label:`Source`,icon:(0,Z.jsx)(C,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:b||w?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(E,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):v?(0,Z.jsx)(ae,{fileName:v.name,content:x,isBinary:S,viewMode:N}):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]});return A?(0,ie.createPortal)(P,A):P}function oe({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:a,onRemove:o}){return n||r?(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(E,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(i,{variant:`ghost`,iconOnly:(0,Z.jsx)(P,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:a,disabled:!a,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(i,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Remove skill`,onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Z.jsx)(i,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:`Bundled skills cannot be removed`,"aria-label":`Bundled skill cannot be removed`,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function se(e){return(e??``).endsWith(`/directory`)}function ce({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)($,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i})]}):(0,Z.jsxs)(S.Root,{children:[(0,Z.jsx)(S.Trigger,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)($,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i}),(0,Z.jsx)(x,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(S.Content,{align:`start`,children:e.map(e=>{let n=se(e.mimeType);return(0,Z.jsx)(S.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Z.jsx)(I,{}):(0,Z.jsx)(T,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function $(){return(0,Z.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Z.jsx)(T,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}function le(){let e=z(),{skillId:t}=o(),n=a(),r=c(),{pathname:l}=r,d=F(),f=(0,X.useRef)(null),p=r.state,h=typeof p?.listSearch==`string`?p.listSearch:``,y=u({...A({path:{assistant_id:e},query:{include:`catalog`}}),select:e=>e.skills,refetchOnMount:`always`}),x=(0,X.useCallback)(()=>{n(`${N.skills.root}${h}`,{replace:!0})},[n,h]);te({containerRef:f,onBack:x,enabled:d,navKey:l});let{handleInstall:S,handleRemove:C,isInstallingSkill:w,isRemovingSkill:T,skillPendingRemoval:E,confirmRemove:D,cancelRemove:O}=b(e,{onRemoved:x}),k=y.data,M=(0,X.useMemo)(()=>k?.find(e=>e.id===t)??null,[k,t]),P=u({...j({path:{assistant_id:e,id:t??``}}),enabled:!!t&&M?.origin===`assistant-memory`,select:e=>e.skill.origin===`assistant-memory`?e.skill.sourceConversationId??null:null});if(!t)return(0,Z.jsx)(s,{to:N.skills.root,replace:!0});if(y.isLoading)return(0,Z.jsx)(_,{});if(y.isError&&!M)return(0,Z.jsx)(v,{});if(!M&&y.isFetching)return(0,Z.jsx)(_,{});if(!M)return(0,Z.jsx)(g,{icon:Y,title:`Skill not found`,subtitle:`This skill may have been removed, or the link is out of date.`,children:(0,Z.jsx)(i,{type:`button`,variant:`outlined`,className:`mt-4`,leftIcon:(0,Z.jsx)(m,{"aria-hidden":!0}),onClick:x,children:`Back to skills`})});let I={assistantId:e,skill:M,onBack:x,onInstall:()=>S(M),onRemove:()=>C(M),isInstalling:w(M),isRemoving:T(M),sourceConversationId:P.data??void 0};return(0,Z.jsxs)(Z.Fragment,{children:[d?(0,Z.jsx)(Q,{...I,swipeContainerRef:f}):(0,Z.jsx)(ne,{...I}),(0,Z.jsx)(U,{skillName:E?.name??null,onConfirm:D,onCancel:O})]})}export{le as SkillDetailPage};