@remit/web-client-dist 0.0.474 → 0.0.476

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 (112) hide show
  1. package/assets/{BriefPane-BDKoZmjl.js → BriefPane-3Fat9VjO.js} +1 -1
  2. package/assets/{ErrorState-CM5cyHBP.js → ErrorState-BYuE95Js.js} +1 -1
  3. package/assets/{FlaggedPane-Ca7Issou.js → FlaggedPane-31OEGzFO.js} +1 -1
  4. package/assets/{FullCompose-CnZFnDBx.js → FullCompose-CoKL7tvs.js} +1 -1
  5. package/assets/MailListHeader-9z9s1SFe.js +7 -0
  6. package/assets/{MailShell-EwdoAJX9.js → MailShell-B8nH8_Jn.js} +1 -1
  7. package/assets/{MailViewChrome-nv3QbQYk.js → MailViewChrome-BcHZgYOJ.js} +1 -1
  8. package/assets/{MailboxPane-D0NZgFZ7.js → MailboxPane-BnAt5Ump.js} +1 -1
  9. package/assets/{NavMenuButton-9eFSbzjS.js → NavMenuButton-D34QMSGy.js} +1 -1
  10. package/assets/{OnboardingWizard-kXlKqKkT.js → OnboardingWizard-BVobH1no.js} +1 -1
  11. package/assets/{OutboxPane-BpnDhdKr.js → OutboxPane-C7jL6ES7.js} +1 -1
  12. package/assets/_mailboxId-ZNg2qV-5.js +1 -0
  13. package/assets/_messageId-Bo8JgpBl.js +1 -0
  14. package/assets/_messageId-CALtF0SS.js +1 -0
  15. package/assets/_messageId-DW_g9KKZ.js +1 -0
  16. package/assets/_outboxMessageId-Bfyrlt2g.js +1 -0
  17. package/assets/_threadId-BATvUNvA.js +1 -0
  18. package/assets/_threadId-BnEAmDmp.js +1 -0
  19. package/assets/_threadId-WZTHRqEW.js +1 -0
  20. package/assets/{accounts-DrwOE93u.js → accounts-2R_11yWL.js} +1 -1
  21. package/assets/{advanced-CiPqtEnK.js → advanced-KJcjVjig.js} +1 -1
  22. package/assets/{appearance-paAXZlxE.js → appearance-BC8x2Syx.js} +1 -1
  23. package/assets/{attachment-file-B7eNQhMy.js → attachment-file-DY0g61n3.js} +1 -1
  24. package/assets/{avatar-mpm-A7uK.js → avatar-C3HjXXDW.js} +1 -1
  25. package/assets/{bottom-sheet-COp-8N7A.js → bottom-sheet-oe_TWJnr.js} +1 -1
  26. package/assets/{brief-NwTw-ufn.js → brief-CTWL-PQ2.js} +1 -1
  27. package/assets/brief-DQVvOanG.js +1 -0
  28. package/assets/{browser-ponyfill-N4pEkQs_.js → browser-ponyfill-DcKrcXwz.js} +1 -1
  29. package/assets/{bug-CXIVVO0p.js → bug-xvxq-6A9.js} +1 -1
  30. package/assets/{circle-check-TXEIke5H.js → circle-check-B5Lo4KtM.js} +1 -1
  31. package/assets/{circle-check-big-DBZcT3r2.js → circle-check-big-CbrB-whu.js} +1 -1
  32. package/assets/{circle-help-D7MpxWNB.js → circle-help-DfR1kzZ6.js} +1 -1
  33. package/assets/{clock-nCszHlHa.js → clock-B7j8Kb2h.js} +1 -1
  34. package/assets/compose._-_outboxMessageId_-BXPyuwTe.js +1 -0
  35. package/assets/compose._-_outboxMessageId_-DxYgLWTq.js +1 -0
  36. package/assets/compose._-_outboxMessageId_-DzaIC9DH.js +1 -0
  37. package/assets/compose._-_outboxMessageId_-R1KbE6EW.js +1 -0
  38. package/assets/{confirm-dialog-Px-_rJtr.js → confirm-dialog-Dhbqjgfh.js} +1 -1
  39. package/assets/{download-0yY4Po26.js → download-KOaI7wxV.js} +1 -1
  40. package/assets/{filters-Bh2quq-C.js → filters-BgnyPAjY.js} +1 -1
  41. package/assets/flagged-NFgGuA0l.js +1 -0
  42. package/assets/{flagged-irmE9mxk.js → flagged-p0jBFiwJ.js} +1 -1
  43. package/assets/{folders-C1S6FfyB.js → folders-BJ2rG6bS.js} +1 -1
  44. package/assets/{format-417NBVfW.js → format-DpHFGtVX.js} +1 -1
  45. package/assets/{help-copy-BvLoUgrl.js → help-copy-BUUPB39d.js} +1 -1
  46. package/assets/index-Bo8JgpBl.js +1 -0
  47. package/assets/index-BqW48k3E.js +1 -0
  48. package/assets/index-Bur8N4bW.js +1 -0
  49. package/assets/index-CALtF0SS.js +1 -0
  50. package/assets/index-CdSDUKfq.js +1 -0
  51. package/assets/index-Cn5cjA8R.js +55 -0
  52. package/assets/index-Didtox3s.js +1 -0
  53. package/assets/index-DxerlW-J.js +1 -0
  54. package/assets/{index-BdbDZ3ku.js → index-K5AhOKmo.js} +4 -4
  55. package/assets/index-NvcP4iqJ.js +1 -0
  56. package/assets/{kbd-BIGqj2Dc.js → kbd-CbTLVnTB.js} +1 -1
  57. package/assets/{labels-5_nA1zXM.js → labels-BEEOMWRI.js} +1 -1
  58. package/assets/{mail-DwoclAEc.js → mail-CS-5Nwao.js} +1 -1
  59. package/assets/mail-xQ8FQa51.js +1 -0
  60. package/assets/{menu--9LOrMJZ.js → menu-BSPlt9Y_.js} +1 -1
  61. package/assets/{onboarding-C-1UiSHC.js → onboarding-BzbVnJzr.js} +1 -1
  62. package/assets/outbox-BdJSGpMl.js +1 -0
  63. package/assets/{pencil-B8mamvzk.js → pencil-ImB6UdGF.js} +1 -1
  64. package/assets/{rich-text-CCgr6JX2.js → rich-text-DQhemLgG.js} +2 -2
  65. package/assets/{rich-text-spellcheck-worker-provider-BPn3NTD-.js → rich-text-spellcheck-worker-provider-88kJwhij.js} +1 -1
  66. package/assets/{rotate-ccw-OqzIn3qY.js → rotate-ccw-BfJOygzg.js} +1 -1
  67. package/assets/{row-actions-C-2lNwEb.js → row-actions-DAvtYtfn.js} +1 -1
  68. package/assets/{search-mirror-DhGJDlwB.js → search-mirror-CZvj1eQw.js} +1 -1
  69. package/assets/{search-token-index-6INe6PaI.js → search-token-index-odsAAGIl.js} +1 -1
  70. package/assets/{senders-CgseGH2S.js → senders-D6sbKe-9.js} +1 -1
  71. package/assets/settings-MftZDuSz.js +1 -0
  72. package/assets/{settings-screen-DoJEM-BK.js → settings-screen-OzuX7GJJ.js} +1 -1
  73. package/assets/{shield-check-BJOsJulP.js → shield-check-C-eR0bvw.js} +1 -1
  74. package/assets/{suggested-vips-BiRiCQkA.js → suggested-vips-Ce-U_0j3.js} +1 -1
  75. package/assets/{useDebouncedValue-D0F2mAw1.js → useDebouncedValue-BFK5ND6l.js} +1 -1
  76. package/assets/{useFilters-C1Pg2Kp9.js → useFilters-BvU5PPFj.js} +1 -1
  77. package/assets/{useLabels-DAStRlRs.js → useLabels-CdtzljdO.js} +1 -1
  78. package/assets/{useMessageBodyContent-DTdYCHws.js → useMessageBodyContent-C2v1x8ve.js} +1 -1
  79. package/assets/{useQueries-DwTMtorf.js → useQueries-Ct9SbKVJ.js} +1 -1
  80. package/assets/{useRefreshControl-JUE06Pfb.js → useRefreshControl-C0g_0d9t.js} +1 -1
  81. package/assets/{useSearchTokenContext-Bf-ouRfT.js → useSearchTokenContext-BxKZmTI-.js} +1 -1
  82. package/assets/{useSemanticSearch-B6z6MopC.js → useSemanticSearch-CuIVMi7q.js} +1 -1
  83. package/assets/{useSignature-eBZIPpos.js → useSignature-CdIg6qCl.js} +1 -1
  84. package/index.html +1 -1
  85. package/package.json +1 -1
  86. package/assets/MailListHeader-CQ3aMJAC.js +0 -7
  87. package/assets/_mailboxId-BrKyNzHR.js +0 -1
  88. package/assets/_messageId-D8iYQXtQ.js +0 -1
  89. package/assets/_messageId-DVqAR_CN.js +0 -1
  90. package/assets/_messageId-Ds1UVeut.js +0 -1
  91. package/assets/_outboxMessageId-DFBgcx7a.js +0 -1
  92. package/assets/_threadId-BhCf4uK0.js +0 -1
  93. package/assets/_threadId-Bt3nV5Pc.js +0 -1
  94. package/assets/_threadId-HxOaTNk3.js +0 -1
  95. package/assets/brief-Cwn5vWXY.js +0 -1
  96. package/assets/compose._-_outboxMessageId_-BQkAA9tb.js +0 -1
  97. package/assets/compose._-_outboxMessageId_-C-aqyNoW.js +0 -1
  98. package/assets/compose._-_outboxMessageId_-CtTA-aTC.js +0 -1
  99. package/assets/compose._-_outboxMessageId_-Dk48Uzns.js +0 -1
  100. package/assets/flagged-B-CDChS4.js +0 -1
  101. package/assets/index-B7TMhuYA.js +0 -1
  102. package/assets/index-BM2EjfZn.js +0 -1
  103. package/assets/index-BgCO0y1p.js +0 -1
  104. package/assets/index-Blprh546.js +0 -1
  105. package/assets/index-D24Cu1CQ.js +0 -1
  106. package/assets/index-D8iYQXtQ.js +0 -1
  107. package/assets/index-DVqAR_CN.js +0 -1
  108. package/assets/index-Dsyf0i4X.js +0 -1
  109. package/assets/index-MTI5VnyW.js +0 -46
  110. package/assets/mail-Bgn0K1SM.js +0 -1
  111. package/assets/outbox-zJuX-TZK.js +0 -1
  112. package/assets/settings-fOya8dt7.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as o}from"./index-K5AhOKmo.js";import{F as r}from"./FlaggedPane-31OEGzFO.js";import"./useSearchTokenContext-BxKZmTI-.js";import"./kbd-CbTLVnTB.js";import"./useMessageBodyContent-C2v1x8ve.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-9z9s1SFe.js";import"./search-token-index-odsAAGIl.js";import"./useQueries-Ct9SbKVJ.js";import"./attachment-file-DY0g61n3.js";import"./mail-CS-5Nwao.js";import"./avatar-C3HjXXDW.js";import"./index-Cn5cjA8R.js";import"./useSignature-CdIg6qCl.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BFK5ND6l.js";import"./format-DpHFGtVX.js";import"./ErrorState-BYuE95Js.js";import"./download-KOaI7wxV.js";import"./shield-check-C-eR0bvw.js";import"./useFilters-BvU5PPFj.js";import"./confirm-dialog-Dhbqjgfh.js";import"./clock-B7j8Kb2h.js";import"./menu-BSPlt9Y_.js";import"./MailViewChrome-BcHZgYOJ.js";import"./wizard-selection-B1bng5Jq.js";function y(){return o.jsx(r.Reading,{})}export{y as component};
@@ -1 +1 @@
1
- import{j as s,b as t}from"./index-BdbDZ3ku.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};
1
+ import{j as s,b as t}from"./index-K5AhOKmo.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};
@@ -1 +1 @@
1
- import{r as f,j as e,aq as h,b7 as y,ap as b,bu as g,B as v,T as N,a1 as C,D as L,a2 as I,aE as D,aI as S,aF as E}from"./index-BdbDZ3ku.js";import{C as w}from"./confirm-dialog-Px-_rJtr.js";import{S as $}from"./settings-screen-DoJEM-BK.js";import{E as j}from"./ErrorState-CM5cyHBP.js";import{a as T,b as k,c as R,u as O}from"./useLabels-DAStRlRs.js";import"./avatar-mpm-A7uK.js";import"./menu--9LOrMJZ.js";import"./circle-help-D7MpxWNB.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(E,{tone:"danger",variant:"soft",children:"Couldn't create that label. Please try again."})]})}function A({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(w,{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 V(){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(A,{account:t},t.accountId))})})}export{V as component};
1
+ import{r as f,j as e,aq as h,b7 as y,ap as b,bu as g,B as v,T as N,a1 as C,D as L,a2 as I,aE as D,aI as S,aF as E}from"./index-K5AhOKmo.js";import{C as w}from"./confirm-dialog-Dhbqjgfh.js";import{S as $}from"./settings-screen-OzuX7GJJ.js";import{E as j}from"./ErrorState-BYuE95Js.js";import{a as T,b as k,c as R,u as O}from"./useLabels-CdtzljdO.js";import"./avatar-C3HjXXDW.js";import"./menu-BSPlt9Y_.js";import"./circle-help-DfR1kzZ6.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(E,{tone:"danger",variant:"soft",children:"Couldn't create that label. Please try again."})]})}function A({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(w,{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 V(){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(A,{account:t},t.accountId))})})}export{V as component};
@@ -1 +1 @@
1
- import{c as e}from"./index-BdbDZ3ku.js";const a=e("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);export{a as M};
1
+ import{c as e}from"./index-K5AhOKmo.js";const a=e("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);export{a as M};
@@ -0,0 +1 @@
1
+ import{c as A,r as d,u as Pe,j as e,S as Le,a as ge,b as k,C as te,d as se,e as Ae,f as be,F as Te,g as ze,X as ve,T as Fe,O as De,M as _e,A as Be,h as Ke,I as Qe,i as ye,B as D,k as Ve,l as He,m as z,n as qe,o as U,p as ae,q as $e,s as Ue,t as We,v as je,w as Y,x as Se,y as Ge,z as J,D as Ne,E as Ye,G as Je,H as W,J as Xe,N as E,K as Ze,L as et,P as tt,Q as st,R as at,U as nt,V as rt,W as ot,Y as it,Z as lt,_ as ct,$ as ut,a0 as dt,a1 as mt,a2 as xt,a3 as ht,a4 as ft,a5 as pt}from"./index-K5AhOKmo.js";import{B as gt,S as bt,D as vt,a as yt,b as jt,u as St,i as Nt,t as Ct,s as kt,c as wt,K as It,d as Mt,e as Ce,f as Ot,g as Rt,h as Et,j as Pt}from"./search-token-index-odsAAGIl.js";import{u as X,a as Lt}from"./useMessageBodyContent-C2v1x8ve.js";import{P as At}from"./pencil-ImB6UdGF.js";import{c as Tt,s as zt,M as Ft}from"./MailShell-B8nH8_Jn.js";import{u as Dt,a as _t,R as Bt,s as Kt,i as Qt,H as Vt,M as Ht}from"./useRefreshControl-C0g_0d9t.js";import{M as qt}from"./menu-BSPlt9Y_.js";import{B as ke}from"./bug-xvxq-6A9.js";import{A as $t}from"./avatar-C3HjXXDW.js";import{u as Ut,a as Wt}from"./index-Cn5cjA8R.js";import{u as Z}from"./useQueries-Ct9SbKVJ.js";import{i as Gt}from"./outbox-status-BlKn6P0x.js";import{E as Yt}from"./ErrorState-BYuE95Js.js";import{K as ne}from"./kbd-CbTLVnTB.js";import{u as Jt}from"./useDebouncedValue-BFK5ND6l.js";import"./search-scope-DTcpOp3S.js";import"./FullCompose-CoKL7tvs.js";import"./confirm-dialog-Dhbqjgfh.js";import"./circle-check-big-CbrB-whu.js";import"./useSignature-CdIg6qCl.js";import"./account-form-helpers-DhckT_PN.js";import"./format-DpHFGtVX.js";const Xt=A("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 Zt=A("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);const we=A("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=A("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 es=A("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"}]]),ts="button:not([disabled]), a[href]",R="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function ss({active:t,dimmed:s,indent:a}){return k("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",R,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 as({icon:t,label:s,count:a,active:n}){return e.jsxs(e.Fragment,{children:[t&&e.jsx("span",{className:k("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:k("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function P({icon:t,label:s,count:a,active:n,dimmed:r,indent:o,navId:c,linkComponent:m,ariaLabel:x,title:u,onClick:b}){const p=ss({active:n,dimmed:r,indent:o}),h=e.jsx(as,{icon:t,label:s,count:a,active:n});return c&&m?m({navId:c,className:p,ariaLabel:x??s,title:u,onClick:b,children:h}):e.jsx("button",{type:"button",onClick:b,className:p,"aria-label":x,title:u,children:h})}const re={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function ns(t){switch(t){case"inbox":return e.jsx(Qe,{className:"size-4"});case"flagged":return e.jsx(ge,{className:"size-4"});case"drafts":return e.jsx(Ke,{className:"size-4"});case"sent":return e.jsx(be,{className:"size-4"});case"archive":return e.jsx(Be,{className:"size-4"});case"all":return e.jsx(_e,{className:"size-4"});case"junk":return e.jsx(De,{className:"size-4"});case"trash":return e.jsx(Fe,{className:"size-4"})}}const oe=t=>t.role!=null,$=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 rs({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:k("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",R),children:[e.jsx(ze,{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:k("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",R),children:e.jsx(ve,{className:"size-3.5"})})]})}function os({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:k("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-accent transition-colors hover:bg-surface",R),children:[e.jsx(Xt,{className:"size-4 shrink-0"}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Save “",s,"”"]})]}),t.map(o=>e.jsx(rs,{query:o,onSelect:()=>a?.(o),onRemove:n?()=>n(o):void 0},o))]})}function is({account:t,selectedNavId:s,onSelectNav:a,linkComponent:n}){const[r,o]=d.useState(()=>ce(le,t.id,!0)),[c,m]=d.useState(()=>ce(ie,t.id,!0)),[x,u]=d.useState(!1),b=()=>{o(l=>{const N=!l;return ue(le,t.id,N),N})},p=()=>{m(l=>{const N=!l;return ue(ie,t.id,N),N})},h=t.mailboxes.filter(oe).sort((l,N)=>re[l.role]-re[N.role]),i=t.mailboxes.filter(l=>!oe(l)),g=x||i.length<=$?i:i.slice(0,$),j=i.length-g.length,y=t.status??"ready",S=y==="ready"&&h.length===0&&i.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:b,"aria-expanded":r,className:k("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",R,t.muted&&"opacity-55"),children:[r?e.jsx(te,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(se,{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(gt,{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:[y==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),y==="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(Ae,{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"})]}),S&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),y==="ready"&&e.jsxs(e.Fragment,{children:[h.map(l=>e.jsx(P,{navId:l.id,linkComponent:n,icon:ns(l.role),label:l.name,ariaLabel:l.name,title:l.fullPath??l.name,count:l.unseen,active:s===l.id,dimmed:t.muted,onClick:()=>a?.(l.id)},l.id)),t.outboxPending!==void 0&&e.jsx(P,{navId:"outbox",linkComponent:n,icon:e.jsx(be,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:t.outboxPending>0?t.outboxPending:void 0,active:s==="outbox",dimmed:t.muted,onClick:()=>a?.("outbox")}),i.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:p,"aria-expanded":c,className:k("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",R),children:[c?e.jsx(te,{className:"size-3 shrink-0"}):e.jsx(se,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:i.length})]}),c&&e.jsxs(e.Fragment,{children:[g.map(l=>e.jsx(P,{navId:l.id,linkComponent:n,icon:e.jsx(Te,{className:"size-4"}),label:l.name,ariaLabel:l.name,title:l.fullPath??l.name,count:l.unseen,active:s===l.id,dimmed:t.muted,onClick:()=>a?.(l.id)},l.id)),(j>0||x)&&i.length>$&&e.jsx("button",{type:"button",onClick:()=>u(l=>!l),className:k("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",R),children:x?"Show less":`Show all (${i.length})`})]})]})]})]})]})}function ls({accounts:t,selectedNavId:s,briefUnseen:a,onSelectNav:n,variant:r="desktop",linkComponent:o,calendarNav:c="hidden",savedSearches:m=[],saveableQuery:x,onSelectSavedSearch:u,onRemoveSavedSearch:b,onSaveCurrentSearch:p}){const h=d.useRef(null);Pe({containerRef:h,itemSelector:ts});const i=r==="drawer",g=e.jsxs("nav",{ref:i?h:void 0,className:i?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(P,{navId:"brief",linkComponent:o,icon:e.jsx(Le,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:s==="brief",onClick:()=>n?.("brief")}),c==="shown"&&e.jsx(P,{navId:"calendar",linkComponent:o,icon:e.jsx(Zt,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:s==="calendar",onClick:()=>n?.("calendar")}),e.jsx(P,{navId:"flagged",linkComponent:o,icon:e.jsx(ge,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:s==="flagged",onClick:()=>n?.("flagged")}),e.jsx(os,{savedSearches:m,saveableQuery:x,onSelectSavedSearch:u,onRemoveSavedSearch:b,onSaveCurrentSearch:p}),t.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-fg-muted",children:"No accounts configured"}):t.map(j=>e.jsx(is,{account:j,selectedNavId:s,onSelectNav:n,linkComponent:o},j.id))]});return i?g:e.jsx("aside",{ref:h,className:"flex h-full w-full flex-col bg-surface-sunken",children:g})}function cs({leading:t,search:s,actions:a,className:n}){return e.jsxs("header",{className:k("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 us(){const t=ye();if(!t)return null;const s=t.showNavPane?!t.navCollapsed:!1;return e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(qt,{className:"size-4"}),onClick:t.toggleNav,"aria-label":s?"Hide folders":"Show folders","aria-expanded":s,title:"Folders",className:"shrink-0"})}const ds={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function ms({search:t,onCompose:s,onReportBug:a,onOpenSettings:n,composeShortcut:r,refreshControl:o,account:c}){return e.jsx(cs,{leading:e.jsx(us,{}),search:e.jsx(bt,{value:t.value,onChange:t.onChange,onClear:t.onClear,onClearQuery:t.onClearQuery,chips:t.chips,onRemoveChip:t.onRemoveChip,placeholder:ds[t.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(es,{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,c]})})}function xs(){const{pathname:t}=Ve(),s=He({from:"/mail/$mailboxId",shouldThrow:!1});return z(t,"/settings")?"settings":z(t,"/mail/outbox")?"outbox":z(t,"/mail/flagged")?"flagged":z(t,"/mail/brief")?"brief":s?.mailboxId??""}function hs(){const t=qe(),s=U({select:u=>ae(u.location.pathname)}),a=U({select:u=>$e(u.location.search)}),[n,r]=d.useState(a),o=Jt(n,200),[c,m]=d.useState(s);if(c!==s){const u=zt(c,s,a);m(s),u!==void 0&&r(u)}const x=d.useCallback(u=>{m(ae(t.state.location.pathname)),r(u)},[t]);return{searchInput:n,committedQuery:Tt(n,o),viewKey:s,setSearchInput:x}}const fs=()=>{const t=X();return Ue()?null:e.jsx("button",{type:"button",onClick:t,"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(At,{className:"size-6"})})},Me=({children:t})=>{const{Account:s}=We();return e.jsx(s,{children:t})},ps=({email:t,onSignOut:s})=>{const a=t??"Account";return e.jsxs(vt,{trigger:e.jsx($t,{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(yt,{})]}),e.jsxs(jt,{onClick:s,children:[e.jsx(we,{className:"size-4"}),"Sign out"]})]})},gs=()=>e.jsx(Me,{children:({email:t,signOut:s})=>e.jsx(ps,{email:t,onSignOut:s})});function bs({accounts:t}){const{searchInput:s,onSearchChange:a,onSearchClear:n,onSearchClearQuery:r,resultFolderIndex:o}=je(),c=Y(),m=Ut(),x=X(),{scope:u,clearScope:b}=St(t),p=u.kind==="scoped"?[{id:u.chip.id,label:u.chip.label,tone:"scope"}]:void 0,h=d.useMemo(()=>t.map(S=>S.accountId),[t]),{hasNewMail:i}=Dt(),{state:g,errorMessage:j,refresh:y}=_t(h,{onSettled:()=>Nt(c,Ct(o.keys()))});return e.jsx(ms,{search:{value:s,scope:u.kind,chips:p,onChange:a,onClear:n,onClearQuery:r,onRemoveChip:b},onCompose:x,onReportBug:Se,onOpenSettings:()=>m("accounts"),composeShortcut:kt("compose"),refreshControl:e.jsx(Bt,{state:g,onRefresh:y,label:"Refresh all accounts",errorMessage:j,hasUpdate:i(h)}),account:e.jsx(gs,{})})}const ee="remit.savedSearches",vs=25;function _(){try{const t=localStorage.getItem(ee);if(!t)return[];const s=JSON.parse(t);return Array.isArray(s)?s.filter(a=>typeof a=="string"):[]}catch{return[]}}function ys(t){const s=t.trim();if(!s)return _();const a=[s,..._().filter(n=>n!==s)].slice(0,vs);try{localStorage.setItem(ee,JSON.stringify(a))}catch{return a}return a}function js(t){const s=_().filter(a=>a!==t);try{localStorage.setItem(ee,JSON.stringify(s))}catch{return s}return s}const de=t=>/^\d/.test(t),Ss=(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 Ns(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,c)=>Ss(W(o,void 0,a),W(c,void 0,a))),{system:n,labels:r}}function Cs(t,s,a){const n=Xe(s)&&t.unseenCount>0;return{id:t.mailboxId,name:W(t,s,a),unseen:n?t.unseenCount:void 0,role:s,fullPath:t.fullPath}}function me({accounts:t,onMailboxSelect:s,variant:a="desktop"}){const n=Y(),r=wt(),o=xs(),{searchInput:c,onSearchChange:m}=je(),[x,u]=d.useState(_),{t:b}=Ge("mail",{useSuspense:!1}),p=d.useCallback((f,C)=>b(f,{defaultValue:C}),[b]),h=Z({queries:t.map(f=>({...J({path:{accountId:f.accountId}}),staleTime:1/0}))}),{data:i}=Ne(Ye()),g=d.useMemo(()=>(i?.items??[]).filter(f=>Gt(f.status)).length,[i?.items]),j=d.useMemo(()=>t.map((f,C)=>{const v=h[C],I=v?.data?.items??[],w=Je(f.folderAppointments),{system:M,labels:V}=Ns(I,w,p),H=v?.isError?"error":v?.isLoading?"loading":"ready";return{id:f.accountId,label:f.email,email:f.email,muted:!!f.muted,outboxPending:g,status:H,onRetry:()=>v?.refetch(),mailboxes:[...M,...V].map(T=>Cs(T,w.get(T.mailboxId),p))}}),[t,h,g,p]),y=f=>{n.invalidateQueries({queryKey:Ze({path:{mailboxId:f},query:{order:"desc"}})})},S=({navId:f,className:C,ariaLabel:v,title:I,children:w,onClick:M})=>f==="brief"?e.jsx(E,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>M?.(),className:C,"aria-label":v,title:I,children:w}):f==="outbox"?e.jsx(E,{to:"/mail/outbox",search:{q:void 0},onClick:()=>M?.(),className:C,"aria-label":v,title:I,children:w}):f==="flagged"?e.jsx(E,{to:"/mail/flagged",search:{q:void 0},onClick:()=>M?.(),className:C,"aria-label":v,title:I,children:w}):f==="settings"?e.jsx(E,{to:"/settings/accounts",onClick:()=>M?.(),className:C,"aria-label":v,title:I,children:w}):e.jsx(E,{to:"/mail/$mailboxId",params:{mailboxId:f},search:{q:void 0},onClick:()=>{y(f),M?.()},className:C,"aria-label":v,title:I,children:w}),l=()=>{m(""),s?.()},N=c.trim(),O=N.length>0&&!x.includes(N)?N:void 0,B=d.useCallback(()=>{O&&u(ys(O))},[O]),K=d.useCallback(f=>{u(js(f))},[]),Q=d.useCallback(f=>{m(f),r(f),s?.()},[m,r,s]);return e.jsx(ls,{accounts:j,selectedNavId:o,onSelectNav:l,linkComponent:S,variant:a,savedSearches:x,saveableQuery:O,onSaveCurrentSearch:B,onSelectSavedSearch:Q,onRemoveSavedSearch:K})}function ks(){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 ws({accounts:t,onMailboxSelect:s}){return ye()?.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(E,{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(ks,{}),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 Is=({isOpen:t,onClose:s})=>(et({id:"shortcuts",open:t,answers:{back:s}}),t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(tt,{label:"Dismiss keyboard shortcuts",onDismiss:s,className:"backdrop-blur-sm"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",className:k("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(ve,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:It.map(a=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-sm font-medium text-fg-muted",children:a.title}),e.jsx("div",{className:"space-y-2",children:a.hints.map(n=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm",children:n.description}),e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:n.keys.map((r,o)=>e.jsxs(d.Fragment,{children:[o>0&&n.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(ne,{children:r})]},r))})]},`${n.action}-${n.keys.join("+")}`))})]},a.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(ne,{children:"Esc"})," to close"]})})]})]}):null);function Ms(t){const s=Z({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0}))});return d.useMemo(()=>Mt(s.map(a=>a.data?.items??[])),[s])}const Oe="remit:intelligence-open";function Os(){try{return localStorage.getItem(Oe)!=="closed"}catch{return!0}}function Rs(t){try{localStorage.setItem(Oe,t?"open":"closed")}catch{}}function xe({panels:t,prefersOpen:s,isDesktop:a,hasThread:n,raisedFor:r,openMessage:o}){return r!==null&&r===o?!0:t.length>0?t.includes("intelligence"):a&&n&&s}const Es=()=>{const t=Ce(),s=st(),a=at(),n=s.find(nt),r=Ot(),[o,c]=d.useState(Os),m=r?`${r.threadId}/${r.messageId??""}`:null,[x,u]=d.useState(null),b={panels:s,prefersOpen:o,isDesktop:t==="desktop",hasThread:r!==void 0,openMessage:m},p=xe({...b,raisedFor:x}),h=xe({...b,raisedFor:null}),i=d.useCallback((S,l)=>{a([...S?["intelligence"]:[],...l?[l]:[]])},[a]),g=d.useCallback(S=>{i(h,S)},[h,i]),j=d.useCallback(()=>{if(p&&!h){u(null);return}const S=!p;Rs(S),c(S),u(null),i(S,n)},[h,p,n,i]),y=d.useCallback(()=>{u(m)},[m]);return{openOverlay:n,intelligenceOpen:p,showOverlay:g,toggleIntelligence:j,raiseIntelligence:y}},Ps=t=>t.map(s=>s.data?.items??[]);function Ls(t){const s=Z({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0})),combine:Ps});return d.useMemo(()=>rt(t.map((a,n)=>({folderAppointments:a.folderAppointments,mailboxes:s[n]??[]}))),[t,s])}var F={exports:{}},he;function As(){if(he)return F.exports;he=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:c}=n;if(!(typeof c=="number"&&c>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${c}\` (${typeof c})`);const m=[],x=s[Symbol.iterator]();let u=!1,b=!1,p=0,h=0;const i=()=>{if(u)return;const g=x.next(),j=h;if(h++,g.done){b=!0,p===0&&r(m);return}p++,Promise.resolve(g.value).then(y=>a(y,j)).then(y=>{m[j]=y,p--,i()},y=>{u=!0,o(y)})};for(let g=0;g<c&&(i(),!b);g++);});return F.exports=t,F.exports.default=t,F.exports}var Ts=As();const zs=ot(Ts),Fs=900*1e3,Ds=30,_s=(t,s)=>{if(!t)return s;const a=Number.parseInt(t,10);return Number.isFinite(a)&&a>0?a:s},Bs=30*1e3,Ks=t=>Math.max(_s(t,Ds)*1e3,Bs),Re=Ks(dt().mailboxPollIntervalSeconds),L=(t=Date.now(),s=Re)=>Qt(t)?Math.min(Vt,s):s,Qs=5,G=new Set,Vs=(t,s,a=Fs)=>t.filter(n=>{const r=n.lastSyncAt;return r==null?!0:s-r>a}).map(n=>n.accountId),Hs=(t,s,a=Re)=>t-s>=a,qs=(t,s)=>t.filter(a=>!s.has(a)),fe=(t,s)=>{if(G.delete(t),ct(s,{softError:!0},"nobody")){ut(s);return}console.warn("[remit] background mailbox sync failed",{accountId:t,error:s})},pe=(t,s)=>it({path:{accountId:t},throwOnError:!0}).then(()=>{s.invalidateQueries({queryKey:lt({path:{accountId:t}})})}),$s=t=>{const s=Y(),a=d.useRef(t);a.current=t;const n=t.map(r=>r.accountId).join(",");d.useEffect(()=>{const r=Date.now(),c=Vs(a.current,r).filter(m=>!G.has(m));if(c.length!==0)for(const m of c)G.add(m),pe(m,s).catch(x=>{fe(m,x)})},[n,s]),d.useEffect(()=>{let r=Date.now(),o;const c=new Set,m=()=>{r=Date.now();const h=qs(a.current.map(i=>i.accountId),c);for(const i of h)c.add(i);zs(h,i=>pe(i,s).catch(g=>{fe(i,g)}).finally(()=>{c.delete(i)}),{concurrency:Qs})},x=()=>{if(document.visibilityState==="visible"){m(),o=setTimeout(x,L());return}},u=()=>{document.visibilityState==="visible"&&Hs(Date.now(),r,L())&&(o!==void 0&&clearTimeout(o),m(),o=setTimeout(x,L()))},b=()=>{document.visibilityState==="visible"&&(o!==void 0&&clearTimeout(o),r=Date.now(),o=setTimeout(x,L()))};o=setTimeout(x,L()),document.addEventListener("visibilitychange",u);const p=Kt(b);return()=>{o!==void 0&&clearTimeout(o),document.removeEventListener("visibilitychange",u),p()}},[n,s])};function fa(){const t=mt(),s=Ce(),a=Pt(s),{openOverlay:n,intelligenceOpen:r,showOverlay:o,toggleIntelligence:c,raiseIntelligence:m}=Es(),x=n==="shortcuts",u=n==="nav",{searchInput:b,committedQuery:p,viewKey:h,setSearchInput:i}=hs(),{data:g,isLoading:j,isError:y,error:S,refetch:l}=Ne({...xt(),staleTime:1/0}),N=!!(g&&(g.accounts?.length??0)===0);d.useEffect(()=>{N&&t({to:"/onboarding",replace:!0})},[N,t]),Wt({enabled:!x,bindings:[{key:"?",action:"help",handler:()=>o("shortcuts"),noModifiers:!1,preventDefault:!0}]});const O=X(),B=Lt(),K=U({select:q=>ht(q.matches)?.list==="mailbox"}),Q=d.useMemo(()=>({compose:O}),[O]);Rt({enabled:!K&&!B,handlers:Q});const f=d.useCallback(()=>{i("")},[i]),C=d.useCallback(()=>{i("")},[i]),v=g?.accounts??[],I=d.useMemo(()=>v.map(q=>q.accountId),[v]),w=Ms(v),M=Ls(v),V=d.useMemo(()=>Et(v),[v]);$s(v);const H=d.useCallback(()=>{n==="nav"&&o(void 0)},[n,o]),T={accounts:v,mailboxNameIndex:w,accountNameIndex:V,resultFolderIndex:M,searchQuery:p,searchInput:b,searchViewKey:h,onSearchChange:i,onSearchClear:f,onSearchClearQuery:C,intelligenceOpen:r,onToggleIntelligence:c,onRaiseIntelligence:m},Ee={isSinglePane:a,isLoading:j||N,intelligenceOpen:r,nav:e.jsx(ws,{accounts:v,onMailboxSelect:H}),topBar:a?void 0:e.jsx(bs,{accounts:v}),overlay:a?e.jsx(fs,{}):void 0,navOpen:u,onOpenNav:()=>o("nav"),onCloseNav:()=>o(void 0)};return e.jsx(ft.Provider,{value:T,children:e.jsxs(Ht,{accountIds:I,children:[y?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(Yt,{title:"Couldn't load your account",error:S,onRetry:()=>{l()}})}):e.jsx(Ft,{chrome:Ee,children:e.jsx(pt,{})}),e.jsx(Is,{isOpen:x,onClose:()=>o(void 0)})]})})}export{fa as component,je as useMailContext};
@@ -1 +1 @@
1
- import{c as e}from"./index-BdbDZ3ku.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};
1
+ import{c as e}from"./index-K5AhOKmo.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};
@@ -1 +1 @@
1
- import{a6 as n,a7 as r,w as a,r as i,j as s}from"./index-BdbDZ3ku.js";import{O as c}from"./OnboardingWizard-kXlKqKkT.js";import"./kbd-BIGqj2Dc.js";import"./account-form-helpers-DhckT_PN.js";import"./mail-DwoclAEc.js";async function m(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:n()}),e.navigateToInbox()}function C(){const e=r(),o=a(),t=i.useCallback(l=>{m({queryClient:o,recordCompleted:()=>e.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[e,o]);return s.jsx(c,{skipWelcome:!1,onComplete:t})}export{C as component};
1
+ import{a6 as n,a7 as r,w as a,r as i,j as s}from"./index-K5AhOKmo.js";import{O as c}from"./OnboardingWizard-BVobH1no.js";import"./kbd-CbTLVnTB.js";import"./account-form-helpers-DhckT_PN.js";import"./mail-CS-5Nwao.js";async function m(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:n()}),e.navigateToInbox()}function C(){const e=r(),o=a(),t=i.useCallback(l=>{m({queryClient:o,recordCompleted:()=>e.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[e,o]);return s.jsx(c,{skipWelcome:!1,onComplete:t})}export{C as component};
@@ -0,0 +1 @@
1
+ import{j as o,a5 as i}from"./index-K5AhOKmo.js";import{a as m}from"./MailShell-B8nH8_Jn.js";import{u as p,O as t}from"./OutboxPane-C7jL6ES7.js";import{u as s}from"./search-mirror-CZvj1eQw.js";import"./FullCompose-CoKL7tvs.js";import"./ErrorState-BYuE95Js.js";import"./index-Cn5cjA8R.js";import"./useMessageBodyContent-C2v1x8ve.js";import"./useSignature-CdIg6qCl.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-BFK5ND6l.js";import"./format-DpHFGtVX.js";import"./confirm-dialog-Dhbqjgfh.js";import"./useSearchTokenContext-BxKZmTI-.js";import"./kbd-CbTLVnTB.js";import"./search-scope-DTcpOp3S.js";import"./circle-check-big-CbrB-whu.js";import"./clock-B7j8Kb2h.js";import"./row-actions-DAvtYtfn.js";import"./rotate-ccw-BfJOygzg.js";import"./NavMenuButton-D34QMSGy.js";import"./menu-BSPlt9Y_.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function q(){const r=p();return s({to:"/mail/outbox"}),o.jsx(t,{outboxMessageId:r,children:o.jsx(m,{phone:o.jsx(t.Phone,{}),list:o.jsx(t.List,{}),reading:o.jsx(i,{})})})}export{q as component};
@@ -1 +1 @@
1
- import{c as a}from"./index-BdbDZ3ku.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};
1
+ import{c as a}from"./index-K5AhOKmo.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};