@remit/web-client-dist 0.0.402 → 0.0.403
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-D1HAyJwj.js → BriefPane-R4rcTAO3.js} +1 -1
- package/assets/{ErrorState-C332ruf-.js → ErrorState-C4QR2OHT.js} +1 -1
- package/assets/{FlaggedPane-CZNq4iiw.js → FlaggedPane-CzQn701M.js} +1 -1
- package/assets/{FullCompose-C2k-JMrq.js → FullCompose-CTpFjCtM.js} +1 -1
- package/assets/MailListHeader-D9UyUWpO.js +7 -0
- package/assets/{MailViewChrome-CDCDo6k8.js → MailViewChrome-BZcvy1C_.js} +1 -1
- package/assets/MailboxPane-U1SkJ4BI.js +1 -0
- package/assets/{NavMenuButton-C70EOG64.js → NavMenuButton-DcnV6Hj5.js} +1 -1
- package/assets/{OnboardingWizard-Dmvq_UiW.js → OnboardingWizard-Dz61uK44.js} +1 -1
- package/assets/{OutboxPane-CRrYo-Ah.js → OutboxPane-NAu0D-vN.js} +1 -1
- package/assets/_mailboxId-ppTzLsI0.js +1 -0
- package/assets/_messageId-4WjOyoww.js +1 -0
- package/assets/_messageId-CZYt4DU7.js +1 -0
- package/assets/_messageId-hnrVh4pn.js +1 -0
- package/assets/_outboxMessageId-Bu7skeag.js +1 -0
- package/assets/_threadId-B3mAevNn.js +1 -0
- package/assets/_threadId-BJHyXjLW.js +1 -0
- package/assets/_threadId-DXzrBvlx.js +1 -0
- package/assets/{accounts-DKymMdYg.js → accounts-Bjer_T0C.js} +1 -1
- package/assets/{advanced-7gVrHHYQ.js → advanced-10eV5vPf.js} +1 -1
- package/assets/{appearance-BMe1cgu9.js → appearance-DmVSvDqw.js} +1 -1
- package/assets/{attachment-file-8N0XrQKe.js → attachment-file-Bjm6lsCc.js} +1 -1
- package/assets/{avatar--VQz8d_L.js → avatar-DV1csnvT.js} +1 -1
- package/assets/{bottom-sheet-BvjDLGZa.js → bottom-sheet-BBgLAlb7.js} +1 -1
- package/assets/brief-Cr9YlJSF.js +1 -0
- package/assets/{brief-DRw-Bxe5.js → brief-fmvzcuvn.js} +1 -1
- package/assets/{browser-ponyfill-BspIUGg5.js → browser-ponyfill-IL0YXJKR.js} +1 -1
- package/assets/{bug-BRW8WWaz.js → bug-BjQ-Km4e.js} +1 -1
- package/assets/{circle-check-BTFZ8lhq.js → circle-check-CccsDKfb.js} +1 -1
- package/assets/{circle-check-big-CL1-ZB_O.js → circle-check-big-BLaZbuG9.js} +1 -1
- package/assets/{circle-help-yrrwRTfu.js → circle-help-BJd9ea_a.js} +1 -1
- package/assets/{clock-C0yW1eee.js → clock-Cyo25YTD.js} +1 -1
- package/assets/compose._-_outboxMessageId_-BAb_afcd.js +1 -0
- package/assets/compose._-_outboxMessageId_-CLnUkdJ7.js +1 -0
- package/assets/compose._-_outboxMessageId_-D_tVDnUF.js +1 -0
- package/assets/compose._-_outboxMessageId_-wfhWchvo.js +1 -0
- package/assets/{confirm-dialog-vx3llY3y.js → confirm-dialog-CQSTQRV2.js} +1 -1
- package/assets/{download-DnKAe7xV.js → download-KdO2vtfS.js} +1 -1
- package/assets/{filters-BZDRgbqS.js → filters-BQtHIEIt.js} +1 -1
- package/assets/flagged-CqBM51xW.js +1 -0
- package/assets/{flagged-CB_-eECE.js → flagged-D8pI5TWD.js} +1 -1
- package/assets/folders-DzKrhOGh.js +1 -0
- package/assets/format-DlutEuGc.js +1 -0
- package/assets/{help-copy-sDsaUy4w.js → help-copy-B9vfpQrv.js} +1 -1
- package/assets/index-4WjOyoww.js +1 -0
- package/assets/index-Bq2nvB6b.js +1 -0
- package/assets/index-CP_u7qA0.js +294 -0
- package/assets/index-CPxKl4U-.js +1 -0
- package/assets/{index-Bn4mOVkF.css → index-DQPXHKId.css} +1 -1
- package/assets/index-DU0Ih05G.js +1 -0
- package/assets/{index-Bi4k0VjD.js → index-EM4Uoip4.js} +6 -6
- package/assets/index-UR3grqCv.js +1 -0
- package/assets/index-hnrVh4pn.js +1 -0
- package/assets/index-yDlPrIVD.js +1 -0
- package/assets/index-zz2iXRjs.js +1 -0
- package/assets/{kbd-xKdnOGJZ.js → kbd-BaSoxAuP.js} +1 -1
- package/assets/{labels-rPmbMwhf.js → labels-O2y4gldY.js} +1 -1
- package/assets/{mail-o1u4DLkr.js → mail-Czi2Y_GZ.js} +1 -1
- package/assets/{mail-CehhDpTR.js → mail-gESMSqqx.js} +1 -1
- package/assets/{menu-DwmzGbPW.js → menu-xsfahEJ7.js} +1 -1
- package/assets/{onboarding-CxRKGCoI.js → onboarding-CEnH8bth.js} +1 -1
- package/assets/outbox-DIxEoc9O.js +1 -0
- package/assets/{pencil-DlDFsTyP.js → pencil-BXASGhia.js} +1 -1
- package/assets/{rich-text-Bs3K2ckY.js → rich-text-DGY3tZhu.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-BxTYxkIb.js → rich-text-spellcheck-worker-provider-DJ4digRi.js} +1 -1
- package/assets/{rotate-ccw-JyEVADG2.js → rotate-ccw-D3n8wodI.js} +1 -1
- package/assets/{row-actions-CujtZtFp.js → row-actions-P90tXTrG.js} +1 -1
- package/assets/{search-scope-BTnbXVTo.js → search-scope-BQ8HHXSV.js} +1 -1
- package/assets/search-token-index-CG7hPaco.js +1 -0
- package/assets/{search-view-Duk4APqX.js → search-view-CNPgAIwM.js} +1 -1
- package/assets/{senders-DD9A8SSC.js → senders-CcBjhLBV.js} +1 -1
- package/assets/settings-Em9by5Kf.js +1 -0
- package/assets/{settings-screen-DQHIX7C-.js → settings-screen-D-_K_C3M.js} +1 -1
- package/assets/{shield-check-DCsAIcLk.js → shield-check-CVmTR1hh.js} +1 -1
- package/assets/{suggested-vips-zREyYZ2F.js → suggested-vips-C-kYnJRU.js} +1 -1
- package/assets/{useDebouncedValue-CRl9MGSf.js → useDebouncedValue-0nS8-8zw.js} +1 -1
- package/assets/{useFilters-DHXpeKMC.js → useFilters-CCgvHNzK.js} +1 -1
- package/assets/{useLabels-BcSt40TB.js → useLabels-Bxa6Xpyj.js} +1 -1
- package/assets/{useMediaQuery-C90gO3CZ.js → useMediaQuery-kszmEDQl.js} +1 -1
- package/assets/{useMessageBodyContent-B-Ao8GWA.js → useMessageBodyContent-gWn_VAyS.js} +1 -1
- package/assets/{useRefreshControl-BAeVhAou.js → useRefreshControl-CEi6jGL4.js} +1 -1
- package/assets/{useSearchMirror-B7mwdkFd.js → useSearchMirror-DjVzjTGW.js} +1 -1
- package/assets/{useSearchTokenContext-CKiYWkSJ.js → useSearchTokenContext-Rec5qr0P.js} +2 -2
- package/assets/useSemanticSearch-CAmlG47i.js +1 -0
- package/assets/{useSignature-BUA39T5e.js → useSignature-DQ37CqeJ.js} +1 -1
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/MailListHeader-BWwp1ceH.js +0 -7
- package/assets/MailboxPane-DNUgw9hU.js +0 -1
- package/assets/_mailboxId-B-sHGfoz.js +0 -1
- package/assets/_messageId-C1qKPamr.js +0 -1
- package/assets/_messageId-C25UV9LM.js +0 -1
- package/assets/_messageId-DeSdz87B.js +0 -1
- package/assets/_outboxMessageId-B94Fh1en.js +0 -1
- package/assets/_threadId-C7emibLe.js +0 -1
- package/assets/_threadId-CViHQCwA.js +0 -1
- package/assets/_threadId-aEW3plLl.js +0 -1
- package/assets/brief-Bx3Y9xQn.js +0 -1
- package/assets/compose._-_outboxMessageId_-Bc7fc59g.js +0 -1
- package/assets/compose._-_outboxMessageId_-DHLSYgG-.js +0 -1
- package/assets/compose._-_outboxMessageId_-DN5Mftwg.js +0 -1
- package/assets/compose._-_outboxMessageId_-StmhPRcC.js +0 -1
- package/assets/enums-B_igRgfI.js +0 -1
- package/assets/flagged-4DoWrHJ3.js +0 -1
- package/assets/folders-DLa_CcpT.js +0 -1
- package/assets/format-D7umvejg.js +0 -1
- package/assets/index-B61k9RLS.js +0 -294
- package/assets/index-BCZl14-3.js +0 -1
- package/assets/index-C1qKPamr.js +0 -1
- package/assets/index-D9OAW-hw.js +0 -1
- package/assets/index-DeSdz87B.js +0 -1
- package/assets/index-DlSdWGZB.js +0 -1
- package/assets/index-DsUtV_jS.js +0 -1
- package/assets/index-J1diOeib.js +0 -1
- package/assets/index-_RaWFdnD.js +0 -1
- package/assets/move-options-YWV9hlAS.js +0 -1
- package/assets/outbox-BYHZDJTa.js +0 -1
- package/assets/search-token-index-D2uoFCjs.js +0 -1
- package/assets/settings-CAeDAiZ1.js +0 -1
- package/assets/useSemanticSearch-_EOOLQQp.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r,bj as ys,as as kt,B as oe,S as Is,b as Ee,at as $t,r as c,C as Cs,d as ws,aY as ks,m as Ue,n as Bt,s as jt,t as js,a7 as Wt,bk as Ms,bl as Rs,I as Ts,h as Es,T as As,bm as Os,bn as Ns,bo as zs,a5 as Fs,aF as Ds,aG as _s,g as Ls,W as Mt,bp as Ps,K as $s,aV as Bs,q as Ws,aW as Vs,aX as Ks,bq as Hs,br as qs,l as Vt,bs as Us,z as Qs,bt as Js,b4 as Gs}from"./index-CP_u7qA0.js";import{u as Ys,p as Xs,R as Zs}from"./useSearchTokenContext-Rec5qr0P.js";import{u as en,a as tn,R as sn}from"./useRefreshControl-CEi6jGL4.js";import{C as Kt,a as Ht,c as qt,j as nn,M as on,t as Ut,u as rn,b as an,d as Qt,e as Jt,f as ln,g as cn,h as un,r as dn,n as hn,i as fn,k as mn,l as gn,m as pn,o as xn,S as bn,p as vn,D as Sn,q as yn,s as In,v as Gt,w as Cn,x as wn,y as kn,z as jn,A as Mn,B as Rn,E as Tn,F as En,G as An,H as On,I as Nn,J as zt,K as Ft,L as zn,N as Fn,O as Dn,P as _n,Q as Ln,R as Pn,T as $n,U as Bn,V as Wn,W as Vn,X as Kn,Y as Hn,Z as Yt,_ as Xt,$ as Zt,a0 as qn,a1 as Un,a2 as Qn,a3 as es,a4 as Jn,a5 as Gn}from"./MailListHeader-D9UyUWpO.js";import{S as Yn,M as Xn,a as Zn,u as eo,b as to}from"./MailViewChrome-BZcvy1C_.js";import{A as Rt}from"./avatar-DV1csnvT.js";import{b as Qe,c as so}from"./format-DlutEuGc.js";import{k as no,n as oo,o as Je,p as io,r as ro,f as ao,h as lo,u as co}from"./useMessageBodyContent-gWn_VAyS.js";import{N as uo}from"./NavMenuButton-DcnV6Hj5.js";import{f as ho}from"./ErrorState-C4QR2OHT.js";import{a as fo}from"./useLabels-Bxa6Xpyj.js";import{a as mo,D as go,u as po}from"./useMediaQuery-kszmEDQl.js";import{L as xo,u as bo}from"./useSemanticSearch-CAmlG47i.js";import{S as ft}from"./shield-check-CVmTR1hh.js";import{B as vo}from"./bottom-sheet-BBgLAlb7.js";import{C as So}from"./circle-help-BJd9ea_a.js";import{C as yo}from"./circle-check-CccsDKfb.js";import{j as Io,k as Co,e as wo}from"./search-token-index-CG7hPaco.js";import{n as ko}from"./search-query-Cr_ZXBCp.js";const jo=({children:e,onRefresh:n,isRefreshing:t})=>mo(go)?e:r.jsx(ys,{onRefresh:n,isPullable:!t,children:e}),Mo=e=>e===1?"message":"messages";function Ro({count:e,onReview:n,onDismiss:t,actionLabel:s="Review & rescue"}){return r.jsx(kt,{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(ft,{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} ${Mo(e)} here`})," ","may not be spam — they're from senders we can verify."]})]}),r.jsx(oe,{variant:"primary",size:"sm",onClick:n,className:"self-start",children:s})]})})}const To=(e,n)=>e==="vip"?"vip":e==="unknown"&&n==="md"?"unknown-pill":"hidden",ts=({senderTrust:e,size:n="sm",className:t})=>{const s=To(e,n);return s==="vip"?r.jsx(Is,{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 Eo({candidate:e,selected:n,onToggle:t,hideSender:s=!1}){const{senderName:o,senderAddress:i,subject:l,snippet:a,trustReason:u,trustSubReason:d,senderTrust:f}=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(Kt,{className:"mt-0.5",checked:n,onChange:t,"aria-label":`${n?"Deselect":"Select"} ${s?l:`message from ${o}`}`}),!s&&r.jsx(Rt,{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}),f&&r.jsx(ts,{senderTrust:f,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($t,{tone:"positive",children:[r.jsx(ft,{className:"size-3","aria-hidden":!0}),u]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:d})]})]})]})}const Ao=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)},Oo=(e,n)=>{const t=e.messages.filter(s=>n.has(s.id)).length;return t===0?"none":t===e.messages.length?"all":"some"},Dt=e=>e===1?"message":"messages";function No({group:e,selected:n,onToggleGroup:t,onToggleMessage:s}){const[o,i]=c.useState(!1),l=Oo(e,n),a=e.messages.length,u=o?Cs:ws;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(Kt,{className:"mt-0.5",checked:l==="all",indeterminate:l==="some",onChange:()=>t(e,l!=="all"),"aria-label":`${l==="all"?"Deselect":"Select"} all ${a} ${Dt(a)} from ${e.senderName}`}),r.jsx(Rt,{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(ts,{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($t,{tone:"positive",children:[r.jsx(ft,{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(d=>!d),"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} ${Dt(a)}`,r.jsx(u,{className:"size-3.5","aria-hidden":!0})]})]}),o&&r.jsx("div",{className:"divide-y divide-line border-t border-line",children:e.messages.map(d=>r.jsx(Eo,{candidate:d,selected:n.has(d.id),onToggle:()=>s(d.id),hideSender:!0},d.id))})]})}const Tt=e=>e===1?"message":"messages",zo=(e,n)=>`Moves ${e===1?"this message":`these ${e} ${Tt(e)}`} out of Spam to ${n} now. Nothing later.`,wt=(e,n)=>e.find(t=>t.id===n)?.label??"Inbox";function Fo(){return r.jsx(kt,{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 Do({candidates:e,selected:n,onToggle:t,onToggleGroup:s,onSelectAll:o,onSelectNone:i,onContinue:l,onCancel:a}){const[u,d]=c.useState(!1),f=n.size,p=c.useMemo(()=>Ao(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(ft,{className:"size-4 text-positive","aria-hidden":!0}),"Rescue from Spam"]}),r.jsx(oe,{variant:"ghost",size:"sm",icon:r.jsx(So,{className:"size-3.5"}),onClick:()=>d(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."}),u&&r.jsx("div",{className:"mt-2",children:r.jsx(Fo,{})})]}),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:`${f} of ${e.length} selected · ${p.length} ${p.length===1?"sender":"senders"}`}),r.jsxs("span",{className:"flex gap-1",children:[r.jsx(oe,{variant:"ghost",size:"sm",onClick:o,children:"Select all"}),r.jsx(oe,{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:p.map(m=>r.jsx(No,{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(oe,{variant:"primary",onClick:l,className:"h-11 w-full font-semibold",children:`Continue with ${f} ${Tt(f)}`}),r.jsx(oe,{variant:"ghost",onClick:a,className:"h-11 w-full",children:"Cancel"})]})]})}function _o({count:e,folders:n,delimiter:t,destination:s,onPick:o,onMove:i,onBack:l}){const[a,u]=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(ks,{folders:n,selectedId:s,delimiter:t,onSelect:o,onCancel:()=>u(!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:wt(n,s)}),r.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>u(!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:zo(e,wt(n,s))}),r.jsx(oe,{variant:"primary",onClick:i,className:"h-11 w-full font-semibold",children:`Move ${e} out of Spam`}),r.jsx(oe,{variant:"ghost",onClick:l,className:"h-11 w-full",children:"Back"})]})]})}function Lo({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(yo,{className:"size-10 text-positive","aria-hidden":!0}),r.jsx("p",{className:"text-base font-semibold text-fg",children:`Moved ${e} ${Tt(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(oe,{variant:"primary",onClick:t,className:"h-11 w-full font-semibold",children:"Done"})})]})}function Po({open:e,candidates:n,defaultDestinationId:t,availableFolders:s,delimiter:o,onConfirmMove:i,onCancel:l}){const[a,u]=c.useState("review"),[d,f]=c.useState(()=>e?new Set(n.map(C=>C.id)):new Set),[p,m]=c.useState(t),[S,y]=c.useState(0),I=c.useRef(!1);c.useEffect(()=>{e&&!I.current&&(u("review"),f(new Set(n.map(C=>C.id))),m(t),y(0)),I.current=e},[e,n,t]);const R=d.size,g=C=>{f(M=>{const O=new Set(M);return O.has(C)?O.delete(C):O.add(C),O})},x=(C,M)=>{f(O=>{const E=new Set(O);for(const N of C.messages)M?E.add(N.id):E.delete(N.id);return E})},j=()=>{const C=Array.from(d);y(C.length),i(C,p),u("done")};return r.jsxs(vo,{open:e,onClose:l,dismissLabel:"Close rescue",children:[a==="review"&&r.jsx(Do,{candidates:n,selected:d,onToggle:g,onToggleGroup:x,onSelectAll:()=>f(new Set(n.map(C=>C.id))),onSelectNone:()=>f(new Set),onContinue:()=>u("destination"),onCancel:l}),a==="destination"&&r.jsx(_o,{count:R,folders:s,delimiter:o,destination:p,onPick:m,onMove:j,onBack:()=>u("review")}),a==="done"&&r.jsx(Lo,{count:S,destinationLabel:wt(s,p),onClose:l})]})}function $o(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 Bo(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 Wo({outboxMessages:e,accountId:n,imapThreads:t}){const s=e.filter(l=>l.status==="draft"&&l.accountId===n).map($o),o=t.map(Bo),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 Vo=({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})]}),Ko=({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(Es,{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(As,{className:"size-3.5"})})})]}),Ho=({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(Rt,{name:e.fromName,email:e.fromEmail,size:"sm"}),r.jsx(Ht,{thread:e})]})};function qo({mailboxId:e,accountId:n,selectedMessageId:t,imapThreads:s,title:o,unreadCount:i}){const l=no(),a=oo(),u=Ue(),d=Je(),f=Bt(),{data:p}=jt(js()),m=c.useMemo(()=>Wo({outboxMessages:p?.items??[],accountId:n,imapThreads:s}),[p?.items,n,s]),S=Wt({...Rs(),onSuccess:()=>{f.invalidateQueries({queryKey:Ms()})}}),y=g=>{S.mutate({path:{outboxMessageId:g}})},I=g=>{const x=s.find(j=>j.messageId===g)?.threadId;x&&u({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:e,threadId:x,messageId:g},search:j=>j,hash:d})},R=m.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(uo,{}),r.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:o}),(i??0)>0&&r.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:[i," unread"]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:R?r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-center px-4",children:[r.jsx(Ts,{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."})]}):m.map(g=>r.jsxs("div",{children:[g.label&&r.jsx(Vo,{label:g.label,count:g.threads.length}),r.jsx("div",{className:"divide-y divide-line",children:g.threads.map(x=>g.id==="remit-drafts"?r.jsx(Ko,{row:x,isSelected:x.id===l,onOpen:a,onDelete:y,isDeleting:S.isPending},x.id):r.jsx(Ho,{row:x,isSelected:x.id===t,onOpen:I},x.id))})]},g.id))})]})}function Uo(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 u=+i;if(Number.isInteger(u)&&u>=0&&u<e){let d=o[u];if(!d){const f=n[u*2];d=o[u]={index:u,key:t(u),start:f,size:n[u*2+1],end:f+n[u*2+1],lane:0}}return d}}if(i==="length")return e}return Reflect.get(o,i,l)}})}function Be(e,n,t){let s=t.initialDeps??[],o,i=!0;function l(){const a=e();return(a.length!==s.length||a.some((d,f)=>s[f]!==d))&&(s=a,o=n(...a),t?.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(o),i=!1),o}return l.updateDeps=a=>{s=a},l}function _t(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Qo=(e,n)=>Math.abs(e-n)<1.01,Jo=(e,n,t)=>{let s;return function(...o){e.clearTimeout(s),s=e.setTimeout(()=>n.apply(this,o),t)}};let qe;const It=()=>{if(qe!==void 0)return qe;if(typeof navigator>"u")return qe=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return qe=!0;const e=navigator.maxTouchPoints;return qe=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Lt=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},Go=e=>e,Yo=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},Xo=(e,n)=>{const t=e.scrollElement;if(!t)return;const s=e.targetWindow;if(!s)return;const o=l=>{const{width:a,height:u}=l;n({width:Math.round(a),height:Math.round(u)})};if(o(Lt(t)),!s.ResizeObserver)return()=>{};const i=new s.ResizeObserver(l=>{const a=()=>{const u=l[0];if(u?.borderBoxSize){const d=u.borderBoxSize[0];if(d){o({width:d.inlineSize,height:d.blockSize});return}}o(Lt(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},ht={passive:!0},Zo=typeof window>"u"?!0:"onscrollend"in window,ei=(e,n,t)=>{const s=e.scrollElement;if(!s)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&Zo;let l=0;const a=i?null:Jo(o,()=>n(l,!1),e.options.isScrollingResetDelay),u=p=>()=>{l=t(s),a?.(),n(l,p)},d=u(!0),f=u(!1);return s.addEventListener("scroll",d,ht),i&&s.addEventListener("scrollend",f,ht),()=>{s.removeEventListener("scroll",d),i&&s.removeEventListener("scrollend",f)}},ti=(e,n)=>ei(e,n,t=>{const{horizontal:s,isRtl:o}=e.options;return s?t.scrollLeft*(o&&-1||1):t.scrollTop}),si=(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"]},ni=(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})},oi=ni;class ii{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,u=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[d,f]of this.elementsCache)if(f===a){this.elementsCache.delete(d);break}return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,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:Go,rangeExtractor:Yo,onChange:()=>{},measureElement:si,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 S=t[m];S!==void 0&&(i[m]=S)}const l=this.options;let a=null,u=null,d=!1;if(l!==void 0&&l.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const m=l.count,S=i.count,y=this.getMeasurements(),I=m>0?((s=y[0])==null?void 0:s.key)??l.getItemKey(0):null,R=m>0?((o=y[m-1])==null?void 0:o.key)??l.getItemKey(m-1):null;if(S!==m||m>0&&S>0&&(i.getItemKey(0)!==I||i.getItemKey(S-1)!==R)){d=!0;const j=m>0?this.getVirtualItemForOffset(this.getScrollOffset())??y[0]:null;j&&(a=[j.key,this.getScrollOffset()-j.start]);const C=i.followOnAppend===!0?"auto":i.followOnAppend||null;C&&S>m&&this.isAtEnd(l.scrollEndThreshold)&&(m===0||i.getItemKey(S-1)!==R)&&(u=C)}}this.options=i,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let f=!1,p=0;if(a&&this.scrollOffset!==null){const[m,S]=a,y=this.getMeasurements(),{count:I,getItemKey:R}=this.options;let g=0;for(;g<I&&R(g)!==m;)g++;if(g<I){const x=y[g];if(x){const j=x.start+S;j!==this.scrollOffset&&(p=j-this.scrollOffset,this.scrollOffset=j,f=!0)}}}(f||u)&&(this.pendingScrollAnchor=[f?a[0]:null,f?a[1]:0,u,p])},this.notify=t=>{var s,o;(o=(s=this.options).onChange)==null||o.call(s,this,t)},this.maybeNotify=Be(()=>(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,!(!It()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",l,ht),i.addEventListener("touchend",a,ht),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,u]=o;i!==null&&!a&&(It()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?u!==0&&(this._iosDeferredAdjustment+=u):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=Be(()=>[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,u,d)=>(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:u,gap:d}),{key:!1}),this.getMeasurements=Be(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:s,scrollMargin:o,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:u,gap:d},f)=>{const p=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const g of this.laneAssignments.keys())g>=t&&this.laneAssignments.delete(g);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(g=>{this.itemSizeCache.set(g.key,g.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 g=t*2;let x=this._flatMeasurements;if(!x||x.length<g){const M=new Float64Array(g);x&&m>0&&M.set(x.subarray(0,m*2)),x=M,this._flatMeasurements=x}let j;if(m===0)j=s+o;else{const M=m-1;j=x[M*2]+x[M*2+1]+d}for(let M=m;M<t;M++){const O=i(M),E=p.get(O),N=typeof E=="number"?E:this.options.estimateSize(M);x[M*2]=j,x[M*2+1]=N,j+=N+d}const C=Uo(t,x,i);return this.measurementsCache=C,C}const S=this.measurementsCache.slice(0,m),y=new Array(a).fill(void 0),I=new Float64Array(a);let R=0;for(let g=0;g<m;g++){const x=S[g];x&&(y[x.lane]===void 0&&R++,y[x.lane]=g,I[x.lane]=x.end)}for(let g=m;g<t;g++){const x=i(g),j=this.laneAssignments.get(g);let C,M;const O=u==="estimate"||p.has(x);if(j!==void 0&&this.options.lanes>1){C=j;const A=y[C],W=A!==void 0?S[A]:void 0;M=W?W.end+d:s+o}else if(R===a){let A=0,W=I[0],le=y[0];for(let z=1;z<a;z++){const X=I[z];(X<W||X===W&&y[z]<le)&&(A=z,W=X,le=y[z])}C=A,M=W+d,O&&this.laneAssignments.set(g,C)}else C=g%this.options.lanes,M=s+o,O&&this.laneAssignments.set(g,C);const E=p.get(x),N=typeof E=="number"?E:this.options.estimateSize(g),L=M+N;S[g]={index:g,start:M,size:N,end:L,key:x,lane:C},y[C]===void 0&&R++,y[C]=g,I[C]=L}return this.measurementsCache=S,S},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Be(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,s,o,i)=>t.length===0||s===0?(this.range=null,null):(this.range=ai(t,s,o,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Be(()=>{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,u;const d=this._flatMeasurements;if(this.options.lanes===1&&d!==null)u=this.options.getItemKey(t),a=d[t*2],l=d[t*2+1];else{const m=this.measurementsCache[t];if(!m)return;u=m.key,a=m.start,l=m.size}const f=this.itemSizeCache.get(u)??l,p=s-f;if(p!==0){const m=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,S=m?this.getTotalSize():0,y=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:u,start:a,size:l,end:a+l,lane:0},p,this):a<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(u)||this.scrollDirection!=="backward"));(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(u,s),this.itemSizeCacheVersion++,m?this.applyScrollAdjustment(this.getTotalSize()-S):y&&this.applyScrollAdjustment(p),this.notify(!1)}},this.getVirtualItems=Be(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,s)=>{const o=[];for(let i=0,l=t.length;i<l;i++){const a=t[i],u=s[a];o.push(u)}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=ss(0,s.length-1,i?a=>o[a*2]:a=>_t(s[a]).start,t);return _t(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,u=this.now();this.scrollState={index:t,align:a,behavior:o,startedAt:u,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&&(It()&&(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&&Qo(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,u=Math.abs(o-this.getScrollOffset()),d=this.scrollState.behavior==="smooth"&&u>a;this.scrollState.lastTargetOffset=o,d||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:d?"smooth":"auto"})}this.scheduleScrollReconcile()}}const ss=(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 ri(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 ai(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 d=ri(o,i,t);let f=d;const p=t+n;for(;f<i&&o[f*2]+o[f*2+1]<p;)f++;return{startIndex:d,endIndex:f}}let a=ss(0,i,d=>e[d].start,t),u=a;if(s===1)for(;u<i&&e[u].end<t+n;)u++;else if(s>1){const d=Array(s).fill(0);for(;u<i&&d.some(p=>p<t+n);){const p=e[u];d[p.lane]=p.end,u++}const f=Array(s).fill(t+n);for(;a>=0&&f.some(p=>p>=t);){const p=e[a];f[p.lane]=p.start,a--}a=Math.max(0,a-a%s),u=Math.min(i,u+(s-1-u%s))}return{startIndex:a,endIndex:u}}const Ct=typeof document<"u"?c.useLayoutEffect:c.useEffect;function li({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...s}){const o=c.useReducer(d=>d+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=d=>{const f=i.current;if(!f.enabled||!f.container)return;const p=d.getTotalSize();if(p!==f.lastSize){f.lastSize=p;const g=d.options.horizontal?"width":"height";f.container.style[g]=`${p}px`}const m=!!d.options.horizontal,S=f.mode==="transform",y=m?"left":"top",I=d.options.scrollMargin,R=d.getVirtualItems();for(const g of R){const x=g.start-I,j=d.elementsCache.get(g.key);j&&f.lastPositions.get(j)!==x&&(f.lastPositions.set(j,x),S?j.style.transform=m?`translate3d(${x}px, 0, 0)`:`translate3d(0, ${x}px, 0)`:j.style[y]=`${x}px`)}},a={...s,onChange:(d,f)=>{var p;const m=i.current;let S=!0;if(m.enabled){l(d);const y=d.range,I=m.prevRange;S=!I||I.isScrolling!==d.isScrolling||I.startIndex!==y?.startIndex||I.endIndex!==y?.endIndex,S&&(m.prevRange=y?{startIndex:y.startIndex,endIndex:y.endIndex,isScrolling:d.isScrolling}:null)}S&&(e&&f?Os.flushSync(o):o()),(p=s.onChange)==null||p.call(s,d,f)}},[u]=c.useState(()=>{const d=new ii(a);return Object.assign(d,{containerRef:f=>{const p=i.current;if(p.container=f,p.lastSize=null,f&&p.enabled){const m=d.getTotalSize();p.lastSize=m;const S=d.options.horizontal?"width":"height";f.style[S]=`${m}px`}}})});return u.setOptions(a),Ct(()=>u._didMount(),[]),Ct(()=>u._willUpdate()),Ct(()=>{l(u)}),u}function ci(e){return li({observeElementRect:Xo,observeElementOffset:ti,scrollToFn:oi,...e})}const Et=e=>e.query?`matching "${e.query}"`:e.from?`from "${e.from}"`:"matching your search",ui=e=>`Select all ${Et(e)}`,di=(e,n)=>`All ${so(n)} ${Et(e)} selected`,hi=({verb:e,confirmingDelete:n,hasSelection:t,junkMailboxId:s,currentMailboxId:o,deletableMessageId:i})=>{if(n)return{kind:"withheld"};if(e==="junk"){const l=nn(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}},fi=(e,n,t)=>e==="BACK"&&n&&t===void 0,mi=(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}),gi=({thread:e,mailboxId:n,isSelected:t,isFocused:s,isTabStop:o,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,messageCount:d,isMultiSelectMode:f,onLongPress:p,isDesktop:m,density:S})=>r.jsx(on,{thread:mi(e,d),link:{mailboxId:n,threadId:e.threadId},inListbox:!0,active:t,focused:s,isTabStop:o,density:S,isDesktop:m,onFocusRow:i,selection:{isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:f,onLongPress:p}}),pi=c.memo(gi),xi=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}},bi=({thread:e,mailboxId:n,isSelected:t,isFocused:s,isTabStop:o,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:d,onLongPress:f,isDesktop:p,onDelete:m,onToggleRead:S,density:y})=>{const[I,R]=c.useState("none"),g=Ue(),x=Je(),j=c.useCallback(N=>{navigator.vibrate?.(10),N==="trailing"?m(e.messageId):S(e.messageId,e.isRead),R("none")},[m,S,e.messageId,e.isRead]),C=c.useCallback(()=>{f(e.messageId)},[f,e.messageId]),M=c.useCallback(()=>{a(e.messageId)},[a,e.messageId]),O=c.useCallback(()=>{g({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:n,threadId:e.threadId,messageId:e.messageId},search:N=>N,hash:x})},[g,x,n,e.threadId,e.messageId]),E=rn(e.messageId,u);return p||d?r.jsx(pi,{thread:e,mailboxId:n,isSelected:t,isFocused:s,isTabStop:o,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:d,onLongPress:f,isDesktop:p,density:y}):r.jsx("div",{role:"presentation",onPointerDownCapture:E.onMouseDown,onClickCapture:E.claimClick,onContextMenu:E.onContextMenu,children:r.jsx(Yn,{thread:xi(e),selectionMode:!1,checked:!1,active:t,peek:I,onPeek:R,onToggleCheck:M,onLongPress:C,onOpen:O,onAct:j})})},vi=72,Si=32,yi=5,ns="remit:list-density",Ii=()=>{try{const e=localStorage.getItem(ns);if(e==="compact"||e==="comfortable")return e}catch{}return"comfortable"},Ci=({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(Ls,{className:"size-4 text-fg-muted"}),r.jsxs("span",{className:"text-sm text-fg-muted",children:["Results for “",e,"”"]})]}),wi=({mailboxId:e,threads:n,selectedMessageId:t,isLoading:s,isError:o=!1,error:i,onRetry:l,searchQuery:a,searchPredicate:u,onDeleteMessages:d,isDeleting:f=!1,isMoving:p=!1,onLoadMore:m,hasMore:S=!1,isLoadingMore:y=!1,accountId:I,listTitle:R,listMeta:g,listFilter:x,listScopeLabel:j,onTriageContextChange:C,commandsRef:M,hideHeader:O=!1})=>{const E=c.useRef(null),N=Ue(),L=Je(),A=po(),W=Ns(),{verb:le,start:z,startFromSearch:X}=W,Ae=zs(),te=!!a?.trim(),Y=an(),{labels:Oe}=fo(I),{pushError:ie}=Fs(),[k,Se]=c.useState(t),[ye,V]=c.useState(),K=c.useCallback(h=>{V(b=>b===h?b:void 0),Se(h)},[]),[ce,Ie]=c.useState(Ii),Ce=c.useCallback(()=>{Ie(h=>{const b=h==="comfortable"?"compact":"comfortable";try{localStorage.setItem(ns,b)}catch{}return b})},[]),{toggleReadFor:Ne}=Qt({mailboxId:e}),{junkMailboxId:ue}=Jt(I),We=Gt(ue,e),U=c.useMemo(()=>[{accountId:I,mailboxId:e}],[I,e]),{outcome:D,trashIsUnconfirmed:ze,staleFolderLabel:de}=ln(U),{selectedIds:Q,selectedCount:P,hasSelection:_,isSelected:Fe,toggle:J,select:Ge,clearSelection:De,selectRange:we,setAnchor:se,selectAll:Ye,toggleAll:gt,intersectWith:_e}=cn(),T=In(P,A),[ke,he]=c.useState(null),Ve=te&&!!u,Xe=`${e}|${JSON.stringify(u??{})}`,w=un({mailboxId:e,accountId:I,enabled:Ve,predicateKey:Xe,searchQuery:u??{}}),Ze=c.useCallback((h,b,ae)=>{const B=dn(h,b,ae,D);B&&ie(B)},[ie,D]),je=w.phase.kind,et=w.clear,F=c.useCallback(()=>{je==="escalated"&&et(),De()},[De,et,je]),[tt,st]=c.useState(null),fe=c.useRef(null),ne=c.useRef(!1),me=c.useRef(null),Me=!s&&n.length>0,ge=ke!==null,pe=ci({count:n.length,getScrollElement:()=>E.current,estimateSize:()=>ce==="compact"?Si:vi,overscan:yi}),Le=t?n.findIndex(h=>h.messageId===t):-1,Z=k?n.findIndex(h=>h.messageId===k):-1,ee=c.useCallback(h=>{if(h<0||h>=n.length)return;const b=n[h];if(T){J(b.messageId);return}fe.current=b.messageId,ne.current=!1,V(b.messageId),Se(b.messageId)},[n,T,J]),Ke=c.useCallback(()=>{if(n.length===0)return;const h=Z<0?0:Math.min(Z+1,n.length-1);ee(h)},[n.length,Z,ee]),xe=c.useCallback(()=>{if(n.length===0)return;const h=Z<=0?0:Z-1;ee(h)},[n.length,Z,ee]),Re=c.useCallback(()=>ee(0),[ee]),Te=c.useCallback(()=>ee(n.length-1),[ee,n.length]),nt=c.useCallback(()=>{k&&J(k)},[k,J]),H=c.useMemo(()=>n.map(h=>h.messageId),[n]),pt=c.useMemo(()=>{const h=[];for(const b of n)Q.has(b.messageId)&&h.push({id:b.messageId,sender:b.fromName??b.fromEmail??"Unknown",email:b.fromEmail??"",subject:b.subject??"(No subject)",date:Qe(b.sentDate),accountId:I});return h},[n,Q,I]),be=c.useCallback((h,b)=>b.shiftKey?(we(H,h,k),!0):b.metaKey||b.ctrlKey?(J(h),!0):(F(),se(h),!1),[H,k,we,J,F,se]),ot=c.useCallback(h=>{!d||h.length===0||(me.current=k??null,he(h))},[d,k]),Pe=c.useCallback(h=>{const b=hn(H,k,h);b!==void 0&&(we(H,b),fe.current=b,ne.current=!1,V(void 0),Se(b))},[H,k,we]),it=c.useCallback(()=>Pe(-1),[Pe]),rt=c.useCallback(()=>Pe(1),[Pe]),at=c.useCallback(()=>{H.length>0&&Ye(H)},[H,Ye]),lt=c.useCallback(h=>{const b=hi({verb:h,confirmingDelete:ke!==null,hasSelection:_,junkMailboxId:ue,currentMailboxId:e,deletableMessageId:d?k:void 0});return b.kind==="openWizard"?(z(h),!0):b.kind==="confirmDelete"?(ot([b.messageId]),!0):b.kind==="unavailable"?(ie({severity:"warning",title:b.reason}),!0):b.kind==="withheld"},[ke,d,_,ue,e,z,k,ot,ie]),re=c.useCallback((h,b)=>{const ae=n.find(B=>B.messageId===h)?.threadId;ae&&N({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:e,threadId:ae,messageId:h},search:B=>B,hash:L,replace:b?.replace})},[N,L,e,n]),ve=c.useCallback(()=>{k&&re(k)},[k,re]),ct=c.useCallback(h=>re(h,{replace:!0}),[re]);fn({keyboardFocusedMessageId:ye,openMessageId:t,enabled:A&&P===0,open:ct});const $e=w.phase.kind==="escalated"?{scope:Et(u??{}),total:w.phase.total,searchQuery:u??{},run:h=>w.runAction(h),stop:w.stop}:void 0,xt=c.useCallback(h=>{if(h.length===0){he(null);return}const b=new Set(h),ae=n.findIndex(G=>b.has(G.messageId));let B;for(let G=ae+1;G<n.length;G++)if(!b.has(n[G].messageId)){B=n[G].messageId;break}if(B===void 0){for(let G=ae-1;G>=0;G--)if(!b.has(n[G].messageId)){B=n[G].messageId;break}}d?.(h),F(),me.current=null,he(null),B!==void 0&&(fe.current=B,ne.current=!1,K(B),A&&re(B,{replace:!0})),A||st(mn("delete",h.length,D))},[n,d,F,re,A,K,D]),bt=c.useCallback(()=>{const h=me.current;me.current=null,he(null),h!==null&&(fe.current=h,ne.current=!1,K(h))},[K]),He=c.useMemo(()=>{if(P===0)return;const h=new Set;for(const b of n)Q.has(b.messageId)&&h.add(b.accountConfigId);if(h.size>1)return"Move only works within one account — clear selection or pick messages from a single account"},[P,Q,n]),ut=c.useCallback(()=>{if($e){X();return}z("organize")},[$e,X,z]),vt=c.useCallback(h=>{d?.([h])},[d]),v=c.useCallback((h,b)=>{Ne([h],!b)},[Ne]),$=c.useCallback(h=>{A||Ge(h)},[A,Ge]),q=c.useCallback(()=>{if(w.isRunning||w.phase.kind==="counting"){w.stop();return}F()},[w,F]),as=c.useCallback(()=>{w.clear()},[w]);c.useEffect(()=>{if(ne.current||!A&&t)return;const h=Z>=0?Z:Le;h>=0&&pe.scrollToIndex(h,{align:"auto"})},[Z,Le,pe,A,t]),c.useEffect(()=>{t&&(ne.current=!1,K(t))},[t,K]),c.useEffect(()=>{k&&(n.some(h=>h.messageId===k)||K(n[0]?.messageId))},[n,k,K]),c.useEffect(()=>{C?.({focusedMessageId:k,selectedIds:Array.from(Q),hasList:Me,blocksKeyboard:ge||W.isOpen})},[k,Q,Me,ge,W.isOpen,C]);const At=c.useRef(C);At.current=C,c.useEffect(()=>()=>At.current?.({focusedMessageId:void 0,selectedIds:[],hasList:!1,blocksKeyboard:!1}),[]),c.useEffect(()=>{w.phase.kind!=="idle"||w.isRunning||_e(n.map(h=>h.messageId))},[n,_e,w.phase,w.isRunning]);const Ot=c.useRef(e);c.useEffect(()=>{Ot.current!==e&&(Ot.current=e,F())},[e,F]),gn({shouldBlockFn:({action:h})=>fi(h,_,Ae)?(F(),!0):!1,enableBeforeUnload:!1,disabled:!_||Ae!==void 0}),c.useEffect(()=>{const h=E.current;if(!h||!S||!m)return;const b=()=>{if(y)return;const{scrollTop:ae,scrollHeight:B,clientHeight:G}=h;ae+G>=B-200&&m()};return h.addEventListener("scroll",b,{passive:!0}),b(),()=>h.removeEventListener("scroll",b)},[S,y,m]),c.useEffect(()=>{const h=fe.current;if(!h)return;const b=E.current?.querySelector(`[data-message-id="${h}"]`);b&&(fe.current=null,b.focus({preventScroll:!0}))}),c.useEffect(()=>{if(M){if(!Me){M.current=null;return}return M.current={focusNext:Ke,focusPrevious:xe,focusFirst:Re,focusLast:Te,openFocused:ve,toggleSelect:nt,extendSelectDown:rt,extendSelectUp:it,selectAll:at,clearSelection:()=>_?(F(),!0):!1,requestVerb:lt,toggleDensity:Ce},()=>{M.current=null}}},[M,Me,Ke,xe,Re,Te,ve,nt,rt,it,at,_,F,lt,Ce]);const Nt=s?"loading":o?"error":n.length===0?"empty":"ready",ls=o?ho(i):void 0,cs=c.useCallback(()=>{const h=Ds(_s());window.open(h,"_blank","noopener,noreferrer")},[]),us=[{id:"inbox",threads:[]}],St=H.length>0&&H.every(h=>Q.has(h)),ds=Ve&&S&&St&&!f&&!p&&w.phase.kind==="idle"&&!w.isRunning,hs=f||p||w.isRunning,yt=w.phase.kind==="escalated"?w.phase.total:P,fs=w.runningAction?pn(w.runningAction.kind,w.progress?.done??0,w.progress?.total??yt):w.phase.kind==="counting"?"Counting matches…":w.phase.kind==="escalated"?di(u??{},w.phase.total):void 0,ms=w.phase.kind!=="escalated"&&H.length>0?{checked:St,indeterminate:P>0&&!St,onChange:()=>gt(H)}:void 0,gs=w.runningAction?{value:w.progress?.done??0,max:w.progress?.total??yt,tone:xn(w.runningAction.kind)}:void 0,ps=(w.phase.kind==="counting"?{tone:"info",text:"",action:{label:"Stop",onClick:w.stop}}:w.phase.kind==="escalated"&&!w.isRunning?{tone:"info",text:"",action:{label:"Clear selection",onClick:as}}:ds?{tone:"info",text:"",action:{label:ui(u??{}),onClick:w.escalate}}:void 0)??(He?{tone:"warning",text:He}:void 0),xs=r.jsx(bn,{title:Y.title||R,navSlot:Y.navSlot,titleMeta:Y.titleMeta,searchSlot:Y.searchSlot,searchField:Y.searchField,idleSlot:Y.makeFilterSlot,count:yt,onCancel:q,onDelete:()=>z("delete"),onMove:()=>z("move"),onOrganize:ut,onJunk:We?()=>z("junk"):void 0,onMarkRead:()=>z("markRead"),overflowSlot:I&&e&&P>0&&Oe.length>0?r.jsx(xo,{accountId:I,mailboxId:e,messageIds:Array.from(Q)}):void 0,isBusy:hs,isCounting:w.phase.kind==="counting",selectAll:ms,statusLabel:fs,progress:gs,notice:ps}),bs=vn(H,k),vs=c.useCallback(h=>{ne.current=!0,K(h)},[K]),Ss=r.jsxs(r.Fragment,{children:[te&&a&&r.jsx(Ci,{query:a}),r.jsxs("div",{ref:E,role:"listbox","aria-multiselectable":!0,"aria-label":R,className:"flex-1 overflow-y-auto",children:[r.jsx("div",{role:"presentation",className:"relative w-full",style:{height:`${pe.getTotalSize()}px`},children:pe.getVirtualItems().map(h=>{const b=n[h.index];return r.jsx("div",{role:"presentation","data-index":h.index,ref:pe.measureElement,className:Ee("absolute left-0 top-0 w-full border-b border-line",w.isRunning&&"pointer-events-none opacity-50"),style:{transform:`translateY(${h.start}px)`},children:r.jsx(bi,{thread:b,mailboxId:e,isSelected:t===b.messageId,isFocused:k===b.messageId,isTabStop:bs===b.messageId,onFocusRow:vs,isChecked:Fe(b.messageId),onToggleCheck:J,onRowSelect:be,isMultiSelectMode:T,onLongPress:$,isDesktop:A,onDelete:vt,onToggleRead:v,density:ce})},h.key)})}),y&&r.jsx(Xn,{})]})]});return r.jsxs(r.Fragment,{children:[tt&&!A&&r.jsx(kt,{tone:"success",variant:"soft",className:"m-2 rounded-md",onDismiss:()=>st(null),children:tt}),r.jsx(Zn,{listTitle:R,listMeta:g,sections:us,flatList:!0,listState:Y.searchResults?"ready":Nt,searchQuery:te?a:void 0,listFilter:x,listScopeLabel:j,errorMessage:ls,onRetry:l,onReportError:cs,density:ce,selectedThreadId:t,onSelectThread:h=>re(h),isDesktop:A,hideHeader:O,selectionBar:xs,listBody:Y.searchResults??(Nt==="ready"?Ss:void 0)}),r.jsx(Sn,{isOpen:ke!==null,messageIds:ke??[],outcome:D,accountId:I,trashFolderLabel:R,staleFolderLabel:de,trashIsUnconfirmed:ze,isDeleting:f,onConfirm:xt,onCancel:bt}),r.jsx(yn,{verb:le,accountId:I,mailboxId:e,selection:pt,selectionRestriction:He?"spansAccounts":void 0,escalated:$e,escalatedProgress:w.progress,onFinished:F,onRunEnded:Ze})]})},ki=e=>$s({path:{accountId:e}}),ji=e=>{const n=Bt(),t=Mt(),s=Wt({...Ps(),onSuccess:()=>{t.recordEvent("sync.triggered"),n.invalidateQueries({queryKey:ki(e)})}});return{trigger:()=>{s.mutate({path:{accountId:e}})},triggerAsync:()=>s.mutateAsync({path:{accountId:e}}),isPending:s.isPending,error:s.error,reset:s.reset}},Mi=({accountId:e,children:n})=>{const{triggerAsync:t,isPending:s}=ji(e);return r.jsx(jo,{onRefresh:t,isRefreshing:s,children:n})};function Ri({accountId:e,currentMailboxId:n,candidates:t,onMove:s,children:o}){const[i,l]=c.useState(!1),a=Mt(),u=Bs(),{inboxMailboxId:d}=Cn(e),f=wn(e),{data:p}=jt({...Ws({path:{accountId:e}}),staleTime:1/0}),m=c.useMemo(()=>Vs({mailboxes:p?.items??[],folderAppointments:f,currentMailboxId:n,translator:u}),[p?.items,f,n,u]),S=c.useMemo(()=>d||(m.find(x=>x.label.toLowerCase()==="inbox")?.id??m.find(x=>!x.isCurrent)?.id??""),[d,m]),y=c.useRef(!1);c.useEffect(()=>{y.current||(y.current=!0,kn(a,t.length))},[a,t.length]);const I=c.useCallback(()=>{jn(a,t.length),l(!0)},[a,t.length]),R=c.useCallback((g,x)=>{Mn(a,{selected:g.length,total:t.length,toInbox:x===d}),s(g,x)},[a,t.length,d,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(Ro,{count:t.length,onReview:I})}),r.jsx("div",{className:"min-h-0 flex-1",children:o}),r.jsx(Po,{open:i,candidates:t,defaultDestinationId:S,availableFolders:m,delimiter:Ks(p?.items??[]),onConfirmMove:R,onCancel:()=>l(!1)})]})}const Ti="We can verify this sender";function Ei(e){const{data:n}=jt({...Hs({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:Ti,trustSubReason:Rn(s.senderTrust),senderTrust:s.senderTrust}))}}const Ai=e=>{const n=new Set,t=[];for(const s of e)n.has(s.threadMessageId)||(n.add(s.threadMessageId),t.push(s));return t},Oi={unread:"unread",flagged:"starred",attachment:"attachments"},Ni=new Set(Object.values(qs)),os=e=>Ni.has(e),zi=e=>os(e.category)||e.attributes.size>0,Fi=e=>{const n={};os(e.category)&&(n.category=[e.category]);for(const t of e.attributes){const s=Oi[t];s&&(n[s]=!0)}return n},Di=e=>(e.senderTrust?.length??0)>0||e.dkimMismatch!==void 0?"loaded-pages":"whole-folder",_i=["category","unread","starred","attachments"],Pt=e=>JSON.stringify(_i.map(n=>e?.[n]??null)),Li=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},Pi=(e,n)=>{const t=Li(e);return t?Pt(t)===Pt(n):!1},dt=e=>e[0],$i=e=>{const n=dt(e.filter(a=>a.type==="from").map(a=>a.value)),t=dt(e.filter(a=>a.type==="subject").map(a=>a.value)),s=dt(e.filter(a=>a.type==="category").map(a=>a.category)),o=dt(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}:{}}},Bi=(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 Wi(e,n={}){const t=$i(e),s={...t,...n};return{params:t,residual:e.filter(o=>!Bi(s,o))}}function Vi(e,n,t){if(n.length===0)return e;const s=[...n];return e.filter(o=>{const i=Tn(o);return En({...i,accountId:i.accountId??t},s)})}const Ki=50,Hi=new Map(es().categories.filter(e=>e.id!=="all").map(e=>[e.id,e.label])),is=c.createContext(null);function mt(){const e=c.useContext(is);if(!e)throw new Error("MailboxPane.* must be used inside <MailboxPane>");return e}function qi({mailboxId:e,thread:n,children:t}){const s=Ue(),o=Je(),i=n?.threadId,l=n?.messageId,a=Mt(),{accounts:u,searchQuery:d,onToggleIntelligence:f}=Vt(),p=Ys(),m=ko(d),S=m.length>0,{freeText:y,tokens:I}=Xs(m,p),[R,g]=c.useState("all"),[x,j]=c.useState(new Set),C=c.useMemo(()=>({category:R,attributes:x}),[R,x]),M=c.useMemo(()=>Fi(C),[C]),O=S||zi(C),{params:E,residual:N}=Wi(I,M),L={order:"desc",limit:Ki,...y?{query:y}:{},...E,...M},A={category:L.category,unread:L.unread,starred:L.starred,attachments:L.attachments},W=O?Us({path:{mailboxId:e},query:L}):Qs({path:{mailboxId:e},query:{order:"desc"}}),{data:le,isLoading:z,isError:X,error:Ae,refetch:te,fetchNextPage:Y,hasNextPage:Oe,isFetchingNextPage:ie}=eo({queryKey:W,queryFn:async({pageParam:v})=>{if(O){const{data:q}=await Js({path:{mailboxId:e},query:{...L,continuationToken:v},throwOnError:!0});return q}const{data:$}=await Gs({path:{mailboxId:e},query:{order:"desc",continuationToken:v},throwOnError:!0});return $},initialPageParam:void 0,getNextPageParam:v=>v.continuationToken,placeholderData:(v,$)=>Pi($?.queryKey,A)?v:void 0}),{accountId:k,isLoading:Se}=An(e),ye=Io({accounts:u}),V=Vi(On(Ai(le?.pages.flatMap(v=>v.items??[])??[])),N,k),K=c.useCallback(v=>{g(v)},[]),ce=c.useCallback(v=>{j($=>{const q=new Set($);return q.has(v)?q.delete(v):q.add(v),q})},[]),Ie=c.useCallback(()=>{g("all"),j(new Set)},[]),Ce=Hi.get(R),Ne=Ce?{label:Ce,reach:N.length>0?"loaded-pages":Di(L),onClear:Ie}:void 0,ue=i?V.find(v=>v.messageId===l)??V.find(v=>v.threadId===i):void 0,We=Nn(i,l),U=ue??We,D=l??U?.messageId,ze=c.useMemo(()=>{if(i)return{threadId:i,mailboxId:U?.mailboxId??e,subject:U?.subject,messageId:D,authenticity:U?.authenticity}},[i,U,D,e]),de=c.useCallback(()=>{s({to:"/mail/$mailboxId",params:{mailboxId:e},search:v=>v,hash:o})},[e,s,o]),Q=c.useCallback(v=>{s({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:e,...v},search:$=>$,hash:o})},[e,s,o]),P=c.useCallback(v=>{D&&v.includes(D)&&de()},[D,de]),{deleteMessages:_,isPending:Fe}=zt({mailboxId:e,onAfterOptimisticRemove:P}),{moveMessages:J,isPending:Ge}=Ft({mailboxId:e,accountId:k,onAfterOptimisticRemove:P}),De=c.useRef(null),we=zn(),{listCommandsRef:se,onTriageContextChange:Ye,focusedMessageId:gt,selectedIds:_e}=we,T=V.find(v=>v.messageId===gt)??U,ke=Co({accounts:u})??0,he=Fn({thread:U,mailboxId:e,accountId:k,onAfterOptimisticRemove:P}),{draftsMailboxId:Ve}=Dn(k),Xe=Ve!==void 0&&Ve===e,{archiveMailboxId:w}=_n(k),Ze=Ln(),je=io(),et=c.useMemo(()=>ro(je,i,D),[je,i,D]),F=c.useMemo(()=>{if(T)return v=>je({threadId:T.threadId,messageId:T.messageId,mode:v})},[je,T]),tt=ao(),st=lo(),fe=co(),ne=c.useCallback(v=>v?Ze(v):[],[Ze]),{toggleStar:me}=Pn({threadId:T?.threadId??"",mailboxId:e}),{toggleReadFor:Me}=Qt({mailboxId:e,accountId:k}),{junkMailboxId:ge}=Jt(k),pe=ge!=null&&ge===e,Le=Gt(ge,e),{candidates:Z}=Ei(pe?ge:void 0),{moveMessages:ee}=Ft({mailboxId:e,threadId:T?.threadId,accountId:k,onAfterOptimisticRemove:P}),{deleteMessages:Ke}=zt({mailboxId:e,threadId:T?.threadId,onAfterOptimisticRemove:P}),{addressId:xe,address:Re}=$n(T),{updateFlags:Te}=Bn({addressId:xe,senderEmail:T?.fromEmail??void 0}),nt=c.useCallback(()=>F?.("reply"),[F]),H=c.useCallback(()=>F?.("reply-all"),[F]),pt=c.useCallback(()=>F?.("forward"),[F]),be=c.useCallback(()=>ne(T),[ne,T]),ot=c.useCallback(()=>{if(se.current?.requestVerb("delete"))return;const v=be();v.length>0&&Ke(v)},[se,be,Ke]),Pe=c.useCallback(()=>{if(se.current?.requestVerb("junk")||!Le)return;const v=be();v.length!==0&&(Wn(a,{count:v.length,senderTrust:T?.senderTrust??"unknown",wasRescuable:T?Vn(T):!1}),ee(v,Le))},[se,Le,be,ee,a,T]),it=c.useCallback(()=>{if(_e.length>0){const v=!(T?.hasStars??!1),$=new Set(_e);for(const q of V)$.has(q.messageId)&&q.hasStars!==v&&me(q.messageId,q.hasStars);return}T&&me(T.messageId,T.hasStars)},[_e,V,T,me]),rt=c.useCallback(()=>{if(se.current?.requestVerb("markRead"))return;const v=be();if(v.length===0)return;const $=!(T?.isRead??!1);Me(v,$)},[se,be,T,Me]),at=c.useCallback(()=>{if(!xe)return;const v=Re?.flags?.muted?.value!==!0;Te({muted:{value:v}})},[xe,Re,Te]),lt=c.useCallback(()=>{if(!xe)return;const v=Re?.flags?.vip?.value!==!0;Te({vip:{value:v}})},[xe,Re,Te]),re=c.useCallback(()=>{De.current?.open()},[]),ve=c.useCallback(v=>{s({to:v})},[s]),ct=Xe?"drafts":w===e?"archive":ge===e?"junk":"inbox",$e=c.useRef("");c.useEffect(()=>{const v=$e.current;$e.current=m,m.length>0&&v.length===0&&a.recordEvent("search.submitted",{mailboxType:ct})},[m,ct,a]);const{goBack:xt,nextMessageId:bt,previousMessageId:He}=Kn({context:we,orderedIds:V.map(v=>v.messageId),selectedMessageId:D,enabled:!tt&&!st,onClose:de,handlers:{reply:nt,replyAll:H,forward:pt,delete:ot,toggleStar:it,toggleRead:rt,muteSender:at,blockSender:U?re:void 0,vipSender:lt,markJunk:Pe,toggleIntelligence:U?()=>De.current?.toggle():void 0,compose:fe,goBrief:()=>ve("/mail/brief"),goInbox:()=>ve("/mail/brief"),goSent:()=>ve("/mail/brief"),goFlagged:()=>ve("/mail/flagged"),goSettings:()=>ve("/settings")}}),ut=v=>{if(!v)return;const $=V.find(q=>q.messageId===v);return $?{threadId:$.threadId,messageId:v}:void 0},vt={mailboxId:e,selectedMessageId:D,selectedThread:U,conversation:ze,onOpenThread:Q,threads:V,isLoading:z,isError:X,error:Ae,mailboxAccountId:k,mailboxAccountLoading:Se,mailboxName:ye,unreadCount:ke,isDraftsMailbox:Xe,isSpamFolder:pe,rescueCandidates:Z,filterCategory:R,filterAttributes:x,onSelectFilterCategory:K,onToggleFilterAttribute:ce,onClearFilters:Ie,listFilter:Ne,onToggleIntelligence:f,intelligenceRef:De,handleDeselectIfRemoved:P,searchPredicate:S&&N.length===0?L:void 0,onDeleteMessages:_,onMoveMessages:J,isDeleting:Fe,isMoving:Ge,onLoadMore:Y,hasMore:Oe,isLoadingMore:ie,onTriageContextChange:Ye,listCommandsRef:se,onRetry:()=>te(),onReply:et,onToolbarDelete:he.deleteThread,onToolbarStar:he.toggleStar,onToolbarMove:he.moveThread,onBack:xt,nextThread:ut(bt),previousThread:ut(He)};return r.jsx(is.Provider,{value:vt,children:t})}function rs(){const{mailboxId:e,selectedMessageId:n,threads:t,isLoading:s,isError:o,error:i,onDeleteMessages:l,onMoveMessages:a,isDeleting:u,isMoving:d,onLoadMore:f,hasMore:p,isLoadingMore:m,mailboxAccountId:S,mailboxName:y,unreadCount:I,isDraftsMailbox:R,isSpamFolder:g,rescueCandidates:x,onTriageContextChange:j,listCommandsRef:C,onRetry:M,filterCategory:O,filterAttributes:E,onSelectFilterCategory:N,onToggleFilterAttribute:L,onClearFilters:A,listFilter:W,searchPredicate:le}=mt(),{searchQuery:z,searchInput:X,accounts:Ae,resultFolderIndex:te}=Vt(),Y=wo(),Oe=Ue(),ie=Je(),k=y??"Inbox",Se=c.useMemo(()=>es(),[]),ye=c.useMemo(()=>S?[S]:[],[S]),{hasNewMail:V}=en(),{state:K,errorMessage:ce,refresh:Ie}=tn(ye,{onSettled:M}),Ce=c.useMemo(()=>r.jsx(sn,{state:K,onRefresh:Ie,label:`Refresh ${k}`,errorMessage:ce,hasUpdate:V(ye)}),[K,Ie,k,ce,V,ye]),Ne=c.useMemo(()=>t.map(_=>Jn(_,te)),[t,te]),{hits:ue,isLoading:We}=bo({mailboxId:e,filterCategory:O}),U=c.useMemo(()=>Gn(ue,t.map(_=>_.threadId),te),[ue,t,te]),D=c.useCallback(_=>{const Fe=_.threadId??t.find(J=>J.messageId===_.id)?.threadId;Fe&&Oe({to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:_.mailboxId??e,threadId:Fe,messageId:_.id},search:J=>({...J,q:X||void 0}),hash:ie})},[e,Oe,ie,X,t]);if(R&&S)return r.jsx(qo,{mailboxId:e,accountId:S,selectedMessageId:n,imapThreads:t,title:y??"Drafts",unreadCount:I??void 0});const ze=r.jsx(wi,{mailboxId:e,threads:t,selectedMessageId:n,isLoading:s,isError:o,error:i,onRetry:M,searchQuery:z,searchPredicate:le,onDeleteMessages:l,isDeleting:u,isMoving:d,onLoadMore:f,hasMore:p,isLoadingMore:m,accountId:S,listTitle:k,listFilter:W,listScopeLabel:k,hideHeader:!0,onTriageContextChange:j,commandsRef:C}),de=Ae[0]?.accountId,Q=Y==="phone"&&de?r.jsx(Mi,{accountId:de,children:ze}):ze,P=g&&x.length>0&&S?r.jsx(Ri,{accountId:S,currentMailboxId:e,candidates:x,onMove:a,children:Q}):Q;return r.jsx(to,{title:k,unreadCount:I,preset:Se,selectedCategory:O,activeFilters:E,onSelectCategory:N,onToggleFilter:L,onClearFilters:A,searchResults:Ne,searchLoading:s,relatedResults:U,relatedLoading:We,onSelectSearchResult:D,searchResultsInBody:!0,refreshControl:Ce,children:P})}function Ui(){const{mailboxId:e,mailboxAccountId:n,mailboxAccountLoading:t,selectedThread:s,conversation:o,onReply:i,onToolbarDelete:l,onToolbarStar:a,onToolbarMove:u,handleDeselectIfRemoved:d,intelligenceRef:f}=mt(),p=!!o,m=Un(o?.threadId);Yt(f,m);const S=c.useRef(null),{railFits:y,openRail:I}=m;c.useEffect(()=>{if(!y)return;const g=s?.messageId??null;g&&S.current!==g&&s?.authenticity?.dkimMismatch&&(S.current=g,I())},[y,I,s?.messageId,s?.authenticity?.dkimMismatch]);const R=o?r.jsx(Xt,{threadId:o.threadId,mailboxId:o.mailboxId,subject:o.subject,selectedMessageId:o.messageId,authenticity:o.authenticity,onOpenIntelligence:m.open}):r.jsx(Zs,{});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(Qn,{hasThread:p,messageId:o?.messageId,intelligenceOpen:m.isShowing,canToggleIntelligence:m.canToggle,onToggleIntelligence:m.toggle,onReply:i?()=>i("reply"):void 0,onReplyAll:i?()=>i("reply-all"):void 0,onForward:i?()=>i("forward"):void 0,onDelete:p?l:void 0,onToggleStar:p?a:void 0,isStarred:s?.hasStars,moveContext:p&&n?{accountId:n,currentMailboxId:e,onMove:u}:void 0,moveContextLoading:t}),r.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:R})]}),r.jsx(Zt,{isOpen:m.drawerOpen,onClose:m.closeDrawer,thread:s,mailboxId:e,accountId:n,onAfterOptimisticRemove:d})]})}function Qi(){const{mailboxId:e,mailboxAccountId:n,selectedThread:t,onToggleIntelligence:s,handleDeselectIfRemoved:o}=mt();return r.jsx(qn,{onClose:s,thread:t,mailboxId:e,accountId:n,onAfterOptimisticRemove:o})}function Ji(){const{mailboxId:e,mailboxAccountId:n,selectedThread:t,conversation:s,onOpenThread:o,onBack:i,nextThread:l,previousThread:a,handleDeselectIfRemoved:u,intelligenceRef:d}=mt(),f=Hn(s?.threadId??null);return Yt(d,f),s?r.jsxs(r.Fragment,{children:[r.jsx(Xt,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:i,onOpenIntelligence:f.toggle,onSwipeNext:l?()=>o(l):void 0,onSwipePrevious:a?()=>o(a):void 0,mobileIntelligenceOpen:f.isOpen}),r.jsx(Zt,{isOpen:f.isOpen,onClose:f.close,thread:t,mailboxId:e,accountId:n,onAfterOptimisticRemove:u})]}):r.jsx(rs,{})}const xr=Object.assign(qi,{List:rs,Reading:Ui,Intelligence:Qi,Phone:Ji});export{xr as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as n,j as a,B as o}from"./index-
|
|
1
|
+
import{i as n,j as a,B as o}from"./index-CP_u7qA0.js";import{M as e}from"./menu-xsfahEJ7.js";function i(){const s=n();return!s||s.showNavPane?null:a.jsx(o,{variant:"ghost",size:"sm",icon:a.jsx(e,{className:"size-4"}),onClick:s.openNav,"aria-label":"Open folders",className:"-ml-1 shrink-0"})}export{i as N};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as re,j as e,b as z,ac as V,ag as oe,r as i,at as he,aw as A,ad as F,n as xe,a7 as X,V as fe,ab as ye,s as Q,ax as Y,Q as ne,B as C,af as D,aa as ge,ae as ve,as as q,ap as be,I as je}from"./index-B61k9RLS.js";import{K as Se}from"./kbd-xKdnOGJZ.js";import{c as we}from"./account-form-helpers-DhckT_PN.js";import{M as ke}from"./mail-CehhDpTR.js";const K=re("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);const Ce=re("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function Ne({url:t}){return e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Stored encrypted, used only to connect to your mail server."," ",t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"How to create an app password"}):e.jsx("span",{children:"Check your provider's help for app password instructions."})]})}function Ee({raised:t,className:o,...s}){return e.jsx("div",{className:z("rounded-sm border border-line bg-surface",t?"bg-surface-raised shadow-sm":"",o),...s})}function J({value:t,defaultValue:o,onValueChange:s,...a}){return s?e.jsxs(V,{value:t,onChange:n=>s(n.target.value),...a,children:[e.jsx("option",{value:"tls",children:"TLS/SSL"}),e.jsx("option",{value:"starttls",children:"STARTTLS"}),e.jsx("option",{value:"none",children:"None (insecure)"})]}):e.jsxs(V,{defaultValue:o??t,...a,children:[e.jsx("option",{value:"tls",children:"TLS/SSL"}),e.jsx("option",{value:"starttls",children:"STARTTLS"}),e.jsx("option",{value:"none",children:"None (insecure)"})]})}function G(t){return{tls:t==="tls",startTls:t==="starttls"}}function Te({steps:t,activeStep:o}){return e.jsx("ol",{className:"flex items-center gap-1",children:t.map((s,a)=>{const n=a<o,r=a===o;return e.jsxs("li",{className:"flex items-center gap-1",children:[a>0&&e.jsx("span",{className:"h-px w-5 bg-line","aria-hidden":!0}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:z("flex size-5 items-center justify-center rounded-full text-2xs font-semibold tabular-nums",n&&"bg-accent text-accent-fg",r&&"bg-accent-soft text-accent ring-1 ring-accent",!n&&!r&&"bg-surface-sunken text-fg-subtle"),children:n?e.jsx(oe,{className:"size-3"}):a+1}),e.jsx("span",{className:z("hidden text-2xs sm:inline",r?"font-medium text-fg":"text-fg-subtle"),children:s})]})]},s)})})}function L({steps:t,activeStep:o,title:s,subtitle:a,children:n,footer:r,hideSteps:u}){return e.jsxs("div",{className:"flex min-h-dvh w-full flex-col items-center overflow-y-auto bg-canvas pb-[max(2rem,env(safe-area-inset-bottom,0px))] pl-[max(2rem,env(safe-area-inset-left,0px))] pr-[max(2rem,env(safe-area-inset-right,0px))] pt-[max(2rem,env(safe-area-inset-top,0px))] font-sans text-fg sm:pt-[30vh]",children:[!u&&e.jsx("div",{className:"mb-5 w-full max-w-xl",children:e.jsx(Te,{steps:t,activeStep:o})}),e.jsxs(Ee,{raised:!0,className:"w-full max-w-xl",children:[e.jsxs("div",{className:"px-5 pt-5",children:[e.jsx("h1",{className:"text-xl font-semibold text-fg",children:s}),a&&e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:a})]}),e.jsx("div",{className:"px-5 py-5",children:n}),r&&e.jsx("div",{className:"flex items-center justify-between gap-3 border-t border-line px-5 py-3",children:r})]})]})}const Pe="Coming soon — use IMAP for now.";function W({name:t,description:o,icon:s,comingSoon:a,selected:n,onSelect:r}){const[u,h]=i.useState(!1),c=()=>{if(r){r();return}a&&h(!0)};return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{type:"button",onClick:c,"aria-disabled":a||void 0,className:z("flex flex-col items-start gap-2 rounded-sm border p-3 text-left transition-colors",n?"border-accent-2 bg-accent-2-soft":"border-line bg-surface hover:border-line-strong",a&&"opacity-55"),children:[e.jsx("span",{className:z("text-fg-muted",n&&"text-accent-2"),children:s}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-fg",children:t}),a&&e.jsx("span",{className:"rounded-full bg-surface-sunken px-1.5 py-0.5 text-2xs text-fg-subtle",children:"soon"})]}),e.jsx("span",{className:"text-xs text-fg-subtle",children:o})]}),u&&e.jsx("p",{className:"text-2xs text-fg-subtle",children:Pe})]})}function Z({legend:t,badge:o,host:s,port:a,security:n,readOnly:r,onHostChange:u,onPortChange:h,onSecurityChange:c,hostPlaceholder:v,portPlaceholder:j}){const S=i.useId(),y=i.useId(),w=i.useId();return e.jsxs("fieldset",{children:[e.jsxs("legend",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[t,o&&e.jsx(he,{tone:o.tone,children:o.label})]}),e.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-3 sm:grid-cols-[1fr_6rem_8rem] sm:gap-2",children:[e.jsxs("div",{children:[e.jsx(A,{htmlFor:S,children:"Host"}),u?e.jsx(F,{id:S,readOnly:r,value:s,onChange:x=>u(x.target.value),placeholder:v}):e.jsx(F,{id:S,readOnly:r,defaultValue:s,placeholder:v})]}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:y,children:"Port"}),h?e.jsx(F,{id:y,readOnly:r,value:a,onChange:x=>h(x.target.value),placeholder:j}):e.jsx(F,{id:y,readOnly:r,defaultValue:a,placeholder:j})]}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:w,children:"Security"}),c?e.jsx(J,{id:w,value:n,onValueChange:c}):e.jsx(J,{id:w,defaultValue:n})]})]})]})}function _({label:t,detail:o,state:s}){return e.jsxs("div",{className:"flex items-start gap-3 py-2",children:[e.jsxs("span",{className:z("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full text-2xs",s==="ok"&&"bg-positive text-accent-fg",s==="failed"&&"bg-danger text-accent-fg",s==="running"&&"border border-accent text-accent",s==="pending"&&"border border-line text-fg-subtle"),children:[s==="ok"&&e.jsx(oe,{className:"size-3"}),s==="failed"&&"!",s==="running"&&e.jsx("span",{className:"size-2 animate-pulse rounded-full bg-accent"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:z("text-sm",s==="failed"?"font-medium text-danger":"text-fg"),children:t}),o&&e.jsx("div",{className:"mt-0.5 text-xs text-fg-subtle",children:o})]})]})}const Ie=(t,o)=>{const s=i.useRef(o);s.current=o,i.useEffect(()=>{if(!t)return;const a=()=>{document.visibilityState==="visible"&&s.current()};return document.addEventListener("visibilitychange",a),window.addEventListener("pageshow",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pageshow",a)}},[t])},Ae={"gmail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"googlemail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"outlook.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"hotmail.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"live.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"msn.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"icloud.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"me.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"mac.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"fastmail.com":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"fastmail.fm":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"yahoo.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"yahoo.co.uk":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"ymail.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"aol.com":{imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},source:"provider-table"},"zoho.com":{imap:{host:"imap.zoho.com",port:993,security:"tls"},smtp:{host:"smtp.zoho.com",port:465,security:"tls"},source:"provider-table"},"gmx.com":{imap:{host:"imap.gmx.com",port:993,security:"tls"},smtp:{host:"smtp.gmx.com",port:587,security:"starttls"},source:"provider-table"},"gmx.net":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"gmx.de":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"web.de":{imap:{host:"imap.web.de",port:993,security:"tls"},smtp:{host:"smtp.web.de",port:587,security:"starttls"},source:"provider-table"},"mail.com":{imap:{host:"imap.mail.com",port:993,security:"tls"},smtp:{host:"smtp.mail.com",port:465,security:"tls"},source:"provider-table"},"hey.com":{imap:{host:"imap.hey.com",port:993,security:"tls"},smtp:{host:"smtp.hey.com",port:465,security:"tls"},source:"provider-table"},"tutanota.com":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"tuta.io":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"posteo.de":{imap:{host:"posteo.de",port:993,security:"tls"},smtp:{host:"posteo.de",port:465,security:"tls"},source:"provider-table"},"runbox.com":{imap:{host:"imap.runbox.com",port:993,security:"tls"},smtp:{host:"smtp.runbox.com",port:587,security:"starttls"},source:"provider-table"},"mailbox.org":{imap:{host:"imap.mailbox.org",port:993,security:"tls"},smtp:{host:"smtp.mailbox.org",port:465,security:"tls"},source:"provider-table"},"hushmail.com":{imap:{host:"imap.hushmail.com",port:993,security:"tls"},smtp:{host:"smtp.hushmail.com",port:465,security:"tls"},source:"provider-table"}},Le={"gmail.com":"https://support.google.com/accounts/answer/185833","googlemail.com":"https://support.google.com/accounts/answer/185833","yahoo.com":"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html","icloud.com":"https://support.apple.com/en-us/102654","me.com":"https://support.apple.com/en-us/102654","mac.com":"https://support.apple.com/en-us/102654","fastmail.com":"https://www.fastmail.help/hc/en-us/articles/360058752854","fastmail.fm":"https://www.fastmail.help/hc/en-us/articles/360058752854","outlook.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","hotmail.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","zoho.com":"https://help.zoho.com/portal/en/kb/zoho-mail/client-configuration/imap-access/articles/zoho-mail-app-passwords"};function ae(t){try{const s=new DOMParser().parseFromString(t,"application/xml");if(s.querySelector("parsererror"))return null;const a=s.querySelectorAll("incomingServer[type='imap']"),n=s.querySelectorAll("outgoingServer[type='smtp']");if(!a.length||!n.length)return null;const r=a[0],u=n[0],h=r.querySelector("hostname")?.textContent?.trim(),c=r.querySelector("port")?.textContent?.trim(),v=r.querySelector("socketType")?.textContent?.trim().toUpperCase(),j=u.querySelector("hostname")?.textContent?.trim(),S=u.querySelector("port")?.textContent?.trim(),y=u.querySelector("socketType")?.textContent?.trim().toUpperCase();if(!h||!c||!j||!S)return null;const w=x=>x==="SSL"||x==="TLS"||x==="SSL/TLS"?"tls":x==="STARTTLS"?"starttls":"none";return{imap:{host:h,port:Number.parseInt(c,10),security:w(v)},smtp:{host:j,port:Number.parseInt(S,10),security:w(y)},source:"mozilla-autoconfig"}}catch{return null}}async function Me(t,o){try{const s=`https://autoconfig.thunderbird.net/v1.1/${t}`,a=await fetch(s,{signal:o});if(!a.ok)return null;const n=await a.text(),r=ae(n);return r||null}catch{return null}}async function Fe(t,o){try{const s=`https://autoconfig.${t}/mail/config-v1.1.xml`,a=await fetch(s,{signal:o});if(!a.ok)return null;const n=await a.text(),r=ae(n);return r?{...r,source:"domain-autoconfig"}:null}catch{return null}}function Re(t){return{imap:{host:`imap.${t}`,port:993,security:"tls"},smtp:{host:`smtp.${t}`,port:587,security:"starttls"},source:"heuristic"}}async function Oe(t,o=1500){const s=t.indexOf("@");if(s===-1)return null;const a=t.slice(s+1).toLowerCase();if(!a)return null;const n=Ae[a];if(n)return n;const r=new AbortController,u=setTimeout(()=>r.abort(),o);try{const h=await Me(a,r.signal);if(h)return h;const c=await Fe(a,r.signal);if(c)return c}finally{clearTimeout(u)}return Re(a)}function ze(t){const o=t.indexOf("@");return o===-1?"Looking up server settings…":`Looking up settings for ${t.slice(o+1)}…`}function ie(t){const o=t.indexOf("@");if(o===-1)return;const s=t.slice(o+1).toLowerCase();return Le[s]}const ce=[{id:"icloud",label:"iCloud",username:"full-email",imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},passwordHelp:{text:"iCloud requires an app-specific password, not your Apple ID password. Generate one under Sign-In & Security → App-Specific Passwords.",url:"https://support.apple.com/en-us/102654"}},{id:"yahoo",label:"Yahoo",username:"full-email",imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},passwordHelp:{text:"Yahoo requires an app password, not your login password. Generate one under Account Security.",url:"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html"}},{id:"aol",label:"AOL",username:"full-email",imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},passwordHelp:{text:"AOL requires an app password, not your login password. Generate one under Account Security.",url:"https://login.aol.com/account/security"}},{id:"fastmail",label:"Fastmail",username:"full-email",imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},passwordHelp:{text:"Fastmail requires an app password, not your login password. Create one under Settings → Privacy & Security → App passwords.",url:"https://www.fastmail.help/hc/en-us/articles/360058752854"}}];function ee(t){return ce.find(o=>o.id===t)}const _e={"icloud.com":"icloud","me.com":"icloud","mac.com":"icloud","yahoo.com":"yahoo","yahoo.co.uk":"yahoo","ymail.com":"yahoo","aol.com":"aol","fastmail.com":"fastmail","fastmail.fm":"fastmail"};function He(t){const o=t.indexOf("@");if(o===-1)return"";const s=t.slice(o+1).toLowerCase();return _e[s]??""}const M=["Connector","Address","Servers","Credentials","Test","Sync"],R={connector:0,address:1,servers:2,credentials:3,test:4,sync:5},te={host:"",port:993,security:"tls"},se={host:"",port:587,security:"starttls"};function $e({onStart:t}){return i.useEffect(()=>{const o=s=>{s.key==="Enter"&&t()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t]),e.jsx(L,{steps:M,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:"One inbox for all your mail, with context about every message.",footer:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-2xs text-fg-subtle",children:[e.jsx(Se,{children:"Enter"})," to continue"]}),e.jsx(C,{variant:"primary",onClick:t,children:"Add your first account"})]}),children:e.jsxs("div",{className:"flex flex-col items-start py-5",children:[e.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:e.jsx(ke,{className:"size-7 text-accent"})}),e.jsx("p",{className:"mt-5 max-w-sm text-sm leading-relaxed text-fg-muted",children:"Remit syncs your existing mailboxes and tells you who is really writing to you — sender history, authenticity checks, and similar messages, right next to every email."})]})})}function De({onContinue:t,onMicrosoft:o,onBack:s,showBack:a}){const[n,r]=i.useState("imap");i.useEffect(()=>{const h=c=>{c.key==="Enter"&&(n==="microsoft"?o():t()),c.key==="Escape"&&s()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t,o,s,n]);const u=()=>{n==="microsoft"?o():t()};return e.jsx(L,{steps:M,activeStep:R.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:e.jsxs(e.Fragment,{children:[a?e.jsx(C,{variant:"ghost",onClick:s,children:"Back"}):e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:u,children:n==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[e.jsx(W,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:e.jsx(Ce,{className:"size-5"}),selected:n==="imap",onSelect:()=>r("imap")}),e.jsx(W,{name:"Gmail",description:"Sign in with Google. No app passwords.",icon:e.jsx(K,{className:"size-5"}),comingSoon:!0}),e.jsx(W,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:e.jsx(je,{className:"size-5"}),selected:n==="microsoft",onSelect:()=>r("microsoft")})]})})}function qe({onBack:t,onConnected:o}){const[s,a]=i.useState(""),[n,r]=i.useState(null),[u,h]=i.useState(!1),[c,v]=i.useState(!1),j=i.useRef(!0);i.useEffect(()=>(j.current=!0,()=>{j.current=!1}),[]);const S=i.useRef(new Set),{refetch:y}=Q(ne()),w=X({...be(),onSuccess:p=>{j.current&&(h(!0),window.location.assign(p.authorizationUrl))},onError:p=>{v(!1),r(p instanceof Error?p.message:"Failed to start sign-in")}});Ie(u,i.useCallback(()=>{v(!1),y().then(({data:p,isError:m})=>{if(!j.current)return;if(m||!p){r("Couldn't check whether the sign-in finished. Open Settings › Accounts to see whether the account is connected.");return}r(null);const N=p.accounts.find(b=>!S.current.has(b.accountId));N&&o(N.accountId)})},[y,o]));const x=c||w.isPending,f=()=>{x||(r(null),v(!0),y().then(({data:p,isError:m})=>{if(j.current){if(m||!p){v(!1),r("Couldn't read this instance's accounts, so sign-in can't be tracked. Check your connection and try again.");return}S.current=new Set(p.accounts.map(N=>N.accountId)),w.mutate({body:{email:s.trim()||void 0}})}}))},l=i.useRef(f);return l.current=f,i.useEffect(()=>{const p=m=>{m.key==="Enter"&&l.current(),m.key==="Escape"&&t()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[t]),e.jsx(L,{steps:M,activeStep:R.connector,title:"Sign in with Microsoft",subtitle:"You'll be redirected to Microsoft to sign in securely.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:t,children:"Back"}),e.jsx(C,{variant:"primary",onClick:f,disabled:x,icon:x?e.jsx(D,{className:"size-4 animate-spin"}):void 0,children:x?"Redirecting…":u?"Start over":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(A,{htmlFor:"microsoft-email",children:"Email address (optional)"}),e.jsx(F,{id:"microsoft-email",icon:e.jsx(K,{className:"size-4"}),placeholder:"you@outlook.com",value:s,onChange:p=>a(p.target.value),type:"email",autoComplete:"email"}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"Pre-fills the Microsoft sign-in form. Leave blank to choose on the Microsoft page."})]}),u&&e.jsx(q,{tone:"info",children:"Waiting for Microsoft. Finish signing in — this window carries on the moment the account is connected, wherever you finished."}),n&&e.jsx(q,{tone:"danger",children:n})]})})}function Ge({initialEmail:t,initialDisplayName:o,onContinue:s,onBack:a}){const[n,r]=i.useState(t),[u,h]=i.useState(o),[c,v]=i.useState(!1),[j,S]=i.useState(""),[y,w]=i.useState(null),x=i.useCallback(async()=>{const f=n.trim();if(!f.includes("@")||!f.includes(".")){w("Enter a valid email address.");return}w(null),v(!0),S(ze(f));try{const l=await Oe(f);s(f,u.trim(),l)}finally{v(!1)}},[n,u,s]);return i.useEffect(()=>{const f=l=>{l.key==="Enter"&&!c&&x(),l.key==="Escape"&&a()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[x,c,a]),e.jsx(L,{steps:M,activeStep:R.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:a,children:"Back"}),e.jsx(C,{variant:"primary",disabled:c,onClick:()=>{x()},children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(A,{htmlFor:"onboarding-email",children:"Email address"}),e.jsx(F,{id:"onboarding-email",icon:e.jsx(K,{className:"size-4"}),placeholder:"you@example.com",value:n,onChange:f=>{r(f.target.value),w(null)},type:"email",autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),e.jsx(F,{id:"onboarding-display-name",placeholder:"Alice",value:u,onChange:f=>h(f.target.value)}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),c&&e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(D,{className:"size-3.5 animate-spin text-accent"}),j]}),y&&!c&&e.jsx("div",{className:"mt-3",children:e.jsx(q,{tone:"danger",children:y})})]})})}function Be({email:t,imapConfig:o,smtpConfig:s,discovered:a,onContinue:n,onBack:r,onChange:u}){const[h,c]=i.useState(o),[v,j]=i.useState(s),[S,y]=i.useState(()=>He(t)),[w,x]=i.useState(!1),[f,l]=i.useState(null),p=ee(S),m=p!==void 0&&!w,N=i.useCallback(g=>{y(g),x(!1),l(null);const d=ee(g);d&&(c({host:d.imap.host,port:d.imap.port,security:d.imap.security}),j({host:d.smtp.host,port:d.smtp.port,security:d.smtp.security}))},[]);i.useEffect(()=>{u(h,v)},[h,v,u]);const b=h.host.trim()!=="",k=i.useCallback(()=>{if(!b){l("Enter the IMAP host.");return}l(null),n()},[b,n]);i.useEffect(()=>{const g=d=>{d.key==="Enter"&&k(),d.key==="Escape"&&r()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[k,r]);const T=t.split("@")[1]??"your domain",O=p?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":a?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${T} — enter them manually.`,P=m?{label:"preset",tone:"neutral"}:!p&&a?{label:"detected",tone:"positive"}:void 0,I=p?.passwordHelp.url??ie(t);return e.jsx(L,{steps:M,activeStep:R.servers,title:"Confirm server settings",subtitle:O,footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:r,children:"Back"}),e.jsx(C,{variant:"primary",onClick:k,children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-5",children:[f&&e.jsx(q,{tone:"danger",children:f}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:"provider-select",children:"Provider"}),e.jsxs(V,{id:"provider-select",value:S,onChange:g=>N(g.target.value),children:[e.jsx("option",{value:"",children:"Custom / other"}),ce.map(g=>e.jsx("option",{value:g.id,children:g.label},g.id))]}),p&&e.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:m?e.jsxs(e.Fragment,{children:["Server settings are pre-filled for ",p.label," and locked."," ",e.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>x(!0),children:"Advanced"})," ","lets you edit them by hand."]}):e.jsxs(e.Fragment,{children:["Editing ",p.label,"'s settings by hand."]})})]}),e.jsx(Z,{legend:"IMAP — incoming",badge:P,readOnly:m,host:h.host,port:String(h.port),security:h.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:g=>{c(d=>({...d,host:g})),l(null)},onPortChange:g=>c(d=>({...d,port:Number(g)})),onSecurityChange:g=>c(d=>({...d,security:g}))}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Sending (SMTP) is optional — leave it blank to set up a receive-only account and add sending later in Settings."}),e.jsx(Z,{legend:"SMTP — outgoing (optional)",badge:P,readOnly:m,host:v.host,port:String(v.port),security:v.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:g=>{j(d=>({...d,host:g})),l(null)},onPortChange:g=>j(d=>({...d,port:Number(g)})),onSecurityChange:g=>j(d=>({...d,security:g}))}),p&&e.jsxs("p",{className:"text-2xs text-fg-subtle",children:[p.passwordHelp.text," ",I&&e.jsx("a",{href:I,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}function Ue({email:t,username:o,password:s,onContinue:a,onBack:n,onChange:r}){const[u,h]=i.useState(o||t),[c,v]=i.useState(s),[j,S]=i.useState(null),y=t.split("@")[1]??"",w=ie(t),x=u.trim()!==""&&c.trim()!=="";i.useEffect(()=>{r(u,c)},[u,c,r]);const f=i.useCallback(()=>{if(!x){S("Enter your username and password.");return}S(null),a()},[x,a]);return i.useEffect(()=>{const l=p=>{p.key==="Enter"&&f(),p.key==="Escape"&&n()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[f,n]),e.jsx(L,{steps:M,activeStep:R.credentials,title:`Sign in to ${y||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:n,children:"Back"}),e.jsx(C,{variant:"primary",onClick:f,children:"Test connection"})]}),children:e.jsxs("div",{className:"space-y-3",children:[j&&e.jsx("div",{className:"rounded-md bg-danger-soft px-3 py-2 text-sm text-danger",children:j}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:"credentials-username",children:"Username"}),e.jsx(F,{id:"credentials-username",value:u,onChange:l=>{h(l.target.value),S(null)},autoComplete:"username"})]}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:"credentials-password",children:"Password or app password"}),e.jsx(ve,{id:"credentials-password",value:c,onChange:l=>{v(l.target.value),S(null)},autoComplete:"current-password"})]}),e.jsx(Ne,{url:w})]})})}function We({email:t,imapConfig:o,smtpConfig:s,username:a,password:n,onSuccess:r,onBackToCredentials:u,onBackToServers:h}){const[c,v]=i.useState({imapState:"running",smtpState:"pending",phase:"running"}),[j,S]=i.useState(0),y=s.host.trim()!=="",w=G(o.security),x=G(s.security),f=X({...ge()});i.useEffect(()=>{let m=!1;const N=[];return v({imapState:"running",smtpState:"pending",phase:"running"}),f.mutate({body:{username:a,password:n,imapHost:o.host,imapPort:o.port,imapTls:w.tls,imapStartTls:w.startTls,smtpHost:s.host,smtpPort:s.port,smtpTls:x.tls,smtpStartTls:x.startTls}},{onSuccess:b=>{if(m)return;const k=b.imapSuccess,T=y?b.smtpSuccess:!0;v({imapState:k?"ok":"failed",smtpState:y?"running":"ok",imapDetail:k?`Connected — ${o.host}:${o.port}`:b.imapError,phase:"running"}),N.push(window.setTimeout(()=>{if(m)return;const O=I=>{const g=I?.toLowerCase()??"";return g.includes("auth")||g.includes("login")||g.includes("535")||g.includes("credential")},P=!k&&O(b.imapError)||k&&y&&!b.smtpSuccess&&O(b.smtpError);v({imapState:k?"ok":"failed",smtpState:y?b.smtpSuccess?"ok":"failed":"ok",imapDetail:k?`Connected — ${o.host}:${o.port}`:b.imapError,smtpDetail:y?b.smtpSuccess?`Connected — ${s.host}:${s.port}`:b.smtpError:"Not set up — receive-only",rawError:k?y&&!b.smtpSuccess?b.smtpError:void 0:b.imapError,phase:k&&T?"success":P?"auth-failure":"network-failure"}),k&&T&&N.push(window.setTimeout(()=>{m||r()},800))},400))},onError:b=>{if(m)return;const k=b instanceof Error?b.message:"Connection failed";v({imapState:"failed",smtpState:"failed",imapDetail:k,smtpDetail:k,rawError:k,phase:"network-failure"})}}),()=>{m=!0;for(const b of N)window.clearTimeout(b)}},[j]);const{phase:l}=c;i.useEffect(()=>{const m=N=>{N.key==="Escape"&&(l==="auth-failure"?u():l==="network-failure"&&h())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[l,u,h]);const p=l==="auth-failure"?e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:u,children:"Back to credentials"}),e.jsx(C,{variant:"primary",onClick:()=>S(m=>m+1),children:"Retry"})]}):l==="network-failure"?e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:h,children:"Back to servers"}),e.jsx(C,{variant:"primary",onClick:()=>S(m=>m+1),children:"Retry"})]}):l==="success"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Connection verified"}),e.jsx(C,{variant:"primary",onClick:r,children:"Start syncing"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Testing…"}),e.jsx("span",{})]});return e.jsx(L,{steps:M,activeStep:R.test,title:"Testing the connection",subtitle:`Checking ${t}`,footer:p,children:e.jsxs("div",{className:"divide-y divide-line",children:[e.jsx(_,{label:`IMAP — ${o.host}:${o.port}`,detail:c.imapDetail,state:c.imapState}),e.jsx(_,{label:y?`SMTP — ${s.host}:${s.port}`:"SMTP — sending",detail:y?c.smtpDetail:"Not set up — you can add sending later in Settings",state:c.smtpState}),(l==="auth-failure"||l==="network-failure")&&c.rawError&&e.jsxs("div",{className:"py-3",children:[l==="auth-failure"&&e.jsx("p",{className:"mb-2 text-xs text-fg-muted",children:"Check your password — many providers require an app password."}),e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:c.rawError})]})]})})}const Ve=2e4;function Qe({email:t,displayName:o,imapConfig:s,smtpConfig:a,username:n,password:r,onGoToInbox:u}){const h=xe(),[c,v]=i.useState(null),[j,S]=i.useState(null),y=i.useRef(!1),w=G(s.security),x=G(a.security),f=X({...ye(),onSuccess:E=>{v(E.accountId),h.invalidateQueries({queryKey:fe()})},onError:E=>{S(E instanceof Error?E.message:"Failed to create account")}});i.useEffect(()=>{if(y.current)return;y.current=!0;const E=a.host.trim()!=="",H=we({imapHost:s.host,smtpHost:a.host,smtpPort:a.port}),$=E?H??{smtpHost:a.host,smtpPort:a.port,smtpTls:x.tls,smtpStartTls:x.startTls}:null;f.mutate({body:{email:t,displayName:o||void 0,username:n!==t?n:void 0,password:r,imapHost:s.host,imapPort:s.port,imapTls:w.tls,imapStartTls:w.startTls,smtpHost:$?.smtpHost||void 0,smtpPort:$?.smtpPort||void 0,smtpTls:$?.smtpTls??!1,smtpStartTls:$?.smtpStartTls??!1}})},[]);const{data:l,isError:p}=Q({...Y({path:{accountId:c??""}}),enabled:!!c,refetchInterval:E=>{const H=E.state.data?.syncPhase;return H==="complete"||H==="error"?!1:2e3}}),m=l?.syncPhase==="error",{data:N}=Q({...ne(),enabled:!!c&&m}),b=N?.accounts.find(E=>E.accountId===c)?.lastError,k=l?.mailboxes.find(E=>E.fullPath==="INBOX"||E.fullPath==="Inbox"),T=l?.mailboxCountTotal??0,O=l?.mailboxCountSynced??0,P=k?.messagesTotal??0,I=k?.messagesSynced??0,g=P>0?I/P:0,d=l?.syncPhase,le=m?"failed":d==="idle"||d===void 0||d==="discovering_mailboxes"?"running":T>0?"ok":"running",B=m?"failed":!d||d==="idle"||d==="discovering_mailboxes"?"pending":d==="syncing_inbox"||d==="syncing_others"?"running":"ok",U=m?"failed":!d||d==="idle"||d==="discovering_mailboxes"||d==="syncing_inbox"?"pending":d==="syncing_others"?"running":"ok",me=I>0||k?.phase==="complete"||d==="complete"||m,[ue,de]=i.useState(!1);i.useEffect(()=>{if(!c)return;const E=setTimeout(()=>de(!0),Ve);return()=>clearTimeout(E)},[c]);const pe=!!c&&(me||p||ue);return j?e.jsx(L,{steps:M,activeStep:R.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:()=>{y.current=!1,S(null),f.mutate({body:{email:t,displayName:o||void 0,username:n!==t?n:void 0,password:r,imapHost:s.host,imapPort:s.port,imapTls:w.tls,imapStartTls:w.startTls,smtpHost:a.host||void 0,smtpPort:a.port||void 0,smtpTls:x.tls,smtpStartTls:x.startTls}})},children:"Retry"})]}),children:e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:j})}):e.jsx(L,{steps:M,activeStep:R.sync,title:`Syncing ${t}`,subtitle:"Newest mail first — you can start reading right away.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),pe?e.jsx(C,{variant:"primary",onClick:()=>c&&u(c),children:"Go to inbox"}):e.jsx(C,{variant:"primary",disabled:!0,icon:e.jsx(D,{className:"size-3.5 animate-spin"}),children:"Getting your mail…"})]}),children:f.isPending?e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(D,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):e.jsxs("div",{className:"space-y-3",children:[P>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[e.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),e.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[I.toLocaleString()," / ",P.toLocaleString()," ","messages"]})]}),e.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,g*100)}%`}})})]}),e.jsxs("div",{className:"divide-y divide-line",children:[e.jsx(_,{label:"Mailboxes discovered",detail:T>0?`${T} mailbox${T===1?"":"es"} found`:"Discovering…",state:le}),e.jsx(_,{label:"INBOX",detail:B==="ok"?`${I.toLocaleString()} messages synced`:B==="running"?"Syncing newest first…":"Queued",state:B}),O>1||d==="syncing_others"||d==="complete"?e.jsx(_,{label:"Other mailboxes",detail:U==="ok"?`${O-1} mailboxes synced`:U==="running"?"Syncing…":"Queued",state:U}):null]}),m&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>{h.invalidateQueries({queryKey:Y({path:{accountId:c??""}}).queryKey})},children:"retry"})]}),b&&e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:b})]})]})})}function Ze({skipWelcome:t=!1,onComplete:o,onCancel:s}){const[a,n]=i.useState(t?"connector":"welcome"),[r,u]=i.useState({email:"",displayName:"",imapConfig:te,smtpConfig:se,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),h=i.useCallback(()=>n("connector"),[]),c=i.useCallback(()=>n("address"),[]),v=i.useCallback(()=>n("microsoft-email"),[]),j=i.useCallback(()=>{t?s?.():n("welcome")},[t,s]),S=i.useCallback((l,p,m)=>{let N=te,b=se,k=!1;m&&(k=m.source!=="heuristic",N={host:m.imap.host,port:m.imap.port,security:m.imap.security},b={host:m.smtp.host,port:m.smtp.port,security:m.smtp.security}),u(T=>({...T,email:l,displayName:p,imapConfig:N,smtpConfig:b,discoveryResult:m,discovered:k,username:l})),n("servers")},[]),y=i.useCallback((l,p)=>{u(m=>({...m,imapConfig:l,smtpConfig:p}))},[]),w=i.useCallback((l,p)=>{u(m=>({...m,username:l,password:p}))},[]),x=i.useCallback(()=>n("sync"),[]),f=i.useCallback(l=>{o(l)},[o]);switch(a){case"welcome":return e.jsx($e,{onStart:h});case"connector":return e.jsx(De,{onContinue:c,onMicrosoft:v,onBack:j,showBack:!t});case"microsoft-email":return e.jsx(qe,{onBack:()=>n("connector"),onConnected:f});case"address":return e.jsx(Ge,{initialEmail:r.email,initialDisplayName:r.displayName,onContinue:S,onBack:()=>n("connector")});case"servers":return e.jsx(Be,{email:r.email,imapConfig:r.imapConfig,smtpConfig:r.smtpConfig,discovered:r.discovered,onContinue:()=>n("credentials"),onBack:()=>n("address"),onChange:y});case"credentials":return e.jsx(Ue,{email:r.email,username:r.username,password:r.password,onContinue:()=>n("test"),onBack:()=>n("servers"),onChange:w});case"test":return e.jsx(We,{email:r.email,imapConfig:r.imapConfig,smtpConfig:r.smtpConfig,username:r.username,password:r.password,onSuccess:x,onBackToCredentials:()=>n("credentials"),onBackToServers:()=>n("servers")});case"sync":return e.jsx(Qe,{email:r.email,displayName:r.displayName,imapConfig:r.imapConfig,smtpConfig:r.smtpConfig,username:r.username,password:r.password,onGoToInbox:f})}}export{Ze as O,ce as P,ee as g,G as s,Ie as u};
|
|
1
|
+
import{c as re,j as e,b as z,ac as V,ag as oe,r as i,at as he,aw as A,ad as F,n as xe,a7 as X,V as fe,ab as ye,s as Q,ax as Y,Q as ne,B as C,af as D,aa as ge,ae as ve,as as q,ap as be,I as je}from"./index-CP_u7qA0.js";import{K as Se}from"./kbd-BaSoxAuP.js";import{c as we}from"./account-form-helpers-DhckT_PN.js";import{M as ke}from"./mail-gESMSqqx.js";const K=re("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);const Ce=re("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function Ne({url:t}){return e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Stored encrypted, used only to connect to your mail server."," ",t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"How to create an app password"}):e.jsx("span",{children:"Check your provider's help for app password instructions."})]})}function Ee({raised:t,className:o,...s}){return e.jsx("div",{className:z("rounded-sm border border-line bg-surface",t?"bg-surface-raised shadow-sm":"",o),...s})}function J({value:t,defaultValue:o,onValueChange:s,...a}){return s?e.jsxs(V,{value:t,onChange:n=>s(n.target.value),...a,children:[e.jsx("option",{value:"tls",children:"TLS/SSL"}),e.jsx("option",{value:"starttls",children:"STARTTLS"}),e.jsx("option",{value:"none",children:"None (insecure)"})]}):e.jsxs(V,{defaultValue:o??t,...a,children:[e.jsx("option",{value:"tls",children:"TLS/SSL"}),e.jsx("option",{value:"starttls",children:"STARTTLS"}),e.jsx("option",{value:"none",children:"None (insecure)"})]})}function G(t){return{tls:t==="tls",startTls:t==="starttls"}}function Te({steps:t,activeStep:o}){return e.jsx("ol",{className:"flex items-center gap-1",children:t.map((s,a)=>{const n=a<o,r=a===o;return e.jsxs("li",{className:"flex items-center gap-1",children:[a>0&&e.jsx("span",{className:"h-px w-5 bg-line","aria-hidden":!0}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:z("flex size-5 items-center justify-center rounded-full text-2xs font-semibold tabular-nums",n&&"bg-accent text-accent-fg",r&&"bg-accent-soft text-accent ring-1 ring-accent",!n&&!r&&"bg-surface-sunken text-fg-subtle"),children:n?e.jsx(oe,{className:"size-3"}):a+1}),e.jsx("span",{className:z("hidden text-2xs sm:inline",r?"font-medium text-fg":"text-fg-subtle"),children:s})]})]},s)})})}function L({steps:t,activeStep:o,title:s,subtitle:a,children:n,footer:r,hideSteps:u}){return e.jsxs("div",{className:"flex min-h-dvh w-full flex-col items-center overflow-y-auto bg-canvas pb-[max(2rem,env(safe-area-inset-bottom,0px))] pl-[max(2rem,env(safe-area-inset-left,0px))] pr-[max(2rem,env(safe-area-inset-right,0px))] pt-[max(2rem,env(safe-area-inset-top,0px))] font-sans text-fg sm:pt-[30vh]",children:[!u&&e.jsx("div",{className:"mb-5 w-full max-w-xl",children:e.jsx(Te,{steps:t,activeStep:o})}),e.jsxs(Ee,{raised:!0,className:"w-full max-w-xl",children:[e.jsxs("div",{className:"px-5 pt-5",children:[e.jsx("h1",{className:"text-xl font-semibold text-fg",children:s}),a&&e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:a})]}),e.jsx("div",{className:"px-5 py-5",children:n}),r&&e.jsx("div",{className:"flex items-center justify-between gap-3 border-t border-line px-5 py-3",children:r})]})]})}const Pe="Coming soon — use IMAP for now.";function W({name:t,description:o,icon:s,comingSoon:a,selected:n,onSelect:r}){const[u,h]=i.useState(!1),c=()=>{if(r){r();return}a&&h(!0)};return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{type:"button",onClick:c,"aria-disabled":a||void 0,className:z("flex flex-col items-start gap-2 rounded-sm border p-3 text-left transition-colors",n?"border-accent-2 bg-accent-2-soft":"border-line bg-surface hover:border-line-strong",a&&"opacity-55"),children:[e.jsx("span",{className:z("text-fg-muted",n&&"text-accent-2"),children:s}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-fg",children:t}),a&&e.jsx("span",{className:"rounded-full bg-surface-sunken px-1.5 py-0.5 text-2xs text-fg-subtle",children:"soon"})]}),e.jsx("span",{className:"text-xs text-fg-subtle",children:o})]}),u&&e.jsx("p",{className:"text-2xs text-fg-subtle",children:Pe})]})}function Z({legend:t,badge:o,host:s,port:a,security:n,readOnly:r,onHostChange:u,onPortChange:h,onSecurityChange:c,hostPlaceholder:v,portPlaceholder:j}){const S=i.useId(),y=i.useId(),w=i.useId();return e.jsxs("fieldset",{children:[e.jsxs("legend",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[t,o&&e.jsx(he,{tone:o.tone,children:o.label})]}),e.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-3 sm:grid-cols-[1fr_6rem_8rem] sm:gap-2",children:[e.jsxs("div",{children:[e.jsx(A,{htmlFor:S,children:"Host"}),u?e.jsx(F,{id:S,readOnly:r,value:s,onChange:x=>u(x.target.value),placeholder:v}):e.jsx(F,{id:S,readOnly:r,defaultValue:s,placeholder:v})]}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:y,children:"Port"}),h?e.jsx(F,{id:y,readOnly:r,value:a,onChange:x=>h(x.target.value),placeholder:j}):e.jsx(F,{id:y,readOnly:r,defaultValue:a,placeholder:j})]}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:w,children:"Security"}),c?e.jsx(J,{id:w,value:n,onValueChange:c}):e.jsx(J,{id:w,defaultValue:n})]})]})]})}function _({label:t,detail:o,state:s}){return e.jsxs("div",{className:"flex items-start gap-3 py-2",children:[e.jsxs("span",{className:z("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full text-2xs",s==="ok"&&"bg-positive text-accent-fg",s==="failed"&&"bg-danger text-accent-fg",s==="running"&&"border border-accent text-accent",s==="pending"&&"border border-line text-fg-subtle"),children:[s==="ok"&&e.jsx(oe,{className:"size-3"}),s==="failed"&&"!",s==="running"&&e.jsx("span",{className:"size-2 animate-pulse rounded-full bg-accent"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:z("text-sm",s==="failed"?"font-medium text-danger":"text-fg"),children:t}),o&&e.jsx("div",{className:"mt-0.5 text-xs text-fg-subtle",children:o})]})]})}const Ie=(t,o)=>{const s=i.useRef(o);s.current=o,i.useEffect(()=>{if(!t)return;const a=()=>{document.visibilityState==="visible"&&s.current()};return document.addEventListener("visibilitychange",a),window.addEventListener("pageshow",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pageshow",a)}},[t])},Ae={"gmail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"googlemail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"outlook.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"hotmail.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"live.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"msn.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"icloud.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"me.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"mac.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"fastmail.com":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"fastmail.fm":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"yahoo.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"yahoo.co.uk":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"ymail.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"aol.com":{imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},source:"provider-table"},"zoho.com":{imap:{host:"imap.zoho.com",port:993,security:"tls"},smtp:{host:"smtp.zoho.com",port:465,security:"tls"},source:"provider-table"},"gmx.com":{imap:{host:"imap.gmx.com",port:993,security:"tls"},smtp:{host:"smtp.gmx.com",port:587,security:"starttls"},source:"provider-table"},"gmx.net":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"gmx.de":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"web.de":{imap:{host:"imap.web.de",port:993,security:"tls"},smtp:{host:"smtp.web.de",port:587,security:"starttls"},source:"provider-table"},"mail.com":{imap:{host:"imap.mail.com",port:993,security:"tls"},smtp:{host:"smtp.mail.com",port:465,security:"tls"},source:"provider-table"},"hey.com":{imap:{host:"imap.hey.com",port:993,security:"tls"},smtp:{host:"smtp.hey.com",port:465,security:"tls"},source:"provider-table"},"tutanota.com":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"tuta.io":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"posteo.de":{imap:{host:"posteo.de",port:993,security:"tls"},smtp:{host:"posteo.de",port:465,security:"tls"},source:"provider-table"},"runbox.com":{imap:{host:"imap.runbox.com",port:993,security:"tls"},smtp:{host:"smtp.runbox.com",port:587,security:"starttls"},source:"provider-table"},"mailbox.org":{imap:{host:"imap.mailbox.org",port:993,security:"tls"},smtp:{host:"smtp.mailbox.org",port:465,security:"tls"},source:"provider-table"},"hushmail.com":{imap:{host:"imap.hushmail.com",port:993,security:"tls"},smtp:{host:"smtp.hushmail.com",port:465,security:"tls"},source:"provider-table"}},Le={"gmail.com":"https://support.google.com/accounts/answer/185833","googlemail.com":"https://support.google.com/accounts/answer/185833","yahoo.com":"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html","icloud.com":"https://support.apple.com/en-us/102654","me.com":"https://support.apple.com/en-us/102654","mac.com":"https://support.apple.com/en-us/102654","fastmail.com":"https://www.fastmail.help/hc/en-us/articles/360058752854","fastmail.fm":"https://www.fastmail.help/hc/en-us/articles/360058752854","outlook.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","hotmail.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","zoho.com":"https://help.zoho.com/portal/en/kb/zoho-mail/client-configuration/imap-access/articles/zoho-mail-app-passwords"};function ae(t){try{const s=new DOMParser().parseFromString(t,"application/xml");if(s.querySelector("parsererror"))return null;const a=s.querySelectorAll("incomingServer[type='imap']"),n=s.querySelectorAll("outgoingServer[type='smtp']");if(!a.length||!n.length)return null;const r=a[0],u=n[0],h=r.querySelector("hostname")?.textContent?.trim(),c=r.querySelector("port")?.textContent?.trim(),v=r.querySelector("socketType")?.textContent?.trim().toUpperCase(),j=u.querySelector("hostname")?.textContent?.trim(),S=u.querySelector("port")?.textContent?.trim(),y=u.querySelector("socketType")?.textContent?.trim().toUpperCase();if(!h||!c||!j||!S)return null;const w=x=>x==="SSL"||x==="TLS"||x==="SSL/TLS"?"tls":x==="STARTTLS"?"starttls":"none";return{imap:{host:h,port:Number.parseInt(c,10),security:w(v)},smtp:{host:j,port:Number.parseInt(S,10),security:w(y)},source:"mozilla-autoconfig"}}catch{return null}}async function Me(t,o){try{const s=`https://autoconfig.thunderbird.net/v1.1/${t}`,a=await fetch(s,{signal:o});if(!a.ok)return null;const n=await a.text(),r=ae(n);return r||null}catch{return null}}async function Fe(t,o){try{const s=`https://autoconfig.${t}/mail/config-v1.1.xml`,a=await fetch(s,{signal:o});if(!a.ok)return null;const n=await a.text(),r=ae(n);return r?{...r,source:"domain-autoconfig"}:null}catch{return null}}function Re(t){return{imap:{host:`imap.${t}`,port:993,security:"tls"},smtp:{host:`smtp.${t}`,port:587,security:"starttls"},source:"heuristic"}}async function Oe(t,o=1500){const s=t.indexOf("@");if(s===-1)return null;const a=t.slice(s+1).toLowerCase();if(!a)return null;const n=Ae[a];if(n)return n;const r=new AbortController,u=setTimeout(()=>r.abort(),o);try{const h=await Me(a,r.signal);if(h)return h;const c=await Fe(a,r.signal);if(c)return c}finally{clearTimeout(u)}return Re(a)}function ze(t){const o=t.indexOf("@");return o===-1?"Looking up server settings…":`Looking up settings for ${t.slice(o+1)}…`}function ie(t){const o=t.indexOf("@");if(o===-1)return;const s=t.slice(o+1).toLowerCase();return Le[s]}const ce=[{id:"icloud",label:"iCloud",username:"full-email",imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},passwordHelp:{text:"iCloud requires an app-specific password, not your Apple ID password. Generate one under Sign-In & Security → App-Specific Passwords.",url:"https://support.apple.com/en-us/102654"}},{id:"yahoo",label:"Yahoo",username:"full-email",imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},passwordHelp:{text:"Yahoo requires an app password, not your login password. Generate one under Account Security.",url:"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html"}},{id:"aol",label:"AOL",username:"full-email",imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},passwordHelp:{text:"AOL requires an app password, not your login password. Generate one under Account Security.",url:"https://login.aol.com/account/security"}},{id:"fastmail",label:"Fastmail",username:"full-email",imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},passwordHelp:{text:"Fastmail requires an app password, not your login password. Create one under Settings → Privacy & Security → App passwords.",url:"https://www.fastmail.help/hc/en-us/articles/360058752854"}}];function ee(t){return ce.find(o=>o.id===t)}const _e={"icloud.com":"icloud","me.com":"icloud","mac.com":"icloud","yahoo.com":"yahoo","yahoo.co.uk":"yahoo","ymail.com":"yahoo","aol.com":"aol","fastmail.com":"fastmail","fastmail.fm":"fastmail"};function He(t){const o=t.indexOf("@");if(o===-1)return"";const s=t.slice(o+1).toLowerCase();return _e[s]??""}const M=["Connector","Address","Servers","Credentials","Test","Sync"],R={connector:0,address:1,servers:2,credentials:3,test:4,sync:5},te={host:"",port:993,security:"tls"},se={host:"",port:587,security:"starttls"};function $e({onStart:t}){return i.useEffect(()=>{const o=s=>{s.key==="Enter"&&t()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t]),e.jsx(L,{steps:M,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:"One inbox for all your mail, with context about every message.",footer:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-2xs text-fg-subtle",children:[e.jsx(Se,{children:"Enter"})," to continue"]}),e.jsx(C,{variant:"primary",onClick:t,children:"Add your first account"})]}),children:e.jsxs("div",{className:"flex flex-col items-start py-5",children:[e.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:e.jsx(ke,{className:"size-7 text-accent"})}),e.jsx("p",{className:"mt-5 max-w-sm text-sm leading-relaxed text-fg-muted",children:"Remit syncs your existing mailboxes and tells you who is really writing to you — sender history, authenticity checks, and similar messages, right next to every email."})]})})}function De({onContinue:t,onMicrosoft:o,onBack:s,showBack:a}){const[n,r]=i.useState("imap");i.useEffect(()=>{const h=c=>{c.key==="Enter"&&(n==="microsoft"?o():t()),c.key==="Escape"&&s()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t,o,s,n]);const u=()=>{n==="microsoft"?o():t()};return e.jsx(L,{steps:M,activeStep:R.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:e.jsxs(e.Fragment,{children:[a?e.jsx(C,{variant:"ghost",onClick:s,children:"Back"}):e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:u,children:n==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[e.jsx(W,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:e.jsx(Ce,{className:"size-5"}),selected:n==="imap",onSelect:()=>r("imap")}),e.jsx(W,{name:"Gmail",description:"Sign in with Google. No app passwords.",icon:e.jsx(K,{className:"size-5"}),comingSoon:!0}),e.jsx(W,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:e.jsx(je,{className:"size-5"}),selected:n==="microsoft",onSelect:()=>r("microsoft")})]})})}function qe({onBack:t,onConnected:o}){const[s,a]=i.useState(""),[n,r]=i.useState(null),[u,h]=i.useState(!1),[c,v]=i.useState(!1),j=i.useRef(!0);i.useEffect(()=>(j.current=!0,()=>{j.current=!1}),[]);const S=i.useRef(new Set),{refetch:y}=Q(ne()),w=X({...be(),onSuccess:p=>{j.current&&(h(!0),window.location.assign(p.authorizationUrl))},onError:p=>{v(!1),r(p instanceof Error?p.message:"Failed to start sign-in")}});Ie(u,i.useCallback(()=>{v(!1),y().then(({data:p,isError:m})=>{if(!j.current)return;if(m||!p){r("Couldn't check whether the sign-in finished. Open Settings › Accounts to see whether the account is connected.");return}r(null);const N=p.accounts.find(b=>!S.current.has(b.accountId));N&&o(N.accountId)})},[y,o]));const x=c||w.isPending,f=()=>{x||(r(null),v(!0),y().then(({data:p,isError:m})=>{if(j.current){if(m||!p){v(!1),r("Couldn't read this instance's accounts, so sign-in can't be tracked. Check your connection and try again.");return}S.current=new Set(p.accounts.map(N=>N.accountId)),w.mutate({body:{email:s.trim()||void 0}})}}))},l=i.useRef(f);return l.current=f,i.useEffect(()=>{const p=m=>{m.key==="Enter"&&l.current(),m.key==="Escape"&&t()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[t]),e.jsx(L,{steps:M,activeStep:R.connector,title:"Sign in with Microsoft",subtitle:"You'll be redirected to Microsoft to sign in securely.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:t,children:"Back"}),e.jsx(C,{variant:"primary",onClick:f,disabled:x,icon:x?e.jsx(D,{className:"size-4 animate-spin"}):void 0,children:x?"Redirecting…":u?"Start over":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(A,{htmlFor:"microsoft-email",children:"Email address (optional)"}),e.jsx(F,{id:"microsoft-email",icon:e.jsx(K,{className:"size-4"}),placeholder:"you@outlook.com",value:s,onChange:p=>a(p.target.value),type:"email",autoComplete:"email"}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"Pre-fills the Microsoft sign-in form. Leave blank to choose on the Microsoft page."})]}),u&&e.jsx(q,{tone:"info",children:"Waiting for Microsoft. Finish signing in — this window carries on the moment the account is connected, wherever you finished."}),n&&e.jsx(q,{tone:"danger",children:n})]})})}function Ge({initialEmail:t,initialDisplayName:o,onContinue:s,onBack:a}){const[n,r]=i.useState(t),[u,h]=i.useState(o),[c,v]=i.useState(!1),[j,S]=i.useState(""),[y,w]=i.useState(null),x=i.useCallback(async()=>{const f=n.trim();if(!f.includes("@")||!f.includes(".")){w("Enter a valid email address.");return}w(null),v(!0),S(ze(f));try{const l=await Oe(f);s(f,u.trim(),l)}finally{v(!1)}},[n,u,s]);return i.useEffect(()=>{const f=l=>{l.key==="Enter"&&!c&&x(),l.key==="Escape"&&a()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[x,c,a]),e.jsx(L,{steps:M,activeStep:R.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:a,children:"Back"}),e.jsx(C,{variant:"primary",disabled:c,onClick:()=>{x()},children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(A,{htmlFor:"onboarding-email",children:"Email address"}),e.jsx(F,{id:"onboarding-email",icon:e.jsx(K,{className:"size-4"}),placeholder:"you@example.com",value:n,onChange:f=>{r(f.target.value),w(null)},type:"email",autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),e.jsx(F,{id:"onboarding-display-name",placeholder:"Alice",value:u,onChange:f=>h(f.target.value)}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),c&&e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(D,{className:"size-3.5 animate-spin text-accent"}),j]}),y&&!c&&e.jsx("div",{className:"mt-3",children:e.jsx(q,{tone:"danger",children:y})})]})})}function Be({email:t,imapConfig:o,smtpConfig:s,discovered:a,onContinue:n,onBack:r,onChange:u}){const[h,c]=i.useState(o),[v,j]=i.useState(s),[S,y]=i.useState(()=>He(t)),[w,x]=i.useState(!1),[f,l]=i.useState(null),p=ee(S),m=p!==void 0&&!w,N=i.useCallback(g=>{y(g),x(!1),l(null);const d=ee(g);d&&(c({host:d.imap.host,port:d.imap.port,security:d.imap.security}),j({host:d.smtp.host,port:d.smtp.port,security:d.smtp.security}))},[]);i.useEffect(()=>{u(h,v)},[h,v,u]);const b=h.host.trim()!=="",k=i.useCallback(()=>{if(!b){l("Enter the IMAP host.");return}l(null),n()},[b,n]);i.useEffect(()=>{const g=d=>{d.key==="Enter"&&k(),d.key==="Escape"&&r()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[k,r]);const T=t.split("@")[1]??"your domain",O=p?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":a?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${T} — enter them manually.`,P=m?{label:"preset",tone:"neutral"}:!p&&a?{label:"detected",tone:"positive"}:void 0,I=p?.passwordHelp.url??ie(t);return e.jsx(L,{steps:M,activeStep:R.servers,title:"Confirm server settings",subtitle:O,footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:r,children:"Back"}),e.jsx(C,{variant:"primary",onClick:k,children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-5",children:[f&&e.jsx(q,{tone:"danger",children:f}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:"provider-select",children:"Provider"}),e.jsxs(V,{id:"provider-select",value:S,onChange:g=>N(g.target.value),children:[e.jsx("option",{value:"",children:"Custom / other"}),ce.map(g=>e.jsx("option",{value:g.id,children:g.label},g.id))]}),p&&e.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:m?e.jsxs(e.Fragment,{children:["Server settings are pre-filled for ",p.label," and locked."," ",e.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>x(!0),children:"Advanced"})," ","lets you edit them by hand."]}):e.jsxs(e.Fragment,{children:["Editing ",p.label,"'s settings by hand."]})})]}),e.jsx(Z,{legend:"IMAP — incoming",badge:P,readOnly:m,host:h.host,port:String(h.port),security:h.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:g=>{c(d=>({...d,host:g})),l(null)},onPortChange:g=>c(d=>({...d,port:Number(g)})),onSecurityChange:g=>c(d=>({...d,security:g}))}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Sending (SMTP) is optional — leave it blank to set up a receive-only account and add sending later in Settings."}),e.jsx(Z,{legend:"SMTP — outgoing (optional)",badge:P,readOnly:m,host:v.host,port:String(v.port),security:v.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:g=>{j(d=>({...d,host:g})),l(null)},onPortChange:g=>j(d=>({...d,port:Number(g)})),onSecurityChange:g=>j(d=>({...d,security:g}))}),p&&e.jsxs("p",{className:"text-2xs text-fg-subtle",children:[p.passwordHelp.text," ",I&&e.jsx("a",{href:I,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}function Ue({email:t,username:o,password:s,onContinue:a,onBack:n,onChange:r}){const[u,h]=i.useState(o||t),[c,v]=i.useState(s),[j,S]=i.useState(null),y=t.split("@")[1]??"",w=ie(t),x=u.trim()!==""&&c.trim()!=="";i.useEffect(()=>{r(u,c)},[u,c,r]);const f=i.useCallback(()=>{if(!x){S("Enter your username and password.");return}S(null),a()},[x,a]);return i.useEffect(()=>{const l=p=>{p.key==="Enter"&&f(),p.key==="Escape"&&n()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[f,n]),e.jsx(L,{steps:M,activeStep:R.credentials,title:`Sign in to ${y||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:n,children:"Back"}),e.jsx(C,{variant:"primary",onClick:f,children:"Test connection"})]}),children:e.jsxs("div",{className:"space-y-3",children:[j&&e.jsx("div",{className:"rounded-md bg-danger-soft px-3 py-2 text-sm text-danger",children:j}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:"credentials-username",children:"Username"}),e.jsx(F,{id:"credentials-username",value:u,onChange:l=>{h(l.target.value),S(null)},autoComplete:"username"})]}),e.jsxs("div",{children:[e.jsx(A,{htmlFor:"credentials-password",children:"Password or app password"}),e.jsx(ve,{id:"credentials-password",value:c,onChange:l=>{v(l.target.value),S(null)},autoComplete:"current-password"})]}),e.jsx(Ne,{url:w})]})})}function We({email:t,imapConfig:o,smtpConfig:s,username:a,password:n,onSuccess:r,onBackToCredentials:u,onBackToServers:h}){const[c,v]=i.useState({imapState:"running",smtpState:"pending",phase:"running"}),[j,S]=i.useState(0),y=s.host.trim()!=="",w=G(o.security),x=G(s.security),f=X({...ge()});i.useEffect(()=>{let m=!1;const N=[];return v({imapState:"running",smtpState:"pending",phase:"running"}),f.mutate({body:{username:a,password:n,imapHost:o.host,imapPort:o.port,imapTls:w.tls,imapStartTls:w.startTls,smtpHost:s.host,smtpPort:s.port,smtpTls:x.tls,smtpStartTls:x.startTls}},{onSuccess:b=>{if(m)return;const k=b.imapSuccess,T=y?b.smtpSuccess:!0;v({imapState:k?"ok":"failed",smtpState:y?"running":"ok",imapDetail:k?`Connected — ${o.host}:${o.port}`:b.imapError,phase:"running"}),N.push(window.setTimeout(()=>{if(m)return;const O=I=>{const g=I?.toLowerCase()??"";return g.includes("auth")||g.includes("login")||g.includes("535")||g.includes("credential")},P=!k&&O(b.imapError)||k&&y&&!b.smtpSuccess&&O(b.smtpError);v({imapState:k?"ok":"failed",smtpState:y?b.smtpSuccess?"ok":"failed":"ok",imapDetail:k?`Connected — ${o.host}:${o.port}`:b.imapError,smtpDetail:y?b.smtpSuccess?`Connected — ${s.host}:${s.port}`:b.smtpError:"Not set up — receive-only",rawError:k?y&&!b.smtpSuccess?b.smtpError:void 0:b.imapError,phase:k&&T?"success":P?"auth-failure":"network-failure"}),k&&T&&N.push(window.setTimeout(()=>{m||r()},800))},400))},onError:b=>{if(m)return;const k=b instanceof Error?b.message:"Connection failed";v({imapState:"failed",smtpState:"failed",imapDetail:k,smtpDetail:k,rawError:k,phase:"network-failure"})}}),()=>{m=!0;for(const b of N)window.clearTimeout(b)}},[j]);const{phase:l}=c;i.useEffect(()=>{const m=N=>{N.key==="Escape"&&(l==="auth-failure"?u():l==="network-failure"&&h())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[l,u,h]);const p=l==="auth-failure"?e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:u,children:"Back to credentials"}),e.jsx(C,{variant:"primary",onClick:()=>S(m=>m+1),children:"Retry"})]}):l==="network-failure"?e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:h,children:"Back to servers"}),e.jsx(C,{variant:"primary",onClick:()=>S(m=>m+1),children:"Retry"})]}):l==="success"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Connection verified"}),e.jsx(C,{variant:"primary",onClick:r,children:"Start syncing"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Testing…"}),e.jsx("span",{})]});return e.jsx(L,{steps:M,activeStep:R.test,title:"Testing the connection",subtitle:`Checking ${t}`,footer:p,children:e.jsxs("div",{className:"divide-y divide-line",children:[e.jsx(_,{label:`IMAP — ${o.host}:${o.port}`,detail:c.imapDetail,state:c.imapState}),e.jsx(_,{label:y?`SMTP — ${s.host}:${s.port}`:"SMTP — sending",detail:y?c.smtpDetail:"Not set up — you can add sending later in Settings",state:c.smtpState}),(l==="auth-failure"||l==="network-failure")&&c.rawError&&e.jsxs("div",{className:"py-3",children:[l==="auth-failure"&&e.jsx("p",{className:"mb-2 text-xs text-fg-muted",children:"Check your password — many providers require an app password."}),e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:c.rawError})]})]})})}const Ve=2e4;function Qe({email:t,displayName:o,imapConfig:s,smtpConfig:a,username:n,password:r,onGoToInbox:u}){const h=xe(),[c,v]=i.useState(null),[j,S]=i.useState(null),y=i.useRef(!1),w=G(s.security),x=G(a.security),f=X({...ye(),onSuccess:E=>{v(E.accountId),h.invalidateQueries({queryKey:fe()})},onError:E=>{S(E instanceof Error?E.message:"Failed to create account")}});i.useEffect(()=>{if(y.current)return;y.current=!0;const E=a.host.trim()!=="",H=we({imapHost:s.host,smtpHost:a.host,smtpPort:a.port}),$=E?H??{smtpHost:a.host,smtpPort:a.port,smtpTls:x.tls,smtpStartTls:x.startTls}:null;f.mutate({body:{email:t,displayName:o||void 0,username:n!==t?n:void 0,password:r,imapHost:s.host,imapPort:s.port,imapTls:w.tls,imapStartTls:w.startTls,smtpHost:$?.smtpHost||void 0,smtpPort:$?.smtpPort||void 0,smtpTls:$?.smtpTls??!1,smtpStartTls:$?.smtpStartTls??!1}})},[]);const{data:l,isError:p}=Q({...Y({path:{accountId:c??""}}),enabled:!!c,refetchInterval:E=>{const H=E.state.data?.syncPhase;return H==="complete"||H==="error"?!1:2e3}}),m=l?.syncPhase==="error",{data:N}=Q({...ne(),enabled:!!c&&m}),b=N?.accounts.find(E=>E.accountId===c)?.lastError,k=l?.mailboxes.find(E=>E.fullPath==="INBOX"||E.fullPath==="Inbox"),T=l?.mailboxCountTotal??0,O=l?.mailboxCountSynced??0,P=k?.messagesTotal??0,I=k?.messagesSynced??0,g=P>0?I/P:0,d=l?.syncPhase,le=m?"failed":d==="idle"||d===void 0||d==="discovering_mailboxes"?"running":T>0?"ok":"running",B=m?"failed":!d||d==="idle"||d==="discovering_mailboxes"?"pending":d==="syncing_inbox"||d==="syncing_others"?"running":"ok",U=m?"failed":!d||d==="idle"||d==="discovering_mailboxes"||d==="syncing_inbox"?"pending":d==="syncing_others"?"running":"ok",me=I>0||k?.phase==="complete"||d==="complete"||m,[ue,de]=i.useState(!1);i.useEffect(()=>{if(!c)return;const E=setTimeout(()=>de(!0),Ve);return()=>clearTimeout(E)},[c]);const pe=!!c&&(me||p||ue);return j?e.jsx(L,{steps:M,activeStep:R.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:()=>{y.current=!1,S(null),f.mutate({body:{email:t,displayName:o||void 0,username:n!==t?n:void 0,password:r,imapHost:s.host,imapPort:s.port,imapTls:w.tls,imapStartTls:w.startTls,smtpHost:a.host||void 0,smtpPort:a.port||void 0,smtpTls:x.tls,smtpStartTls:x.startTls}})},children:"Retry"})]}),children:e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:j})}):e.jsx(L,{steps:M,activeStep:R.sync,title:`Syncing ${t}`,subtitle:"Newest mail first — you can start reading right away.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),pe?e.jsx(C,{variant:"primary",onClick:()=>c&&u(c),children:"Go to inbox"}):e.jsx(C,{variant:"primary",disabled:!0,icon:e.jsx(D,{className:"size-3.5 animate-spin"}),children:"Getting your mail…"})]}),children:f.isPending?e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(D,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):e.jsxs("div",{className:"space-y-3",children:[P>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[e.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),e.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[I.toLocaleString()," / ",P.toLocaleString()," ","messages"]})]}),e.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,g*100)}%`}})})]}),e.jsxs("div",{className:"divide-y divide-line",children:[e.jsx(_,{label:"Mailboxes discovered",detail:T>0?`${T} mailbox${T===1?"":"es"} found`:"Discovering…",state:le}),e.jsx(_,{label:"INBOX",detail:B==="ok"?`${I.toLocaleString()} messages synced`:B==="running"?"Syncing newest first…":"Queued",state:B}),O>1||d==="syncing_others"||d==="complete"?e.jsx(_,{label:"Other mailboxes",detail:U==="ok"?`${O-1} mailboxes synced`:U==="running"?"Syncing…":"Queued",state:U}):null]}),m&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>{h.invalidateQueries({queryKey:Y({path:{accountId:c??""}}).queryKey})},children:"retry"})]}),b&&e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:b})]})]})})}function Ze({skipWelcome:t=!1,onComplete:o,onCancel:s}){const[a,n]=i.useState(t?"connector":"welcome"),[r,u]=i.useState({email:"",displayName:"",imapConfig:te,smtpConfig:se,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),h=i.useCallback(()=>n("connector"),[]),c=i.useCallback(()=>n("address"),[]),v=i.useCallback(()=>n("microsoft-email"),[]),j=i.useCallback(()=>{t?s?.():n("welcome")},[t,s]),S=i.useCallback((l,p,m)=>{let N=te,b=se,k=!1;m&&(k=m.source!=="heuristic",N={host:m.imap.host,port:m.imap.port,security:m.imap.security},b={host:m.smtp.host,port:m.smtp.port,security:m.smtp.security}),u(T=>({...T,email:l,displayName:p,imapConfig:N,smtpConfig:b,discoveryResult:m,discovered:k,username:l})),n("servers")},[]),y=i.useCallback((l,p)=>{u(m=>({...m,imapConfig:l,smtpConfig:p}))},[]),w=i.useCallback((l,p)=>{u(m=>({...m,username:l,password:p}))},[]),x=i.useCallback(()=>n("sync"),[]),f=i.useCallback(l=>{o(l)},[o]);switch(a){case"welcome":return e.jsx($e,{onStart:h});case"connector":return e.jsx(De,{onContinue:c,onMicrosoft:v,onBack:j,showBack:!t});case"microsoft-email":return e.jsx(qe,{onBack:()=>n("connector"),onConnected:f});case"address":return e.jsx(Ge,{initialEmail:r.email,initialDisplayName:r.displayName,onContinue:S,onBack:()=>n("connector")});case"servers":return e.jsx(Be,{email:r.email,imapConfig:r.imapConfig,smtpConfig:r.smtpConfig,discovered:r.discovered,onContinue:()=>n("credentials"),onBack:()=>n("address"),onChange:y});case"credentials":return e.jsx(Ue,{email:r.email,username:r.username,password:r.password,onContinue:()=>n("test"),onBack:()=>n("servers"),onChange:w});case"test":return e.jsx(We,{email:r.email,imapConfig:r.imapConfig,smtpConfig:r.smtpConfig,username:r.username,password:r.password,onSuccess:x,onBackToCredentials:()=>n("credentials"),onBackToServers:()=>n("servers")});case"sync":return e.jsx(Qe,{email:r.email,displayName:r.displayName,imapConfig:r.imapConfig,smtpConfig:r.smtpConfig,username:r.username,password:r.password,onGoToInbox:f})}}export{Ze as O,ce as P,ee as g,G as s,Ie as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a3 as g,e as w,af as C,j as s,b,cc as H,T as U,f as k,m as K,s as W,t as G,l as J,r as m,u as S,cT as R,cf as V,n as X,a5 as Y,b8 as Z,a7 as v,a8 as y,c8 as ee,b9 as se}from"./index-B61k9RLS.js";import{u as te,p as ne,R as j,e as ae}from"./useSearchTokenContext-CKiYWkSJ.js";import{C as T}from"./circle-check-big-CL1-ZB_O.js";import{C as A}from"./clock-C0yW1eee.js";import{R as oe}from"./row-actions-CujtZtFp.js";import{R as re}from"./rotate-ccw-JyEVADG2.js";import{N as E}from"./NavMenuButton-C70EOG64.js";import{a as p,t as ie}from"./format-D7umvejg.js";import{i as le,s as I}from"./outbox-status-BlKn6P0x.js";import{n as ce}from"./search-query-Cr_ZXBCp.js";import{o as de,n as ue}from"./useMessageBodyContent-B-Ao8GWA.js";const xe={queued:{icon:A,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2",spin:!0},sent:{icon:T,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}};function M({status:e,iconOnly:n,className:a}){const t=xe[e],o=t.icon;return s.jsxs("span",{className:b("inline-flex items-center gap-1.5 text-xs font-medium",t.className,a),children:[s.jsx(o,{className:b("size-4",t.spin&&"animate-spin")}),!n&&t.label]})}const me=(e,n)=>n?"bg-accent-2-soft":e==="failed"?"bg-danger-soft":e==="blocked"||e==="unfiled"?"bg-warning/10":"";function fe({recipients:e,subject:n,time:a,status:t,error:o,selected:l,onSelect:c,onRetry:r,retrying:d,onEdit:i,onDelete:f,deleting:u}){const h=t==="failed"||t==="blocked"||t==="unfiled";return s.jsxs("div",{className:b("flex items-start gap-3 border-b border-line px-4 py-3 transition-colors hover:bg-surface-raised",me(t,l)),children:[s.jsxs("button",{type:"button",...H,onClick:c,className:"flex flex-1 min-w-0 items-start gap-3 text-left",children:[s.jsx("div",{className:"mt-0.5 shrink-0",children:s.jsx(M,{status:t,iconOnly:!0})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"truncate text-sm font-medium",children:e}),s.jsx("span",{className:"shrink-0 text-xs text-fg-muted",children:a})]}),s.jsx("div",{className:"truncate text-sm",children:n||"No subject"}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s.jsx(M,{status:t}),o&&s.jsxs("span",{className:"truncate text-xs text-fg-muted",children:["— ",o]})]})]})]}),h&&s.jsx("div",{className:"shrink-0",children:s.jsx(oe,{actions:[...t==="failed"&&r?[{label:"Retry sending",iconOnly:!0,icon:s.jsx(re,{className:"size-3.5"}),busy:d,onClick:r}]:[],...t==="unfiled"?[]:[{label:"Edit as draft",iconOnly:!0,icon:s.jsx(k,{className:"size-3.5"}),onClick:i}]],destructive:{label:"Delete message",iconOnly:!0,icon:s.jsx(U,{className:"size-3.5"}),busy:u,confirm:{prompt:"Delete this message?",confirmLabel:"Delete"},onClick:f}})})]})}function he(e,n){const a=n.trim().toLowerCase();if(a.length===0)return!0;const t=[e.subject,e.fromAddress,e.fromName,...e.toAddresses??[],...e.ccAddresses??[]].filter(o=>typeof o=="string").join(" ").toLowerCase();return a.split(/\s+/).every(o=>o.length===0||t.includes(o))}function be(e){return e.tokens.length>0&&e.freeText.trim().length===0}const L={queued:{icon:A,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2"},sent:{icon:T,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}},ge=e=>ie(e).toDateString()===new Date().toDateString()?p(e,{hour:"numeric",minute:"2-digit"}):p(e,{month:"short",day:"numeric"}),O=e=>p(e,{dateStyle:"medium",timeStyle:"short"}),pe=e=>{const n=e.toAddresses??[];return n.length===0?"No recipients":n.length===1?n[0]:`${n[0]} +${n.length-1}`},D=(e,n)=>n?"The outbox cannot filter on those terms":e?"No matching outbox messages":"No outbox messages",Q=m.createContext(null);function N(){const e=m.useContext(Q);if(!e)throw new Error("OutboxPane.* must be used inside <OutboxPane>");return e}function je({outboxMessageId:e,children:n}){const a=K(),t=de(),{data:o,isLoading:l}=W(G()),{searchQuery:c}=J(),r=te(),d=ce(c),i=ne(d,r),f=d.length>0,u=be(i),h=m.useMemo(()=>u?[]:(o?.items??[]).filter(x=>le(x.status)).filter(x=>he(x,i.freeText)),[o,i.freeText,u]),z=m.useMemo(()=>h.find(x=>x.outboxMessageId===e),[h,e]),F=m.useCallback(x=>{a({to:"/mail/outbox/draft/$outboxMessageId",params:{outboxMessageId:x},search:q=>q,hash:t})},[a,t]),$=m.useCallback(()=>{a({to:"/mail/outbox",search:x=>x,hash:t})},[a,t]),_={messages:h,hasQuery:f,unsupportedQuery:u,isLoading:l,selectedMessageId:e,selectedMessage:z,onOpenMessage:F,onCloseMessage:$};return s.jsx(Q.Provider,{value:_,children:n})}function P({message:e,isSelected:n,onSelect:a}){const t=X(),o=ue(),{pushError:l}=Y(),c=m.useCallback(()=>{t.invalidateQueries({queryKey:Z()})},[t]),r=v({...ee(),onSuccess:c,onError:u=>{l(y("Couldn't resend message","The message wasn't sent.",u))}}),d=v({...se(),onSuccess:c,onError:u=>{l(y("Couldn't delete message","The message wasn't deleted.",u))}}),i=e.status;if(!L[i])return null;const f=I(e.status);return s.jsx(fe,{recipients:pe(e),subject:e.subject||"",time:ge(e.sentAt??e.updatedAt),status:i,error:f?e.lastError??void 0:void 0,selected:n,onSelect:a,onRetry:i==="failed"?()=>r.mutate({path:{outboxMessageId:e.outboxMessageId}}):void 0,retrying:r.isPending,onEdit:()=>o(e.outboxMessageId),onDelete:()=>d.mutate({path:{outboxMessageId:e.outboxMessageId}}),deleting:d.isPending})}function B({message:e,onBack:n}){const a=e.status,t=L[a],o=t?.icon??k,l=e.sentAt?O(e.sentAt):O(e.updatedAt);return s.jsxs("div",{className:"h-full overflow-y-auto bg-canvas",children:[s.jsxs("div",{className:"border-b border-line p-4",children:[n&&s.jsxs("button",{type:"button",onClick:n,className:"mb-3 inline-flex items-center gap-1 text-sm text-fg-muted hover:text-fg",children:[s.jsx(V,{className:"size-4"}),s.jsx("span",{children:"Back"})]}),s.jsx("h1",{className:"text-xl font-semibold mb-3",children:e.subject||"(No subject)"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"From:"}),s.jsx("span",{className:"text-fg",children:e.fromName?`${e.fromName} <${e.fromAddress}>`:e.fromAddress})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"To:"}),s.jsx("span",{className:"text-fg",children:(e.toAddresses??[]).join(", ")})]}),e.ccAddresses&&e.ccAddresses.length>0&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Cc:"}),s.jsx("span",{className:"text-fg",children:e.ccAddresses.join(", ")})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Date:"}),s.jsx("span",{className:"text-fg",children:l})]}),t&&s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(o,{className:b("size-4",t.className,a==="sending"&&"animate-spin")}),s.jsx("span",{className:b("text-xs font-medium",t.className),children:t.label}),I(e.status)&&e.lastError&&s.jsxs("span",{className:"text-xs text-fg-muted",children:["— ",e.lastError]})]})]})]}),s.jsx("div",{className:"p-4",children:s.jsx(ae,{html:e.htmlBody,text:e.textBody})})]})}function Ne(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,onOpenMessage:l}=N(),c=m.useRef(null);return S({containerRef:c,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:D(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(E,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:e.map(r=>s.jsx(P,{message:r,isSelected:o===r.outboxMessageId,onSelect:()=>l(r.outboxMessageId)},r.outboxMessageId))})]})}function ve(){const{selectedMessage:e}=N();return s.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[s.jsx("header",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-3"}),s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?s.jsx(B,{message:e}):s.jsx(j,{message:"Select a message to read",showHints:!1})})]})}function ye(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,selectedMessage:l,onOpenMessage:c,onCloseMessage:r}=N(),d=m.useRef(null);return S({containerRef:d,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):l?s.jsx(B,{message:l,onBack:r}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:D(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(E,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:d,className:"flex-1 overflow-y-auto",children:e.map(i=>s.jsx(P,{message:i,isSelected:o===i.outboxMessageId,onSelect:()=>c(i.outboxMessageId)},i.outboxMessageId))})]})}const Le=Object.assign(je,{List:Ne,Reading:ve,Phone:ye});export{Le as O};
|
|
1
|
+
import{a3 as g,e as w,af as k,j as s,b,cp as H,T as U,f as C,m as K,s as W,t as G,l as J,r as m,u as S,d9 as R,cs as V,n as X,a5 as Y,bk as Z,a7 as v,a8 as y,cl as ee,bl as se}from"./index-CP_u7qA0.js";import{u as te,p as ne,R as j,e as ae}from"./useSearchTokenContext-Rec5qr0P.js";import{C as A}from"./circle-check-big-BLaZbuG9.js";import{C as T}from"./clock-Cyo25YTD.js";import{R as oe}from"./row-actions-P90tXTrG.js";import{R as re}from"./rotate-ccw-D3n8wodI.js";import{N as E}from"./NavMenuButton-DcnV6Hj5.js";import{a as p,t as ie}from"./format-DlutEuGc.js";import{i as le,s as I}from"./outbox-status-BlKn6P0x.js";import{n as ce}from"./search-query-Cr_ZXBCp.js";import{o as de,n as ue}from"./useMessageBodyContent-gWn_VAyS.js";const xe={queued:{icon:T,label:"Queued",className:"text-warning"},sending:{icon:k,label:"Sending…",className:"text-accent-2",spin:!0},sent:{icon:A,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}};function M({status:e,iconOnly:n,className:a}){const t=xe[e],o=t.icon;return s.jsxs("span",{className:b("inline-flex items-center gap-1.5 text-xs font-medium",t.className,a),children:[s.jsx(o,{className:b("size-4",t.spin&&"animate-spin")}),!n&&t.label]})}const me=(e,n)=>n?"bg-accent-2-soft":e==="failed"?"bg-danger-soft":e==="blocked"||e==="unfiled"?"bg-warning/10":"";function fe({recipients:e,subject:n,time:a,status:t,error:o,selected:l,onSelect:c,onRetry:r,retrying:d,onEdit:i,onDelete:f,deleting:u}){const h=t==="failed"||t==="blocked"||t==="unfiled";return s.jsxs("div",{className:b("flex items-start gap-3 border-b border-line px-4 py-3 transition-colors hover:bg-surface-raised",me(t,l)),children:[s.jsxs("button",{type:"button",...H,onClick:c,className:"flex flex-1 min-w-0 items-start gap-3 text-left",children:[s.jsx("div",{className:"mt-0.5 shrink-0",children:s.jsx(M,{status:t,iconOnly:!0})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"truncate text-sm font-medium",children:e}),s.jsx("span",{className:"shrink-0 text-xs text-fg-muted",children:a})]}),s.jsx("div",{className:"truncate text-sm",children:n||"No subject"}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s.jsx(M,{status:t}),o&&s.jsxs("span",{className:"truncate text-xs text-fg-muted",children:["— ",o]})]})]})]}),h&&s.jsx("div",{className:"shrink-0",children:s.jsx(oe,{actions:[...t==="failed"&&r?[{label:"Retry sending",iconOnly:!0,icon:s.jsx(re,{className:"size-3.5"}),busy:d,onClick:r}]:[],...t==="unfiled"?[]:[{label:"Edit as draft",iconOnly:!0,icon:s.jsx(C,{className:"size-3.5"}),onClick:i}]],destructive:{label:"Delete message",iconOnly:!0,icon:s.jsx(U,{className:"size-3.5"}),busy:u,confirm:{prompt:"Delete this message?",confirmLabel:"Delete"},onClick:f}})})]})}function he(e,n){const a=n.trim().toLowerCase();if(a.length===0)return!0;const t=[e.subject,e.fromAddress,e.fromName,...e.toAddresses??[],...e.ccAddresses??[]].filter(o=>typeof o=="string").join(" ").toLowerCase();return a.split(/\s+/).every(o=>o.length===0||t.includes(o))}function be(e){return e.tokens.length>0&&e.freeText.trim().length===0}const L={queued:{icon:T,label:"Queued",className:"text-warning"},sending:{icon:k,label:"Sending…",className:"text-accent-2"},sent:{icon:A,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}},ge=e=>ie(e).toDateString()===new Date().toDateString()?p(e,{hour:"numeric",minute:"2-digit"}):p(e,{month:"short",day:"numeric"}),O=e=>p(e,{dateStyle:"medium",timeStyle:"short"}),pe=e=>{const n=e.toAddresses??[];return n.length===0?"No recipients":n.length===1?n[0]:`${n[0]} +${n.length-1}`},D=(e,n)=>n?"The outbox cannot filter on those terms":e?"No matching outbox messages":"No outbox messages",Q=m.createContext(null);function N(){const e=m.useContext(Q);if(!e)throw new Error("OutboxPane.* must be used inside <OutboxPane>");return e}function je({outboxMessageId:e,children:n}){const a=K(),t=de(),{data:o,isLoading:l}=W(G()),{searchQuery:c}=J(),r=te(),d=ce(c),i=ne(d,r),f=d.length>0,u=be(i),h=m.useMemo(()=>u?[]:(o?.items??[]).filter(x=>le(x.status)).filter(x=>he(x,i.freeText)),[o,i.freeText,u]),z=m.useMemo(()=>h.find(x=>x.outboxMessageId===e),[h,e]),F=m.useCallback(x=>{a({to:"/mail/outbox/draft/$outboxMessageId",params:{outboxMessageId:x},search:q=>q,hash:t})},[a,t]),$=m.useCallback(()=>{a({to:"/mail/outbox",search:x=>x,hash:t})},[a,t]),_={messages:h,hasQuery:f,unsupportedQuery:u,isLoading:l,selectedMessageId:e,selectedMessage:z,onOpenMessage:F,onCloseMessage:$};return s.jsx(Q.Provider,{value:_,children:n})}function P({message:e,isSelected:n,onSelect:a}){const t=X(),o=ue(),{pushError:l}=Y(),c=m.useCallback(()=>{t.invalidateQueries({queryKey:Z()})},[t]),r=v({...ee(),onSuccess:c,onError:u=>{l(y("Couldn't resend message","The message wasn't sent.",u))}}),d=v({...se(),onSuccess:c,onError:u=>{l(y("Couldn't delete message","The message wasn't deleted.",u))}}),i=e.status;if(!L[i])return null;const f=I(e.status);return s.jsx(fe,{recipients:pe(e),subject:e.subject||"",time:ge(e.sentAt??e.updatedAt),status:i,error:f?e.lastError??void 0:void 0,selected:n,onSelect:a,onRetry:i==="failed"?()=>r.mutate({path:{outboxMessageId:e.outboxMessageId}}):void 0,retrying:r.isPending,onEdit:()=>o(e.outboxMessageId),onDelete:()=>d.mutate({path:{outboxMessageId:e.outboxMessageId}}),deleting:d.isPending})}function B({message:e,onBack:n}){const a=e.status,t=L[a],o=t?.icon??C,l=e.sentAt?O(e.sentAt):O(e.updatedAt);return s.jsxs("div",{className:"h-full overflow-y-auto bg-canvas",children:[s.jsxs("div",{className:"border-b border-line p-4",children:[n&&s.jsxs("button",{type:"button",onClick:n,className:"mb-3 inline-flex items-center gap-1 text-sm text-fg-muted hover:text-fg",children:[s.jsx(V,{className:"size-4"}),s.jsx("span",{children:"Back"})]}),s.jsx("h1",{className:"text-xl font-semibold mb-3",children:e.subject||"(No subject)"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"From:"}),s.jsx("span",{className:"text-fg",children:e.fromName?`${e.fromName} <${e.fromAddress}>`:e.fromAddress})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"To:"}),s.jsx("span",{className:"text-fg",children:(e.toAddresses??[]).join(", ")})]}),e.ccAddresses&&e.ccAddresses.length>0&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Cc:"}),s.jsx("span",{className:"text-fg",children:e.ccAddresses.join(", ")})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Date:"}),s.jsx("span",{className:"text-fg",children:l})]}),t&&s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(o,{className:b("size-4",t.className,a==="sending"&&"animate-spin")}),s.jsx("span",{className:b("text-xs font-medium",t.className),children:t.label}),I(e.status)&&e.lastError&&s.jsxs("span",{className:"text-xs text-fg-muted",children:["— ",e.lastError]})]})]})]}),s.jsx("div",{className:"p-4",children:s.jsx(ae,{html:e.htmlBody,text:e.textBody})})]})}function Ne(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,onOpenMessage:l}=N(),c=m.useRef(null);return S({containerRef:c,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:D(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(E,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:e.map(r=>s.jsx(P,{message:r,isSelected:o===r.outboxMessageId,onSelect:()=>l(r.outboxMessageId)},r.outboxMessageId))})]})}function ve(){const{selectedMessage:e}=N();return s.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[s.jsx("header",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-3"}),s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?s.jsx(B,{message:e}):s.jsx(j,{message:"Select a message to read",showHints:!1})})]})}function ye(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,selectedMessage:l,onOpenMessage:c,onCloseMessage:r}=N(),d=m.useRef(null);return S({containerRef:d,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):l?s.jsx(B,{message:l,onBack:r}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:D(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(E,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:d,className:"flex-1 overflow-y-auto",children:e.map(i=>s.jsx(P,{message:i,isSelected:o===i.outboxMessageId,onSelect:()=>c(i.outboxMessageId)},i.outboxMessageId))})]})}const Le=Object.assign(je,{List:Ne,Reading:ve,Phone:ye});export{Le as O};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Y as m,j as o,U as p}from"./index-CP_u7qA0.js";import{a}from"./search-view-CNPgAIwM.js";import{M as r}from"./MailboxPane-U1SkJ4BI.js";import{u as e}from"./useSearchMirror-DjVzjTGW.js";import"./useMessageBodyContent-gWn_VAyS.js";import{f as s}from"./search-token-index-CG7hPaco.js";import"./FullCompose-CTpFjCtM.js";import"./ErrorState-C4QR2OHT.js";import"./index-EM4Uoip4.js";import"./useSignature-DQ37CqeJ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-0nS8-8zw.js";import"./useMediaQuery-kszmEDQl.js";import"./confirm-dialog-CQSTQRV2.js";import"./useSearchTokenContext-Rec5qr0P.js";import"./kbd-BaSoxAuP.js";import"./search-scope-BQ8HHXSV.js";import"./useRefreshControl-CEi6jGL4.js";import"./circle-check-big-BLaZbuG9.js";import"./MailListHeader-D9UyUWpO.js";import"./attachment-file-Bjm6lsCc.js";import"./mail-gESMSqqx.js";import"./avatar-DV1csnvT.js";import"./format-DlutEuGc.js";import"./download-KdO2vtfS.js";import"./shield-check-CVmTR1hh.js";import"./useFilters-CCgvHNzK.js";import"./clock-Cyo25YTD.js";import"./menu-xsfahEJ7.js";import"./MailViewChrome-BZcvy1C_.js";import"./NavMenuButton-DcnV6Hj5.js";import"./useLabels-Bxa6Xpyj.js";import"./useSemanticSearch-CAmlG47i.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-BBgLAlb7.js";import"./circle-help-BJd9ea_a.js";import"./circle-check-CccsDKfb.js";function K(){const{mailboxId:t}=m.useParams(),i=s();return e({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{K as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-CP_u7qA0.js";import{B as o}from"./BriefPane-R4rcTAO3.js";import"./useSearchTokenContext-Rec5qr0P.js";import"./kbd-BaSoxAuP.js";import"./useMessageBodyContent-gWn_VAyS.js";import"./useMediaQuery-kszmEDQl.js";import"./search-scope-BQ8HHXSV.js";import"./MailListHeader-D9UyUWpO.js";import"./search-token-index-CG7hPaco.js";import"./attachment-file-Bjm6lsCc.js";import"./mail-gESMSqqx.js";import"./avatar-DV1csnvT.js";import"./index-EM4Uoip4.js";import"./useSignature-DQ37CqeJ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-0nS8-8zw.js";import"./ErrorState-C4QR2OHT.js";import"./format-DlutEuGc.js";import"./download-KdO2vtfS.js";import"./shield-check-CVmTR1hh.js";import"./useFilters-CCgvHNzK.js";import"./confirm-dialog-CQSTQRV2.js";import"./clock-Cyo25YTD.js";import"./menu-xsfahEJ7.js";import"./useRefreshControl-CEi6jGL4.js";import"./circle-check-big-BLaZbuG9.js";import"./useLabels-Bxa6Xpyj.js";import"./useSemanticSearch-CAmlG47i.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function C(){return r.jsx(o.Reading,{})}export{C as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-CP_u7qA0.js";import{M as r}from"./MailboxPane-U1SkJ4BI.js";import"./useSearchTokenContext-Rec5qr0P.js";import"./kbd-BaSoxAuP.js";import"./useMessageBodyContent-gWn_VAyS.js";import"./useMediaQuery-kszmEDQl.js";import"./search-scope-BQ8HHXSV.js";import"./useRefreshControl-CEi6jGL4.js";import"./circle-check-big-BLaZbuG9.js";import"./search-token-index-CG7hPaco.js";import"./MailListHeader-D9UyUWpO.js";import"./attachment-file-Bjm6lsCc.js";import"./mail-gESMSqqx.js";import"./avatar-DV1csnvT.js";import"./index-EM4Uoip4.js";import"./useSignature-DQ37CqeJ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-0nS8-8zw.js";import"./ErrorState-C4QR2OHT.js";import"./format-DlutEuGc.js";import"./download-KdO2vtfS.js";import"./shield-check-CVmTR1hh.js";import"./useFilters-CCgvHNzK.js";import"./confirm-dialog-CQSTQRV2.js";import"./clock-Cyo25YTD.js";import"./menu-xsfahEJ7.js";import"./MailViewChrome-BZcvy1C_.js";import"./NavMenuButton-DcnV6Hj5.js";import"./useLabels-Bxa6Xpyj.js";import"./useSemanticSearch-CAmlG47i.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-BBgLAlb7.js";import"./circle-help-BJd9ea_a.js";import"./circle-check-CccsDKfb.js";function H(){return o.jsx(r.Reading,{})}export{H as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-CP_u7qA0.js";import{F as r}from"./FlaggedPane-CzQn701M.js";import"./useSearchTokenContext-Rec5qr0P.js";import"./kbd-BaSoxAuP.js";import"./useMessageBodyContent-gWn_VAyS.js";import"./useMediaQuery-kszmEDQl.js";import"./search-scope-BQ8HHXSV.js";import"./MailListHeader-D9UyUWpO.js";import"./search-token-index-CG7hPaco.js";import"./attachment-file-Bjm6lsCc.js";import"./mail-gESMSqqx.js";import"./avatar-DV1csnvT.js";import"./index-EM4Uoip4.js";import"./useSignature-DQ37CqeJ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-0nS8-8zw.js";import"./ErrorState-C4QR2OHT.js";import"./format-DlutEuGc.js";import"./download-KdO2vtfS.js";import"./shield-check-CVmTR1hh.js";import"./useFilters-CCgvHNzK.js";import"./confirm-dialog-CQSTQRV2.js";import"./clock-Cyo25YTD.js";import"./menu-xsfahEJ7.js";import"./MailViewChrome-BZcvy1C_.js";import"./wizard-selection-B1bng5Jq.js";function w(){return o.jsx(r.Reading,{})}export{w as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-CP_u7qA0.js";import{O as t}from"./OutboxPane-NAu0D-vN.js";import"./useSearchTokenContext-Rec5qr0P.js";import"./kbd-BaSoxAuP.js";import"./useMessageBodyContent-gWn_VAyS.js";import"./useMediaQuery-kszmEDQl.js";import"./search-scope-BQ8HHXSV.js";import"./circle-check-big-BLaZbuG9.js";import"./clock-Cyo25YTD.js";import"./row-actions-P90tXTrG.js";import"./rotate-ccw-D3n8wodI.js";import"./NavMenuButton-DcnV6Hj5.js";import"./menu-xsfahEJ7.js";import"./format-DlutEuGc.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function R(){return o.jsx(t.Reading,{})}export{R as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as o}from"./index-CP_u7qA0.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as o}from"./index-CP_u7qA0.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as o}from"./index-CP_u7qA0.js";const n=o;export{n as component};
|