@vellumai/web 0.11.1-staging.2 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/assets/{access-C97H-xHb.js → access-BJiXpwUJ.js} +1 -1
  2. package/dist/assets/{account-page-Cflmw8J6.js → account-page-DP2HVinz.js} +1 -1
  3. package/dist/assets/{acp-run-detail-panel-BZ36-1N5.js → acp-run-detail-panel-C_M19m8P.js} +1 -1
  4. package/dist/assets/{activity-steps-panel-KMiSlUt3.js → activity-steps-panel-BsmwWzP1.js} +1 -1
  5. package/dist/assets/{add-credits-modal-Daz6j8gm.js → add-credits-modal-3Rsd1ZeS.js} +1 -1
  6. package/dist/assets/{ai-page-DPVi-dhB.js → ai-page-B9mJkV_p.js} +1 -1
  7. package/dist/assets/{app-card-JHbWefmm.js → app-card-DgDV-yMd.js} +1 -1
  8. package/dist/assets/{assistant-status-panel-CLMAEQ-v.js → assistant-status-panel-Bt_19-BI.js} +1 -1
  9. package/dist/assets/{auth-store-w_EmIQP7.js → auth-store-BwKMFgpK.js} +1 -1
  10. package/dist/assets/{background-task-actions-yrapeY1n.js → background-task-actions-DX0pUvY9.js} +1 -1
  11. package/dist/assets/{background-task-detail-panel-BV9Y227f.js → background-task-detail-panel-DqXuwo9q.js} +1 -1
  12. package/dist/assets/{billing-page-CmkTn62f.js → billing-page-CED96NEp.js} +1 -1
  13. package/dist/assets/{bookmarks-page-B2JvSaKf.js → bookmarks-page-Bk04EUIg.js} +1 -1
  14. package/dist/assets/{browser-CpgSNbEp.js → browser-Bses4IN3.js} +1 -1
  15. package/dist/assets/{build-state-DDUJ0MId.js → build-state-DPMhQpLB.js} +1 -1
  16. package/dist/assets/{channels-page-route-DAp7F6ed.js → channels-page-route-BooWFQMp.js} +1 -1
  17. package/dist/assets/{chat-markdown-message-B3Qo04ug.js → chat-markdown-message-f4cLJfax.js} +1 -1
  18. package/dist/assets/{checkout-continuation-DRPQwh5V.js → checkout-continuation-CcuqWhhp.js} +1 -1
  19. package/dist/assets/{checkout-page-B8CJoCWQ.js → checkout-page-BateK-Nf.js} +1 -1
  20. package/dist/assets/{client-identity-BSG341dO.js → client-identity-bdtPpHZK.js} +1 -1
  21. package/dist/assets/{command-palette-DH_ybPTY.js → command-palette-B3TVIQUH.js} +1 -1
  22. package/dist/assets/{command-palette-window-page-KoC7mrpM.js → command-palette-window-page-Bp9WplfA.js} +1 -1
  23. package/dist/assets/{contacts-page-route-BJBOnSQK.js → contacts-page-route--hTzWT8X.js} +1 -1
  24. package/dist/assets/{conversation-navigation-tj2ntPAn.js → conversation-navigation-D63NJmBl.js} +1 -1
  25. package/dist/assets/{conversation-queries-str0jfqv.js → conversation-queries-3taor2DZ.js} +1 -1
  26. package/dist/assets/{credentials-page-DFm5A_Dj.js → credentials-page-CYBmOQhl.js} +1 -1
  27. package/dist/assets/{debug-page-6DjAgWtl.js → debug-page-CHuby9yt.js} +1 -1
  28. package/dist/assets/{developer-page-dHmIDclp.js → developer-page-CUJqTs2_.js} +1 -1
  29. package/dist/assets/{diagnostics-BE1IgjfV.js → diagnostics-CLHyv7Xw.js} +1 -1
  30. package/dist/assets/{doctor-handoff-store-ClS6J-b-.js → doctor-handoff-store-DWNbuW3P.js} +1 -1
  31. package/dist/assets/{document-viewer-page-DJFR9XhM.js → document-viewer-page-_jndOS7P.js} +1 -1
  32. package/dist/assets/{emails-page-Ro1_IIiv.js → emails-page-Bqr8Buvt.js} +1 -1
  33. package/dist/assets/{first-run-scope-CZm4WhC7.js → first-run-scope-7wWjJ4Tn.js} +1 -1
  34. package/dist/assets/{funnel-events-BAmjKdwH.js → funnel-events-RT_kdQHK.js} +1 -1
  35. package/dist/assets/{general-page-BH3Zl4tV.js → general-page-DoAKoumC.js} +1 -1
  36. package/dist/assets/{handle-logout-C_CDLqjS.js → handle-logout-BTgnSSUm.js} +1 -1
  37. package/dist/assets/{haptics-agodX1nl.js → haptics-rJpeBta-.js} +1 -1
  38. package/dist/assets/{hatching-screen-CziT_eEj.js → hatching-screen-Q59qvj8_.js} +1 -1
  39. package/dist/assets/{home-page-route-BSHvc0DH.js → home-page-route-TPR5p3LW.js} +1 -1
  40. package/dist/assets/{hosting-screen-D6gwvyR3.js → hosting-screen-DRrmkmoO.js} +1 -1
  41. package/dist/assets/{index-D-NVGcvg.js → index-Ch9eoFem.js} +2 -2
  42. package/dist/assets/{ingest-DiiwFQfV.js → ingest-BbV11WbG.js} +1 -1
  43. package/dist/assets/{inspect-page-D0xZPslr.js → inspect-page-D_9E5ham.js} +1 -1
  44. package/dist/assets/{integrations-page-DuKFioaA.js → integrations-page-CnjTLjpf.js} +1 -1
  45. package/dist/assets/{library-detail-page-BmD8ODsN.js → library-detail-page-CKWN2cc7.js} +1 -1
  46. package/dist/assets/{library-page-B1_J428q.js → library-page-CuNX2WgS.js} +1 -1
  47. package/dist/assets/{local-runtime-upgrade-1CLFIVes.js → local-runtime-upgrade-JwVgn034.js} +1 -1
  48. package/dist/assets/{login-flow-BnCQjNXm.js → login-flow-llpmkEjN.js} +1 -1
  49. package/dist/assets/login-page-SG4TPVDu.js +1 -0
  50. package/dist/assets/{logout-page-BguUo424.js → logout-page-CBGk_cSN.js} +1 -1
  51. package/dist/assets/{logs-layout-BiZ4JakR.js → logs-layout-B4EPBuaC.js} +1 -1
  52. package/dist/assets/{memory-page-route-DwmCqWRb.js → memory-page-route-C8nIc6Mb.js} +1 -1
  53. package/dist/assets/{memory-router-playground-page-Bl-5j5de.js → memory-router-playground-page-ftfbkFhf.js} +1 -1
  54. package/dist/assets/{messages-BsXTJIIe.js → messages-BzNSqJQx.js} +1 -1
  55. package/dist/assets/{mobile-sidebar-drawer-Cp72bTDC.js → mobile-sidebar-drawer-BnxfQaDB.js} +1 -1
  56. package/dist/assets/native-anchor-BiuEQHcy.js +1 -0
  57. package/dist/assets/{native-biometric-CTR2Zi2w.js → native-biometric-B96mgKGP.js} +1 -1
  58. package/dist/assets/{navigation-resolver-CIICT6n9.js → navigation-resolver-Lxhf-tbn.js} +1 -1
  59. package/dist/assets/{notifications-page-CD8OVGKw.js → notifications-page-BAYd0t-0.js} +1 -1
  60. package/dist/assets/{open-workspace-file-DYklNHQ0.js → open-workspace-file-DucrTmt3.js} +2 -2
  61. package/dist/assets/{pairing-page-_kskNw0h.js → pairing-page-BRPUYbzJ.js} +1 -1
  62. package/dist/assets/{plans-page-D924rN93.js → plans-page-BxebYucs.js} +1 -1
  63. package/dist/assets/{platform-detection-BY5uzLL8.js → platform-detection-a_IB3-0w.js} +1 -1
  64. package/dist/assets/{platform-login-notice-DIS8PWXu.js → platform-login-notice-D-yQLWUo.js} +1 -1
  65. package/dist/assets/{platform-loopback-page-BTr35x9U.js → platform-loopback-page-DESnWJYO.js} +1 -1
  66. package/dist/assets/{privacy-page-BGXaPgBR.js → privacy-page-sZhcJ3uB.js} +1 -1
  67. package/dist/assets/{privacy-screen-znr9P7PH.js → privacy-screen-D2EBZTX8.js} +1 -1
  68. package/dist/assets/{provider-callback-page-Bn1Tp_ej.js → provider-callback-page-BZlfsT4J.js} +1 -1
  69. package/dist/assets/{provider-signup-page-C5z8x-YS.js → provider-signup-page-D5mOXHww.js} +1 -1
  70. package/dist/assets/{research-onboarding-route-DpC0dKBR.js → research-onboarding-route-ZOwRvfGs.js} +1 -1
  71. package/dist/assets/{retire-confirm-dialog-BFbPH66U.js → retire-confirm-dialog-m6ORm5Pq.js} +1 -1
  72. package/dist/assets/{review-terms-screen-W08isuCB.js → review-terms-screen-zzdu4AQi.js} +1 -1
  73. package/dist/assets/{risk-FjW-m05l.js → risk-uPLh5W5z.js} +1 -1
  74. package/dist/assets/{routes-DOTByxnJ.js → routes-BP00Ewbf.js} +5 -5
  75. package/dist/assets/{runtime-upgrade-banner-4PNA3XVR.js → runtime-upgrade-banner-yZYtWxoJ.js} +1 -1
  76. package/dist/assets/{schedules-page-BSr0-mjB.js → schedules-page-BQSGUmn5.js} +1 -1
  77. package/dist/assets/{select-assistant-screen-DAkhS0wl.js → select-assistant-screen-B5N_TUcG.js} +1 -1
  78. package/dist/assets/{session-corner-action-CqofVz_i.js → session-corner-action-vhb51vd3.js} +1 -1
  79. package/dist/assets/{settings-layout-DcuaK8qu.js → settings-layout-BtT0532M.js} +1 -1
  80. package/dist/assets/{share-feedback-modal-Dy0GRvA9.js → share-feedback-modal-DO6_oaZg.js} +1 -1
  81. package/dist/assets/{sidebar-tree-DrZXY5Iz.js → sidebar-tree-D6fHs4GK.js} +1 -1
  82. package/dist/assets/signup-page-DqfStkXZ.js +1 -0
  83. package/dist/assets/{site-favicon-CA7jaNnH.js → site-favicon-Dh1OTgFr.js} +1 -1
  84. package/dist/assets/{skill-detail-page-BCPN6NmR.js → skill-detail-page-SvM2JKKY.js} +1 -1
  85. package/dist/assets/{subagent-detail-panel-jOUXcDnl.js → subagent-detail-panel-jp0r0ZFk.js} +1 -1
  86. package/dist/assets/{subagent-store-C8qemfgn.js → subagent-store-DyKwOIj_.js} +1 -1
  87. package/dist/assets/{system-events-page-DEQyyquu.js → system-events-page-Cg0uMSMs.js} +1 -1
  88. package/dist/assets/{tool-detail-panel-86ruMQAQ.js → tool-detail-panel-CXcjfDGo.js} +1 -1
  89. package/dist/assets/{transcript-message-body-shared-CT5pk4wz.js → transcript-message-body-shared-woOFNF_q.js} +1 -1
  90. package/dist/assets/{upgrade-cancel-page-DmStvNCn.js → upgrade-cancel-page-D8is9-gw.js} +1 -1
  91. package/dist/assets/{upgrade-success-page-jOEtujYa.js → upgrade-success-page-3W1VuHqB.js} +1 -1
  92. package/dist/assets/{use-checkout-dismiss-refresh-BZXXQef1.js → use-checkout-dismiss-refresh-BkIzNk6B.js} +1 -1
  93. package/dist/assets/{use-command-palette-sections-DWCppiPf.js → use-command-palette-sections-CAmbyguu.js} +1 -1
  94. package/dist/assets/{use-edge-swipe-sMxDzAcb.js → use-edge-swipe-Gst62FjL.js} +1 -1
  95. package/dist/assets/{use-edge-swipe-back-Dbz1hC9g.js → use-edge-swipe-back-D12vbvly.js} +1 -1
  96. package/dist/assets/{use-ios-app-nudge-DiqQWH5O.js → use-ios-app-nudge-CrBEIZ8w.js} +1 -1
  97. package/dist/assets/{use-is-org-ready-BbqlQFXw.js → use-is-org-ready-zouQ5CN4.js} +1 -1
  98. package/dist/assets/{use-onboarding-login-xZhWGmky.js → use-onboarding-login-X8pB53cV.js} +1 -1
  99. package/dist/assets/{use-platform-assistant-id-BnFEQQeS.js → use-platform-assistant-id-CIoqMsyh.js} +1 -1
  100. package/dist/assets/{use-platform-gate-D9hR3R0n.js → use-platform-gate-CqEOGZtI.js} +1 -1
  101. package/dist/assets/use-return-to-short-circuit-B295pgoV.js +1 -0
  102. package/dist/assets/{use-sticky-profiles-GTUzoFP4.js → use-sticky-profiles-bdq2XW7H.js} +1 -1
  103. package/dist/assets/{use-subagent-card-data-Cu_-lx6d.js → use-subagent-card-data-B8JTa5rQ.js} +1 -1
  104. package/dist/assets/{voice-list-BMMz4e4M.js → voice-list-CCLkiF-c.js} +1 -1
  105. package/dist/assets/{voice-page-4AS-Fm6W.js → voice-page-Bvgm-7L8.js} +1 -1
  106. package/dist/assets/{welcome-screen-B-88csxO.js → welcome-screen-Cga6YuF9.js} +1 -1
  107. package/dist/assets/{workspace-page-b8SfI_28.js → workspace-page-BFJO59Ch.js} +1 -1
  108. package/dist/index.html +43 -43
  109. package/package.json +1 -1
  110. package/dist/assets/login-page-BnF7_s7c.js +0 -1
  111. package/dist/assets/native-anchor-BpfRwc60.js +0 -1
  112. package/dist/assets/signup-page-B6mmAQJU.js +0 -1
  113. package/dist/assets/use-return-to-short-circuit-B1mhvgIq.js +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{n as i,t as a}from"./use-swipe-engine-RAFE-Hrf.js";import{t as o}from"./x-DuBvjmAE.js";import"./src-BAS7a2RG.js";import{t as s}from"./haptics-agodX1nl.js";var c=e(t(),1),l=80;function u({enabled:e,onSwipeLeft:t,onSwipeRight:n,commitThresholdPx:r=l}){return a({enabled:e,axis:`horizontal`,commitThresholdPx:r,touchOnly:!0,onCommit:(0,c.useCallback)(e=>{e<=-r?(s.light(),t?.()):e>=r&&(s.light(),n?.())},[r,t,n])})}var d=r(),f=`(min-width: 640px)`,p=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function m({open:e,onClose:t,children:r,title:i}){let a=(0,c.useRef)(null),s=(0,c.useRef)(null),l=(0,c.useRef)(t);(0,c.useEffect)(()=>{l.current=t});let{dragOffset:m,isDragging:h,onTouchStart:g,onTouchMove:_,onTouchEnd:v,onTouchCancel:y}=u({enabled:e,onSwipeLeft:t});return(0,c.useEffect)(()=>{if(!e)return;s.current?.focus();let t=document.body.style.overflow;document.body.style.overflow=`hidden`;let n=window.matchMedia(f),r=e=>{e.matches&&l.current()};n.addEventListener(`change`,r);let i=e=>{if(e.key===`Escape`){l.current();return}if(e.key!==`Tab`||!a.current)return;let t=a.current.querySelectorAll(p),n=t[0],r=t[t.length-1];if(!n||!r){e.preventDefault();return}let i=document.activeElement,o=a.current.contains(i);e.shiftKey?(!o||i===n)&&(e.preventDefault(),r.focus()):(!o||i===r)&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`keydown`,i),n.removeEventListener(`change`,r),document.body.style.overflow=t}},[e]),e?(0,d.jsxs)(`div`,{ref:a,className:`fixed inset-0 sm:hidden`,style:{zIndex:40},role:`dialog`,"aria-modal":`true`,"aria-label":i,children:[(0,d.jsx)(`button`,{type:`button`,"aria-label":`Close sidebar`,className:`absolute inset-0 h-full w-full cursor-default`,style:{background:`rgba(0, 0, 0, 0.4)`,zIndex:40},onClick:t}),(0,d.jsxs)(`aside`,{className:`relative flex h-full w-[80vw] max-w-xs flex-col shadow-xl`,style:{background:`var(--surface-lift)`,borderRight:`1px solid var(--border-base)`,zIndex:50,paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,transform:`translateX(${m}px)`,transition:h?`none`:`transform 200ms ease-out`,touchAction:`pan-y`},onTouchStart:g,onTouchMove:_,onTouchEnd:v,onTouchCancel:y,children:[(0,d.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-3`,style:{borderColor:`var(--border-base)`},children:[(0,d.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:i}),(0,d.jsx)(n,{ref:s,type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,d.jsx)(o,{"aria-hidden":!0}),onClick:t,"aria-label":`Close`,tintColor:`var(--content-tertiary)`})]}),(0,d.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:r})]})]}):null}function h({onClick:e}){return(0,d.jsx)(n,{type:`button`,variant:`ghost`,iconOnly:(0,d.jsx)(i,{"aria-hidden":!0}),onClick:e,"aria-label":`Open sidebar`,tintColor:`var(--content-secondary)`,className:`sm:hidden`})}export{h as n,m as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{n as i,t as a}from"./use-swipe-engine-RAFE-Hrf.js";import{t as o}from"./x-DuBvjmAE.js";import"./src-BAS7a2RG.js";import{t as s}from"./haptics-rJpeBta-.js";var c=e(t(),1),l=80;function u({enabled:e,onSwipeLeft:t,onSwipeRight:n,commitThresholdPx:r=l}){return a({enabled:e,axis:`horizontal`,commitThresholdPx:r,touchOnly:!0,onCommit:(0,c.useCallback)(e=>{e<=-r?(s.light(),t?.()):e>=r&&(s.light(),n?.())},[r,t,n])})}var d=r(),f=`(min-width: 640px)`,p=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function m({open:e,onClose:t,children:r,title:i}){let a=(0,c.useRef)(null),s=(0,c.useRef)(null),l=(0,c.useRef)(t);(0,c.useEffect)(()=>{l.current=t});let{dragOffset:m,isDragging:h,onTouchStart:g,onTouchMove:_,onTouchEnd:v,onTouchCancel:y}=u({enabled:e,onSwipeLeft:t});return(0,c.useEffect)(()=>{if(!e)return;s.current?.focus();let t=document.body.style.overflow;document.body.style.overflow=`hidden`;let n=window.matchMedia(f),r=e=>{e.matches&&l.current()};n.addEventListener(`change`,r);let i=e=>{if(e.key===`Escape`){l.current();return}if(e.key!==`Tab`||!a.current)return;let t=a.current.querySelectorAll(p),n=t[0],r=t[t.length-1];if(!n||!r){e.preventDefault();return}let i=document.activeElement,o=a.current.contains(i);e.shiftKey?(!o||i===n)&&(e.preventDefault(),r.focus()):(!o||i===r)&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`keydown`,i),n.removeEventListener(`change`,r),document.body.style.overflow=t}},[e]),e?(0,d.jsxs)(`div`,{ref:a,className:`fixed inset-0 sm:hidden`,style:{zIndex:40},role:`dialog`,"aria-modal":`true`,"aria-label":i,children:[(0,d.jsx)(`button`,{type:`button`,"aria-label":`Close sidebar`,className:`absolute inset-0 h-full w-full cursor-default`,style:{background:`rgba(0, 0, 0, 0.4)`,zIndex:40},onClick:t}),(0,d.jsxs)(`aside`,{className:`relative flex h-full w-[80vw] max-w-xs flex-col shadow-xl`,style:{background:`var(--surface-lift)`,borderRight:`1px solid var(--border-base)`,zIndex:50,paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,transform:`translateX(${m}px)`,transition:h?`none`:`transform 200ms ease-out`,touchAction:`pan-y`},onTouchStart:g,onTouchMove:_,onTouchEnd:v,onTouchCancel:y,children:[(0,d.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-3`,style:{borderColor:`var(--border-base)`},children:[(0,d.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:i}),(0,d.jsx)(n,{ref:s,type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,d.jsx)(o,{"aria-hidden":!0}),onClick:t,"aria-label":`Close`,tintColor:`var(--content-tertiary)`})]}),(0,d.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:r})]})]}):null}function h({onClick:e}){return(0,d.jsx)(n,{type:`button`,variant:`ghost`,iconOnly:(0,d.jsx)(i,{"aria-hidden":!0}),onClick:e,"aria-label":`Open sidebar`,tintColor:`var(--content-secondary)`,className:`sm:hidden`})}export{h as n,m as t};
@@ -0,0 +1 @@
1
+ import{u as e}from"./native-biometric-B96mgKGP.js";import{n as t}from"./browser-Bses4IN3.js";function n(n,r){!r||!e()||(n.preventDefault(),t(r))}export{n as t};
@@ -3,4 +3,4 @@ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n}from"./device-settings-D
3
3
 
4
4
  `);p=a.pop()??``;for(let e of a){let t=e.split(`
5
5
  `),a=[],o;for(let e of t)if(e.startsWith(`data:`))a.push(e.replace(/^data:\s*/,``));else if(e.startsWith(`event:`))o=e.replace(/^event:\s*/,``);else if(e.startsWith(`id:`))d=e.replace(/^id:\s*/,``);else if(e.startsWith(`retry:`)){let t=Number.parseInt(e.replace(/^retry:\s*/,``),10);Number.isNaN(t)||(c=t)}let s,l=!1;if(a.length){let e=a.join(`
6
- `);try{s=JSON.parse(e),l=!0}catch{s=e}}l&&(i&&await i(s),r&&(s=await r(s))),n?.({data:s,event:o,id:d,retry:c}),a.length&&(yield s)}}}finally{m.removeEventListener(`abort`,h),f.releaseLock()}break}catch(e){if(t?.(e),o!==void 0&&p>=o)break;await f(Math.min(c*2**(p-1),s??3e4))}}}()}}var p=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},m=e=>{switch(e){case`form`:return`,`;case`pipeDelimited`:return`|`;case`spaceDelimited`:return`%20`;default:return`,`}},h=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},ee=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let t=(e?i:i.map(e=>encodeURIComponent(e))).join(m(r));switch(r){case`label`:return`.${t}`;case`matrix`:return`;${n}=${t}`;case`simple`:return t;default:return`${n}=${t}`}}let a=p(r),o=i.map(t=>r===`label`||r===`simple`?e?t:encodeURIComponent(t):g({allowReserved:e,name:n,value:t})).join(a);return r===`label`||r===`matrix`?a+o:o},g=({allowReserved:e,name:t,value:n})=>{if(n==null)return``;if(typeof n==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},te=({allowReserved:e,explode:t,name:n,style:r,value:i,valueOnly:a})=>{if(i instanceof Date)return a?i.toISOString():`${n}=${i.toISOString()}`;if(r!==`deepObject`&&!t){let t=[];Object.entries(i).forEach(([n,r])=>{t=[...t,n,e?r:encodeURIComponent(r)]});let a=t.join(`,`);switch(r){case`form`:return`${n}=${a}`;case`label`:return`.${a}`;case`matrix`:return`;${n}=${a}`;default:return a}}let o=h(r),s=Object.entries(i).map(([t,i])=>g({allowReserved:e,name:r===`deepObject`?`${n}[${t}]`:t,value:i})).join(o);return r===`label`||r===`matrix`?o+s:s},ne=/\{[^{}]+\}/g,re=({path:e,url:t})=>{let n=t,r=t.match(ne);if(r)for(let t of r){let r=!1,i=t.substring(1,t.length-1),a=`simple`;i.endsWith(`*`)&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(`.`)?(i=i.substring(1),a=`label`):i.startsWith(`;`)&&(i=i.substring(1),a=`matrix`);let o=e[i];if(o==null)continue;if(Array.isArray(o)){n=n.replace(t,ee({explode:r,name:i,style:a,value:o}));continue}if(typeof o==`object`){n=n.replace(t,te({explode:r,name:i,style:a,value:o,valueOnly:!0}));continue}if(a===`matrix`){n=n.replace(t,`;${g({name:i,value:o})}`);continue}let s=encodeURIComponent(a===`label`?`.${o}`:o);n=n.replace(t,s)}return n},ie=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let a=i.startsWith(`/`)?i:`/${i}`,o=(e??``)+a;t&&(o=re({path:t,url:o}));let s=n?r(n):``;return s.startsWith(`?`)&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function _(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return`serializedBody`in e?e.serializedBody!==void 0&&e.serializedBody!==``?e.serializedBody:null:e.body===``?null:e.body;if(t)return e.body}var ae=async(e,t)=>{let n=typeof t==`function`?await t(e):t;if(n)return e.scheme===`bearer`?`Bearer ${n}`:e.scheme===`basic`?`Basic ${btoa(n)}`:n},v=({parameters:e={},...t}={})=>n=>{let r=[];if(n&&typeof n==`object`)for(let i in n){let a=n[i];if(a==null)continue;let o=e[i]||t;if(Array.isArray(a)){let e=ee({allowReserved:o.allowReserved,explode:!0,name:i,style:`form`,value:a,...o.array});e&&r.push(e)}else if(typeof a==`object`){let e=te({allowReserved:o.allowReserved,explode:!0,name:i,style:`deepObject`,value:a,...o.object});e&&r.push(e)}else{let e=g({allowReserved:o.allowReserved,name:i,value:a});e&&r.push(e)}}return r.join(`&`)},oe=e=>{if(!e)return`stream`;let t=e.split(`;`)[0]?.trim();if(t){if(t.startsWith(`application/json`)||t.endsWith(`+json`))return`json`;if(t===`multipart/form-data`)return`formData`;if([`application/`,`audio/`,`image/`,`video/`].some(e=>t.startsWith(e)))return`blob`;if(t.startsWith(`text/`))return`text`}},se=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get(`Cookie`)?.includes(`${t}=`)):!1,ce=async({security:e,...t})=>{for(let n of e){if(se(t,n.name))continue;let e=await ae(n,t.auth);if(!e)continue;let r=n.name??`Authorization`;switch(n.in){case`query`:t.query||={},t.query[r]=e;break;case`cookie`:t.headers.append(`Cookie`,`${r}=${e}`);break;default:t.headers.set(r,e);break}}},y=e=>ie({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==`function`?e.querySerializer:v(e.querySerializer),url:e.url}),b=(e,t)=>{let n={...e,...t};return n.baseUrl?.endsWith(`/`)&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=ue(e.headers,t.headers),n},le=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},ue=(...e)=>{let t=new Headers;for(let n of e){if(!n)continue;let e=n instanceof Headers?le(n):Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,typeof r==`object`?JSON.stringify(r):r)}return t},x=class{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){let t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e==`number`?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){let n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}},de=()=>({error:new x,request:new x,response:new x}),fe=v({allowReserved:!1,array:{explode:!0,style:`form`},object:{explode:!0,style:`deepObject`}}),pe={"Content-Type":`application/json`},me=(e={})=>({...d,headers:pe,parseAs:`auto`,querySerializer:fe,...e}),S=((e={})=>{let t=b(me(),e),n=()=>({...t}),r=e=>(t=b(t,e),n()),i=de(),a=async e=>{let n={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:ue(t.headers,e.headers),serializedBody:void 0};n.security&&await ce({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody===``)&&n.headers.delete(`Content-Type`);let r=n;return{opts:r,url:y(r)}},o=async e=>{let n=e.throwOnError??t.throwOnError,r=e.responseStyle??t.responseStyle,o,s;try{let{opts:t,url:n}=await a(e),r={redirect:`follow`,...t,body:_(t)};o=new Request(n,r);for(let e of i.request.fns)e&&(o=await e(o,t));let c=t.fetch;s=await c(o);for(let e of i.response.fns)e&&(s=await e(s,o,t));let l={request:o,response:s};if(s.ok){let e=(t.parseAs===`auto`?oe(s.headers.get(`Content-Type`)):t.parseAs)??`json`;if(s.status===204||s.headers.get(`Content-Length`)===`0`){let n;switch(e){case`arrayBuffer`:case`blob`:case`text`:n=await s[e]();break;case`formData`:n=new FormData;break;case`stream`:n=s.body;break;default:n={};break}return t.responseStyle===`data`?n:{data:n,...l}}let n;switch(e){case`arrayBuffer`:case`blob`:case`formData`:case`text`:n=await s[e]();break;case`json`:{let e=await s.text();n=e?JSON.parse(e):{};break}case`stream`:return t.responseStyle===`data`?s.body:{data:s.body,...l}}return e===`json`&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),t.responseStyle===`data`?n:{data:n,...l}}let u=await s.text(),d;try{d=JSON.parse(u)}catch{}throw d??u}catch(t){let a=t;for(let t of i.error.fns)t&&(a=await t(a,s,o,e));if(a||={},n)throw a;return r===`data`?void 0:{error:a,request:o,response:s}}},s=e=>t=>o({...t,method:e}),c=e=>async t=>{let{opts:n,url:r}=await a(t);return f({...n,body:n.body,method:e,onRequest:async(e,t)=>{let r=new Request(e,t);for(let e of i.request.fns)e&&(r=await e(r,n));return r},serializedBody:_(n),url:r})};return{buildUrl:e=>y({...t,...e}),connect:s(`CONNECT`),delete:s(`DELETE`),get:s(`GET`),getConfig:n,head:s(`HEAD`),interceptors:i,options:s(`OPTIONS`),patch:s(`PATCH`),post:s(`POST`),put:s(`PUT`),request:o,setConfig:r,sse:{connect:c(`CONNECT`),delete:c(`DELETE`),get:c(`GET`),head:c(`HEAD`),options:c(`OPTIONS`),patch:c(`PATCH`),post:c(`POST`),put:c(`PUT`),trace:c(`TRACE`)},trace:s(`TRACE`)}})(me()),he=e=>(e.client??S).get({url:`/_allauth/{client}/v1/auth/provider/signup`,...e}),ge=e=>(e.client??S).post({url:`/_allauth/{client}/v1/auth/provider/signup`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),_e=e=>(e.client??S).delete({url:`/_allauth/{client}/v1/auth/session`,...e}),C=e=>(e.client??S).get({url:`/_allauth/{client}/v1/auth/session`,...e}),w=()=>o()?`app`:`browser`;function ve(e){return!e.ok&&e.status===409}function T(e,t){let n=e;if(n&&Array.isArray(n.errors))return{ok:!1,status:t,errors:n.errors};let r=n?.data;return r&&Array.isArray(r.flows)?{ok:!1,status:t,errors:[],flows:r.flows}:{ok:!1,status:t,errors:[]}}async function E(){let{data:e,error:t,response:n}=await C({path:{client:w()}});return e?{ok:!0,data:e.data}:T(t,n?.status)}async function ye(){let{data:e,error:t,response:n}=await _e({path:{client:w()}});return e?{ok:!0,data:e}:n?.status===401?{ok:!0,data:{}}:T(t,n?.status)}async function be(){let{data:e,error:t,response:n}=await he({path:{client:w()}});return e?{ok:!0,data:e.data}:T(t,n?.status)}async function xe({email:e,username:t}){let{data:n,error:r,response:i}=await ge({path:{client:w()},body:{email:e,username:t}});return n?{ok:!0,data:n.data}:T(r,i?.status)}var D;function Se(){return o()?(D===void 0&&(D=window.vellum?.auth?.getSessionToken?.()??null),D):null}function Ce(e){D=e}var O=`__Secure-csrftoken`;function k(){return document.cookie.split(`; `).findLast(e=>e.startsWith(`${O}=`))?.split(`=`).slice(1).join(`=`)}function we(){document.cookie.split(`; `).filter(e=>e.startsWith(`${O}=`)).length>1&&(document.cookie=`${O}=; path=/; max-age=0; secure`)}var A=null;async function j(){o()||i()||(we(),!k()&&(A||=(async()=>{for(let e=0;e<2;e++)try{if(await C({path:{client:`browser`}}),k())return}catch{console.warn(`CSRF cookie bootstrap failed (attempt ${e+1}/2)`),e===0&&await new Promise(e=>setTimeout(e,500))}})().finally(()=>{A=null}),await A))}var Te=`/_allauth/browser/v1/auth/provider/redirect`,M=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gclid`,`gbraid`,`wbraid`,`msclkid`,`fbclid`,`ttclid`,`li_fat_id`,`twclid`],Ee=512;function De(e){let t=new URLSearchParams(e),n={};for(let e of M){let r=t.get(e);r&&(n[e]=r.slice(0,Ee))}return n}function Oe(e,t,n,r={}){let i={provider:e,callback_url:new URL(t,n).href,process:`login`};r.intent&&(i.intent=r.intent),r.loginHint&&(i.login_hint=r.loginHint);for(let e of M){let t=r.attribution?.[e];t&&(i[e]=t)}return i}function ke(e){if(!e)throw Error(`Unable to start provider redirect: CSRF token is missing. The session may not be initialized. Please refresh the page and try again.`)}async function Ae(e,t,n={}){await j();let r=k();ke(r);let i=window.location.origin,a=document.createElement(`form`);a.method=`POST`,a.action=`${i}${Te}`;let o=Oe(e,t,i,{...n,attribution:n.attribution??De(window.location.search)});o.csrfmiddlewaretoken=r;for(let[e,t]of Object.entries(o)){let n=document.createElement(`input`);n.type=`hidden`,n.name=e,n.value=t,a.appendChild(n)}document.body.appendChild(a),a.submit()}function je(e,t){return e?{kind:`authenticated`}:t.some(e=>e.id===`provider_signup`&&e.is_pending)?{kind:`provider_signup`}:{kind:`error`,message:`Unexpected authentication state.`}}var Me=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//;function N(e,t){if(!e)return t;if(Me.test(e)){try{let t=new URL(e);if(t.protocol===`https:`&&l(t.hostname))return e}catch{}return t}return e.startsWith(`//`)||e.includes(`\\`)||!e.startsWith(`/`)?t:e}var P=`vellum.pro-checkout-intent`,F=1800*1e3,I=null;function L(e){let t={...e,savedAt:Date.now()};I=t;try{sessionStorage.setItem(P,JSON.stringify(t))}catch{}}function R(){let e=null;if(typeof sessionStorage<`u`)try{e=sessionStorage.getItem(P)}catch{return B()}if(!e)return B();let t;try{t=JSON.parse(e)}catch{return z(),null}return!Pe(t)||Date.now()-t.savedAt>F?(z(),null):t}function Ne(){let e=R();return e?.resumeAfterOnboarding===!0?null:e}function z(){I=null;try{sessionStorage.removeItem(P)}catch{}}function B(){return I?Date.now()-I.savedAt>F?(I=null,null):I:null}function Pe(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.savedAt==`number`?t.kind===`package`?typeof t.packageKey==`string`:t.kind===`custom`:!1}var V=`machine_tier`,H=`storage_tier`,U=`credit_tier`,Fe=new Set([`medium`,`large`,`xl`]),Ie=new Set([`xs`,`s`,`m`,`l`]),Le=new Set([`credits_10`,`credits_25`,`credits_50`,`credits_100`,`credits_200`]);function W(e){let t=e.get(H);if(t===null||!Be(t))return null;let n=e.get(V);if(n!==null&&!ze(n))return null;let r=e.get(U);return r!==null&&!Ve(r)?null:{machineTier:n,storageTier:t,creditTier:r}}function Re(e){let t=new URLSearchParams;return e.machineTier!==null&&t.set(V,e.machineTier),t.set(H,e.storageTier),e.creditTier!==null&&t.set(U,e.creditTier),t}function ze(e){return Fe.has(e)}function Be(e){return Ie.has(e)}function Ve(e){return Le.has(e)}function He(e){let t;try{t=new URL(e,`http://placeholder.invalid`)}catch{return null}if(t.pathname!==u.checkout)return null;let n=t.searchParams.get(`package`)||null;if(n)return{kind:`package`,packageKey:n};let r=W(t.searchParams);return r?{kind:`custom`,selection:r}:null}function G(e){let{intent:t,returnTo:n}=e,r=He(n);return r||z(),t===`signup`?(r&&L(r.kind===`package`?{kind:`package`,packageKey:r.packageKey,resumeAfterOnboarding:!0}:{kind:`custom`,machineTier:r.selection.machineTier,storageTier:r.selection.storageTier,creditTier:r.selection.creditTier,resumeAfterOnboarding:!0}),u.onboarding.privacy):n}var Ue=`https://www.vellum.ai`,We=`vellum:loopback:state`,Ge=`vellum:loopback:returnTo`;function Ke(){let e=window.__VELLUM_CONFIG__;return e?.webUrl?{webUrl:e.webUrl}:{webUrl:Ue}}function qe(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}function Je(){return Ke().webUrl===window.location.origin}async function Ye(e,t){let{webUrl:n}=Ke(),r=qe(),i=window.location.port||`3000`;sessionStorage.setItem(We,r),e&&sessionStorage.setItem(Ge,e);let a=`/accounts/cli/callback?port=${i}&state=${r}`,o=`${n}/account/${t?.intent===`signup`?`signup`:`login`}?returnTo=${encodeURIComponent(a)}`;window.location.href=o}async function Xe(e){o()&&await window.vellum?.menu.setPlatformSession(e)}var Ze=e(r(),1),Qe=s(`NativeAuth`),K=u.assistant,q=!1;function $e(){return q}function et(){return`${window.location.protocol}//${window.location.host}`}function J(){return typeof window<`u`&&c.isNativePlatform()}var tt=()=>()=>{};function nt(){return(0,Ze.useSyncExternalStore)(tt,J,()=>!1)}async function rt(e){lt(e?.intent,e?.returnTo);let t=e?.baseURL??et(),n=N(e?.returnTo??null,K),{sessionToken:r}=await Qe.startAuth({baseURL:t,...e?.loginHint?{loginHint:e.loginHint}:{},...e?.intent?{intent:e.intent}:{},postAuthDestination:n});await at(r,n)}async function it(){if(!J()||c.getPlatform()!==`android`)return;let e=await Qe.consumeRestoredAuth();if(e.error){let t=Error(e.error);throw t.code=e.errorCode,t}if(!e.sessionToken)return;let t=N(e.postAuthDestination??null,K);await at(e.sessionToken,t)}async function at(e,t){ot(e),J()&&await Y(),$()&&await ft(e),window.location.href=t}async function Y(){for(let e=0;e<6;e++){try{let e=await E();if(e.ok&&e.data.user)return}catch{}await new Promise(t=>setTimeout(t,50*(e+1)))}}function ot(e){let t=`path=/; domain=.vellum.ai; secure; samesite=lax; max-age=1209600`;document.cookie=`sessionid=${e}; ${t}`,document.cookie=`__Secure-sessionid=${e}; ${t}`}function st(){if(typeof document>`u`)return null;let e=document.cookie.split(`; `);for(let t of[`__Secure-sessionid`,`sessionid`]){let n=e.find(e=>e.startsWith(`${t}=`));if(n){let e=n.slice(t.length+1);if(e)return e}}return null}function ct(e,t){let n=e===`signup`,r=G({intent:n?`signup`:`login`,returnTo:t??``});return n?r:t??null}function lt(e,t){e!==`signup`&&G({intent:`login`,returnTo:t??``})}async function ut(e,t,n={}){if(J()){try{await rt({returnTo:ct(n.intent,n.returnTo),loginHint:n.loginHint,intent:n.intent})}catch(e){if(e?.code===`USER_CANCELLED`)return;throw e}return}if(o()&&window.vellum?.auth?.startOAuth){q=!0;try{let e=await window.vellum.auth.startOAuth({loginHint:n.loginHint,intent:n.intent});if(e?.sessionToken){Ce(e.sessionToken),await Xe(!0);let t=N(ct(n.intent,n.returnTo),K);window.location.href=t}}finally{q=!1}return}if(a()&&!Je()){await Ye(n.returnTo??void 0,{intent:n.intent});return}await Ae(e,t,n)}var X=s(`NativeBiometric`),Z=`vellum.ai`;async function dt(){if(!J())return!1;try{let{available:e}=await X.isAvailable();return e}catch{return!1}}async function ft(e){if(!await dt())return!1;try{return await X.storeToken({token:e,server:Z}),!0}catch(e){return console.error(`[native-biometric] failed to store token:`,e),!1}}var Q=null;async function pt(){return J()?Q||(Q=(async()=>{try{let{token:e}=await X.retrieveToken({server:Z,reason:`Sign in to Vellum`});return e}catch{return null}finally{Q=null}})(),Q):null}async function mt(){if(J())try{await X.deleteToken({server:Z})}catch{}}function $(){return n(`biometricEnabled`,!0)}function ht(e){t(`biometricEnabled`,e)}async function gt(){if(!J())return`Biometrics`;try{let{biometryType:e}=await X.isAvailable();switch(e){case`faceId`:return`Face ID`;case`touchId`:return`Touch ID`;case`opticId`:return`Optic ID`;default:return`Biometrics`}}catch{return`Biometrics`}}export{be as A,Ne as C,j as D,je as E,S as F,ve as M,ye as N,k as O,xe as P,R as S,N as T,Xe as _,pt as a,W as b,st as c,$e as d,it as f,Y as g,nt as h,$ as i,E as j,Se as k,ot as l,rt as m,gt as n,ht as o,ut as p,dt as r,ft as s,mt as t,J as u,G as v,L as w,z as x,Re as y};
6
+ `);try{s=JSON.parse(e),l=!0}catch{s=e}}l&&(i&&await i(s),r&&(s=await r(s))),n?.({data:s,event:o,id:d,retry:c}),a.length&&(yield s)}}}finally{m.removeEventListener(`abort`,h),f.releaseLock()}break}catch(e){if(t?.(e),o!==void 0&&p>=o)break;await f(Math.min(c*2**(p-1),s??3e4))}}}()}}var p=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},m=e=>{switch(e){case`form`:return`,`;case`pipeDelimited`:return`|`;case`spaceDelimited`:return`%20`;default:return`,`}},h=e=>{switch(e){case`label`:return`.`;case`matrix`:return`;`;case`simple`:return`,`;default:return`&`}},ee=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let t=(e?i:i.map(e=>encodeURIComponent(e))).join(m(r));switch(r){case`label`:return`.${t}`;case`matrix`:return`;${n}=${t}`;case`simple`:return t;default:return`${n}=${t}`}}let a=p(r),o=i.map(t=>r===`label`||r===`simple`?e?t:encodeURIComponent(t):g({allowReserved:e,name:n,value:t})).join(a);return r===`label`||r===`matrix`?a+o:o},g=({allowReserved:e,name:t,value:n})=>{if(n==null)return``;if(typeof n==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},te=({allowReserved:e,explode:t,name:n,style:r,value:i,valueOnly:a})=>{if(i instanceof Date)return a?i.toISOString():`${n}=${i.toISOString()}`;if(r!==`deepObject`&&!t){let t=[];Object.entries(i).forEach(([n,r])=>{t=[...t,n,e?r:encodeURIComponent(r)]});let a=t.join(`,`);switch(r){case`form`:return`${n}=${a}`;case`label`:return`.${a}`;case`matrix`:return`;${n}=${a}`;default:return a}}let o=h(r),s=Object.entries(i).map(([t,i])=>g({allowReserved:e,name:r===`deepObject`?`${n}[${t}]`:t,value:i})).join(o);return r===`label`||r===`matrix`?o+s:s},ne=/\{[^{}]+\}/g,re=({path:e,url:t})=>{let n=t,r=t.match(ne);if(r)for(let t of r){let r=!1,i=t.substring(1,t.length-1),a=`simple`;i.endsWith(`*`)&&(r=!0,i=i.substring(0,i.length-1)),i.startsWith(`.`)?(i=i.substring(1),a=`label`):i.startsWith(`;`)&&(i=i.substring(1),a=`matrix`);let o=e[i];if(o==null)continue;if(Array.isArray(o)){n=n.replace(t,ee({explode:r,name:i,style:a,value:o}));continue}if(typeof o==`object`){n=n.replace(t,te({explode:r,name:i,style:a,value:o,valueOnly:!0}));continue}if(a===`matrix`){n=n.replace(t,`;${g({name:i,value:o})}`);continue}let s=encodeURIComponent(a===`label`?`.${o}`:o);n=n.replace(t,s)}return n},ie=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let a=i.startsWith(`/`)?i:`/${i}`,o=(e??``)+a;t&&(o=re({path:t,url:o}));let s=n?r(n):``;return s.startsWith(`?`)&&(s=s.substring(1)),s&&(o+=`?${s}`),o};function _(e){let t=e.body!==void 0;if(t&&e.bodySerializer)return`serializedBody`in e?e.serializedBody!==void 0&&e.serializedBody!==``?e.serializedBody:null:e.body===``?null:e.body;if(t)return e.body}var ae=async(e,t)=>{let n=typeof t==`function`?await t(e):t;if(n)return e.scheme===`bearer`?`Bearer ${n}`:e.scheme===`basic`?`Basic ${btoa(n)}`:n},v=({parameters:e={},...t}={})=>n=>{let r=[];if(n&&typeof n==`object`)for(let i in n){let a=n[i];if(a==null)continue;let o=e[i]||t;if(Array.isArray(a)){let e=ee({allowReserved:o.allowReserved,explode:!0,name:i,style:`form`,value:a,...o.array});e&&r.push(e)}else if(typeof a==`object`){let e=te({allowReserved:o.allowReserved,explode:!0,name:i,style:`deepObject`,value:a,...o.object});e&&r.push(e)}else{let e=g({allowReserved:o.allowReserved,name:i,value:a});e&&r.push(e)}}return r.join(`&`)},oe=e=>{if(!e)return`stream`;let t=e.split(`;`)[0]?.trim();if(t){if(t.startsWith(`application/json`)||t.endsWith(`+json`))return`json`;if(t===`multipart/form-data`)return`formData`;if([`application/`,`audio/`,`image/`,`video/`].some(e=>t.startsWith(e)))return`blob`;if(t.startsWith(`text/`))return`text`}},se=(e,t)=>t?!!(e.headers.has(t)||e.query?.[t]||e.headers.get(`Cookie`)?.includes(`${t}=`)):!1,ce=async({security:e,...t})=>{for(let n of e){if(se(t,n.name))continue;let e=await ae(n,t.auth);if(!e)continue;let r=n.name??`Authorization`;switch(n.in){case`query`:t.query||={},t.query[r]=e;break;case`cookie`:t.headers.append(`Cookie`,`${r}=${e}`);break;default:t.headers.set(r,e);break}}},y=e=>ie({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer==`function`?e.querySerializer:v(e.querySerializer),url:e.url}),b=(e,t)=>{let n={...e,...t};return n.baseUrl?.endsWith(`/`)&&(n.baseUrl=n.baseUrl.substring(0,n.baseUrl.length-1)),n.headers=ue(e.headers,t.headers),n},le=e=>{let t=[];return e.forEach((e,n)=>{t.push([n,e])}),t},ue=(...e)=>{let t=new Headers;for(let n of e){if(!n)continue;let e=n instanceof Headers?le(n):Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,typeof r==`object`?JSON.stringify(r):r)}return t},x=class{fns=[];clear(){this.fns=[]}eject(e){let t=this.getInterceptorIndex(e);this.fns[t]&&(this.fns[t]=null)}exists(e){let t=this.getInterceptorIndex(e);return!!this.fns[t]}getInterceptorIndex(e){return typeof e==`number`?this.fns[e]?e:-1:this.fns.indexOf(e)}update(e,t){let n=this.getInterceptorIndex(e);return this.fns[n]?(this.fns[n]=t,e):!1}use(e){return this.fns.push(e),this.fns.length-1}},de=()=>({error:new x,request:new x,response:new x}),fe=v({allowReserved:!1,array:{explode:!0,style:`form`},object:{explode:!0,style:`deepObject`}}),pe={"Content-Type":`application/json`},me=(e={})=>({...d,headers:pe,parseAs:`auto`,querySerializer:fe,...e}),S=((e={})=>{let t=b(me(),e),n=()=>({...t}),r=e=>(t=b(t,e),n()),i=de(),a=async e=>{let n={...t,...e,fetch:e.fetch??t.fetch??globalThis.fetch,headers:ue(t.headers,e.headers),serializedBody:void 0};n.security&&await ce({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody===``)&&n.headers.delete(`Content-Type`);let r=n;return{opts:r,url:y(r)}},o=async e=>{let n=e.throwOnError??t.throwOnError,r=e.responseStyle??t.responseStyle,o,s;try{let{opts:t,url:n}=await a(e),r={redirect:`follow`,...t,body:_(t)};o=new Request(n,r);for(let e of i.request.fns)e&&(o=await e(o,t));let c=t.fetch;s=await c(o);for(let e of i.response.fns)e&&(s=await e(s,o,t));let l={request:o,response:s};if(s.ok){let e=(t.parseAs===`auto`?oe(s.headers.get(`Content-Type`)):t.parseAs)??`json`;if(s.status===204||s.headers.get(`Content-Length`)===`0`){let n;switch(e){case`arrayBuffer`:case`blob`:case`text`:n=await s[e]();break;case`formData`:n=new FormData;break;case`stream`:n=s.body;break;default:n={};break}return t.responseStyle===`data`?n:{data:n,...l}}let n;switch(e){case`arrayBuffer`:case`blob`:case`formData`:case`text`:n=await s[e]();break;case`json`:{let e=await s.text();n=e?JSON.parse(e):{};break}case`stream`:return t.responseStyle===`data`?s.body:{data:s.body,...l}}return e===`json`&&(t.responseValidator&&await t.responseValidator(n),t.responseTransformer&&(n=await t.responseTransformer(n))),t.responseStyle===`data`?n:{data:n,...l}}let u=await s.text(),d;try{d=JSON.parse(u)}catch{}throw d??u}catch(t){let a=t;for(let t of i.error.fns)t&&(a=await t(a,s,o,e));if(a||={},n)throw a;return r===`data`?void 0:{error:a,request:o,response:s}}},s=e=>t=>o({...t,method:e}),c=e=>async t=>{let{opts:n,url:r}=await a(t);return f({...n,body:n.body,method:e,onRequest:async(e,t)=>{let r=new Request(e,t);for(let e of i.request.fns)e&&(r=await e(r,n));return r},serializedBody:_(n),url:r})};return{buildUrl:e=>y({...t,...e}),connect:s(`CONNECT`),delete:s(`DELETE`),get:s(`GET`),getConfig:n,head:s(`HEAD`),interceptors:i,options:s(`OPTIONS`),patch:s(`PATCH`),post:s(`POST`),put:s(`PUT`),request:o,setConfig:r,sse:{connect:c(`CONNECT`),delete:c(`DELETE`),get:c(`GET`),head:c(`HEAD`),options:c(`OPTIONS`),patch:c(`PATCH`),post:c(`POST`),put:c(`PUT`),trace:c(`TRACE`)},trace:s(`TRACE`)}})(me()),he=e=>(e.client??S).get({url:`/_allauth/{client}/v1/auth/provider/signup`,...e}),ge=e=>(e.client??S).post({url:`/_allauth/{client}/v1/auth/provider/signup`,...e,headers:{"Content-Type":`application/json`,...e.headers}}),_e=e=>(e.client??S).delete({url:`/_allauth/{client}/v1/auth/session`,...e}),C=e=>(e.client??S).get({url:`/_allauth/{client}/v1/auth/session`,...e}),w=()=>o()?`app`:`browser`;function ve(e){return!e.ok&&e.status===409}function T(e,t){let n=e;if(n&&Array.isArray(n.errors))return{ok:!1,status:t,errors:n.errors};let r=n?.data;return r&&Array.isArray(r.flows)?{ok:!1,status:t,errors:[],flows:r.flows}:{ok:!1,status:t,errors:[]}}async function E(){let{data:e,error:t,response:n}=await C({path:{client:w()}});return e?{ok:!0,data:e.data}:T(t,n?.status)}async function ye(){let{data:e,error:t,response:n}=await _e({path:{client:w()}});return e?{ok:!0,data:e}:n?.status===401?{ok:!0,data:{}}:T(t,n?.status)}async function be(){let{data:e,error:t,response:n}=await he({path:{client:w()}});return e?{ok:!0,data:e.data}:T(t,n?.status)}async function xe({email:e,username:t}){let{data:n,error:r,response:i}=await ge({path:{client:w()},body:{email:e,username:t}});return n?{ok:!0,data:n.data}:T(r,i?.status)}var D;function Se(){return o()?(D===void 0&&(D=window.vellum?.auth?.getSessionToken?.()??null),D):null}function Ce(e){D=e}var O=`__Secure-csrftoken`;function k(){return document.cookie.split(`; `).findLast(e=>e.startsWith(`${O}=`))?.split(`=`).slice(1).join(`=`)}function we(){document.cookie.split(`; `).filter(e=>e.startsWith(`${O}=`)).length>1&&(document.cookie=`${O}=; path=/; max-age=0; secure`)}var A=null;async function j(){o()||i()||(we(),!k()&&(A||=(async()=>{for(let e=0;e<2;e++)try{if(await C({path:{client:`browser`}}),k())return}catch{console.warn(`CSRF cookie bootstrap failed (attempt ${e+1}/2)`),e===0&&await new Promise(e=>setTimeout(e,500))}})().finally(()=>{A=null}),await A))}var Te=`/_allauth/browser/v1/auth/provider/redirect`,M=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gclid`,`gbraid`,`wbraid`,`msclkid`,`fbclid`,`ttclid`,`li_fat_id`,`twclid`],Ee=512;function N(e){let t=new URLSearchParams(e),n={};for(let e of M){let r=t.get(e);r&&(n[e]=r.slice(0,Ee))}return n}function De(e,t){let n=e.indexOf(`?`),r=new URLSearchParams(n===-1?``:e.slice(n+1)),i=new URLSearchParams;for(let[e,n]of Object.entries(N(t)))r.has(e)||i.append(e,n);let a=i.toString();return a===``?e:`${e}${n===-1?`?`:`&`}${a}`}function Oe(e,t,n,r={}){let i={provider:e,callback_url:new URL(t,n).href,process:`login`};r.intent&&(i.intent=r.intent),r.loginHint&&(i.login_hint=r.loginHint);for(let e of M){let t=r.attribution?.[e];t&&(i[e]=t)}return i}function ke(e){if(!e)throw Error(`Unable to start provider redirect: CSRF token is missing. The session may not be initialized. Please refresh the page and try again.`)}async function Ae(e,t,n={}){await j();let r=k();ke(r);let i=window.location.origin,a=document.createElement(`form`);a.method=`POST`,a.action=`${i}${Te}`;let o=Oe(e,t,i,{...n,attribution:n.attribution??N(window.location.search)});o.csrfmiddlewaretoken=r;for(let[e,t]of Object.entries(o)){let n=document.createElement(`input`);n.type=`hidden`,n.name=e,n.value=t,a.appendChild(n)}document.body.appendChild(a),a.submit()}function je(e,t){return e?{kind:`authenticated`}:t.some(e=>e.id===`provider_signup`&&e.is_pending)?{kind:`provider_signup`}:{kind:`error`,message:`Unexpected authentication state.`}}var Me=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//;function P(e,t){if(!e)return t;if(Me.test(e)){try{let t=new URL(e);if(t.protocol===`https:`&&l(t.hostname))return e}catch{}return t}return e.startsWith(`//`)||e.includes(`\\`)||!e.startsWith(`/`)?t:e}var F=`vellum.pro-checkout-intent`,I=1800*1e3,L=null;function R(e){let t={...e,savedAt:Date.now()};L=t;try{sessionStorage.setItem(F,JSON.stringify(t))}catch{}}function z(){let e=null;if(typeof sessionStorage<`u`)try{e=sessionStorage.getItem(F)}catch{return V()}if(!e)return V();let t;try{t=JSON.parse(e)}catch{return B(),null}return!Pe(t)||Date.now()-t.savedAt>I?(B(),null):t}function Ne(){let e=z();return e?.resumeAfterOnboarding===!0?null:e}function B(){L=null;try{sessionStorage.removeItem(F)}catch{}}function V(){return L?Date.now()-L.savedAt>I?(L=null,null):L:null}function Pe(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.savedAt==`number`?t.kind===`package`?typeof t.packageKey==`string`:t.kind===`custom`:!1}var H=`machine_tier`,U=`storage_tier`,W=`credit_tier`,Fe=new Set([`medium`,`large`,`xl`]),Ie=new Set([`xs`,`s`,`m`,`l`]),Le=new Set([`credits_10`,`credits_25`,`credits_50`,`credits_100`,`credits_200`]);function G(e){let t=e.get(U);if(t===null||!Be(t))return null;let n=e.get(H);if(n!==null&&!ze(n))return null;let r=e.get(W);return r!==null&&!Ve(r)?null:{machineTier:n,storageTier:t,creditTier:r}}function Re(e){let t=new URLSearchParams;return e.machineTier!==null&&t.set(H,e.machineTier),t.set(U,e.storageTier),e.creditTier!==null&&t.set(W,e.creditTier),t}function ze(e){return Fe.has(e)}function Be(e){return Ie.has(e)}function Ve(e){return Le.has(e)}function He(e){let t;try{t=new URL(e,`http://placeholder.invalid`)}catch{return null}if(t.pathname!==u.checkout)return null;let n=t.searchParams.get(`package`)||null;if(n)return{kind:`package`,packageKey:n};let r=G(t.searchParams);return r?{kind:`custom`,selection:r}:null}function K(e){let{intent:t,returnTo:n}=e,r=He(n);return r||B(),t===`signup`?(r&&R(r.kind===`package`?{kind:`package`,packageKey:r.packageKey,resumeAfterOnboarding:!0}:{kind:`custom`,machineTier:r.selection.machineTier,storageTier:r.selection.storageTier,creditTier:r.selection.creditTier,resumeAfterOnboarding:!0}),u.onboarding.privacy):n}var Ue=`https://www.vellum.ai`,We=`vellum:loopback:state`,Ge=`vellum:loopback:returnTo`;function Ke(){let e=window.__VELLUM_CONFIG__;return e?.webUrl?{webUrl:e.webUrl}:{webUrl:Ue}}function qe(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}function Je(){return Ke().webUrl===window.location.origin}async function Ye(e,t){let{webUrl:n}=Ke(),r=qe(),i=window.location.port||`3000`;sessionStorage.setItem(We,r),e&&sessionStorage.setItem(Ge,e);let a=`/accounts/cli/callback?port=${i}&state=${r}`,o=`${n}/account/${t?.intent===`signup`?`signup`:`login`}?returnTo=${encodeURIComponent(a)}`;window.location.href=o}async function Xe(e){o()&&await window.vellum?.menu.setPlatformSession(e)}var Ze=e(r(),1),Qe=s(`NativeAuth`),q=u.assistant,J=!1;function $e(){return J}function et(){return`${window.location.protocol}//${window.location.host}`}function Y(){return typeof window<`u`&&c.isNativePlatform()}var tt=()=>()=>{};function nt(){return(0,Ze.useSyncExternalStore)(tt,Y,()=>!1)}async function rt(e){ut(e?.intent,e?.returnTo);let t=e?.baseURL??et(),n=P(e?.returnTo??null,q),{sessionToken:r}=await Qe.startAuth({baseURL:t,...e?.loginHint?{loginHint:e.loginHint}:{},...e?.intent?{intent:e.intent}:{},postAuthDestination:n});await at(r,n)}async function it(){if(!Y()||c.getPlatform()!==`android`)return;let e=await Qe.consumeRestoredAuth();if(e.error){let t=Error(e.error);throw t.code=e.errorCode,t}if(!e.sessionToken)return;let t=P(e.postAuthDestination??null,q);await at(e.sessionToken,t)}async function at(e,t){st(e),Y()&&await ot(),$()&&await pt(e),window.location.href=t}async function ot(){for(let e=0;e<6;e++){try{let e=await E();if(e.ok&&e.data.user)return}catch{}await new Promise(t=>setTimeout(t,50*(e+1)))}}function st(e){let t=`path=/; domain=.vellum.ai; secure; samesite=lax; max-age=1209600`;document.cookie=`sessionid=${e}; ${t}`,document.cookie=`__Secure-sessionid=${e}; ${t}`}function ct(){if(typeof document>`u`)return null;let e=document.cookie.split(`; `);for(let t of[`__Secure-sessionid`,`sessionid`]){let n=e.find(e=>e.startsWith(`${t}=`));if(n){let e=n.slice(t.length+1);if(e)return e}}return null}function lt(e,t){let n=e===`signup`,r=K({intent:n?`signup`:`login`,returnTo:t??``});return n?r:t??null}function ut(e,t){e!==`signup`&&K({intent:`login`,returnTo:t??``})}async function dt(e,t,n={}){if(Y()){try{await rt({returnTo:lt(n.intent,n.returnTo),loginHint:n.loginHint,intent:n.intent})}catch(e){if(e?.code===`USER_CANCELLED`)return;throw e}return}if(o()&&window.vellum?.auth?.startOAuth){J=!0;try{let e=await window.vellum.auth.startOAuth({loginHint:n.loginHint,intent:n.intent});if(e?.sessionToken){Ce(e.sessionToken),await Xe(!0);let t=P(lt(n.intent,n.returnTo),q);window.location.href=t}}finally{J=!1}return}if(a()&&!Je()){await Ye(n.returnTo??void 0,{intent:n.intent});return}await Ae(e,t,n)}var X=s(`NativeBiometric`),Z=`vellum.ai`;async function ft(){if(!Y())return!1;try{let{available:e}=await X.isAvailable();return e}catch{return!1}}async function pt(e){if(!await ft())return!1;try{return await X.storeToken({token:e,server:Z}),!0}catch(e){return console.error(`[native-biometric] failed to store token:`,e),!1}}var Q=null;async function mt(){return Y()?Q||(Q=(async()=>{try{let{token:e}=await X.retrieveToken({server:Z,reason:`Sign in to Vellum`});return e}catch{return null}finally{Q=null}})(),Q):null}async function ht(){if(Y())try{await X.deleteToken({server:Z})}catch{}}function $(){return n(`biometricEnabled`,!0)}function gt(e){t(`biometricEnabled`,e)}async function _t(){if(!Y())return`Biometrics`;try{let{biometryType:e}=await X.isAvailable();switch(e){case`faceId`:return`Face ID`;case`touchId`:return`Touch ID`;case`opticId`:return`Optic ID`;default:return`Biometrics`}}catch{return`Biometrics`}}export{Se as A,Ne as C,De as D,je as E,xe as F,S as I,E as M,ve as N,j as O,ye as P,z as S,P as T,Xe as _,mt as a,G as b,ct as c,$e as d,it as f,ot as g,nt as h,$ as i,be as j,k,st as l,rt as m,_t as n,gt as o,dt as p,ft as r,pt as s,ht as t,Y as u,K as v,R as w,B as x,Re as y};
@@ -1 +1 @@
1
- import{T as e,v as t}from"./native-biometric-CTR2Zi2w.js";import{d as n}from"./routes-GmNvdtLW.js";function r({isLocalHatch:e}){return e?n.onboarding.hatching:n.onboarding.research}function i(e){return e.tosAccepted&&e.privacyConsent}function a(e){return i(e)&&e.analyticsConsentCurrent&&e.diagnosticsConsentCurrent}var o=`${n.assistant}/onboarding`,s=new Set([n.onboarding.hosting,n.onboarding.apiKey]),c=new Set([n.welcome,n.selectAssistant]);function l(e){return e.startsWith(`${o}/`)||e===o}function u(e){return e?n.welcome:n.onboarding.privacy}var d=new Set([`${n.settings.root}/billing`,n.settings.usage]);function f(e){let t=e.indexOf(`?`);if(t<0)return!1;let n=e.slice(0,t).split(`#`)[0]??``;return d.has(n)?new URLSearchParams(e.slice(t+1)).has(`session_id`):!1}var p=`post_checkout`;function m(){return`${r({isLocalHatch:!1})}?hosting=vellum-cloud&${p}=1`}var h=new Set([n.onboarding.hatching,n.onboarding.research]);function g(t){let n=e(t,``);if(!n.startsWith(`/`))return null;let r=n.indexOf(`?`);return r<0||!h.has(n.slice(0,r))||new URLSearchParams(n.slice(r+1)).get(`post_checkout`)!==`1`?null:n}function _(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`))try{return new URL(e,`http://placeholder.invalid`).pathname}catch{return e}return e}function v(e,t){return t===n.welcome?e.hasAssistants?n.selectAssistant:n.onboarding.hosting:t===n.selectAssistant?`${t}?fromLogin=1`:t}function y(e,t){switch(t.kind){case`route-guard`:return x(e,t.pathname);case`onboarding-intercept`:return P(e,t.intendedDestination);case`hatch-gate`:return F(e);case`post-auth`:return R(t.authIntent,t.returnTo,t.fallback);case`post-retire`:return z(e)}}var b=[S,C,w,E,D,O,A,M,N];function x(e,t){let n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;for(let n of b){let i=n(e,r,t);if(i)return i}return{action:`allow`}}function S(e){return e.sessionSettled?null:{action:`wait`}}function C(e,t,n){if(e.hasPlatformHostedAssistant||!f(n)||!e.isAuthenticated)return null;if(!e.isLocalClient&&!e.assistantsHydrated)return{action:`wait`};if(e.isLocalClient){if(e.platformSession===`unknown`)return{action:`wait`,waitFor:`platform-session`};if(e.platformSession!==`present`)return null}return{action:`redirect`,to:m()}}function w(e,t,n){return!e.isGatewayAuth||g(n)?null:{action:`allow`}}function T(e,t){let r=e.remoteGatewayPublicPathPrefix;return!e.isRemoteGateway||!r?t:t===r?n.assistant:t.startsWith(`${r}/`)?t.slice(r.length):t}function E(e,t,r){if(!e.isRemoteGateway||e.isAuthenticated)return null;let i=T(e,r);return{action:`redirect`,to:`${n.remotePair}?returnTo=${encodeURIComponent(i)}`}}function D(e,t,r){return e.isAuthenticated?null:e.isLocalClient&&(l(t)||c.has(t))?t===n.selectAssistant&&!e.hasAssistants?{action:`redirect`,to:n.onboarding.hosting}:{action:`allow`}:e.isLocalClient&&!e.hasAssistants?{action:`redirect`,to:n.welcome}:e.isLocalClient?{action:`redirect`,to:n.selectAssistant}:{action:`redirect`,to:`${n.account.login}?returnTo=${encodeURIComponent(r)}`}}function O(e,t){return c.has(t)?e.isLocalClient?t===n.selectAssistant&&!e.hasAssistants?{action:`redirect`,to:n.onboarding.hosting}:{action:`allow`}:{action:`redirect`,to:n.assistant}:s.has(t)&&!e.isLocalClient?{action:`redirect`,to:n.assistant}:null}function k(e,t){let r=u(e.isLocalClient);if(r!==n.onboarding.privacy)return r;let i=g(t);return i?`${r}?returnTo=${encodeURIComponent(i)}`:r}function A(e,t,r){return t===n.reviewTerms?{action:`allow`}:l(t)?j(e,t,r):null}function j(e,t,r){if(!h.has(t))return{action:`allow`};if(t===n.onboarding.research){if(!e.isLocalClient&&!e.consentHydrated)return{action:`wait`};if(e.consentHydrationTimedOut)return{action:`allow`}}if(!i(e))return{action:`redirect`,to:k(e,r)};if(t===n.onboarding.research&&g(r)&&!e.isPlatformDisabled&&e.platformSession===`present`&&!a(e)){let e=encodeURIComponent(r);return{action:`redirect`,to:`${n.reviewTerms}?returnTo=${e}`}}return{action:`allow`}}function M(e,t,r){if(e.hasAssistants||t===n.checkout)return null;if(e.isLocalClient)return e.platformSession===`unknown`?{action:`wait`,waitFor:`platform-session`}:e.platformSession===`present`?{action:`redirect`,to:n.onboarding.hosting}:{action:`redirect`,to:n.welcome};if(!e.assistantsHydrated||!e.consentHydrated)return{action:`wait`};if(!i(e))return{action:`redirect`,to:n.onboarding.privacy};if(!a(e)){let e=encodeURIComponent(r);return{action:`redirect`,to:`${n.reviewTerms}?returnTo=${e}`}}return{action:`redirect`,to:n.onboarding.hatching}}function N(e,t,r){if(e.isPlatformDisabled||e.platformSession!==`present`||a(e))return null;if(!e.consentHydrated&&!e.isLocalClient)return{action:`wait`};let i=encodeURIComponent(r);return{action:`redirect`,to:`${n.reviewTerms}?returnTo=${i}`}}function P(e,t){if(e.isLocalClient&&e.hasAssistants||i(e))return{action:`allow`};let r=_(t);return!r.startsWith(n.assistant)||r.startsWith(`${n.assistant}/onboarding`)||r===n.reviewTerms?{action:`allow`}:{action:`redirect`,to:u(e.isLocalClient)}}function F(e){return e.sessionSettled?!e.isAuthenticated&&!e.isLocalClient?{action:`redirect`,to:n.account.login}:i(e)?!e.isLocalClient&&!a(e)?{action:`redirect`,to:n.reviewTerms}:{action:`allow`}:{action:`redirect`,to:u(e.isLocalClient)}:{action:`wait`}}var I=`/import`;function L(e){return e===I||e.startsWith(`${I}?`)||e.startsWith(`${I}/`)}function R(n,r,i){let a=e(r,i),o=t({intent:n,returnTo:a});return n===`signup`&&L(a)?{action:`redirect`,to:a}:{action:`redirect`,to:o}}function z(e){return e.hasAssistants?{action:`redirect`,to:e.isLocalClient?n.selectAssistant:n.assistant}:e.isLocalClient?e.platformSession===`present`?{action:`redirect`,to:n.onboarding.hosting}:{action:`redirect`,to:n.welcome}:{action:`redirect`,to:n.onboarding.privacy}}export{y as a,v as i,f as n,r as o,g as r,p as t};
1
+ import{T as e,v as t}from"./native-biometric-B96mgKGP.js";import{d as n}from"./routes-GmNvdtLW.js";function r({isLocalHatch:e}){return e?n.onboarding.hatching:n.onboarding.research}function i(e){return e.tosAccepted&&e.privacyConsent}function a(e){return i(e)&&e.analyticsConsentCurrent&&e.diagnosticsConsentCurrent}var o=`${n.assistant}/onboarding`,s=new Set([n.onboarding.hosting,n.onboarding.apiKey]),c=new Set([n.welcome,n.selectAssistant]);function l(e){return e.startsWith(`${o}/`)||e===o}function u(e){return e?n.welcome:n.onboarding.privacy}var d=new Set([`${n.settings.root}/billing`,n.settings.usage]);function f(e){let t=e.indexOf(`?`);if(t<0)return!1;let n=e.slice(0,t).split(`#`)[0]??``;return d.has(n)?new URLSearchParams(e.slice(t+1)).has(`session_id`):!1}var p=`post_checkout`;function m(){return`${r({isLocalHatch:!1})}?hosting=vellum-cloud&${p}=1`}var h=new Set([n.onboarding.hatching,n.onboarding.research]);function g(t){let n=e(t,``);if(!n.startsWith(`/`))return null;let r=n.indexOf(`?`);return r<0||!h.has(n.slice(0,r))||new URLSearchParams(n.slice(r+1)).get(`post_checkout`)!==`1`?null:n}function _(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`))try{return new URL(e,`http://placeholder.invalid`).pathname}catch{return e}return e}function v(e,t){return t===n.welcome?e.hasAssistants?n.selectAssistant:n.onboarding.hosting:t===n.selectAssistant?`${t}?fromLogin=1`:t}function y(e,t){switch(t.kind){case`route-guard`:return x(e,t.pathname);case`onboarding-intercept`:return P(e,t.intendedDestination);case`hatch-gate`:return F(e);case`post-auth`:return R(t.authIntent,t.returnTo,t.fallback);case`post-retire`:return z(e)}}var b=[S,C,w,E,D,O,A,M,N];function x(e,t){let n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;for(let n of b){let i=n(e,r,t);if(i)return i}return{action:`allow`}}function S(e){return e.sessionSettled?null:{action:`wait`}}function C(e,t,n){if(e.hasPlatformHostedAssistant||!f(n)||!e.isAuthenticated)return null;if(!e.isLocalClient&&!e.assistantsHydrated)return{action:`wait`};if(e.isLocalClient){if(e.platformSession===`unknown`)return{action:`wait`,waitFor:`platform-session`};if(e.platformSession!==`present`)return null}return{action:`redirect`,to:m()}}function w(e,t,n){return!e.isGatewayAuth||g(n)?null:{action:`allow`}}function T(e,t){let r=e.remoteGatewayPublicPathPrefix;return!e.isRemoteGateway||!r?t:t===r?n.assistant:t.startsWith(`${r}/`)?t.slice(r.length):t}function E(e,t,r){if(!e.isRemoteGateway||e.isAuthenticated)return null;let i=T(e,r);return{action:`redirect`,to:`${n.remotePair}?returnTo=${encodeURIComponent(i)}`}}function D(e,t,r){return e.isAuthenticated?null:e.isLocalClient&&(l(t)||c.has(t))?t===n.selectAssistant&&!e.hasAssistants?{action:`redirect`,to:n.onboarding.hosting}:{action:`allow`}:e.isLocalClient&&!e.hasAssistants?{action:`redirect`,to:n.welcome}:e.isLocalClient?{action:`redirect`,to:n.selectAssistant}:{action:`redirect`,to:`${n.account.login}?returnTo=${encodeURIComponent(r)}`}}function O(e,t){return c.has(t)?e.isLocalClient?t===n.selectAssistant&&!e.hasAssistants?{action:`redirect`,to:n.onboarding.hosting}:{action:`allow`}:{action:`redirect`,to:n.assistant}:s.has(t)&&!e.isLocalClient?{action:`redirect`,to:n.assistant}:null}function k(e,t){let r=u(e.isLocalClient);if(r!==n.onboarding.privacy)return r;let i=g(t);return i?`${r}?returnTo=${encodeURIComponent(i)}`:r}function A(e,t,r){return t===n.reviewTerms?{action:`allow`}:l(t)?j(e,t,r):null}function j(e,t,r){if(!h.has(t))return{action:`allow`};if(t===n.onboarding.research){if(!e.isLocalClient&&!e.consentHydrated)return{action:`wait`};if(e.consentHydrationTimedOut)return{action:`allow`}}if(!i(e))return{action:`redirect`,to:k(e,r)};if(t===n.onboarding.research&&g(r)&&!e.isPlatformDisabled&&e.platformSession===`present`&&!a(e)){let e=encodeURIComponent(r);return{action:`redirect`,to:`${n.reviewTerms}?returnTo=${e}`}}return{action:`allow`}}function M(e,t,r){if(e.hasAssistants||t===n.checkout)return null;if(e.isLocalClient)return e.platformSession===`unknown`?{action:`wait`,waitFor:`platform-session`}:e.platformSession===`present`?{action:`redirect`,to:n.onboarding.hosting}:{action:`redirect`,to:n.welcome};if(!e.assistantsHydrated||!e.consentHydrated)return{action:`wait`};if(!i(e))return{action:`redirect`,to:n.onboarding.privacy};if(!a(e)){let e=encodeURIComponent(r);return{action:`redirect`,to:`${n.reviewTerms}?returnTo=${e}`}}return{action:`redirect`,to:n.onboarding.hatching}}function N(e,t,r){if(e.isPlatformDisabled||e.platformSession!==`present`||a(e))return null;if(!e.consentHydrated&&!e.isLocalClient)return{action:`wait`};let i=encodeURIComponent(r);return{action:`redirect`,to:`${n.reviewTerms}?returnTo=${i}`}}function P(e,t){if(e.isLocalClient&&e.hasAssistants||i(e))return{action:`allow`};let r=_(t);return!r.startsWith(n.assistant)||r.startsWith(`${n.assistant}/onboarding`)||r===n.reviewTerms?{action:`allow`}:{action:`redirect`,to:u(e.isLocalClient)}}function F(e){return e.sessionSettled?!e.isAuthenticated&&!e.isLocalClient?{action:`redirect`,to:n.account.login}:i(e)?!e.isLocalClient&&!a(e)?{action:`redirect`,to:n.reviewTerms}:{action:`allow`}:{action:`redirect`,to:u(e.isLocalClient)}:{action:`wait`}}var I=`/import`;function L(e){return e===I||e.startsWith(`${I}?`)||e.startsWith(`${I}/`)}function R(n,r,i){let a=e(r,i),o=t({intent:n,returnTo:a});return n===`signup`&&L(a)?{action:`redirect`,to:a}:{action:`redirect`,to:o}}function z(e){return e.hasAssistants?{action:`redirect`,to:e.isLocalClient?n.selectAssistant:n.assistant}:e.isLocalClient?e.platformSession===`present`?{action:`redirect`,to:n.onboarding.hosting}:{action:`redirect`,to:n.welcome}:{action:`redirect`,to:n.onboarding.privacy}}export{y as a,v as i,f as n,r as o,g as r,p as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./useMutation-CXGTrp4W.js";import{t as o}from"./jsx-runtime-D3ZM-ToX.js";import{t as s}from"./createLucideIcon-CAM1RhH8.js";import{t as c}from"./bell-Ct4a9v6Y.js";import{t as l}from"./check-sC49_hjU.js";import{t as u}from"./menu-CKZtG-s_.js";import{t as d}from"./loader-circle-BzJ2kz3F.js";import{t as f}from"./moon-DSdti3GO.js";import{t as p}from"./triangle-alert--e3n47gm.js";import{t as m}from"./notice-DCp7WO3L.js";import{t as h}from"./popover-BFL-uOLh.js";import{t as g}from"./input-C-GkeWCw.js";import{n as _,t as v}from"./panel-item-DGs4s9r-.js";import{n as y}from"./toast-DR7D7Uma.js";import{d as b}from"./routes-GmNvdtLW.js";import{i as x,r as S,t as C}from"./use-platform-gate-D9hR3R0n.js";import{n as w}from"./use-is-mobile-Cx2xnNUx.js";import{Ct as T,St as E,_t as D,bt as O,vt as k,xt as A,yt as j}from"./react-query.gen-BVTEjHsw.js";import{t as M}from"./platform-login-notice-DIS8PWXu.js";import{r as N}from"./format-date-CKGQir4m.js";import{t as P}from"./mutation-error-CXV1BKlB.js";var F=s(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=s(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),L=e(t(),1);function R(e){e.invalidateQueries({queryKey:j()}),e.invalidateQueries({queryKey:T()})}function z(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var B=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],V=o();function H({notificationId:e,currentlySnoozed:t,children:n}){let i=r(),o=a(E()),s=w(),[c,l]=(0,L.useState)(!1),d=()=>R(i),f=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:d,onError:P(`Failed to snooze notification`)})},p=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:d,onError:P(`Failed to clear snooze`)})};return s?(0,V.jsxs)(_.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Snooze until…`})}),(0,V.jsxs)(_.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(v,{label:e,onSelect:()=>{o.isPending||(l(!1),f(t))}},e)),t&&(0,V.jsx)(v,{label:`Clear snooze`,onSelect:()=>{o.isPending||(l(!1),p())}})]})]})]}):(0,V.jsxs)(u.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(u.Trigger,{children:n}),(0,V.jsxs)(u.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(u.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>f(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(u.Separator,{}),(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>p(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(O()),l=a(A()),[u,f]=(0,L.useState)(``),p=()=>R(s),m=()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();c.mutate({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:u.trim()||`User requested pause`,expires_at:e}},{onSuccess:e=>{n(e),p(),t()},onError:P(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),p(),t()},onError:P(`Failed to resume alerts`)})},_=c.isPending||l.isPending;return(0,V.jsxs)(`div`,{children:[!o&&(0,V.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,V.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,N(e.expires_at)]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>h(e.id),disabled:_,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,V.jsx)(g,{type:`text`,value:u,onChange:e=>f(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:_,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function W({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=z(e),a=!e.is_read;return(0,V.jsxs)(`div`,{className:`relative rounded-lg border border-[var(--border-base)] p-4`,style:{background:e.is_resolved?`var(--surface-base)`:`var(--surface-lift)`,opacity:e.is_resolved?.75:1},children:[(0,V.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-negative-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,V.jsx)(p,{className:`h-3 w-3`}),`Alert`]}),i&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--surface-base)] px-2 py-0.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-positive-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,children:[(0,V.jsx)(l,{className:`h-3 w-3`}),`Resolved`]})]}),(0,V.jsx)(`h3`,{className:`text-body-medium-default leading-tight`,style:{color:e.is_resolved?`var(--content-secondary)`:`var(--content-default)`},children:e.title}),e.body&&(0,V.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsxs)(`span`,{children:[`Last seen `,N(e.last_seen_at)]}),e.occurrence_count>1&&(0,V.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id,a),disabled:n,className:`flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-body-small-default transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,style:{background:a?`var(--primary-base)`:`var(--surface-base)`,color:a?`var(--content-inset)`:`var(--content-secondary)`},children:[n?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(l,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,V.jsx)(H,{notificationId:e.id,currentlySnoozed:i,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=x({platformHostedOnly:!0}),t=C(),o=S(),s=r(),l=w(),[u,f]=(0,L.useState)(`open`),[p,g]=(0,L.useState)(!1),[v,T]=(0,L.useState)([]),{data:E,isLoading:O,isError:A,refetch:j}=i({...k({query:{status:u}}),enabled:e===`full`&&t}),N=e===`full`&&o||(t?O:!1);(0,L.useEffect)(()=>{!t&&p&&g(!1)},[t,p]);let P=t?A:!1,z=t?E?.results??[]:[],B=z.filter(e=>!e.is_read&&!e.is_resolved),H=a(D()),[G,K]=(0,L.useState)(new Set),[q,J]=(0,L.useState)(!1),Y=(0,L.useCallback)(()=>R(s),[s]),X=async(e,t)=>{K(t=>new Set(t).add(e));try{await H.mutateAsync({path:{id:e},body:{acknowledged:t}}),Y()}catch(e){y.error(e instanceof Error?e.message:`Failed to update notification`)}finally{K(t=>{let n=new Set(t);return n.delete(e),n})}},Z=async()=>{if(!(B.length===0||q)){J(!0);try{await Promise.allSettled(B.map(e=>H.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{Y(),J(!1)}}},Q=(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,title:`Pause alerts`,children:[(0,V.jsx)(F,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),$=(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>T(t=>[...t,e]),onPauseDeleted:e=>T(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,V.jsx)(n,{replace:!0,to:b.settings.general}):e===`disabled`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,V.jsx)(M,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(l?(0,V.jsxs)(_.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Pause alerts`})}),(0,V.jsx)(_.Body,{children:(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>T(t=>[...t,e]),onPauseDeleted:e=>T(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(h.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(h.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(h.Content,{align:`end`,className:`w-72`,children:$})]}))]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-1`,children:[`open`,`resolved`].map(e=>{let t=u===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>f(e),className:`cursor-pointer rounded px-3 py-1 text-body-small-default capitalize transition-colors`,style:{background:t?`var(--surface-lift)`:`transparent`,color:t?`var(--content-default)`:`var(--content-secondary)`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.08)`:void 0},children:e},e)})}),u===`open`&&B.length>1&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>void Z(),disabled:q,className:`ml-auto flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-transparent px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:[q?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(I,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),N?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,V.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(m,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void j(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):z.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,V.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,u,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:u===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:z.map(e=>(0,V.jsx)(W,{notification:e,onAck:(e,t)=>void X(e,t),isAcking:G.has(e.id)},e.id))})]})}export{G as NotificationsPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./useMutation-CXGTrp4W.js";import{t as o}from"./jsx-runtime-D3ZM-ToX.js";import{t as s}from"./createLucideIcon-CAM1RhH8.js";import{t as c}from"./bell-Ct4a9v6Y.js";import{t as l}from"./check-sC49_hjU.js";import{t as u}from"./menu-CKZtG-s_.js";import{t as d}from"./loader-circle-BzJ2kz3F.js";import{t as f}from"./moon-DSdti3GO.js";import{t as p}from"./triangle-alert--e3n47gm.js";import{t as m}from"./notice-DCp7WO3L.js";import{t as h}from"./popover-BFL-uOLh.js";import{t as g}from"./input-C-GkeWCw.js";import{n as _,t as v}from"./panel-item-DGs4s9r-.js";import{n as y}from"./toast-DR7D7Uma.js";import{d as b}from"./routes-GmNvdtLW.js";import{i as x,r as S,t as C}from"./use-platform-gate-CqEOGZtI.js";import{n as w}from"./use-is-mobile-Cx2xnNUx.js";import{Ct as T,St as E,_t as D,bt as O,vt as k,xt as A,yt as j}from"./react-query.gen-BVTEjHsw.js";import{t as M}from"./platform-login-notice-D-yQLWUo.js";import{r as N}from"./format-date-CKGQir4m.js";import{t as P}from"./mutation-error-CXV1BKlB.js";var F=s(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=s(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),L=e(t(),1);function R(e){e.invalidateQueries({queryKey:j()}),e.invalidateQueries({queryKey:T()})}function z(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var B=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],V=o();function H({notificationId:e,currentlySnoozed:t,children:n}){let i=r(),o=a(E()),s=w(),[c,l]=(0,L.useState)(!1),d=()=>R(i),f=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:d,onError:P(`Failed to snooze notification`)})},p=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:d,onError:P(`Failed to clear snooze`)})};return s?(0,V.jsxs)(_.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Snooze until…`})}),(0,V.jsxs)(_.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(v,{label:e,onSelect:()=>{o.isPending||(l(!1),f(t))}},e)),t&&(0,V.jsx)(v,{label:`Clear snooze`,onSelect:()=>{o.isPending||(l(!1),p())}})]})]})]}):(0,V.jsxs)(u.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(u.Trigger,{children:n}),(0,V.jsxs)(u.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(u.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>f(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(u.Separator,{}),(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>p(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(O()),l=a(A()),[u,f]=(0,L.useState)(``),p=()=>R(s),m=()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();c.mutate({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:u.trim()||`User requested pause`,expires_at:e}},{onSuccess:e=>{n(e),p(),t()},onError:P(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),p(),t()},onError:P(`Failed to resume alerts`)})},_=c.isPending||l.isPending;return(0,V.jsxs)(`div`,{children:[!o&&(0,V.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,V.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,N(e.expires_at)]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>h(e.id),disabled:_,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,V.jsx)(g,{type:`text`,value:u,onChange:e=>f(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:_,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function W({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=z(e),a=!e.is_read;return(0,V.jsxs)(`div`,{className:`relative rounded-lg border border-[var(--border-base)] p-4`,style:{background:e.is_resolved?`var(--surface-base)`:`var(--surface-lift)`,opacity:e.is_resolved?.75:1},children:[(0,V.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-negative-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,V.jsx)(p,{className:`h-3 w-3`}),`Alert`]}),i&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--surface-base)] px-2 py-0.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-positive-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,children:[(0,V.jsx)(l,{className:`h-3 w-3`}),`Resolved`]})]}),(0,V.jsx)(`h3`,{className:`text-body-medium-default leading-tight`,style:{color:e.is_resolved?`var(--content-secondary)`:`var(--content-default)`},children:e.title}),e.body&&(0,V.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsxs)(`span`,{children:[`Last seen `,N(e.last_seen_at)]}),e.occurrence_count>1&&(0,V.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id,a),disabled:n,className:`flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-body-small-default transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,style:{background:a?`var(--primary-base)`:`var(--surface-base)`,color:a?`var(--content-inset)`:`var(--content-secondary)`},children:[n?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(l,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,V.jsx)(H,{notificationId:e.id,currentlySnoozed:i,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=x({platformHostedOnly:!0}),t=C(),o=S(),s=r(),l=w(),[u,f]=(0,L.useState)(`open`),[p,g]=(0,L.useState)(!1),[v,T]=(0,L.useState)([]),{data:E,isLoading:O,isError:A,refetch:j}=i({...k({query:{status:u}}),enabled:e===`full`&&t}),N=e===`full`&&o||(t?O:!1);(0,L.useEffect)(()=>{!t&&p&&g(!1)},[t,p]);let P=t?A:!1,z=t?E?.results??[]:[],B=z.filter(e=>!e.is_read&&!e.is_resolved),H=a(D()),[G,K]=(0,L.useState)(new Set),[q,J]=(0,L.useState)(!1),Y=(0,L.useCallback)(()=>R(s),[s]),X=async(e,t)=>{K(t=>new Set(t).add(e));try{await H.mutateAsync({path:{id:e},body:{acknowledged:t}}),Y()}catch(e){y.error(e instanceof Error?e.message:`Failed to update notification`)}finally{K(t=>{let n=new Set(t);return n.delete(e),n})}},Z=async()=>{if(!(B.length===0||q)){J(!0);try{await Promise.allSettled(B.map(e=>H.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{Y(),J(!1)}}},Q=(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,title:`Pause alerts`,children:[(0,V.jsx)(F,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),$=(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>T(t=>[...t,e]),onPauseDeleted:e=>T(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,V.jsx)(n,{replace:!0,to:b.settings.general}):e===`disabled`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,V.jsx)(M,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(l?(0,V.jsxs)(_.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Pause alerts`})}),(0,V.jsx)(_.Body,{children:(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>T(t=>[...t,e]),onPauseDeleted:e=>T(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(h.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(h.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(h.Content,{align:`end`,className:`w-72`,children:$})]}))]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-1`,children:[`open`,`resolved`].map(e=>{let t=u===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>f(e),className:`cursor-pointer rounded px-3 py-1 text-body-small-default capitalize transition-colors`,style:{background:t?`var(--surface-lift)`:`transparent`,color:t?`var(--content-default)`:`var(--content-secondary)`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.08)`:void 0},children:e},e)})}),u===`open`&&B.length>1&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>void Z(),disabled:q,className:`ml-auto flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-transparent px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:[q?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(I,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),N?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,V.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(m,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void j(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):z.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,V.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,u,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:u===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:z.map(e=>(0,V.jsx)(W,{notification:e,onAck:(e,t)=>void X(e,t),isAcking:G.has(e.id)},e.id))})]})}export{G as NotificationsPage};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-DOTByxnJ.js","assets/chunk-jRWAZmH_.js","assets/preload-helper-Cv2QeVDK.js","assets/api-DDKNgE8n.js","assets/local-mode-9zpgPNoq.js","assets/is-electron-7N7iyz1y.js","assets/create-selectors-B-P03-8K.js","assets/react-BFJW0bSv.js","assets/local-settings-C-dW2vkq.js","assets/api-C8TlQNEU.js","assets/sdk.gen-DVW3wpbx.js","assets/client.gen-DHOmbzD9.js","assets/sdk.gen-BySz4QYj.js","assets/api-errors-SZKDzMLE.js","assets/use-assistant-avatar--4s_vvar.js","assets/utils-C-YNXdkX.js","assets/assistant-identity-store-BczULg2T.js","assets/QueryClientProvider-CMu7CkQU.js","assets/jsx-runtime-D3ZM-ToX.js","assets/useQuery-Bz-fbQ-m.js","assets/use-ios-app-nudge-DiqQWH5O.js","assets/funnel-events-BAmjKdwH.js","assets/prefs-B6fvTCOn.js","assets/onboarding-store-OVV4wyh5.js","assets/device-settings-DXp9L4iB.js","assets/consent-s5g0Gmb2.js","assets/ingest-DiiwFQfV.js","assets/client-identity-BSG341dO.js","assets/platform-detection-BY5uzLL8.js","assets/native-biometric-CTR2Zi2w.js","assets/domains-OaR_FpOR.js","assets/routes-GmNvdtLW.js","assets/dist-CFSiz2ry2.js","assets/use-bus-subscription-CyRPH_gr.js","assets/event-bus-CvZyJQ26.js","assets/client-feature-flag-store-Bg5XEI2b.js","assets/feature-flag-catalog-CWHnoWvT.js","assets/theme-preferences-LQuLaIA6.js","assets/typed-storage-C-R1po3l.js","assets/button-Dy5001j6.js","assets/cn-CJf7MmLX.js","assets/bundle-mjs-BQxDdOEo.js","assets/src-BAS7a2RG.js","assets/dist-CQN0ZAOZ.js","assets/dist-CKLJHt4Z.js","assets/dist-BKxs5XmY.js","assets/checkbox-BZTUJtxM.js","assets/createLucideIcon-CAM1RhH8.js","assets/check-sC49_hjU.js","assets/typography-DEI9Ra9z.js","assets/list-row-BYrmPIC4.js","assets/chevron-right-HU6H84S0.js","assets/menu-CKZtG-s_.js","assets/Combination-C7TWRLS7.js","assets/popover-BFL-uOLh.js","assets/toast-DR7D7Uma.js","assets/circle-alert-DVCpoZrc.js","assets/circle-check-CjGnAahM.js","assets/info-CYiVdnQV.js","assets/x-DuBvjmAE.js","assets/panel-item-DGs4s9r-.js","assets/dist-BswnB-bR.js","assets/card-DRIctGVs.js","assets/confirm-dialog-DZX6LhLy.js","assets/loader-circle-BzJ2kz3F.js","assets/triangle-alert--e3n47gm.js","assets/modal-DwsThLGg.js","assets/dropdown-DswWMJhz.js","assets/chevron-down-B5A-0g8A.js","assets/input-C-GkeWCw.js","assets/notice-DCp7WO3L.js","assets/progress-bar-CJxkStgF.js","assets/tag-D8NAGb0r.js","assets/toggle-D776PTw-.js","assets/src-CfUWwwYf.css","assets/use-sticky-profiles-GTUzoFP4.js","assets/voice-list-BMMz4e4M.js","assets/react-query.gen-0mspArBl.js","assets/useMutation-CXGTrp4W.js","assets/infiniteQueryOptions-CqLc14_4.js","assets/queryOptions-CMSBCFOf.js","assets/use-is-org-ready-BbqlQFXw.js","assets/auth-store-w_EmIQP7.js","assets/remote-gateway-session-CgxYHgOD.js","assets/capture-error-FWzaVb8P.js","assets/resolved-assistants-store-8HQDfxZh.js","assets/square-Bn3X6ZlO.js","assets/volume-2-Bj3y3ZBJ.js","assets/use-platform-gate-D9hR3R0n.js","assets/search-DA3TmTuR.js","assets/identity-Cb4xS1Kk.js","assets/runtime-upgrade-banner-4PNA3XVR.js","assets/react-query.gen-BVTEjHsw.js","assets/local-runtime-upgrade-1CLFIVes.js","assets/diagnostics-BE1IgjfV.js","assets/misc-CAQM4FGM.js","assets/cloud-off-BCBGTmt0.js","assets/moon-DSdti3GO.js","assets/refresh-cw-Ci7hSykC.js","assets/wrench-tjOqvzJ2.js","assets/chunk-5KNZJZUH-Bsoom5--.js","assets/retire-confirm-dialog-BFbPH66U.js","assets/navigation-resolver-CIICT6n9.js","assets/research-onboarding-persistence-BN6g1lF7.js","assets/build-state-DDUJ0MId.js","assets/use-command-palette-sections-DWCppiPf.js","assets/chat-BIJEFb5u.js","assets/haptics-agodX1nl.js","assets/calendar-RYdAv74D.js","assets/globe-BDvXuPkw.js","assets/layout-grid-PPpVK0nJ.js","assets/message-square-zCNXaHYX.js","assets/monitor-B5vtTCxm.js","assets/settings-DyEBEqeQ.js","assets/add-credential-modal-DQZ43BJU.js","assets/use-active-assistant-id-CjvzlL4t.js","assets/key-round-CSc3w5ka.js","assets/app-card-JHbWefmm.js","assets/edge-swipe-arbiter-store-D9XJTxJJ.js","assets/viewer-store--hIQLNm5.js","assets/pointer-QlIwQKYH.js","assets/sandbox-bridge-CjHMJYTZ.js","assets/external-link-CAce-RVu.js","assets/puzzle-CtM3jM-f.js","assets/use-edit-app-BF9YK7AV.js","assets/use-is-mobile-Cx2xnNUx.js","assets/conversation-store-C0tvFESx.js","assets/edit-chat-session-Beky6Vpg.js","assets/chevron-up-2Qqarz0p.js","assets/minimize-2-BR0ed4mI.js","assets/pencil-CLJIvYKH.js","assets/avatar-renderer-3EVhZ7TB.js","assets/avatar-svg-compositor-DclcUb1M.js","assets/animated-avatar-CDeJNhwm.js","assets/use-reduced-motion-bjjt6x6d.js","assets/proxy-CNtrhN4q.js","assets/chat-avatar-CIF_o6y5.js","assets/sound-manager-DUo0lHGZ.js","assets/detail-shell-D9L3L7AM.js","assets/apple-logo-Cg-KnqW2.js","assets/use-discord-nudge-CRU-lEHV.js","assets/middleware-HE0NLvPl.js","assets/integration-icon-tiuVoy54.js","assets/public-asset-CD3ouSWU.js","assets/chat-layout-slots-store-C325hn1X.js","assets/document-viewer-container-Doc7G7NK.js","assets/circle-check-big-DSsDH5_6.js","assets/download-CywcQLB2.js","assets/file-text-BCsUYVEF.js","assets/message-square-text-asdoy3SW.js","assets/send-DHWUIK7G.js","assets/trash-2-De6X8YiM.js","assets/user-Dq9DUxnU.js","assets/not-found-p1VhZpMs.js","assets/arrow-left-C2ylPLHq.js","assets/sparkles-DC8kqYjt.js","assets/platform-login-notice-DIS8PWXu.js","assets/use-onboarding-login-xZhWGmky.js","assets/login-flow-BnCQjNXm.js","assets/log-in-Bhye1kwc.js","assets/slack-setup-wizard-dVkbEE6P.js","assets/use-copy-to-clipboard-BarKTY4m.js","assets/clipboard-copy-JwIceweN.js","assets/voice-providers-note-g4IBSHFm.js","assets/use-save-twilio-credentials-CCp1iqBf.js","assets/sdk.gen-DEFA-6EJ.js","assets/mail-DABv3_Ue.js","assets/message-circle-gk_DFUIg.js","assets/acp-run-store-CmGaPJm1.js","assets/by-tool-use-id-index-DcsiqOhc.js","assets/optimistic-lifecycle-50vNA6dY.js","assets/messages-BsXTJIIe.js","assets/prechat-EVefdGcO.js","assets/effective-timezone-CnKC3vj0.js","assets/browser-timezone-DGz-HvxU.js","assets/background-task-store-CN04oS2z.js","assets/risk-FjW-m05l.js","assets/chat-markdown-message-B3Qo04ug.js","assets/file-markdown-DBLxtb0M.js","assets/copy-to-clipboard-DaTa8Tbi.js","assets/workspace-tree-query-CqcOBNKw.js","assets/browser-CpgSNbEp.js","assets/native-anchor-BpfRwc60.js","assets/chevron-left-CytMddTB.js","assets/eye-off-fuOP4Lij.js","assets/eye-DTyDWiqu.js","assets/acp-run-actions-BGbBYETY.js","assets/code-qafFA0_-.js","assets/background-task-actions-yrapeY1n.js","assets/transcript-message-body-shared-CT5pk4wz.js","assets/site-favicon-CA7jaNnH.js","assets/three-dot-indicator-CfjkCgEH.js","assets/AnimatePresence-D23js3-M.js","assets/brain-BIzJCPA6.js","assets/user-plus-CXMJ1x_5.js","assets/subagent-store-C8qemfgn.js","assets/circle-x-17dBxF06.js","assets/file-plus-Dq2xo7Ic.js","assets/terminal-Cs_TREv-.js","assets/surface-parse-helpers-CEJ3tQ9Q.js","assets/conversation-navigation-tj2ntPAn.js","assets/workflow-store-Cbd3x6KN.js","assets/workflow-status-CgrMMiJT.js","assets/conversation-selection-B954w311.js","assets/use-subagent-card-data-Cu_-lx6d.js","assets/access-C97H-xHb.js","assets/assistant-feature-flag-store-CMUNSAPL.js","assets/research-results-view-BBf2iyCA.js","assets/research-facts-BcW4fghT.js","assets/ban-B__z3LwE.js","assets/utils-Ction0uF.js","assets/format-date-CKGQir4m.js","assets/bell-Ct4a9v6Y.js","assets/clock-BYTc0Ds9.js","assets/list-CDyb1CGV.js","assets/rotate-ccw-Da_2DvhY.js","assets/shield-check-z7CU-gBq.js","assets/invalidate-memory-queries-BPL6t0Cu.js","assets/get-memory-stats-CthVfpul.js","assets/invalidate-plugin-queries-QmmXCyiN.js","assets/first-run-scope-CZm4WhC7.js","assets/oauth-connection-utils-D9CTptlA.js","assets/native-deep-link-BJjxOpZm.js","assets/oauth-popup-Ql5xgtlO.js","assets/onboarding-layout-K7X9fV8B.js","assets/handle-logout-C_CDLqjS.js","assets/hard-navigate-V2EFapkk.js","assets/workspace-theme-tokens-bLqHFK0a.js","assets/conversation-queries-str0jfqv.js","assets/conversation-list-fetchers-BZnx9EMN.js","assets/use-app-theme-BLGjiz96.js","assets/use-assistant-capability-BaZVGuCu.js","assets/use-avatar-accent-var-BaftJG7F.js","assets/avatar-bundled-components-CTd294ra.js","assets/use-bookmarks-B6Y60m9F.js","assets/use-supports-bookmarks-DbG5HZ6P.js","assets/use-edge-swipe-sMxDzAcb.js","assets/use-swipe-engine-RAFE-Hrf.js","assets/plugins-surface-C4peMNec.js","assets/installed-plugins-query-6u0jUM-L.js","assets/doctor-handoff-store-ClS6J-b-.js","assets/threshold-presets-B-gOdjC4.js","assets/shield-9aFTFyT9.js","assets/trust-rules-api-iUGCiDDM.js","assets/dictation-overlay-w1YHEfFR.js","assets/native-file-BvwfoU6A.js","assets/deploy-store-BJ-njgv-.js","assets/avatar-subagent-BpXST4nO.js","assets/avatar-tone-4L7foPzW.js","assets/conversation-cache-BzPdBPXN.js","assets/external-urls-97O9n0lb.js","assets/eye-bbox-DE8r0Vt3.js","assets/settings-navigation-BDpUXrOI.js","assets/bug-VUcJFHwN.js","assets/chart-column-BLKW3sjY.js","assets/sliders-horizontal-slneqAyY.js","assets/mic-DZrWtAAu.js","assets/users-DWDkv8ju.js","assets/use-bundled-avatar-components-IQw2k8-g.js","assets/use-effective-timezone-Bx9QaO25.js","assets/useInfiniteQuery-Dk8q0n49.js","assets/arrow-down-to-line-Bh_5sIPp.js","assets/arrow-right-B-jRJNWP.js","assets/arrow-up-BNd4Gpy7.js","assets/upload-Bdbyo_ok.js","assets/circle-minus-DNfBAj4g.js","assets/cloud-RlApB3rO.js","assets/coins-Hrmb9tmj.js","assets/target-cdw7WP5q.js","assets/dices-DcuIF52A.js","assets/ellipsis-BRJI5_P1.js","assets/file-code-DD3K2kve.js","assets/video-CQJlht8Q.js","assets/folder-g06qTW2O.js","assets/hard-drive-CncrDZ7V.js","assets/heart-2AHOP0tB.js","assets/inbox-DXYIwUrn.js","assets/laptop-ByoaxLxg.js","assets/paperclip-DVE0scjU.js","assets/link-CowyzCIZ.js","assets/log-out-BLE632qu.js","assets/play-CCT817Ah.js","assets/plus-JG7kWjHA.js","assets/smartphone-BbK6bGuE.js","assets/sun-BKEPYS7Q.js","assets/workflow-DbPANJpf.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-Cv2QeVDK.js";import{d as t}from"./routes-GmNvdtLW.js";async function n(n){let{router:r}=await e(async()=>{let{router:e}=await import(`./routes-DOTByxnJ.js`).then(e=>e.n);return{router:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285]));await r.navigate(`${t.workspace}?file=${encodeURIComponent(n)}`)}export{n as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-BP00Ewbf.js","assets/chunk-jRWAZmH_.js","assets/preload-helper-Cv2QeVDK.js","assets/api-DDKNgE8n.js","assets/local-mode-9zpgPNoq.js","assets/is-electron-7N7iyz1y.js","assets/create-selectors-B-P03-8K.js","assets/react-BFJW0bSv.js","assets/local-settings-C-dW2vkq.js","assets/api-C8TlQNEU.js","assets/sdk.gen-DVW3wpbx.js","assets/client.gen-DHOmbzD9.js","assets/sdk.gen-BySz4QYj.js","assets/api-errors-SZKDzMLE.js","assets/use-assistant-avatar--4s_vvar.js","assets/utils-C-YNXdkX.js","assets/assistant-identity-store-BczULg2T.js","assets/QueryClientProvider-CMu7CkQU.js","assets/jsx-runtime-D3ZM-ToX.js","assets/useQuery-Bz-fbQ-m.js","assets/use-ios-app-nudge-CrBEIZ8w.js","assets/funnel-events-RT_kdQHK.js","assets/prefs-B6fvTCOn.js","assets/onboarding-store-OVV4wyh5.js","assets/device-settings-DXp9L4iB.js","assets/consent-s5g0Gmb2.js","assets/ingest-BbV11WbG.js","assets/client-identity-bdtPpHZK.js","assets/platform-detection-a_IB3-0w.js","assets/native-biometric-B96mgKGP.js","assets/domains-OaR_FpOR.js","assets/routes-GmNvdtLW.js","assets/dist-CFSiz2ry2.js","assets/use-bus-subscription-CyRPH_gr.js","assets/event-bus-CvZyJQ26.js","assets/client-feature-flag-store-Bg5XEI2b.js","assets/feature-flag-catalog-CWHnoWvT.js","assets/theme-preferences-LQuLaIA6.js","assets/typed-storage-C-R1po3l.js","assets/button-Dy5001j6.js","assets/cn-CJf7MmLX.js","assets/bundle-mjs-BQxDdOEo.js","assets/src-BAS7a2RG.js","assets/dist-CQN0ZAOZ.js","assets/dist-CKLJHt4Z.js","assets/dist-BKxs5XmY.js","assets/checkbox-BZTUJtxM.js","assets/createLucideIcon-CAM1RhH8.js","assets/check-sC49_hjU.js","assets/typography-DEI9Ra9z.js","assets/list-row-BYrmPIC4.js","assets/chevron-right-HU6H84S0.js","assets/menu-CKZtG-s_.js","assets/Combination-C7TWRLS7.js","assets/popover-BFL-uOLh.js","assets/toast-DR7D7Uma.js","assets/circle-alert-DVCpoZrc.js","assets/circle-check-CjGnAahM.js","assets/info-CYiVdnQV.js","assets/x-DuBvjmAE.js","assets/panel-item-DGs4s9r-.js","assets/dist-BswnB-bR.js","assets/card-DRIctGVs.js","assets/confirm-dialog-DZX6LhLy.js","assets/loader-circle-BzJ2kz3F.js","assets/triangle-alert--e3n47gm.js","assets/modal-DwsThLGg.js","assets/dropdown-DswWMJhz.js","assets/chevron-down-B5A-0g8A.js","assets/input-C-GkeWCw.js","assets/notice-DCp7WO3L.js","assets/progress-bar-CJxkStgF.js","assets/tag-D8NAGb0r.js","assets/toggle-D776PTw-.js","assets/src-CfUWwwYf.css","assets/use-sticky-profiles-bdq2XW7H.js","assets/voice-list-CCLkiF-c.js","assets/react-query.gen-0mspArBl.js","assets/useMutation-CXGTrp4W.js","assets/infiniteQueryOptions-CqLc14_4.js","assets/queryOptions-CMSBCFOf.js","assets/use-is-org-ready-zouQ5CN4.js","assets/auth-store-BwKMFgpK.js","assets/remote-gateway-session-CgxYHgOD.js","assets/capture-error-FWzaVb8P.js","assets/resolved-assistants-store-8HQDfxZh.js","assets/square-Bn3X6ZlO.js","assets/volume-2-Bj3y3ZBJ.js","assets/use-platform-gate-CqEOGZtI.js","assets/search-DA3TmTuR.js","assets/identity-Cb4xS1Kk.js","assets/runtime-upgrade-banner-yZYtWxoJ.js","assets/react-query.gen-BVTEjHsw.js","assets/local-runtime-upgrade-JwVgn034.js","assets/diagnostics-CLHyv7Xw.js","assets/misc-CAQM4FGM.js","assets/cloud-off-BCBGTmt0.js","assets/moon-DSdti3GO.js","assets/refresh-cw-Ci7hSykC.js","assets/wrench-tjOqvzJ2.js","assets/chunk-5KNZJZUH-Bsoom5--.js","assets/retire-confirm-dialog-m6ORm5Pq.js","assets/navigation-resolver-Lxhf-tbn.js","assets/research-onboarding-persistence-BN6g1lF7.js","assets/build-state-DPMhQpLB.js","assets/use-command-palette-sections-CAmbyguu.js","assets/chat-BIJEFb5u.js","assets/haptics-rJpeBta-.js","assets/calendar-RYdAv74D.js","assets/globe-BDvXuPkw.js","assets/layout-grid-PPpVK0nJ.js","assets/message-square-zCNXaHYX.js","assets/monitor-B5vtTCxm.js","assets/settings-DyEBEqeQ.js","assets/add-credential-modal-DQZ43BJU.js","assets/use-active-assistant-id-CjvzlL4t.js","assets/key-round-CSc3w5ka.js","assets/app-card-DgDV-yMd.js","assets/edge-swipe-arbiter-store-D9XJTxJJ.js","assets/viewer-store--hIQLNm5.js","assets/pointer-QlIwQKYH.js","assets/sandbox-bridge-CjHMJYTZ.js","assets/external-link-CAce-RVu.js","assets/puzzle-CtM3jM-f.js","assets/use-edit-app-BF9YK7AV.js","assets/use-is-mobile-Cx2xnNUx.js","assets/conversation-store-C0tvFESx.js","assets/edit-chat-session-Beky6Vpg.js","assets/chevron-up-2Qqarz0p.js","assets/minimize-2-BR0ed4mI.js","assets/pencil-CLJIvYKH.js","assets/avatar-renderer-3EVhZ7TB.js","assets/avatar-svg-compositor-DclcUb1M.js","assets/animated-avatar-CDeJNhwm.js","assets/use-reduced-motion-bjjt6x6d.js","assets/proxy-CNtrhN4q.js","assets/chat-avatar-CIF_o6y5.js","assets/sound-manager-DUo0lHGZ.js","assets/detail-shell-D9L3L7AM.js","assets/apple-logo-Cg-KnqW2.js","assets/use-discord-nudge-CRU-lEHV.js","assets/middleware-HE0NLvPl.js","assets/integration-icon-tiuVoy54.js","assets/public-asset-CD3ouSWU.js","assets/chat-layout-slots-store-C325hn1X.js","assets/document-viewer-container-Doc7G7NK.js","assets/circle-check-big-DSsDH5_6.js","assets/download-CywcQLB2.js","assets/file-text-BCsUYVEF.js","assets/message-square-text-asdoy3SW.js","assets/send-DHWUIK7G.js","assets/trash-2-De6X8YiM.js","assets/user-Dq9DUxnU.js","assets/not-found-p1VhZpMs.js","assets/arrow-left-C2ylPLHq.js","assets/sparkles-DC8kqYjt.js","assets/platform-login-notice-D-yQLWUo.js","assets/use-onboarding-login-X8pB53cV.js","assets/login-flow-llpmkEjN.js","assets/log-in-Bhye1kwc.js","assets/slack-setup-wizard-dVkbEE6P.js","assets/use-copy-to-clipboard-BarKTY4m.js","assets/clipboard-copy-JwIceweN.js","assets/voice-providers-note-g4IBSHFm.js","assets/use-save-twilio-credentials-CCp1iqBf.js","assets/sdk.gen-DEFA-6EJ.js","assets/mail-DABv3_Ue.js","assets/message-circle-gk_DFUIg.js","assets/acp-run-store-CmGaPJm1.js","assets/by-tool-use-id-index-DcsiqOhc.js","assets/optimistic-lifecycle-50vNA6dY.js","assets/messages-BzNSqJQx.js","assets/prechat-EVefdGcO.js","assets/effective-timezone-CnKC3vj0.js","assets/browser-timezone-DGz-HvxU.js","assets/background-task-store-CN04oS2z.js","assets/risk-uPLh5W5z.js","assets/chat-markdown-message-f4cLJfax.js","assets/file-markdown-DBLxtb0M.js","assets/copy-to-clipboard-DaTa8Tbi.js","assets/workspace-tree-query-CqcOBNKw.js","assets/browser-Bses4IN3.js","assets/native-anchor-BiuEQHcy.js","assets/chevron-left-CytMddTB.js","assets/eye-off-fuOP4Lij.js","assets/eye-DTyDWiqu.js","assets/acp-run-actions-BGbBYETY.js","assets/code-qafFA0_-.js","assets/background-task-actions-DX0pUvY9.js","assets/transcript-message-body-shared-woOFNF_q.js","assets/site-favicon-Dh1OTgFr.js","assets/three-dot-indicator-CfjkCgEH.js","assets/AnimatePresence-D23js3-M.js","assets/brain-BIzJCPA6.js","assets/user-plus-CXMJ1x_5.js","assets/subagent-store-DyKwOIj_.js","assets/circle-x-17dBxF06.js","assets/file-plus-Dq2xo7Ic.js","assets/terminal-Cs_TREv-.js","assets/surface-parse-helpers-CEJ3tQ9Q.js","assets/conversation-navigation-D63NJmBl.js","assets/workflow-store-Cbd3x6KN.js","assets/workflow-status-CgrMMiJT.js","assets/conversation-selection-B954w311.js","assets/use-subagent-card-data-B8JTa5rQ.js","assets/access-BJiXpwUJ.js","assets/assistant-feature-flag-store-CMUNSAPL.js","assets/research-results-view-BBf2iyCA.js","assets/research-facts-BcW4fghT.js","assets/ban-B__z3LwE.js","assets/utils-Ction0uF.js","assets/format-date-CKGQir4m.js","assets/bell-Ct4a9v6Y.js","assets/clock-BYTc0Ds9.js","assets/list-CDyb1CGV.js","assets/rotate-ccw-Da_2DvhY.js","assets/shield-check-z7CU-gBq.js","assets/invalidate-memory-queries-BPL6t0Cu.js","assets/get-memory-stats-CthVfpul.js","assets/invalidate-plugin-queries-QmmXCyiN.js","assets/first-run-scope-7wWjJ4Tn.js","assets/oauth-connection-utils-D9CTptlA.js","assets/native-deep-link-BJjxOpZm.js","assets/oauth-popup-Ql5xgtlO.js","assets/onboarding-layout-K7X9fV8B.js","assets/handle-logout-BTgnSSUm.js","assets/hard-navigate-V2EFapkk.js","assets/workspace-theme-tokens-bLqHFK0a.js","assets/conversation-queries-3taor2DZ.js","assets/conversation-list-fetchers-BZnx9EMN.js","assets/use-app-theme-BLGjiz96.js","assets/use-assistant-capability-BaZVGuCu.js","assets/use-avatar-accent-var-BaftJG7F.js","assets/avatar-bundled-components-CTd294ra.js","assets/use-bookmarks-B6Y60m9F.js","assets/use-supports-bookmarks-DbG5HZ6P.js","assets/use-edge-swipe-Gst62FjL.js","assets/use-swipe-engine-RAFE-Hrf.js","assets/plugins-surface-C4peMNec.js","assets/installed-plugins-query-6u0jUM-L.js","assets/doctor-handoff-store-DWNbuW3P.js","assets/threshold-presets-B-gOdjC4.js","assets/shield-9aFTFyT9.js","assets/trust-rules-api-iUGCiDDM.js","assets/dictation-overlay-w1YHEfFR.js","assets/native-file-BvwfoU6A.js","assets/deploy-store-BJ-njgv-.js","assets/avatar-subagent-BpXST4nO.js","assets/avatar-tone-4L7foPzW.js","assets/conversation-cache-BzPdBPXN.js","assets/external-urls-97O9n0lb.js","assets/eye-bbox-DE8r0Vt3.js","assets/settings-navigation-BDpUXrOI.js","assets/bug-VUcJFHwN.js","assets/chart-column-BLKW3sjY.js","assets/sliders-horizontal-slneqAyY.js","assets/mic-DZrWtAAu.js","assets/users-DWDkv8ju.js","assets/use-bundled-avatar-components-IQw2k8-g.js","assets/use-effective-timezone-Bx9QaO25.js","assets/useInfiniteQuery-Dk8q0n49.js","assets/arrow-down-to-line-Bh_5sIPp.js","assets/arrow-right-B-jRJNWP.js","assets/arrow-up-BNd4Gpy7.js","assets/upload-Bdbyo_ok.js","assets/circle-minus-DNfBAj4g.js","assets/cloud-RlApB3rO.js","assets/coins-Hrmb9tmj.js","assets/target-cdw7WP5q.js","assets/dices-DcuIF52A.js","assets/ellipsis-BRJI5_P1.js","assets/file-code-DD3K2kve.js","assets/video-CQJlht8Q.js","assets/folder-g06qTW2O.js","assets/hard-drive-CncrDZ7V.js","assets/heart-2AHOP0tB.js","assets/inbox-DXYIwUrn.js","assets/laptop-ByoaxLxg.js","assets/paperclip-DVE0scjU.js","assets/link-CowyzCIZ.js","assets/log-out-BLE632qu.js","assets/play-CCT817Ah.js","assets/plus-JG7kWjHA.js","assets/smartphone-BbK6bGuE.js","assets/sun-BKEPYS7Q.js","assets/workflow-DbPANJpf.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./preload-helper-Cv2QeVDK.js";import{d as t}from"./routes-GmNvdtLW.js";async function n(n){let{router:r}=await e(async()=>{let{router:e}=await import(`./routes-BP00Ewbf.js`).then(e=>e.n);return{router:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285]));await r.navigate(`${t.workspace}?file=${encodeURIComponent(n)}`)}export{n as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{l as n,u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./circle-alert-DVCpoZrc.js";import{t as o}from"./circle-check-CjGnAahM.js";import{t as s}from"./loader-circle-BzJ2kz3F.js";import{t as c}from"./smartphone-BbK6bGuE.js";import{h as l}from"./local-mode-9zpgPNoq.js";import{T as u,u as d}from"./native-biometric-CTR2Zi2w.js";import{a as f,c as p,i as m,n as h,r as g,t as _}from"./remote-gateway-session-CgxYHgOD.js";import{d as v}from"./routes-GmNvdtLW.js";import{r as y}from"./platform-detection-BY5uzLL8.js";import{t as b}from"./not-found-p1VhZpMs.js";var x=e(t(),1),S=i();function C(e){switch(e.kind){case`starting`:return{title:`Starting pairing`,body:`Creating a code for this browser.`};case`handoff_choice`:return{title:`Open in the Vellum app`,body:`Scanning from a phone with the Vellum app installed? Hand this pairing to the app.`};case`verifying`:return{title:`Pairing`,body:`Connecting this device to your assistant.`};case`approved`:return{title:`Connected`,body:`Opening your assistant.`};case`expired`:return{title:`Pairing expired`,body:`This pairing code is invalid or expired. Run vellum pair --qr (or vellum pair --web) on the machine running your assistant to get a new one.`};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 w({state:e}){return e.kind===`approved`?(0,S.jsx)(o,{className:`h-5 w-5 text-green-600`,"aria-hidden":!0}):e.kind===`handoff_choice`?(0,S.jsx)(c,{className:`h-5 w-5 text-blue-600`,"aria-hidden":!0}):e.kind===`starting`||e.kind===`verifying`||e.kind===`polling`?(0,S.jsx)(s,{className:`h-5 w-5 animate-spin text-blue-600`,"aria-hidden":!0}):(0,S.jsx)(a,{className:`h-5 w-5 text-red-600`,"aria-hidden":!0})}function T(){try{let e=new URL(window.location.href);for(let t of[`deviceCode`,`device_code`,`userCode`,`user_code`])e.searchParams.delete(t);e.hash=``,window.history.replaceState(null,``,`${e.pathname}${e.search}`)}catch{}}var E=`vellum-assistant`;function D(e){return`${E}://connect?${new URLSearchParams({url:p(),code:e}).toString()}`}function O({deviceCode:e,onContinueInBrowser:t}){return(0,S.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[(0,S.jsx)(`a`,{href:(0,x.useMemo)(()=>D(e),[e]),className:`inline-flex items-center justify-center rounded-md bg-blue-600 px-4 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-blue-700`,children:`Open in the Vellum app`}),(0,S.jsx)(`button`,{type:`button`,onClick:t,className:`inline-flex items-center justify-center rounded-md border border-[var(--border-default)] bg-[var(--background-surface)] px-4 py-2.5 text-sm font-medium text-[var(--content-primary)] transition-colors hover:bg-[var(--background-muted)]`,children:`Continue in this browser`})]})}function k(){let e=n(),t=r(),i=l(),a=(0,x.useMemo)(()=>u(new URLSearchParams(e.search).get(`returnTo`),v.assistant),[e.search]),o=(0,x.useMemo)(()=>f(`${e.pathname}${e.search}${e.hash}`),[e.pathname,e.search,e.hash]),s=(0,x.useMemo)(()=>!!o.deviceCode&&y()&&!d(),[o.deviceCode]),[c,p]=(0,x.useState)(()=>o.deviceCode?{deviceCode:o.deviceCode,userCode:o.userCode}:null),[E,D]=(0,x.useState)(()=>!s),[k,A]=(0,x.useState)(()=>s?{kind:`handoff_choice`}:o.deviceCode?{kind:`verifying`}:{kind:`starting`});(0,x.useEffect)(()=>{if(!i||c)return;let e=new AbortController;return(async()=>{try{let t=await g(e.signal);p({deviceCode:t.deviceCode,userCode:t.userCode}),A({kind:`polling`,expiresAt:t.expiresAt})}catch{if(e.signal.aborted)return;A({kind:`error`,message:`The assistant could not start pairing. Refresh the page to try again.`})}})(),()=>{e.abort()}},[i,c]),(0,x.useEffect)(()=>{if(!i||!c?.deviceCode||!E)return;let e=new AbortController,n=null,r=async()=>{try{let i=await m(c.deviceCode,e.signal);if(i.status===`pending`){A({kind:`polling`,expiresAt:i.expiresAt||null}),n=setTimeout(()=>void r(),Math.max(1,i.intervalSeconds)*1e3);return}h(i),T(),A({kind:`approved`}),n=setTimeout(()=>t(a,{replace:!0}),250)}catch(t){if(e.signal.aborted)return;if(t instanceof _&&t.status===401){A({kind:`expired`});return}if(t instanceof _&&t.code===`GUARDIAN_REPAIR_REQUIRED`){A({kind:`error`,message:`The assistant's trust database needs repair. Run guardian repair on the machine hosting the assistant, then retry this same pairing link — the code stays valid.`});return}A({kind:`error`,message:`The assistant could not complete pairing. Try starting a new pairing.`})}};return r(),()=>{e.abort(),n&&clearTimeout(n)}},[i,c?.deviceCode,E,t,a]);let j=(0,x.useCallback)(()=>{D(!0),A({kind:`verifying`})},[]);if(!i)return(0,S.jsx)(b,{});let M=C(k);return(0,S.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,S.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,S.jsxs)(`div`,{className:`mb-5 flex items-center gap-3`,children:[(0,S.jsx)(w,{state:k}),(0,S.jsx)(`h1`,{className:`text-xl font-semibold`,children:M.title})]}),k.kind===`polling`&&c?.userCode?(0,S.jsxs)(`div`,{className:`mb-5 rounded-md border border-[var(--border-subtle)] bg-[var(--background-muted)] p-4 text-center`,children:[(0,S.jsx)(`div`,{className:`text-xs font-medium uppercase text-[var(--content-secondary)]`,children:`Pairing code`}),(0,S.jsx)(`div`,{className:`mt-2 font-mono text-3xl font-semibold tracking-[0.18em]`,children:c.userCode})]}):null,(0,S.jsx)(`p`,{className:`text-sm leading-6 text-[var(--content-secondary)]`,children:M.body}),k.kind===`handoff_choice`&&c?(0,S.jsx)(O,{deviceCode:c.deviceCode,onContinueInBrowser:j}):null,k.kind===`polling`&&k.expiresAt?(0,S.jsxs)(`p`,{className:`mt-4 text-xs text-[var(--content-tertiary)]`,children:[`Expires `,new Date(k.expiresAt).toLocaleTimeString(),`.`]}):null]})})}export{k as RemoteWebPairingPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{l as n,u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./circle-alert-DVCpoZrc.js";import{t as o}from"./circle-check-CjGnAahM.js";import{t as s}from"./loader-circle-BzJ2kz3F.js";import{t as c}from"./smartphone-BbK6bGuE.js";import{h as l}from"./local-mode-9zpgPNoq.js";import{T as u,u as d}from"./native-biometric-B96mgKGP.js";import{a as f,c as p,i as m,n as h,r as g,t as _}from"./remote-gateway-session-CgxYHgOD.js";import{d as v}from"./routes-GmNvdtLW.js";import{r as y}from"./platform-detection-a_IB3-0w.js";import{t as b}from"./not-found-p1VhZpMs.js";var x=e(t(),1),S=i();function C(e){switch(e.kind){case`starting`:return{title:`Starting pairing`,body:`Creating a code for this browser.`};case`handoff_choice`:return{title:`Open in the Vellum app`,body:`Scanning from a phone with the Vellum app installed? Hand this pairing to the app.`};case`verifying`:return{title:`Pairing`,body:`Connecting this device to your assistant.`};case`approved`:return{title:`Connected`,body:`Opening your assistant.`};case`expired`:return{title:`Pairing expired`,body:`This pairing code is invalid or expired. Run vellum pair --qr (or vellum pair --web) on the machine running your assistant to get a new one.`};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 w({state:e}){return e.kind===`approved`?(0,S.jsx)(o,{className:`h-5 w-5 text-green-600`,"aria-hidden":!0}):e.kind===`handoff_choice`?(0,S.jsx)(c,{className:`h-5 w-5 text-blue-600`,"aria-hidden":!0}):e.kind===`starting`||e.kind===`verifying`||e.kind===`polling`?(0,S.jsx)(s,{className:`h-5 w-5 animate-spin text-blue-600`,"aria-hidden":!0}):(0,S.jsx)(a,{className:`h-5 w-5 text-red-600`,"aria-hidden":!0})}function T(){try{let e=new URL(window.location.href);for(let t of[`deviceCode`,`device_code`,`userCode`,`user_code`])e.searchParams.delete(t);e.hash=``,window.history.replaceState(null,``,`${e.pathname}${e.search}`)}catch{}}var E=`vellum-assistant`;function D(e){return`${E}://connect?${new URLSearchParams({url:p(),code:e}).toString()}`}function O({deviceCode:e,onContinueInBrowser:t}){return(0,S.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[(0,S.jsx)(`a`,{href:(0,x.useMemo)(()=>D(e),[e]),className:`inline-flex items-center justify-center rounded-md bg-blue-600 px-4 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-blue-700`,children:`Open in the Vellum app`}),(0,S.jsx)(`button`,{type:`button`,onClick:t,className:`inline-flex items-center justify-center rounded-md border border-[var(--border-default)] bg-[var(--background-surface)] px-4 py-2.5 text-sm font-medium text-[var(--content-primary)] transition-colors hover:bg-[var(--background-muted)]`,children:`Continue in this browser`})]})}function k(){let e=n(),t=r(),i=l(),a=(0,x.useMemo)(()=>u(new URLSearchParams(e.search).get(`returnTo`),v.assistant),[e.search]),o=(0,x.useMemo)(()=>f(`${e.pathname}${e.search}${e.hash}`),[e.pathname,e.search,e.hash]),s=(0,x.useMemo)(()=>!!o.deviceCode&&y()&&!d(),[o.deviceCode]),[c,p]=(0,x.useState)(()=>o.deviceCode?{deviceCode:o.deviceCode,userCode:o.userCode}:null),[E,D]=(0,x.useState)(()=>!s),[k,A]=(0,x.useState)(()=>s?{kind:`handoff_choice`}:o.deviceCode?{kind:`verifying`}:{kind:`starting`});(0,x.useEffect)(()=>{if(!i||c)return;let e=new AbortController;return(async()=>{try{let t=await g(e.signal);p({deviceCode:t.deviceCode,userCode:t.userCode}),A({kind:`polling`,expiresAt:t.expiresAt})}catch{if(e.signal.aborted)return;A({kind:`error`,message:`The assistant could not start pairing. Refresh the page to try again.`})}})(),()=>{e.abort()}},[i,c]),(0,x.useEffect)(()=>{if(!i||!c?.deviceCode||!E)return;let e=new AbortController,n=null,r=async()=>{try{let i=await m(c.deviceCode,e.signal);if(i.status===`pending`){A({kind:`polling`,expiresAt:i.expiresAt||null}),n=setTimeout(()=>void r(),Math.max(1,i.intervalSeconds)*1e3);return}h(i),T(),A({kind:`approved`}),n=setTimeout(()=>t(a,{replace:!0}),250)}catch(t){if(e.signal.aborted)return;if(t instanceof _&&t.status===401){A({kind:`expired`});return}if(t instanceof _&&t.code===`GUARDIAN_REPAIR_REQUIRED`){A({kind:`error`,message:`The assistant's trust database needs repair. Run guardian repair on the machine hosting the assistant, then retry this same pairing link — the code stays valid.`});return}A({kind:`error`,message:`The assistant could not complete pairing. Try starting a new pairing.`})}};return r(),()=>{e.abort(),n&&clearTimeout(n)}},[i,c?.deviceCode,E,t,a]);let j=(0,x.useCallback)(()=>{D(!0),A({kind:`verifying`})},[]);if(!i)return(0,S.jsx)(b,{});let M=C(k);return(0,S.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,S.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,S.jsxs)(`div`,{className:`mb-5 flex items-center gap-3`,children:[(0,S.jsx)(w,{state:k}),(0,S.jsx)(`h1`,{className:`text-xl font-semibold`,children:M.title})]}),k.kind===`polling`&&c?.userCode?(0,S.jsxs)(`div`,{className:`mb-5 rounded-md border border-[var(--border-subtle)] bg-[var(--background-muted)] p-4 text-center`,children:[(0,S.jsx)(`div`,{className:`text-xs font-medium uppercase text-[var(--content-secondary)]`,children:`Pairing code`}),(0,S.jsx)(`div`,{className:`mt-2 font-mono text-3xl font-semibold tracking-[0.18em]`,children:c.userCode})]}):null,(0,S.jsx)(`p`,{className:`text-sm leading-6 text-[var(--content-secondary)]`,children:M.body}),k.kind===`handoff_choice`&&c?(0,S.jsx)(O,{deviceCode:c.deviceCode,onContinueInBrowser:j}):null,k.kind===`polling`&&k.expiresAt?(0,S.jsxs)(`p`,{className:`mt-4 text-xs text-[var(--content-tertiary)]`,children:[`Expires `,new Date(k.expiresAt).toLocaleTimeString(),`.`]}):null]})})}export{k as RemoteWebPairingPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{m as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as a}from"./QueryClientProvider-CMu7CkQU.js";import{t as o}from"./useQuery-Bz-fbQ-m.js";import{t as s}from"./useMutation-CXGTrp4W.js";import{t as c}from"./jsx-runtime-D3ZM-ToX.js";import{t as l}from"./typography-DEI9Ra9z.js";import{t as u}from"./arrow-left-C2ylPLHq.js";import{t as d}from"./circle-check-CjGnAahM.js";import{A as f,C as p,D as ee,E as m,I as te,N as h,S as ne,T as g,a as re,b as ie,h as ae,i as oe,j as se,l as ce,n as le,o as ue,r as de,s as fe,t as pe,u as me}from"./use-checkout-dismiss-refresh-BZXXQef1.js";import{t as he}from"./sliders-horizontal-slneqAyY.js";import{t as ge}from"./loader-circle-BzJ2kz3F.js";import{t as _}from"./triangle-alert--e3n47gm.js";import{t as v}from"./tag-D8NAGb0r.js";import{t as y}from"./modal-DwsThLGg.js";import{n as b}from"./toast-DR7D7Uma.js";import{t as _e}from"./is-electron-7N7iyz1y.js";import{c as ve}from"./auth-store-w_EmIQP7.js";import{w as ye}from"./native-biometric-CTR2Zi2w.js";import{d as x,t as be}from"./routes-GmNvdtLW.js";import{i as xe,r as Se,t as Ce}from"./use-platform-gate-D9hR3R0n.js";import{r as we}from"./use-is-org-ready-BbqlQFXw.js";import{n as Te}from"./browser-CpgSNbEp.js";import{$ as Ee,dt as De,et as Oe,lt as ke,ut as S}from"./react-query.gen-BVTEjHsw.js";import{t as C}from"./use-bundled-avatar-components-IQw2k8-g.js";import{s as w}from"./machine-sizes-D0oAlF9f.js";import{t as Ae}from"./checkout-return-target-Cib3fzdY.js";var T=e(t(),1),E=c(),D=`Select custom CPU power, Ram and Storage. Or just throw in some tokens.`;function je({className:e,onConfigure:t,configureDisabled:r,isCurrent:i=!1,currentSummary:a}){return(0,E.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-8 ${e??``}`,children:[(0,E.jsx)(`p`,{className:`text-center text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Need something more tailored to your needs?`}),(0,E.jsxs)(`div`,{className:`flex w-[840px] max-w-full flex-col items-start gap-4 rounded-2xl bg-[var(--surface-lift)] p-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[(0,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,E.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--content-disabled)] p-[14px]`,children:(0,E.jsx)(he,{className:`h-6 w-6 text-[var(--aux-white)]`,"aria-hidden":!0})}),(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Custom Plan`}),i?(0,E.jsx)(v,{className:`bg-[var(--feed-digest-weak)] text-[var(--content-default)]`,children:`Your Current Plan`}):null]}),(0,E.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-tertiary)]`,children:a??D})]})]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,E.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Billed monthly`}),(0,E.jsx)(n,{variant:`outlined`,onClick:t,disabled:r,children:`Configure`})]})]})]})}function Me({open:e,lostFeatures:t,pending:r,onCancel:i,onConfirm:a}){let o=t.length>0;return(0,E.jsx)(y.Root,{open:e,onOpenChange:e=>{!e&&!r&&i()},children:(0,E.jsxs)(y.Content,{size:`md`,hideCloseButton:!0,children:[(0,E.jsx)(y.Header,{children:(0,E.jsx)(y.Title,{icon:_,children:`Downgrade to Base?`})}),(0,E.jsxs)(y.Body,{children:[(0,E.jsx)(l,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:o?`Downgrading removes the following Pro features. You'll be taken to Stripe to cancel your subscription.`:`You'll be taken to Stripe to cancel your subscription.`}),o?(0,E.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5`,children:t.map(e=>(0,E.jsx)(`li`,{children:(0,E.jsx)(l,{as:`span`,variant:`body-medium-default`,children:e})},e))}):null]}),(0,E.jsxs)(y.Footer,{children:[(0,E.jsx)(n,{variant:`outlined`,onClick:i,disabled:r,children:`Cancel`}),(0,E.jsx)(n,{variant:`danger`,onClick:a,disabled:r,"data-testid":`confirm-free-downgrade-button`,children:`Downgrade to Base`})]})]})})}function Ne({tierKey:e,name:t,tagline:r,priceLabel:i,priceCaption:a,ctaLabel:o,features:s,recommended:c=!1,tone:l=`dark`,isCurrent:u,intent:f=`upgrade`,pending:p,onCta:ee}){let m=f===`downgrade`&&!u;return(0,E.jsxs)(`div`,{"data-theme":l,className:`flex w-full flex-col gap-3 rounded-2xl bg-[var(--surface-lift)] p-3 sm:gap-4 sm:p-4`,children:[(0,E.jsx)(g,{tier:e,size:50}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`text-[20px] font-medium text-[var(--content-emphasised)]`,children:t}),c&&!m&&!u?(0,E.jsx)(v,{className:`bg-[var(--feed-digest-weak)] text-[12px] font-semibold uppercase text-[var(--credits-accent)]`,children:`Recommended`}):null]}),(0,E.jsx)(`p`,{className:`overflow-hidden text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)] sm:h-9`,children:r})]}),(0,E.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,E.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:i}),(0,E.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:a})]}),(0,E.jsx)(n,{variant:m?`outlined`:`primary`,fullWidth:!0,disabled:u||p,onClick:ee,children:u?`Current Plan`:o}),(0,E.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:gap-4`,children:[(0,E.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Includes:`}),(0,E.jsx)(`ul`,{className:`flex flex-col gap-2`,children:s.map(e=>(0,E.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,E.jsx)(d,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,E.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-secondary)]`,children:e})]},e))})]})]})}var Pe=`#0A0A0B`,Fe=`https://www.vellum.ai/docs/pricing`,Ie=8e3,Le={upgrade:`upgrade`,downgrade:`downgrade`,switch:`change`};C();var Re=[`Small Computer`,`4 GB Storage`,`Pay-as-you-go credits`];function ze(e){return`${h(e)}/month`}function O(e){return`${p(e)} Computer`}function Be(e,t){let n=e.credits_usd??0;return[O(e),`${e.storage_gib} GB Storage`,`${h(n*100)} in credits included`,...t]}function Ve(e,t){return ne(e,t).join(` · `)}function He(){let e=i(),[t,c]=r(),l=a(),d=_e(),p=xe({platformHostedOnly:!0}),h=Ce(),ne=Se(),g=p===`full`&&h,he=p===`full`&&ne,_=o({...ke(),enabled:g}),v=o({...Ee(),enabled:g}),y=s(De()),{changePackage:C,isPending:D}=fe(),{changeTiers:O,isPending:He,current:k,currentReady:A,currentKnown:j,primaryAssistantId:Ue}=ue({enabled:g});pe();let[We,Ge]=(0,T.useState)(!1),[Ke,M]=(0,T.useState)(!1),[qe,N]=(0,T.useState)(!1),[P,F]=(0,T.useState)(null),[Je,I]=(0,T.useState)(!1),[Ye,L]=(0,T.useState)(void 0),R=(0,T.useRef)(!1),[z,Xe]=(0,T.useState)(!1),Ze=(0,T.useRef)(!1),[B,Qe]=(0,T.useState)(null),V=_.data,H=v.data?.plans.find(e=>e.id===`pro`),U=H?.packages??[],$e=U.length>0,W=V?.plan_id===`pro`,et=we(),tt=te(Ue,g&&et&&W&&j),nt=j?tt:void 0,G=V?V.plan_id===`base`?`free`:ee(V.package)?V.package.key:null:null,K=ie(ae(V)),rt=new Set(v.data?.plans.find(e=>e.id===`base`)?.included_features??[]),it=(H?.included_features??[]).filter(e=>!rt.has(e)),q=We||D||K.isPending,at=(0,T.useMemo)(()=>!W||k.storageTier==null?null:{machineTier:k.machineTier,storageTier:k.storageTier,creditTier:k.creditTier},[W,k.machineTier,k.storageTier,k.creditTier]),J=t.get(be),Y=!g&&!he,ot=g&&!v.isLoading&&!$e,X=Y||!(J!=null&&!z)&&(_.isError||ot);(0,T.useEffect)(()=>{X&&e(Y?x.settings.usageBilling:`${x.settings.usageBilling}&adjust_plan`,{replace:!0})},[X,Y,e]);let st=()=>{(window.history.state?.idx??0)>0?e(-1):e(x.settings.usageBilling)},ct=async e=>{Ge(!0);try{let t=await y.mutateAsync({body:{...e,return_target:Ae()}});t.status===`redirect`&&t.checkout_url?(ye(e.package?{kind:`package`,packageKey:e.package}:{kind:`custom`,machineTier:e.machine_tier??null,storageTier:e.storage_tier??null,creditTier:e.credit_tier??null}),ve(l),Te(t.checkout_url)):(await l.invalidateQueries({queryKey:S()}),await l.invalidateQueries({queryKey:Oe()}))}catch(e){b.error(ce(e,`Failed to start the upgrade checkout. Please try again.`))}finally{Ge(!1)}},Z=(t,n)=>{if(V&&!q){if(W){if(t===`free`){N(!0);return}let r=U.find(e=>e.key===t);if(!r||f(G,r.key)===`current`)return;if(!me(V)){e(`${x.settings.usageBilling}&adjust_plan`,{replace:n?.replaceOnBail===!0});return}F(r);return}t!==`free`&&ct({target_plan_id:`pro`,package:t,confirm:!0})}},Q=(0,T.useRef)(Z);(0,T.useEffect)(()=>{Q.current=Z}),(0,T.useEffect)(()=>{if(J==null||R.current||X||!g||Ze.current)return;Ze.current=!0;let e=setTimeout(()=>{Xe(!0)},Ie),t=()=>{clearTimeout(e),Xe(!0)};Promise.all([l.refetchQueries({queryKey:S()}),l.refetchQueries({queryKey:Oe()})]).then(t,t)},[X,J,g,l]),(0,T.useEffect)(()=>{J==null||R.current||X||!g||!z||(R.current=!0,W&&J!==`free`&&Qe(J),c(e=>{let t=new URLSearchParams(e);return t.delete(be),t},{replace:!0}))},[z,X,J,g,W,c]),(0,T.useEffect)(()=>{B==null||J!=null||(Qe(null),Q.current(B,{replaceOnBail:!0}))},[J,B]);let $;if(V&&H&&$e){let e=W&&G===null&&A&&k.storageGib!=null,t=e?Ve(k,H):void 0,n=()=>{N(!1),K.mutate({})},r=()=>({creditTier:k.creditTier,fromSnapshot:{machineSize:nt?.machine_size??null,storageGib:nt?.provisioned_storage_gib??null}}),i=P?G===null?`switch`:f(G,P.key)===`downgrade`?`downgrade`:`upgrade`:`upgrade`,a=async()=>{if(!P)return;let e=P,t=r(),n=G===null||!A||!j||w(k.machineTier,e.machine_tier),a=await C(e.key);if(!a)return;if(F(null),a.status===`no_op`){b.success(`You're already on this plan.`);return}let o=e.credit_tier??null;L({fromSnapshot:t.fromSnapshot,credits:o===t.creditTier?null:{fromTier:t.creditTier,toTier:o},direction:Le[i],canLowerResources:n}),I(!0)},o=e=>ct({target_plan_id:`pro`,confirm:!0,machine_tier:e.machineTier,storage_tier:e.storageTier,credit_tier:e.creditTier}),s=async e=>{let t=r(),n=!j||w(k.machineTier,e.machineTier),i=await O(e);i&&(M(!1),i.needsResize||i.creditChanged?(L({fromSnapshot:t.fromSnapshot,credits:i.creditChanged?{fromTier:t.creditTier,toTier:e.creditTier}:null,direction:`change`,canLowerResources:n}),I(!0)):b.success(`Plan updated.`))},c=()=>{q||W&&!A||M(!0)},l=[...U].sort((e,t)=>m.indexOf(e.key)-m.indexOf(t.key)),u=oe(`free`),d=W?`downgrade`:f(G,`free`);$=(0,E.jsxs)(`div`,{className:`my-auto flex w-full flex-col items-center`,children:[(0,E.jsxs)(`header`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,E.jsx)(`h1`,{className:`text-[40px] text-[var(--content-emphasised)] sm:text-[60px]`,style:{fontFamily:`var(--font-serif)`,fontWeight:400,lineHeight:1.2,letterSpacing:`1.2px`},children:`Give your assistant more power`}),(0,E.jsx)(`p`,{className:`text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Choose the level that matches how much you want it to take on.`})]}),(0,E.jsxs)(`div`,{className:`mt-6 grid w-full max-w-[1312px] grid-cols-1 items-start gap-4 sm:mt-10 sm:grid-cols-2 sm:gap-6 lg:grid-cols-4`,children:[(0,E.jsx)(Ne,{tierKey:`free`,name:`Base`,tagline:u?.tagline??``,priceLabel:`Free`,priceCaption:u?.priceCaption??`Forever`,ctaLabel:d===`downgrade`?de(`Base`):u?.cta??`Start Free`,features:Re,tone:`dark`,isCurrent:G===`free`,intent:d,pending:q,onCta:()=>Z(`free`)}),l.map(e=>{let t=oe(e.key),n=f(G,e.key);return(0,E.jsx)(Ne,{tierKey:e.key,name:e.name,tagline:t?.tagline??``,priceLabel:ze(e.total_price_cents),priceCaption:t?.priceCaption??`Billed monthly`,ctaLabel:n===`downgrade`?de(e.name):t?.cta??e.name,features:Be(e,t?.extraFeatures??[]),recommended:t?.recommended,tone:t?.recommended?`light`:`dark`,isCurrent:G===e.key,intent:n,pending:q,onCta:()=>Z(e.key)},e.key)})]}),(0,E.jsx)(je,{className:`mt-6 sm:mt-10`,onConfigure:c,configureDisabled:W&&!A||q,isCurrent:e,currentSummary:t}),(0,E.jsx)(re,{open:Ke,proPlan:H,pending:We||He,currentStorageGib:W?k.storageGib:null,initialSelection:at,onClose:()=>M(!1),onContinue:e=>{W?s(e):o(e)}}),(0,E.jsx)(le,{open:P!==null,relation:i,packageName:P?.name??``,targetPackage:P,pending:D,onCancel:()=>F(null),onConfirm:()=>void a()}),(0,E.jsx)(Me,{open:qe,lostFeatures:it,pending:K.isPending,onCancel:()=>N(!1),onConfirm:n}),(0,E.jsx)(se,{mode:`resize`,open:Je,onClose:()=>{I(!1),L(void 0)},resizeContext:Ye}),(0,E.jsxs)(`p`,{className:`mt-6 text-center text-[12px] font-medium text-[var(--content-tertiary)] sm:mt-10`,children:[`You can cancel or change your plan anytime you want. To learn more`,` `,(0,E.jsx)(`a`,{href:Fe,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--content-default)] underline`,children:`Read our Docs.`})]})]})}else $=(0,E.jsx)(`div`,{className:`my-auto flex items-center justify-center`,children:(0,E.jsx)(ge,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading plans`})});return(0,E.jsxs)(`div`,{"data-theme":`dark`,className:`plans-takeover-canvas-enter relative h-full w-full overflow-y-auto`,style:{backgroundColor:Pe},children:[(0,E.jsx)(`div`,{className:`absolute left-8 z-10 [-webkit-app-region:no-drag]`,style:{top:d?`3rem`:`2rem`},children:(0,E.jsx)(n,{variant:`outlined`,leftIcon:(0,E.jsx)(u,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:st,className:`[-webkit-app-region:no-drag]`,children:`Back`})}),(0,E.jsx)(`div`,{className:`plans-takeover-content-enter flex min-h-full flex-col items-center px-4 pb-8 sm:px-6`,style:{paddingTop:d?`5rem`:`4rem`},children:$})]})}export{He as PlansPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{m as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as a}from"./QueryClientProvider-CMu7CkQU.js";import{t as o}from"./useQuery-Bz-fbQ-m.js";import{t as s}from"./useMutation-CXGTrp4W.js";import{t as c}from"./jsx-runtime-D3ZM-ToX.js";import{t as l}from"./typography-DEI9Ra9z.js";import{t as u}from"./arrow-left-C2ylPLHq.js";import{t as d}from"./circle-check-CjGnAahM.js";import{A as f,C as p,D as ee,E as m,I as te,N as h,S as ne,T as g,a as re,b as ie,h as ae,i as oe,j as se,l as ce,n as le,o as ue,r as de,s as fe,t as pe,u as me}from"./use-checkout-dismiss-refresh-BkIzNk6B.js";import{t as he}from"./sliders-horizontal-slneqAyY.js";import{t as ge}from"./loader-circle-BzJ2kz3F.js";import{t as _}from"./triangle-alert--e3n47gm.js";import{t as v}from"./tag-D8NAGb0r.js";import{t as y}from"./modal-DwsThLGg.js";import{n as b}from"./toast-DR7D7Uma.js";import{t as _e}from"./is-electron-7N7iyz1y.js";import{c as ve}from"./auth-store-BwKMFgpK.js";import{w as ye}from"./native-biometric-B96mgKGP.js";import{d as x,t as be}from"./routes-GmNvdtLW.js";import{i as xe,r as Se,t as Ce}from"./use-platform-gate-CqEOGZtI.js";import{r as we}from"./use-is-org-ready-zouQ5CN4.js";import{n as Te}from"./browser-Bses4IN3.js";import{$ as Ee,dt as De,et as Oe,lt as ke,ut as S}from"./react-query.gen-BVTEjHsw.js";import{t as C}from"./use-bundled-avatar-components-IQw2k8-g.js";import{s as w}from"./machine-sizes-D0oAlF9f.js";import{t as Ae}from"./checkout-return-target-Cib3fzdY.js";var T=e(t(),1),E=c(),D=`Select custom CPU power, Ram and Storage. Or just throw in some tokens.`;function je({className:e,onConfigure:t,configureDisabled:r,isCurrent:i=!1,currentSummary:a}){return(0,E.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-8 ${e??``}`,children:[(0,E.jsx)(`p`,{className:`text-center text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Need something more tailored to your needs?`}),(0,E.jsxs)(`div`,{className:`flex w-[840px] max-w-full flex-col items-start gap-4 rounded-2xl bg-[var(--surface-lift)] p-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[(0,E.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,E.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--content-disabled)] p-[14px]`,children:(0,E.jsx)(he,{className:`h-6 w-6 text-[var(--aux-white)]`,"aria-hidden":!0})}),(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Custom Plan`}),i?(0,E.jsx)(v,{className:`bg-[var(--feed-digest-weak)] text-[var(--content-default)]`,children:`Your Current Plan`}):null]}),(0,E.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-tertiary)]`,children:a??D})]})]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,E.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Billed monthly`}),(0,E.jsx)(n,{variant:`outlined`,onClick:t,disabled:r,children:`Configure`})]})]})]})}function Me({open:e,lostFeatures:t,pending:r,onCancel:i,onConfirm:a}){let o=t.length>0;return(0,E.jsx)(y.Root,{open:e,onOpenChange:e=>{!e&&!r&&i()},children:(0,E.jsxs)(y.Content,{size:`md`,hideCloseButton:!0,children:[(0,E.jsx)(y.Header,{children:(0,E.jsx)(y.Title,{icon:_,children:`Downgrade to Base?`})}),(0,E.jsxs)(y.Body,{children:[(0,E.jsx)(l,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:o?`Downgrading removes the following Pro features. You'll be taken to Stripe to cancel your subscription.`:`You'll be taken to Stripe to cancel your subscription.`}),o?(0,E.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5`,children:t.map(e=>(0,E.jsx)(`li`,{children:(0,E.jsx)(l,{as:`span`,variant:`body-medium-default`,children:e})},e))}):null]}),(0,E.jsxs)(y.Footer,{children:[(0,E.jsx)(n,{variant:`outlined`,onClick:i,disabled:r,children:`Cancel`}),(0,E.jsx)(n,{variant:`danger`,onClick:a,disabled:r,"data-testid":`confirm-free-downgrade-button`,children:`Downgrade to Base`})]})]})})}function Ne({tierKey:e,name:t,tagline:r,priceLabel:i,priceCaption:a,ctaLabel:o,features:s,recommended:c=!1,tone:l=`dark`,isCurrent:u,intent:f=`upgrade`,pending:p,onCta:ee}){let m=f===`downgrade`&&!u;return(0,E.jsxs)(`div`,{"data-theme":l,className:`flex w-full flex-col gap-3 rounded-2xl bg-[var(--surface-lift)] p-3 sm:gap-4 sm:p-4`,children:[(0,E.jsx)(g,{tier:e,size:50}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`text-[20px] font-medium text-[var(--content-emphasised)]`,children:t}),c&&!m&&!u?(0,E.jsx)(v,{className:`bg-[var(--feed-digest-weak)] text-[12px] font-semibold uppercase text-[var(--credits-accent)]`,children:`Recommended`}):null]}),(0,E.jsx)(`p`,{className:`overflow-hidden text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)] sm:h-9`,children:r})]}),(0,E.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,E.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:i}),(0,E.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:a})]}),(0,E.jsx)(n,{variant:m?`outlined`:`primary`,fullWidth:!0,disabled:u||p,onClick:ee,children:u?`Current Plan`:o}),(0,E.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 sm:gap-4`,children:[(0,E.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Includes:`}),(0,E.jsx)(`ul`,{className:`flex flex-col gap-2`,children:s.map(e=>(0,E.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,E.jsx)(d,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,E.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-secondary)]`,children:e})]},e))})]})]})}var Pe=`#0A0A0B`,Fe=`https://www.vellum.ai/docs/pricing`,Ie=8e3,Le={upgrade:`upgrade`,downgrade:`downgrade`,switch:`change`};C();var Re=[`Small Computer`,`4 GB Storage`,`Pay-as-you-go credits`];function ze(e){return`${h(e)}/month`}function O(e){return`${p(e)} Computer`}function Be(e,t){let n=e.credits_usd??0;return[O(e),`${e.storage_gib} GB Storage`,`${h(n*100)} in credits included`,...t]}function Ve(e,t){return ne(e,t).join(` · `)}function He(){let e=i(),[t,c]=r(),l=a(),d=_e(),p=xe({platformHostedOnly:!0}),h=Ce(),ne=Se(),g=p===`full`&&h,he=p===`full`&&ne,_=o({...ke(),enabled:g}),v=o({...Ee(),enabled:g}),y=s(De()),{changePackage:C,isPending:D}=fe(),{changeTiers:O,isPending:He,current:k,currentReady:A,currentKnown:j,primaryAssistantId:Ue}=ue({enabled:g});pe();let[We,Ge]=(0,T.useState)(!1),[Ke,M]=(0,T.useState)(!1),[qe,N]=(0,T.useState)(!1),[P,F]=(0,T.useState)(null),[Je,I]=(0,T.useState)(!1),[Ye,L]=(0,T.useState)(void 0),R=(0,T.useRef)(!1),[z,Xe]=(0,T.useState)(!1),Ze=(0,T.useRef)(!1),[B,Qe]=(0,T.useState)(null),V=_.data,H=v.data?.plans.find(e=>e.id===`pro`),U=H?.packages??[],$e=U.length>0,W=V?.plan_id===`pro`,et=we(),tt=te(Ue,g&&et&&W&&j),nt=j?tt:void 0,G=V?V.plan_id===`base`?`free`:ee(V.package)?V.package.key:null:null,K=ie(ae(V)),rt=new Set(v.data?.plans.find(e=>e.id===`base`)?.included_features??[]),it=(H?.included_features??[]).filter(e=>!rt.has(e)),q=We||D||K.isPending,at=(0,T.useMemo)(()=>!W||k.storageTier==null?null:{machineTier:k.machineTier,storageTier:k.storageTier,creditTier:k.creditTier},[W,k.machineTier,k.storageTier,k.creditTier]),J=t.get(be),Y=!g&&!he,ot=g&&!v.isLoading&&!$e,X=Y||!(J!=null&&!z)&&(_.isError||ot);(0,T.useEffect)(()=>{X&&e(Y?x.settings.usageBilling:`${x.settings.usageBilling}&adjust_plan`,{replace:!0})},[X,Y,e]);let st=()=>{(window.history.state?.idx??0)>0?e(-1):e(x.settings.usageBilling)},ct=async e=>{Ge(!0);try{let t=await y.mutateAsync({body:{...e,return_target:Ae()}});t.status===`redirect`&&t.checkout_url?(ye(e.package?{kind:`package`,packageKey:e.package}:{kind:`custom`,machineTier:e.machine_tier??null,storageTier:e.storage_tier??null,creditTier:e.credit_tier??null}),ve(l),Te(t.checkout_url)):(await l.invalidateQueries({queryKey:S()}),await l.invalidateQueries({queryKey:Oe()}))}catch(e){b.error(ce(e,`Failed to start the upgrade checkout. Please try again.`))}finally{Ge(!1)}},Z=(t,n)=>{if(V&&!q){if(W){if(t===`free`){N(!0);return}let r=U.find(e=>e.key===t);if(!r||f(G,r.key)===`current`)return;if(!me(V)){e(`${x.settings.usageBilling}&adjust_plan`,{replace:n?.replaceOnBail===!0});return}F(r);return}t!==`free`&&ct({target_plan_id:`pro`,package:t,confirm:!0})}},Q=(0,T.useRef)(Z);(0,T.useEffect)(()=>{Q.current=Z}),(0,T.useEffect)(()=>{if(J==null||R.current||X||!g||Ze.current)return;Ze.current=!0;let e=setTimeout(()=>{Xe(!0)},Ie),t=()=>{clearTimeout(e),Xe(!0)};Promise.all([l.refetchQueries({queryKey:S()}),l.refetchQueries({queryKey:Oe()})]).then(t,t)},[X,J,g,l]),(0,T.useEffect)(()=>{J==null||R.current||X||!g||!z||(R.current=!0,W&&J!==`free`&&Qe(J),c(e=>{let t=new URLSearchParams(e);return t.delete(be),t},{replace:!0}))},[z,X,J,g,W,c]),(0,T.useEffect)(()=>{B==null||J!=null||(Qe(null),Q.current(B,{replaceOnBail:!0}))},[J,B]);let $;if(V&&H&&$e){let e=W&&G===null&&A&&k.storageGib!=null,t=e?Ve(k,H):void 0,n=()=>{N(!1),K.mutate({})},r=()=>({creditTier:k.creditTier,fromSnapshot:{machineSize:nt?.machine_size??null,storageGib:nt?.provisioned_storage_gib??null}}),i=P?G===null?`switch`:f(G,P.key)===`downgrade`?`downgrade`:`upgrade`:`upgrade`,a=async()=>{if(!P)return;let e=P,t=r(),n=G===null||!A||!j||w(k.machineTier,e.machine_tier),a=await C(e.key);if(!a)return;if(F(null),a.status===`no_op`){b.success(`You're already on this plan.`);return}let o=e.credit_tier??null;L({fromSnapshot:t.fromSnapshot,credits:o===t.creditTier?null:{fromTier:t.creditTier,toTier:o},direction:Le[i],canLowerResources:n}),I(!0)},o=e=>ct({target_plan_id:`pro`,confirm:!0,machine_tier:e.machineTier,storage_tier:e.storageTier,credit_tier:e.creditTier}),s=async e=>{let t=r(),n=!j||w(k.machineTier,e.machineTier),i=await O(e);i&&(M(!1),i.needsResize||i.creditChanged?(L({fromSnapshot:t.fromSnapshot,credits:i.creditChanged?{fromTier:t.creditTier,toTier:e.creditTier}:null,direction:`change`,canLowerResources:n}),I(!0)):b.success(`Plan updated.`))},c=()=>{q||W&&!A||M(!0)},l=[...U].sort((e,t)=>m.indexOf(e.key)-m.indexOf(t.key)),u=oe(`free`),d=W?`downgrade`:f(G,`free`);$=(0,E.jsxs)(`div`,{className:`my-auto flex w-full flex-col items-center`,children:[(0,E.jsxs)(`header`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,E.jsx)(`h1`,{className:`text-[40px] text-[var(--content-emphasised)] sm:text-[60px]`,style:{fontFamily:`var(--font-serif)`,fontWeight:400,lineHeight:1.2,letterSpacing:`1.2px`},children:`Give your assistant more power`}),(0,E.jsx)(`p`,{className:`text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Choose the level that matches how much you want it to take on.`})]}),(0,E.jsxs)(`div`,{className:`mt-6 grid w-full max-w-[1312px] grid-cols-1 items-start gap-4 sm:mt-10 sm:grid-cols-2 sm:gap-6 lg:grid-cols-4`,children:[(0,E.jsx)(Ne,{tierKey:`free`,name:`Base`,tagline:u?.tagline??``,priceLabel:`Free`,priceCaption:u?.priceCaption??`Forever`,ctaLabel:d===`downgrade`?de(`Base`):u?.cta??`Start Free`,features:Re,tone:`dark`,isCurrent:G===`free`,intent:d,pending:q,onCta:()=>Z(`free`)}),l.map(e=>{let t=oe(e.key),n=f(G,e.key);return(0,E.jsx)(Ne,{tierKey:e.key,name:e.name,tagline:t?.tagline??``,priceLabel:ze(e.total_price_cents),priceCaption:t?.priceCaption??`Billed monthly`,ctaLabel:n===`downgrade`?de(e.name):t?.cta??e.name,features:Be(e,t?.extraFeatures??[]),recommended:t?.recommended,tone:t?.recommended?`light`:`dark`,isCurrent:G===e.key,intent:n,pending:q,onCta:()=>Z(e.key)},e.key)})]}),(0,E.jsx)(je,{className:`mt-6 sm:mt-10`,onConfigure:c,configureDisabled:W&&!A||q,isCurrent:e,currentSummary:t}),(0,E.jsx)(re,{open:Ke,proPlan:H,pending:We||He,currentStorageGib:W?k.storageGib:null,initialSelection:at,onClose:()=>M(!1),onContinue:e=>{W?s(e):o(e)}}),(0,E.jsx)(le,{open:P!==null,relation:i,packageName:P?.name??``,targetPackage:P,pending:D,onCancel:()=>F(null),onConfirm:()=>void a()}),(0,E.jsx)(Me,{open:qe,lostFeatures:it,pending:K.isPending,onCancel:()=>N(!1),onConfirm:n}),(0,E.jsx)(se,{mode:`resize`,open:Je,onClose:()=>{I(!1),L(void 0)},resizeContext:Ye}),(0,E.jsxs)(`p`,{className:`mt-6 text-center text-[12px] font-medium text-[var(--content-tertiary)] sm:mt-10`,children:[`You can cancel or change your plan anytime you want. To learn more`,` `,(0,E.jsx)(`a`,{href:Fe,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--content-default)] underline`,children:`Read our Docs.`})]})]})}else $=(0,E.jsx)(`div`,{className:`my-auto flex items-center justify-center`,children:(0,E.jsx)(ge,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading plans`})});return(0,E.jsxs)(`div`,{"data-theme":`dark`,className:`plans-takeover-canvas-enter relative h-full w-full overflow-y-auto`,style:{backgroundColor:Pe},children:[(0,E.jsx)(`div`,{className:`absolute left-8 z-10 [-webkit-app-region:no-drag]`,style:{top:d?`3rem`:`2rem`},children:(0,E.jsx)(n,{variant:`outlined`,leftIcon:(0,E.jsx)(u,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:st,className:`[-webkit-app-region:no-drag]`,children:`Back`})}),(0,E.jsx)(`div`,{className:`plans-takeover-content-enter flex min-h-full flex-col items-center px-4 pb-8 sm:px-6`,style:{paddingTop:d?`5rem`:`4rem`},children:$})]})}export{He as PlansPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./is-electron-7N7iyz1y.js";import{u as r}from"./native-biometric-CTR2Zi2w.js";import{t as i}from"./dist-CFSiz2ry2.js";var a=e(t(),1);function o(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent;if(/iPhone|iPod/.test(e)||/iPad/.test(e))return!0;let t=navigator.userAgentData;return(t?.platform?t.platform.toLowerCase().includes(`mac`):navigator.platform.toLowerCase().includes(`mac`))&&navigator.maxTouchPoints>1}function s(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent;return/Safari/.test(e)&&!/CriOS|FxiOS|EdgiOS|OPiOS|Chrome|Chromium/.test(e)}function c(){if(typeof navigator>`u`||o())return!1;let e=navigator.userAgentData;return e?.platform?e.platform.toLowerCase().includes(`mac`):navigator.platform.toLowerCase().includes(`mac`)}function l(){return typeof navigator>`u`?!1:/Android/i.test(navigator.userAgent)}function u(){return n()?`macos`:r()?i.getPlatform()===`android`?`android`:`ios`:o()?`ios`:l()?`android`:`web`}function d(){return r()&&i.getPlatform()===`ios`}function f(e){if(!e||e.length===0)return null;for(let{family:t,pattern:n}of[{family:`edge`,pattern:/microsoft edge/i},{family:`chrome`,pattern:/google chrome|chromium/i}]){let r=e.find(e=>n.test(e.brand));if(r){let e=r.version.match(/^\d+/)?.[0];return{family:t,...e?{version:e}:{}}}}return null}function p(e){for(let{family:t,pattern:n}of[{family:`edge`,pattern:/(?:Edg|EdgiOS|EdgA)\/(\d+)/},{family:`chrome`,pattern:/(?:Chrome|CriOS|Chromium)\/(\d+)/},{family:`firefox`,pattern:/(?:Firefox|FxiOS)\/(\d+)/},{family:`safari`,pattern:/Version\/(\d+).*Safari\//}]){let r=e.match(n);if(r)return{family:t,version:r[1]}}return null}function m(){if(typeof navigator>`u`)return{};let e=navigator.userAgentData;return f(e?.brands)??p(navigator.userAgent)??{}}var h=()=>()=>{};function g(){return(0,a.useSyncExternalStore)(h,()=>o()&&!r()&&!s(),()=>!1)}function _(){return(0,a.useSyncExternalStore)(h,()=>c()&&!r()&&!n(),()=>!1)}function v(){return(0,a.useSyncExternalStore)(h,d,()=>!1)}export{d as a,v as c,c as i,u as n,g as o,o as r,_ as s,m as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./is-electron-7N7iyz1y.js";import{u as r}from"./native-biometric-B96mgKGP.js";import{t as i}from"./dist-CFSiz2ry2.js";var a=e(t(),1);function o(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent;if(/iPhone|iPod/.test(e)||/iPad/.test(e))return!0;let t=navigator.userAgentData;return(t?.platform?t.platform.toLowerCase().includes(`mac`):navigator.platform.toLowerCase().includes(`mac`))&&navigator.maxTouchPoints>1}function s(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent;return/Safari/.test(e)&&!/CriOS|FxiOS|EdgiOS|OPiOS|Chrome|Chromium/.test(e)}function c(){if(typeof navigator>`u`||o())return!1;let e=navigator.userAgentData;return e?.platform?e.platform.toLowerCase().includes(`mac`):navigator.platform.toLowerCase().includes(`mac`)}function l(){return typeof navigator>`u`?!1:/Android/i.test(navigator.userAgent)}function u(){return n()?`macos`:r()?i.getPlatform()===`android`?`android`:`ios`:o()?`ios`:l()?`android`:`web`}function d(){return r()&&i.getPlatform()===`ios`}function f(e){if(!e||e.length===0)return null;for(let{family:t,pattern:n}of[{family:`edge`,pattern:/microsoft edge/i},{family:`chrome`,pattern:/google chrome|chromium/i}]){let r=e.find(e=>n.test(e.brand));if(r){let e=r.version.match(/^\d+/)?.[0];return{family:t,...e?{version:e}:{}}}}return null}function p(e){for(let{family:t,pattern:n}of[{family:`edge`,pattern:/(?:Edg|EdgiOS|EdgA)\/(\d+)/},{family:`chrome`,pattern:/(?:Chrome|CriOS|Chromium)\/(\d+)/},{family:`firefox`,pattern:/(?:Firefox|FxiOS)\/(\d+)/},{family:`safari`,pattern:/Version\/(\d+).*Safari\//}]){let r=e.match(n);if(r)return{family:t,version:r[1]}}return null}function m(){if(typeof navigator>`u`)return{};let e=navigator.userAgentData;return f(e?.brands)??p(navigator.userAgent)??{}}var h=()=>()=>{};function g(){return(0,a.useSyncExternalStore)(h,()=>o()&&!r()&&!s(),()=>!1)}function _(){return(0,a.useSyncExternalStore)(h,()=>c()&&!r()&&!n(),()=>!1)}function v(){return(0,a.useSyncExternalStore)(h,d,()=>!1)}export{d as a,v as c,c as i,u as n,g as o,o as r,_ as s,m as t};
@@ -1 +1 @@
1
- import{t as e}from"./button-Dy5001j6.js";import{l as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./log-in-Bhye1kwc.js";import{t as i}from"./notice-DCp7WO3L.js";import{t as a}from"./use-onboarding-login-xZhWGmky.js";var o=n();function s({children:n,className:s}){let{pathname:c,search:l,hash:u}=t(),{loading:d,login:f,cancel:p}=a(`${c}${l}${u}`);return(0,o.jsx)(i,{tone:`info`,className:s,actions:(0,o.jsx)(e,{variant:`ghost`,leftIcon:d?void 0:(0,o.jsx)(r,{className:`h-4 w-4`}),onClick:d?p:()=>void f(),children:d?`Cancel`:`Log In`}),children:n})}export{s as t};
1
+ import{t as e}from"./button-Dy5001j6.js";import{l as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./log-in-Bhye1kwc.js";import{t as i}from"./notice-DCp7WO3L.js";import{t as a}from"./use-onboarding-login-X8pB53cV.js";var o=n();function s({children:n,className:s}){let{pathname:c,search:l,hash:u}=t(),{loading:d,login:f,cancel:p}=a(`${c}${l}${u}`);return(0,o.jsx)(i,{tone:`info`,className:s,actions:(0,o.jsx)(e,{variant:`ghost`,leftIcon:d?void 0:(0,o.jsx)(r,{className:`h-4 w-4`}),onClick:d?p:()=>void f(),children:d?`Cancel`:`Log In`}),children:n})}export{s as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{m as n,u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{E as a,N as o}from"./local-mode-9zpgPNoq.js";import{Z as s,n as c}from"./auth-store-w_EmIQP7.js";import{c as l}from"./api-C8TlQNEU.js";import{_ as u}from"./native-biometric-CTR2Zi2w.js";import{d}from"./routes-GmNvdtLW.js";var f=e(t(),1),p=i(),m=`vellum:loopback:state`,h=`vellum:loopback:returnTo`;function g(){let[e]=n(),t=r(),[i,g]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let n=e.get(`state`),r=e.get(`session_token`),i=sessionStorage.getItem(m),f=sessionStorage.getItem(h)||d.assistant;if(sessionStorage.removeItem(m),sessionStorage.removeItem(h),!n||n!==i){g(`Login failed: state mismatch. Please try again.`);return}if(!r){g(`Login failed: no session token received. Please try again.`);return}if(!/^[a-zA-Z0-9]+$/.test(r)){g(`Login failed: invalid session token.`);return}(async()=>{if(!await o(r)){g(`Login failed: couldn't reach the local Vellum server to store the session. Please try again.`);return}await c.getState().initSession(),await u(!0);try{let e=await l();if(e.ok&&e.data.length>0){await a(e.data,s.getState().currentOrganizationId??void 0),t(d.assistant,{replace:!0});return}}catch{}t(f,{replace:!0})})()},[e,t]),i?(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:i}),(0,p.jsx)(`button`,{type:`button`,className:`mt-4 rounded-lg border border-[var(--border-disabled)] px-4 py-2 text-sm hover:bg-[var(--surface-lift)]`,onClick:()=>void t(d.welcome),children:`Back to Welcome`})]})}):(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:`Completing login...`})})}export{g as PlatformLoopbackPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{m as n,u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{E as a,N as o}from"./local-mode-9zpgPNoq.js";import{Z as s,n as c}from"./auth-store-BwKMFgpK.js";import{c as l}from"./api-C8TlQNEU.js";import{_ as u}from"./native-biometric-B96mgKGP.js";import{d}from"./routes-GmNvdtLW.js";var f=e(t(),1),p=i(),m=`vellum:loopback:state`,h=`vellum:loopback:returnTo`;function g(){let[e]=n(),t=r(),[i,g]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let n=e.get(`state`),r=e.get(`session_token`),i=sessionStorage.getItem(m),f=sessionStorage.getItem(h)||d.assistant;if(sessionStorage.removeItem(m),sessionStorage.removeItem(h),!n||n!==i){g(`Login failed: state mismatch. Please try again.`);return}if(!r){g(`Login failed: no session token received. Please try again.`);return}if(!/^[a-zA-Z0-9]+$/.test(r)){g(`Login failed: invalid session token.`);return}(async()=>{if(!await o(r)){g(`Login failed: couldn't reach the local Vellum server to store the session. Please try again.`);return}await c.getState().initSession(),await u(!0);try{let e=await l();if(e.ok&&e.data.length>0){await a(e.data,s.getState().currentOrganizationId??void 0),t(d.assistant,{replace:!0});return}}catch{}t(f,{replace:!0})})()},[e,t]),i?(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:i}),(0,p.jsx)(`button`,{type:`button`,className:`mt-4 rounded-lg border border-[var(--border-disabled)] px-4 py-2 text-sm hover:bg-[var(--surface-lift)]`,onClick:()=>void t(d.welcome),children:`Back to Welcome`})]})}):(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:`Completing login...`})})}export{g as PlatformLoopbackPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-DXp9L4iB.js";import{t as o}from"./react-BFJW0bSv.js";import{F as s,t as c}from"./button-Dy5001j6.js";import{n as l}from"./QueryClientProvider-CMu7CkQU.js";import{t as u}from"./useQuery-Bz-fbQ-m.js";import{t as d}from"./useMutation-CXGTrp4W.js";import{t as f}from"./jsx-runtime-D3ZM-ToX.js";import{t as p}from"./cn-CJf7MmLX.js";import{t as m}from"./card-DRIctGVs.js";import{t as h}from"./chevron-down-B5A-0g8A.js";import{t as g}from"./chevron-right-HU6H84S0.js";import{t as _}from"./loader-circle-BzJ2kz3F.js";import{c as v,o as y,r as b,t as x}from"./threshold-presets-B-gOdjC4.js";import{t as S}from"./pencil-CLJIvYKH.js";import{t as C}from"./shield-check-z7CU-gBq.js";import{t as w}from"./trash-2-De6X8YiM.js";import{t as T}from"./x-DuBvjmAE.js";import{t as E}from"./notice-DCp7WO3L.js";import{t as D}from"./tag-D8NAGb0r.js";import{t as O}from"./input-C-GkeWCw.js";import{t as k}from"./toggle-D776PTw-.js";import{n as A}from"./toast-DR7D7Uma.js";import{t as j}from"./confirm-dialog-DZX6LhLy.js";import{t as M}from"./dropdown-DswWMJhz.js";import{n as N,r as P,v as F}from"./auth-store-w_EmIQP7.js";import{t as ee}from"./sdk.gen-DVW3wpbx.js";import{c as te,h as ne,i as re,n as ie,o as I,r as ae,s as oe,t as se}from"./native-biometric-CTR2Zi2w.js";import{d as ce,u as le}from"./routes-GmNvdtLW.js";import{i as L,r as ue,t as de}from"./use-platform-gate-D9hR3R0n.js";import{f as fe,p as pe}from"./prefs-B6fvTCOn.js";import{n as me,t as R}from"./react-query.gen-BVTEjHsw.js";import{a as z,c as he,n as ge,o as _e,r as B,s as ve,u as ye}from"./trust-rules-api-iUGCiDDM.js";import{t as be}from"./platform-login-notice-DIS8PWXu.js";import{t as V}from"./use-active-assistant-id-CjvzlL4t.js";import{t as H}from"./detail-card-D-5EWmAS.js";import{t as U}from"./setting-row-DEyL7IUP.js";import{t as xe}from"./settings-divider-Bf5WJ9ve.js";var W=e(o(),1),G=f(),K=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],Se=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function Ce(){let[e,t]=(0,W.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function we(){let[e,r]=(0,W.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,W.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||_e(0)}]}function Te({row:e,onToggle:t}){return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(k,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,G.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,G.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Ee(){return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function De({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=ye(),{pendingKind:o,run:s}=Ce(),[c,l]=we(),u=(0,W.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of K){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,W.useMemo)(()=>{let e=K.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=Se.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await ve(e.sourceKind):await he(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,G.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,G.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,G.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,G.jsx)(Ee,{}),`Checking permissions...`]}):(0,G.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,G.jsx)(Te,{row:e,onToggle:p},e.id))}),r&&(0,G.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Oe(){let e=L({platformHostedOnly:!0}),t=de(),n=ue(),r=l(),{data:i,isLoading:a,isError:o}=u({...R(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await ee({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{me(r,void 0,e),A.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{A.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,G.jsxs)(G.Fragment,{children:[(s.isPending||c)&&(0,G.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,G.jsx)(k,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,G.jsx)(be,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function ke(){let e=ne(),[t,n]=(0,W.useState)(()=>re()),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(`Face ID`),[s,c]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{e&&(ae().then(i),ie().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)I(!1),await se(),n(!1);else{let e=te();e&&await oe(e),I(!0),n(!0)}}finally{c(!1)}};return(0,G.jsx)(H,{title:`Security`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,G.jsx)(k,{checked:t,onChange:()=>void l(),disabled:s})]})})}var q=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function Ae(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...q]}function je(){return n(`mediaEmbedsEnabled`,!0)}function Me(){let e=i(`mediaEmbedDomains`,``);return e?Ae(e):[...q]}function Ne(){let[e,n]=(0,W.useState)(()=>je()),[i,a]=(0,W.useState)(()=>Me()),[o,s]=(0,W.useState)(!1),[l,u]=(0,W.useState)(``),d=(0,W.useMemo)(()=>l.trim().toLowerCase(),[l]),f=e=>{n(e),t(`mediaEmbedsEnabled`,e)},p=e=>{a(e),r(`mediaEmbedDomains`,JSON.stringify(e))},m=()=>{if(d){if(i.includes(d)){u(``);return}p([...i,d]),u(``)}},_=e=>{p(i.filter(t=>t!==e))},v=()=>{p([...q])},y=i.length===q.length&&i.every((e,t)=>e===q[t]);return(0,G.jsxs)(H,{title:`Media Embeds`,subtitle:`Automatically embed images, videos, and other media shared in chat messages.`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Auto Media Embeds`}),(0,G.jsx)(k,{checked:e,onChange:f})]}),e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`mt-4`,children:(0,G.jsx)(xe,{})}),(0,G.jsxs)(c,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,G.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0}):(0,G.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0}),`Video Domain Allowlist`]}),(0,G.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[i.length,` domain`,i.length===1?``:`s`]})]}),o&&(0,G.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsx)(O,{label:`Add Domain`,type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),m())},placeholder:`Add domain (e.g. example.com)`,fullWidth:!0,wrapperClassName:`flex-1`}),(0,G.jsx)(c,{variant:`primary`,size:`compact`,onClick:m,disabled:!d,children:`Add`})]}),i.length>0&&(0,G.jsx)(`div`,{className:`flex justify-end`,children:(0,G.jsx)(c,{type:`button`,variant:`ghost`,size:`compact`,onClick:v,disabled:y,tintColor:`var(--content-tertiary)`,children:`Reset to Defaults`})}),i.length>0&&(0,G.jsx)(`ul`,{className:`space-y-2`,children:i.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] px-3 py-2 text-body-medium-lighter`,children:[(0,G.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:e}),(0,G.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,G.jsx)(w,{}),onClick:()=>_(e),"aria-label":`Remove ${e}`})]},e))})]})]})]})}function J(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=x.map(e=>({value:e.id,label:e.label,icon:(0,G.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Pe(){let e=V(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>y(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[o,s]=(0,W.useState)(`conservative`),[c,d]=(0,W.useState)(`strict`),[f,p]=(0,W.useState)(!1),_=(0,W.useRef)(!1),[S,C]=(0,W.useState)(!1),w=(0,W.useRef)(null),T=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||_.current||(a(b(n.interactive).id),s(b(n.autonomous).id),d(b(n.headless).id),C(!0))},[n]),(0,W.useEffect)(()=>()=>{w.current!==null&&(clearTimeout(w.current),w.current=null,T.current?.(),T.current=null)},[]);let E=(0,W.useCallback)((n,r,i)=>{if(!e||!S)return;let a=x.find(e=>e.id===n)?.riskThreshold,o=x.find(e=>e.id===r)?.riskThreshold,s=x.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||v(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,S,t]),D=(0,W.useCallback)((e,t,n)=>{w.current!==null&&clearTimeout(w.current),T.current=()=>E(e,t,n),w.current=setTimeout(()=>{T.current?.(),w.current=null,T.current=null},500)},[E]),O=(0,W.useCallback)(e=>{_.current=!0,a(e),D(e,o,c)},[o,c,D]),k=(0,W.useCallback)(e=>{_.current=!0,s(e),D(i,e,c)},[i,c,D]),A=(0,W.useCallback)(e=>{_.current=!0,d(e),D(i,o,e)},[i,o,D]),j=x.find(e=>e.id===i),N=x.find(e=>e.id===o),P=x.find(e=>e.id===c),F=!e||!S;return(0,G.jsxs)(m,{children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:i,onChange:O,options:Y,disabled:F})}),j&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:j.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,G.jsx)(h,{className:`h-4 w-4`}):(0,G.jsx)(g,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,G.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:o,onChange:k,options:Y,disabled:F})}),N&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:N.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:c,onChange:A,options:Y,disabled:F})}),P&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:P.description})]})]})]})]})]})}var X=e(s(),1),Fe=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Ie=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Z({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(t.tool),[s,c]=(0,W.useState)(t.pattern),[l,u]=(0,W.useState)(t.risk),[d,f]=(0,W.useState)(t.description??``),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,W.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await z(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,X.createPortal)((0,G.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,W.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(T,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,G.jsx)(E,{tone:`error`,children:h}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(M,{value:a,onChange:o,disabled:!0,options:Fe.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(O,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,G.jsx)(`div`,{className:`mt-2 flex gap-2`,children:Ie.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,G.jsx)(O,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function Le(e){return e.origin===`default`&&!e.userModified}function Re(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function ze(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Be({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(!1),g=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([B(e),B(e,{origin:`default`})]);return Re(t,n)}return B(e)},[e]),_=(0,W.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,W.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[g,m]);let v=(0,W.useCallback)(async()=>{if(f)try{await ge(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,X.createPortal)((0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,W.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(k,{checked:m,onChange:h,label:`Show all defaults`}),(0,G.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(E,{tone:`error`,children:s})}),a?(0,G.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,G.jsx)(C,{className:`h-8 w-8`}),(0,G.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,G.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=Le(e);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,G.jsx)(D,{tone:ze(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,G.jsx)(D,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(D,{tone:`warning`,children:`Modified`})]}),(0,G.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(S,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(w,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,G.jsx)(Z,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,G.jsx)(j,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void v(),onCancel:()=>p(null)})]}),document.body)}function Ve(){let e=V(),[t,n]=(0,W.useState)(!1);return(0,G.jsxs)(m,{children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(C,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,G.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,G.jsx)(Be,{assistantId:e,onClose:()=>n(!1)})]})}var He=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Ue=`thirtyDays`;function $(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function We(){let e=L({platformHostedOnly:!0}),t=P(),n=t,a=N.use.user()?.id??null,[o]=fe(),[s]=pe(),c=o??!0,l=s??!0,[u,d]=(0,W.useState)(()=>i(`llmLogRetention`,Ue));return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(ke,{}),(0,G.jsx)(De,{}),(0,G.jsx)(Ve,{}),(0,G.jsx)(Pe,{}),(0,G.jsx)(Ne,{}),(0,G.jsx)(H,{title:`Privacy`,subtitle:t?(0,G.jsxs)(G.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,G.jsx)(`a`,{href:le(ce.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(U,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:c,onChange:()=>{F(`share_analytics`,!c,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{}),(0,G.jsx)(U,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{F(`share_diagnostics`,!l,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{})]}),(0,G.jsx)(Oe,{}),e!==`gated`&&(0,G.jsx)($,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:u,onChange:e=>{d(e),r(`llmLogRetention`,e)},options:He})}),(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{We as PrivacyPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-DXp9L4iB.js";import{t as o}from"./react-BFJW0bSv.js";import{F as s,t as c}from"./button-Dy5001j6.js";import{n as l}from"./QueryClientProvider-CMu7CkQU.js";import{t as u}from"./useQuery-Bz-fbQ-m.js";import{t as d}from"./useMutation-CXGTrp4W.js";import{t as f}from"./jsx-runtime-D3ZM-ToX.js";import{t as p}from"./cn-CJf7MmLX.js";import{t as m}from"./card-DRIctGVs.js";import{t as h}from"./chevron-down-B5A-0g8A.js";import{t as g}from"./chevron-right-HU6H84S0.js";import{t as _}from"./loader-circle-BzJ2kz3F.js";import{c as v,o as y,r as b,t as x}from"./threshold-presets-B-gOdjC4.js";import{t as S}from"./pencil-CLJIvYKH.js";import{t as C}from"./shield-check-z7CU-gBq.js";import{t as w}from"./trash-2-De6X8YiM.js";import{t as T}from"./x-DuBvjmAE.js";import{t as E}from"./notice-DCp7WO3L.js";import{t as D}from"./tag-D8NAGb0r.js";import{t as O}from"./input-C-GkeWCw.js";import{t as k}from"./toggle-D776PTw-.js";import{n as A}from"./toast-DR7D7Uma.js";import{t as j}from"./confirm-dialog-DZX6LhLy.js";import{t as M}from"./dropdown-DswWMJhz.js";import{n as N,r as P,v as F}from"./auth-store-BwKMFgpK.js";import{t as ee}from"./sdk.gen-DVW3wpbx.js";import{c as te,h as ne,i as re,n as ie,o as I,r as ae,s as oe,t as se}from"./native-biometric-B96mgKGP.js";import{d as ce,u as le}from"./routes-GmNvdtLW.js";import{i as L,r as ue,t as de}from"./use-platform-gate-CqEOGZtI.js";import{f as fe,p as pe}from"./prefs-B6fvTCOn.js";import{n as me,t as R}from"./react-query.gen-BVTEjHsw.js";import{a as z,c as he,n as ge,o as _e,r as B,s as ve,u as ye}from"./trust-rules-api-iUGCiDDM.js";import{t as be}from"./platform-login-notice-D-yQLWUo.js";import{t as V}from"./use-active-assistant-id-CjvzlL4t.js";import{t as H}from"./detail-card-D-5EWmAS.js";import{t as U}from"./setting-row-DEyL7IUP.js";import{t as xe}from"./settings-divider-Bf5WJ9ve.js";var W=e(o(),1),G=f(),K=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],Se=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function Ce(){let[e,t]=(0,W.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function we(){let[e,r]=(0,W.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,W.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||_e(0)}]}function Te({row:e,onToggle:t}){return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(k,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,G.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,G.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Ee(){return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function De({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=ye(),{pendingKind:o,run:s}=Ce(),[c,l]=we(),u=(0,W.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of K){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,W.useMemo)(()=>{let e=K.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=Se.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await ve(e.sourceKind):await he(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,G.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,G.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,G.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,G.jsx)(Ee,{}),`Checking permissions...`]}):(0,G.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,G.jsx)(Te,{row:e,onToggle:p},e.id))}),r&&(0,G.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Oe(){let e=L({platformHostedOnly:!0}),t=de(),n=ue(),r=l(),{data:i,isLoading:a,isError:o}=u({...R(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await ee({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{me(r,void 0,e),A.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{A.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,G.jsxs)(G.Fragment,{children:[(s.isPending||c)&&(0,G.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,G.jsx)(k,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,G.jsx)(be,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function ke(){let e=ne(),[t,n]=(0,W.useState)(()=>re()),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(`Face ID`),[s,c]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{e&&(ae().then(i),ie().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)I(!1),await se(),n(!1);else{let e=te();e&&await oe(e),I(!0),n(!0)}}finally{c(!1)}};return(0,G.jsx)(H,{title:`Security`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,G.jsx)(k,{checked:t,onChange:()=>void l(),disabled:s})]})})}var q=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function Ae(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...q]}function je(){return n(`mediaEmbedsEnabled`,!0)}function Me(){let e=i(`mediaEmbedDomains`,``);return e?Ae(e):[...q]}function Ne(){let[e,n]=(0,W.useState)(()=>je()),[i,a]=(0,W.useState)(()=>Me()),[o,s]=(0,W.useState)(!1),[l,u]=(0,W.useState)(``),d=(0,W.useMemo)(()=>l.trim().toLowerCase(),[l]),f=e=>{n(e),t(`mediaEmbedsEnabled`,e)},p=e=>{a(e),r(`mediaEmbedDomains`,JSON.stringify(e))},m=()=>{if(d){if(i.includes(d)){u(``);return}p([...i,d]),u(``)}},_=e=>{p(i.filter(t=>t!==e))},v=()=>{p([...q])},y=i.length===q.length&&i.every((e,t)=>e===q[t]);return(0,G.jsxs)(H,{title:`Media Embeds`,subtitle:`Automatically embed images, videos, and other media shared in chat messages.`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Auto Media Embeds`}),(0,G.jsx)(k,{checked:e,onChange:f})]}),e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`mt-4`,children:(0,G.jsx)(xe,{})}),(0,G.jsxs)(c,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,G.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0}):(0,G.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0}),`Video Domain Allowlist`]}),(0,G.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[i.length,` domain`,i.length===1?``:`s`]})]}),o&&(0,G.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsx)(O,{label:`Add Domain`,type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),m())},placeholder:`Add domain (e.g. example.com)`,fullWidth:!0,wrapperClassName:`flex-1`}),(0,G.jsx)(c,{variant:`primary`,size:`compact`,onClick:m,disabled:!d,children:`Add`})]}),i.length>0&&(0,G.jsx)(`div`,{className:`flex justify-end`,children:(0,G.jsx)(c,{type:`button`,variant:`ghost`,size:`compact`,onClick:v,disabled:y,tintColor:`var(--content-tertiary)`,children:`Reset to Defaults`})}),i.length>0&&(0,G.jsx)(`ul`,{className:`space-y-2`,children:i.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] px-3 py-2 text-body-medium-lighter`,children:[(0,G.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:e}),(0,G.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,G.jsx)(w,{}),onClick:()=>_(e),"aria-label":`Remove ${e}`})]},e))})]})]})]})}function J(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=x.map(e=>({value:e.id,label:e.label,icon:(0,G.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Pe(){let e=V(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>y(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[o,s]=(0,W.useState)(`conservative`),[c,d]=(0,W.useState)(`strict`),[f,p]=(0,W.useState)(!1),_=(0,W.useRef)(!1),[S,C]=(0,W.useState)(!1),w=(0,W.useRef)(null),T=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||_.current||(a(b(n.interactive).id),s(b(n.autonomous).id),d(b(n.headless).id),C(!0))},[n]),(0,W.useEffect)(()=>()=>{w.current!==null&&(clearTimeout(w.current),w.current=null,T.current?.(),T.current=null)},[]);let E=(0,W.useCallback)((n,r,i)=>{if(!e||!S)return;let a=x.find(e=>e.id===n)?.riskThreshold,o=x.find(e=>e.id===r)?.riskThreshold,s=x.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||v(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,S,t]),D=(0,W.useCallback)((e,t,n)=>{w.current!==null&&clearTimeout(w.current),T.current=()=>E(e,t,n),w.current=setTimeout(()=>{T.current?.(),w.current=null,T.current=null},500)},[E]),O=(0,W.useCallback)(e=>{_.current=!0,a(e),D(e,o,c)},[o,c,D]),k=(0,W.useCallback)(e=>{_.current=!0,s(e),D(i,e,c)},[i,c,D]),A=(0,W.useCallback)(e=>{_.current=!0,d(e),D(i,o,e)},[i,o,D]),j=x.find(e=>e.id===i),N=x.find(e=>e.id===o),P=x.find(e=>e.id===c),F=!e||!S;return(0,G.jsxs)(m,{children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:i,onChange:O,options:Y,disabled:F})}),j&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:j.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,G.jsx)(h,{className:`h-4 w-4`}):(0,G.jsx)(g,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,G.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:o,onChange:k,options:Y,disabled:F})}),N&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:N.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:c,onChange:A,options:Y,disabled:F})}),P&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:P.description})]})]})]})]})]})}var X=e(s(),1),Fe=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Ie=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Z({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(t.tool),[s,c]=(0,W.useState)(t.pattern),[l,u]=(0,W.useState)(t.risk),[d,f]=(0,W.useState)(t.description??``),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,W.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await z(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,X.createPortal)((0,G.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,W.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(T,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,G.jsx)(E,{tone:`error`,children:h}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(M,{value:a,onChange:o,disabled:!0,options:Fe.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(O,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,G.jsx)(`div`,{className:`mt-2 flex gap-2`,children:Ie.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,G.jsx)(O,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function Le(e){return e.origin===`default`&&!e.userModified}function Re(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function ze(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Be({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(!1),g=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([B(e),B(e,{origin:`default`})]);return Re(t,n)}return B(e)},[e]),_=(0,W.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,W.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[g,m]);let v=(0,W.useCallback)(async()=>{if(f)try{await ge(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,X.createPortal)((0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,W.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(k,{checked:m,onChange:h,label:`Show all defaults`}),(0,G.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(E,{tone:`error`,children:s})}),a?(0,G.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,G.jsx)(C,{className:`h-8 w-8`}),(0,G.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,G.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=Le(e);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,G.jsx)(D,{tone:ze(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,G.jsx)(D,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(D,{tone:`warning`,children:`Modified`})]}),(0,G.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(S,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(w,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,G.jsx)(Z,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,G.jsx)(j,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void v(),onCancel:()=>p(null)})]}),document.body)}function Ve(){let e=V(),[t,n]=(0,W.useState)(!1);return(0,G.jsxs)(m,{children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(C,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,G.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,G.jsx)(Be,{assistantId:e,onClose:()=>n(!1)})]})}var He=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Ue=`thirtyDays`;function $(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function We(){let e=L({platformHostedOnly:!0}),t=P(),n=t,a=N.use.user()?.id??null,[o]=fe(),[s]=pe(),c=o??!0,l=s??!0,[u,d]=(0,W.useState)(()=>i(`llmLogRetention`,Ue));return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(ke,{}),(0,G.jsx)(De,{}),(0,G.jsx)(Ve,{}),(0,G.jsx)(Pe,{}),(0,G.jsx)(Ne,{}),(0,G.jsx)(H,{title:`Privacy`,subtitle:t?(0,G.jsxs)(G.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,G.jsx)(`a`,{href:le(ce.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(U,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:c,onChange:()=>{F(`share_analytics`,!c,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{}),(0,G.jsx)(U,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{F(`share_diagnostics`,!l,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{})]}),(0,G.jsx)(Oe,{}),e!==`gated`&&(0,G.jsx)($,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:u,onChange:e=>{d(e),r(`llmLogRetention`,e)},options:He})}),(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{We as PrivacyPage};