@vellumai/web 0.10.11-staging.1 → 0.10.11
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-CGxN4FMB.js → account-page-baxQRPzp.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-zoCY9fdY.js → acp-run-detail-panel-CrZYAG8F.js} +1 -1
- package/dist/assets/{activity-steps-panel-CmBQQebr.js → activity-steps-panel-CNHBFP0M.js} +1 -1
- package/dist/assets/{add-credits-modal-UyqhEjtA.js → add-credits-modal-C6ACa7dJ.js} +1 -1
- package/dist/assets/{ai-page-CiXDPar3.js → ai-page-DWwijgkF.js} +1 -1
- package/dist/assets/{api-key-screen-Bj2ar1dh.js → api-key-screen-BEJ0jwQj.js} +1 -1
- package/dist/assets/{background-task-detail-panel-Ceccab-p.js → background-task-detail-panel-be-t1c4C.js} +1 -1
- package/dist/assets/{billing-page-ChU757Bq.js → billing-page-BcRCl8ly.js} +1 -1
- package/dist/assets/{bookmarks-page-CVao8uzP.js → bookmarks-page-Dit38fI8.js} +1 -1
- package/dist/assets/{channels-page-route-ThCDtS-m.js → channels-page-route-BlSQtnuj.js} +1 -1
- package/dist/assets/{command-palette-fZ-DYpTl.js → command-palette-BCipBcvn.js} +1 -1
- package/dist/assets/{command-palette-window-page-jACRTws1.js → command-palette-window-page-BqYv7VcH.js} +1 -1
- package/dist/assets/{community-page-BKMT2nGi.js → community-page-Dv-ySbbM.js} +1 -1
- package/dist/assets/{contacts-page-route-429brUkX.js → contacts-page-route-DgNLQnBu.js} +1 -1
- package/dist/assets/{credentials-page-BRYdZPLW.js → credentials-page-Cc4tHUkB.js} +1 -1
- package/dist/assets/{debug-page-dgwTiWS_.js → debug-page-BFWROcsz.js} +1 -1
- package/dist/assets/{deploy-dialogs-CzNMZxp5.js → deploy-dialogs-Cj-Aq_TC.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-BDxTkocG.js → detail-panel-stop-button-39zLlSig.js} +1 -1
- package/dist/assets/{developer-page-CiMYzKyb.js → developer-page-DuvYjoYj.js} +1 -1
- package/dist/assets/{dictation-overlay-page-q89WquJV.js → dictation-overlay-page-DXgz4AQ6.js} +1 -1
- package/dist/assets/{document-viewer-page-BTdqnb-W.js → document-viewer-page-CZwiaFH_.js} +1 -1
- package/dist/assets/{emails-page-DnChFgts.js → emails-page-B-d8kujE.js} +1 -1
- package/dist/assets/{general-page-8T5d4hdF.js → general-page-CmA6p9An.js} +1 -1
- package/dist/assets/{hatching-screen-CKXaloYL.js → hatching-screen-XNHr8o2G.js} +1 -1
- package/dist/assets/{home-page-route-CUHZxuiS.js → home-page-route-CuxIigyf.js} +1 -1
- package/dist/assets/{hosting-screen-DvbjTPb9.js → hosting-screen-DefYV0ge.js} +1 -1
- package/dist/assets/identity-page-route-CiL_Zphi.js +7 -0
- package/dist/assets/{index-D7_9Qy0L.js → index-2np2R8qP.js} +26 -26
- package/dist/assets/{index-C0vMCzOO.css → index-B92kvb9E.css} +1 -1
- package/dist/assets/{inspect-page-CjOJXOkP.js → inspect-page-kRK_xs6g.js} +1 -1
- package/dist/assets/{integrations-page-33TSVQvc.js → integrations-page-CISSOSzb.js} +1 -1
- package/dist/assets/{intelligence-layout-DXqwl75M.js → intelligence-layout-DpgeQgJY.js} +1 -1
- package/dist/assets/{library-detail-page-CbtWUL71.js → library-detail-page-Bt9gp3QI.js} +1 -1
- package/dist/assets/{library-page-B0se5Aoa.js → library-page-BlNKrPkk.js} +1 -1
- package/dist/assets/{logout-page-l46o01fc.js → logout-page-Iz2ybEnD.js} +1 -1
- package/dist/assets/{logs-layout-BKW_V70e.js → logs-layout-CxOA-Wc5.js} +1 -1
- package/dist/assets/{memory-page-route-w5t6GZVV.js → memory-page-route-CPsBSRih.js} +1 -1
- package/dist/assets/{memory-router-playground-page-B9lQcT7J.js → memory-router-playground-page-B12rXqZf.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-BNR5lCRm.js → mobile-sidebar-drawer-ZUf-00kg.js} +1 -1
- package/dist/assets/{notifications-page-BkxAhZI8.js → notifications-page-CjYIVpTH.js} +1 -1
- package/dist/assets/{oauth-complete-page-CVO0cJkk.js → oauth-complete-page-B2ewGhNS.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-w7j77OYp.js → oauth-popup-complete-page-DzBQF52z.js} +1 -1
- package/dist/assets/{pairing-page-DCLePIes.js → pairing-page-Cts5oIbb.js} +1 -1
- package/dist/assets/{personality-page-BLTetblf.js → personality-page-BIqqAa7v.js} +1 -1
- package/dist/assets/{plan-tier-meta-sbANEgqF.js → plan-tier-meta-BIKAm_Ai.js} +1 -1
- package/dist/assets/{plans-page-DDi3uCIA.js → plans-page-SfiDHZ-V.js} +1 -1
- package/dist/assets/{plugin-detail-page-Bx6MHYum.js → plugin-detail-page-CldUqueG.js} +1 -1
- package/dist/assets/{privacy-page-DEN2g4bg.js → privacy-page-C0yyDdog.js} +1 -1
- package/dist/assets/{privacy-screen-CcR6K8KB.js → privacy-screen-Dy-ZmDGc.js} +1 -1
- package/dist/assets/{provider-callback-page-DnCyuaIz.js → provider-callback-page-Dl7F__Qu.js} +1 -1
- package/dist/assets/{quick-input-page-DL6C5pNV.js → quick-input-page-CBLwsr9x.js} +1 -1
- package/dist/assets/{research-mock-page-JkFx_erV.js → research-mock-page-B6haRdv5.js} +1 -1
- package/dist/assets/{research-onboarding-route-CiYOCoIf.js → research-onboarding-route-ByXRk6ey.js} +1 -1
- package/dist/assets/{review-terms-screen-DeGMhBmb.js → review-terms-screen-CKDlmyVS.js} +1 -1
- package/dist/assets/{schedules-page-BCG9NNr8.js → schedules-page-BHCnNRj0.js} +1 -1
- package/dist/assets/{select-assistant-screen-DnHvJdOC.js → select-assistant-screen-dLgg2FG5.js} +1 -1
- package/dist/assets/{settings-layout-D4XyzZ10.js → settings-layout-DwJxTai2.js} +1 -1
- package/dist/assets/{share-feedback-modal-BTL9J1ZG.js → share-feedback-modal-Di8E9iA6.js} +1 -1
- package/dist/assets/{sidebar-tree-B3cns8Q3.js → sidebar-tree-CpqsN0in.js} +1 -1
- package/dist/assets/{signup-page-D0UmJvWq.js → signup-page-C0ErIgF3.js} +1 -1
- package/dist/assets/{skill-detail-page-DCX3jpg5.js → skill-detail-page-DF53ks-N.js} +1 -1
- package/dist/assets/{skill-detail-panel-DYJgMNy6.js → skill-detail-panel-D_eE-IN4.js} +1 -1
- package/dist/assets/{start-screen-5j8Dwj88.js → start-screen-DKTECs_x.js} +1 -1
- package/dist/assets/{subagent-detail-panel-Bh11Bk4f.js → subagent-detail-panel-PimZMDhD.js} +1 -1
- package/dist/assets/{superpowers-page-TClXVwUH.js → superpowers-page-z-OIImRF.js} +1 -1
- package/dist/assets/{system-events-page-BLI3KA9e.js → system-events-page-69I8yECA.js} +1 -1
- package/dist/assets/{theme-stage-page-C8IC55us.js → theme-stage-page-DbSjHaq5.js} +1 -1
- package/dist/assets/{tiptap-document-editor-CW_Ejipp.js → tiptap-document-editor-Drkf4aZR.js} +1 -1
- package/dist/assets/{tool-detail-panel-EOB9LtOS.js → tool-detail-panel-B7WGaI0e.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-Rz-Zr9uN.js → upgrade-cancel-page-ouMju_xq.js} +1 -1
- package/dist/assets/{upgrade-success-page-VUmOBid-.js → upgrade-success-page-tGHxARrq.js} +1 -1
- package/dist/assets/{use-assistant-identity-details-DyyBK8Em.js → use-assistant-identity-details-CT-IVkCa.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-DGdE69fG.js → use-edge-swipe-back-BYWXReAH.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-BL_ylpSj.js → use-invite-link-dialog-BsdPKDQ_.js} +1 -1
- package/dist/assets/{use-skill-actions-BssxVwhK.js → use-skill-actions-7ZROdMpd.js} +1 -1
- package/dist/assets/{use-skill-detail-files-BVoaelHO.js → use-skill-detail-files-8L8VWCDM.js} +1 -1
- package/dist/assets/{voice-page-baOGcJ5W.js → voice-page-XqnVdjxN.js} +1 -1
- package/dist/assets/{weather-forecast-display-KeNyTAKb.js → weather-forecast-display-Bb6e1yNM.js} +1 -1
- package/dist/assets/{welcome-screen-C78xMG9C.js → welcome-screen-9POAvbd3.js} +1 -1
- package/dist/assets/{workflow-detail-panel-COrOekoP.js → workflow-detail-panel-xU_g1_Ed.js} +1 -1
- package/dist/assets/{workspace-page-9Rb-xofV.js → workspace-page-BuAzqfnV.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/identity-page-route-Cdj6Wr6j.js +0 -7
|
@@ -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-CheJrlfT.js";import{t as a}from"./haptics-izy3LPi2.js";import{Dt as o,Qo as s}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{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./x-CswtfvgS.js";import"./src-CheJrlfT.js";import{t as a}from"./haptics-izy3LPi2.js";import{Dt as o,Qo as s}from"./index-2np2R8qP.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-V9BYKY__.js";import{t as l}from"./check-wF3S-AV4.js";import{n as u,t as d}from"./panel-item-An-BBeyL.js";import{t as f}from"./menu-C9SOvGlk.js";import{t as p}from"./loader-circle-Ck8fq3yv.js";import{t as m}from"./moon-h3xmz34k.js";import{t as h}from"./triangle-alert-CnjNKhNx.js";import{t as g}from"./notice-DkAWz47A.js";import{t as _}from"./popover-Bl6742nZ.js";import{t as v}from"./input-ZpyYt_a0.js";import{n as y}from"./toast-Be8FEQ-I.js";import{c as b}from"./routes-Cwb-U9H-.js";import{$a as x,Bi as S,Ea as C,Gi as w,H as T,Hi as E,Ki as D,Ui as O,Vi as k,Wi as A,eo as j,g as M,to as N}from"./index-D7_9Qy0L.js";import{t as P}from"./mutation-error-C9sr8Rue.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:E()}),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(w()),s=C(),[c,l]=(0,L.useState)(!1),p=()=>R(i),m=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:p,onError:P(`Failed to snooze notification`)})},h=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:p,onError:P(`Failed to clear snooze`)})};return s?(0,V.jsxs)(u.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(u.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(u.Content,{children:[(0,V.jsx)(u.Header,{children:(0,V.jsx)(u.Title,{children:`Snooze until…`})}),(0,V.jsxs)(u.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(d,{label:e,onSelect:()=>{o.isPending||(l(!1),m(t))}},e)),t&&(0,V.jsx)(d,{label:`Clear snooze`,onSelect:()=>{o.isPending||(l(!1),h())}})]})]})]}):(0,V.jsxs)(f.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(f.Trigger,{children:n}),(0,V.jsxs)(f.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(f.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(f.Item,{disabled:o.isPending,onSelect:()=>m(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f.Separator,{}),(0,V.jsx)(f.Item,{disabled:o.isPending,onSelect:()=>h(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(O()),l=a(A()),[u,d]=(0,L.useState)(``),f=()=>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),f(),t()},onError:P(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),f(),t()},onError:P(`Failed to resume alerts`)})},g=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:g,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)(v,{type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:g,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)(p,{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)(h,{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)(m,{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)(p,{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)(m,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=N({platformHostedOnly:!0}),t=x(),o=j(),s=r(),l=C(),[d,f]=(0,L.useState)(`open`),[m,h]=(0,L.useState)(!1),[v,w]=(0,L.useState)([]),{data:E,isLoading:D,isError:O,refetch:A}=i({...k({query:{status:d}}),enabled:e===`full`&&t}),M=e===`full`&&o||(t?D:!1);(0,L.useEffect)(()=>{!t&&m&&h(!1)},[t,m]);let P=t?O:!1,z=t?E?.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:()=>h(!1),onPauseCreated:e=>w(t=>[...t,e]),onPauseDeleted:e=>w(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)(T,{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)(u.Root,{open:m,onOpenChange:h,children:[(0,V.jsx)(u.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(u.Content,{children:[(0,V.jsx)(u.Header,{children:(0,V.jsx)(u.Title,{children:`Pause alerts`})}),(0,V.jsx)(u.Body,{children:(0,V.jsx)(U,{existingRules:v,onClose:()=>h(!1),onPauseCreated:e=>w(t=>[...t,e]),onPauseDeleted:e=>w(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(_.Root,{open:m,onOpenChange:h,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(_.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=d===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)})}),d===`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)(p,{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)(p,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(g,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void A(),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 `,d,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:d===`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-V9BYKY__.js";import{t as l}from"./check-wF3S-AV4.js";import{n as u,t as d}from"./panel-item-An-BBeyL.js";import{t as f}from"./menu-C9SOvGlk.js";import{t as p}from"./loader-circle-Ck8fq3yv.js";import{t as m}from"./moon-h3xmz34k.js";import{t as h}from"./triangle-alert-CnjNKhNx.js";import{t as g}from"./notice-DkAWz47A.js";import{t as _}from"./popover-Bl6742nZ.js";import{t as v}from"./input-ZpyYt_a0.js";import{n as y}from"./toast-Be8FEQ-I.js";import{c as b}from"./routes-Cwb-U9H-.js";import{$a as x,Bi as S,Ea as C,Gi as w,H as T,Hi as E,Ki as D,Ui as O,Vi as k,Wi as A,eo as j,g as M,to as N}from"./index-2np2R8qP.js";import{t as P}from"./mutation-error-C9sr8Rue.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:E()}),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(w()),s=C(),[c,l]=(0,L.useState)(!1),p=()=>R(i),m=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:p,onError:P(`Failed to snooze notification`)})},h=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:p,onError:P(`Failed to clear snooze`)})};return s?(0,V.jsxs)(u.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(u.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(u.Content,{children:[(0,V.jsx)(u.Header,{children:(0,V.jsx)(u.Title,{children:`Snooze until…`})}),(0,V.jsxs)(u.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(d,{label:e,onSelect:()=>{o.isPending||(l(!1),m(t))}},e)),t&&(0,V.jsx)(d,{label:`Clear snooze`,onSelect:()=>{o.isPending||(l(!1),h())}})]})]})]}):(0,V.jsxs)(f.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(f.Trigger,{children:n}),(0,V.jsxs)(f.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(f.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(f.Item,{disabled:o.isPending,onSelect:()=>m(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f.Separator,{}),(0,V.jsx)(f.Item,{disabled:o.isPending,onSelect:()=>h(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(O()),l=a(A()),[u,d]=(0,L.useState)(``),f=()=>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),f(),t()},onError:P(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),f(),t()},onError:P(`Failed to resume alerts`)})},g=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:g,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)(v,{type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:g,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)(p,{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)(h,{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)(m,{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)(p,{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)(m,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=N({platformHostedOnly:!0}),t=x(),o=j(),s=r(),l=C(),[d,f]=(0,L.useState)(`open`),[m,h]=(0,L.useState)(!1),[v,w]=(0,L.useState)([]),{data:E,isLoading:D,isError:O,refetch:A}=i({...k({query:{status:d}}),enabled:e===`full`&&t}),M=e===`full`&&o||(t?D:!1);(0,L.useEffect)(()=>{!t&&m&&h(!1)},[t,m]);let P=t?O:!1,z=t?E?.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:()=>h(!1),onPauseCreated:e=>w(t=>[...t,e]),onPauseDeleted:e=>w(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)(T,{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)(u.Root,{open:m,onOpenChange:h,children:[(0,V.jsx)(u.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(u.Content,{children:[(0,V.jsx)(u.Header,{children:(0,V.jsx)(u.Title,{children:`Pause alerts`})}),(0,V.jsx)(u.Body,{children:(0,V.jsx)(U,{existingRules:v,onClose:()=>h(!1),onPauseCreated:e=>w(t=>[...t,e]),onPauseDeleted:e=>w(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(_.Root,{open:m,onOpenChange:h,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(_.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=d===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)})}),d===`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)(p,{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)(p,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(g,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void A(),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 `,d,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:d===`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{un 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{un as i}from"./index-2np2R8qP.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-w7j77OYp.js → oauth-popup-complete-page-DzBQF52z.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-CbHUZ2h_.js";import{un 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-CbHUZ2h_.js";import{un as o}from"./index-2np2R8qP.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-Ck8fq3yv.js";import{h as c}from"./local-mode-Dydd46cS.js";import{a as l,i as u,n as d,r as f,t as p}from"./remote-gateway-session-D-udmSfx.js";import{t as m}from"./return-to-ugSGJ0dm.js";import{c as h}from"./routes-Cwb-U9H-.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-Ck8fq3yv.js";import{h as c}from"./local-mode-Dydd46cS.js";import{a as l,i as u,n as d,r as f,t as p}from"./remote-gateway-session-D-udmSfx.js";import{t as m}from"./return-to-ugSGJ0dm.js";import{c as h}from"./routes-Cwb-U9H-.js";import{t as g}from"./index-2np2R8qP.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};
|
|
@@ -1 +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-BK3KXCjl.js";import"./src-CheJrlfT.js";import{i as c,r as l,t as u}from"./dist-Cul7ysiV.js";import{n as d}from"./toast-Be8FEQ-I.js";import{c as f}from"./routes-Cwb-U9H-.js";import{ga as p}from"./index-
|
|
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-BK3KXCjl.js";import"./src-CheJrlfT.js";import{i as c,r as l,t as u}from"./dist-Cul7ysiV.js";import{n as d}from"./toast-Be8FEQ-I.js";import{c as f}from"./routes-Cwb-U9H-.js";import{ga as p}from"./index-2np2R8qP.js";import{t as m}from"./use-active-assistant-id-DwLFgABu.js";import{a as h,c as g,i as _,o as v,s as y}from"./latest-assistant-text-BihKVb5c.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-CT-IVkCa.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 min-h-11 min-w-[240px] max-w-full shrink-0 cursor-pointer items-center justify-center gap-2 rounded-[10px] px-6 py-2 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 shrink-0 animate-spin rounded-full border-2 border-transparent`,style:{borderTopColor:c.isLight?`#FFFFFF`:`#1A1A1A`,borderRightColor:c.isLight?`#FFFFFF`:`#1A1A1A`}}),(0,O.jsxs)(`span`,{className:`min-w-0 text-center`,children:[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{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./typography-Cqi8q9o7.js";import{t as i}from"./createLucideIcon-Bjb-Kuq7.js";import{t as a}from"./info-CqgkBvyS.js";import{t as o}from"./dropdown-BxYrCXBS.js";import{ft as s,pt as c}from"./index-
|
|
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"./typography-Cqi8q9o7.js";import{t as i}from"./createLucideIcon-Bjb-Kuq7.js";import{t as a}from"./info-CqgkBvyS.js";import{t as o}from"./dropdown-BxYrCXBS.js";import{ft as s,pt as c}from"./index-2np2R8qP.js";var l=i(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),u=e(t(),1);function d(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function f(e){return`${d(e)}/mo`}function p(e){return`${e>0?`+`:`−`}${d(Math.abs(e))}/mo`}var m=n(),h={medium:`Medium`,large:`Large`,xl:`XL`};function g(e){return e.disabled===!0}function _({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:i,onMachineTierChange:s,onStorageTierChange:c,currentMachinePriceCents:l,currentStoragePriceCents:d}){let _=(0,u.useMemo)(()=>e.map(e=>{let t=h[e.tier]??e.label,n=l==null?`+${f(e.price_cents)}`:e.price_cents===l?`(${f(e.price_cents)}, current)`:p(e.price_cents-l);return{value:e.tier,label:`${t} ${n}`,disabled:g(e)}}),[e,l]),v=(0,u.useMemo)(()=>t.map(e=>{let t=d==null?`+${f(e.price_cents)}`:e.price_cents===d?`(${f(e.price_cents)}, current)`:p(e.price_cents-d);return{value:e.tier,label:`${e.storage_gib} GiB ${t}`,disabled:g(e)}}),[t,d]);return(0,m.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(r,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Machine`}),(0,m.jsx)(`span`,{title:`Determines the CPU and memory allocated to your assistant`,children:(0,m.jsx)(a,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,m.jsx)(o,{"aria-label":`Machine tier`,placeholder:`Select a machine tier`,value:n??``,onChange:s,options:_})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(r,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Storage`}),(0,m.jsx)(`span`,{title:`Persistent disk space for your assistant's files and data`,children:(0,m.jsx)(a,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,m.jsx)(o,{"aria-label":`Storage tier`,placeholder:`Select a storage tier`,value:i??``,onChange:c,options:v})]})]})}var v=new Set([`active`,`trialing`,`past_due`]),y=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`non_field_errors`];function b(e,t){if(e&&typeof e==`object`){for(let t of y)if(t in e){let n=e[t];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(`detail`in e&&typeof e.detail==`string`)return e.detail}return t}function x(e,t){let n=e.filter(e=>!g(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function S(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function C(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}var w=[`mighty`,`super`,`ultra`];function T(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>w.indexOf(e.key)-w.indexOf(t.key));if(!t)return n[0];let r=n.findIndex(e=>e.key===t);return r===-1?n[0]:r>=n.length-1?null:n[r+1]}var E={free:`#E9C91A`,mighty:`#4C9B50`,super:`#0E9B8B`,ultra:`#EF4300`},D={free:{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},mighty:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`},super:{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},ultra:{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`}};function O({tier:e,size:t=40}){let n=D[e]??D.free,r=s();return(0,m.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,m.jsx)(c,{components:r,bodyShapeId:n.bodyShape,eyeStyleId:n.eyeStyle,colorId:n.color,size:t}):(0,m.jsx)(`div`,{style:{width:t,height:t}})})}export{v as a,S as c,g as d,p as f,l as h,T as i,x as l,f as m,E as n,b as o,d as p,w as r,C as s,O as t,_ as u};
|
|
@@ -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{u as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./arrow-left-C2re-gYj.js";import{t as l}from"./circle-check-DqvTjWle.js";import{d as u,h as d,m as f,o as p,p as m,r as h,t as g}from"./plan-tier-meta-sbANEgqF.js";import{t as _}from"./hard-drive-DVmyHlZR.js";import{t as v}from"./loader-circle-Ck8fq3yv.js";import{t as y}from"./sliders-horizontal-MqeLCMh3.js";import{t as b}from"./tag-B6WeUtBW.js";import{t as x}from"./modal-BtcwNEBj.js";import{n as S}from"./toast-Be8FEQ-I.js";import{t as C}from"./dropdown-BxYrCXBS.js";import{t as w}from"./is-electron-y5bNUVyG.js";import{c as T}from"./routes-Cwb-U9H-.js";import{t as E}from"./browser-WF64N2wk.js";import{$a as D,Mi as O,Ni as k,Pi as A,Ti as j,dt as M,eo as N,to as P,wi as ee,ys as F}from"./index-D7_9Qy0L.js";import{n as I}from"./machine-sizes-bagopaDl.js";var L=e(t(),1),R=s(),z=`__none__`;function B(e){return(0,R.jsxs)(`span`,{className:`text-[12px] font-medium text-[var(--content-disabled)]`,children:[`+`,f(e)]})}function V({open:e,proPlan:t,pending:r,onClose:i,onContinue:a}){let[o,s]=(0,L.useState)(``),[c,p]=(0,L.useState)(``),[h,g]=(0,L.useState)(``);(0,L.useEffect)(()=>{e||(s(``),p(``),g(``))},[e]);let v=t.machine_tiers,b=(0,L.useMemo)(()=>t.storage_tiers.filter(e=>!e.legacy),[t.storage_tiers]),S=t.credit_tiers??[],w=v.map(e=>({value:e.tier,label:e.description,icon:(0,R.jsx)(d,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:B(e.price_cents),disabled:u(e)})),T=b.map(e=>({value:e.tier,label:e.label,icon:(0,R.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:B(e.price_cents),disabled:u(e)})),E=[{value:z,label:`No extra credits`,icon:(0,R.jsx)(F,{className:`h-4 w-4`,"aria-hidden":!0})},...S.map(e=>({value:e.tier,label:e.label,icon:(0,R.jsx)(F,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:B(e.price_cents)}))],D=v.find(e=>e.tier===o)??null,O=b.find(e=>e.tier===c)??null,k=h&&h!==z?S.find(e=>e.tier===h)??null:null,A=D!=null&&O!=null&&h!==``,j=t.base_price_cents+(D?.price_cents??0)+(O?.price_cents??0)+(k?.price_cents??0),M=[`Pro base plan — ${f(t.base_price_cents)}`,D?.description,O?`${O.storage_gib} GiB storage`:null,h===z?`No extra credits`:k?`${m(k.credits_usd*100)} of bundled credits`:null].filter(e=>e!=null);return(0,R.jsx)(x.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,R.jsx)(x.Content,{size:`lg`,"data-theme":`light`,hideCloseButton:!0,overlayClassName:`backdrop-blur-[2px]`,className:`max-w-[820px] md:min-h-[min(608px,calc(100vh-4rem))]`,children:(0,R.jsx)(x.Body,{className:`p-6`,children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-8 md:flex-row md:gap-12`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-8 md:w-[440px] md:shrink-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--surface-active)] p-[14px]`,children:(0,R.jsx)(y,{className:`h-6 w-6 text-[var(--content-emphasised)]`,"aria-hidden":!0})}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(x.Title,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Create a custom plan`}),(0,R.jsx)(x.Description,{className:`mt-0 text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:`Just better.`})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Select a machine size:`}),(0,R.jsx)(C,{"aria-label":`Machine size`,placeholder:`Select a machine size`,value:o,onChange:s,options:w})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Select storage:`}),(0,R.jsx)(C,{"aria-label":`Storage`,placeholder:`Select storage`,value:c,onChange:p,options:T})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Bundle some credits:`}),(0,R.jsx)(C,{"aria-label":`Credit bundle`,placeholder:`Select a credit bundle`,value:h,onChange:g,options:E})]})]}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5 md:pt-[3px]`,children:[(0,R.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Recap`}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:f(j)}),(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Total`})]}),(0,R.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,R.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Your selection:`}),(0,R.jsx)(`ul`,{className:`flex flex-col gap-2`,children:M.map(e=>(0,R.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`text-[14px] font-medium leading-[18px] text-[var(--content-secondary)]`,children:e})]},e))}),(0,R.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:!A||r,onClick:()=>{!D||!O||h===``||r||a({machineTier:D.tier,storageTier:O.tier,creditTier:h===z?null:h})},children:`Continue`}),(0,R.jsx)(n,{variant:`ghost`,fullWidth:!0,disabled:r,onClick:i,children:`Cancel`})]})]})})})})}function H({className:e,onConfigure:t}){return(0,R.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-8 ${e??``}`,children:[(0,R.jsx)(`p`,{className:`text-center text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Need something more tailored to your needs?`}),(0,R.jsxs)(`div`,{className:`flex w-[840px] max-w-full flex-col items-start gap-4 rounded-2xl bg-[var(--surface-lift)] p-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,R.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--content-disabled)] p-[14px]`,children:(0,R.jsx)(y,{className:`h-6 w-6 text-[var(--aux-white)]`,"aria-hidden":!0})}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Custom Plan`}),(0,R.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-tertiary)]`,children:`Select custom CPU power, Ram and Storage. Or just throw in some tokens.`})]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Billed monthly`}),(0,R.jsx)(n,{variant:`outlined`,onClick:t,children:`Configure`})]})]})]})}function U({tierKey:e,name:t,tagline:r,priceLabel:i,priceCaption:a,ctaLabel:o,features:s,mostPopular:c=!1,tone:u=`dark`,isCurrent:d,pending:f,onCta:p}){return(0,R.jsxs)(`div`,{"data-theme":u,className:`flex w-full flex-col gap-4 rounded-2xl bg-[var(--surface-lift)] p-4`,children:[(0,R.jsx)(g,{tier:e,size:50}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[20px] font-medium text-[var(--content-emphasised)]`,children:t}),c?(0,R.jsx)(b,{className:`bg-[var(--feed-digest-weak)] text-[12px] font-semibold uppercase text-[var(--credits-accent)]`,children:`Most Popular`}):null]}),(0,R.jsx)(`p`,{className:`h-9 overflow-hidden text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:r})]}),(0,R.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:i}),(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:a})]}),(0,R.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:d||f,onClick:p,children:d?`Current Plan`:o}),(0,R.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,R.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Includes:`}),(0,R.jsx)(`ul`,{className:`flex flex-col gap-2`,children:s.map(e=>(0,R.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-secondary)]`,children:e})]},e))})]})]})}var W={free:{tagline:`Get to know your assistant`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`Empower your assistant to level you up.`,cta:`Power Up`,priceCaption:`Billed monthly`},super:{tagline:`Give your assistant real muscle to help you grow`,cta:`Go Super`,priceCaption:`Billed monthly`,mostPopular:!0,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Our most powerful assistant. There's nothing you can't tackle together`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function G(e){return W[e]}var K=`#0A0A0B`,q=`https://www.vellum.ai/docs/pricing`;M();var J=[`Small Computer`,`4 GiB Storage`,`Pay-as-you-go credits`];function Y(e){return`${m(e)}/month`}function X(e){let t=e.machine_size;return`${t?I[t]??t:`Small`} Computer`}function te(e,t){let n=e.credits_usd??0;return[X(e),`${e.storage_gib} GiB Storage`,`${m(n*100)} in credits per month`,...t]}function Z(){let e=r(),t=i(),s=w(),l=P({platformHostedOnly:!0}),u=D(),d=N(),f=l===`full`&&u,m=l===`full`&&d,g=a({...O(),enabled:f}),_=a({...ee(),enabled:f}),y=o(A()),[b,x]=(0,L.useState)(!1),[C,M]=(0,L.useState)(!1),F=g.data,I=_.data?.plans.find(e=>e.id===`pro`),z=I?.packages??[],B=z.length>0,W=!f&&!m,X=f&&!_.isLoading&&!B,Z=W||g.isError||X;(0,L.useEffect)(()=>{Z&&e(T.settings.usageBilling,{replace:!0})},[Z,e]);let ne=()=>{(window.history.state?.idx??0)>0?e(-1):e(T.settings.usageBilling)},Q=async e=>{x(!0);try{let n=await y.mutateAsync({body:e});n.status===`redirect`&&n.checkout_url?E(n.checkout_url):(await t.invalidateQueries({queryKey:k()}),await t.invalidateQueries({queryKey:j()}))}catch(e){S.error(p(e,`Failed to start the upgrade checkout. Please try again.`))}finally{x(!1)}},$;if(F&&I&&B){let t=F.plan_id===`pro`,n=F.plan_id===`base`?`free`:F.package?.key??null,r=n=>{if(t){e(`${T.settings.usage}?tab=billing&adjust_plan`);return}n!==`free`&&Q({target_plan_id:`pro`,package:n,confirm:!0})},i=e=>Q({target_plan_id:`pro`,confirm:!0,machine_tier:e.machineTier,storage_tier:e.storageTier,credit_tier:e.creditTier}),a=()=>{if(t){e(`${T.settings.usage}?tab=billing&adjust_plan`);return}M(!0)},o=[...z].sort((e,t)=>h.indexOf(e.key)-h.indexOf(t.key)),s=G(`free`);$=(0,R.jsxs)(`div`,{className:`my-auto flex w-full flex-col items-center`,children:[(0,R.jsxs)(`header`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,R.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:{fontFamily:`var(--font-serif)`,fontSize:`60px`,fontWeight:400,lineHeight:1.2,letterSpacing:`1.2px`},children:`Plans designed to empower you`}),(0,R.jsx)(`p`,{className:`text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Start free. Upgrade when you actually need more.`})]}),(0,R.jsxs)(`div`,{className:`mt-10 grid w-full max-w-[1312px] grid-cols-1 items-start gap-6 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,R.jsx)(U,{tierKey:`free`,name:`Free`,tagline:s?.tagline??``,priceLabel:`$0/month`,priceCaption:s?.priceCaption??`Forever`,ctaLabel:s?.cta??`Start Free`,features:J,tone:`dark`,isCurrent:n===`free`,pending:b,onCta:()=>r(`free`)}),o.map(e=>{let t=G(e.key);return(0,R.jsx)(U,{tierKey:e.key,name:e.name,tagline:t?.tagline??``,priceLabel:Y(e.total_price_cents),priceCaption:t?.priceCaption??`Billed monthly`,ctaLabel:t?.cta??e.name,features:te(e,t?.extraFeatures??[]),mostPopular:t?.mostPopular,tone:t?.mostPopular?`light`:`dark`,isCurrent:n===e.key,pending:b,onCta:()=>r(e.key)},e.key)})]}),(0,R.jsx)(H,{className:`mt-10`,onConfigure:a}),(0,R.jsx)(V,{open:C,proPlan:I,pending:b,onClose:()=>M(!1),onContinue:e=>void i(e)}),(0,R.jsxs)(`p`,{className:`mt-10 text-center text-[12px] font-medium text-[var(--content-tertiary)]`,children:[`You can cancel or change your plan anytime you want. To learn more`,` `,(0,R.jsx)(`a`,{href:q,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--content-default)] underline`,children:`Read our Docs.`})]})]})}else $=(0,R.jsx)(`div`,{className:`my-auto flex items-center justify-center`,children:(0,R.jsx)(v,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading plans`})});return(0,R.jsxs)(`div`,{"data-theme":`dark`,className:`plans-takeover-canvas-enter relative h-full w-full overflow-y-auto`,style:{backgroundColor:K},children:[(0,R.jsx)(`div`,{className:`absolute left-8 z-10 [-webkit-app-region:no-drag]`,style:{top:s?`3rem`:`2rem`},children:(0,R.jsx)(n,{variant:`outlined`,leftIcon:(0,R.jsx)(c,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:ne,className:`[-webkit-app-region:no-drag]`,children:`Back`})}),(0,R.jsx)(`div`,{className:`plans-takeover-content-enter flex min-h-full flex-col items-center px-6 pb-8`,style:{paddingTop:s?`5rem`:`4rem`},children:$})]})}export{Z as PlansPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{u as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./arrow-left-C2re-gYj.js";import{t as l}from"./circle-check-DqvTjWle.js";import{d as u,h as d,m as f,o as p,p as m,r as h,t as g}from"./plan-tier-meta-BIKAm_Ai.js";import{t as _}from"./hard-drive-DVmyHlZR.js";import{t as v}from"./loader-circle-Ck8fq3yv.js";import{t as y}from"./sliders-horizontal-MqeLCMh3.js";import{t as b}from"./tag-B6WeUtBW.js";import{t as x}from"./modal-BtcwNEBj.js";import{n as S}from"./toast-Be8FEQ-I.js";import{t as C}from"./dropdown-BxYrCXBS.js";import{t as w}from"./is-electron-y5bNUVyG.js";import{c as T}from"./routes-Cwb-U9H-.js";import{t as E}from"./browser-WF64N2wk.js";import{$a as D,Mi as O,Ni as k,Pi as A,Ti as j,dt as M,eo as N,to as P,wi as ee,ys as F}from"./index-2np2R8qP.js";import{n as I}from"./machine-sizes-bagopaDl.js";var L=e(t(),1),R=s(),z=`__none__`;function B(e){return(0,R.jsxs)(`span`,{className:`text-[12px] font-medium text-[var(--content-disabled)]`,children:[`+`,f(e)]})}function V({open:e,proPlan:t,pending:r,onClose:i,onContinue:a}){let[o,s]=(0,L.useState)(``),[c,p]=(0,L.useState)(``),[h,g]=(0,L.useState)(``);(0,L.useEffect)(()=>{e||(s(``),p(``),g(``))},[e]);let v=t.machine_tiers,b=(0,L.useMemo)(()=>t.storage_tiers.filter(e=>!e.legacy),[t.storage_tiers]),S=t.credit_tiers??[],w=v.map(e=>({value:e.tier,label:e.description,icon:(0,R.jsx)(d,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:B(e.price_cents),disabled:u(e)})),T=b.map(e=>({value:e.tier,label:e.label,icon:(0,R.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:B(e.price_cents),disabled:u(e)})),E=[{value:z,label:`No extra credits`,icon:(0,R.jsx)(F,{className:`h-4 w-4`,"aria-hidden":!0})},...S.map(e=>({value:e.tier,label:e.label,icon:(0,R.jsx)(F,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:B(e.price_cents)}))],D=v.find(e=>e.tier===o)??null,O=b.find(e=>e.tier===c)??null,k=h&&h!==z?S.find(e=>e.tier===h)??null:null,A=D!=null&&O!=null&&h!==``,j=t.base_price_cents+(D?.price_cents??0)+(O?.price_cents??0)+(k?.price_cents??0),M=[`Pro base plan — ${f(t.base_price_cents)}`,D?.description,O?`${O.storage_gib} GiB storage`:null,h===z?`No extra credits`:k?`${m(k.credits_usd*100)} of bundled credits`:null].filter(e=>e!=null);return(0,R.jsx)(x.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,R.jsx)(x.Content,{size:`lg`,"data-theme":`light`,hideCloseButton:!0,overlayClassName:`backdrop-blur-[2px]`,className:`max-w-[820px] md:min-h-[min(608px,calc(100vh-4rem))]`,children:(0,R.jsx)(x.Body,{className:`p-6`,children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-8 md:flex-row md:gap-12`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-8 md:w-[440px] md:shrink-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--surface-active)] p-[14px]`,children:(0,R.jsx)(y,{className:`h-6 w-6 text-[var(--content-emphasised)]`,"aria-hidden":!0})}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(x.Title,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Create a custom plan`}),(0,R.jsx)(x.Description,{className:`mt-0 text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:`Just better.`})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Select a machine size:`}),(0,R.jsx)(C,{"aria-label":`Machine size`,placeholder:`Select a machine size`,value:o,onChange:s,options:w})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Select storage:`}),(0,R.jsx)(C,{"aria-label":`Storage`,placeholder:`Select storage`,value:c,onChange:p,options:T})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:`Bundle some credits:`}),(0,R.jsx)(C,{"aria-label":`Credit bundle`,placeholder:`Select a credit bundle`,value:h,onChange:g,options:E})]})]}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5 md:pt-[3px]`,children:[(0,R.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Recap`}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:f(j)}),(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Total`})]}),(0,R.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,R.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Your selection:`}),(0,R.jsx)(`ul`,{className:`flex flex-col gap-2`,children:M.map(e=>(0,R.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`text-[14px] font-medium leading-[18px] text-[var(--content-secondary)]`,children:e})]},e))}),(0,R.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:!A||r,onClick:()=>{!D||!O||h===``||r||a({machineTier:D.tier,storageTier:O.tier,creditTier:h===z?null:h})},children:`Continue`}),(0,R.jsx)(n,{variant:`ghost`,fullWidth:!0,disabled:r,onClick:i,children:`Cancel`})]})]})})})})}function H({className:e,onConfigure:t}){return(0,R.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-8 ${e??``}`,children:[(0,R.jsx)(`p`,{className:`text-center text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Need something more tailored to your needs?`}),(0,R.jsxs)(`div`,{className:`flex w-[840px] max-w-full flex-col items-start gap-4 rounded-2xl bg-[var(--surface-lift)] p-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,R.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--content-disabled)] p-[14px]`,children:(0,R.jsx)(y,{className:`h-6 w-6 text-[var(--aux-white)]`,"aria-hidden":!0})}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Custom Plan`}),(0,R.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-tertiary)]`,children:`Select custom CPU power, Ram and Storage. Or just throw in some tokens.`})]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Billed monthly`}),(0,R.jsx)(n,{variant:`outlined`,onClick:t,children:`Configure`})]})]})]})}function U({tierKey:e,name:t,tagline:r,priceLabel:i,priceCaption:a,ctaLabel:o,features:s,mostPopular:c=!1,tone:u=`dark`,isCurrent:d,pending:f,onCta:p}){return(0,R.jsxs)(`div`,{"data-theme":u,className:`flex w-full flex-col gap-4 rounded-2xl bg-[var(--surface-lift)] p-4`,children:[(0,R.jsx)(g,{tier:e,size:50}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[20px] font-medium text-[var(--content-emphasised)]`,children:t}),c?(0,R.jsx)(b,{className:`bg-[var(--feed-digest-weak)] text-[12px] font-semibold uppercase text-[var(--credits-accent)]`,children:`Most Popular`}):null]}),(0,R.jsx)(`p`,{className:`h-9 overflow-hidden text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:r})]}),(0,R.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:i}),(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:a})]}),(0,R.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:d||f,onClick:p,children:d?`Current Plan`:o}),(0,R.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,R.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Includes:`}),(0,R.jsx)(`ul`,{className:`flex flex-col gap-2`,children:s.map(e=>(0,R.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(l,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-secondary)]`,children:e})]},e))})]})]})}var W={free:{tagline:`Get to know your assistant`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`Empower your assistant to level you up.`,cta:`Power Up`,priceCaption:`Billed monthly`},super:{tagline:`Give your assistant real muscle to help you grow`,cta:`Go Super`,priceCaption:`Billed monthly`,mostPopular:!0,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Our most powerful assistant. There's nothing you can't tackle together`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function G(e){return W[e]}var K=`#0A0A0B`,q=`https://www.vellum.ai/docs/pricing`;M();var J=[`Small Computer`,`4 GiB Storage`,`Pay-as-you-go credits`];function Y(e){return`${m(e)}/month`}function X(e){let t=e.machine_size;return`${t?I[t]??t:`Small`} Computer`}function te(e,t){let n=e.credits_usd??0;return[X(e),`${e.storage_gib} GiB Storage`,`${m(n*100)} in credits per month`,...t]}function Z(){let e=r(),t=i(),s=w(),l=P({platformHostedOnly:!0}),u=D(),d=N(),f=l===`full`&&u,m=l===`full`&&d,g=a({...O(),enabled:f}),_=a({...ee(),enabled:f}),y=o(A()),[b,x]=(0,L.useState)(!1),[C,M]=(0,L.useState)(!1),F=g.data,I=_.data?.plans.find(e=>e.id===`pro`),z=I?.packages??[],B=z.length>0,W=!f&&!m,X=f&&!_.isLoading&&!B,Z=W||g.isError||X;(0,L.useEffect)(()=>{Z&&e(T.settings.usageBilling,{replace:!0})},[Z,e]);let ne=()=>{(window.history.state?.idx??0)>0?e(-1):e(T.settings.usageBilling)},Q=async e=>{x(!0);try{let n=await y.mutateAsync({body:e});n.status===`redirect`&&n.checkout_url?E(n.checkout_url):(await t.invalidateQueries({queryKey:k()}),await t.invalidateQueries({queryKey:j()}))}catch(e){S.error(p(e,`Failed to start the upgrade checkout. Please try again.`))}finally{x(!1)}},$;if(F&&I&&B){let t=F.plan_id===`pro`,n=F.plan_id===`base`?`free`:F.package?.key??null,r=n=>{if(t){e(`${T.settings.usage}?tab=billing&adjust_plan`);return}n!==`free`&&Q({target_plan_id:`pro`,package:n,confirm:!0})},i=e=>Q({target_plan_id:`pro`,confirm:!0,machine_tier:e.machineTier,storage_tier:e.storageTier,credit_tier:e.creditTier}),a=()=>{if(t){e(`${T.settings.usage}?tab=billing&adjust_plan`);return}M(!0)},o=[...z].sort((e,t)=>h.indexOf(e.key)-h.indexOf(t.key)),s=G(`free`);$=(0,R.jsxs)(`div`,{className:`my-auto flex w-full flex-col items-center`,children:[(0,R.jsxs)(`header`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,R.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:{fontFamily:`var(--font-serif)`,fontSize:`60px`,fontWeight:400,lineHeight:1.2,letterSpacing:`1.2px`},children:`Plans designed to empower you`}),(0,R.jsx)(`p`,{className:`text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Start free. Upgrade when you actually need more.`})]}),(0,R.jsxs)(`div`,{className:`mt-10 grid w-full max-w-[1312px] grid-cols-1 items-start gap-6 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,R.jsx)(U,{tierKey:`free`,name:`Free`,tagline:s?.tagline??``,priceLabel:`$0/month`,priceCaption:s?.priceCaption??`Forever`,ctaLabel:s?.cta??`Start Free`,features:J,tone:`dark`,isCurrent:n===`free`,pending:b,onCta:()=>r(`free`)}),o.map(e=>{let t=G(e.key);return(0,R.jsx)(U,{tierKey:e.key,name:e.name,tagline:t?.tagline??``,priceLabel:Y(e.total_price_cents),priceCaption:t?.priceCaption??`Billed monthly`,ctaLabel:t?.cta??e.name,features:te(e,t?.extraFeatures??[]),mostPopular:t?.mostPopular,tone:t?.mostPopular?`light`:`dark`,isCurrent:n===e.key,pending:b,onCta:()=>r(e.key)},e.key)})]}),(0,R.jsx)(H,{className:`mt-10`,onConfigure:a}),(0,R.jsx)(V,{open:C,proPlan:I,pending:b,onClose:()=>M(!1),onContinue:e=>void i(e)}),(0,R.jsxs)(`p`,{className:`mt-10 text-center text-[12px] font-medium text-[var(--content-tertiary)]`,children:[`You can cancel or change your plan anytime you want. To learn more`,` `,(0,R.jsx)(`a`,{href:q,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--content-default)] underline`,children:`Read our Docs.`})]})]})}else $=(0,R.jsx)(`div`,{className:`my-auto flex items-center justify-center`,children:(0,R.jsx)(v,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading plans`})});return(0,R.jsxs)(`div`,{"data-theme":`dark`,className:`plans-takeover-canvas-enter relative h-full w-full overflow-y-auto`,style:{backgroundColor:K},children:[(0,R.jsx)(`div`,{className:`absolute left-8 z-10 [-webkit-app-region:no-drag]`,style:{top:s?`3rem`:`2rem`},children:(0,R.jsx)(n,{variant:`outlined`,leftIcon:(0,R.jsx)(c,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:ne,className:`[-webkit-app-region:no-drag]`,children:`Back`})}),(0,R.jsx)(`div`,{className:`plans-takeover-content-enter flex min-h-full flex-col items-center px-6 pb-8`,style:{paddingTop:s?`5rem`:`4rem`},children:$})]})}export{Z as PlansPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,n as t}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./assistant-identity-store-CgJwLRMd.js";import{c as i}from"./routes-Cwb-U9H-.js";import{Fn as a}from"./index-
|
|
1
|
+
import{f as e,n as t}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./assistant-identity-store-CgJwLRMd.js";import{c as i}from"./routes-Cwb-U9H-.js";import{Fn as a}from"./index-2np2R8qP.js";var o=n();function s(){let n=r.use.version(),s=a(),{name:c}=e();return n===null?null:!s||!c?(0,o.jsx)(t,{to:i.superpowers,replace:!0}):(0,o.jsx)(t,{to:`${i.superpowers}?plugin=${encodeURIComponent(c)}`,replace:!0})}export{s as PluginDetailPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-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{r as g}from"./panel-item-An-BBeyL.js";import{t as _}from"./loader-circle-Ck8fq3yv.js";import{t as v}from"./pencil-CsnkG5VN.js";import{t as y}from"./shield-check-C3mmA0Pk.js";import{t as b}from"./x-CswtfvgS.js";import{t as x}from"./notice-DkAWz47A.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-Be8FEQ-I.js";import{t as E}from"./confirm-dialog-Zyfei9GV.js";import{t as D}from"./dropdown-BxYrCXBS.js";import{n as O,p as k,r as A}from"./auth-store-B8Es53B9.js";import{t as j}from"./sdk.gen-B3ej_AZQ.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-Bp5eYpXj.js";import{c as oe,s as se}from"./routes-Cwb-U9H-.js";import{d as ce,f as le}from"./prefs-Od3axSSC.js";import{$ as ue,$a as de,$n as fe,Ao as P,F,H as pe,I as me,L as he,Or as I,P as L,ar as R,eo as ge,et as z,kr as _e,or as ve,sr as ye,to as B,tt as be}from"./index-D7_9Qy0L.js";import{t as V}from"./use-active-assistant-id-DwLFgABu.js";import{t as H}from"./detail-card-CIh4dCKt.js";import{t as U}from"./setting-row-BL-mNsNh.js";import{t as xe}from"./settings-divider-qjjA_SZa.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}=ye(),{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 R(e.sourceKind):await ve(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=B({platformHostedOnly:!0}),t=de(),n=ge(),r=u(),{data:i,isLoading:a,isError:o}=d({...I(),enabled:e===`full`&&t}),s=f({mutationFn:async e=>{let{data:t}=await j({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{_e(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)(pe,{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)(P,{}),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=L.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:()=>me(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=L.find(e=>e.id===n)?.riskThreshold,o=L.find(e=>e.id===r)?.riskThreshold,s=L.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||he(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=L.find(e=>e.id===i),k=L.find(e=>e.id===o),A=L.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 be(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([z(e),z(e,{origin:`default`})]);return Re(t,n)}return z(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 ue(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)(P,{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=B({platformHostedOnly:!0}),t=A(),n=t,a=O.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:()=>{k(`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:()=>{k(`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
|
+
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{r as g}from"./panel-item-An-BBeyL.js";import{t as _}from"./loader-circle-Ck8fq3yv.js";import{t as v}from"./pencil-CsnkG5VN.js";import{t as y}from"./shield-check-C3mmA0Pk.js";import{t as b}from"./x-CswtfvgS.js";import{t as x}from"./notice-DkAWz47A.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-Be8FEQ-I.js";import{t as E}from"./confirm-dialog-Zyfei9GV.js";import{t as D}from"./dropdown-BxYrCXBS.js";import{n as O,p as k,r as A}from"./auth-store-B8Es53B9.js";import{t as j}from"./sdk.gen-B3ej_AZQ.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-Bp5eYpXj.js";import{c as oe,s as se}from"./routes-Cwb-U9H-.js";import{d as ce,f as le}from"./prefs-Od3axSSC.js";import{$ as ue,$a as de,$n as fe,Ao as P,F,H as pe,I as me,L as he,Or as I,P as L,ar as R,eo as ge,et as z,kr as _e,or as ve,sr as ye,to as B,tt as be}from"./index-2np2R8qP.js";import{t as V}from"./use-active-assistant-id-DwLFgABu.js";import{t as H}from"./detail-card-CIh4dCKt.js";import{t as U}from"./setting-row-BL-mNsNh.js";import{t as xe}from"./settings-divider-qjjA_SZa.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}=ye(),{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 R(e.sourceKind):await ve(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=B({platformHostedOnly:!0}),t=de(),n=ge(),r=u(),{data:i,isLoading:a,isError:o}=d({...I(),enabled:e===`full`&&t}),s=f({mutationFn:async e=>{let{data:t}=await j({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{_e(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)(pe,{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)(P,{}),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=L.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:()=>me(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=L.find(e=>e.id===n)?.riskThreshold,o=L.find(e=>e.id===r)?.riskThreshold,s=L.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||he(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=L.find(e=>e.id===i),k=L.find(e=>e.id===o),A=L.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 be(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([z(e),z(e,{origin:`default`})]);return Re(t,n)}return z(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 ue(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)(P,{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=B({platformHostedOnly:!0}),t=A(),n=t,a=O.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:()=>{k(`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:()=>{k(`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{f as o}from"./local-mode-Dydd46cS.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{f as c,i as l,n as u}from"./auth-store-B8Es53B9.js";import{m as d}from"./native-biometric-Bp5eYpXj.js";import{c as f}from"./routes-Cwb-U9H-.js";import{f as p,p as m,u as h}from"./prefs-Od3axSSC.js";import{Nn as g,jn as _,kn as v,pn 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{f as o}from"./local-mode-Dydd46cS.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{f as c,i as l,n as u}from"./auth-store-B8Es53B9.js";import{m as d}from"./native-biometric-Bp5eYpXj.js";import{c as f}from"./routes-Cwb-U9H-.js";import{f as p,p as m,u as h}from"./prefs-Od3axSSC.js";import{Nn as g,jn as _,kn as v,pn as y}from"./index-2np2R8qP.js";import{t as b}from"./plugin-attribution-6W3_ulYk.js";import{n as x,t as S}from"./consent-controls-DS7GjOzc.js";var C=e(t(),1),w=a();function T({current:e,total:t,color:n}){return(0,w.jsx)(`div`,{className:`flex items-center gap-1.5`,role:`group`,"aria-label":`Step ${e+1} of ${t}`,children:Array.from({length:t},(t,r)=>(0,w.jsx)(`div`,{"aria-hidden":`true`,className:`h-[3px] w-8 rounded-full transition-colors`,style:n?{backgroundColor:n,opacity:r<=e?1:.3}:void 0,children:n?null:(0,w.jsx)(`div`,{className:`h-full w-full rounded-full bg-[var(--content-default)] ${r<=e?``:`opacity-20`}`})},r))})}function E({isNative:e,isLocalHatch:t}){return e||t?f.onboarding.hatching:f.onboarding.research}function D(){let e=i(),[t]=r(),a=u.use.user()?.id??null,D=s(),O=d(),[k,A]=p(),j=k??!0,[M,N]=m(),[P,F]=h(),I=l();(0,C.useEffect)(()=>{O||g()},[O]);let L=t.get(`preview`)===`true`,R=(0,C.useCallback)(e=>{},[]),z=L?R:A,B=L?R:N,V=L?R:F,H=(0,C.useCallback)(()=>{if(L)return;c({userId:a,tos:M,privacy:P,shareAnalytics:null,shareDiagnostics:j,hasPlatformSession:I}),O||_(v.privacyTos,{userId:a});let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=t.get(b);i&&r.set(b,i);let s=r.toString();e(`${E({isNative:O,isLocalHatch:o()&&n!==null&&n!==`vellum-cloud`})}${s?`?${s}`:``}`)},[P,I,O,L,e,t,j,M,a]);return(0,w.jsx)(y,{children:(0,w.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${D?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[O&&(0,w.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,w.jsx)(T,{current:2,total:3})}),(0,w.jsx)(`h1`,{className:D?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,w.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${D?`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,w.jsx)(x,{electron:D,showAnalytics:!1,shareAnalytics:!1,shareDiagnostics:j,onShareAnalyticsChange:R,onShareDiagnosticsChange:z,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,w.jsx)(S,{electron:D,privacyConsent:P,tosAccepted:M,onPrivacyChange:V,onTosChange:B,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,w.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${D?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,w.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!M||!P,onClick:H,className:D?void 0:`h-11 text-base`,children:`Start`}),(0,w.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(o()?f.onboarding.hosting:f.onboarding.start),className:D?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{D as PrivacyScreen};
|
package/dist/assets/{provider-callback-page-DnCyuaIz.js → provider-callback-page-Dl7F__Qu.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-anSemq95.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{C as s,f as c}from"./local-mode-Dydd46cS.js";import{D as l,n as u}from"./auth-store-B8Es53B9.js";import{c as d}from"./api-DbnBa3dN.js";import{S as f,_ as p}from"./native-biometric-Bp5eYpXj.js";import{c as m}from"./routes-Cwb-U9H-.js";import{a as h,i as g}from"./login-flow-DXwwcT6M.js";import{v as _}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-anSemq95.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{C as s,f as c}from"./local-mode-Dydd46cS.js";import{D as l,n as u}from"./auth-store-B8Es53B9.js";import{c as d}from"./api-DbnBa3dN.js";import{S as f,_ as p}from"./native-biometric-Bp5eYpXj.js";import{c as m}from"./routes-Cwb-U9H-.js";import{a as h,i as g}from"./login-flow-DXwwcT6M.js";import{v as _}from"./index-2np2R8qP.js";import{r as v,t as y}from"./account-shell-z2p_MG9z.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(),c())try{let e=await d();if(e.ok&&e.data.length>0&&(await s(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-y5bNUVyG.js";import{t as i}from"./public-asset-Cr86Gucv.js";import{Ns as a}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{t as i}from"./public-asset-Cr86Gucv.js";import{Ns as a}from"./index-2np2R8qP.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-Cwb-U9H-.js";import"./conversation-store-Ogn1aavZ.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-Cwb-U9H-.js";import"./conversation-store-Ogn1aavZ.js";import"./index-2np2R8qP.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};
|
package/dist/assets/{research-onboarding-route-CiYOCoIf.js → research-onboarding-route-ByXRk6ey.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-anSemq95.js";import{t as n}from"./react-DJZBPgpf.js";import{P as r,t as i}from"./button-BQVYX8n_.js";import{m as a,u as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./arrow-left-C2re-gYj.js";import{t as d}from"./loader-circle-Ck8fq3yv.js";import{t as f}from"./pencil-CsnkG5VN.js";import{t as p}from"./plus-DZZypDUF.js";import{t as m}from"./x-CswtfvgS.js";import{t as h}from"./tag-B6WeUtBW.js";import{t as g}from"./input-ZpyYt_a0.js";import{i as _,r as v,t as y}from"./dist-Cul7ysiV.js";import{n as b}from"./toast-Be8FEQ-I.js";import{n as x,t as S}from"./create-selectors-8NePGNlX.js";import{ct as C,f as w,o as T,y as E}from"./local-mode-Dydd46cS.js";import{Dr as D,Un as O,V as k,Wn as A,bn as j,tt as M,wr as N,yn as P}from"./sdk.gen-zsiNChRm.js";import{r as ee}from"./api-errors-CoE1wFl2.js";import{A as F,I as te,L as I,R as ne,n as re,z as ie}from"./auth-store-B8Es53B9.js";import{a as L,o as R,r as ae}from"./api-DbnBa3dN.js";import{c as oe}from"./routes-Cwb-U9H-.js";import{n as se}from"./platform-detection-BnBFKFxp.js";import{a as ce}from"./feature-flag-catalog-DpiUkDzU.js";import{o as le,s as ue}from"./prechat-mDxOfWth.js";import{t as de}from"./browser-timezone-2SnmKDjM.js";import{c as fe}from"./conversation-list-fetchers-o20VEKwg.js";import{i as pe,n as me,r as he,t as ge}from"./research-onboarding-persistence-C4LT0Ekr.js";import{A as _e,B as ve,C as ye,D as be,E as xe,F as Se,I as Ce,L as we,M as Te,N as Ee,O as De,P as Oe,R as ke,S as z,T as Ae,V as B,a as je,d as V,f as Me,g as Ne,i as Pe,j as Fe,k as Ie,m as Le,o as H,p as Re,r as ze,s as Be,t as U,v as Ve,w as He,x as W,y as Ue}from"./proxy-BzlH_XAe.js";import{t as We}from"./AnimatePresence-C8APSgIu.js";import{t as G}from"./use-reduced-motion-CcGT6CHV.js";import{An as Ge,Bo as Ke,Cn as qe,En as Je,Eo as Ye,Er as Xe,Fs as K,Mn as Ze,Sa as Qe,Sn as $e,Tn as et,Un as tt,Yt as q,_s as nt,dt as rt,fa as it,ft as J,gn as at,hn as ot,in as st,mn as ct,pa as lt,pn as ut}from"./index-D7_9Qy0L.js";import{c as dt,i as ft,l as pt,n as mt,r as ht,s as gt,t as _t}from"./latest-assistant-text-BihKVb5c.js";import{n as vt,t as yt}from"./onboarding-step-layout-2XcmxqFN.js";import{n as bt}from"./plugin-attribution-6W3_ulYk.js";var xt=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function St(e,t){return Te(e)?e[xt(0,e.length,t)]:e}var Ct=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return wt(this.animations,`duration`)}get iterationDuration(){return wt(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function wt(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Tt=class extends Ct{then(e,t){return this.finished.finally(e).then(()=>{})}};function Et(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=xe(i,a,o);return t?s(r):s}function Dt(e,t){return e in t}var Ot=class extends Be{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Dt(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Me()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},Y=e(n(),1);function kt(e){let t=B(()=>z(e)),{isStatic:n}=(0,Y.useContext)(ze);if(n){let[,n]=(0,Y.useState)(e);(0,Y.useEffect)(()=>t.on(`change`,n),[])}return t}function At(e,t){let n=kt(t()),r=()=>n.set(t());return r(),ve(()=>{let t=()=>Fe.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),_e(r)}}),n}function jt(e){W.current=[],e();let t=At(W.current,e);return W.current=void 0,t}function Mt(e,t,n,r){if(typeof e==`function`)return jt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return Pt(e,t,n,r);let i=typeof t==`function`?t:Et(t,n,r),a=Array.isArray(e)?Nt(e,i):Nt([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function Nt(e,t){let n=B(()=>[]);return At(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function Pt(e,t,n,r){let i=B(()=>Object.keys(n)),a=B(()=>({}));for(let o of i)a[o]=Mt(e,t,n[o],r);return a}function Ft(e){return typeof e==`object`&&!Array.isArray(e)}function It(e,t,n,r){return e==null?[]:typeof e==`string`&&Ft(t)?Ne(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Lt(e,t,n){return e*(t+1)+n*t}function Rt(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function zt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(ke(e,i),r--)}}function Bt(e,t,n,r,i,a){zt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Ie(i,a,r[o]),easing:St(n,o)})}function Vt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Ht(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Ut=`easeInOut`,Wt=20;function Gt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,Rt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Rt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Jt(e),{delay:l=0,times:u=He(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=ye(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Zt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=Oe(b));let r=De(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Ae(u,T),c.length===1&&c.unshift(null),m&&we(m<Wt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Wt} or apply repeat at the sequence level instead.`),m&&m<Wt){let e=b>0?_/b:0;b=Lt(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Ee(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:St(f,e-1))}Vt(u,m,e)}let E=w+b;Bt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Ue(p)){let e=Kt(p,s);_(m,h,qt(`default`,e))}else{let e=It(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Kt(r,s);for(let e in m)_(m[e],Yt(h,e),qt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Ht);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Se(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Ut)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Kt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function qt(e,t){return t[e]||(t[e]=[]),t[e]}function Jt(e){return Array.isArray(e)?e:[e]}function Yt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Xt=e=>typeof e==`number`,Zt=e=>e.every(Xt);function Qt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Le(e)&&!Re(e)?new je(t):new H(t);n.mount(e),V.set(e,n)}function $t(e){let t=new Ot({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),V.set(e,t)}function en(e,t){return Ue(e)||typeof e==`number`||typeof e==`string`&&!Ft(t)}function tn(e,t,n,r){let i=[];if(en(e,t))i.push(Pe(e,Ft(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=It(e,t,r),o=a.length;Ce(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Qt:$t;V.has(r)||s(r);let c=V.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ve(c,{...t,transition:l},{}))}}return i}function nn(e,t,n){let r=[];return Gt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=z(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:be}).forEach(({keyframes:e,transition:t},n)=>{r.push(...tn(n,e,t))}),r}function rn(e){return Array.isArray(e)&&e.some(Array.isArray)}function an(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),rn(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=nn(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=tn(e,i,{...c,...r},t)}let l=new Tt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{ke(t.animations,l)})),l}return i}var on=an(),sn=`grounded`,cn=12;function ln(e,t){let n=e.slice(0,cn).map(e=>`- ${e.name} — ${e.description}`).join(`
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-anSemq95.js";import{t as n}from"./react-DJZBPgpf.js";import{P as r,t as i}from"./button-BQVYX8n_.js";import{m as a,u as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./arrow-left-C2re-gYj.js";import{t as d}from"./loader-circle-Ck8fq3yv.js";import{t as f}from"./pencil-CsnkG5VN.js";import{t as p}from"./plus-DZZypDUF.js";import{t as m}from"./x-CswtfvgS.js";import{t as h}from"./tag-B6WeUtBW.js";import{t as g}from"./input-ZpyYt_a0.js";import{i as _,r as v,t as y}from"./dist-Cul7ysiV.js";import{n as b}from"./toast-Be8FEQ-I.js";import{n as x,t as S}from"./create-selectors-8NePGNlX.js";import{ct as C,f as w,o as T,y as E}from"./local-mode-Dydd46cS.js";import{Dr as D,Un as O,V as k,Wn as A,bn as j,tt as M,wr as N,yn as P}from"./sdk.gen-zsiNChRm.js";import{r as ee}from"./api-errors-CoE1wFl2.js";import{A as F,I as te,L as I,R as ne,n as re,z as ie}from"./auth-store-B8Es53B9.js";import{a as L,o as R,r as ae}from"./api-DbnBa3dN.js";import{c as oe}from"./routes-Cwb-U9H-.js";import{n as se}from"./platform-detection-BnBFKFxp.js";import{a as ce}from"./feature-flag-catalog-DpiUkDzU.js";import{o as le,s as ue}from"./prechat-mDxOfWth.js";import{t as de}from"./browser-timezone-2SnmKDjM.js";import{c as fe}from"./conversation-list-fetchers-o20VEKwg.js";import{i as pe,n as me,r as he,t as ge}from"./research-onboarding-persistence-C4LT0Ekr.js";import{A as _e,B as ve,C as ye,D as be,E as xe,F as Se,I as Ce,L as we,M as Te,N as Ee,O as De,P as Oe,R as ke,S as z,T as Ae,V as B,a as je,d as V,f as Me,g as Ne,i as Pe,j as Fe,k as Ie,m as Le,o as H,p as Re,r as ze,s as Be,t as U,v as Ve,w as He,x as W,y as Ue}from"./proxy-BzlH_XAe.js";import{t as We}from"./AnimatePresence-C8APSgIu.js";import{t as G}from"./use-reduced-motion-CcGT6CHV.js";import{An as Ge,Bo as Ke,Cn as qe,En as Je,Eo as Ye,Er as Xe,Fs as K,Mn as Ze,Sa as Qe,Sn as $e,Tn as et,Un as tt,Yt as q,_s as nt,dt as rt,fa as it,ft as J,gn as at,hn as ot,in as st,mn as ct,pa as lt,pn as ut}from"./index-2np2R8qP.js";import{c as dt,i as ft,l as pt,n as mt,r as ht,s as gt,t as _t}from"./latest-assistant-text-BihKVb5c.js";import{n as vt,t as yt}from"./onboarding-step-layout-2XcmxqFN.js";import{n as bt}from"./plugin-attribution-6W3_ulYk.js";var xt=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function St(e,t){return Te(e)?e[xt(0,e.length,t)]:e}var Ct=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return wt(this.animations,`duration`)}get iterationDuration(){return wt(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function wt(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Tt=class extends Ct{then(e,t){return this.finished.finally(e).then(()=>{})}};function Et(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=xe(i,a,o);return t?s(r):s}function Dt(e,t){return e in t}var Ot=class extends Be{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Dt(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Me()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},Y=e(n(),1);function kt(e){let t=B(()=>z(e)),{isStatic:n}=(0,Y.useContext)(ze);if(n){let[,n]=(0,Y.useState)(e);(0,Y.useEffect)(()=>t.on(`change`,n),[])}return t}function At(e,t){let n=kt(t()),r=()=>n.set(t());return r(),ve(()=>{let t=()=>Fe.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),_e(r)}}),n}function jt(e){W.current=[],e();let t=At(W.current,e);return W.current=void 0,t}function Mt(e,t,n,r){if(typeof e==`function`)return jt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return Pt(e,t,n,r);let i=typeof t==`function`?t:Et(t,n,r),a=Array.isArray(e)?Nt(e,i):Nt([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function Nt(e,t){let n=B(()=>[]);return At(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function Pt(e,t,n,r){let i=B(()=>Object.keys(n)),a=B(()=>({}));for(let o of i)a[o]=Mt(e,t,n[o],r);return a}function Ft(e){return typeof e==`object`&&!Array.isArray(e)}function It(e,t,n,r){return e==null?[]:typeof e==`string`&&Ft(t)?Ne(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Lt(e,t,n){return e*(t+1)+n*t}function Rt(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function zt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(ke(e,i),r--)}}function Bt(e,t,n,r,i,a){zt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Ie(i,a,r[o]),easing:St(n,o)})}function Vt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Ht(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Ut=`easeInOut`,Wt=20;function Gt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,Rt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Rt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Jt(e),{delay:l=0,times:u=He(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=ye(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Zt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=Oe(b));let r=De(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Ae(u,T),c.length===1&&c.unshift(null),m&&we(m<Wt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Wt} or apply repeat at the sequence level instead.`),m&&m<Wt){let e=b>0?_/b:0;b=Lt(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Ee(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:St(f,e-1))}Vt(u,m,e)}let E=w+b;Bt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Ue(p)){let e=Kt(p,s);_(m,h,qt(`default`,e))}else{let e=It(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Kt(r,s);for(let e in m)_(m[e],Yt(h,e),qt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Ht);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Se(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Ut)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Kt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function qt(e,t){return t[e]||(t[e]=[]),t[e]}function Jt(e){return Array.isArray(e)?e:[e]}function Yt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Xt=e=>typeof e==`number`,Zt=e=>e.every(Xt);function Qt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Le(e)&&!Re(e)?new je(t):new H(t);n.mount(e),V.set(e,n)}function $t(e){let t=new Ot({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),V.set(e,t)}function en(e,t){return Ue(e)||typeof e==`number`||typeof e==`string`&&!Ft(t)}function tn(e,t,n,r){let i=[];if(en(e,t))i.push(Pe(e,Ft(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=It(e,t,r),o=a.length;Ce(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Qt:$t;V.has(r)||s(r);let c=V.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ve(c,{...t,transition:l},{}))}}return i}function nn(e,t,n){let r=[];return Gt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=z(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:be}).forEach(({keyframes:e,transition:t},n)=>{r.push(...tn(n,e,t))}),r}function rn(e){return Array.isArray(e)&&e.some(Array.isArray)}function an(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),rn(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=nn(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=tn(e,i,{...c,...r},t)}let l=new Tt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{ke(t.animations,l)})),l}return i}var on=an(),sn=`grounded`,cn=12;function ln(e,t){let n=e.slice(0,cn).map(e=>`- ${e.name} — ${e.description}`).join(`
|
|
2
2
|
`);return n?`
|
|
3
3
|
Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
|
|
4
4
|
${n}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-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{t as o}from"./shield-check-C3mmA0Pk.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{f as c,i as l,n as u}from"./auth-store-B8Es53B9.js";import{t as d}from"./return-to-ugSGJ0dm.js";import{c as f}from"./routes-Cwb-U9H-.js";import{c as p,d as m,f as h,l as g,p as _,u as v}from"./prefs-Od3axSSC.js";import{pn as y,wa as b}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{t as o}from"./shield-check-C3mmA0Pk.js";import{t as s}from"./is-electron-y5bNUVyG.js";import{f as c,i as l,n as u}from"./auth-store-B8Es53B9.js";import{t as d}from"./return-to-ugSGJ0dm.js";import{c as f}from"./routes-Cwb-U9H-.js";import{c as p,d as m,f as h,l as g,p as _,u as v}from"./prefs-Od3axSSC.js";import{pn as y,wa as b}from"./index-2np2R8qP.js";import{n as x,t as S}from"./consent-controls-DS7GjOzc.js";var C=e(t(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function E(e){return w[e]??[]}function D(e){return T[e]??[]}var O=a();function k(){let e=i(),[t]=r(),a=u.use.user()?.id??null,w=u.use.logout(),T=s(),k=l(),[A,j]=_(),[M,N]=v(),[P,F]=m(),[I,L]=h(),[R]=p(),[z]=g(),B=P??!0,V=I??!0,[H]=(0,C.useState)(()=>!A),[U]=(0,C.useState)(()=>!M),[W]=(0,C.useState)(()=>!R),[G]=(0,C.useState)(()=>!z),K=!H&&!U&&!W&&!G,q=H||K,J=U||K,Y=W||K,X=G||K,Z=!K&&!H&&!U,Q=K?`Terms & privacy`:Z?`Review your privacy preferences`:`Updated terms`,$=K?`Review your terms and privacy preferences anytime.`:Z?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,ee=(0,C.useCallback)(()=>{c({userId:a,tos:A,privacy:M,shareAnalytics:Y?B:null,shareDiagnostics:X?V:null,hasPlatformSession:k}),e(d(t.get(`returnTo`),f.assistant),{replace:!0})},[M,k,e,t,B,V,Y,X,A,a]),te=(0,C.useCallback)(async()=>{await w(),b(f.account.login)},[w]),ne=q&&!A||J&&!M;return(0,O.jsx)(y,{showCreatureFooter:!1,children:(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${T?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,O.jsx)(o,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,O.jsx)(`h1`,{className:`mt-5 ${T?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:Q}),(0,O.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${T?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:$}),(Y||X)&&(0,O.jsx)(x,{electron:T,showAnalytics:Y,showDiagnostics:X,shareAnalytics:B,shareDiagnostics:V,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(J||q)&&(0,O.jsx)(S,{electron:T,showPrivacy:J,showTos:q,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:J?D(`2026-06-22`):[],tosNotes:q?E(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,O.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${T?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:ne,onClick:ee,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:te,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};
|