@vellumai/web 0.10.10-staging.1 → 0.10.10-staging.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{account-page-B8Z6QZKe.js → account-page-B27dNQ3d.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-DvbBzgps.js → acp-run-detail-panel-B0k2rYpM.js} +4 -4
- package/dist/assets/{activity-steps-panel-Cc6sOJ7O.js → activity-steps-panel-LDydO3OK.js} +1 -1
- package/dist/assets/ai-page-UMlli-yL.js +1 -0
- package/dist/assets/{api-key-screen-D7u7SPiq.js → api-key-screen-BYdMayOl.js} +1 -1
- package/dist/assets/{background-task-detail-panel-BNb7N4q2.js → background-task-detail-panel-wG11sk-D.js} +1 -1
- package/dist/assets/{billing-page-QcfuHjR9.js → billing-page-BHg4_D8p.js} +2 -2
- package/dist/assets/{bookmarks-page-CRZqWo3d.js → bookmarks-page-Dj_WhT38.js} +1 -1
- package/dist/assets/{channels-page-route-C_YBqGsE.js → channels-page-route-BLMC84yp.js} +2 -2
- package/dist/assets/{command-palette-y6-mfSgF.js → command-palette-nEbCvF9B.js} +1 -1
- package/dist/assets/{command-palette-window-page-DUPyaVxH.js → command-palette-window-page-Um5WOMD9.js} +1 -1
- package/dist/assets/community-page-BpLDD6Gw.js +1 -0
- package/dist/assets/contacts-page-route-Na5xsrCM.js +1 -0
- package/dist/assets/{credentials-page-CvW82Tlz.js → credentials-page-DiPIjJOv.js} +1 -1
- package/dist/assets/{debug-page-CmPi5tnZ.js → debug-page-Op9gPo8_.js} +2 -2
- package/dist/assets/{deploy-dialogs-DaPjl9bW.js → deploy-dialogs-BNZpdpkW.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-DpEnEgJn.js → detail-panel-stop-button-QQ20Gb80.js} +1 -1
- package/dist/assets/{developer-page-CV-CsA3N.js → developer-page-CEm6gJ5c.js} +1 -1
- package/dist/assets/{dictation-overlay-page-g9BvDir_.js → dictation-overlay-page-DFy73eLq.js} +1 -1
- package/dist/assets/{document-viewer-page-C5v8akIG.js → document-viewer-page-BB8CFKzx.js} +1 -1
- package/dist/assets/{emails-page-CtFCYDq9.js → emails-page-DfS8M0KH.js} +1 -1
- package/dist/assets/general-page-DRyIIgkk.js +1 -0
- package/dist/assets/{hatching-screen-HNiZriOH.js → hatching-screen-D0zBF6G3.js} +1 -1
- package/dist/assets/home-page-route-BMbIyFRk.js +1 -0
- package/dist/assets/{hosting-screen-CkRQ1ibr.js → hosting-screen-Zb6-T1r9.js} +1 -1
- package/dist/assets/identity-page-route-BmQtmPF0.js +7 -0
- package/dist/assets/{index-CZVGv7Cn.js → index-CgcZXB4g.js} +28 -28
- package/dist/assets/index-yF00bLYk.css +2 -0
- package/dist/assets/{inspect-page-JQwJQ_Sl.js → inspect-page-Iemfgo7r.js} +2 -2
- package/dist/assets/{integrations-page-FCrRTt2X.js → integrations-page-8U6yrpy_.js} +1 -1
- package/dist/assets/{intelligence-layout-AsbvHVqu.js → intelligence-layout-Bk61phvn.js} +1 -1
- package/dist/assets/latest-assistant-text-cGlQO-ow.js +24 -0
- package/dist/assets/{library-detail-page-Bcnsh9CI.js → library-detail-page-BCRw2pXt.js} +1 -1
- package/dist/assets/{library-page-DZduD_bA.js → library-page-BCFKyR7R.js} +1 -1
- package/dist/assets/{logout-page-Buv0U8Wq.js → logout-page-C27fK6LX.js} +1 -1
- package/dist/assets/{logs-layout-CaZNYn0T.js → logs-layout-DrBxBaoW.js} +1 -1
- package/dist/assets/memory-page-route-BdF70Wmp.js +1 -0
- package/dist/assets/{memory-router-playground-page-CGIGEOgT.js → memory-router-playground-page-BlT9oFs0.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-kwgBD2Oe.js → mobile-sidebar-drawer-BmS9adnj.js} +1 -1
- package/dist/assets/{notifications-page-BhLbSbpe.js → notifications-page-DsQJaAsR.js} +1 -1
- package/dist/assets/{oauth-complete-page-Y9TaL3bP.js → oauth-complete-page-BMqOW3MA.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-D9YtNVV9.js → oauth-popup-complete-page-D-r0oM8y.js} +1 -1
- package/dist/assets/{pairing-page-CYBL5nXH.js → pairing-page-CELMlJeG.js} +1 -1
- package/dist/assets/personality-page-BdkuO-Fy.js +1 -0
- package/dist/assets/{plugins-page-DtB-KvF9.js → plugins-page-DblHkb06.js} +1 -1
- package/dist/assets/prechat-route-DcgCgSV8.js +1 -0
- package/dist/assets/privacy-page-Ccn6St6F.js +1 -0
- package/dist/assets/{privacy-screen-C4Y8Fzqr.js → privacy-screen-IqygR70e.js} +1 -1
- package/dist/assets/{provider-callback-page-DkUH2bax.js → provider-callback-page-fjZoTIWk.js} +1 -1
- package/dist/assets/{quick-input-page--AKggGR2.js → quick-input-page-BmPU9B6u.js} +1 -1
- package/dist/assets/{research-mock-page-DNVvgUNF.js → research-mock-page-CssYNgG7.js} +1 -1
- package/dist/assets/research-onboarding-route-sFu5EQW9.js +42 -0
- package/dist/assets/{review-terms-screen-3Mt29KCp.js → review-terms-screen-Cv_jkYHP.js} +1 -1
- package/dist/assets/schedules-page-DCFEdNCs.js +1 -0
- package/dist/assets/{select-assistant-screen-DKEkfrzB.js → select-assistant-screen-B0qoVKd5.js} +1 -1
- package/dist/assets/{settings-layout-D5GIvMSd.js → settings-layout-B_NU6GFk.js} +1 -1
- package/dist/assets/{share-feedback-modal-Bns-AdW9.js → share-feedback-modal-c0vGJBMA.js} +1 -1
- package/dist/assets/{sidebar-tree-DRAO8jjA.js → sidebar-tree-Cq8ACYzP.js} +1 -1
- package/dist/assets/{signup-page-_JnnV0FO.js → signup-page-CQLi5G7p.js} +1 -1
- package/dist/assets/{skill-detail-page-DiV9u6T7.js → skill-detail-page-C_-DI2tN.js} +1 -1
- package/dist/assets/{skill-detail-panel-Bevi3Lss.js → skill-detail-panel-J7W0DU8J.js} +1 -1
- package/dist/assets/skills-page-BhMnBhiu.js +1 -0
- package/dist/assets/{start-screen-DfMdkCZZ.js → start-screen-Cbh01xPj.js} +1 -1
- package/dist/assets/{subagent-detail-panel-B8XiU0Z-.js → subagent-detail-panel-D9BXd8vR.js} +2 -2
- package/dist/assets/{system-events-page-Bd7g4y5T.js → system-events-page-BWbjCZVh.js} +1 -1
- package/dist/assets/{theme-stage-page-B72tB13w.js → theme-stage-page-DUeQZVJ3.js} +1 -1
- package/dist/assets/{tiptap-document-editor-jTc6PPwp.js → tiptap-document-editor-yCVhNTRu.js} +1 -1
- package/dist/assets/{tool-detail-panel-DyCqe5Yq.js → tool-detail-panel-Dtl2QLOW.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-CUl1Cass.js → upgrade-cancel-page-DmdDdCjG.js} +1 -1
- package/dist/assets/{upgrade-success-page-DKvgbJHK.js → upgrade-success-page-DQoC2Y_H.js} +1 -1
- package/dist/assets/use-assistant-identity-details-D-gTqmOL.js +1 -0
- package/dist/assets/{use-edge-swipe-back-CaTk2Wz5.js → use-edge-swipe-back-Dpo-0Weh.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-B6r6wWD7.js → use-invite-link-dialog-DhVTs4OS.js} +1 -1
- package/dist/assets/{use-skill-actions-B443tGAI.js → use-skill-actions-fDejA0nc.js} +1 -1
- package/dist/assets/{use-skill-categories-DsLNc-NO.js → use-skill-categories-DCOdxAre.js} +1 -1
- package/dist/assets/{use-skill-detail-files-BjQHazRM.js → use-skill-detail-files-DS6fk9Xz.js} +1 -1
- package/dist/assets/{voice-page-BiO7sMlu.js → voice-page-BRscGXct.js} +1 -1
- package/dist/assets/{weather-forecast-display-CZLINMqN.js → weather-forecast-display-Dcw7Ta6D.js} +1 -1
- package/dist/assets/{welcome-screen-CkOAvi7q.js → welcome-screen-C35jMBVC.js} +1 -1
- package/dist/assets/{workflow-detail-panel-PevRtp_O.js → workflow-detail-panel-CYjQlhPc.js} +1 -1
- package/dist/assets/{workspace-page-D_ZIEJYY.js → workspace-page-Dh-OnRd7.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/ai-page-TYCxSdRA.js +0 -1
- package/dist/assets/community-page-JggT8MFi.js +0 -1
- package/dist/assets/contacts-page-route-q6JfNlkd.js +0 -1
- package/dist/assets/general-page-CBJ13Yzs.js +0 -1
- package/dist/assets/home-page-route-B5t1I9Kc.js +0 -1
- package/dist/assets/identity-page-route-BvdzgZ7m.js +0 -7
- package/dist/assets/index-BoLhUIgw.css +0 -2
- package/dist/assets/latest-assistant-text-BCjy0Q0O.js +0 -24
- package/dist/assets/memory-page-route-VwqOIgOs.js +0 -1
- package/dist/assets/personality-page-BuIF9LmP.js +0 -1
- package/dist/assets/prechat-route-Cn9TbGYd.js +0 -1
- package/dist/assets/privacy-page-wr_tX0w2.js +0 -1
- package/dist/assets/research-onboarding-route-CsLjEqSj.js +0 -42
- package/dist/assets/schedules-page-DWZ-lJ7j.js +0 -1
- package/dist/assets/skills-page-ano_t4YY.js +0 -1
- package/dist/assets/use-assistant-identity-details-CmAZ1Y2o.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./x-CswtfvgS.js";import"./src-CDdn26Yb.js";import{t as a}from"./haptics-D5SxnqtJ.js";import{Ft as o,
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./x-CswtfvgS.js";import"./src-CDdn26Yb.js";import{t as a}from"./haptics-D5SxnqtJ.js";import{Ft as o,pa as s}from"./index-CgcZXB4g.js";var c=e(t(),1),l=80;function u({enabled:e,onSwipeLeft:t,onSwipeRight:n,commitThresholdPx:r=l}){return o({enabled:e,axis:`horizontal`,commitThresholdPx:r,touchOnly:!0,onCommit:(0,c.useCallback)(e=>{e<=-r?(a.light(),t?.()):e>=r&&(a.light(),n?.())},[r,t,n])})}var d=r(),f=`(min-width: 640px)`,p=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function m({open:e,onClose:t,children:r,title:a}){let o=(0,c.useRef)(null),s=(0,c.useRef)(null),l=(0,c.useRef)(t);(0,c.useEffect)(()=>{l.current=t});let{dragOffset:m,isDragging:h,onTouchStart:g,onTouchMove:_,onTouchEnd:v,onTouchCancel:y}=u({enabled:e,onSwipeLeft:t});return(0,c.useEffect)(()=>{if(!e)return;s.current?.focus();let t=document.body.style.overflow;document.body.style.overflow=`hidden`;let n=window.matchMedia(f),r=e=>{e.matches&&l.current()};n.addEventListener(`change`,r);let i=e=>{if(e.key===`Escape`){l.current();return}if(e.key!==`Tab`||!o.current)return;let t=o.current.querySelectorAll(p),n=t[0],r=t[t.length-1];if(!n||!r){e.preventDefault();return}let i=document.activeElement,a=o.current.contains(i);e.shiftKey?(!a||i===n)&&(e.preventDefault(),r.focus()):(!a||i===r)&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`keydown`,i),n.removeEventListener(`change`,r),document.body.style.overflow=t}},[e]),e?(0,d.jsxs)(`div`,{ref:o,className:`fixed inset-0 sm:hidden`,style:{zIndex:40},role:`dialog`,"aria-modal":`true`,"aria-label":a,children:[(0,d.jsx)(`button`,{type:`button`,"aria-label":`Close sidebar`,className:`absolute inset-0 h-full w-full cursor-default`,style:{background:`rgba(0, 0, 0, 0.4)`,zIndex:40},onClick:t}),(0,d.jsxs)(`aside`,{className:`relative flex h-full w-[80vw] max-w-xs flex-col shadow-xl`,style:{background:`var(--surface-lift)`,borderRight:`1px solid var(--border-base)`,zIndex:50,paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,transform:`translateX(${m}px)`,transition:h?`none`:`transform 200ms ease-out`,touchAction:`pan-y`},onTouchStart:g,onTouchMove:_,onTouchEnd:v,onTouchCancel:y,children:[(0,d.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-3`,style:{borderColor:`var(--border-base)`},children:[(0,d.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:a}),(0,d.jsx)(n,{ref:s,type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,d.jsx)(i,{"aria-hidden":!0}),onClick:t,"aria-label":`Close`,tintColor:`var(--content-tertiary)`})]}),(0,d.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:r})]})]}):null}function h({onClick:e}){return(0,d.jsx)(n,{type:`button`,variant:`ghost`,iconOnly:(0,d.jsx)(s,{"aria-hidden":!0}),onClick:e,"aria-label":`Open sidebar`,tintColor:`var(--content-secondary)`,className:`sm:hidden`})}export{h as n,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./createLucideIcon-Bjb-Kuq7.js";import{t as c}from"./bell-BbESwsZk.js";import{t as l}from"./check-wF3S-AV4.js";import{t as u}from"./menu-DpEE6Pur.js";import{t as d}from"./loader-circle-D57RZgLH.js";import{t as f}from"./moon-Ci1LuSVx.js";import{t as p}from"./triangle-alert-DXEpFOj_.js";import{t as m}from"./notice-BylgS5W_.js";import{t as h}from"./popover-Bl6742nZ.js";import{t as g}from"./input-ZpyYt_a0.js";import{n as _,t as v}from"./panel-item-Bvqsr5n9.js";import{n as y}from"./toast-ZoZVyeDI.js";import{c as b}from"./routes-XPLb07Av.js";import{_t as x,ft as S,gt as C,ht as w,mt as T,pt as E,vt as D}from"./react-query.gen-BXPoln4i.js";import{Rr as O,U as k,di as A,fi as j,g as M,pi as N}from"./index-CZVGv7Cn.js";import{t as P}from"./mutation-error-CbcKvssD.js";var F=s(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=s(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),L=e(t(),1);function R(e){e.invalidateQueries({queryKey:T()}),e.invalidateQueries({queryKey:D()})}function z(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var B=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],V=o();function H({notificationId:e,currentlySnoozed:t,children:n}){let i=r(),o=a(x()),s=O(),[c,l]=(0,L.useState)(!1),d=()=>R(i),f=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:d,onError:P(`Failed to snooze notification`)})},p=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:d,onError:P(`Failed to clear snooze`)})};return s?(0,V.jsxs)(_.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Snooze until…`})}),(0,V.jsxs)(_.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(v,{label:e,onSelect:()=>{o.isPending||(l(!1),f(t))}},e)),t&&(0,V.jsx)(v,{label:`Clear snooze`,onSelect:()=>{o.isPending||(l(!1),p())}})]})]})]}):(0,V.jsxs)(u.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(u.Trigger,{children:n}),(0,V.jsxs)(u.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(u.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>f(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(u.Separator,{}),(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>p(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(w()),l=a(C()),[u,f]=(0,L.useState)(``),p=()=>R(s),m=()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();c.mutate({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:u.trim()||`User requested pause`,expires_at:e}},{onSuccess:e=>{n(e),p(),t()},onError:P(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),p(),t()},onError:P(`Failed to resume alerts`)})},_=c.isPending||l.isPending;return(0,V.jsxs)(`div`,{children:[!o&&(0,V.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,V.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,M(e.expires_at)]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>h(e.id),disabled:_,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,V.jsx)(g,{type:`text`,value:u,onChange:e=>f(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:_,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function W({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=z(e),a=!e.is_read;return(0,V.jsxs)(`div`,{className:`relative rounded-lg border border-[var(--border-base)] p-4`,style:{background:e.is_resolved?`var(--surface-base)`:`var(--surface-lift)`,opacity:e.is_resolved?.75:1},children:[(0,V.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-negative-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,V.jsx)(p,{className:`h-3 w-3`}),`Alert`]}),i&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--surface-base)] px-2 py-0.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-positive-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,children:[(0,V.jsx)(l,{className:`h-3 w-3`}),`Resolved`]})]}),(0,V.jsx)(`h3`,{className:`text-body-medium-default leading-tight`,style:{color:e.is_resolved?`var(--content-secondary)`:`var(--content-default)`},children:e.title}),e.body&&(0,V.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsxs)(`span`,{children:[`Last seen `,M(e.last_seen_at)]}),e.occurrence_count>1&&(0,V.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id,a),disabled:n,className:`flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-body-small-default transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,style:{background:a?`var(--primary-base)`:`var(--surface-base)`,color:a?`var(--content-inset)`:`var(--content-secondary)`},children:[n?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(l,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,V.jsx)(H,{notificationId:e.id,currentlySnoozed:i,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=N({platformHostedOnly:!0}),t=A(),o=j(),s=r(),l=O(),[u,f]=(0,L.useState)(`open`),[p,g]=(0,L.useState)(!1),[v,x]=(0,L.useState)([]),{data:C,isLoading:w,isError:T,refetch:D}=i({...E({query:{status:u}}),enabled:e===`full`&&t}),M=e===`full`&&o||(t?w:!1);(0,L.useEffect)(()=>{!t&&p&&g(!1)},[t,p]);let P=t?T:!1,z=t?C?.results??[]:[],B=z.filter(e=>!e.is_read&&!e.is_resolved),H=a(S()),[G,K]=(0,L.useState)(new Set),[q,J]=(0,L.useState)(!1),Y=(0,L.useCallback)(()=>R(s),[s]),X=async(e,t)=>{K(t=>new Set(t).add(e));try{await H.mutateAsync({path:{id:e},body:{acknowledged:t}}),Y()}catch(e){y.error(e instanceof Error?e.message:`Failed to update notification`)}finally{K(t=>{let n=new Set(t);return n.delete(e),n})}},Z=async()=>{if(!(B.length===0||q)){J(!0);try{await Promise.allSettled(B.map(e=>H.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{Y(),J(!1)}}},Q=(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,title:`Pause alerts`,children:[(0,V.jsx)(F,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),$=(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>x(t=>[...t,e]),onPauseDeleted:e=>x(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,V.jsx)(n,{replace:!0,to:b.settings.general}):e===`disabled`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,V.jsx)(k,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(l?(0,V.jsxs)(_.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Pause alerts`})}),(0,V.jsx)(_.Body,{children:(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>x(t=>[...t,e]),onPauseDeleted:e=>x(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(h.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(h.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(h.Content,{align:`end`,className:`w-72`,children:$})]}))]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-1`,children:[`open`,`resolved`].map(e=>{let t=u===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>f(e),className:`cursor-pointer rounded px-3 py-1 text-body-small-default capitalize transition-colors`,style:{background:t?`var(--surface-lift)`:`transparent`,color:t?`var(--content-default)`:`var(--content-secondary)`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.08)`:void 0},children:e},e)})}),u===`open`&&B.length>1&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>void Z(),disabled:q,className:`ml-auto flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-transparent px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:[q?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(I,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),M?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,V.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(m,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void D(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):z.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,V.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,u,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:u===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:z.map(e=>(0,V.jsx)(W,{notification:e,onAck:(e,t)=>void X(e,t),isAcking:G.has(e.id)},e.id))})]})}export{G as NotificationsPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./createLucideIcon-Bjb-Kuq7.js";import{t as c}from"./bell-BbESwsZk.js";import{t as l}from"./check-wF3S-AV4.js";import{t as u}from"./menu-DpEE6Pur.js";import{t as d}from"./loader-circle-D57RZgLH.js";import{t as f}from"./moon-Ci1LuSVx.js";import{t as p}from"./triangle-alert-DXEpFOj_.js";import{t as m}from"./notice-BylgS5W_.js";import{t as h}from"./popover-Bl6742nZ.js";import{t as g}from"./input-ZpyYt_a0.js";import{n as _,t as v}from"./panel-item-Bvqsr5n9.js";import{n as y}from"./toast-ZoZVyeDI.js";import{c as b}from"./routes-XPLb07Av.js";import{_t as x,ft as S,gt as C,ht as w,mt as T,pt as E,vt as D}from"./react-query.gen-BXPoln4i.js";import{U as O,fi as k,g as A,mi as j,pi as M,zr as N}from"./index-CgcZXB4g.js";import{t as P}from"./mutation-error-CbcKvssD.js";var F=s(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=s(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),L=e(t(),1);function R(e){e.invalidateQueries({queryKey:T()}),e.invalidateQueries({queryKey:D()})}function z(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var B=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],V=o();function H({notificationId:e,currentlySnoozed:t,children:n}){let i=r(),o=a(x()),s=N(),[c,l]=(0,L.useState)(!1),d=()=>R(i),f=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:d,onError:P(`Failed to snooze notification`)})},p=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:d,onError:P(`Failed to clear snooze`)})};return s?(0,V.jsxs)(_.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Snooze until…`})}),(0,V.jsxs)(_.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(v,{label:e,onSelect:()=>{o.isPending||(l(!1),f(t))}},e)),t&&(0,V.jsx)(v,{label:`Clear snooze`,onSelect:()=>{o.isPending||(l(!1),p())}})]})]})]}):(0,V.jsxs)(u.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(u.Trigger,{children:n}),(0,V.jsxs)(u.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(u.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>f(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(u.Separator,{}),(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>p(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(w()),l=a(C()),[u,f]=(0,L.useState)(``),p=()=>R(s),m=()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();c.mutate({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:u.trim()||`User requested pause`,expires_at:e}},{onSuccess:e=>{n(e),p(),t()},onError:P(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),p(),t()},onError:P(`Failed to resume alerts`)})},_=c.isPending||l.isPending;return(0,V.jsxs)(`div`,{children:[!o&&(0,V.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,V.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,A(e.expires_at)]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>h(e.id),disabled:_,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,V.jsx)(g,{type:`text`,value:u,onChange:e=>f(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:_,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function W({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=z(e),a=!e.is_read;return(0,V.jsxs)(`div`,{className:`relative rounded-lg border border-[var(--border-base)] p-4`,style:{background:e.is_resolved?`var(--surface-base)`:`var(--surface-lift)`,opacity:e.is_resolved?.75:1},children:[(0,V.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-negative-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,V.jsx)(p,{className:`h-3 w-3`}),`Alert`]}),i&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--surface-base)] px-2 py-0.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-positive-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,children:[(0,V.jsx)(l,{className:`h-3 w-3`}),`Resolved`]})]}),(0,V.jsx)(`h3`,{className:`text-body-medium-default leading-tight`,style:{color:e.is_resolved?`var(--content-secondary)`:`var(--content-default)`},children:e.title}),e.body&&(0,V.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsxs)(`span`,{children:[`Last seen `,A(e.last_seen_at)]}),e.occurrence_count>1&&(0,V.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id,a),disabled:n,className:`flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-body-small-default transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,style:{background:a?`var(--primary-base)`:`var(--surface-base)`,color:a?`var(--content-inset)`:`var(--content-secondary)`},children:[n?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(l,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,V.jsx)(H,{notificationId:e.id,currentlySnoozed:i,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=j({platformHostedOnly:!0}),t=k(),o=M(),s=r(),l=N(),[u,f]=(0,L.useState)(`open`),[p,g]=(0,L.useState)(!1),[v,x]=(0,L.useState)([]),{data:C,isLoading:w,isError:T,refetch:D}=i({...E({query:{status:u}}),enabled:e===`full`&&t}),A=e===`full`&&o||(t?w:!1);(0,L.useEffect)(()=>{!t&&p&&g(!1)},[t,p]);let P=t?T:!1,z=t?C?.results??[]:[],B=z.filter(e=>!e.is_read&&!e.is_resolved),H=a(S()),[G,K]=(0,L.useState)(new Set),[q,J]=(0,L.useState)(!1),Y=(0,L.useCallback)(()=>R(s),[s]),X=async(e,t)=>{K(t=>new Set(t).add(e));try{await H.mutateAsync({path:{id:e},body:{acknowledged:t}}),Y()}catch(e){y.error(e instanceof Error?e.message:`Failed to update notification`)}finally{K(t=>{let n=new Set(t);return n.delete(e),n})}},Z=async()=>{if(!(B.length===0||q)){J(!0);try{await Promise.allSettled(B.map(e=>H.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{Y(),J(!1)}}},Q=(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,title:`Pause alerts`,children:[(0,V.jsx)(F,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),$=(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>x(t=>[...t,e]),onPauseDeleted:e=>x(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,V.jsx)(n,{replace:!0,to:b.settings.general}):e===`disabled`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,V.jsx)(O,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(l?(0,V.jsxs)(_.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Pause alerts`})}),(0,V.jsx)(_.Body,{children:(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>x(t=>[...t,e]),onPauseDeleted:e=>x(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(h.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(h.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(h.Content,{align:`end`,className:`w-72`,children:$})]}))]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-1`,children:[`open`,`resolved`].map(e=>{let t=u===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>f(e),className:`cursor-pointer rounded px-3 py-1 text-body-small-default capitalize transition-colors`,style:{background:t?`var(--surface-lift)`:`transparent`,color:t?`var(--content-default)`:`var(--content-secondary)`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.08)`:void 0},children:e},e)})}),u===`open`&&B.length>1&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>void Z(),disabled:q,className:`ml-auto flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-transparent px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:[q?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(I,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),A?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,V.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(m,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void D(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):z.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,V.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,u,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:u===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:z.map(e=>(0,V.jsx)(W,{notification:e,onAck:(e,t)=>void X(e,t),isAcking:G.has(e.id)},e.id))})]})}export{G as NotificationsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{m as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{hn as i}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{m as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{hn as i}from"./index-CgcZXB4g.js";var a=e(t(),1),o=r();function s(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,o.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function c(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var l=`
|
|
2
2
|
:root {
|
|
3
3
|
--oauth-surface: #F5F3EB;
|
|
4
4
|
--oauth-surface-card: #FFFFFF;
|
package/dist/assets/{oauth-popup-complete-page-D9YtNVV9.js → oauth-popup-complete-page-D-r0oM8y.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{m as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{n as i,r as a}from"./native-deep-link-B9BuDLg1.js";import{hn as o}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{m as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{n as i,r as a}from"./native-deep-link-B9BuDLg1.js";import{hn as o}from"./index-CgcZXB4g.js";var s=e(t(),1),c=r();function l(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,c.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function u(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var d=`
|
|
2
2
|
:root {
|
|
3
3
|
--oauth-surface: #F5F3EB;
|
|
4
4
|
--oauth-surface-card: #FFFFFF;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{l as n,u as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./circle-alert-CTnM6GCb.js";import{t as o}from"./circle-check-DqvTjWle.js";import{t as s}from"./loader-circle-D57RZgLH.js";import{g as c}from"./local-mode-hyYI6_OH.js";import{a as l,i as u,n as d,r as f,t as p}from"./remote-gateway-session-CuTuWPx8.js";import{t as m}from"./return-to-BVIOUdUp.js";import{c as h}from"./routes-XPLb07Av.js";import{t as g}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{l as n,u as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./circle-alert-CTnM6GCb.js";import{t as o}from"./circle-check-DqvTjWle.js";import{t as s}from"./loader-circle-D57RZgLH.js";import{g as c}from"./local-mode-hyYI6_OH.js";import{a as l,i as u,n as d,r as f,t as p}from"./remote-gateway-session-CuTuWPx8.js";import{t as m}from"./return-to-BVIOUdUp.js";import{c as h}from"./routes-XPLb07Av.js";import{t as g}from"./index-CgcZXB4g.js";var _=e(t(),1),v=i();function y(e){switch(e.kind){case`starting`:return{title:`Starting pairing`,body:`Creating a code for this browser.`};case`approved`:return{title:`Connected`,body:`Opening your assistant.`};case`expired`:return{title:`Pairing expired`,body:`Start a new web pairing from the local assistant.`};case`error`:return{title:`Pairing failed`,body:e.message};case`polling`:return{title:`Waiting for approval`,body:`Confirm this code on the machine running your assistant.`}}}function b({state:e}){return e.kind===`approved`?(0,v.jsx)(o,{className:`h-5 w-5 text-green-600`,"aria-hidden":!0}):e.kind===`starting`||e.kind===`polling`?(0,v.jsx)(s,{className:`h-5 w-5 animate-spin text-blue-600`,"aria-hidden":!0}):(0,v.jsx)(a,{className:`h-5 w-5 text-red-600`,"aria-hidden":!0})}function x(){let e=n(),t=r(),i=c(),a=(0,_.useMemo)(()=>m(new URLSearchParams(e.search).get(`returnTo`),h.assistant),[e.search]),o=(0,_.useMemo)(()=>l(`${e.pathname}${e.search}${e.hash}`),[e.pathname,e.search,e.hash]),[s,x]=(0,_.useState)(()=>o.deviceCode?{deviceCode:o.deviceCode,userCode:o.userCode}:null),[S,C]=(0,_.useState)(s?{kind:`polling`,expiresAt:null}:{kind:`starting`});if((0,_.useEffect)(()=>{if(!i||s)return;let e=new AbortController;return(async()=>{try{let t=await f(e.signal);x({deviceCode:t.deviceCode,userCode:t.userCode}),C({kind:`polling`,expiresAt:t.expiresAt})}catch{if(e.signal.aborted)return;C({kind:`error`,message:`The assistant could not start pairing. Refresh the page to try again.`})}})(),()=>{e.abort()}},[i,s]),(0,_.useEffect)(()=>{if(!i||!s?.deviceCode)return;let e=new AbortController,n=null,r=async()=>{try{let i=await u(s.deviceCode,e.signal);if(i.status===`pending`){C({kind:`polling`,expiresAt:i.expiresAt||null}),n=setTimeout(()=>void r(),Math.max(1,i.intervalSeconds)*1e3);return}d(i),C({kind:`approved`}),n=setTimeout(()=>t(a,{replace:!0}),250)}catch(t){if(e.signal.aborted)return;if(t instanceof p&&t.status===401){C({kind:`expired`});return}if(t instanceof p&&t.code===`GUARDIAN_REPAIR_REQUIRED`){C({kind:`error`,message:`The assistant's trust database needs repair. Run guardian repair on the machine hosting the assistant, then retry this same pairing link — the code stays valid.`});return}C({kind:`error`,message:`The assistant could not complete pairing. Try starting a new pairing.`})}};return r(),()=>{e.abort(),n&&clearTimeout(n)}},[i,s?.deviceCode,t,a]),!i)return(0,v.jsx)(g,{});let w=y(S);return(0,v.jsx)(`main`,{className:`flex min-h-svh items-center justify-center bg-[var(--background-default)] px-6 py-10 text-[var(--content-primary)]`,children:(0,v.jsxs)(`section`,{className:`w-full max-w-md rounded-lg border border-[var(--border-default)] bg-[var(--background-surface)] p-8 shadow-sm`,children:[(0,v.jsxs)(`div`,{className:`mb-5 flex items-center gap-3`,children:[(0,v.jsx)(b,{state:S}),(0,v.jsx)(`h1`,{className:`text-xl font-semibold`,children:w.title})]}),s?.userCode?(0,v.jsxs)(`div`,{className:`mb-5 rounded-md border border-[var(--border-subtle)] bg-[var(--background-muted)] p-4 text-center`,children:[(0,v.jsx)(`div`,{className:`text-xs font-medium uppercase text-[var(--content-secondary)]`,children:`Pairing code`}),(0,v.jsx)(`div`,{className:`mt-2 font-mono text-3xl font-semibold tracking-[0.18em]`,children:s.userCode})]}):null,(0,v.jsx)(`p`,{className:`text-sm leading-6 text-[var(--content-secondary)]`,children:w.body}),S.kind===`polling`&&S.expiresAt?(0,v.jsxs)(`p`,{className:`mt-4 text-xs text-[var(--content-tertiary)]`,children:[`Expires `,new Date(S.expiresAt).toLocaleTimeString(),`.`]}):null]})})}export{x as RemoteWebPairingPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{u as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./arrow-left-C2re-gYj.js";import{t as s}from"./sparkles-DDIsk_nZ.js";import"./src-CDdn26Yb.js";import{i as c,r as l,t as u}from"./dist-Cul7ysiV.js";import{n as d}from"./toast-ZoZVyeDI.js";import{c as f}from"./routes-XPLb07Av.js";import{kr as p}from"./index-CgcZXB4g.js";import{t as m}from"./use-active-assistant-id-9rGx8kT9.js";import{a as h,c as g,i as _,o as v,s as y}from"./latest-assistant-text-cGlQO-ow.js";import{a as b,c as x,i as S,n as C,o as w,r as T,t as E}from"./use-assistant-identity-details-D-gTqmOL.js";var D=e(t(),1),O=a(),k=`rgba(36, 41, 46, 0.25)`,A=`#FDFDFC`;function j({axis:e,value:t,onValueChange:n,tone:r,disabled:i}){return(0,O.jsxs)(`div`,{className:`flex w-full shrink-0 flex-wrap items-center gap-x-5 gap-y-1.5 sm:flex-nowrap`,style:{opacity:i?.7:1},children:[(0,O.jsx)(`span`,{className:`order-1 flex-1 text-left text-sm sm:w-32 sm:flex-none sm:text-right sm:text-[17px]`,style:{color:r.fg},children:e.left}),(0,O.jsx)(`span`,{className:`order-2 flex-1 text-right text-sm sm:order-3 sm:w-32 sm:flex-none sm:text-left sm:text-[17px]`,style:{color:r.fg},children:e.right}),(0,O.jsxs)(u,{className:`relative order-3 flex h-6 w-full touch-none items-center select-none sm:order-2 sm:w-auto sm:flex-1`,value:[t],onValueChange:e=>n(e[0]??b),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,O.jsx)(c,{className:`relative h-2 w-full grow rounded-full sm:h-3`,style:{backgroundColor:k}}),(0,O.jsx)(l,{className:`block h-5 w-5 cursor-grab rounded-full shadow-sm transition-transform active:scale-95 active:cursor-grabbing keyboard-focus:outline-none keyboard-focus:ring-2 keyboard-focus:ring-white/70 data-[disabled]:cursor-not-allowed data-[disabled]:active:scale-100 sm:h-6 sm:w-6`,style:{backgroundColor:A}})]})]})}async function M({assistantId:e,values:t,assistantName:n}){return T({assistantId:e,content:g(t,void 0,n),title:`Updating personality`,context:`identity_personality_update`})}function N(){let e=m(),t=n(),a=r(),{components:o,traits:s,customImageUrl:c}=p(e),l=C(e),u=i({queryKey:v(e),queryFn:()=>h(e)}),[g,b]=(0,D.useState)(null),[x,S]=(0,D.useState)(!1),T=g??u.data??{},k=l.data?.identity?.name||`Assistant`;return(0,O.jsx)(w,{components:o,traits:s,customImageUrl:c,entrance:!0,children:(0,O.jsx)(P,{assistantName:k,values:T,onValueChange:(e,t)=>b({...T,[e]:t}),applying:x,onUpdate:()=>{S(!0);let n=_(T);M({assistantId:e,values:n,assistantName:l.data?.identity?.name}).then(async r=>{S(!1),r?(await y(e,n),a.invalidateQueries({queryKey:v(e)}),a.invalidateQueries({queryKey:E(e)}),d.success(`Personality updated — come say hi!`),t(f.identity)):d.error(`The personality update didn't go through. Please try again.`)})},onBack:()=>void t(f.identity)})})}function P({assistantName:e,values:t,onValueChange:n,applying:r,onUpdate:i,onBack:a}){let{tone:c,bottomReserve:l}=x();return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`button`,{type:`button`,onClick:a,className:`absolute top-4 left-4 z-20 flex cursor-pointer items-center gap-1.5 rounded-full py-2 pr-4 pl-3 text-body-medium-default backdrop-blur-sm transition-all duration-150 active:scale-[0.97] ${c.isLight?`bg-black/10 hover:bg-black/20`:`bg-white/10 hover:bg-white/20`}`,style:{color:c.fg},children:[(0,O.jsx)(o,{className:`h-4 w-4`,"aria-hidden":!0}),`Back`]}),(0,O.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center overflow-y-auto px-6`,style:{paddingBottom:l},children:[(0,O.jsx)(`div`,{className:`w-full min-h-14 shrink-[4]`,style:{flexBasis:`12%`}}),(0,O.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2 text-center`,children:[(0,O.jsx)(`h1`,{className:`text-[2.6rem] leading-none max-sm:text-[2rem]`,style:{fontFamily:`var(--font-serif)`},children:`Shape my personality`}),(0,O.jsx)(`p`,{className:`max-w-md text-[15px]`,style:{color:c.fgMuted},children:`Slide the dials, then hit update — I’ll rewrite myself to match.`})]}),(0,O.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-10`}),(0,O.jsx)(`div`,{className:`flex w-full max-w-2xl shrink-0 flex-col`,children:S.map((e,i)=>(0,O.jsxs)(D.Fragment,{children:[i>0&&(0,O.jsx)(`div`,{className:`w-full min-h-2.5 shrink basis-8 sm:basis-11`}),(0,O.jsx)(j,{axis:e,value:t[e.id]??b,onValueChange:t=>n(e.id,t),tone:c,disabled:r})]},e.id))}),(0,O.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-12`}),(0,O.jsx)(`button`,{type:`button`,onClick:i,disabled:r,className:`flex h-11 w-[240px] shrink-0 cursor-pointer items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97] disabled:cursor-default disabled:opacity-80 disabled:active:scale-100`,style:{backgroundColor:c.isLight?`#1A1A1A`:`#FFFFFF`,color:c.isLight?`#FFFFFF`:`#1A1A1A`},children:r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-transparent`,style:{borderTopColor:c.isLight?`#FFFFFF`:`#1A1A1A`,borderRightColor:c.isLight?`#FFFFFF`:`#1A1A1A`}}),e,` is rewriting itself…`]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(s,{className:`h-4 w-4`,"aria-hidden":!0}),`Update personality`]})})]})]})}export{N as PersonalityPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./local-settings-C-dW2vkq.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i,z as a}from"./button-BQVYX8n_.js";import{m as o,n as s}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as c}from"./QueryClientProvider-DKhXIxGb.js";import{t as l}from"./useQuery-B45lW1Kk.js";import{t as u}from"./useMutation-Lj4VunQV.js";import{t as d}from"./jsx-runtime-CVSDxk6A.js";import{t as f}from"./card-D8zyWtZh.js";import{t as p}from"./createLucideIcon-Bjb-Kuq7.js";import{t as m}from"./arrow-left-C2re-gYj.js";import{t as h}from"./check-wF3S-AV4.js";import{t as g}from"./cloud-off-DT0KnUQ4.js";import{t as _}from"./download-CXYjvgB3.js";import{t as v}from"./external-link-5a-JuPGf.js";import{i as y,n as b,r as x,t as ee}from"./use-skill-categories-DsLNc-NO.js";import{t as S}from"./globe-Dx8dM0gj.js";import{t as C}from"./hard-drive-BxDRcYId.js";import{t as w}from"./loader-circle-D57RZgLH.js";import{t as T}from"./puzzle-CL8CuOcC.js";import{t as E}from"./sparkles-DDIsk_nZ.js";import{t as D}from"./triangle-alert-DXEpFOj_.js";import{t as O}from"./x-CswtfvgS.js";import"./src-CDdn26Yb.js";import{t as k}from"./tag-B6WeUtBW.js";import{t as A}from"./popover-Bl6742nZ.js";import{t as te}from"./input-ZpyYt_a0.js";import{t as ne}from"./toggle-QSEiPr3k.js";import{n as j,t as M}from"./panel-item-Bvqsr5n9.js";import{n as N}from"./toast-ZoZVyeDI.js";import{t as P}from"./confirm-dialog-CCrDkChx.js";import{t as F}from"./file-markdown-DZhQRECx.js";import{In as I,Nn as re,Pn as L,zn as ie}from"./sdk.gen-D_Qurj4O.js";import{at as ae,ct as oe,in as se,nn as ce,rn as le,rt as R,st as z}from"./react-query.gen-BQH0QRfT.js";import{t as ue}from"./assistant-identity-store-bwxIa6fM.js";import{r as de}from"./utils-ilzygKkt.js";import{c as fe}from"./routes-XPLb07Av.js";import{t as pe}from"./misc-Dz1odwkI.js";import{$i as B,At as me,Ha as V,Hi as H,Nr as he,Rr as ge,Va as U,ba as W,na as _e,qa as G}from"./index-CZVGv7Cn.js";import{t as ve}from"./use-active-assistant-id-9rGx8kT9.js";import{t as ye}from"./plugins-surface-Db6GSyl4.js";var be=p(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),K=e(r(),1),q=d(),xe={sm:`h-7 w-7`,md:`h-8 w-8 text-3xl`};function J({external:e=!1,icon:t,iconSrc:n,size:r=`sm`,className:i}){let[a,o]=(0,K.useState)(!1);(0,K.useEffect)(()=>{o(!1)},[n]);let s=t||(e?`📦`:`🧩`),c=!!n&&!a;return(0,q.jsx)(`span`,{className:pe(`flex shrink-0 items-center justify-center`,xe[r],i),children:c?(0,q.jsx)(`img`,{src:n,alt:``,"aria-hidden":!0,loading:`lazy`,className:`h-full w-full object-contain`,onError:()=>o(!0)}):s})}var Se=e=>`Remove "${e}" from this assistant?`,Ce=e=>`"${e}" has local edits that will be overwritten by the upgrade. Continue?`,we=`Upgrade anyway`,Te=`Failed to install plugin. Please try again.`,Ee=`Failed to remove plugin. Please try again.`,De=`Failed to upgrade plugin. Please try again.`,Oe=`Failed to update plugin. Please try again.`;function ke(e,t){let n=e.map(e=>({name:e.name,description:e.description??void 0,status:`installed`,external:void 0,version:e.version??void 0,path:e.path,issues:e.issues,enabled:e.enabled,icon:e.icon,hasIcon:e.hasIcon,iconVersion:e.iconVersion})),r=new Set(n.map(e=>e.name)),i=t.filter(e=>!r.has(e.name)).map(e=>({name:e.name,description:e.description,status:`available`,external:!0,path:e.path}));return[...n,...i]}function Ae(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description].some(e=>e?.toLowerCase().includes(n)):!0}function je(e){return[...e].sort((e,t)=>{let n=e.status===`installed`;return n===(t.status===`installed`)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function Me(e,t){switch(t){case`all`:return e;case`available`:return e.filter(e=>e.status===`available`);case`installed`:return e.filter(e=>e.status===`installed`);case`active`:return e.filter(e=>e.status===`installed`&&e.enabled!==!1);case`off`:return e.filter(e=>e.status===`installed`&&e.enabled===!1)}}function Y(e){return e?e.slice(0,7):`unknown`}function X({plugin:e,surfaces:t=null,className:n}){let r=[{label:`Source`,value:e.source?.kind===`github`?e.source.repo:`Local`,href:(e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null)??void 0}];return e.homepage&&r.push({label:`Homepage`,value:e.homepage,href:e.homepage}),e.license&&r.push({label:`License`,value:e.license}),t&&(t.skills.length>0&&r.push({label:`Skills`,value:String(t.skills.length)}),t.hooks.length>0&&r.push({label:`Hooks`,value:String(t.hooks.length)}),t.tools.length>0&&r.push({label:`Tools`,value:String(t.tools.length)})),(0,q.jsx)(`dl`,{className:pe(`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,n),style:{borderColor:`var(--border-base)`},children:r.map(e=>(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,q.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,q.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 underline`,style:{color:`var(--primary-base, #60a5fa)`},children:[e.value,(0,q.jsx)(v,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function Ne({plugin:e,drift:t,onInstall:n,onRemove:r,onUpgrade:a,isInstalling:o,isRemoving:s,isUpgrading:c,hasLocalEdits:l,enabled:u,onToggle:d,isToggling:f}){let[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),v=e.installed??!1,y=e.artifact??null,b=t?.status===`update-available`,x=b?`Upgrade ${Y(t?.local?.commit??null)} → ${Y(t?.remote?.commit??null)}`:void 0;return(0,q.jsxs)(q.Fragment,{children:[v?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-nowrap md:shrink-0`,children:[u!==void 0&&d?(0,q.jsx)(ne,{label:`Auto-include in chat`,checked:u,onChange:()=>d(),disabled:f}):null,y?(0,q.jsx)(i,{asChild:!0,leftIcon:(0,q.jsx)(_,{"aria-hidden":!0}),children:(0,q.jsx)(`a`,{href:y.url,download:!0,children:y.label??`Download`})}):null,b?(0,q.jsx)(i,{type:`button`,onClick:()=>{if(l){g(!0);return}a()},disabled:c,title:x,leftIcon:c?(0,q.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(V,{"aria-hidden":!0}),children:`Upgrade`}):null,(0,q.jsx)(i,{type:`button`,variant:`dangerOutline`,onClick:()=>m(!0),disabled:s,leftIcon:s?(0,q.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(H,{"aria-hidden":!0}),children:`Remove`})]}):(0,q.jsx)(i,{type:`button`,onClick:n,disabled:o,leftIcon:o?(0,q.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(G,{"aria-hidden":!0}),children:`Install`}),(0,q.jsx)(P,{open:p,title:`Remove plugin`,message:Se(e.name),confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{m(!1),r()},onCancel:()=>m(!1)}),(0,q.jsx)(P,{open:h,title:`Upgrade plugin`,message:Ce(e.name),confirmLabel:we,destructive:!0,onConfirm:()=>{g(!1),a()},onCancel:()=>g(!1)})]})}function Z(){return(0,q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,q.jsx)(w,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Q(){return(0,q.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,q.jsx)(D,{className:`h-6 w-6`,"aria-hidden":!0}),(0,q.jsx)(`p`,{className:`text-body-medium-default`,children:`We couldn't load this plugin.`}),(0,q.jsx)(`p`,{className:`text-body-small-default`,children:`It may not exist, or your assistant may be on an older build.`})]})}function Pe({isInstallError:e,isRemoveError:t,isUpgradeError:n}){let r=e?Te:t?Ee:n?De:null;return r?(0,q.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,q.jsx)(D,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),r]}):null}function Fe({external:e,className:t}){let n=e?{label:`External`,icon:S}:{label:`Local`,icon:C};return(0,q.jsx)(k,{tone:`neutral`,leftIcon:(0,K.createElement)(n.icon),className:t,children:n.label})}function Ie({onClick:e,isUpgrading:t=!1}={}){let n=(0,q.jsx)(k,{tone:`warning`,leftIcon:(0,K.createElement)(t?w:V,{className:t?`animate-spin`:void 0}),className:`shrink-0`,children:`Update available`});return e?(0,q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},disabled:t,"aria-label":`Upgrade plugin`,className:`shrink-0 rounded-[6px] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:cursor-not-allowed`,children:n}):n}var Le=300*1e3;function Re({assistantId:e,name:t,enabled:n=!0}){return l({...ae({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t&&n,staleTime:Le,retry:!1})}function ze(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}function Be(e,t,n){let r=c(),i=n?.onRemoved,a=l({...R({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t}),o=Re({assistantId:e,name:t,enabled:a.data?.installed??!1}).data,s=(0,K.useCallback)(()=>he(r,e,t),[e,t,r]),u=se({onSuccess:()=>{s(),N.success(`Installed ${t||`plugin`}`)}}),d=ce({onSuccess:()=>{s(),i?.()}}),f=le({onSuccess:e=>{s(),N.success(e.outcome===`already-up-to-date`?`${t||`Plugin`} is already up to date`:`Upgraded ${t||`plugin`} to ${Y(e.toCommit)}`)}});return{plugin:a.data??null,drift:o,isLoading:a.isLoading,isError:a.isError,install:()=>{u.mutate({path:{assistant_id:e},body:{name:t}})},remove:()=>{d.mutate({path:{assistant_id:e,name:t}})},upgrade:()=>{f.mutate({path:{assistant_id:e,name:t},body:{}})},isInstalling:u.isPending,isRemoving:d.isPending,isUpgrading:f.isPending,isInstallError:u.isError,isRemoveError:d.isError,isUpgradeError:f.isError,hasLocalEdits:ze(o)}}var Ve=`0.10.5`;function He(){return de(Ve)}function Ue(e,t,n,r){let i=He(),{data:a}=l({queryKey:[`pluginIcon`,e,t,r],queryFn:async()=>{let{data:n,error:r}=await I({path:{assistant_id:e,name:t},parseAs:`blob`,throwOnError:!1});if(r||!(n instanceof Blob))throw Error(`Failed to load plugin icon`);return n},enabled:!!(i&&n&&r),staleTime:1/0,retry:!1}),[o,s]=(0,K.useState)(void 0);return(0,K.useEffect)(()=>{if(!a){s(void 0);return}let e=URL.createObjectURL(a);return s(e),()=>{URL.revokeObjectURL(e)}},[a]),o}function We(e){let t=c(),n={queryKey:z({path:{assistant_id:e}})},r=(e,r)=>{t.setQueriesData(n,t=>t&&{...t,plugins:t.plugins.map(t=>t.name===e?{...t,enabled:r}:t)})},i=u({mutationFn:async({name:t,nextEnabled:n})=>{let r=await(n?L({path:{assistant_id:e,name:t},throwOnError:!1}):re({path:{assistant_id:e,name:t},throwOnError:!1})),i=r.response?.status;if(r.response?.ok||i===409)return r;throw Error(`Plugin toggle failed (${i??`network error`})`)},onMutate:async({name:e,nextEnabled:i})=>{await t.cancelQueries(n),r(e,i)},onError:(e,{name:t,nextEnabled:n})=>{r(t,!n),N.error(Oe)},onSettled:(n,r,i)=>{he(t,e,i.name)}});return{toggle:(e,t)=>{i.mutate({name:e,nextEnabled:t})},togglingName:i.isPending?i.variables?.name??null:null}}function Ge({assistantId:e,name:t,onBack:n,externalHint:r,enabled:a}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Be(e,t,{onRemoved:n}),{toggle:ee,togglingName:S}=We(e),C=Ue(e,t,o?.hasIcon,o?.iconVersion);return(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,q.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,q.jsx)(i,{type:`button`,variant:`ghost`,iconOnly:(0,q.jsx)(m,{"aria-hidden":!0}),"aria-label":`Back to plugins`,onClick:n}),(0,q.jsx)(Ke,{name:t,plugin:o,externalHint:r,iconSrc:C,drift:s,onInstall:u,onRemove:d,onUpgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x,enabled:a,onToggle:()=>ee(t,!a),isToggling:S===t})]}),(v||y||b)&&(0,q.jsx)(Pe,{isInstallError:v,isRemoveError:y,isUpgradeError:b}),(0,q.jsx)(f.Root,{asChild:!0,children:(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:c?(0,q.jsx)(Z,{}):l||!o?(0,q.jsx)(Q,{}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(X,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,q.jsx)(F,{content:o.readme}):(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})]})}function Ke({name:e,plugin:t,externalHint:n,iconSrc:r,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}){let h=t?.source?.kind===`github`,g=t?h:n,_=i?.status===`update-available`;return(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[g===void 0?(0,q.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,q.jsx)(J,{external:g,icon:t?.icon??void 0,iconSrc:r,size:`md`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,q.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,q.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,t?(0,q.jsx)(Fe,{external:h}):null,_?(0,q.jsx)(Ie,{}):null]}),t?.description?(0,q.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?(0,q.jsx)(Ne,{plugin:t,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}):null]})}var qe=e(a(),1);function Je({assistantId:e,name:t,onBack:n,externalHint:r,enabled:a}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Be(e,t,{onRemoved:n}),{toggle:ee,togglingName:S}=We(e),[C,w]=(0,K.useState)(null);(0,K.useEffect)(()=>{w(document.getElementById(`viewport-overlays`))},[]);let T=o?.source?.kind===`github`,E=o?T:r,D=s?.status===`update-available`,O=o?.name??t,k=Ue(e,t,o?.hasIcon,o?.iconVersion),A=(0,q.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsx)(i,{variant:`ghost`,iconOnly:(0,q.jsx)(m,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to plugins`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:O}),(0,q.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0 touch-mobile:h-10 touch-mobile:w-10`})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[E===void 0?(0,q.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,q.jsx)(J,{external:E,icon:o?.icon??void 0,iconSrc:k,size:`md`}),(0,q.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:O})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[D?(0,q.jsx)(Ie,{}):null,o?(0,q.jsx)(Fe,{external:T}):null]})]}),o?.description?(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:o.description}):null]}),o?(0,q.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:(0,q.jsx)(Ne,{plugin:o,drift:s,enabled:a,onToggle:()=>ee(t,!a),isToggling:S===t,onInstall:u,onRemove:d,onUpgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x})}):null,(v||y||b)&&(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(Pe,{isInstallError:v,isRemoveError:y,isUpgradeError:b})}),(0,q.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,q.jsx)(`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,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:c?(0,q.jsx)(Z,{}):l||!o?(0,q.jsx)(Q,{}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(X,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,q.jsx)(F,{content:o.readme}):(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})})]});return C?(0,qe.createPortal)(A,C):A}var Ye={value:`all`,label:`All`,icon:W},Xe={value:`available`,label:`Available`,icon:G};function Ze(e){return e?[Ye,{value:`active`,label:`Active`,icon:_e},{value:`off`,label:`Off`,icon:be},Xe]:[Ye,{value:`installed`,label:`Installed`,icon:U},Xe]}function Qe({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i=!1,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginToggleSupported:d}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(te,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search plugins`,"aria-label":`Search plugins`,leftIcon:(0,q.jsx)(B,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,q.jsx)(w,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,q.jsx)($e,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginToggleSupported:d})]})}function $e(e){let t=ge(),[n,r]=(0,K.useState)(!1),a=(0,q.jsx)(i,{type:`button`,variant:`outlined`,iconOnly:(0,q.jsx)(y,{"aria-hidden":!0}),"aria-label":`Filter plugins`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,q.jsx)(et,{...e,open:n,onOpenChange:r,trigger:a}):(0,q.jsxs)(A.Root,{open:n,onOpenChange:r,children:[(0,q.jsx)(A.Trigger,{asChild:!0,children:a}),(0,q.jsx)(A.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,q.jsx)(`ul`,{role:`listbox`,children:(0,q.jsx)(rt,{label:`Status`,options:Ze(e.pluginToggleSupported),selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}})})})]})}function et({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:a,counts:o,totalCount:s,showCounts:c,pluginToggleSupported:l,open:u,onOpenChange:d,trigger:f}){let p=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,q.jsxs)(j.Root,{open:u,onOpenChange:d,children:[(0,q.jsx)(j.Trigger,{asChild:!0,children:f}),(0,q.jsxs)(j.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,q.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,q.jsx)(j.Header,{children:(0,q.jsx)(j.Title,{children:`Filters`})}),(0,q.jsxs)(j.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,q.jsx)(tt,{label:`Status`,children:Ze(l).map(n=>(0,q.jsx)(nt,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),n.length>0&&(0,q.jsxs)(tt,{label:`Categories`,children:[(0,q.jsx)(nt,{icon:W,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>a(null)}),p.map(e=>(0,q.jsx)(nt,{icon:x(e.icon)??W,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>a(e.slug)},e.slug))]})]}),(0,q.jsx)(j.Footer,{children:(0,q.jsx)(i,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>d(!1),children:`Done`})})]})]})}function tt({label:e,children:t}){return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function nt({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,q.jsx)(M,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,q.jsx)(h,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function rt({label:e,options:t,selected:n,onSelect:r}){return(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,q.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,q.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,q.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,q.jsx)(U,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}function it({assistantId:e,item:t,drift:n,onSelect:r,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c=!1,isRemoving:l=!1,isUpgrading:u=!1}){let d=t.status===`available`,p=n?.status===`update-available`,m=t.enabled!==void 0,h=t.enabled===!1,g=Ue(e,t.name,t.hasIcon,t.iconVersion);return(0,q.jsx)(f.Root,{asChild:!0,children:(0,q.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:r,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,q.jsx)(J,{size:`sm`,external:t.external,icon:t.icon,iconSrc:g,className:h?`opacity-50`:void 0}),(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:`truncate text-body-medium-default`,style:{color:h?`var(--content-tertiary)`:`var(--content-emphasised)`},children:t.name}),t.version?(0,q.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,p?(0,q.jsx)(Ie,{onClick:s,isUpgrading:u}):null]}),(0,q.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description??`No description provided.`}),t.issues&&t.issues.length>0?(0,q.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:t.issues.join(`; `),children:[t.issues[0],t.issues.length>1?` (+${t.issues.length-1} more)`:``]}):null]}),d?c?(0,q.jsx)(i,{type:`button`,iconOnly:(0,q.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,q.jsx)(i,{type:`button`,iconOnly:(0,q.jsx)(G,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),a?.()},disabled:!a,"aria-label":`Install plugin`,expandOnMobile:!1}):(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[m?(0,q.jsx)(k,{tone:t.enabled?`positive`:`neutral`,children:t.enabled?`Enabled`:`Disabled`}):null,(0,q.jsx)(i,{type:`button`,variant:`dangerOutline`,iconOnly:l?(0,q.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(H,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),o?.()},disabled:l||u||!o,"aria-label":`Remove plugin`,expandOnMobile:!1})]})]})})}var at=300*1e3,$=[],ot=[];async function st(e,t,n){let r=await ie({path:{assistant_id:e},query:{q:void 0,category:t},signal:n,throwOnError:!1});if(r.response?.status===404)return{plugins:[]};if(!r.response?.ok)throw Error(`Failed to load plugins`);return r.data??{plugins:[]}}function ct(e,t){let[n,r]=(0,K.useState)({assistantId:e,latched:!1}),i=n.assistantId===e?n.latched:!1;return n.assistantId!==e&&r({assistantId:e,latched:!1}),(0,K.useEffect)(()=>{t&&r(t=>t.assistantId===e&&t.latched?t:{assistantId:e,latched:!0})},[e,t]),i||t}function lt(e,t=null){let n=t??void 0,r=l({queryKey:z({path:{assistant_id:e},query:{q:void 0,category:n}}),queryFn:({signal:t})=>st(e,n,t),enabled:!!e,staleTime:at}),i=l({...me(e),enabled:!!e&&t!==null}),a=l({...oe({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e,staleTime:at}),o=(0,K.useMemo)(()=>{let e=t===null?r.data?.plugins:i.data?.plugins??r.data?.plugins;return new Set((e??$).map(e=>e.name))},[t,i.data?.plugins,r.data?.plugins]),s=(0,K.useMemo)(()=>{let e=r.data?.plugins??$,n=a.data?.matches??ot;return je(ke(e,(t===null?n:n.filter(e=>(e.category??`system`)===t)).filter(e=>!o.has(e.name))))},[r.data?.plugins,a.data?.matches,t,o]),u=t===null?r.data:i.data,d=ct(e,u?.categoryCounts!==void 0),f=ct(e,(u?.plugins??$).some(e=>e.enabled!==void 0)),p=c(),m=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(m.current===e||!a.isSuccess)return;let t=u?.plugins;if(!t?.length)return;let n=new Map((a.data?.matches??ot).map(e=>[e.name,e.category]));t.some(e=>{let t=n.get(e.name);return t!=null&&t!==`system`&&(e.category??`system`)===`system`})&&(m.current=e,p.invalidateQueries({queryKey:z({path:{assistant_id:e},query:{q:void 0}})}))},[e,a.isSuccess,a.data?.matches,u?.plugins,p]),{items:s,isLoading:r.isLoading,catalogLoading:a.isLoading,isError:r.isError,isFetching:r.isFetching||a.isFetching,catalogError:a.isError,categorySupported:d,pluginToggleSupported:f,installedCategoryCounts:u?.categoryCounts,installedPlugins:u?.plugins??$,installedTotal:u?.totalCount,catalogMatches:a.data?.matches??ot,unfilteredInstalledNames:o}}var ut=`vellum:plugins:tipDismissed`;function dt({assistantId:e}){let r=c(),i=ge(),[a,s]=o(),l=a.get(`plugin`),u=a.get(`success`),d=(0,K.useRef)(!1);(0,K.useEffect)(()=>{u!==`true`||d.current||(d.current=!0,l&&N.success(`Installed ${l}`),s(e=>{let t=new URLSearchParams(e);return t.delete(`success`),t},{replace:!0}))},[u,l,s]);let[f,p]=(0,K.useState)(``),[m,h]=(0,K.useState)(`all`),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(null),[T,E]=(0,K.useState)(null),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(()=>n(ut,!1)),[te,ne]=(0,K.useState)(e);e!==te&&(ne(e),_(null));let j=e===te?g:null,{data:M=[]}=ee(e),{items:F,isLoading:I,catalogLoading:re,isError:L,isFetching:ie,catalogError:ae,categorySupported:oe,pluginToggleSupported:R,installedCategoryCounts:z,installedPlugins:ue,installedTotal:de,catalogMatches:fe,unfilteredInstalledNames:pe}=lt(e,j),B=(R?[`all`,`active`,`off`,`available`]:[`all`,`installed`,`available`]).includes(m)?m:`all`,{counts:me,totalCount:V}=ft(z,ue,de,fe,pe,B),H=oe&&M.length>0,U=(0,K.useCallback)(t=>he(r,e,t),[e,r]),W=se({onMutate:e=>y(e.body.name),onSuccess:(e,t)=>N.success(`Installed ${t.body.name}`),onError:()=>N.error(Te),onSettled:(e,t,n)=>{y(null),U(n.body.name)}}),_e=ce({onMutate:e=>S(e.path.name),onSuccess:(e,t)=>N.success(`Removed ${t.path.name}`),onError:()=>N.error(Ee),onSettled:(e,t,n)=>{S(null),U(n.path.name)}}),G=le({onMutate:e=>w(e.path.name),onSuccess:(e,t)=>N.success(e.outcome===`already-up-to-date`?`${t.path.name} is already up to date`:`Upgraded ${t.path.name} to ${Y(e.toCommit)}`),onError:()=>N.error(De),onSettled:(e,t,n)=>{w(null),U(n.path.name)}}),ve=(0,K.useCallback)(e=>s(t=>{let n=new URLSearchParams(t);return n.set(`plugin`,e.name),n}),[s]),ye=(0,K.useCallback)(()=>s(e=>{let t=new URLSearchParams(e);return t.delete(`plugin`),t},{replace:!0}),[s]),be=(0,K.useCallback)(t=>{W.mutate({path:{assistant_id:e},body:{name:t.name}})},[e,W]),xe=(0,K.useCallback)(()=>{T&&(_e.mutate({path:{assistant_id:e,name:T.name}}),E(null))},[e,T,_e]),J=(0,K.useCallback)(t=>{G.mutate({path:{assistant_id:e,name:t},body:{}})},[e,G]),Oe=(0,K.useCallback)(()=>{D&&(J(D.name),O(null))},[D,J]),ke=(0,K.useCallback)((e,t)=>{if(ze(t)){O(e);return}J(e.name)},[J]),je=(0,K.useCallback)(()=>{A(!0),t(ut,!0)},[]),X=(0,K.useMemo)(()=>Me(F,B).filter(e=>Ae(e,f)),[F,B,f]),Ne=ie&&!I,Z=f.trim().length>0;if(l){let t=F.find(e=>e.name===l),n={assistantId:e,name:l,externalHint:t?.external,enabled:t?.enabled,onBack:ye};return i?(0,q.jsx)(Je,{...n}):(0,q.jsx)(Ge,{...n})}let Q=(0,q.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:I?(0,q.jsx)(gt,{}):L?(0,q.jsx)(_t,{}):X.length===0?re&&(B===`all`||B===`available`)?(0,q.jsx)(gt,{}):(0,q.jsx)(vt,{filter:B,category:j}):(0,q.jsx)(`ul`,{className:`flex flex-col gap-2`,children:X.map(t=>(0,q.jsx)(`li`,{children:t.status===`installed`?(0,q.jsx)(pt,{assistantId:e,item:t,onSelect:()=>ve(t),onRemove:()=>E(t),onUpgrade:e=>ke(t,e),isRemoving:x===t.name,isUpgrading:C===t.name}):(0,q.jsx)(it,{assistantId:e,item:t,onSelect:()=>ve(t),onInstall:()=>be(t),isInstalling:v===t.name})},t.name))})});return(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!k&&(0,q.jsx)(mt,{onDismiss:je}),(0,q.jsx)(Qe,{search:f,onSearchChange:p,filter:B,onFilterChange:h,isSearching:Ne,categories:H?M:[],category:j,onCategoryChange:_,counts:me,totalCount:V,showCounts:!Z,pluginToggleSupported:R}),ae&&!I&&!L?(0,q.jsx)(ht,{}):null,H?(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,q.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto md:block`,children:(0,q.jsx)(b,{ariaLabel:`Plugin categories`,selected:j,onSelect:_,counts:me,totalCount:V,showCounts:!Z,categories:M})}),Q]}):Q,(0,q.jsx)(P,{open:T!==null,title:`Remove plugin`,message:T?Se(T.name):``,confirmLabel:`Remove`,destructive:!0,onConfirm:xe,onCancel:()=>E(null)}),(0,q.jsx)(P,{open:D!==null,title:`Upgrade plugin`,message:D?Ce(D.name):``,confirmLabel:we,destructive:!0,onConfirm:Oe,onCancel:()=>O(null)})]})}function ft(e,t,n,r,i,a){return(0,K.useMemo)(()=>{let o={},s=a!==`available`,c=a===`all`||a===`available`,l=a===`active`||a===`off`,u=l?t.filter(e=>a===`off`?e.enabled===!1:e.enabled!==!1):t;if(s)if(!l&&e&&Object.keys(e).length>0)Object.assign(o,e);else for(let e of u){let t=e.category??`system`;o[t]=(o[t]??0)+1}let d=0;if(c)for(let e of r){if(i.has(e.name))continue;let t=e.category??`system`;o[t]=(o[t]??0)+1,d+=1}let f=l?u.length:n??t.length;return{counts:o,totalCount:(s?f:0)+d}},[e,t,n,r,i,a])}function pt({assistantId:e,item:t,onSelect:n,onRemove:r,onUpgrade:i,isRemoving:a,isUpgrading:o}){let s=Re({assistantId:e,name:t.name}).data;return(0,q.jsx)(it,{assistantId:e,item:t,drift:s,onSelect:n,onRemove:r,onUpgrade:()=>i(s),isRemoving:a,isUpgrading:o})}function mt({onDismiss:e}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,q.jsx)(E,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,q.jsx)(`p`,{className:`flex-1`,children:`Browse the catalog below to install plugins that extend your assistant.`}),(0,q.jsx)(i,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,q.jsx)(O,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function ht(){return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,q.jsx)(g,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,q.jsx)(`p`,{className:`flex-1`,children:`Catalog browsing is temporarily unavailable. Installed plugins are still listed below.`})]})}function gt(){return(0,q.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,q.jsx)(w,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function _t(){return(0,q.jsx)(f.Root,{children:(0,q.jsxs)(f.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,q.jsx)(D,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,q.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load plugins`}),(0,q.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function vt({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=yt(e,t);return(0,q.jsx)(f.Root,{children:(0,q.jsxs)(f.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,q.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,q.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,q.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r})]})})}function yt(e,t){if(t)return{title:`No plugins in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:W};switch(e){case`installed`:return{title:`No Plugins Installed`,subtitle:`Browse the catalog to install plugins that extend your assistant.`,Icon:T};case`active`:return{title:`No Active Plugins`,subtitle:`Install a plugin from the catalog, or turn on an installed one.`,Icon:T};case`off`:return{title:`No Plugins Turned Off`,subtitle:`Installed plugins you turn off will appear here.`,Icon:T};case`available`:return{title:`No Plugins Available`,subtitle:`Every catalog plugin is already installed.`,Icon:U};default:return{title:`No Plugins Found`,subtitle:`Browse the catalog to install plugins that extend your assistant.`,Icon:T}}}function bt(){let e=ue.use.version(),t=ye(),n=ve();return e===null?null:t?(0,q.jsx)(dt,{assistantId:n}):(0,q.jsx)(s,{to:fe.identity,replace:!0})}export{bt as PluginsPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./local-settings-C-dW2vkq.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i,z as a}from"./button-BQVYX8n_.js";import{m as o,n as s}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as c}from"./QueryClientProvider-DKhXIxGb.js";import{t as l}from"./useQuery-B45lW1Kk.js";import{t as u}from"./useMutation-Lj4VunQV.js";import{t as d}from"./jsx-runtime-CVSDxk6A.js";import{t as f}from"./card-D8zyWtZh.js";import{t as p}from"./createLucideIcon-Bjb-Kuq7.js";import{t as m}from"./arrow-left-C2re-gYj.js";import{t as h}from"./check-wF3S-AV4.js";import{t as g}from"./cloud-off-DT0KnUQ4.js";import{t as _}from"./download-CXYjvgB3.js";import{t as v}from"./external-link-5a-JuPGf.js";import{i as y,n as b,r as x,t as ee}from"./use-skill-categories-DCOdxAre.js";import{t as S}from"./globe-Dx8dM0gj.js";import{t as C}from"./hard-drive-BxDRcYId.js";import{t as w}from"./loader-circle-D57RZgLH.js";import{t as T}from"./puzzle-CL8CuOcC.js";import{t as E}from"./sparkles-DDIsk_nZ.js";import{t as D}from"./triangle-alert-DXEpFOj_.js";import{t as O}from"./x-CswtfvgS.js";import"./src-CDdn26Yb.js";import{t as k}from"./tag-B6WeUtBW.js";import{t as A}from"./popover-Bl6742nZ.js";import{t as te}from"./input-ZpyYt_a0.js";import{t as ne}from"./toggle-QSEiPr3k.js";import{n as j,t as M}from"./panel-item-Bvqsr5n9.js";import{n as N}from"./toast-ZoZVyeDI.js";import{t as P}from"./confirm-dialog-CCrDkChx.js";import{t as F}from"./file-markdown-DZhQRECx.js";import{In as I,Nn as re,Pn as L,zn as ie}from"./sdk.gen-D_Qurj4O.js";import{at as ae,ct as oe,in as se,nn as ce,rn as le,rt as R,st as z}from"./react-query.gen-BQH0QRfT.js";import{t as ue}from"./assistant-identity-store-bwxIa6fM.js";import{r as de}from"./utils-ilzygKkt.js";import{c as fe}from"./routes-XPLb07Av.js";import{t as pe}from"./misc-Dz1odwkI.js";import{At as B,Ha as V,Ja as H,Pr as me,Ua as U,Ui as W,ea as he,ra as ge,xa as G,zr as _e}from"./index-CgcZXB4g.js";import{t as ve}from"./use-active-assistant-id-9rGx8kT9.js";import{t as ye}from"./plugins-surface-Db6GSyl4.js";var be=p(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),K=e(r(),1),q=d(),xe={sm:`h-7 w-7`,md:`h-8 w-8 text-3xl`};function J({external:e=!1,icon:t,iconSrc:n,size:r=`sm`,className:i}){let[a,o]=(0,K.useState)(!1);(0,K.useEffect)(()=>{o(!1)},[n]);let s=t||(e?`📦`:`🧩`),c=!!n&&!a;return(0,q.jsx)(`span`,{className:pe(`flex shrink-0 items-center justify-center`,xe[r],i),children:c?(0,q.jsx)(`img`,{src:n,alt:``,"aria-hidden":!0,loading:`lazy`,className:`h-full w-full object-contain`,onError:()=>o(!0)}):s})}var Se=e=>`Remove "${e}" from this assistant?`,Ce=e=>`"${e}" has local edits that will be overwritten by the upgrade. Continue?`,we=`Upgrade anyway`,Te=`Failed to install plugin. Please try again.`,Ee=`Failed to remove plugin. Please try again.`,De=`Failed to upgrade plugin. Please try again.`,Oe=`Failed to update plugin. Please try again.`;function ke(e,t){let n=e.map(e=>({name:e.name,description:e.description??void 0,status:`installed`,external:void 0,version:e.version??void 0,path:e.path,issues:e.issues,enabled:e.enabled,icon:e.icon,hasIcon:e.hasIcon,iconVersion:e.iconVersion})),r=new Set(n.map(e=>e.name)),i=t.filter(e=>!r.has(e.name)).map(e=>({name:e.name,description:e.description,status:`available`,external:!0,path:e.path}));return[...n,...i]}function Ae(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description].some(e=>e?.toLowerCase().includes(n)):!0}function je(e){return[...e].sort((e,t)=>{let n=e.status===`installed`;return n===(t.status===`installed`)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function Me(e,t){switch(t){case`all`:return e;case`available`:return e.filter(e=>e.status===`available`);case`installed`:return e.filter(e=>e.status===`installed`);case`active`:return e.filter(e=>e.status===`installed`&&e.enabled!==!1);case`off`:return e.filter(e=>e.status===`installed`&&e.enabled===!1)}}function Y(e){return e?e.slice(0,7):`unknown`}function X({plugin:e,surfaces:t=null,className:n}){let r=[{label:`Source`,value:e.source?.kind===`github`?e.source.repo:`Local`,href:(e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null)??void 0}];return e.homepage&&r.push({label:`Homepage`,value:e.homepage,href:e.homepage}),e.license&&r.push({label:`License`,value:e.license}),t&&(t.skills.length>0&&r.push({label:`Skills`,value:String(t.skills.length)}),t.hooks.length>0&&r.push({label:`Hooks`,value:String(t.hooks.length)}),t.tools.length>0&&r.push({label:`Tools`,value:String(t.tools.length)})),(0,q.jsx)(`dl`,{className:pe(`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,n),style:{borderColor:`var(--border-base)`},children:r.map(e=>(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,q.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,q.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 underline`,style:{color:`var(--primary-base, #60a5fa)`},children:[e.value,(0,q.jsx)(v,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function Ne({plugin:e,drift:t,onInstall:n,onRemove:r,onUpgrade:a,isInstalling:o,isRemoving:s,isUpgrading:c,hasLocalEdits:l,enabled:u,onToggle:d,isToggling:f}){let[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),v=e.installed??!1,y=e.artifact??null,b=t?.status===`update-available`,x=b?`Upgrade ${Y(t?.local?.commit??null)} → ${Y(t?.remote?.commit??null)}`:void 0;return(0,q.jsxs)(q.Fragment,{children:[v?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-nowrap md:shrink-0`,children:[u!==void 0&&d?(0,q.jsx)(ne,{label:`Auto-include in chat`,checked:u,onChange:()=>d(),disabled:f}):null,y?(0,q.jsx)(i,{asChild:!0,leftIcon:(0,q.jsx)(_,{"aria-hidden":!0}),children:(0,q.jsx)(`a`,{href:y.url,download:!0,children:y.label??`Download`})}):null,b?(0,q.jsx)(i,{type:`button`,onClick:()=>{if(l){g(!0);return}a()},disabled:c,title:x,leftIcon:c?(0,q.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(U,{"aria-hidden":!0}),children:`Upgrade`}):null,(0,q.jsx)(i,{type:`button`,variant:`dangerOutline`,onClick:()=>m(!0),disabled:s,leftIcon:s?(0,q.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(W,{"aria-hidden":!0}),children:`Remove`})]}):(0,q.jsx)(i,{type:`button`,onClick:n,disabled:o,leftIcon:o?(0,q.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(H,{"aria-hidden":!0}),children:`Install`}),(0,q.jsx)(P,{open:p,title:`Remove plugin`,message:Se(e.name),confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{m(!1),r()},onCancel:()=>m(!1)}),(0,q.jsx)(P,{open:h,title:`Upgrade plugin`,message:Ce(e.name),confirmLabel:we,destructive:!0,onConfirm:()=>{g(!1),a()},onCancel:()=>g(!1)})]})}function Z(){return(0,q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,q.jsx)(w,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Q(){return(0,q.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,q.jsx)(D,{className:`h-6 w-6`,"aria-hidden":!0}),(0,q.jsx)(`p`,{className:`text-body-medium-default`,children:`We couldn't load this plugin.`}),(0,q.jsx)(`p`,{className:`text-body-small-default`,children:`It may not exist, or your assistant may be on an older build.`})]})}function Pe({isInstallError:e,isRemoveError:t,isUpgradeError:n}){let r=e?Te:t?Ee:n?De:null;return r?(0,q.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,q.jsx)(D,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),r]}):null}function Fe({external:e,className:t}){let n=e?{label:`External`,icon:S}:{label:`Local`,icon:C};return(0,q.jsx)(k,{tone:`neutral`,leftIcon:(0,K.createElement)(n.icon),className:t,children:n.label})}function Ie({onClick:e,isUpgrading:t=!1}={}){let n=(0,q.jsx)(k,{tone:`warning`,leftIcon:(0,K.createElement)(t?w:U,{className:t?`animate-spin`:void 0}),className:`shrink-0`,children:`Update available`});return e?(0,q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},disabled:t,"aria-label":`Upgrade plugin`,className:`shrink-0 rounded-[6px] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:cursor-not-allowed`,children:n}):n}var Le=300*1e3;function Re({assistantId:e,name:t,enabled:n=!0}){return l({...ae({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t&&n,staleTime:Le,retry:!1})}function ze(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}function Be(e,t,n){let r=c(),i=n?.onRemoved,a=l({...R({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t}),o=Re({assistantId:e,name:t,enabled:a.data?.installed??!1}).data,s=(0,K.useCallback)(()=>me(r,e,t),[e,t,r]),u=se({onSuccess:()=>{s(),N.success(`Installed ${t||`plugin`}`)}}),d=ce({onSuccess:()=>{s(),i?.()}}),f=le({onSuccess:e=>{s(),N.success(e.outcome===`already-up-to-date`?`${t||`Plugin`} is already up to date`:`Upgraded ${t||`plugin`} to ${Y(e.toCommit)}`)}});return{plugin:a.data??null,drift:o,isLoading:a.isLoading,isError:a.isError,install:()=>{u.mutate({path:{assistant_id:e},body:{name:t}})},remove:()=>{d.mutate({path:{assistant_id:e,name:t}})},upgrade:()=>{f.mutate({path:{assistant_id:e,name:t},body:{}})},isInstalling:u.isPending,isRemoving:d.isPending,isUpgrading:f.isPending,isInstallError:u.isError,isRemoveError:d.isError,isUpgradeError:f.isError,hasLocalEdits:ze(o)}}var Ve=`0.10.5`;function He(){return de(Ve)}function Ue(e,t,n,r){let i=He(),{data:a}=l({queryKey:[`pluginIcon`,e,t,r],queryFn:async()=>{let{data:n,error:r}=await I({path:{assistant_id:e,name:t},parseAs:`blob`,throwOnError:!1});if(r||!(n instanceof Blob))throw Error(`Failed to load plugin icon`);return n},enabled:!!(i&&n&&r),staleTime:1/0,retry:!1}),[o,s]=(0,K.useState)(void 0);return(0,K.useEffect)(()=>{if(!a){s(void 0);return}let e=URL.createObjectURL(a);return s(e),()=>{URL.revokeObjectURL(e)}},[a]),o}function We(e){let t=c(),n={queryKey:z({path:{assistant_id:e}})},r=(e,r)=>{t.setQueriesData(n,t=>t&&{...t,plugins:t.plugins.map(t=>t.name===e?{...t,enabled:r}:t)})},i=u({mutationFn:async({name:t,nextEnabled:n})=>{let r=await(n?L({path:{assistant_id:e,name:t},throwOnError:!1}):re({path:{assistant_id:e,name:t},throwOnError:!1})),i=r.response?.status;if(r.response?.ok||i===409)return r;throw Error(`Plugin toggle failed (${i??`network error`})`)},onMutate:async({name:e,nextEnabled:i})=>{await t.cancelQueries(n),r(e,i)},onError:(e,{name:t,nextEnabled:n})=>{r(t,!n),N.error(Oe)},onSettled:(n,r,i)=>{me(t,e,i.name)}});return{toggle:(e,t)=>{i.mutate({name:e,nextEnabled:t})},togglingName:i.isPending?i.variables?.name??null:null}}function Ge({assistantId:e,name:t,onBack:n,externalHint:r,enabled:a}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Be(e,t,{onRemoved:n}),{toggle:ee,togglingName:S}=We(e),C=Ue(e,t,o?.hasIcon,o?.iconVersion);return(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,q.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,q.jsx)(i,{type:`button`,variant:`ghost`,iconOnly:(0,q.jsx)(m,{"aria-hidden":!0}),"aria-label":`Back to plugins`,onClick:n}),(0,q.jsx)(Ke,{name:t,plugin:o,externalHint:r,iconSrc:C,drift:s,onInstall:u,onRemove:d,onUpgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x,enabled:a,onToggle:()=>ee(t,!a),isToggling:S===t})]}),(v||y||b)&&(0,q.jsx)(Pe,{isInstallError:v,isRemoveError:y,isUpgradeError:b}),(0,q.jsx)(f.Root,{asChild:!0,children:(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:c?(0,q.jsx)(Z,{}):l||!o?(0,q.jsx)(Q,{}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(X,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,q.jsx)(F,{content:o.readme}):(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})]})}function Ke({name:e,plugin:t,externalHint:n,iconSrc:r,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}){let h=t?.source?.kind===`github`,g=t?h:n,_=i?.status===`update-available`;return(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[g===void 0?(0,q.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,q.jsx)(J,{external:g,icon:t?.icon??void 0,iconSrc:r,size:`md`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,q.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,q.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,t?(0,q.jsx)(Fe,{external:h}):null,_?(0,q.jsx)(Ie,{}):null]}),t?.description?(0,q.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?(0,q.jsx)(Ne,{plugin:t,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}):null]})}var qe=e(a(),1);function Je({assistantId:e,name:t,onBack:n,externalHint:r,enabled:a}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Be(e,t,{onRemoved:n}),{toggle:ee,togglingName:S}=We(e),[C,w]=(0,K.useState)(null);(0,K.useEffect)(()=>{w(document.getElementById(`viewport-overlays`))},[]);let T=o?.source?.kind===`github`,E=o?T:r,D=s?.status===`update-available`,O=o?.name??t,k=Ue(e,t,o?.hasIcon,o?.iconVersion),A=(0,q.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsx)(i,{variant:`ghost`,iconOnly:(0,q.jsx)(m,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to plugins`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:O}),(0,q.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0 touch-mobile:h-10 touch-mobile:w-10`})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[E===void 0?(0,q.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,q.jsx)(J,{external:E,icon:o?.icon??void 0,iconSrc:k,size:`md`}),(0,q.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:O})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[D?(0,q.jsx)(Ie,{}):null,o?(0,q.jsx)(Fe,{external:T}):null]})]}),o?.description?(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:o.description}):null]}),o?(0,q.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:(0,q.jsx)(Ne,{plugin:o,drift:s,enabled:a,onToggle:()=>ee(t,!a),isToggling:S===t,onInstall:u,onRemove:d,onUpgrade:p,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x})}):null,(v||y||b)&&(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(Pe,{isInstallError:v,isRemoveError:y,isUpgradeError:b})}),(0,q.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,q.jsx)(`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,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:c?(0,q.jsx)(Z,{}):l||!o?(0,q.jsx)(Q,{}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(X,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,q.jsx)(F,{content:o.readme}):(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})})]});return C?(0,qe.createPortal)(A,C):A}var Ye={value:`all`,label:`All`,icon:G},Xe={value:`available`,label:`Available`,icon:H};function Ze(e){return e?[Ye,{value:`active`,label:`Active`,icon:ge},{value:`off`,label:`Off`,icon:be},Xe]:[Ye,{value:`installed`,label:`Installed`,icon:V},Xe]}function Qe({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i=!1,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginToggleSupported:d}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(te,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search plugins`,"aria-label":`Search plugins`,leftIcon:(0,q.jsx)(he,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,q.jsx)(w,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,q.jsx)($e,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginToggleSupported:d})]})}function $e(e){let t=_e(),[n,r]=(0,K.useState)(!1),a=(0,q.jsx)(i,{type:`button`,variant:`outlined`,iconOnly:(0,q.jsx)(y,{"aria-hidden":!0}),"aria-label":`Filter plugins`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,q.jsx)(et,{...e,open:n,onOpenChange:r,trigger:a}):(0,q.jsxs)(A.Root,{open:n,onOpenChange:r,children:[(0,q.jsx)(A.Trigger,{asChild:!0,children:a}),(0,q.jsx)(A.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,q.jsx)(`ul`,{role:`listbox`,children:(0,q.jsx)(rt,{label:`Status`,options:Ze(e.pluginToggleSupported),selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}})})})]})}function et({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:a,counts:o,totalCount:s,showCounts:c,pluginToggleSupported:l,open:u,onOpenChange:d,trigger:f}){let p=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,q.jsxs)(j.Root,{open:u,onOpenChange:d,children:[(0,q.jsx)(j.Trigger,{asChild:!0,children:f}),(0,q.jsxs)(j.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,q.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,q.jsx)(j.Header,{children:(0,q.jsx)(j.Title,{children:`Filters`})}),(0,q.jsxs)(j.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,q.jsx)(tt,{label:`Status`,children:Ze(l).map(n=>(0,q.jsx)(nt,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),n.length>0&&(0,q.jsxs)(tt,{label:`Categories`,children:[(0,q.jsx)(nt,{icon:G,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>a(null)}),p.map(e=>(0,q.jsx)(nt,{icon:x(e.icon)??G,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>a(e.slug)},e.slug))]})]}),(0,q.jsx)(j.Footer,{children:(0,q.jsx)(i,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>d(!1),children:`Done`})})]})]})}function tt({label:e,children:t}){return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function nt({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,q.jsx)(M,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,q.jsx)(h,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function rt({label:e,options:t,selected:n,onSelect:r}){return(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,q.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,q.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,q.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,q.jsx)(V,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}function it({assistantId:e,item:t,drift:n,onSelect:r,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c=!1,isRemoving:l=!1,isUpgrading:u=!1}){let d=t.status===`available`,p=n?.status===`update-available`,m=t.enabled!==void 0,h=t.enabled===!1,g=Ue(e,t.name,t.hasIcon,t.iconVersion);return(0,q.jsx)(f.Root,{asChild:!0,children:(0,q.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:r,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,q.jsx)(J,{size:`sm`,external:t.external,icon:t.icon,iconSrc:g,className:h?`opacity-50`:void 0}),(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:`truncate text-body-medium-default`,style:{color:h?`var(--content-tertiary)`:`var(--content-emphasised)`},children:t.name}),t.version?(0,q.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,p?(0,q.jsx)(Ie,{onClick:s,isUpgrading:u}):null]}),(0,q.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description??`No description provided.`}),t.issues&&t.issues.length>0?(0,q.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:t.issues.join(`; `),children:[t.issues[0],t.issues.length>1?` (+${t.issues.length-1} more)`:``]}):null]}),d?c?(0,q.jsx)(i,{type:`button`,iconOnly:(0,q.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,q.jsx)(i,{type:`button`,iconOnly:(0,q.jsx)(H,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),a?.()},disabled:!a,"aria-label":`Install plugin`,expandOnMobile:!1}):(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[m?(0,q.jsx)(k,{tone:t.enabled?`positive`:`neutral`,children:t.enabled?`Enabled`:`Disabled`}):null,(0,q.jsx)(i,{type:`button`,variant:`dangerOutline`,iconOnly:l?(0,q.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(W,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),o?.()},disabled:l||u||!o,"aria-label":`Remove plugin`,expandOnMobile:!1})]})]})})}var at=300*1e3,$=[],ot=[];async function st(e,t,n){let r=await ie({path:{assistant_id:e},query:{q:void 0,category:t},signal:n,throwOnError:!1});if(r.response?.status===404)return{plugins:[]};if(!r.response?.ok)throw Error(`Failed to load plugins`);return r.data??{plugins:[]}}function ct(e,t){let[n,r]=(0,K.useState)({assistantId:e,latched:!1}),i=n.assistantId===e?n.latched:!1;return n.assistantId!==e&&r({assistantId:e,latched:!1}),(0,K.useEffect)(()=>{t&&r(t=>t.assistantId===e&&t.latched?t:{assistantId:e,latched:!0})},[e,t]),i||t}function lt(e,t=null){let n=t??void 0,r=l({queryKey:z({path:{assistant_id:e},query:{q:void 0,category:n}}),queryFn:({signal:t})=>st(e,n,t),enabled:!!e,staleTime:at}),i=l({...B(e),enabled:!!e&&t!==null}),a=l({...oe({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e,staleTime:at}),o=(0,K.useMemo)(()=>{let e=t===null?r.data?.plugins:i.data?.plugins??r.data?.plugins;return new Set((e??$).map(e=>e.name))},[t,i.data?.plugins,r.data?.plugins]),s=(0,K.useMemo)(()=>{let e=r.data?.plugins??$,n=a.data?.matches??ot;return je(ke(e,(t===null?n:n.filter(e=>(e.category??`system`)===t)).filter(e=>!o.has(e.name))))},[r.data?.plugins,a.data?.matches,t,o]),u=t===null?r.data:i.data,d=ct(e,u?.categoryCounts!==void 0),f=ct(e,(u?.plugins??$).some(e=>e.enabled!==void 0)),p=c(),m=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(m.current===e||!a.isSuccess)return;let t=u?.plugins;if(!t?.length)return;let n=new Map((a.data?.matches??ot).map(e=>[e.name,e.category]));t.some(e=>{let t=n.get(e.name);return t!=null&&t!==`system`&&(e.category??`system`)===`system`})&&(m.current=e,p.invalidateQueries({queryKey:z({path:{assistant_id:e},query:{q:void 0}})}))},[e,a.isSuccess,a.data?.matches,u?.plugins,p]),{items:s,isLoading:r.isLoading,catalogLoading:a.isLoading,isError:r.isError,isFetching:r.isFetching||a.isFetching,catalogError:a.isError,categorySupported:d,pluginToggleSupported:f,installedCategoryCounts:u?.categoryCounts,installedPlugins:u?.plugins??$,installedTotal:u?.totalCount,catalogMatches:a.data?.matches??ot,unfilteredInstalledNames:o}}var ut=`vellum:plugins:tipDismissed`;function dt({assistantId:e}){let r=c(),i=_e(),[a,s]=o(),l=a.get(`plugin`),u=a.get(`success`),d=(0,K.useRef)(!1);(0,K.useEffect)(()=>{u!==`true`||d.current||(d.current=!0,l&&N.success(`Installed ${l}`),s(e=>{let t=new URLSearchParams(e);return t.delete(`success`),t},{replace:!0}))},[u,l,s]);let[f,p]=(0,K.useState)(``),[m,h]=(0,K.useState)(`all`),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(null),[T,E]=(0,K.useState)(null),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(()=>n(ut,!1)),[te,ne]=(0,K.useState)(e);e!==te&&(ne(e),_(null));let j=e===te?g:null,{data:M=[]}=ee(e),{items:F,isLoading:I,catalogLoading:re,isError:L,isFetching:ie,catalogError:ae,categorySupported:oe,pluginToggleSupported:R,installedCategoryCounts:z,installedPlugins:ue,installedTotal:de,catalogMatches:fe,unfilteredInstalledNames:pe}=lt(e,j),B=(R?[`all`,`active`,`off`,`available`]:[`all`,`installed`,`available`]).includes(m)?m:`all`,{counts:V,totalCount:H}=ft(z,ue,de,fe,pe,B),U=oe&&M.length>0,W=(0,K.useCallback)(t=>me(r,e,t),[e,r]),he=se({onMutate:e=>y(e.body.name),onSuccess:(e,t)=>N.success(`Installed ${t.body.name}`),onError:()=>N.error(Te),onSettled:(e,t,n)=>{y(null),W(n.body.name)}}),ge=ce({onMutate:e=>S(e.path.name),onSuccess:(e,t)=>N.success(`Removed ${t.path.name}`),onError:()=>N.error(Ee),onSettled:(e,t,n)=>{S(null),W(n.path.name)}}),G=le({onMutate:e=>w(e.path.name),onSuccess:(e,t)=>N.success(e.outcome===`already-up-to-date`?`${t.path.name} is already up to date`:`Upgraded ${t.path.name} to ${Y(e.toCommit)}`),onError:()=>N.error(De),onSettled:(e,t,n)=>{w(null),W(n.path.name)}}),ve=(0,K.useCallback)(e=>s(t=>{let n=new URLSearchParams(t);return n.set(`plugin`,e.name),n}),[s]),ye=(0,K.useCallback)(()=>s(e=>{let t=new URLSearchParams(e);return t.delete(`plugin`),t},{replace:!0}),[s]),be=(0,K.useCallback)(t=>{he.mutate({path:{assistant_id:e},body:{name:t.name}})},[e,he]),xe=(0,K.useCallback)(()=>{T&&(ge.mutate({path:{assistant_id:e,name:T.name}}),E(null))},[e,T,ge]),J=(0,K.useCallback)(t=>{G.mutate({path:{assistant_id:e,name:t},body:{}})},[e,G]),Oe=(0,K.useCallback)(()=>{D&&(J(D.name),O(null))},[D,J]),ke=(0,K.useCallback)((e,t)=>{if(ze(t)){O(e);return}J(e.name)},[J]),je=(0,K.useCallback)(()=>{A(!0),t(ut,!0)},[]),X=(0,K.useMemo)(()=>Me(F,B).filter(e=>Ae(e,f)),[F,B,f]),Ne=ie&&!I,Z=f.trim().length>0;if(l){let t=F.find(e=>e.name===l),n={assistantId:e,name:l,externalHint:t?.external,enabled:t?.enabled,onBack:ye};return i?(0,q.jsx)(Je,{...n}):(0,q.jsx)(Ge,{...n})}let Q=(0,q.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:I?(0,q.jsx)(gt,{}):L?(0,q.jsx)(_t,{}):X.length===0?re&&(B===`all`||B===`available`)?(0,q.jsx)(gt,{}):(0,q.jsx)(vt,{filter:B,category:j}):(0,q.jsx)(`ul`,{className:`flex flex-col gap-2`,children:X.map(t=>(0,q.jsx)(`li`,{children:t.status===`installed`?(0,q.jsx)(pt,{assistantId:e,item:t,onSelect:()=>ve(t),onRemove:()=>E(t),onUpgrade:e=>ke(t,e),isRemoving:x===t.name,isUpgrading:C===t.name}):(0,q.jsx)(it,{assistantId:e,item:t,onSelect:()=>ve(t),onInstall:()=>be(t),isInstalling:v===t.name})},t.name))})});return(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!k&&(0,q.jsx)(mt,{onDismiss:je}),(0,q.jsx)(Qe,{search:f,onSearchChange:p,filter:B,onFilterChange:h,isSearching:Ne,categories:U?M:[],category:j,onCategoryChange:_,counts:V,totalCount:H,showCounts:!Z,pluginToggleSupported:R}),ae&&!I&&!L?(0,q.jsx)(ht,{}):null,U?(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,q.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto md:block`,children:(0,q.jsx)(b,{ariaLabel:`Plugin categories`,selected:j,onSelect:_,counts:V,totalCount:H,showCounts:!Z,categories:M})}),Q]}):Q,(0,q.jsx)(P,{open:T!==null,title:`Remove plugin`,message:T?Se(T.name):``,confirmLabel:`Remove`,destructive:!0,onConfirm:xe,onCancel:()=>E(null)}),(0,q.jsx)(P,{open:D!==null,title:`Upgrade plugin`,message:D?Ce(D.name):``,confirmLabel:we,destructive:!0,onConfirm:Oe,onCancel:()=>O(null)})]})}function ft(e,t,n,r,i,a){return(0,K.useMemo)(()=>{let o={},s=a!==`available`,c=a===`all`||a===`available`,l=a===`active`||a===`off`,u=l?t.filter(e=>a===`off`?e.enabled===!1:e.enabled!==!1):t;if(s)if(!l&&e&&Object.keys(e).length>0)Object.assign(o,e);else for(let e of u){let t=e.category??`system`;o[t]=(o[t]??0)+1}let d=0;if(c)for(let e of r){if(i.has(e.name))continue;let t=e.category??`system`;o[t]=(o[t]??0)+1,d+=1}let f=l?u.length:n??t.length;return{counts:o,totalCount:(s?f:0)+d}},[e,t,n,r,i,a])}function pt({assistantId:e,item:t,onSelect:n,onRemove:r,onUpgrade:i,isRemoving:a,isUpgrading:o}){let s=Re({assistantId:e,name:t.name}).data;return(0,q.jsx)(it,{assistantId:e,item:t,drift:s,onSelect:n,onRemove:r,onUpgrade:()=>i(s),isRemoving:a,isUpgrading:o})}function mt({onDismiss:e}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,q.jsx)(E,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,q.jsx)(`p`,{className:`flex-1`,children:`Browse the catalog below to install plugins that extend your assistant.`}),(0,q.jsx)(i,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,q.jsx)(O,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function ht(){return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,q.jsx)(g,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,q.jsx)(`p`,{className:`flex-1`,children:`Catalog browsing is temporarily unavailable. Installed plugins are still listed below.`})]})}function gt(){return(0,q.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,q.jsx)(w,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function _t(){return(0,q.jsx)(f.Root,{children:(0,q.jsxs)(f.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,q.jsx)(D,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,q.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load plugins`}),(0,q.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function vt({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=yt(e,t);return(0,q.jsx)(f.Root,{children:(0,q.jsxs)(f.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,q.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,q.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,q.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r})]})})}function yt(e,t){if(t)return{title:`No plugins in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:G};switch(e){case`installed`:return{title:`No Plugins Installed`,subtitle:`Browse the catalog to install plugins that extend your assistant.`,Icon:T};case`active`:return{title:`No Active Plugins`,subtitle:`Install a plugin from the catalog, or turn on an installed one.`,Icon:T};case`off`:return{title:`No Plugins Turned Off`,subtitle:`Installed plugins you turn off will appear here.`,Icon:T};case`available`:return{title:`No Plugins Available`,subtitle:`Every catalog plugin is already installed.`,Icon:V};default:return{title:`No Plugins Found`,subtitle:`Browse the catalog to install plugins that extend your assistant.`,Icon:T}}}function bt(){let e=ue.use.version(),t=ye(),n=ve();return e===null?null:t?(0,q.jsx)(dt,{assistantId:n}):(0,q.jsx)(s,{to:fe.identity,replace:!0})}export{bt as PluginsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./card-D8zyWtZh.js";import{t as l}from"./check-wF3S-AV4.js";import{t as u}from"./chevron-left-B_RAz34t.js";import{t as d}from"./loader-circle-D57RZgLH.js";import{t as f}from"./pencil-DEevs4oD.js";import{t as p}from"./x-CswtfvgS.js";import{t as m}from"./input-ZpyYt_a0.js";import{l as h,p as g,s as _}from"./local-mode-hyYI6_OH.js";import{t as v}from"./is-electron-DBOtwp5h.js";import{n as y}from"./resolved-assistants-store-DdnJoLGS.js";import{A as b,S as x,a as S,k as C,n as w,o as T}from"./auth-store-B6EXnaee.js";import{t as E}from"./client.gen-DZZugzSk.js";import{m as D}from"./native-biometric-gWkPFBiw.js";import{c as O}from"./routes-XPLb07Av.js";import{a as k,s as A}from"./prefs-wApndUEh.js";import{a as j}from"./platform-detection-1awANa55.js";import{t as M}from"./client-feature-flag-store-DeUwlUsr.js";import{n as ee,t as te}from"./browser-JyOUYdam.js";import{c as N,l as ne,n as P,t as F}from"./prechat-P1y7ZM6C.js";import{Ct as re,b as I,r as ie}from"./react-query.gen-BXPoln4i.js";import{t as L}from"./public-asset-Cr86Gucv.js";import{Aa as R,Dt as ae,M as oe,N as z,Tt as B,_n as se,fn as V,hn as H,it as ce,j as U,mn as le,pn as ue,rt as de,vn as W}from"./index-CgcZXB4g.js";import{t as G}from"./onboarding-step-layout-2XcmxqFN.js";import{n as fe,r as pe}from"./prechat-names-clVy5Mee.js";import{t as me}from"./step-indicator-dots-D03TmFKG.js";var K=e(t(),1);async function he(){try{let{data:e,response:t}=await E.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var q=s(),ge=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function _e({onComplete:e}){function t(){z(),U(),e()}return(0,q.jsx)(W,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,q.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,q.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,q.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,q.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,q.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,q.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,q.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,q.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,q.jsx)(`ul`,{className:`space-y-4`,children:ge.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,q.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,q.jsx)(l,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,q.jsxs)(`span`,{className:`text-left`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,q.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var J=`google`,ve=[{id:`gmail`,label:`Gmail`,logoSrc:L(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:L(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:L(`/images/integrations/google-drive.svg`)}];function ye({assistantId:e,assistantName:t,onConnect:r,onSkip:i,onBack:o}){let s=v(),c=a(),l=D(),f=(0,K.useRef)(null),p=(0,K.useRef)(null),m=(0,K.useRef)(null),h=(0,K.useRef)(null),g=(0,K.useRef)(null),_=(0,K.useRef)(null),y=(0,K.useRef)(null),[b,S]=(0,K.useState)(!1),C=(0,K.useCallback)(()=>{p.current=null,S(!1)},[]),w=(0,K.useCallback)(()=>{g.current&&=(window.removeEventListener(`message`,g.current),null),_.current&&=(window.removeEventListener(`storage`,_.current),null)},[]),T=(0,K.useCallback)(()=>{f.current&&!f.current.closed&&f.current.close(),f.current=null,m.current&&=(clearInterval(m.current),null),h.current&&=(clearTimeout(h.current),null)},[]),E=re();(0,K.useEffect)(()=>()=>{m.current&&clearInterval(m.current),h.current&&clearTimeout(h.current),f.current&&!f.current.closed&&f.current.close(),g.current&&window.removeEventListener(`message`,g.current),_.current&&window.removeEventListener(`storage`,_.current),y.current&&=(y.current(),null)},[]);let k=(0,K.useCallback)(async e=>{try{return(await c.fetchQuery({...I({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===J&&e.connected)??null}catch{return null}},[c]),A=(0,K.useCallback)(async()=>{let e=p.current?.platformAssistantId;T(),C(),r((e?await k(e):null)?.scopes_granted??[])},[C,T,k,r]),j=(0,K.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!p.current||e.requestId!==p.current.requestId||(e.oauthStatus===`connected`?A():(T(),C())))},[C,T,A]),M=(0,K.useCallback)(e=>{let t=p.current;if(!t)return;let n=V(e,window.location.origin,t.requestId);n&&j(n)},[j]),N=(0,K.useCallback)(e=>{let t=p.current;if(!t)return;let n=ue(e,t.requestId);n&&(j(n),window.localStorage.removeItem(H(t.requestId)))},[j]);se((0,K.useCallback)(e=>{let t=p.current;t&&e.requestId===t.requestId&&j({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[j]));let ne=(0,K.useCallback)(()=>{let t=crypto.randomUUID();if(w(),g.current=M,_.current=N,l){S(!0),(async()=>{let n;try{n=await x(e)}catch{C();return}p.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:J},body:{requested_scopes:[],redirect_after_connect:`${O.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){te(e.connect_url)},onError(){C()}})})(),window.addEventListener(`message`,M),window.addEventListener(`storage`,N),y.current&&y.current();let n=ee(()=>{let e=p.current;if(!e){n(),y.current=null;return}(async()=>{let t=await k(e.platformAssistantId);p.current&&(t?await A():C(),w(),n(),y.current=null)})()});y.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){w();return}f.current=n,S(!0),window.addEventListener(`message`,M),window.addEventListener(`storage`,N),m.current=setInterval(()=>{f.current&&f.current.closed&&p.current&&!h.current&&(h.current=setTimeout(async()=>{h.current=null;let e=p.current;if(!e)return;let t=window.localStorage.getItem(H(e.requestId));if(t)try{let n=JSON.parse(t);if(le(n,e.requestId)){j(n),window.localStorage.removeItem(H(e.requestId)),w();return}}catch{}let n=await k(e.platformAssistantId);p.current&&(n?await A():(T(),C()),w())},1e3))},100),(async()=>{let n;try{n=await x(e)}catch{T(),C(),w();return}p.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:J},body:{requested_scopes:[],redirect_after_connect:`${O.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){f.current&&!f.current.closed?f.current.location.href=e.connect_url:p.current&&(T(),C(),w())},onError(){T(),C(),w()}})})()},[e,C,T,k,j,M,N,A,l,w,E]),P=t||`your assistant`,F=t||`Your assistant`;return(0,q.jsx)(W,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${s?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,q.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}),(0,q.jsx)(`h1`,{className:`text-center ${s?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,q.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${P} can use Gmail, Calendar, and Drive with your permission.`}),(0,q.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:ve.map(e=>(0,q.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,q.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,q.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,q.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${F} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,q.jsxs)(`div`,{className:`${s?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:ne,disabled:b||E.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:b||E.isPending?(0,q.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,q.jsx)(d,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,disabled:b||E.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function be({userName:e,assistantName:t,selectedGroupId:r,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:l,onSkip:d}){let f=v();return(0,q.jsx)(W,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,q.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}):null,(0,q.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,q.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,q.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(m,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),className:G,fullWidth:!0}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(m,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),className:G,fullWidth:!0}),(0,q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>{let n=e===t;return(0,q.jsx)(`button`,{type:`button`,onClick:()=>o(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,q.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:fe.map(e=>(0,q.jsx)(xe,{group:e,isActive:r===e.id,onToggle:()=>s(r===e.id?null:e.id)},e.id))})]})]}),(0,q.jsxs)(`div`,{className:`${f?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:l,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:d,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function xe({group:e,isActive:t,onToggle:n}){return(0,q.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,q.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function Se({userName:e,assistantName:t,displayedAssistantNames:r,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:l,totalSteps:d}){return(0,q.jsx)(W,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[o?(0,q.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,q.jsx)(u,{}),onClick:o,"aria-label":`Back`}):(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,q.jsx)(`div`,{className:`flex justify-center`,children:(0,q.jsx)(me,{current:l,total:d})}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,q.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,q.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,q.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(m,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),className:G,fullWidth:!0}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(m,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),className:G,fullWidth:!0}),(0,q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let n=e===t;return(0,q.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var Ce=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:L(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:L(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:L(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:L(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:L(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:L(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:L(`/images/prior-assistants/copilot.svg`)}];function we({selectedAssistants:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=v(),[s,l]=(0,K.useState)(()=>Ee(e)),[d,h]=(0,K.useState)(()=>s.length>0),g=(0,K.useRef)(Y(e));(0,K.useEffect)(()=>{let t=Y(e);if(t===g.current)return;let n=Ee(e);l(n),h(e=>e||n.length>0),g.current=t},[e]),(0,K.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}Te(n,e)||(g.current=Y(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},y=(0,K.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,q.jsx)(W,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,q.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}),(0,q.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,q.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,q.jsxs)(`div`,{className:`${o?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Ce.map(t=>(0,q.jsx)(De,{assistant:t,selected:e.has(t.id),onToggle:()=>_(t.id)},t.id)),d?null:(0,q.jsx)(X,{onClick:()=>h(!0)})]}),d?(0,q.jsx)(c,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(f,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{h(!1),l(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(p,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,q.jsx)(m,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>l(e.target.value),helperText:`Separate multiple assistants with commas`,className:G,fullWidth:!0}),y.length>0?(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:y.map(e=>(0,q.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,q.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function Te(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Ee(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function De({assistant:e,selected:t,onToggle:n}){return(0,q.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(Oe,{assistant:e,size:32}),(0,q.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,q.jsx)(l,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function X({onClick:e}){return(0,q.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,q.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,q.jsx)(R,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,q.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Oe({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,q.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,q.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,q.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,q.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,q.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,q.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function ke({selectedTasks:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=v(),s=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,q.jsx)(W,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,q.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}),(0,q.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,q.jsx)(`p`,{className:`${o?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,q.jsx)(`div`,{className:`${o?`mt-6`:`mt-8`} flex w-full flex-col ${o?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:de.map(t=>{let n=ce[t.iconKey],r=e.has(t.id);return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${o?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,q.jsx)(n,{className:`h-4 w-4`}):null}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,q.jsx)(l,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,q.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Ae=new Set([`gmail`,`google-calendar`,`google-drive`]),Z=[{id:`gmail`,label:`Gmail`,logoSrc:L(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:L(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:L(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:L(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:L(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:L(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:L(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:L(`/images/integrations/github.svg`),logoSrcDark:L(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:L(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:L(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:L(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:L(`/images/integrations/apple-notes.svg`)}];function Q(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function je({selectedTools:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=v(),[s,l]=(0,K.useState)(()=>Me(e)),[d,h]=(0,K.useState)(()=>s.length>0),g=(0,K.useRef)(Ne(e));(0,K.useEffect)(()=>{let t=Ne(e);if(t===g.current)return;let n=Me(e);l(n),h(e=>e||n.length>0),g.current=t},[e]),(0,K.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}$(n,e)||(g.current=Ne(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},y=(0,K.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,q.jsx)(W,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full items-center ${r?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[r?(0,q.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}):null,(0,q.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),r?(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,q.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,q.jsxs)(`div`,{className:`grid w-full gap-2 ${o?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Z.map(t=>(0,q.jsx)(Pe,{tool:t,selected:e.has(t.id),onToggle:()=>_(t.id),electron:o},t.id)),d?null:(0,q.jsx)(Fe,{onClick:()=>h(!0),electron:o})]}),d?(0,q.jsx)(c,{padding:o?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,q.jsxs)(`div`,{className:`flex flex-col ${o?`gap-2`:`gap-3`}`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(f,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{h(!1),l(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(p,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,q.jsx)(m,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>l(e.target.value),helperText:`Separate multiple tools with commas`,className:G,fullWidth:!0}),y.length>0?(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:y.map(e=>(0,q.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,q.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function $(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Me(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Ne(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Pe({tool:e,selected:t,onToggle:n,electron:r}){return(0,q.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(Ie,{tool:e,size:32}),(0,q.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,q.jsx)(l,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Fe({onClick:e,electron:t}){return(0,q.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,q.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,q.jsx)(R,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,q.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ie({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,q.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,q.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,q.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,q.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,q.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,q.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Le({selectedGroupId:e,onGroupChange:t,onBack:r,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,q.jsx)(W,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,q.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,q.jsx)(u,{}),onClick:r,"aria-label":`Back`}),(0,q.jsx)(`div`,{className:`flex justify-center`,children:(0,q.jsx)(me,{current:o,total:s})}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,q.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,q.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,q.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:fe.map(n=>{let r=e===n.id;return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,q.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,q.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function Re(e){let[t,n]=(0,K.useState)(()=>(e??``).trim()),r=(0,K.useRef)(!1);return(0,K.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,K.useCallback)(e=>{r.current=!0,n(e)},[])}}var ze=`experiment-activation-flow-2026-06-03`,Be=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ve(e,t,n){return t?.initialMessage?t.initialMessage:n?P(e):F}function He(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:{tools:Q([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=ze,i.bootstrapTemplate=Be);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Q([...e.selectedPriorAssistants])),i.initialMessage=Ve(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function Ue(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function We(e){return[{id:`name`,funnelStep:B.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:B.controlWorkType,enabled:!0},{id:`tools`,funnelStep:B.controlTools,enabled:!0},{id:`priorAssistants`,funnelStep:B.controlPriorAssistants,enabled:e.canOfferPriorAssistants},{id:`google`,funnelStep:B.controlGmailConnect,enabled:e.canOfferGoogleStep&&e.hasGoogleTool},{id:`iosApp`,funnelStep:B.controlGetApp,enabled:e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Ge(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Ke=`1`;function qe(e){return e===`nativeVibe`||e===Ke?`nativeVibe`:null}function Je(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function Ye(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function Xe(){let e=i(),t=D(),n=A()&&k();return(0,K.useEffect)(()=>{!n&&!t&&e(O.onboarding.privacy,{replace:!0})},[n,t,e]),t||n}function Ze(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,K.useState)(()=>t?`nativeName`:`name`),a=(0,K.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,K.useLayoutEffect)(()=>{if(n)try{let e=qe(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,K.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,K.useCallback)(()=>{a(null)},[a])}}var Qe=3;function $e(){let e=h();return e?.cloud===`vellum`?e.assistantId:_()[0]?.assistantId??null}function et(){let e=i(),[t]=r(),n=t.get(`preview`)===`true`,a=w.use.user(),s=S(),c=T(),l=a?.id??null,u=a?.firstName??``,d=a?.lastName??``,f=D(),p=y.use.activeAssistantId(),m=g(),h=j()&&!oe(),_=(M.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,v=M.use.selfIntroGreeting(),x=m?$e():null,E=Xe(),{currentStep:k,setCurrentStep:A,clearPersistedStep:ee}=Ze(l,f),te=w.use.platformSession(),P=b(te),[F,re]=(0,K.useState)(()=>new Set),[I,L]=(0,K.useState)(()=>new Set),[R,z]=(0,K.useState)(()=>new Set),{value:B,onChange:se}=Re(m&&!P?``:u||d),[V,H]=(0,K.useState)(null),[ce]=(0,K.useState)(()=>pe()),[U,le]=(0,K.useState)(``),[ue,de]=(0,K.useState)(!1),[W,G]=(0,K.useState)([]),{data:fe}=o({...ie(),enabled:!c&&s&&(!m||P)}),{data:me,isLoading:ge}=o({queryKey:[`onboarding-recipe`,l],queryFn:he,enabled:!c&&s&&!f&&!m,staleTime:1/0}),J=me??null,ve=fe?.id??p??x,xe=Ue({localMode:m,platformSession:te,hasCachedPlatformAssistant:x!==null}),Ce=xe,Te=xe,Ee=async()=>{await C.checkAssistant(),e(`${O.assistant}?onboarding=1`,{replace:!0})};function Y(e){n||ae(e,{userId:l})}let De=[...F].some(e=>Ae.has(e)),X=f?Ge():We({canOfferPriorAssistants:Te,canOfferGoogleStep:n?!1:Ce,hasGoogleTool:De,showIOSAppStep:h});function Oe(t){if(n){e(-1);return}ne(He({mode:f?`native`:`control`,recipe:f?null:J,selectedTools:F,selectedTasks:I,selectedPriorAssistants:t?.selectedPriorAssistants??R,tone:V??J?.tone??`grounded`,userName:B,assistantName:U,selfIntroGreetingEnabled:v,activationFlowEnabled:f?void 0:_,googleConnected:ue,googleScopes:W,connectedScopes:t?.connectedScopes}));let r=U.trim();r&&N(r),f?(ee(),e(O.onboarding.privacy)):(C.markExpectingFirstMessage(),Ee())}let Z=(e,t)=>{e.funnelStep&&Y(e.funnelStep);let n=Je(X,e.id);n?A(n):Oe(t)},Q=e=>{let t=Ye(X,e.id);t&&A(t)};if(!E||ge)return null;let $=X.find(e=>e.id===k)??X[0];return $?$.id===`nativeName`?(0,q.jsx)(Se,{userName:B,assistantName:U,displayedAssistantNames:ce,onUserNameChange:se,onAssistantNameChange:le,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:Qe}):$.id===`nativeVibe`?(0,q.jsx)(Le,{selectedGroupId:V,onGroupChange:H,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:Qe}):$.id===`name`?(0,q.jsx)(be,{userName:B,assistantName:U,selectedGroupId:V,displayedAssistantNames:ce,onUserNameChange:se,onAssistantNameChange:le,onGroupChange:H,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,q.jsx)(ke,{selectedTasks:I,onChange:L,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,q.jsx)(je,{selectedTools:F,onChange:re,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,q.jsx)(we,{selectedAssistants:R,onChange:z,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;z(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?ve?(0,q.jsx)(ye,{assistantId:ve,assistantName:U,onConnect:e=>{de(!0),G(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,q.jsx)(_e,{onComplete:()=>Z($)}):null:null}function tt(){return(0,q.jsx)(et,{})}export{tt as PreChatRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-DXp9L4iB.js";import{t as o}from"./react-DJZBPgpf.js";import{P as s,t as c,z as l}from"./button-BQVYX8n_.js";import{n as u}from"./QueryClientProvider-DKhXIxGb.js";import{t as d}from"./useQuery-B45lW1Kk.js";import{t as f}from"./useMutation-Lj4VunQV.js";import{t as p}from"./jsx-runtime-CVSDxk6A.js";import{t as m}from"./card-D8zyWtZh.js";import{t as h}from"./chevron-down-DpYf9Gwq.js";import{t as g}from"./chevron-right-jRymmL7S.js";import{t as _}from"./loader-circle-D57RZgLH.js";import{t as v}from"./pencil-DEevs4oD.js";import{t as y}from"./shield-check-BOKWBJve.js";import{t as b}from"./x-CswtfvgS.js";import{t as x}from"./notice-BylgS5W_.js";import{t as S}from"./tag-B6WeUtBW.js";import{t as C}from"./input-ZpyYt_a0.js";import{t as w}from"./toggle-QSEiPr3k.js";import{n as T}from"./toast-ZoZVyeDI.js";import{t as E}from"./confirm-dialog-CCrDkChx.js";import{t as D}from"./dropdown-BMNSccmo.js";import{f as O,n as k,r as A}from"./auth-store-B6EXnaee.js";import{t as j}from"./sdk.gen-BJsTUGAk.js";import{c as ee,i as te,m as ne,n as M,o as N,r as re,s as ie,t as ae}from"./native-biometric-gWkPFBiw.js";import{c as oe,s as se}from"./routes-XPLb07Av.js";import{d as ce,f as le}from"./prefs-wApndUEh.js";import{n as ue,t as de}from"./react-query.gen-BXPoln4i.js";import{F as P,I as F,Jn as fe,L as pe,R as me,U as he,Ui as I,er as L,et as R,fi as ge,mi as z,nr as _e,nt as ve,pi as ye,tr as be,tt as B}from"./index-CgcZXB4g.js";import{t as V}from"./use-active-assistant-id-9rGx8kT9.js";import{t as H}from"./detail-card-CA8lPa5K.js";import{t as U}from"./setting-row-BoJnQfzh.js";import{t as xe}from"./settings-divider-Dk_uJxp_.js";var W=e(o(),1),G=p(),K=[{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.`}],Se=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function Ce(){let[e,t]=(0,W.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function we(){let[e,r]=(0,W.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,W.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||fe(0)}]}function Te({row:e,onToggle:t}){return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(w,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:s(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,G.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,G.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Ee(){return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function De({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=_e(),{pendingKind:o,run:s}=Ce(),[c,l]=we(),u=(0,W.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of K){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,W.useMemo)(()=>{let e=K.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=Se.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 L(e.sourceKind):await be(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,G.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,G.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,G.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,G.jsx)(Ee,{}),`Checking permissions...`]}):(0,G.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,G.jsx)(Te,{row:e,onToggle:p},e.id))}),r&&(0,G.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Oe(){let e=z({platformHostedOnly:!0}),t=ge(),n=ye(),r=u(),{data:i,isLoading:a,isError:o}=d({...de(),enabled:e===`full`&&t}),s=f({mutationFn:async e=>{let{data:t}=await j({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{ue(r,void 0,e),T.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{T.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,l=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,G.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,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,G.jsxs)(G.Fragment,{children:[(s.isPending||c)&&(0,G.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,G.jsx)(w,{checked:l,disabled:p,onChange:()=>s.mutate(!l)})]})})]}),e===`disabled`&&(0,G.jsx)(he,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function ke(){let e=ne(),[t,n]=(0,W.useState)(()=>te()),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(`Face ID`),[s,c]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{e&&(re().then(i),M().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)N(!1),await ae(),n(!1);else{let e=ee();e&&await ie(e),N(!0),n(!0)}}finally{c(!1)}};return(0,G.jsx)(H,{title:`Security`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,G.jsx)(w,{checked:t,onChange:()=>void l(),disabled:s})]})})}var q=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function Ae(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...q]}function je(){return n(`mediaEmbedsEnabled`,!0)}function Me(){let e=i(`mediaEmbedDomains`,``);return e?Ae(e):[...q]}function Ne(){let[e,n]=(0,W.useState)(()=>je()),[i,a]=(0,W.useState)(()=>Me()),[o,s]=(0,W.useState)(!1),[l,u]=(0,W.useState)(``),d=(0,W.useMemo)(()=>l.trim().toLowerCase(),[l]),f=e=>{n(e),t(`mediaEmbedsEnabled`,e)},p=e=>{a(e),r(`mediaEmbedDomains`,JSON.stringify(e))},m=()=>{if(d){if(i.includes(d)){u(``);return}p([...i,d]),u(``)}},_=e=>{p(i.filter(t=>t!==e))},v=()=>{p([...q])},y=i.length===q.length&&i.every((e,t)=>e===q[t]);return(0,G.jsxs)(H,{title:`Media Embeds`,subtitle:`Automatically embed images, videos, and other media shared in chat messages.`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Auto Media Embeds`}),(0,G.jsx)(w,{checked:e,onChange:f})]}),e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`mt-4`,children:(0,G.jsx)(xe,{})}),(0,G.jsxs)(c,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,G.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0}):(0,G.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0}),`Video Domain Allowlist`]}),(0,G.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[i.length,` domain`,i.length===1?``:`s`]})]}),o&&(0,G.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsx)(C,{label:`Add Domain`,type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),m())},placeholder:`Add domain (e.g. example.com)`,fullWidth:!0,wrapperClassName:`flex-1`}),(0,G.jsx)(c,{variant:`primary`,size:`compact`,onClick:m,disabled:!d,children:`Add`})]}),i.length>0&&(0,G.jsx)(`div`,{className:`flex justify-end`,children:(0,G.jsx)(c,{type:`button`,variant:`ghost`,size:`compact`,onClick:v,disabled:y,tintColor:`var(--content-tertiary)`,children:`Reset to Defaults`})}),i.length>0&&(0,G.jsx)(`ul`,{className:`space-y-2`,children:i.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] px-3 py-2 text-body-medium-lighter`,children:[(0,G.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:e}),(0,G.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,G.jsx)(I,{}),onClick:()=>_(e),"aria-label":`Remove ${e}`})]},e))})]})]})]})}function J(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=P.map(e=>({value:e.id,label:e.label,icon:(0,G.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Pe(){let e=V(),t=u(),{data:n,isError:r}=d({queryKey:[`thresholds`,e],queryFn:()=>pe(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[o,s]=(0,W.useState)(`conservative`),[c,l]=(0,W.useState)(`strict`),[f,p]=(0,W.useState)(!1),_=(0,W.useRef)(!1),[v,y]=(0,W.useState)(!1),b=(0,W.useRef)(null),x=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||_.current||(a(F(n.interactive).id),s(F(n.autonomous).id),l(F(n.headless).id),y(!0))},[n]),(0,W.useEffect)(()=>()=>{b.current!==null&&(clearTimeout(b.current),b.current=null,x.current?.(),x.current=null)},[]);let S=(0,W.useCallback)((n,r,i)=>{if(!e||!v)return;let a=P.find(e=>e.id===n)?.riskThreshold,o=P.find(e=>e.id===r)?.riskThreshold,s=P.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||me(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,v,t]),C=(0,W.useCallback)((e,t,n)=>{b.current!==null&&clearTimeout(b.current),x.current=()=>S(e,t,n),b.current=setTimeout(()=>{x.current?.(),b.current=null,x.current=null},500)},[S]),w=(0,W.useCallback)(e=>{_.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,W.useCallback)(e=>{_.current=!0,s(e),C(i,e,c)},[i,c,C]),E=(0,W.useCallback)(e=>{_.current=!0,l(e),C(i,o,e)},[i,o,C]),O=P.find(e=>e.id===i),k=P.find(e=>e.id===o),A=P.find(e=>e.id===c),j=!e||!v;return(0,G.jsxs)(m,{children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:i,onChange:w,options:Y,disabled:j})}),O&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,G.jsx)(h,{className:`h-4 w-4`}):(0,G.jsx)(g,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,G.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:o,onChange:T,options:Y,disabled:j})}),k&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:c,onChange:E,options:Y,disabled:j})}),A&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:A.description})]})]})]})]})]})}var X=e(l(),1),Fe=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Ie=[{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 Z({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(t.tool),[s,c]=(0,W.useState)(t.pattern),[l,u]=(0,W.useState)(t.risk),[d,f]=(0,W.useState)(t.description??``),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,W.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await ve(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,X.createPortal)((0,G.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,W.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(b,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,G.jsx)(x,{tone:`error`,children:h}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(D,{value:a,onChange:o,disabled:!0,options:Fe.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(C,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,G.jsx)(`div`,{className:`mt-2 flex gap-2`,children:Ie.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,G.jsx)(C,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!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 Le(e){return e.origin===`default`&&!e.userModified}function Re(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 ze(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 Be({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(!1),g=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([B(e),B(e,{origin:`default`})]);return Re(t,n)}return B(e)},[e]),_=(0,W.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,W.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 b=(0,W.useCallback)(async()=>{if(f)try{await R(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,X.createPortal)((0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,W.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(w,{checked:m,onChange:h,label:`Show all defaults`}),(0,G.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(x,{tone:`error`,children:s})}),a?(0,G.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,G.jsx)(y,{className:`h-8 w-8`}),(0,G.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,G.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=Le(e);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,G.jsx)(S,{tone:ze(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,G.jsx)(S,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(S,{tone:`warning`,children:`Modified`})]}),(0,G.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(v,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(I,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,G.jsx)(Z,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,G.jsx)(E,{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 b(),onCancel:()=>p(null)})]}),document.body)}function Ve(){let e=V(),[t,n]=(0,W.useState)(!1);return(0,G.jsxs)(m,{children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(y,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,G.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,G.jsx)(Be,{assistantId:e,onClose:()=>n(!1)})]})}var He=[{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`}],Ue=`thirtyDays`;function $(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function We(){let e=z({platformHostedOnly:!0}),t=A(),n=t,a=k.use.user()?.id??null,[o]=ce(),[s]=le(),c=o??!0,l=s??!0,[u,d]=(0,W.useState)(()=>i(`llmLogRetention`,Ue));return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(ke,{}),(0,G.jsx)(De,{}),(0,G.jsx)(Ve,{}),(0,G.jsx)(Pe,{}),(0,G.jsx)(Ne,{}),(0,G.jsx)(H,{title:`Privacy`,subtitle:t?(0,G.jsxs)(G.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,G.jsx)(`a`,{href:se(oe.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(U,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:c,onChange:()=>{O(`share_analytics`,!c,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{}),(0,G.jsx)(U,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{O(`share_diagnostics`,!l,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{})]}),(0,G.jsx)(Oe,{}),e!==`gated`&&(0,G.jsx)($,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:u,onChange:e=>{d(e),r(`llmLogRetention`,e)},options:He})}),(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{We 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-BQVYX8n_.js";import{m as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{p as o}from"./local-mode-hyYI6_OH.js";import{t as s}from"./is-electron-DBOtwp5h.js";import{d as c,i as l,n as u}from"./auth-store-B6EXnaee.js";import{m as d}from"./native-biometric-gWkPFBiw.js";import{c as f}from"./routes-XPLb07Av.js";import{f as p,p as m,u as h}from"./prefs-wApndUEh.js";import{Dt as g,Tt as _,kt as v,vn as y}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{p as o}from"./local-mode-hyYI6_OH.js";import{t as s}from"./is-electron-DBOtwp5h.js";import{d as c,i as l,n as u}from"./auth-store-B6EXnaee.js";import{m as d}from"./native-biometric-gWkPFBiw.js";import{c as f}from"./routes-XPLb07Av.js";import{f as p,p as m,u as h}from"./prefs-wApndUEh.js";import{Dt as g,Tt as _,kt as v,vn as y}from"./index-CgcZXB4g.js";import{t as b}from"./step-indicator-dots-D03TmFKG.js";import{n as x,t as S}from"./consent-controls-CiU4EkLm.js";var C=e(t(),1);function w({isNative:e,isLocalHatch:t}){return e||t?f.onboarding.hatching:f.onboarding.research}var T=a();function E(){let e=i(),[t]=r(),a=u.use.user()?.id??null,E=s(),D=d(),[O,k]=p(),A=O??!0,[j,M]=m(),[N,P]=h(),F=l();(0,C.useEffect)(()=>{D||v()},[D]);let I=t.get(`preview`)===`true`,L=(0,C.useCallback)(e=>{},[]),R=I?L:k,z=I?L:M,B=I?L:P,V=(0,C.useCallback)(()=>{if(I){e(`${f.onboarding.prechat}?preview=true`);return}c({userId:a,tos:j,privacy:N,shareAnalytics:null,shareDiagnostics:A,hasPlatformSession:F}),D||g(_.privacyTos,{userId:a});let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${w({isNative:D,isLocalHatch:o()&&n!==null&&n!==`vellum-cloud`})}${i?`?${i}`:``}`)},[N,F,D,I,e,t,A,j,a]);return(0,T.jsx)(y,{children:(0,T.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${E?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[D&&(0,T.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,T.jsx)(b,{current:2,total:3})}),(0,T.jsx)(`h1`,{className:E?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,T.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${E?`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,T.jsx)(x,{electron:E,showAnalytics:!1,shareAnalytics:!1,shareDiagnostics:A,onShareAnalyticsChange:L,onShareDiagnosticsChange:R,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,T.jsx)(S,{electron:E,privacyConsent:N,tosAccepted:j,onPrivacyChange:B,onTosChange:z,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,T.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${E?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,T.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!j||!N,onClick:V,className:E?void 0:`h-11 text-base`,children:`Start`}),(0,T.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(o()?f.onboarding.hosting:f.onboarding.start),className:E?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{E as PrivacyScreen};
|
package/dist/assets/{provider-callback-page-DkUH2bax.js → provider-callback-page-fjZoTIWk.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BGD3-GQf.js";import{t as n}from"./react-DJZBPgpf.js";import{m as r,t as i,u as a}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{p as s,w as c}from"./local-mode-hyYI6_OH.js";import{E as l,n as u}from"./auth-store-B6EXnaee.js";import{c as d}from"./api-BBMl4mW3.js";import{S as f,_ as p}from"./native-biometric-gWkPFBiw.js";import{c as m}from"./routes-XPLb07Av.js";import{a as h,i as g}from"./login-flow-CsH-88pb.js";import{v as _}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BGD3-GQf.js";import{t as n}from"./react-DJZBPgpf.js";import{m as r,t as i,u as a}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{p as s,w as c}from"./local-mode-hyYI6_OH.js";import{E as l,n as u}from"./auth-store-B6EXnaee.js";import{c as d}from"./api-BBMl4mW3.js";import{S as f,_ as p}from"./native-biometric-gWkPFBiw.js";import{c as m}from"./routes-XPLb07Av.js";import{a as h,i as g}from"./login-flow-CsH-88pb.js";import{v as _}from"./index-CgcZXB4g.js";import{r as v,t as y}from"./account-shell-CfWeuJs3.js";var b=e(n(),1),x=o();function S(){let[e]=r(),n=a(),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)(i,{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)(i,{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-DBOtwp5h.js";import{t as i}from"./public-asset-Cr86Gucv.js";import{
|
|
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-DBOtwp5h.js";import{t as i}from"./public-asset-Cr86Gucv.js";import{Ga as a}from"./index-CgcZXB4g.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"./button-BQVYX8n_.js";import{n,u as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{c as a}from"./routes-XPLb07Av.js";import"./conversation-store-DBm_wIJg.js";import"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import"./button-BQVYX8n_.js";import{n,u as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{c as a}from"./routes-XPLb07Av.js";import"./conversation-store-DBm_wIJg.js";import"./index-CgcZXB4g.js";var o=e(t(),1),s=i(),c=[{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:[]}];function l(){r();let[e,t]=(0,o.useState)(`results`),[i,l]=(0,o.useState)(()=>new Map);return c.map((e,t)=>({fact:e,index:t})),(0,s.jsx)(n,{to:a.assistant,replace:!0})}export{l as ResearchMockPage};
|