@remit/web-client-dist 0.0.435 → 0.0.436
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-CE93iCPr.js → BriefPane-BaWOPD1j.js} +1 -1
- package/assets/{ErrorState-WU8paRcb.js → ErrorState-SR7HXMCp.js} +1 -1
- package/assets/{FlaggedPane--YaOQH14.js → FlaggedPane-bpn-dBVE.js} +1 -1
- package/assets/{FullCompose-BMZ1sIF5.js → FullCompose-Ctbbyn_P.js} +1 -1
- package/assets/{MailListHeader-BZUH36MN.js → MailListHeader-DUsWWdtv.js} +1 -1
- package/assets/{MailShell-De5YFONf.js → MailShell-BT5CzwYc.js} +1 -1
- package/assets/{MailViewChrome-DeV9Kn27.js → MailViewChrome-BbtvPHLk.js} +1 -1
- package/assets/{MailboxPane-PAA5o2XB.js → MailboxPane-DaKBt5ND.js} +1 -1
- package/assets/{NavMenuButton-BAheKj6z.js → NavMenuButton-BrYI0UMa.js} +1 -1
- package/assets/{OnboardingWizard-BVeAuWWz.js → OnboardingWizard-DGQ0jfPp.js} +1 -1
- package/assets/{OutboxPane-dU18PCRw.js → OutboxPane-AMa2mcsZ.js} +1 -1
- package/assets/_mailboxId-B7BBnqOz.js +1 -0
- package/assets/_messageId-CYE4siVX.js +1 -0
- package/assets/_messageId-Cc2WYmor.js +1 -0
- package/assets/_messageId-vOzQwhv8.js +1 -0
- package/assets/_outboxMessageId-Bi8xG7Li.js +1 -0
- package/assets/_threadId-Dfmy2Wwu.js +1 -0
- package/assets/_threadId-DtnqzpiE.js +1 -0
- package/assets/_threadId-e0Rw2o_U.js +1 -0
- package/assets/{accounts-D_H-P5al.js → accounts-CfzT4V4B.js} +1 -1
- package/assets/{advanced-BuUqhky7.js → advanced-B72Qd8pO.js} +1 -1
- package/assets/{appearance-hMIIC33M.js → appearance-CgVrb3-2.js} +1 -1
- package/assets/{attachment-file-ChOgFw1d.js → attachment-file-e6GW9r52.js} +1 -1
- package/assets/{avatar-C1kF9MNm.js → avatar-COcR-Yn4.js} +1 -1
- package/assets/{bottom-sheet-c62LOMtp.js → bottom-sheet-BtQSsjLr.js} +1 -1
- package/assets/brief-DN4WEDBy.js +1 -0
- package/assets/{brief-DZBJs3Of.js → brief-DZXQ6rzf.js} +1 -1
- package/assets/{browser-ponyfill-DsRvNesb.js → browser-ponyfill-5Jmp1msx.js} +1 -1
- package/assets/{bug-bAaPregC.js → bug-vo80J4LO.js} +1 -1
- package/assets/{circle-check-big-CHTuUhmt.js → circle-check-big-BrnlrKGs.js} +1 -1
- package/assets/{circle-check-DudN_n8m.js → circle-check-lJ65poup.js} +1 -1
- package/assets/{circle-help-DtfJUknv.js → circle-help-D8SiCh5v.js} +1 -1
- package/assets/{clock-CLr3vhni.js → clock-DSBZCny8.js} +1 -1
- package/assets/compose._-_outboxMessageId_-Bnd4Pd2Q.js +1 -0
- package/assets/compose._-_outboxMessageId_-BzB-vryW.js +1 -0
- package/assets/compose._-_outboxMessageId_-DZyjsMrH.js +1 -0
- package/assets/compose._-_outboxMessageId_-Xdu-5m9J.js +1 -0
- package/assets/{confirm-dialog-DeZ_9x2D.js → confirm-dialog-hMUgIb67.js} +1 -1
- package/assets/{download-COB-Ichs.js → download-BCYg5JPP.js} +1 -1
- package/assets/{filters-C3GwkGEi.js → filters-C_j3WmwZ.js} +1 -1
- package/assets/{flagged-dZcn0s4E.js → flagged-DH7PuqQQ.js} +1 -1
- package/assets/flagged-G4-mQMoE.js +1 -0
- package/assets/{folders-DrY12Xiy.js → folders-DmpSkVDO.js} +1 -1
- package/assets/{help-copy-BGzcQOqJ.js → help-copy-DS_bsLHC.js} +1 -1
- package/assets/index-03-lu2BM.js +1 -0
- package/assets/index-9Pkyvi-T.js +1 -0
- package/assets/index-C7DCdO7K.js +1 -0
- package/assets/{index-k7ZH-ntd.js → index-CBNp-llx.js} +3 -3
- package/assets/index-CYE4siVX.js +1 -0
- package/assets/index-D8sOhB0M.js +1 -0
- package/assets/index-DGMS3XHH.js +1 -0
- package/assets/{index-DDQC_-SF.js → index-DXrRPYx2.js} +4 -4
- package/assets/index-SAWrBWVQ.js +1 -0
- package/assets/index-vOzQwhv8.js +1 -0
- package/assets/{kbd-B8Kzi4ce.js → kbd-C1K7eslD.js} +1 -1
- package/assets/{labels-BaBe2pyj.js → labels-DR_xR9i4.js} +1 -1
- package/assets/{mail-Co_RbqEb.js → mail-Cd43oa34.js} +1 -1
- package/assets/{mail-CY6brKIm.js → mail-b9HhGqLt.js} +1 -1
- package/assets/{menu-ChACEtAT.js → menu-CcW4Wr_9.js} +1 -1
- package/assets/{onboarding-CKiFNdoe.js → onboarding-BBEW0aqz.js} +1 -1
- package/assets/outbox-CP1Cq2tD.js +1 -0
- package/assets/{pencil-HM3U5V5r.js → pencil-BR-dCXQJ.js} +1 -1
- package/assets/{rich-text-BZHxkXDy.js → rich-text-5MOv7gBw.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-CShGkBGJ.js → rich-text-spellcheck-worker-provider-LpMQc0ys.js} +1 -1
- package/assets/{rotate-ccw-4njmyIsB.js → rotate-ccw-DJxd-PkP.js} +1 -1
- package/assets/{row-actions-B2FwppeN.js → row-actions-BnzXJfcw.js} +1 -1
- package/assets/{search-mirror-C-nDRfAj.js → search-mirror-BtubY4as.js} +1 -1
- package/assets/{search-token-index-pcFPHJpd.js → search-token-index-BQMRJt8c.js} +1 -1
- package/assets/{senders-C65aT7Cq.js → senders-1JRt7YFd.js} +1 -1
- package/assets/settings-iDvwiQWF.js +1 -0
- package/assets/{settings-screen-B1OWaFOu.js → settings-screen-C8uViHtb.js} +1 -1
- package/assets/{shield-check-BJZxBNxI.js → shield-check-Lsl_-cAn.js} +1 -1
- package/assets/{suggested-vips-DeZLC7pv.js → suggested-vips-DsgC95zf.js} +1 -1
- package/assets/{useDebouncedValue-DhDIauKO.js → useDebouncedValue-kyZq57X5.js} +1 -1
- package/assets/{useFilters-A5bbtysP.js → useFilters-DLfMq1hl.js} +1 -1
- package/assets/{useLabels-BvNn-ceD.js → useLabels-BJ9gy1Q2.js} +1 -1
- package/assets/{useMessageBodyContent-Dyt5ksdW.js → useMessageBodyContent-Dr5dvjkL.js} +1 -1
- package/assets/{useRefreshControl-BXkRujMt.js → useRefreshControl-ORv6jQgg.js} +1 -1
- package/assets/{useSearchTokenContext-DtsR9mAt.js → useSearchTokenContext-SO0wjc97.js} +1 -1
- package/assets/{useSemanticSearch-CP9_f79j.js → useSemanticSearch-D6Snq9cY.js} +1 -1
- package/assets/{useSignature-DRsfqIVE.js → useSignature-DZQ9ecpk.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/_mailboxId-BLWMIY6k.js +0 -1
- package/assets/_messageId-CLyM-Pf3.js +0 -1
- package/assets/_messageId-DmTLuvIX.js +0 -1
- package/assets/_messageId-x8ckMOQH.js +0 -1
- package/assets/_outboxMessageId-DKuZXsbN.js +0 -1
- package/assets/_threadId-BST4-H3I.js +0 -1
- package/assets/_threadId-BoPEk136.js +0 -1
- package/assets/_threadId-fjkpaJnM.js +0 -1
- package/assets/brief-DuJvIThu.js +0 -1
- package/assets/compose._-_outboxMessageId_-VVBwYevV.js +0 -1
- package/assets/compose._-_outboxMessageId_-Yn5g5eva.js +0 -1
- package/assets/compose._-_outboxMessageId_-sbg6SQAq.js +0 -1
- package/assets/compose._-_outboxMessageId_-xi1uPLsh.js +0 -1
- package/assets/flagged-E6dxVWSM.js +0 -1
- package/assets/index-C1zgU1sd.js +0 -1
- package/assets/index-Dez1ypT7.js +0 -1
- package/assets/index-DiKEkpVO.js +0 -1
- package/assets/index-DmTLuvIX.js +0 -1
- package/assets/index-DntvrKQw.js +0 -1
- package/assets/index-LsGCT8zA.js +0 -1
- package/assets/index-R7qgp6Mt.js +0 -1
- package/assets/index-x8ckMOQH.js +0 -1
- package/assets/outbox-xvPGw_Zp.js +0 -1
- package/assets/settings-Btc9vamv.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n,ar as Xe,S as Ze,bS as es,v as Y,b3 as ss,bF as ts,r as a,D as ne,bT as oe,z as ns,bU as os,bV as as,bW as rs,e as Te,bX as is,a8 as cs,bP as ls,bQ as ds}from"./index-DDQC_-SF.js";import{s as je,a as us,b as Re,u as ms,p as fs,R as hs}from"./useSearchTokenContext-DtsR9mAt.js";import{aa as be,H as ve,ab as gs,ac as xs,I as ps,ad as ye,ae as Is,af as bs,ag as vs,a9 as ys,ah as Ss,ai as Cs,aj as Ts,M as js,ak as Rs,al as ws,am as Ms,e as ks,v as Fs,an as As,q as Ns,S as Os,L as Bs,Q as Se,P as Ds,N as Ls,d as Es,_ as Ps,$ as qs,a1 as we,a2 as Me,a3 as zs,a4 as Qs,a5 as Hs}from"./MailListHeader-BZUH36MN.js";import{u as _s,a as Ws,R as $s,i as Us,b as Vs}from"./useRefreshControl-BXkRujMt.js";import{f as Gs,p as Ys,d as Js,R as Ks,k as Xs,l as Zs}from"./search-token-index-pcFPHJpd.js";import{a as et}from"./useLabels-BvNn-ceD.js";import{u as st,r as tt,L as nt}from"./useSemanticSearch-CP9_f79j.js";import{w as ot}from"./wizard-selection-B1bng5Jq.js";import{u as ke}from"./index-k7ZH-ntd.js";import{a as at}from"./useMessageBodyContent-Dyt5ksdW.js";function rt({sync:e}){return e?n.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:[n.jsx(Xe,{className:"size-8 animate-spin text-fg-subtle","aria-hidden":"true"}),n.jsx("p",{className:"text-sm font-medium text-fg",children:"Still syncing your mail"}),n.jsx("p",{className:"text-xs text-fg-subtle",children:it(e)})]}):n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-12 text-center px-4",children:[n.jsx(Ze,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),n.jsx("p",{className:"text-sm font-medium text-fg",children:"You're caught up"}),n.jsx("p",{className:"text-xs text-fg-subtle",children:"Nothing needs attention."})]})}function it({synced:e,total:s}){return s>0?`${e.toLocaleString()} of ${s.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",ct={unclassified:"uncategorized"},W=e=>us(e).map(s=>s.raw),_=e=>e.join(" "),ae=e=>{const s=Re(e);if(s)return Fe.find(o=>o.name===s.name&&o.value===s.value.toLowerCase())?.id},re=e=>{const s=Re(e);if(!s||s.name!==Ae)return;const o=s.value.toLowerCase(),r=ct[o];if(r)return r;if(!(!es(o)||o==="all"))return o},Ne=e=>Fe.find(s=>s.id===e),Oe=e=>Ne(e)!==void 0,lt=e=>{const s=new Set;for(const o of W(e)){const r=ae(o);r&&s.add(r)}return s},dt=e=>{let s="all";for(const o of W(e)){const r=re(o);r&&(s=r)}return s},ut=(e,s)=>{const o=Ne(s);if(!o)return;const r=W(e),l=r.filter(d=>ae(d)!==s);return l.length<r.length?_(l):_([...r,je(o.name,o.value)])},mt=(e,s)=>{const o=W(e).filter(r=>!re(r));return _(s==="all"?o:[...o,je(Ae,s)])},ft=e=>_(W(e).filter(s=>!ae(s)&&!re(s))),Be=e=>e.trim().length>0,ht=e=>{if(!Be(e.query))return e.ownFilters;const s=new Set(lt(e.query));for(const o of e.ownFilters)Oe(o)||s.add(o);return s},gt=e=>Be(e.query)?dt(e.query):e.ownCategory,xt=(e,s)=>e.createdAt!==s.createdAt?e.createdAt-s.createdAt:e.accountId.localeCompare(s.accountId),pt=e=>[...e].sort(xt),It=200,Ce=()=>n.jsx("div",{className:"animate-pulse",children:Array.from({length:3}).map((e,s)=>n.jsxs("div",{className:"flex items-start gap-3 py-2 pl-5 pr-4 border-b border-line",children:[n.jsx("div",{className:"size-7 rounded-full bg-surface-sunken shrink-0 mt-0.5"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsxs("div",{className:"flex justify-between gap-2",children:[n.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-28"}),n.jsx("div",{className:"h-3 bg-surface-sunken rounded w-12"})]}),n.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-48"}),n.jsx("div",{className:"h-3 bg-surface-sunken rounded w-full"})]})]},s))}),bt=({accountEmail:e})=>{const s=ke();return n.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:[n.jsx(Te,{className:"size-3.5 shrink-0"}),n.jsxs("span",{className:"flex-1 truncate",children:[e," can't connect"]}),n.jsx("button",{type:"button",onClick:()=>s("accounts"),className:"shrink-0 underline text-danger hover:opacity-80",children:"Reconnect"})]})},vt=(e,s)=>{if(s.size===0)return{};const o=e.filter(d=>s.has(d.id)),r=tt(o.map(d=>d.accountId));if(r.restriction)return r;const l=new Set;for(const d of o)d.mailboxId&&l.add(d.mailboxId);return l.size>1?{accountId:r.accountId,restriction:"spansFolders",moveDisabledHint:`Move only works within one folder — this selection spans ${l.size} folders`}:{accountId:r.accountId,mailboxId:l.size===1?[...l][0]:void 0}};function yt({header:e,rows:s,wizard:o,children:r}){const{selectedIds:l,selectedCount:d,exitSelection:u,orderedIds:m,allSelected:b,toggleAllLoaded:f}=Ms(),x=a.useMemo(()=>vt(s,l),[s,l]),{junkMailboxId:D}=ks(x.accountId),{labels:I}=et(x.accountId),p=a.useMemo(()=>Array.from(l),[l]),L=a.useMemo(()=>ot(s,l),[s,l]),h=Fs(D,x.mailboxId),v=a.useMemo(()=>m.length>0?{checked:b,indeterminate:d>0&&!b,onChange:f}:void 0,[m.length,b,d,f]),F=x.moveDisabledHint?{tone:"warning",text:x.moveDisabledHint}:void 0,S=C=>n.jsx(Os,{title:C.title,navSlot:C.navSlot,titleMeta:C.titleMeta,searchSlot:C.searchSlot,searchField:C.searchField,idleSlot:C.makeFilterSlot,count:d,onCancel:u,onDelete:()=>o.start("delete"),onMove:()=>o.start("move"),onOrganize:()=>o.start("organize"),onJunk:h?()=>o.start("junk"):void 0,onMarkRead:()=>o.start("markRead"),overflowSlot:x.accountId&&x.mailboxId&&d>0&&I.length>0?n.jsx(nt,{accountId:x.accountId,mailboxId:x.mailboxId,messageIds:p}):void 0,selectAll:v,notice:F});return n.jsx(As,{...e,selectionBar:S,paneOverlay:n.jsx(Ns,{verb:o.verb,accountId:x.accountId,mailboxId:x.mailboxId,selection:L,selectionRestriction:x.restriction,onFinished:u}),children:r})}function St({accounts:e,selectedMessageId:s,onOpenThread:o,commandsRef:r,onTriageContextChange:l,onDeleteMessages:d}){const{searchQuery:u,searchInput:m,resultFolderIndex:b,onSearchChange:f}=Y(),x=ms(),D=ss(),I=Gs(),p=ts(),L=Ys(),h=a.useMemo(()=>pt(e.filter(t=>!t.muted?.value)),[e]),[v,F]=a.useState("all"),[S,C]=a.useState("all"),[$,E]=a.useState(new Set),[K,T]=a.useState(!1),P=a.useCallback(t=>{E(i=>{const c=new Set(i);return c.has(t)?c.delete(t):c.add(t),c})},[]),U=a.useCallback(()=>E(new Set),[]),R=m.trim().length>0,j=a.useMemo(()=>ht({query:m,ownFilters:$}),[m,$]),w=a.useMemo(()=>gt({query:m,ownCategory:S}),[m,S]),A=a.useCallback(t=>{if(!R||!Oe(t)){P(t);return}const i=ut(m,t);i!==void 0&&f(i)},[R,m,f,P]),q=a.useCallback(t=>{if(!R){C(t);return}f(mt(m,t))},[R,m,f]),z=a.useCallback(()=>{C("all"),F("all"),U(),R&&f(ft(m))},[R,m,f,U]),{data:N,isLoading:Q,isError:g,refetch:O}=ne({...oe(),staleTime:6e4}),B=Js({queries:h.map(t=>({...ns({path:{accountId:t.accountId}}),staleTime:1/0,meta:{softError:!0}}))}),V=a.useMemo(()=>{const t=new Map;for(let i=0;i<h.length;i++){const c=h[i].accountId,Ye=(B[i]?.data?.items??[]).reduce((Je,Ke)=>Je+(Ke.unseenCount??0),0);t.set(c,Ye)}return t},[h,B]),Ee=a.useMemo(()=>h.filter((t,i)=>{const c=B[i];return c?.isError?!os(c.error):!1}),[h,B]),{freeText:M,tokens:X}=fs(u.trim().toLowerCase(),x),{data:ie,isFetching:Pe}=ne({...oe({query:{query:M,limit:It}}),enabled:M.length>0,staleTime:3e4}),y=a.useMemo(()=>{const t=be(N?.items??[]).map(ve);return(M?gs(t.filter(c=>xs(c,M)),be(ie?.items??[]).map(ve)):t).filter(c=>(v==="all"||c.accountId===v)&&ps(c,X))},[N,ie,v,M,X]),{bodyRows:ce,briefSpamOffer:Z}=a.useMemo(()=>{if(!M)return{bodyRows:y,briefSpamOffer:void 0};const t=y.map(k=>ye(k,b)),{spam:i}=Is(t);if(i.length===0)return{bodyRows:y,briefSpamOffer:void 0};const c=new Set(i.map(k=>k.id));return{bodyRows:y.filter(k=>!c.has(k.id)),briefSpamOffer:bs(t)}},[y,M,b]),le=a.useMemo(()=>vs(ce),[ce]),de=a.useCallback((t,i)=>{const c=y.find(k=>k.id===t)?.threadId;c&&o?.({threadId:c,messageId:t},i)},[y,o]),qe=a.useCallback(t=>{const i=t.threadId??y.find(c=>c.id===t.id)?.threadId;i&&o?.({threadId:i,messageId:t.id})},[y,o]),ee=a.useMemo(()=>h.length<=1?[]:[{id:"all",label:"All",active:v==="all"},...h.map(t=>({id:t.accountId,label:t.email.split("@")[0]??t.email,count:V.get(t.accountId),active:v===t.accountId}))],[h,V,v]),H=a.useMemo(()=>e.filter(t=>t.muted?.value).length,[e]),ze=a.useMemo(()=>Array.from(V.values()).reduce((t,i)=>t+i,0),[V]),se=a.useMemo(()=>h.map(t=>t.accountId),[h]),{hasNewMail:ue}=_s(),{state:me,errorMessage:fe,refresh:he}=Ws(se,{onSettled:()=>O()}),Qe=a.useMemo(()=>n.jsx($s,{state:me,onRefresh:he,label:"Refresh daily brief",errorMessage:fe,hasUpdate:ue(se)}),[me,he,fe,ue,se]),te=a.useMemo(()=>y.filter(t=>(w==="all"||t.category===w)&&as(t,j)).map(t=>ye(t,b)),[y,w,j,b]),{hits:ge,isLoading:He}=st(),_e=a.useMemo(()=>{const t=new Map;for(const c of N?.items??[])t.set(c.messageId,c.threadId);const i=te.map(c=>t.get(c.id)).filter(c=>c!=null);return ys(ge,i,b)},[ge,te,N,b]),We=a.useMemo(()=>{const t=Ss(ee.map(i=>({id:i.id,label:i.label,count:i.count,active:i.active})));return{categories:t.categories,filters:t.filters,sources:t.sources,sourcesNote:H>0?`+${H} muted`:void 0,selectedCategory:w,activeFilters:j,expanded:K,onExpandedChange:T,onSelectCategory:i=>q(i),onSelectSource:F,onToggleFilter:i=>A(i),onClear:z}},[ee,H,w,j,K,A,q,z]),xe=le.length===0&&v==="all"&&M.length===0&&X.length===0,$e=a.useMemo(()=>h.map(t=>t.accountId),[h]),Ue=a.useMemo(()=>h.some(t=>Us(t.syncPhase)),[h]),G=Vs($e,xe||Ue),pe=n.jsxs("div",{className:"h-full overflow-y-auto",children:[n.jsx(Ce,{}),n.jsx(Ce,{})]}),Ie=!Q&&!g&&!xe,Ve=Cs({tier:I,hasLiveInput:R,hasCommittedQuery:u.trim().length>0,bodyRendersCommittedResults:!0}),Ge=Ie?n.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[Z&&n.jsx(Ts,{count:Z.count,onScopeToSpam:()=>L(Z.mailboxId,u)}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(rs,{sections:le,briefCategory:w,Row:js,selectedThreadId:s,onSelectThread:de,onSelectBriefCategory:q,sources:ee,sourcesNote:H>0?`+${H} muted`:void 0,onSelectSource:F,activeFilters:j,onToggleFilter:A,onClearFilters:z})})]}):Q?pe:g?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 py-12 text-sm text-fg-muted",children:[n.jsx(Te,{className:"size-8 text-danger"}),n.jsx("p",{children:"Couldn't load your messages"}),n.jsxs("button",{type:"button",onClick:()=>O(),className:"flex items-center gap-1 text-accent underline text-xs",children:[n.jsx(Ks,{className:"size-3.5"}),"Try again"]})]}):G.resolved?n.jsx(rt,{sync:G.syncing?{synced:G.synced,total:G.total}:void 0}):pe;return n.jsx(is,{hasSheet:Ie&&!Ve,children:n.jsx(Rs,{selectedMessageId:s,rows:y,onOpen:de,onDeleteMessages:d,onSelectionVerb:p.start,wizardOpen:p.isOpen,commandsRef:r,onTriageContextChange:l,children:n.jsx(yt,{wizard:p,header:{title:"Daily brief",unreadCount:ze,footer:D?n.jsx(ws,{}):void 0,searchFilter:We,searchResults:te,searchLoading:Q||Pe,relatedResults:_e,relatedLoading:He,onSelectSearchResult:qe,searchResultsInBody:!0,refreshControl:Qe},rows:y,children:n.jsxs("div",{className:"flex h-full flex-col",children:[Ee.map(t=>n.jsx(bt,{accountEmail:t.email,accountId:t.accountId},t.accountId)),n.jsx("div",{className:"min-h-0 flex-1",children:Ge})]})})})})}const De=a.createContext(null);function J(){const e=a.useContext(De);if(!e)throw new Error("BriefPane.* must be used inside <BriefPane>");return e}function Ct({thread:e,children:s}){const o=Xs(),r=Zs(),l=ke(),{searchInput:d}=Y(),u=e?.threadId,m=e?.messageId,{data:b}=ne({...oe(),staleTime:6e4}),f=a.useMemo(()=>b?.items??[],[b]),x=a.useMemo(()=>{if(u)return f.find(g=>g.messageId===m)??f.find(g=>g.threadId===u)},[f,u,m]),D=Bs(u,m),I=x??D,p=m??I?.messageId,L=a.useMemo(()=>{if(u)return{threadId:u,mailboxId:I?.mailboxId??"",subject:I?.subject,messageId:p,authenticity:I?.authenticity}},[u,I,p]),h=a.useCallback((g,O)=>{o(g,{replace:O?.replace,query:d})},[o,d]),v=a.useCallback(g=>{p&&g.includes(p)&&r()},[p,r]),F=Se({thread:I,onAfterOptimisticRemove:v}),S=Ds(),{deleteMessages:C}=Ls({mailboxId:I?.mailboxId??"",messages:f,onAfterOptimisticRemove:v}),{toggleReadFor:$}=Es({mailboxId:I?.mailboxId??"",messages:f}),E=S.focusedMessageId,T=a.useMemo(()=>f.find(g=>g.messageId===E),[f,E])??I,P=Se({thread:T}),U=at(),R=cs(),j=ls(),w=a.useMemo(()=>ds(j,u,p),[j,u,p]),A=a.useMemo(()=>{if(T)return g=>j({threadId:T.threadId,messageId:T.messageId,mode:g})},[j,T]),{nextMessageId:q,previousMessageId:z}=Ps({context:S,orderedIds:S.orderedIds,selectedMessageId:p,enabled:!U&&!R,onClose:r,handlers:{reply:()=>A?.("reply"),replyAll:()=>A?.("reply-all"),forward:()=>A?.("forward"),delete:()=>{S.listCommandsRef.current?.requestVerb("delete")||P.deleteThread()},toggleStar:P.toggleStar,toggleRead:()=>{S.listCommandsRef.current?.requestVerb("markRead")||T&&$([T.messageId],!T.isRead)},goFlagged:()=>l("flagged"),goSettings:()=>l("settings")}}),N=a.useCallback(g=>{if(!g)return;const O=f.find(B=>B.messageId===g);return O?{threadId:O.threadId,messageId:g}:void 0},[f]),Q={selectedMessageId:p,selectedThread:I,conversation:L,onOpenThread:h,onCloseThread:r,nextThread:N(q),previousThread:N(z),actions:F,onReply:w,triage:S,onDeleteMessages:C,handleDeselectIfRemoved:v};return n.jsx(De.Provider,{value:Q,children:s})}function Le(){const{selectedMessageId:e,onOpenThread:s,triage:o,onDeleteMessages:r}=J(),{accounts:l}=Y();return n.jsx(St,{accounts:l,selectedMessageId:e,onOpenThread:s,commandsRef:o.listCommandsRef,onTriageContextChange:o.onTriageContextChange,onDeleteMessages:r})}function Tt(){const{conversation:e,selectedThread:s,actions:o,onReply:r,handleDeselectIfRemoved:l}=J(),d=!!e,u=Qs(e?.threadId);return n.jsxs(n.Fragment,{children:[n.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[n.jsx(Hs,{hasThread:d,intelligenceOpen:u.isShowing,canToggleIntelligence:u.canToggle,onToggleIntelligence:u.toggle,onReply:r?()=>r("reply"):void 0,onReplyAll:r?()=>r("reply-all"):void 0,onForward:r?()=>r("forward"):void 0,onDelete:d?o.deleteThread:void 0,onToggleStar:d?o.toggleStar:void 0,isStarred:o.isStarred,moveContext:d&&o.accountId&&o.mailboxId?{accountId:o.accountId,currentMailboxId:o.mailboxId,onMove:o.moveThread}:void 0}),n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?n.jsx(we,{threadId:e.threadId,mailboxId:e.mailboxId,subject:e.subject,selectedMessageId:e.messageId,authenticity:e.authenticity,onOpenIntelligence:u.open}):n.jsx(hs,{})})]}),n.jsx(Me,{isOpen:u.drawerOpen,onClose:u.closeDrawer,thread:s,mailboxId:s?.mailboxId,accountId:s?.accountId,onAfterOptimisticRemove:l})]})}function jt(){const{selectedThread:e,handleDeselectIfRemoved:s}=J(),{onToggleIntelligence:o}=Y();return n.jsx(zs,{onClose:o,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:s})}function Rt(){const{selectedThread:e,conversation:s,onOpenThread:o,onCloseThread:r,nextThread:l,previousThread:d,handleDeselectIfRemoved:u}=J(),m=qs(s?.threadId??null);return s?n.jsxs(n.Fragment,{children:[n.jsx(we,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:r,onOpenIntelligence:m.toggle,onSwipeNext:l?()=>o(l):void 0,onSwipePrevious:d?()=>o(d):void 0,mobileIntelligenceOpen:m.isOpen}),n.jsx(Me,{isOpen:m.isOpen,onClose:m.close,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:u})]}):n.jsx("div",{className:"h-full",children:n.jsx(Le,{})})}const Et=Object.assign(Ct,{List:Le,Reading:Tt,Intelligence:jt,Phone:Rt});export{Et as B};
|
|
1
|
+
import{j as n,ar as Xe,S as Ze,bS as es,v as Y,b3 as ss,bF as ts,r as a,D as ne,bT as oe,z as ns,bU as os,bV as as,bW as rs,e as Te,bX as is,a8 as cs,bP as ls,bQ as ds}from"./index-DXrRPYx2.js";import{s as je,a as us,b as Re,u as ms,p as fs,R as hs}from"./useSearchTokenContext-SO0wjc97.js";import{aa as be,H as ve,ab as gs,ac as xs,I as ps,ad as ye,ae as Is,af as bs,ag as vs,a9 as ys,ah as Ss,ai as Cs,aj as Ts,M as js,ak as Rs,al as ws,am as Ms,e as ks,v as Fs,an as As,q as Ns,S as Os,L as Bs,Q as Se,P as Ds,N as Ls,d as Es,_ as Ps,$ as qs,a1 as we,a2 as Me,a3 as zs,a4 as Qs,a5 as Hs}from"./MailListHeader-DUsWWdtv.js";import{u as _s,a as Ws,R as $s,i as Us,b as Vs}from"./useRefreshControl-ORv6jQgg.js";import{f as Gs,p as Ys,d as Js,R as Ks,k as Xs,l as Zs}from"./search-token-index-BQMRJt8c.js";import{a as et}from"./useLabels-BJ9gy1Q2.js";import{u as st,r as tt,L as nt}from"./useSemanticSearch-D6Snq9cY.js";import{w as ot}from"./wizard-selection-B1bng5Jq.js";import{u as ke}from"./index-CBNp-llx.js";import{a as at}from"./useMessageBodyContent-Dr5dvjkL.js";function rt({sync:e}){return e?n.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:[n.jsx(Xe,{className:"size-8 animate-spin text-fg-subtle","aria-hidden":"true"}),n.jsx("p",{className:"text-sm font-medium text-fg",children:"Still syncing your mail"}),n.jsx("p",{className:"text-xs text-fg-subtle",children:it(e)})]}):n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-12 text-center px-4",children:[n.jsx(Ze,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),n.jsx("p",{className:"text-sm font-medium text-fg",children:"You're caught up"}),n.jsx("p",{className:"text-xs text-fg-subtle",children:"Nothing needs attention."})]})}function it({synced:e,total:s}){return s>0?`${e.toLocaleString()} of ${s.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",ct={unclassified:"uncategorized"},W=e=>us(e).map(s=>s.raw),_=e=>e.join(" "),ae=e=>{const s=Re(e);if(s)return Fe.find(o=>o.name===s.name&&o.value===s.value.toLowerCase())?.id},re=e=>{const s=Re(e);if(!s||s.name!==Ae)return;const o=s.value.toLowerCase(),r=ct[o];if(r)return r;if(!(!es(o)||o==="all"))return o},Ne=e=>Fe.find(s=>s.id===e),Oe=e=>Ne(e)!==void 0,lt=e=>{const s=new Set;for(const o of W(e)){const r=ae(o);r&&s.add(r)}return s},dt=e=>{let s="all";for(const o of W(e)){const r=re(o);r&&(s=r)}return s},ut=(e,s)=>{const o=Ne(s);if(!o)return;const r=W(e),l=r.filter(d=>ae(d)!==s);return l.length<r.length?_(l):_([...r,je(o.name,o.value)])},mt=(e,s)=>{const o=W(e).filter(r=>!re(r));return _(s==="all"?o:[...o,je(Ae,s)])},ft=e=>_(W(e).filter(s=>!ae(s)&&!re(s))),Be=e=>e.trim().length>0,ht=e=>{if(!Be(e.query))return e.ownFilters;const s=new Set(lt(e.query));for(const o of e.ownFilters)Oe(o)||s.add(o);return s},gt=e=>Be(e.query)?dt(e.query):e.ownCategory,xt=(e,s)=>e.createdAt!==s.createdAt?e.createdAt-s.createdAt:e.accountId.localeCompare(s.accountId),pt=e=>[...e].sort(xt),It=200,Ce=()=>n.jsx("div",{className:"animate-pulse",children:Array.from({length:3}).map((e,s)=>n.jsxs("div",{className:"flex items-start gap-3 py-2 pl-5 pr-4 border-b border-line",children:[n.jsx("div",{className:"size-7 rounded-full bg-surface-sunken shrink-0 mt-0.5"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsxs("div",{className:"flex justify-between gap-2",children:[n.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-28"}),n.jsx("div",{className:"h-3 bg-surface-sunken rounded w-12"})]}),n.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-48"}),n.jsx("div",{className:"h-3 bg-surface-sunken rounded w-full"})]})]},s))}),bt=({accountEmail:e})=>{const s=ke();return n.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:[n.jsx(Te,{className:"size-3.5 shrink-0"}),n.jsxs("span",{className:"flex-1 truncate",children:[e," can't connect"]}),n.jsx("button",{type:"button",onClick:()=>s("accounts"),className:"shrink-0 underline text-danger hover:opacity-80",children:"Reconnect"})]})},vt=(e,s)=>{if(s.size===0)return{};const o=e.filter(d=>s.has(d.id)),r=tt(o.map(d=>d.accountId));if(r.restriction)return r;const l=new Set;for(const d of o)d.mailboxId&&l.add(d.mailboxId);return l.size>1?{accountId:r.accountId,restriction:"spansFolders",moveDisabledHint:`Move only works within one folder — this selection spans ${l.size} folders`}:{accountId:r.accountId,mailboxId:l.size===1?[...l][0]:void 0}};function yt({header:e,rows:s,wizard:o,children:r}){const{selectedIds:l,selectedCount:d,exitSelection:u,orderedIds:m,allSelected:b,toggleAllLoaded:f}=Ms(),x=a.useMemo(()=>vt(s,l),[s,l]),{junkMailboxId:D}=ks(x.accountId),{labels:I}=et(x.accountId),p=a.useMemo(()=>Array.from(l),[l]),L=a.useMemo(()=>ot(s,l),[s,l]),h=Fs(D,x.mailboxId),v=a.useMemo(()=>m.length>0?{checked:b,indeterminate:d>0&&!b,onChange:f}:void 0,[m.length,b,d,f]),F=x.moveDisabledHint?{tone:"warning",text:x.moveDisabledHint}:void 0,S=C=>n.jsx(Os,{title:C.title,navSlot:C.navSlot,titleMeta:C.titleMeta,searchSlot:C.searchSlot,searchField:C.searchField,idleSlot:C.makeFilterSlot,count:d,onCancel:u,onDelete:()=>o.start("delete"),onMove:()=>o.start("move"),onOrganize:()=>o.start("organize"),onJunk:h?()=>o.start("junk"):void 0,onMarkRead:()=>o.start("markRead"),overflowSlot:x.accountId&&x.mailboxId&&d>0&&I.length>0?n.jsx(nt,{accountId:x.accountId,mailboxId:x.mailboxId,messageIds:p}):void 0,selectAll:v,notice:F});return n.jsx(As,{...e,selectionBar:S,paneOverlay:n.jsx(Ns,{verb:o.verb,accountId:x.accountId,mailboxId:x.mailboxId,selection:L,selectionRestriction:x.restriction,onFinished:u}),children:r})}function St({accounts:e,selectedMessageId:s,onOpenThread:o,commandsRef:r,onTriageContextChange:l,onDeleteMessages:d}){const{searchQuery:u,searchInput:m,resultFolderIndex:b,onSearchChange:f}=Y(),x=ms(),D=ss(),I=Gs(),p=ts(),L=Ys(),h=a.useMemo(()=>pt(e.filter(t=>!t.muted?.value)),[e]),[v,F]=a.useState("all"),[S,C]=a.useState("all"),[$,E]=a.useState(new Set),[K,T]=a.useState(!1),P=a.useCallback(t=>{E(i=>{const c=new Set(i);return c.has(t)?c.delete(t):c.add(t),c})},[]),U=a.useCallback(()=>E(new Set),[]),R=m.trim().length>0,j=a.useMemo(()=>ht({query:m,ownFilters:$}),[m,$]),w=a.useMemo(()=>gt({query:m,ownCategory:S}),[m,S]),A=a.useCallback(t=>{if(!R||!Oe(t)){P(t);return}const i=ut(m,t);i!==void 0&&f(i)},[R,m,f,P]),q=a.useCallback(t=>{if(!R){C(t);return}f(mt(m,t))},[R,m,f]),z=a.useCallback(()=>{C("all"),F("all"),U(),R&&f(ft(m))},[R,m,f,U]),{data:N,isLoading:Q,isError:g,refetch:O}=ne({...oe(),staleTime:6e4}),B=Js({queries:h.map(t=>({...ns({path:{accountId:t.accountId}}),staleTime:1/0,meta:{softError:!0}}))}),V=a.useMemo(()=>{const t=new Map;for(let i=0;i<h.length;i++){const c=h[i].accountId,Ye=(B[i]?.data?.items??[]).reduce((Je,Ke)=>Je+(Ke.unseenCount??0),0);t.set(c,Ye)}return t},[h,B]),Ee=a.useMemo(()=>h.filter((t,i)=>{const c=B[i];return c?.isError?!os(c.error):!1}),[h,B]),{freeText:M,tokens:X}=fs(u.trim().toLowerCase(),x),{data:ie,isFetching:Pe}=ne({...oe({query:{query:M,limit:It}}),enabled:M.length>0,staleTime:3e4}),y=a.useMemo(()=>{const t=be(N?.items??[]).map(ve);return(M?gs(t.filter(c=>xs(c,M)),be(ie?.items??[]).map(ve)):t).filter(c=>(v==="all"||c.accountId===v)&&ps(c,X))},[N,ie,v,M,X]),{bodyRows:ce,briefSpamOffer:Z}=a.useMemo(()=>{if(!M)return{bodyRows:y,briefSpamOffer:void 0};const t=y.map(k=>ye(k,b)),{spam:i}=Is(t);if(i.length===0)return{bodyRows:y,briefSpamOffer:void 0};const c=new Set(i.map(k=>k.id));return{bodyRows:y.filter(k=>!c.has(k.id)),briefSpamOffer:bs(t)}},[y,M,b]),le=a.useMemo(()=>vs(ce),[ce]),de=a.useCallback((t,i)=>{const c=y.find(k=>k.id===t)?.threadId;c&&o?.({threadId:c,messageId:t},i)},[y,o]),qe=a.useCallback(t=>{const i=t.threadId??y.find(c=>c.id===t.id)?.threadId;i&&o?.({threadId:i,messageId:t.id})},[y,o]),ee=a.useMemo(()=>h.length<=1?[]:[{id:"all",label:"All",active:v==="all"},...h.map(t=>({id:t.accountId,label:t.email.split("@")[0]??t.email,count:V.get(t.accountId),active:v===t.accountId}))],[h,V,v]),H=a.useMemo(()=>e.filter(t=>t.muted?.value).length,[e]),ze=a.useMemo(()=>Array.from(V.values()).reduce((t,i)=>t+i,0),[V]),se=a.useMemo(()=>h.map(t=>t.accountId),[h]),{hasNewMail:ue}=_s(),{state:me,errorMessage:fe,refresh:he}=Ws(se,{onSettled:()=>O()}),Qe=a.useMemo(()=>n.jsx($s,{state:me,onRefresh:he,label:"Refresh daily brief",errorMessage:fe,hasUpdate:ue(se)}),[me,he,fe,ue,se]),te=a.useMemo(()=>y.filter(t=>(w==="all"||t.category===w)&&as(t,j)).map(t=>ye(t,b)),[y,w,j,b]),{hits:ge,isLoading:He}=st(),_e=a.useMemo(()=>{const t=new Map;for(const c of N?.items??[])t.set(c.messageId,c.threadId);const i=te.map(c=>t.get(c.id)).filter(c=>c!=null);return ys(ge,i,b)},[ge,te,N,b]),We=a.useMemo(()=>{const t=Ss(ee.map(i=>({id:i.id,label:i.label,count:i.count,active:i.active})));return{categories:t.categories,filters:t.filters,sources:t.sources,sourcesNote:H>0?`+${H} muted`:void 0,selectedCategory:w,activeFilters:j,expanded:K,onExpandedChange:T,onSelectCategory:i=>q(i),onSelectSource:F,onToggleFilter:i=>A(i),onClear:z}},[ee,H,w,j,K,A,q,z]),xe=le.length===0&&v==="all"&&M.length===0&&X.length===0,$e=a.useMemo(()=>h.map(t=>t.accountId),[h]),Ue=a.useMemo(()=>h.some(t=>Us(t.syncPhase)),[h]),G=Vs($e,xe||Ue),pe=n.jsxs("div",{className:"h-full overflow-y-auto",children:[n.jsx(Ce,{}),n.jsx(Ce,{})]}),Ie=!Q&&!g&&!xe,Ve=Cs({tier:I,hasLiveInput:R,hasCommittedQuery:u.trim().length>0,bodyRendersCommittedResults:!0}),Ge=Ie?n.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[Z&&n.jsx(Ts,{count:Z.count,onScopeToSpam:()=>L(Z.mailboxId,u)}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(rs,{sections:le,briefCategory:w,Row:js,selectedThreadId:s,onSelectThread:de,onSelectBriefCategory:q,sources:ee,sourcesNote:H>0?`+${H} muted`:void 0,onSelectSource:F,activeFilters:j,onToggleFilter:A,onClearFilters:z})})]}):Q?pe:g?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 py-12 text-sm text-fg-muted",children:[n.jsx(Te,{className:"size-8 text-danger"}),n.jsx("p",{children:"Couldn't load your messages"}),n.jsxs("button",{type:"button",onClick:()=>O(),className:"flex items-center gap-1 text-accent underline text-xs",children:[n.jsx(Ks,{className:"size-3.5"}),"Try again"]})]}):G.resolved?n.jsx(rt,{sync:G.syncing?{synced:G.synced,total:G.total}:void 0}):pe;return n.jsx(is,{hasSheet:Ie&&!Ve,children:n.jsx(Rs,{selectedMessageId:s,rows:y,onOpen:de,onDeleteMessages:d,onSelectionVerb:p.start,wizardOpen:p.isOpen,commandsRef:r,onTriageContextChange:l,children:n.jsx(yt,{wizard:p,header:{title:"Daily brief",unreadCount:ze,footer:D?n.jsx(ws,{}):void 0,searchFilter:We,searchResults:te,searchLoading:Q||Pe,relatedResults:_e,relatedLoading:He,onSelectSearchResult:qe,searchResultsInBody:!0,refreshControl:Qe},rows:y,children:n.jsxs("div",{className:"flex h-full flex-col",children:[Ee.map(t=>n.jsx(bt,{accountEmail:t.email,accountId:t.accountId},t.accountId)),n.jsx("div",{className:"min-h-0 flex-1",children:Ge})]})})})})}const De=a.createContext(null);function J(){const e=a.useContext(De);if(!e)throw new Error("BriefPane.* must be used inside <BriefPane>");return e}function Ct({thread:e,children:s}){const o=Xs(),r=Zs(),l=ke(),{searchInput:d}=Y(),u=e?.threadId,m=e?.messageId,{data:b}=ne({...oe(),staleTime:6e4}),f=a.useMemo(()=>b?.items??[],[b]),x=a.useMemo(()=>{if(u)return f.find(g=>g.messageId===m)??f.find(g=>g.threadId===u)},[f,u,m]),D=Bs(u,m),I=x??D,p=m??I?.messageId,L=a.useMemo(()=>{if(u)return{threadId:u,mailboxId:I?.mailboxId??"",subject:I?.subject,messageId:p,authenticity:I?.authenticity}},[u,I,p]),h=a.useCallback((g,O)=>{o(g,{replace:O?.replace,query:d})},[o,d]),v=a.useCallback(g=>{p&&g.includes(p)&&r()},[p,r]),F=Se({thread:I,onAfterOptimisticRemove:v}),S=Ds(),{deleteMessages:C}=Ls({mailboxId:I?.mailboxId??"",messages:f,onAfterOptimisticRemove:v}),{toggleReadFor:$}=Es({mailboxId:I?.mailboxId??"",messages:f}),E=S.focusedMessageId,T=a.useMemo(()=>f.find(g=>g.messageId===E),[f,E])??I,P=Se({thread:T}),U=at(),R=cs(),j=ls(),w=a.useMemo(()=>ds(j,u,p),[j,u,p]),A=a.useMemo(()=>{if(T)return g=>j({threadId:T.threadId,messageId:T.messageId,mode:g})},[j,T]),{nextMessageId:q,previousMessageId:z}=Ps({context:S,orderedIds:S.orderedIds,selectedMessageId:p,enabled:!U&&!R,onClose:r,handlers:{reply:()=>A?.("reply"),replyAll:()=>A?.("reply-all"),forward:()=>A?.("forward"),delete:()=>{S.listCommandsRef.current?.requestVerb("delete")||P.deleteThread()},toggleStar:P.toggleStar,toggleRead:()=>{S.listCommandsRef.current?.requestVerb("markRead")||T&&$([T.messageId],!T.isRead)},goFlagged:()=>l("flagged"),goSettings:()=>l("settings")}}),N=a.useCallback(g=>{if(!g)return;const O=f.find(B=>B.messageId===g);return O?{threadId:O.threadId,messageId:g}:void 0},[f]),Q={selectedMessageId:p,selectedThread:I,conversation:L,onOpenThread:h,onCloseThread:r,nextThread:N(q),previousThread:N(z),actions:F,onReply:w,triage:S,onDeleteMessages:C,handleDeselectIfRemoved:v};return n.jsx(De.Provider,{value:Q,children:s})}function Le(){const{selectedMessageId:e,onOpenThread:s,triage:o,onDeleteMessages:r}=J(),{accounts:l}=Y();return n.jsx(St,{accounts:l,selectedMessageId:e,onOpenThread:s,commandsRef:o.listCommandsRef,onTriageContextChange:o.onTriageContextChange,onDeleteMessages:r})}function Tt(){const{conversation:e,selectedThread:s,actions:o,onReply:r,handleDeselectIfRemoved:l}=J(),d=!!e,u=Qs(e?.threadId);return n.jsxs(n.Fragment,{children:[n.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[n.jsx(Hs,{hasThread:d,intelligenceOpen:u.isShowing,canToggleIntelligence:u.canToggle,onToggleIntelligence:u.toggle,onReply:r?()=>r("reply"):void 0,onReplyAll:r?()=>r("reply-all"):void 0,onForward:r?()=>r("forward"):void 0,onDelete:d?o.deleteThread:void 0,onToggleStar:d?o.toggleStar:void 0,isStarred:o.isStarred,moveContext:d&&o.accountId&&o.mailboxId?{accountId:o.accountId,currentMailboxId:o.mailboxId,onMove:o.moveThread}:void 0}),n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?n.jsx(we,{threadId:e.threadId,mailboxId:e.mailboxId,subject:e.subject,selectedMessageId:e.messageId,authenticity:e.authenticity,onOpenIntelligence:u.open}):n.jsx(hs,{})})]}),n.jsx(Me,{isOpen:u.drawerOpen,onClose:u.closeDrawer,thread:s,mailboxId:s?.mailboxId,accountId:s?.accountId,onAfterOptimisticRemove:l})]})}function jt(){const{selectedThread:e,handleDeselectIfRemoved:s}=J(),{onToggleIntelligence:o}=Y();return n.jsx(zs,{onClose:o,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:s})}function Rt(){const{selectedThread:e,conversation:s,onOpenThread:o,onCloseThread:r,nextThread:l,previousThread:d,handleDeselectIfRemoved:u}=J(),m=qs(s?.threadId??null);return s?n.jsxs(n.Fragment,{children:[n.jsx(we,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:r,onOpenIntelligence:m.toggle,onSwipeNext:l?()=>o(l):void 0,onSwipePrevious:d?()=>o(d):void 0,mobileIntelligenceOpen:m.isOpen}),n.jsx(Me,{isOpen:m.isOpen,onClose:m.close,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:u})]}):n.jsx("div",{className:"h-full",children:n.jsx(Le,{})})}const Et=Object.assign(Ct,{List:Le,Reading:Tt,Intelligence:jt,Phone:Rt});export{Et as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,e as r}from"./index-
|
|
1
|
+
import{j as t,e as r}from"./index-DXrRPYx2.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{dJ as $,r as n,d0 as X,v as z,b3 as Y,bF as Z,aR as ee,aS as te,j as a,a8 as se,bP as ae,bQ as oe}from"./index-
|
|
1
|
+
import{dJ as $,r as n,d0 as X,v as z,b3 as Y,bF as Z,aR as ee,aS as te,j as a,a8 as se,bP as ae,bQ as oe}from"./index-DXrRPYx2.js";import{u as re,p as ne,R as de}from"./useSearchTokenContext-SO0wjc97.js";import{H as ie,ac as le,I as ce,aw as ue,ad as ge,b as he,M as me,ak as fe,ax as Ie,am as pe,q as xe,L as Te,Q as V,P as ye,N as be,d as ve,_ as Re,$ as Ce,a1 as K,a2 as W,a3 as Se,a4 as we,a5 as je}from"./MailListHeader-DUsWWdtv.js";import{u as Fe,b as Me,a as Pe}from"./MailViewChrome-BbtvPHLk.js";import{f as ke}from"./ErrorState-SR7HXMCp.js";import{w as Oe}from"./wizard-selection-B1bng5Jq.js";import{a as Le}from"./useMessageBodyContent-Dr5dvjkL.js";import{k as Ae,l as Ne}from"./search-token-index-BQMRJt8c.js";import{u as De}from"./index-CBNp-llx.js";const Ee=()=>X({query:{starred:!0,order:"desc"}});function _(){const{data:e,isLoading:t,isError:s,error:d,refetch:g,fetchNextPage:c,hasNextPage:o,isFetchingNextPage:h}=Fe({queryKey:Ee(),queryFn:async({pageParam:p})=>{const{data:b}=await $({query:{starred:!0,order:"desc",continuationToken:p},throwOnError:!0});return b},initialPageParam:void 0,getNextPageParam:p=>p.continuationToken,staleTime:6e4});return{threads:n.useMemo(()=>(e?.pages??[]).flatMap(p=>p.items??[]),[e]),isLoading:t,isError:s,error:d,refetch:g,fetchNextPage:c,hasNextPage:o,isFetchingNextPage:h}}const Be=e=>{const t=new Set;return e.filter(s=>t.has(s.threadId)?!1:(t.add(s.threadId),!0))},qe={unread:e=>!e.isRead,attachment:e=>e.hasAttachment===!0};function Qe({rows:e,verb:t}){const{selectedIds:s,exitSelection:d}=pe(),g=n.useMemo(()=>Oe(e,s),[e,s]);return a.jsx(xe,{verb:t,selection:g,selectionRestriction:"spansAccounts",onFinished:d})}function ze({selectedMessageId:e,onOpenThread:t,commandsRef:s,onTriageContextChange:d,onDeleteMessages:g}){const{searchQuery:c,resultFolderIndex:o}=z(),h=re(),I=Y(),p=Z(),[b,m]=n.useState("all"),[f,F]=n.useState(new Set),D=n.useCallback(r=>{F(u=>{const x=new Set(u);return x.has(r)?x.delete(r):x.add(r),x})},[]),C=n.useCallback(()=>{m("all"),F(new Set)},[]),{threads:M,isLoading:y,isError:P,error:E,refetch:k,fetchNextPage:H,hasNextPage:T,isFetchingNextPage:S}=_(),{freeText:R,tokens:O}=ne(c.trim().toLowerCase(),h),i=n.useMemo(()=>{const r=Array.from(f).map(u=>qe[u]).filter(u=>u!=null);return Be(M).map(ie).filter(u=>(b==="all"||u.category===b)&&r.every(x=>x(u))&&(!R||le(u,R))&&ce(u,O))},[M,b,f,R,O]),w=n.useCallback((r,u)=>{const x=i.find(U=>U.id===r)?.threadId;x&&t?.({threadId:x,messageId:r},u)},[i,t]),j=n.useCallback(r=>{const u=r.threadId??i.find(x=>x.id===r.id)?.threadId;u&&t?.({threadId:u,messageId:r.id})},[i,t]),B=n.useMemo(()=>ue(),[]),q=n.useMemo(()=>i.map(r=>ge(r,o)),[i,o]),L=n.useMemo(()=>i.filter(r=>!r.isRead).length,[i]),A=y?"loading":P?"error":i.length===0?"empty":"ready",l=n.useCallback(()=>{const r=ee(te());window.open(r,"_blank","noopener,noreferrer")},[]),v=he(),Q=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:i.map(r=>a.jsx(me,{thread:r,active:r.id===e,onClick:()=>w(r.id)},r.id))}),T?a.jsx("button",{type:"button",className:"w-full py-3 text-sm text-muted hover:text-fg disabled:opacity-50",onClick:()=>H(),disabled:S,children:S?"Loading…":"Load more"}):null]})});return a.jsx(Me,{title:"Starred",unreadCount:L,preset:B,selectedCategory:b,activeFilters:f,onSelectCategory:m,onToggleFilter:D,onClearFilters:C,searchResults:q,searchLoading:y,onSelectSearchResult:j,searchResultsInBody:!0,children:a.jsxs(fe,{selectedMessageId:e,rows:i,onOpen:w,onDeleteMessages:g,onSelectionVerb:p.start,wizardOpen:p.isOpen,commandsRef:s,onTriageContextChange:d,children:[a.jsx(Pe,{listTitle:"Starred",sections:[{id:"flagged",threads:i}],flatList:!0,hideHeader:!0,listState:v.searchResults?"ready":A,searchQuery:R?c:void 0,errorMessage:P?ke(E):void 0,onRetry:()=>k(),onReportError:l,selectedThreadId:e,onSelectThread:w,isDesktop:I,selectionBar:a.jsx(Ie,{title:"Starred"}),listBody:v.searchResults??(A==="ready"?Q:void 0)}),a.jsx(Qe,{rows:i,verb:p.verb})]})})}const G=n.createContext(null);function N(){const e=n.useContext(G);if(!e)throw new Error("FlaggedPane.* must be used inside <FlaggedPane>");return e}function He({thread:e,children:t}){const s=Ae(),d=Ne(),g=De(),{searchInput:c}=z(),o=e?.threadId,h=e?.messageId,{threads:I}=_(),p=n.useMemo(()=>{if(o)return I.find(l=>l.messageId===h)??I.find(l=>l.threadId===o)},[I,o,h]),b=Te(o,h),m=p??b,f=h??m?.messageId,F=n.useMemo(()=>{if(o)return{threadId:o,mailboxId:m?.mailboxId??"",subject:m?.subject,messageId:f,authenticity:m?.authenticity}},[o,m,f]),D=n.useCallback((l,v)=>{s(l,{replace:v?.replace,query:c})},[s,c]),C=n.useCallback(l=>{f&&l.includes(f)&&d()},[f,d]),M=V({thread:m,onAfterOptimisticRemove:C}),y=ye(),{deleteMessages:P}=be({mailboxId:m?.mailboxId??"",messages:I,onAfterOptimisticRemove:C}),{toggleReadFor:E}=ve({mailboxId:m?.mailboxId??"",messages:I}),k=y.focusedMessageId,T=n.useMemo(()=>I.find(l=>l.messageId===k),[I,k])??m,S=V({thread:T}),R=Le(),O=se(),i=ae(),w=n.useMemo(()=>oe(i,o,f),[i,o,f]),j=n.useMemo(()=>{if(T)return l=>i({threadId:T.threadId,messageId:T.messageId,mode:l})},[i,T]),{nextMessageId:B,previousMessageId:q}=Re({context:y,orderedIds:y.orderedIds,selectedMessageId:f,enabled:!R&&!O,onClose:d,handlers:{reply:()=>j?.("reply"),replyAll:()=>j?.("reply-all"),forward:()=>j?.("forward"),delete:()=>{y.listCommandsRef.current?.requestVerb("delete")||S.deleteThread()},toggleStar:S.toggleStar,toggleRead:()=>{y.listCommandsRef.current?.requestVerb("markRead")||T&&E([T.messageId],!T.isRead)},goBrief:()=>g("brief"),goSettings:()=>g("settings")}}),L=n.useCallback(l=>{if(!l)return;const v=I.find(Q=>Q.messageId===l);return v?{threadId:v.threadId,messageId:l}:void 0},[I]),A={selectedMessageId:f,selectedThread:m,conversation:F,onOpenThread:D,onCloseThread:d,nextThread:L(B),previousThread:L(q),actions:M,onReply:w,triage:y,onDeleteMessages:P,handleDeselectIfRemoved:C};return a.jsx(G.Provider,{value:A,children:t})}function J(){const{selectedMessageId:e,onOpenThread:t,triage:s,onDeleteMessages:d}=N();return a.jsx(ze,{selectedMessageId:e,onOpenThread:t,commandsRef:s.listCommandsRef,onTriageContextChange:s.onTriageContextChange,onDeleteMessages:d})}function Ve(){const{conversation:e,selectedThread:t,actions:s,onReply:d,handleDeselectIfRemoved:g}=N(),c=!!e,o=we(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(je,{hasThread:c,intelligenceOpen:o.isShowing,canToggleIntelligence:o.canToggle,onToggleIntelligence:o.toggle,onReply:d?()=>d("reply"):void 0,onReplyAll:d?()=>d("reply-all"):void 0,onForward:d?()=>d("forward"):void 0,onDelete:c?s.deleteThread:void 0,onToggleStar:c?s.toggleStar:void 0,isStarred:s.isStarred,moveContext:c&&s.accountId&&s.mailboxId?{accountId:s.accountId,currentMailboxId:s.mailboxId,onMove:s.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:o.open}):a.jsx(de,{})})]}),a.jsx(W,{isOpen:o.drawerOpen,onClose:o.closeDrawer,thread:t,mailboxId:t?.mailboxId,accountId:t?.accountId,onAfterOptimisticRemove:g})]})}function Ke(){const{selectedThread:e,handleDeselectIfRemoved:t}=N(),{onToggleIntelligence:s}=z();return a.jsx(Se,{onClose:s,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:t})}function We(){const{selectedThread:e,conversation:t,onCloseThread:s,onOpenThread:d,nextThread:g,previousThread:c,handleDeselectIfRemoved:o}=N(),h=Ce(t?.threadId??null);return t?a.jsxs(a.Fragment,{children:[a.jsx(K,{threadId:t.threadId,mailboxId:t.mailboxId,subject:t.subject,selectedMessageId:t.messageId,authenticity:t.authenticity,onBack:s,onOpenIntelligence:h.toggle,onSwipeNext:g?()=>d(g):void 0,onSwipePrevious:c?()=>d(c):void 0,mobileIntelligenceOpen:h.isOpen}),a.jsx(W,{isOpen:h.isOpen,onClose:h.close,thread:e,mailboxId:e?.mailboxId,accountId:e?.accountId,onAfterOptimisticRemove:o})]}):a.jsx("div",{className:"h-full",children:a.jsx(J,{})})}const tt=Object.assign(He,{List:J,Reading:Ve,Intelligence:Ke,Phone:We});export{tt as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,D as f,a1 as m,j as e,b3 as N,X as w}from"./index-
|
|
1
|
+
import{r as n,D as f,a1 as m,j as e,b3 as N,X as w}from"./index-DXrRPYx2.js";import{E as u}from"./ErrorState-SR7HXMCp.js";import{D as r,C as x,a as E}from"./index-CBNp-llx.js";import{b as h,e as p,f as b}from"./useMessageBodyContent-Dr5dvjkL.js";import{C as k}from"./confirm-dialog-hMUgIb67.js";const C=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=h(),i=p(),s=b(),a=I(),[l,o]=n.useState(!1),{isError:d,error:c,refetch:g}=f({...m(),staleTime:1/0}),j=n.useCallback(v=>{v||(a()?o(!0):s())},[s,a]),y=n.useCallback(()=>{o(!1),s()},[s]),D=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:C(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(k,{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:D})]})},F=()=>{const t=h(),i=p(),s=b(),a=N(),{isError:l,error:o,refetch:d}=f({...m(),staleTime:1/0});if(E({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:C(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(w,{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{F};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ag as vs,cK as yr,r as l,c as ie,j as a,C as ut,d as On,B as G,X as Pt,aF as Ie,cL as zn,b as U,a as Ye,S as We,b5 as vr,cM as kr,as as Dt,T as Ft,cN as _n,bn as ks,cO as jr,cP as Un,az as wr,ar as Kn,e as Cr,cQ as Sr,aE as Bn,cR as Nr,cS as Tr,cT as Ir,cU as Er,cV as Mr,cW as Rr,cX as Ar,cY as $r,n as Lr,D as Z,a1 as gt,z as bt,cZ as Pr,c_ as Dr,c$ as Ot,K as qn,bO as Qn,d0 as Hn,x as ae,ah as ge,aj as me,Y as Je,bK as Me,d1 as zt,cx as Fr,d2 as Re,d3 as Or,d4 as Gs,d5 as zr,d6 as _r,d7 as Ur,d8 as Kr,co as Br,bI as Gn,bJ as qr,d9 as Qr,b3 as js,y as Hr,b6 as Vn,b0 as Wn,b7 as Yn,b8 as Jn,b9 as Gr,aR as Vr,aS as Wr,cJ as Yr,da as Jr,t as Xn,cI as Xr,db as Zr,dc as eo,dd as Zn,de as to,bP as so,by as ws,c1 as no,bU as Vs,df as ao,dg as es,dh as ro,bx as oo,_ as io,a6 as lo,N as ea,L as co,bR as Ws,bh as uo,di as fo,dj as mo,ak as Ys,bM as po,dk as ho,dl as go,v as _t,dm as bo,dn as xo,dp as Js,dq as yo,dr as vo,ds as ko,i as ta,dt as Cs,bN as ve,du as jo,cp as wo,c0 as Co,dv as So,dw as Xs,g as No,cq as To}from"./index-DDQC_-SF.js";import{B as Io,q as Eo,r as Mo,S as sa,d as Ss,l as Ro,g as Ao,D as $o,b as Tt,a as Lo,t as it,h as Po,v as Do,w as Fo,p as Oo,f as zo,u as _o,j as Uo}from"./search-token-index-pcFPHJpd.js";import{K as Ko}from"./kbd-B8Kzi4ce.js";import{P as na,f as Bo,U as qo,E as Qo,s as Ho}from"./attachment-file-ChOgFw1d.js";import{M as Go}from"./mail-CY6brKIm.js";import{A as ft}from"./avatar-C1kF9MNm.js";import{M as Vo,c as Wo,d as aa,e as Yo,f as ra,g as oa,a as Jo,b as Xo,S as Zs,s as ia,u as la,p as Zo,r as ei}from"./useSearchTokenContext-DtsR9mAt.js";import{C as ti,D as Qe,a as si}from"./index-k7ZH-ntd.js";import{E as Oe}from"./ErrorState-WU8paRcb.js";import{e as ca,b as Xe,a as ni,g as ai,c as ze,d as ri}from"./format-23Av07Go.js";import{D as oi}from"./download-COB-Ichs.js";import{g as ii}from"./useMessageBodyContent-Dyt5ksdW.js";import{S as li}from"./shield-check-BJZxBNxI.js";import{u as da}from"./useDebouncedValue-DhDIauKO.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-A5bbtysP.js";import{C as It}from"./confirm-dialog-DeZ_9x2D.js";import{C as bi}from"./clock-CLr3vhni.js";import{r as xi,b as yi}from"./search-scope-DTcpOp3S.js";import{M as vi}from"./menu-ChACEtAT.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 ua(){return Ni}function he(e,t){if(!ua())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(ua()&&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 fa(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||fa(e.parentElement,e))}const ma=["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"],Mi=ma.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";ma.push('[tabindex]:not([tabindex="-1"]):not([disabled])');function Ri(e,t){return e.matches(Mi)&&!Ai(e)&&(t?.skipVisibilityCheck||fa(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"?vs.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&&!Ri(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)}),pa=Ae(function(){return Ts(/^iPad/i)||At()&&navigator.maxTouchPoints>1}),ha=Ae(function(){return Di()||pa()}),Fi=Ae(function(){return Ut(/AppleWebKit/i)&&!Oi()}),Oi=Ae(function(){return Ut(/Chrome/i)}),ga=Ae(function(){return Ut(/Android/i)}),zi=Ae(function(){return Ut(/Firefox/i)});function _i(e){return e.pointerType===""&&e.isTrusted?!0:ga()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ui(e){return!ga()&&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()&&!pa()?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 Ki(){for(const[e]of Ne)"isConnected"in e&&!e.isConnected&&Ne.delete(e)}function Bi(e){requestAnimationFrame(()=>{Ki(),Ne.size===0?e():ds.add(e)})}function ba(...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]=ba(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=vs.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="",Rt=new WeakMap;function Vi(e){if(ha()){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";Rt.set(e,e.style[t]),e.style[t]="none"}}function nn(e){if(ha()){if(Ge!=="disabled")return;Ge="restoring",setTimeout(()=>{Bi(()=>{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&&Rt.has(e)){let t=Rt.get(e),s="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[s]==="none"&&(e.style[s]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Rt.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 xa=vs.createContext({register:()=>{}});xa.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(xa);if(t){let{register:s,ref:n,...r}=t;e=xt(r,e),s()}return Hi(t,e.ref),e}class Mt{#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,...y}=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(),v=l.useCallback((j,I)=>{let A=m.current;if(c||A.didFirePressStart)return!1;let C=!0;if(A.isTriggeringEvent=!0,n){let E=new Mt("pressstart",I,j);n(E),C=E.shouldStopPropagation}return s&&s(!0),A.isTriggeringEvent=!1,A.didFirePressStart=!0,u(!0),C},[c,n,s]),k=l.useCallback((j,I,A=!0)=>{let C=m.current;if(!C.didFirePressStart)return!1;C.didFirePressStart=!1,C.isTriggeringEvent=!0;let E=!0;if(r){let S=new Mt("pressend",I,j);r(S),E=S.shouldStopPropagation}if(s&&s(!1),u(!1),t&&A&&!c){let S=new Mt("press",I,j);t(S),E&&=S.shouldStopPropagation}return C.isTriggeringEvent=!1,E},[c,r,s,t]),T=ts(k),R=l.useCallback((j,I)=>{let A=m.current;if(c)return!1;if(o){A.isTriggeringEvent=!0;let C=new Mt("pressup",I,j);return o(C),A.isTriggeringEvent=!1,C.shouldStopPropagation}return!0},[c,o]),P=ts(R),M=l.useCallback(j=>{let I=m.current;if(I.isPressed&&I.target){I.didFirePressStart&&I.pointerType!=null&&k(De(I.target,j),I.pointerType,!1),I.isPressed=!1,I.isOverTarget=!1,I.activePointerId=null,I.pointerType=null,w(),x||nn(I.target);for(let A of I.disposables)A();I.disposables=[]}},[x,w,k]),F=ts(M);l.useEffect(()=>{c&&m.current.isPressed&&F({currentTarget:m.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[c]);let D=l.useCallback(j=>{h&&M(j)},[h,M]),O=l.useCallback(j=>{c||i?.(j)},[c,i]),_=l.useCallback((j,I)=>{if(!c&&i){let A=new MouseEvent("click",j);Li(A,I),i($i(A))}},[c,i]),q=l.useMemo(()=>{let j=m.current,I={onKeyDown(C){if(ns(C.nativeEvent,C.currentTarget)&&he(C.currentTarget,X(C))){cn(X(C),C.key)&&C.preventDefault();let E=!0;!j.isPressed&&!C.repeat&&(j.target=C.currentTarget,j.isPressed=!0,j.pointerType="keyboard",E=v(C,"keyboard"));let S=C.currentTarget,z=K=>{ns(K,S)&&!K.repeat&&he(S,X(K))&&j.target&&P(De(j.target,K),"keyboard")};g(Te(C.currentTarget),"keyup",ba(z,A),!0),E&&C.stopPropagation(),C.metaKey&&At()&&j.metaKeyEvents?.set(C.key,C.nativeEvent)}else C.key==="Meta"&&(j.metaKeyEvents=new Map)},onClick(C){if(!(C&&!he(C.currentTarget,X(C)))&&C&&C.button===0&&!j.isTriggeringEvent&&!pt.isOpening){let E=!0;if(c&&C.preventDefault(),!j.ignoreEmulatedMouseEvents&&!j.isPressed&&(j.pointerType==="virtual"||_i(C.nativeEvent))){let S=v(C,"virtual"),z=P(C,"virtual"),K=T(C,"virtual");O(C),E=S&&z&&K}else if(j.isPressed&&j.pointerType!=="keyboard"){let S=j.pointerType||C.nativeEvent.pointerType||"virtual",z=P(De(C.currentTarget,C),S),K=T(De(C.currentTarget,C),S,!0);E=z&&K,j.isOverTarget=!1,O(C),F(C)}j.ignoreEmulatedMouseEvents=!1,E&&C.stopPropagation()}}},A=C=>{if(j.isPressed&&j.target&&ns(C,j.target)){cn(X(C),C.key)&&C.preventDefault();let E=X(C),S=he(j.target,E);T(De(j.target,C),"keyboard",S),S&&_(C,j.target),w(),C.key!=="Enter"&&Is(j.target)&&he(j.target,E)&&!C[rn]&&(C[rn]=!0,pt(j.target,C,!1)),j.isPressed=!1,j.metaKeyEvents?.delete(C.key)}else if(C.key==="Meta"&&j.metaKeyEvents?.size){let E=j.metaKeyEvents;j.metaKeyEvents=void 0;for(let S of E.values())j.target?.dispatchEvent(new KeyboardEvent("keyup",S))}};if(typeof PointerEvent<"u"){I.onPointerDown=S=>{if(S.button!==0||!he(S.currentTarget,X(S)))return;if(Ui(S.nativeEvent)){j.pointerType="virtual";return}j.pointerType=S.pointerType;let z=!0;if(!j.isPressed){j.isPressed=!0,j.isOverTarget=!0,j.activePointerId=S.pointerId,j.target=S.currentTarget,x||Vi(j.target),z=v(S,j.pointerType);let K=X(S);"releasePointerCapture"in K&&("hasPointerCapture"in K?K.hasPointerCapture(S.pointerId)&&K.releasePointerCapture(S.pointerId):K.releasePointerCapture(S.pointerId)),g(Te(S.currentTarget),"pointerup",C,!1),g(Te(S.currentTarget),"pointercancel",E,!1)}z&&S.stopPropagation()},I.onMouseDown=S=>{if(he(S.currentTarget,X(S))&&S.button===0){if(b){let z=Pi(S.target);z&&j.disposables.push(z)}S.stopPropagation()}},I.onPointerUp=S=>{!he(S.currentTarget,X(S))||j.pointerType==="virtual"||S.button===0&&!j.isPressed&&P(S,j.pointerType||S.pointerType)},I.onPointerEnter=S=>{S.pointerId===j.activePointerId&&j.target&&!j.isOverTarget&&j.pointerType!=null&&(j.isOverTarget=!0,v(De(j.target,S),j.pointerType))},I.onPointerLeave=S=>{S.pointerId===j.activePointerId&&j.target&&j.isOverTarget&&j.pointerType!=null&&(j.isOverTarget=!1,T(De(j.target,S),j.pointerType,!1),D(S))};let C=S=>{if(S.pointerId===j.activePointerId&&j.isPressed&&S.button===0&&j.target){if(he(j.target,X(S))&&j.pointerType!=null){let z=!1,K=setTimeout(()=>{j.isPressed&&j.target instanceof HTMLElement&&(z?F(S):(mt(j.target),j.target.click()))},80);g(S.currentTarget,"click",()=>z=!0,!0),j.disposables.push(()=>clearTimeout(K))}else F(S);j.isOverTarget=!1}},E=S=>{F(S)};I.onDragStart=S=>{he(S.currentTarget,X(S))&&F(S)}}return I},[g,c,b,w,x,D,v,O,_]);return l.useEffect(()=>{if(!p)return;const j=Te(p.current);if(!j||!j.head||j.getElementById(on))return;const I=j.createElement("style");I.id=on;let A=Wi(j);A&&(I.nonce=A),I.textContent=`
|
|
1
|
+
import{ag as vs,cK as yr,r as l,c as ie,j as a,C as ut,d as On,B as G,X as Pt,aF as Ie,cL as zn,b as U,a as Ye,S as We,b5 as vr,cM as kr,as as Dt,T as Ft,cN as _n,bn as ks,cO as jr,cP as Un,az as wr,ar as Kn,e as Cr,cQ as Sr,aE as Bn,cR as Nr,cS as Tr,cT as Ir,cU as Er,cV as Mr,cW as Rr,cX as Ar,cY as $r,n as Lr,D as Z,a1 as gt,z as bt,cZ as Pr,c_ as Dr,c$ as Ot,K as qn,bO as Qn,d0 as Hn,x as ae,ah as ge,aj as me,Y as Je,bK as Me,d1 as zt,cx as Fr,d2 as Re,d3 as Or,d4 as Gs,d5 as zr,d6 as _r,d7 as Ur,d8 as Kr,co as Br,bI as Gn,bJ as qr,d9 as Qr,b3 as js,y as Hr,b6 as Vn,b0 as Wn,b7 as Yn,b8 as Jn,b9 as Gr,aR as Vr,aS as Wr,cJ as Yr,da as Jr,t as Xn,cI as Xr,db as Zr,dc as eo,dd as Zn,de as to,bP as so,by as ws,c1 as no,bU as Vs,df as ao,dg as es,dh as ro,bx as oo,_ as io,a6 as lo,N as ea,L as co,bR as Ws,bh as uo,di as fo,dj as mo,ak as Ys,bM as po,dk as ho,dl as go,v as _t,dm as bo,dn as xo,dp as Js,dq as yo,dr as vo,ds as ko,i as ta,dt as Cs,bN as ve,du as jo,cp as wo,c0 as Co,dv as So,dw as Xs,g as No,cq as To}from"./index-DXrRPYx2.js";import{B as Io,q as Eo,r as Mo,S as sa,d as Ss,l as Ro,g as Ao,D as $o,b as Tt,a as Lo,t as it,h as Po,v as Do,w as Fo,p as Oo,f as zo,u as _o,j as Uo}from"./search-token-index-BQMRJt8c.js";import{K as Ko}from"./kbd-C1K7eslD.js";import{P as na,f as Bo,U as qo,E as Qo,s as Ho}from"./attachment-file-e6GW9r52.js";import{M as Go}from"./mail-b9HhGqLt.js";import{A as ft}from"./avatar-COcR-Yn4.js";import{M as Vo,c as Wo,d as aa,e as Yo,f as ra,g as oa,a as Jo,b as Xo,S as Zs,s as ia,u as la,p as Zo,r as ei}from"./useSearchTokenContext-SO0wjc97.js";import{C as ti,D as Qe,a as si}from"./index-CBNp-llx.js";import{E as Oe}from"./ErrorState-SR7HXMCp.js";import{e as ca,b as Xe,a as ni,g as ai,c as ze,d as ri}from"./format-23Av07Go.js";import{D as oi}from"./download-BCYg5JPP.js";import{g as ii}from"./useMessageBodyContent-Dr5dvjkL.js";import{S as li}from"./shield-check-Lsl_-cAn.js";import{u as da}from"./useDebouncedValue-kyZq57X5.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-DLfMq1hl.js";import{C as It}from"./confirm-dialog-hMUgIb67.js";import{C as bi}from"./clock-DSBZCny8.js";import{r as xi,b as yi}from"./search-scope-DTcpOp3S.js";import{M as vi}from"./menu-CcW4Wr_9.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 ua(){return Ni}function he(e,t){if(!ua())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(ua()&&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 fa(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||fa(e.parentElement,e))}const ma=["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"],Mi=ma.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";ma.push('[tabindex]:not([tabindex="-1"]):not([disabled])');function Ri(e,t){return e.matches(Mi)&&!Ai(e)&&(t?.skipVisibilityCheck||fa(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"?vs.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&&!Ri(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)}),pa=Ae(function(){return Ts(/^iPad/i)||At()&&navigator.maxTouchPoints>1}),ha=Ae(function(){return Di()||pa()}),Fi=Ae(function(){return Ut(/AppleWebKit/i)&&!Oi()}),Oi=Ae(function(){return Ut(/Chrome/i)}),ga=Ae(function(){return Ut(/Android/i)}),zi=Ae(function(){return Ut(/Firefox/i)});function _i(e){return e.pointerType===""&&e.isTrusted?!0:ga()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ui(e){return!ga()&&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()&&!pa()?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 Ki(){for(const[e]of Ne)"isConnected"in e&&!e.isConnected&&Ne.delete(e)}function Bi(e){requestAnimationFrame(()=>{Ki(),Ne.size===0?e():ds.add(e)})}function ba(...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]=ba(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=vs.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="",Rt=new WeakMap;function Vi(e){if(ha()){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";Rt.set(e,e.style[t]),e.style[t]="none"}}function nn(e){if(ha()){if(Ge!=="disabled")return;Ge="restoring",setTimeout(()=>{Bi(()=>{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&&Rt.has(e)){let t=Rt.get(e),s="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[s]==="none"&&(e.style[s]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Rt.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 xa=vs.createContext({register:()=>{}});xa.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(xa);if(t){let{register:s,ref:n,...r}=t;e=xt(r,e),s()}return Hi(t,e.ref),e}class Mt{#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,...y}=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(),v=l.useCallback((j,I)=>{let A=m.current;if(c||A.didFirePressStart)return!1;let C=!0;if(A.isTriggeringEvent=!0,n){let E=new Mt("pressstart",I,j);n(E),C=E.shouldStopPropagation}return s&&s(!0),A.isTriggeringEvent=!1,A.didFirePressStart=!0,u(!0),C},[c,n,s]),k=l.useCallback((j,I,A=!0)=>{let C=m.current;if(!C.didFirePressStart)return!1;C.didFirePressStart=!1,C.isTriggeringEvent=!0;let E=!0;if(r){let S=new Mt("pressend",I,j);r(S),E=S.shouldStopPropagation}if(s&&s(!1),u(!1),t&&A&&!c){let S=new Mt("press",I,j);t(S),E&&=S.shouldStopPropagation}return C.isTriggeringEvent=!1,E},[c,r,s,t]),T=ts(k),R=l.useCallback((j,I)=>{let A=m.current;if(c)return!1;if(o){A.isTriggeringEvent=!0;let C=new Mt("pressup",I,j);return o(C),A.isTriggeringEvent=!1,C.shouldStopPropagation}return!0},[c,o]),P=ts(R),M=l.useCallback(j=>{let I=m.current;if(I.isPressed&&I.target){I.didFirePressStart&&I.pointerType!=null&&k(De(I.target,j),I.pointerType,!1),I.isPressed=!1,I.isOverTarget=!1,I.activePointerId=null,I.pointerType=null,w(),x||nn(I.target);for(let A of I.disposables)A();I.disposables=[]}},[x,w,k]),F=ts(M);l.useEffect(()=>{c&&m.current.isPressed&&F({currentTarget:m.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[c]);let D=l.useCallback(j=>{h&&M(j)},[h,M]),O=l.useCallback(j=>{c||i?.(j)},[c,i]),_=l.useCallback((j,I)=>{if(!c&&i){let A=new MouseEvent("click",j);Li(A,I),i($i(A))}},[c,i]),q=l.useMemo(()=>{let j=m.current,I={onKeyDown(C){if(ns(C.nativeEvent,C.currentTarget)&&he(C.currentTarget,X(C))){cn(X(C),C.key)&&C.preventDefault();let E=!0;!j.isPressed&&!C.repeat&&(j.target=C.currentTarget,j.isPressed=!0,j.pointerType="keyboard",E=v(C,"keyboard"));let S=C.currentTarget,z=K=>{ns(K,S)&&!K.repeat&&he(S,X(K))&&j.target&&P(De(j.target,K),"keyboard")};g(Te(C.currentTarget),"keyup",ba(z,A),!0),E&&C.stopPropagation(),C.metaKey&&At()&&j.metaKeyEvents?.set(C.key,C.nativeEvent)}else C.key==="Meta"&&(j.metaKeyEvents=new Map)},onClick(C){if(!(C&&!he(C.currentTarget,X(C)))&&C&&C.button===0&&!j.isTriggeringEvent&&!pt.isOpening){let E=!0;if(c&&C.preventDefault(),!j.ignoreEmulatedMouseEvents&&!j.isPressed&&(j.pointerType==="virtual"||_i(C.nativeEvent))){let S=v(C,"virtual"),z=P(C,"virtual"),K=T(C,"virtual");O(C),E=S&&z&&K}else if(j.isPressed&&j.pointerType!=="keyboard"){let S=j.pointerType||C.nativeEvent.pointerType||"virtual",z=P(De(C.currentTarget,C),S),K=T(De(C.currentTarget,C),S,!0);E=z&&K,j.isOverTarget=!1,O(C),F(C)}j.ignoreEmulatedMouseEvents=!1,E&&C.stopPropagation()}}},A=C=>{if(j.isPressed&&j.target&&ns(C,j.target)){cn(X(C),C.key)&&C.preventDefault();let E=X(C),S=he(j.target,E);T(De(j.target,C),"keyboard",S),S&&_(C,j.target),w(),C.key!=="Enter"&&Is(j.target)&&he(j.target,E)&&!C[rn]&&(C[rn]=!0,pt(j.target,C,!1)),j.isPressed=!1,j.metaKeyEvents?.delete(C.key)}else if(C.key==="Meta"&&j.metaKeyEvents?.size){let E=j.metaKeyEvents;j.metaKeyEvents=void 0;for(let S of E.values())j.target?.dispatchEvent(new KeyboardEvent("keyup",S))}};if(typeof PointerEvent<"u"){I.onPointerDown=S=>{if(S.button!==0||!he(S.currentTarget,X(S)))return;if(Ui(S.nativeEvent)){j.pointerType="virtual";return}j.pointerType=S.pointerType;let z=!0;if(!j.isPressed){j.isPressed=!0,j.isOverTarget=!0,j.activePointerId=S.pointerId,j.target=S.currentTarget,x||Vi(j.target),z=v(S,j.pointerType);let K=X(S);"releasePointerCapture"in K&&("hasPointerCapture"in K?K.hasPointerCapture(S.pointerId)&&K.releasePointerCapture(S.pointerId):K.releasePointerCapture(S.pointerId)),g(Te(S.currentTarget),"pointerup",C,!1),g(Te(S.currentTarget),"pointercancel",E,!1)}z&&S.stopPropagation()},I.onMouseDown=S=>{if(he(S.currentTarget,X(S))&&S.button===0){if(b){let z=Pi(S.target);z&&j.disposables.push(z)}S.stopPropagation()}},I.onPointerUp=S=>{!he(S.currentTarget,X(S))||j.pointerType==="virtual"||S.button===0&&!j.isPressed&&P(S,j.pointerType||S.pointerType)},I.onPointerEnter=S=>{S.pointerId===j.activePointerId&&j.target&&!j.isOverTarget&&j.pointerType!=null&&(j.isOverTarget=!0,v(De(j.target,S),j.pointerType))},I.onPointerLeave=S=>{S.pointerId===j.activePointerId&&j.target&&j.isOverTarget&&j.pointerType!=null&&(j.isOverTarget=!1,T(De(j.target,S),j.pointerType,!1),D(S))};let C=S=>{if(S.pointerId===j.activePointerId&&j.isPressed&&S.button===0&&j.target){if(he(j.target,X(S))&&j.pointerType!=null){let z=!1,K=setTimeout(()=>{j.isPressed&&j.target instanceof HTMLElement&&(z?F(S):(mt(j.target),j.target.click()))},80);g(S.currentTarget,"click",()=>z=!0,!0),j.disposables.push(()=>clearTimeout(K))}else F(S);j.isOverTarget=!1}},E=S=>{F(S)};I.onDragStart=S=>{he(S.currentTarget,X(S))&&F(S)}}return I},[g,c,b,w,x,D,v,O,_]);return l.useEffect(()=>{if(!p)return;const j=Te(p.current);if(!j||!j.head||j.getElementById(on))return;const I=j.createElement("style");I.id=on;let A=Wi(j);A&&(I.nonce=A),I.textContent=`
|
|
2
2
|
@layer {
|
|
3
3
|
[${ln}] {
|
|
4
4
|
touch-action: pan-x pan-y pinch-zoom;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as v,r as u,j as s,a9 as l,aa as p}from"./index-
|
|
1
|
+
import{m as v,r as u,j as s,a9 as l,aa as p}from"./index-DXrRPYx2.js";import{F as x}from"./FullCompose-Ctbbyn_P.js";import{a as m}from"./useMessageBodyContent-Dr5dvjkL.js";function S(o,n,r){if(o!==n)return r}function d(o,n){return o===""?"":n}function j({searchInput:o,committedQuery:n,urlQuery:r,pathname:t,listPath:a}){return!v(t,a)||n!==o?!1:n!==r}const c=u.createContext(null),C=({chrome:o,children:n})=>s.jsx(c.Provider,{value:o,children:n});function M({phone:o,list:n,reading:r,intelligence:t,hasThread:a=!1}){const e=u.useContext(c),f=m();if(!e)return s.jsx(l,{});const i={nav:e.nav,overlay:e.overlay,skeleton:s.jsx(l,{}),isLoading:e.isLoading,navOpen:e.navOpen,onOpenNav:e.onOpenNav,onCloseNav:e.onCloseNav};return e.isSinglePane?s.jsx(p,{...i,list:f?s.jsx(x,{}):o,intelligenceOpen:e.intelligenceOpen}):s.jsx(p,{...i,topBar:e.topBar,list:n,reading:r,intelligence:t,intelligenceOpen:e.intelligenceOpen,hasThread:a})}export{C as M,M as a,j as b,d as c,S as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,ar as re,B as A,e as ie,r as x,b as Q,as as oe,T as ce,dx as le,u as ue,dy as q,bW as de,cc as fe,dz as me,dA as xe,dB as ge,v as he,bX as pe,cV as be}from"./index-DDQC_-SF.js";import{R as ve,q as je,x as we}from"./search-token-index-pcFPHJpd.js";import{aq as Ne,ar as ye,c as Pe,a as U,as as Ce,s as Re,at as ke,au as Se,av as Me,al as Ee,an as ze}from"./MailListHeader-BZUH36MN.js";import{A as Ie}from"./avatar-C1kF9MNm.js";import{M as Oe}from"./mail-CY6brKIm.js";import{M as Le}from"./menu-ChACEtAT.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(G,{children:[e.jsx("p",{className:"font-medium text-fg",children:$e(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(G,{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 $e(s,n,r){return r?`No results for “${r}” in ${s}`:n?`No ${s} mail in ${n}`:`No ${s} mail`}function G({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 Fe({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 I=72,V=10,Xe=I/2,J="__swipeableRowAxisCancel";function Z(s){return s==="leading"?I:s==="trailing"?-I:0}function He(s){return s>=I/2?"leading":s<=-I/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>Xe&&(o.escaped=!0,k(i)),o.axis!=="horizontal")return;const F=Z(m),X=Math.max(-I,Math.min(I,F+u));v(X)},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(He(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=Q("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},$=!s.isRead,z=i=>i.stopPropagation(),T=n?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:Q("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(U,{thread:s})]}):e.jsxs(e.Fragment,{children:[$&&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:z,onPointerMove:z,onPointerUp:z,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(Ie,{name:s.fromName,email:s.fromEmail,size:"sm"})}),e.jsx(U,{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:$=!1}){const z=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 F=!R&&!f&&g==="ready",[X,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,K=a?.onRowSelect,te=Re(_.size,R),H=x.useCallback(t=>{if(L)return{checked:_.has(t),onToggle:c=>{c.preventDefault(),c.stopPropagation(),L(t)}}},[_,L]),B=x.useCallback((t,c)=>K?.(t,ke(c))?(c.preventDefault(),c.shiftKey&&window.getSelection()?.removeAllRanges(),!0):!1,[K]),ne=x.useCallback(({thread:t,active:c,onClick:W})=>e.jsx(z,{thread:t,active:c,focused:t.id===u,tabIndex:O(t.id),selection:H(t.id),onClick:ae=>{B(t.id,ae)||W?.()}}),[z,H,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??($?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(Fe,{message:p,onRetry:d,onReport:b}):f?e.jsx(de,{...v??{},sections:r,selectedThreadId:P,Row:ne,keyboard:l,onSelectThread:w}):D??(F?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:X}):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(z,{thread:c,active:c.id===P,focused:c.id===u,tabIndex:O(c.id),selection:H(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 Ke=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,Ke)}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(ze,{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,ar as re,B as A,e as ie,r as x,b as Q,as as oe,T as ce,dx as le,u as ue,dy as q,bW as de,cc as fe,dz as me,dA as xe,dB as ge,v as he,bX as pe,cV as be}from"./index-DXrRPYx2.js";import{R as ve,q as je,x as we}from"./search-token-index-BQMRJt8c.js";import{aq as Ne,ar as ye,c as Pe,a as U,as as Ce,s as Re,at as ke,au as Se,av as Me,al as Ee,an as ze}from"./MailListHeader-DUsWWdtv.js";import{A as Ie}from"./avatar-COcR-Yn4.js";import{M as Oe}from"./mail-b9HhGqLt.js";import{M as Le}from"./menu-CcW4Wr_9.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(G,{children:[e.jsx("p",{className:"font-medium text-fg",children:$e(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(G,{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 $e(s,n,r){return r?`No results for “${r}” in ${s}`:n?`No ${s} mail in ${n}`:`No ${s} mail`}function G({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 Fe({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 I=72,V=10,Xe=I/2,J="__swipeableRowAxisCancel";function Z(s){return s==="leading"?I:s==="trailing"?-I:0}function He(s){return s>=I/2?"leading":s<=-I/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>Xe&&(o.escaped=!0,k(i)),o.axis!=="horizontal")return;const F=Z(m),X=Math.max(-I,Math.min(I,F+u));v(X)},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(He(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=Q("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},$=!s.isRead,z=i=>i.stopPropagation(),T=n?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:Q("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(U,{thread:s})]}):e.jsxs(e.Fragment,{children:[$&&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:z,onPointerMove:z,onPointerUp:z,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(Ie,{name:s.fromName,email:s.fromEmail,size:"sm"})}),e.jsx(U,{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:$=!1}){const z=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 F=!R&&!f&&g==="ready",[X,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,K=a?.onRowSelect,te=Re(_.size,R),H=x.useCallback(t=>{if(L)return{checked:_.has(t),onToggle:c=>{c.preventDefault(),c.stopPropagation(),L(t)}}},[_,L]),B=x.useCallback((t,c)=>K?.(t,ke(c))?(c.preventDefault(),c.shiftKey&&window.getSelection()?.removeAllRanges(),!0):!1,[K]),ne=x.useCallback(({thread:t,active:c,onClick:W})=>e.jsx(z,{thread:t,active:c,focused:t.id===u,tabIndex:O(t.id),selection:H(t.id),onClick:ae=>{B(t.id,ae)||W?.()}}),[z,H,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??($?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(Fe,{message:p,onRetry:d,onReport:b}):f?e.jsx(de,{...v??{},sections:r,selectedThreadId:P,Row:ne,keyboard:l,onSelectThread:w}):D??(F?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:X}):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(z,{thread:c,active:c.id===P,focused:c.id===u,tabIndex:O(c.id),selection:H(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 Ke=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,Ke)}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(ze,{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};
|