@remit/web-client-dist 0.0.427 → 0.0.429
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-ChEbSMGP.js → BriefPane-D4GKn4Vw.js} +1 -1
- package/assets/{ErrorState-Ws9Z0fI_.js → ErrorState-CNHmvGYF.js} +1 -1
- package/assets/{FlaggedPane-DZ9jLP-d.js → FlaggedPane-CIICNSCS.js} +1 -1
- package/assets/{FullCompose-Dc4-If6R.js → FullCompose-B0bbns1M.js} +1 -1
- package/assets/{MailListHeader-B9vO8fqH.js → MailListHeader-BcdPneAy.js} +1 -1
- package/assets/{MailViewChrome-C7Id56Ny.js → MailViewChrome-CZb8kPr_.js} +1 -1
- package/assets/{MailboxPane-Bu0_IYWM.js → MailboxPane-MXdO0Vz2.js} +1 -1
- package/assets/{NavMenuButton-BcqODuEd.js → NavMenuButton-BIPTnOry.js} +1 -1
- package/assets/{OnboardingWizard-tY8vpnCv.js → OnboardingWizard-yfi2kykm.js} +1 -1
- package/assets/{OutboxPane-Cd4tJpl0.js → OutboxPane-mFkq2dEJ.js} +1 -1
- package/assets/_mailboxId--xq6K8vG.js +1 -0
- package/assets/_messageId-CTALYmhq.js +1 -0
- package/assets/_messageId-CmMd3Ukp.js +1 -0
- package/assets/_messageId-CtxjpTtR.js +1 -0
- package/assets/_outboxMessageId-VPhQOPhK.js +1 -0
- package/assets/_threadId-1kFdcas1.js +1 -0
- package/assets/_threadId-7ZWe-9US.js +1 -0
- package/assets/_threadId-DNmSvZSP.js +1 -0
- package/assets/{accounts-DlTUrH3V.js → accounts--GnFjtNP.js} +1 -1
- package/assets/{advanced-Dw-wsK5U.js → advanced-DKEc5X7D.js} +1 -1
- package/assets/{appearance-BUoaNx3t.js → appearance-Bn-KJ5jL.js} +1 -1
- package/assets/{attachment-file-D2wuknKq.js → attachment-file-BrXH3M3V.js} +1 -1
- package/assets/{avatar-CvCVi3F9.js → avatar-DtND0ruk.js} +1 -1
- package/assets/{bottom-sheet-Bof5NPqf.js → bottom-sheet-Cpg512Z8.js} +1 -1
- package/assets/{brief-CZOGgeVH.js → brief-CP_gyoWx.js} +1 -1
- package/assets/brief-DWBpwjTi.js +1 -0
- package/assets/{browser-ponyfill-Dvm9tXLa.js → browser-ponyfill-BQQucyWN.js} +1 -1
- package/assets/{bug-BHLCg0Ji.js → bug-D-5qIgn1.js} +1 -1
- package/assets/{circle-check-BOHoppHs.js → circle-check-CyTXHuU4.js} +1 -1
- package/assets/{circle-check-big-BKpjINgN.js → circle-check-big-BCgBHZQm.js} +1 -1
- package/assets/{circle-help-Cw9vIhaj.js → circle-help-lK4oidSt.js} +1 -1
- package/assets/{clock-eaUrEZh3.js → clock-CpWsGek7.js} +1 -1
- package/assets/compose._-_outboxMessageId_-Bh6SV1dn.js +1 -0
- package/assets/compose._-_outboxMessageId_-CYWE1jEd.js +1 -0
- package/assets/compose._-_outboxMessageId_-Cn0WCeO7.js +1 -0
- package/assets/compose._-_outboxMessageId_-SUbFIkQY.js +1 -0
- package/assets/{confirm-dialog-007Povhq.js → confirm-dialog-CSNgGV-I.js} +1 -1
- package/assets/{download-L7TAGjcT.js → download-Yg8MAJuV.js} +1 -1
- package/assets/{filters-BSAjH538.js → filters-BYXepTJ3.js} +1 -1
- package/assets/{flagged-Dpa1oNld.js → flagged-CPZoSWDR.js} +1 -1
- package/assets/flagged-CtM4krn0.js +1 -0
- package/assets/{folders-Ch9mngfY.js → folders-BMWrmSe-.js} +1 -1
- package/assets/{help-copy-CHMOAa54.js → help-copy-o2bu5jXr.js} +1 -1
- package/assets/index-BaVdEvyR.js +1 -0
- package/assets/index-BgNbixl6.js +1 -0
- package/assets/index-C015CYKF.js +1 -0
- package/assets/index-Cf-KjbzP.js +1 -0
- package/assets/index-CmMd3Ukp.js +1 -0
- package/assets/index-CtxjpTtR.js +1 -0
- package/assets/{index-BQTgnFU2.js → index-D_YBuI3z.js} +59 -59
- package/assets/{index-C4YPHP48.js → index-DwTAdS0U.js} +3 -3
- package/assets/index-TQGaXC_d.js +1 -0
- package/assets/index-zMBRTYBv.js +1 -0
- package/assets/{kbd-6Q4PA1CK.js → kbd-BUm8HPo9.js} +1 -1
- package/assets/{labels-C2OiNUkg.js → labels-DriP01Rs.js} +1 -1
- package/assets/{mail-CVppWr2e.js → mail-Byqd_siN.js} +1 -1
- package/assets/{mail-3ysdr_UV.js → mail-yZgIYq66.js} +1 -1
- package/assets/{menu-BPCaZ391.js → menu-B4mmeG34.js} +1 -1
- package/assets/{onboarding-CSic18s9.js → onboarding-BbbW2CcQ.js} +1 -1
- package/assets/outbox-B7YGZwez.js +1 -0
- package/assets/{pencil-CGRYJ2HA.js → pencil-rdzjE11g.js} +1 -1
- package/assets/{rich-text-CTCzqAZV.js → rich-text-BKM0xPkp.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-BDAX6zj1.js → rich-text-spellcheck-worker-provider-Dg635-7T.js} +1 -1
- package/assets/{rotate-ccw-Ctsa6iVn.js → rotate-ccw-5k3dg52M.js} +1 -1
- package/assets/{row-actions-DQugjqmq.js → row-actions-BGPkkIDv.js} +1 -1
- package/assets/{search-scope-CVzGDF_4.js → search-scope-MtY0zpRq.js} +1 -1
- package/assets/{search-token-index-C_566xlt.js → search-token-index-nAK4hI7B.js} +1 -1
- package/assets/{search-view-D_ZqPNzH.js → search-view-CtInfT0I.js} +1 -1
- package/assets/{senders-BgE6PkRz.js → senders-CRCPlNSI.js} +1 -1
- package/assets/{settings-screen-BQniXREi.js → settings-screen-D53GKsd_.js} +1 -1
- package/assets/settings-zuLLX00L.js +1 -0
- package/assets/{shield-check-CkZ3bUEI.js → shield-check-BZ36Y5z_.js} +1 -1
- package/assets/{suggested-vips-rnLJj6Mu.js → suggested-vips-BZprt8nM.js} +1 -1
- package/assets/{useDebouncedValue-TwIik-Bi.js → useDebouncedValue-4E-721vu.js} +1 -1
- package/assets/{useFilters-Vl02Feaa.js → useFilters-BdPFYyLi.js} +1 -1
- package/assets/{useLabels-Bl4H_oW2.js → useLabels-CwcqSC09.js} +1 -1
- package/assets/{useMediaQuery-D1S3QsF0.js → useMediaQuery-CDMcFeIb.js} +1 -1
- package/assets/{useMessageBodyContent-PBQCTZnz.js → useMessageBodyContent-DEOYO0s3.js} +1 -1
- package/assets/{useRefreshControl-CItUGjsW.js → useRefreshControl-h1VyXjLX.js} +1 -1
- package/assets/{useSearchMirror-Bc0QfWX3.js → useSearchMirror-rswuH5l3.js} +1 -1
- package/assets/{useSearchTokenContext-C-H1Y09b.js → useSearchTokenContext-DROeO7xw.js} +1 -1
- package/assets/{useSemanticSearch-CDYV0k01.js → useSemanticSearch-RnkqtV8e.js} +1 -1
- package/assets/{useSignature-BVhhHKWK.js → useSignature-C3CmLf8D.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/_mailboxId-dU4H0AN9.js +0 -1
- package/assets/_messageId-CTgEnmtM.js +0 -1
- package/assets/_messageId-DCJbqxEk.js +0 -1
- package/assets/_messageId-DUX30A6Y.js +0 -1
- package/assets/_outboxMessageId-CiHhV-Yj.js +0 -1
- package/assets/_threadId-1NzAK4iY.js +0 -1
- package/assets/_threadId-DqXza0Du.js +0 -1
- package/assets/_threadId-R_V3bAlO.js +0 -1
- package/assets/brief-DGAOeQdW.js +0 -1
- package/assets/compose._-_outboxMessageId_-BJFtKEIo.js +0 -1
- package/assets/compose._-_outboxMessageId_-ByHrB5wW.js +0 -1
- package/assets/compose._-_outboxMessageId_-DBrWN_mQ.js +0 -1
- package/assets/compose._-_outboxMessageId_-Xvop5g6F.js +0 -1
- package/assets/flagged-B6CZYSBK.js +0 -1
- package/assets/index-B9Y4Ktcc.js +0 -1
- package/assets/index-BsdV-1tl.js +0 -1
- package/assets/index-BtL0yPFO.js +0 -1
- package/assets/index-CTgEnmtM.js +0 -1
- package/assets/index-CbNeZplB.js +0 -1
- package/assets/index-CzrP7CHx.js +0 -1
- package/assets/index-DUX30A6Y.js +0 -1
- package/assets/index-Dbp1yAxw.js +0 -1
- package/assets/outbox-BtflsbYT.js +0 -1
- package/assets/settings-VG4DU0In.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,af as Ze,S as Xe,bB as et,l as Y,bq as tt,m as oe,r as o,s as ae,bC as ne,q as st,bD as at,bE as nt,bF as ot,e as Re,bG as rt}from"./index-BQTgnFU2.js";import{s as Te,a as it,b as we,u as lt,p as ct,R as dt}from"./useSearchTokenContext-C-H1Y09b.js";import{aa as ve,H as ye,ab as ut,ac as mt,I as ft,ad as Se,ae as ht,af as gt,ag as xt,a9 as pt,ah as It,ai as bt,aj as vt,M as yt,ak as St,al as Ct,am as jt,e as Rt,v as Tt,an as wt,q as Mt,S as kt,L as Ft,Q as Ce,P as At,N as Nt,d as Ot,_ as Bt,$ as Dt,a1 as Me,a2 as ke,a3 as Lt,a4 as Et,a5 as Pt}from"./MailListHeader-B9vO8fqH.js";import{u as qt,a as zt,R as Qt,i as Ht,b as _t}from"./useRefreshControl-CItUGjsW.js";import{e as $t,c as Wt,R as Gt}from"./search-token-index-C_566xlt.js";import{a as Ut}from"./useLabels-Bl4H_oW2.js";import{u as Vt}from"./useMediaQuery-D1S3QsF0.js";import{u as Yt,r as Jt,L as Kt}from"./useSemanticSearch-CDYV0k01.js";import{w as Zt}from"./wizard-selection-B1bng5Jq.js";import{o as Xt,f as es,h as ts,p as ss,r as as}from"./useMessageBodyContent-PBQCTZnz.js";function ns({sync:e}){return e?a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-12 text-center px-4",role:"status","aria-live":"polite",children:[a.jsx(Ze,{className:"size-8 animate-spin text-fg-subtle","aria-hidden":"true"}),a.jsx("p",{className:"text-sm font-medium text-fg",children:"Still syncing your mail"}),a.jsx("p",{className:"text-xs text-fg-subtle",children:os(e)})]}):a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-12 text-center px-4",children:[a.jsx(Xe,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),a.jsx("p",{className:"text-sm font-medium text-fg",children:"You're caught up"}),a.jsx("p",{className:"text-xs text-fg-subtle",children:"Nothing needs attention."})]})}function os({synced:e,total:t}){return t>0?`${e.toLocaleString()} of ${t.toLocaleString()} messages downloaded. This list fills in as they arrive.`:"Downloading your messages. This list fills in as they arrive."}const Fe=[{id:"unread",name:"is",value:"unread"},{id:"attachment",name:"has",value:"attachment"}],Ae="category",rs={unclassified:"uncategorized"},$=e=>it(e).map(t=>t.raw),_=e=>e.join(" "),re=e=>{const t=we(e);if(t)return Fe.find(n=>n.name===t.name&&n.value===t.value.toLowerCase())?.id},ie=e=>{const t=we(e);if(!t||t.name!==Ae)return;const n=t.value.toLowerCase(),r=rs[n];if(r)return r;if(!(!et(n)||n==="all"))return n},Ne=e=>Fe.find(t=>t.id===e),Oe=e=>Ne(e)!==void 0,is=e=>{const t=new Set;for(const n of $(e)){const r=re(n);r&&t.add(r)}return t},ls=e=>{let t="all";for(const n of $(e)){const r=ie(n);r&&(t=r)}return t},cs=(e,t)=>{const n=Ne(t);if(!n)return;const r=$(e),d=r.filter(i=>re(i)!==t);return d.length<r.length?_(d):_([...r,Te(n.name,n.value)])},ds=(e,t)=>{const n=$(e).filter(r=>!ie(r));return _(t==="all"?n:[...n,Te(Ae,t)])},us=e=>_($(e).filter(t=>!re(t)&&!ie(t))),Be=e=>e.trim().length>0,ms=e=>{if(!Be(e.query))return e.ownFilters;const t=new Set(is(e.query));for(const n of e.ownFilters)Oe(n)||t.add(n);return t},fs=e=>Be(e.query)?ls(e.query):e.ownCategory,hs=(e,t)=>e.createdAt!==t.createdAt?e.createdAt-t.createdAt:e.accountId.localeCompare(t.accountId),gs=e=>[...e].sort(hs),xs=200,je=()=>a.jsx("div",{className:"animate-pulse",children:Array.from({length:3}).map((e,t)=>a.jsxs("div",{className:"flex items-start gap-3 py-2 pl-5 pr-4 border-b border-line",children:[a.jsx("div",{className:"size-7 rounded-full bg-surface-sunken shrink-0 mt-0.5"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsxs("div",{className:"flex justify-between gap-2",children:[a.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-28"}),a.jsx("div",{className:"h-3 bg-surface-sunken rounded w-12"})]}),a.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-48"}),a.jsx("div",{className:"h-3 bg-surface-sunken rounded w-full"})]})]},t))}),ps=({accountEmail:e})=>{const t=oe();return a.jsxs("div",{className:"flex items-center gap-2 px-row-inset py-2 border-b border-line bg-danger-soft/40 text-xs text-danger",children:[a.jsx(Re,{className:"size-3.5 shrink-0"}),a.jsxs("span",{className:"flex-1 truncate",children:[e," can't connect"]}),a.jsx("button",{type:"button",onClick:()=>t({to:"/settings/accounts"}),className:"shrink-0 underline text-danger hover:opacity-80",children:"Reconnect"})]})},Is=(e,t)=>{if(t.size===0)return{};const n=e.filter(i=>t.has(i.id)),r=Jt(n.map(i=>i.accountId));if(r.restriction)return r;const d=new Set;for(const i of n)i.mailboxId&&d.add(i.mailboxId);return d.size>1?{accountId:r.accountId,restriction:"spansFolders",moveDisabledHint:`Move only works within one folder — this selection spans ${d.size} folders`}:{accountId:r.accountId,mailboxId:d.size===1?[...d][0]:void 0}};function bs({header:e,rows:t,wizard:n,children:r}){const{selectedIds:d,selectedCount:i,exitSelection:f,orderedIds:u,allSelected:h,toggleAllLoaded:y}=jt(),x=o.useMemo(()=>Is(t,d),[t,d]),{junkMailboxId:p}=Rt(x.accountId),{labels:I}=Ut(x.accountId),A=o.useMemo(()=>Array.from(d),[d]),L=o.useMemo(()=>Zt(t,d),[t,d]),m=Tt(p,x.mailboxId),b=o.useMemo(()=>u.length>0?{checked:h,indeterminate:i>0&&!h,onChange:y}:void 0,[u.length,h,i,y]),N=x.moveDisabledHint?{tone:"warning",text:x.moveDisabledHint}:void 0,S=C=>a.jsx(kt,{title:C.title,navSlot:C.navSlot,titleMeta:C.titleMeta,searchSlot:C.searchSlot,searchField:C.searchField,idleSlot:C.makeFilterSlot,count:i,onCancel:f,onDelete:()=>n.start("delete"),onMove:()=>n.start("move"),onOrganize:()=>n.start("organize"),onJunk:m?()=>n.start("junk"):void 0,onMarkRead:()=>n.start("markRead"),overflowSlot:x.accountId&&x.mailboxId&&i>0&&I.length>0?a.jsx(Kt,{accountId:x.accountId,mailboxId:x.mailboxId,messageIds:A}):void 0,selectAll:b,notice:N});return a.jsx(wt,{...e,selectionBar:S,paneOverlay:a.jsx(Mt,{verb:n.verb,accountId:x.accountId,mailboxId:x.mailboxId,selection:L,selectionRestriction:x.restriction,onFinished:f}),children:r})}function vs({accounts:e,selectedMessageId:t,onOpenThread:n,commandsRef:r,onTriageContextChange:d,onDeleteMessages:i}){const{searchQuery:f,searchInput:u,resultFolderIndex:h,onSearchChange:y}=Y(),x=lt(),p=Vt(),I=$t(),A=tt(),L=oe(),m=o.useMemo(()=>gs(e.filter(s=>!s.muted?.value)),[e]),[b,N]=o.useState("all"),[S,C]=o.useState("all"),[W,E]=o.useState(new Set),[K,j]=o.useState(!1),P=o.useCallback(s=>{E(l=>{const c=new Set(l);return c.has(s)?c.delete(s):c.add(s),c})},[]),G=o.useCallback(()=>E(new Set),[]),T=u.trim().length>0,R=o.useMemo(()=>ms({query:u,ownFilters:W}),[u,W]),w=o.useMemo(()=>fs({query:u,ownCategory:S}),[u,S]),O=o.useCallback(s=>{if(!T||!Oe(s)){P(s);return}const l=cs(u,s);l!==void 0&&y(l)},[T,u,y,P]),q=o.useCallback(s=>{if(!T){C(s);return}y(ds(u,s))},[T,u,y]),z=o.useCallback(()=>{C("all"),N("all"),G(),T&&y(us(u))},[T,u,y,G]),{data:B,isLoading:Q,isError:g,refetch:D}=ae({...ne(),staleTime:6e4}),M=Wt({queries:m.map(s=>({...st({path:{accountId:s.accountId}}),staleTime:1/0,meta:{softError:!0}}))}),U=o.useMemo(()=>{const s=new Map;for(let l=0;l<m.length;l++){const c=m[l].accountId,Ye=(M[l]?.data?.items??[]).reduce((Je,Ke)=>Je+(Ke.unseenCount??0),0);s.set(c,Ye)}return s},[m,M]),Ee=o.useMemo(()=>m.filter((s,l)=>{const c=M[l];return c?.isError?!at(c.error):!1}),[m,M]),{freeText:k,tokens:Z}=ct(f.trim().toLowerCase(),x),{data:le,isFetching:Pe}=ae({...ne({query:{query:k,limit:xs}}),enabled:k.length>0,staleTime:3e4}),v=o.useMemo(()=>{const s=ve(B?.items??[]).map(ye);return(k?ut(s.filter(c=>mt(c,k)),ve(le?.items??[]).map(ye)):s).filter(c=>(b==="all"||c.accountId===b)&&ft(c,Z))},[B,le,b,k,Z]),{bodyRows:ce,briefSpamOffer:X}=o.useMemo(()=>{if(!k)return{bodyRows:v,briefSpamOffer:void 0};const s=v.map(F=>Se(F,h)),{spam:l}=ht(s);if(l.length===0)return{bodyRows:v,briefSpamOffer:void 0};const c=new Set(l.map(F=>F.id));return{bodyRows:v.filter(F=>!c.has(F.id)),briefSpamOffer:gt(s)}},[v,k,h]),de=o.useMemo(()=>xt(ce),[ce]),ue=o.useCallback((s,l)=>{const c=v.find(F=>F.id===s)?.threadId;c&&n?.({threadId:c,messageId:s},l)},[v,n]),qe=o.useCallback(s=>{const l=s.threadId??v.find(c=>c.id===s.id)?.threadId;l&&n?.({threadId:l,messageId:s.id})},[v,n]),ee=o.useMemo(()=>m.length<=1?[]:[{id:"all",label:"All",active:b==="all"},...m.map(s=>({id:s.accountId,label:s.email.split("@")[0]??s.email,count:U.get(s.accountId),active:b===s.accountId}))],[m,U,b]),H=o.useMemo(()=>e.filter(s=>s.muted?.value).length,[e]),ze=o.useMemo(()=>Array.from(U.values()).reduce((s,l)=>s+l,0),[U]),te=o.useMemo(()=>m.map(s=>s.accountId),[m]),{hasNewMail:me}=qt(),{state:fe,errorMessage:he,refresh:ge}=zt(te,{onSettled:()=>D()}),Qe=o.useMemo(()=>a.jsx(Qt,{state:fe,onRefresh:ge,label:"Refresh daily brief",errorMessage:he,hasUpdate:me(te)}),[fe,ge,he,me,te]),se=o.useMemo(()=>v.filter(s=>(w==="all"||s.category===w)&&nt(s,R)).map(s=>Se(s,h)),[v,w,R,h]),{hits:xe,isLoading:He}=Yt(),_e=o.useMemo(()=>{const s=new Map;for(const c of B?.items??[])s.set(c.messageId,c.threadId);const l=se.map(c=>s.get(c.id)).filter(c=>c!=null);return pt(xe,l,h)},[xe,se,B,h]),$e=o.useMemo(()=>{const s=It(ee.map(l=>({id:l.id,label:l.label,count:l.count,active:l.active})));return{categories:s.categories,filters:s.filters,sources:s.sources,sourcesNote:H>0?`+${H} muted`:void 0,selectedCategory:w,activeFilters:R,expanded:K,onExpandedChange:j,onSelectCategory:l=>q(l),onSelectSource:N,onToggleFilter:l=>O(l),onClear:z}},[ee,H,w,R,K,O,q,z]),pe=de.length===0&&b==="all"&&k.length===0&&Z.length===0,We=o.useMemo(()=>m.map(s=>s.accountId),[m]),Ge=o.useMemo(()=>m.some(s=>Ht(s.syncPhase)),[m]),V=_t(We,pe||Ge),Ie=a.jsxs("div",{className:"h-full overflow-y-auto",children:[a.jsx(je,{}),a.jsx(je,{})]}),be=!Q&&!g&&!pe,Ue=bt({tier:I,hasLiveInput:T,hasCommittedQuery:f.trim().length>0,bodyRendersCommittedResults:!0}),Ve=be?a.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[X&&a.jsx(vt,{count:X.count,onScopeToSpam:()=>L({to:"/mail/$mailboxId",params:{mailboxId:X.mailboxId},search:{q:f||void 0}})}),a.jsx("div",{className:"min-h-0 flex-1",children:a.jsx(ot,{sections:de,briefCategory:w,Row:yt,selectedThreadId:t,onSelectThread:ue,onSelectBriefCategory:q,sources:ee,sourcesNote:H>0?`+${H} muted`:void 0,onSelectSource:N,activeFilters:R,onToggleFilter:O,onClearFilters:z})})]}):Q?Ie:g?a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 py-12 text-sm text-fg-muted",children:[a.jsx(Re,{className:"size-8 text-danger"}),a.jsx("p",{children:"Couldn't load your messages"}),a.jsxs("button",{type:"button",onClick:()=>D(),className:"flex items-center gap-1 text-accent underline text-xs",children:[a.jsx(Gt,{className:"size-3.5"}),"Try again"]})]}):V.resolved?a.jsx(ns,{sync:V.syncing?{synced:V.synced,total:V.total}:void 0}):Ie;return a.jsx(rt,{hasSheet:be&&!Ue,children:a.jsx(St,{selectedMessageId:t,rows:v,onOpen:ue,onDeleteMessages:i,onSelectionVerb:A.start,wizardOpen:A.isOpen,commandsRef:r,onTriageContextChange:d,children:a.jsx(bs,{wizard:A,header:{title:"Daily brief",unreadCount:ze,footer:p?a.jsx(Ct,{}):void 0,searchFilter:$e,searchResults:se,searchLoading:Q||Pe,relatedResults:_e,relatedLoading:He,onSelectSearchResult:qe,searchResultsInBody:!0,refreshControl:Qe},rows:v,children:a.jsxs("div",{className:"flex h-full flex-col",children:[Ee.map(s=>a.jsx(ps,{accountEmail:s.email,accountId:s.accountId},s.accountId)),a.jsx("div",{className:"min-h-0 flex-1",children:Ve})]})})})})}const De=o.createContext(null);function J(){const e=o.useContext(De);if(!e)throw new Error("BriefPane.* must be used inside <BriefPane>");return e}function ys({thread:e,children:t}){const n=oe(),r=Xt(),{searchInput:d}=Y(),i=e?.threadId,f=e?.messageId,{data:u}=ae({...ne(),staleTime:6e4}),h=o.useMemo(()=>u?.items??[],[u]),y=o.useMemo(()=>{if(i)return h.find(g=>g.messageId===f)??h.find(g=>g.threadId===i)},[h,i,f]),x=Ft(i,f),p=y??x,I=f??p?.messageId,A=o.useMemo(()=>{if(i)return{threadId:i,mailboxId:p?.mailboxId??"",subject:p?.subject,messageId:I,authenticity:p?.authenticity}},[i,p,I]),L=o.useCallback((g,D)=>{n({to:"/mail/brief/$threadId/$messageId",params:g,replace:D?.replace,search:M=>({...M,q:d||void 0}),hash:r})},[n,r,d]),m=o.useCallback(()=>{n({to:"/mail/brief",search:g=>g,hash:r})},[n,r]),b=o.useCallback(g=>{I&&g.includes(I)&&m()},[I,m]),N=Ce({thread:p,onAfterOptimisticRemove:b}),S=At(),{deleteMessages:C}=Nt({mailboxId:p?.mailboxId??"",messages:h,onAfterOptimisticRemove:b}),{toggleReadFor:W}=Ot({mailboxId:p?.mailboxId??"",messages:h}),E=S.focusedMessageId,j=o.useMemo(()=>h.find(g=>g.messageId===E),[h,E])??p,P=Ce({thread:j}),G=es(),T=ts(),R=ss(),w=o.useMemo(()=>as(R,i,I),[R,i,I]),O=o.useMemo(()=>{if(j)return g=>R({threadId:j.threadId,messageId:j.messageId,mode:g})},[R,j]),{nextMessageId:q,previousMessageId:z}=Bt({context:S,orderedIds:S.orderedIds,selectedMessageId:I,enabled:!G&&!T,onClose:m,handlers:{reply:()=>O?.("reply"),replyAll:()=>O?.("reply-all"),forward:()=>O?.("forward"),delete:()=>{S.listCommandsRef.current?.requestVerb("delete")||P.deleteThread()},toggleStar:P.toggleStar,toggleRead:()=>{S.listCommandsRef.current?.requestVerb("markRead")||j&&W([j.messageId],!j.isRead)},goFlagged:()=>n({to:"/mail/flagged"}),goSettings:()=>n({to:"/settings"})}}),B=o.useCallback(g=>{if(!g)return;const D=h.find(M=>M.messageId===g);return D?{threadId:D.threadId,messageId:g}:void 0},[h]),Q={selectedMessageId:I,selectedThread:p,conversation:A,onOpenThread:L,onCloseThread:m,nextThread:B(q),previousThread:B(z),actions:N,onReply:w,triage:S,onDeleteMessages:C,handleDeselectIfRemoved:b};return a.jsx(De.Provider,{value:Q,children:t})}function Le(){const{selectedMessageId:e,onOpenThread:t,triage:n,onDeleteMessages:r}=J(),{accounts:d}=Y();return a.jsx(vs,{accounts:d,selectedMessageId:e,onOpenThread:t,commandsRef:n.listCommandsRef,onTriageContextChange:n.onTriageContextChange,onDeleteMessages:r})}function Ss(){const{conversation:e,selectedThread:t,actions:n,onReply:r,handleDeselectIfRemoved:d}=J(),i=!!e,f=Et(e?.threadId);return a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[a.jsx(Pt,{hasThread:i,intelligenceOpen:f.isShowing,canToggleIntelligence:f.canToggle,onToggleIntelligence:f.toggle,onReply:r?()=>r("reply"):void 0,onReplyAll:r?()=>r("reply-all"):void 0,onForward:r?()=>r("forward"):void 0,onDelete:i?n.deleteThread:void 0,onToggleStar:i?n.toggleStar:void 0,isStarred:n.isStarred,moveContext:i&&n.accountId&&n.mailboxId?{accountId:n.accountId,currentMailboxId:n.mailboxId,onMove:n.moveThread}:void 0}),a.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?a.jsx(Me,{threadId:e.threadId,mailboxId:e.mailboxId,subject:e.subject,selectedMessageId:e.messageId,authenticity:e.authenticity,onOpenIntelligence:f.open}):a.jsx(dt,{})})]}),a.jsx(ke,{isOpen:f.drawerOpen,onClose:f.closeDrawer,thread:t,mailboxId:t?.mailboxId,accountId:t?.accountId,onAfterOptimisticRemove:d})]})}function Cs(){const{selectedThread:e,handleDeselectIfRemoved:t}=J(),{onToggleIntelligence:n}=Y();return a.jsx(Lt,{onClose:n,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:t})}function js(){const{selectedThread:e,conversation:t,onOpenThread:n,onCloseThread:r,nextThread:d,previousThread:i,handleDeselectIfRemoved:f}=J(),u=Dt(t?.threadId??null);return t?a.jsxs(a.Fragment,{children:[a.jsx(Me,{threadId:t.threadId,mailboxId:t.mailboxId,subject:t.subject,selectedMessageId:t.messageId,authenticity:t.authenticity,onBack:r,onOpenIntelligence:u.toggle,onSwipeNext:d?()=>n(d):void 0,onSwipePrevious:i?()=>n(i):void 0,mobileIntelligenceOpen:u.isOpen}),a.jsx(ke,{isOpen:u.isOpen,onClose:u.close,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:f})]}):a.jsx("div",{className:"h-full",children:a.jsx(Le,{})})}const Ds=Object.assign(ys,{List:Le,Reading:Ss,Intelligence:Cs,Phone:js});export{Ds as B};
|
|
1
|
+
import{j as a,af as Ze,S as Xe,bB as et,l as Y,bq as tt,m as oe,r as o,s as ae,bC as ne,q as st,bD as at,bE as nt,bF as ot,e as Re,bG as rt}from"./index-D_YBuI3z.js";import{s as Te,a as it,b as we,u as lt,p as ct,R as dt}from"./useSearchTokenContext-DROeO7xw.js";import{aa as ve,H as ye,ab as ut,ac as mt,I as ft,ad as Se,ae as ht,af as gt,ag as xt,a9 as pt,ah as It,ai as bt,aj as vt,M as yt,ak as St,al as Ct,am as jt,e as Rt,v as Tt,an as wt,q as Mt,S as kt,L as Ft,Q as Ce,P as At,N as Nt,d as Ot,_ as Bt,$ as Dt,a1 as Me,a2 as ke,a3 as Lt,a4 as Et,a5 as Pt}from"./MailListHeader-BcdPneAy.js";import{u as qt,a as zt,R as Qt,i as Ht,b as _t}from"./useRefreshControl-h1VyXjLX.js";import{e as $t,c as Wt,R as Gt}from"./search-token-index-nAK4hI7B.js";import{a as Ut}from"./useLabels-CwcqSC09.js";import{u as Vt}from"./useMediaQuery-CDMcFeIb.js";import{u as Yt,r as Jt,L as Kt}from"./useSemanticSearch-RnkqtV8e.js";import{w as Zt}from"./wizard-selection-B1bng5Jq.js";import{o as Xt,f as es,h as ts,p as ss,r as as}from"./useMessageBodyContent-DEOYO0s3.js";function ns({sync:e}){return e?a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-12 text-center px-4",role:"status","aria-live":"polite",children:[a.jsx(Ze,{className:"size-8 animate-spin text-fg-subtle","aria-hidden":"true"}),a.jsx("p",{className:"text-sm font-medium text-fg",children:"Still syncing your mail"}),a.jsx("p",{className:"text-xs text-fg-subtle",children:os(e)})]}):a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-12 text-center px-4",children:[a.jsx(Xe,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),a.jsx("p",{className:"text-sm font-medium text-fg",children:"You're caught up"}),a.jsx("p",{className:"text-xs text-fg-subtle",children:"Nothing needs attention."})]})}function os({synced:e,total:t}){return t>0?`${e.toLocaleString()} of ${t.toLocaleString()} messages downloaded. This list fills in as they arrive.`:"Downloading your messages. This list fills in as they arrive."}const Fe=[{id:"unread",name:"is",value:"unread"},{id:"attachment",name:"has",value:"attachment"}],Ae="category",rs={unclassified:"uncategorized"},$=e=>it(e).map(t=>t.raw),_=e=>e.join(" "),re=e=>{const t=we(e);if(t)return Fe.find(n=>n.name===t.name&&n.value===t.value.toLowerCase())?.id},ie=e=>{const t=we(e);if(!t||t.name!==Ae)return;const n=t.value.toLowerCase(),r=rs[n];if(r)return r;if(!(!et(n)||n==="all"))return n},Ne=e=>Fe.find(t=>t.id===e),Oe=e=>Ne(e)!==void 0,is=e=>{const t=new Set;for(const n of $(e)){const r=re(n);r&&t.add(r)}return t},ls=e=>{let t="all";for(const n of $(e)){const r=ie(n);r&&(t=r)}return t},cs=(e,t)=>{const n=Ne(t);if(!n)return;const r=$(e),d=r.filter(i=>re(i)!==t);return d.length<r.length?_(d):_([...r,Te(n.name,n.value)])},ds=(e,t)=>{const n=$(e).filter(r=>!ie(r));return _(t==="all"?n:[...n,Te(Ae,t)])},us=e=>_($(e).filter(t=>!re(t)&&!ie(t))),Be=e=>e.trim().length>0,ms=e=>{if(!Be(e.query))return e.ownFilters;const t=new Set(is(e.query));for(const n of e.ownFilters)Oe(n)||t.add(n);return t},fs=e=>Be(e.query)?ls(e.query):e.ownCategory,hs=(e,t)=>e.createdAt!==t.createdAt?e.createdAt-t.createdAt:e.accountId.localeCompare(t.accountId),gs=e=>[...e].sort(hs),xs=200,je=()=>a.jsx("div",{className:"animate-pulse",children:Array.from({length:3}).map((e,t)=>a.jsxs("div",{className:"flex items-start gap-3 py-2 pl-5 pr-4 border-b border-line",children:[a.jsx("div",{className:"size-7 rounded-full bg-surface-sunken shrink-0 mt-0.5"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsxs("div",{className:"flex justify-between gap-2",children:[a.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-28"}),a.jsx("div",{className:"h-3 bg-surface-sunken rounded w-12"})]}),a.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-48"}),a.jsx("div",{className:"h-3 bg-surface-sunken rounded w-full"})]})]},t))}),ps=({accountEmail:e})=>{const t=oe();return a.jsxs("div",{className:"flex items-center gap-2 px-row-inset py-2 border-b border-line bg-danger-soft/40 text-xs text-danger",children:[a.jsx(Re,{className:"size-3.5 shrink-0"}),a.jsxs("span",{className:"flex-1 truncate",children:[e," can't connect"]}),a.jsx("button",{type:"button",onClick:()=>t({to:"/settings/accounts"}),className:"shrink-0 underline text-danger hover:opacity-80",children:"Reconnect"})]})},Is=(e,t)=>{if(t.size===0)return{};const n=e.filter(i=>t.has(i.id)),r=Jt(n.map(i=>i.accountId));if(r.restriction)return r;const d=new Set;for(const i of n)i.mailboxId&&d.add(i.mailboxId);return d.size>1?{accountId:r.accountId,restriction:"spansFolders",moveDisabledHint:`Move only works within one folder — this selection spans ${d.size} folders`}:{accountId:r.accountId,mailboxId:d.size===1?[...d][0]:void 0}};function bs({header:e,rows:t,wizard:n,children:r}){const{selectedIds:d,selectedCount:i,exitSelection:f,orderedIds:u,allSelected:h,toggleAllLoaded:y}=jt(),x=o.useMemo(()=>Is(t,d),[t,d]),{junkMailboxId:p}=Rt(x.accountId),{labels:I}=Ut(x.accountId),A=o.useMemo(()=>Array.from(d),[d]),L=o.useMemo(()=>Zt(t,d),[t,d]),m=Tt(p,x.mailboxId),b=o.useMemo(()=>u.length>0?{checked:h,indeterminate:i>0&&!h,onChange:y}:void 0,[u.length,h,i,y]),N=x.moveDisabledHint?{tone:"warning",text:x.moveDisabledHint}:void 0,S=C=>a.jsx(kt,{title:C.title,navSlot:C.navSlot,titleMeta:C.titleMeta,searchSlot:C.searchSlot,searchField:C.searchField,idleSlot:C.makeFilterSlot,count:i,onCancel:f,onDelete:()=>n.start("delete"),onMove:()=>n.start("move"),onOrganize:()=>n.start("organize"),onJunk:m?()=>n.start("junk"):void 0,onMarkRead:()=>n.start("markRead"),overflowSlot:x.accountId&&x.mailboxId&&i>0&&I.length>0?a.jsx(Kt,{accountId:x.accountId,mailboxId:x.mailboxId,messageIds:A}):void 0,selectAll:b,notice:N});return a.jsx(wt,{...e,selectionBar:S,paneOverlay:a.jsx(Mt,{verb:n.verb,accountId:x.accountId,mailboxId:x.mailboxId,selection:L,selectionRestriction:x.restriction,onFinished:f}),children:r})}function vs({accounts:e,selectedMessageId:t,onOpenThread:n,commandsRef:r,onTriageContextChange:d,onDeleteMessages:i}){const{searchQuery:f,searchInput:u,resultFolderIndex:h,onSearchChange:y}=Y(),x=lt(),p=Vt(),I=$t(),A=tt(),L=oe(),m=o.useMemo(()=>gs(e.filter(s=>!s.muted?.value)),[e]),[b,N]=o.useState("all"),[S,C]=o.useState("all"),[W,E]=o.useState(new Set),[K,j]=o.useState(!1),P=o.useCallback(s=>{E(l=>{const c=new Set(l);return c.has(s)?c.delete(s):c.add(s),c})},[]),G=o.useCallback(()=>E(new Set),[]),T=u.trim().length>0,R=o.useMemo(()=>ms({query:u,ownFilters:W}),[u,W]),w=o.useMemo(()=>fs({query:u,ownCategory:S}),[u,S]),O=o.useCallback(s=>{if(!T||!Oe(s)){P(s);return}const l=cs(u,s);l!==void 0&&y(l)},[T,u,y,P]),q=o.useCallback(s=>{if(!T){C(s);return}y(ds(u,s))},[T,u,y]),z=o.useCallback(()=>{C("all"),N("all"),G(),T&&y(us(u))},[T,u,y,G]),{data:B,isLoading:Q,isError:g,refetch:D}=ae({...ne(),staleTime:6e4}),M=Wt({queries:m.map(s=>({...st({path:{accountId:s.accountId}}),staleTime:1/0,meta:{softError:!0}}))}),U=o.useMemo(()=>{const s=new Map;for(let l=0;l<m.length;l++){const c=m[l].accountId,Ye=(M[l]?.data?.items??[]).reduce((Je,Ke)=>Je+(Ke.unseenCount??0),0);s.set(c,Ye)}return s},[m,M]),Ee=o.useMemo(()=>m.filter((s,l)=>{const c=M[l];return c?.isError?!at(c.error):!1}),[m,M]),{freeText:k,tokens:Z}=ct(f.trim().toLowerCase(),x),{data:le,isFetching:Pe}=ae({...ne({query:{query:k,limit:xs}}),enabled:k.length>0,staleTime:3e4}),v=o.useMemo(()=>{const s=ve(B?.items??[]).map(ye);return(k?ut(s.filter(c=>mt(c,k)),ve(le?.items??[]).map(ye)):s).filter(c=>(b==="all"||c.accountId===b)&&ft(c,Z))},[B,le,b,k,Z]),{bodyRows:ce,briefSpamOffer:X}=o.useMemo(()=>{if(!k)return{bodyRows:v,briefSpamOffer:void 0};const s=v.map(F=>Se(F,h)),{spam:l}=ht(s);if(l.length===0)return{bodyRows:v,briefSpamOffer:void 0};const c=new Set(l.map(F=>F.id));return{bodyRows:v.filter(F=>!c.has(F.id)),briefSpamOffer:gt(s)}},[v,k,h]),de=o.useMemo(()=>xt(ce),[ce]),ue=o.useCallback((s,l)=>{const c=v.find(F=>F.id===s)?.threadId;c&&n?.({threadId:c,messageId:s},l)},[v,n]),qe=o.useCallback(s=>{const l=s.threadId??v.find(c=>c.id===s.id)?.threadId;l&&n?.({threadId:l,messageId:s.id})},[v,n]),ee=o.useMemo(()=>m.length<=1?[]:[{id:"all",label:"All",active:b==="all"},...m.map(s=>({id:s.accountId,label:s.email.split("@")[0]??s.email,count:U.get(s.accountId),active:b===s.accountId}))],[m,U,b]),H=o.useMemo(()=>e.filter(s=>s.muted?.value).length,[e]),ze=o.useMemo(()=>Array.from(U.values()).reduce((s,l)=>s+l,0),[U]),te=o.useMemo(()=>m.map(s=>s.accountId),[m]),{hasNewMail:me}=qt(),{state:fe,errorMessage:he,refresh:ge}=zt(te,{onSettled:()=>D()}),Qe=o.useMemo(()=>a.jsx(Qt,{state:fe,onRefresh:ge,label:"Refresh daily brief",errorMessage:he,hasUpdate:me(te)}),[fe,ge,he,me,te]),se=o.useMemo(()=>v.filter(s=>(w==="all"||s.category===w)&&nt(s,R)).map(s=>Se(s,h)),[v,w,R,h]),{hits:xe,isLoading:He}=Yt(),_e=o.useMemo(()=>{const s=new Map;for(const c of B?.items??[])s.set(c.messageId,c.threadId);const l=se.map(c=>s.get(c.id)).filter(c=>c!=null);return pt(xe,l,h)},[xe,se,B,h]),$e=o.useMemo(()=>{const s=It(ee.map(l=>({id:l.id,label:l.label,count:l.count,active:l.active})));return{categories:s.categories,filters:s.filters,sources:s.sources,sourcesNote:H>0?`+${H} muted`:void 0,selectedCategory:w,activeFilters:R,expanded:K,onExpandedChange:j,onSelectCategory:l=>q(l),onSelectSource:N,onToggleFilter:l=>O(l),onClear:z}},[ee,H,w,R,K,O,q,z]),pe=de.length===0&&b==="all"&&k.length===0&&Z.length===0,We=o.useMemo(()=>m.map(s=>s.accountId),[m]),Ge=o.useMemo(()=>m.some(s=>Ht(s.syncPhase)),[m]),V=_t(We,pe||Ge),Ie=a.jsxs("div",{className:"h-full overflow-y-auto",children:[a.jsx(je,{}),a.jsx(je,{})]}),be=!Q&&!g&&!pe,Ue=bt({tier:I,hasLiveInput:T,hasCommittedQuery:f.trim().length>0,bodyRendersCommittedResults:!0}),Ve=be?a.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[X&&a.jsx(vt,{count:X.count,onScopeToSpam:()=>L({to:"/mail/$mailboxId",params:{mailboxId:X.mailboxId},search:{q:f||void 0}})}),a.jsx("div",{className:"min-h-0 flex-1",children:a.jsx(ot,{sections:de,briefCategory:w,Row:yt,selectedThreadId:t,onSelectThread:ue,onSelectBriefCategory:q,sources:ee,sourcesNote:H>0?`+${H} muted`:void 0,onSelectSource:N,activeFilters:R,onToggleFilter:O,onClearFilters:z})})]}):Q?Ie:g?a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 py-12 text-sm text-fg-muted",children:[a.jsx(Re,{className:"size-8 text-danger"}),a.jsx("p",{children:"Couldn't load your messages"}),a.jsxs("button",{type:"button",onClick:()=>D(),className:"flex items-center gap-1 text-accent underline text-xs",children:[a.jsx(Gt,{className:"size-3.5"}),"Try again"]})]}):V.resolved?a.jsx(ns,{sync:V.syncing?{synced:V.synced,total:V.total}:void 0}):Ie;return a.jsx(rt,{hasSheet:be&&!Ue,children:a.jsx(St,{selectedMessageId:t,rows:v,onOpen:ue,onDeleteMessages:i,onSelectionVerb:A.start,wizardOpen:A.isOpen,commandsRef:r,onTriageContextChange:d,children:a.jsx(bs,{wizard:A,header:{title:"Daily brief",unreadCount:ze,footer:p?a.jsx(Ct,{}):void 0,searchFilter:$e,searchResults:se,searchLoading:Q||Pe,relatedResults:_e,relatedLoading:He,onSelectSearchResult:qe,searchResultsInBody:!0,refreshControl:Qe},rows:v,children:a.jsxs("div",{className:"flex h-full flex-col",children:[Ee.map(s=>a.jsx(ps,{accountEmail:s.email,accountId:s.accountId},s.accountId)),a.jsx("div",{className:"min-h-0 flex-1",children:Ve})]})})})})}const De=o.createContext(null);function J(){const e=o.useContext(De);if(!e)throw new Error("BriefPane.* must be used inside <BriefPane>");return e}function ys({thread:e,children:t}){const n=oe(),r=Xt(),{searchInput:d}=Y(),i=e?.threadId,f=e?.messageId,{data:u}=ae({...ne(),staleTime:6e4}),h=o.useMemo(()=>u?.items??[],[u]),y=o.useMemo(()=>{if(i)return h.find(g=>g.messageId===f)??h.find(g=>g.threadId===i)},[h,i,f]),x=Ft(i,f),p=y??x,I=f??p?.messageId,A=o.useMemo(()=>{if(i)return{threadId:i,mailboxId:p?.mailboxId??"",subject:p?.subject,messageId:I,authenticity:p?.authenticity}},[i,p,I]),L=o.useCallback((g,D)=>{n({to:"/mail/brief/$threadId/$messageId",params:g,replace:D?.replace,search:M=>({...M,q:d||void 0}),hash:r})},[n,r,d]),m=o.useCallback(()=>{n({to:"/mail/brief",search:g=>g,hash:r})},[n,r]),b=o.useCallback(g=>{I&&g.includes(I)&&m()},[I,m]),N=Ce({thread:p,onAfterOptimisticRemove:b}),S=At(),{deleteMessages:C}=Nt({mailboxId:p?.mailboxId??"",messages:h,onAfterOptimisticRemove:b}),{toggleReadFor:W}=Ot({mailboxId:p?.mailboxId??"",messages:h}),E=S.focusedMessageId,j=o.useMemo(()=>h.find(g=>g.messageId===E),[h,E])??p,P=Ce({thread:j}),G=es(),T=ts(),R=ss(),w=o.useMemo(()=>as(R,i,I),[R,i,I]),O=o.useMemo(()=>{if(j)return g=>R({threadId:j.threadId,messageId:j.messageId,mode:g})},[R,j]),{nextMessageId:q,previousMessageId:z}=Bt({context:S,orderedIds:S.orderedIds,selectedMessageId:I,enabled:!G&&!T,onClose:m,handlers:{reply:()=>O?.("reply"),replyAll:()=>O?.("reply-all"),forward:()=>O?.("forward"),delete:()=>{S.listCommandsRef.current?.requestVerb("delete")||P.deleteThread()},toggleStar:P.toggleStar,toggleRead:()=>{S.listCommandsRef.current?.requestVerb("markRead")||j&&W([j.messageId],!j.isRead)},goFlagged:()=>n({to:"/mail/flagged"}),goSettings:()=>n({to:"/settings"})}}),B=o.useCallback(g=>{if(!g)return;const D=h.find(M=>M.messageId===g);return D?{threadId:D.threadId,messageId:g}:void 0},[h]),Q={selectedMessageId:I,selectedThread:p,conversation:A,onOpenThread:L,onCloseThread:m,nextThread:B(q),previousThread:B(z),actions:N,onReply:w,triage:S,onDeleteMessages:C,handleDeselectIfRemoved:b};return a.jsx(De.Provider,{value:Q,children:t})}function Le(){const{selectedMessageId:e,onOpenThread:t,triage:n,onDeleteMessages:r}=J(),{accounts:d}=Y();return a.jsx(vs,{accounts:d,selectedMessageId:e,onOpenThread:t,commandsRef:n.listCommandsRef,onTriageContextChange:n.onTriageContextChange,onDeleteMessages:r})}function Ss(){const{conversation:e,selectedThread:t,actions:n,onReply:r,handleDeselectIfRemoved:d}=J(),i=!!e,f=Et(e?.threadId);return a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[a.jsx(Pt,{hasThread:i,intelligenceOpen:f.isShowing,canToggleIntelligence:f.canToggle,onToggleIntelligence:f.toggle,onReply:r?()=>r("reply"):void 0,onReplyAll:r?()=>r("reply-all"):void 0,onForward:r?()=>r("forward"):void 0,onDelete:i?n.deleteThread:void 0,onToggleStar:i?n.toggleStar:void 0,isStarred:n.isStarred,moveContext:i&&n.accountId&&n.mailboxId?{accountId:n.accountId,currentMailboxId:n.mailboxId,onMove:n.moveThread}:void 0}),a.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?a.jsx(Me,{threadId:e.threadId,mailboxId:e.mailboxId,subject:e.subject,selectedMessageId:e.messageId,authenticity:e.authenticity,onOpenIntelligence:f.open}):a.jsx(dt,{})})]}),a.jsx(ke,{isOpen:f.drawerOpen,onClose:f.closeDrawer,thread:t,mailboxId:t?.mailboxId,accountId:t?.accountId,onAfterOptimisticRemove:d})]})}function Cs(){const{selectedThread:e,handleDeselectIfRemoved:t}=J(),{onToggleIntelligence:n}=Y();return a.jsx(Lt,{onClose:n,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:t})}function js(){const{selectedThread:e,conversation:t,onOpenThread:n,onCloseThread:r,nextThread:d,previousThread:i,handleDeselectIfRemoved:f}=J(),u=Dt(t?.threadId??null);return t?a.jsxs(a.Fragment,{children:[a.jsx(Me,{threadId:t.threadId,mailboxId:t.mailboxId,subject:t.subject,selectedMessageId:t.messageId,authenticity:t.authenticity,onBack:r,onOpenIntelligence:u.toggle,onSwipeNext:d?()=>n(d):void 0,onSwipePrevious:i?()=>n(i):void 0,mobileIntelligenceOpen:u.isOpen}),a.jsx(ke,{isOpen:u.isOpen,onClose:u.close,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:f})]}):a.jsx("div",{className:"h-full",children:a.jsx(Le,{})})}const Ds=Object.assign(ys,{List:Le,Reading:Ss,Intelligence:Cs,Phone:js});export{Ds as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,e as r}from"./index-
|
|
1
|
+
import{j as t,e as r}from"./index-D_YBuI3z.js";const d=e=>e instanceof Error?e.message:typeof e=="string"?e:typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:"An unexpected error occurred",l=({title:e="Couldn't load content",error:a,onRetry:s,variant:i="block"})=>{const n=d(a);return i==="inline"?t.jsxs("div",{role:"alert",className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[t.jsx(r,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"font-medium text-danger",children:e}),t.jsx("p",{className:"text-fg-muted mt-0.5 break-words",children:n})]}),s&&t.jsx("button",{type:"button",onClick:s,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}):t.jsxs("div",{role:"alert",className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[t.jsx(r,{className:"size-8 text-danger","aria-hidden":"true"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-danger",children:e}),t.jsx("p",{className:"text-sm text-fg-muted mt-1 break-words",children:n})]}),s&&t.jsx("button",{type:"button",onClick:s,className:"inline-flex items-center rounded-md border border-line bg-canvas px-4 py-2 text-sm font-medium hover:bg-surface-raised transition-colors",children:"Retry"})]})};export{l as E,d as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dr as J,r,cL as X,l as H,bq as Y,aF as Z,aG as ee,j as a,m as te}from"./index-
|
|
1
|
+
import{dr as J,r,cL as X,l as H,bq as Y,aF as Z,aG as ee,j as a,m as te}from"./index-D_YBuI3z.js";import{u as se,p as ae,R as re}from"./useSearchTokenContext-DROeO7xw.js";import{H as oe,ac as ne,I as de,aw as ie,ad as le,b as ce,M as ue,ak as ge,ax as he,am as me,q as fe,L as Ie,Q as V,P as pe,N as xe,d as Te,_ as ve,$ as ye,a1 as K,a2 as W,a3 as be,a4 as Re,a5 as Ce}from"./MailListHeader-BcdPneAy.js";import{u as we,b as Se,a as je}from"./MailViewChrome-CZb8kPr_.js";import{f as Fe}from"./ErrorState-CNHmvGYF.js";import{u as Me}from"./useMediaQuery-CDMcFeIb.js";import{w as Pe}from"./wizard-selection-B1bng5Jq.js";import{o as ke,f as Oe,h as Le,p as Ae,r as Ne}from"./useMessageBodyContent-DEOYO0s3.js";const De=()=>X({query:{starred:!0,order:"desc"}});function _(){const{data:e,isLoading:s,isError:t,error:n,refetch:m,fetchNextPage:d,hasNextPage:l,isFetchingNextPage:c}=we({queryKey:De(),queryFn:async({pageParam:I})=>{const{data:g}=await J({query:{starred:!0,order:"desc",continuationToken:I},throwOnError:!0});return g},initialPageParam:void 0,getNextPageParam:I=>I.continuationToken,staleTime:6e4});return{threads:r.useMemo(()=>(e?.pages??[]).flatMap(I=>I.items??[]),[e]),isLoading:s,isError:t,error:n,refetch:m,fetchNextPage:d,hasNextPage:l,isFetchingNextPage:c}}const Ee=e=>{const s=new Set;return e.filter(t=>s.has(t.threadId)?!1:(s.add(t.threadId),!0))},qe={unread:e=>!e.isRead,attachment:e=>e.hasAttachment===!0};function Be({rows:e,verb:s}){const{selectedIds:t,exitSelection:n}=me(),m=r.useMemo(()=>Pe(e,t),[e,t]);return a.jsx(fe,{verb:s,selection:m,selectionRestriction:"spansAccounts",onFinished:n})}function ze({selectedMessageId:e,onOpenThread:s,commandsRef:t,onTriageContextChange:n,onDeleteMessages:m}){const{searchQuery:d,resultFolderIndex:l}=H(),c=se(),M=Me(),I=Y(),[g,f]=r.useState("all"),[R,P]=r.useState(new Set),y=r.useCallback(o=>{P(h=>{const p=new Set(h);return p.has(o)?p.delete(o):p.add(o),p})},[]),C=r.useCallback(()=>{f("all"),P(new Set)},[]),{threads:k,isLoading:T,isError:O,error:q,refetch:L,fetchNextPage:Q,hasNextPage:x,isFetchingNextPage:w}=_(),{freeText:b,tokens:A}=ae(d.trim().toLowerCase(),c),u=r.useMemo(()=>{const o=Array.from(R).map(h=>qe[h]).filter(h=>h!=null);return Ee(k).map(oe).filter(h=>(g==="all"||h.category===g)&&o.every(p=>p(h))&&(!b||ne(h,b))&&de(h,A))},[k,g,R,b,A]),S=r.useCallback((o,h)=>{const p=u.find(U=>U.id===o)?.threadId;p&&s?.({threadId:p,messageId:o},h)},[u,s]),j=r.useCallback(o=>{const h=o.threadId??u.find(p=>p.id===o.id)?.threadId;h&&s?.({threadId:h,messageId:o.id})},[u,s]),B=r.useMemo(()=>ie(),[]),z=r.useMemo(()=>u.map(o=>le(o,l)),[u,l]),N=r.useMemo(()=>u.filter(o=>!o.isRead).length,[u]),D=T?"loading":O?"error":u.length===0?"empty":"ready",i=r.useCallback(()=>{const o=Z(ee());window.open(o,"_blank","noopener,noreferrer")},[]),v=ce(),F=a.jsx("div",{className:"flex h-full min-h-0 flex-col",children:a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsx("div",{className:"divide-y divide-line",children:u.map(o=>a.jsx(ue,{thread:o,active:o.id===e,onClick:()=>S(o.id)},o.id))}),x?a.jsx("button",{type:"button",className:"w-full py-3 text-sm text-muted hover:text-fg disabled:opacity-50",onClick:()=>Q(),disabled:w,children:w?"Loading…":"Load more"}):null]})});return a.jsx(Se,{title:"Starred",unreadCount:N,preset:B,selectedCategory:g,activeFilters:R,onSelectCategory:f,onToggleFilter:y,onClearFilters:C,searchResults:z,searchLoading:T,onSelectSearchResult:j,searchResultsInBody:!0,children:a.jsxs(ge,{selectedMessageId:e,rows:u,onOpen:S,onDeleteMessages:m,onSelectionVerb:I.start,wizardOpen:I.isOpen,commandsRef:t,onTriageContextChange:n,children:[a.jsx(je,{listTitle:"Starred",sections:[{id:"flagged",threads:u}],flatList:!0,hideHeader:!0,listState:v.searchResults?"ready":D,searchQuery:b?d:void 0,errorMessage:O?Fe(q):void 0,onRetry:()=>L(),onReportError:i,selectedThreadId:e,onSelectThread:S,isDesktop:M,selectionBar:a.jsx(he,{title:"Starred"}),listBody:v.searchResults??(D==="ready"?F:void 0)}),a.jsx(Be,{rows:u,verb:I.verb})]})})}const $=r.createContext(null);function E(){const e=r.useContext($);if(!e)throw new Error("FlaggedPane.* must be used inside <FlaggedPane>");return e}function He({thread:e,children:s}){const t=te(),n=ke(),{searchInput:m}=H(),d=e?.threadId,l=e?.messageId,{threads:c}=_(),M=r.useMemo(()=>{if(d)return c.find(i=>i.messageId===l)??c.find(i=>i.threadId===d)},[c,d,l]),I=Ie(d,l),g=M??I,f=l??g?.messageId,R=r.useMemo(()=>{if(d)return{threadId:d,mailboxId:g?.mailboxId??"",subject:g?.subject,messageId:f,authenticity:g?.authenticity}},[d,g,f]),P=r.useCallback((i,v)=>{t({to:"/mail/flagged/$threadId/$messageId",params:i,replace:v?.replace,search:F=>({...F,q:m||void 0}),hash:n})},[t,n,m]),y=r.useCallback(()=>{t({to:"/mail/flagged",search:i=>i,hash:n})},[t,n]),C=r.useCallback(i=>{f&&i.includes(f)&&y()},[f,y]),k=V({thread:g,onAfterOptimisticRemove:C}),T=pe(),{deleteMessages:O}=xe({mailboxId:g?.mailboxId??"",messages:c,onAfterOptimisticRemove:C}),{toggleReadFor:q}=Te({mailboxId:g?.mailboxId??"",messages:c}),L=T.focusedMessageId,x=r.useMemo(()=>c.find(i=>i.messageId===L),[c,L])??g,w=V({thread:x}),b=Oe(),A=Le(),u=Ae(),S=r.useMemo(()=>Ne(u,d,f),[u,d,f]),j=r.useMemo(()=>{if(x)return i=>u({threadId:x.threadId,messageId:x.messageId,mode:i})},[u,x]),{nextMessageId:B,previousMessageId:z}=ve({context:T,orderedIds:T.orderedIds,selectedMessageId:f,enabled:!b&&!A,onClose:y,handlers:{reply:()=>j?.("reply"),replyAll:()=>j?.("reply-all"),forward:()=>j?.("forward"),delete:()=>{T.listCommandsRef.current?.requestVerb("delete")||w.deleteThread()},toggleStar:w.toggleStar,toggleRead:()=>{T.listCommandsRef.current?.requestVerb("markRead")||x&&q([x.messageId],!x.isRead)},goBrief:()=>t({to:"/mail/brief"}),goSettings:()=>t({to:"/settings"})}}),N=r.useCallback(i=>{if(!i)return;const v=c.find(F=>F.messageId===i);return v?{threadId:v.threadId,messageId:i}:void 0},[c]),D={selectedMessageId:f,selectedThread:g,conversation:R,onOpenThread:P,onCloseThread:y,nextThread:N(B),previousThread:N(z),actions:k,onReply:S,triage:T,onDeleteMessages:O,handleDeselectIfRemoved:C};return a.jsx($.Provider,{value:D,children:s})}function G(){const{selectedMessageId:e,onOpenThread:s,triage:t,onDeleteMessages:n}=E();return a.jsx(ze,{selectedMessageId:e,onOpenThread:s,commandsRef:t.listCommandsRef,onTriageContextChange:t.onTriageContextChange,onDeleteMessages:n})}function Qe(){const{conversation:e,selectedThread:s,actions:t,onReply:n,handleDeselectIfRemoved:m}=E(),d=!!e,l=Re(e?.threadId);return a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[a.jsx(Ce,{hasThread:d,intelligenceOpen:l.isShowing,canToggleIntelligence:l.canToggle,onToggleIntelligence:l.toggle,onReply:n?()=>n("reply"):void 0,onReplyAll:n?()=>n("reply-all"):void 0,onForward:n?()=>n("forward"):void 0,onDelete:d?t.deleteThread:void 0,onToggleStar:d?t.toggleStar:void 0,isStarred:t.isStarred,moveContext:d&&t.accountId&&t.mailboxId?{accountId:t.accountId,currentMailboxId:t.mailboxId,onMove:t.moveThread}:void 0}),a.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?a.jsx(K,{threadId:e.threadId,mailboxId:e.mailboxId,subject:e.subject,selectedMessageId:e.messageId,authenticity:e.authenticity,onOpenIntelligence:l.open}):a.jsx(re,{})})]}),a.jsx(W,{isOpen:l.drawerOpen,onClose:l.closeDrawer,thread:s,mailboxId:s?.mailboxId,accountId:s?.accountId,onAfterOptimisticRemove:m})]})}function Ve(){const{selectedThread:e,handleDeselectIfRemoved:s}=E(),{onToggleIntelligence:t}=H();return a.jsx(be,{onClose:t,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:s})}function Ke(){const{selectedThread:e,conversation:s,onCloseThread:t,onOpenThread:n,nextThread:m,previousThread:d,handleDeselectIfRemoved:l}=E(),c=ye(s?.threadId??null);return s?a.jsxs(a.Fragment,{children:[a.jsx(K,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:t,onOpenIntelligence:c.toggle,onSwipeNext:m?()=>n(m):void 0,onSwipePrevious:d?()=>n(d):void 0,mobileIntelligenceOpen:c.isOpen}),a.jsx(W,{isOpen:c.isOpen,onClose:c.close,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:l})]}):a.jsx("div",{className:"h-full",children:a.jsx(G,{})})}const Ze=Object.assign(He,{List:G,Reading:Qe,Intelligence:Ve,Phone:Ke});export{Ze as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,s as f,Q as m,j as e,X as N}from"./index-
|
|
1
|
+
import{r as n,s as f,Q as m,j as e,X as N}from"./index-D_YBuI3z.js";import{E as u}from"./ErrorState-CNHmvGYF.js";import{D as r,C as x,u as k}from"./index-DwTAdS0U.js";import{u as w}from"./useMediaQuery-CDMcFeIb.js";import{k as p,s as h,t as C}from"./useMessageBodyContent-DEOYO0s3.js";import{C as E}from"./confirm-dialog-CSNgGV-I.js";const b=t=>t?"Draft":"New Message",I=()=>{const t=n.useRef(!1);return n.useCallback(()=>{const s=document.querySelector("[data-subject-field]")?.value??"",o=(document.querySelector('[data-testid="compose-body"]')?.textContent??"").replace(/--\s*/g,"").trim();return t.current=s.trim().length>0||o.length>0,t.current},[])},S=()=>{const t=p(),i=h(),s=C(),a=I(),[l,o]=n.useState(!1),{isError:d,error:c,refetch:g}=f({...m(),staleTime:1/0}),j=n.useCallback(D=>{D||(a()?o(!0):s())},[s,a]),y=n.useCallback(()=>{o(!1),s()},[s]),v=n.useCallback(()=>{o(!1)},[]);return e.jsxs(r.Root,{open:!0,onOpenChange:j,children:[e.jsxs(r.Portal,{children:[e.jsx(r.Overlay,{className:"fixed inset-0 z-40 bg-black/40"}),e.jsxs(r.Content,{className:"fixed inset-x-0 bottom-0 z-50 flex flex-col rounded-t-lg bg-canvas pb-[env(safe-area-inset-bottom,0px)]",style:{height:"95dvh"},children:[e.jsx(r.Handle,{className:"mx-auto mt-2 mb-1 h-1.5 w-12 rounded-full bg-fg-muted/30"}),e.jsx(r.Title,{className:"px-4 py-2 text-base font-semibold border-b border-line",children:b(t)}),d?e.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:e.jsx(u,{title:"Couldn't load compose",error:c,onRetry:()=>{g()}})}):e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(x,{mode:"new",outboxMessageId:t,onDraftCreated:i,onClose:s})})]})]}),e.jsx(E,{isOpen:l,title:"Discard draft?",description:"Your message has unsaved content. Are you sure you want to discard it?",confirmLabel:"Discard",cancelLabel:"Keep editing",destructive:!0,onConfirm:y,onCancel:v})]})},q=()=>{const t=p(),i=h(),s=C(),a=w(),{isError:l,error:o,refetch:d}=f({...m(),staleTime:1/0});if(k({bindings:[{key:"Escape",handler:s,preventDefault:!0}]}),!a)return e.jsx(S,{});const c=e.jsxs("header",{className:"flex items-center justify-between gap-2 px-4 py-3 border-b border-line shrink-0",children:[e.jsx("div",{className:"flex items-center gap-2 min-w-0",children:e.jsx("h2",{className:"text-lg font-semibold truncate",children:b(t)})}),e.jsx("button",{type:"button",onClick:s,className:"p-2 rounded-md hover:bg-surface-raised transition-colors min-h-11 min-w-11 inline-flex items-center justify-center","aria-label":"Close",children:e.jsx(N,{className:"size-5"})})]});return l?e.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[c,e.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:e.jsx(u,{title:"Couldn't load compose",error:o,onRetry:()=>{d()}})})]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-canvas",children:[c,e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(x,{mode:"new",outboxMessageId:t,onDraftCreated:i,onClose:s})})]})};export{q as F};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a4 as ys,cv as yr,r as l,c as ie,j as a,C as ut,d as On,B as G,X as Pt,at as Ie,cw as zn,b as U,a as Ye,S as We,aU as kr,cx as jr,ag as Dt,T as Ft,cy as _n,ba as ks,cz as wr,cA as Un,an as Cr,af as Bn,e as Sr,cB as Nr,as as Kn,cC as Tr,cD as Ir,cE as Er,cF as Rr,cG as Mr,cH as Ar,cI as $r,cJ as Lr,G as Pr,s as Z,Q as gt,q as bt,cK as Ot,z as Qn,bz as qn,cL as Hn,n as ae,a5 as be,a7 as pe,K as Je,bv as Re,cM as zt,ck as Dr,cN as Me,cO as Fr,cP as Gs,cQ as Or,cR as zr,cS as _r,cT as Ur,c4 as Br,bt as Gn,bu as Kr,cU as Qr,p as qr,aV as Vn,aQ as Wn,aW as Yn,aX as Jn,aY as Hr,m as Xn,aF as Gr,aG as Vr,cb as Wr,cV as Yr,k as Zn,ca as Jr,cW as Xr,cX as Zr,cY as ea,bl as js,bL as eo,bD as Vs,cZ as to,c_ as es,c$ as so,bk as no,N as ao,W as ro,D as oo,bA as Ws,b4 as io,d0 as lo,d1 as co,a8 as Ys,bx as uo,d2 as fo,d3 as mo,l as _t,d4 as po,d5 as ho,d6 as Js,d7 as go,d8 as bo,d9 as xo,i as ta,da as ws,by as ye,db as vo,cc as yo,dc as ko,dd as Xs,g as jo,cd as wo}from"./index-BQTgnFU2.js";import{B as Co,m as So,n as No,S as sa,c as Cs,f as To,D as Io,b as Tt,a as Eo,t as it,g as Ro,o as Mo,p as Ao,e as $o,u as Lo,i as Po}from"./search-token-index-C_566xlt.js";import{K as Do}from"./kbd-6Q4PA1CK.js";import{P as na,f as Fo,U as Oo,E as zo,s as _o}from"./attachment-file-D2wuknKq.js";import{M as Uo}from"./mail-3ysdr_UV.js";import{A as ft}from"./avatar-CvCVi3F9.js";import{M as Bo,c as Ko,d as aa,e as Qo,f as ra,g as oa,a as qo,b as Ho,S as Zs,s as ia,u as la,p as Go,r as Vo}from"./useSearchTokenContext-C-H1Y09b.js";import{v as Wo,w as Yo,o as Jo,x as Xo,y as Zo,p as ei,N as ca,d as ti}from"./useMessageBodyContent-PBQCTZnz.js";import{C as si,D as qe,u as ni}from"./index-C4YPHP48.js";import{E as Oe}from"./ErrorState-Ws9Z0fI_.js";import{u as Ss}from"./useMediaQuery-D1S3QsF0.js";import{e as da,b as Xe,a as ai,g as ri,c as ze,d as oi}from"./format-23Av07Go.js";import{D as ii}from"./download-L7TAGjcT.js";import{S as li}from"./shield-check-CkZ3bUEI.js";import{u as ua}from"./useDebouncedValue-TwIik-Bi.js";import{h as en,u as ci,a as di,i as ui,n as fi,o as mi,j as pi,k as hi,S as gi}from"./useFilters-Vl02Feaa.js";import{C as It}from"./confirm-dialog-007Povhq.js";import{C as bi}from"./clock-eaUrEZh3.js";import{r as xi,b as vi}from"./search-scope-CVzGDF_4.js";import{M as yi}from"./menu-BPCaZ391.js";function mt(e){if(ki())e.focus({preventScroll:!0});else{let t=ji(e);e.focus(),wi(t)}}let Et=null;function ki(){if(Et==null){Et=!1;try{document.createElement("div").focus({get preventScroll(){return Et=!0,!0}})}catch{}}return Et}function ji(e){let t=e.parentNode,s=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&s.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&s.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),s}function wi(e){for(let{element:t,scrollTop:s,scrollLeft:n}of e)t.scrollTop=s,t.scrollLeft=n}const Te=e=>e?.ownerDocument??document,Ee=e=>e&&"window"in e&&e.window===e?e:Te(e).defaultView||window;function Ci(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Si(e){return Ci(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Ni=!1;function fa(){return Ni}function ge(e,t){if(!fa())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let s=t;for(;s!==null;){if(s===e)return!0;s.tagName==="SLOT"&&s.assignedSlot?s=s.assignedSlot.parentNode:Si(s)?s=s.host:s=s.parentNode}return!1}function X(e){if(fa()&&e.target instanceof Element&&e.target.shadowRoot){if("composedPath"in e)return e.composedPath()[0]??null;if("composedPath"in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}const Ti=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Ii(e){const t=Ee(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:s,visibility:n}=e.style,r=s!=="none"&&n!=="hidden"&&n!=="collapse";if(r){const{getComputedStyle:o}=Ee(e);let{display:i,visibility:c}=o(e);r=i!=="none"&&c!=="hidden"&&c!=="collapse"}return r}function Ei(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function ma(e,t){return Ti?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&Ii(e)&&Ei(e,t)&&(!e.parentElement||ma(e.parentElement,e))}const pa=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Ri=pa.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";pa.push('[tabindex]:not([tabindex="-1"]):not([disabled])');function Mi(e,t){return e.matches(Ri)&&!Ai(e)&&(t?.skipVisibilityCheck||ma(e))}function Ai(e){let t=e;for(;t!=null;){if(t instanceof Ee(t).HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}const Ns=typeof document<"u"?ys.useLayoutEffect:()=>{};function $i(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Li(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function Pi(e){for(;e&&!Mi(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=Ee(e),s=t.document.activeElement;if(!s||s===e)return;let n=!1,r=h=>{(X(h)===s||n)&&h.stopImmediatePropagation()},o=h=>{(X(h)===s||n)&&(h.stopImmediatePropagation(),!e&&!n&&(n=!0,mt(s),d()))},i=h=>{(X(h)===e||n)&&h.stopImmediatePropagation()},c=h=>{(X(h)===e||n)&&(h.stopImmediatePropagation(),n||(n=!0,mt(s),d()))};t.addEventListener("blur",r,!0),t.addEventListener("focusout",o,!0),t.addEventListener("focusin",c,!0),t.addEventListener("focus",i,!0);let d=()=>{cancelAnimationFrame(b),t.removeEventListener("blur",r,!0),t.removeEventListener("focusout",o,!0),t.removeEventListener("focusin",c,!0),t.removeEventListener("focus",i,!0),n=!1},b=requestAnimationFrame(d);return d}function Ut(e){if(typeof window>"u"||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(s=>e.test(s.brand))||e.test(window.navigator.userAgent)}function Ts(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function Ae(e){let t=null;return()=>(t==null&&(t=e()),t)}const At=Ae(function(){return Ts(/^Mac/i)}),Di=Ae(function(){return Ts(/^iPhone/i)}),ha=Ae(function(){return Ts(/^iPad/i)||At()&&navigator.maxTouchPoints>1}),ga=Ae(function(){return Di()||ha()}),Fi=Ae(function(){return Ut(/AppleWebKit/i)&&!Oi()}),Oi=Ae(function(){return Ut(/Chrome/i)}),ba=Ae(function(){return Ut(/Android/i)}),zi=Ae(function(){return Ut(/Firefox/i)});function _i(e){return e.pointerType===""&&e.isTrusted?!0:ba()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ui(e){return!ba()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function pt(e,t,s=!0){let{metaKey:n,ctrlKey:r,altKey:o,shiftKey:i}=t;zi()&&window.event?.type?.startsWith("key")&&e.target==="_blank"&&(At()?n=!0:r=!0);let c=Fi()&&At()&&!ha()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:n,ctrlKey:r,altKey:o,shiftKey:i}):new MouseEvent("click",{metaKey:n,ctrlKey:r,altKey:o,shiftKey:i,detail:1,bubbles:!0,cancelable:!0});pt.isOpening=s,mt(e),e.dispatchEvent(c),pt.isOpening=!1}pt.isOpening=!1;let Ne=new Map,ds=new Set;function tn(){if(typeof window>"u")return;function e(n){return"propertyName"in n}let t=n=>{let r=X(n);if(!e(n)||!r)return;let o=Ne.get(r);o||(o=new Set,Ne.set(r,o),r.addEventListener("transitioncancel",s,{once:!0})),o.add(n.propertyName)},s=n=>{let r=X(n);if(!e(n)||!r)return;let o=Ne.get(r);if(o&&(o.delete(n.propertyName),o.size===0&&(r.removeEventListener("transitioncancel",s),Ne.delete(r)),Ne.size===0)){for(let i of ds)i();ds.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",s)}typeof document<"u"&&(document.readyState!=="loading"?tn():document.addEventListener("DOMContentLoaded",tn));function Bi(){for(const[e]of Ne)"isConnected"in e&&!e.isConnected&&Ne.delete(e)}function Ki(e){requestAnimationFrame(()=>{Bi(),Ne.size===0?e():ds.add(e)})}function xa(...e){return(...t)=>{for(let s of e)typeof s=="function"&&s(...t)}}let us=new Map;typeof FinalizationRegistry<"u"&&new FinalizationRegistry(e=>{us.delete(e)});function Qi(e,t){if(e===t)return e;let s=us.get(e);if(s)return s.forEach(r=>r.current=t),t;let n=us.get(t);return n?(n.forEach(r=>r.current=e),e):t}function qi(...e){return e.length===1&&e[0]?e[0]:t=>{let s=!1;const n=e.map(r=>{const o=sn(r,t);return s||=typeof o=="function",o});if(s)return()=>{n.forEach((r,o)=>{typeof r=="function"?r():sn(e[o],null)})}}}function sn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xt(...e){let t={...e[0]};for(let s=1;s<e.length;s++){let n=e[s];for(let r in n){let o=t[r],i=n[r];typeof o=="function"&&typeof i=="function"&&r[0]==="o"&&r[1]==="n"&&r.charCodeAt(2)>=65&&r.charCodeAt(2)<=90?t[r]=xa(o,i):(r==="className"||r==="UNSAFE_className")&&typeof o=="string"&&typeof i=="string"?t[r]=yr(o,i):r==="id"&&o&&i?t.id=Qi(o,i):r==="ref"&&o&&i?t.ref=qi(o,i):t[r]=i!==void 0?i:o}}return t}function Hi(e,t){Ns(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}const Gi=ys.useInsertionEffect??Ns;function ts(e){const t=l.useRef(null);return Gi(()=>{t.current=e},[e]),l.useCallback((...s)=>{const n=t.current;return n?.(...s)},[])}let Ge="default",fs="",Mt=new WeakMap;function Vi(e){if(ga()){if(Ge==="default"){const t=Te(e);fs=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}Ge="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";Mt.set(e,e.style[t]),e.style[t]="none"}}function nn(e){if(ga()){if(Ge!=="disabled")return;Ge="restoring",setTimeout(()=>{Ki(()=>{if(Ge==="restoring"){const t=Te(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=fs||""),fs="",Ge="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Mt.has(e)){let t=Mt.get(e),s="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[s]==="none"&&(e.style[s]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Mt.delete(e)}}function an(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let ss=new WeakMap;function Wi(e){let t=e??(typeof document<"u"?document:void 0);if(!t)return an(t);if(ss.has(t))return ss.get(t);let s=t.querySelector('meta[property="csp-nonce"]'),n=s&&s instanceof Ee(s).HTMLMetaElement&&(s.nonce||s.content)||an(t)||void 0;return n!==void 0&&ss.set(t,n),n}const va=ys.createContext({register:()=>{}});va.displayName="PressResponderContext";function ya(){let e=l.useRef(new Map),t=l.useCallback((r,o,i,c)=>{let d=c?.once?(...b)=>{e.current.delete(i),i(...b)}:i;e.current.set(i,{type:o,eventTarget:r,fn:d,options:c}),r.addEventListener(o,d,c)},[]),s=l.useCallback((r,o,i,c)=>{let d=e.current.get(i)?.fn||i;r.removeEventListener(o,d,c),e.current.delete(i)},[]),n=l.useCallback(()=>{e.current.forEach((r,o)=>{s(r.eventTarget,r.type,o,r.options)})},[s]);return l.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:s,removeAllGlobalListeners:n}}function Yi(e){let t=l.useContext(va);if(t){let{register:s,ref:n,...r}=t;e=xt(r,e),s()}return Hi(t,e.ref),e}class Rt{#e;constructor(t,s,n,r){this.#e=!0;const i=(r?.target??n.currentTarget)?.getBoundingClientRect();let c,d=0,b,h=null;n.clientX!=null&&n.clientY!=null&&(b=n.clientX,h=n.clientY),i&&(b!=null&&h!=null?(c=b-i.left,d=h-i.top):(c=i.width/2,d=i.height/2)),this.type=t,this.pointerType=s,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=c,this.y=d,this.key=n.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}const rn=Symbol("linkClicked"),on="react-aria-pressable-style",ln="data-react-aria-pressable";function Ji(e){let{onPress:t,onPressChange:s,onPressStart:n,onPressEnd:r,onPressUp:o,onClick:i,isDisabled:c,isPressed:d,preventFocusOnPress:b,shouldCancelOnPointerExit:h,allowTextSelectionOnPress:x,ref:p,...v}=Yi(e),[f,u]=l.useState(!1),m=l.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:g,removeAllGlobalListeners:w}=ya(),y=l.useCallback((j,M)=>{let A=m.current;if(c||A.didFirePressStart)return!1;let S=!0;if(A.isTriggeringEvent=!0,n){let I=new Rt("pressstart",M,j);n(I),S=I.shouldStopPropagation}return s&&s(!0),A.isTriggeringEvent=!1,A.didFirePressStart=!0,u(!0),S},[c,n,s]),k=l.useCallback((j,M,A=!0)=>{let S=m.current;if(!S.didFirePressStart)return!1;S.didFirePressStart=!1,S.isTriggeringEvent=!0;let I=!0;if(r){let C=new Rt("pressend",M,j);r(C),I=C.shouldStopPropagation}if(s&&s(!1),u(!1),t&&A&&!c){let C=new Rt("press",M,j);t(C),I&&=C.shouldStopPropagation}return S.isTriggeringEvent=!1,I},[c,r,s,t]),T=ts(k),R=l.useCallback((j,M)=>{let A=m.current;if(c)return!1;if(o){A.isTriggeringEvent=!0;let S=new Rt("pressup",M,j);return o(S),A.isTriggeringEvent=!1,S.shouldStopPropagation}return!0},[c,o]),D=ts(R),E=l.useCallback(j=>{let M=m.current;if(M.isPressed&&M.target){M.didFirePressStart&&M.pointerType!=null&&k(De(M.target,j),M.pointerType,!1),M.isPressed=!1,M.isOverTarget=!1,M.activePointerId=null,M.pointerType=null,w(),x||nn(M.target);for(let A of M.disposables)A();M.disposables=[]}},[x,w,k]),F=ts(E);l.useEffect(()=>{c&&m.current.isPressed&&F({currentTarget:m.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[c]);let O=l.useCallback(j=>{h&&E(j)},[h,E]),_=l.useCallback(j=>{c||i?.(j)},[c,i]),z=l.useCallback((j,M)=>{if(!c&&i){let A=new MouseEvent("click",j);Li(A,M),i($i(A))}},[c,i]),Q=l.useMemo(()=>{let j=m.current,M={onKeyDown(S){if(ns(S.nativeEvent,S.currentTarget)&&ge(S.currentTarget,X(S))){cn(X(S),S.key)&&S.preventDefault();let I=!0;!j.isPressed&&!S.repeat&&(j.target=S.currentTarget,j.isPressed=!0,j.pointerType="keyboard",I=y(S,"keyboard"));let C=S.currentTarget,P=B=>{ns(B,C)&&!B.repeat&&ge(C,X(B))&&j.target&&D(De(j.target,B),"keyboard")};g(Te(S.currentTarget),"keyup",xa(P,A),!0),I&&S.stopPropagation(),S.metaKey&&At()&&j.metaKeyEvents?.set(S.key,S.nativeEvent)}else S.key==="Meta"&&(j.metaKeyEvents=new Map)},onClick(S){if(!(S&&!ge(S.currentTarget,X(S)))&&S&&S.button===0&&!j.isTriggeringEvent&&!pt.isOpening){let I=!0;if(c&&S.preventDefault(),!j.ignoreEmulatedMouseEvents&&!j.isPressed&&(j.pointerType==="virtual"||_i(S.nativeEvent))){let C=y(S,"virtual"),P=D(S,"virtual"),B=T(S,"virtual");_(S),I=C&&P&&B}else if(j.isPressed&&j.pointerType!=="keyboard"){let C=j.pointerType||S.nativeEvent.pointerType||"virtual",P=D(De(S.currentTarget,S),C),B=T(De(S.currentTarget,S),C,!0);I=P&&B,j.isOverTarget=!1,_(S),F(S)}j.ignoreEmulatedMouseEvents=!1,I&&S.stopPropagation()}}},A=S=>{if(j.isPressed&&j.target&&ns(S,j.target)){cn(X(S),S.key)&&S.preventDefault();let I=X(S),C=ge(j.target,I);T(De(j.target,S),"keyboard",C),C&&z(S,j.target),w(),S.key!=="Enter"&&Is(j.target)&&ge(j.target,I)&&!S[rn]&&(S[rn]=!0,pt(j.target,S,!1)),j.isPressed=!1,j.metaKeyEvents?.delete(S.key)}else if(S.key==="Meta"&&j.metaKeyEvents?.size){let I=j.metaKeyEvents;j.metaKeyEvents=void 0;for(let C of I.values())j.target?.dispatchEvent(new KeyboardEvent("keyup",C))}};if(typeof PointerEvent<"u"){M.onPointerDown=C=>{if(C.button!==0||!ge(C.currentTarget,X(C)))return;if(Ui(C.nativeEvent)){j.pointerType="virtual";return}j.pointerType=C.pointerType;let P=!0;if(!j.isPressed){j.isPressed=!0,j.isOverTarget=!0,j.activePointerId=C.pointerId,j.target=C.currentTarget,x||Vi(j.target),P=y(C,j.pointerType);let B=X(C);"releasePointerCapture"in B&&("hasPointerCapture"in B?B.hasPointerCapture(C.pointerId)&&B.releasePointerCapture(C.pointerId):B.releasePointerCapture(C.pointerId)),g(Te(C.currentTarget),"pointerup",S,!1),g(Te(C.currentTarget),"pointercancel",I,!1)}P&&C.stopPropagation()},M.onMouseDown=C=>{if(ge(C.currentTarget,X(C))&&C.button===0){if(b){let P=Pi(C.target);P&&j.disposables.push(P)}C.stopPropagation()}},M.onPointerUp=C=>{!ge(C.currentTarget,X(C))||j.pointerType==="virtual"||C.button===0&&!j.isPressed&&D(C,j.pointerType||C.pointerType)},M.onPointerEnter=C=>{C.pointerId===j.activePointerId&&j.target&&!j.isOverTarget&&j.pointerType!=null&&(j.isOverTarget=!0,y(De(j.target,C),j.pointerType))},M.onPointerLeave=C=>{C.pointerId===j.activePointerId&&j.target&&j.isOverTarget&&j.pointerType!=null&&(j.isOverTarget=!1,T(De(j.target,C),j.pointerType,!1),O(C))};let S=C=>{if(C.pointerId===j.activePointerId&&j.isPressed&&C.button===0&&j.target){if(ge(j.target,X(C))&&j.pointerType!=null){let P=!1,B=setTimeout(()=>{j.isPressed&&j.target instanceof HTMLElement&&(P?F(C):(mt(j.target),j.target.click()))},80);g(C.currentTarget,"click",()=>P=!0,!0),j.disposables.push(()=>clearTimeout(B))}else F(C);j.isOverTarget=!1}},I=C=>{F(C)};M.onDragStart=C=>{ge(C.currentTarget,X(C))&&F(C)}}return M},[g,c,b,w,x,O,y,_,z]);return l.useEffect(()=>{if(!p)return;const j=Te(p.current);if(!j||!j.head||j.getElementById(on))return;const M=j.createElement("style");M.id=on;let A=Wi(j);A&&(M.nonce=A),M.textContent=`
|
|
1
|
+
import{a4 as ys,cv as yr,r as l,c as ie,j as a,C as ut,d as On,B as G,X as Pt,at as Ie,cw as zn,b as U,a as Ye,S as We,aU as kr,cx as jr,ag as Dt,T as Ft,cy as _n,ba as ks,cz as wr,cA as Un,an as Cr,af as Bn,e as Sr,cB as Nr,as as Kn,cC as Tr,cD as Ir,cE as Er,cF as Rr,cG as Mr,cH as Ar,cI as $r,cJ as Lr,G as Pr,s as Z,Q as gt,q as bt,cK as Ot,z as Qn,bz as qn,cL as Hn,n as ae,a5 as be,a7 as pe,K as Je,bv as Re,cM as zt,ck as Dr,cN as Me,cO as Fr,cP as Gs,cQ as Or,cR as zr,cS as _r,cT as Ur,c4 as Br,bt as Gn,bu as Kr,cU as Qr,p as qr,aV as Vn,aQ as Wn,aW as Yn,aX as Jn,aY as Hr,m as Xn,aF as Gr,aG as Vr,cb as Wr,cV as Yr,k as Zn,ca as Jr,cW as Xr,cX as Zr,cY as ea,bl as js,bL as eo,bD as Vs,cZ as to,c_ as es,c$ as so,bk as no,N as ao,W as ro,D as oo,bA as Ws,b4 as io,d0 as lo,d1 as co,a8 as Ys,bx as uo,d2 as fo,d3 as mo,l as _t,d4 as po,d5 as ho,d6 as Js,d7 as go,d8 as bo,d9 as xo,i as ta,da as ws,by as ye,db as vo,cc as yo,dc as ko,dd as Xs,g as jo,cd as wo}from"./index-D_YBuI3z.js";import{B as Co,m as So,n as No,S as sa,c as Cs,f as To,D as Io,b as Tt,a as Eo,t as it,g as Ro,o as Mo,p as Ao,e as $o,u as Lo,i as Po}from"./search-token-index-nAK4hI7B.js";import{K as Do}from"./kbd-BUm8HPo9.js";import{P as na,f as Fo,U as Oo,E as zo,s as _o}from"./attachment-file-BrXH3M3V.js";import{M as Uo}from"./mail-yZgIYq66.js";import{A as ft}from"./avatar-DtND0ruk.js";import{M as Bo,c as Ko,d as aa,e as Qo,f as ra,g as oa,a as qo,b as Ho,S as Zs,s as ia,u as la,p as Go,r as Vo}from"./useSearchTokenContext-DROeO7xw.js";import{v as Wo,w as Yo,o as Jo,x as Xo,y as Zo,p as ei,N as ca,d as ti}from"./useMessageBodyContent-DEOYO0s3.js";import{C as si,D as qe,u as ni}from"./index-DwTAdS0U.js";import{E as Oe}from"./ErrorState-CNHmvGYF.js";import{u as Ss}from"./useMediaQuery-CDMcFeIb.js";import{e as da,b as Xe,a as ai,g as ri,c as ze,d as oi}from"./format-23Av07Go.js";import{D as ii}from"./download-Yg8MAJuV.js";import{S as li}from"./shield-check-BZ36Y5z_.js";import{u as ua}from"./useDebouncedValue-4E-721vu.js";import{h as en,u as ci,a as di,i as ui,n as fi,o as mi,j as pi,k as hi,S as gi}from"./useFilters-BdPFYyLi.js";import{C as It}from"./confirm-dialog-CSNgGV-I.js";import{C as bi}from"./clock-CpWsGek7.js";import{r as xi,b as vi}from"./search-scope-MtY0zpRq.js";import{M as yi}from"./menu-B4mmeG34.js";function mt(e){if(ki())e.focus({preventScroll:!0});else{let t=ji(e);e.focus(),wi(t)}}let Et=null;function ki(){if(Et==null){Et=!1;try{document.createElement("div").focus({get preventScroll(){return Et=!0,!0}})}catch{}}return Et}function ji(e){let t=e.parentNode,s=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&s.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&s.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),s}function wi(e){for(let{element:t,scrollTop:s,scrollLeft:n}of e)t.scrollTop=s,t.scrollLeft=n}const Te=e=>e?.ownerDocument??document,Ee=e=>e&&"window"in e&&e.window===e?e:Te(e).defaultView||window;function Ci(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Si(e){return Ci(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Ni=!1;function fa(){return Ni}function ge(e,t){if(!fa())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let s=t;for(;s!==null;){if(s===e)return!0;s.tagName==="SLOT"&&s.assignedSlot?s=s.assignedSlot.parentNode:Si(s)?s=s.host:s=s.parentNode}return!1}function X(e){if(fa()&&e.target instanceof Element&&e.target.shadowRoot){if("composedPath"in e)return e.composedPath()[0]??null;if("composedPath"in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}const Ti=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Ii(e){const t=Ee(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:s,visibility:n}=e.style,r=s!=="none"&&n!=="hidden"&&n!=="collapse";if(r){const{getComputedStyle:o}=Ee(e);let{display:i,visibility:c}=o(e);r=i!=="none"&&c!=="hidden"&&c!=="collapse"}return r}function Ei(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function ma(e,t){return Ti?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&Ii(e)&&Ei(e,t)&&(!e.parentElement||ma(e.parentElement,e))}const pa=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Ri=pa.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";pa.push('[tabindex]:not([tabindex="-1"]):not([disabled])');function Mi(e,t){return e.matches(Ri)&&!Ai(e)&&(t?.skipVisibilityCheck||ma(e))}function Ai(e){let t=e;for(;t!=null;){if(t instanceof Ee(t).HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}const Ns=typeof document<"u"?ys.useLayoutEffect:()=>{};function $i(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Li(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function Pi(e){for(;e&&!Mi(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=Ee(e),s=t.document.activeElement;if(!s||s===e)return;let n=!1,r=h=>{(X(h)===s||n)&&h.stopImmediatePropagation()},o=h=>{(X(h)===s||n)&&(h.stopImmediatePropagation(),!e&&!n&&(n=!0,mt(s),d()))},i=h=>{(X(h)===e||n)&&h.stopImmediatePropagation()},c=h=>{(X(h)===e||n)&&(h.stopImmediatePropagation(),n||(n=!0,mt(s),d()))};t.addEventListener("blur",r,!0),t.addEventListener("focusout",o,!0),t.addEventListener("focusin",c,!0),t.addEventListener("focus",i,!0);let d=()=>{cancelAnimationFrame(b),t.removeEventListener("blur",r,!0),t.removeEventListener("focusout",o,!0),t.removeEventListener("focusin",c,!0),t.removeEventListener("focus",i,!0),n=!1},b=requestAnimationFrame(d);return d}function Ut(e){if(typeof window>"u"||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(s=>e.test(s.brand))||e.test(window.navigator.userAgent)}function Ts(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function Ae(e){let t=null;return()=>(t==null&&(t=e()),t)}const At=Ae(function(){return Ts(/^Mac/i)}),Di=Ae(function(){return Ts(/^iPhone/i)}),ha=Ae(function(){return Ts(/^iPad/i)||At()&&navigator.maxTouchPoints>1}),ga=Ae(function(){return Di()||ha()}),Fi=Ae(function(){return Ut(/AppleWebKit/i)&&!Oi()}),Oi=Ae(function(){return Ut(/Chrome/i)}),ba=Ae(function(){return Ut(/Android/i)}),zi=Ae(function(){return Ut(/Firefox/i)});function _i(e){return e.pointerType===""&&e.isTrusted?!0:ba()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ui(e){return!ba()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function pt(e,t,s=!0){let{metaKey:n,ctrlKey:r,altKey:o,shiftKey:i}=t;zi()&&window.event?.type?.startsWith("key")&&e.target==="_blank"&&(At()?n=!0:r=!0);let c=Fi()&&At()&&!ha()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:n,ctrlKey:r,altKey:o,shiftKey:i}):new MouseEvent("click",{metaKey:n,ctrlKey:r,altKey:o,shiftKey:i,detail:1,bubbles:!0,cancelable:!0});pt.isOpening=s,mt(e),e.dispatchEvent(c),pt.isOpening=!1}pt.isOpening=!1;let Ne=new Map,ds=new Set;function tn(){if(typeof window>"u")return;function e(n){return"propertyName"in n}let t=n=>{let r=X(n);if(!e(n)||!r)return;let o=Ne.get(r);o||(o=new Set,Ne.set(r,o),r.addEventListener("transitioncancel",s,{once:!0})),o.add(n.propertyName)},s=n=>{let r=X(n);if(!e(n)||!r)return;let o=Ne.get(r);if(o&&(o.delete(n.propertyName),o.size===0&&(r.removeEventListener("transitioncancel",s),Ne.delete(r)),Ne.size===0)){for(let i of ds)i();ds.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",s)}typeof document<"u"&&(document.readyState!=="loading"?tn():document.addEventListener("DOMContentLoaded",tn));function Bi(){for(const[e]of Ne)"isConnected"in e&&!e.isConnected&&Ne.delete(e)}function Ki(e){requestAnimationFrame(()=>{Bi(),Ne.size===0?e():ds.add(e)})}function xa(...e){return(...t)=>{for(let s of e)typeof s=="function"&&s(...t)}}let us=new Map;typeof FinalizationRegistry<"u"&&new FinalizationRegistry(e=>{us.delete(e)});function Qi(e,t){if(e===t)return e;let s=us.get(e);if(s)return s.forEach(r=>r.current=t),t;let n=us.get(t);return n?(n.forEach(r=>r.current=e),e):t}function qi(...e){return e.length===1&&e[0]?e[0]:t=>{let s=!1;const n=e.map(r=>{const o=sn(r,t);return s||=typeof o=="function",o});if(s)return()=>{n.forEach((r,o)=>{typeof r=="function"?r():sn(e[o],null)})}}}function sn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xt(...e){let t={...e[0]};for(let s=1;s<e.length;s++){let n=e[s];for(let r in n){let o=t[r],i=n[r];typeof o=="function"&&typeof i=="function"&&r[0]==="o"&&r[1]==="n"&&r.charCodeAt(2)>=65&&r.charCodeAt(2)<=90?t[r]=xa(o,i):(r==="className"||r==="UNSAFE_className")&&typeof o=="string"&&typeof i=="string"?t[r]=yr(o,i):r==="id"&&o&&i?t.id=Qi(o,i):r==="ref"&&o&&i?t.ref=qi(o,i):t[r]=i!==void 0?i:o}}return t}function Hi(e,t){Ns(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}const Gi=ys.useInsertionEffect??Ns;function ts(e){const t=l.useRef(null);return Gi(()=>{t.current=e},[e]),l.useCallback((...s)=>{const n=t.current;return n?.(...s)},[])}let Ge="default",fs="",Mt=new WeakMap;function Vi(e){if(ga()){if(Ge==="default"){const t=Te(e);fs=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}Ge="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";Mt.set(e,e.style[t]),e.style[t]="none"}}function nn(e){if(ga()){if(Ge!=="disabled")return;Ge="restoring",setTimeout(()=>{Ki(()=>{if(Ge==="restoring"){const t=Te(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=fs||""),fs="",Ge="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Mt.has(e)){let t=Mt.get(e),s="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[s]==="none"&&(e.style[s]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Mt.delete(e)}}function an(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let ss=new WeakMap;function Wi(e){let t=e??(typeof document<"u"?document:void 0);if(!t)return an(t);if(ss.has(t))return ss.get(t);let s=t.querySelector('meta[property="csp-nonce"]'),n=s&&s instanceof Ee(s).HTMLMetaElement&&(s.nonce||s.content)||an(t)||void 0;return n!==void 0&&ss.set(t,n),n}const va=ys.createContext({register:()=>{}});va.displayName="PressResponderContext";function ya(){let e=l.useRef(new Map),t=l.useCallback((r,o,i,c)=>{let d=c?.once?(...b)=>{e.current.delete(i),i(...b)}:i;e.current.set(i,{type:o,eventTarget:r,fn:d,options:c}),r.addEventListener(o,d,c)},[]),s=l.useCallback((r,o,i,c)=>{let d=e.current.get(i)?.fn||i;r.removeEventListener(o,d,c),e.current.delete(i)},[]),n=l.useCallback(()=>{e.current.forEach((r,o)=>{s(r.eventTarget,r.type,o,r.options)})},[s]);return l.useEffect(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:s,removeAllGlobalListeners:n}}function Yi(e){let t=l.useContext(va);if(t){let{register:s,ref:n,...r}=t;e=xt(r,e),s()}return Hi(t,e.ref),e}class Rt{#e;constructor(t,s,n,r){this.#e=!0;const i=(r?.target??n.currentTarget)?.getBoundingClientRect();let c,d=0,b,h=null;n.clientX!=null&&n.clientY!=null&&(b=n.clientX,h=n.clientY),i&&(b!=null&&h!=null?(c=b-i.left,d=h-i.top):(c=i.width/2,d=i.height/2)),this.type=t,this.pointerType=s,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=c,this.y=d,this.key=n.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}const rn=Symbol("linkClicked"),on="react-aria-pressable-style",ln="data-react-aria-pressable";function Ji(e){let{onPress:t,onPressChange:s,onPressStart:n,onPressEnd:r,onPressUp:o,onClick:i,isDisabled:c,isPressed:d,preventFocusOnPress:b,shouldCancelOnPointerExit:h,allowTextSelectionOnPress:x,ref:p,...v}=Yi(e),[f,u]=l.useState(!1),m=l.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:g,removeAllGlobalListeners:w}=ya(),y=l.useCallback((j,M)=>{let A=m.current;if(c||A.didFirePressStart)return!1;let S=!0;if(A.isTriggeringEvent=!0,n){let I=new Rt("pressstart",M,j);n(I),S=I.shouldStopPropagation}return s&&s(!0),A.isTriggeringEvent=!1,A.didFirePressStart=!0,u(!0),S},[c,n,s]),k=l.useCallback((j,M,A=!0)=>{let S=m.current;if(!S.didFirePressStart)return!1;S.didFirePressStart=!1,S.isTriggeringEvent=!0;let I=!0;if(r){let C=new Rt("pressend",M,j);r(C),I=C.shouldStopPropagation}if(s&&s(!1),u(!1),t&&A&&!c){let C=new Rt("press",M,j);t(C),I&&=C.shouldStopPropagation}return S.isTriggeringEvent=!1,I},[c,r,s,t]),T=ts(k),R=l.useCallback((j,M)=>{let A=m.current;if(c)return!1;if(o){A.isTriggeringEvent=!0;let S=new Rt("pressup",M,j);return o(S),A.isTriggeringEvent=!1,S.shouldStopPropagation}return!0},[c,o]),D=ts(R),E=l.useCallback(j=>{let M=m.current;if(M.isPressed&&M.target){M.didFirePressStart&&M.pointerType!=null&&k(De(M.target,j),M.pointerType,!1),M.isPressed=!1,M.isOverTarget=!1,M.activePointerId=null,M.pointerType=null,w(),x||nn(M.target);for(let A of M.disposables)A();M.disposables=[]}},[x,w,k]),F=ts(E);l.useEffect(()=>{c&&m.current.isPressed&&F({currentTarget:m.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[c]);let O=l.useCallback(j=>{h&&E(j)},[h,E]),_=l.useCallback(j=>{c||i?.(j)},[c,i]),z=l.useCallback((j,M)=>{if(!c&&i){let A=new MouseEvent("click",j);Li(A,M),i($i(A))}},[c,i]),Q=l.useMemo(()=>{let j=m.current,M={onKeyDown(S){if(ns(S.nativeEvent,S.currentTarget)&&ge(S.currentTarget,X(S))){cn(X(S),S.key)&&S.preventDefault();let I=!0;!j.isPressed&&!S.repeat&&(j.target=S.currentTarget,j.isPressed=!0,j.pointerType="keyboard",I=y(S,"keyboard"));let C=S.currentTarget,P=B=>{ns(B,C)&&!B.repeat&&ge(C,X(B))&&j.target&&D(De(j.target,B),"keyboard")};g(Te(S.currentTarget),"keyup",xa(P,A),!0),I&&S.stopPropagation(),S.metaKey&&At()&&j.metaKeyEvents?.set(S.key,S.nativeEvent)}else S.key==="Meta"&&(j.metaKeyEvents=new Map)},onClick(S){if(!(S&&!ge(S.currentTarget,X(S)))&&S&&S.button===0&&!j.isTriggeringEvent&&!pt.isOpening){let I=!0;if(c&&S.preventDefault(),!j.ignoreEmulatedMouseEvents&&!j.isPressed&&(j.pointerType==="virtual"||_i(S.nativeEvent))){let C=y(S,"virtual"),P=D(S,"virtual"),B=T(S,"virtual");_(S),I=C&&P&&B}else if(j.isPressed&&j.pointerType!=="keyboard"){let C=j.pointerType||S.nativeEvent.pointerType||"virtual",P=D(De(S.currentTarget,S),C),B=T(De(S.currentTarget,S),C,!0);I=P&&B,j.isOverTarget=!1,_(S),F(S)}j.ignoreEmulatedMouseEvents=!1,I&&S.stopPropagation()}}},A=S=>{if(j.isPressed&&j.target&&ns(S,j.target)){cn(X(S),S.key)&&S.preventDefault();let I=X(S),C=ge(j.target,I);T(De(j.target,S),"keyboard",C),C&&z(S,j.target),w(),S.key!=="Enter"&&Is(j.target)&&ge(j.target,I)&&!S[rn]&&(S[rn]=!0,pt(j.target,S,!1)),j.isPressed=!1,j.metaKeyEvents?.delete(S.key)}else if(S.key==="Meta"&&j.metaKeyEvents?.size){let I=j.metaKeyEvents;j.metaKeyEvents=void 0;for(let C of I.values())j.target?.dispatchEvent(new KeyboardEvent("keyup",C))}};if(typeof PointerEvent<"u"){M.onPointerDown=C=>{if(C.button!==0||!ge(C.currentTarget,X(C)))return;if(Ui(C.nativeEvent)){j.pointerType="virtual";return}j.pointerType=C.pointerType;let P=!0;if(!j.isPressed){j.isPressed=!0,j.isOverTarget=!0,j.activePointerId=C.pointerId,j.target=C.currentTarget,x||Vi(j.target),P=y(C,j.pointerType);let B=X(C);"releasePointerCapture"in B&&("hasPointerCapture"in B?B.hasPointerCapture(C.pointerId)&&B.releasePointerCapture(C.pointerId):B.releasePointerCapture(C.pointerId)),g(Te(C.currentTarget),"pointerup",S,!1),g(Te(C.currentTarget),"pointercancel",I,!1)}P&&C.stopPropagation()},M.onMouseDown=C=>{if(ge(C.currentTarget,X(C))&&C.button===0){if(b){let P=Pi(C.target);P&&j.disposables.push(P)}C.stopPropagation()}},M.onPointerUp=C=>{!ge(C.currentTarget,X(C))||j.pointerType==="virtual"||C.button===0&&!j.isPressed&&D(C,j.pointerType||C.pointerType)},M.onPointerEnter=C=>{C.pointerId===j.activePointerId&&j.target&&!j.isOverTarget&&j.pointerType!=null&&(j.isOverTarget=!0,y(De(j.target,C),j.pointerType))},M.onPointerLeave=C=>{C.pointerId===j.activePointerId&&j.target&&j.isOverTarget&&j.pointerType!=null&&(j.isOverTarget=!1,T(De(j.target,C),j.pointerType,!1),O(C))};let S=C=>{if(C.pointerId===j.activePointerId&&j.isPressed&&C.button===0&&j.target){if(ge(j.target,X(C))&&j.pointerType!=null){let P=!1,B=setTimeout(()=>{j.isPressed&&j.target instanceof HTMLElement&&(P?F(C):(mt(j.target),j.target.click()))},80);g(C.currentTarget,"click",()=>P=!0,!0),j.disposables.push(()=>clearTimeout(B))}else F(C);j.isOverTarget=!1}},I=C=>{F(C)};M.onDragStart=C=>{ge(C.currentTarget,X(C))&&F(C)}}return M},[g,c,b,w,x,O,y,_,z]);return l.useEffect(()=>{if(!p)return;const j=Te(p.current);if(!j||!j.head||j.getElementById(on))return;const M=j.createElement("style");M.id=on;let A=Wi(j);A&&(M.nonce=A),M.textContent=`
|
|
2
2
|
@layer {
|
|
3
3
|
[${ln}] {
|
|
4
4
|
touch-action: pan-x pan-y pinch-zoom;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,af as re,B as A,e as ie,r as x,b as K,ag as oe,T as ce,de as le,u as ue,df as Q,bF as de,bW as fe,dg as me,dh as xe,di as ge,l as he,bG as pe,cG as be}from"./index-BQTgnFU2.js";import{R as ve,m as je,q as we}from"./search-token-index-C_566xlt.js";import{aq as Ne,ar as ye,c as Pe,a as q,as as Ce,s as Re,at as ke,au as Se,av as Me,al as Ee,an as Ie}from"./MailListHeader-B9vO8fqH.js";import{A as ze}from"./avatar-CvCVi3F9.js";import{M as Oe}from"./mail-3ysdr_UV.js";import{M as Le}from"./menu-BPCaZ391.js";function De(){return e.jsx("div",{className:"space-y-0",role:"status","aria-busy":"true","aria-label":"Loading messages",children:Array.from({length:8}).map((s,n)=>e.jsxs("div",{className:"animate-pulse border-b border-line px-3 py-2",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("div",{className:"h-4 w-32 rounded bg-surface-sunken"}),e.jsx("div",{className:"h-3 w-16 rounded bg-surface-sunken"})]}),e.jsx("div",{className:"mb-2 h-4 w-48 rounded bg-surface-sunken"}),e.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]},n))})}function Te({filter:s,scopeLabel:n,searchQuery:r}){const f=r?.trim();return s?e.jsxs(U,{children:[e.jsx("p",{className:"font-medium text-fg",children:Fe(s.label,n,f)}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:_e[s.reach]}),e.jsx(A,{variant:"secondary",size:"sm",className:"mt-4",onClick:s.onClear,children:"Clear filter"})]}):e.jsx(U,{children:e.jsx("p",{className:"text-fg-muted",children:Ae(f,n)})})}const _e={"whole-folder":"Every message in this folder was checked.","loaded-pages":"Only the messages loaded so far were checked."};function Ae(s,n){return s?"No messages match your search":n?`No messages in ${n}`:"No messages in this mailbox"}function Fe(s,n,r){return r?`No results for “${r}” in ${s}`:n?`No ${s} mail in ${n}`:`No ${s} mail`}function U({children:s}){return e.jsx("div",{className:"flex h-full flex-1 items-center justify-center",children:e.jsx("div",{className:"flex max-w-sm flex-col items-center justify-center p-8 text-center",children:s})})}function Ze(){return e.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-sm text-fg-muted",role:"status","aria-live":"polite",children:[e.jsx(re,{className:"size-4 animate-spin","aria-hidden":"true"}),e.jsx("span",{children:"Loading more…"})]})}function $e({message:s="Something went wrong loading this mailbox.",onRetry:n,onReport:r}){return e.jsx("div",{className:"flex h-full flex-1 items-center justify-center p-4",children:e.jsxs("div",{role:"alert",className:"flex max-w-sm flex-col items-center justify-center gap-3 text-center",children:[e.jsx(ie,{className:"size-8 text-danger","aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load messages"}),e.jsx("p",{className:"mt-1 break-words text-sm text-fg-muted",children:s})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[n&&e.jsx(A,{variant:"secondary",size:"sm",onClick:n,children:"Retry"}),r&&e.jsx(A,{variant:"ghost",size:"sm",onClick:r,children:"Report a problem"})]})]})})}const z=72,V=10,He=z/2,J="__swipeableRowAxisCancel";function Z(s){return s==="leading"?z:s==="trailing"?-z:0}function Xe(s){return s>=z/2?"leading":s<=-z/2?"trailing":"none"}function Be({thread:s,selectionMode:n,checked:r,active:f,peek:m,onPeek:g,onToggleCheck:y,onLongPress:j,onOpen:h,onAct:p}){const d=x.useRef(null),[b,v]=x.useState(null),{longPressProps:P}=Ne({onLongPress:j,isDisabled:n,accessibilityDescription:"Select message"}),k=i=>{const o=new PointerEvent("pointercancel",{bubbles:!0});o[J]=!0,i.currentTarget.dispatchEvent(o)},a=ye(P,{onPointerDown:i=>{d.current={startX:i.clientX,startY:i.clientY,axis:"none",escaped:!1}},onPointerMove:i=>{if(n)return;const o=d.current;if(!o)return;const u=i.clientX-o.startX,M=i.clientY-o.startY;if(o.axis==="none"&&(Math.abs(M)>V&&Math.abs(M)>Math.abs(u)?o.axis="vertical":Math.abs(u)>V&&Math.abs(u)>Math.abs(M)&&(o.axis="horizontal",i.currentTarget.setPointerCapture(i.pointerId))),o.axis==="none")return;const O=o.axis==="horizontal"?Math.abs(u):Math.abs(M);if(!o.escaped&&O>He&&(o.escaped=!0,k(i)),o.axis!=="horizontal")return;const $=Z(m),H=Math.max(-z,Math.min(z,$+u));v(H)},onPointerUp:i=>{const o=d.current;d.current=null;const u=b;if(v(null),!!o){if(o.axis!=="none"&&!o.escaped&&k(i),o.axis==="horizontal"){u!==null&&g(Xe(u));return}if(o.axis!=="vertical"){if(n){y();return}if(m!=="none"){g("none");return}h()}}},onPointerCancel:i=>{i.nativeEvent[J]||(d.current=null,v(null))}}),l=b??Z(m),N=l>0?"leading":l<0?"trailing":"none",C=K("relative touch-pan-y bg-surface","select-none",Pe({active:r||f})),D={transform:l!==0?`translateX(${l}px)`:void 0,transition:b===null?"transform 150ms ease":"none",minHeight:44},F=!s.isRead,I=i=>i.stopPropagation(),T=n?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:K("inline-flex size-7 shrink-0 items-center justify-center rounded-full border",r?"border-accent bg-accent text-accent-fg":"border-line-strong bg-canvas"),children:r&&e.jsx(oe,{className:"size-3.5"})}),e.jsx(q,{thread:s})]}):e.jsxs(e.Fragment,{children:[F&&e.jsx("span",{className:"absolute left-1.5 top-1/2 size-1.5 -translate-y-1/2 rounded-full bg-accent"}),e.jsx("span",{role:"checkbox",tabIndex:0,"aria-checked":r,"aria-label":`Select message from ${s.fromName}`,onPointerDown:I,onPointerMove:I,onPointerUp:I,onClick:i=>{i.preventDefault(),i.stopPropagation(),j()},onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),i.stopPropagation(),j())},className:"-m-2 inline-flex size-11 shrink-0 items-center justify-center rounded-full",children:e.jsx(ze,{name:s.fromName,email:s.fromEmail,size:"sm"})}),e.jsx(q,{thread:s})]});return e.jsxs("div",{className:"relative overflow-hidden",children:[N==="leading"&&e.jsx("button",{type:"button",onClick:()=>p("leading"),"aria-label":s.isRead?"Mark as unread":"Mark as read",className:"absolute inset-y-0 left-0 flex items-center justify-start bg-accent-2 px-6 text-accent-fg",children:s.isRead?e.jsx(Oe,{className:"size-6"}):e.jsx(Ce,{className:"size-6"})}),N==="trailing"&&e.jsx("button",{type:"button",onClick:()=>p("trailing"),"aria-label":"Delete message",className:"absolute inset-y-0 right-0 flex items-center justify-end bg-danger px-6 text-canvas",children:e.jsx(ce,{className:"size-6"})}),e.jsx("button",{type:"button",role:n?"checkbox":void 0,"aria-checked":n?r:void 0,"data-message-row":!0,"data-message-id":s.id,...a,className:C,style:D,children:T})]})}function We({sections:s,selectedThreadId:n,selectionMode:r,checkedIds:f,initialPeek:m,onToggleCheck:g,onEnterSelection:y,onOpenThread:j,onRefresh:h,refreshing:p,busy:d=!1}){const[b,v]=x.useState(new Set),[P,k]=x.useState(new Map),w=s.flatMap(a=>a.threads).filter(a=>!b.has(a.id)).map(a=>{const l=P.get(a.id);return l===void 0?a:{...a,isRead:l}}),[S,R]=x.useState(m&&m!=="none"&&w[1]?{id:w[1].id,side:m}:null),E=(a,l)=>{if(l==="trailing")v(N=>new Set(N).add(a));else{const N=w.find(C=>C.id===a);k(C=>new Map(C).set(a,!N?.isRead))}R(null)};return e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[p&&e.jsxs("div",{className:"flex items-center justify-center gap-2 border-b border-line py-3 text-fg-muted",children:[e.jsx(ve,{className:"size-4 animate-spin"}),e.jsx("span",{className:"text-xs",children:"Checking for new mail…"})]}),e.jsx("div",{className:"divide-y divide-line",children:w.map(a=>e.jsx("div",{className:d?"pointer-events-none opacity-50":void 0,children:e.jsx(Be,{thread:a,selectionMode:r,checked:f.has(a.id),active:a.id===n,peek:S?.id===a.id?S.side:"none",onPeek:l=>R(l==="none"?null:{id:a.id,side:l}),onToggleCheck:()=>g(a.id),onLongPress:()=>y(a.id),onOpen:()=>j(a.id),onAct:l=>E(a.id,l)})},a.id))}),!r&&!p&&!d&&e.jsx("button",{type:"button",onClick:h,className:"w-full border-t border-line py-2 text-center text-2xs text-fg-subtle transition-colors hover:bg-surface-sunken",children:"Pull to refresh"})]})}const Ye=new Set;function es({listTitle:s,listMeta:n,sections:r,briefFilters:f,flatList:m,listState:g="ready",searchQuery:y,listFilter:j,listScopeLabel:h,errorMessage:p,onRetry:d,onReportError:b,briefFilter:v,selectedThreadId:P,density:k="comfortable",onSelectThread:w,onOpenNav:S,isDesktop:R,initialTouchState:E,selection:a,keyboard:l,selectionBar:N,paneOverlay:C,listBody:D,hideHeader:F=!1}){const I=k==="compact"?Se:Me,T=x.useRef(null),i=x.useRef(null),o=le(l);ue({containerRef:T,itemSelector:Q,enabled:!o});const u=o?l.focusedId:void 0,M=o?u??r[0]?.threads[0]?.id:void 0,O=x.useCallback(t=>M===void 0?void 0:t===M?0:-1,[M]);x.useEffect(()=>{if(u===void 0)return;const t=i.current;if(!t)return;const c=t.querySelector(`${Q}[data-message-id="${u}"]`);!c||c===t.ownerDocument.activeElement||c.focus({preventScroll:!1})},[u]),x.useEffect(()=>{if(!o)return;const t=i.current;if(!t)return;const c=t.ownerDocument.activeElement;c!==null&&c!==t.ownerDocument.body||t.focus({preventScroll:!0})},[o]);const $=!R&&!f&&g==="ready",[H,Y]=x.useState(!1),ee=E==="peek-trailing"?"trailing":E==="peek-leading"?"leading":void 0,se=()=>{Y(!0),setTimeout(()=>Y(!1),1400)},_=a?.selectedIds??Ye,L=a?.onToggle,G=a?.onRowSelect,te=Re(_.size,R),X=x.useCallback(t=>{if(L)return{checked:_.has(t),onToggle:c=>{c.preventDefault(),c.stopPropagation(),L(t)}}},[_,L]),B=x.useCallback((t,c)=>G?.(t,ke(c))?(c.preventDefault(),c.shiftKey&&window.getSelection()?.removeAllRanges(),!0):!1,[G]),ne=x.useCallback(({thread:t,active:c,onClick:W})=>e.jsx(I,{thread:t,active:c,focused:t.id===u,tabIndex:O(t.id),selection:X(t.id),onClick:ae=>{B(t.id,ae)||W?.()}}),[I,X,B,u,O]);return e.jsxs("section",{ref:t=>{i.current=t,l?.ref(t)},tabIndex:o?-1:void 0,className:"relative flex h-full w-full flex-col bg-surface outline-none",children:[N??(F?null:e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[S&&e.jsx(A,{variant:"ghost",size:"sm",icon:e.jsx(Le,{className:"size-4"}),onClick:S,"aria-label":"Open folders",className:"-ml-1 shrink-0"}),e.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:s}),n&&e.jsx("span",{className:"shrink-0 text-2xs text-fg-subtle",children:n})]})),g==="loading"?e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(De,{})}):g==="empty"?e.jsx(Te,{filter:j,scopeLabel:h,searchQuery:y}):g==="error"?e.jsx($e,{message:p,onRetry:d,onReport:b}):f?e.jsx(de,{...v??{},sections:r,selectedThreadId:P,Row:ne,keyboard:l,onSelectThread:w}):D??($?e.jsx(We,{sections:r,selectedThreadId:P,selectionMode:te,checkedIds:_,initialPeek:ee,onToggleCheck:t=>L?.(t),onEnterSelection:t=>L?.(t),onOpenThread:t=>w?.(t),onRefresh:se,refreshing:H}):e.jsx("div",{ref:T,className:"flex-1 overflow-y-auto",children:r.map(t=>e.jsxs("div",{children:[!m&&t.label&&e.jsxs("div",{className:"sticky top-0 flex h-section-row items-center justify-between border-b border-line bg-surface-sunken px-row-inset",children:[e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:t.label}),e.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:t.threads.length})]}),e.jsx("div",{className:"divide-y divide-line",children:t.threads.map(c=>e.jsx(I,{thread:c,active:c.id===P,focused:c.id===u,tabIndex:O(c.id),selection:X(c.id),onClick:W=>{B(c.id,W)||w?.(c.id)}},c.id))})]},t.id))})),R&&e.jsx(Ee,{hints:l?we(l.handlers):je}),C]})}var Ge=class extends fe{constructor(s,n){super(s,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,n){const{state:r}=s,f=super.createResult(s,n),{isFetching:m,isRefetching:g,isError:y,isRefetchError:j}=f,h=r.fetchMeta?.fetchMore?.direction,p=y&&h==="forward",d=m&&h==="forward",b=y&&h==="backward",v=m&&h==="backward";return{...f,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:xe(n,r.data),hasPreviousPage:me(n,r.data),isFetchNextPageError:p,isFetchingNextPage:d,isFetchPreviousPageError:b,isFetchingPreviousPage:v,isRefetchError:j&&!p&&!b,isRefetching:g&&!d&&!v}}};function ss(s,n){return ge(s,Ge)}function ts({title:s,unreadCount:n,preset:r,selectedCategory:f,activeFilters:m,onSelectCategory:g,onToggleFilter:y,onSelectSource:j,onClearFilters:h,children:p,footer:d,searchResults:b,searchLoading:v,relatedResults:P,relatedLoading:k,onSelectSearchResult:w,searchResultsLabel:S,relatedResultsLabel:R,searchResultsInBody:E,refreshControl:a}){const{searchInput:l}=he(),N=l.trim().length>0,C={categories:r.categories,filters:r.filters,sources:r.sources,selectedCategory:f,activeFilters:m,onSelectCategory:g,onSelectSource:j,onToggleFilter:y,onClear:h};return e.jsx(pe,{hasSheet:!N,children:e.jsx(Ie,{title:s,unreadCount:n,footer:d,searchFilter:C,searchResults:b,searchLoading:v,relatedResults:P,relatedLoading:k,onSelectSearchResult:w,searchResultsLabel:S,relatedResultsLabel:R,searchResultsInBody:E,refreshControl:a,children:e.jsx(be,{...C,hideChrome:N,children:p})})})}export{Ze as M,Be as S,es as a,ts as b,ss as u};
|
|
1
|
+
import{j as e,af as re,B as A,e as ie,r as x,b as K,ag as oe,T as ce,de as le,u as ue,df as Q,bF as de,bW as fe,dg as me,dh as xe,di as ge,l as he,bG as pe,cG as be}from"./index-D_YBuI3z.js";import{R as ve,m as je,q as we}from"./search-token-index-nAK4hI7B.js";import{aq as Ne,ar as ye,c as Pe,a as q,as as Ce,s as Re,at as ke,au as Se,av as Me,al as Ee,an as Ie}from"./MailListHeader-BcdPneAy.js";import{A as ze}from"./avatar-DtND0ruk.js";import{M as Oe}from"./mail-yZgIYq66.js";import{M as Le}from"./menu-B4mmeG34.js";function De(){return e.jsx("div",{className:"space-y-0",role:"status","aria-busy":"true","aria-label":"Loading messages",children:Array.from({length:8}).map((s,n)=>e.jsxs("div",{className:"animate-pulse border-b border-line px-3 py-2",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("div",{className:"h-4 w-32 rounded bg-surface-sunken"}),e.jsx("div",{className:"h-3 w-16 rounded bg-surface-sunken"})]}),e.jsx("div",{className:"mb-2 h-4 w-48 rounded bg-surface-sunken"}),e.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]},n))})}function Te({filter:s,scopeLabel:n,searchQuery:r}){const f=r?.trim();return s?e.jsxs(U,{children:[e.jsx("p",{className:"font-medium text-fg",children:Fe(s.label,n,f)}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:_e[s.reach]}),e.jsx(A,{variant:"secondary",size:"sm",className:"mt-4",onClick:s.onClear,children:"Clear filter"})]}):e.jsx(U,{children:e.jsx("p",{className:"text-fg-muted",children:Ae(f,n)})})}const _e={"whole-folder":"Every message in this folder was checked.","loaded-pages":"Only the messages loaded so far were checked."};function Ae(s,n){return s?"No messages match your search":n?`No messages in ${n}`:"No messages in this mailbox"}function Fe(s,n,r){return r?`No results for “${r}” in ${s}`:n?`No ${s} mail in ${n}`:`No ${s} mail`}function U({children:s}){return e.jsx("div",{className:"flex h-full flex-1 items-center justify-center",children:e.jsx("div",{className:"flex max-w-sm flex-col items-center justify-center p-8 text-center",children:s})})}function Ze(){return e.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-sm text-fg-muted",role:"status","aria-live":"polite",children:[e.jsx(re,{className:"size-4 animate-spin","aria-hidden":"true"}),e.jsx("span",{children:"Loading more…"})]})}function $e({message:s="Something went wrong loading this mailbox.",onRetry:n,onReport:r}){return e.jsx("div",{className:"flex h-full flex-1 items-center justify-center p-4",children:e.jsxs("div",{role:"alert",className:"flex max-w-sm flex-col items-center justify-center gap-3 text-center",children:[e.jsx(ie,{className:"size-8 text-danger","aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load messages"}),e.jsx("p",{className:"mt-1 break-words text-sm text-fg-muted",children:s})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[n&&e.jsx(A,{variant:"secondary",size:"sm",onClick:n,children:"Retry"}),r&&e.jsx(A,{variant:"ghost",size:"sm",onClick:r,children:"Report a problem"})]})]})})}const z=72,V=10,He=z/2,J="__swipeableRowAxisCancel";function Z(s){return s==="leading"?z:s==="trailing"?-z:0}function Xe(s){return s>=z/2?"leading":s<=-z/2?"trailing":"none"}function Be({thread:s,selectionMode:n,checked:r,active:f,peek:m,onPeek:g,onToggleCheck:y,onLongPress:j,onOpen:h,onAct:p}){const d=x.useRef(null),[b,v]=x.useState(null),{longPressProps:P}=Ne({onLongPress:j,isDisabled:n,accessibilityDescription:"Select message"}),k=i=>{const o=new PointerEvent("pointercancel",{bubbles:!0});o[J]=!0,i.currentTarget.dispatchEvent(o)},a=ye(P,{onPointerDown:i=>{d.current={startX:i.clientX,startY:i.clientY,axis:"none",escaped:!1}},onPointerMove:i=>{if(n)return;const o=d.current;if(!o)return;const u=i.clientX-o.startX,M=i.clientY-o.startY;if(o.axis==="none"&&(Math.abs(M)>V&&Math.abs(M)>Math.abs(u)?o.axis="vertical":Math.abs(u)>V&&Math.abs(u)>Math.abs(M)&&(o.axis="horizontal",i.currentTarget.setPointerCapture(i.pointerId))),o.axis==="none")return;const O=o.axis==="horizontal"?Math.abs(u):Math.abs(M);if(!o.escaped&&O>He&&(o.escaped=!0,k(i)),o.axis!=="horizontal")return;const $=Z(m),H=Math.max(-z,Math.min(z,$+u));v(H)},onPointerUp:i=>{const o=d.current;d.current=null;const u=b;if(v(null),!!o){if(o.axis!=="none"&&!o.escaped&&k(i),o.axis==="horizontal"){u!==null&&g(Xe(u));return}if(o.axis!=="vertical"){if(n){y();return}if(m!=="none"){g("none");return}h()}}},onPointerCancel:i=>{i.nativeEvent[J]||(d.current=null,v(null))}}),l=b??Z(m),N=l>0?"leading":l<0?"trailing":"none",C=K("relative touch-pan-y bg-surface","select-none",Pe({active:r||f})),D={transform:l!==0?`translateX(${l}px)`:void 0,transition:b===null?"transform 150ms ease":"none",minHeight:44},F=!s.isRead,I=i=>i.stopPropagation(),T=n?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:K("inline-flex size-7 shrink-0 items-center justify-center rounded-full border",r?"border-accent bg-accent text-accent-fg":"border-line-strong bg-canvas"),children:r&&e.jsx(oe,{className:"size-3.5"})}),e.jsx(q,{thread:s})]}):e.jsxs(e.Fragment,{children:[F&&e.jsx("span",{className:"absolute left-1.5 top-1/2 size-1.5 -translate-y-1/2 rounded-full bg-accent"}),e.jsx("span",{role:"checkbox",tabIndex:0,"aria-checked":r,"aria-label":`Select message from ${s.fromName}`,onPointerDown:I,onPointerMove:I,onPointerUp:I,onClick:i=>{i.preventDefault(),i.stopPropagation(),j()},onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),i.stopPropagation(),j())},className:"-m-2 inline-flex size-11 shrink-0 items-center justify-center rounded-full",children:e.jsx(ze,{name:s.fromName,email:s.fromEmail,size:"sm"})}),e.jsx(q,{thread:s})]});return e.jsxs("div",{className:"relative overflow-hidden",children:[N==="leading"&&e.jsx("button",{type:"button",onClick:()=>p("leading"),"aria-label":s.isRead?"Mark as unread":"Mark as read",className:"absolute inset-y-0 left-0 flex items-center justify-start bg-accent-2 px-6 text-accent-fg",children:s.isRead?e.jsx(Oe,{className:"size-6"}):e.jsx(Ce,{className:"size-6"})}),N==="trailing"&&e.jsx("button",{type:"button",onClick:()=>p("trailing"),"aria-label":"Delete message",className:"absolute inset-y-0 right-0 flex items-center justify-end bg-danger px-6 text-canvas",children:e.jsx(ce,{className:"size-6"})}),e.jsx("button",{type:"button",role:n?"checkbox":void 0,"aria-checked":n?r:void 0,"data-message-row":!0,"data-message-id":s.id,...a,className:C,style:D,children:T})]})}function We({sections:s,selectedThreadId:n,selectionMode:r,checkedIds:f,initialPeek:m,onToggleCheck:g,onEnterSelection:y,onOpenThread:j,onRefresh:h,refreshing:p,busy:d=!1}){const[b,v]=x.useState(new Set),[P,k]=x.useState(new Map),w=s.flatMap(a=>a.threads).filter(a=>!b.has(a.id)).map(a=>{const l=P.get(a.id);return l===void 0?a:{...a,isRead:l}}),[S,R]=x.useState(m&&m!=="none"&&w[1]?{id:w[1].id,side:m}:null),E=(a,l)=>{if(l==="trailing")v(N=>new Set(N).add(a));else{const N=w.find(C=>C.id===a);k(C=>new Map(C).set(a,!N?.isRead))}R(null)};return e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[p&&e.jsxs("div",{className:"flex items-center justify-center gap-2 border-b border-line py-3 text-fg-muted",children:[e.jsx(ve,{className:"size-4 animate-spin"}),e.jsx("span",{className:"text-xs",children:"Checking for new mail…"})]}),e.jsx("div",{className:"divide-y divide-line",children:w.map(a=>e.jsx("div",{className:d?"pointer-events-none opacity-50":void 0,children:e.jsx(Be,{thread:a,selectionMode:r,checked:f.has(a.id),active:a.id===n,peek:S?.id===a.id?S.side:"none",onPeek:l=>R(l==="none"?null:{id:a.id,side:l}),onToggleCheck:()=>g(a.id),onLongPress:()=>y(a.id),onOpen:()=>j(a.id),onAct:l=>E(a.id,l)})},a.id))}),!r&&!p&&!d&&e.jsx("button",{type:"button",onClick:h,className:"w-full border-t border-line py-2 text-center text-2xs text-fg-subtle transition-colors hover:bg-surface-sunken",children:"Pull to refresh"})]})}const Ye=new Set;function es({listTitle:s,listMeta:n,sections:r,briefFilters:f,flatList:m,listState:g="ready",searchQuery:y,listFilter:j,listScopeLabel:h,errorMessage:p,onRetry:d,onReportError:b,briefFilter:v,selectedThreadId:P,density:k="comfortable",onSelectThread:w,onOpenNav:S,isDesktop:R,initialTouchState:E,selection:a,keyboard:l,selectionBar:N,paneOverlay:C,listBody:D,hideHeader:F=!1}){const I=k==="compact"?Se:Me,T=x.useRef(null),i=x.useRef(null),o=le(l);ue({containerRef:T,itemSelector:Q,enabled:!o});const u=o?l.focusedId:void 0,M=o?u??r[0]?.threads[0]?.id:void 0,O=x.useCallback(t=>M===void 0?void 0:t===M?0:-1,[M]);x.useEffect(()=>{if(u===void 0)return;const t=i.current;if(!t)return;const c=t.querySelector(`${Q}[data-message-id="${u}"]`);!c||c===t.ownerDocument.activeElement||c.focus({preventScroll:!1})},[u]),x.useEffect(()=>{if(!o)return;const t=i.current;if(!t)return;const c=t.ownerDocument.activeElement;c!==null&&c!==t.ownerDocument.body||t.focus({preventScroll:!0})},[o]);const $=!R&&!f&&g==="ready",[H,Y]=x.useState(!1),ee=E==="peek-trailing"?"trailing":E==="peek-leading"?"leading":void 0,se=()=>{Y(!0),setTimeout(()=>Y(!1),1400)},_=a?.selectedIds??Ye,L=a?.onToggle,G=a?.onRowSelect,te=Re(_.size,R),X=x.useCallback(t=>{if(L)return{checked:_.has(t),onToggle:c=>{c.preventDefault(),c.stopPropagation(),L(t)}}},[_,L]),B=x.useCallback((t,c)=>G?.(t,ke(c))?(c.preventDefault(),c.shiftKey&&window.getSelection()?.removeAllRanges(),!0):!1,[G]),ne=x.useCallback(({thread:t,active:c,onClick:W})=>e.jsx(I,{thread:t,active:c,focused:t.id===u,tabIndex:O(t.id),selection:X(t.id),onClick:ae=>{B(t.id,ae)||W?.()}}),[I,X,B,u,O]);return e.jsxs("section",{ref:t=>{i.current=t,l?.ref(t)},tabIndex:o?-1:void 0,className:"relative flex h-full w-full flex-col bg-surface outline-none",children:[N??(F?null:e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[S&&e.jsx(A,{variant:"ghost",size:"sm",icon:e.jsx(Le,{className:"size-4"}),onClick:S,"aria-label":"Open folders",className:"-ml-1 shrink-0"}),e.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:s}),n&&e.jsx("span",{className:"shrink-0 text-2xs text-fg-subtle",children:n})]})),g==="loading"?e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(De,{})}):g==="empty"?e.jsx(Te,{filter:j,scopeLabel:h,searchQuery:y}):g==="error"?e.jsx($e,{message:p,onRetry:d,onReport:b}):f?e.jsx(de,{...v??{},sections:r,selectedThreadId:P,Row:ne,keyboard:l,onSelectThread:w}):D??($?e.jsx(We,{sections:r,selectedThreadId:P,selectionMode:te,checkedIds:_,initialPeek:ee,onToggleCheck:t=>L?.(t),onEnterSelection:t=>L?.(t),onOpenThread:t=>w?.(t),onRefresh:se,refreshing:H}):e.jsx("div",{ref:T,className:"flex-1 overflow-y-auto",children:r.map(t=>e.jsxs("div",{children:[!m&&t.label&&e.jsxs("div",{className:"sticky top-0 flex h-section-row items-center justify-between border-b border-line bg-surface-sunken px-row-inset",children:[e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:t.label}),e.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:t.threads.length})]}),e.jsx("div",{className:"divide-y divide-line",children:t.threads.map(c=>e.jsx(I,{thread:c,active:c.id===P,focused:c.id===u,tabIndex:O(c.id),selection:X(c.id),onClick:W=>{B(c.id,W)||w?.(c.id)}},c.id))})]},t.id))})),R&&e.jsx(Ee,{hints:l?we(l.handlers):je}),C]})}var Ge=class extends fe{constructor(s,n){super(s,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,n){const{state:r}=s,f=super.createResult(s,n),{isFetching:m,isRefetching:g,isError:y,isRefetchError:j}=f,h=r.fetchMeta?.fetchMore?.direction,p=y&&h==="forward",d=m&&h==="forward",b=y&&h==="backward",v=m&&h==="backward";return{...f,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:xe(n,r.data),hasPreviousPage:me(n,r.data),isFetchNextPageError:p,isFetchingNextPage:d,isFetchPreviousPageError:b,isFetchingPreviousPage:v,isRefetchError:j&&!p&&!b,isRefetching:g&&!d&&!v}}};function ss(s,n){return ge(s,Ge)}function ts({title:s,unreadCount:n,preset:r,selectedCategory:f,activeFilters:m,onSelectCategory:g,onToggleFilter:y,onSelectSource:j,onClearFilters:h,children:p,footer:d,searchResults:b,searchLoading:v,relatedResults:P,relatedLoading:k,onSelectSearchResult:w,searchResultsLabel:S,relatedResultsLabel:R,searchResultsInBody:E,refreshControl:a}){const{searchInput:l}=he(),N=l.trim().length>0,C={categories:r.categories,filters:r.filters,sources:r.sources,selectedCategory:f,activeFilters:m,onSelectCategory:g,onSelectSource:j,onToggleFilter:y,onClear:h};return e.jsx(pe,{hasSheet:!N,children:e.jsx(Ie,{title:s,unreadCount:n,footer:d,searchFilter:C,searchResults:b,searchLoading:v,relatedResults:P,relatedLoading:k,onSelectSearchResult:w,searchResultsLabel:S,relatedResultsLabel:R,searchResultsInBody:E,refreshControl:a,children:e.jsx(be,{...C,hideChrome:N,children:p})})})}export{Ze as M,Be as S,es as a,ts as b,ss as u};
|