@vellumai/web 0.11.2-staging.1 → 0.11.2-staging.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{access-DRXEXX07.js → access-CVnesk0m.js} +1 -1
- package/dist/assets/{account-page-CX6hJQwg.js → account-page-mMG1nL1O.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-CiQqwf32.js → acp-run-detail-panel-SN6NIuW5.js} +1 -1
- package/dist/assets/activity-steps-panel-bduSS8_d.js +1 -0
- package/dist/assets/{ai-page-DMad1ZuI.js → ai-page-BMqECtJX.js} +1 -1
- package/dist/assets/{app-card-CiARsZNb.js → app-card-BJigGog3.js} +1 -1
- package/dist/assets/{assistant-status-panel-BcO4L1Ot.js → assistant-status-panel-DyjhJvK6.js} +1 -1
- package/dist/assets/auth-store-C9aYqB9U.js +2 -0
- package/dist/assets/background-task-actions-DmocXKSr.js +1 -0
- package/dist/assets/{background-task-detail-panel-Cwy0aX1X.js → background-task-detail-panel-DCtBOnvF.js} +1 -1
- package/dist/assets/{billing-page-DtY1C_1i.js → billing-page-TF_LgX6K.js} +1 -1
- package/dist/assets/{bookmarks-page-CR6qlXH4.js → bookmarks-page-Brvj5Jf6.js} +1 -1
- package/dist/assets/{build-state-dDRg651i.js → build-state-9uUe0jN5.js} +1 -1
- package/dist/assets/{channels-page-route-BkAp7hp5.js → channels-page-route-8vJJE2LN.js} +1 -1
- package/dist/assets/{chat-markdown-message-Da34digC.js → chat-markdown-message-B7qvlO44.js} +1 -1
- package/dist/assets/{checkout-page-ChHhRSW7.js → checkout-page-MpIPAAgf.js} +1 -1
- package/dist/assets/{command-palette-window-page-BYRKvEj-.js → command-palette-window-page-CoweYsZl.js} +1 -1
- package/dist/assets/{contacts-page-route-6Pnu98io.js → contacts-page-route-BOpVOsYK.js} +1 -1
- package/dist/assets/{conversation-navigation-BqoIExAQ.js → conversation-navigation-Bf3cDRKh.js} +1 -1
- package/dist/assets/{conversation-queries-Dcm9S7mz.js → conversation-queries-BBj4FfQn.js} +1 -1
- package/dist/assets/{credentials-page-BnxIymyf.js → credentials-page-DBLT8nUI.js} +1 -1
- package/dist/assets/{debug-page-Bjdmoc6_.js → debug-page-DfPZPo6D.js} +1 -1
- package/dist/assets/{developer-page-CiJvs_Lu.js → developer-page-DwBmhm09.js} +1 -1
- package/dist/assets/{document-viewer-page-CsLTrhRq.js → document-viewer-page-CA1ParJ6.js} +1 -1
- package/dist/assets/{emails-page-DPdeEAZJ.js → emails-page-Bo0Bwem2.js} +1 -1
- package/dist/assets/{first-run-scope-CXWfJKeP.js → first-run-scope-CPJpXaWU.js} +1 -1
- package/dist/assets/{general-page-DYnUkwRE.js → general-page-BXeIQDGi.js} +1 -1
- package/dist/assets/{hatching-screen-CxSp0qa2.js → hatching-screen-BUpSlvBy.js} +1 -1
- package/dist/assets/{home-page-route-dqvJQwjW.js → home-page-route-BPht0PNp.js} +1 -1
- package/dist/assets/{hosting-screen-kj-kAK7Q.js → hosting-screen-DxtyBx0I.js} +1 -1
- package/dist/assets/index-C7_04HXM.css +2 -0
- package/dist/assets/index-CPeIfypI.js +11 -0
- package/dist/assets/{inspect-page-BlY6O00x.js → inspect-page-C8aLJOd6.js} +1 -1
- package/dist/assets/{integrations-page-49zuLodO.js → integrations-page-Bp2Q81Qt.js} +1 -1
- package/dist/assets/{library-detail-page-fsYlOanf.js → library-detail-page-gC4yIWnV.js} +1 -1
- package/dist/assets/{library-page-CjJhvK-9.js → library-page-B10gnbXU.js} +1 -1
- package/dist/assets/{local-runtime-upgrade-BvHY1msh.js → local-runtime-upgrade-CnY-6TiF.js} +1 -1
- package/dist/assets/{login-flow-DmQTk-x9.js → login-flow-CQhvCbQQ.js} +1 -1
- package/dist/assets/{login-page-BvisuxEP.js → login-page-CbWRbJDE.js} +1 -1
- package/dist/assets/{logout-page-BMKKBE_F.js → logout-page-DCyzi0V6.js} +1 -1
- package/dist/assets/{logs-layout-BJe9y8po.js → logs-layout-CYkqau4S.js} +1 -1
- package/dist/assets/{memory-page-route-BcZNNNO7.js → memory-page-route-j_3602nh.js} +1 -1
- package/dist/assets/{memory-router-playground-page-DTR4Mrw4.js → memory-router-playground-page-x5X662qi.js} +1 -1
- package/dist/assets/message-content-B6_GZQl9.js +1 -0
- package/dist/assets/{message-files-panel-CKeLnC4N.js → message-files-panel-C8JokH6e.js} +1 -1
- package/dist/assets/{messages-QgGSiklY.js → messages-Dyp1xUqz.js} +1 -1
- package/dist/assets/{notifications-rSx7pNPi.js → notifications-BTG4cTbF.js} +1 -1
- package/dist/assets/{notifications-page-Cu8hoFGy.js → notifications-page-BA2BW5y6.js} +1 -1
- package/dist/assets/{open-workspace-file-B_Rft7dd.js → open-workspace-file-CivxJWcw.js} +2 -2
- package/dist/assets/{plans-page-BDMR-ZtU.js → plans-page-BfyCgy38.js} +1 -1
- package/dist/assets/{platform-login-notice-q7ZuGeuo.js → platform-login-notice-DFmjUE9q.js} +1 -1
- package/dist/assets/{platform-loopback-page-e9XVrvYR.js → platform-loopback-page-BGF_H8f_.js} +1 -1
- package/dist/assets/{privacy-page-BZSbEQ1K.js → privacy-page-BhEGh78C.js} +1 -1
- package/dist/assets/{privacy-screen-BnQiOWl7.js → privacy-screen-CWVCI_KU.js} +1 -1
- package/dist/assets/{provider-callback-page-z2Cgryjl.js → provider-callback-page-DP5cKqPE.js} +1 -1
- package/dist/assets/{provider-signup-page-B-Li8WKA.js → provider-signup-page-BjiiJWS_.js} +1 -1
- package/dist/assets/{research-onboarding-route-C7jtWVgW.js → research-onboarding-route-DZF-B2Rk.js} +1 -1
- package/dist/assets/{retire-confirm-dialog-CgvcI85l.js → retire-confirm-dialog-8xlq4bkx.js} +1 -1
- package/dist/assets/{review-terms-screen-Bwu6-idm.js → review-terms-screen-C5BAI3Rx.js} +1 -1
- package/dist/assets/routes-uGHUgv4F.js +23 -0
- package/dist/assets/{runtime-upgrade-banner-BhPmj3_g.js → runtime-upgrade-banner-DjFuJawk.js} +1 -1
- package/dist/assets/{schedules-page-CT6myKlW.js → schedules-page-3ZE1nR6I.js} +1 -1
- package/dist/assets/{select-assistant-screen-DbeX0PLD.js → select-assistant-screen-D4WHHv61.js} +1 -1
- package/dist/assets/{settings-layout-ChyYdGV8.js → settings-layout-BmOglXDq.js} +1 -1
- package/dist/assets/{settings-navigation-DNl4C8Cc.js → settings-navigation-CyH-twYD.js} +1 -1
- package/dist/assets/{share-feedback-modal-7O61hwO1.js → share-feedback-modal-Rwuho_1S.js} +1 -1
- package/dist/assets/{sidebar-tree-CsfghEZ-.js → sidebar-tree-Dxx5qLMQ.js} +1 -1
- package/dist/assets/{signup-page-DDuZGMBS.js → signup-page-BAEo45pt.js} +1 -1
- package/dist/assets/site-favicon-CDH0mg6Q.js +1 -0
- package/dist/assets/{skill-detail-page-u1LBXWn1.js → skill-detail-page-DswXTTyb.js} +1 -1
- package/dist/assets/{subagent-detail-panel-8-Z5ZMUL.js → subagent-detail-panel-CidisBCf.js} +1 -1
- package/dist/assets/{system-events-page-DLvxCVqo.js → system-events-page-BrvTNeiN.js} +1 -1
- package/dist/assets/{tool-detail-panel-BmohMKch.js → tool-detail-panel-B2CIRZkB.js} +2 -2
- package/dist/assets/transcript-message-body-shared-BfKwS5qD.js +1 -0
- package/dist/assets/{upgrade-cancel-page-DcWOus4Y.js → upgrade-cancel-page-DjeqfvTa.js} +1 -1
- package/dist/assets/{upgrade-success-page-BSzX2vWY.js → upgrade-success-page-B4TCn340.js} +1 -1
- package/dist/assets/{use-checkout-dismiss-refresh-BcEeQKyP.js → use-checkout-dismiss-refresh-CV_H4uEB.js} +1 -1
- package/dist/assets/{use-command-palette-sections-DvMBAWZC.js → use-command-palette-sections-BshFMe0w.js} +1 -1
- package/dist/assets/{use-edit-app-DOmv9zsZ.js → use-edit-app-Bd1eXXFq.js} +1 -1
- package/dist/assets/{use-is-org-ready-Df3qfx4p.js → use-is-org-ready-3vHDbj4G.js} +1 -1
- package/dist/assets/{use-onboarding-login-V-vR-6Zd.js → use-onboarding-login-CiQyxJLM.js} +1 -1
- package/dist/assets/{use-platform-assistant-id-y2pWr9on.js → use-platform-assistant-id-DgrNmSy2.js} +1 -1
- package/dist/assets/{use-platform-gate-B_3hHMqw.js → use-platform-gate-C5bNA5Pn.js} +1 -1
- package/dist/assets/{use-return-to-short-circuit-DzCxe5P0.js → use-return-to-short-circuit-g88hMnN8.js} +1 -1
- package/dist/assets/{use-sticky-profiles-DamFnjb1.js → use-sticky-profiles-D5TVHOgw.js} +1 -1
- package/dist/assets/use-subagent-card-data-bjGydvhR.js +1 -0
- package/dist/assets/{use-transcript-message-by-id-BxaY6TIY.js → use-transcript-message-by-id-BgyP3Ki5.js} +1 -1
- package/dist/assets/{use-transcript-messages-CgESPWZ3.js → use-transcript-messages-C2uwkjKL.js} +1 -1
- package/dist/assets/{viewer-store-Cp5tMX-G.js → viewer-store-DbIS4l8d.js} +1 -1
- package/dist/assets/{voice-list-yvKUrPIf.js → voice-list-D26Lzbpv.js} +1 -1
- package/dist/assets/{voice-page-C8EoRpvD.js → voice-page-CQ2Vp8p4.js} +1 -1
- package/dist/assets/{welcome-screen-DzQAH74J.js → welcome-screen-CdsjDVfi.js} +1 -1
- package/dist/index.html +34 -34
- package/package.json +1 -1
- package/dist/assets/activity-steps-panel-Ds6C3Jf0.js +0 -1
- package/dist/assets/auth-store-CWJoXmMk.js +0 -2
- package/dist/assets/background-task-actions-762wxVkT.js +0 -1
- package/dist/assets/index-DQqBZlYO.js +0 -11
- package/dist/assets/index-OYTmjL3q.css +0 -2
- package/dist/assets/risk-Bnj8QXuk.js +0 -1
- package/dist/assets/routes-SchRo2Ae.js +0 -23
- package/dist/assets/site-favicon-FokoB0J2.js +0 -1
- package/dist/assets/transcript-message-body-shared-DkwwIkg0.js +0 -1
- package/dist/assets/use-subagent-card-data-B31LofB3.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-CAM1RhH8.js";var t=e(`bolt`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),n=e(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),r=e(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),i=e(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),a=new Set([`low`,`medium`,`high`]);function o(e){let t=e?.toLowerCase();return t&&a.has(t)?t:`medium`}function s(e){switch(e?.toLowerCase()){case`low`:return{bg:`bg-[var(--system-positive-strong)]`,text:`text-white`,label:`Low`};case`medium`:return{bg:`bg-[var(--system-mid-strong)]`,text:`text-black`,label:`Medium`};case`high`:return{bg:`bg-[var(--system-negative-strong)]`,text:`text-white`,label:`High`};case`workspace`:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,border:`border border-[var(--border-element)]`,label:`Workspace`};default:return{bg:`bg-[var(--content-secondary)]`,text:`text-white`,label:e??`Unknown`}}}function c(e){switch(e?.toLowerCase()){case`low`:return`Auto-approved at Conservative tolerance or higher`;case`medium`:return`Auto-approved at Relaxed tolerance or higher`;case`high`:return`Auto-approved only at Full Access tolerance`;default:return}}function l(e){switch(e?.toLowerCase()){case`low`:return{bg:`bg-[var(--system-positive-weak)]`,text:`text-[var(--system-positive-strong)]`,label:`Low`};case`medium`:return{bg:`bg-[var(--system-mid-weak)]`,text:`text-[var(--system-mid-strong)]`,label:`Medium`};case`high`:return{bg:`bg-[var(--system-negative-weak)]`,text:`text-[var(--system-negative-strong)]`,label:`High`};case`workspace`:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,label:`Workspace`};default:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,label:e?e.charAt(0).toUpperCase()+e.slice(1):`Unknown`}}}var u={unknown:2,low:0,medium:1,high:2},d={none:-1,low:0,medium:1,high:2};function f(e,t,n){return e?.toLowerCase()!==`auto`||!n?!0:(u[(t??``).toLowerCase()]??-1)<=(d[n.toLowerCase()]??-1)}function p(e){switch(e){case`trust_rule_allowed`:return`· Auto-approved · Trust rule matched`;case`sandbox_auto_approve`:return null;case`platform_auto_approve`:return`· Auto-approved · Platform session`;default:return null}}function m(e,t){return e===`sandbox_auto_approve`?{displayLevel:`workspace`,inherentRisk:t}:{displayLevel:t??`unknown`}}function h(e,t,n=`…`){return e.length<=t?e:e.slice(0,t-n.length)+n}function g(e){if(!e)return null;let t=e.split(`/`),n=t[t.length-1];return!n||n===`.`?null:n}function _(e,t){return h(e,t,`...`)}function v(e){if(!e)return null;let t=e.replace(/\s+/g,` `).trim().match(/(?:^|&&\s*|\|\|\s*|;\s*)(?:\S*\/)?assistant\s+browser\s+([^\s;&|]+)/i);if(!t)return null;let n=t[1].toLowerCase();return new Set([`navigate`,`click`,`type`,`screenshot`,`snapshot`,`scroll`,`hover`,`select`,`drag`,`wait`,`back`,`forward`,`refresh`,`close`,`tab`,`press_key`,`wait_for`,`extract`,`fill_credential`]).has(n)?n:`unknown`}function y(e,t){let n=e.toLowerCase();return n!==`bash`&&n!==`host_bash`?null:v(t)}function b(e){switch(e){case`navigate`:return`Opened a page`;case`click`:return`Clicked on the page`;case`type`:return`Typed on the page`;case`screenshot`:return`Took a screenshot`;case`snapshot`:return`Captured page snapshot`;case`scroll`:return`Scrolled the page`;case`hover`:return`Hovered on the page`;case`select`:return`Selected on the page`;case`drag`:return`Dragged on the page`;case`wait`:return`Waited for the page`;case`back`:return`Went back`;case`forward`:return`Went forward`;case`refresh`:return`Refreshed the page`;case`close`:return`Closed the tab`;case`tab`:return`Switched tabs`;case`press_key`:return`Pressed a key`;case`wait_for`:return`Waited for a condition`;case`extract`:return`Extracted page content`;case`fill_credential`:return`Filled a credential`;case`unknown`:return`Used the browser`}}function x(e){switch(e){case`navigate`:return`Opening a page`;case`click`:return`Clicking on the page`;case`type`:return`Typing on the page`;case`screenshot`:return`Taking a screenshot`;case`snapshot`:return`Capturing page snapshot`;case`scroll`:return`Scrolling the page`;case`hover`:return`Hovering on the page`;case`select`:return`Selecting on the page`;case`drag`:return`Dragging on the page`;case`wait`:return`Waiting for the page`;case`back`:return`Going back`;case`forward`:return`Going forward`;case`refresh`:return`Refreshing the page`;case`close`:return`Closing the tab`;case`tab`:return`Switching tabs`;case`press_key`:return`Pressing a key`;case`wait_for`:return`Waiting for a condition`;case`extract`:return`Extracting page content`;case`fill_credential`:return`Filling a credential`;case`unknown`:return`Using the browser`}}function S(e){switch(e){case`navigate`:case`back`:case`forward`:case`tab`:return`compass`;case`click`:case`hover`:case`select`:case`drag`:case`scroll`:return`compass`;case`screenshot`:case`snapshot`:return`camera`;case`type`:case`press_key`:case`fill_credential`:return`compass`;case`wait`:case`wait_for`:case`refresh`:case`close`:return`compass`;case`extract`:return`compass`;case`unknown`:return`compass`}}function C(e,t){let n=e.toLowerCase();if(n===`bash`||n===`host_bash`){let e=t.command??t.cmd;if(typeof e==`string`)return e.replace(/\s+/g,` `).trim()}if(n===`file_read`||n===`host_file_read`||n===`file_write`||n===`host_file_write`||n===`file_edit`||n===`host_file_edit`){let e=t.file_path??t.path??t.filePath;if(typeof e==`string`)return e}if(n===`grep`||n===`glob`){let e=t.pattern??t.query;if(typeof e==`string`)return e}if(n===`web_search`){let e=t.query??t.search;if(typeof e==`string`)return e}return``}function w(e,t=``){let n=e.toLowerCase(),r=t.replace(/\s+/g,` `).trim(),i=g(r),a=y(e,r);if(a)return b(a);switch(n){case`bash`:case`host_bash`:return r?`Ran \`${_(r,30)}\``:`Ran a command`;case`file_read`:case`host_file_read`:return i?`Read ${i}`:`Read a file`;case`file_write`:case`host_file_write`:return i?`Wrote ${i}`:`Wrote a file`;case`file_edit`:case`host_file_edit`:return i?`Edited ${i}`:`Edited a file`;case`grep`:return r?`Searched for '${_(r,25)}'`:`Searched files`;case`glob`:return r?`Searched for ${_(r,25)}`:`Found files`;case`web_search`:return r?`Searched '${_(r,25)}'`:`Searched the web`;case`web_fetch`:return`Fetched a webpage`;default:return`Used ${e.replace(/_/g,` `)}`}}function T(e,t=``,n){let r=y(e,t);if(r)return x(r);if(n){let t=e.toLowerCase();if(t===`app_create`||t===`app_refresh`||t===`app_update`)return n}switch(e.toLowerCase()){case`bash`:case`host_bash`:return`Running a command`;case`file_read`:case`host_file_read`:return`Reading a file`;case`file_write`:case`host_file_write`:return`Writing a file`;case`file_edit`:case`host_file_edit`:return`Editing a file`;case`grep`:return`Searching files`;case`glob`:return`Finding files`;case`web_search`:return`Searching the web`;case`web_fetch`:return`Fetching a webpage`;case`app_create`:return`Building your app`;case`app_refresh`:case`app_update`:return`Refreshing your app`;default:return`Running ${e.replace(/_/g,` `)}`}}function E(e){return e.split(/[_-]+/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function D(e,t=``){let n=y(e,t);if(n)return S(n);switch(e.toLowerCase()){case`bash`:case`host_bash`:return`terminal`;case`file_read`:case`host_file_read`:return`file-text`;case`file_write`:case`host_file_write`:return`file-plus`;case`file_edit`:case`host_file_edit`:return`pencil`;case`grep`:case`glob`:case`web_search`:return`search`;case`web_fetch`:return`globe`;default:return`wrench`}}var O=80;function k(e,...t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim().length>0)return t}return``}function A(e){if(!e)return``;let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)}function j(e){if(!e.startsWith(`mcp__`))return null;let t=e.slice(5),n=t.indexOf(`__`);if(n===-1)return null;let r=t.slice(0,n),i=t.slice(n+2);return!r||!i?null:{serverName:r,toolMethod:i}}function M(e,t){let n=t&&typeof t==`object`?t:{},r=e.toLowerCase(),i=k(n,`activity`,`reason`),a=j(e);if(a)return{title:`Using ${a.serverName}`,info:a.toolMethod,activity:i,iconName:`plug`};switch(r){case`bash`:case`host_bash`:return{title:`Working`,info:h(k(n,`command`,`cmd`).replace(/\s+/g,` `).trim(),O),activity:i,iconName:`terminal`};case`str_replace_editor`:case`text_editor`:{let e=k(n,`command`).toLowerCase(),t=A(k(n,`path`,`file_path`,`filePath`));return e===`view`?{title:`Reading`,info:t,activity:i,iconName:`file`}:{title:`Editing`,info:t,activity:i,iconName:`pen`}}case`computer`:return{title:`Using computer`,info:k(n,`action`),activity:i,iconName:`monitor`};case`skill_execute`:{let e=k(n,`tool`);if(e){let t=n.input,r=M(e,t);return{...r,activity:i||r.activity}}return{title:`Using a skill`,info:k(n,`skill`,`name`,`skillName`),activity:i,iconName:`sparkle`}}case`skill`:case`skill_invoke`:case`skill_load`:return{title:`Using a skill`,info:k(n,`skill`,`name`,`skillName`),activity:i,iconName:`sparkle`};case`subagent_spawn`:return{title:`Spawning subagent`,info:k(n,`label`,`objective`,`task`),activity:i,iconName:`user-plus`};default:return{title:e?`Running ${E(e)}`:`Running tool`,info:``,activity:i,iconName:`bolt`}}}function N(e){return M(e.name,e.input)}var P=[{open:`<thinking>`,close:`</thinking>`},{open:`<think>`,close:`</think>`}];function F(e){return P.some(t=>e.includes(t.open))}function I(e){if(!F(e))return null;let t=[],n=e=>{e.trim()&&t.push({type:`text`,text:e})},r=e=>{let n=e.trim();n&&t.push({type:`thinking`,thinking:n})},i=0;for(;;){let a=-1,o;for(let t of P){let n=e.indexOf(t.open,i);n!==-1&&(a===-1||n<a)&&(a=n,o=t)}if(!o)break;n(e.slice(i,a));let s=a+o.open.length,c=e.indexOf(o.close,s);if(c===-1)return r(e.slice(s)),t;r(e.slice(s,c)),i=c+o.close.length}return n(e.slice(i)),t}function L(e){return typeof e.id==`string`&&e.id.length>0}function R(e){return e.some(e=>e.type===`text`&&F(e.text))?e.flatMap(e=>{let t=e.type===`text`?I(e.text):null;return t?t.map(e=>e.type===`thinking`?{type:`thinking`,thinking:e.thinking}:{type:`text`,text:e.text}):[e]}):e}function z(e,t){let n=t?.splitInlineThinking?R(e):e,r=[],i=null,a=()=>(i||(i={type:`activity`,items:[]},r.push(i)),i);for(let e of n)if(e.type===`thinking`){let t=a(),n=t.items[t.items.length-1];n?.type===`thinking`?(n.thinking=n.thinking?`${n.thinking}\n${e.thinking}`:e.thinking,e.startedAt!=null&&(n.startedAt=n.startedAt==null?e.startedAt:Math.min(n.startedAt,e.startedAt)),e.completedAt!=null&&(n.completedAt=n.completedAt==null?e.completedAt:Math.max(n.completedAt,e.completedAt))):t.items.push({type:`thinking`,thinking:e.thinking,startedAt:e.startedAt,completedAt:e.completedAt})}else if(e.type===`tool_use`){if(!L(e.toolCall))continue;a().items.push({type:`tool_use`,toolCall:e.toolCall})}else (e.type===`text`||e.type===`surface`)&&(i=null,r.push(e));return r}function B(e){let t=[],n=[];for(let r of e){if(r.type===`thinking`){r.thinking&&t.push({kind:`thinking`,text:r.thinking,startedAt:r.startedAt,completedAt:r.completedAt});continue}let e=r.toolCall;V(e)||(n.push(e),t.push({kind:`toolCall`,toolCall:e}))}return{cardItems:t,toolCalls:n}}function V(e){return!e.pendingConfirmation&&(e.name===`ui_show`||e.name===`ui_update`||e.name===`ui_dismiss`)}function H(e){if(e.name===`subagent_spawn`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`subagent_spawn`}function U(e){if(e.name===`run_workflow`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`run_workflow`}function W(e){if(e.name===`acp_spawn`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`acp_spawn`}function G(e){if(e.name!==`bash`&&e.name!==`host_bash`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.background===!0}export{r as C,i as S,t as T,s as _,U as a,o as b,M as c,D as d,w as f,p as g,m as h,G as i,C as l,h as m,z as n,H as o,E as p,W as r,N as s,B as t,T as u,l as v,n as w,f as x,c as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-D3ZM-ToX.js";import{t}from"./typography-DEI9Ra9z.js";import"./src-Da9g8qsW.js";import{t as n}from"./paperclip--f908Kg3.js";import{t as r}from"./use-attachment-squares-8Hx-p8ls.js";import{t as i}from"./detail-shell-BjqibXNX.js";import{t as a}from"./use-transcript-message-by-id-
|
|
1
|
+
import{t as e}from"./jsx-runtime-D3ZM-ToX.js";import{t}from"./typography-DEI9Ra9z.js";import"./src-Da9g8qsW.js";import{t as n}from"./paperclip--f908Kg3.js";import{t as r}from"./use-attachment-squares-8Hx-p8ls.js";import{t as i}from"./detail-shell-BjqibXNX.js";import{t as a}from"./use-transcript-message-by-id-BgyP3Ki5.js";var o=[];function s(e){let t=a(e);return t?t.attachments??o:null}var c=e();function l({payload:e,onClose:a}){let{displayAttachments:o,renderSquare:l,previewModal:u}=r({attachments:s(e.messageId)??e.attachments,assistantId:e.assistantId});return(0,c.jsxs)(i,{Glyph:n,titleNode:(0,c.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,c.jsx)(t,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:`Files`}),(0,c.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,c.jsx)(t,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:o.length})]}),closeLabel:`Close files`,onClose:a,children:[o.length===0?(0,c.jsx)(t,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No files on this message`}):(0,c.jsx)(`div`,{className:`flex flex-wrap items-start gap-3`,children:o.map((e,t)=>l(e,t))}),u]})}export{l as MessageFilesPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./capture-error-CqtAGHQu.js";import{t}from"./assistant-identity-store-B51BX78j.js";import{r as n,t as r}from"./semver-Bfq1LtyW.js";import{n as i}from"./api-errors-BRGPPSWw.js";import{Cn as a,Kr as o,Sn as s,Tn as c,Vr as l,u,wn as d}from"./sdk.gen-CjtCuSlS.js";import{n as f}from"./platform-detection-AHYibqOx.js";import{i as p}from"./viewer-store-
|
|
1
|
+
import{t as e}from"./capture-error-CqtAGHQu.js";import{t}from"./assistant-identity-store-B51BX78j.js";import{r as n,t as r}from"./semver-Bfq1LtyW.js";import{n as i}from"./api-errors-BRGPPSWw.js";import{Cn as a,Kr as o,Sn as s,Tn as c,Vr as l,u,wn as d}from"./sdk.gen-CjtCuSlS.js";import{n as f}from"./platform-detection-AHYibqOx.js";import{i as p}from"./viewer-store-DbIS4l8d.js";import{a as m,r as h}from"./prechat-C4MZwKWX.js";import{t as g}from"./effective-timezone-BX46fWmk.js";var _=/^\[File attachment\] (.+?), type=([^,\n]+?)(?:, size=([^\n]+))?$/,v=/^([\d.]+)\s*(B|KB|MB|GB)$/;function y(e){let t=v.exec(e.trim());if(!t)return 0;let n=Number.parseFloat(t[1]);if(!Number.isFinite(n))return 0;switch(t[2]){case`B`:return Math.round(n);case`KB`:return Math.round(n*1024);case`MB`:return Math.round(n*1024*1024);case`GB`:return Math.round(n*1024*1024*1024);default:return 0}}function b(e){let t=e.indexOf(`[File attachment] `);if(t<0||!(t===0||e[t-1]===`
|
|
2
2
|
`))return{cleanedContent:e,attachments:void 0};let n=t>0&&e[t-1]===`
|
|
3
3
|
`?e.slice(0,t-1):e.slice(0,t),r=[];for(let n of e.slice(t).split(`
|
|
4
4
|
`)){let e=_.exec(n);if(!e)continue;let[,t,i,a]=e;r.push({id:`rehydrated:${r.length}`,filename:t,mimeType:i,sizeBytes:a?y(a):0,previewUrl:null,thumbnailUrl:null})}return{cleanedContent:n,attachments:r.length>0?r:void 0}}var x=[`users/guardian.md`,`users/default.md`],S=`## Onboarding Context`;function C(e){let t=[S,``];return e.preferredName&&t.push(`- **Preferred name:** ${e.preferredName}`),e.occupation&&t.push(`- **Role:** ${e.occupation}`),e.commonWork.length>0&&t.push(`- **Common work:** ${e.commonWork.join(`; `)}`),e.dailyTools.length>0&&t.push(`- **Daily tools:** ${e.dailyTools.join(`, `)}`),t.push(``),t.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./is-electron-DIlIrdJX.js";import{A as t,D as n,E as r,j as i}from"./auth-store-
|
|
1
|
+
import{t as e}from"./is-electron-DIlIrdJX.js";import{A as t,D as n,E as r,j as i}from"./auth-store-C9aYqB9U.js";import{Dn as a}from"./sdk.gen-CjtCuSlS.js";import{l as o}from"./native-biometric-DetUqtjl.js";import{o as s}from"./platform-detection-AHYibqOx.js";import{t as c}from"./esm-Jw5qNk7q.js";var l=null,u=!1,d=!1,f=null,p=new Set,m=new Map,h=128;function g(){return typeof window>`u`?!1:e()?!!window.vellum?.notifications:o()?!0:`Notification`in window}async function _(){try{let{display:e}=await c.checkPermissions();return e===`granted`?`granted`:e===`denied`?`denied`:`prompt`}catch{return`unsupported`}}function v(){if(typeof Notification>`u`)return`unsupported`;switch(Notification.permission){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}async function y(){try{let{display:e}=await c.requestPermissions();return e===`granted`?`granted`:e===`denied`?`denied`:`prompt`}catch{return`unsupported`}}async function b(){if(typeof Notification>`u`)return`unsupported`;let e=await Notification.requestPermission();return e===`granted`?`granted`:e===`denied`?`denied`:`prompt`}async function x(){if(l)return l;let e=o()?await _():v();return l=e,e}async function S(){return l=null,x()}async function C(){let e=await x();if(e!==`prompt`||u)return e;u=!0;let t=o()?await y():await b();return l=t,t}async function w(){if(!d){if(d=!0,e()&&window.vellum?.notifications){window.vellum.notifications.onAction(e=>{f&&f({conversationId:e.conversationId,sourceEventName:`electron:${e.category}:${e.kind}`,deliveryId:e.deliveryId})});return}if(o())try{await c.addListener(`localNotificationActionPerformed`,e=>{let t=e.notification.extra;t&&f&&f(t)})}catch{}}}function T(e){f=e,w()}function E(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)%2147483647}async function D(e,t){if(p.has(e))return;let n=m.get(e);n||(n=(async()=>{try{try{await i(),await c.schedule({notifications:[t]})}catch{await i(),await c.schedule({notifications:[t]})}if(p.add(e),p.size>h){let e=p.values().next().value;e&&p.delete(e)}}finally{m.delete(e)}})(),m.set(e,n)),await n}function O(e){if(!e)return;let{conversationId:t}=e;if(typeof t==`string`&&t.length>0)return t}async function k(e,t,n,r){try{let i={deliveryId:t,success:n};r&&(i.errorMessage=r),await a({path:{assistant_id:e},body:i,throwOnError:!1})}catch{}}async function A(r){if(!g()){r.assistantId&&r.deliveryId&&await k(r.assistantId,r.deliveryId,!1,`Notifications not supported on this client`);return}if(e()&&window.vellum?.notifications){let e=!0,t;try{let n=await window.vellum.notifications.show({category:`notificationIntent`,title:r.title,body:r.body,deliveryId:r.deliveryId,conversationId:O(r.deepLinkMetadata),deepLinkMetadata:r.deepLinkMetadata});e=n.success,t=n.errorMessage}catch(n){e=!1,t=n instanceof Error?n.message:String(n)}r.assistantId&&r.deliveryId&&await k(r.assistantId,r.deliveryId,e,t);return}let a=document.visibilityState;if(await C()!==`granted`){r.assistantId&&r.deliveryId&&await k(r.assistantId,r.deliveryId,!1,`Notification authorization denied`);return}let l={conversationId:O(r.deepLinkMetadata),sourceEventName:r.sourceEventName,deliveryId:r.deliveryId},u=!0,d;if(o()){if((r.remotePushPlatforms?r.remotePushPlatforms.includes(s()?`android`:`ios`):!s()&&r.remotePushDispatched===!0)&&r.assistantId!==void 0&&n(r.assistantId)&&a===`hidden`){r.deliveryId&&await k(r.assistantId,r.deliveryId,!0);return}let e={id:E(r.correlationId??r.deliveryId??`${r.sourceEventName}:${r.title}:${r.body}`),title:r.title,body:r.body,extra:l,...s()?{channelId:t}:{}};try{let t=r.correlationId??r.deliveryId;t&&s()?await D(t,e):(await i(),await c.schedule({notifications:[e]}))}catch(e){u=!1,d=e instanceof Error?e.message:String(e)}}else{let e=r.deliveryId??`${r.sourceEventName}:${r.title}:${r.body}`;try{let t=new Notification(r.title,{body:r.body,tag:e,data:l});t.onclick=()=>{window.focus(),f&&f(l),t.close()}}catch(e){u=!1,d=e instanceof Error?e.message:String(e)}}r.assistantId&&r.deliveryId&&await k(r.assistantId,r.deliveryId,u,d)}function j(e){if(!s())return;let t=typeof e.data==`object`&&e.data!==null?e.data:{},n=typeof t.delivery_id==`string`?t.delivery_id:e.id,i=typeof t.source_event_name==`string`?t.source_event_name:`remote_push`,a=r(t);A({title:e.title??`Vellum`,body:e.body??``,sourceEventName:i,deliveryId:n,correlationId:n,deepLinkMetadata:a?{conversationId:a}:void 0})}export{S as a,A as i,x as n,k as o,j as r,T as s,O as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CqtAGHQu.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-Dy5001j6.js";import{n as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as a}from"./QueryClientProvider-CMu7CkQU.js";import{t as o}from"./useQuery-Bz-fbQ-m.js";import{t as s}from"./useMutation-CXGTrp4W.js";import{t as c}from"./jsx-runtime-D3ZM-ToX.js";import{t as l}from"./card-DRIctGVs.js";import{t as u}from"./createLucideIcon-CAM1RhH8.js";import{t as d}from"./bell-2SnK9BVD.js";import{t as f}from"./check-Dt2rQhdg.js";import{t as p}from"./menu-wESJw6y3.js";import{t as m}from"./loader-circle-DWWXcfTQ.js";import{t as h}from"./moon-CHW45huN.js";import{t as g}from"./triangle-alert-D6bAGtMw.js";import{t as _}from"./notice-Dslxs3H6.js";import{t as v}from"./popover-B-3isZCV.js";import{t as y}from"./input-tXUFa7Eo.js";import{n as b,t as x}from"./panel-item-CJh95P_q.js";import{n as S}from"./toast-BtFgiPe3.js";import{i as C,t as w}from"./dist-an0Z446E.js";import{d as T}from"./routes-DrfnNoYS.js";import{d as E,o as D}from"./platform-detection-AHYibqOx.js";import{i as O,r as k,t as A}from"./use-platform-gate-B_3hHMqw.js";import{t as j}from"./use-bus-subscription-DiCq1_ki.js";import{n as M}from"./use-is-mobile-MmHo-OM6.js";import{a as N,n as P}from"./notifications-rSx7pNPi.js";import{Ct as F,St as I,_t as L,bt as R,vt as z,xt as B,yt as V}from"./react-query.gen-BtYBixpk.js";import{t as H}from"./platform-login-notice-q7ZuGeuo.js";import{r as U}from"./format-date-CQUMvfqf.js";import{t as W}from"./mutation-error-YLfUU5XL.js";var G=u(`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`}]]),K=u(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),q=e(n(),1),J=C(`AndroidNotificationSettings`);function Y(){return D()&&w.isPluginAvailable(`AndroidNotificationSettings`)}async function ee(){if(Y())try{await J.open()}catch(e){t(e,{context:`android_notification_settings_open`,level:`warning`})}}var X=c();function te(){let e=E(),t=Y(),[n,i]=(0,q.useState)(null);return(0,q.useEffect)(()=>{e&&P().then(i)},[e]),j(`app.resume`,()=>{e&&N().then(i)}),e?(0,X.jsxs)(l,{className:`flex items-center gap-3`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Native alerts`}),(0,X.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:n===`granted`?`Enabled for this device.`:`Receive alerts when the app is closed.`})]}),t&&(0,X.jsx)(r,{variant:`outlined`,size:`regular`,onClick:()=>void ee(),disabled:n===null,children:`System settings`})]}):null}function Z(e){e.invalidateQueries({queryKey:V()}),e.invalidateQueries({queryKey:F()})}function ne(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var Q=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}];function re({notificationId:e,currentlySnoozed:t,children:n}){let r=a(),i=s(I()),o=M(),[c,l]=(0,q.useState)(!1),u=()=>Z(r),d=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();i.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:u,onError:W(`Failed to snooze notification`)})},f=()=>{i.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:u,onError:W(`Failed to clear snooze`)})};return o?(0,X.jsxs)(b.Root,{open:c,onOpenChange:l,children:[(0,X.jsx)(b.Trigger,{asChild:!0,children:n}),(0,X.jsxs)(b.Content,{children:[(0,X.jsx)(b.Header,{children:(0,X.jsx)(b.Title,{children:`Snooze until…`})}),(0,X.jsxs)(b.Body,{children:[Q.map(({label:e,hours:t})=>(0,X.jsx)(x,{label:e,onSelect:()=>{i.isPending||(l(!1),d(t))}},e)),t&&(0,X.jsx)(x,{label:`Clear snooze`,onSelect:()=>{i.isPending||(l(!1),f())}})]})]})]}):(0,X.jsxs)(p.Root,{open:c,onOpenChange:l,children:[(0,X.jsx)(p.Trigger,{children:n}),(0,X.jsxs)(p.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,X.jsx)(p.Label,{children:`Snooze until…`}),Q.map(({label:e,hours:t})=>(0,X.jsx)(p.Item,{disabled:i.isPending,onSelect:()=>d(t),children:e},e)),t&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(p.Separator,{}),(0,X.jsx)(p.Item,{disabled:i.isPending,onSelect:()=>f(),children:`Clear snooze`})]})]})]})}function $({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:r,hideTitle:i=!1}){let o=a(),c=s(R()),l=s(B()),[u,d]=(0,q.useState)(``),f=()=>Z(o),p=()=>{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:W(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{r(e),f(),t()},onError:W(`Failed to resume alerts`)})},g=c.isPending||l.isPending;return(0,X.jsxs)(`div`,{children:[!i&&(0,X.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,X.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,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,X.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,U(e.expires_at)]})]}),(0,X.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,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,X.jsx)(y,{type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`Reason (optional)`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>p(),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,X.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,X.jsx)(m,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function ie({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=ne(e),a=!e.is_read;return(0,X.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,X.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,X.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,X.jsx)(g,{className:`h-3 w-3`}),`Alert`]}),i&&(0,X.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,X.jsx)(h,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,X.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,X.jsx)(f,{className:`h-3 w-3`}),`Resolved`]})]}),(0,X.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,X.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,X.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,X.jsxs)(`span`,{children:[`Last seen `,U(e.last_seen_at)]}),e.occurrence_count>1&&(0,X.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,X.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,X.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,X.jsx)(m,{className:`h-3 w-3 animate-spin`}):(0,X.jsx)(f,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,X.jsx)(re,{notificationId:e.id,currentlySnoozed:i,children:(0,X.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,X.jsx)(h,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function ae(){let e=O({platformHostedOnly:!0}),t=A(),n=k(),r=a(),c=M(),[l,u]=(0,q.useState)(`open`),[f,p]=(0,q.useState)(!1),[h,g]=(0,q.useState)([]),{data:y,isLoading:x,isError:C,refetch:w}=o({...z({query:{status:l}}),enabled:e===`full`&&t}),E=e===`full`&&n||(t?x:!1);(0,q.useEffect)(()=>{!t&&f&&p(!1)},[t,f]);let D=t?C:!1,j=t?y?.results??[]:[],N=j.filter(e=>!e.is_read&&!e.is_resolved),P=s(L()),[F,I]=(0,q.useState)(new Set),[R,B]=(0,q.useState)(!1),V=(0,q.useCallback)(()=>Z(r),[r]),U=async(e,t)=>{I(t=>new Set(t).add(e));try{await P.mutateAsync({path:{id:e},body:{acknowledged:t}}),V()}catch(e){S.error(e instanceof Error?e.message:`Failed to update notification`)}finally{I(t=>{let n=new Set(t);return n.delete(e),n})}},W=async()=>{if(!(N.length===0||R)){B(!0);try{await Promise.allSettled(N.map(e=>P.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{V(),B(!1)}}},J=(0,X.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,X.jsx)(G,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),Y=(0,X.jsx)($,{existingRules:h,onClose:()=>p(!1),onPauseCreated:e=>g(t=>[...t,e]),onPauseDeleted:e=>g(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,X.jsx)(i,{replace:!0,to:T.settings.general}):e===`disabled`?(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(d,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,X.jsxs)(`div`,{className:`flex-1`,children:[(0,X.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,X.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,X.jsx)(H,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(d,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,X.jsxs)(`div`,{className:`flex-1`,children:[(0,X.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,X.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(c?(0,X.jsxs)(b.Root,{open:f,onOpenChange:p,children:[(0,X.jsx)(b.Trigger,{asChild:!0,children:J}),(0,X.jsxs)(b.Content,{children:[(0,X.jsx)(b.Header,{children:(0,X.jsx)(b.Title,{children:`Pause alerts`})}),(0,X.jsx)(b.Body,{children:(0,X.jsx)($,{existingRules:h,onClose:()=>p(!1),onPauseCreated:e=>g(t=>[...t,e]),onPauseDeleted:e=>g(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,X.jsxs)(v.Root,{open:f,onOpenChange:p,children:[(0,X.jsx)(v.Trigger,{asChild:!0,children:J}),(0,X.jsx)(v.Content,{align:`end`,className:`w-72`,children:Y})]}))]}),(0,X.jsx)(te,{}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.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=l===e;return(0,X.jsx)(`button`,{type:`button`,onClick:()=>u(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)})}),l===`open`&&N.length>1&&(0,X.jsxs)(`button`,{type:`button`,onClick:()=>void W(),disabled:R,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:[R?(0,X.jsx)(m,{className:`h-3 w-3 animate-spin`}):(0,X.jsx)(K,{className:`h-3 w-3`}),`Mark all as read (`,N.length,`)`]})]}),E?(0,X.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,X.jsx)(m,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):D?(0,X.jsxs)(_,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,X.jsx)(`button`,{type:`button`,onClick:()=>void w(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):j.length===0?(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,X.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,X.jsx)(d,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,X.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,l,` notifications`]}),(0,X.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:l===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,X.jsx)(`div`,{className:`space-y-3`,children:j.map(e=>(0,X.jsx)(ie,{notification:e,onAck:(e,t)=>void U(e,t),isAcking:F.has(e.id)},e.id))})]})}export{ae as NotificationsPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CqtAGHQu.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-Dy5001j6.js";import{n as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as a}from"./QueryClientProvider-CMu7CkQU.js";import{t as o}from"./useQuery-Bz-fbQ-m.js";import{t as s}from"./useMutation-CXGTrp4W.js";import{t as c}from"./jsx-runtime-D3ZM-ToX.js";import{t as l}from"./card-DRIctGVs.js";import{t as u}from"./createLucideIcon-CAM1RhH8.js";import{t as d}from"./bell-2SnK9BVD.js";import{t as f}from"./check-Dt2rQhdg.js";import{t as p}from"./menu-wESJw6y3.js";import{t as m}from"./loader-circle-DWWXcfTQ.js";import{t as h}from"./moon-CHW45huN.js";import{t as g}from"./triangle-alert-D6bAGtMw.js";import{t as _}from"./notice-Dslxs3H6.js";import{t as v}from"./popover-B-3isZCV.js";import{t as y}from"./input-tXUFa7Eo.js";import{n as b,t as x}from"./panel-item-CJh95P_q.js";import{n as S}from"./toast-BtFgiPe3.js";import{i as C,t as w}from"./dist-an0Z446E.js";import{d as T}from"./routes-DrfnNoYS.js";import{d as E,o as D}from"./platform-detection-AHYibqOx.js";import{i as O,r as k,t as A}from"./use-platform-gate-C5bNA5Pn.js";import{t as j}from"./use-bus-subscription-DiCq1_ki.js";import{n as M}from"./use-is-mobile-MmHo-OM6.js";import{a as N,n as P}from"./notifications-BTG4cTbF.js";import{Ct as F,St as I,_t as L,bt as R,vt as z,xt as B,yt as V}from"./react-query.gen-BtYBixpk.js";import{t as H}from"./platform-login-notice-DFmjUE9q.js";import{r as U}from"./format-date-CQUMvfqf.js";import{t as W}from"./mutation-error-YLfUU5XL.js";var G=u(`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`}]]),K=u(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),q=e(n(),1),J=C(`AndroidNotificationSettings`);function Y(){return D()&&w.isPluginAvailable(`AndroidNotificationSettings`)}async function ee(){if(Y())try{await J.open()}catch(e){t(e,{context:`android_notification_settings_open`,level:`warning`})}}var X=c();function te(){let e=E(),t=Y(),[n,i]=(0,q.useState)(null);return(0,q.useEffect)(()=>{e&&P().then(i)},[e]),j(`app.resume`,()=>{e&&N().then(i)}),e?(0,X.jsxs)(l,{className:`flex items-center gap-3`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Native alerts`}),(0,X.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:n===`granted`?`Enabled for this device.`:`Receive alerts when the app is closed.`})]}),t&&(0,X.jsx)(r,{variant:`outlined`,size:`regular`,onClick:()=>void ee(),disabled:n===null,children:`System settings`})]}):null}function Z(e){e.invalidateQueries({queryKey:V()}),e.invalidateQueries({queryKey:F()})}function ne(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var Q=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}];function re({notificationId:e,currentlySnoozed:t,children:n}){let r=a(),i=s(I()),o=M(),[c,l]=(0,q.useState)(!1),u=()=>Z(r),d=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();i.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:u,onError:W(`Failed to snooze notification`)})},f=()=>{i.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:u,onError:W(`Failed to clear snooze`)})};return o?(0,X.jsxs)(b.Root,{open:c,onOpenChange:l,children:[(0,X.jsx)(b.Trigger,{asChild:!0,children:n}),(0,X.jsxs)(b.Content,{children:[(0,X.jsx)(b.Header,{children:(0,X.jsx)(b.Title,{children:`Snooze until…`})}),(0,X.jsxs)(b.Body,{children:[Q.map(({label:e,hours:t})=>(0,X.jsx)(x,{label:e,onSelect:()=>{i.isPending||(l(!1),d(t))}},e)),t&&(0,X.jsx)(x,{label:`Clear snooze`,onSelect:()=>{i.isPending||(l(!1),f())}})]})]})]}):(0,X.jsxs)(p.Root,{open:c,onOpenChange:l,children:[(0,X.jsx)(p.Trigger,{children:n}),(0,X.jsxs)(p.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,X.jsx)(p.Label,{children:`Snooze until…`}),Q.map(({label:e,hours:t})=>(0,X.jsx)(p.Item,{disabled:i.isPending,onSelect:()=>d(t),children:e},e)),t&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(p.Separator,{}),(0,X.jsx)(p.Item,{disabled:i.isPending,onSelect:()=>f(),children:`Clear snooze`})]})]})]})}function $({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:r,hideTitle:i=!1}){let o=a(),c=s(R()),l=s(B()),[u,d]=(0,q.useState)(``),f=()=>Z(o),p=()=>{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:W(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{r(e),f(),t()},onError:W(`Failed to resume alerts`)})},g=c.isPending||l.isPending;return(0,X.jsxs)(`div`,{children:[!i&&(0,X.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,X.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,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,X.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,U(e.expires_at)]})]}),(0,X.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,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,X.jsx)(y,{type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`Reason (optional)`}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>p(),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,X.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,X.jsx)(m,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function ie({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=ne(e),a=!e.is_read;return(0,X.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,X.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,X.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,X.jsx)(g,{className:`h-3 w-3`}),`Alert`]}),i&&(0,X.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,X.jsx)(h,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,X.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,X.jsx)(f,{className:`h-3 w-3`}),`Resolved`]})]}),(0,X.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,X.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,X.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,X.jsxs)(`span`,{children:[`Last seen `,U(e.last_seen_at)]}),e.occurrence_count>1&&(0,X.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,X.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,X.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,X.jsx)(m,{className:`h-3 w-3 animate-spin`}):(0,X.jsx)(f,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,X.jsx)(re,{notificationId:e.id,currentlySnoozed:i,children:(0,X.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,X.jsx)(h,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function ae(){let e=O({platformHostedOnly:!0}),t=A(),n=k(),r=a(),c=M(),[l,u]=(0,q.useState)(`open`),[f,p]=(0,q.useState)(!1),[h,g]=(0,q.useState)([]),{data:y,isLoading:x,isError:C,refetch:w}=o({...z({query:{status:l}}),enabled:e===`full`&&t}),E=e===`full`&&n||(t?x:!1);(0,q.useEffect)(()=>{!t&&f&&p(!1)},[t,f]);let D=t?C:!1,j=t?y?.results??[]:[],N=j.filter(e=>!e.is_read&&!e.is_resolved),P=s(L()),[F,I]=(0,q.useState)(new Set),[R,B]=(0,q.useState)(!1),V=(0,q.useCallback)(()=>Z(r),[r]),U=async(e,t)=>{I(t=>new Set(t).add(e));try{await P.mutateAsync({path:{id:e},body:{acknowledged:t}}),V()}catch(e){S.error(e instanceof Error?e.message:`Failed to update notification`)}finally{I(t=>{let n=new Set(t);return n.delete(e),n})}},W=async()=>{if(!(N.length===0||R)){B(!0);try{await Promise.allSettled(N.map(e=>P.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{V(),B(!1)}}},J=(0,X.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,X.jsx)(G,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),Y=(0,X.jsx)($,{existingRules:h,onClose:()=>p(!1),onPauseCreated:e=>g(t=>[...t,e]),onPauseDeleted:e=>g(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,X.jsx)(i,{replace:!0,to:T.settings.general}):e===`disabled`?(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(d,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,X.jsxs)(`div`,{className:`flex-1`,children:[(0,X.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,X.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,X.jsx)(H,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(d,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,X.jsxs)(`div`,{className:`flex-1`,children:[(0,X.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,X.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(c?(0,X.jsxs)(b.Root,{open:f,onOpenChange:p,children:[(0,X.jsx)(b.Trigger,{asChild:!0,children:J}),(0,X.jsxs)(b.Content,{children:[(0,X.jsx)(b.Header,{children:(0,X.jsx)(b.Title,{children:`Pause alerts`})}),(0,X.jsx)(b.Body,{children:(0,X.jsx)($,{existingRules:h,onClose:()=>p(!1),onPauseCreated:e=>g(t=>[...t,e]),onPauseDeleted:e=>g(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,X.jsxs)(v.Root,{open:f,onOpenChange:p,children:[(0,X.jsx)(v.Trigger,{asChild:!0,children:J}),(0,X.jsx)(v.Content,{align:`end`,className:`w-72`,children:Y})]}))]}),(0,X.jsx)(te,{}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.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=l===e;return(0,X.jsx)(`button`,{type:`button`,onClick:()=>u(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)})}),l===`open`&&N.length>1&&(0,X.jsxs)(`button`,{type:`button`,onClick:()=>void W(),disabled:R,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:[R?(0,X.jsx)(m,{className:`h-3 w-3 animate-spin`}):(0,X.jsx)(K,{className:`h-3 w-3`}),`Mark all as read (`,N.length,`)`]})]}),E?(0,X.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,X.jsx)(m,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):D?(0,X.jsxs)(_,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,X.jsx)(`button`,{type:`button`,onClick:()=>void w(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):j.length===0?(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,X.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,X.jsx)(d,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,X.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,l,` notifications`]}),(0,X.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:l===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,X.jsx)(`div`,{className:`space-y-3`,children:j.map(e=>(0,X.jsx)(ie,{notification:e,onAck:(e,t)=>void U(e,t),isAcking:F.has(e.id)},e.id))})]})}export{ae as NotificationsPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-SchRo2Ae.js","assets/chunk-jRWAZmH_.js","assets/preload-helper-Cv2QeVDK.js","assets/api-pN-AgY8Q.js","assets/local-mode-DHueA-BJ.js","assets/is-electron-DIlIrdJX.js","assets/create-selectors-BfxF8Sx_.js","assets/react-BFJW0bSv.js","assets/local-settings-Bx7FsNo5.js","assets/api-CGsj1Pig.js","assets/sdk.gen-ies09CqM.js","assets/client.gen-Dq2brHDV.js","assets/sdk.gen-CjtCuSlS.js","assets/api-errors-BRGPPSWw.js","assets/use-assistant-avatar-Bjqx8JUy.js","assets/utils-DtVy-_pB.js","assets/assistant-identity-store-B51BX78j.js","assets/semver-Bfq1LtyW.js","assets/QueryClientProvider-CMu7CkQU.js","assets/jsx-runtime-D3ZM-ToX.js","assets/useQuery-Bz-fbQ-m.js","assets/use-ios-app-nudge-CadXZRJC.js","assets/funnel-events-B9hFLlxs.js","assets/prefs-CfRaGUUx.js","assets/onboarding-store-BiTZenvP.js","assets/device-settings-CUIsZfaf.js","assets/consent-logPJwKV.js","assets/ingest-BzFSv_f8.js","assets/client-identity-BZBfwdGQ.js","assets/platform-detection-AHYibqOx.js","assets/native-biometric-DetUqtjl.js","assets/native-deep-link-jXO4XsVj.js","assets/domains-Cwi5sL0m.js","assets/routes-DrfnNoYS.js","assets/dist-an0Z446E.js","assets/use-bus-subscription-DiCq1_ki.js","assets/event-bus-CbDg1VDt.js","assets/client-feature-flag-store-Cw39NfCq.js","assets/feature-flag-catalog-CpyCubJW.js","assets/theme-preferences-B2X7Xgir.js","assets/typed-storage-OO7emDaU.js","assets/button-Dy5001j6.js","assets/cn-CJf7MmLX.js","assets/bundle-mjs-BQxDdOEo.js","assets/checkbox-PU47Djxg.js","assets/createLucideIcon-CAM1RhH8.js","assets/check-Dt2rQhdg.js","assets/typography-DEI9Ra9z.js","assets/src-Da9g8qsW.js","assets/dist-C68qFSny.js","assets/dist-EanpjdWC.js","assets/menu-wESJw6y3.js","assets/Combination-CWTYp834.js","assets/chevron-right-CANAtgGn.js","assets/popover-B-3isZCV.js","assets/toast-BtFgiPe3.js","assets/circle-alert-DQMH8VJH.js","assets/circle-check-DvrCdroD.js","assets/info-DkhVkzmK.js","assets/x-D4O9yIS7.js","assets/panel-item-CJh95P_q.js","assets/dist-BDdp8zqz.js","assets/card-DRIctGVs.js","assets/confirm-dialog-j9o2h3xs.js","assets/loader-circle-DWWXcfTQ.js","assets/triangle-alert-D6bAGtMw.js","assets/modal-xr_vw1ZO.js","assets/dropdown-B3FHWc_n.js","assets/chevron-down-BNidRDh1.js","assets/input-tXUFa7Eo.js","assets/notice-Dslxs3H6.js","assets/progress-bar-3GUUAhXi.js","assets/tag-gOOX7fbA.js","assets/toggle-BEPV0rQM.js","assets/src-CfUWwwYf.css","assets/use-sticky-profiles-DamFnjb1.js","assets/voice-list-yvKUrPIf.js","assets/react-query.gen-C7om930f.js","assets/useMutation-CXGTrp4W.js","assets/infiniteQueryOptions-CqLc14_4.js","assets/queryOptions-CMSBCFOf.js","assets/use-is-org-ready-Df3qfx4p.js","assets/auth-store-CWJoXmMk.js","assets/remote-gateway-session-C8pRadB2.js","assets/capture-error-CqtAGHQu.js","assets/resolved-assistants-store-C6oDdTxB.js","assets/square-DTFrgbZb.js","assets/volume-2-BXDl4IEg.js","assets/use-platform-gate-B_3hHMqw.js","assets/search-DL-2uX3K.js","assets/identity-BplXBnQ5.js","assets/runtime-upgrade-banner-BhPmj3_g.js","assets/react-query.gen-BtYBixpk.js","assets/local-runtime-upgrade-BvHY1msh.js","assets/diagnostics-DykDXmF3.js","assets/misc-BBsGq1IU.js","assets/cloud-off-BFACQbO0.js","assets/moon-CHW45huN.js","assets/refresh-cw-EZQqnaxp.js","assets/wrench-DhynFba1.js","assets/chunk-5KNZJZUH-Bsoom5--.js","assets/retire-confirm-dialog-CgvcI85l.js","assets/navigation-resolver-CzEY-5nE.js","assets/research-onboarding-persistence-DwV372yy.js","assets/build-state-dDRg651i.js","assets/use-command-palette-sections-DvMBAWZC.js","assets/chat-Dy2BC2i1.js","assets/haptics-C4p_Rjba.js","assets/calendar-qrPKlf1H.js","assets/globe-CdLn4IX7.js","assets/layout-grid-Ct4RT2Ea.js","assets/message-square-CHUvAEY9.js","assets/monitor-RX4oi4Nj.js","assets/settings-6_RIT4kT.js","assets/add-credential-modal-4zzd0MPK.js","assets/use-active-assistant-id-JLsAfn3e.js","assets/key-round-BFkuiQGH.js","assets/app-card-CiARsZNb.js","assets/edge-swipe-arbiter-store-BwC23ScO.js","assets/viewer-store-Cp5tMX-G.js","assets/workspace-path-links-vDBIljq_.js","assets/pointer-CQ4DXHXb.js","assets/sandbox-bridge-B5H4c27m.js","assets/external-link-GPGZ1LGU.js","assets/puzzle-4NgH5snP.js","assets/use-edit-app-DOmv9zsZ.js","assets/use-is-mobile-MmHo-OM6.js","assets/conversation-store-CTMy9QPV.js","assets/edit-chat-session-DVzLQLWl.js","assets/chevron-up-DofScvyy.js","assets/minimize-2-Dj9FY4aF.js","assets/pencil-Cm5DdeRM.js","assets/avatar-renderer-TpNgmnU1.js","assets/avatar-svg-compositor-axSwKFvf.js","assets/animated-avatar-B0vCEKkY.js","assets/use-reduced-motion-fR0m_opJ.js","assets/proxy-DrtKRLtr.js","assets/chat-avatar-B5fx9Xm3.js","assets/sound-manager-Bv6Sc7Ut.js","assets/detail-shell-BjqibXNX.js","assets/apple-logo-BOBq3-Sn.js","assets/use-discord-nudge-DED9TaIm.js","assets/middleware-Bxr-mmHu.js","assets/integration-icon-B1G4FQT2.js","assets/public-asset-OTnPMErp.js","assets/chat-layout-slots-store-DP8MgnXi.js","assets/document-viewer-container-iB63ww7P.js","assets/use-local-file-info-D2-ycwyJ.js","assets/circle-check-big-DtV6IJuh.js","assets/download-Cnb8zZrK.js","assets/file-text-CwGsMgaa.js","assets/message-square-text-CN_v46So.js","assets/send-Bdmy_GSE.js","assets/trash-2-DfVRfykB.js","assets/user-DHC7OLPE.js","assets/not-found-Bh7ZsdAo.js","assets/arrow-left-W84B6oJL.js","assets/sparkles-DfEFn3Bh.js","assets/platform-login-notice-q7ZuGeuo.js","assets/use-onboarding-login-V-vR-6Zd.js","assets/login-flow-DmQTk-x9.js","assets/log-in-D4nsqRbG.js","assets/slack-setup-wizard-DPzdheN0.js","assets/use-copy-to-clipboard-RUBxQIiE.js","assets/clipboard-copy-BYpgEh2O.js","assets/voice-providers-note-Ck7hNTfp.js","assets/use-save-twilio-credentials-yqA7lnzq.js","assets/sdk.gen-BpJ1vF7l.js","assets/mail-DyUf40pu.js","assets/message-circle-ByXBaIaq.js","assets/acp-run-store-DdzY8U9Y.js","assets/by-tool-use-id-index-CUFuQqHz.js","assets/optimistic-lifecycle-GoMZsAsc.js","assets/messages-QgGSiklY.js","assets/prechat-C4MZwKWX.js","assets/effective-timezone-BX46fWmk.js","assets/browser-timezone-Br-HawKV.js","assets/background-task-store-DpOSZFT8.js","assets/use-transcript-messages-CgESPWZ3.js","assets/use-attachment-preview-CQjpDfsc.js","assets/file-markdown-DnVLY_b_.js","assets/pdf-preview-pscVmtvX.js","assets/chevron-left-CrxnPze-.js","assets/file-DOePafLU.js","assets/acp-run-actions-zSUs8U3N.js","assets/code-D6SOwRrI.js","assets/background-task-actions-762wxVkT.js","assets/risk-Bnj8QXuk.js","assets/transcript-message-body-shared-DkwwIkg0.js","assets/site-favicon-FokoB0J2.js","assets/three-dot-indicator-CeTxs9-J.js","assets/AnimatePresence-CHo6D7IH.js","assets/brain-CN4zzNgU.js","assets/user-plus-DjxxnQ8G.js","assets/subagent-store-DibRR9Ij.js","assets/copy-to-clipboard-DgY-nZpm.js","assets/circle-x-DTjJzoQl.js","assets/file-plus-DjC7wnGp.js","assets/terminal-BucMVaPU.js","assets/use-attachment-squares-8Hx-p8ls.js","assets/archive-BQ3zdIPv.js","assets/chat-markdown-message-Da34digC.js","assets/workspace-tree-query-Dfkrp_rV.js","assets/native-file-B71h3csB.js","assets/browser-CcdNg0HN.js","assets/native-anchor-D1Sy2PbD.js","assets/ellipsis-C5fQnusC.js","assets/eye-off-DQ4xakzN.js","assets/eye-B_jBDDRn.js","assets/preview-skeleton-Biw3dosM.js","assets/surface-parse-helpers-iPHZ9D7N.js","assets/conversation-navigation-BqoIExAQ.js","assets/workflow-store-zCcRcvi8.js","assets/workflow-status-D0bBEpGp.js","assets/conversation-selection-CJs3Fnse.js","assets/use-subagent-card-data-B31LofB3.js","assets/access-DRXEXX07.js","assets/assistant-feature-flag-store-BvLDPeej.js","assets/research-results-view-BFZFPpev.js","assets/research-facts-BUfgocIh.js","assets/ban-BKp90l-0.js","assets/utils-3IBGVjNS.js","assets/format-date-CQUMvfqf.js","assets/bell-2SnK9BVD.js","assets/clock-DeynsyYL.js","assets/list-D2LnQ7lS.js","assets/rotate-ccw-CL6IkaAI.js","assets/shield-check-CNsbiH1v.js","assets/invalidate-memory-queries-DonPN3eH.js","assets/get-memory-stats-BnRGtUPT.js","assets/invalidate-plugin-queries-B0OpJSUW.js","assets/first-run-scope-CXWfJKeP.js","assets/oauth-connection-utils-BrGz4Zc5.js","assets/oauth-popup-DAMkjCsP.js","assets/onboarding-layout-iPzXbZk1.js","assets/settings-navigation-DNl4C8Cc.js","assets/hard-navigate-BYoBFmE4.js","assets/use-supports-bookmarks-DwTpI8uM.js","assets/bug-DdmWJIkz.js","assets/chart-column-k8S2UYq8.js","assets/sliders-horizontal-BwdOIxz8.js","assets/mic-BZZo0R22.js","assets/users-OcC3p9Jn.js","assets/workspace-theme-tokens-dJKcMIdP.js","assets/conversation-queries-Dcm9S7mz.js","assets/conversation-list-fetchers-C6W8PkvR.js","assets/use-app-theme-yiZ38i4_.js","assets/use-assistant-capability-CnI3VItU.js","assets/use-avatar-accent-var-BafXGBXW.js","assets/avatar-bundled-components-BvKt7I7O.js","assets/use-bookmarks-DO9wmU-2.js","assets/use-edge-swipe-CRkrRNLg.js","assets/use-swipe-engine-Bkqjs1Zk.js","assets/plugins-surface-C_pFzsVo.js","assets/android-consumption-only-D3L1Nc41.js","assets/installed-plugins-query-3ACToZeY.js","assets/doctor-handoff-store-CvOwsVRo.js","assets/threshold-presets-B-RqvhUM.js","assets/shield-CAWgGAqm.js","assets/trust-rules-api-Dbyz25hE.js","assets/dictation-overlay-CnPWVnXc.js","assets/notifications-rSx7pNPi.js","assets/esm-Jw5qNk7q.js","assets/deploy-store-BDIOP-i9.js","assets/avatar-subagent-tkmKhEWI.js","assets/avatar-tone-D99t9DAP.js","assets/conversation-cache-D1AJdwZd.js","assets/external-urls-BL9qY0s8.js","assets/eye-bbox-CRs175_n.js","assets/use-bundled-avatar-components-BcyasJwu.js","assets/use-effective-timezone-BM5B7KHp.js","assets/useInfiniteQuery-Dk8q0n49.js","assets/arrow-down-to-line-DMGjBlMw.js","assets/arrow-right-ChqGeAaW.js","assets/arrow-up-CWzHzcyU.js","assets/upload-DsWG9TbD.js","assets/circle-minus-BBDKV6k6.js","assets/cloud-q4J30bVb.js","assets/coins-CcTuNVlN.js","assets/target-CJU4DUFo.js","assets/dices-C3diFTyP.js","assets/file-code-CrtJR2ax.js","assets/video-Dtwi0MD9.js","assets/folder-_l8GIyQp.js","assets/hard-drive-sI2ZzmqM.js","assets/heart-DFD4eqW-.js","assets/inbox-OC3STytq.js","assets/laptop-BGOychmC.js","assets/lightbulb-NdZMkb6Y.js","assets/link-DOobzBVg.js","assets/log-out-CF9mMMsz.js","assets/paperclip--f908Kg3.js","assets/play-Dh6Bw5AP.js","assets/plus-EJu6s6xR.js","assets/smartphone-CIrxb2NM.js","assets/sun-BauGiwdK.js","assets/workflow-Bsy5y3W0.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./preload-helper-Cv2QeVDK.js";import{d as t}from"./routes-DrfnNoYS.js";async function n(n){let{router:r}=await e(async()=>{let{router:e}=await import(`./routes-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-uGHUgv4F.js","assets/chunk-jRWAZmH_.js","assets/preload-helper-Cv2QeVDK.js","assets/api-pN-AgY8Q.js","assets/local-mode-DHueA-BJ.js","assets/is-electron-DIlIrdJX.js","assets/create-selectors-BfxF8Sx_.js","assets/react-BFJW0bSv.js","assets/local-settings-Bx7FsNo5.js","assets/api-CGsj1Pig.js","assets/sdk.gen-ies09CqM.js","assets/client.gen-Dq2brHDV.js","assets/sdk.gen-CjtCuSlS.js","assets/api-errors-BRGPPSWw.js","assets/use-assistant-avatar-Bjqx8JUy.js","assets/utils-DtVy-_pB.js","assets/assistant-identity-store-B51BX78j.js","assets/semver-Bfq1LtyW.js","assets/QueryClientProvider-CMu7CkQU.js","assets/jsx-runtime-D3ZM-ToX.js","assets/useQuery-Bz-fbQ-m.js","assets/use-ios-app-nudge-CadXZRJC.js","assets/funnel-events-B9hFLlxs.js","assets/prefs-CfRaGUUx.js","assets/onboarding-store-BiTZenvP.js","assets/device-settings-CUIsZfaf.js","assets/consent-logPJwKV.js","assets/ingest-BzFSv_f8.js","assets/client-identity-BZBfwdGQ.js","assets/platform-detection-AHYibqOx.js","assets/native-biometric-DetUqtjl.js","assets/native-deep-link-jXO4XsVj.js","assets/domains-Cwi5sL0m.js","assets/routes-DrfnNoYS.js","assets/dist-an0Z446E.js","assets/use-bus-subscription-DiCq1_ki.js","assets/event-bus-CbDg1VDt.js","assets/client-feature-flag-store-Cw39NfCq.js","assets/feature-flag-catalog-CpyCubJW.js","assets/theme-preferences-B2X7Xgir.js","assets/typed-storage-OO7emDaU.js","assets/button-Dy5001j6.js","assets/cn-CJf7MmLX.js","assets/bundle-mjs-BQxDdOEo.js","assets/checkbox-PU47Djxg.js","assets/createLucideIcon-CAM1RhH8.js","assets/check-Dt2rQhdg.js","assets/typography-DEI9Ra9z.js","assets/src-Da9g8qsW.js","assets/dist-C68qFSny.js","assets/dist-EanpjdWC.js","assets/menu-wESJw6y3.js","assets/Combination-CWTYp834.js","assets/chevron-right-CANAtgGn.js","assets/popover-B-3isZCV.js","assets/toast-BtFgiPe3.js","assets/circle-alert-DQMH8VJH.js","assets/circle-check-DvrCdroD.js","assets/info-DkhVkzmK.js","assets/x-D4O9yIS7.js","assets/panel-item-CJh95P_q.js","assets/dist-BDdp8zqz.js","assets/card-DRIctGVs.js","assets/confirm-dialog-j9o2h3xs.js","assets/loader-circle-DWWXcfTQ.js","assets/triangle-alert-D6bAGtMw.js","assets/modal-xr_vw1ZO.js","assets/dropdown-B3FHWc_n.js","assets/chevron-down-BNidRDh1.js","assets/input-tXUFa7Eo.js","assets/notice-Dslxs3H6.js","assets/progress-bar-3GUUAhXi.js","assets/tag-gOOX7fbA.js","assets/toggle-BEPV0rQM.js","assets/src-CfUWwwYf.css","assets/use-sticky-profiles-D5TVHOgw.js","assets/voice-list-D26Lzbpv.js","assets/react-query.gen-C7om930f.js","assets/useMutation-CXGTrp4W.js","assets/infiniteQueryOptions-CqLc14_4.js","assets/queryOptions-CMSBCFOf.js","assets/use-is-org-ready-3vHDbj4G.js","assets/auth-store-C9aYqB9U.js","assets/remote-gateway-session-C8pRadB2.js","assets/capture-error-CqtAGHQu.js","assets/resolved-assistants-store-C6oDdTxB.js","assets/square-DTFrgbZb.js","assets/volume-2-BXDl4IEg.js","assets/use-platform-gate-C5bNA5Pn.js","assets/search-DL-2uX3K.js","assets/identity-BplXBnQ5.js","assets/runtime-upgrade-banner-DjFuJawk.js","assets/react-query.gen-BtYBixpk.js","assets/local-runtime-upgrade-CnY-6TiF.js","assets/diagnostics-DykDXmF3.js","assets/misc-BBsGq1IU.js","assets/cloud-off-BFACQbO0.js","assets/moon-CHW45huN.js","assets/refresh-cw-EZQqnaxp.js","assets/wrench-DhynFba1.js","assets/chunk-5KNZJZUH-Bsoom5--.js","assets/retire-confirm-dialog-8xlq4bkx.js","assets/navigation-resolver-CzEY-5nE.js","assets/research-onboarding-persistence-DwV372yy.js","assets/build-state-9uUe0jN5.js","assets/use-command-palette-sections-BshFMe0w.js","assets/chat-Dy2BC2i1.js","assets/haptics-C4p_Rjba.js","assets/calendar-qrPKlf1H.js","assets/globe-CdLn4IX7.js","assets/layout-grid-Ct4RT2Ea.js","assets/message-square-CHUvAEY9.js","assets/monitor-RX4oi4Nj.js","assets/settings-6_RIT4kT.js","assets/add-credential-modal-4zzd0MPK.js","assets/use-active-assistant-id-JLsAfn3e.js","assets/key-round-BFkuiQGH.js","assets/app-card-BJigGog3.js","assets/edge-swipe-arbiter-store-BwC23ScO.js","assets/viewer-store-DbIS4l8d.js","assets/workspace-path-links-vDBIljq_.js","assets/pointer-CQ4DXHXb.js","assets/sandbox-bridge-B5H4c27m.js","assets/external-link-GPGZ1LGU.js","assets/puzzle-4NgH5snP.js","assets/use-edit-app-Bd1eXXFq.js","assets/use-is-mobile-MmHo-OM6.js","assets/conversation-store-CTMy9QPV.js","assets/edit-chat-session-DVzLQLWl.js","assets/chevron-up-DofScvyy.js","assets/minimize-2-Dj9FY4aF.js","assets/pencil-Cm5DdeRM.js","assets/avatar-renderer-TpNgmnU1.js","assets/avatar-svg-compositor-axSwKFvf.js","assets/animated-avatar-B0vCEKkY.js","assets/use-reduced-motion-fR0m_opJ.js","assets/proxy-DrtKRLtr.js","assets/chat-avatar-B5fx9Xm3.js","assets/sound-manager-Bv6Sc7Ut.js","assets/detail-shell-BjqibXNX.js","assets/apple-logo-BOBq3-Sn.js","assets/use-discord-nudge-DED9TaIm.js","assets/middleware-Bxr-mmHu.js","assets/integration-icon-B1G4FQT2.js","assets/public-asset-OTnPMErp.js","assets/chat-layout-slots-store-DP8MgnXi.js","assets/document-viewer-container-iB63ww7P.js","assets/use-local-file-info-D2-ycwyJ.js","assets/circle-check-big-DtV6IJuh.js","assets/download-Cnb8zZrK.js","assets/file-text-CwGsMgaa.js","assets/message-square-text-CN_v46So.js","assets/send-Bdmy_GSE.js","assets/trash-2-DfVRfykB.js","assets/user-DHC7OLPE.js","assets/not-found-Bh7ZsdAo.js","assets/arrow-left-W84B6oJL.js","assets/sparkles-DfEFn3Bh.js","assets/platform-login-notice-DFmjUE9q.js","assets/use-onboarding-login-CiQyxJLM.js","assets/login-flow-CQhvCbQQ.js","assets/log-in-D4nsqRbG.js","assets/slack-setup-wizard-DPzdheN0.js","assets/use-copy-to-clipboard-RUBxQIiE.js","assets/clipboard-copy-BYpgEh2O.js","assets/voice-providers-note-Ck7hNTfp.js","assets/use-save-twilio-credentials-yqA7lnzq.js","assets/sdk.gen-BpJ1vF7l.js","assets/mail-DyUf40pu.js","assets/message-circle-ByXBaIaq.js","assets/acp-run-store-DdzY8U9Y.js","assets/by-tool-use-id-index-CUFuQqHz.js","assets/optimistic-lifecycle-GoMZsAsc.js","assets/messages-Dyp1xUqz.js","assets/prechat-C4MZwKWX.js","assets/effective-timezone-BX46fWmk.js","assets/browser-timezone-Br-HawKV.js","assets/background-task-store-DpOSZFT8.js","assets/use-transcript-messages-C2uwkjKL.js","assets/use-attachment-preview-CQjpDfsc.js","assets/file-markdown-DnVLY_b_.js","assets/pdf-preview-pscVmtvX.js","assets/chevron-left-CrxnPze-.js","assets/file-DOePafLU.js","assets/acp-run-actions-zSUs8U3N.js","assets/code-D6SOwRrI.js","assets/background-task-actions-DmocXKSr.js","assets/message-content-B6_GZQl9.js","assets/transcript-message-body-shared-BfKwS5qD.js","assets/site-favicon-CDH0mg6Q.js","assets/three-dot-indicator-CeTxs9-J.js","assets/AnimatePresence-CHo6D7IH.js","assets/brain-CN4zzNgU.js","assets/user-plus-DjxxnQ8G.js","assets/subagent-store-DibRR9Ij.js","assets/copy-to-clipboard-DgY-nZpm.js","assets/circle-x-DTjJzoQl.js","assets/file-plus-DjC7wnGp.js","assets/terminal-BucMVaPU.js","assets/use-attachment-squares-8Hx-p8ls.js","assets/archive-BQ3zdIPv.js","assets/chat-markdown-message-B7qvlO44.js","assets/workspace-tree-query-Dfkrp_rV.js","assets/native-file-B71h3csB.js","assets/browser-CcdNg0HN.js","assets/native-anchor-D1Sy2PbD.js","assets/ellipsis-C5fQnusC.js","assets/eye-off-DQ4xakzN.js","assets/eye-B_jBDDRn.js","assets/preview-skeleton-Biw3dosM.js","assets/surface-parse-helpers-iPHZ9D7N.js","assets/conversation-navigation-Bf3cDRKh.js","assets/workflow-store-zCcRcvi8.js","assets/workflow-status-D0bBEpGp.js","assets/conversation-selection-CJs3Fnse.js","assets/use-subagent-card-data-bjGydvhR.js","assets/access-CVnesk0m.js","assets/assistant-feature-flag-store-BvLDPeej.js","assets/research-results-view-BFZFPpev.js","assets/research-facts-BUfgocIh.js","assets/ban-BKp90l-0.js","assets/utils-3IBGVjNS.js","assets/format-date-CQUMvfqf.js","assets/bell-2SnK9BVD.js","assets/clock-DeynsyYL.js","assets/list-D2LnQ7lS.js","assets/rotate-ccw-CL6IkaAI.js","assets/shield-check-CNsbiH1v.js","assets/invalidate-memory-queries-DonPN3eH.js","assets/get-memory-stats-BnRGtUPT.js","assets/invalidate-plugin-queries-B0OpJSUW.js","assets/first-run-scope-CPJpXaWU.js","assets/oauth-connection-utils-BrGz4Zc5.js","assets/oauth-popup-DAMkjCsP.js","assets/onboarding-layout-iPzXbZk1.js","assets/settings-navigation-CyH-twYD.js","assets/hard-navigate-BYoBFmE4.js","assets/use-supports-bookmarks-DwTpI8uM.js","assets/bug-DdmWJIkz.js","assets/chart-column-k8S2UYq8.js","assets/sliders-horizontal-BwdOIxz8.js","assets/mic-BZZo0R22.js","assets/users-OcC3p9Jn.js","assets/workspace-theme-tokens-dJKcMIdP.js","assets/conversation-queries-BBj4FfQn.js","assets/conversation-list-fetchers-C6W8PkvR.js","assets/use-app-theme-yiZ38i4_.js","assets/use-assistant-capability-CnI3VItU.js","assets/use-avatar-accent-var-BafXGBXW.js","assets/avatar-bundled-components-BvKt7I7O.js","assets/use-bookmarks-DO9wmU-2.js","assets/use-edge-swipe-CRkrRNLg.js","assets/use-swipe-engine-Bkqjs1Zk.js","assets/plugins-surface-C_pFzsVo.js","assets/android-consumption-only-D3L1Nc41.js","assets/installed-plugins-query-3ACToZeY.js","assets/doctor-handoff-store-CvOwsVRo.js","assets/threshold-presets-B-RqvhUM.js","assets/shield-CAWgGAqm.js","assets/trust-rules-api-Dbyz25hE.js","assets/dictation-overlay-CnPWVnXc.js","assets/notifications-BTG4cTbF.js","assets/esm-Jw5qNk7q.js","assets/deploy-store-BDIOP-i9.js","assets/avatar-subagent-tkmKhEWI.js","assets/avatar-tone-D99t9DAP.js","assets/conversation-cache-D1AJdwZd.js","assets/external-urls-BL9qY0s8.js","assets/eye-bbox-CRs175_n.js","assets/use-bundled-avatar-components-BcyasJwu.js","assets/use-effective-timezone-BM5B7KHp.js","assets/useInfiniteQuery-Dk8q0n49.js","assets/arrow-down-to-line-DMGjBlMw.js","assets/arrow-right-ChqGeAaW.js","assets/arrow-up-CWzHzcyU.js","assets/upload-DsWG9TbD.js","assets/circle-minus-BBDKV6k6.js","assets/cloud-q4J30bVb.js","assets/coins-CcTuNVlN.js","assets/target-CJU4DUFo.js","assets/dices-C3diFTyP.js","assets/file-code-CrtJR2ax.js","assets/video-Dtwi0MD9.js","assets/folder-_l8GIyQp.js","assets/hard-drive-sI2ZzmqM.js","assets/heart-DFD4eqW-.js","assets/inbox-OC3STytq.js","assets/laptop-BGOychmC.js","assets/lightbulb-NdZMkb6Y.js","assets/link-DOobzBVg.js","assets/log-out-CF9mMMsz.js","assets/paperclip--f908Kg3.js","assets/play-Dh6Bw5AP.js","assets/plus-EJu6s6xR.js","assets/smartphone-CIrxb2NM.js","assets/sun-BauGiwdK.js","assets/workflow-Bsy5y3W0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-Cv2QeVDK.js";import{d as t}from"./routes-DrfnNoYS.js";async function n(n){let{router:r}=await e(async()=>{let{router:e}=await import(`./routes-uGHUgv4F.js`).then(e=>e.n);return{router:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296]));await r.navigate(`${t.workspace}?file=${encodeURIComponent(n)}`)}export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{m as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as a}from"./QueryClientProvider-CMu7CkQU.js";import{t as o}from"./useQuery-Bz-fbQ-m.js";import{t as s}from"./useMutation-CXGTrp4W.js";import{t as c}from"./jsx-runtime-D3ZM-ToX.js";import{t as l}from"./typography-DEI9Ra9z.js";import{t as u}from"./arrow-left-W84B6oJL.js";import{t as d}from"./circle-check-DvrCdroD.js";import{A as f,C as p,D as ee,E as m,I as te,L as ne,N as h,S as g,T as re,a as ie,b as ae,h as oe,i as se,j as ce,l as le,n as ue,o as de,r as fe,s as pe,t as me,u as he}from"./use-checkout-dismiss-refresh-BcEeQKyP.js";import{t as _}from"./sliders-horizontal-BwdOIxz8.js";import{t as ge}from"./loader-circle-DWWXcfTQ.js";import{t as v}from"./triangle-alert-D6bAGtMw.js";import{t as y}from"./tag-gOOX7fbA.js";import{t as b}from"./modal-xr_vw1ZO.js";import{n as x}from"./toast-BtFgiPe3.js";import{t as _e}from"./is-electron-DIlIrdJX.js";import{c as ve}from"./auth-store-CWJoXmMk.js";import{C as ye}from"./native-biometric-DetUqtjl.js";import{d as S,t as be}from"./routes-DrfnNoYS.js";import{i as xe,r as Se,t as Ce}from"./use-platform-gate-B_3hHMqw.js";import{r as we}from"./use-is-org-ready-Df3qfx4p.js";import{n as Te}from"./browser-CcdNg0HN.js";import{$ as Ee,dt as De,et as C,lt as Oe,ut as ke}from"./react-query.gen-BtYBixpk.js";import{t as w}from"./use-bundled-avatar-components-BcyasJwu.js";import{s as Ae}from"./machine-sizes-B9nt_h-U.js";import{t as je}from"./checkout-return-target-BStfEab4.js";var T=e(t(),1),E=c(),D=`Select custom CPU power, Ram and Storage. Or just throw in some tokens.`;function Me({className:e,onConfigure:t,configureDisabled:r,isCurrent:i=!1,currentSummary:a}){return(0,E.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-8 ${e??``}`,children:[(0,E.jsx)(`p`,{className:`text-center text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Need something more tailored to your needs?`}),(0,E.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,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,E.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--content-disabled)] p-[14px]`,children:(0,E.jsx)(_,{className:`h-6 w-6 text-[var(--aux-white)]`,"aria-hidden":!0})}),(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Custom Plan`}),i?(0,E.jsx)(y,{className:`bg-[var(--feed-digest-weak)] text-[var(--content-default)]`,children:`Your Current Plan`}):null]}),(0,E.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-tertiary)]`,children:a??D})]})]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,E.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Billed monthly`}),(0,E.jsx)(n,{variant:`outlined`,onClick:t,disabled:r,children:`Configure`})]})]})]})}function Ne({open:e,lostFeatures:t,pending:r,onCancel:i,onConfirm:a}){let o=t.length>0;return(0,E.jsx)(b.Root,{open:e,onOpenChange:e=>{!e&&!r&&i()},children:(0,E.jsxs)(b.Content,{size:`md`,hideCloseButton:!0,children:[(0,E.jsx)(b.Header,{children:(0,E.jsx)(b.Title,{icon:v,children:`Downgrade to Base?`})}),(0,E.jsxs)(b.Body,{children:[(0,E.jsx)(l,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:o?`Downgrading removes the following Pro features. You'll be taken to Stripe to cancel your subscription.`:`You'll be taken to Stripe to cancel your subscription.`}),o?(0,E.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5`,children:t.map(e=>(0,E.jsx)(`li`,{children:(0,E.jsx)(l,{as:`span`,variant:`body-medium-default`,children:e})},e))}):null]}),(0,E.jsxs)(b.Footer,{children:[(0,E.jsx)(n,{variant:`outlined`,onClick:i,disabled:r,children:`Cancel`}),(0,E.jsx)(n,{variant:`danger`,onClick:a,disabled:r,"data-testid":`confirm-free-downgrade-button`,children:`Downgrade to Base`})]})]})})}function Pe({tierKey:e,name:t,tagline:r,priceLabel:i,priceCaption:a,ctaLabel:o,features:s,recommended:c=!1,tone:l=`dark`,isCurrent:u,intent:f=`upgrade`,pending:p,onCta:ee}){let m=f===`downgrade`&&!u;return(0,E.jsxs)(`div`,{"data-theme":l,className:`flex w-full flex-col gap-3 rounded-2xl bg-[var(--surface-lift)] p-3 sm:gap-4 sm:p-4`,children:[(0,E.jsx)(re,{tier:e,size:50}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`text-[20px] font-medium text-[var(--content-emphasised)]`,children:t}),c&&!m&&!u?(0,E.jsx)(y,{className:`bg-[var(--feed-digest-weak)] text-[12px] font-semibold uppercase text-[var(--credits-accent)]`,children:`Recommended`}):null]}),(0,E.jsx)(`p`,{className:`overflow-hidden text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)] sm:h-9`,children:r})]}),(0,E.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,E.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:i}),(0,E.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:a})]}),(0,E.jsx)(n,{variant:m?`outlined`:`primary`,fullWidth:!0,disabled:u||p,onClick:ee,children:u?`Current Plan`:o}),(0,E.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:gap-4`,children:[(0,E.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Includes:`}),(0,E.jsx)(`ul`,{className:`flex flex-col gap-2`,children:s.map(e=>(0,E.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,E.jsx)(d,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,E.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-secondary)]`,children:e})]},e))})]})]})}var Fe=`#0A0A0B`,Ie=`https://www.vellum.ai/docs/pricing`,Le=8e3,Re={upgrade:`upgrade`,downgrade:`downgrade`,switch:`change`};w();var ze=[`Small Computer`,`4 GB Storage`,`Pay-as-you-go credits`];function Be(e){return`${h(e)}/month`}function Ve(e){return`${p(e)} Computer`}function He(e,t){let n=e.credits_usd??0;return[Ve(e),`${e.storage_gib} GB Storage`,`${h(n*100)} in credits included`,...t]}function Ue(e,t){return g(e,t).join(` · `)}function O(){let e=i(),[t,c]=r(),l=a(),d=_e(),p=xe({platformHostedOnly:!0}),ne=Ce(),h=Se(),g=p===`full`&&ne,re=p===`full`&&h,_=o({...Oe(),enabled:g}),v=o({...Ee(),enabled:g}),y=s(De()),{changePackage:b,isPending:w}=pe(),{changeTiers:D,isPending:Ve,current:O,currentReady:k,currentKnown:A,primaryAssistantId:We}=de({enabled:g});me();let[j,Ge]=(0,T.useState)(!1),[Ke,M]=(0,T.useState)(!1),[qe,N]=(0,T.useState)(!1),[P,F]=(0,T.useState)(null),[Je,I]=(0,T.useState)(!1),[Ye,L]=(0,T.useState)(void 0),R=(0,T.useRef)(!1),[z,Xe]=(0,T.useState)(!1),Ze=(0,T.useRef)(!1),[B,V]=(0,T.useState)(null),H=_.data,U=v.data?.plans.find(e=>e.id===`pro`),W=U?.packages??[],Qe=W.length>0,G=H?.plan_id===`pro`,$e=we(),et=te(We,g&&$e&&G&&A),tt=A?et:void 0,K=H?H.plan_id===`base`?`free`:ee(H.package)?H.package.key:null:null,q=ae(oe(H)),nt=new Set(v.data?.plans.find(e=>e.id===`base`)?.included_features??[]),rt=(U?.included_features??[]).filter(e=>!nt.has(e)),J=j||w||q.isPending,it=(0,T.useMemo)(()=>!G||O.storageTier==null?null:{machineTier:O.machineTier,storageTier:O.storageTier,creditTier:O.creditTier},[G,O.machineTier,O.storageTier,O.creditTier]),Y=t.get(be),X=!g&&!re,at=g&&!v.isLoading&&!Qe,Z=X||!(Y!=null&&!z)&&(_.isError||at);(0,T.useEffect)(()=>{Z&&e(X?S.settings.usageBilling:`${S.settings.usageBilling}&adjust_plan`,{replace:!0})},[Z,X,e]);let ot=()=>{(window.history.state?.idx??0)>0?e(-1):e(S.settings.usageBilling)},st=async e=>{Ge(!0);try{let t=await y.mutateAsync({body:{...e,return_target:je()}});t.status===`redirect`&&t.checkout_url?(ye(e.package?{kind:`package`,packageKey:e.package}:{kind:`custom`,machineTier:e.machine_tier??null,storageTier:e.storage_tier??null,creditTier:e.credit_tier??null}),ve(l),Te(t.checkout_url)):(await l.invalidateQueries({queryKey:ke()}),await l.invalidateQueries({queryKey:C()}))}catch(e){x.error(le(e,`Failed to start the upgrade checkout. Please try again.`))}finally{Ge(!1)}},Q=(t,n)=>{if(H&&!J){if(G){if(t===`free`){N(!0);return}let r=W.find(e=>e.key===t);if(!r||f(K,r.key)===`current`)return;if(!he(H)){e(`${S.settings.usageBilling}&adjust_plan`,{replace:n?.replaceOnBail===!0});return}F(r);return}t!==`free`&&st({target_plan_id:`pro`,package:t,confirm:!0})}},ct=(0,T.useRef)(Q);(0,T.useEffect)(()=>{ct.current=Q}),(0,T.useEffect)(()=>{if(Y==null||R.current||Z||!g||Ze.current)return;Ze.current=!0;let e=setTimeout(()=>{Xe(!0)},Le),t=()=>{clearTimeout(e),Xe(!0)};Promise.all([l.refetchQueries({queryKey:ke()}),l.refetchQueries({queryKey:C()})]).then(t,t)},[Z,Y,g,l]),(0,T.useEffect)(()=>{Y==null||R.current||Z||!g||!z||(R.current=!0,G&&Y!==`free`&&V(Y),c(e=>{let t=new URLSearchParams(e);return t.delete(be),t},{replace:!0}))},[z,Z,Y,g,G,c]),(0,T.useEffect)(()=>{B==null||Y!=null||(V(null),ct.current(B,{replaceOnBail:!0}))},[Y,B]);let $;if(H&&U&&Qe){let e=G&&K===null&&k&&O.storageGib!=null,t=e?Ue(O,U):void 0,n=()=>{N(!1),q.mutate({})},r=()=>({creditTier:O.creditTier,fromSnapshot:{machineSize:tt?.machine_size??null,storageGib:tt?.provisioned_storage_gib??null}}),i=P?K===null?`switch`:f(K,P.key)===`downgrade`?`downgrade`:`upgrade`:`upgrade`,a=async()=>{if(!P)return;let e=P,t=r(),n=K===null||!k||!A||Ae(O.machineTier,e.machine_tier),a=await b(e.key);if(!a)return;if(F(null),a.status===`no_op`){x.success(`You're already on this plan.`);return}let o=e.credit_tier??null;L({fromSnapshot:t.fromSnapshot,credits:o===t.creditTier?null:{fromTier:t.creditTier,toTier:o},direction:Re[i],canLowerResources:n}),I(!0)},o=e=>st({target_plan_id:`pro`,confirm:!0,machine_tier:e.machineTier,storage_tier:e.storageTier,credit_tier:e.creditTier}),s=async e=>{let t=r(),n=!A||Ae(O.machineTier,e.machineTier),i=await D(e);i&&(M(!1),i.needsResize||i.creditChanged?(L({fromSnapshot:t.fromSnapshot,credits:i.creditChanged?{fromTier:t.creditTier,toTier:e.creditTier}:null,direction:`change`,canLowerResources:n}),I(!0)):x.success(`Plan updated.`))},c=()=>{J||G&&!k||M(!0)},l=[...W].sort((e,t)=>m.indexOf(e.key)-m.indexOf(t.key)),u=se(`free`),d=G?`downgrade`:f(K,`free`);$=(0,E.jsxs)(`div`,{className:`my-auto flex w-full flex-col items-center`,children:[(0,E.jsxs)(`header`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,E.jsx)(`h1`,{className:`text-[40px] text-[var(--content-emphasised)] sm:text-[60px]`,style:{fontFamily:`var(--font-serif)`,fontWeight:400,lineHeight:1.2,letterSpacing:`1.2px`},children:`Give your assistant more power`}),(0,E.jsx)(`p`,{className:`text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Choose the level that matches how much you want it to take on.`})]}),(0,E.jsxs)(`div`,{className:`mt-6 grid w-full max-w-[1312px] grid-cols-1 items-start gap-4 sm:mt-10 sm:grid-cols-2 sm:gap-6 lg:grid-cols-4`,children:[(0,E.jsx)(Pe,{tierKey:`free`,name:`Base`,tagline:u?.tagline??``,priceLabel:`Free`,priceCaption:u?.priceCaption??`Forever`,ctaLabel:d===`downgrade`?fe(`Base`):u?.cta??`Start Free`,features:ze,tone:`dark`,isCurrent:K===`free`,intent:d,pending:J,onCta:()=>Q(`free`)}),l.map(e=>{let t=se(e.key),n=f(K,e.key);return(0,E.jsx)(Pe,{tierKey:e.key,name:e.name,tagline:t?.tagline??``,priceLabel:Be(e.total_price_cents),priceCaption:t?.priceCaption??`Billed monthly`,ctaLabel:n===`downgrade`?fe(e.name):t?.cta??e.name,features:He(e,t?.extraFeatures??[]),recommended:t?.recommended,tone:t?.recommended?`light`:`dark`,isCurrent:K===e.key,intent:n,pending:J,onCta:()=>Q(e.key)},e.key)})]}),(0,E.jsx)(Me,{className:`mt-6 sm:mt-10`,onConfigure:c,configureDisabled:G&&!k||J,isCurrent:e,currentSummary:t}),(0,E.jsx)(ie,{open:Ke,proPlan:U,pending:j||Ve,currentStorageGib:G?O.storageGib:null,initialSelection:it,onClose:()=>M(!1),onContinue:e=>{G?s(e):o(e)}}),(0,E.jsx)(ue,{open:P!==null,relation:i,packageName:P?.name??``,targetPackage:P,pending:w,onCancel:()=>F(null),onConfirm:()=>void a()}),(0,E.jsx)(Ne,{open:qe,lostFeatures:rt,pending:q.isPending,onCancel:()=>N(!1),onConfirm:n}),(0,E.jsx)(ce,{mode:`resize`,open:Je,onClose:()=>{I(!1),L(void 0)},resizeContext:Ye}),(0,E.jsxs)(`p`,{className:`mt-6 text-center text-[12px] font-medium text-[var(--content-tertiary)] sm:mt-10`,children:[`You can cancel or change your plan anytime you want. To learn more`,` `,(0,E.jsx)(`a`,{href:Ie,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--content-default)] underline`,children:`Read our Docs.`})]})]})}else $=(0,E.jsx)(`div`,{className:`my-auto flex items-center justify-center`,children:(0,E.jsx)(ge,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading plans`})});return(0,E.jsxs)(`div`,{"data-theme":`dark`,className:`plans-takeover-canvas-enter relative h-full w-full overflow-y-auto`,style:{backgroundColor:Fe},children:[(0,E.jsx)(`div`,{className:`absolute left-8 z-10 [-webkit-app-region:no-drag]`,style:{top:d?`3rem`:`2rem`},children:(0,E.jsx)(n,{variant:`outlined`,leftIcon:(0,E.jsx)(u,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:ot,className:`[-webkit-app-region:no-drag]`,children:`Back`})}),(0,E.jsx)(`div`,{className:`plans-takeover-content-enter flex min-h-full flex-col items-center px-4 pb-8 sm:px-6`,style:{paddingTop:d?`5rem`:`4rem`},children:$})]})}function k(){return(0,E.jsx)(ne,{redirectToBilling:!0,children:(0,E.jsx)(O,{})})}export{k as PlansPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{m as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as a}from"./QueryClientProvider-CMu7CkQU.js";import{t as o}from"./useQuery-Bz-fbQ-m.js";import{t as s}from"./useMutation-CXGTrp4W.js";import{t as c}from"./jsx-runtime-D3ZM-ToX.js";import{t as l}from"./typography-DEI9Ra9z.js";import{t as u}from"./arrow-left-W84B6oJL.js";import{t as d}from"./circle-check-DvrCdroD.js";import{A as f,C as p,D as ee,E as m,I as te,L as ne,N as h,S as g,T as re,a as ie,b as ae,h as oe,i as se,j as ce,l as le,n as ue,o as de,r as fe,s as pe,t as me,u as he}from"./use-checkout-dismiss-refresh-CV_H4uEB.js";import{t as _}from"./sliders-horizontal-BwdOIxz8.js";import{t as ge}from"./loader-circle-DWWXcfTQ.js";import{t as v}from"./triangle-alert-D6bAGtMw.js";import{t as y}from"./tag-gOOX7fbA.js";import{t as b}from"./modal-xr_vw1ZO.js";import{n as x}from"./toast-BtFgiPe3.js";import{t as _e}from"./is-electron-DIlIrdJX.js";import{c as ve}from"./auth-store-C9aYqB9U.js";import{C as ye}from"./native-biometric-DetUqtjl.js";import{d as S,t as be}from"./routes-DrfnNoYS.js";import{i as xe,r as Se,t as Ce}from"./use-platform-gate-C5bNA5Pn.js";import{r as we}from"./use-is-org-ready-3vHDbj4G.js";import{n as Te}from"./browser-CcdNg0HN.js";import{$ as Ee,dt as De,et as C,lt as Oe,ut as ke}from"./react-query.gen-BtYBixpk.js";import{t as w}from"./use-bundled-avatar-components-BcyasJwu.js";import{s as Ae}from"./machine-sizes-B9nt_h-U.js";import{t as je}from"./checkout-return-target-BStfEab4.js";var T=e(t(),1),E=c(),D=`Select custom CPU power, Ram and Storage. Or just throw in some tokens.`;function Me({className:e,onConfigure:t,configureDisabled:r,isCurrent:i=!1,currentSummary:a}){return(0,E.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-8 ${e??``}`,children:[(0,E.jsx)(`p`,{className:`text-center text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Need something more tailored to your needs?`}),(0,E.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,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,E.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--content-disabled)] p-[14px]`,children:(0,E.jsx)(_,{className:`h-6 w-6 text-[var(--aux-white)]`,"aria-hidden":!0})}),(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Custom Plan`}),i?(0,E.jsx)(y,{className:`bg-[var(--feed-digest-weak)] text-[var(--content-default)]`,children:`Your Current Plan`}):null]}),(0,E.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-tertiary)]`,children:a??D})]})]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,E.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Billed monthly`}),(0,E.jsx)(n,{variant:`outlined`,onClick:t,disabled:r,children:`Configure`})]})]})]})}function Ne({open:e,lostFeatures:t,pending:r,onCancel:i,onConfirm:a}){let o=t.length>0;return(0,E.jsx)(b.Root,{open:e,onOpenChange:e=>{!e&&!r&&i()},children:(0,E.jsxs)(b.Content,{size:`md`,hideCloseButton:!0,children:[(0,E.jsx)(b.Header,{children:(0,E.jsx)(b.Title,{icon:v,children:`Downgrade to Base?`})}),(0,E.jsxs)(b.Body,{children:[(0,E.jsx)(l,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:o?`Downgrading removes the following Pro features. You'll be taken to Stripe to cancel your subscription.`:`You'll be taken to Stripe to cancel your subscription.`}),o?(0,E.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5`,children:t.map(e=>(0,E.jsx)(`li`,{children:(0,E.jsx)(l,{as:`span`,variant:`body-medium-default`,children:e})},e))}):null]}),(0,E.jsxs)(b.Footer,{children:[(0,E.jsx)(n,{variant:`outlined`,onClick:i,disabled:r,children:`Cancel`}),(0,E.jsx)(n,{variant:`danger`,onClick:a,disabled:r,"data-testid":`confirm-free-downgrade-button`,children:`Downgrade to Base`})]})]})})}function Pe({tierKey:e,name:t,tagline:r,priceLabel:i,priceCaption:a,ctaLabel:o,features:s,recommended:c=!1,tone:l=`dark`,isCurrent:u,intent:f=`upgrade`,pending:p,onCta:ee}){let m=f===`downgrade`&&!u;return(0,E.jsxs)(`div`,{"data-theme":l,className:`flex w-full flex-col gap-3 rounded-2xl bg-[var(--surface-lift)] p-3 sm:gap-4 sm:p-4`,children:[(0,E.jsx)(re,{tier:e,size:50}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`text-[20px] font-medium text-[var(--content-emphasised)]`,children:t}),c&&!m&&!u?(0,E.jsx)(y,{className:`bg-[var(--feed-digest-weak)] text-[12px] font-semibold uppercase text-[var(--credits-accent)]`,children:`Recommended`}):null]}),(0,E.jsx)(`p`,{className:`overflow-hidden text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)] sm:h-9`,children:r})]}),(0,E.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,E.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:i}),(0,E.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:a})]}),(0,E.jsx)(n,{variant:m?`outlined`:`primary`,fullWidth:!0,disabled:u||p,onClick:ee,children:u?`Current Plan`:o}),(0,E.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:gap-4`,children:[(0,E.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Includes:`}),(0,E.jsx)(`ul`,{className:`flex flex-col gap-2`,children:s.map(e=>(0,E.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,E.jsx)(d,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,E.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-secondary)]`,children:e})]},e))})]})]})}var Fe=`#0A0A0B`,Ie=`https://www.vellum.ai/docs/pricing`,Le=8e3,Re={upgrade:`upgrade`,downgrade:`downgrade`,switch:`change`};w();var ze=[`Small Computer`,`4 GB Storage`,`Pay-as-you-go credits`];function Be(e){return`${h(e)}/month`}function Ve(e){return`${p(e)} Computer`}function He(e,t){let n=e.credits_usd??0;return[Ve(e),`${e.storage_gib} GB Storage`,`${h(n*100)} in credits included`,...t]}function Ue(e,t){return g(e,t).join(` · `)}function O(){let e=i(),[t,c]=r(),l=a(),d=_e(),p=xe({platformHostedOnly:!0}),ne=Ce(),h=Se(),g=p===`full`&&ne,re=p===`full`&&h,_=o({...Oe(),enabled:g}),v=o({...Ee(),enabled:g}),y=s(De()),{changePackage:b,isPending:w}=pe(),{changeTiers:D,isPending:Ve,current:O,currentReady:k,currentKnown:A,primaryAssistantId:We}=de({enabled:g});me();let[j,Ge]=(0,T.useState)(!1),[Ke,M]=(0,T.useState)(!1),[qe,N]=(0,T.useState)(!1),[P,F]=(0,T.useState)(null),[Je,I]=(0,T.useState)(!1),[Ye,L]=(0,T.useState)(void 0),R=(0,T.useRef)(!1),[z,Xe]=(0,T.useState)(!1),Ze=(0,T.useRef)(!1),[B,V]=(0,T.useState)(null),H=_.data,U=v.data?.plans.find(e=>e.id===`pro`),W=U?.packages??[],Qe=W.length>0,G=H?.plan_id===`pro`,$e=we(),et=te(We,g&&$e&&G&&A),tt=A?et:void 0,K=H?H.plan_id===`base`?`free`:ee(H.package)?H.package.key:null:null,q=ae(oe(H)),nt=new Set(v.data?.plans.find(e=>e.id===`base`)?.included_features??[]),rt=(U?.included_features??[]).filter(e=>!nt.has(e)),J=j||w||q.isPending,it=(0,T.useMemo)(()=>!G||O.storageTier==null?null:{machineTier:O.machineTier,storageTier:O.storageTier,creditTier:O.creditTier},[G,O.machineTier,O.storageTier,O.creditTier]),Y=t.get(be),X=!g&&!re,at=g&&!v.isLoading&&!Qe,Z=X||!(Y!=null&&!z)&&(_.isError||at);(0,T.useEffect)(()=>{Z&&e(X?S.settings.usageBilling:`${S.settings.usageBilling}&adjust_plan`,{replace:!0})},[Z,X,e]);let ot=()=>{(window.history.state?.idx??0)>0?e(-1):e(S.settings.usageBilling)},st=async e=>{Ge(!0);try{let t=await y.mutateAsync({body:{...e,return_target:je()}});t.status===`redirect`&&t.checkout_url?(ye(e.package?{kind:`package`,packageKey:e.package}:{kind:`custom`,machineTier:e.machine_tier??null,storageTier:e.storage_tier??null,creditTier:e.credit_tier??null}),ve(l),Te(t.checkout_url)):(await l.invalidateQueries({queryKey:ke()}),await l.invalidateQueries({queryKey:C()}))}catch(e){x.error(le(e,`Failed to start the upgrade checkout. Please try again.`))}finally{Ge(!1)}},Q=(t,n)=>{if(H&&!J){if(G){if(t===`free`){N(!0);return}let r=W.find(e=>e.key===t);if(!r||f(K,r.key)===`current`)return;if(!he(H)){e(`${S.settings.usageBilling}&adjust_plan`,{replace:n?.replaceOnBail===!0});return}F(r);return}t!==`free`&&st({target_plan_id:`pro`,package:t,confirm:!0})}},ct=(0,T.useRef)(Q);(0,T.useEffect)(()=>{ct.current=Q}),(0,T.useEffect)(()=>{if(Y==null||R.current||Z||!g||Ze.current)return;Ze.current=!0;let e=setTimeout(()=>{Xe(!0)},Le),t=()=>{clearTimeout(e),Xe(!0)};Promise.all([l.refetchQueries({queryKey:ke()}),l.refetchQueries({queryKey:C()})]).then(t,t)},[Z,Y,g,l]),(0,T.useEffect)(()=>{Y==null||R.current||Z||!g||!z||(R.current=!0,G&&Y!==`free`&&V(Y),c(e=>{let t=new URLSearchParams(e);return t.delete(be),t},{replace:!0}))},[z,Z,Y,g,G,c]),(0,T.useEffect)(()=>{B==null||Y!=null||(V(null),ct.current(B,{replaceOnBail:!0}))},[Y,B]);let $;if(H&&U&&Qe){let e=G&&K===null&&k&&O.storageGib!=null,t=e?Ue(O,U):void 0,n=()=>{N(!1),q.mutate({})},r=()=>({creditTier:O.creditTier,fromSnapshot:{machineSize:tt?.machine_size??null,storageGib:tt?.provisioned_storage_gib??null}}),i=P?K===null?`switch`:f(K,P.key)===`downgrade`?`downgrade`:`upgrade`:`upgrade`,a=async()=>{if(!P)return;let e=P,t=r(),n=K===null||!k||!A||Ae(O.machineTier,e.machine_tier),a=await b(e.key);if(!a)return;if(F(null),a.status===`no_op`){x.success(`You're already on this plan.`);return}let o=e.credit_tier??null;L({fromSnapshot:t.fromSnapshot,credits:o===t.creditTier?null:{fromTier:t.creditTier,toTier:o},direction:Re[i],canLowerResources:n}),I(!0)},o=e=>st({target_plan_id:`pro`,confirm:!0,machine_tier:e.machineTier,storage_tier:e.storageTier,credit_tier:e.creditTier}),s=async e=>{let t=r(),n=!A||Ae(O.machineTier,e.machineTier),i=await D(e);i&&(M(!1),i.needsResize||i.creditChanged?(L({fromSnapshot:t.fromSnapshot,credits:i.creditChanged?{fromTier:t.creditTier,toTier:e.creditTier}:null,direction:`change`,canLowerResources:n}),I(!0)):x.success(`Plan updated.`))},c=()=>{J||G&&!k||M(!0)},l=[...W].sort((e,t)=>m.indexOf(e.key)-m.indexOf(t.key)),u=se(`free`),d=G?`downgrade`:f(K,`free`);$=(0,E.jsxs)(`div`,{className:`my-auto flex w-full flex-col items-center`,children:[(0,E.jsxs)(`header`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,E.jsx)(`h1`,{className:`text-[40px] text-[var(--content-emphasised)] sm:text-[60px]`,style:{fontFamily:`var(--font-serif)`,fontWeight:400,lineHeight:1.2,letterSpacing:`1.2px`},children:`Give your assistant more power`}),(0,E.jsx)(`p`,{className:`text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Choose the level that matches how much you want it to take on.`})]}),(0,E.jsxs)(`div`,{className:`mt-6 grid w-full max-w-[1312px] grid-cols-1 items-start gap-4 sm:mt-10 sm:grid-cols-2 sm:gap-6 lg:grid-cols-4`,children:[(0,E.jsx)(Pe,{tierKey:`free`,name:`Base`,tagline:u?.tagline??``,priceLabel:`Free`,priceCaption:u?.priceCaption??`Forever`,ctaLabel:d===`downgrade`?fe(`Base`):u?.cta??`Start Free`,features:ze,tone:`dark`,isCurrent:K===`free`,intent:d,pending:J,onCta:()=>Q(`free`)}),l.map(e=>{let t=se(e.key),n=f(K,e.key);return(0,E.jsx)(Pe,{tierKey:e.key,name:e.name,tagline:t?.tagline??``,priceLabel:Be(e.total_price_cents),priceCaption:t?.priceCaption??`Billed monthly`,ctaLabel:n===`downgrade`?fe(e.name):t?.cta??e.name,features:He(e,t?.extraFeatures??[]),recommended:t?.recommended,tone:t?.recommended?`light`:`dark`,isCurrent:K===e.key,intent:n,pending:J,onCta:()=>Q(e.key)},e.key)})]}),(0,E.jsx)(Me,{className:`mt-6 sm:mt-10`,onConfigure:c,configureDisabled:G&&!k||J,isCurrent:e,currentSummary:t}),(0,E.jsx)(ie,{open:Ke,proPlan:U,pending:j||Ve,currentStorageGib:G?O.storageGib:null,initialSelection:it,onClose:()=>M(!1),onContinue:e=>{G?s(e):o(e)}}),(0,E.jsx)(ue,{open:P!==null,relation:i,packageName:P?.name??``,targetPackage:P,pending:w,onCancel:()=>F(null),onConfirm:()=>void a()}),(0,E.jsx)(Ne,{open:qe,lostFeatures:rt,pending:q.isPending,onCancel:()=>N(!1),onConfirm:n}),(0,E.jsx)(ce,{mode:`resize`,open:Je,onClose:()=>{I(!1),L(void 0)},resizeContext:Ye}),(0,E.jsxs)(`p`,{className:`mt-6 text-center text-[12px] font-medium text-[var(--content-tertiary)] sm:mt-10`,children:[`You can cancel or change your plan anytime you want. To learn more`,` `,(0,E.jsx)(`a`,{href:Ie,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--content-default)] underline`,children:`Read our Docs.`})]})]})}else $=(0,E.jsx)(`div`,{className:`my-auto flex items-center justify-center`,children:(0,E.jsx)(ge,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading plans`})});return(0,E.jsxs)(`div`,{"data-theme":`dark`,className:`plans-takeover-canvas-enter relative h-full w-full overflow-y-auto`,style:{backgroundColor:Fe},children:[(0,E.jsx)(`div`,{className:`absolute left-8 z-10 [-webkit-app-region:no-drag]`,style:{top:d?`3rem`:`2rem`},children:(0,E.jsx)(n,{variant:`outlined`,leftIcon:(0,E.jsx)(u,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:ot,className:`[-webkit-app-region:no-drag]`,children:`Back`})}),(0,E.jsx)(`div`,{className:`plans-takeover-content-enter flex min-h-full flex-col items-center px-4 pb-8 sm:px-6`,style:{paddingTop:d?`5rem`:`4rem`},children:$})]})}function k(){return(0,E.jsx)(ne,{redirectToBilling:!0,children:(0,E.jsx)(O,{})})}export{k as PlansPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./button-Dy5001j6.js";import{l as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./log-in-D4nsqRbG.js";import{t as i}from"./notice-Dslxs3H6.js";import{t as a}from"./use-onboarding-login-
|
|
1
|
+
import{t as e}from"./button-Dy5001j6.js";import{l as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./log-in-D4nsqRbG.js";import{t as i}from"./notice-Dslxs3H6.js";import{t as a}from"./use-onboarding-login-CiQyxJLM.js";var o=n();function s({children:n,className:s}){let{pathname:c,search:l,hash:u}=t(),{loading:d,login:f,cancel:p}=a(`${c}${l}${u}`);return(0,o.jsx)(i,{tone:`info`,className:s,actions:(0,o.jsx)(e,{variant:`ghost`,leftIcon:d?void 0:(0,o.jsx)(r,{className:`h-4 w-4`}),onClick:d?p:()=>void f(),children:d?`Cancel`:`Log In`}),children:n})}export{s as t};
|
package/dist/assets/{platform-loopback-page-e9XVrvYR.js → platform-loopback-page-BGF_H8f_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{m as n,u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{E as a,N as o}from"./local-mode-DHueA-BJ.js";import{at as s,n as c}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{m as n,u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{E as a,N as o}from"./local-mode-DHueA-BJ.js";import{at as s,n as c}from"./auth-store-C9aYqB9U.js";import{c as l}from"./api-CGsj1Pig.js";import{g as u}from"./native-biometric-DetUqtjl.js";import{d}from"./routes-DrfnNoYS.js";var f=e(t(),1),p=i(),m=`vellum:loopback:state`,h=`vellum:loopback:returnTo`;function g(){let[e]=n(),t=r(),[i,g]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let n=e.get(`state`),r=e.get(`session_token`),i=sessionStorage.getItem(m),f=sessionStorage.getItem(h)||d.assistant;if(sessionStorage.removeItem(m),sessionStorage.removeItem(h),!n||n!==i){g(`Login failed: state mismatch. Please try again.`);return}if(!r){g(`Login failed: no session token received. Please try again.`);return}if(!/^[a-zA-Z0-9]+$/.test(r)){g(`Login failed: invalid session token.`);return}(async()=>{if(!await o(r)){g(`Login failed: couldn't reach the local Vellum server to store the session. Please try again.`);return}await c.getState().initSession(),await u(!0);try{let e=await l();if(e.ok&&e.data.length>0){await a(e.data,s.getState().currentOrganizationId??void 0),t(d.assistant,{replace:!0});return}}catch{}t(f,{replace:!0})})()},[e,t]),i?(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:i}),(0,p.jsx)(`button`,{type:`button`,className:`mt-4 rounded-lg border border-[var(--border-disabled)] px-4 py-2 text-sm hover:bg-[var(--surface-lift)]`,onClick:()=>void t(d.welcome),children:`Back to Welcome`})]})}):(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:`Completing login...`})})}export{g as PlatformLoopbackPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-CUIsZfaf.js";import{t as o}from"./react-BFJW0bSv.js";import{F as s,t as c}from"./button-Dy5001j6.js";import{n as l}from"./QueryClientProvider-CMu7CkQU.js";import{t as u}from"./useQuery-Bz-fbQ-m.js";import{t as d}from"./useMutation-CXGTrp4W.js";import{t as f}from"./jsx-runtime-D3ZM-ToX.js";import{t as p}from"./cn-CJf7MmLX.js";import{t as m}from"./card-DRIctGVs.js";import{t as h}from"./chevron-down-BNidRDh1.js";import{t as g}from"./chevron-right-CANAtgGn.js";import{t as _}from"./loader-circle-DWWXcfTQ.js";import{c as v,o as y,r as b,t as x}from"./threshold-presets-B-RqvhUM.js";import{t as S}from"./pencil-Cm5DdeRM.js";import{t as C}from"./shield-check-CNsbiH1v.js";import{t as w}from"./trash-2-DfVRfykB.js";import{t as T}from"./x-D4O9yIS7.js";import{t as E}from"./notice-Dslxs3H6.js";import{t as D}from"./tag-gOOX7fbA.js";import{t as O}from"./input-tXUFa7Eo.js";import{t as k}from"./toggle-BEPV0rQM.js";import{n as A}from"./toast-BtFgiPe3.js";import{t as j}from"./confirm-dialog-j9o2h3xs.js";import{t as M}from"./dropdown-B3FHWc_n.js";import{n as N,r as P,v as F}from"./auth-store-CWJoXmMk.js";import{t as ee}from"./sdk.gen-ies09CqM.js";import{a as I,m as te,n as ne,o as re,r as ie,s as ae,t as oe}from"./native-biometric-DetUqtjl.js";import{d as se,u as ce}from"./routes-DrfnNoYS.js";import{f as le}from"./platform-detection-AHYibqOx.js";import{i as L,r as ue,t as de}from"./use-platform-gate-B_3hHMqw.js";import{f as fe,p as pe}from"./prefs-CfRaGUUx.js";import{n as me,t as R}from"./react-query.gen-BtYBixpk.js";import{a as z,c as he,n as ge,o as _e,r as B,s as ve,u as ye}from"./trust-rules-api-Dbyz25hE.js";import{t as be}from"./platform-login-notice-q7ZuGeuo.js";import{t as V}from"./use-active-assistant-id-JLsAfn3e.js";import{t as H}from"./detail-card-BElAV1cp.js";import{t as U}from"./setting-row-C4jX7c_4.js";import{t as xe}from"./settings-divider-BkLQFMlW.js";var W=e(o(),1),G=f(),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||_e(0)}]}function Te({row:e,onToggle:t}){return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(k,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,G.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,G.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function 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 ve(e.sourceKind):await he(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=L({platformHostedOnly:!0}),t=de(),n=ue(),r=l(),{data:i,isLoading:a,isError:o}=u({...R(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await ee({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{me(r,void 0,e),A.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{A.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow 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)(k,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,G.jsx)(be,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function ke(){let e=te(),t=le(),[n,r]=(0,W.useState)(()=>ie()),[i,a]=(0,W.useState)(null),[o,s]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{if(!e)return;let t=!0;return ne().then(e=>{t&&a(e)}),()=>{t=!1}},[e]),!e||!i?.available)return null;let c=async()=>{s(!0);try{if(n)I(!1),await oe(),r(!1);else{let e=ae();if(!e||!await re(e)){I(!1),r(!1);return}I(!0),r(!0)}}finally{s(!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 `,i.label,` 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 `,i.label,t&&` or your device passcode`,` instead of signing in again.`]})]}),(0,G.jsx)(k,{checked:n,onChange:()=>void c(),disabled:o})]})})}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)(k,{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)(O,{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)(w,{}),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=x.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=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>y(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[o,s]=(0,W.useState)(`conservative`),[c,d]=(0,W.useState)(`strict`),[f,p]=(0,W.useState)(!1),_=(0,W.useRef)(!1),[S,C]=(0,W.useState)(!1),w=(0,W.useRef)(null),T=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||_.current||(a(b(n.interactive).id),s(b(n.autonomous).id),d(b(n.headless).id),C(!0))},[n]),(0,W.useEffect)(()=>()=>{w.current!==null&&(clearTimeout(w.current),w.current=null,T.current?.(),T.current=null)},[]);let E=(0,W.useCallback)((n,r,i)=>{if(!e||!S)return;let a=x.find(e=>e.id===n)?.riskThreshold,o=x.find(e=>e.id===r)?.riskThreshold,s=x.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||v(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,S,t]),D=(0,W.useCallback)((e,t,n)=>{w.current!==null&&clearTimeout(w.current),T.current=()=>E(e,t,n),w.current=setTimeout(()=>{T.current?.(),w.current=null,T.current=null},500)},[E]),O=(0,W.useCallback)(e=>{_.current=!0,a(e),D(e,o,c)},[o,c,D]),k=(0,W.useCallback)(e=>{_.current=!0,s(e),D(i,e,c)},[i,c,D]),A=(0,W.useCallback)(e=>{_.current=!0,d(e),D(i,o,e)},[i,o,D]),j=x.find(e=>e.id===i),N=x.find(e=>e.id===o),P=x.find(e=>e.id===c),F=!e||!S;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)(M,{value:i,onChange:O,options:Y,disabled:F})}),j&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:j.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)(M,{value:o,onChange:k,options:Y,disabled:F})}),N&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:N.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)(M,{value:c,onChange:A,options:Y,disabled:F})}),P&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:P.description})]})]})]})]})]})}var X=e(s(),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 z(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`&&!e.defaultPrevented&&(e.preventDefault(),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)(T,{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)(E,{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)(M,{value:a,onChange:o,disabled:!0,options:Fe.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(O,{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)(O,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function Le(e){return e.origin===`default`&&!e.userModified}function Re(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function ze(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Be({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(!1),g=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([B(e),B(e,{origin:`default`})]);return Re(t,n)}return B(e)},[e]),_=(0,W.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,W.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[g,m]);let v=(0,W.useCallback)(async()=>{if(f)try{await ge(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`&&!e.defaultPrevented&&(e.preventDefault(),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)(k,{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)(E,{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)(C,{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)(D,{tone:ze(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,G.jsx)(D,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(D,{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)(S,{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)(w,{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)(j,{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 v(),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)(C,{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=L({platformHostedOnly:!0}),t=P(),n=t,a=N.use.user()?.id??null,[o]=fe(),[s]=pe(),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:ce(se.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:()=>{F(`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:()=>{F(`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)(M,{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-CUIsZfaf.js";import{t as o}from"./react-BFJW0bSv.js";import{F as s,t as c}from"./button-Dy5001j6.js";import{n as l}from"./QueryClientProvider-CMu7CkQU.js";import{t as u}from"./useQuery-Bz-fbQ-m.js";import{t as d}from"./useMutation-CXGTrp4W.js";import{t as f}from"./jsx-runtime-D3ZM-ToX.js";import{t as p}from"./cn-CJf7MmLX.js";import{t as m}from"./card-DRIctGVs.js";import{t as h}from"./chevron-down-BNidRDh1.js";import{t as g}from"./chevron-right-CANAtgGn.js";import{t as _}from"./loader-circle-DWWXcfTQ.js";import{c as v,o as y,r as b,t as x}from"./threshold-presets-B-RqvhUM.js";import{t as S}from"./pencil-Cm5DdeRM.js";import{t as C}from"./shield-check-CNsbiH1v.js";import{t as w}from"./trash-2-DfVRfykB.js";import{t as T}from"./x-D4O9yIS7.js";import{t as E}from"./notice-Dslxs3H6.js";import{t as D}from"./tag-gOOX7fbA.js";import{t as O}from"./input-tXUFa7Eo.js";import{t as k}from"./toggle-BEPV0rQM.js";import{n as A}from"./toast-BtFgiPe3.js";import{t as j}from"./confirm-dialog-j9o2h3xs.js";import{t as M}from"./dropdown-B3FHWc_n.js";import{n as N,r as P,v as F}from"./auth-store-C9aYqB9U.js";import{t as ee}from"./sdk.gen-ies09CqM.js";import{a as I,m as te,n as ne,o as re,r as ie,s as ae,t as oe}from"./native-biometric-DetUqtjl.js";import{d as se,u as ce}from"./routes-DrfnNoYS.js";import{f as le}from"./platform-detection-AHYibqOx.js";import{i as L,r as ue,t as de}from"./use-platform-gate-C5bNA5Pn.js";import{f as fe,p as pe}from"./prefs-CfRaGUUx.js";import{n as me,t as R}from"./react-query.gen-BtYBixpk.js";import{a as z,c as he,n as ge,o as _e,r as B,s as ve,u as ye}from"./trust-rules-api-Dbyz25hE.js";import{t as be}from"./platform-login-notice-DFmjUE9q.js";import{t as V}from"./use-active-assistant-id-JLsAfn3e.js";import{t as H}from"./detail-card-BElAV1cp.js";import{t as U}from"./setting-row-C4jX7c_4.js";import{t as xe}from"./settings-divider-BkLQFMlW.js";var W=e(o(),1),G=f(),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||_e(0)}]}function Te({row:e,onToggle:t}){return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(k,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,G.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,G.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function 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 ve(e.sourceKind):await he(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=L({platformHostedOnly:!0}),t=de(),n=ue(),r=l(),{data:i,isLoading:a,isError:o}=u({...R(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await ee({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{me(r,void 0,e),A.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{A.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow 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)(k,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,G.jsx)(be,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function ke(){let e=te(),t=le(),[n,r]=(0,W.useState)(()=>ie()),[i,a]=(0,W.useState)(null),[o,s]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{if(!e)return;let t=!0;return ne().then(e=>{t&&a(e)}),()=>{t=!1}},[e]),!e||!i?.available)return null;let c=async()=>{s(!0);try{if(n)I(!1),await oe(),r(!1);else{let e=ae();if(!e||!await re(e)){I(!1),r(!1);return}I(!0),r(!0)}}finally{s(!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 `,i.label,` 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 `,i.label,t&&` or your device passcode`,` instead of signing in again.`]})]}),(0,G.jsx)(k,{checked:n,onChange:()=>void c(),disabled:o})]})})}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)(k,{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)(O,{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)(w,{}),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=x.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=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>y(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[o,s]=(0,W.useState)(`conservative`),[c,d]=(0,W.useState)(`strict`),[f,p]=(0,W.useState)(!1),_=(0,W.useRef)(!1),[S,C]=(0,W.useState)(!1),w=(0,W.useRef)(null),T=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||_.current||(a(b(n.interactive).id),s(b(n.autonomous).id),d(b(n.headless).id),C(!0))},[n]),(0,W.useEffect)(()=>()=>{w.current!==null&&(clearTimeout(w.current),w.current=null,T.current?.(),T.current=null)},[]);let E=(0,W.useCallback)((n,r,i)=>{if(!e||!S)return;let a=x.find(e=>e.id===n)?.riskThreshold,o=x.find(e=>e.id===r)?.riskThreshold,s=x.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||v(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,S,t]),D=(0,W.useCallback)((e,t,n)=>{w.current!==null&&clearTimeout(w.current),T.current=()=>E(e,t,n),w.current=setTimeout(()=>{T.current?.(),w.current=null,T.current=null},500)},[E]),O=(0,W.useCallback)(e=>{_.current=!0,a(e),D(e,o,c)},[o,c,D]),k=(0,W.useCallback)(e=>{_.current=!0,s(e),D(i,e,c)},[i,c,D]),A=(0,W.useCallback)(e=>{_.current=!0,d(e),D(i,o,e)},[i,o,D]),j=x.find(e=>e.id===i),N=x.find(e=>e.id===o),P=x.find(e=>e.id===c),F=!e||!S;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)(M,{value:i,onChange:O,options:Y,disabled:F})}),j&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:j.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)(M,{value:o,onChange:k,options:Y,disabled:F})}),N&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:N.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)(M,{value:c,onChange:A,options:Y,disabled:F})}),P&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:P.description})]})]})]})]})]})}var X=e(s(),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 z(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`&&!e.defaultPrevented&&(e.preventDefault(),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)(T,{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)(E,{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)(M,{value:a,onChange:o,disabled:!0,options:Fe.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(O,{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)(O,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function Le(e){return e.origin===`default`&&!e.userModified}function Re(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function ze(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Be({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(!1),g=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([B(e),B(e,{origin:`default`})]);return Re(t,n)}return B(e)},[e]),_=(0,W.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,W.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[g,m]);let v=(0,W.useCallback)(async()=>{if(f)try{await ge(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`&&!e.defaultPrevented&&(e.preventDefault(),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)(k,{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)(E,{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)(C,{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)(D,{tone:ze(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,G.jsx)(D,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(D,{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)(S,{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)(w,{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)(j,{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 v(),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)(C,{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=L({platformHostedOnly:!0}),t=P(),n=t,a=N.use.user()?.id??null,[o]=fe(),[s]=pe(),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:ce(se.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:()=>{F(`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:()=>{F(`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)(M,{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-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{m as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{f as o}from"./local-mode-DHueA-BJ.js";import{t as s}from"./is-electron-DIlIrdJX.js";import{_ as c,i as l,n as u}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{m as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{f as o}from"./local-mode-DHueA-BJ.js";import{t as s}from"./is-electron-DIlIrdJX.js";import{_ as c,i as l,n as u}from"./auth-store-C9aYqB9U.js";import{b as d,m as f,v as p,x as m}from"./native-biometric-DetUqtjl.js";import{d as h,t as g}from"./routes-DrfnNoYS.js";import{d as _,m as v,p as y}from"./prefs-CfRaGUUx.js";import{o as b,r as x}from"./navigation-resolver-CzEY-5nE.js";import{l as S,n as C,o as w}from"./funnel-events-B9hFLlxs.js";import{t as T}from"./onboarding-layout-iPzXbZk1.js";import{t as E}from"./plugin-attribution-DAf_69AU.js";import{n as D,t as O}from"./consent-controls-Bs63UL5k.js";import{r as k,t as A}from"./checkout-continuation-CYDyrqci.js";var j=e(t(),1),M=a();function N({current:e,total:t,color:n}){return(0,M.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,M.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,M.jsx)(`div`,{className:`h-full w-full rounded-full bg-[var(--content-default)] ${r<=e?``:`opacity-20`}`})},r))})}function P(){let e=i(),[t]=r(),a=u.use.user()?.id??null,p=s(),g=f(),[P,I]=y(),L=P??!0,[R,z]=v(),[B,V]=_(),H=l(),U=k();(0,j.useEffect)(()=>{S()},[]);let W=t.get(`preview`)===`true`,G=(0,j.useCallback)(e=>{},[]),K=W?G:I,q=W?G:z,J=W?G:V,Y=(0,j.useCallback)(()=>{if(W)return;c({userId:a,tos:R,privacy:B,shareAnalytics:null,shareDiagnostics:L,hasPlatformSession:H}),w(C.privacyTos,{userId:a});let n=x(t.get(`returnTo`));if(n){e(n);return}let r=t.get(`hosting`),i=new URLSearchParams;r&&i.set(`hosting`,r);let s=t.get(E);s&&i.set(E,s);let l=i.toString(),u=`${b({isLocalHatch:o()&&r!==null&&r!==`vellum-cloud`})}${l?`?${l}`:``}`,f=m();if(f?.resumeAfterOnboarding===!0)if(U===`disabled`)d();else{let t=F(f);if(t){t.set(A,u),e(`${h.checkout}?${t.toString()}`);return}}e(u)},[B,H,W,e,t,L,U,R,a]);return(0,M.jsx)(T,{children:(0,M.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${p?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[g&&(0,M.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,M.jsx)(N,{current:2,total:3})}),(0,M.jsx)(`h1`,{className:p?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,M.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${p?`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,M.jsx)(D,{electron:p,showAnalytics:!1,shareAnalytics:!1,shareDiagnostics:L,onShareAnalyticsChange:G,onShareDiagnosticsChange:K,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,M.jsx)(O,{electron:p,privacyConsent:B,tosAccepted:R,onPrivacyChange:J,onTosChange:q,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,M.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${p?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,M.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!R||!B,onClick:Y,className:p?void 0:`h-11 text-base`,children:`Start`}),(0,M.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(o()?h.onboarding.hosting:h.onboarding.start),className:p?void 0:`h-11 text-base`,children:`Back`})]})]})})}function F(e){return e.kind===`package`?new URLSearchParams({[g]:e.packageKey}):e.storageTier===null?null:p({machineTier:e.machineTier,storageTier:e.storageTier,creditTier:e.creditTier})}export{P as PrivacyScreen};
|
package/dist/assets/{provider-callback-page-z2Cgryjl.js → provider-callback-page-DP5cKqPE.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CqtAGHQu.js";import{t as n}from"./react-BFJW0bSv.js";import{m as r,t as i,u as a}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as o}from"./jsx-runtime-D3ZM-ToX.js";import{E as s,f as c}from"./local-mode-DHueA-BJ.js";import{at as l,n as u}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CqtAGHQu.js";import{t as n}from"./react-BFJW0bSv.js";import{m as r,t as i,u as a}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as o}from"./jsx-runtime-D3ZM-ToX.js";import{E as s,f as c}from"./local-mode-DHueA-BJ.js";import{at as l,n as u}from"./auth-store-C9aYqB9U.js";import{c as d}from"./api-CGsj1Pig.js";import{T as f,j as p}from"./native-biometric-DetUqtjl.js";import{d as m}from"./routes-DrfnNoYS.js";import{i as h,s as g}from"./login-flow-CQhvCbQQ.js";import{t as _}from"./external-urls-BL9qY0s8.js";import{r as v,t as y}from"./account-shell-BmH96-Ie.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=h(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let t=await p(),r=f(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}=g({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-BFJW0bSv.js";import{m as n,t as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{n as o}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{m as n,t as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{n as o}from"./auth-store-C9aYqB9U.js";import{A as s,M as c,P as l}from"./native-biometric-DetUqtjl.js";import{d as u}from"./routes-DrfnNoYS.js";import{c as d,s as f}from"./login-flow-CQhvCbQQ.js";import{i as p,n as m,r as h,t as g}from"./account-shell-BmH96-Ie.js";import{t as _}from"./signup-shell-Dwuv81sx.js";var v=e(t(),1),y=a();function b(){let e=i(),[t]=n(),a=o.use.refreshSession(),b=t.get(`returnTo`),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!0),L=(0,v.useRef)(!1);(0,v.useEffect)(()=>{L.current||(L.current=!0,(async()=>{try{let t=await s();if(!t.ok){e(u.account.login,{replace:!0});return}S(t.data.user.email??``),w(t.data.user.username??``),E(t.data.user.first_name??``),O(t.data.user.last_name??``),I(!1)}catch{e(u.account.login,{replace:!0})}})())},[e]);let R=async()=>{let t=await l({email:x,username:C});if(!t.ok){if(c(t)){await a();let t=d(b,u.account.root);t.requiresFullPageNavigation?window.location.href=t.destination:e(t.destination);return}M(t.errors[0]?.message??`Failed to complete signup.`);return}await a();let n=f({returnTo:b,fallback:u.account.root,authIntent:`signup`});n.requiresFullPageNavigation?window.location.href=n.destination:e(n.destination)},z=async e=>{e.preventDefault(),M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}},B=async e=>{if(e.preventDefault(),k.trim()){M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}}};if(F)return(0,y.jsx)(g,{children:(0,y.jsx)(h,{title:`Completing signup...`,subtitle:`Please wait while we load your information.`})});if(x&&C){let e=k.trim().length>0&&!N;return(0,y.jsx)(_,{children:(0,y.jsxs)(`form`,{onSubmit:B,className:`signup-details__thread`,children:[(0,y.jsxs)(`h2`,{className:`signup-details__heading`,children:[`Almost there,`,(0,y.jsx)(`br`,{}),`one more detail`]}),j&&(0,y.jsx)(`p`,{className:`signup-details__error`,children:j}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`What should I call you?`,` `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`First name`,value:T,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`And your last name? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`Last name`,value:D,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`Your role `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,autoComplete:`organization-title`,placeholder:`e.g. Software Engineer`,value:k,onChange:e=>A(e.target.value),autoFocus:!0})]}),(0,y.jsx)(`div`,{className:`signup-details__step`,children:(0,y.jsx)(`button`,{type:`submit`,className:`signup-details__continue`,disabled:!e,children:N?`Setting up…`:`Continue →`})})]})})}return(0,y.jsxs)(g,{children:[(0,y.jsx)(h,{title:`Complete your account`,subtitle:`We need a few more details to finish setting up your account.`}),(0,y.jsxs)(m,{onSubmit:z,error:j,submitLabel:`Complete signup`,submittingLabel:`Completing...`,isSubmitting:N,footer:(0,y.jsx)(r,{to:u.account.login,className:`text-sm text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:`← Back to sign in`}),children:[(0,y.jsx)(p,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`Email`,value:x,onChange:e=>S(e.target.value),required:!0}),(0,y.jsx)(p,{id:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:C,onChange:e=>w(e.target.value),required:!0})]})]})}export{b as ProviderSignupPage};
|
package/dist/assets/{research-onboarding-route-C7jtWVgW.js → research-onboarding-route-DZF-B2Rk.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./capture-error-CqtAGHQu.js";import{t as r}from"./react-BFJW0bSv.js";import{F as i,t as a}from"./button-Dy5001j6.js";import{m as o,u as s}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as c}from"./QueryClientProvider-CMu7CkQU.js";import{t as l}from"./jsx-runtime-D3ZM-ToX.js";import{t as u}from"./cn-CJf7MmLX.js";import{t as d}from"./arrow-left-W84B6oJL.js";import{t as f}from"./arrow-right-ChqGeAaW.js";import{t as p}from"./dices-C3diFTyP.js";import{t as m}from"./loader-circle-DWWXcfTQ.js";import{t as h}from"./pencil-Cm5DdeRM.js";import{t as g}from"./plus-EJu6s6xR.js";import{t as _}from"./search-DL-2uX3K.js";import{t as v}from"./x-D4O9yIS7.js";import{t as y}from"./notice-Dslxs3H6.js";import{t as b}from"./tag-gOOX7fbA.js";import{t as x}from"./input-tXUFa7Eo.js";import{i as S,r as C,t as w}from"./dist-C68qFSny.js";import{n as T,t as E}from"./create-selectors-BfxF8Sx_.js";import{b as D,dt as ee,f as O,it as k,o as A,ot as j,w as M}from"./local-mode-DHueA-BJ.js";import{r as N}from"./api-errors-BRGPPSWw.js";import{_t as te,at as ne,gt as re,ht as ie,n as ae,rt as oe,st as se,vt as P}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./capture-error-CqtAGHQu.js";import{t as r}from"./react-BFJW0bSv.js";import{F as i,t as a}from"./button-Dy5001j6.js";import{m as o,u as s}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as c}from"./QueryClientProvider-CMu7CkQU.js";import{t as l}from"./jsx-runtime-D3ZM-ToX.js";import{t as u}from"./cn-CJf7MmLX.js";import{t as d}from"./arrow-left-W84B6oJL.js";import{t as f}from"./arrow-right-ChqGeAaW.js";import{t as p}from"./dices-C3diFTyP.js";import{t as m}from"./loader-circle-DWWXcfTQ.js";import{t as h}from"./pencil-Cm5DdeRM.js";import{t as g}from"./plus-EJu6s6xR.js";import{t as _}from"./search-DL-2uX3K.js";import{t as v}from"./x-D4O9yIS7.js";import{t as y}from"./notice-Dslxs3H6.js";import{t as b}from"./tag-gOOX7fbA.js";import{t as x}from"./input-tXUFa7Eo.js";import{i as S,r as C,t as w}from"./dist-C68qFSny.js";import{n as T,t as E}from"./create-selectors-BfxF8Sx_.js";import{b as D,dt as ee,f as O,it as k,o as A,ot as j,w as M}from"./local-mode-DHueA-BJ.js";import{r as N}from"./api-errors-BRGPPSWw.js";import{_t as te,at as ne,gt as re,ht as ie,n as ae,rt as oe,st as se,vt as P}from"./auth-store-C9aYqB9U.js";import{Cn as F,Kn as ce,Sn as I,V as le,kr as ue,qn as de,tt as L}from"./sdk.gen-CjtCuSlS.js";import{a as fe,o as R,r as pe}from"./api-CGsj1Pig.js";import{d as me}from"./routes-DrfnNoYS.js";import{n as he}from"./use-is-org-ready-3vHDbj4G.js";import{t as ge}from"./navigation-resolver-CzEY-5nE.js";import{o as _e,s as ve}from"./prechat-C4MZwKWX.js";import{t as ye}from"./browser-timezone-Br-HawKV.js";import{t as be}from"./identity-BplXBnQ5.js";import{c as xe}from"./conversation-list-fetchers-C6W8PkvR.js";import{i as Se}from"./conversation-cache-D1AJdwZd.js";import{t as Ce}from"./avatar-bundled-components-BvKt7I7O.js";import{i as we,n as Te,r as Ee,t as De}from"./research-onboarding-persistence-DwV372yy.js";import{a as Oe,c as ke,i as Ae,l as je,o as Me,s as z,t as B,u as Ne}from"./first-run-scope-CPJpXaWU.js";import{c as Pe,i as Fe}from"./funnel-events-B9hFLlxs.js";import{t as V}from"./proxy-DrtKRLtr.js";import{t as H}from"./AnimatePresence-CHo6D7IH.js";import{t as U}from"./use-reduced-motion-fR0m_opJ.js";import{i as Ie}from"./avatar-tone-D99t9DAP.js";import{n as Le,t as Re}from"./eye-bbox-CRs175_n.js";import{a as ze,i as Be}from"./research-facts-BUfgocIh.js";import{t as Ve}from"./onboarding-layout-iPzXbZk1.js";import{t as W}from"./animated-avatar-B0vCEKkY.js";import{n as G,t as He}from"./use-bundled-avatar-components-BcyasJwu.js";import{a as Ue,c as We,i as Ge,l as Ke,n as K,r as qe,t as Je,u as Ye}from"./latest-assistant-text-CwHBWP6s.js";import{n as q,t as Xe}from"./onboarding-step-layout-Bsc_5btV.js";import{a as Ze,i as Qe,n as $e,r as et,t as tt}from"./avatar-random-BR8w4F35.js";import{n as nt}from"./plugin-attribution-DAf_69AU.js";var J=e(r(),1),rt=`grounded`,it=12;function at(e,t){let n=e.slice(0,it).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"./local-settings-Bx7FsNo5.js";import{t}from"./jsx-runtime-D3ZM-ToX.js";import{t as n}from"./confirm-dialog-j9o2h3xs.js";import{E as r,S as i,a,d as o,f as s}from"./local-mode-DHueA-BJ.js";import{n as c}from"./resolved-assistants-store-C6oDdTxB.js";import{at as l,n as u}from"./auth-store-
|
|
1
|
+
import{o as e}from"./local-settings-Bx7FsNo5.js";import{t}from"./jsx-runtime-D3ZM-ToX.js";import{t as n}from"./confirm-dialog-j9o2h3xs.js";import{E as r,S as i,a,d as o,f as s}from"./local-mode-DHueA-BJ.js";import{n as c}from"./resolved-assistants-store-C6oDdTxB.js";import{at as l,n as u}from"./auth-store-C9aYqB9U.js";import{c as d,d as f}from"./api-CGsj1Pig.js";import{d as p}from"./routes-DrfnNoYS.js";import{a as m}from"./navigation-resolver-CzEY-5nE.js";import{t as h}from"./build-state-9uUe0jN5.js";import{t as g}from"./research-onboarding-persistence-DwV372yy.js";var _=`vellum_assistant_name`;function v(){let e=m(h(),{kind:`post-retire`});return e.action===`redirect`?e.to:p.welcome}async function y(t){try{let n=a().assistants.find(e=>e.assistantId===t);if(s()&&n&&o(n)){let e=await i(t);if(!e.ok)return{ok:!1,error:e.error||`Failed to retire assistant.`}}else{let e=await f(t);if(!(e.ok||e.status===404))return{ok:!1,error:typeof e.error?.detail==`string`?e.error.detail:`Failed to retire assistant.`};if(s())try{let e=await d();e.ok&&await r(e.data,l.getState().currentOrganizationId??void 0)}catch{}}return c.getState().remove(t),g(u.getState().user?.id??null),e(_),{ok:!0,nextRoute:v()}}catch{return{ok:!1,error:`Failed to retire assistant.`}}}var b=t();function x({open:e,isPending:t,extraMessage:r,onConfirm:i,onCancel:a}){return(0,b.jsx)(n,{open:e,title:`Retire Assistant`,message:(0,b.jsxs)(b.Fragment,{children:[`This will permanently retire this assistant and all of its data. You will need to go through the onboarding flow again to create a new one. This action cannot be undone.`,r]}),confirmLabel:`Retire`,destructive:!0,isPending:t,onConfirm:i,onCancel:a})}export{y as n,x as t};
|