@remit/web-client-dist 0.0.468 → 0.0.469
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-C_QC3eVR.js +1 -0
- package/assets/{ErrorState-B1mR3jCT.js → ErrorState-BERqUrds.js} +1 -1
- package/assets/FlaggedPane-CtiSf_Zn.js +1 -0
- package/assets/{FullCompose-Br0mcbGw.js → FullCompose-CY7NE8Z8.js} +1 -1
- package/assets/MailListHeader-d5-g3D2Z.js +7 -0
- package/assets/{MailShell-CUim8dj6.js → MailShell-CN8HeoUf.js} +1 -1
- package/assets/{MailViewChrome-D9aV_9be.js → MailViewChrome-D17fhkFG.js} +1 -1
- package/assets/MailboxPane-BMaqeE9Z.js +1 -0
- package/assets/{NavMenuButton-BQ9-rzur.js → NavMenuButton-UqKl731P.js} +1 -1
- package/assets/{OnboardingWizard-5emWPpUT.js → OnboardingWizard-PKG6nvMI.js} +1 -1
- package/assets/{OutboxPane-32Q9m5ko.js → OutboxPane-Bz-Hbcno.js} +1 -1
- package/assets/_mailboxId-CZRsATWK.js +1 -0
- package/assets/_messageId-Ci6WlaAY.js +1 -0
- package/assets/_messageId-CsyC2TjA.js +1 -0
- package/assets/_messageId-DAw9hrFE.js +1 -0
- package/assets/_outboxMessageId-Cu5BhWzs.js +1 -0
- package/assets/_threadId-CClAuUEl.js +1 -0
- package/assets/_threadId-CDBTv4_2.js +1 -0
- package/assets/_threadId-Cq952goT.js +1 -0
- package/assets/{accounts-BhVAc8yw.js → accounts-41KqLgYa.js} +1 -1
- package/assets/{advanced-DUSGDBfK.js → advanced-Cui6L2Ha.js} +1 -1
- package/assets/{appearance-BbkweWeP.js → appearance-BZsMumup.js} +1 -1
- package/assets/{attachment-file-DEH4WgYf.js → attachment-file-DfVAahne.js} +1 -1
- package/assets/{avatar-BBglc2I4.js → avatar-BQ7sLnCR.js} +1 -1
- package/assets/{bottom-sheet-OpVokgSv.js → bottom-sheet-CgbOHOQS.js} +1 -1
- package/assets/{brief-CrRSkqlA.js → brief-BBqfLXje.js} +1 -1
- package/assets/brief-CSab0sDo.js +1 -0
- package/assets/{browser-ponyfill-Df7n_1sC.js → browser-ponyfill-BxVYMRGN.js} +1 -1
- package/assets/{bug-D_fNRScy.js → bug-Bzl2VFgt.js} +1 -1
- package/assets/{circle-check-Baq2FWDe.js → circle-check-D3aoKigg.js} +1 -1
- package/assets/{circle-check-big-CXwm43TJ.js → circle-check-big-BwIbv7rj.js} +1 -1
- package/assets/{circle-help-CM8xpE1V.js → circle-help-PPdw9Jsy.js} +1 -1
- package/assets/{clock-BQeXEzQF.js → clock-DsrNyB8f.js} +1 -1
- package/assets/compose._-_outboxMessageId_-CBOLml6o.js +1 -0
- package/assets/compose._-_outboxMessageId_-Cahn8ibl.js +1 -0
- package/assets/compose._-_outboxMessageId_-DoT_e_gI.js +1 -0
- package/assets/compose._-_outboxMessageId_-to_omsW7.js +1 -0
- package/assets/{confirm-dialog-GmPoGhCn.js → confirm-dialog-4qhyVNku.js} +1 -1
- package/assets/{download-EfcHBuh8.js → download-B3TzbRCb.js} +1 -1
- package/assets/{filters-DidFDGTV.js → filters-0vfn3KrZ.js} +1 -1
- package/assets/{flagged-utTyqiq-.js → flagged-6nenq6aO.js} +1 -1
- package/assets/flagged-B3E76kjm.js +1 -0
- package/assets/{folders-Cef6uriX.js → folders-ByEy3mG2.js} +1 -1
- package/assets/{format-3KE4u_Hd.js → format-BE0VVZUg.js} +1 -1
- package/assets/{help-copy-CtXPXqHY.js → help-copy-MxNDSTV2.js} +1 -1
- package/assets/index-2QHoji9M.js +1 -0
- package/assets/{index-B_8e-R9R.js → index-BwuLGpux.js} +3 -3
- package/assets/index-Ci6WlaAY.js +1 -0
- package/assets/index-CsyC2TjA.js +1 -0
- package/assets/index-Cz2B5sbc.js +1 -0
- package/assets/index-DGGWePJ1.js +1 -0
- package/assets/index-EnalpmAp.js +1 -0
- package/assets/index-G2tExsch.js +1 -0
- package/assets/{index-BWDUs3V6.js → index-gnNPLb5t.js} +4 -4
- package/assets/index-o6IagACw.js +1 -0
- package/assets/{kbd-B38YZfep.js → kbd-CzUFlqaQ.js} +1 -1
- package/assets/{labels-CCi4LQfv.js → labels-STGynaKL.js} +1 -1
- package/assets/mail-BTcIHE0i.js +1 -0
- package/assets/{mail-BWE-pYx5.js → mail-D6MNzC5w.js} +1 -1
- package/assets/{menu-5hCLgFBH.js → menu-BezNx-_C.js} +1 -1
- package/assets/{onboarding-DDciFWNb.js → onboarding-BuR-aSf1.js} +1 -1
- package/assets/outbox-CCHCIK1w.js +1 -0
- package/assets/{pencil-YuDLXsRQ.js → pencil-B2IgJ1C0.js} +1 -1
- package/assets/{rich-text-CfSZ-p4W.js → rich-text-C6r9pITz.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-CgGcVVZ7.js → rich-text-spellcheck-worker-provider-CsQ6xRPy.js} +1 -1
- package/assets/{rotate-ccw-XBZJu6qP.js → rotate-ccw-BArtedIq.js} +1 -1
- package/assets/{row-actions-oBe5D2si.js → row-actions-BISz53Q3.js} +1 -1
- package/assets/{search-mirror-CykJ2cWs.js → search-mirror-OLPAuG_e.js} +1 -1
- package/assets/search-token-index-B_LZD8dU.js +1 -0
- package/assets/{senders-DtECYsWd.js → senders-BipaoG42.js} +1 -1
- package/assets/settings-B3yxCAqu.js +1 -0
- package/assets/{settings-screen-DAIjg4OV.js → settings-screen-BJA__16w.js} +1 -1
- package/assets/{shield-check-lGPCGnQJ.js → shield-check-D7tRDAxF.js} +1 -1
- package/assets/{suggested-vips-DxtB-62O.js → suggested-vips-BZ3lDRnO.js} +1 -1
- package/assets/{useDebouncedValue-s7snq_EM.js → useDebouncedValue-CLBaPD2p.js} +1 -1
- package/assets/{useFilters-gaAKlbPF.js → useFilters-Bw_BFt7Q.js} +1 -1
- package/assets/{useLabels-B3A1qgdI.js → useLabels-D7-SqNtw.js} +1 -1
- package/assets/{useMessageBodyContent-DS0NFpSx.js → useMessageBodyContent-BVvq5Osk.js} +1 -1
- package/assets/{useQueries-C3zqiHO-.js → useQueries-B00yuP8q.js} +1 -1
- package/assets/useRefreshControl-B5aomXDv.js +1 -0
- package/assets/{useSearchTokenContext-w53PxiHs.js → useSearchTokenContext-BUAmn1Pp.js} +1 -1
- package/assets/useSemanticSearch-CQDDmATk.js +1 -0
- package/assets/{useSignature-DW3HxNEu.js → useSignature-ClYkVKoW.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/BriefPane-DLK5k99W.js +0 -1
- package/assets/FlaggedPane-DI6-ax2Z.js +0 -1
- package/assets/MailListHeader-C9Ahbu_k.js +0 -7
- package/assets/MailboxPane-Dj528iUI.js +0 -1
- package/assets/_mailboxId-BMhZ77qu.js +0 -1
- package/assets/_messageId-BCIXHmXz.js +0 -1
- package/assets/_messageId-H07H7Eex.js +0 -1
- package/assets/_messageId-mRH07OoH.js +0 -1
- package/assets/_outboxMessageId-9cyseXBF.js +0 -1
- package/assets/_threadId-DIaDNMTt.js +0 -1
- package/assets/_threadId-DV5G2S4v.js +0 -1
- package/assets/_threadId-DWlFkjM3.js +0 -1
- package/assets/brief-cxgK-E6D.js +0 -1
- package/assets/compose._-_outboxMessageId_-3wpqxHI6.js +0 -1
- package/assets/compose._-_outboxMessageId_-CPMXxUi_.js +0 -1
- package/assets/compose._-_outboxMessageId_-DWeiwO6s.js +0 -1
- package/assets/compose._-_outboxMessageId_-DndQVaa2.js +0 -1
- package/assets/flagged-BhTGWo0c.js +0 -1
- package/assets/index-BeNI6neR.js +0 -1
- package/assets/index-CLDF_4HA.js +0 -1
- package/assets/index-CzK-6vhR.js +0 -1
- package/assets/index-DEO1VWcT.js +0 -1
- package/assets/index-DyGkymdi.js +0 -1
- package/assets/index-H07H7Eex.js +0 -1
- package/assets/index-cMzfCNd2.js +0 -1
- package/assets/index-mRH07OoH.js +0 -1
- package/assets/mail-Cg3Fw05o.js +0 -1
- package/assets/outbox-_x6GAjiP.js +0 -1
- package/assets/search-token-index-CqhHYEC3.js +0 -1
- package/assets/settings-DhIrOkty.js +0 -1
- package/assets/useRefreshControl-oC0K6m0h.js +0 -1
- package/assets/useSemanticSearch-BK6xhcs8.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bz as Ts,bA as js,j as r,bB as ws,aF as dt,B as te,S as ks,b as Ee,aG as Pt,r as c,C as Ms,d as Rs,ba as Es,x as It,D as Tt,E as As,ak as jt,bC as Os,bD as Ns,I as zs,h as Fs,T as Bt,bE as Ds,b5 as Ls,bF as _s,bG as Ps,ai as $t,aT as Bs,aU as $s,g as Ws,a7 as wt,bH as Ks,Z as Wt,b8 as Vs,z as Hs,b9 as qs,aQ as Us,bI as Qs,a6 as Js,bJ as Gs,bK as Ys,bL as Xs,bM as Zs,bN as en,v as Kt,bO as tn,K as sn,bP as nn,bQ as on,a9 as rn,bR as an,bj as ln}from"./index-BWDUs3V6.js";import{u as cn,p as dn,R as un}from"./useSearchTokenContext-w53PxiHs.js";import{u as hn,a as fn,R as mn}from"./useRefreshControl-oC0K6m0h.js";import{C as Vt,a as Ht,c as qt,j as gn,M as pn,t as Ut,u as xn,b as bn,d as Qt,e as Jt,f as vn,g as Sn,h as yn,r as Cn,n as In,i as Tn,k as jn,l as wn,m as kn,o as Mn,S as Rn,p as En,D as An,q as On,s as Nn,v as Gt,w as zn,x as Fn,y as Dn,z as Ln,A as _n,B as Yt,E as Pn,F as Bn,G as $n,H as Wn,I as Kn,J as Vn,K as Hn,L as qn,N as Nt,O as zt,P as Un,Q as Qn,R as Jn,T as Gn,U as Yn,V as Xn,W as Zn,X as eo,Y as to,Z as so,_ as no,$ as oo,a0 as Xt,a1 as Zt,a2 as es,a3 as io,a4 as ro,a5 as ao,a6 as ts,a7 as lo,a8 as co,a9 as uo}from"./MailListHeader-C9Ahbu_k.js";import{S as ho,M as fo,a as mo,u as go,b as po}from"./MailViewChrome-D9aV_9be.js";import{A as kt}from"./avatar-BBglc2I4.js";import{b as Qe,d as xo,c as ss}from"./format-3KE4u_Hd.js";import{b as bo,c as vo,a as So,u as yo}from"./useMessageBodyContent-DS0NFpSx.js";import{j as Je,k as Co,l as Io,m as To,e as jo,n as wo}from"./search-token-index-CqhHYEC3.js";import{N as ko}from"./NavMenuButton-BQ9-rzur.js";import{C as Mo}from"./confirm-dialog-GmPoGhCn.js";import{f as Ro}from"./ErrorState-B1mR3jCT.js";import{a as Eo}from"./useLabels-B3A1qgdI.js";import{L as Ao,r as Oo,u as No}from"./useSemanticSearch-BK6xhcs8.js";import{S as ut}from"./shield-check-lGPCGnQJ.js";import{B as zo}from"./bottom-sheet-OpVokgSv.js";import{C as Fo}from"./circle-help-CM8xpE1V.js";import{C as Do}from"./circle-check-Baq2FWDe.js";import{n as Lo}from"./search-query-Cr_ZXBCp.js";import{u as _o}from"./index-B_8e-R9R.js";const Po=({children:e,onRefresh:n,isRefreshing:t})=>Ts(js)?e:r.jsx(ws,{onRefresh:n,isPullable:!t,children:e}),Bo=e=>e===1?"message":"messages";function $o({count:e,onReview:n,onDismiss:t,actionLabel:s="Review & rescue"}){return r.jsx(dt,{tone:"info",variant:"soft",onDismiss:t,children:r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("p",{className:"flex items-start gap-2 text-sm text-fg",children:[r.jsx(ut,{className:"mt-0.5 size-4 shrink-0 text-positive","aria-hidden":!0}),r.jsxs("span",{children:[r.jsx("span",{className:"font-semibold text-fg",children:`${e} ${Bo(e)} here`})," ","may not be spam — they're from senders we can verify."]})]}),r.jsx(te,{variant:"primary",size:"sm",onClick:n,className:"self-start",children:s})]})})}const Wo=(e,n)=>e==="vip"?"vip":e==="unknown"&&n==="md"?"unknown-pill":"hidden",ns=({senderTrust:e,size:n="sm",className:t})=>{const s=Wo(e,n);return s==="vip"?r.jsx(ks,{className:Ee("text-warning shrink-0",n==="sm"&&"size-3.5",n==="md"&&"size-4",t),"aria-label":"VIP sender","data-testid":"sender-trust-vip"}):s==="unknown-pill"?r.jsx("span",{className:Ee("inline-flex items-center rounded border border-dashed border-fg-subtle/40 font-medium uppercase tracking-wide text-fg-muted/80 shrink-0","px-2 py-0.5 text-xs",t),title:"First message from this sender","aria-label":"First message from this sender","data-testid":"sender-trust-unknown",children:"new"}):null};function Ko({candidate:e,selected:n,onToggle:t,hideSender:s=!1}){const{senderName:o,senderAddress:i,subject:l,snippet:a,trustReason:d,trustSubReason:u,senderTrust:h}=e;return r.jsxs("label",{className:Ee("flex w-full cursor-pointer items-start gap-3 px-3 py-2.5 text-left transition-colors",s&&"pl-11",n?"bg-positive/10":"bg-surface hover:bg-surface-sunken"),children:[r.jsx(Vt,{className:"mt-0.5",checked:n,onChange:t,"aria-label":`${n?"Deselect":"Select"} ${s?l:`message from ${o}`}`}),!s&&r.jsx(kt,{name:o,email:i,size:"sm"}),r.jsxs("span",{className:"min-w-0 flex-1",children:[!s&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"truncate text-sm font-medium text-fg",children:o}),h&&r.jsx(ns,{senderTrust:h,size:"sm"}),r.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:i})]}),r.jsx("span",{className:"block truncate text-sm text-fg-muted",children:l}),r.jsx("span",{className:"block line-clamp-1 text-xs text-fg-subtle",children:a}),!s&&r.jsxs("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.jsxs(Pt,{tone:"positive",children:[r.jsx(ut,{className:"size-3","aria-hidden":!0}),d]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:u})]})]})]})}const Vo=e=>{const n=new Map,t=[];for(const s of e){const o=(s.senderAddress||s.senderName).toLowerCase(),i=n.get(o);if(i){i.messages.push(s);continue}n.set(o,{key:o,senderName:s.senderName,senderAddress:s.senderAddress,trustReason:s.trustReason,trustSubReason:s.trustSubReason,senderTrust:s.senderTrust,messages:[s]}),t.push(o)}return t.map(s=>n.get(s)).sort((s,o)=>o.messages.length-s.messages.length)},Ho=(e,n)=>{const t=e.messages.filter(s=>n.has(s.id)).length;return t===0?"none":t===e.messages.length?"all":"some"},Ft=e=>e===1?"message":"messages";function qo({group:e,selected:n,onToggleGroup:t,onToggleMessage:s}){const[o,i]=c.useState(!1),l=Ho(e,n),a=e.messages.length,d=o?Ms:Rs;return r.jsxs("div",{className:Ee(l!=="none"?"bg-positive/10":"bg-surface"),children:[r.jsxs("div",{className:"flex w-full items-start gap-3 px-3 py-2.5",children:[r.jsx(Vt,{className:"mt-0.5",checked:l==="all",indeterminate:l==="some",onChange:()=>t(e,l!=="all"),"aria-label":`${l==="all"?"Deselect":"Select"} all ${a} ${Ft(a)} from ${e.senderName}`}),r.jsx(kt,{name:e.senderName,email:e.senderAddress,size:"sm"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"truncate text-sm font-medium text-fg",children:e.senderName}),e.senderTrust&&r.jsx(ns,{senderTrust:e.senderTrust,size:"sm"}),r.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:e.senderAddress})]}),r.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.jsxs(Pt,{tone:"positive",children:[r.jsx(ut,{className:"size-3","aria-hidden":!0}),e.trustReason]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:e.trustSubReason})]})]}),r.jsxs("button",{type:"button",onClick:()=>i(u=>!u),"aria-expanded":o,className:"flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-2xs text-fg-muted transition-colors hover:bg-surface-sunken hover:text-fg",children:[`${a} ${Ft(a)}`,r.jsx(d,{className:"size-3.5","aria-hidden":!0})]})]}),o&&r.jsx("div",{className:"divide-y divide-line border-t border-line",children:e.messages.map(u=>r.jsx(Ko,{candidate:u,selected:n.has(u.id),onToggle:()=>s(u.id),hideSender:!0},u.id))})]})}const Mt=e=>e===1?"message":"messages",Uo=(e,n)=>`Moves ${e===1?"this message":`these ${e} ${Mt(e)}`} out of Spam to ${n} now. Nothing later.`,Ct=(e,n)=>e.find(t=>t.id===n)?.label??"Inbox";function Qo(){return r.jsx(dt,{tone:"info",variant:"soft",children:r.jsx("p",{className:"text-2xs text-fg-muted",children:"We list a message here only when we can confirm the sender is who they say — usually someone you've emailed before, write to often, or a service that consistently checks out. We never guess from words in the subject. Anything we can't confirm stays in Spam."})})}function Jo({candidates:e,selected:n,onToggle:t,onToggleGroup:s,onSelectAll:o,onSelectNone:i,onContinue:l,onCancel:a}){const[d,u]=c.useState(!1),h=n.size,g=c.useMemo(()=>Vo(e),[e]);return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"px-row-inset pb-2 pt-1",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("h2",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[r.jsx(ut,{className:"size-4 text-positive","aria-hidden":!0}),"Rescue from Spam"]}),r.jsx(te,{variant:"ghost",size:"sm",icon:r.jsx(Fo,{className:"size-3.5"}),onClick:()=>u(m=>!m),className:"-mr-1.5 -mt-0.5",children:"Why these?"})]}),r.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"These look safe — from senders we can verify. Uncheck any sender that belongs in Spam, or open a sender to pick individual messages."}),d&&r.jsx("div",{className:"mt-2",children:r.jsx(Qo,{})})]}),r.jsxs("div",{className:"flex items-center justify-between px-row-inset pb-1.5",children:[r.jsx("span",{className:"text-2xs font-medium text-fg-muted",children:`${h} of ${e.length} selected · ${g.length} ${g.length===1?"sender":"senders"}`}),r.jsxs("span",{className:"flex gap-1",children:[r.jsx(te,{variant:"ghost",size:"sm",onClick:o,children:"Select all"}),r.jsx(te,{variant:"ghost",size:"sm",onClick:i,children:"Select none"})]})]}),r.jsx("div",{className:"min-h-0 flex-1 divide-y divide-line overflow-y-auto border-y border-line",children:g.map(m=>r.jsx(qo,{group:m,selected:n,onToggleGroup:s,onToggleMessage:t},m.key))}),r.jsxs("div",{className:"space-y-2 border-t border-line bg-surface px-row-inset py-3",children:[r.jsx(te,{variant:"primary",onClick:l,className:"h-11 w-full font-semibold",children:`Continue with ${h} ${Mt(h)}`}),r.jsx(te,{variant:"ghost",onClick:a,className:"h-11 w-full",children:"Cancel"})]})]})}function Go({count:e,folders:n,delimiter:t,destination:s,onPick:o,onMove:i,onBack:l}){const[a,d]=c.useState(!1);return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"px-row-inset pb-2 pt-1",children:[r.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Where should they go?"}),r.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"Pick a folder, then we move them out of Spam."})]}),r.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto px-row-inset py-2",children:a?r.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden rounded-xl border border-line bg-surface",children:r.jsx(Es,{folders:n,selectedId:s,delimiter:t,onSelect:o,onCancel:()=>d(!1)})}):r.jsxs("div",{className:"rounded-xl border border-line bg-surface-sunken p-3",children:[r.jsx("p",{className:"text-2xs text-fg-subtle",children:"Destination"}),r.jsx("p",{className:"mt-0.5 text-sm font-medium text-fg",children:Ct(n,s)}),r.jsx(te,{variant:"ghost",size:"sm",onClick:()=>d(!0),className:"mt-2 px-0",children:"Move to a different folder"})]})}),r.jsxs("div",{className:"space-y-2 border-t border-line bg-surface px-row-inset py-3",children:[r.jsx("p",{className:"text-2xs text-fg-subtle",children:Uo(e,Ct(n,s))}),r.jsx(te,{variant:"primary",onClick:i,className:"h-11 w-full font-semibold",children:`Move ${e} out of Spam`}),r.jsx(te,{variant:"ghost",onClick:l,className:"h-11 w-full",children:"Back"})]})]})}function Yo({count:e,destinationLabel:n,onClose:t}){return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-row-inset py-10 text-center",children:[r.jsx(Do,{className:"size-10 text-positive","aria-hidden":!0}),r.jsx("p",{className:"text-base font-semibold text-fg",children:`Moved ${e} ${Mt(e)} out of Spam.`}),r.jsx("p",{className:"text-2xs text-fg-subtle",children:`You'll find them in ${n}.`})]}),r.jsx("div",{className:"border-t border-line bg-surface px-row-inset py-3",children:r.jsx(te,{variant:"primary",onClick:t,className:"h-11 w-full font-semibold",children:"Done"})})]})}function Xo({open:e,candidates:n,defaultDestinationId:t,availableFolders:s,delimiter:o,onConfirmMove:i,onCancel:l}){const[a,d]=c.useState("review"),[u,h]=c.useState(()=>e?new Set(n.map(I=>I.id)):new Set),[g,m]=c.useState(t),[p,C]=c.useState(0),b=c.useRef(!1);c.useEffect(()=>{e&&!b.current&&(d("review"),h(new Set(n.map(I=>I.id))),m(t),C(0)),b.current=e},[e,n,t]);const w=u.size,v=I=>{h(T=>{const E=new Set(T);return E.has(I)?E.delete(I):E.add(I),E})},x=(I,T)=>{h(E=>{const A=new Set(E);for(const L of I.messages)T?A.add(L.id):A.delete(L.id);return A})},k=()=>{const I=Array.from(u);C(I.length),i(I,g),d("done")};return r.jsxs(zo,{open:e,onClose:l,dismissLabel:"Close rescue",children:[a==="review"&&r.jsx(Jo,{candidates:n,selected:u,onToggle:v,onToggleGroup:x,onSelectAll:()=>h(new Set(n.map(I=>I.id))),onSelectNone:()=>h(new Set),onContinue:()=>d("destination"),onCancel:l}),a==="destination"&&r.jsx(Go,{count:w,folders:s,delimiter:o,destination:g,onPick:m,onMove:k,onBack:()=>d("review")}),a==="done"&&r.jsx(Yo,{count:p,destinationLabel:Ct(s,g),onClose:l})]})}function Zo(e){const n=e.toAddresses.join(", ");return{id:e.outboxMessageId,accountId:e.accountId,fromName:e.fromName??e.fromAddress??"Me",fromEmail:e.fromAddress??"",subject:e.subject??"(No subject)",snippet:n?`To: ${n}`:"(No recipients)",timeLabel:Qe(e.updatedAt),isRead:!0}}function ei(e){return{id:e.messageId,accountId:e.accountId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Qe(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0}}function ti({outboxMessages:e,accountId:n,imapThreads:t}){const s=e.filter(l=>l.status==="draft"&&l.accountId===n).map(Zo),o=t.map(ei),i=[];return s.length>0&&i.push({id:"remit-drafts",label:"Not yet sent (Remit)",threads:s}),o.length>0&&i.push({id:"imap-drafts",label:"On the server",threads:o}),i}const si=({label:e,count:n})=>r.jsxs("div",{className:"sticky top-0 z-10 flex items-baseline justify-between border-b border-line bg-surface-sunken px-row-inset py-1",children:[r.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:e}),r.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:n})]}),ni=({row:e,isSelected:n,onOpen:t,onDelete:s,isDeleting:o})=>r.jsxs("button",{type:"button",onClick:()=>t(e.id),className:Ee("group",qt({active:n})),children:[r.jsx(Fs,{className:"size-7 shrink-0 text-fg-muted mt-0.5"}),r.jsx(Ht,{thread:e}),r.jsx("div",{className:"flex items-center gap-1 shrink-0",children:r.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),s(e.id)},disabled:o,className:"p-1.5 rounded-md text-fg-muted hover:text-danger hover:bg-surface-raised transition-colors opacity-0 group-hover:opacity-100 focus:opacity-100",title:"Delete draft",children:r.jsx(Bt,{className:"size-3.5"})})})]}),oi=({row:e,isSelected:n,onOpen:t})=>{const s=!e.isRead;return r.jsxs("button",{type:"button",onClick:()=>t(e.id),className:Ee("group",qt({active:n})),children:[s&&r.jsx("span",{className:"absolute left-1.5 top-1/2 size-1.5 -translate-y-1/2 rounded-full bg-accent"}),r.jsx(kt,{name:e.fromName,email:e.fromEmail,size:"sm"}),r.jsx(Ht,{thread:e})]})};function ii({accountId:e,selectedMessageId:n,imapThreads:t,title:s,unreadCount:o}){const i=bo(),l=vo(),a=Je(),d=It(),{data:u}=Tt(As()),h=c.useMemo(()=>ti({outboxMessages:u?.items??[],accountId:e,imapThreads:t}),[u?.items,e,t]),g=jt({...Ns(),onSuccess:()=>{d.invalidateQueries({queryKey:Os()})}}),m=b=>{g.mutate({path:{outboxMessageId:b}})},p=b=>{const w=t.find(v=>v.messageId===b)?.threadId;w&&a({threadId:w,messageId:b})},C=h.length===0;return r.jsxs("section",{className:"flex h-full w-full flex-col bg-surface",children:[r.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[r.jsx(ko,{}),r.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:s}),(o??0)>0&&r.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:[o," unread"]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:C?r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-center px-4",children:[r.jsx(zs,{className:"size-8 text-fg-subtle"}),r.jsx("p",{className:"text-sm font-medium text-fg",children:"No drafts"}),r.jsx("p",{className:"text-xs text-fg-subtle",children:"Messages you start composing will appear here."})]}):h.map(b=>r.jsxs("div",{children:[b.label&&r.jsx(si,{label:b.label,count:b.threads.length}),r.jsx("div",{className:"divide-y divide-line",children:b.threads.map(w=>b.id==="remit-drafts"?r.jsx(ni,{row:w,isSelected:w.id===i,onOpen:l,onDelete:m,isDeleting:g.isPending},w.id):r.jsx(oi,{row:w,isSelected:w.id===n,onOpen:p},w.id))})]},b.id))})]})}const os=e=>e===1?"1 message":`${ss(e)} messages`,ri=e=>({title:"Empty Trash?",description:`${os(e)} ${e===1?"is":"are"} erased from the mail server and cannot be restored.`,confirmLabel:"Empty Trash"}),ai=(e,n={})=>{const{trashFolderLabel:t,staleFolderLabel:s}=n;if(e==="unconfirmed"){const o=xo(0,"unconfirmed",{trashFolderLabel:t});return{headline:o.title,body:o.description,actionLabel:o.confirmLabel}}return e==="stale"?{headline:"Nothing was emptied.",body:s?`The folder you chose for Trash — ${s} — is gone from the mail server.`:"The folder you chose for Trash is gone from the mail server.",actionLabel:"Pick another folder"}:{headline:"Nothing was emptied.",body:"No folder on this account is set as Trash.",actionLabel:"Pick a folder"}};function li({messageCount:e,isEmptying:n,deletedCount:t,refusalReason:s,trashFolderLabel:o,staleFolderLabel:i,onEmpty:l,onRepair:a,children:d}){const[u,h]=c.useState(!1);if(e<1&&s===void 0&&t===void 0)return r.jsx(r.Fragment,{children:d});const g=s?ai(s,{trashFolderLabel:o,staleFolderLabel:i}):void 0,m=ri(e);return r.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[r.jsx("div",{className:"shrink-0 px-row-inset pt-2",children:r.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-line px-3 py-2",children:[r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[t!==void 0&&r.jsx("p",{className:"mr-auto text-2xs text-fg-subtle",role:"status",children:`${os(t)} erased from the mail server.`}),r.jsx(te,{variant:"ghost",size:"sm",icon:r.jsx(Bt,{className:"size-3.5","aria-hidden":!0}),disabled:n||e<1,"aria-busy":n,onClick:()=>h(!0),children:n?"Emptying…":"Empty Trash"})]}),g&&r.jsx(dt,{tone:"warning",variant:"soft",children:r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx("p",{className:"font-semibold text-fg",children:g.headline}),r.jsx("p",{className:"text-sm",children:g.body}),r.jsx(te,{variant:"primary",size:"sm",className:"self-start",onClick:a,children:g.actionLabel})]})})]})}),r.jsx("div",{className:"min-h-0 flex-1",children:d}),r.jsx(Mo,{isOpen:u,title:m.title,description:m.description,confirmLabel:m.confirmLabel,destructive:!0,onConfirm:()=>{h(!1),l()},onCancel:()=>h(!1)})]})}function ci(e,n,t){const s=new Array(e);return new Proxy(s,{get(o,i,l){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const d=+i;if(Number.isInteger(d)&&d>=0&&d<e){let u=o[d];if(!u){const h=n[d*2];u=o[d]={index:d,key:t(d),start:h,size:n[d*2+1],end:h+n[d*2+1],lane:0}}return u}}if(i==="length")return e}return Reflect.get(o,i,l)}})}function _e(e,n,t){let s=t.initialDeps??[],o,i=!0;function l(){const a=e();return(a.length!==s.length||a.some((u,h)=>s[h]!==u))&&(s=a,o=n(...a),t?.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(o),i=!1),o}return l.updateDeps=a=>{s=a},l}function Dt(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const di=(e,n)=>Math.abs(e-n)<1.01,ui=(e,n,t)=>{let s;return function(...o){e.clearTimeout(s),s=e.setTimeout(()=>n.apply(this,o),t)}};let Ue;const St=()=>{if(Ue!==void 0)return Ue;if(typeof navigator>"u")return Ue=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ue=!0;const e=navigator.maxTouchPoints;return Ue=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Lt=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},hi=e=>e,fi=e=>{const n=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,o=new Array(s);for(let i=0;i<s;i++)o[i]=n+i;return o},mi=(e,n)=>{const t=e.scrollElement;if(!t)return;const s=e.targetWindow;if(!s)return;const o=l=>{const{width:a,height:d}=l;n({width:Math.round(a),height:Math.round(d)})};if(o(Lt(t)),!s.ResizeObserver)return()=>{};const i=new s.ResizeObserver(l=>{const a=()=>{const d=l[0];if(d?.borderBoxSize){const u=d.borderBoxSize[0];if(u){o({width:u.inlineSize,height:u.blockSize});return}}o(Lt(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},ct={passive:!0},gi=typeof window>"u"?!0:"onscrollend"in window,pi=(e,n,t)=>{const s=e.scrollElement;if(!s)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&gi;let l=0;const a=i?null:ui(o,()=>n(l,!1),e.options.isScrollingResetDelay),d=g=>()=>{l=t(s),a?.(),n(l,g)},u=d(!0),h=d(!1);return s.addEventListener("scroll",u,ct),i&&s.addEventListener("scrollend",h,ct),()=>{s.removeEventListener("scroll",u),i&&s.removeEventListener("scrollend",h)}},xi=(e,n)=>pi(e,n,t=>{const{horizontal:s,isRtl:o}=e.options;return s?t.scrollLeft*(o&&-1||1):t.scrollTop}),bi=(e,n,t)=>{if(t.options.useCachedMeasurements){const s=t.indexFromElement(e),o=t.options.getItemKey(s);return t.itemSizeCache.get(o)??t.options.estimateSize(s)}if(n?.borderBoxSize){const s=n.borderBoxSize[0];if(s)return Math.round(s[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const s=t.indexFromElement(e),o=t.options.getItemKey(s),i=t.itemSizeCache.get(o);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},vi=(e,{adjustments:n=0,behavior:t},s)=>{var o,i;(i=(o=s.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[s.options.horizontal?"left":"top"]:e+n,behavior:t})},Si=vi;class yi{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,s,o;return((o=(s=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:s.now)==null?void 0:o.call(s))??Date.now()},this.observer=(()=>{let t=null;const s=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const l=()=>{const a=i.target,d=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[u,h]of this.elementsCache)if(h===a){this.elementsCache.delete(u);break}return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var o;(o=s())==null||o.disconnect(),t=null},observe:o=>{var i;return(i=s())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=s())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=t=>{var s,o;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:hi,rangeExtractor:fi,onChange:()=>{},measureElement:bi,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const m in t){const p=t[m];p!==void 0&&(i[m]=p)}const l=this.options;let a=null,d=null,u=!1;if(l!==void 0&&l.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const m=l.count,p=i.count,C=this.getMeasurements(),b=m>0?((s=C[0])==null?void 0:s.key)??l.getItemKey(0):null,w=m>0?((o=C[m-1])==null?void 0:o.key)??l.getItemKey(m-1):null;if(p!==m||m>0&&p>0&&(i.getItemKey(0)!==b||i.getItemKey(p-1)!==w)){u=!0;const k=m>0?this.getVirtualItemForOffset(this.getScrollOffset())??C[0]:null;k&&(a=[k.key,this.getScrollOffset()-k.start]);const I=i.followOnAppend===!0?"auto":i.followOnAppend||null;I&&p>m&&this.isAtEnd(l.scrollEndThreshold)&&(m===0||i.getItemKey(p-1)!==w)&&(d=I)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let h=!1,g=0;if(a&&this.scrollOffset!==null){const[m,p]=a,C=this.getMeasurements(),{count:b,getItemKey:w}=this.options;let v=0;for(;v<b&&w(v)!==m;)v++;if(v<b){const x=C[v];if(x){const k=x.start+p;k!==this.scrollOffset&&(g=k-this.scrollOffset,this.scrollOffset=k,h=!0)}}}(h||d)&&(this.pendingScrollAnchor=[h?a[0]:null,h?a[1]:0,d,g])},this.notify=t=>{var s,o;(o=(s=this.options).onChange)==null||o.call(s,this,t)},this.maybeNotify=_e(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}if(this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,l)=>{if(l&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const a=this.getScrollOffset();this.scrollDirection=l?a===i?this.scrollDirection:a<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!St()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",l,ct),i.addEventListener("touchend",a,ct),this.unsubs.push(()=>{i.removeEventListener("touchstart",l),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,l,a,d]=o;i!==null&&!a&&(St()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?d!==0&&(this._iosDeferredAdjustment+=d):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),s=this.getMaxScrollOffset();if(t<0||t>s)return;const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=_e(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,s,o,i,l,a,d,u)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:t,paddingStart:s,scrollMargin:o,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:d,gap:u}),{key:!1}),this.getMeasurements=_e(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:s,scrollMargin:o,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:d,gap:u},h)=>{const g=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const v of this.laneAssignments.keys())v>=t&&this.laneAssignments.delete(v);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(v=>{this.itemSizeCache.set(v.key,v.size)}));const m=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),a===1){const v=t*2;let x=this._flatMeasurements;if(!x||x.length<v){const T=new Float64Array(v);x&&m>0&&T.set(x.subarray(0,m*2)),x=T,this._flatMeasurements=x}let k;if(m===0)k=s+o;else{const T=m-1;k=x[T*2]+x[T*2+1]+u}for(let T=m;T<t;T++){const E=i(T),A=g.get(E),L=typeof A=="number"?A:this.options.estimateSize(T);x[T*2]=k,x[T*2+1]=L,k+=L+u}const I=ci(t,x,i);return this.measurementsCache=I,I}const p=this.measurementsCache.slice(0,m),C=new Array(a).fill(void 0),b=new Float64Array(a);let w=0;for(let v=0;v<m;v++){const x=p[v];x&&(C[x.lane]===void 0&&w++,C[x.lane]=v,b[x.lane]=x.end)}for(let v=m;v<t;v++){const x=i(v),k=this.laneAssignments.get(v);let I,T;const E=d==="estimate"||g.has(x);if(k!==void 0&&this.options.lanes>1){I=k;const F=C[I],J=F!==void 0?p[F]:void 0;T=J?J.end+u:s+o}else if(w===a){let F=0,J=b[0],_=C[0];for(let G=1;G<a;G++){const se=b[G];(se<J||se===J&&C[G]<_)&&(F=G,J=se,_=C[G])}I=F,T=J+u,E&&this.laneAssignments.set(v,I)}else I=v%this.options.lanes,T=s+o,E&&this.laneAssignments.set(v,I);const A=g.get(x),L=typeof A=="number"?A:this.options.estimateSize(v),O=T+L;p[v]={index:v,start:T,size:L,end:O,key:x,lane:I},C[I]===void 0&&w++,C[I]=v,b[I]=O}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=_e(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,s,o,i)=>t.length===0||s===0?(this.range=null,null):(this.range=Ii(t,s,o,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_e(()=>{let t=null,s=null;const o=this.calculateRange();return o&&(t=o.startIndex,s=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,s]},(t,s,o,i,l)=>i===null||l===null?[]:t({startIndex:i,endIndex:l,overscan:s,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const s=this.options.indexAttribute,o=t.getAttribute(s);return o?parseInt(o,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var s;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:s.index);if(o!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,o-i),a=Math.min(this.options.count-1,o+i);return t>=l&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((l,a)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(a))});return}const s=this.indexFromElement(t),o=this.options.getItemKey(s),i=this.elementsCache.get(o);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(o,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,s)=>{var o,i;if(t<0||t>=this.options.count)return;let l,a,d;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)d=this.options.getItemKey(t),a=u[t*2],l=u[t*2+1];else{const m=this.measurementsCache[t];if(!m)return;d=m.key,a=m.start,l=m.size}const h=this.itemSizeCache.get(d)??l,g=s-h;if(g!==0){const m=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,p=m?this.getTotalSize():0,C=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:d,start:a,size:l,end:a+l,lane:0},g,this):a<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(d)||this.scrollDirection!=="backward"));(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(d,s),this.itemSizeCacheVersion++,m?this.applyScrollAdjustment(this.getTotalSize()-p):C&&this.applyScrollAdjustment(g),this.notify(!1)}},this.getVirtualItems=_e(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,s)=>{const o=[];for(let i=0,l=t.length;i<l;i++){const a=t[i],d=s[a];o.push(d)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const s=this.getMeasurements();if(s.length===0)return;const o=this._flatMeasurements,i=this.options.lanes===1&&o!=null,l=is(0,s.length-1,i?a=>o[a*2]:a=>Dt(s[a]).start,t);return Dt(s[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,s,o=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),l=this.getScrollOffset();s==="auto"&&(s=t>=l+i?"end":"start"),s==="center"?t+=(o-i)/2:s==="end"&&(t-=i);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,s="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getSize(),i=this.getScrollOffset(),l=this.measurementsCache[t];if(!l)return;if(s==="auto")if(l.end>=i+o-this.options.scrollPaddingEnd)s="end";else if(l.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];if(s==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),s];const a=s==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,s,l.size),s]},this.scrollToOffset=(t,{align:s="start",behavior:o="auto"}={})=>{const i=this.getOffsetForAlignment(t,s),l=this.now();this.scrollState={index:null,align:s,behavior:o,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:s="auto",behavior:o="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,s);if(!i)return;const[l,a]=i,d=this.now();this.scrollState={index:t,align:a,behavior:o,startedAt:d,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:s="auto"}={})=>{const o=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const s=this.getMeasurements();let o;if(s.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const i=s.length-1,l=this._flatMeasurements;l!=null?o=l[i*2]+l[i*2+1]:o=((t=s[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let l=s.length-1;for(;l>=0&&i.some(a=>a===null);){const a=s[l];i[a.lane]===null&&(i[a.lane]=a.end),l--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const s=this.getMeasurements();for(const o of s)o&&this.itemSizeCache.has(o.key)&&t.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return t},this._scrollToOffset=(t,{adjustments:s,behavior:o})=>{this._intendedScrollOffset=t+(s??0),this.options.scrollToFn(t,{behavior:o,adjustments:s},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){n!==0&&(St()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=n:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const s=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=s?s[0]:this.scrollState.lastTargetOffset,i=1,l=o!==this.scrollState.lastTargetOffset;if(!l&&di(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const a=this.getSize()||600,d=Math.abs(o-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&d>a;this.scrollState.lastTargetOffset=o,u||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const is=(e,n,t,s)=>{for(;e<=n;){const o=(e+n)/2|0,i=t(o);if(i<s)e=o+1;else if(i>s)n=o-1;else return o}return e>0?e-1:0};function Ci(e,n,t){let s=0;for(;s<=n;){const o=(s+n)/2|0,i=e[o*2];if(i<t)s=o+1;else if(i>t)n=o-1;else return o}return s>0?s-1:0}function Ii(e,n,t,s,o){const i=e.length-1;if(e.length<=s)return{startIndex:0,endIndex:i};if(s===1&&o!==null){const u=Ci(o,i,t);let h=u;const g=t+n;for(;h<i&&o[h*2]+o[h*2+1]<g;)h++;return{startIndex:u,endIndex:h}}let a=is(0,i,u=>e[u].start,t),d=a;if(s===1)for(;d<i&&e[d].end<t+n;)d++;else if(s>1){const u=Array(s).fill(0);for(;d<i&&u.some(g=>g<t+n);){const g=e[d];u[g.lane]=g.end,d++}const h=Array(s).fill(t+n);for(;a>=0&&h.some(g=>g>=t);){const g=e[a];h[g.lane]=g.start,a--}a=Math.max(0,a-a%s),d=Math.min(i,d+(s-1-d%s))}return{startIndex:a,endIndex:d}}const yt=typeof document<"u"?c.useLayoutEffect:c.useEffect;function Ti({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...s}){const o=c.useReducer(u=>u+1,0)[1],i=c.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const l=u=>{const h=i.current;if(!h.enabled||!h.container)return;const g=u.getTotalSize();if(g!==h.lastSize){h.lastSize=g;const v=u.options.horizontal?"width":"height";h.container.style[v]=`${g}px`}const m=!!u.options.horizontal,p=h.mode==="transform",C=m?"left":"top",b=u.options.scrollMargin,w=u.getVirtualItems();for(const v of w){const x=v.start-b,k=u.elementsCache.get(v.key);k&&h.lastPositions.get(k)!==x&&(h.lastPositions.set(k,x),p?k.style.transform=m?`translate3d(${x}px, 0, 0)`:`translate3d(0, ${x}px, 0)`:k.style[C]=`${x}px`)}},a={...s,onChange:(u,h)=>{var g;const m=i.current;let p=!0;if(m.enabled){l(u);const C=u.range,b=m.prevRange;p=!b||b.isScrolling!==u.isScrolling||b.startIndex!==C?.startIndex||b.endIndex!==C?.endIndex,p&&(m.prevRange=C?{startIndex:C.startIndex,endIndex:C.endIndex,isScrolling:u.isScrolling}:null)}p&&(e&&h?Ds.flushSync(o):o()),(g=s.onChange)==null||g.call(s,u,h)}},[d]=c.useState(()=>{const u=new yi(a);return Object.assign(u,{containerRef:h=>{const g=i.current;if(g.container=h,g.lastSize=null,h&&g.enabled){const m=u.getTotalSize();g.lastSize=m;const p=u.options.horizontal?"width":"height";h.style[p]=`${m}px`}}})});return d.setOptions(a),yt(()=>d._didMount(),[]),yt(()=>d._willUpdate()),yt(()=>{l(d)}),d}function ji(e){return Ti({observeElementRect:mi,observeElementOffset:xi,scrollToFn:Si,...e})}const Rt=e=>e.query?`matching "${e.query}"`:e.from?`from "${e.from}"`:"matching your search",wi=e=>`Select all ${Rt(e)}`,ki=(e,n)=>`All ${ss(n)} ${Rt(e)} selected`,Mi=({verb:e,confirmingDelete:n,hasSelection:t,junkMailboxId:s,currentMailboxId:o,deletableMessageId:i})=>{if(n)return{kind:"withheld"};if(e==="junk"){const l=gn(s,o);if(l!==void 0)return{kind:"unavailable",reason:l}}return t?{kind:"openWizard"}:e!=="delete"||i===void 0?{kind:"declined"}:{kind:"confirmDelete",messageId:i}},Ri=(e,n,t)=>e==="BACK"&&n&&t===void 0,Ei=(e,n)=>({id:e.messageId,accountId:e.accountId,mailboxId:e.mailboxId,threadId:e.threadId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Qe(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Ut(e.category),messageCount:n,suspicious:e.authenticity?.dkimMismatch===!0,labels:e.labels}),Ai=({thread:e,mailboxId:n,isSelected:t,isFocused:s,isTabStop:o,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:d,messageCount:u,isMultiSelectMode:h,onLongPress:g,isDesktop:m,density:p})=>r.jsx(pn,{thread:Ei(e,u),link:{mailboxId:n,threadId:e.threadId},inListbox:!0,active:t,focused:s,isTabStop:o,density:p,isDesktop:m,onFocusRow:i,selection:{isChecked:l,onToggleCheck:a,onRowSelect:d,isMultiSelectMode:h,onLongPress:g}}),Oi=c.memo(Ai),Ni=e=>{const n=e.authenticity?.dkimMismatch===!0;return{id:e.messageId,accountId:e.accountId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Qe(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Ut(e.category),suspicious:n}},zi=({thread:e,mailboxId:n,isSelected:t,isFocused:s,isTabStop:o,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:d,isMultiSelectMode:u,onLongPress:h,isDesktop:g,onDelete:m,onToggleRead:p,density:C})=>{const[b,w]=c.useState("none"),v=Je(),x=c.useCallback(A=>{navigator.vibrate?.(10),A==="trailing"?m(e.messageId):p(e.messageId,e.isRead),w("none")},[m,p,e.messageId,e.isRead]),k=c.useCallback(()=>{h(e.messageId)},[h,e.messageId]),I=c.useCallback(()=>{a(e.messageId)},[a,e.messageId]),T=c.useCallback(()=>{v({threadId:e.threadId,messageId:e.messageId})},[v,e.threadId,e.messageId]),E=xn(e.messageId,d);return g||u?r.jsx(Oi,{thread:e,mailboxId:n,isSelected:t,isFocused:s,isTabStop:o,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:d,isMultiSelectMode:u,onLongPress:h,isDesktop:g,density:C}):r.jsx("div",{role:"presentation",onPointerDownCapture:E.onMouseDown,onClickCapture:E.claimClick,onContextMenu:E.onContextMenu,children:r.jsx(ho,{thread:Ni(e),selectionMode:!1,checked:!1,active:t,peek:b,onPeek:w,onToggleCheck:I,onLongPress:k,onOpen:T,onAct:x})})},Fi=72,Di=32,Li=5,rs="remit:list-density",_i=()=>{try{const e=localStorage.getItem(rs);if(e==="compact"||e==="comfortable")return e}catch{}return"comfortable"},Pi=({query:e})=>r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface-sunken/30",children:[r.jsx(Ws,{className:"size-4 text-fg-muted"}),r.jsxs("span",{className:"text-sm text-fg-muted",children:["Results for “",e,"”"]})]}),Bi=(e,n,t)=>Oo(e.filter(s=>n.has(s.messageId)).map(s=>s.accountId??t)).moveDisabledHint,$i=({mailboxId:e,threads:n,selectedMessageId:t,isLoading:s,isError:o=!1,error:i,onRetry:l,searchQuery:a,searchPredicate:d,onDeleteMessages:u,isDeleting:h=!1,isMoving:g=!1,onLoadMore:m,hasMore:p=!1,isLoadingMore:C=!1,accountId:b,listTitle:w,listMeta:v,listFilter:x,listScopeLabel:k,onTriageContextChange:I,commandsRef:T,hideHeader:E=!1})=>{const A=c.useRef(null),L=Je(),O=Ls(),F=_s(),{verb:J,start:_,startFromSearch:G}=F,se=Ps(),pe=!!a?.trim(),P=bn(),{labels:Pe}=Eo(b),{pushError:ae}=$t(),[M,Ce]=c.useState(t),[W,Ie]=c.useState(),K=c.useCallback(f=>{Ie(S=>S===f?S:void 0),Ce(f)},[]),[D,Be]=c.useState(_i),xe=c.useCallback(()=>{Be(f=>{const S=f==="comfortable"?"compact":"comfortable";try{localStorage.setItem(rs,S)}catch{}return S})},[]),{toggleReadFor:be}=Qt({mailboxId:e}),{junkMailboxId:le}=Jt(b),Ae=Gt(le,e),Oe=c.useMemo(()=>[{accountId:b,mailboxId:e}],[b,e]),{outcome:ce,staleFolderLabel:V,guessedMailboxId:H}=vn(Oe),{selectedIds:Z,selectedCount:q,hasSelection:oe,isSelected:Ne,toggle:ee,select:Te,clearSelection:de,selectRange:ue,setAnchor:N,selectAll:je,toggleAll:$e,intersectWith:ze}=Sn(),R=Nn(q,O),[Fe,he]=c.useState(null),We=pe&&!!d,Ge=`${e}|${JSON.stringify(d??{})}`,j=yn({mailboxId:e,accountId:b,enabled:We,predicateKey:Ge,searchQuery:d??{}}),Ye=c.useCallback((f,S,ge)=>{const Q=Cn(f,S,ge,ce);Q&&ae(Q)},[ae,ce]),we=j.phase.kind,Xe=j.clear,z=c.useCallback(()=>{we==="escalated"&&Xe(),de()},[de,Xe,we]),[Ze,et]=c.useState(null),ve=c.useRef(null),ie=c.useRef(!1),Se=c.useRef(null),ke=!s&&n.length>0,ne=ji({count:n.length,getScrollElement:()=>A.current,estimateSize:()=>D==="compact"?Di:Fi,overscan:Li}),Ke=t?n.findIndex(f=>f.messageId===t):-1,Y=M?n.findIndex(f=>f.messageId===M):-1,re=c.useCallback(f=>{if(f<0||f>=n.length)return;const S=n[f];if(R){ee(S.messageId);return}ve.current=S.messageId,ie.current=!1,Ie(S.messageId),Ce(S.messageId)},[n,R,ee]),Ve=c.useCallback(()=>{if(n.length===0)return;const f=Y<0?0:Math.min(Y+1,n.length-1);re(f)},[n.length,Y,re]),He=c.useCallback(()=>{if(n.length===0)return;const f=Y<=0?0:Y-1;re(f)},[n.length,Y,re]),ye=c.useCallback(()=>re(0),[re]),Me=c.useCallback(()=>re(n.length-1),[re,n.length]),Re=c.useCallback(()=>{M&&ee(M)},[M,ee]),B=c.useMemo(()=>n.map(f=>f.messageId),[n]),ft=c.useMemo(()=>{const f=[];for(const S of n)Z.has(S.messageId)&&f.push({id:S.messageId,sender:S.fromName??S.fromEmail??"Unknown",email:S.fromEmail??"",subject:S.subject??"(No subject)",date:Qe(S.sentDate),accountId:b});return f},[n,Z,b]),mt=c.useCallback((f,S)=>S.shiftKey?(ue(B,f,M),!0):S.metaKey||S.ctrlKey?(ee(f),!0):(z(),N(f),!1),[B,M,ue,ee,z,N]),fe=c.useCallback(f=>{!u||f.length===0||(Se.current=M??null,he(f))},[u,M]),De=c.useCallback(f=>{const S=In(B,M,f);S!==void 0&&(ue(B,S),ve.current=S,ie.current=!1,Ie(void 0),Ce(S))},[B,M,ue]),tt=c.useCallback(()=>De(-1),[De]),st=c.useCallback(()=>De(1),[De]),nt=c.useCallback(()=>{B.length>0&&je(B)},[B,je]),ot=c.useCallback(f=>{const S=Mi({verb:f,confirmingDelete:Fe!==null,hasSelection:oe,junkMailboxId:le,currentMailboxId:e,deletableMessageId:u?M:void 0});return S.kind==="openWizard"?(_(f),!0):S.kind==="confirmDelete"?(fe([S.messageId]),!0):S.kind==="unavailable"?(ae({severity:"warning",title:S.reason}),!0):S.kind==="withheld"},[Fe,u,oe,le,e,_,M,fe,ae]),me=c.useCallback((f,S)=>{const ge=n.find(Q=>Q.messageId===f)?.threadId;ge&&L({threadId:ge,messageId:f},{replace:S?.replace})},[L,n]),it=c.useCallback(()=>{M&&me(M)},[M,me]),rt=c.useCallback(f=>me(f,{replace:!0}),[me]);Tn({keyboardFocusedMessageId:W,openMessageId:t,enabled:O&&q===0,open:rt});const Le=j.phase.kind==="escalated"?{scope:Rt(d??{}),total:j.phase.total,searchQuery:d??{},run:f=>j.runAction(f),stop:j.stop}:void 0,gt=c.useCallback(f=>{if(f.length===0){he(null);return}const S=new Set(f),ge=n.findIndex(X=>S.has(X.messageId));let Q;for(let X=ge+1;X<n.length;X++)if(!S.has(n[X].messageId)){Q=n[X].messageId;break}if(Q===void 0){for(let X=ge-1;X>=0;X--)if(!S.has(n[X].messageId)){Q=n[X].messageId;break}}u?.(f),z(),Se.current=null,he(null),Q!==void 0&&(ve.current=Q,ie.current=!1,K(Q),O&&me(Q,{replace:!0})),O||et(jn("delete",f.length,ce))},[n,u,z,me,O,K,ce]),pt=c.useCallback(()=>{const f=Se.current;Se.current=null,he(null),f!==null&&(ve.current=f,ie.current=!1,K(f))},[K]),qe=c.useMemo(()=>Bi(n,Z,b),[b,Z,n]),at=c.useCallback(()=>{if(Le){G();return}_("organize")},[Le,G,_]),xt=c.useCallback(f=>{u?.([f])},[u]),y=c.useCallback((f,S)=>{be([f],!S)},[be]),U=c.useCallback(f=>{O||Te(f)},[O,Te]),$=c.useCallback(()=>{if(j.isRunning||j.phase.kind==="counting"){j.stop();return}z()},[j,z]),ds=c.useCallback(()=>{j.clear()},[j]);c.useEffect(()=>{if(ie.current||!O&&t)return;const f=Y>=0?Y:Ke;f>=0&&ne.scrollToIndex(f,{align:"auto"})},[Y,Ke,ne,O,t]),c.useEffect(()=>{t&&(ie.current=!1,K(t))},[t,K]),c.useEffect(()=>{M&&(n.some(f=>f.messageId===M)||K(n[0]?.messageId))},[n,M,K]),c.useEffect(()=>{I?.({focusedMessageId:M,selectedIds:Array.from(Z),hasList:ke})},[M,Z,ke,I]);const Et=c.useRef(I);Et.current=I,c.useEffect(()=>()=>Et.current?.({focusedMessageId:void 0,selectedIds:[],hasList:!1}),[]),c.useEffect(()=>{j.phase.kind!=="idle"||j.isRunning||ze(n.map(f=>f.messageId))},[n,ze,j.phase,j.isRunning]);const At=c.useRef(e);c.useEffect(()=>{At.current!==e&&(At.current=e,z())},[e,z]),wn({shouldBlockFn:({action:f})=>Ri(f,oe,se)?(z(),!0):!1,enableBeforeUnload:!1,disabled:!oe||se!==void 0}),c.useEffect(()=>{const f=A.current;if(!f||!p||!m)return;const S=()=>{if(C)return;const{scrollTop:ge,scrollHeight:Q,clientHeight:X}=f;ge+X>=Q-200&&m()};return f.addEventListener("scroll",S,{passive:!0}),S(),()=>f.removeEventListener("scroll",S)},[p,C,m]),c.useEffect(()=>{const f=ve.current;if(!f)return;const S=A.current?.querySelector(`[data-message-id="${f}"]`);S&&(ve.current=null,S.focus({preventScroll:!0}))}),c.useEffect(()=>{if(T){if(!ke){T.current=null;return}return T.current={focusNext:Ve,focusPrevious:He,focusFirst:ye,focusLast:Me,openFocused:it,toggleSelect:Re,extendSelectDown:st,extendSelectUp:tt,selectAll:nt,clearSelection:()=>oe?(z(),!0):!1,requestVerb:ot,toggleDensity:xe},()=>{T.current=null}}},[T,ke,Ve,He,ye,Me,it,Re,st,tt,nt,oe,z,ot,xe]);const Ot=s?"loading":o?"error":n.length===0?"empty":"ready",us=o?Ro(i):void 0,hs=c.useCallback(()=>{const f=Bs($s());window.open(f,"_blank","noopener,noreferrer")},[]),fs=[{id:"inbox",threads:[]}],bt=B.length>0&&B.every(f=>Z.has(f)),ms=We&&p&&bt&&!h&&!g&&j.phase.kind==="idle"&&!j.isRunning,gs=h||g||j.isRunning,vt=j.phase.kind==="escalated"?j.phase.total:q,ps=j.runningAction?kn(j.runningAction.kind,j.progress?.done??0,j.progress?.total??vt):j.phase.kind==="counting"?"Counting matches…":j.phase.kind==="escalated"?ki(d??{},j.phase.total):void 0,xs=j.phase.kind!=="escalated"&&B.length>0?{checked:bt,indeterminate:q>0&&!bt,onChange:()=>$e(B)}:void 0,bs=j.runningAction?{value:j.progress?.done??0,max:j.progress?.total??vt,tone:Mn(j.runningAction.kind)}:void 0,vs=(j.phase.kind==="counting"?{tone:"info",text:"",action:{label:"Stop",onClick:j.stop}}:j.phase.kind==="escalated"&&!j.isRunning?{tone:"info",text:"",action:{label:"Clear selection",onClick:ds}}:ms?{tone:"info",text:"",action:{label:wi(d??{}),onClick:j.escalate}}:void 0)??(qe?{tone:"warning",text:qe}:void 0),Ss=r.jsx(Rn,{title:P.title||w,navSlot:P.navSlot,titleMeta:P.titleMeta,searchSlot:P.searchSlot,searchField:P.searchField,idleSlot:P.makeFilterSlot,count:vt,onCancel:$,onDelete:()=>_("delete"),onMove:()=>_("move"),onOrganize:at,onJunk:Ae?()=>_("junk"):void 0,onMarkRead:()=>_("markRead"),overflowSlot:b&&e&&q>0&&Pe.length>0?r.jsx(Ao,{accountId:b,mailboxId:e,messageIds:Array.from(Z)}):void 0,isBusy:gs,isCounting:j.phase.kind==="counting",selectAll:xs,statusLabel:ps,progress:bs,notice:vs}),ys=En(B,M),Cs=c.useCallback(f=>{ie.current=!0,K(f)},[K]),Is=r.jsxs(r.Fragment,{children:[pe&&a&&r.jsx(Pi,{query:a}),r.jsxs("div",{ref:A,role:"listbox","aria-multiselectable":!0,"aria-label":w,className:"flex-1 overflow-y-auto",children:[r.jsx("div",{role:"presentation",className:"relative w-full",style:{height:`${ne.getTotalSize()}px`},children:ne.getVirtualItems().map(f=>{const S=n[f.index];return r.jsx("div",{role:"presentation","data-index":f.index,ref:ne.measureElement,className:Ee("absolute left-0 top-0 w-full border-b border-line",j.isRunning&&"pointer-events-none opacity-50"),style:{transform:`translateY(${f.start}px)`},children:r.jsx(zi,{thread:S,mailboxId:e,isSelected:t===S.messageId,isFocused:M===S.messageId,isTabStop:ys===S.messageId,onFocusRow:Cs,isChecked:Ne(S.messageId),onToggleCheck:ee,onRowSelect:mt,isMultiSelectMode:R,onLongPress:U,isDesktop:O,onDelete:xt,onToggleRead:y,density:D})},f.key)})}),C&&r.jsx(fo,{})]})]});return r.jsxs(r.Fragment,{children:[Ze&&!O&&r.jsx(dt,{tone:"success",variant:"soft",className:"m-2 rounded-md",onDismiss:()=>et(null),children:Ze}),r.jsx(mo,{listTitle:w,listMeta:v,sections:fs,flatList:!0,listState:P.searchResults?"ready":Ot,searchQuery:pe?a:void 0,listFilter:x,listScopeLabel:k,errorMessage:us,onRetry:l,onReportError:hs,density:D,selectedThreadId:t,onSelectThread:f=>me(f),isDesktop:O,hideHeader:E,selectionBar:Ss,listBody:P.searchResults??(Ot==="ready"?Is:void 0)}),r.jsx(An,{isOpen:Fe!==null,messageIds:Fe??[],outcome:ce,accountId:b,trashFolderLabel:w,staleFolderLabel:V,guessedMailboxId:H,isDeleting:h,onConfirm:gt,onCancel:pt}),r.jsx(On,{verb:J,accountId:b,mailboxId:e,selection:ft,selectionRestriction:qe?"spansAccounts":void 0,escalated:Le,escalatedProgress:j.progress,onFinished:z,onRunEnded:Ye})]})},Wi=e=>Wt({path:{accountId:e}}),Ki=e=>{const n=It(),t=wt(),s=jt({...Ks(),onSuccess:()=>{t.recordEvent("sync.triggered"),n.invalidateQueries({queryKey:Wi(e)})}});return{trigger:()=>{s.mutate({path:{accountId:e}})},triggerAsync:()=>s.mutateAsync({path:{accountId:e}}),isPending:s.isPending,error:s.error,reset:s.reset}},Vi=({accountId:e,children:n})=>{const{triggerAsync:t,isPending:s}=Ki(e);return r.jsx(Po,{onRefresh:t,isRefreshing:s,children:n})};function Hi({accountId:e,currentMailboxId:n,candidates:t,onMove:s,children:o}){const[i,l]=c.useState(!1),a=wt(),d=Vs(),{inboxMailboxId:u}=zn(e),h=Fn(e),{data:g}=Tt({...Hs({path:{accountId:e}}),staleTime:1/0}),m=c.useMemo(()=>qs({mailboxes:g?.items??[],folderAppointments:h,currentMailboxId:n,translator:d}),[g?.items,h,n,d]),p=c.useMemo(()=>u||(m.find(x=>x.label.toLowerCase()==="inbox")?.id??m.find(x=>!x.isCurrent)?.id??""),[u,m]),C=c.useRef(!1);c.useEffect(()=>{C.current||(C.current=!0,Dn(a,t.length))},[a,t.length]);const b=c.useCallback(()=>{Ln(a,t.length),l(!0)},[a,t.length]),w=c.useCallback((v,x)=>{_n(a,{selected:v.length,total:t.length,toInbox:x===u}),s(v,x)},[a,t.length,u,s]);return r.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[r.jsx("div",{className:"shrink-0 px-row-inset pt-2",children:r.jsx($o,{count:t.length,onReview:b})}),r.jsx("div",{className:"min-h-0 flex-1",children:o}),r.jsx(Xo,{open:i,candidates:t,defaultDestinationId:p,availableFolders:m,delimiter:Us(g?.items??[]),onConfirmMove:w,onCancel:()=>l(!1)})]})}const qi=(e,n,t,s)=>`${e??""}|${n}|${t??""}|${s??""}`,Ui=({accountId:e,mailboxId:n})=>{const t=It(),{pushError:s}=$t(),{requestAppointment:o}=Qs(),{trashByAccount:i}=Yt(),l=e?i.get(e):void 0,a=qi(e,n,l?.mailboxId,l?.source),[d,u]=c.useState({scope:a});d.scope!==a&&u({scope:a});const h=d.scope===a?d:void 0,g=c.useCallback(()=>t.getQueryData(Js())?.accounts.find(T=>T.accountId===e)?.folderAppointments.find(T=>T.role==="Trash")?.mailboxId??n,[t,e,n]),m=c.useRef(void 0),{mutateAsync:p,isPending:C}=jt({...Xs(),onMutate:()=>(m.current=a,{scope:a,listMailboxId:g()}),onSuccess:(x,k,I)=>{I.scope===a&&u({scope:a,deletedCount:x.deletedCount})},onError:(x,k,I)=>{const T=Gs(x);if(!T){s({title:"Couldn't empty Trash",detail:Ys(x),error:x});return}I?.scope===a&&u({scope:a,refusal:T})},onSettled:(x,k,I,T)=>{m.current===T?.scope&&(m.current=void 0),Pn(t,Bn([T?.listMailboxId??n])),e&&t.invalidateQueries({queryKey:Wt({path:{accountId:e}})})}}),b=c.useCallback(()=>e?(u({scope:a}),p({path:{accountId:e}}).then(()=>{},()=>{})):Promise.resolve(),[e,a,p]),w=c.useCallback(()=>{b()},[b]),v=c.useCallback(()=>{const x=h?.refusal;x&&o({accountId:x.accountId,role:x.role,reason:x.reason,action:{kind:"emptyTrash"},onAppointed:b})},[h,o,b]);return{emptyTrash:w,isEmptying:C&&m.current===a,deletedCount:h?.deletedCount,refusal:h?.refusal,repair:v}},Qi="We can verify this sender";function Ji(e){const{data:n}=Tt({...Zs({path:{mailboxId:e??""},query:{senderTrust:["vip","wellknown"],dkimMismatch:!1,results:!0,limit:500}}),enabled:!!e,staleTime:6e4});return{candidates:(n?.items??[]).map(s=>({id:s.messageId,senderName:s.fromName||s.fromEmail||"Unknown sender",senderAddress:s.fromEmail??"",subject:s.subject||"(no subject)",snippet:s.snippet??"",trustReason:Qi,trustSubReason:$n(s.senderTrust),senderTrust:s.senderTrust}))}}const Gi=e=>{const n=new Set,t=[];for(const s of e)n.has(s.threadMessageId)||(n.add(s.threadMessageId),t.push(s));return t},Yi={unread:"unread",flagged:"starred",attachment:"attachments"},Xi=new Set(Object.values(en)),as=e=>Xi.has(e),Zi=e=>as(e.category)||e.attributes.size>0,er=e=>{const n={};as(e.category)&&(n.category=[e.category]);for(const t of e.attributes){const s=Yi[t];s&&(n[s]=!0)}return n},tr=e=>(e.senderTrust?.length??0)>0||e.dkimMismatch!==void 0?"loaded-pages":"whole-folder",sr=["category","unread","starred","attachments"],_t=e=>JSON.stringify(sr.map(n=>e?.[n]??null)),nr=e=>{if(!Array.isArray(e))return;const[n]=e;if(typeof n!="object"||n===null)return;const t=n.query;if(!(typeof t!="object"||t===null))return t},or=(e,n)=>{const t=nr(e);return t?_t(t)===_t(n):!1},lt=e=>e[0],ir=e=>{const n=lt(e.filter(a=>a.type==="from").map(a=>a.value)),t=lt(e.filter(a=>a.type==="subject").map(a=>a.value)),s=lt(e.filter(a=>a.type==="category").map(a=>a.category)),o=lt(e.filter(a=>a.type==="isUnread"||a.type==="isRead").map(a=>a.type==="isUnread")),i=e.some(a=>a.type==="isStarred")?!0:void 0,l=e.some(a=>a.type==="hasAttachment")?!0:void 0;return{...n!==void 0?{from:n}:{},...t!==void 0?{subject:t}:{},...s!==void 0?{category:[s]}:{},...o!==void 0?{unread:o}:{},...i!==void 0?{starred:i}:{},...l!==void 0?{attachments:l}:{}}},rr=(e,n)=>{switch(n.type){case"from":return e.from?.toLowerCase()===n.value.toLowerCase();case"subject":return e.subject?.toLowerCase()===n.value.toLowerCase();case"category":return e.category?.length===1&&e.category[0]===n.category;case"isUnread":return e.unread===!0;case"isRead":return e.unread===!1;case"isStarred":return e.starred===!0;case"hasAttachment":return e.attachments===!0;case"before":case"after":case"in":case"account":return!1}};function ar(e,n={}){const t=ir(e),s={...t,...n};return{params:t,residual:e.filter(o=>!rr(s,o))}}function lr(e,n,t){if(n.length===0)return e;const s=[...n];return e.filter(o=>{const i=Wn(o);return Kn({...i,accountId:i.accountId??t},s)})}const cr=50,dr=new Map(ts().categories.filter(e=>e.id!=="all").map(e=>[e.id,e.label])),ls=c.createContext(null);function ht(){const e=c.useContext(ls);if(!e)throw new Error("MailboxPane.* must be used inside <MailboxPane>");return e}function ur({mailboxId:e,thread:n,children:t}){const s=Je(),o=Co(),i=_o(),l=n?.threadId,a=n?.messageId,d=wt(),{accounts:u,searchQuery:h,onToggleIntelligence:g}=Kt(),m=cn(),p=Lo(h),C=p.length>0,{freeText:b,tokens:w}=dn(p,m),[v,x]=c.useState("all"),[k,I]=c.useState(new Set),T=c.useMemo(()=>({category:v,attributes:k}),[v,k]),E=c.useMemo(()=>er(T),[T]),A=C||Zi(T),{params:L,residual:O}=ar(w,E),F={order:"desc",limit:cr,...b?{query:b}:{},...L,...E},J={category:F.category,unread:F.unread,starred:F.starred,attachments:F.attachments},_=A?tn({path:{mailboxId:e},query:F}):sn({path:{mailboxId:e},query:{order:"desc"}}),{data:G,isLoading:se,isError:pe,error:P,refetch:Pe,fetchNextPage:ae,hasNextPage:M,isFetchingNextPage:Ce}=go({queryKey:_,queryFn:async({pageParam:y})=>{if(A){const{data:$}=await an({path:{mailboxId:e},query:{...F,continuationToken:y},throwOnError:!0});return $}const{data:U}=await ln({path:{mailboxId:e},query:{order:"desc",continuationToken:y},throwOnError:!0});return U},initialPageParam:void 0,getNextPageParam:y=>y.continuationToken,placeholderData:(y,U)=>or(U?.queryKey,J)?y:void 0}),{accountId:W,isLoading:Ie}=Vn(e),K=Io({accounts:u}),D=lr(Hn(Gi(G?.pages.flatMap(y=>y.items??[])??[])),O,W),Be=c.useCallback(y=>{x(y)},[]),xe=c.useCallback(y=>{I(U=>{const $=new Set(U);return $.has(y)?$.delete(y):$.add(y),$})},[]),be=c.useCallback(()=>{x("all"),I(new Set)},[]),le=dr.get(v),Ae=le?{label:le,reach:O.length>0?"loaded-pages":tr(F),onClear:be}:void 0,Oe=l?D.find(y=>y.messageId===a)??D.find(y=>y.threadId===l):void 0,ce=qn(l,a),V=Oe??ce,H=a??V?.messageId,Z=c.useMemo(()=>{if(l)return{threadId:l,mailboxId:V?.mailboxId??e,subject:V?.subject,messageId:H,authenticity:V?.authenticity}},[l,V,H,e]),q=c.useCallback(y=>{H&&y.includes(H)&&o()},[H,o]),{deleteMessages:oe,isPending:Ne}=Nt({mailboxId:e,onAfterOptimisticRemove:q}),{moveMessages:ee,isPending:Te}=zt({mailboxId:e,accountId:W,onAfterOptimisticRemove:q}),de=c.useRef(null),ue=Un(),{listCommandsRef:N,onTriageContextChange:je,focusedMessageId:$e,selectedIds:ze}=ue,R=D.find(y=>y.messageId===$e)??V,Fe=To({accounts:u})??0,he=Qn({thread:V,isOpen:!0,mailboxId:e,accountId:W,onAfterOptimisticRemove:q}),{draftsMailboxId:We}=Jn(W),Ge=We!==void 0&&We===e,{archiveMailboxId:j}=Gn(W),Ye=Yn(),we=nn(),Xe=c.useMemo(()=>on(we,l,H),[we,l,H]),z=c.useMemo(()=>{if(R)return y=>we({threadId:R.threadId,messageId:R.messageId,mode:y})},[we,R]),Ze=So(),et=rn(),ve=yo(),ie=c.useCallback(y=>y?Ye(y):[],[Ye]),{toggleStar:Se}=Xn({threadId:R?.threadId??"",mailboxId:e}),{toggleReadFor:ke}=Qt({mailboxId:e,accountId:W}),{junkMailboxId:ne}=Jt(W),Ke=ne!=null&&ne===e,Y=Gt(ne,e),{candidates:re}=Ji(Ke?ne:void 0),{moveMessages:Ve}=zt({mailboxId:e,threadId:R?.threadId,accountId:W,onAfterOptimisticRemove:q}),{deleteMessages:He}=Nt({mailboxId:e,threadId:R?.threadId,onAfterOptimisticRemove:q}),{addressId:ye,address:Me}=Zn(R),{updateFlags:Re}=eo({addressId:ye,senderEmail:R?.fromEmail??void 0}),B=c.useCallback(()=>z?.("reply"),[z]),ft=c.useCallback(()=>z?.("reply-all"),[z]),mt=c.useCallback(()=>z?.("forward"),[z]),fe=c.useCallback(()=>ie(R),[ie,R]),De=c.useCallback(()=>{if(N.current?.requestVerb("delete"))return;const y=fe();y.length>0&&He(y)},[N,fe,He]),tt=c.useCallback(()=>{if(N.current?.requestVerb("junk")||!Y)return;const y=fe();y.length!==0&&(to(d,{count:y.length,senderTrust:R?.senderTrust??"unknown",wasRescuable:R?so(R):!1}),Ve(y,Y))},[N,Y,fe,Ve,d,R]),st=c.useCallback(()=>{if(ze.length>0){const y=!(R?.hasStars??!1),U=new Set(ze);for(const $ of D)U.has($.messageId)&&$.hasStars!==y&&Se($.messageId,$.hasStars);return}R&&Se(R.messageId,R.hasStars)},[ze,D,R,Se]),nt=c.useCallback(()=>{if(N.current?.requestVerb("markRead"))return;const y=fe();if(y.length===0)return;const U=!(R?.isRead??!1);ke(y,U)},[N,fe,R,ke]),ot=c.useCallback(()=>{if(!ye)return;const y=Me?.flags?.muted?.value!==!0;Re({muted:{value:y}})},[ye,Me,Re]),me=c.useCallback(()=>{if(!ye)return;const y=Me?.flags?.vip?.value!==!0;Re({vip:{value:y}})},[ye,Me,Re]),it=c.useCallback(()=>{de.current?.open()},[]),rt=Ge?"drafts":j===e?"archive":ne===e?"junk":"inbox",Le=c.useRef("");c.useEffect(()=>{const y=Le.current;Le.current=p,p.length>0&&y.length===0&&d.recordEvent("search.submitted",{mailboxType:rt})},[p,rt,d]);const{goBack:gt,nextMessageId:pt,previousMessageId:qe}=no({context:ue,orderedIds:D.map(y=>y.messageId),selectedMessageId:H,enabled:!Ze&&!et,hasOpenThread:l!==void 0,onClose:o,handlers:{reply:B,replyAll:ft,forward:mt,delete:De,toggleStar:st,toggleRead:nt,muteSender:ot,blockSender:V?it:void 0,vipSender:me,markJunk:tt,toggleIntelligence:V?()=>de.current?.toggle():void 0,compose:ve,goBrief:()=>i("brief"),goInbox:()=>i("brief"),goSent:()=>i("brief"),goFlagged:()=>i("flagged"),goSettings:()=>i("settings")}}),at=y=>{if(!y)return;const U=D.find($=>$.messageId===y);return U?{threadId:U.threadId,messageId:y}:void 0},xt={mailboxId:e,selectedMessageId:H,selectedThread:V,conversation:Z,onOpenThread:s,threads:D,isLoading:se,isError:pe,error:P,mailboxAccountId:W,mailboxAccountLoading:Ie,mailboxName:K,unreadCount:Fe,isDraftsMailbox:Ge,isSpamFolder:Ke,rescueCandidates:re,filterCategory:v,filterAttributes:k,onSelectFilterCategory:Be,onToggleFilterAttribute:xe,onClearFilters:be,listFilter:Ae,onToggleIntelligence:g,intelligenceRef:de,handleDeselectIfRemoved:q,searchPredicate:C&&O.length===0?F:void 0,onDeleteMessages:oe,onMoveMessages:ee,isDeleting:Ne,isMoving:Te,onLoadMore:ae,hasMore:M,isLoadingMore:Ce,onTriageContextChange:je,listCommandsRef:N,onRetry:()=>Pe(),onReply:Xe,onToolbarDelete:he.deleteThread,onToolbarStar:he.toggleStar,isStarred:he.isStarred,onToolbarMove:he.moveThread,onBack:gt,nextThread:at(pt),previousThread:at(qe)};return r.jsx(ls.Provider,{value:xt,children:t})}function cs(){const{mailboxId:e,selectedMessageId:n,threads:t,isLoading:s,isError:o,error:i,onDeleteMessages:l,onMoveMessages:a,isDeleting:d,isMoving:u,onLoadMore:h,hasMore:g,isLoadingMore:m,mailboxAccountId:p,mailboxName:C,unreadCount:b,isDraftsMailbox:w,isSpamFolder:v,rescueCandidates:x,onTriageContextChange:k,listCommandsRef:I,onRetry:T,filterCategory:E,filterAttributes:A,onSelectFilterCategory:L,onToggleFilterAttribute:O,onClearFilters:F,listFilter:J,searchPredicate:_}=ht(),{searchQuery:G,searchInput:se,accounts:pe,resultFolderIndex:P}=Kt(),Pe=jo(),ae=Je(),M=C??"Inbox",Ce=c.useMemo(()=>ts(),[]),{trashMailboxId:W}=lo(p),Ie=wo({accounts:pe}),{trashByAccount:K}=Yt(),D=Ui({accountId:p,mailboxId:e}),Be=W!=null&&W===e,xe=c.useMemo(()=>p?[p]:[],[p]),{hasNewMail:be}=hn(),{state:le,errorMessage:Ae,refresh:Oe}=fn(xe,{onSettled:T}),ce=c.useMemo(()=>r.jsx(mn,{state:le,onRefresh:Oe,label:`Refresh ${M}`,errorMessage:Ae,hasUpdate:be(xe)}),[le,Oe,M,Ae,be,xe]),V=c.useMemo(()=>t.map(N=>co(N,P)),[t,P]),{hits:H,isLoading:Z}=No({mailboxId:e,filterCategory:E}),q=c.useMemo(()=>uo(H,t.map(N=>N.threadId),P),[H,t,P]),oe=c.useCallback(N=>{const je=N.threadId??t.find($e=>$e.messageId===N.id)?.threadId;je&&ae({threadId:je,messageId:N.id},{mailboxId:N.mailboxId??e,query:se})},[e,ae,se,t]);if(w&&p)return r.jsx(ii,{accountId:p,selectedMessageId:n,imapThreads:t,title:C??"Drafts",unreadCount:b??void 0});const Ne=r.jsx($i,{mailboxId:e,threads:t,selectedMessageId:n,isLoading:s,isError:o,error:i,onRetry:T,searchQuery:G,searchPredicate:_,onDeleteMessages:l,isDeleting:d,isMoving:u,onLoadMore:h,hasMore:g,isLoadingMore:m,accountId:p,listTitle:M,listFilter:J,listScopeLabel:M,hideHeader:!0,onTriageContextChange:k,commandsRef:I}),ee=pe[0]?.accountId,Te=Pe==="phone"&&ee?r.jsx(Vi,{accountId:ee,children:Ne}):Ne,de=v&&x.length>0&&p?r.jsx(Hi,{accountId:p,currentMailboxId:e,candidates:x,onMove:a,children:Te}):Te,ue=Be?r.jsx(li,{messageCount:Ie,isEmptying:D.isEmptying,deletedCount:D.deletedCount,refusalReason:D.refusal?.reason,trashFolderLabel:C??void 0,staleFolderLabel:p?K.get(p)?.staleFolderPath:void 0,onEmpty:D.emptyTrash,onRepair:D.repair,children:de}):de;return r.jsx(po,{title:M,unreadCount:b,preset:Ce,selectedCategory:E,activeFilters:A,onSelectCategory:L,onToggleFilter:O,onClearFilters:F,searchResults:V,searchLoading:s,relatedResults:q,relatedLoading:Z,onSelectSearchResult:oe,searchResultsInBody:!0,refreshControl:ce,children:ue})}function hr(){const{mailboxId:e,mailboxAccountId:n,mailboxAccountLoading:t,selectedThread:s,conversation:o,onReply:i,onToolbarDelete:l,onToolbarStar:a,isStarred:d,onToolbarMove:u,handleDeselectIfRemoved:h,intelligenceRef:g}=ht(),m=!!o,p=ro(o?.threadId);Xt(g,p);const C=c.useRef(null),{railFits:b,openRail:w}=p;c.useEffect(()=>{if(!b)return;const x=s?.messageId??null;x&&C.current!==x&&s?.authenticity?.dkimMismatch&&(C.current=x,w())},[b,w,s?.messageId,s?.authenticity?.dkimMismatch]);const v=o?r.jsx(Zt,{threadId:o.threadId,mailboxId:o.mailboxId,subject:o.subject,selectedMessageId:o.messageId,authenticity:o.authenticity,onOpenIntelligence:p.open,listOnScreen:!0}):r.jsx(un,{});return r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[r.jsx(ao,{hasThread:m,messageId:o?.messageId,intelligenceOpen:p.isShowing,canToggleIntelligence:p.canToggle,onToggleIntelligence:p.toggle,onReply:i?()=>i("reply"):void 0,onReplyAll:i?()=>i("reply-all"):void 0,onForward:i?()=>i("forward"):void 0,onDelete:m?l:void 0,onToggleStar:m?a:void 0,isStarred:d,moveContext:m&&n?{accountId:n,currentMailboxId:e,onMove:u}:void 0,moveContextLoading:t}),r.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:v})]}),r.jsx(es,{isOpen:p.drawerOpen,onClose:p.closeDrawer,thread:s,mailboxId:e,accountId:n,onAfterOptimisticRemove:h})]})}function fr(){const{mailboxId:e,mailboxAccountId:n,selectedThread:t,onToggleIntelligence:s,handleDeselectIfRemoved:o}=ht();return r.jsx(io,{onClose:s,thread:t,mailboxId:e,accountId:n,onAfterOptimisticRemove:o})}function mr(){const{mailboxId:e,mailboxAccountId:n,selectedThread:t,conversation:s,onOpenThread:o,onBack:i,nextThread:l,previousThread:a,handleDeselectIfRemoved:d,intelligenceRef:u}=ht(),h=oo(s?.threadId??null);return Xt(u,h),s?r.jsxs(r.Fragment,{children:[r.jsx(Zt,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:i,onOpenIntelligence:h.toggle,onSwipeNext:l?()=>o(l):void 0,onSwipePrevious:a?()=>o(a):void 0,mobileIntelligenceOpen:h.isOpen}),r.jsx(es,{isOpen:h.isOpen,onClose:h.close,thread:t,mailboxId:e,accountId:n,onAfterOptimisticRemove:d})]}):r.jsx(cs,{})}const Lr=Object.assign(ur,{List:cs,Reading:hr,Intelligence:fr,Phone:mr});export{Lr as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a8 as m,j as o,a5 as p}from"./index-BWDUs3V6.js";import{a}from"./MailShell-CUim8dj6.js";import{M as r}from"./MailboxPane-Dj528iUI.js";import{f as e}from"./search-token-index-CqhHYEC3.js";import{u as s}from"./search-mirror-CykJ2cWs.js";import"./FullCompose-Br0mcbGw.js";import"./ErrorState-B1mR3jCT.js";import"./index-B_8e-R9R.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./confirm-dialog-GmPoGhCn.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./search-scope-DTcpOp3S.js";import"./useRefreshControl-oC0K6m0h.js";import"./circle-check-big-CXwm43TJ.js";import"./useQueries-C3zqiHO-.js";import"./MailListHeader-C9Ahbu_k.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./MailViewChrome-D9aV_9be.js";import"./NavMenuButton-BQ9-rzur.js";import"./useLabels-B3A1qgdI.js";import"./useSemanticSearch-BK6xhcs8.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-OpVokgSv.js";import"./circle-help-CM8xpE1V.js";import"./circle-check-Baq2FWDe.js";function Q(){const{mailboxId:t}=m.useParams(),i=e();return s({to:"/mail/$mailboxId",params:{mailboxId:t}}),o.jsx(r,{mailboxId:t,thread:i,children:o.jsx(a,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(p,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!i})})}export{Q as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BWDUs3V6.js";import{M as r}from"./MailboxPane-Dj528iUI.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./useRefreshControl-oC0K6m0h.js";import"./circle-check-big-CXwm43TJ.js";import"./search-token-index-CqhHYEC3.js";import"./useQueries-C3zqiHO-.js";import"./MailListHeader-C9Ahbu_k.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./index-B_8e-R9R.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./ErrorState-B1mR3jCT.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./confirm-dialog-GmPoGhCn.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./MailViewChrome-D9aV_9be.js";import"./NavMenuButton-BQ9-rzur.js";import"./useLabels-B3A1qgdI.js";import"./useSemanticSearch-BK6xhcs8.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-OpVokgSv.js";import"./circle-help-CM8xpE1V.js";import"./circle-check-Baq2FWDe.js";function H(){return o.jsx(r.Reading,{})}export{H as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-BWDUs3V6.js";import{B as o}from"./BriefPane-DLK5k99W.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-C9Ahbu_k.js";import"./search-token-index-CqhHYEC3.js";import"./useQueries-C3zqiHO-.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./index-B_8e-R9R.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./ErrorState-B1mR3jCT.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./confirm-dialog-GmPoGhCn.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./useRefreshControl-oC0K6m0h.js";import"./circle-check-big-CXwm43TJ.js";import"./useLabels-B3A1qgdI.js";import"./useSemanticSearch-BK6xhcs8.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function C(){return r.jsx(o.Reading,{})}export{C as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BWDUs3V6.js";import{F as r}from"./FlaggedPane-DI6-ax2Z.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-C9Ahbu_k.js";import"./search-token-index-CqhHYEC3.js";import"./useQueries-C3zqiHO-.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./index-B_8e-R9R.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./ErrorState-B1mR3jCT.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./confirm-dialog-GmPoGhCn.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./MailViewChrome-D9aV_9be.js";import"./wizard-selection-B1bng5Jq.js";function w(){return o.jsx(r.Reading,{})}export{w as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BWDUs3V6.js";import{O as t}from"./OutboxPane-32Q9m5ko.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./circle-check-big-CXwm43TJ.js";import"./clock-BQeXEzQF.js";import"./row-actions-oBe5D2si.js";import"./rotate-ccw-XBZJu6qP.js";import"./NavMenuButton-BQ9-rzur.js";import"./menu-5hCLgFBH.js";import"./format-3KE4u_Hd.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function P(){return o.jsx(t.Reading,{})}export{P as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as o}from"./index-BWDUs3V6.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as o}from"./index-BWDUs3V6.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as o}from"./index-BWDUs3V6.js";const n=o;export{n as component};
|
package/assets/brief-cxgK-E6D.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,a5 as i}from"./index-BWDUs3V6.js";import{a as m}from"./MailShell-CUim8dj6.js";import{B as o}from"./BriefPane-DLK5k99W.js";import{f as p}from"./search-token-index-CqhHYEC3.js";import{u as e}from"./search-mirror-CykJ2cWs.js";import"./FullCompose-Br0mcbGw.js";import"./ErrorState-B1mR3jCT.js";import"./index-B_8e-R9R.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./confirm-dialog-GmPoGhCn.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-C9Ahbu_k.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./useQueries-C3zqiHO-.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./useRefreshControl-oC0K6m0h.js";import"./circle-check-big-CXwm43TJ.js";import"./useLabels-B3A1qgdI.js";import"./useSemanticSearch-BK6xhcs8.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function G(){const t=p();return e({to:"/mail/brief"}),r.jsx(o,{thread:t,children:r.jsx(m,{phone:r.jsx(o.Phone,{}),list:r.jsx(o.List,{}),reading:r.jsx(i,{}),intelligence:r.jsx(o.Intelligence,{}),hasThread:!!t})})}export{G as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-Br0mcbGw.js";import"./index-BWDUs3V6.js";import"./ErrorState-B1mR3jCT.js";import"./index-B_8e-R9R.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./confirm-dialog-GmPoGhCn.js";const a=o;export{a as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-Br0mcbGw.js";import"./index-BWDUs3V6.js";import"./ErrorState-B1mR3jCT.js";import"./index-B_8e-R9R.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./confirm-dialog-GmPoGhCn.js";const a=o;export{a as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-Br0mcbGw.js";import"./index-BWDUs3V6.js";import"./ErrorState-B1mR3jCT.js";import"./index-B_8e-R9R.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./confirm-dialog-GmPoGhCn.js";const a=o;export{a as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-Br0mcbGw.js";import"./index-BWDUs3V6.js";import"./ErrorState-B1mR3jCT.js";import"./index-B_8e-R9R.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./confirm-dialog-GmPoGhCn.js";const a=o;export{a as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,a5 as i}from"./index-BWDUs3V6.js";import{a as m}from"./MailShell-CUim8dj6.js";import{F as r}from"./FlaggedPane-DI6-ax2Z.js";import{f as p}from"./search-token-index-CqhHYEC3.js";import{u as e}from"./search-mirror-CykJ2cWs.js";import"./FullCompose-Br0mcbGw.js";import"./ErrorState-B1mR3jCT.js";import"./index-B_8e-R9R.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./confirm-dialog-GmPoGhCn.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-C9Ahbu_k.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./useQueries-C3zqiHO-.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./MailViewChrome-D9aV_9be.js";import"./wizard-selection-B1bng5Jq.js";function z(){const t=p();return e({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{z as component};
|
package/assets/index-BeNI6neR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BWDUs3V6.js";import{O as t}from"./OutboxPane-32Q9m5ko.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./circle-check-big-CXwm43TJ.js";import"./clock-BQeXEzQF.js";import"./row-actions-oBe5D2si.js";import"./rotate-ccw-XBZJu6qP.js";import"./NavMenuButton-BQ9-rzur.js";import"./menu-5hCLgFBH.js";import"./format-3KE4u_Hd.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function c(){return o.jsx(t.Reading,{})}export{c as component};
|
package/assets/index-CLDF_4HA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BWDUs3V6.js";import{M as i}from"./MailboxPane-Dj528iUI.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./useRefreshControl-oC0K6m0h.js";import"./circle-check-big-CXwm43TJ.js";import"./search-token-index-CqhHYEC3.js";import"./useQueries-C3zqiHO-.js";import"./MailListHeader-C9Ahbu_k.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./index-B_8e-R9R.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./ErrorState-B1mR3jCT.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./confirm-dialog-GmPoGhCn.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./MailViewChrome-D9aV_9be.js";import"./NavMenuButton-BQ9-rzur.js";import"./useLabels-B3A1qgdI.js";import"./useSemanticSearch-BK6xhcs8.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-OpVokgSv.js";import"./circle-help-CM8xpE1V.js";import"./circle-check-Baq2FWDe.js";function H(){return o.jsx(i.Reading,{})}export{H as component};
|
package/assets/index-CzK-6vhR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-BWDUs3V6.js";import{B as o}from"./BriefPane-DLK5k99W.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-C9Ahbu_k.js";import"./search-token-index-CqhHYEC3.js";import"./useQueries-C3zqiHO-.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./index-B_8e-R9R.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./ErrorState-B1mR3jCT.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./confirm-dialog-GmPoGhCn.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./useRefreshControl-oC0K6m0h.js";import"./circle-check-big-CXwm43TJ.js";import"./useLabels-B3A1qgdI.js";import"./useSemanticSearch-BK6xhcs8.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function D(){return r.jsx(o.Reading,{})}export{D as component};
|
package/assets/index-DEO1VWcT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BWDUs3V6.js";import{F as r}from"./FlaggedPane-DI6-ax2Z.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-C9Ahbu_k.js";import"./search-token-index-CqhHYEC3.js";import"./useQueries-C3zqiHO-.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./index-B_8e-R9R.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./ErrorState-B1mR3jCT.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./confirm-dialog-GmPoGhCn.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./MailViewChrome-D9aV_9be.js";import"./wizard-selection-B1bng5Jq.js";function y(){return o.jsx(r.Reading,{})}export{y as component};
|
package/assets/index-DyGkymdi.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,ac as o}from"./index-BWDUs3V6.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
|
package/assets/index-H07H7Eex.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-BWDUs3V6.js";import{B as o}from"./BriefPane-DLK5k99W.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-C9Ahbu_k.js";import"./search-token-index-CqhHYEC3.js";import"./useQueries-C3zqiHO-.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./index-B_8e-R9R.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./ErrorState-B1mR3jCT.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./confirm-dialog-GmPoGhCn.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./useRefreshControl-oC0K6m0h.js";import"./circle-check-big-CXwm43TJ.js";import"./useLabels-B3A1qgdI.js";import"./useSemanticSearch-BK6xhcs8.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function C(){return r.jsx(o.Reading,{})}export{C as component};
|
package/assets/index-cMzfCNd2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BWDUs3V6.js";import{M as r}from"./MailboxPane-Dj528iUI.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./useRefreshControl-oC0K6m0h.js";import"./circle-check-big-CXwm43TJ.js";import"./search-token-index-CqhHYEC3.js";import"./useQueries-C3zqiHO-.js";import"./MailListHeader-C9Ahbu_k.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./index-B_8e-R9R.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./ErrorState-B1mR3jCT.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./confirm-dialog-GmPoGhCn.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./MailViewChrome-D9aV_9be.js";import"./NavMenuButton-BQ9-rzur.js";import"./useLabels-B3A1qgdI.js";import"./useSemanticSearch-BK6xhcs8.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-OpVokgSv.js";import"./circle-help-CM8xpE1V.js";import"./circle-check-Baq2FWDe.js";function G(){return o.jsx(r.Reading,{})}export{G as component};
|
package/assets/index-mRH07OoH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BWDUs3V6.js";import{F as r}from"./FlaggedPane-DI6-ax2Z.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-C9Ahbu_k.js";import"./search-token-index-CqhHYEC3.js";import"./useQueries-C3zqiHO-.js";import"./attachment-file-DEH4WgYf.js";import"./mail-BWE-pYx5.js";import"./avatar-BBglc2I4.js";import"./index-B_8e-R9R.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./ErrorState-B1mR3jCT.js";import"./format-3KE4u_Hd.js";import"./download-EfcHBuh8.js";import"./shield-check-lGPCGnQJ.js";import"./useFilters-gaAKlbPF.js";import"./confirm-dialog-GmPoGhCn.js";import"./clock-BQeXEzQF.js";import"./menu-5hCLgFBH.js";import"./MailViewChrome-D9aV_9be.js";import"./wizard-selection-B1bng5Jq.js";function w(){return o.jsx(r.Reading,{})}export{w as component};
|
package/assets/mail-Cg3Fw05o.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as A,r as u,u as Ee,j as e,S as Pe,a as pe,b as k,C as ee,d as te,e as Ae,f as ge,F as Le,g as ze,X as be,T as Te,O as Fe,M as De,A as _e,h as Be,I as Ke,i as ve,B as F,k as Qe,l as Ve,m as z,n as qe,o as U,p as se,q as He,s as $e,t as Ue,v as ye,w as je,x as Se,y as Ge,z as J,D as Ne,E as Ye,G as Je,H as G,J as We,N as E,K as Xe,L as Ze,P as et,Q as tt,R as st,U as at,V as nt,W as rt,Y as ot,Z as it,_ as lt,$ as ct,a0 as ut,a1 as dt,a2 as mt,a3 as xt,a4 as ht,a5 as ft}from"./index-BWDUs3V6.js";import{B as pt,S as gt,D as bt,a as vt,b as yt,u as jt,s as St,c as Nt,K as Ct,d as kt,e as Ce,f as It,g as wt,h as Mt,i as Ot}from"./search-token-index-CqhHYEC3.js";import{u as W,a as Rt}from"./useMessageBodyContent-DS0NFpSx.js";import{P as Et}from"./pencil-YuDLXsRQ.js";import{c as Pt,s as At,M as Lt}from"./MailShell-CUim8dj6.js";import{u as zt,a as Tt,R as Ft,M as Dt}from"./useRefreshControl-oC0K6m0h.js";import{M as _t}from"./menu-5hCLgFBH.js";import{B as ke}from"./bug-D_fNRScy.js";import{A as Bt}from"./avatar-BBglc2I4.js";import{u as Kt,a as Qt}from"./index-B_8e-R9R.js";import{u as X}from"./useQueries-C3zqiHO-.js";import{i as Vt}from"./outbox-status-BlKn6P0x.js";import{E as qt}from"./ErrorState-B1mR3jCT.js";import{K as ae}from"./kbd-B38YZfep.js";import{u as Ht}from"./useDebouncedValue-s7snq_EM.js";import"./search-scope-DTcpOp3S.js";import"./FullCompose-Br0mcbGw.js";import"./confirm-dialog-GmPoGhCn.js";import"./circle-check-big-CXwm43TJ.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";const $t=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 Ut=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 Ie=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 we=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 Gt=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"}]]),Yt="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 Jt({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 Wt({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:l,linkComponent:c,ariaLabel:h,title:d,onClick:g}){const x=Jt({active:n,dimmed:r,indent:o}),p=e.jsx(Wt,{icon:t,label:s,count:a,active:n});return l&&c?c({navId:l,className:x,ariaLabel:h??s,title:d,onClick:g,children:p}):e.jsx("button",{type:"button",onClick:g,className:x,"aria-label":h,title:d,children:p})}const ne={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function Xt(t){switch(t){case"inbox":return e.jsx(Ke,{className:"size-4"});case"flagged":return e.jsx(pe,{className:"size-4"});case"drafts":return e.jsx(Be,{className:"size-4"});case"sent":return e.jsx(ge,{className:"size-4"});case"archive":return e.jsx(_e,{className:"size-4"});case"all":return e.jsx(De,{className:"size-4"});case"junk":return e.jsx(Fe,{className:"size-4"});case"trash":return e.jsx(Te,{className:"size-4"})}}const re=t=>t.role!=null,$=8,oe="remit.nav.folders.open.",ie="remit.nav.account.open.";function le(t,s,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(t+s);return n===null?a:n!=="0"}function ce(t,s,a){typeof localStorage>"u"||localStorage.setItem(t+s,a?"1":"0")}function Zt({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(be,{className:"size-3.5"})})]})}function es({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($t,{className:"size-4 shrink-0"}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Save “",s,"”"]})]}),t.map(o=>e.jsx(Zt,{query:o,onSelect:()=>a?.(o),onRemove:n?()=>n(o):void 0},o))]})}function ts({account:t,selectedNavId:s,onSelectNav:a,linkComponent:n}){const[r,o]=u.useState(()=>le(ie,t.id,!0)),[l,c]=u.useState(()=>le(oe,t.id,!0)),[h,d]=u.useState(!1),g=()=>{o(i=>{const S=!i;return ce(ie,t.id,S),S})},x=()=>{c(i=>{const S=!i;return ce(oe,t.id,S),S})},p=t.mailboxes.filter(re).sort((i,S)=>ne[i.role]-ne[S.role]),m=t.mailboxes.filter(i=>!re(i)),b=h||m.length<=$?m:m.slice(0,$),j=m.length-b.length,y=t.status??"ready",N=y==="ready"&&p.length===0&&m.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:g,"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(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(pt,{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"})]}),N&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),y==="ready"&&e.jsxs(e.Fragment,{children:[p.map(i=>e.jsx(P,{navId:i.id,linkComponent:n,icon:Xt(i.role),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,count:i.unseen,active:s===i.id,dimmed:t.muted,onClick:()=>a?.(i.id)},i.id)),t.outboxPending!==void 0&&e.jsx(P,{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")}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:x,"aria-expanded":l,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:[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:m.length})]}),l&&e.jsxs(e.Fragment,{children:[b.map(i=>e.jsx(P,{navId:i.id,linkComponent:n,icon:e.jsx(Le,{className:"size-4"}),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,count:i.unseen,active:s===i.id,dimmed:t.muted,onClick:()=>a?.(i.id)},i.id)),(j>0||h)&&m.length>$&&e.jsx("button",{type:"button",onClick:()=>d(i=>!i),className:k("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",R),children:h?"Show less":`Show all (${m.length})`})]})]})]})]})]})}function ss({accounts:t,selectedNavId:s,briefUnseen:a,onSelectNav:n,variant:r="desktop",linkComponent:o,calendarNav:l="hidden",savedSearches:c=[],saveableQuery:h,onSelectSavedSearch:d,onRemoveSavedSearch:g,onSaveCurrentSearch:x}){const p=u.useRef(null);Ee({containerRef:p,itemSelector:Yt});const m=r==="drawer",b=e.jsxs("nav",{ref:m?p:void 0,className:m?"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(Pe,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:s==="brief",onClick:()=>n?.("brief")}),l==="shown"&&e.jsx(P,{navId:"calendar",linkComponent:o,icon:e.jsx(Ut,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:s==="calendar",onClick:()=>n?.("calendar")}),e.jsx(P,{navId:"flagged",linkComponent:o,icon:e.jsx(pe,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:s==="flagged",onClick:()=>n?.("flagged")}),e.jsx(es,{savedSearches:c,saveableQuery:h,onSelectSavedSearch:d,onRemoveSavedSearch:g,onSaveCurrentSearch:x}),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(ts,{account:j,selectedNavId:s,onSelectNav:n,linkComponent:o},j.id))]});return m?b:e.jsx("aside",{ref:p,className:"flex h-full w-full flex-col bg-surface-sunken",children:b})}function as({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 ns(){const t=ve();if(!t)return null;const s=t.showNavPane?!t.navCollapsed:!1;return e.jsx(F,{variant:"ghost",size:"sm",icon:e.jsx(_t,{className:"size-4"}),onClick:t.toggleNav,"aria-label":s?"Hide folders":"Show folders","aria-expanded":s,title:"Folders",className:"shrink-0"})}const rs={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function os({search:t,onCompose:s,onReportBug:a,onOpenSettings:n,composeShortcut:r,refreshControl:o,account:l}){return e.jsx(as,{leading:e.jsx(ns,{}),search:e.jsx(gt,{value:t.value,onChange:t.onChange,onClear:t.onClear,onClearQuery:t.onClearQuery,chips:t.chips,onRemoveChip:t.onRemoveChip,placeholder:rs[t.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(F,{variant:"ghost",size:"sm",icon:e.jsx(Gt,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:s}),e.jsx(F,{variant:"ghost",size:"sm",icon:e.jsx(ke,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(F,{variant:"ghost",size:"sm",icon:e.jsx(we,{className:"size-4"}),title:"Settings","aria-label":"Settings",onClick:n}),o,l]})})}function is(){const{pathname:t}=Qe(),s=Ve({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 ls(){const t=qe(),s=U({select:d=>se(d.location.pathname)}),a=U({select:d=>He(d.location.search)}),[n,r]=u.useState(a),o=Ht(n,200),[l,c]=u.useState(s);if(l!==s){const d=At(l,s,a);c(s),d!==void 0&&r(d)}const h=u.useCallback(d=>{c(se(t.state.location.pathname)),r(d)},[t]);return{searchInput:n,committedQuery:Pt(n,o),viewKey:s,setSearchInput:h}}const cs=()=>{const t=W();return $e()?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(Et,{className:"size-6"})})},Me=({children:t})=>{const{Account:s}=Ue();return e.jsx(s,{children:t})},us=({email:t,onSignOut:s})=>{const a=t??"Account";return e.jsxs(bt,{trigger:e.jsx(Bt,{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(vt,{})]}),e.jsxs(yt,{onClick:s,children:[e.jsx(Ie,{className:"size-4"}),"Sign out"]})]})},ds=()=>e.jsx(Me,{children:({email:t,signOut:s})=>e.jsx(us,{email:t,onSignOut:s})});function ms({accounts:t}){const{searchInput:s,onSearchChange:a,onSearchClear:n,onSearchClearQuery:r}=ye(),o=Kt(),l=W(),{scope:c,clearScope:h}=jt(t),d=c.kind==="scoped"?[{id:c.chip.id,label:c.chip.label,tone:"scope"}]:void 0,g=u.useMemo(()=>t.map(j=>j.accountId),[t]),{hasNewMail:x}=zt(),{state:p,errorMessage:m,refresh:b}=Tt(g);return e.jsx(os,{search:{value:s,scope:c.kind,chips:d,onChange:a,onClear:n,onClearQuery:r,onRemoveChip:h},onCompose:l,onReportBug:je,onOpenSettings:()=>o("accounts"),composeShortcut:St("compose"),refreshControl:e.jsx(Ft,{state:p,onRefresh:b,label:"Refresh all accounts",errorMessage:m,hasUpdate:x(g)}),account:e.jsx(ds,{})})}const Z="remit.savedSearches",xs=25;function _(){try{const t=localStorage.getItem(Z);if(!t)return[];const s=JSON.parse(t);return Array.isArray(s)?s.filter(a=>typeof a=="string"):[]}catch{return[]}}function hs(t){const s=t.trim();if(!s)return _();const a=[s,..._().filter(n=>n!==s)].slice(0,xs);try{localStorage.setItem(Z,JSON.stringify(a))}catch{return a}return a}function fs(t){const s=_().filter(a=>a!==t);try{localStorage.setItem(Z,JSON.stringify(s))}catch{return s}return s}const ue=t=>/^\d/.test(t),ps=(t,s)=>{const a=ue(t),n=ue(s);return a&&!n?-1:!a&&n?1:t.localeCompare(s,void 0,{sensitivity:"base",numeric:!0})};function gs(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)=>ps(G(o,void 0,a),G(l,void 0,a))),{system:n,labels:r}}function bs(t,s,a){const n=We(s)&&t.unseenCount>0;return{id:t.mailboxId,name:G(t,s,a),unseen:n?t.unseenCount:void 0,role:s,fullPath:t.fullPath}}function de({accounts:t,onMailboxSelect:s,variant:a="desktop"}){const n=Se(),r=Nt(),o=is(),{searchInput:l,onSearchChange:c}=ye(),[h,d]=u.useState(_),{t:g}=Ge("mail",{useSuspense:!1}),x=u.useCallback((f,C)=>g(f,{defaultValue:C}),[g]),p=X({queries:t.map(f=>({...J({path:{accountId:f.accountId}}),staleTime:1/0}))}),{data:m}=Ne(Ye()),b=u.useMemo(()=>(m?.items??[]).filter(f=>Vt(f.status)).length,[m?.items]),j=u.useMemo(()=>t.map((f,C)=>{const v=p[C],w=v?.data?.items??[],I=Je(f.folderAppointments),{system:M,labels:V}=gs(w,I,x),q=v?.isError?"error":v?.isLoading?"loading":"ready";return{id:f.accountId,label:f.email,email:f.email,muted:!!f.muted,outboxPending:b,status:q,onRetry:()=>v?.refetch(),mailboxes:[...M,...V].map(L=>bs(L,I.get(L.mailboxId),x))}}),[t,p,b,x]),y=f=>{n.invalidateQueries({queryKey:Xe({path:{mailboxId:f},query:{order:"desc"}})})},N=({navId:f,className:C,ariaLabel:v,title:w,children:I,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:w,children:I}):f==="outbox"?e.jsx(E,{to:"/mail/outbox",search:{q:void 0},onClick:()=>M?.(),className:C,"aria-label":v,title:w,children:I}):f==="flagged"?e.jsx(E,{to:"/mail/flagged",search:{q:void 0},onClick:()=>M?.(),className:C,"aria-label":v,title:w,children:I}):f==="settings"?e.jsx(E,{to:"/settings/accounts",onClick:()=>M?.(),className:C,"aria-label":v,title:w,children:I}):e.jsx(E,{to:"/mail/$mailboxId",params:{mailboxId:f},search:{q:void 0},onClick:()=>{y(f),M?.()},className:C,"aria-label":v,title:w,children:I}),i=()=>{c(""),s?.()},S=l.trim(),O=S.length>0&&!h.includes(S)?S:void 0,B=u.useCallback(()=>{O&&d(hs(O))},[O]),K=u.useCallback(f=>{d(fs(f))},[]),Q=u.useCallback(f=>{c(f),r(f),s?.()},[c,r,s]);return e.jsx(ss,{accounts:j,selectedNavId:o,onSelectNav:i,linkComponent:N,variant:a,savedSearches:h,saveableQuery:O,onSaveCurrentSearch:B,onSelectSavedSearch:Q,onRemoveSavedSearch:K})}function vs(){return e.jsxs("button",{type:"button",onClick:je,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 ys({accounts:t,onMailboxSelect:s}){return ve()?.showNavPane??!0?e.jsx(de,{accounts:t}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(de,{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(we,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(vs,{}),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(Ie,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}const js=({isOpen:t,onClose:s})=>(Ze({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(et,{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(be,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:Ct.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(u.Fragment,{children:[o>0&&n.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(ae,{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(ae,{children:"Esc"})," to close"]})})]})]}):null);function Ss(t){const s=X({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0}))});return u.useMemo(()=>kt(s.map(a=>a.data?.items??[])),[s])}const Oe="remit:intelligence-open";function Ns(){try{return localStorage.getItem(Oe)!=="closed"}catch{return!0}}function Cs(t){try{localStorage.setItem(Oe,t?"open":"closed")}catch{}}function me({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 ks=()=>{const t=Ce(),s=tt(),a=st(),n=s.find(at),r=It(),[o,l]=u.useState(Ns),c=r?`${r.threadId}/${r.messageId??""}`:null,[h,d]=u.useState(null),g={panels:s,prefersOpen:o,isDesktop:t==="desktop",hasThread:r!==void 0,openMessage:c},x=me({...g,raisedFor:h}),p=me({...g,raisedFor:null}),m=u.useCallback((N,i)=>{a([...N?["intelligence"]:[],...i?[i]:[]])},[a]),b=u.useCallback(N=>{m(p,N)},[p,m]),j=u.useCallback(()=>{if(x&&!p){d(null);return}const N=!x;Cs(N),l(N),d(null),m(N,n)},[p,x,n,m]),y=u.useCallback(()=>{d(c)},[c]);return{openOverlay:n,intelligenceOpen:x,showOverlay:b,toggleIntelligence:j,raiseIntelligence:y}},Is=t=>t.map(s=>s.data?.items??[]);function ws(t){const s=X({queries:t.map(a=>({...J({path:{accountId:a.accountId}}),staleTime:1/0})),combine:Is});return u.useMemo(()=>nt(t.map((a,n)=>({folderAppointments:a.folderAppointments,mailboxes:s[n]??[]}))),[t,s])}var T={exports:{}},xe;function Ms(){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 c=[],h=s[Symbol.iterator]();let d=!1,g=!1,x=0,p=0;const m=()=>{if(d)return;const b=h.next(),j=p;if(p++,b.done){g=!0,x===0&&r(c);return}x++,Promise.resolve(b.value).then(y=>a(y,j)).then(y=>{c[j]=y,x--,m()},y=>{d=!0,o(y)})};for(let b=0;b<l&&(m(),!g);b++);});return T.exports=t,T.exports.default=t,T.exports}var Os=Ms();const Rs=rt(Os),Es=900*1e3,Ps=300,As=(t,s)=>{if(!t)return s;const a=Number.parseInt(t,10);return Number.isFinite(a)&&a>0?a:s},Ls=60*1e3,zs=t=>Math.max(As(t,Ps)*1e3,Ls),D=zs(ut().mailboxPollIntervalSeconds),Ts=5,Y=new Set,Fs=(t,s,a=Es)=>t.filter(n=>{const r=n.lastSyncAt;return r==null?!0:s-r>a}).map(n=>n.accountId),Ds=(t,s,a=D)=>t-s>=a,_s=(t,s)=>t.filter(a=>!s.has(a)),he=(t,s)=>{if(Y.delete(t),lt(s,{softError:!0},"nobody")){ct(s);return}console.warn("[remit] background mailbox sync failed",{accountId:t,error:s})},fe=(t,s)=>ot({path:{accountId:t},throwOnError:!0}).then(()=>{s.invalidateQueries({queryKey:it({path:{accountId:t}})})}),Bs=t=>{const s=Se(),a=u.useRef(t);a.current=t;const n=t.map(r=>r.accountId).join(",");u.useEffect(()=>{const r=Date.now(),l=Fs(a.current,r).filter(c=>!Y.has(c));if(l.length!==0)for(const c of l)Y.add(c),fe(c,s).catch(h=>{he(c,h)})},[n,s]),u.useEffect(()=>{let r=Date.now(),o;const l=new Set,c=()=>{r=Date.now();const g=_s(a.current.map(x=>x.accountId),l);for(const x of g)l.add(x);Rs(g,x=>fe(x,s).catch(p=>{he(x,p)}).finally(()=>{l.delete(x)}),{concurrency:Ts})},h=()=>{if(document.visibilityState==="visible"){c(),o=setTimeout(h,D);return}},d=()=>{document.visibilityState==="visible"&&Ds(Date.now(),r)&&(o!==void 0&&clearTimeout(o),c(),o=setTimeout(h,D))};return o=setTimeout(h,D),document.addEventListener("visibilitychange",d),()=>{o!==void 0&&clearTimeout(o),document.removeEventListener("visibilitychange",d)}},[n,s])};function la(){const t=dt(),s=Ce(),a=Ot(s),{openOverlay:n,intelligenceOpen:r,showOverlay:o,toggleIntelligence:l,raiseIntelligence:c}=ks(),h=n==="shortcuts",d=n==="nav",{searchInput:g,committedQuery:x,viewKey:p,setSearchInput:m}=ls(),{data:b,isLoading:j,isError:y,error:N,refetch:i}=Ne({...mt(),staleTime:1/0}),S=!!(b&&(b.accounts?.length??0)===0);u.useEffect(()=>{S&&t({to:"/onboarding",replace:!0})},[S,t]),Qt({enabled:!h,bindings:[{key:"?",action:"help",handler:()=>o("shortcuts"),noModifiers:!1,preventDefault:!0}]});const O=W(),B=Rt(),K=U({select:H=>xt(H.matches)?.list==="mailbox"}),Q=u.useMemo(()=>({compose:O}),[O]);wt({enabled:!K&&!B,handlers:Q});const f=u.useCallback(()=>{m("")},[m]),C=u.useCallback(()=>{m("")},[m]),v=b?.accounts??[],w=u.useMemo(()=>v.map(H=>H.accountId),[v]),I=Ss(v),M=ws(v),V=u.useMemo(()=>Mt(v),[v]);Bs(v);const q=u.useCallback(()=>{n==="nav"&&o(void 0)},[n,o]),L={accounts:v,mailboxNameIndex:I,accountNameIndex:V,resultFolderIndex:M,searchQuery:x,searchInput:g,searchViewKey:p,onSearchChange:m,onSearchClear:f,onSearchClearQuery:C,intelligenceOpen:r,onToggleIntelligence:l,onRaiseIntelligence:c},Re={isSinglePane:a,isLoading:j||S,intelligenceOpen:r,nav:e.jsx(ys,{accounts:v,onMailboxSelect:q}),topBar:a?void 0:e.jsx(ms,{accounts:v}),overlay:a?e.jsx(cs,{}):void 0,navOpen:d,onOpenNav:()=>o("nav"),onCloseNav:()=>o(void 0)};return e.jsx(ht.Provider,{value:L,children:e.jsxs(Dt,{accountIds:w,children:[y?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(qt,{title:"Couldn't load your account",error:N,onRetry:()=>{i()}})}):e.jsx(Lt,{chrome:Re,children:e.jsx(ft,{})}),e.jsx(js,{isOpen:h,onClose:()=>o(void 0)})]})})}export{la as component,ye as useMailContext};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,a5 as i}from"./index-BWDUs3V6.js";import{a as m}from"./MailShell-CUim8dj6.js";import{u as p,O as t}from"./OutboxPane-32Q9m5ko.js";import{u as s}from"./search-mirror-CykJ2cWs.js";import"./FullCompose-Br0mcbGw.js";import"./ErrorState-B1mR3jCT.js";import"./index-B_8e-R9R.js";import"./useMessageBodyContent-DS0NFpSx.js";import"./useSignature-DW3HxNEu.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-s7snq_EM.js";import"./confirm-dialog-GmPoGhCn.js";import"./useSearchTokenContext-w53PxiHs.js";import"./kbd-B38YZfep.js";import"./search-scope-DTcpOp3S.js";import"./circle-check-big-CXwm43TJ.js";import"./clock-BQeXEzQF.js";import"./row-actions-oBe5D2si.js";import"./rotate-ccw-XBZJu6qP.js";import"./NavMenuButton-BQ9-rzur.js";import"./menu-5hCLgFBH.js";import"./format-3KE4u_Hd.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 +0,0 @@
|
|
|
1
|
-
import{c as $,r as c,j as m,g as z,b as k,c7 as Q,X as G,c8 as q,c9 as X,ca as Y,cb as J,cc as W,l as x,a1 as N,cd as Z,c0 as w,ce as ee,L as te,y as ne,z as R,G as se,H as oe,v as re,bz as F,bA as ae,cf as M}from"./index-BWDUs3V6.js";import{a as ie,S as ce}from"./search-scope-DTcpOp3S.js";import{u as D}from"./useQueries-C3zqiHO-.js";const Se=$("BellOff",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]);const ve=$("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),le=[{action:"focusNext",keys:["j","k"],label:"navigate"},{action:"muteSender",keys:["m"],label:"mute"},{action:"help",keys:["?"],label:"all shortcuts"}];function Te(e){return le.filter(t=>e[t.action]!==void 0)}const ue=[{title:"Navigation",hints:[{action:"focusNext",keys:["j"],description:"Focus the message below"},{action:"focusPrevious",keys:["k"],description:"Focus the message above"},{action:"focusNext",keys:["↓"],description:"Focus the message below"},{action:"focusPrevious",keys:["↑"],description:"Focus the message above"},{action:"focusFirst",keys:["Home"],description:"Focus first"},{action:"focusLast",keys:["End"],description:"Focus last"},{action:"openFocused",keys:["Enter"],description:"Open focused thread"},{action:"back",keys:["Esc"],description:"Back / close overlay"}]},{title:"Selection",hints:[{action:"toggleSelect",keys:["x"],description:"Toggle select"},{action:"toggleSelect",keys:["Space"],description:"Toggle select"},{action:"extendSelectDown",keys:["Shift","j"],description:"Extend selection down"},{action:"extendSelectUp",keys:["Shift","k"],description:"Extend selection up"},{action:"extendSelectDown",keys:["Shift","↓"],description:"Extend selection down"},{action:"extendSelectUp",keys:["Shift","↑"],description:"Extend selection up"},{action:"selectAll",keys:["⌘","A"],description:"Select all"}]},{title:"Actions",hints:[{action:"reply",keys:["r"],description:"Reply"},{action:"replyAll",keys:["a"],description:"Reply all"},{action:"forward",keys:["f"],description:"Forward"},{action:"delete",keys:["#"],description:"Delete"},{action:"toggleStar",keys:["s"],description:"Star / unstar"},{action:"toggleRead",keys:["u"],description:"Toggle read / unread"}]},{title:"Sender",hints:[{action:"muteSender",keys:["m"],description:"Mute sender"},{action:"blockSender",keys:["b"],description:"Block sender"},{action:"vipSender",keys:["v"],description:"VIP sender"},{action:"markJunk",keys:["!"],description:"Mark junk"}]},{title:"Go to",hints:[{action:"goBrief",keys:["g","b"],description:"Daily brief"},{action:"goInbox",keys:["g","i"],description:"Inbox"},{action:"goSent",keys:["g","s"],description:"Sent"},{action:"goFlagged",keys:["g","f"],description:"Starred"},{action:"goSettings",keys:["g",","],description:"Settings"}]},{title:"View & global",hints:[{action:"toggleIntelligence",keys:["i"],description:"Toggle intelligence"},{action:"toggleDensity",keys:["d"],description:"Toggle density"},{action:"focusSearch",keys:["/"],description:"Focus search"},{action:"compose",keys:["c"],description:"Compose"},{action:"compose",keys:["⌘","N"],description:"Compose"},{action:"help",keys:["?"],description:"Shortcut help"}]}];function de(e){for(const t of ue){const n=t.hints.find(s=>s.action===e);if(n)return n.keys}}function fe(e){const t=de(e);return!t||t.length===0?"":t.length===1?t[0]??"":t[0]==="g"?t.join(" then "):t.join("")}function Ee(e){const t=fe(e);return t===""?"":`(${t})`}function pe({key:e,shiftKey:t=!1,repeat:n=!1,caretAtStart:s,hasValue:i,chipCount:o}){const a=o-1;return e==="Escape"?i?{type:"clearQuery"}:{type:"blur"}:e==="Tab"&&t?o===0?{type:"none"}:{type:"focusChip",index:a}:e==="Backspace"||e==="ArrowLeft"?!s||o===0?{type:"none"}:n?{type:"none"}:{type:"focusChip",index:a}:{type:"none"}}function me({key:e,repeat:t=!1,index:n,chipCount:s}){return e==="Backspace"||e==="Delete"?t?{type:"none"}:{type:"removeChip",index:n}:e==="ArrowLeft"?n===0?{type:"none"}:{type:"focusChip",index:n-1}:e==="ArrowRight"?n>=s-1?{type:"focusInput"}:{type:"focusChip",index:n+1}:e==="Enter"||e===" "?{type:"activateChip",index:n}:e==="Escape"?{type:"focusInput"}:{type:"none"}}function he(e,t){const n=t-1;return n<=0?null:e<n?e:n-1}const ge=e=>e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable:!1,ye=({chips:e=[],onRemoveChip:t,value:n,onChange:s,onClear:i,onClearQuery:o,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:p=!0,size:h="sm",inputId:d,suggest:f,className:b})=>{const O=c.useId(),L=d??O,I=c.useRef(null),K=c.useRef([]),P=o??i,[A,C]=c.useState(null),v=c.useRef(void 0),[B,H]=c.useState(""),T=e.length>0;c.useEffect(()=>{C(r=>r!==null&&r>=e.length?null:r)},[e.length]),c.useEffect(()=>{const r=v.current;if(r!==void 0){if(v.current=void 0,r===null){I.current?.focus();return}K.current[r]?.focus()}});const j=c.useRef(void 0);c.useEffect(()=>{const r=f?.caret;if(!r||r===j.current)return;j.current=r;const l=I.current;!l||l.ownerDocument.activeElement!==l||(l.setSelectionRange(r.cursor,r.cursor),f?.onCaretChange(r.cursor))});const S=r=>{f?.onCaretChange(r.selectionStart??r.value.length)},g=c.useCallback(r=>{C(r),v.current=r},[]),E=c.useCallback(r=>{const l=e[r];l&&t&&(g(he(r,e.length)),H(`${l.label} removed`),t(l.id))},[e,t,g]),_=c.useCallback(()=>{g(null),i()},[i,g]),U=c.useCallback(r=>{const l=r.currentTarget;if(f?.onKeyDown(r))return;const y=pe({key:r.key,shiftKey:r.shiftKey,repeat:r.repeat,caretAtStart:l.selectionStart===0&&l.selectionEnd===0,hasValue:n.length>0,chipCount:e.length});switch(y.type){case"focusChip":r.preventDefault(),g(y.index);return;case"clearQuery":P();return;case"blur":l.blur();return;case"none":return}},[e.length,n,P,g,f]),V=c.useCallback(r=>l=>{const y=me({key:l.key,repeat:l.repeat,index:r,chipCount:e.length});switch(y.type!=="none"&&l.preventDefault(),y.type){case"removeChip":E(y.index);return;case"focusChip":g(y.index);return;case"focusInput":g(null);return;case"activateChip":return;case"none":return}},[e,E,g]);return c.useEffect(()=>{if(!u)return;const r=l=>{l.key!=="/"||l.metaKey||l.ctrlKey||l.altKey||ge(l.target)||q("focusSearch")||(l.preventDefault(),I.current?.focus())};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[u]),m.jsxs("label",{htmlFor:L,className:k("flex w-full items-center gap-1.5 text-sm","bg-surface-sunken/50 border border-transparent","focus-within:bg-canvas focus-within:border-line focus-within:ring-2 focus-within:ring-ring","transition-colors",h==="lg"?"rounded-xl px-4 py-2":"rounded-md px-2.5 py-1",b),children:[m.jsx(z,{className:k("shrink-0 text-fg-muted pointer-events-none",h==="lg"?"size-5":"size-4")}),m.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1",children:[T&&m.jsx("div",{role:"grid","aria-label":"Search filters",className:"flex min-w-0 flex-wrap items-center gap-1",children:e.map((r,l)=>m.jsx(Q,{ref:y=>{K.current[l]=y},label:r.label,tone:r.tone,focused:A===l,onFocusLabel:()=>C(l),onKeyDown:V(l),onRemove:()=>E(l)},r.id))}),m.jsx("input",{ref:I,id:L,name:"q",type:"text","aria-label":"Search mail",autoComplete:"off",value:n,tabIndex:A===null?0:-1,onChange:r=>{s(r.target.value),S(r.target)},onKeyDown:U,onKeyUp:r=>S(r.currentTarget),onClick:r=>S(r.currentTarget),onFocus:r=>{C(null),f?.onFocusChange?.(!0),S(r.currentTarget)},onBlur:()=>f?.onFocusChange?.(!1),...f?.comboboxProps,placeholder:T?void 0:a,className:"min-w-24 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-muted"})]}),(n||T)&&p&&m.jsx("button",{type:"button",onClick:_,className:"shrink-0 rounded p-0.5 hover:bg-surface-raised transition-colors","aria-label":"Clear search",children:m.jsx(G,{className:k("text-fg-muted",h==="lg"?"size-5":"size-4")})}),m.jsx("span",{role:"status","aria-live":"polite",className:"sr-only",children:B})]})},Me=({value:e,onChange:t,onClear:n,onClearQuery:s,chips:i,onRemoveChip:o,placeholder:a="Search mail...",globalFocusKey:u=!0,showClearButton:p=!0,size:h,inputId:d,suggest:f,className:b})=>m.jsx(ye,{value:e,onChange:t,onClear:n,onClearQuery:s,chips:i,onRemoveChip:o,placeholder:a,globalFocusKey:u,showClearButton:p,size:h,inputId:d,suggest:f,className:b});function Ne({handlers:e,enabled:t=!0,target:n,sequenceTimeoutMs:s=1e3}){const i=c.useRef(e);i.current=e;const o=c.useRef(null),a=c.useRef(null);c.useEffect(()=>{if(!t)return;const u=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null)},p=d=>{const f=X({key:d.key,shiftKey:d.shiftKey,metaKey:d.metaKey,ctrlKey:d.ctrlKey,altKey:d.altKey,inEditable:J(d.target),onControl:Y(d.target)},o.current);if(W().length>0){u(),o.current=null;return}if(u(),o.current=f.nextPrefix,f.nextPrefix!==null&&(a.current=setTimeout(()=>{o.current=null,a.current=null},s)),f.action===null||q(f.action)!==null)return;const b=i.current[f.action];b&&(f.preventDefault&&d.preventDefault(),b())},h=n===void 0?window:n;if(h!==null)return h.addEventListener("keydown",p),()=>{h.removeEventListener("keydown",p),u(),o.current=null}},[t,s,n])}function Re(){const e=x({from:"/mail/brief/$threadId",shouldThrow:!1}),t=x({from:"/mail/brief/$threadId/$messageId",shouldThrow:!1}),n=x({from:"/mail/flagged/$threadId",shouldThrow:!1}),s=x({from:"/mail/flagged/$threadId/$messageId",shouldThrow:!1}),i=x({from:"/mail/$mailboxId/$threadId",shouldThrow:!1}),o=x({from:"/mail/$mailboxId/$threadId/$messageId",shouldThrow:!1}),a=e?.threadId??n?.threadId??i?.threadId,u=t?.messageId??s?.messageId??o?.messageId;return c.useMemo(()=>a?{threadId:a,messageId:u}:void 0,[a,u])}function De(){const e=N(),t=Z(),{list:n,mailboxId:s}=w();return c.useCallback((i,o)=>{const a=o?.query,p={search:d=>a===void 0?d:{...d,q:a||void 0},hash:t,replace:o?.replace??!1};if(n==="flagged"){e({to:"/mail/flagged/$threadId/$messageId",params:i,...p});return}const h=o?.mailboxId??s;if(n==="mailbox"&&h){e({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:h,...i},...p});return}e({to:"/mail/brief/$threadId/$messageId",params:i,...p})},[e,t,n,s])}function Le(){return ee()}function be(){const e=N();return c.useCallback(t=>{e({to:"/mail/brief",search:{q:t||void 0}})},[e])}function Ke(){const e=N();return c.useCallback((t,n)=>{e({to:"/mail/$mailboxId",params:{mailboxId:t},search:{q:n||void 0}})},[e])}const Pe=({trigger:e,children:t,align:n="right"})=>{const[s,i]=c.useState(!1),o=c.useRef(null),a=c.useCallback(u=>{o.current&&!o.current.contains(u.target)&&i(!1)},[]);return te({id:"dropdown-menu",open:s,answers:{back:()=>i(!1)}}),c.useEffect(()=>(s&&document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)),[s,a]),m.jsxs("div",{ref:o,className:"relative",children:[m.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),i(!s)},className:k("p-1.5 min-h-11 min-w-11 inline-flex items-center justify-center rounded-md transition-colors","hover:bg-surface-raised text-fg-muted hover:text-fg"),children:e}),s&&m.jsx("div",{className:k("absolute z-50 mt-1 min-w-[180px] py-1","bg-surface border border-line rounded-md shadow-lg",n==="right"?"right-0":"left-0"),children:t})]})},Ae=({onClick:e,disabled:t,destructive:n,children:s})=>m.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),t||e()},disabled:t,className:k("w-full px-3 py-2 text-left text-sm transition-colors","flex items-center gap-2",t&&"opacity-50 cursor-not-allowed",!t&&"hover:bg-surface-raised",n&&"text-danger hover:text-danger"),children:s}),je=()=>m.jsx("div",{className:"my-1 h-px bg-line"}),xe=({accounts:e})=>{const{list:t,mailboxId:n}=w(),{t:s}=ne("mail",{useSuspense:!1}),i=c.useCallback((a,u)=>s(a,{defaultValue:u}),[s]),o=D({queries:e.map(a=>({...R({path:{accountId:a.accountId}}),staleTime:1/0}))});if(t==="outbox")return"Outbox";if(!n)return null;for(let a=0;a<e.length;a++){const u=o[a]?.data?.items;if(!u)continue;const p=u.find(d=>d.mailboxId===n);if(!p)continue;const h=se(e[a].folderAppointments);return oe(p,h.get(n),i)}return null},Fe=({accounts:e})=>{const{mailboxId:t}=w(),n=D({queries:e.map(s=>({...R({path:{accountId:s.accountId}}),staleTime:1/0}))});if(!t)return null;for(const s of n){const i=s.data?.items;if(!i)continue;const o=i.find(a=>a.mailboxId===t);if(o)return o.unseenCount}return null},$e=({accounts:e})=>{const{mailboxId:t}=w(),n=D({queries:e.map(s=>({...R({path:{accountId:s.accountId}}),staleTime:1/0}))});if(!t)return 0;for(const s of n){const i=s.data?.items;if(!i)continue;const o=i.find(a=>a.mailboxId===t);if(o)return o.messageCount}return 0};function qe(e){const t=be(),{searchInput:n}=re(),s=xe({accounts:e}),i=w(),o=ie(i,s),a=c.useCallback(u=>{u===ce&&t(n)},[t,n]);return{scope:o,clearScope:a}}const ke=768,Oe=e=>e!=="desktop",Be=()=>{const e=F(`(min-width: ${ke}px)`);return F(ae)?"desktop":e?"tablet":"phone"};function He(e){const t=new Map;for(const n of e){const s=n.email.toLowerCase(),i=s.split("@")[0];i&&!t.has(i)&&t.set(i,n.accountId),t.has(s)||t.set(s,n.accountId)}return t}function _e(e){const t=new Map;for(const n of e)for(const s of n){const i=s.fullPath?.toLowerCase();if(!i)continue;const o=M(s).toLowerCase();t.has(i)||t.set(i,s.mailboxId),t.has(o)||t.set(o,s.mailboxId)}return t}function Ue(e,t=[]){const n=e.flat().filter(o=>o.fullPath),s=new Map;for(const o of n){const a=M(o).toLowerCase();s.set(a,(s.get(a)??0)+1)}const i=new Map(t.map(o=>[o.accountId,o.email]));return n.map(o=>{const a=M(o),u=s.get(a.toLowerCase())===1,p=t.length>1?i.get(o.accountId):void 0;return{value:u?a:o.fullPath,label:o.displayNameOverride?.trim()||a,...p?{hint:p}:{}}})}function Ve(e){const t=new Map;for(const n of e){const s=n.email.toLowerCase().split("@")[0]??"";t.set(s,(t.get(s)??0)+1)}return e.map(n=>{const s=n.email.split("@")[0]??n.email,i=t.get(s.toLowerCase())===1,o=n.displayName?.trim();return{value:i?s:n.email,label:o||n.email,...o?{hint:n.email}:{}}})}export{Se as B,Pe as D,ue as K,ve as R,Me as S,je as a,Ae as b,be as c,_e as d,Be as e,Re as f,Ne as g,He as h,Oe as i,De as j,Le as k,xe as l,Fe as m,$e as n,Ke as o,le as p,Ue as q,Ve as r,fe as s,Ee as t,qe as u,Te as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,a5 as o}from"./index-BWDUs3V6.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as E,e as q,b as j,B as A,r as i,aK as R,x as T,v as L,a7 as D,Z as K,Y as Q,_ as $,$ as z}from"./index-BWDUs3V6.js";import{C as B}from"./circle-check-big-CXwm43TJ.js";import{R as G}from"./search-token-index-CqhHYEC3.js";import{u as _}from"./useQueries-C3zqiHO-.js";function oe({state:e,onRefresh:s,label:t,errorMessage:n,hasUpdate:a,size:u="sm",className:c}){const o=e==="refreshing",m=e==="error",f=e==="success",g=m?E.jsx(q,{className:"size-4 text-danger"}):f?E.jsx(B,{className:"size-4 text-positive"}):E.jsx(G,{className:j("size-4",o&&"animate-spin")}),y=m?`${t} — failed: ${n??"try again"}`:o?`${t} — refreshing`:f?`${t} — up to date`:a?`${t} — new mail`:t;return E.jsxs("div",{className:"relative inline-flex",children:[E.jsx(A,{variant:"ghost",size:u,icon:g,onClick:s,disabled:o,"aria-label":y,"aria-busy":o||void 0,title:m?n:t,className:c}),e==="idle"&&a&&E.jsx("span",{"aria-hidden":"true",className:"absolute right-1 top-1 size-1.5 rounded-full bg-accent-2"})]})}const H=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function N(e){return!!e&&H.has(e)}const P=3e3,U=P*2,v={syncing:!1,resolved:!1,synced:0,total:0};function ie(e,s){const t=e.join(","),[n,a]=i.useState(!1),[u,c]=i.useState(!1);i.useEffect(()=>{a(!1),c(!1)},[t,s]),i.useEffect(()=>{if(!s)return;const r=setTimeout(()=>c(!0),U);return()=>clearTimeout(r)},[t,s]);const o=_({queries:e.map(r=>({...R({path:{accountId:r}}),enabled:s&&!n,refetchInterval:P,meta:{softError:!0}}))}),m=o.every(r=>r.isSuccess||r.isError),f=o.length===0||m||u;let g=!1,y=0,w=0;for(const r of o)if(N(r.data?.syncPhase)){g=!0;for(const l of r.data?.mailboxes??[])y+=l.messagesSynced,w+=l.messagesTotal}const S=s&&f&&!g;return i.useEffect(()=>{S&&a(!0)},[S]),!s||!f?v:{syncing:g,resolved:!0,synced:y,total:w}}const M=6e4,W=new Set(["sent","drafts","trash","archive"]),b=(e,s)=>{const t=new Map;for(const n of e){const a=s.get(n.mailboxId)?.role;a&&W.has(a)||t.set(n.mailboxId,n.messagesTotal)}return t},X=(e,s)=>{for(const[t,n]of s)if(n>(e.get(t)??0))return!0;return!1},F=i.createContext(null),Y=()=>{const e=i.useContext(F);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function ce({accountIds:e,children:s}){const t=T(),{resultFolderIndex:n}=L(),a=i.useRef(new Map),u=i.useRef(new Set),[c,o]=i.useState(new Set),m=_({queries:e.map(r=>({...R({path:{accountId:r}}),refetchInterval:M,staleTime:M,meta:{softError:!0}}))}),f=m.map(r=>r.dataUpdatedAt).join(","),g=e.join(",");i.useEffect(()=>{let r=!1;const l=new Set(c);e.forEach((d,x)=>{const p=m[x]?.data;if(!p)return;const h=b(p.mailboxes??[],n);if(!u.current.has(d)){u.current.add(d),a.current.set(d,h);return}if(l.has(d))return;const O=a.current.get(d)??new Map;X(O,h)&&(l.add(d),r=!0)}),r&&o(l)},[g,f]);const y=i.useCallback(r=>r.some(l=>c.has(l)),[c]),w=i.useCallback(r=>{o(l=>{if(r.every(x=>!l.has(x)))return l;const d=new Set(l);for(const x of r)d.delete(x);return d});for(const l of r){const d=t.getQueryData(R({path:{accountId:l}}).queryKey);a.current.set(l,b(d?.mailboxes??[],n)),u.current.add(l)}},[t,n]),S=i.useMemo(()=>({hasNewMail:y,acknowledge:w}),[y,w]);return E.jsx(F.Provider,{value:S,children:s})}const Z=2e3,I=45e3,J=e=>new Promise(s=>setTimeout(s,e)),k=e=>e instanceof Error&&e.message?e.message:"Something went wrong",V=e=>{$(e,{softError:!0},"user")&&z(e)},C=(e,s)=>e.fetchQuery({...R({path:{accountId:s}}),staleTime:0}),ee=async({accountId:e,readStatus:s,baselineLastSyncAt:t,deadline:n,pollMs:a=Z})=>{for(;;){const u=await s().then(f=>({ok:!0,data:f})).catch(f=>({ok:!1,error:f}));if(!u.ok)return{accountId:e,message:k(u.error)};const{syncPhase:c,lastSyncAt:o}=u.data;if((o??0)>t&&!N(c))return c==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(Date.now()>=n)return{accountId:e,message:"Refresh is taking longer than usual"};await J(a)}},te=async(e,s,t,n)=>{const a=await C(e,t).then(o=>({ok:!0,lastSyncAt:o.lastSyncAt??0})).catch(o=>({ok:!1,error:o}));if(!a.ok)return{accountId:t,enqueued:!1,ok:!1,message:k(a.error)};const u=await Q({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(o=>({ok:!1,error:o}));if(!u.ok)return V(u.error),{accountId:t,enqueued:!1,ok:!1,message:k(u.error)};s.recordEvent("sync.triggered");const c=await ee({accountId:t,readStatus:()=>C(e,t),baselineLastSyncAt:a.lastSyncAt,deadline:n});return c?{accountId:t,enqueued:!0,ok:!1,message:c.message}:{accountId:t,enqueued:!0,ok:!0}},ue=(e,s={})=>{const t=T(),n=D(),{acknowledge:a}=Y(),[u,c]=i.useState("idle"),[o,m]=i.useState(),f=i.useRef(0),g=i.useRef(e);g.current=e;const y=i.useRef(s);y.current=s,i.useEffect(()=>{if(u!=="success")return;const S=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(S)},[u]);const w=i.useCallback(()=>{const S=g.current;if(S.length===0){c("error"),m("Nothing to refresh yet");return}const r=++f.current;c("refreshing"),m(void 0),(async()=>{const l=Date.now()+I,d=await Promise.all(S.map(h=>te(t,n,h,l)));if(f.current!==r)return;const x=d.filter(h=>h.enqueued).map(h=>h.accountId);for(const h of x)t.invalidateQueries({queryKey:K({path:{accountId:h}})});x.length>0&&(y.current.onSettled?.(),a(x));const p=d.filter(h=>!h.ok);p.length===0?c("success"):(c("error"),m(p[0]?.message))})()},[a,t,n]);return{state:u,errorMessage:o,refresh:w}};export{ce as M,oe as R,ue as a,ie as b,N as i,Y as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{x as T,ai as I,ak as k,bK as C,bY as A,r as v,j as p,bZ as h,b_ as E,b$ as D,v as j,c0 as w,D as z,c1 as Q,bN as R}from"./index-BWDUs3V6.js";import{P as _}from"./attachment-file-DEH4WgYf.js";import{E as N,F as O,ao as P,ap as q}from"./MailListHeader-C9Ahbu_k.js";import{a as B}from"./useLabels-B3A1qgdI.js";import{n as F}from"./search-query-Cr_ZXBCp.js";import{s as U}from"./search-scope-DTcpOp3S.js";import{u as G,p as H}from"./useSearchTokenContext-w53PxiHs.js";const ae=e=>{const t=new Set;for(const a of e)a&&t.add(a);return t.size>1?{accountId:void 0,restriction:"spansAccounts",moveDisabledHint:"Move only works within one account — clear selection or pick messages from a single account"}:{accountId:t.size===1?[...t][0]:void 0,restriction:void 0,moveDisabledHint:void 0}},K=e=>{const{mailboxId:t,messages:a}=e,c=T(),{pushError:l}=I(),{mutateAsync:i,isPending:o}=k({...A(),onError:(n,u)=>{l({title:u.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:C(n),error:n})},onSettled:(n,u,d)=>{N(c,O(P(d.body.messageIds??[],a??[],t)))}});return{applyLabel:v.useCallback((n,u,d)=>{n.length!==0&&q(n,m=>i({body:{messageIds:m,labelId:u,action:d}}))},[i]),isPending:o}};function ne({accountId:e,mailboxId:t,messageIds:a}){const{labels:c}=B(e),{applyLabel:l}=K({mailboxId:t}),i=v.useMemo(()=>c.map(o=>({key:o.labelId,label:o.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${E(o.color)?h[o.color]:h.Default}`}),onSelect:()=>l(a,o.labelId,"Apply")})),[c,a,l]);return i.length===0?null:p.jsx(_,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(D,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:i,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 $=20,V=new Set(Object.values(R)),Y=e=>e!==void 0&&V.has(e)?e:void 0,Z=e=>{if(e.some(t=>t.type==="isUnread"))return!1;if(e.some(t=>t.type==="isRead"))return!0};function re({mailboxId:e,filterCategory:t}={}){const{searchQuery:a}=j(),c=G(),l=w(),i=F(a),{freeText:o,tokens:r}=H(i,c),n=o.length>0,u=r.find(s=>s.type==="category"),d=Y(t)??u?.category,m=r.some(s=>s.type==="hasAttachment")?!0:void 0,b=r.some(s=>s.type==="isStarred")?!0:void 0,y=Z(r),f=r.find(s=>s.type==="after"),g=r.find(s=>s.type==="before"),x=r.find(s=>s.type==="in"),S=U({browsed:l,callerMailboxId:e,inTokenMailboxId:x?.mailboxId}),{data:L,isLoading:M}=z({...Q({query:{query:o,mailboxId:S,limit:$,...d!==void 0?{category:d}:{},...m!==void 0?{hasAttachment:m}:{},...b!==void 0?{hasStars:b}:{},...y!==void 0?{isRead:y}:{},...f?{sentDateFrom:f.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:n,staleTime:6e4});return{hits:L?.items??[],isLoading:n&&M}}export{ne as L,ae as r,re as u};
|