@remit/web-client-dist 0.0.310 → 0.0.312
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/BriefPane-CyCnqfV1.js +1 -0
- package/assets/{ErrorState-DiX_zNTK.js → ErrorState-CN4Cwb5A.js} +1 -1
- package/assets/FlaggedPane-MgcE5bKj.js +1 -0
- package/assets/MailListHeader-DX7_Cewa.js +52 -0
- package/assets/MailViewChrome-9cKXCycT.js +1 -0
- package/assets/MailboxPane-Db0hba1S.js +1 -0
- package/assets/NavMenuButton-3t-xq8p6.js +1 -0
- package/assets/{OnboardingWizard-r-N3eGPg.js → OnboardingWizard-BFkNhodP.js} +1 -1
- package/assets/OutboxPane-O18gKLgX.js +1 -0
- package/assets/_mailboxId-DbcIOfsr.js +1 -0
- package/assets/{account-form-helpers-BHUowns0.js → account-form-helpers-D3tfbITU.js} +1 -1
- package/assets/accounts-J2omBETN.js +1 -0
- package/assets/advanced-Cb-Yw4fX.js +1 -0
- package/assets/appearance-BXwFGVL1.js +1 -0
- package/assets/avatar-DTwl3jb1.js +1 -0
- package/assets/bottom-sheet-Bw79dNtH.js +1 -0
- package/assets/brief-Cj9RHZn4.js +1 -0
- package/assets/brief-CrERI6Q7.js +1 -0
- package/assets/browser-ponyfill-Dfl9dHmO.js +2 -0
- package/assets/circle-check-DizPpF0Y.js +1 -0
- package/assets/circle-check-big-ChA18R4j.js +1 -0
- package/assets/circle-help-DPkDkgdF.js +1 -0
- package/assets/clock-uuvA1em-.js +1 -0
- package/assets/confirm-dialog-BTyZAw5R.js +1 -0
- package/assets/conversation-target-B0jE-e47.js +1 -0
- package/assets/{download-Bg6cLSAV.js → download-B3EpkLuL.js} +1 -1
- package/assets/enums-CCxx0t2v.js +1 -0
- package/assets/filters-Dk1yDjyQ.js +1 -0
- package/assets/{flagged-CuV2oZw_.js → flagged-CHfuc_hl.js} +1 -1
- package/assets/flagged-CZrDrTDc.js +1 -0
- package/assets/folders-B8orXsv8.js +1 -0
- package/assets/{format-CKZmh-Ru.js → format-De9HZKjg.js} +1 -1
- package/assets/index-BHkaa_C4.js +1 -0
- package/assets/index-CdMOAANs.js +1 -0
- package/assets/index-DDXDeP1_.js +1 -0
- package/assets/index-DjZFLwif.js +294 -0
- package/assets/index-O_DYWmDx.js +1 -0
- package/assets/index-lDYTJ6Ao.js +1 -0
- package/assets/intelligence-pref-C6lFpj6U.js +1 -0
- package/assets/{kbd-C00o9L4B.js → kbd-C0TyJDqO.js} +1 -1
- package/assets/labels-BzM1g0fg.js +1 -0
- package/assets/mail-oqxsK0QY.js +1 -0
- package/assets/menu-Cpsp0ZMZ.js +1 -0
- package/assets/move-options-CdaX2x7F.js +1 -0
- package/assets/onboarding-BAPCDoFw.js +1 -0
- package/assets/outbox-DQtIjp3h.js +1 -0
- package/assets/outbox-status-CPfNHfUQ.js +1 -0
- package/assets/pencil-Cm8cWZKn.js +1 -0
- package/assets/{rich-text-CoTs3nIc.js → rich-text-CGn1MSzM.js} +2 -2
- package/assets/rotate-ccw-oQ2bjkRm.js +1 -0
- package/assets/row-actions-CN3rJN24.js +1 -0
- package/assets/search-query-Cr_ZXBCp.js +1 -0
- package/assets/search-scope-CFN-gjTv.js +1 -0
- package/assets/search-token-index-CxMDhXuP.js +1 -0
- package/assets/search-view-ClRhrhjK.js +1 -0
- package/assets/senders-C-f6yU99.js +1 -0
- package/assets/settings-BbNYlJXs.js +1 -0
- package/assets/settings-screen-DBHgQU-S.js +1 -0
- package/assets/shield-check-BG5lmiwu.js +1 -0
- package/assets/{suggested-vips-BQoY6-Yl.js → suggested-vips-D0nhcuze.js} +1 -1
- package/assets/{useDebouncedValue-Ck8McJvG.js → useDebouncedValue-BFCY668u.js} +1 -1
- package/assets/useFilters-CxQU6LTN.js +1 -0
- package/assets/useLabels-DdQPlRo8.js +1 -0
- package/assets/useMediaQuery-fUhUpE77.js +1 -0
- package/assets/useRefreshControl-BsKYVbfM.js +1 -0
- package/assets/useSearchMirror-HHNbELBF.js +1 -0
- package/assets/useSearchTokenContext-D5dvdLSW.js +67 -0
- package/assets/useSignature-C6SBu3ql.js +1 -0
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/_mailboxId-DtqBFgK5.js +0 -1
- package/assets/accounts-B4-7wVt4.js +0 -1
- package/assets/advanced-Dlyjnb6l.js +0 -1
- package/assets/appearance-Drfetqy5.js +0 -1
- package/assets/avatar-Ci3CMhdo.js +0 -1
- package/assets/browser-ponyfill-BhnZT7aq.js +0 -2
- package/assets/circle-check-BM6iE_RP.js +0 -1
- package/assets/confirm-dialog-F7nDmx5t.js +0 -1
- package/assets/filters-CsWlycJW.js +0 -1
- package/assets/flagged-DtqBFgK5.js +0 -1
- package/assets/folders-Dg7RilCS.js +0 -1
- package/assets/index-BSJKHoKS.js +0 -1
- package/assets/index-DtqBFgK5.js +0 -1
- package/assets/index-dsr8I39S.js +0 -1
- package/assets/index-xOALrEh8.js +0 -294
- package/assets/labels-pEUVx_Ue.js +0 -1
- package/assets/mail-Chm12_Xz.js +0 -118
- package/assets/move-options-B2c-WWEl.js +0 -1
- package/assets/onboarding-DKy8Q5MV.js +0 -1
- package/assets/outbox-DtqBFgK5.js +0 -1
- package/assets/pencil-CZK87pI9.js +0 -1
- package/assets/senders-p6LBrcYb.js +0 -1
- package/assets/settings-C2TANSwS.js +0 -1
- package/assets/settings-screen-C7xmJsXG.js +0 -1
- package/assets/shield-check-CdES_QdC.js +0 -1
- package/assets/useFilters-DMt8Gx-P.js +0 -1
- package/assets/useLabels-oSXOt6KZ.js +0 -1
- package/assets/useSignature-BQN3IL24.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,a6 as o}from"./index-DjZFLwif.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-DjZFLwif.js";import{O as t}from"./OutboxPane-O18gKLgX.js";import"./useSearchTokenContext-D5dvdLSW.js";import"./kbd-C0TyJDqO.js";import"./enums-CCxx0t2v.js";import"./search-scope-CFN-gjTv.js";import"./circle-check-big-ChA18R4j.js";import"./clock-uuvA1em-.js";import"./row-actions-CN3rJN24.js";import"./rotate-ccw-oQ2bjkRm.js";import"./NavMenuButton-3t-xq8p6.js";import"./menu-Cpsp0ZMZ.js";import"./format-De9HZKjg.js";import"./outbox-status-CPfNHfUQ.js";import"./search-query-Cr_ZXBCp.js";function c(){return o.jsx(t.Reading,{})}export{c as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="remit:intelligence-open";function r(){try{return localStorage.getItem(e)!=="closed"}catch{return!0}}function n(t){try{localStorage.setItem(e,t?"open":"closed")}catch{}}export{r,n as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,
|
|
1
|
+
import{j as s,b as t}from"./index-DjZFLwif.js";function x({className:e,...n}){return s.jsx("kbd",{className:t("inline-flex h-4 min-w-4 items-center justify-center rounded-xs border border-line bg-surface-sunken px-1 font-sans text-2xs text-fg-muted",e),...n})}export{x as K};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as f,j as e,ak as h,aU as y,aj as b,b6 as g,B as v,T as N,o as C,w as L,W as I,ay as D,aC as S,az as w}from"./index-DjZFLwif.js";import{C as E}from"./confirm-dialog-BTyZAw5R.js";import{S as $}from"./settings-screen-DBHgQU-S.js";import{E as j}from"./ErrorState-CN4Cwb5A.js";import{a as T,b as k,c as R,u as O}from"./useLabels-DdQPlRo8.js";import"./avatar-DTwl3jb1.js";import"./menu-Cpsp0ZMZ.js";import"./circle-help-DPkDkgdF.js";function B({labels:l,onRename:i,onRecolor:n,onDelete:m,deletingLabelId:c}){const[u,r]=f.useState(),[o,d]=f.useState("");if(l.length===0)return e.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No labels yet. Create one below, then use it in a filter or apply it to mail directly."});const t=a=>{const s=o.trim();s!==""&&i(a,s),r(void 0)};return e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:l.map(a=>e.jsxs("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[u===a.labelId?e.jsx(h,{autoFocus:!0,value:o,onChange:s=>d(s.target.value),onBlur:()=>t(a.labelId),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),t(a.labelId)),s.key==="Escape"&&(s.preventDefault(),r(void 0))},"aria-label":`Rename label ${a.name}`}):e.jsx("button",{type:"button",onClick:()=>{r(a.labelId),d(a.name)},"aria-label":`Rename label ${a.name}`,className:"flex items-center gap-2 rounded-sm text-left hover:opacity-80",children:e.jsx(y,{label:a})}),e.jsx("p",{className:"mt-0.5 text-xs text-fg-subtle",children:a.filterCount===0?"Not used in any filter":`Used in ${a.filterCount} ${a.filterCount===1?"filter":"filters"}`})]}),e.jsx(b,{"aria-label":`Color for ${a.name}`,value:a.color,onChange:s=>n(a.labelId,s.target.value),className:"w-28 shrink-0",children:g.map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsx(v,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4 text-danger"}),onClick:()=>m(a),disabled:c===a.labelId,"aria-label":`Delete label ${a.name}`})]},a.labelId))})}const P=(l,i)=>{if(i===0)return{title:`Delete the "${l}" label?`};const n=i===1?"filter":"filters";return{title:`Delete the "${l}" label?`,description:`This also deletes ${i} ${n} that ${i===1?"applies":"apply"} it — they can't be recovered.`}},_=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Labels mark mail without moving it — a message can carry any number of them alongside whichever folder it lives in."}),e.jsx("p",{children:"Use a label in a filter's action to have new (and existing) mail label itself automatically, or apply one to a selection directly from the mailbox."}),e.jsx("p",{children:"Deleting a label removes it from every message, and deletes every filter that applies it — the confirmation names how many."})]});function H({accountId:l}){const{createLabel:i,isPending:n,isError:m}=O(l),[c,u]=f.useState(""),[r,o]=f.useState("Default"),d=()=>{const t=c.trim();t!==""&&i(t,r).then(()=>{u(""),o("Default")})};return e.jsxs("div",{className:"space-y-2 rounded-sm border border-line bg-surface p-3",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"New label"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Name"}),e.jsx(h,{value:c,onChange:t=>u(t.target.value),placeholder:"e.g. Receipts","aria-label":"Label name",onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),d())}})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Color"}),e.jsx(b,{value:r,onChange:t=>o(t.target.value),"aria-label":"Label color",className:"w-28",children:g.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsx(v,{variant:"primary",onClick:d,disabled:n||c.trim()==="",children:n?"Creating…":"Create label"})]}),m&&e.jsx(w,{tone:"danger",variant:"soft",children:"Couldn't create that label. Please try again."})]})}function U({account:l}){const i=l.accountId,{labels:n,isPending:m,isError:c,error:u,refetch:r}=T(i),{updateLabel:o}=k(i),{deleteLabel:d,deletingLabelId:t}=R(i),[a,s]=f.useState();return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:l.email}),m?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading labels for ${l.email}`}):c?e.jsx(j,{variant:"inline",title:`Couldn't load labels for ${l.email}`,error:u,onRetry:()=>{r()}}):e.jsx(B,{labels:n,onRename:(p,x)=>o(p,{name:x}),onRecolor:(p,x)=>o(p,{color:x}),onDelete:s,deletingLabelId:t}),e.jsx(H,{accountId:i}),a&&(()=>{const p=P(a.name,a.filterCount);return e.jsx(E,{isOpen:!0,title:p.title,description:p.description,confirmLabel:"Delete label",destructive:!0,isBusy:t===a.labelId,onConfirm:()=>{d(a.labelId),s(void 0)},onCancel:()=>s(void 0)})})()]})}function W(){const l=C(),[i,n]=f.useState(!0),{data:m,isPending:c,isError:u,error:r,refetch:o}=L(I()),d=t=>{const a=S[t];a&&l({to:a})};return e.jsx($,{items:D,activeId:"labels",title:"Labels",description:"Mark mail without moving it, per account.",help:_,helpOpen:i,onToggleHelp:()=>n(t=>!t),onSelect:d,onBackToMail:()=>{l({to:"/mail"})},children:c?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):u?e.jsx(j,{title:"Couldn't load accounts",error:r,onRetry:()=>{o()}}):m.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:m.accounts.map(t=>e.jsx(U,{account:t},t.accountId))})})}export{W as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as L,r as i,u as Le,j as e,S as Fe,a as pe,b as I,C as ee,d as te,e as Te,f as ge,F as De,g as Be,X as be,T as _e,O as Ke,M as Ve,A as qe,h as Qe,I as He,i as ve,B as D,k as U,l as ye,m as $e,n as je,o as Y,p as Se,q as Ne,s as We,t as G,v as J,w as Ce,x as Ue,y as Ye,z as Ge,D as $,E as Je,G as Xe,H as Ze,J as et,K as tt,L as st,N as at,P as nt,Q as rt,R as ot,U as it,V as lt,W as ct,Y as ut,Z as dt,_ as mt}from"./index-DjZFLwif.js";import{B as xt,S as ht,D as ft,a as pt,b as gt,u as bt,s as vt,N as P,K as yt,c as jt,d as St,e as Nt,f as Ct,g as kt,i as wt}from"./search-token-index-CxMDhXuP.js";import{u as se,m as It}from"./search-scope-CFN-gjTv.js";import{P as Mt}from"./pencil-Cm8cWZKn.js";import{M as Et,s as Ot,c as Rt}from"./search-view-ClRhrhjK.js";import{u as At,a as Pt,R as zt,M as Lt}from"./useRefreshControl-BsKYVbfM.js";import{M as Ft}from"./menu-Cpsp0ZMZ.js";import{A as Tt}from"./avatar-DTwl3jb1.js";import{i as Dt}from"./outbox-status-CPfNHfUQ.js";import{E as Bt}from"./ErrorState-CN4Cwb5A.js";import{K as ae}from"./kbd-C0TyJDqO.js";import{u as _t}from"./useDebouncedValue-BFCY668u.js";import{w as ne}from"./intelligence-pref-C6lFpj6U.js";import"./useMediaQuery-fUhUpE77.js";import"./circle-check-big-ChA18R4j.js";const Kt=L("BookmarkPlus",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}],["line",{x1:"12",x2:"12",y1:"7",y2:"13",key:"1cppfj"}],["line",{x1:"15",x2:"9",y1:"10",y2:"10",key:"1gty7f"}]]);const ke=L("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);const we=L("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);const Ie=L("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Vt=L("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),qt="button:not([disabled]), a[href]",O="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function Qt({active:t,dimmed:s,indent:a}){return I("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",O,a&&"pl-7",t?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg",s&&"opacity-55")}function Ht({icon:t,label:s,count:a,active:n}){return e.jsxs(e.Fragment,{children:[t&&e.jsx("span",{className:I("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:t}),e.jsx("span",{className:"flex-1 truncate",children:s}),a!=null&&a>0&&e.jsx("span",{className:I("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function z({icon:t,label:s,count:a,active:n,dimmed:r,indent:o,navId:l,linkComponent:m,ariaLabel:x,title:p,onClick:b}){const u=Qt({active:n,dimmed:r,indent:o}),h=e.jsx(Ht,{icon:t,label:s,count:a,active:n});return l&&m?m({navId:l,className:u,ariaLabel:x??s,title:p,onClick:b,children:h}):e.jsx("button",{type:"button",onClick:b,className:u,"aria-label":x,title:p,children:h})}const re={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function $t(t){switch(t){case"inbox":return e.jsx(He,{className:"size-4"});case"flagged":return e.jsx(pe,{className:"size-4"});case"drafts":return e.jsx(Qe,{className:"size-4"});case"sent":return e.jsx(ge,{className:"size-4"});case"archive":return e.jsx(qe,{className:"size-4"});case"all":return e.jsx(Ve,{className:"size-4"});case"junk":return e.jsx(Ke,{className:"size-4"});case"trash":return e.jsx(_e,{className:"size-4"})}}const oe=t=>t.role!=null,H=8,ie="remit.nav.folders.open.",le="remit.nav.account.open.";function ce(t,s,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(t+s);return n===null?a:n!=="0"}function ue(t,s,a){typeof localStorage>"u"||localStorage.setItem(t+s,a?"1":"0")}function Wt({query:t,onSelect:s,onRemove:a}){return e.jsxs("div",{className:"group flex w-full items-center gap-1 rounded-md pr-1 hover:bg-surface",children:[e.jsxs("button",{type:"button",onClick:s,className:I("flex min-w-0 flex-1 items-center gap-2 px-2 py-1 text-left text-sm text-fg-muted transition-colors hover:text-fg",O),children:[e.jsx(Be,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:t})]}),a&&e.jsx("button",{type:"button",onClick:a,"aria-label":`Remove saved search: ${t}`,className:I("shrink-0 rounded-full p-1 text-fg-subtle opacity-0 transition-opacity hover:bg-surface-sunken hover:text-fg group-hover:opacity-100 focus-visible:opacity-100",O),children:e.jsx(be,{className:"size-3.5"})})]})}function Ut({savedSearches:t,saveableQuery:s,onSelectSavedSearch:a,onRemoveSavedSearch:n,onSaveCurrentSearch:r}){return t.length===0&&!s?null:e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"px-2 pb-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Saved searches"}),s&&e.jsxs("button",{type:"button",onClick:r,className:I("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-accent transition-colors hover:bg-surface",O),children:[e.jsx(Kt,{className:"size-4 shrink-0"}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Save “",s,"”"]})]}),t.map(o=>e.jsx(Wt,{query:o,onSelect:()=>a?.(o),onRemove:n?()=>n(o):void 0},o))]})}function Yt({account:t,selectedNavId:s,onSelectNav:a,linkComponent:n}){const[r,o]=i.useState(()=>ce(le,t.id,!0)),[l,m]=i.useState(()=>ce(ie,t.id,!0)),[x,p]=i.useState(!1),b=()=>{o(c=>{const y=!c;return ue(le,t.id,y),y})},u=()=>{m(c=>{const y=!c;return ue(ie,t.id,y),y})},h=t.mailboxes.filter(oe).sort((c,y)=>re[c.role]-re[y.role]),f=t.mailboxes.filter(c=>!oe(c)),v=x||f.length<=H?f:f.slice(0,H),k=f.length-v.length,g=t.status??"ready",R=g==="ready"&&h.length===0&&f.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:b,"aria-expanded":r,className:I("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",O,t.muted&&"opacity-55"),children:[r?e.jsx(ee,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(te,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:t.label}),t.muted&&e.jsxs(e.Fragment,{children:[e.jsx(xt,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]})]}),r&&e.jsxs(e.Fragment,{children:[g==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),g==="error"&&e.jsxs("div",{role:"alert",className:"mx-2 my-1 flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-2 py-1.5 text-sm",children:[e.jsx(Te,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load mailboxes"})}),t.onRetry&&e.jsx("button",{type:"button",onClick:t.onRetry,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}),R&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),g==="ready"&&e.jsxs(e.Fragment,{children:[h.map(c=>e.jsx(z,{navId:c.id,linkComponent:n,icon:$t(c.role),label:c.name,ariaLabel:c.name,title:c.fullPath??c.name,count:c.unseen,active:s===c.id,dimmed:t.muted,onClick:()=>a?.(c.id)},c.id)),t.outboxPending!==void 0&&e.jsx(z,{navId:"outbox",linkComponent:n,icon:e.jsx(ge,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:t.outboxPending>0?t.outboxPending:void 0,active:s==="outbox",dimmed:t.muted,onClick:()=>a?.("outbox")}),f.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:u,"aria-expanded":l,className:I("mt-1 flex w-full items-center gap-1 px-2 py-1 text-left text-2xs font-semibold uppercase tracking-wider text-fg-subtle transition-colors hover:text-fg",O),children:[l?e.jsx(ee,{className:"size-3 shrink-0"}):e.jsx(te,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:f.length})]}),l&&e.jsxs(e.Fragment,{children:[v.map(c=>e.jsx(z,{navId:c.id,linkComponent:n,icon:e.jsx(De,{className:"size-4"}),label:c.name,ariaLabel:c.name,title:c.fullPath??c.name,count:c.unseen,active:s===c.id,dimmed:t.muted,onClick:()=>a?.(c.id)},c.id)),(k>0||x)&&f.length>H&&e.jsx("button",{type:"button",onClick:()=>p(c=>!c),className:I("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",O),children:x?"Show less":`Show all (${f.length})`})]})]})]})]})]})}function Gt({accounts:t,selectedNavId:s,briefUnseen:a,onSelectNav:n,variant:r="desktop",linkComponent:o,savedSearches:l=[],saveableQuery:m,onSelectSavedSearch:x,onRemoveSavedSearch:p,onSaveCurrentSearch:b}){const u=i.useRef(null);Le({containerRef:u,itemSelector:qt});const h=r==="drawer",f=e.jsxs("nav",{ref:h?u:void 0,className:h?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(z,{navId:"brief",linkComponent:o,icon:e.jsx(Fe,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:s==="brief",onClick:()=>n?.("brief")}),e.jsx(z,{navId:"flagged",linkComponent:o,icon:e.jsx(pe,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:s==="flagged",onClick:()=>n?.("flagged")}),e.jsx(Ut,{savedSearches:l,saveableQuery:m,onSelectSavedSearch:x,onRemoveSavedSearch:p,onSaveCurrentSearch:b}),t.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-fg-muted",children:"No accounts configured"}):t.map(v=>e.jsx(Yt,{account:v,selectedNavId:s,onSelectNav:n,linkComponent:o},v.id))]});return h?f:e.jsx("aside",{ref:u,className:"flex h-full w-full flex-col bg-surface-sunken",children:f})}function Jt({leading:t,search:s,actions:a,className:n}){return e.jsxs("header",{className:I("flex min-h-pane-header w-full shrink-0 items-center gap-2 border-b border-line bg-canvas px-row-inset py-1",n),children:[t&&e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:t}),e.jsx("div",{className:"flex min-w-0 flex-1 justify-start",children:e.jsx("div",{className:"w-full max-w-xs transition-[max-width] duration-150 ease-out focus-within:max-w-lg",children:s})}),a&&e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:a})]})}function Xt(){const t=ve();if(!t)return null;const s=t.showNavPane?!t.navCollapsed:!1;return e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(Ft,{className:"size-4"}),onClick:t.toggleNav,"aria-label":s?"Hide folders":"Show folders","aria-expanded":s,title:"Folders",className:"shrink-0"})}const Zt={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function es({search:t,onCompose:s,onReportBug:a,onOpenSettings:n,composeShortcut:r,refreshControl:o,account:l}){return e.jsx(Jt,{leading:e.jsx(Xt,{}),search:e.jsx(ht,{value:t.value,onChange:t.onChange,onClear:t.onClear,onClearQuery:t.onClearQuery,chips:t.chips,onRemoveChip:t.onRemoveChip,placeholder:Zt[t.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(Vt,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:s}),e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(ke,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(Ie,{className:"size-4"}),title:"Settings","aria-label":"Settings",onClick:n}),o,l]})})}const ts=()=>{const{state:t,openCompose:s}=U(),a=ye(),n=i.useCallback(()=>{s({mode:"new"})},[s]),o=!!a.search?.selectedMessageId;return!a.pathname.startsWith("/mail")||t.isOpen||o?null:e.jsx("button",{type:"button",onClick:n,"aria-label":"Compose new message",className:"lg:hidden fixed right-4 z-30 h-14 w-14 rounded-full bg-accent text-accent-fg shadow-lg flex items-center justify-center hover:opacity-90 active:scale-95 transition-all",style:{bottom:"calc(env(safe-area-inset-bottom, 0) + 1rem)"},children:e.jsx(Mt,{className:"size-6"})})},Me=({children:t})=>{const{Account:s}=$e();return e.jsx(s,{children:t})},ss=({email:t,onSignOut:s})=>{const a=t??"Account";return e.jsxs(ft,{trigger:e.jsx(Tt,{name:a,email:t??void 0,size:"sm"}),align:"right",children:[t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-2 text-xs text-fg-muted truncate",title:t,"data-testid":"account-menu-email",children:t}),e.jsx(pt,{})]}),e.jsxs(gt,{onClick:s,children:[e.jsx(we,{className:"size-4"}),"Sign out"]})]})},as=()=>e.jsx(Me,{children:({email:t,signOut:s})=>e.jsx(ss,{email:t,onSignOut:s})});function ns({accounts:t}){const{searchInput:s,onSearchChange:a,onSearchClear:n,onSearchClearQuery:r}=je(),o=Y(),{openCompose:l}=U(),m=i.useCallback(()=>{l({mode:"new"})},[l]),{scope:x,clearScope:p}=bt(t),b=x.kind==="scoped"?[{id:x.chip.id,label:x.chip.label,tone:"scope"}]:void 0,u=i.useMemo(()=>t.map(g=>g.accountId),[t]),{hasNewMail:h}=At(),{state:f,errorMessage:v,refresh:k}=Pt(u);return e.jsx(es,{search:{value:s,scope:x.kind,chips:b,onChange:a,onClear:n,onClearQuery:r,onRemoveChip:p},onCompose:m,onReportBug:Se,onOpenSettings:()=>o({to:"/settings/accounts"}),composeShortcut:vt("compose"),refreshControl:e.jsx(zt,{state:f,onRefresh:k,label:"Refresh all accounts",errorMessage:v,hasUpdate:h(u)}),account:e.jsx(as,{})})}const X="remit.savedSearches",rs=25;function _(){try{const t=localStorage.getItem(X);if(!t)return[];const s=JSON.parse(t);return Array.isArray(s)?s.filter(a=>typeof a=="string"):[]}catch{return[]}}function os(t){const s=t.trim();if(!s)return _();const a=[s,..._().filter(n=>n!==s)].slice(0,rs);try{localStorage.setItem(X,JSON.stringify(a))}catch{return a}return a}function is(t){const s=_().filter(a=>a!==t);try{localStorage.setItem(X,JSON.stringify(s))}catch{return s}return s}const de=t=>/^\d/.test(t),ls=(t,s)=>{const a=de(t),n=de(s);return a&&!n?-1:!a&&n?1:t.localeCompare(s,void 0,{sensitivity:"base",numeric:!0})};function cs(t,s,a){const n=[],r=[];for(const o of t)s.has(o.mailboxId)?n.push(o):r.push(o);return r.sort((o,l)=>ls($(o,void 0,a),$(l,void 0,a))),{system:n,labels:r}}function us(t,s,a){const n=Je(s)&&t.unseenCount>0;return{id:t.mailboxId,name:$(t,s,a),unseen:n?t.unseenCount:void 0,role:s,fullPath:t.fullPath}}function ds(){const t=ye(),s=Ge({strict:!1});return t.pathname.startsWith("/settings")?"settings":t.pathname.startsWith("/mail/outbox")?"outbox":t.pathname.startsWith("/mail/flagged")?"flagged":t.pathname.startsWith("/mail/brief")?"brief":s.mailboxId?s.mailboxId:""}function me({accounts:t,onMailboxSelect:s,variant:a="desktop"}){const n=Ne(),r=Y(),o=ds(),{searchInput:l,onSearchChange:m}=je(),[x,p]=i.useState(_),{t:b}=We("mail",{useSuspense:!1}),u=i.useCallback((d,S)=>b(d,{defaultValue:S}),[b]),h=G({queries:t.map(d=>({...J({path:{accountId:d.accountId}}),staleTime:1/0}))}),{data:f}=Ce(Ue()),v=i.useMemo(()=>(f?.items??[]).filter(d=>Dt(d.status)).length,[f?.items]),k=i.useMemo(()=>t.map((d,S)=>{const N=h[S],M=N?.data?.items??[],w=Ye(d.folderAppointments),{system:E,labels:Q}=cs(M,w,u),C=N?.isError?"error":N?.isLoading?"loading":"ready";return{id:d.accountId,label:d.email,email:d.email,muted:!!d.muted,outboxPending:v,status:C,onRetry:()=>N?.refetch(),mailboxes:[...E,...Q].map(F=>us(F,w.get(F.mailboxId),u))}}),[t,h,v,u]),g=d=>{n.invalidateQueries({queryKey:Xe({path:{mailboxId:d},query:{order:"desc"}})})},R=({navId:d,className:S,ariaLabel:N,title:M,children:w,onClick:E})=>d==="brief"?e.jsx(P,{to:"/mail/brief",search:{q:void 0,selectedMessageId:void 0},activeOptions:{includeSearch:!1},onClick:()=>E?.(),className:S,"aria-label":N,title:M,children:w}):d==="outbox"?e.jsx(P,{to:"/mail/outbox",search:{q:void 0,selectedOutboxMessageId:void 0},onClick:()=>E?.(),className:S,"aria-label":N,title:M,children:w}):d==="flagged"?e.jsx(P,{to:"/mail/flagged",search:{q:void 0,selectedMessageId:void 0},onClick:()=>E?.(),className:S,"aria-label":N,title:M,children:w}):d==="settings"?e.jsx(P,{to:"/settings/accounts",onClick:()=>E?.(),className:S,"aria-label":N,title:M,children:w}):e.jsx(P,{to:"/mail/$mailboxId",params:{mailboxId:d},search:{q:void 0,selectedMessageId:void 0},onClick:()=>{g(d),E?.()},className:S,"aria-label":N,title:M,children:w}),c=()=>{m(""),s?.()},y=l.trim(),A=y.length>0&&!x.includes(y)?y:void 0,K=i.useCallback(()=>{A&&p(os(A))},[A]),V=i.useCallback(d=>{p(is(d))},[]),q=i.useCallback(d=>{m(d),r({to:"/mail/brief",search:{q:d,selectedMessageId:void 0}}),s?.()},[m,r,s]);return e.jsx(Gt,{accounts:k,selectedNavId:o,onSelectNav:c,linkComponent:R,variant:a,savedSearches:x,saveableQuery:A,onSaveCurrentSearch:K,onSelectSavedSearch:q,onRemoveSavedSearch:V})}function ms(){return e.jsxs("button",{type:"button",onClick:Se,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg",children:[e.jsx(ke,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}function xs({accounts:t,onMailboxSelect:s}){return ve()?.showNavPane??!0?e.jsx(me,{accounts:t}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(me,{accounts:t,onMailboxSelect:s,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(P,{to:"/settings/accounts",onClick:s,children:[e.jsx(Ie,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(ms,{}),e.jsx(Me,{children:({signOut:r})=>e.jsxs("button",{type:"button",onClick:()=>{s?.(),r()},className:"flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg","data-testid":"sign-out-button",children:[e.jsx(we,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}const hs=({isOpen:t,onClose:s})=>{const a=i.useCallback(n=>{n.key==="Escape"&&(n.preventDefault(),s())},[s]);return i.useEffect(()=>{if(t)return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,a]),t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Ze,{label:"Dismiss keyboard shortcuts",onDismiss:s,className:"backdrop-blur-sm"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",className:et("relative z-10 max-h-[85vh] w-full max-w-2xl overflow-y-auto","rounded-lg border border-line bg-surface shadow-lg","p-6"),children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Keyboard shortcuts"}),e.jsx("button",{type:"button",onClick:s,className:"p-1 text-fg-muted transition-colors hover:text-fg","aria-label":"Close",children:e.jsx(be,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:yt.map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-sm font-medium text-fg-muted",children:n.title}),e.jsx("div",{className:"space-y-2",children:n.hints.map(r=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm",children:r.description}),e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:r.keys.map((o,l)=>e.jsxs(i.Fragment,{children:[l>0&&r.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(ae,{children:o})]},o))})]},`${r.action}-${r.keys.join("+")}`))})]},n.title))}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsxs("p",{className:"text-center text-xs text-fg-muted",children:["Press ",e.jsx(ae,{children:"Esc"})," to close"]})})]})]}):null};function fs(t){const s=G({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0}))});return i.useMemo(()=>jt(s.map(a=>a.data?.items??[])),[s])}const ps=t=>t.map(s=>s.data?.items??[]);function gs(t){const s=G({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0})),combine:ps});return i.useMemo(()=>tt(t.map((a,n)=>({folderAppointments:a.folderAppointments,mailboxes:s[n]??[]}))),[t,s])}var T={exports:{}},xe;function bs(){if(xe)return T.exports;xe=1;const t=(s,a,n)=>new Promise((r,o)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:l}=n;if(!(typeof l=="number"&&l>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${l}\` (${typeof l})`);const m=[],x=s[Symbol.iterator]();let p=!1,b=!1,u=0,h=0;const f=()=>{if(p)return;const v=x.next(),k=h;if(h++,v.done){b=!0,u===0&&r(m);return}u++,Promise.resolve(v.value).then(g=>a(g,k)).then(g=>{m[k]=g,u--,f()},g=>{p=!0,o(g)})};for(let v=0;v<l&&(f(),!b);v++);});return T.exports=t,T.exports.default=t,T.exports}var vs=bs();const ys=st(vs),js=900*1e3,Ss=300,Ns=(t,s)=>{if(!t)return s;const a=Number.parseInt(t,10);return Number.isFinite(a)&&a>0?a:s},Cs=60*1e3,ks=t=>Math.max(Ns(t,Ss)*1e3,Cs),B=ks(it().mailboxPollIntervalSeconds),ws=5,W=new Set,Is=(t,s,a=js)=>t.filter(n=>{const r=n.lastSyncAt;return r==null?!0:s-r>a}).map(n=>n.accountId),Ms=(t,s,a=B)=>t-s>=a,Es=(t,s)=>t.filter(a=>!s.has(a)),he=(t,s)=>{if(W.delete(t),rt(s,{softError:!0})){ot(s);return}console.warn("[remit] background mailbox sync failed",{accountId:t,error:s})},fe=(t,s)=>at({path:{accountId:t},throwOnError:!0}).then(()=>{s.invalidateQueries({queryKey:nt({path:{accountId:t}})})}),Os=t=>{const s=Ne(),a=i.useRef(t);a.current=t;const n=t.map(r=>r.accountId).join(",");i.useEffect(()=>{const r=Date.now(),l=Is(a.current,r).filter(m=>!W.has(m));if(l.length!==0)for(const m of l)W.add(m),fe(m,s).catch(x=>{he(m,x)})},[n,s]),i.useEffect(()=>{let r=Date.now(),o;const l=new Set,m=()=>{r=Date.now();const b=Es(a.current.map(u=>u.accountId),l);for(const u of b)l.add(u);ys(b,u=>fe(u,s).catch(h=>{he(u,h)}).finally(()=>{l.delete(u)}),{concurrency:ws})},x=()=>{if(document.visibilityState==="visible"){m(),o=setTimeout(x,B);return}},p=()=>{document.visibilityState==="visible"&&Ms(Date.now(),r)&&(o!==void 0&&clearTimeout(o),m(),o=setTimeout(x,B))};return o=setTimeout(x,B),document.addEventListener("visibilitychange",p),()=>{o!==void 0&&clearTimeout(o),document.removeEventListener("visibilitychange",p)}},[n,s])};function $s(){const{q:t=""}=lt({from:"/mail"}),s=Y(),a=St(),n=wt(a),[r,o]=i.useState(!1),[l,m]=i.useState(!1),[x,p]=i.useState(!1),b=i.useCallback(j=>{p(j),ne(j)},[]),[u,h]=i.useState(t),f=_t(u,200),v=Rt(u,f),k=se({select:j=>j.location.pathname}),g=se({select:j=>It(j.matches)}),[R,c]=i.useState(g);if(R!==g){const j=Ot(R,g,t);c(g),j!==void 0&&h(j)}const{data:y,isLoading:A,isError:K,error:V,refetch:q}=Ce({...ct(),staleTime:1/0}),d=!!(y&&(y.accounts?.length??0)===0);i.useEffect(()=>{d&&s({to:"/onboarding",replace:!0})},[d,s]),Nt({enabled:!r,bindings:[{key:"?",handler:()=>o(!0),noModifiers:!1,preventDefault:!0}]});const{openCompose:S}=U(),N=i.useMemo(()=>({compose:()=>S({mode:"new"})}),[S]);Ct({enabled:!ut(k),handlers:N});const M=i.useCallback(j=>{h(j)},[]),w=i.useCallback(()=>{h("")},[]),E=i.useCallback(()=>{h("")},[]),Q=i.useCallback(()=>{p(j=>{const Z=!j;return ne(Z),Z})},[]),C=y?.accounts??[],F=i.useMemo(()=>C.map(j=>j.accountId),[C]),Ee=fs(C),Oe=gs(C),Re=i.useMemo(()=>kt(C),[C]);Os(C);const Ae=i.useCallback(()=>{m(!1)},[]),Pe={accounts:C,mailboxNameIndex:Ee,accountNameIndex:Re,resultFolderIndex:Oe,searchQuery:v,searchInput:u,searchViewKey:g,onSearchChange:M,onSearchClear:w,onSearchClearQuery:E,intelligenceOpen:x,onToggleIntelligence:Q,onSetIntelligenceOpen:b},ze={isSinglePane:n,isLoading:A||d,intelligenceOpen:x,nav:e.jsx(xs,{accounts:C,onMailboxSelect:Ae}),topBar:n?void 0:e.jsx(ns,{accounts:C}),overlay:n?e.jsx(ts,{}):void 0,navOpen:l,onOpenNav:()=>m(!0),onCloseNav:()=>m(!1)};return e.jsx(dt.Provider,{value:Pe,children:e.jsxs(Lt,{accountIds:F,children:[K?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(Bt,{title:"Couldn't load your account",error:V,onRetry:()=>{q()}})}):e.jsx(Et,{chrome:ze,children:e.jsx(mt,{})}),e.jsx(hs,{isOpen:r,onClose:()=>o(!1)})]})})}export{$s as component,je as useMailContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./index-DjZFLwif.js";const n=e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);export{n as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as g,w as C,v as w,ae as L,P as _,cV as D,r as b,cm as x,s as A,y as E,cW as p,D as N}from"./index-DjZFLwif.js";import{a as I}from"./enums-CCxx0t2v.js";const F=3e4,R=1e3,$="The folder couldn't be created on the mail server. Please try again.",B="The folder was created but the mail server hasn't confirmed it yet, so nothing was attached to it. It's in your folder list — try again in a moment.",k=(e,t)=>new Promise((a,o)=>{if(t?.aborted){o(t.reason);return}const n=setTimeout(()=>{t?.removeEventListener("abort",r),a()},e),r=()=>{clearTimeout(n),o(t?.reason)};t?.addEventListener("abort",r,{once:!0})});async function Y({fetchMailboxes:e,mailboxId:t,signal:a,timeoutMs:o=F,pollIntervalMs:n=R,delay:r=k,now:l=Date.now}){const s=l()+o;for(;;){a?.throwIfAborted();const c=(await e()).find(u=>u.mailboxId===t);if(c?.syncStatus===I.synced)return c;if(c?.syncStatus===I.failed)throw new Error($);if(l()>=s)throw new Error(B);await r(n,a)}}function S(e,t){const a=e.trim();return t?`${t.fullPath}${t.hierarchyDelimiter}${a}`:a}const P=(e,t)=>{const a=e.split(t);return a[0]?.toLowerCase()==="inbox"&&(a[0]="INBOX"),a.join(t)};function X({name:e,delimiter:t,parent:a,existingPaths:o}){const n=e.trim();if(n==="")return"Enter a folder name.";if(n.includes(t))return`A folder name can't contain "${t}".`;const r=P(S(n,a),t);if(o.some(s=>P(s,t)===r))return"A folder with that name already exists."}function j(e){const t=g(),{data:a}=C({...w({path:{accountId:e??""}}),enabled:!!e}),o=L({...D(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:_({path:{accountId:e}})})}}),n=b.useRef(new Map),r=b.useCallback(async(s,i,c)=>{if(!e)throw new Error("No account to create the folder in. Pick messages from a single account first.");const u=a?.items??[],d=i?u.find(h=>h.fullPath===i):void 0;if(i&&!d)throw new Error(`Couldn't find the folder "${i}" to create this one inside.`);const y=d?{fullPath:d.fullPath,hierarchyDelimiter:d.hierarchyDelimiter}:void 0,f=S(s,y);let m=n.current.get(f);if(!m){const h=y?.hierarchyDelimiter??u[0]?.hierarchyDelimiter??"/",v=X({name:s,delimiter:h,parent:y,existingPaths:u.map(T=>T.fullPath)});if(v)throw new Error(v);m=(await o.mutateAsync({path:{accountId:e},body:{fullPath:f,namespaceType:"personal"}})).mailboxId,n.current.set(f,m)}const M=await Y({mailboxId:m,signal:c,fetchMailboxes:async()=>(await t.fetchQuery({...w({path:{accountId:e}}),staleTime:0})).items??[]});return n.current.delete(f),{id:M.mailboxId,label:x(M.fullPath),path:M.fullPath}},[o,e,a,t]);return{createFolder:b.useCallback((s,i)=>r(s,"",i),[r]),createFolderIn:r,mutation:o}}const J=()=>{const{t:e}=A("mail",{useSuspense:!1});return b.useCallback((t,a)=>e(t,{defaultValue:a}),[e])},ee=100,Q=e=>e.trim().toLowerCase()==="inbox",z=(e,t)=>{const a=`${e.fullPath}${e.hierarchyDelimiter}`;return t.some(o=>o.mailboxId!==e.mailboxId&&o.fullPath.startsWith(a))},V=(e,t)=>t.find(a=>a.mailboxId!=null&&a.mailboxId===e)?.role;function te(e,t,a){if(Q(e.fullPath))return{deletable:!1,reason:"inbox",message:"The inbox can't be deleted."};const o=V(e.mailboxId,a);return o?{deletable:!1,reason:"role",message:`This folder is your ${o} folder. Reassign that role before deleting it.`}:z(e,t)?{deletable:!1,reason:"children",message:"This folder has subfolders. Delete them first."}:{deletable:!0}}function q(e,t){return e.filter(a=>a.mailboxId!==t)}function ae(e){return{total:e,moved:0,phase:e===0?"moved":"moving"}}function oe(e,t){if(e.phase!=="moving")return e;const a=Math.min(e.total,e.moved+Math.max(0,t));return{...e,moved:a,phase:a>=e.total?"moved":"moving"}}function ne(e,t){return{...e,phase:"failed",error:t}}function re(e){return`Moved ${e.moved} of ${e.total}`}function ie(e){return e>0?"choose-fate":"confirm-empty"}const U=new Set(["outbox","postvak uit","boîte d'envoi","postausgang","buzón de salida","posta in uscita","送信トレイ","送件匣","发件箱","skrzynka nadawcza"]),G=e=>{const t=x(e.fullPath).trim().toLowerCase();return U.has(t)},O=p.length,K=(e,t)=>{const a=E(t);return[...e.filter(n=>{const r=a.get(n.mailboxId);return r==="drafts"||r==="sent"?!1:!G(n)})].sort((n,r)=>{const l=a.has(n.mailboxId)?p.indexOf(a.get(n.mailboxId)??"inbox"):O,s=a.has(r.mailboxId)?p.indexOf(a.get(r.mailboxId)??"inbox"):O;return l!==s?l-s:x(n.fullPath).localeCompare(x(r.fullPath),void 0,{sensitivity:"base",numeric:!0})})},se=e=>e[0]?.hierarchyDelimiter??"/",le=({mailboxes:e,folderAppointments:t,currentMailboxId:a,excludeMailboxId:o,translator:n})=>{const r=K(e,t),l=E(t);return(o?q(r,o):r).map(i=>({id:i.mailboxId,label:N(i,l.get(i.mailboxId),n),path:i.fullPath,isCurrent:i.mailboxId===a}))};export{ee as M,J as a,le as b,ae as c,ne as d,oe as e,se as f,te as g,ie as i,re as m,j as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as t,a0 as r,q as a,r as i,j as s}from"./index-DjZFLwif.js";import{O as c}from"./OnboardingWizard-BFkNhodP.js";import"./kbd-C0TyJDqO.js";import"./account-form-helpers-D3tfbITU.js";async function l(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:t()}),e.navigateToInbox()}function y(){const e=r(),o=a(),n=i.useCallback(m=>{l({queryClient:o,recordCompleted:()=>e.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[e,o]);return s.jsx(c,{skipWelcome:!1,onComplete:n})}export{y as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o,_ as r}from"./index-DjZFLwif.js";import{a as i}from"./search-view-ClRhrhjK.js";import{O as t}from"./OutboxPane-O18gKLgX.js";import{u as m}from"./useSearchMirror-HHNbELBF.js";import"./search-scope-CFN-gjTv.js";import"./useSearchTokenContext-D5dvdLSW.js";import"./kbd-C0TyJDqO.js";import"./enums-CCxx0t2v.js";import"./circle-check-big-ChA18R4j.js";import"./clock-uuvA1em-.js";import"./row-actions-CN3rJN24.js";import"./rotate-ccw-oQ2bjkRm.js";import"./NavMenuButton-3t-xq8p6.js";import"./menu-Cpsp0ZMZ.js";import"./format-De9HZKjg.js";import"./outbox-status-CPfNHfUQ.js";import"./search-query-Cr_ZXBCp.js";function P(){return m({to:"/mail/outbox"}),o.jsx(t,{children:o.jsx(i,{phone:o.jsx(t.Phone,{}),list:o.jsx(t.List,{}),reading:o.jsx(r,{})})})}export{P as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=e=>e==="failed"||e==="blocked",s=e=>e!=="draft"&&e!=="sent";export{o as a,s as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a}from"./index-DjZFLwif.js";const c=a("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);export{c as P};
|