@vellumai/web 0.9.0-dev.202606180546.485697b → 0.9.0-dev.202606180940.f141ea3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{account-page-BEUoRWs2.js → account-page-CgSEu6si.js} +1 -1
- package/dist/assets/add-credits-modal-ZjtQgz-s.js +1 -0
- package/dist/assets/advanced-page-CDMmsg53.js +1 -0
- package/dist/assets/ai-page-B6mKG9-y.js +1 -0
- package/dist/assets/{api-BN0sIMYQ.js → api-CaQT1t9I.js} +2 -2
- package/dist/assets/{api-key-screen-B7KKLr23.js → api-key-screen-Dvq6SmmD.js} +1 -1
- package/dist/assets/{app-html-cache-D_fJ0lrQ.js → app-html-cache-C7dPhzfJ.js} +1 -1
- package/dist/assets/{archive-page-CY_ntJvm.js → archive-page-B0gk0DjR.js} +1 -1
- package/dist/assets/{assistant-status-panel-DeGkE-O8.js → assistant-status-panel-BA4yU5xK.js} +1 -1
- package/dist/assets/{auth-store-BU_GGnGR.js → auth-store-woVh7RrN.js} +1 -1
- package/dist/assets/billing-page-CipWd-CL.js +3 -0
- package/dist/assets/{bookmarks-page-tqdNAPDN.js → bookmarks-page-BMRN4dp1.js} +1 -1
- package/dist/assets/{build-state-MuE7gZto.js → build-state-TfS2CPlU.js} +1 -1
- package/dist/assets/{command-palette-DzvDntYv.js → command-palette-ZkbTE9vO.js} +1 -1
- package/dist/assets/{command-palette-window-page-CykubI98.js → command-palette-window-page-DdO6688L.js} +1 -1
- package/dist/assets/{community-page-C0nE8F6E.js → community-page-D7JwUlhI.js} +1 -1
- package/dist/assets/{connect-page-15ueoBvs.js → connect-page-B3LNeOSl.js} +1 -1
- package/dist/assets/{contacts-gateway-BVHW7xBg.js → contacts-gateway-BKzt2hCg.js} +1 -1
- package/dist/assets/contacts-page-route-qaHy_BXU.js +1 -0
- package/dist/assets/{conversation-queries-BKw8Tv65.js → conversation-queries-CxYlym0R.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-Orv88Cth.js → danger-zone-redirect-page-BMUPU9Uk.js} +1 -1
- package/dist/assets/debug-page-BlceeOjF.js +2 -0
- package/dist/assets/{deploy-dialogs-CDjewUQX.js → deploy-dialogs-BQVQ0e_z.js} +1 -1
- package/dist/assets/developer-page-Bi5pKe82.js +1 -0
- package/dist/assets/devices-page-DTAB7FEt.js +1 -0
- package/dist/assets/{dictation-overlay-page-C8KfsCbC.js → dictation-overlay-page-Ct1mWZqi.js} +1 -1
- package/dist/assets/{document-viewer-page-C1TUHlfC.js → document-viewer-page-BPsatNFe.js} +1 -1
- package/dist/assets/earn-credits-modal-0Kt9kJjA.js +1 -0
- package/dist/assets/emails-page-DB4kkpft.js +1 -0
- package/dist/assets/{file-editor-DgPSVkjE.js → file-editor-CPTI4pVm.js} +1 -1
- package/dist/assets/general-page-CijTRHvO.js +1 -0
- package/dist/assets/hatching-screen-CFnIyEOm.js +1 -0
- package/dist/assets/home-page-route-vXjsHsMC.js +1 -0
- package/dist/assets/{hosting-screen-DmmNLnH5.js → hosting-screen-BLvtGAPO.js} +1 -1
- package/dist/assets/identity-page-route-DTF2W2nC.js +1 -0
- package/dist/assets/index-Cq1KPDcU.css +2 -0
- package/dist/assets/index-DXxd4eQM.js +138 -0
- package/dist/assets/infiniteQueryOptions-C6p49ZmI.js +1 -0
- package/dist/assets/inspect-page-DZ4bACLe.js +7 -0
- package/dist/assets/install-BY6jCD8h.js +1 -0
- package/dist/assets/integrations-page-SH_31bgA.js +1 -0
- package/dist/assets/{intelligence-layout-BGvR_MZc.js → intelligence-layout-C5GGuJth.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-D8NlwTb5.js → keyboard-shortcuts-page-BVoast44.js} +1 -1
- package/dist/assets/{library-detail-page-D2MhZKzm.js → library-detail-page-DduTKHkj.js} +1 -1
- package/dist/assets/library-page-D5_HZVu5.js +1 -0
- package/dist/assets/{login-flow-oROiary-.js → login-flow-Dw3PIsv0.js} +1 -1
- package/dist/assets/{login-page-D5YVSV2i.js → login-page-B-T8ribB.js} +1 -1
- package/dist/assets/{logout-page-CRclSKbp.js → logout-page-D5a0NMQ8.js} +1 -1
- package/dist/assets/{logs-layout-DU1naBDX.js → logs-layout-B6YGSDkq.js} +1 -1
- package/dist/assets/{memory-router-playground-page-Be_DGS5c.js → memory-router-playground-page-Bh1UIzFO.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-B9aylmC0.js → mobile-sidebar-drawer-DjYcps7T.js} +1 -1
- package/dist/assets/notifications-page-CYgSEdWL.js +1 -0
- package/dist/assets/{oauth-complete-page-DC3AeFT2.js → oauth-complete-page-Cmwj4oP-.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-DGDv0icT.js → oauth-popup-complete-page-B5j06nqz.js} +1 -1
- package/dist/assets/{pairing-page-C4CC3wTq.js → pairing-page-Dcd-EmK-.js} +1 -1
- package/dist/assets/{password-reset-page-5ZqRLxjO.js → password-reset-page-DTZC3O1A.js} +1 -1
- package/dist/assets/{platform-loopback-page-BlVfvSj9.js → platform-loopback-page-D2GKqkS3.js} +1 -1
- package/dist/assets/plugin-detail-page-D7xtc3pg.js +1 -0
- package/dist/assets/plugins-page-DRNvUGJ9.js +1 -0
- package/dist/assets/prechat-route-BZ3gJGaS.js +1 -0
- package/dist/assets/{prefs-CejllQWT.js → prefs-DziJ3-oV.js} +1 -1
- package/dist/assets/privacy-page-3P107rOe.js +1 -0
- package/dist/assets/{privacy-screen-CBV5krLi.js → privacy-screen-CJt3w53W.js} +1 -1
- package/dist/assets/{provider-callback-page-BOEqzZF8.js → provider-callback-page-BxanH_ms.js} +1 -1
- package/dist/assets/{provider-key-BnWreV7r.js → provider-key-oYh1M04a.js} +1 -1
- package/dist/assets/{provider-signup-page-DYanPAtG.js → provider-signup-page-CV07whKP.js} +1 -1
- package/dist/assets/react-query.gen-Dc9bPcAq.js +1 -0
- package/dist/assets/{research-mock-page-Bxa89LAI.js → research-mock-page-C47--8uz.js} +1 -1
- package/dist/assets/{research-onboarding-route-B20fHcF3.js → research-onboarding-route-D6t3Cr0J.js} +1 -1
- package/dist/assets/{review-terms-screen-DCcZEfB_.js → review-terms-screen-0tsnuovp.js} +1 -1
- package/dist/assets/{routes-Yq6id8Dc.js → routes-BnbYm-Mr.js} +1 -1
- package/dist/assets/schedules-B5g8s8wO.js +1 -0
- package/dist/assets/sdk.gen-ZXouuy0U.js +6 -0
- package/dist/assets/{select-assistant-screen-D6T0nA_-.js → select-assistant-screen-B-Rw2sEN.js} +1 -1
- package/dist/assets/{settings-layout-BAx2Mdz5.js → settings-layout-Bx25kDay.js} +1 -1
- package/dist/assets/share-feedback-modal-B_X6jb__.js +1 -0
- package/dist/assets/{sidebar-tree-DHVMjAQs.js → sidebar-tree-CeCcOFV9.js} +1 -1
- package/dist/assets/{signup-page-Bgu_-IfI.js → signup-page-e6GwOPiF.js} +1 -1
- package/dist/assets/skills-page-B25d4FIH.js +1 -0
- package/dist/assets/{sounds-page-DbGL-n6e.js → sounds-page-D3TmKrwm.js} +1 -1
- package/dist/assets/{step-indicator-dots-DlVTNbQw.js → step-indicator-dots-D5GsK2aj.js} +1 -1
- package/dist/assets/{subagent-detail-panel-CwnHh5x3.js → subagent-detail-panel-CwzUOZC1.js} +2 -2
- package/dist/assets/system-events-page-CebuxmuA.js +1 -0
- package/dist/assets/{system-events-redirect-page-BlI0jNBz.js → system-events-redirect-page-LgAPqevP.js} +1 -1
- package/dist/assets/{tiptap-document-editor-BE6lPNfv.js → tiptap-document-editor-Bnkv2457.js} +2 -2
- package/dist/assets/{tool-detail-panel-B7Bpm9yf.js → tool-detail-panel-nNE4IjA2.js} +2 -2
- package/dist/assets/trace-page-B5w2nToX.js +1 -0
- package/dist/assets/{upgrade-cancel-page-DgR6TZ07.js → upgrade-cancel-page-LDYAyg8m.js} +1 -1
- package/dist/assets/upgrade-success-page-IcRfZu70.js +1 -0
- package/dist/assets/usage-page-CrKxqhfB.js +1 -0
- package/dist/assets/use-is-org-ready-DFmevGN_.js +1 -0
- package/dist/assets/{use-onboarding-login-BEJ4EXYv.js → use-onboarding-login-DpIZN3Y5.js} +1 -1
- package/dist/assets/{use-plugin-drift-osxdTTBb.js → use-plugin-drift-B1mUU7pv.js} +1 -1
- package/dist/assets/{viewer-store-onOxtSWg.js → viewer-store-Bh4ICci0.js} +1 -1
- package/dist/assets/{voice-page-f_LXW_je.js → voice-page-BD5zq31S.js} +1 -1
- package/dist/assets/{weather-forecast-display-jyHGCNnE.js → weather-forecast-display-BNLiWqFx.js} +1 -1
- package/dist/assets/{welcome-screen-CknGxWKu.js → welcome-screen-DOkgmm44.js} +1 -1
- package/dist/assets/workspace-page-CVZzsH3t.js +1 -0
- package/dist/index.html +18 -18
- package/package.json +1 -1
- package/dist/assets/add-credits-modal-IfT1tMcI.js +0 -1
- package/dist/assets/advanced-page-Cq6cWB0r.js +0 -1
- package/dist/assets/ai-page-Dl8iXRH7.js +0 -1
- package/dist/assets/billing-page-Bc7kVI1Q.js +0 -3
- package/dist/assets/contacts-page-route-BCUn7VwE.js +0 -1
- package/dist/assets/debug-page-BtP8EDae.js +0 -2
- package/dist/assets/developer-page-CcON7FhP.js +0 -1
- package/dist/assets/devices-page-CgLt8LV4.js +0 -1
- package/dist/assets/earn-credits-modal-DQcbaAqD.js +0 -1
- package/dist/assets/emails-page-C1USNIPS.js +0 -1
- package/dist/assets/general-page-BilqgbnP.js +0 -1
- package/dist/assets/hatching-screen-DEw12Puw.js +0 -1
- package/dist/assets/home-page-route-BYnu71Ml.js +0 -1
- package/dist/assets/identity-page-route-Bbq1yUPK.js +0 -1
- package/dist/assets/index-D83cQ55g.css +0 -2
- package/dist/assets/index-DrU_8CGE.js +0 -138
- package/dist/assets/inspect-page-BMqnJH-8.js +0 -7
- package/dist/assets/install-DSYKf9y6.js +0 -1
- package/dist/assets/integrations-page-DiFlwVRO.js +0 -1
- package/dist/assets/library-page-CYc_GVyb.js +0 -1
- package/dist/assets/notifications-page-DtidAGx_.js +0 -1
- package/dist/assets/plugin-detail-page-CcLHfAqT.js +0 -1
- package/dist/assets/plugins-page-BC16X6Cr.js +0 -1
- package/dist/assets/prechat-route-C_1b4_as.js +0 -1
- package/dist/assets/privacy-page-CAIi8VoN.js +0 -1
- package/dist/assets/react-query.gen-CVtqZHeT.js +0 -1
- package/dist/assets/react-query.gen-Dn7kk2yq.js +0 -1
- package/dist/assets/schedules-Br1uopZH.js +0 -1
- package/dist/assets/sdk.gen-CK6-dkoS.js +0 -6
- package/dist/assets/share-feedback-modal-Ci45t2ey.js +0 -1
- package/dist/assets/skills-page-C07Xdz60.js +0 -1
- package/dist/assets/system-events-page-CuSFHpmf.js +0 -1
- package/dist/assets/trace-page-DpvUwiDS.js +0 -1
- package/dist/assets/upgrade-success-page-x8v_jQWi.js +0 -1
- package/dist/assets/usage-page-CRKAESGx.js +0 -1
- package/dist/assets/use-is-org-ready-BEoJYdiS.js +0 -1
- package/dist/assets/workspace-page-IGaiT69s.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{i as n,n as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./cn-DvW5mxZR.js";import{t as s}from"./typography-BscuIPxA.js";import"./src-C4Sj609L.js";import{a as c}from"./routes-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{i as n,n as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./cn-DvW5mxZR.js";import{t as s}from"./typography-BscuIPxA.js";import"./src-C4Sj609L.js";import{a as c}from"./routes-BnbYm-Mr.js";import{n as l}from"./use-is-mobile-ikBu--_t.js";import{t as u}from"./assistant-identity-store-bwfN6pDI.js";import{t as d}from"./assistant-feature-flag-store-ClCVaYet.js";import{kt as f}from"./index-DXxd4eQM.js";import{t as p}from"./page-shell-zjplma_p.js";var m=e(t(),1),h=a(),g=[{label:`Identity`,to:c.identity},{label:`Skills`,to:c.skills},{label:`Workspace`,to:c.workspace},{label:`Contacts`,to:c.contacts.root}],_={label:`Plugins`,to:c.plugins};function v(){let e=u.use.name(),t=d.use.hasHydrated(),a=d.use.externalPlugins(),{pathname:c}=i(),v=l(),y=f.use.setTopBarCenter();(0,m.useEffect)(()=>(y(v?(0,h.jsxs)(s,{variant:`body-medium-default`,className:`truncate text-[var(--content-secondary)]`,children:[`About `,e||`Assistant`]}):null),()=>{y(null)}),[v,e,y]);let b=t&&a?[g[0],_,...g.slice(1)]:g;return(0,h.jsxs)(p,{children:[(0,h.jsxs)(`h1`,{className:`mb-4 shrink-0 text-title-large text-[var(--content-default)] max-md:hidden`,children:[`About `,e||`Assistant`]}),(0,h.jsx)(`nav`,{className:`mb-4 flex shrink-0 items-center overflow-x-auto border-b border-[var(--border-base)]`,style:{scrollbarWidth:`none`,WebkitOverflowScrolling:`touch`},"aria-label":`About assistant sections`,children:b.map(({label:e,to:t})=>{let n=c===t||c.startsWith(t+`/`);return(0,h.jsx)(r,{to:t,className:o(`relative -mb-px inline-flex cursor-pointer items-center gap-1.5 border-b-2 border-transparent bg-transparent px-2.5 py-[7px]`,`text-body-medium-default whitespace-nowrap`,`text-[var(--content-secondary)] transition-colors`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-0`,`hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`,n&&`border-[var(--border-active)] text-[var(--primary-active)]`,n&&`hover:bg-transparent`),children:e},t)})}),(0,h.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:(0,h.jsx)(n,{})})]})}export{v as IntelligenceLayout};
|
package/dist/assets/{keyboard-shortcuts-page-D8NlwTb5.js → keyboard-shortcuts-page-BVoast44.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./card-BibIM9x3.js";import{t as o}from"./notice-G5Imd5pC.js";import{t as s}from"./shortcut-keys-WNQqv5_X.js";import{t as c}from"./is-electron-BuSDabCt.js";import{t as l}from"./x-Bmx5Uey2.js";import{a as u}from"./routes-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./card-BibIM9x3.js";import{t as o}from"./notice-G5Imd5pC.js";import{t as s}from"./shortcut-keys-WNQqv5_X.js";import{t as c}from"./is-electron-BuSDabCt.js";import{t as l}from"./x-Bmx5Uey2.js";import{a as u}from"./routes-BnbYm-Mr.js";import{la as d}from"./index-DXxd4eQM.js";var f=e(t(),1);async function p(){if(!c())return[];let e=window.vellum;return e?.hotkeys?e.hotkeys.get():[]}async function m(e,t){if(!c())return;let n=window.vellum;n?.hotkeys&&await n.hotkeys.set(e,t)}function h(e){if(!c())return()=>{};let t=window.vellum;return t?.hotkeys?t.hotkeys.onChange(e):()=>{}}var g={ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`,Enter:`Return`,NumpadEnter:`Return`,Space:`Space`,Tab:`Tab`,Escape:`Escape`,Backspace:`Backspace`,Delete:`Delete`,Insert:`Insert`,Home:`Home`,End:`End`,PageUp:`PageUp`,PageDown:`PageDown`,Minus:`-`,Equal:`=`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Semicolon:`;`,Quote:`'`,Backquote:"`",Comma:`,`,Period:`.`,Slash:`/`},_=new Set([`MetaLeft`,`MetaRight`,`ControlLeft`,`ControlRight`,`AltLeft`,`AltRight`,`ShiftLeft`,`ShiftRight`]),v=e=>{let t=e.code;return _.has(t)?null:/^Key[A-Z]$/.test(t)?t.slice(3):/^Digit[0-9]$/.test(t)?t.slice(5):/^Numpad[0-9]$/.test(t)?`num${t.slice(6)}`:/^F[0-9]{1,2}$/.test(t)?t:g[t]??null},y=e=>{let t=v(e);if(t===null)return null;let n=[];return e.metaKey&&n.push(`CmdOrCtrl`),e.ctrlKey&&n.push(`Control`),e.altKey&&n.push(`Alt`),e.shiftKey&&n.push(`Shift`),[...n,t].join(`+`)},b=(e,t,n)=>n===``?null:e.find(e=>e.key!==t&&e.accelerator===n)??null,x=i(),S=[{scope:`global`,title:`Global shortcuts`,description:`Work anywhere, even when Vellum is in the background.`},{scope:`menu`,title:`App shortcuts`,description:`Work while a Vellum window is focused.`}];function C({hotkey:e,recording:t,conflictLabel:r,onStartRecording:i,onCancelRecording:a,onReset:o,onRemove:c}){let u=e.accelerator===``,f=e.override!==null;return(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-2`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`div`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e.label}),r!==null&&(0,x.jsxs)(`div`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:[`Already used by `,r]})]}),(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,x.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Recording… press a shortcut, or Esc to cancel`}):u?(0,x.jsx)(`span`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`Disabled`}):(0,x.jsx)(s,{accelerator:e.accelerator}),t?(0,x.jsx)(n,{variant:`ghost`,size:`compact`,onClick:a,children:`Cancel`}):(0,x.jsx)(n,{variant:`outlined`,size:`compact`,onClick:i,"aria-label":`Record shortcut for ${e.label}`,children:`Record`}),(0,x.jsx)(n,{variant:`ghost`,size:`compact`,disabled:!f,leftIcon:(0,x.jsx)(d,{className:`h-3.5 w-3.5`}),onClick:o,"aria-label":`Reset ${e.label} to default`}),(0,x.jsx)(n,{variant:`ghost`,size:`compact`,disabled:u,leftIcon:(0,x.jsx)(l,{className:`h-3.5 w-3.5`}),onClick:c,"aria-label":`Remove ${e.label} binding`})]})]})}function w(){let[e,t]=(0,f.useState)([]),[n,i]=(0,f.useState)(null),[s,l]=(0,f.useState)(null),d=(0,f.useCallback)(()=>{p().then(t)},[]);(0,f.useEffect)(()=>(d(),h(t)),[d]);let g=(0,f.useCallback)(()=>{i(null),l(null)},[]);(0,f.useEffect)(()=>{if(n===null)return;let t=t=>{if(t.preventDefault(),t.stopPropagation(),t.code===`Escape`){g();return}let r=y(t);if(r===null)return;let i=b(e,n,r);if(i!==null){l({key:n,label:i.label});return}m(n,r).then(d),g()};return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[n,e,d,g]);let _=(0,f.useCallback)(e=>{l(null),i(e)},[]),v=(0,f.useCallback)(t=>{let n=b(e,t,e.find(e=>e.key===t)?.defaultAccelerator??``);if(n!==null){i(null),l({key:t,label:n.label});return}g(),m(t,null).then(d)},[e,d,g]),w=(0,f.useCallback)(e=>{g(),m(e,``).then(d)},[d,g]),T=(0,f.useMemo)(()=>S.map(t=>({...t,commands:e.filter(e=>e.rebindable&&e.scope===t.scope)})).filter(e=>e.commands.length>0),[e]);return c()?(0,x.jsxs)(`div`,{className:`space-y-4`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Keyboard Shortcuts`}),(0,x.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Customize the shortcuts for Vellum's commands.`})]}),s!==null&&(0,x.jsxs)(o,{tone:`warning`,children:[`That shortcut is already used by `,s.label,`.`,` `,n===null?`Remove or change that binding before resetting.`:`Pick a different combination, or press Esc to cancel.`]}),T.map(e=>(0,x.jsxs)(a,{bordered:!0,children:[(0,x.jsxs)(`div`,{className:`mb-2`,children:[(0,x.jsx)(`div`,{className:`text-body-medium-emphasised text-[var(--content-default)]`,children:e.title}),(0,x.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,x.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:e.commands.map(e=>(0,x.jsx)(C,{hotkey:e,recording:n===e.key,conflictLabel:s!==null&&s.key===e.key?s.label:null,onStartRecording:()=>_(e.key),onCancelRecording:g,onReset:()=>v(e.key),onRemove:()=>w(e.key)},e.key))})]},e.scope))]}):(0,x.jsx)(r,{replace:!0,to:u.settings.general})}export{w as KeyboardShortcutsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,p as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import"./src-C4Sj609L.js";import{n as a}from"./toast-DLWkiWW6.js";import{t as o}from"./loader-circle-CdxxVJvk.js";import{n as s}from"./sdk.gen-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,p as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import"./src-C4Sj609L.js";import{n as a}from"./toast-DLWkiWW6.js";import{t as o}from"./loader-circle-CdxxVJvk.js";import{n as s}from"./sdk.gen-ZXouuy0U.js";import{a as c}from"./routes-BnbYm-Mr.js";import{r as l}from"./app-html-cache-C7dPhzfJ.js";import{Y as u,r as d,tt as f}from"./index-DXxd4eQM.js";import{t as p}from"./use-active-assistant-id-BFElIHKJ.js";var m=e(t(),1),h=i();function g(){let{appId:e}=r(),t=p(),i=n(),[g,_]=(0,m.useState)(null),[v,y]=(0,m.useState)(null),[b,x]=(0,m.useState)(!1),S=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(e)return S.current=e,_(null),y(null),s({path:{assistant_id:t,id:e},throwOnError:!0}).then(({data:n})=>{S.current===e&&(l(t,n.appId,n.html),_({appId:n.appId,dirName:n.dirName,name:n.name,html:n.html}))}).catch(t=>{S.current===e&&y(t instanceof Error?t.message:`Failed to open app`)}),()=>{S.current=null}},[t,e]);let C=(0,m.useCallback)(()=>{i(c.library.root)},[i]),w=d(),T=(0,m.useCallback)(()=>{g&&w(g)},[g,w]),E=(0,m.useCallback)(async()=>{if(!(!g||b)){x(!0);try{await f(t,g.appId,g.name),a.success(`App exported`,{description:`${g.name}.vellum`})}catch(e){a.error(`Failed to share app`,{description:e instanceof Error?e.message:void 0})}finally{x(!1)}}},[t,g,b]);return e?v?(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-4`,children:[(0,h.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:v}),(0,h.jsx)(`button`,{type:`button`,onClick:C,className:`text-body-medium-default text-[var(--primary-base)] underline`,children:`Back to Library`})]}):g?(0,h.jsx)(u,{appId:g.appId,appName:g.name,html:g.html,assistantId:t,onClose:C,onEdit:T,onShare:E,isSharing:b,enableFullscreen:!0}):(0,h.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,h.jsx)(o,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}):null}export{g as LibraryDetailPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./menu-BvyV91Np.js";import"./src-C4Sj609L.js";import{t as c}from"./confirm-dialog-DbNUkFt6.js";import{t as l}from"./input-CwdmSRlD.js";import{n as u,t as d}from"./panel-item-BFOUNXY1.js";import{n as f}from"./toast-DLWkiWW6.js";import{t as p}from"./arrow-up-DUZaEAPa.js";import{t as m}from"./globe-Pg4412Nf.js";import{s as h,t as g}from"./sdk.gen-ZXouuy0U.js";import{C as _,n as v,t as y}from"./react-query.gen-Dc9bPcAq.js";import{a as b}from"./routes-BnbYm-Mr.js";import{n as x}from"./use-is-mobile-ikBu--_t.js";import{n as S,t as C}from"./app-html-cache-C7dPhzfJ.js";import{t as w}from"./misc-9E89XAY7.js";import{Gi as T,Ja as E,Ki as D,Pa as O,Ua as k,_a as A,_t as j,et as M,ga as N,oa as P,tt as F,z as I}from"./index-DXxd4eQM.js";import{t as L}from"./deploy-dialogs-BQVQ0e_z.js";import{t as R}from"./use-active-assistant-id-BFElIHKJ.js";import{t as z}from"./page-shell-zjplma_p.js";import{t as B}from"./format-date-Oi80uFkI.js";var V=e(t(),1),H=o();function U({app:e,isDeleting:t,onConfirm:n,onCancel:r}){return(0,H.jsx)(c,{open:e!==null,title:`Delete app`,message:e?`"${e.name}" will be permanently removed.`:``,confirmLabel:t?`Deleting…`:`Delete`,destructive:!0,onConfirm:n,onCancel:r})}function W(e){return e===1?`1 word`:`${e} words`}function G({document:e,onOpen:t}){return(0,H.jsxs)(`div`,{className:`group relative flex flex-col gap-2`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>t(e.surfaceId),className:w(`relative flex w-full cursor-pointer flex-col items-center justify-center gap-2 overflow-hidden rounded-xl border border-[var(--border-base)] bg-[var(--surface-base)]`,`aspect-[16/10]`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`),children:[(0,H.jsx)(k,{size:34,className:`text-[var(--content-tertiary)]`}),(0,H.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:W(e.wordCount)})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>t(e.surfaceId),className:`flex cursor-pointer flex-col gap-0.5 px-0.5 text-left outline-none`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-large-default text-[color:var(--content-emphasised)]`,children:e.title}),(0,H.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:B(new Date(e.updatedAt))})]})]})}function K({fileInputRef:e,isImporting:t,onImportBundle:r,onNewConversation:i}){return(0,H.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-4 py-24`,children:[(0,H.jsx)(`input`,{ref:e,type:`file`,accept:`.vellum`,className:`hidden`,onChange:r}),(0,H.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-xl bg-[var(--surface-base)]`,children:(0,H.jsx)(O,{size:32,className:`text-[var(--content-tertiary)]`})}),(0,H.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Your library is empty`}),(0,H.jsx)(`p`,{className:`max-w-md text-center text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:`Ask your assistant to build something, or import a shared app`}),(0,H.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[i?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(n,{variant:`primary`,size:`regular`,onClick:i,children:`New Conversation`}),(0,H.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:`or`})]}):null,(0,H.jsxs)(n,{variant:`outlined`,size:`regular`,onClick:()=>e.current?.click(),disabled:t,children:[t?(0,H.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`}):(0,H.jsx)(T,{size:14}),(0,H.jsx)(`span`,{className:`ml-1.5`,children:`Import .vellum File`})]})]})]})}function q({app:e,assistantId:t,isPinned:n,onOpen:r,onPin:i,onDelete:a,onDeploy:o,justImported:s,onAnimationEnd:c}){let[l,u]=(0,V.useState)(!1),d=(0,V.useCallback)(()=>S(t,e.id),[t,e.id]),p=(0,V.useCallback)(async()=>{if(!l){u(!0);try{await F(t,e.id,e.name),f.success(`App exported`,{description:`${e.name}.vellum`})}catch(e){f.error(`Failed to share app`,{description:e instanceof Error?e.message:void 0})}finally{u(!1)}}},[t,e.id,e.name,l]),[m,h]=(0,V.useState)(!1),g=x();return(0,H.jsxs)(`div`,{className:w(`group relative flex flex-col gap-2`,s&&`animate-[card-entrance_400ms_ease-out]`),onAnimationEnd:s?c:void 0,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),className:w(`relative w-full cursor-pointer overflow-hidden rounded-xl`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`),children:(0,H.jsx)(I,{name:e.name,icon:e.icon,loadHtml:d})}),(0,H.jsx)(`div`,{className:w(`absolute right-2 top-2 z-20 transition-opacity`,`max-md:opacity-100`,`md:group-hover:opacity-100 md:group-focus-within:opacity-100`,m?`opacity-100`:`md:opacity-0`),children:(0,H.jsx)(J,{appName:e.name,isPinned:n,open:m,onOpenChange:h,onPin:()=>i(e),onDelete:a?()=>a(e):void 0,onShare:p,onDeploy:o,isMobile:g})}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:`flex cursor-pointer flex-col gap-0.5 px-0.5 text-left outline-none`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-large-default text-[color:var(--content-emphasised)]`,children:e.name}),(0,H.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:B(new Date(e.createdAt))})]})]})}function J({appName:e,isPinned:t,open:r,onOpenChange:i,onPin:a,onDelete:o,onShare:c,onDeploy:l,isMobile:f}){return f?(0,H.jsxs)(u.Root,{open:r,onOpenChange:i,children:[(0,H.jsx)(u.Trigger,{asChild:!0,children:(0,H.jsx)(n,{variant:`primary`,size:`compact`,iconOnly:(0,H.jsx)(E,{}),"aria-label":`App actions`,onClick:e=>e.stopPropagation()})}),(0,H.jsxs)(u.Content,{children:[(0,H.jsx)(u.Header,{className:`sr-only`,children:(0,H.jsx)(u.Title,{children:e})}),(0,H.jsxs)(u.Body,{className:`pt-0`,children:[(0,H.jsx)(d,{icon:t?A:N,label:t?`Unpin`:`Pin`,onSelect:()=>{i(!1),a()}}),c?(0,H.jsx)(d,{icon:p,label:(0,H.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,H.jsx)(`span`,{children:`Share`}),(0,H.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Export as .vellum file`})]}),onSelect:()=>{i(!1),c()}}):null,l?(0,H.jsx)(d,{icon:m,label:(0,H.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,H.jsx)(`span`,{children:`Deploy to Vercel`}),(0,H.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Publish as a static page`})]}),onSelect:()=>{i(!1),l()}}):null,o?(0,H.jsx)(d,{icon:D,label:`Delete`,onSelect:()=>{i(!1),o()}}):null]})]})]}):(0,H.jsxs)(s.Root,{open:r,onOpenChange:i,children:[(0,H.jsx)(s.Trigger,{asChild:!0,children:(0,H.jsx)(n,{variant:`primary`,size:`compact`,iconOnly:(0,H.jsx)(E,{}),"aria-label":`App actions`,onClick:e=>e.stopPropagation()})}),(0,H.jsxs)(s.Content,{align:`end`,sideOffset:4,children:[(0,H.jsx)(s.Item,{leftIcon:t?(0,H.jsx)(A,{size:14}):(0,H.jsx)(N,{size:14}),onSelect:()=>a(),className:`whitespace-nowrap`,children:t?`Unpin`:`Pin`}),c?(0,H.jsx)(s.Item,{leftIcon:(0,H.jsx)(p,{size:14}),onSelect:()=>c(),className:`whitespace-nowrap`,children:`Share`}):null,l?(0,H.jsx)(s.Item,{leftIcon:(0,H.jsx)(m,{size:14}),onSelect:()=>l(),className:`whitespace-nowrap`,children:`Deploy to Vercel`}):null,o?(0,H.jsx)(s.Item,{leftIcon:(0,H.jsx)(D,{size:14,className:`text-red-600`}),onSelect:()=>o(),className:`whitespace-nowrap text-red-600 data-[highlighted]:text-red-700`,children:`Delete`}):null]})]})}function Y({title:e,apps:t,assistantId:n,pinnedAppIds:r,lastImportedAppId:i,onOpen:a,onPin:o,onDelete:s,onDeploy:c,onAnimationEnd:l}){return t.length===0?null:(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h2`,{className:`mb-4 text-body-small-emphasised text-[color:var(--content-secondary)]`,children:e}),(0,H.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(max(220px,calc((100%-6rem)/5)),1fr))] gap-6`,children:t.map(e=>(0,H.jsx)(q,{app:e,assistantId:n,isPinned:r.has(e.id),onOpen:a,onPin:o,onDelete:s,justImported:e.id===i,onAnimationEnd:l,onDeploy:c?()=>c(e.id):void 0},e.id))})]})}var X=(e,t)=>t.updatedAt-e.updatedAt||t.createdAt-e.createdAt;function Z(e){let t=j.use.pinnedAppIds(),{data:n=[],isLoading:r,error:i}=a({...y({path:{assistant_id:e}}),select:e=>e.apps}),{data:o=[],isLoading:s,error:c}=a({..._({path:{assistant_id:e}}),select:e=>e.documents}),l=r||s,u=i&&c?i instanceof Error?i.message:`Failed to load library`:null,[d,f]=(0,V.useState)(``),p=(0,V.useMemo)(()=>{if(!d.trim())return n;let e=d.toLowerCase();return n.filter(t=>t.name.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e))},[n,d]);return{apps:n,documents:o,filteredApps:p,pinnedApps:(0,V.useMemo)(()=>p.filter(e=>t.has(e.id)).sort(X),[p,t]),recentApps:(0,V.useMemo)(()=>p.filter(e=>!t.has(e.id)).sort(X),[p,t]),filteredDocuments:(0,V.useMemo)(()=>{if(!d.trim())return o;let e=d.toLowerCase();return o.filter(t=>t.title.toLowerCase().includes(e))},[o,d]),searchText:d,setSearchText:f,loading:l,error:u}}async function Q(e,t){let{data:n,error:r,response:i}=await h({path:{assistant_id:e},body:t,bodySerializer:e=>e,headers:{"Content-Type":`application/octet-stream`},throwOnError:!1});if(!i||!i.ok){let e=(r&&typeof r==`object`&&`message`in r?r.message:null)??`Failed to import app.`;throw Error(e)}return n}function $({assistantId:e,assistantName:t,title:r,onNewConversation:a,onOpenDocument:o,onOpenApp:s}){let c=i(),u=j.use.togglePin(),d=j.use.pinnedAppIds(),p=M.use.isDeploying(),{apps:m,documents:h,filteredApps:_,pinnedApps:y,recentApps:b,filteredDocuments:x,searchText:w,setSearchText:E,loading:D,error:O}=Z(e),[k,A]=(0,V.useState)(null),[N,F]=(0,V.useState)(!1),I=(0,V.useCallback)(async()=>{let t=k;if(!(!t||N)){F(!0);try{await g({path:{assistant_id:e,id:t.id},throwOnError:!0}),C(e,t.id),c.invalidateQueries({queryKey:v({path:{assistant_id:e}})}),d.has(t.id)&&u(t),A(null)}catch(e){f.error(e instanceof Error?e.message:`Failed to delete app`)}finally{F(!1)}}},[k,N,e,d,u,c]),R=(0,V.useCallback)(()=>{N||A(null)},[N]),z=(0,V.useRef)(null),[B,W]=(0,V.useState)(!1),q=(0,V.useCallback)(async t=>{let n=t.target.files?.[0];if(!(!n||B)){W(!0);try{let t=await Q(e,n);await c.invalidateQueries({queryKey:v({path:{assistant_id:e}})}),f.success(t.name+` imported`),s(t.appId)}catch(e){f.error(e instanceof Error?e.message:`Failed to import app`)}finally{W(!1),z.current&&(z.current.value=``)}}},[e,B,c,s]),J=(0,V.useCallback)(async t=>{if(p)return;let n=m.find(e=>e.id===t)?.name??`this app`;try{let r=await S(e,t);M.getState().deployApp(e,t,n,r)}catch{M.getState().deployApp(e,t,n,``)}},[e,p,m]),X=(0,V.useCallback)(e=>u(e),[u]);return D?(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,H.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--primary-base)]`,role:`status`,"aria-label":`Loading apps`})}):O?(0,H.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-4`,children:[(0,H.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:O}),(0,H.jsx)(`button`,{type:`button`,className:`rounded-lg bg-[var(--primary-base)] px-4 py-2 text-body-medium-default text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)]`,onClick:()=>window.location.reload(),children:`Retry`})]}):m.length===0&&h.length===0?(0,H.jsx)(K,{fileInputRef:z,isImporting:B,onImportBundle:q,onNewConversation:a?()=>a():void 0}):(0,H.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`mb-4 flex shrink-0 items-center justify-between gap-4`,children:[r?(0,H.jsx)(`h1`,{className:`text-title-large text-[var(--content-default)]`,children:r}):(0,H.jsx)(`span`,{}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`input`,{ref:z,type:`file`,accept:`.vellum`,className:`hidden`,onChange:q}),(0,H.jsxs)(n,{variant:`outlined`,size:`regular`,onClick:()=>z.current?.click(),disabled:B,children:[B?(0,H.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`}):(0,H.jsx)(T,{size:14}),(0,H.jsx)(`span`,{className:`ml-1.5`,children:`Import`})]})]})]}),(0,H.jsx)(`div`,{className:`mb-6 shrink-0`,children:(0,H.jsx)(l,{fullWidth:!0,type:`text`,placeholder:`Search your library`,value:w,onChange:e=>E(e.target.value),leftIcon:(0,H.jsx)(P,{size:16})})}),(0,H.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:_.length===0&&x.length===0?(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16`,children:[(0,H.jsx)(P,{size:32,className:`mb-4 text-[var(--content-tertiary)]`}),(0,H.jsxs)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`No apps or documents matched “`,w,`”`]})]}):(0,H.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,H.jsx)(Y,{title:`Pinned`,apps:y,assistantId:e,pinnedAppIds:d,onOpen:s,onPin:X,onDelete:A,onDeploy:J}),(0,H.jsx)(Y,{title:`Recents`,apps:b,assistantId:e,pinnedAppIds:d,onOpen:s,onPin:X,onDelete:A,onDeploy:J}),x.length>0?(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h2`,{className:`mb-4 text-body-small-emphasised text-[color:var(--content-secondary)]`,children:`Documents`}),(0,H.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(max(220px,calc((100%-6rem)/5)),1fr))] gap-6`,children:x.map(e=>(0,H.jsx)(G,{document:e,onOpen:e=>{o&&o(e)}},e.surfaceId))})]}):null]})}),(0,H.jsx)(L,{assistantId:e,assistantName:t,onStartConversation:a}),(0,H.jsx)(U,{app:k,isDeleting:N,onConfirm:I,onCancel:R})]})}function ee(){let e=R(),t=r();return(0,H.jsx)(z,{children:(0,H.jsx)($,{assistantId:e,title:`Library`,onNewConversation:(0,V.useCallback)(e=>{t(b.assistant)},[t]),onOpenDocument:(0,V.useCallback)(e=>{t(b.document(e))},[t]),onOpenApp:(0,V.useCallback)(e=>{t(b.library.app(e))},[t])})})}export{ee as LibraryPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./routes-
|
|
1
|
+
import{a as e}from"./routes-BnbYm-Mr.js";import{r as t,t as n}from"./build-state-TfS2CPlU.js";var r=`workos`,i=e.account.providerCallback,a=`authIntent`;function o(e,t={}){let n=new URLSearchParams;e&&n.set(`returnTo`,e),t.authIntent&&n.set(a,t.authIntent);let r=n.toString();return r?`${i}?${r}`:i}function s(e){return e.get(a)===`signup`?`signup`:`login`}function c(e){return e.startsWith(`http`)||e.startsWith(`/accounts/`)||e.startsWith(`/v1/`)||e.startsWith(`/_allauth/`)}function l(e,t){return u({returnTo:e,fallback:t,authIntent:`login`})}function u({returnTo:e,fallback:r,authIntent:i}){let a=t(n(),{kind:`post-auth`,authIntent:i,returnTo:e,fallback:r}),o=a.action===`redirect`?a.to:r;return{destination:o,requiresFullPageNavigation:c(o)}}export{u as a,s as i,r as n,l as o,o as r,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{h as r,t as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./cn-DvW5mxZR.js";import"./src-C4Sj609L.js";import{D as s,O as c,k as l}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{h as r,t as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./cn-DvW5mxZR.js";import"./src-C4Sj609L.js";import{D as s,O as c,k as l}from"./auth-store-woVh7RrN.js";import{a as u}from"./routes-BnbYm-Mr.js";import{n as d,r as f}from"./login-flow-Dw3PIsv0.js";import{t as p}from"./public-asset-y2pjkMTl.js";import{H as m,Oa as h,R as g}from"./index-DXxd4eQM.js";var _=e(t(),1),v=a();function y({children:e}){return(0,v.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:[(0,v.jsx)(`img`,{src:p(`/vellum-logo.svg`),alt:`Vellum`,width:220,height:66,className:`block dark:hidden`}),(0,v.jsx)(`img`,{src:p(`/vellum-logo-white.svg`),alt:`Vellum`,width:220,height:66,className:`hidden dark:block`}),e,(0,v.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute left-1/2 w-full max-w-[900px] -translate-x-1/2`,style:{bottom:0},children:(0,v.jsx)(`img`,{src:p(`/login-background-characters.svg`),alt:``,width:880,height:182,className:`h-auto w-full`})})]})}function b(){return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`div`,{className:`pointer-events-none absolute top-[120px] left-1/2 z-0 -translate-x-1/2`,children:(0,v.jsx)(`img`,{src:p(`/vellum-logo-white.svg`),alt:`Vellum`,width:92,height:28})}),(0,v.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-0 bottom-0 left-1/2 z-0 w-full max-w-[1100px] -translate-x-1/2`,children:(0,v.jsx)(`img`,{src:p(`/login-background-characters.svg`),alt:``,width:880,height:182,className:`h-auto w-full`})})]})}var x=`flex w-full max-w-[448px] flex-col gap-6 rounded-lg border border-[var(--border-disabled)] bg-[var(--surface-lift)] p-6`;function S({children:e}){return(0,v.jsx)(`div`,{className:x,children:e})}function C({children:e}){return(0,v.jsx)(`h1`,{className:`text-title-large text-center text-[var(--content-emphasised)]`,children:e})}function w({children:e,className:t}){return(0,v.jsx)(`p`,{className:o(`text-body-small-default text-center text-[var(--system-negative-strong)]`,t),children:e})}function T({children:e}){return(0,v.jsx)(`div`,{className:`dark`,children:(0,v.jsxs)(`div`,{className:`relative min-h-screen overflow-x-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:[(0,v.jsx)(b,{}),(0,v.jsx)(`div`,{className:`relative z-10 flex min-h-screen flex-col items-center justify-center px-4`,children:e})]})})}function E({signUpHref:e}){return(0,v.jsxs)(`p`,{className:`text-body-small-default flex justify-center gap-1`,children:[(0,v.jsx)(`span`,{className:`text-[var(--content-secondary)]`,children:`Don't have an account?`}),(0,v.jsx)(i,{to:e,className:`font-medium text-[var(--content-emphasised)] hover:underline`,children:`Sign up`})]})}function D({returnTo:e,loading:t,errorMessage:r,onProviderClick:i}){let a=e?`${u.account.signup}?returnTo=${encodeURIComponent(e)}`:u.account.signup;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(C,{children:`Sign in to Vellum`}),r&&(0,v.jsx)(w,{children:r}),(0,v.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,v.jsx)(n,{type:`button`,variant:`outlined`,fullWidth:!0,onClick:()=>i(`AppleOAuth`),disabled:t,leftIcon:(0,v.jsx)(m,{}),className:`max-w-[300px] gap-3`,children:`Continue with Apple`}),(0,v.jsx)(n,{type:`button`,variant:`outlined`,fullWidth:!0,onClick:()=>i(`GoogleOAuth`),disabled:t,leftIcon:(0,v.jsx)(g,{}),className:`max-w-[300px] gap-3`,children:`Continue with Google`}),(0,v.jsx)(n,{type:`button`,variant:`outlined`,fullWidth:!0,onClick:()=>i(),disabled:t,leftIcon:(0,v.jsx)(h,{}),className:`max-w-[300px] gap-3`,children:`Continue with Email`})]}),(0,v.jsx)(E,{signUpHref:a})]})}var O={signup_closed:`Sign-ups are currently closed. Visit vellum.ai/community to request access.`};function k({returnTo:e}){let[t,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(!1),o=async()=>{r(null),a(!0);try{await c({returnTo:e??null})}catch(e){let t=e&&typeof e==`object`&&`code`in e?e.code:void 0;if(t===`USER_CANCELLED`){a(!1);return}if(t===`AUTH_ERROR`){let t=e&&typeof e==`object`&&`data`in e&&e.data&&typeof e.data==`object`&&`authError`in e.data&&typeof e.data.authError==`string`?e.data.authError:void 0;r((t&&O[t])??`Something went wrong. Please try again.`)}else console.error(`[native-auth] auth flow failed:`,e),r(`Something went wrong. Please try again.`);a(!1)}};return(0,v.jsx)(y,{children:(0,v.jsxs)(`div`,{className:`z-10 mt-8 flex w-full max-w-[320px] flex-col items-center gap-3`,children:[t&&(0,v.jsx)(w,{className:`max-w-[280px]`,children:t}),(0,v.jsx)(n,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>{o()},disabled:i,className:`max-w-[300px]`,children:`Sign in`})]})})}function A({returnTo:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!1),a=f(e),o=async t=>{n(null),i(!0);try{await s(d,a,{...t?{providerHint:t}:{},returnTo:e})}catch(e){console.error(`[web-login] auth flow failed:`,e),n(`Something went wrong. Please try again.`),i(!1)}};return(0,v.jsx)(T,{children:(0,v.jsx)(S,{children:(0,v.jsx)(D,{returnTo:e,loading:r,errorMessage:t,onProviderClick:e=>{o(e)}})})})}function j(){let[e]=r(),t=l(),n=e.get(`returnTo`);return t?(0,v.jsx)(k,{returnTo:n}):(0,v.jsx)(A,{returnTo:n})}export{j as LoginPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{M as i,n as a}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{M as i,n as a}from"./auth-store-woVh7RrN.js";import{a as o}from"./routes-BnbYm-Mr.js";import{qr as s}from"./index-DXxd4eQM.js";import{r as c,t as l}from"./account-shell-DblhUTJ5.js";var u=e(t(),1),d=r();function f(){let[e]=n(),t=a.use.logout(),r=(0,u.useRef)(!1);return(0,u.useEffect)(()=>{if(r.current)return;r.current=!0;let n=i(e.get(`returnTo`),o.account.login),a=n.startsWith(`http`)||n===o.account.login?n:`${o.account.login}?returnTo=${encodeURIComponent(n)}`,c=!1;return t().then(()=>{c||s(a)},()=>{c||s(a)}),()=>{c=!0}},[t,e]),(0,d.jsx)(l,{children:(0,d.jsx)(c,{title:`Signing out...`})})}export{f as LogoutPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{i as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./createLucideIcon-DIlBzeWM.js";import{a as o}from"./routes-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{i as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./createLucideIcon-DIlBzeWM.js";import{a as o}from"./routes-BnbYm-Mr.js";import{It as s,Oa as c,ho as l,sa as u}from"./index-DXxd4eQM.js";import{n as d,t as f}from"./sidebar-tree-CeCcOFV9.js";var p=a(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),m=e(t(),1),h=[{id:`usage`,label:`Usage`,href:o.logs.usage,icon:l},{id:`logs`,label:`Logs`,href:o.logs.trace,icon:u},{id:`emails`,label:`Emails`,href:o.logs.emails,icon:c},{id:`system-events`,label:`System Events`,href:o.logs.systemEvents,icon:p}],g=i();function _(){let e=s({platformHostedOnly:!0}),t=s(),{pathname:i}=r(),a=(0,m.useMemo)(()=>h.filter(n=>!(n.id===`system-events`&&e===`gated`||n.id===`emails`&&t===`gated`)),[e,t]),c=(0,m.useMemo)(()=>{let e=h.find(e=>i===e.href||i.startsWith(e.href+`/`));return e?e.label:i===o.logs.root?h[0]?.label??`Logs & Usage`:`Logs & Usage`},[i]);return(0,g.jsx)(d,{backHref:o.assistant,sidebar:(0,g.jsx)(f,{items:a,indexPath:o.logs.root}),title:c,menuRoute:o.logs.root,children:(0,g.jsx)(n,{})})}export{_ as LogsLayout};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./useQuery-B45lW1Kk.js";import{t as r}from"./useMutation-Lj4VunQV.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./card-BibIM9x3.js";import"./src-C4Sj609L.js";import{Ut as o}from"./sdk.gen-CK6-dkoS.js";import{M as s,N as c,f as l}from"./react-query.gen-Dn7kk2yq.js";import{a as u}from"./auth-store-BU_GGnGR.js";import{t as d}from"./client-feature-flag-store-DZMwD6Gv.js";import{Ct as f}from"./index-DrU_8CGE.js";import{t as p}from"./use-active-assistant-id-BFElIHKJ.js";var m=e(t(),1),h=class extends Error{status;constructor(e,t){super(t),this.name=`SimulateMemoryRouterError`,this.status=e}};async function g(e,t,n){let{data:r,response:i}=await o({path:{assistant_id:e},body:t,signal:n,throwOnError:!1}),a=i?await i.clone().text().catch(()=>``):``;if(!i||!i.ok)throw new h(i?.status??0,a||i?.statusText||`Failed to simulate memory router`);if(!r)throw new h(i.status,`Empty response from memory router simulator endpoint`);return{response:r,rawRequest:JSON.stringify(t,null,2),rawResponse:_(a)}}function _(e){if(e.length===0)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function v(e){return r({mutationFn:async t=>{if(!e)throw new h(0,`Missing assistantId`);return g(e,t)}})}function y(e){return n({...l({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4})}function b(e){return n({...c({path:{assistant_id:e}}),enabled:!!e,staleTime:1440*60*1e3})}function x(e){return n({...s({path:{assistant_id:e}}),enabled:!!e,staleTime:1/0})}var S=i();function C(){let e=f(),t=u(),n=d.use.memoryRouterPlayground();return t?(0,S.jsx)($,{children:`Loading…`}):!e||!n?(0,S.jsx)($,{children:`Memory router playground is not available.`}):(0,S.jsx)(T,{})}var w={tier1:``,tier2:``,batch:``,profile:``,customPrompt:``};function T(){let e=p(),t=v(e),n=v(e),r=y(e),i=b(e),a=x(e),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)([{assistantMessage:``,userMessage:``}]),[u,d]=(0,m.useState)(!1);(0,m.useEffect)(()=>{if(u)return;let e=a.data?.nowText;typeof e==`string`&&o===``&&s(e)},[a.data?.nowText,o,u]);let[f,h]=(0,m.useState)(w),[g,_]=(0,m.useState)(w),[C,T]=(0,m.useState)(null),[D,k]=(0,m.useState)(null),j=c[c.length-1].userMessage,M=e=>{let r=e===`A`?f:g,i=e===`A`?T:k,a=e===`A`?t:n;i(null);let s;try{s=E(r)}catch(e){i(e instanceof Error?e.message:`Invalid override input`);return}let l=r.profile.trim().length>0?r.profile:void 0,u=r.customPrompt.trim().length>0?r.customPrompt:void 0,d=c.map((e,t)=>t===c.length-1?{...e,userMessage:e.userMessage.trim()}:e);a.mutate({recentTurnPairs:d,nowText:o,...s?{configOverrides:s}:{},...l===void 0?{}:{profileOverride:l},...u===void 0?{}:{routerPromptOverride:u}})},N=()=>{M(`A`),M(`B`)},P=j.trim().length>0,I=P&&!t.isPending,L=P&&!n.isPending;return(0,S.jsx)(`div`,{className:`flex h-full min-h-0 flex-col overflow-y-auto`,children:(0,S.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1280px] flex-col gap-6 p-6`,children:[(0,S.jsx)(ee,{}),(0,S.jsx)(O,{nowText:o,onNowTextChange:e=>{d(!0),s(e)},onReloadNowText:()=>{let e=a.data?.nowText;typeof e==`string`&&(s(e),d(!1))},nowTextLoading:a.isLoading,pairs:c,onPairsChange:l}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:[(0,S.jsx)(A,{paneId:`A`,overrides:f,onChange:h,onRun:()=>M(`A`),canRun:I,isRunning:t.isPending,profiles:r.data?.profiles??[],activeProfile:r.data?.activeProfile??null,defaultPromptTemplate:i.data?.template??``}),(0,S.jsx)(A,{paneId:`B`,overrides:g,onChange:_,onRun:()=>M(`B`),canRun:L,isRunning:n.isPending,profiles:r.data?.profiles??[],activeProfile:r.data?.activeProfile??null,defaultPromptTemplate:i.data?.template??``})]}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(te,{onClick:N,disabled:!P||t.isPending||n.isPending,isRunning:t.isPending||n.isPending})}),(0,S.jsx)(ne,{visible:t.data!==void 0&&n.data!==void 0}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:[(0,S.jsx)(F,{paneId:`A`,userMessage:j,mutation:t,otherResult:n.data?.response,validation:C}),(0,S.jsx)(F,{paneId:`B`,userMessage:j,mutation:n,otherResult:t.data?.response,validation:D})]})]})})}function E(e){let t={...D(`tier1_size`,e.tier1),...D(`tier2_size`,e.tier2),...D(`batch_size`,e.batch)};return Object.keys(t).length===0?void 0:t}function D(e,t){let n=t.trim();if(n===``)return{};if(n===`null`)return{[e]:null};let r=Number(n);if(!Number.isInteger(r)||r<1)throw Error(`${e} must be a positive integer or 'null' (got "${n}")`);return{[e]:r}}function ee(){return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`h1`,{className:`text-body-large-default`,style:{color:`var(--content-default)`},children:`Memory Router Playground`}),(0,S.jsxs)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:[`Dry-run the v4 router with custom tier/batch overrides. Read-only — no rows are written to `,(0,S.jsx)(`code`,{children:`memory_v2_injection_events`}),` or`,` `,(0,S.jsx)(`code`,{children:`memory_v2_activation_logs`}),`, and no activation state is mutated. Leave an override blank to inherit the live config value; enter`,` `,(0,S.jsx)(`code`,{children:`null`}),` to explicitly disable a tier.`]})]})}function O({nowText:e,onNowTextChange:t,onReloadNowText:n,nowTextLoading:r,pairs:i,onPairsChange:o}){let s=(e,t)=>{o(i.map((n,r)=>r===e?{...n,...t}:n))},c=()=>{o([{assistantMessage:``,userMessage:``},...i])},l=e=>{e!==i.length-1&&o(i.filter((t,n)=>n!==e))};return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:`Conversational context (shared by both panes)`}),(0,S.jsx)(k,{id:`memory-router-playground-now`,label:`<now> block`,value:e,onChange:t,rows:6,monospace:!0,placeholder:r?`Loading current NOW.md…`:`Pre-filled with the live NOW.md. Edit to test alternate states.`,trailing:(0,S.jsx)(`button`,{type:`button`,onClick:n,disabled:r,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:r?`not-allowed`:`pointer`},children:`Reload live NOW.md`})}),(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,S.jsx)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:`Recent (assistant, user) pairs · oldest first`}),(0,S.jsx)(`button`,{type:`button`,onClick:c,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:`pointer`},children:`+ Add older pair`})]}),i.map((e,t)=>{let n=t===i.length-1;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border p-3`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`},children:[(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,S.jsxs)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:[`Pair `,t+1,` of `,i.length,n?` · most recent`:``]}),!n&&(0,S.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`rounded px-2 py-1 text-label-default`,style:{background:`transparent`,color:`var(--system-negative-strong)`,border:`none`,cursor:`pointer`},children:`Remove`})]}),(0,S.jsx)(k,{id:`memory-router-playground-pair-${t}-assistant`,label:`[assistant]: reply`,value:e.assistantMessage,onChange:e=>s(t,{assistantMessage:e}),rows:3,placeholder:t===0&&i.length===1?`Leave blank for a first-turn scenario.`:`Assistant's reply that came before the user message below.`}),(0,S.jsx)(k,{id:`memory-router-playground-pair-${t}-user`,label:n?`Just-arrived [user]: message`:`[user]: message`,value:e.userMessage,onChange:e=>s(t,{userMessage:e}),rows:3,placeholder:n?`e.g. what should we ship next`:`User's message.`,required:n})]},t)})]})})}function k({id:e,label:t,value:n,onChange:r,rows:i,placeholder:a,monospace:o,trailing:s,required:c}){return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`label`,{htmlFor:e,className:`text-label-default`,style:{color:`var(--content-secondary)`},children:[t,c?` *`:``]}),s]}),(0,S.jsx)(`textarea`,{id:e,value:n,onChange:e=>r(e.target.value),rows:i,placeholder:a,className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,resize:`vertical`,...o?{fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`}:{}}})]})}function A({paneId:e,overrides:t,onChange:n,onRun:r,canRun:i,isRunning:o,profiles:s,activeProfile:c,defaultPromptTemplate:l}){return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,S.jsxs)(`div`,{className:`text-body-medium-default`,style:{color:q(e)},children:[`Config `,e]}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,S.jsx)(N,{paneId:e,label:`tier1_size`,value:t.tier1,onChange:e=>n({...t,tier1:e})}),(0,S.jsx)(N,{paneId:e,label:`tier2_size`,value:t.tier2,onChange:e=>n({...t,tier2:e})}),(0,S.jsx)(N,{paneId:e,label:`batch_size`,value:t.batch,onChange:e=>n({...t,batch:e})})]}),(0,S.jsx)(M,{paneId:e,value:t.profile,onChange:e=>n({...t,profile:e}),profiles:s,activeProfile:c}),(0,S.jsx)(j,{paneId:e,value:t.customPrompt,onChange:e=>n({...t,customPrompt:e}),defaultTemplate:l}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(`button`,{type:`button`,onClick:r,disabled:!i,className:`rounded-md px-4 py-2 text-body-medium-default transition-colors`,style:{background:i?`var(--system-positive-strong)`:`var(--surface-overlay)`,color:i?`var(--content-on-positive)`:`var(--content-disabled)`,border:`none`,cursor:i?`pointer`:`not-allowed`},children:o?`Running…`:`Run ${e}`})})]})})}function j({paneId:e,value:t,onChange:n,defaultTemplate:r}){let[i,a]=(0,m.useState)(!1),o=`memory-router-playground-${e}-prompt`,s=t.trim().length>0;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`text-label-default`,style:{color:`var(--content-secondary)`,background:`transparent`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`},children:[i?`▾`:`▸`,` System prompt`,` `,(0,S.jsxs)(`span`,{style:{color:`var(--content-tertiary)`},children:[`(`,s?`custom`:`bundled`,`)`]})]}),i&&(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>n(r),disabled:r.length===0,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:r.length===0?`not-allowed`:`pointer`},children:`Load default`}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>n(``),disabled:!s,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:s?`pointer`:`not-allowed`},children:`Reset`})]})]}),i&&(0,S.jsx)(`textarea`,{id:o,value:t,onChange:e=>n(e.target.value),rows:12,placeholder:`Custom router system prompt. Available placeholders:
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./useQuery-B45lW1Kk.js";import{t as r}from"./useMutation-Lj4VunQV.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./card-BibIM9x3.js";import"./src-C4Sj609L.js";import{Xt as o}from"./sdk.gen-ZXouuy0U.js";import{H as s,V as c,f as l}from"./react-query.gen-Dc9bPcAq.js";import{a as u}from"./auth-store-woVh7RrN.js";import{t as d}from"./client-feature-flag-store-DZMwD6Gv.js";import{Ct as f}from"./index-DXxd4eQM.js";import{t as p}from"./use-active-assistant-id-BFElIHKJ.js";var m=e(t(),1),h=class extends Error{status;constructor(e,t){super(t),this.name=`SimulateMemoryRouterError`,this.status=e}};async function g(e,t,n){let{data:r,response:i}=await o({path:{assistant_id:e},body:t,signal:n,throwOnError:!1}),a=i?await i.clone().text().catch(()=>``):``;if(!i||!i.ok)throw new h(i?.status??0,a||i?.statusText||`Failed to simulate memory router`);if(!r)throw new h(i.status,`Empty response from memory router simulator endpoint`);return{response:r,rawRequest:JSON.stringify(t,null,2),rawResponse:_(a)}}function _(e){if(e.length===0)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function v(e){return r({mutationFn:async t=>{if(!e)throw new h(0,`Missing assistantId`);return g(e,t)}})}function y(e){return n({...l({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4})}function b(e){return n({...s({path:{assistant_id:e}}),enabled:!!e,staleTime:1440*60*1e3})}function x(e){return n({...c({path:{assistant_id:e}}),enabled:!!e,staleTime:1/0})}var S=i();function C(){let e=f(),t=u(),n=d.use.memoryRouterPlayground();return t?(0,S.jsx)($,{children:`Loading…`}):!e||!n?(0,S.jsx)($,{children:`Memory router playground is not available.`}):(0,S.jsx)(T,{})}var w={tier1:``,tier2:``,batch:``,profile:``,customPrompt:``};function T(){let e=p(),t=v(e),n=v(e),r=y(e),i=b(e),a=x(e),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)([{assistantMessage:``,userMessage:``}]),[u,d]=(0,m.useState)(!1);(0,m.useEffect)(()=>{if(u)return;let e=a.data?.nowText;typeof e==`string`&&o===``&&s(e)},[a.data?.nowText,o,u]);let[f,h]=(0,m.useState)(w),[g,_]=(0,m.useState)(w),[C,T]=(0,m.useState)(null),[D,k]=(0,m.useState)(null),j=c[c.length-1].userMessage,M=e=>{let r=e===`A`?f:g,i=e===`A`?T:k,a=e===`A`?t:n;i(null);let s;try{s=E(r)}catch(e){i(e instanceof Error?e.message:`Invalid override input`);return}let l=r.profile.trim().length>0?r.profile:void 0,u=r.customPrompt.trim().length>0?r.customPrompt:void 0,d=c.map((e,t)=>t===c.length-1?{...e,userMessage:e.userMessage.trim()}:e);a.mutate({recentTurnPairs:d,nowText:o,...s?{configOverrides:s}:{},...l===void 0?{}:{profileOverride:l},...u===void 0?{}:{routerPromptOverride:u}})},N=()=>{M(`A`),M(`B`)},P=j.trim().length>0,I=P&&!t.isPending,L=P&&!n.isPending;return(0,S.jsx)(`div`,{className:`flex h-full min-h-0 flex-col overflow-y-auto`,children:(0,S.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1280px] flex-col gap-6 p-6`,children:[(0,S.jsx)(ee,{}),(0,S.jsx)(O,{nowText:o,onNowTextChange:e=>{d(!0),s(e)},onReloadNowText:()=>{let e=a.data?.nowText;typeof e==`string`&&(s(e),d(!1))},nowTextLoading:a.isLoading,pairs:c,onPairsChange:l}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:[(0,S.jsx)(A,{paneId:`A`,overrides:f,onChange:h,onRun:()=>M(`A`),canRun:I,isRunning:t.isPending,profiles:r.data?.profiles??[],activeProfile:r.data?.activeProfile??null,defaultPromptTemplate:i.data?.template??``}),(0,S.jsx)(A,{paneId:`B`,overrides:g,onChange:_,onRun:()=>M(`B`),canRun:L,isRunning:n.isPending,profiles:r.data?.profiles??[],activeProfile:r.data?.activeProfile??null,defaultPromptTemplate:i.data?.template??``})]}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(te,{onClick:N,disabled:!P||t.isPending||n.isPending,isRunning:t.isPending||n.isPending})}),(0,S.jsx)(ne,{visible:t.data!==void 0&&n.data!==void 0}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:[(0,S.jsx)(F,{paneId:`A`,userMessage:j,mutation:t,otherResult:n.data?.response,validation:C}),(0,S.jsx)(F,{paneId:`B`,userMessage:j,mutation:n,otherResult:t.data?.response,validation:D})]})]})})}function E(e){let t={...D(`tier1_size`,e.tier1),...D(`tier2_size`,e.tier2),...D(`batch_size`,e.batch)};return Object.keys(t).length===0?void 0:t}function D(e,t){let n=t.trim();if(n===``)return{};if(n===`null`)return{[e]:null};let r=Number(n);if(!Number.isInteger(r)||r<1)throw Error(`${e} must be a positive integer or 'null' (got "${n}")`);return{[e]:r}}function ee(){return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`h1`,{className:`text-body-large-default`,style:{color:`var(--content-default)`},children:`Memory Router Playground`}),(0,S.jsxs)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:[`Dry-run the v4 router with custom tier/batch overrides. Read-only — no rows are written to `,(0,S.jsx)(`code`,{children:`memory_v2_injection_events`}),` or`,` `,(0,S.jsx)(`code`,{children:`memory_v2_activation_logs`}),`, and no activation state is mutated. Leave an override blank to inherit the live config value; enter`,` `,(0,S.jsx)(`code`,{children:`null`}),` to explicitly disable a tier.`]})]})}function O({nowText:e,onNowTextChange:t,onReloadNowText:n,nowTextLoading:r,pairs:i,onPairsChange:o}){let s=(e,t)=>{o(i.map((n,r)=>r===e?{...n,...t}:n))},c=()=>{o([{assistantMessage:``,userMessage:``},...i])},l=e=>{e!==i.length-1&&o(i.filter((t,n)=>n!==e))};return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:`Conversational context (shared by both panes)`}),(0,S.jsx)(k,{id:`memory-router-playground-now`,label:`<now> block`,value:e,onChange:t,rows:6,monospace:!0,placeholder:r?`Loading current NOW.md…`:`Pre-filled with the live NOW.md. Edit to test alternate states.`,trailing:(0,S.jsx)(`button`,{type:`button`,onClick:n,disabled:r,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:r?`not-allowed`:`pointer`},children:`Reload live NOW.md`})}),(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,S.jsx)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:`Recent (assistant, user) pairs · oldest first`}),(0,S.jsx)(`button`,{type:`button`,onClick:c,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:`pointer`},children:`+ Add older pair`})]}),i.map((e,t)=>{let n=t===i.length-1;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border p-3`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`},children:[(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,S.jsxs)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:[`Pair `,t+1,` of `,i.length,n?` · most recent`:``]}),!n&&(0,S.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`rounded px-2 py-1 text-label-default`,style:{background:`transparent`,color:`var(--system-negative-strong)`,border:`none`,cursor:`pointer`},children:`Remove`})]}),(0,S.jsx)(k,{id:`memory-router-playground-pair-${t}-assistant`,label:`[assistant]: reply`,value:e.assistantMessage,onChange:e=>s(t,{assistantMessage:e}),rows:3,placeholder:t===0&&i.length===1?`Leave blank for a first-turn scenario.`:`Assistant's reply that came before the user message below.`}),(0,S.jsx)(k,{id:`memory-router-playground-pair-${t}-user`,label:n?`Just-arrived [user]: message`:`[user]: message`,value:e.userMessage,onChange:e=>s(t,{userMessage:e}),rows:3,placeholder:n?`e.g. what should we ship next`:`User's message.`,required:n})]},t)})]})})}function k({id:e,label:t,value:n,onChange:r,rows:i,placeholder:a,monospace:o,trailing:s,required:c}){return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`label`,{htmlFor:e,className:`text-label-default`,style:{color:`var(--content-secondary)`},children:[t,c?` *`:``]}),s]}),(0,S.jsx)(`textarea`,{id:e,value:n,onChange:e=>r(e.target.value),rows:i,placeholder:a,className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,resize:`vertical`,...o?{fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`}:{}}})]})}function A({paneId:e,overrides:t,onChange:n,onRun:r,canRun:i,isRunning:o,profiles:s,activeProfile:c,defaultPromptTemplate:l}){return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,S.jsxs)(`div`,{className:`text-body-medium-default`,style:{color:q(e)},children:[`Config `,e]}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,S.jsx)(N,{paneId:e,label:`tier1_size`,value:t.tier1,onChange:e=>n({...t,tier1:e})}),(0,S.jsx)(N,{paneId:e,label:`tier2_size`,value:t.tier2,onChange:e=>n({...t,tier2:e})}),(0,S.jsx)(N,{paneId:e,label:`batch_size`,value:t.batch,onChange:e=>n({...t,batch:e})})]}),(0,S.jsx)(M,{paneId:e,value:t.profile,onChange:e=>n({...t,profile:e}),profiles:s,activeProfile:c}),(0,S.jsx)(j,{paneId:e,value:t.customPrompt,onChange:e=>n({...t,customPrompt:e}),defaultTemplate:l}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(`button`,{type:`button`,onClick:r,disabled:!i,className:`rounded-md px-4 py-2 text-body-medium-default transition-colors`,style:{background:i?`var(--system-positive-strong)`:`var(--surface-overlay)`,color:i?`var(--content-on-positive)`:`var(--content-disabled)`,border:`none`,cursor:i?`pointer`:`not-allowed`},children:o?`Running…`:`Run ${e}`})})]})})}function j({paneId:e,value:t,onChange:n,defaultTemplate:r}){let[i,a]=(0,m.useState)(!1),o=`memory-router-playground-${e}-prompt`,s=t.trim().length>0;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`text-label-default`,style:{color:`var(--content-secondary)`,background:`transparent`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`},children:[i?`▾`:`▸`,` System prompt`,` `,(0,S.jsxs)(`span`,{style:{color:`var(--content-tertiary)`},children:[`(`,s?`custom`:`bundled`,`)`]})]}),i&&(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>n(r),disabled:r.length===0,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:r.length===0?`not-allowed`:`pointer`},children:`Load default`}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>n(``),disabled:!s,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:s?`pointer`:`not-allowed`},children:`Reset`})]})]}),i&&(0,S.jsx)(`textarea`,{id:o,value:t,onChange:e=>n(e.target.value),rows:12,placeholder:`Custom router system prompt. Available placeholders:
|
|
2
2
|
{{ASSISTANT_NAME}}, {{USER_NAME}}, {{PAGE_INDEX}}
|
|
3
3
|
Leave blank to use the bundled template. "Load default" seeds the textarea with the bundled body for editing.`,className:`rounded-md border px-3 py-2 text-body-small-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,resize:`vertical`,minHeight:`120px`}})]})}function M({paneId:e,value:t,onChange:n,profiles:r,activeProfile:i}){let a=`memory-router-playground-${e}-profile`,o=i!==null&&i.length>0?`inherit active (${i})`:`inherit active`;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`label`,{htmlFor:a,className:`text-label-default`,style:{color:`var(--content-secondary)`},children:`llm.profiles override`}),(0,S.jsxs)(`select`,{id:a,value:t,onChange:e=>n(e.target.value),className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`},children:[(0,S.jsx)(`option`,{value:``,children:o}),r.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))]})]})}function N({paneId:e,label:t,value:n,onChange:r}){let i=`memory-router-playground-${e}-${t}`;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`label`,{htmlFor:i,className:`text-label-default`,style:{color:`var(--content-secondary)`},children:t}),(0,S.jsx)(`input`,{id:i,value:n,onChange:e=>r(e.target.value),placeholder:`inherit`,className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`}})]})}function te({onClick:e,disabled:t,isRunning:n}){return(0,S.jsx)(`button`,{type:`button`,onClick:e,disabled:t,className:`rounded-md px-4 py-2 text-body-medium-default transition-colors`,style:{background:t?`var(--surface-overlay)`:`var(--primary-base)`,color:t?`var(--content-disabled)`:`var(--content-on-primary)`,border:`none`,cursor:t?`not-allowed`:`pointer`},children:n?`Running…`:`Run both`})}function ne({visible:e}){return e?(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 rounded-md px-4 py-2 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`},children:[(0,S.jsx)(P,{marker:`●`,markerColor:`var(--content-default)`,label:`in both`}),(0,S.jsx)(P,{marker:`◆`,markerColor:q(`A`),label:`A only`}),(0,S.jsx)(P,{marker:`◇`,markerColor:q(`B`),label:`B only`})]}):null}function P({marker:e,markerColor:t,label:n}){return(0,S.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`span`,{style:{color:t},children:e}),(0,S.jsx)(`span`,{children:n})]})}function F({paneId:e,userMessage:t,mutation:n,otherResult:r,validation:i}){let a=n.data;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,S.jsx)(R,{paneId:e}),i!==null&&(0,S.jsx)(Q,{message:i}),n.isError&&(0,S.jsx)(Q,{message:n.error instanceof Error?n.error.message:`Failed to run simulation`}),a!==void 0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(z,{paneId:e,userMessage:t,result:a.response,otherResult:r}),(0,S.jsx)(I,{paneId:e,rawRequest:a.rawRequest,rawResponse:a.rawResponse})]})]})}function I({paneId:e,rawRequest:t,rawResponse:n}){let[r,i]=(0,m.useState)(!1);return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`text-label-default`,style:{color:`var(--content-secondary)`,background:`transparent`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`},children:[r?`▾`:`▸`,` Raw API exchange`]}),r&&(0,S.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,S.jsx)(L,{label:`Request (Pane ${e})`,body:t}),(0,S.jsx)(L,{label:`Response (Pane ${e})`,body:n})]})]})})}function L({label:e,body:t}){return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:e}),(0,S.jsx)(`pre`,{className:`overflow-auto rounded-md border px-3 py-2 text-body-small-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,maxHeight:`320px`,whiteSpace:`pre`},children:t.length===0?`(empty)`:t})]})}function R({paneId:e}){return(0,S.jsxs)(`div`,{className:`text-body-medium-default`,style:{color:q(e)},children:[`Pane `,e]})}function z({paneId:e,userMessage:t,result:n,otherResult:r}){let i=(0,m.useMemo)(()=>B(n,r),[n,r]),a=(0,m.useMemo)(()=>W(n),[n]);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,S.jsx)(H,{result:n,userMessage:t,otherResult:r,counts:(0,m.useMemo)(()=>V(i),[i])}),(0,S.jsx)(U,{result:n}),n.failureReason!==null&&(0,S.jsx)(Q,{message:`Router failure: ${n.failureReason}`}),a.length===0?(0,S.jsx)(X,{}):a.map(t=>(0,S.jsx)(Y,{paneId:e,source:t.source,slugs:t.slugs,scores:n.scores,diff:i},t.source))]})}function B(e,t){let n=new Map;if(t===void 0){for(let t of e.selectedSlugs)n.set(t,`both`);return n}let r=new Set(t.selectedSlugs);for(let t of e.selectedSlugs)n.set(t,r.has(t)?`both`:`only-here`);return n}function V(e){let t=0,n=0;for(let r of e.values())r===`both`?t++:n++;return{total:e.size,shared:t,unique:n}}function H({result:e,userMessage:t,otherResult:n,counts:r}){let i=[{label:`User message`,value:t},{label:`Total candidate pages`,value:e.totalCandidatePages.toLocaleString()},{label:`Selected`,value:`${e.selectedSlugs.length} (live max_page_ids: ${e.effectiveConfig.max_page_ids})`}];return n!==void 0&&i.push({label:`Diff`,value:`${r.shared} shared · ${r.unique} unique to this pane`}),(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:`Summary`}),(0,S.jsx)(Z,{rows:i})]})})}function U({result:e}){let t=[`tier1_size`,`tier2_size`,`batch_size`,`max_page_ids`].map(t=>{let n=e.effectiveConfig[t],r=e.overrides[t];return{label:t,value:`${n===null?`null`:String(n)}${r===void 0?``:` (override)`}`}});return t.push({label:`llm.profiles override`,value:e.profileOverride===null?`inherit active`:`${e.profileOverride} (override)`}),t.push({label:`system prompt`,value:e.routerPromptOverridden?`custom`:`bundled`}),(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:`Effective config`}),(0,S.jsx)(Z,{rows:t})]})})}function W(e){let t=new Map;for(let n of e.selectedSlugs){let r=e.sourceBySlug[n];if(r===void 0)continue;let i=t.get(r)??[];i.push(n),t.set(r,i)}return[...t.keys()].sort((e,t)=>G(e)-G(t)).map(e=>({source:e,slugs:t.get(e)}))}function G(e){return e===`tier1`?0:e===`tier2`?1:e.startsWith(`tier3:`)?2+Number(e.slice(6)):2**53-1}function K(e){return e===`tier1`?`tier 1`:e===`tier2`?`tier 2`:e.startsWith(`tier3:`)?`tier 3 · b${e.slice(6)}`:e}function q(e){return e===`A`?`var(--system-mid-strong)`:`var(--primary-base)`}function J(e,t){return t===`both`?{color:`var(--content-default)`,marker:`●`}:{color:q(e),marker:e===`A`?`◆`:`◇`}}function Y({paneId:e,source:t,slugs:n,scores:r,diff:i}){return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:K(t)}),(0,S.jsxs)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:[n.length,` `,n.length===1?`page`:`pages`]})]}),(0,S.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(n=>{let{color:a,marker:o}=J(e,i.get(n)??`only-here`);return(0,S.jsxs)(`li`,{className:`flex items-baseline justify-between gap-3`,children:[(0,S.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,S.jsx)(`span`,{style:{color:a},children:o}),(0,S.jsx)(`code`,{className:`text-body-medium-default`,style:{color:a},children:n})]}),t===`tier2`&&(0,S.jsxs)(`span`,{className:`tabular-nums text-label-default`,style:{color:`var(--content-secondary)`},children:[`EMA `,(r[n]??0).toFixed(3)]})]},n)})})]})})}function X(){return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:`No pages selected`}),(0,S.jsx)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:`The router returned an empty selection. Try a more specific query, or relax the override values.`})]})})}function Z({rows:e}){return(0,S.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(({label:e,value:t})=>(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,S.jsx)(`span`,{className:`shrink-0 text-label-default`,style:{color:`var(--content-secondary)`},children:e}),(0,S.jsx)(`span`,{className:`text-right text-body-medium-lighter`,style:{color:`var(--content-default)`},children:t})]},e))})}function Q({message:e}){return(0,S.jsx)(`div`,{className:`rounded-md px-4 py-3 text-body-medium-default`,style:{background:`var(--surface-overlay)`,color:`var(--system-negative-strong)`},children:e})}function $({children:e}){return(0,S.jsx)(`div`,{className:`flex h-full w-full items-center justify-center p-8 text-label-default`,style:{color:`var(--content-tertiary)`},children:e})}export{C as MemoryRouterPlaygroundPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import"./src-C4Sj609L.js";import{t as i}from"./x-Bmx5Uey2.js";import{
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import"./src-C4Sj609L.js";import{t as i}from"./x-Bmx5Uey2.js";import{Da as a}from"./index-DXxd4eQM.js";var o=e(t(),1),s=r(),c=`(min-width: 640px)`,l=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function u({open:e,onClose:t,children:r,title:a}){let u=(0,o.useRef)(null),d=(0,o.useRef)(null),f=(0,o.useRef)(t);return(0,o.useEffect)(()=>{f.current=t}),(0,o.useEffect)(()=>{if(!e)return;d.current?.focus();let t=document.body.style.overflow;document.body.style.overflow=`hidden`;let n=window.matchMedia(c),r=e=>{e.matches&&f.current()};n.addEventListener(`change`,r);let i=e=>{if(e.key===`Escape`){f.current();return}if(e.key!==`Tab`||!u.current)return;let t=u.current.querySelectorAll(l),n=t[0],r=t[t.length-1];if(!n||!r){e.preventDefault();return}let i=document.activeElement,a=u.current.contains(i);e.shiftKey?(!a||i===n)&&(e.preventDefault(),r.focus()):(!a||i===r)&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`keydown`,i),n.removeEventListener(`change`,r),document.body.style.overflow=t}},[e]),e?(0,s.jsxs)(`div`,{ref:u,className:`fixed inset-0 sm:hidden`,style:{zIndex:40},role:`dialog`,"aria-modal":`true`,"aria-label":a,children:[(0,s.jsx)(`button`,{type:`button`,"aria-label":`Close sidebar`,className:`absolute inset-0 h-full w-full cursor-default`,style:{background:`rgba(0, 0, 0, 0.4)`,zIndex:40},onClick:t}),(0,s.jsxs)(`aside`,{className:`relative flex h-full w-[80vw] max-w-xs flex-col shadow-xl`,style:{background:`var(--surface-lift)`,borderRight:`1px solid var(--border-base)`,zIndex:50,paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`},children:[(0,s.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-3`,style:{borderColor:`var(--border-base)`},children:[(0,s.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:a}),(0,s.jsx)(n,{ref:d,type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,s.jsx)(i,{"aria-hidden":!0}),onClick:t,"aria-label":`Close`,tintColor:`var(--content-tertiary)`})]}),(0,s.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:r})]})]}):null}function d({onClick:e}){return(0,s.jsx)(n,{type:`button`,variant:`ghost`,iconOnly:(0,s.jsx)(a,{"aria-hidden":!0}),onClick:e,"aria-label":`Open sidebar`,tintColor:`var(--content-secondary)`,className:`sm:hidden`})}export{d as n,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./menu-BvyV91Np.js";import{t as c}from"./notice-G5Imd5pC.js";import{t as l}from"./popover-PnyzuDx3.js";import{t as u}from"./input-CwdmSRlD.js";import{n as d,t as f}from"./panel-item-BFOUNXY1.js";import{t as p}from"./createLucideIcon-DIlBzeWM.js";import{t as m}from"./bell-Co08GYEf.js";import{t as h}from"./loader-circle-CdxxVJvk.js";import{t as g}from"./moon-BhPlqy1k.js";import{t as _}from"./triangle-alert-B-ye6tYl.js";import{a as v}from"./routes-BnbYm-Mr.js";import{n as y}from"./use-is-mobile-ikBu--_t.js";import{Ft as b,It as x,Pt as S,Sr as C,_r as w,br as T,gr as E,mo as D,v as O,vr as k,xr as A,yr as j}from"./index-DXxd4eQM.js";import{r as M}from"./format-date-Oi80uFkI.js";var N=p(`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`}]]),P=p(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),F=e(t(),1);function I(e){e.invalidateQueries({queryKey:k()}),e.invalidateQueries({queryKey:C()})}function L(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var R=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],z=o();function B({notificationId:e,currentlySnoozed:t,children:n}){let i=r(),o=a(A()),c=y(),[l,u]=(0,F.useState)(!1),p=()=>I(i),m=async t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();await o.mutateAsync({path:{id:e},body:{snoozed_until:n}}),p()},h=async()=>{await o.mutateAsync({path:{id:e},body:{snoozed_until:null}}),p()};return c?(0,z.jsxs)(d.Root,{open:l,onOpenChange:u,children:[(0,z.jsx)(d.Trigger,{asChild:!0,children:n}),(0,z.jsxs)(d.Content,{children:[(0,z.jsx)(d.Header,{children:(0,z.jsx)(d.Title,{children:`Snooze until…`})}),(0,z.jsxs)(d.Body,{children:[R.map(({label:e,hours:t})=>(0,z.jsx)(f,{label:e,onSelect:()=>{o.isPending||(u(!1),m(t))}},e)),t&&(0,z.jsx)(f,{label:`Clear snooze`,onSelect:()=>{o.isPending||(u(!1),h())}})]})]})]}):(0,z.jsxs)(s.Root,{open:l,onOpenChange:u,children:[(0,z.jsx)(s.Trigger,{children:n}),(0,z.jsxs)(s.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,z.jsx)(s.Label,{children:`Snooze until…`}),R.map(({label:e,hours:t})=>(0,z.jsx)(s.Item,{disabled:o.isPending,onSelect:()=>void m(t),children:e},e)),t&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(s.Separator,{}),(0,z.jsx)(s.Item,{disabled:o.isPending,onSelect:()=>void h(),children:`Clear snooze`})]})]})]})}function V({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(j()),l=a(T()),[d,f]=(0,F.useState)(``),p=()=>I(s),m=async()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();n(await c.mutateAsync({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:d.trim()||`User requested pause`,expires_at:e}})),p(),t()},g=async e=>{await l.mutateAsync({path:{rule_id:e}}),i(e),p(),t()},_=c.isPending||l.isPending;return(0,z.jsxs)(`div`,{children:[!o&&(0,z.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,z.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,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,z.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,M(e.expires_at)]})]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void g(e.id),disabled:_,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,z.jsx)(u,{type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`Reason (optional)`}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>void m(),disabled:_,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,z.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,z.jsx)(h,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function H({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=L(e),a=!e.is_read;return(0,z.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,z.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,z.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,z.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,z.jsx)(_,{className:`h-3 w-3`}),`Alert`]}),i&&(0,z.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,z.jsx)(g,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,z.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,z.jsx)(D,{className:`h-3 w-3`}),`Resolved`]})]}),(0,z.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,z.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,z.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,z.jsxs)(`span`,{children:[`Last seen `,M(e.last_seen_at)]}),e.occurrence_count>1&&(0,z.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,z.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,z.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,z.jsx)(h,{className:`h-3 w-3 animate-spin`}):(0,z.jsx)(D,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,z.jsx)(B,{notificationId:e.id,currentlySnoozed:i,children:(0,z.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,z.jsx)(g,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function U(){let e=x({platformHostedOnly:!0}),t=S(),o=b(),s=r(),u=y(),[f,p]=(0,F.useState)(`open`),[g,_]=(0,F.useState)(!1),[C,T]=(0,F.useState)([]),{data:D,isLoading:k,isError:A,refetch:j}=i({...w({query:{status:f}}),enabled:e===`full`&&t}),M=e===`full`&&o||(t?k:!1);(0,F.useEffect)(()=>{!t&&g&&_(!1)},[t,g]);let L=t?A:!1,R=t?D?.results??[]:[],B=R.filter(e=>!e.is_read&&!e.is_resolved),U=a(E()),[W,G]=(0,F.useState)(new Set),[K,q]=(0,F.useState)(!1),J=(0,F.useCallback)(()=>I(s),[s]),Y=async(e,t)=>{G(t=>new Set(t).add(e));try{await U.mutateAsync({path:{id:e},body:{acknowledged:t}}),J()}finally{G(t=>{let n=new Set(t);return n.delete(e),n})}},X=async()=>{if(!(B.length===0||K)){q(!0);try{await Promise.allSettled(B.map(e=>U.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{J(),q(!1)}}},Z=(0,z.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,z.jsx)(N,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),Q=(0,z.jsx)(V,{existingRules:C,onClose:()=>_(!1),onPauseCreated:e=>T(t=>[...t,e]),onPauseDeleted:e=>T(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,z.jsx)(n,{replace:!0,to:v.settings.general}):e===`disabled`?(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(m,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,z.jsxs)(`div`,{className:`flex-1`,children:[(0,z.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,z.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,z.jsx)(O,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(m,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,z.jsxs)(`div`,{className:`flex-1`,children:[(0,z.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,z.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(u?(0,z.jsxs)(d.Root,{open:g,onOpenChange:_,children:[(0,z.jsx)(d.Trigger,{asChild:!0,children:Z}),(0,z.jsxs)(d.Content,{children:[(0,z.jsx)(d.Header,{children:(0,z.jsx)(d.Title,{children:`Pause alerts`})}),(0,z.jsx)(d.Body,{children:(0,z.jsx)(V,{existingRules:C,onClose:()=>_(!1),onPauseCreated:e=>T(t=>[...t,e]),onPauseDeleted:e=>T(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,z.jsxs)(l.Root,{open:g,onOpenChange:_,children:[(0,z.jsx)(l.Trigger,{asChild:!0,children:Z}),(0,z.jsx)(l.Content,{align:`end`,className:`w-72`,children:Q})]}))]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.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=f===e;return(0,z.jsx)(`button`,{type:`button`,onClick:()=>p(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)})}),f===`open`&&B.length>1&&(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void X(),disabled:K,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:[K?(0,z.jsx)(h,{className:`h-3 w-3 animate-spin`}):(0,z.jsx)(P,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),M?(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,z.jsx)(h,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):L?(0,z.jsxs)(c,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,z.jsx)(`button`,{type:`button`,onClick:()=>void j(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):R.length===0?(0,z.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,z.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,z.jsx)(m,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,z.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,f,` notifications`]}),(0,z.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:f===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,z.jsx)(`div`,{className:`space-y-3`,children:R.map(e=>(0,z.jsx)(H,{notification:e,onAck:(e,t)=>void Y(e,t),isAcking:W.has(e.id)},e.id))})]})}export{U as NotificationsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{ct as i}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{ct as i}from"./index-DXxd4eQM.js";var a=e(t(),1),o=r();function s(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,o.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function c(){return(0,o.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,o.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var l=`
|
|
2
2
|
:root {
|
|
3
3
|
--oauth-surface: #F5F3EB;
|
|
4
4
|
--oauth-surface-card: #FFFFFF;
|
package/dist/assets/{oauth-popup-complete-page-DGDv0icT.js → oauth-popup-complete-page-B5j06nqz.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{n as i,r as a}from"./native-deep-link-DHVHl6Uy.js";import{ct as o}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{n as i,r as a}from"./native-deep-link-DHVHl6Uy.js";import{ct as o}from"./index-DXxd4eQM.js";var s=e(t(),1),c=r();function l(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-positive-bg)`}),(0,c.jsx)(`path`,{className:`oauth-check`,d:`M17 28.5L24.5 36L39 21`,stroke:`var(--oauth-positive-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function u(){return(0,c.jsxs)(`svg`,{className:`oauth-icon`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,c.jsx)(`circle`,{cx:`28`,cy:`28`,r:`28`,fill:`var(--oauth-negative-bg)`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-1`,d:`M20 20L36 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`}),(0,c.jsx)(`path`,{className:`oauth-cross oauth-cross-2`,d:`M36 20L20 36`,stroke:`var(--oauth-negative-fg)`,strokeWidth:`3.5`,strokeLinecap:`round`,fill:`none`})]})}var d=`
|
|
2
2
|
:root {
|
|
3
3
|
--oauth-surface: #F5F3EB;
|
|
4
4
|
--oauth-surface-card: #FFFFFF;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{m as a}from"./local-mode-Bvz5B1q8.js";import{t as o}from"./circle-alert-CIUa_TF0.js";import{t as s}from"./circle-check-BZU8YmDv.js";import{t as c}from"./loader-circle-CdxxVJvk.js";import{i as l,n as u,r as d,t as f}from"./remote-gateway-session-BVFc4ZX7.js";import{a as p}from"./routes-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{m as a}from"./local-mode-Bvz5B1q8.js";import{t as o}from"./circle-alert-CIUa_TF0.js";import{t as s}from"./circle-check-BZU8YmDv.js";import{t as c}from"./loader-circle-CdxxVJvk.js";import{i as l,n as u,r as d,t as f}from"./remote-gateway-session-BVFc4ZX7.js";import{a as p}from"./routes-BnbYm-Mr.js";import{t as m}from"./index-DXxd4eQM.js";var h=e(t(),1),g=i();function _(e){switch(e.kind){case`missing`:return{title:`Pairing link incomplete`,body:`Start a new web pairing from the local assistant and open the full link.`};case`approved`:return{title:`Connected`,body:`Opening your assistant.`};case`expired`:return{title:`Pairing expired`,body:`Start a new web pairing from the local assistant.`};case`error`:return{title:`Pairing failed`,body:e.message};case`polling`:return{title:`Waiting for approval`,body:`Confirm this code on the machine running your assistant.`}}}function v({state:e}){return e.kind===`approved`?(0,g.jsx)(s,{className:`h-5 w-5 text-green-600`,"aria-hidden":!0}):e.kind===`polling`?(0,g.jsx)(c,{className:`h-5 w-5 animate-spin text-blue-600`,"aria-hidden":!0}):(0,g.jsx)(o,{className:`h-5 w-5 text-red-600`,"aria-hidden":!0})}function y(){let e=r(),t=n(),i=a(),o=(0,h.useMemo)(()=>l(`${e.pathname}${e.search}${e.hash}`),[e.pathname,e.search,e.hash]),[s,c]=(0,h.useState)(o.deviceCode?{kind:`polling`,expiresAt:null}:{kind:`missing`});if((0,h.useEffect)(()=>{if(!i)return;if(!o.deviceCode){c({kind:`missing`});return}let e=new AbortController,n=null,r=async()=>{try{let i=await d(o.deviceCode,e.signal);if(i.status===`pending`){c({kind:`polling`,expiresAt:i.expiresAt||null}),n=setTimeout(()=>void r(),Math.max(1,i.intervalSeconds)*1e3);return}u(i),c({kind:`approved`}),n=setTimeout(()=>t(p.assistant,{replace:!0}),250)}catch(t){if(e.signal.aborted)return;if(t instanceof f&&t.status===401){c({kind:`expired`});return}c({kind:`error`,message:`The assistant could not complete pairing. Try starting a new pairing.`})}};return r(),()=>{e.abort(),n&&clearTimeout(n)}},[i,o.deviceCode,t]),!i)return(0,g.jsx)(m,{});let y=_(s);return(0,g.jsx)(`main`,{className:`flex min-h-svh items-center justify-center bg-[var(--background-default)] px-6 py-10 text-[var(--content-primary)]`,children:(0,g.jsxs)(`section`,{className:`w-full max-w-md rounded-lg border border-[var(--border-default)] bg-[var(--background-surface)] p-8 shadow-sm`,children:[(0,g.jsxs)(`div`,{className:`mb-5 flex items-center gap-3`,children:[(0,g.jsx)(v,{state:s}),(0,g.jsx)(`h1`,{className:`text-xl font-semibold`,children:y.title})]}),o.userCode?(0,g.jsxs)(`div`,{className:`mb-5 rounded-md border border-[var(--border-subtle)] bg-[var(--background-muted)] p-4 text-center`,children:[(0,g.jsx)(`div`,{className:`text-xs font-medium uppercase text-[var(--content-secondary)]`,children:`Pairing code`}),(0,g.jsx)(`div`,{className:`mt-2 font-mono text-3xl font-semibold tracking-[0.18em]`,children:o.userCode})]}):null,(0,g.jsx)(`p`,{className:`text-sm leading-6 text-[var(--content-secondary)]`,children:y.body}),s.kind===`polling`&&s.expiresAt?(0,g.jsxs)(`p`,{className:`mt-4 text-xs text-[var(--content-tertiary)]`,children:[`Expires `,new Date(s.expiresAt).toLocaleTimeString(),`.`]}):null]})})}export{y as RemoteWebPairingPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import{a as n}from"./routes-
|
|
1
|
+
import{r as e}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import{a as n}from"./routes-BnbYm-Mr.js";var r=t();function i(){return(0,r.jsx)(e,{to:n.account.login,replace:!0})}export{i as PasswordResetPage};
|
package/dist/assets/{platform-loopback-page-BlVfvSj9.js → platform-loopback-page-D2GKqkS3.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{x as a}from"./local-mode-Bvz5B1q8.js";import{A as o,c as s,n as c}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{x as a}from"./local-mode-Bvz5B1q8.js";import{A as o,c as s,n as c}from"./auth-store-woVh7RrN.js";import{c as l}from"./api-CaQT1t9I.js";import{a as u}from"./routes-BnbYm-Mr.js";var d=e(t(),1),f=i(),p=`vellum:loopback:state`,m=`vellum:loopback:returnTo`;function h(){let[e]=r(),t=n(),[i,h]=(0,d.useState)(null);return(0,d.useEffect)(()=>{let n=e.get(`state`),r=e.get(`session_token`),i=sessionStorage.getItem(p),d=sessionStorage.getItem(m)||u.assistant;if(sessionStorage.removeItem(p),sessionStorage.removeItem(m),!n||n!==i){h(`Login failed: state mismatch. Please try again.`);return}if(!r){h(`Login failed: no session token received. Please try again.`);return}if(!/^[a-zA-Z0-9]+$/.test(r)){h(`Login failed: invalid session token.`);return}document.cookie=`sessionid=${r}; path=/; samesite=lax; max-age=1209600`,(async()=>{await c.getState().initSession(),await o(!0);try{let e=await l();if(e.ok&&e.data.length>0){await a(e.data,s.getState().currentOrganizationId??void 0),t(u.assistant,{replace:!0});return}}catch{}t(d,{replace:!0})})()},[e,t]),i?(0,f.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,f.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,f.jsx)(`p`,{className:`text-body-medium-default`,children:i}),(0,f.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(u.welcome),children:`Back to Welcome`})]})}):(0,f.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,f.jsx)(`p`,{className:`text-body-medium-default`,children:`Completing login...`})})}export{h as PlatformLoopbackPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{p as r,r as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./useQuery-B45lW1Kk.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{t as l}from"./card-BibIM9x3.js";import"./src-C4Sj609L.js";import{t as u}from"./confirm-dialog-DbNUkFt6.js";import{n as d}from"./toast-DLWkiWW6.js";import{t as f}from"./external-link-BK_NhMUL.js";import{t as p}from"./loader-circle-CdxxVJvk.js";import{t as m}from"./triangle-alert-B-ye6tYl.js";import{$ as h,Bt as g,Q as _,Vt as v,X as y,Y as b,tt as x,zt as S}from"./react-query.gen-Dc9bPcAq.js";import{a as C}from"./routes-BnbYm-Mr.js";import{t as w}from"./assistant-feature-flag-store-ClCVaYet.js";import{Ki as T,Xa as E,bo as D,fo as O,xo as k}from"./index-DXxd4eQM.js";import{t as A}from"./use-active-assistant-id-BFElIHKJ.js";import{t as j}from"./file-markdown-CCyGVLOO.js";import{n as M,r as N,t as P}from"./use-plugin-drift-B1mUU7pv.js";var F=e(t(),1),I=c();function L(e){return e?e.slice(0,7):`unknown`}function R(){let e=w.use.hasHydrated(),t=w.use.externalPlugins(),c=A(),{name:f}=r(),p=o(),[m,T]=(0,F.useState)(!1),[E,O]=(0,F.useState)(!1),k=s({...b({path:{assistant_id:c,name:f??``}}),enabled:!!c&&!!f}),N=k.data?.installed??!1,R=M({assistantId:c,name:f??``,enabled:N}).data,W=(0,F.useCallback)(()=>{p.invalidateQueries({queryKey:h({path:{assistant_id:c}})}),p.invalidateQueries({queryKey:x({path:{assistant_id:c}})}),f&&(p.invalidateQueries({queryKey:y({path:{assistant_id:c,name:f}})}),p.invalidateQueries({queryKey:_({path:{assistant_id:c,name:f}})}))},[c,f,p]),G=v({onSuccess:()=>{W(),d.success(`Installed ${f??`plugin`}`)}}),K=S({onSuccess:W}),q=g({onSuccess:e=>{W(),d.success(e.outcome===`already-up-to-date`?`${f??`Plugin`} is already up to date`:`Upgraded ${f??`plugin`} to ${L(e.toCommit)}`)}});if(!e)return null;if(!t)return(0,I.jsx)(i,{to:C.identity,replace:!0});if(!f)return(0,I.jsx)(i,{to:C.plugins,replace:!0});let J=()=>{G.mutate({path:{assistant_id:c},body:{name:f}})},Y=()=>{T(!1),K.mutate({path:{assistant_id:c,name:f}})},X=()=>{q.mutate({path:{assistant_id:c,name:f},body:{}})},Z=()=>{if(P(R)){O(!0);return}X()},Q=()=>{O(!1),X()},$=k.data??null;return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,I.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,I.jsx)(n,{asChild:!0,variant:`ghost`,children:(0,I.jsx)(a,{to:C.plugins,"aria-label":`Back to plugins`,children:(0,I.jsx)(D,{"aria-hidden":!0})})}),(0,I.jsx)(z,{name:f,plugin:$,drift:R,onInstall:J,onRemove:()=>T(!0),onUpgrade:Z,isInstalling:G.isPending,isRemoving:K.isPending,isUpgrading:q.isPending})]}),(G.isError||K.isError||q.isError)&&(0,I.jsx)(U,{message:G.isError?`Failed to install plugin. Please try again.`:K.isError?`Failed to remove plugin. Please try again.`:`Failed to upgrade plugin. Please try again.`}),(0,I.jsx)(l.Root,{asChild:!0,children:(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:k.isLoading?(0,I.jsx)(V,{}):k.isError||!$?(0,I.jsx)(H,{}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(B,{plugin:$}),$.readme?(0,I.jsx)(j,{content:$.readme}):(0,I.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})}),(0,I.jsx)(u,{open:m,title:`Remove plugin`,message:`Remove "${$?.name??f}" from this assistant?`,confirmLabel:`Remove`,destructive:!0,onConfirm:Y,onCancel:()=>T(!1)}),(0,I.jsx)(u,{open:E,title:`Upgrade plugin`,message:`"${$?.name??f}" has local edits that will be overwritten by the upgrade. Continue?`,confirmLabel:`Upgrade anyway`,destructive:!0,onConfirm:Q,onCancel:()=>O(!1)})]})}function z({name:e,plugin:t,drift:r,onInstall:i,onRemove:a,onUpgrade:o,isInstalling:s,isRemoving:c,isUpgrading:l}){let u=t?.installed??!1,d=t?.source?.kind===`github`,f=t?.artifact??null,m=r?.status===`update-available`,h=m?`Upgrade ${L(r?.local?.commit??null)} \u2192 ${L(r?.remote?.commit??null)}`:void 0;return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:d?`📦`:`🧩`}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,I.jsx)(`h2`,{className:`truncate text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,I.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,d?(0,I.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-tertiary)`},children:`external`}):null,m?(0,I.jsx)(N,{}):null]}),t?.description?(0,I.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?u?(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[f?(0,I.jsx)(n,{asChild:!0,leftIcon:(0,I.jsx)(E,{"aria-hidden":!0}),children:(0,I.jsx)(`a`,{href:f.url,download:!0,children:f.label??`Download`})}):null,m?(0,I.jsx)(n,{type:`button`,onClick:o,disabled:l,title:h,leftIcon:l?(0,I.jsx)(p,{className:`animate-spin`,"aria-hidden":!0}):(0,I.jsx)(O,{"aria-hidden":!0}),children:`Upgrade`}):null,(0,I.jsx)(n,{type:`button`,variant:`dangerOutline`,onClick:a,disabled:c,leftIcon:c?(0,I.jsx)(p,{className:`animate-spin`,"aria-hidden":!0}):(0,I.jsx)(T,{"aria-hidden":!0}),children:`Remove`})]}):(0,I.jsx)(n,{type:`button`,onClick:i,disabled:s,leftIcon:s?(0,I.jsx)(p,{className:`animate-spin`,"aria-hidden":!0}):(0,I.jsx)(k,{"aria-hidden":!0}),children:`Install`}):null]})}function B({plugin:e}){let t=[{label:`Source`,value:e.source?.kind===`github`?e.source.repo:`Local`,href:(e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null)??void 0}];return e.homepage&&t.push({label:`Homepage`,value:e.homepage,href:e.homepage}),e.license&&t.push({label:`License`,value:e.license}),(0,I.jsx)(`dl`,{className:`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,style:{borderColor:`var(--border-base)`},children:t.map(e=>(0,I.jsxs)(`div`,{className:`contents`,children:[(0,I.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,I.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,I.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 underline`,style:{color:`var(--primary-base, #60a5fa)`},children:[e.value,(0,I.jsx)(f,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function V(){return(0,I.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,I.jsx)(p,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function H(){return(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,I.jsx)(m,{className:`h-6 w-6`,"aria-hidden":!0}),(0,I.jsx)(`p`,{className:`text-body-medium-default`,children:`We couldn't load this plugin.`}),(0,I.jsx)(`p`,{className:`text-body-small-default`,children:`It may not exist, or your assistant may be on an older build.`})]})}function U({message:e}){return(0,I.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,I.jsx)(m,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),e]})}export{R as PluginDetailPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n,t as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./card-BibIM9x3.js";import"./src-C4Sj609L.js";import{t as s}from"./input-CwdmSRlD.js";import{t as c}from"./chevron-right-Cu9YGUrb.js";import{t as l}from"./loader-circle-CdxxVJvk.js";import{t as u}from"./triangle-alert-B-ye6tYl.js";import{_n as d}from"./sdk.gen-ZXouuy0U.js";import{$ as f,et as p}from"./react-query.gen-Dc9bPcAq.js";import{a as m}from"./routes-BnbYm-Mr.js";import{t as h}from"./assistant-feature-flag-store-ClCVaYet.js";import{fa as g,oa as _}from"./index-DXxd4eQM.js";import{t as v}from"./use-active-assistant-id-BFElIHKJ.js";import{n as y,r as b}from"./use-plugin-drift-B1mUU7pv.js";var x=e(t(),1),S=a();function C({match:e}){return(0,S.jsx)(o.Root,{asChild:!0,children:(0,S.jsxs)(r,{to:m.plugin(e.name),className:`group flex cursor-pointer items-center gap-4 px-5 py-4 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,S.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:`📦`}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,S.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.name})}),e.description&&(0,S.jsx)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.description}),(0,S.jsx)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},title:e.path,children:e.path})]}),(0,S.jsx)(c,{className:`h-5 w-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})})}function w({plugin:e,assistantId:t}){let n=y({assistantId:t,name:e.name}).data?.status===`update-available`;return(0,S.jsx)(o.Root,{asChild:!0,children:(0,S.jsxs)(r,{to:m.plugin(e.name),className:`group flex cursor-pointer items-center gap-4 px-5 py-4 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,S.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center text-2xl`,children:`🧩`}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.name}),e.version?(0,S.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,e.version]}):null,n?(0,S.jsx)(b,{}):null]}),(0,S.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:e.description??`No description provided.`}),e.issues&&e.issues.length>0?(0,S.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:e.issues.join(`; `),children:[e.issues[0],e.issues.length>1?` (+${e.issues.length-1} more)`:``]}):null]}),(0,S.jsx)(c,{className:`h-5 w-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})})}var T=300*1e3;function E(e,...t){return e?t.some(t=>t?.toLowerCase().includes(e)):!0}function D({assistantId:e}){let[t,n]=(0,x.useState)(``),r=t.trim().toLowerCase(),a=i({queryKey:f({path:{assistant_id:e},query:{q:void 0}}),queryFn:async({signal:t})=>{let n=await d({path:{assistant_id:e},query:{q:void 0},signal:t,throwOnError:!1});if(n.response?.status===404)return{plugins:[]};if(!n.response?.ok)throw Error(`Failed to load plugins`);return n.data??{plugins:[]}},enabled:!!e,staleTime:T}),o=i({...p({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e,staleTime:T}),s=(0,x.useMemo)(()=>O(a.data?.plugins??[]),[a.data?.plugins]),c=(0,x.useMemo)(()=>new Set(s.map(e=>e.name)),[s]),l=(0,x.useMemo)(()=>s.filter(e=>E(r,e.name,e.description)),[s,r]),u=(0,x.useMemo)(()=>(o.data?.matches??[]).filter(e=>!c.has(e.name)&&E(r,e.name,e.description)),[o.data?.matches,c,r]),m=a.isFetching&&!a.isLoading||o.isFetching&&!o.isLoading,h=a.isLoading,g=o.isLoading,_=!h&&!a.isError&&l.length===0,v=!g&&u.length===0;return(0,S.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[(0,S.jsx)(k,{search:t,onSearchChange:n,isSearching:m}),(0,S.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:[(0,S.jsx)(A,{title:`Installed`}),h?(0,S.jsx)(j,{}):a.isError?(0,S.jsx)(P,{}):_?(0,S.jsx)(M,{hasQuery:!!r}):(0,S.jsx)(`ul`,{className:`flex flex-col gap-2`,children:l.map(t=>(0,S.jsx)(`li`,{children:(0,S.jsx)(w,{plugin:t,assistantId:e})},t.id))}),(0,S.jsx)(`div`,{className:`mt-6`}),(0,S.jsx)(A,{title:`Available to install`}),g?(0,S.jsx)(j,{}):o.isError?(0,S.jsx)(F,{}):v?(0,S.jsx)(N,{hasQuery:!!r}):(0,S.jsx)(`ul`,{className:`flex flex-col gap-2`,children:u.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsx)(C,{match:e})},e.path))})]})]})}function O(e){return[...e].sort((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:`base`}))}function k({search:e,onSearchChange:t,isSearching:n}){return(0,S.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,S.jsx)(s,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search Plugins`,"aria-label":`Search Plugins`,leftIcon:(0,S.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:n?(0,S.jsx)(l,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`})})}function A({title:e}){return(0,S.jsx)(`h3`,{className:`mb-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e})}function j(){return(0,S.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,S.jsx)(l,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function M({hasQuery:e}){let t=e?`No installed plugins match`:`No Plugins Installed`,n=e?`Try a different search term, or browse the catalog below.`:`Install a plugin with the CLI, or browse the catalog below.`,r=e?_:g;return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(r,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:t}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n})]})})}function N({hasQuery:e}){let t=e?`No catalog entries match`:`Catalog is empty`,n=e?`Try a different search term, or remove the filter to browse everything.`:`No plugins are currently published in the catalog.`;return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(_,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:t}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n})]})})}function P(){return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(u,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load plugins`}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function F(){return(0,S.jsx)(o.Root,{children:(0,S.jsxs)(o.Body,{className:`flex flex-col items-center justify-center py-10 text-center`,children:[(0,S.jsx)(g,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,S.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Couldn't load catalog`}),(0,S.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Catalog browsing is temporarily unavailable. Installed plugins are still listed above.`})]})})}function I(){let e=h.use.hasHydrated(),t=h.use.externalPlugins(),r=v();return e?t?(0,S.jsx)(D,{assistantId:r}):(0,S.jsx)(n,{to:m.identity,replace:!0}):null}export{I as PluginsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./card-BibIM9x3.js";import{t as l}from"./input-CwdmSRlD.js";import{a as u,d,s as f}from"./local-mode-Bvz5B1q8.js";import{t as p}from"./is-electron-BuSDabCt.js";import{n as m}from"./resolved-assistants-store-Cumv2SiX.js";import{t as h}from"./chevron-left-H9xBKELt.js";import{t as g}from"./loader-circle-CdxxVJvk.js";import{t as _}from"./pencil-BqT-WChe.js";import{t as v}from"./x-Bmx5Uey2.js";import{G as y,W as b,a as x,i as S,k as C,n as w}from"./auth-store-woVh7RrN.js";import{t as T}from"./client.gen-ZHFX_7TH.js";import{a as E}from"./routes-BnbYm-Mr.js";import{i as D,t as O}from"./prefs-DziJ3-oV.js";import{t as k}from"./client-feature-flag-store-DZMwD6Gv.js";import{t as A}from"./public-asset-y2pjkMTl.js";import{An as j,Dr as M,F as N,I as ee,Ja as P,P as te,an as ne,at as re,c as ie,ct as F,d as ae,dt as I,gt as oe,ht as se,in as ce,l as le,mo as L,nn as ue,ot as R,pn as de,rn as fe,s as z,st as pe,ut as me}from"./index-DXxd4eQM.js";import{c as he,i as ge,n as B,o as _e,r as ve,s as ye,t as V}from"./step-indicator-dots-D5GsK2aj.js";import{n as H,r as be}from"./prechat-names-Ba-YnefK.js";var U=e(t(),1);async function xe(){try{let{data:e,response:t}=await T.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var W=s(),Se=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function Ce({onComplete:e}){function t(){le(),z(),e()}return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,W.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,W.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,W.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,W.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,W.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,W.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,W.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,W.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,W.jsx)(`ul`,{className:`space-y-4`,children:Se.map((e,t)=>(0,W.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,W.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,W.jsx)(L,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,W.jsxs)(`span`,{className:`text-left`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,W.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var G=`google`,we=[{id:`gmail`,label:`Gmail`,logoSrc:A(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:A(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:A(`/images/integrations/google-drive.svg`)}];function Te({assistantId:e,assistantName:t,onConnect:r,onSkip:i,onBack:o}){let s=p(),c=a(),l=C(),u=(0,U.useRef)(null),d=(0,U.useRef)(null),f=(0,U.useRef)(null),m=(0,U.useRef)(null),_=(0,U.useRef)(null),v=(0,U.useRef)(null),y=(0,U.useRef)(null),[b,x]=(0,U.useState)(!1),S=(0,U.useCallback)(()=>{d.current=null,x(!1)},[]),w=(0,U.useCallback)(()=>{_.current&&=(window.removeEventListener(`message`,_.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),T=(0,U.useCallback)(()=>{u.current&&!u.current.closed&&u.current.close(),u.current=null,f.current&&=(clearInterval(f.current),null),m.current&&=(clearTimeout(m.current),null)},[]),D=M();(0,U.useEffect)(()=>()=>{f.current&&clearInterval(f.current),m.current&&clearTimeout(m.current),u.current&&!u.current.closed&&u.current.close(),_.current&&window.removeEventListener(`message`,_.current),v.current&&window.removeEventListener(`storage`,v.current),y.current&&=(y.current(),null)},[]);let O=(0,U.useCallback)(async e=>{try{return(await c.fetchQuery({...j({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===G&&e.connected)??null}catch{return null}},[c]),k=(0,U.useCallback)(async()=>{let e=d.current?.platformAssistantId;T(),S(),r((e?await O(e):null)?.scopes_granted??[])},[S,T,O,r]),A=(0,U.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!d.current||e.requestId!==d.current.requestId||(e.oauthStatus===`connected`?k():(T(),S())))},[S,T,k]),N=(0,U.useCallback)(e=>{let t=d.current;if(!t)return;let n=re(e,window.location.origin,t.requestId);n&&A(n)},[A]),P=(0,U.useCallback)(e=>{let t=d.current;if(!t)return;let n=R(e,t.requestId);n&&(A(n),window.localStorage.removeItem(F(t.requestId)))},[A]);me((0,U.useCallback)(e=>{let t=d.current;t&&e.requestId===t.requestId&&A({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[A]));let te=(0,U.useCallback)(()=>{let t=crypto.randomUUID();if(w(),_.current=N,v.current=P,l){x(!0),(async()=>{let n;try{n=await ee(e)}catch{S();return}d.current={requestId:t,platformAssistantId:n},D.mutate({path:{assistant_id:n,provider:G},body:{requested_scopes:[],redirect_after_connect:`${E.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){se(e.connect_url)},onError(){S()}})})(),window.addEventListener(`message`,N),window.addEventListener(`storage`,P),y.current&&y.current();let n=oe(()=>{let e=d.current;if(!e){n(),y.current=null;return}(async()=>{let t=await O(e.platformAssistantId);d.current&&(t?await k():S(),w(),n(),y.current=null)})()});y.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){w();return}u.current=n,x(!0),window.addEventListener(`message`,N),window.addEventListener(`storage`,P),f.current=setInterval(()=>{u.current&&u.current.closed&&d.current&&!m.current&&(m.current=setTimeout(async()=>{m.current=null;let e=d.current;if(!e)return;let t=window.localStorage.getItem(F(e.requestId));if(t)try{let n=JSON.parse(t);if(pe(n,e.requestId)){A(n),window.localStorage.removeItem(F(e.requestId)),w();return}}catch{}let n=await O(e.platformAssistantId);d.current&&(n?await k():(T(),S()),w())},1e3))},100),(async()=>{let n;try{n=await ee(e)}catch{T(),S(),w();return}d.current={requestId:t,platformAssistantId:n},D.mutate({path:{assistant_id:n,provider:G},body:{requested_scopes:[],redirect_after_connect:`${E.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){u.current&&!u.current.closed?u.current.location.href=e.connect_url:d.current&&(T(),S(),w())},onError(){T(),S(),w()}})})()},[e,S,T,O,A,N,P,k,l,w,D]),ne=t||`your assistant`,ie=t||`Your assistant`;return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${s?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(h,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${s?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${ne} can use Gmail, Calendar, and Drive with your permission.`}),(0,W.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:we.map(e=>(0,W.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,W.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,W.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${ie} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,W.jsxs)(`div`,{className:`${s?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:te,disabled:b||D.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:b||D.isPending?(0,W.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,W.jsx)(g,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,disabled:b||D.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function Ee({userName:e,assistantName:t,selectedGroupId:r,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:u,onSkip:d}){let f=p();return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,W.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(h,{className:`h-4 w-4`})}):null,(0,W.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,W.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,W.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),fullWidth:!0}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),fullWidth:!0}),(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>{let n=e===t;return(0,W.jsx)(`button`,{type:`button`,onClick:()=>o(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,W.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:H.map(e=>(0,W.jsx)(De,{group:e,isActive:r===e.id,onToggle:()=>s(r===e.id?null:e.id)},e.id))})]})]}),(0,W.jsxs)(`div`,{className:`${f?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:d,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function De({group:e,isActive:t,onToggle:n}){return(0,W.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,W.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function Oe({userName:e,assistantName:t,displayedAssistantNames:r,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:u,totalSteps:d}){return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[o?(0,W.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,W.jsx)(h,{}),onClick:o,"aria-label":`Back`}):(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,W.jsx)(`div`,{className:`flex justify-center`,children:(0,W.jsx)(V,{current:u,total:d})}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,W.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,W.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,W.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),fullWidth:!0}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),fullWidth:!0}),(0,W.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let n=e===t;return(0,W.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var ke=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:A(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:A(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:A(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:A(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:A(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:A(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:A(`/images/prior-assistants/copilot.svg`)}];function Ae({selectedAssistants:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,U.useState)(()=>K(e)),[d,f]=(0,U.useState)(()=>s.length>0),m=(0,U.useRef)(q(e));(0,U.useEffect)(()=>{let t=q(e);if(t===m.current)return;let n=K(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,U.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}je(n,e)||(m.current=q(n),t(n))},[s]);let g=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},y=(0,U.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(h,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,W.jsxs)(`div`,{className:`${o?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[ke.map(t=>(0,W.jsx)(Me,{assistant:t,selected:e.has(t.id),onToggle:()=>g(t.id)},t.id)),d?null:(0,W.jsx)(Ne,{onClick:()=>f(!0)})]}),d?(0,W.jsx)(c,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(_,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(v,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,W.jsx)(l,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple assistants with commas`,fullWidth:!0}),y.length>0?(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:y.map(e=>(0,W.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,W.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function je(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function K(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function q(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Me({assistant:e,selected:t,onToggle:n}){return(0,W.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(Pe,{assistant:e,size:32}),(0,W.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,W.jsx)(L,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Ne({onClick:e}){return(0,W.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,W.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,W.jsx)(P,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,W.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Pe({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,W.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,W.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,W.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Fe({selectedTasks:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),s=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(h,{className:`h-4 w-4`})}),(0,W.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsx)(`p`,{className:`${o?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,W.jsx)(`div`,{className:`${o?`mt-6`:`mt-8`} flex w-full flex-col ${o?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:te.map(t=>{let n=N[t.iconKey],r=e.has(t.id);return(0,W.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${o?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,W.jsx)(n,{className:`h-4 w-4`}):null}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,W.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,W.jsx)(L,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,W.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Ie=new Set([`gmail`,`google-calendar`,`google-drive`]),Le=[{id:`gmail`,label:`Gmail`,logoSrc:A(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:A(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:A(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:A(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:A(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:A(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:A(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:A(`/images/integrations/github.svg`),logoSrcDark:A(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:A(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:A(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:A(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:A(`/images/integrations/apple-notes.svg`)}];function J(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function Re({selectedTools:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,U.useState)(()=>Y(e)),[d,f]=(0,U.useState)(()=>s.length>0),m=(0,U.useRef)(X(e));(0,U.useEffect)(()=>{let t=X(e);if(t===m.current)return;let n=Y(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,U.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}ze(n,e)||(m.current=X(n),t(n))},[s]);let g=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},y=(0,U.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full items-center ${r?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[r?(0,W.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(h,{className:`h-4 w-4`})}):null,(0,W.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),r?(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,W.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,W.jsxs)(`div`,{className:`grid w-full gap-2 ${o?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Le.map(t=>(0,W.jsx)(Z,{tool:t,selected:e.has(t.id),onToggle:()=>g(t.id),electron:o},t.id)),d?null:(0,W.jsx)(Q,{onClick:()=>f(!0),electron:o})]}),d?(0,W.jsx)(c,{padding:o?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,W.jsxs)(`div`,{className:`flex flex-col ${o?`gap-2`:`gap-3`}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(_,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,W.jsx)(v,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,W.jsx)(l,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple tools with commas`,fullWidth:!0}),y.length>0?(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:y.map(e=>(0,W.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,W.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function ze(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function X(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Z({tool:e,selected:t,onToggle:n,electron:r}){return(0,W.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)($,{tool:e,size:32}),(0,W.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,W.jsx)(L,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Q({onClick:e,electron:t}){return(0,W.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,W.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,W.jsx)(P,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,W.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function $({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,W.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,W.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,W.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,W.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,W.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Be({selectedGroupId:e,onGroupChange:t,onBack:r,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,W.jsx)(I,{showCreatureFooter:!1,children:(0,W.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,W.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,W.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,W.jsx)(h,{}),onClick:r,"aria-label":`Back`}),(0,W.jsx)(`div`,{className:`flex justify-center`,children:(0,W.jsx)(V,{current:o,total:s})}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,W.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,W.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,W.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:H.map(n=>{let r=e===n.id;return(0,W.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,W.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,W.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,W.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,W.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,W.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function Ve(e){let[t,n]=(0,U.useState)(()=>(e??``).trim()),r=(0,U.useRef)(!1);return(0,U.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,U.useCallback)(e=>{r.current=!0,n(e)},[])}}var He=[`gmail`,`google-calendar`,`google-drive`],Ue=`experiment-activation-flow-2026-06-03`,We=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ge(e,t,n){return t?.initialMessage?t.initialMessage:n?fe(e):ue}function Ke(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:t===`paredDown`?{tools:r?[...He]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:J([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=Ue,i.bootstrapTemplate=We);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),t===`paredDown`?r&&(i.googleScopes=e.connectedScopes):t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=J([...e.selectedPriorAssistants])),i.initialMessage=Ge(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function qe(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Je(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:B.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:B.controlWorkType,enabled:!t},{id:`tools`,funnelStep:B.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:B.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?B.gmailConnect:B.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:B.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Ye(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Xe=`1`;function Ze(e){return e===`nativeVibe`||e===Xe?`nativeVibe`:null}function Qe(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function et(){let e=r(),t=C(),n=D()&&O();return(0,U.useEffect)(()=>{!n&&!t&&e(E.onboarding.privacy,{replace:!0})},[n,t,e]),t||n}function tt(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,U.useState)(()=>t?`nativeName`:`name`),a=(0,U.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,U.useLayoutEffect)(()=>{if(n)try{let e=Ze(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,U.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,U.useCallback)(()=>{a(null)},[a])}}var nt=3;function rt(){let e=f();return e?.cloud===`vellum`?e.assistantId:u()[0]?.assistantId??null}function it(){let e=r(),[t]=i(),n=t.get(`preview`)===`true`,a=w.use.user(),s=S(),c=x(),l=a?.id??null,u=a?.firstName??``,f=a?.lastName??``,p=C(),h=m.use.activeAssistantId(),g=d(),_=ae()&&!ie(),v=k.use.stringFlags().preChatOnboardingExperiment20260606??`control`,T=(k.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,D=k.use.selfIntroGreeting(),O=_e(v),A=ye()??O,j=A===ve.paredDown,M=g?rt():null,N=et(),{currentStep:ee,setCurrentStep:P,clearPersistedStep:te}=tt(l,p),re=w.use.platformSession(),F=y(re),[I,oe]=(0,U.useState)(()=>new Set),[se,le]=(0,U.useState)(()=>new Set),[L,ue]=(0,U.useState)(()=>new Set),{value:R,onChange:fe}=Ve(g&&!F?``:u||f),[z,pe]=(0,U.useState)(null),[me]=(0,U.useState)(()=>be()),[B,V]=(0,U.useState)(``),[H,Se]=(0,U.useState)(!1),[G,we]=(0,U.useState)([]),{data:De}=o({...de(),enabled:!c&&s&&(!g||F)}),{data:ke,isLoading:je}=o({queryKey:[`onboarding-recipe`,l],queryFn:xe,enabled:!c&&s&&!p&&!g,staleTime:1/0}),K=ke??null,q=De?.id??h??M,Me=qe({localMode:g,platformSession:re,hasCachedPlatformAssistant:M!==null}),Ne=Me,Pe=Me,Le=async()=>{await b.checkAssistant(),e(`${E.assistant}?onboarding=1`,{replace:!0})};function J(e,t=A){n||ge(e,{userId:l,variant:he(t)})}let ze=[...I].some(e=>Ie.has(e)),Y=p?Ye():Je({paredDown:j,canOfferPriorAssistants:Pe,canOfferGoogleStep:n?!1:Ne,hasGoogleTool:ze,showIOSAppStep:_});function X(t){if(n){e(-1);return}ne(Ke({mode:p?`native`:j?`paredDown`:`control`,recipe:p?null:K,selectedTools:I,selectedTasks:se,selectedPriorAssistants:t?.selectedPriorAssistants??L,tone:z??K?.tone??`grounded`,userName:R,assistantName:B,selfIntroGreetingEnabled:D,activationFlowEnabled:p?void 0:T,googleConnected:H,googleScopes:G,connectedScopes:t?.connectedScopes}));let r=B.trim();r&&ce(r),p?(te(),e(E.onboarding.privacy)):(b.markExpectingFirstMessage(),Le())}let Z=(e,t)=>{e.funnelStep&&J(e.funnelStep);let n=Qe(Y,e.id);n?P(n):X(t)},Q=e=>{let t=$e(Y,e.id);t&&P(t)};if(!N||je)return null;let $=Y.find(e=>e.id===ee)??Y[0];return $?$.id===`nativeName`?(0,W.jsx)(Oe,{userName:R,assistantName:B,displayedAssistantNames:me,onUserNameChange:fe,onAssistantNameChange:V,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:nt}):$.id===`nativeVibe`?(0,W.jsx)(Be,{selectedGroupId:z,onGroupChange:pe,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:nt}):$.id===`name`?(0,W.jsx)(Ee,{userName:R,assistantName:B,selectedGroupId:z,displayedAssistantNames:me,onUserNameChange:fe,onAssistantNameChange:V,onGroupChange:pe,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,W.jsx)(Fe,{selectedTasks:se,onChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,W.jsx)(Re,{selectedTools:I,onChange:oe,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,W.jsx)(Ae,{selectedAssistants:L,onChange:ue,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;ue(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?q?(0,W.jsx)(Te,{assistantId:q,assistantName:B,onConnect:e=>{Se(!0),we(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,W.jsx)(Ce,{onComplete:()=>Z($)}):null:null}function at(){return(0,W.jsx)(it,{})}export{at as PreChatRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{n as i}from"./device-settings-zXRxGDTH.js";import{t as a}from"./react-DJZBPgpf.js";import{f as o}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{n as i}from"./device-settings-zXRxGDTH.js";import{t as a}from"./react-DJZBPgpf.js";import{f as o}from"./auth-store-woVh7RrN.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.aiDataConsent(),(0,s.useCallback)(e=>{o.getState().setAiDataConsent(e)},[])]}function p(){return o.getState().tosAccepted}function m(){return o.getState().aiDataConsent}function h(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function g(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function _(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{f as a,d as c,p as i,_ as l,g as n,l as o,h as r,u as s,m as t};
|