@remit/web-client-dist 0.0.324 → 0.0.325
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-BX0Ts8eK.js +1 -0
- package/assets/{ErrorState-D475ZmnW.js → ErrorState-BczXHsEF.js} +1 -1
- package/assets/FlaggedPane-Dt_iIYmt.js +1 -0
- package/assets/MailListHeader-BdAHPksi.js +52 -0
- package/assets/{MailViewChrome-BbPVsgkA.js → MailViewChrome-fy62FAjL.js} +1 -1
- package/assets/MailboxPane-U7vV6ftH.js +1 -0
- package/assets/{NavMenuButton-jHcm8vfZ.js → NavMenuButton-BPba0-Bs.js} +1 -1
- package/assets/OnboardingWizard-B8Q-LYx6.js +1 -0
- package/assets/{OutboxPane-BYMmHEVx.js → OutboxPane-7b3N6IIo.js} +1 -1
- package/assets/_mailboxId-Be32_Fkl.js +1 -0
- package/assets/_messageId-CMKPHNSP.js +1 -0
- package/assets/_messageId-Co6i3yAO.js +1 -0
- package/assets/_outboxMessageId-DJdiizxk.js +1 -0
- package/assets/_threadId-DDJseBJS.js +1 -0
- package/assets/_threadId-qAapyx6s.js +1 -0
- package/assets/{account-form-helpers-CcGKmwNo.js → account-form-helpers-Dy_qYZBf.js} +1 -1
- package/assets/accounts-CHlRsNpU.js +1 -0
- package/assets/{advanced-C7Ukhd8Y.js → advanced-BAXLq_6J.js} +1 -1
- package/assets/{appearance-DqT05V6b.js → appearance-BVBH78Qj.js} +1 -1
- package/assets/{avatar-DdJbookK.js → avatar-Cmct93tu.js} +1 -1
- package/assets/{bottom-sheet-cDZH6e9F.js → bottom-sheet-Div7q8za.js} +1 -1
- package/assets/brief-NFFuYb2Y.js +1 -0
- package/assets/{brief-zjptLhSQ.js → brief-ztU-V5Jr.js} +1 -1
- package/assets/{browser-ponyfill-B_dFgQ2w.js → browser-ponyfill-CltT4veR.js} +2 -2
- package/assets/{circle-check-UNJJb11g.js → circle-check-CqOKm1jQ.js} +1 -1
- package/assets/{circle-check-big-DH3iP9sG.js → circle-check-big-C1QO6sWU.js} +1 -1
- package/assets/{circle-help-BTvpgH50.js → circle-help-DtLG-dD-.js} +1 -1
- package/assets/{clock-BmHk7UCJ.js → clock-C_nmZOAr.js} +1 -1
- package/assets/{confirm-dialog-CuFS4VZc.js → confirm-dialog-D_L2OQTt.js} +1 -1
- package/assets/{download-BaUix46z.js → download-CUYIOGeY.js} +1 -1
- package/assets/{filters-CK8qlYLT.js → filters-CihDvHy0.js} +1 -1
- package/assets/flagged-D2-nECko.js +1 -0
- package/assets/{flagged-BQZ7wYZM.js → flagged-DJtQwJRJ.js} +1 -1
- package/assets/folders-CuQtFJNd.js +1 -0
- package/assets/index-BZNymLz7.js +1 -0
- package/assets/index-CB14yMy_.js +1 -0
- package/assets/index-Co6i3yAO.js +1 -0
- package/assets/{index-CJnB8f3k.js → index-ComwGxPk.js} +65 -65
- package/assets/index-DHWRCxPH.js +1 -0
- package/assets/index-Dd9u_oFv.js +1 -0
- package/assets/index-EJnMy0RH.js +1 -0
- package/assets/index-UDuEAHny.js +1 -0
- package/assets/{index-B9v7X7iy.css → index-rGtSoq8U.css} +1 -1
- package/assets/{kbd-CaPCJ6kw.js → kbd-BRJLjcIX.js} +1 -1
- package/assets/{labels-B-Y5h1qN.js → labels-D8TMS0RV.js} +1 -1
- package/assets/mail-1ta1TRDs.js +1 -0
- package/assets/{menu-fPT37kSH.js → menu-C8-I96Zt.js} +1 -1
- package/assets/move-options-WgyTD7l9.js +1 -0
- package/assets/{nav-link-DNUfNst6.js → nav-link-DRXYLG2N.js} +1 -1
- package/assets/onboarding-mDqYUvKo.js +1 -0
- package/assets/outbox-BkghU3zE.js +1 -0
- package/assets/{pencil-B7n34zlT.js → pencil-Dbryb2G4.js} +1 -1
- package/assets/{rich-text-D0kC56sS.js → rich-text-BtOJxUml.js} +1 -1
- package/assets/{rotate-ccw-Dxvks-Fa.js → rotate-ccw-CqFFuTll.js} +1 -1
- package/assets/{row-actions-CCoOsKI0.js → row-actions-BMjwPo6d.js} +1 -1
- package/assets/search-scope-CtUcfBl6.js +1 -0
- package/assets/{search-token-index-DecN3tuj.js → search-token-index-D0pBouL9.js} +1 -1
- package/assets/search-view-BjfUA02J.js +1 -0
- package/assets/{senders-DGft74el.js → senders-CSIdLfBV.js} +1 -1
- package/assets/settings-B885opIA.js +1 -0
- package/assets/{settings-screen-C1bOf6b4.js → settings-screen-CKYaXpTP.js} +1 -1
- package/assets/{shield-check-Dtx-C_MX.js → shield-check-zfqCjw0j.js} +1 -1
- package/assets/{suggested-vips-DZp292iM.js → suggested-vips-B0qK0um_.js} +1 -1
- package/assets/{useDebouncedValue-BSOGglNm.js → useDebouncedValue-DtSfQRAl.js} +1 -1
- package/assets/{useFilters-D45aWbCk.js → useFilters-CgqWzSsw.js} +1 -1
- package/assets/useLabels-w33B4HcN.js +1 -0
- package/assets/{useMediaQuery-CyTmCzY8.js → useMediaQuery-DB_QCXpp.js} +1 -1
- package/assets/{useRefreshControl-Da3yPTgP.js → useRefreshControl-DQcQYMVi.js} +1 -1
- package/assets/{useSearchMirror-2jg6tvic.js → useSearchMirror-DcdqXC7B.js} +1 -1
- package/assets/{useSearchTokenContext-CwRxhOKm.js → useSearchTokenContext-DxeXQ6z3.js} +1 -1
- package/assets/useSignature-iMCmNOo-.js +1 -0
- package/assets/useThreadRow-DvG5ipyv.js +1 -0
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/BriefPane-DL_dX2hD.js +0 -1
- package/assets/FlaggedPane-BVLRbiSx.js +0 -1
- package/assets/MailListHeader-C9wj024y.js +0 -52
- package/assets/MailboxPane-BxcFua3V.js +0 -1
- package/assets/OnboardingWizard-5e-Jbm_d.js +0 -1
- package/assets/_mailboxId-QM6wK6lu.js +0 -1
- package/assets/_messageId-qDl7dOGW.js +0 -1
- package/assets/_outboxMessageId-iQ5-XecM.js +0 -1
- package/assets/_threadId-DxeTBXZj.js +0 -1
- package/assets/accounts-B63o2ILX.js +0 -1
- package/assets/brief-BrK0nniY.js +0 -1
- package/assets/flagged-B_Vv3pKi.js +0 -1
- package/assets/folders-DXl5KdxR.js +0 -1
- package/assets/index-AqW6UMG_.js +0 -1
- package/assets/index-B3S02Qux.js +0 -1
- package/assets/index-DaxvMafC.js +0 -1
- package/assets/index-DzjwtnHo.js +0 -1
- package/assets/index-NL2-w7re.js +0 -1
- package/assets/index-qDl7dOGW.js +0 -1
- package/assets/mail-CkOH6e4d.js +0 -1
- package/assets/move-options-CoyjCaBu.js +0 -1
- package/assets/onboarding-BRxQhT4c.js +0 -1
- package/assets/outbox-CXGpzDAb.js +0 -1
- package/assets/search-scope-YZoKowSP.js +0 -1
- package/assets/search-view-BT2iNrko.js +0 -1
- package/assets/settings-CaxtfSrL.js +0 -1
- package/assets/useLabels-HGxt9ahb.js +0 -1
- package/assets/useSemanticSearch-DrT4OjKH.js +0 -1
- package/assets/useSignature-DY1xfitb.js +0 -1
package/assets/index-DaxvMafC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-CJnB8f3k.js";import{F as r}from"./FlaggedPane-BVLRbiSx.js";import"./useSearchTokenContext-CwRxhOKm.js";import"./kbd-CaPCJ6kw.js";import"./enums-CCxx0t2v.js";import"./search-scope-YZoKowSP.js";import"./MailListHeader-C9wj024y.js";import"./search-token-index-DecN3tuj.js";import"./useMediaQuery-CyTmCzY8.js";import"./account-form-helpers-CcGKmwNo.js";import"./avatar-DdJbookK.js";import"./useSignature-DY1xfitb.js";import"./useDebouncedValue-BSOGglNm.js";import"./ErrorState-D475ZmnW.js";import"./format-De9HZKjg.js";import"./download-BaUix46z.js";import"./shield-check-Dtx-C_MX.js";import"./nav-link-DNUfNst6.js";import"./move-options-CoyjCaBu.js";import"./useFilters-D45aWbCk.js";import"./confirm-dialog-CuFS4VZc.js";import"./clock-BmHk7UCJ.js";import"./menu-fPT37kSH.js";import"./MailViewChrome-BbPVsgkA.js";function v(){return o.jsx(r.Reading,{})}export{v as component};
|
package/assets/index-DzjwtnHo.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-CJnB8f3k.js";import{M as i}from"./MailboxPane-BxcFua3V.js";import"./useSearchTokenContext-CwRxhOKm.js";import"./kbd-CaPCJ6kw.js";import"./enums-CCxx0t2v.js";import"./search-scope-YZoKowSP.js";import"./useRefreshControl-Da3yPTgP.js";import"./circle-check-big-DH3iP9sG.js";import"./search-token-index-DecN3tuj.js";import"./useMediaQuery-CyTmCzY8.js";import"./MailListHeader-C9wj024y.js";import"./account-form-helpers-CcGKmwNo.js";import"./avatar-DdJbookK.js";import"./useSignature-DY1xfitb.js";import"./useDebouncedValue-BSOGglNm.js";import"./ErrorState-D475ZmnW.js";import"./format-De9HZKjg.js";import"./download-BaUix46z.js";import"./shield-check-Dtx-C_MX.js";import"./nav-link-DNUfNst6.js";import"./move-options-CoyjCaBu.js";import"./useFilters-D45aWbCk.js";import"./confirm-dialog-CuFS4VZc.js";import"./clock-BmHk7UCJ.js";import"./menu-fPT37kSH.js";import"./MailViewChrome-BbPVsgkA.js";import"./NavMenuButton-jHcm8vfZ.js";import"./useLabels-HGxt9ahb.js";import"./useSemanticSearch-DrT4OjKH.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-cDZH6e9F.js";import"./circle-help-BTvpgH50.js";import"./circle-check-UNJJb11g.js";import"./intelligence-pref-C6lFpj6U.js";function H(){return o.jsx(i.Reading,{})}export{H as component};
|
package/assets/index-NL2-w7re.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-CJnB8f3k.js";import{O as t}from"./OutboxPane-BYMmHEVx.js";import"./useSearchTokenContext-CwRxhOKm.js";import"./kbd-CaPCJ6kw.js";import"./enums-CCxx0t2v.js";import"./search-scope-YZoKowSP.js";import"./circle-check-big-DH3iP9sG.js";import"./clock-BmHk7UCJ.js";import"./row-actions-CCoOsKI0.js";import"./rotate-ccw-Dxvks-Fa.js";import"./NavMenuButton-jHcm8vfZ.js";import"./menu-fPT37kSH.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};
|
package/assets/index-qDl7dOGW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-CJnB8f3k.js";import{B as o}from"./BriefPane-DL_dX2hD.js";import"./useSearchTokenContext-CwRxhOKm.js";import"./kbd-CaPCJ6kw.js";import"./enums-CCxx0t2v.js";import"./search-scope-YZoKowSP.js";import"./MailListHeader-C9wj024y.js";import"./search-token-index-DecN3tuj.js";import"./useMediaQuery-CyTmCzY8.js";import"./account-form-helpers-CcGKmwNo.js";import"./avatar-DdJbookK.js";import"./useSignature-DY1xfitb.js";import"./useDebouncedValue-BSOGglNm.js";import"./ErrorState-D475ZmnW.js";import"./format-De9HZKjg.js";import"./download-BaUix46z.js";import"./shield-check-Dtx-C_MX.js";import"./nav-link-DNUfNst6.js";import"./move-options-CoyjCaBu.js";import"./useFilters-D45aWbCk.js";import"./confirm-dialog-CuFS4VZc.js";import"./clock-BmHk7UCJ.js";import"./menu-fPT37kSH.js";import"./useRefreshControl-Da3yPTgP.js";import"./circle-check-big-DH3iP9sG.js";import"./useLabels-HGxt9ahb.js";import"./useSemanticSearch-DrT4OjKH.js";import"./search-query-Cr_ZXBCp.js";function z(){return r.jsx(o.Reading,{})}export{z as component};
|
package/assets/mail-CkOH6e4d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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-CJnB8f3k.js";import{B as xt,S as ht,D as ft,a as pt,b as gt,u as bt,s as vt,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-DecN3tuj.js";import{l as It,u as se,m as Mt}from"./search-scope-YZoKowSP.js";import{P as Et}from"./pencil-B7n34zlT.js";import{M as Ot,s as Rt,c as At}from"./search-view-BT2iNrko.js";import{u as Pt,a as zt,R as Lt,M as Ft}from"./useRefreshControl-Da3yPTgP.js";import{M as Tt}from"./menu-fPT37kSH.js";import{A as Dt}from"./avatar-DdJbookK.js";import{i as Bt}from"./outbox-status-CPfNHfUQ.js";import{N as P}from"./nav-link-DNUfNst6.js";import{E as _t}from"./ErrorState-D475ZmnW.js";import{K as ae}from"./kbd-CaPCJ6kw.js";import{u as Kt}from"./useDebouncedValue-BSOGglNm.js";import{w as ne}from"./intelligence-pref-C6lFpj6U.js";import"./useMediaQuery-CyTmCzY8.js";import"./circle-check-big-DH3iP9sG.js";const Vt=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 qt=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 Ht({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 $t({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=Ht({active:n,dimmed:r,indent:o}),h=e.jsx($t,{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 Wt(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 Ut({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 Yt({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(Vt,{className:"size-4 shrink-0"}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Save “",s,"”"]})]}),t.map(o=>e.jsx(Ut,{query:o,onSelect:()=>a?.(o),onRemove:n?()=>n(o):void 0},o))]})}function Gt({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:Wt(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 Jt({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(Yt,{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(Gt,{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 Xt({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 Zt(){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(Tt,{className:"size-4"}),onClick:t.toggleNav,"aria-label":s?"Hide folders":"Show folders","aria-expanded":s,title:"Folders",className:"shrink-0"})}const es={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function ts({search:t,onCompose:s,onReportBug:a,onOpenSettings:n,composeShortcut:r,refreshControl:o,account:l}){return e.jsx(Xt,{leading:e.jsx(Zt,{}),search:e.jsx(ht,{value:t.value,onChange:t.onChange,onClear:t.onClear,onClearQuery:t.onClearQuery,chips:t.chips,onRemoveChip:t.onRemoveChip,placeholder:es[t.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(D,{variant:"ghost",size:"sm",icon:e.jsx(qt,{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 ss=()=>{const{state:t,openCompose:s}=U(),a=ye(),n=i.useCallback(()=>{s({mode:"new"})},[s]),o=!!a.search?.selectedMessageId||It(a.pathname);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(Et,{className:"size-6"})})},Me=({children:t})=>{const{Account:s}=$e();return e.jsx(s,{children:t})},as=({email:t,onSignOut:s})=>{const a=t??"Account";return e.jsxs(ft,{trigger:e.jsx(Dt,{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"]})]})},ns=()=>e.jsx(Me,{children:({email:t,signOut:s})=>e.jsx(as,{email:t,onSignOut:s})});function rs({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}=Pt(),{state:f,errorMessage:v,refresh:k}=zt(u);return e.jsx(ts,{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(Lt,{state:f,onRefresh:k,label:"Refresh all accounts",errorMessage:v,hasUpdate:h(u)}),account:e.jsx(ns,{})})}const X="remit.savedSearches",os=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 is(t){const s=t.trim();if(!s)return _();const a=[s,..._().filter(n=>n!==s)].slice(0,os);try{localStorage.setItem(X,JSON.stringify(a))}catch{return a}return a}function ls(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),cs=(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 us(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)=>cs($(o,void 0,a),$(l,void 0,a))),{system:n,labels:r}}function ds(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 ms(){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=ms(),{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=>Bt(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}=us(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=>ds(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},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},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(is(A))},[A]),V=i.useCallback(d=>{p(ls(d))},[]),q=i.useCallback(d=>{m(d),r({to:"/mail/brief",search:{q:d}}),s?.()},[m,r,s]);return e.jsx(Jt,{accounts:k,selectedNavId:o,onSelectNav:c,linkComponent:R,variant:a,savedSearches:x,saveableQuery:A,onSaveCurrentSearch:K,onSelectSavedSearch:q,onRemoveSavedSearch:V})}function xs(){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 hs({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(xs,{}),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 fs=({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 ps(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 gs=t=>t.map(s=>s.data?.items??[]);function bs(t){const s=G({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0})),combine:gs});return i.useMemo(()=>tt(t.map((a,n)=>({folderAppointments:a.folderAppointments,mailboxes:s[n]??[]}))),[t,s])}var T={exports:{}},xe;function vs(){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 ys=vs();const js=st(ys),Ss=900*1e3,Ns=300,Cs=(t,s)=>{if(!t)return s;const a=Number.parseInt(t,10);return Number.isFinite(a)&&a>0?a:s},ks=60*1e3,ws=t=>Math.max(Cs(t,Ns)*1e3,ks),B=ws(it().mailboxPollIntervalSeconds),Is=5,W=new Set,Ms=(t,s,a=Ss)=>t.filter(n=>{const r=n.lastSyncAt;return r==null?!0:s-r>a}).map(n=>n.accountId),Es=(t,s,a=B)=>t-s>=a,Os=(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}})})}),Rs=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=Ms(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=Os(a.current.map(u=>u.accountId),l);for(const u of b)l.add(u);js(b,u=>fe(u,s).catch(h=>{he(u,h)}).finally(()=>{l.delete(u)}),{concurrency:Is})},x=()=>{if(document.visibilityState==="visible"){m(),o=setTimeout(x,B);return}},p=()=>{document.visibilityState==="visible"&&Es(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 Us(){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=Kt(u,200),v=At(u,f),k=se({select:j=>j.location.pathname}),g=se({select:j=>Mt(j.matches)}),[R,c]=i.useState(g);if(R!==g){const j=Rt(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=ps(C),Oe=bs(C),Re=i.useMemo(()=>kt(C),[C]);Rs(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(hs,{accounts:C,onMailboxSelect:Ae}),topBar:n?void 0:e.jsx(rs,{accounts:C}),overlay:n?e.jsx(ss,{}):void 0,navOpen:l,onOpenNav:()=>m(!0),onCloseNav:()=>m(!1)};return e.jsx(dt.Provider,{value:Pe,children:e.jsxs(Ft,{accountIds:F,children:[K?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(_t,{title:"Couldn't load your account",error:V,onRetry:()=>{q()}})}):e.jsx(Ot,{chrome:ze,children:e.jsx(mt,{})}),e.jsx(fs,{isOpen:r,onClose:()=>o(!1)})]})})}export{Us as component,je as useMailContext};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as g,w as C,v as w,ad 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-CJnB8f3k.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as t,a0 as r,q as a,r as i,j as s}from"./index-CJnB8f3k.js";import{O as c}from"./OnboardingWizard-5e-Jbm_d.js";import"./kbd-CaPCJ6kw.js";import"./account-form-helpers-CcGKmwNo.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as s,j as o,_ as i}from"./index-CJnB8f3k.js";import{a as m}from"./search-view-BT2iNrko.js";import{O as t}from"./OutboxPane-BYMmHEVx.js";import{u as a}from"./useSearchMirror-2jg6tvic.js";import"./nav-link-DNUfNst6.js";import"./search-scope-YZoKowSP.js";import"./useSearchTokenContext-CwRxhOKm.js";import"./kbd-CaPCJ6kw.js";import"./enums-CCxx0t2v.js";import"./circle-check-big-DH3iP9sG.js";import"./clock-BmHk7UCJ.js";import"./row-actions-CCoOsKI0.js";import"./rotate-ccw-Dxvks-Fa.js";import"./NavMenuButton-jHcm8vfZ.js";import"./menu-fPT37kSH.js";import"./format-De9HZKjg.js";import"./outbox-status-CPfNHfUQ.js";import"./search-query-Cr_ZXBCp.js";function e(){return s({from:"/mail/outbox/draft/$outboxMessageId",shouldThrow:!1})?.outboxMessageId}function w(){const r=e();return a({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{w as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c7 as a,cX as c,cY as d}from"./index-CJnB8f3k.js";function p(e){const t=a({warn:e?.router===void 0}),o=e?.router||t;return c(o.stores.__store,d(e,o))}const n="/mail/brief",s="/mail/$mailboxId",u="/mail/outbox",l="/mail/flagged";function i(e){for(const t of e){if(t.routeId===n)return{list:"brief"};if(t.routeId===l)return{list:"flagged"};if(t.routeId===u)return{list:"outbox"};if(t.routeId===s)return{list:"mailbox",mailboxId:t.params?.mailboxId}}}function _(e){const t=i(e);if(!t)return"";switch(t.list){case"mailbox":return t.mailboxId?f(t.mailboxId):"";case"flagged":return l;case"outbox":return u;case"brief":return n}}function f(e){return`${s}:${e}`}function g(e,t){return e===t?!0:e.startsWith(`${t}/`)}function R(e){const t=e.split(/[?#]/)[0].split("/").filter(Boolean);return t[0]==="mail"&&t.length>2}const r="search-scope";function b(e){const t=e.trim().replace(/\s+/g," ").toLowerCase();return/\s/.test(t)?`in:"${t}"`:`in:${t}`}function m(e){const t=i(e);return t!==void 0&&t.list!=="brief"}function I(e){const t=i(e);return t?.list==="mailbox"?t.mailboxId:void 0}function M(e){const t=I(e.matches);return t||(m(e.matches)?e.callerMailboxId:e.callerMailboxId??e.inTokenMailboxId)}function S(e,t){const o=i(e);return o?.list==="flagged"?{kind:"scoped",chip:{id:r,label:"is:starred"}}:o?.list==="outbox"?{kind:"scoped",chip:{id:r,label:"in:outbox"}}:o?.list==="mailbox"?t?{kind:"scoped",chip:{id:r,label:b(t)}}:{kind:"pending"}:{kind:"global"}}function h(e,t,o){return t.kind==="global"?{kind:"global"}:i(e)?.list==="flagged"?{kind:"collection"}:{kind:"folder",...o?{role:o}:{}}}export{r as S,g as a,h as b,S as c,m as i,R as l,_ as m,I as r,M as s,p as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as u,j as a,a3 as i,a4 as p}from"./index-CJnB8f3k.js";import{a as f}from"./search-scope-YZoKowSP.js";const c=u.createContext(null),h=({chrome:r,children:n})=>a.jsx(c.Provider,{value:r,children:n});function O({phone:r,list:n,reading:t,intelligence:o,hasThread:s=!1}){const e=u.useContext(c);if(!e)return a.jsx(i,{});const l={nav:e.nav,overlay:e.overlay,skeleton:a.jsx(i,{}),isLoading:e.isLoading,navOpen:e.navOpen,onOpenNav:e.onOpenNav,onCloseNav:e.onCloseNav};return e.isSinglePane?a.jsx(p,{...l,list:r,intelligenceOpen:e.intelligenceOpen}):a.jsx(p,{...l,topBar:e.topBar,list:n,reading:t,intelligence:o,intelligenceOpen:e.intelligenceOpen,hasThread:s})}function S(r,n,t){if(r!==n)return t}function d(r,n){return r===""?"":n}function g({searchInput:r,committedQuery:n,urlQuery:t,pathname:o,listPath:s}){return!f(o,s)||n!==r?!1:n!==t}export{h as M,O as a,g as b,d as c,S as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,_ as o}from"./index-CJnB8f3k.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as L,bI as d,q as n,ad as l,bJ as p,r as o,bK as y,bL as c,bM as g}from"./index-CJnB8f3k.js";const u=e=>y({path:{accountId:e}}),f=e=>{const r=L({...d({path:{accountId:e??""}}),enabled:!!e});return{labels:r.data?.items??[],isPending:r.isPending,isError:r.isError,error:r.error,refetch:r.refetch}},m=e=>{const r=n(),t=l({...p(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutateAsync:s}=t;return{createLabel:o.useCallback((a,i="Default")=>e?s({path:{accountId:e},body:{name:a,color:i}}):Promise.reject(new Error("No account")),[e,s]),isPending:t.isPending,isError:t.isError,error:t.error,reset:t.reset}},h=e=>{const r=n(),t=l({...c(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{updateLabel:o.useCallback((a,i)=>{e&&s({path:{accountId:e,labelId:a},body:i})},[e,s]),isPending:t.isPending,updatingLabelId:t.isPending?t.variables?.path.labelId:void 0}},C=e=>{const r=n(),t=l({...g(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{deleteLabel:o.useCallback(a=>{e&&s({path:{accountId:e,labelId:a}})},[e,s]),isPending:t.isPending,deletingLabelId:t.isPending?t.variables?.path.labelId:void 0}};export{f as a,h as b,C as c,m as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as L,ab as C,ad as E,bC as I,bD as k,r as x,j as p,bE as h,bF as A,bG as j,n as R,w as D,bH as Q}from"./index-CJnB8f3k.js";import{ap as q,aq as O,ar as _,as as z,at as N}from"./MailListHeader-C9wj024y.js";import{a as P}from"./useLabels-HGxt9ahb.js";import{M as w}from"./enums-CCxx0t2v.js";import{u as F,s as G}from"./search-scope-YZoKowSP.js";import{n as U}from"./search-query-Cr_ZXBCp.js";import{u as B,p as H}from"./useSearchTokenContext-CwRxhOKm.js";const K=t=>{const{mailboxId:s,messages:i}=t,l=L(),{pushError:c}=C(),{mutateAsync:r,isPending:a}=E({...k(),onError:(o,u)=>{c({title:u.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:I(o),error:o})},onSettled:(o,u,m)=>{q(l,O(_(m.body.messageIds??[],i??[],s)))}});return{applyLabel:x.useCallback((o,u,m)=>{o.length!==0&&z(o,d=>r({body:{messageIds:d,labelId:u,action:m}}))},[r]),isPending:a}};function oe({accountId:t,mailboxId:s,messageIds:i}){const{labels:l}=P(t),{applyLabel:c}=K({mailboxId:s}),r=x.useMemo(()=>l.map(a=>({key:a.labelId,label:a.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${A(a.color)?h[a.color]:h.Default}`}),onSelect:()=>c(i,a.labelId,"Apply")})),[l,i,c]);return r.length===0?null:p.jsx(N,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(j,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:r,align:"start",nested:!0,touch:!1,triggerClassName:"min-h-11 w-full justify-start gap-3 px-4 py-2.5 text-sm font-normal text-fg"})}const V=20,$=new Set(Object.values(w)),J=t=>t!==void 0&&$.has(t)?t:void 0,W=t=>{if(t.some(s=>s.type==="isUnread"))return!1;if(t.some(s=>s.type==="isRead"))return!0};function ne({mailboxId:t,filterCategory:s}={}){const{searchQuery:i}=R(),l=B(),c=F({select:e=>e.matches}),r=U(i),{freeText:a,tokens:n}=H(r,l),o=a.length>0,u=n.find(e=>e.type==="category"),m=J(s)??u?.category,d=n.some(e=>e.type==="hasAttachment")?!0:void 0,b=n.some(e=>e.type==="isStarred")?!0:void 0,y=W(n),f=n.find(e=>e.type==="after"),g=n.find(e=>e.type==="before"),S=n.find(e=>e.type==="in"),M=G({matches:c,callerMailboxId:t,inTokenMailboxId:S?.mailboxId}),{data:T,isLoading:v}=D({...Q({query:{query:a,mailboxId:M,limit:V,...m!==void 0?{category:m}:{},...d!==void 0?{hasAttachment:d}:{},...b!==void 0?{hasStars:b}:{},...y!==void 0?{isRead:y}:{},...f?{sentDateFrom:f.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:o,staleTime:6e4});return{hits:T?.items??[],isLoading:o&&v}}export{oe as L,ne as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as g,ab as f,w as p,W as m,r,ad as y,ae as T,$ as E,af as d}from"./index-CJnB8f3k.js";const i={html:"",plainText:""},C=e=>{const u=g(),{pushError:o}=f(),{data:n}=p({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(s=>s.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),a=y({...d(),onSuccess:()=>{u.invalidateQueries({queryKey:E()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),c=r.useCallback((t,s)=>{e&&a.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:s}})},[e,a]);return{signature:l,setSignature:c,isSaving:a.isPending}};export{C as u};
|