@remit/web-client-dist 0.0.482 → 0.0.483
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-D6mVesqu.js +1 -0
- package/assets/CalendarShell-CbesY9P5.js +1 -0
- package/assets/EmptyState-DYWkEoYy.js +1 -0
- package/assets/{ErrorState-4TfgxGLk.js → ErrorState-CQA1uNfQ.js} +1 -1
- package/assets/{FlaggedPane-B7mltHsE.js → FlaggedPane-DoeXJfm_.js} +1 -1
- package/assets/FullCompose-DdXnvGhK.js +1 -0
- package/assets/MailListHeader-Dv4RRNrm.js +7 -0
- package/assets/MailNav-v3LcAYtx.js +1 -0
- package/assets/MailShell-CqyZkGBA.js +1 -0
- package/assets/MailViewChrome-BrAblQ-h.js +1 -0
- package/assets/MailboxPane-B1OopvI6.js +1 -0
- package/assets/{NavMenuButton-n2Am7T-q.js → NavMenuButton-DsipgLLk.js} +1 -1
- package/assets/{OnboardingWizard-BtlDSuHk.js → OnboardingWizard-LMPbQ6jT.js} +1 -1
- package/assets/OpenCalendarEvent-jziTx8_b.js +1 -0
- package/assets/OutboxPane-C5Ns55rS.js +1 -0
- package/assets/_calendarObjectId-BwZvTd4q.js +1 -0
- package/assets/_mailboxId-r4aTgexi.js +1 -0
- package/assets/_messageId-B1vH4rgJ.js +1 -0
- package/assets/_messageId-BtEEXwAi.js +1 -0
- package/assets/_messageId-Df_PxEto.js +1 -0
- package/assets/_outboxMessageId-CxMGfZJP.js +1 -0
- package/assets/_recurrenceId-C2heuIxv.js +1 -0
- package/assets/_threadId-BCSAHVdO.js +1 -0
- package/assets/_threadId-qoVrigtw.js +1 -0
- package/assets/_threadId-vleFQxLm.js +1 -0
- package/assets/_view._date-kUsauS8B.js +1 -0
- package/assets/accounts-Dzj3yoGR.js +1 -0
- package/assets/{advanced-DtxZPECw.js → advanced-DUCDPZSq.js} +3 -3
- package/assets/appearance-BOPQSuz4.js +1 -0
- package/assets/attachment-file-DClGI76U.js +1 -0
- package/assets/{avatar-G7g9Uwvc.js → avatar-wLH6-Ayd.js} +1 -1
- package/assets/bottom-sheet-D6dXigqc.js +1 -0
- package/assets/{brief-BcQPVd1X.js → brief-BVNqThW-.js} +1 -1
- package/assets/brief-DZPDGIPc.js +1 -0
- package/assets/browser-ponyfill-CH8d2KQ8.js +2 -0
- package/assets/{bug-Dj9DPa4Y.js → bug-C9mbESSL.js} +1 -1
- package/assets/calendar-ZcQGYvWc.js +1 -0
- package/assets/calendar-_byPswbZ.js +1 -0
- package/assets/calendar-days-GutYioyG.js +1 -0
- package/assets/card-D55_7IJj.js +1 -0
- package/assets/chevron-left-KNAXuraL.js +1 -0
- package/assets/{circle-check-big-SYJDr4tY.js → circle-check-big-B1p6oh-i.js} +1 -1
- package/assets/circle-check-o0AqGZ-u.js +1 -0
- package/assets/{circle-help-BoGPc17x.js → circle-help-DtvJPapE.js} +1 -1
- package/assets/clock-Z-oAijsz.js +1 -0
- package/assets/compose._-_outboxMessageId_-5aWrcne1.js +1 -0
- package/assets/compose._-_outboxMessageId_-Bi_nmcO4.js +1 -0
- package/assets/compose._-_outboxMessageId_-D3DAlT64.js +1 -0
- package/assets/compose._-_outboxMessageId_-PDfNjd_n.js +1 -0
- package/assets/{config-import-1pqti4UQ.js → config-import-CMt0F7iy.js} +1 -1
- package/assets/confirm-dialog-XKVleo_p.js +1 -0
- package/assets/{credential-steps-BNmmF6YJ.js → credential-steps-Bhbo8-zA.js} +1 -1
- package/assets/download-BzIqNtrq.js +1 -0
- package/assets/filters-Cp8CCnd5.js +1 -0
- package/assets/{flagged-uZGUg7Dw.js → flagged-CLgTXep4.js} +1 -1
- package/assets/flagged-D-ptU5v2.js +1 -0
- package/assets/folders-BiY-9lME.js +1 -0
- package/assets/{format-BSk7Do06.js → format-CCaI2KqP.js} +1 -1
- package/assets/{help-copy-D6t16AP5.js → help-copy-DawC2xSA.js} +1 -1
- package/assets/import-CJAbCD1j.js +1 -0
- package/assets/index-BDh85s_o.js +1 -0
- package/assets/index-BluhX7J5.js +1 -0
- package/assets/index-BqjhYbTK.js +1 -0
- package/assets/index-BtEEXwAi.js +1 -0
- package/assets/index-CJDhCMZY.js +1 -0
- package/assets/index-CeziyGm_.js +1 -0
- package/assets/index-CxA7LBuE.js +1 -0
- package/assets/index-D8-XdCBI.js +1 -0
- package/assets/index-Df_PxEto.js +1 -0
- package/assets/index-lqmSDAG_.js +1 -0
- package/assets/{index-FpwHnbdV.js → index-lxVTsHBH.js} +64 -64
- package/assets/{index-CYwsmjFx.js → index-y3enq74c.js} +6 -6
- package/assets/kbd-Ds8JAL-i.js +1 -0
- package/assets/labels-CwARLqAD.js +1 -0
- package/assets/mail-Bux3edOt.js +1 -0
- package/assets/mail-CSpgLNSC.js +1 -0
- package/assets/menu-D6aq1T1f.js +1 -0
- package/assets/minus-DW1FraKg.js +1 -0
- package/assets/new-DwJ7NLZR.js +1 -0
- package/assets/onboarding-0lqsEEMH.js +1 -0
- package/assets/onboarding-completion-WuK4B8wi.js +1 -0
- package/assets/outbox-4__1O2vy.js +1 -0
- package/assets/{pencil-DSzm4tGc.js → pencil-DJPntSjN.js} +1 -1
- package/assets/{rich-text-Bi1khhyl.js → rich-text-Ticmqq6R.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-vLdWVTOw.js → rich-text-spellcheck-worker-provider-CEjXNkTo.js} +1 -1
- package/assets/rotate-ccw-Snzk6-SP.js +1 -0
- package/assets/{row-actions-DgziqjAx.js → row-actions-BY8sJ70m.js} +1 -1
- package/assets/search-mirror-CgMxavNa.js +1 -0
- package/assets/{search-scope-DTcpOp3S.js → search-scope-B5-OK3Cq.js} +1 -1
- package/assets/search-token-index-D1mRODfF.js +1 -0
- package/assets/sections-BaNfgGs8.js +1 -0
- package/assets/senders-DtfLvp-S.js +1 -0
- package/assets/settings-JoaCyeEy.js +1 -0
- package/assets/settings-screen-D5PdsyBl.js +1 -0
- package/assets/shield-check-Bvnu7s8U.js +1 -0
- package/assets/{suggested-vips-CtCLsdy6.js → suggested-vips-W8f9qNN8.js} +1 -1
- package/assets/useCalendarData-CBjm4DbE.js +1 -0
- package/assets/{useDebouncedValue-DU11pzlc.js → useDebouncedValue-D4EGUdvx.js} +1 -1
- package/assets/{useFilters-BBJu_93Q.js → useFilters-CW_hrFZo.js} +1 -1
- package/assets/useLabels-Dlob_XK-.js +1 -0
- package/assets/useLayoutTier-Ciq4HlaK.js +1 -0
- package/assets/useMessageBodyContent-CUM4C6Cq.js +1 -0
- package/assets/useQueries-CPnZMt_1.js +1 -0
- package/assets/useRefreshControl-DiNXvxEh.js +1 -0
- package/assets/{useSearchTokenContext-DH5XswlU.js → useSearchTokenContext-mRvSGuNd.js} +4 -4
- package/assets/useSemanticSearch-DqVnsXbc.js +1 -0
- package/assets/{useSignature-HAuR6_Ul.js → useSignature-CrrwTrAx.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/BriefPane-CfitNMEu.js +0 -1
- package/assets/FullCompose-0DIPCtd6.js +0 -1
- package/assets/MailListHeader-Brjq4vBE.js +0 -7
- package/assets/MailShell-CvGuWCuj.js +0 -1
- package/assets/MailViewChrome-C7sCKY-n.js +0 -1
- package/assets/MailboxPane-COHQn6Yb.js +0 -1
- package/assets/OutboxPane-C-_EQFRO.js +0 -1
- package/assets/_mailboxId-Bqbp7c9M.js +0 -1
- package/assets/_messageId-BAluf3UO.js +0 -1
- package/assets/_messageId-CHs89GPR.js +0 -1
- package/assets/_messageId-Ctd9_Bl1.js +0 -1
- package/assets/_outboxMessageId-_2jJC1Qb.js +0 -1
- package/assets/_threadId-BYyW8ujt.js +0 -1
- package/assets/_threadId-BrgLQ-Pl.js +0 -1
- package/assets/_threadId-C9FCiXzy.js +0 -1
- package/assets/accounts-D3L3nj2z.js +0 -1
- package/assets/appearance-OV39hcLF.js +0 -1
- package/assets/attachment-file-ul58bxI4.js +0 -1
- package/assets/bottom-sheet-B6YVIwAN.js +0 -1
- package/assets/brief-Bc68FlBf.js +0 -1
- package/assets/browser-ponyfill-DXnwXxSp.js +0 -2
- package/assets/card-B1IEp2-a.js +0 -1
- package/assets/circle-check-CsnMhxDa.js +0 -1
- package/assets/clock-C2olBfsH.js +0 -1
- package/assets/compose._-_outboxMessageId_-C_qZJ56q.js +0 -1
- package/assets/compose._-_outboxMessageId_-DKWODs5S.js +0 -1
- package/assets/compose._-_outboxMessageId_-DwRvAUq2.js +0 -1
- package/assets/compose._-_outboxMessageId_-mWQ2SoXJ.js +0 -1
- package/assets/confirm-dialog-B4KJVTQx.js +0 -1
- package/assets/download-vw3zYEkx.js +0 -1
- package/assets/filters-BmW8kKxW.js +0 -1
- package/assets/flagged-R318UqUZ.js +0 -1
- package/assets/folders-CkYvGGkZ.js +0 -1
- package/assets/import-CNvHrBcn.js +0 -1
- package/assets/index-2Vc2Ycg0.js +0 -1
- package/assets/index-BBBVjIQK.js +0 -1
- package/assets/index-CAPjLYZ5.js +0 -1
- package/assets/index-CHs89GPR.js +0 -1
- package/assets/index-COugriit.js +0 -1
- package/assets/index-Ctd9_Bl1.js +0 -1
- package/assets/index-D93knX1J.js +0 -1
- package/assets/index-N1RMrj2-.js +0 -1
- package/assets/kbd-tXno4rYH.js +0 -1
- package/assets/labels-D8dMllXL.js +0 -1
- package/assets/mail-CFC6XnIq.js +0 -1
- package/assets/mail-DmVe7n1g.js +0 -1
- package/assets/menu-B-aaGy7K.js +0 -1
- package/assets/onboarding-completion-YE4GukFN.js +0 -1
- package/assets/onboarding-vJtatS1N.js +0 -1
- package/assets/outbox-C9Rxk-WO.js +0 -1
- package/assets/rotate-ccw-CwLIBdgY.js +0 -1
- package/assets/search-mirror-B2LoSoNR.js +0 -1
- package/assets/search-token-index-C9KNJC5_.js +0 -1
- package/assets/sections-DDQm-Sbc.js +0 -1
- package/assets/senders-BWTk7Fqx.js +0 -1
- package/assets/settings-B4qmCAFR.js +0 -1
- package/assets/settings-screen-m0Uy9zlo.js +0 -1
- package/assets/shield-check-Cs0C_oxK.js +0 -1
- package/assets/useLabels-GtiakPKP.js +0 -1
- package/assets/useMessageBodyContent-BOBb68Px.js +0 -1
- package/assets/useQueries-Dx2PHSps.js +0 -1
- package/assets/useRefreshControl-CWjutjgw.js +0 -1
- package/assets/useSemanticSearch-CZUtmciE.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bF as Ts,bG as js,j as r,bH as ws,B as dt,a as te,S as ks,p as Ee,b as Pt,r as c,C as Ms,q as Rs,bg as Es,u as It,d as Tt,W as As,f as jt,bI as Os,bJ as Ns,I as zs,x as Fs,T as Bt,bK as Ds,bb as Ls,bL as _s,bM as Ps,ar as $t,aX as Bs,aY as $s,w as Ws,l as wt,i as Vs,a9 as Wt,be as Ks,V as Hs,bf as qs,aU as Us,bN as Qs,k as Js,bO as Gs,bP as Ys,bQ as Xs,bR as Zs,bS as en,Q as Vt,bT as tn,a0 as sn,bU as nn,bV as on,ai as rn,bW as an,bp as ln}from"./index-FpwHnbdV.js";import{u as cn,p as dn,R as un}from"./useSearchTokenContext-DH5XswlU.js";import{u as hn,a as fn,R as mn}from"./useRefreshControl-CWjutjgw.js";import{C as Kt,a as Ht,c as qt,j as gn,M as pn,t as Ut,u as xn,b as bn,d as Qt,e as Jt,f as vn,g as Sn,h as yn,r as Cn,n as In,i as Tn,k as jn,l as wn,m as kn,o as Mn,S as Rn,p as En,D as An,q as On,s as Nn,v as Gt,w as zn,x as Fn,y as Dn,z as Ln,A as _n,B as Yt,E as Pn,F as Bn,G as $n,H as Wn,I as Vn,J as Kn,K as Nt,L as zt,N as Hn,O as qn,P as Un,Q as Qn,R as Jn,T as Gn,U as Yn,V as Xn,W as Zn,X as eo,Y as to,Z as so,_ as Xt,$ as Zt,a0 as es,a1 as no,a2 as oo,a3 as io,a4 as ts,a5 as ro,a6 as ao,a7 as lo}from"./MailListHeader-Brjq4vBE.js";import{S as co,M as uo,a as ho,u as fo,b as mo}from"./MailViewChrome-C7sCKY-n.js";import{A as kt}from"./avatar-G7g9Uwvc.js";import{b as Qe,d as go,c as ss}from"./format-BSk7Do06.js";import{b as po,c as xo,a as bo,u as vo}from"./useMessageBodyContent-BOBb68Px.js";import{k as Je,i as So,t as yo,l as Co,m as Io,n as To,e as jo,o as wo}from"./search-token-index-C9KNJC5_.js";import{N as ko}from"./NavMenuButton-n2Am7T-q.js";import{C as Mo}from"./confirm-dialog-B4KJVTQx.js";import{f as Ro}from"./ErrorState-4TfgxGLk.js";import{a as Eo}from"./useLabels-GtiakPKP.js";import{L as Ao,r as Oo,u as No}from"./useSemanticSearch-CZUtmciE.js";import{S as ut}from"./shield-check-Cs0C_oxK.js";import{B as zo}from"./bottom-sheet-B6YVIwAN.js";import{C as Fo}from"./circle-help-BoGPc17x.js";import{C as Do}from"./circle-check-CsnMhxDa.js";import{n as Lo}from"./search-query-Cr_ZXBCp.js";import{u as _o}from"./sections-DDQm-Sbc.js";const Po=({children:e,onRefresh:n,isRefreshing:t})=>Ts(js)?e:r.jsx(ws,{onRefresh:n,isPullable:!t,children:e}),Bo=e=>e===1?"message":"messages";function $o({count:e,onReview:n,onDismiss:t,actionLabel:s="Review & rescue"}){return r.jsx(dt,{tone:"info",variant:"soft",onDismiss:t,children:r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("p",{className:"flex items-start gap-2 text-sm text-fg",children:[r.jsx(ut,{className:"mt-0.5 size-4 shrink-0 text-positive","aria-hidden":!0}),r.jsxs("span",{children:[r.jsx("span",{className:"font-semibold text-fg",children:`${e} ${Bo(e)} here`})," ","may not be spam — they're from senders we can verify."]})]}),r.jsx(te,{variant:"primary",size:"sm",onClick:n,className:"self-start",children:s})]})})}const Wo=(e,n)=>e==="vip"?"vip":e==="unknown"&&n==="md"?"unknown-pill":"hidden",ns=({senderTrust:e,size:n="sm",className:t})=>{const s=Wo(e,n);return s==="vip"?r.jsx(ks,{className:Ee("text-warning shrink-0",n==="sm"&&"size-3.5",n==="md"&&"size-4",t),"aria-label":"VIP sender","data-testid":"sender-trust-vip"}):s==="unknown-pill"?r.jsx("span",{className:Ee("inline-flex items-center rounded border border-dashed border-fg-subtle/40 font-medium uppercase tracking-wide text-fg-muted/80 shrink-0","px-2 py-0.5 text-xs",t),title:"First message from this sender","aria-label":"First message from this sender","data-testid":"sender-trust-unknown",children:"new"}):null};function Vo({candidate:e,selected:n,onToggle:t,hideSender:s=!1}){const{senderName:o,senderAddress:i,subject:l,snippet:a,trustReason:d,trustSubReason:u,senderTrust:h}=e;return r.jsxs("label",{className:Ee("flex w-full cursor-pointer items-start gap-3 px-3 py-2.5 text-left transition-colors",s&&"pl-11",n?"bg-positive/10":"bg-surface hover:bg-surface-sunken"),children:[r.jsx(Kt,{className:"mt-0.5",checked:n,onChange:t,"aria-label":`${n?"Deselect":"Select"} ${s?l:`message from ${o}`}`}),!s&&r.jsx(kt,{name:o,email:i,size:"sm"}),r.jsxs("span",{className:"min-w-0 flex-1",children:[!s&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"truncate text-sm font-medium text-fg",children:o}),h&&r.jsx(ns,{senderTrust:h,size:"sm"}),r.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:i})]}),r.jsx("span",{className:"block truncate text-sm text-fg-muted",children:l}),r.jsx("span",{className:"block line-clamp-1 text-xs text-fg-subtle",children:a}),!s&&r.jsxs("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.jsxs(Pt,{tone:"positive",children:[r.jsx(ut,{className:"size-3","aria-hidden":!0}),d]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:u})]})]})]})}const Ko=e=>{const n=new Map,t=[];for(const s of e){const o=(s.senderAddress||s.senderName).toLowerCase(),i=n.get(o);if(i){i.messages.push(s);continue}n.set(o,{key:o,senderName:s.senderName,senderAddress:s.senderAddress,trustReason:s.trustReason,trustSubReason:s.trustSubReason,senderTrust:s.senderTrust,messages:[s]}),t.push(o)}return t.map(s=>n.get(s)).sort((s,o)=>o.messages.length-s.messages.length)},Ho=(e,n)=>{const t=e.messages.filter(s=>n.has(s.id)).length;return t===0?"none":t===e.messages.length?"all":"some"},Ft=e=>e===1?"message":"messages";function qo({group:e,selected:n,onToggleGroup:t,onToggleMessage:s}){const[o,i]=c.useState(!1),l=Ho(e,n),a=e.messages.length,d=o?Ms:Rs;return r.jsxs("div",{className:Ee(l!=="none"?"bg-positive/10":"bg-surface"),children:[r.jsxs("div",{className:"flex w-full items-start gap-3 px-3 py-2.5",children:[r.jsx(Kt,{className:"mt-0.5",checked:l==="all",indeterminate:l==="some",onChange:()=>t(e,l!=="all"),"aria-label":`${l==="all"?"Deselect":"Select"} all ${a} ${Ft(a)} from ${e.senderName}`}),r.jsx(kt,{name:e.senderName,email:e.senderAddress,size:"sm"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"truncate text-sm font-medium text-fg",children:e.senderName}),e.senderTrust&&r.jsx(ns,{senderTrust:e.senderTrust,size:"sm"}),r.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:e.senderAddress})]}),r.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.jsxs(Pt,{tone:"positive",children:[r.jsx(ut,{className:"size-3","aria-hidden":!0}),e.trustReason]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:e.trustSubReason})]})]}),r.jsxs("button",{type:"button",onClick:()=>i(u=>!u),"aria-expanded":o,className:"flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-2xs text-fg-muted transition-colors hover:bg-surface-sunken hover:text-fg",children:[`${a} ${Ft(a)}`,r.jsx(d,{className:"size-3.5","aria-hidden":!0})]})]}),o&&r.jsx("div",{className:"divide-y divide-line border-t border-line",children:e.messages.map(u=>r.jsx(Vo,{candidate:u,selected:n.has(u.id),onToggle:()=>s(u.id),hideSender:!0},u.id))})]})}const Mt=e=>e===1?"message":"messages",Uo=(e,n)=>`Moves ${e===1?"this message":`these ${e} ${Mt(e)}`} out of Spam to ${n} now. Nothing later.`,Ct=(e,n)=>e.find(t=>t.id===n)?.label??"Inbox";function Qo(){return r.jsx(dt,{tone:"info",variant:"soft",children:r.jsx("p",{className:"text-2xs text-fg-muted",children:"We list a message here only when we can confirm the sender is who they say — usually someone you've emailed before, write to often, or a service that consistently checks out. We never guess from words in the subject. Anything we can't confirm stays in Spam."})})}function Jo({candidates:e,selected:n,onToggle:t,onToggleGroup:s,onSelectAll:o,onSelectNone:i,onContinue:l,onCancel:a}){const[d,u]=c.useState(!1),h=n.size,g=c.useMemo(()=>Ko(e),[e]);return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"px-row-inset pb-2 pt-1",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("h2",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[r.jsx(ut,{className:"size-4 text-positive","aria-hidden":!0}),"Rescue from Spam"]}),r.jsx(te,{variant:"ghost",size:"sm",icon:r.jsx(Fo,{className:"size-3.5"}),onClick:()=>u(m=>!m),className:"-mr-1.5 -mt-0.5",children:"Why these?"})]}),r.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"These look safe — from senders we can verify. Uncheck any sender that belongs in Spam, or open a sender to pick individual messages."}),d&&r.jsx("div",{className:"mt-2",children:r.jsx(Qo,{})})]}),r.jsxs("div",{className:"flex items-center justify-between px-row-inset pb-1.5",children:[r.jsx("span",{className:"text-2xs font-medium text-fg-muted",children:`${h} of ${e.length} selected · ${g.length} ${g.length===1?"sender":"senders"}`}),r.jsxs("span",{className:"flex gap-1",children:[r.jsx(te,{variant:"ghost",size:"sm",onClick:o,children:"Select all"}),r.jsx(te,{variant:"ghost",size:"sm",onClick:i,children:"Select none"})]})]}),r.jsx("div",{className:"min-h-0 flex-1 divide-y divide-line overflow-y-auto border-y border-line",children:g.map(m=>r.jsx(qo,{group:m,selected:n,onToggleGroup:s,onToggleMessage:t},m.key))}),r.jsxs("div",{className:"space-y-2 border-t border-line bg-surface px-row-inset py-3",children:[r.jsx(te,{variant:"primary",onClick:l,className:"h-11 w-full font-semibold",children:`Continue with ${h} ${Mt(h)}`}),r.jsx(te,{variant:"ghost",onClick:a,className:"h-11 w-full",children:"Cancel"})]})]})}function Go({count:e,folders:n,delimiter:t,destination:s,onPick:o,onMove:i,onBack:l}){const[a,d]=c.useState(!1);return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"px-row-inset pb-2 pt-1",children:[r.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Where should they go?"}),r.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"Pick a folder, then we move them out of Spam."})]}),r.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto px-row-inset py-2",children:a?r.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden rounded-xl border border-line bg-surface",children:r.jsx(Es,{folders:n,selectedId:s,delimiter:t,onSelect:o,onCancel:()=>d(!1)})}):r.jsxs("div",{className:"rounded-xl border border-line bg-surface-sunken p-3",children:[r.jsx("p",{className:"text-2xs text-fg-subtle",children:"Destination"}),r.jsx("p",{className:"mt-0.5 text-sm font-medium text-fg",children:Ct(n,s)}),r.jsx(te,{variant:"ghost",size:"sm",onClick:()=>d(!0),className:"mt-2 px-0",children:"Move to a different folder"})]})}),r.jsxs("div",{className:"space-y-2 border-t border-line bg-surface px-row-inset py-3",children:[r.jsx("p",{className:"text-2xs text-fg-subtle",children:Uo(e,Ct(n,s))}),r.jsx(te,{variant:"primary",onClick:i,className:"h-11 w-full font-semibold",children:`Move ${e} out of Spam`}),r.jsx(te,{variant:"ghost",onClick:l,className:"h-11 w-full",children:"Back"})]})]})}function Yo({count:e,destinationLabel:n,onClose:t}){return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-row-inset py-10 text-center",children:[r.jsx(Do,{className:"size-10 text-positive","aria-hidden":!0}),r.jsx("p",{className:"text-base font-semibold text-fg",children:`Moved ${e} ${Mt(e)} out of Spam.`}),r.jsx("p",{className:"text-2xs text-fg-subtle",children:`You'll find them in ${n}.`})]}),r.jsx("div",{className:"border-t border-line bg-surface px-row-inset py-3",children:r.jsx(te,{variant:"primary",onClick:t,className:"h-11 w-full font-semibold",children:"Done"})})]})}function Xo({open:e,candidates:n,defaultDestinationId:t,availableFolders:s,delimiter:o,onConfirmMove:i,onCancel:l}){const[a,d]=c.useState("review"),[u,h]=c.useState(()=>e?new Set(n.map(I=>I.id)):new Set),[g,m]=c.useState(t),[p,C]=c.useState(0),b=c.useRef(!1);c.useEffect(()=>{e&&!b.current&&(d("review"),h(new Set(n.map(I=>I.id))),m(t),C(0)),b.current=e},[e,n,t]);const w=u.size,v=I=>{h(T=>{const E=new Set(T);return E.has(I)?E.delete(I):E.add(I),E})},x=(I,T)=>{h(E=>{const A=new Set(E);for(const L of I.messages)T?A.add(L.id):A.delete(L.id);return A})},k=()=>{const I=Array.from(u);C(I.length),i(I,g),d("done")};return r.jsxs(zo,{open:e,onClose:l,dismissLabel:"Close rescue",children:[a==="review"&&r.jsx(Jo,{candidates:n,selected:u,onToggle:v,onToggleGroup:x,onSelectAll:()=>h(new Set(n.map(I=>I.id))),onSelectNone:()=>h(new Set),onContinue:()=>d("destination"),onCancel:l}),a==="destination"&&r.jsx(Go,{count:w,folders:s,delimiter:o,destination:g,onPick:m,onMove:k,onBack:()=>d("review")}),a==="done"&&r.jsx(Yo,{count:p,destinationLabel:Ct(s,g),onClose:l})]})}function Zo(e){const n=e.toAddresses.join(", ");return{id:e.outboxMessageId,accountId:e.accountId,fromName:e.fromName??e.fromAddress??"Me",fromEmail:e.fromAddress??"",subject:e.subject??"(No subject)",snippet:n?`To: ${n}`:"(No recipients)",timeLabel:Qe(e.updatedAt),isRead:!0}}function ei(e){return{id:e.messageId,accountId:e.accountId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Qe(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0}}function ti({outboxMessages:e,accountId:n,imapThreads:t}){const s=e.filter(l=>l.status==="draft"&&l.accountId===n).map(Zo),o=t.map(ei),i=[];return s.length>0&&i.push({id:"remit-drafts",label:"Not yet sent (Remit)",threads:s}),o.length>0&&i.push({id:"imap-drafts",label:"On the server",threads:o}),i}const si=({label:e,count:n})=>r.jsxs("div",{className:"sticky top-0 z-10 flex items-baseline justify-between border-b border-line bg-surface-sunken px-row-inset py-1",children:[r.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:e}),r.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:n})]}),ni=({row:e,isSelected:n,onOpen:t,onDelete:s,isDeleting:o})=>r.jsxs("button",{type:"button",onClick:()=>t(e.id),className:Ee("group",qt({active:n})),children:[r.jsx(Fs,{className:"size-7 shrink-0 text-fg-muted mt-0.5"}),r.jsx(Ht,{thread:e}),r.jsx("div",{className:"flex items-center gap-1 shrink-0",children:r.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),s(e.id)},disabled:o,className:"p-1.5 rounded-md text-fg-muted hover:text-danger hover:bg-surface-raised transition-colors opacity-0 group-hover:opacity-100 focus:opacity-100",title:"Delete draft",children:r.jsx(Bt,{className:"size-3.5"})})})]}),oi=({row:e,isSelected:n,onOpen:t})=>{const s=!e.isRead;return r.jsxs("button",{type:"button",onClick:()=>t(e.id),className:Ee("group",qt({active:n})),children:[s&&r.jsx("span",{className:"absolute left-1.5 top-1/2 size-1.5 -translate-y-1/2 rounded-full bg-accent"}),r.jsx(kt,{name:e.fromName,email:e.fromEmail,size:"sm"}),r.jsx(Ht,{thread:e})]})};function ii({accountId:e,selectedMessageId:n,imapThreads:t,title:s,unreadCount:o}){const i=po(),l=xo(),a=Je(),d=It(),{data:u}=Tt(As()),h=c.useMemo(()=>ti({outboxMessages:u?.items??[],accountId:e,imapThreads:t}),[u?.items,e,t]),g=jt({...Ns(),onSuccess:()=>{d.invalidateQueries({queryKey:Os()})}}),m=b=>{g.mutate({path:{outboxMessageId:b}})},p=b=>{const w=t.find(v=>v.messageId===b)?.threadId;w&&a({threadId:w,messageId:b})},C=h.length===0;return r.jsxs("section",{className:"flex h-full w-full flex-col bg-surface",children:[r.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[r.jsx(ko,{}),r.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:s}),(o??0)>0&&r.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:[o," unread"]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:C?r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-center px-4",children:[r.jsx(zs,{className:"size-8 text-fg-subtle"}),r.jsx("p",{className:"text-sm font-medium text-fg",children:"No drafts"}),r.jsx("p",{className:"text-xs text-fg-subtle",children:"Messages you start composing will appear here."})]}):h.map(b=>r.jsxs("div",{children:[b.label&&r.jsx(si,{label:b.label,count:b.threads.length}),r.jsx("div",{className:"divide-y divide-line",children:b.threads.map(w=>b.id==="remit-drafts"?r.jsx(ni,{row:w,isSelected:w.id===i,onOpen:l,onDelete:m,isDeleting:g.isPending},w.id):r.jsx(oi,{row:w,isSelected:w.id===n,onOpen:p},w.id))})]},b.id))})]})}const os=e=>e===1?"1 message":`${ss(e)} messages`,ri=e=>({title:"Empty Trash?",description:`${os(e)} ${e===1?"is":"are"} erased from the mail server and cannot be restored.`,confirmLabel:"Empty Trash"}),ai=(e,n={})=>{const{trashFolderLabel:t,staleFolderLabel:s}=n;if(e==="unconfirmed"){const o=go(0,"unconfirmed",{trashFolderLabel:t});return{headline:o.title,body:o.description,actionLabel:o.confirmLabel}}return e==="stale"?{headline:"Nothing was emptied.",body:s?`The folder you chose for Trash — ${s} — is gone from the mail server.`:"The folder you chose for Trash is gone from the mail server.",actionLabel:"Pick another folder"}:{headline:"Nothing was emptied.",body:"No folder on this account is set as Trash.",actionLabel:"Pick a folder"}};function li({messageCount:e,isEmptying:n,deletedCount:t,refusalReason:s,trashFolderLabel:o,staleFolderLabel:i,onEmpty:l,onRepair:a,children:d}){const[u,h]=c.useState(!1);if(e<1&&s===void 0&&t===void 0)return r.jsx(r.Fragment,{children:d});const g=s?ai(s,{trashFolderLabel:o,staleFolderLabel:i}):void 0,m=ri(e);return r.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[r.jsx("div",{className:"shrink-0 px-row-inset pt-2",children:r.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-line px-3 py-2",children:[r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[t!==void 0&&r.jsx("p",{className:"mr-auto text-2xs text-fg-subtle",role:"status",children:`${os(t)} erased from the mail server.`}),r.jsx(te,{variant:"ghost",size:"sm",icon:r.jsx(Bt,{className:"size-3.5","aria-hidden":!0}),disabled:n||e<1,"aria-busy":n,onClick:()=>h(!0),children:n?"Emptying…":"Empty Trash"})]}),g&&r.jsx(dt,{tone:"warning",variant:"soft",children:r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx("p",{className:"font-semibold text-fg",children:g.headline}),r.jsx("p",{className:"text-sm",children:g.body}),r.jsx(te,{variant:"primary",size:"sm",className:"self-start",onClick:a,children:g.actionLabel})]})})]})}),r.jsx("div",{className:"min-h-0 flex-1",children:d}),r.jsx(Mo,{isOpen:u,title:m.title,description:m.description,confirmLabel:m.confirmLabel,destructive:!0,onConfirm:()=>{h(!1),l()},onCancel:()=>h(!1)})]})}function ci(e,n,t){const s=new Array(e);return new Proxy(s,{get(o,i,l){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const d=+i;if(Number.isInteger(d)&&d>=0&&d<e){let u=o[d];if(!u){const h=n[d*2];u=o[d]={index:d,key:t(d),start:h,size:n[d*2+1],end:h+n[d*2+1],lane:0}}return u}}if(i==="length")return e}return Reflect.get(o,i,l)}})}function _e(e,n,t){let s=t.initialDeps??[],o,i=!0;function l(){const a=e();return(a.length!==s.length||a.some((u,h)=>s[h]!==u))&&(s=a,o=n(...a),t?.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(o),i=!1),o}return l.updateDeps=a=>{s=a},l}function Dt(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const di=(e,n)=>Math.abs(e-n)<1.01,ui=(e,n,t)=>{let s;return function(...o){e.clearTimeout(s),s=e.setTimeout(()=>n.apply(this,o),t)}};let Ue;const St=()=>{if(Ue!==void 0)return Ue;if(typeof navigator>"u")return Ue=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ue=!0;const e=navigator.maxTouchPoints;return Ue=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Lt=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},hi=e=>e,fi=e=>{const n=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1)-n+1,o=new Array(s);for(let i=0;i<s;i++)o[i]=n+i;return o},mi=(e,n)=>{const t=e.scrollElement;if(!t)return;const s=e.targetWindow;if(!s)return;const o=l=>{const{width:a,height:d}=l;n({width:Math.round(a),height:Math.round(d)})};if(o(Lt(t)),!s.ResizeObserver)return()=>{};const i=new s.ResizeObserver(l=>{const a=()=>{const d=l[0];if(d?.borderBoxSize){const u=d.borderBoxSize[0];if(u){o({width:u.inlineSize,height:u.blockSize});return}}o(Lt(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},ct={passive:!0},gi=typeof window>"u"?!0:"onscrollend"in window,pi=(e,n,t)=>{const s=e.scrollElement;if(!s)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&gi;let l=0;const a=i?null:ui(o,()=>n(l,!1),e.options.isScrollingResetDelay),d=g=>()=>{l=t(s),a?.(),n(l,g)},u=d(!0),h=d(!1);return s.addEventListener("scroll",u,ct),i&&s.addEventListener("scrollend",h,ct),()=>{s.removeEventListener("scroll",u),i&&s.removeEventListener("scrollend",h)}},xi=(e,n)=>pi(e,n,t=>{const{horizontal:s,isRtl:o}=e.options;return s?t.scrollLeft*(o&&-1||1):t.scrollTop}),bi=(e,n,t)=>{if(t.options.useCachedMeasurements){const s=t.indexFromElement(e),o=t.options.getItemKey(s);return t.itemSizeCache.get(o)??t.options.estimateSize(s)}if(n?.borderBoxSize){const s=n.borderBoxSize[0];if(s)return Math.round(s[t.options.horizontal?"inlineSize":"blockSize"])}if(!n){const s=t.indexFromElement(e),o=t.options.getItemKey(s),i=t.itemSizeCache.get(o);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},vi=(e,{adjustments:n=0,behavior:t},s)=>{var o,i;(i=(o=s.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[s.options.horizontal?"left":"top"]:e+n,behavior:t})},Si=vi;class yi{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,s,o;return((o=(s=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:s.now)==null?void 0:o.call(s))??Date.now()},this.observer=(()=>{let t=null;const s=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const l=()=>{const a=i.target,d=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[u,h]of this.elementsCache)if(h===a){this.elementsCache.delete(u);break}return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var o;(o=s())==null||o.disconnect(),t=null},observe:o=>{var i;return(i=s())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=s())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=t=>{var s,o;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:hi,rangeExtractor:fi,onChange:()=>{},measureElement:bi,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const m in t){const p=t[m];p!==void 0&&(i[m]=p)}const l=this.options;let a=null,d=null,u=!1;if(l!==void 0&&l.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const m=l.count,p=i.count,C=this.getMeasurements(),b=m>0?((s=C[0])==null?void 0:s.key)??l.getItemKey(0):null,w=m>0?((o=C[m-1])==null?void 0:o.key)??l.getItemKey(m-1):null;if(p!==m||m>0&&p>0&&(i.getItemKey(0)!==b||i.getItemKey(p-1)!==w)){u=!0;const k=m>0?this.getVirtualItemForOffset(this.getScrollOffset())??C[0]:null;k&&(a=[k.key,this.getScrollOffset()-k.start]);const I=i.followOnAppend===!0?"auto":i.followOnAppend||null;I&&p>m&&this.isAtEnd(l.scrollEndThreshold)&&(m===0||i.getItemKey(p-1)!==w)&&(d=I)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let h=!1,g=0;if(a&&this.scrollOffset!==null){const[m,p]=a,C=this.getMeasurements(),{count:b,getItemKey:w}=this.options;let v=0;for(;v<b&&w(v)!==m;)v++;if(v<b){const x=C[v];if(x){const k=x.start+p;k!==this.scrollOffset&&(g=k-this.scrollOffset,this.scrollOffset=k,h=!0)}}}(h||d)&&(this.pendingScrollAnchor=[h?a[0]:null,h?a[1]:0,d,g])},this.notify=t=>{var s,o;(o=(s=this.options).onChange)==null||o.call(s,this,t)},this.maybeNotify=_e(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}if(this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,l)=>{if(l&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const a=this.getScrollOffset();this.scrollDirection=l?a===i?this.scrollDirection:a<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!St()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",l,ct),i.addEventListener("touchend",a,ct),this.unsubs.push(()=>{i.removeEventListener("touchstart",l),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,l,a,d]=o;i!==null&&!a&&(St()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?d!==0&&(this._iosDeferredAdjustment+=d):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),s=this.getMaxScrollOffset();if(t<0||t>s)return;const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=_e(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,s,o,i,l,a,d,u)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:t,paddingStart:s,scrollMargin:o,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:d,gap:u}),{key:!1}),this.getMeasurements=_e(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:s,scrollMargin:o,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:d,gap:u},h)=>{const g=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const v of this.laneAssignments.keys())v>=t&&this.laneAssignments.delete(v);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(v=>{this.itemSizeCache.set(v.key,v.size)}));const m=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),a===1){const v=t*2;let x=this._flatMeasurements;if(!x||x.length<v){const T=new Float64Array(v);x&&m>0&&T.set(x.subarray(0,m*2)),x=T,this._flatMeasurements=x}let k;if(m===0)k=s+o;else{const T=m-1;k=x[T*2]+x[T*2+1]+u}for(let T=m;T<t;T++){const E=i(T),A=g.get(E),L=typeof A=="number"?A:this.options.estimateSize(T);x[T*2]=k,x[T*2+1]=L,k+=L+u}const I=ci(t,x,i);return this.measurementsCache=I,I}const p=this.measurementsCache.slice(0,m),C=new Array(a).fill(void 0),b=new Float64Array(a);let w=0;for(let v=0;v<m;v++){const x=p[v];x&&(C[x.lane]===void 0&&w++,C[x.lane]=v,b[x.lane]=x.end)}for(let v=m;v<t;v++){const x=i(v),k=this.laneAssignments.get(v);let I,T;const E=d==="estimate"||g.has(x);if(k!==void 0&&this.options.lanes>1){I=k;const F=C[I],J=F!==void 0?p[F]:void 0;T=J?J.end+u:s+o}else if(w===a){let F=0,J=b[0],_=C[0];for(let G=1;G<a;G++){const se=b[G];(se<J||se===J&&C[G]<_)&&(F=G,J=se,_=C[G])}I=F,T=J+u,E&&this.laneAssignments.set(v,I)}else I=v%this.options.lanes,T=s+o,E&&this.laneAssignments.set(v,I);const A=g.get(x),L=typeof A=="number"?A:this.options.estimateSize(v),O=T+L;p[v]={index:v,start:T,size:L,end:O,key:x,lane:I},C[I]===void 0&&w++,C[I]=v,b[I]=O}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=_e(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,s,o,i)=>t.length===0||s===0?(this.range=null,null):(this.range=Ii(t,s,o,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_e(()=>{let t=null,s=null;const o=this.calculateRange();return o&&(t=o.startIndex,s=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,s]},(t,s,o,i,l)=>i===null||l===null?[]:t({startIndex:i,endIndex:l,overscan:s,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const s=this.options.indexAttribute,o=t.getAttribute(s);return o?parseInt(o,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var s;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:s.index);if(o!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,o-i),a=Math.min(this.options.count-1,o+i);return t>=l&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((l,a)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(a))});return}const s=this.indexFromElement(t),o=this.options.getItemKey(s),i=this.elementsCache.get(o);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(o,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,s)=>{var o,i;if(t<0||t>=this.options.count)return;let l,a,d;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)d=this.options.getItemKey(t),a=u[t*2],l=u[t*2+1];else{const m=this.measurementsCache[t];if(!m)return;d=m.key,a=m.start,l=m.size}const h=this.itemSizeCache.get(d)??l,g=s-h;if(g!==0){const m=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,p=m?this.getTotalSize():0,C=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:d,start:a,size:l,end:a+l,lane:0},g,this):a<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(d)||this.scrollDirection!=="backward"));(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(d,s),this.itemSizeCacheVersion++,m?this.applyScrollAdjustment(this.getTotalSize()-p):C&&this.applyScrollAdjustment(g),this.notify(!1)}},this.getVirtualItems=_e(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,s)=>{const o=[];for(let i=0,l=t.length;i<l;i++){const a=t[i],d=s[a];o.push(d)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const s=this.getMeasurements();if(s.length===0)return;const o=this._flatMeasurements,i=this.options.lanes===1&&o!=null,l=is(0,s.length-1,i?a=>o[a*2]:a=>Dt(s[a]).start,t);return Dt(s[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,s,o=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),l=this.getScrollOffset();s==="auto"&&(s=t>=l+i?"end":"start"),s==="center"?t+=(o-i)/2:s==="end"&&(t-=i);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,s="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getSize(),i=this.getScrollOffset(),l=this.measurementsCache[t];if(!l)return;if(s==="auto")if(l.end>=i+o-this.options.scrollPaddingEnd)s="end";else if(l.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];if(s==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),s];const a=s==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,s,l.size),s]},this.scrollToOffset=(t,{align:s="start",behavior:o="auto"}={})=>{const i=this.getOffsetForAlignment(t,s),l=this.now();this.scrollState={index:null,align:s,behavior:o,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:s="auto",behavior:o="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,s);if(!i)return;const[l,a]=i,d=this.now();this.scrollState={index:t,align:a,behavior:o,startedAt:d,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:s="auto"}={})=>{const o=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const s=this.getMeasurements();let o;if(s.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const i=s.length-1,l=this._flatMeasurements;l!=null?o=l[i*2]+l[i*2+1]:o=((t=s[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let l=s.length-1;for(;l>=0&&i.some(a=>a===null);){const a=s[l];i[a.lane]===null&&(i[a.lane]=a.end),l--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const s=this.getMeasurements();for(const o of s)o&&this.itemSizeCache.has(o.key)&&t.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return t},this._scrollToOffset=(t,{adjustments:s,behavior:o})=>{this._intendedScrollOffset=t+(s??0),this.options.scrollToFn(t,{behavior:o,adjustments:s},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(n)}applyScrollAdjustment(n,t){n!==0&&(St()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=n:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const s=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=s?s[0]:this.scrollState.lastTargetOffset,i=1,l=o!==this.scrollState.lastTargetOffset;if(!l&&di(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const a=this.getSize()||600,d=Math.abs(o-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&d>a;this.scrollState.lastTargetOffset=o,u||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const is=(e,n,t,s)=>{for(;e<=n;){const o=(e+n)/2|0,i=t(o);if(i<s)e=o+1;else if(i>s)n=o-1;else return o}return e>0?e-1:0};function Ci(e,n,t){let s=0;for(;s<=n;){const o=(s+n)/2|0,i=e[o*2];if(i<t)s=o+1;else if(i>t)n=o-1;else return o}return s>0?s-1:0}function Ii(e,n,t,s,o){const i=e.length-1;if(e.length<=s)return{startIndex:0,endIndex:i};if(s===1&&o!==null){const u=Ci(o,i,t);let h=u;const g=t+n;for(;h<i&&o[h*2]+o[h*2+1]<g;)h++;return{startIndex:u,endIndex:h}}let a=is(0,i,u=>e[u].start,t),d=a;if(s===1)for(;d<i&&e[d].end<t+n;)d++;else if(s>1){const u=Array(s).fill(0);for(;d<i&&u.some(g=>g<t+n);){const g=e[d];u[g.lane]=g.end,d++}const h=Array(s).fill(t+n);for(;a>=0&&h.some(g=>g>=t);){const g=e[a];h[g.lane]=g.start,a--}a=Math.max(0,a-a%s),d=Math.min(i,d+(s-1-d%s))}return{startIndex:a,endIndex:d}}const yt=typeof document<"u"?c.useLayoutEffect:c.useEffect;function Ti({useFlushSync:e=!0,directDomUpdates:n=!1,directDomUpdatesMode:t="transform",...s}){const o=c.useReducer(u=>u+1,0)[1],i=c.useRef({enabled:n,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=n,i.current.mode=t;const l=u=>{const h=i.current;if(!h.enabled||!h.container)return;const g=u.getTotalSize();if(g!==h.lastSize){h.lastSize=g;const v=u.options.horizontal?"width":"height";h.container.style[v]=`${g}px`}const m=!!u.options.horizontal,p=h.mode==="transform",C=m?"left":"top",b=u.options.scrollMargin,w=u.getVirtualItems();for(const v of w){const x=v.start-b,k=u.elementsCache.get(v.key);k&&h.lastPositions.get(k)!==x&&(h.lastPositions.set(k,x),p?k.style.transform=m?`translate3d(${x}px, 0, 0)`:`translate3d(0, ${x}px, 0)`:k.style[C]=`${x}px`)}},a={...s,onChange:(u,h)=>{var g;const m=i.current;let p=!0;if(m.enabled){l(u);const C=u.range,b=m.prevRange;p=!b||b.isScrolling!==u.isScrolling||b.startIndex!==C?.startIndex||b.endIndex!==C?.endIndex,p&&(m.prevRange=C?{startIndex:C.startIndex,endIndex:C.endIndex,isScrolling:u.isScrolling}:null)}p&&(e&&h?Ds.flushSync(o):o()),(g=s.onChange)==null||g.call(s,u,h)}},[d]=c.useState(()=>{const u=new yi(a);return Object.assign(u,{containerRef:h=>{const g=i.current;if(g.container=h,g.lastSize=null,h&&g.enabled){const m=u.getTotalSize();g.lastSize=m;const p=u.options.horizontal?"width":"height";h.style[p]=`${m}px`}}})});return d.setOptions(a),yt(()=>d._didMount(),[]),yt(()=>d._willUpdate()),yt(()=>{l(d)}),d}function ji(e){return Ti({observeElementRect:mi,observeElementOffset:xi,scrollToFn:Si,...e})}const Rt=e=>e.query?`matching "${e.query}"`:e.from?`from "${e.from}"`:"matching your search",wi=e=>`Select all ${Rt(e)}`,ki=(e,n)=>`All ${ss(n)} ${Rt(e)} selected`,Mi=({verb:e,confirmingDelete:n,hasSelection:t,junkMailboxId:s,currentMailboxId:o,deletableMessageId:i})=>{if(n)return{kind:"withheld"};if(e==="junk"){const l=gn(s,o);if(l!==void 0)return{kind:"unavailable",reason:l}}return t?{kind:"openWizard"}:e!=="delete"||i===void 0?{kind:"declined"}:{kind:"confirmDelete",messageId:i}},Ri=(e,n,t)=>e==="BACK"&&n&&t===void 0,Ei=(e,n)=>({id:e.messageId,accountId:e.accountId,mailboxId:e.mailboxId,threadId:e.threadId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Qe(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Ut(e.category),messageCount:n,suspicious:e.authenticity?.dkimMismatch===!0,labels:e.labels}),Ai=({thread:e,mailboxId:n,isSelected:t,isFocused:s,isTabStop:o,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:d,messageCount:u,isMultiSelectMode:h,onLongPress:g,isDesktop:m,density:p})=>r.jsx(pn,{thread:Ei(e,u),link:{mailboxId:n,threadId:e.threadId},inListbox:!0,active:t,focused:s,isTabStop:o,density:p,isDesktop:m,onFocusRow:i,selection:{isChecked:l,onToggleCheck:a,onRowSelect:d,isMultiSelectMode:h,onLongPress:g}}),Oi=c.memo(Ai),Ni=e=>{const n=e.authenticity?.dkimMismatch===!0;return{id:e.messageId,accountId:e.accountId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Qe(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Ut(e.category),suspicious:n}},zi=({thread:e,mailboxId:n,isSelected:t,isFocused:s,isTabStop:o,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:d,isMultiSelectMode:u,onLongPress:h,isDesktop:g,onDelete:m,onToggleRead:p,density:C})=>{const[b,w]=c.useState("none"),v=Je(),x=c.useCallback(A=>{navigator.vibrate?.(10),A==="trailing"?m(e.messageId):p(e.messageId,e.isRead),w("none")},[m,p,e.messageId,e.isRead]),k=c.useCallback(()=>{h(e.messageId)},[h,e.messageId]),I=c.useCallback(()=>{a(e.messageId)},[a,e.messageId]),T=c.useCallback(()=>{v({threadId:e.threadId,messageId:e.messageId})},[v,e.threadId,e.messageId]),E=xn(e.messageId,d);return g||u?r.jsx(Oi,{thread:e,mailboxId:n,isSelected:t,isFocused:s,isTabStop:o,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:d,isMultiSelectMode:u,onLongPress:h,isDesktop:g,density:C}):r.jsx("div",{role:"presentation",onPointerDownCapture:E.onMouseDown,onClickCapture:E.claimClick,onContextMenu:E.onContextMenu,children:r.jsx(co,{thread:Ni(e),selectionMode:!1,checked:!1,active:t,peek:b,onPeek:w,onToggleCheck:I,onLongPress:k,onOpen:T,onAct:x})})},Fi=72,Di=32,Li=5,rs="remit:list-density",_i=()=>{try{const e=localStorage.getItem(rs);if(e==="compact"||e==="comfortable")return e}catch{}return"comfortable"},Pi=({query:e})=>r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface-sunken/30",children:[r.jsx(Ws,{className:"size-4 text-fg-muted"}),r.jsxs("span",{className:"text-sm text-fg-muted",children:["Results for “",e,"”"]})]}),Bi=(e,n,t)=>Oo(e.filter(s=>n.has(s.messageId)).map(s=>s.accountId??t)).moveDisabledHint,$i=({mailboxId:e,threads:n,selectedMessageId:t,isLoading:s,isError:o=!1,error:i,onRetry:l,searchQuery:a,searchPredicate:d,onDeleteMessages:u,isDeleting:h=!1,isMoving:g=!1,onLoadMore:m,hasMore:p=!1,isLoadingMore:C=!1,accountId:b,listTitle:w,listMeta:v,listFilter:x,listScopeLabel:k,onTriageContextChange:I,commandsRef:T,hideHeader:E=!1})=>{const A=c.useRef(null),L=Je(),O=Ls(),F=_s(),{verb:J,start:_,startFromSearch:G}=F,se=Ps(),pe=!!a?.trim(),P=bn(),{labels:Pe}=Eo(b),{pushError:ae}=$t(),[M,Ce]=c.useState(t),[W,Ie]=c.useState(),V=c.useCallback(f=>{Ie(S=>S===f?S:void 0),Ce(f)},[]),[D,Be]=c.useState(_i),xe=c.useCallback(()=>{Be(f=>{const S=f==="comfortable"?"compact":"comfortable";try{localStorage.setItem(rs,S)}catch{}return S})},[]),{toggleReadFor:be}=Qt({mailboxId:e}),{junkMailboxId:le}=Jt(b),Ae=Gt(le,e),Oe=c.useMemo(()=>[{accountId:b,mailboxId:e}],[b,e]),{outcome:ce,staleFolderLabel:K,guessedMailboxId:H}=vn(Oe),{selectedIds:Z,selectedCount:q,hasSelection:oe,isSelected:Ne,toggle:ee,select:Te,clearSelection:de,selectRange:ue,setAnchor:N,selectAll:je,toggleAll:$e,intersectWith:ze}=Sn(),R=Nn(q,O),[Fe,he]=c.useState(null),We=pe&&!!d,Ge=`${e}|${JSON.stringify(d??{})}`,j=yn({mailboxId:e,accountId:b,enabled:We,predicateKey:Ge,searchQuery:d??{}}),Ye=c.useCallback((f,S,ge)=>{const Q=Cn(f,S,ge,ce);Q&&ae(Q)},[ae,ce]),we=j.phase.kind,Xe=j.clear,z=c.useCallback(()=>{we==="escalated"&&Xe(),de()},[de,Xe,we]),[Ze,et]=c.useState(null),ve=c.useRef(null),ie=c.useRef(!1),Se=c.useRef(null),ke=!s&&n.length>0,ne=ji({count:n.length,getScrollElement:()=>A.current,estimateSize:()=>D==="compact"?Di:Fi,overscan:Li}),Ve=t?n.findIndex(f=>f.messageId===t):-1,Y=M?n.findIndex(f=>f.messageId===M):-1,re=c.useCallback(f=>{if(f<0||f>=n.length)return;const S=n[f];if(R){ee(S.messageId);return}ve.current=S.messageId,ie.current=!1,Ie(S.messageId),Ce(S.messageId)},[n,R,ee]),Ke=c.useCallback(()=>{if(n.length===0)return;const f=Y<0?0:Math.min(Y+1,n.length-1);re(f)},[n.length,Y,re]),He=c.useCallback(()=>{if(n.length===0)return;const f=Y<=0?0:Y-1;re(f)},[n.length,Y,re]),ye=c.useCallback(()=>re(0),[re]),Me=c.useCallback(()=>re(n.length-1),[re,n.length]),Re=c.useCallback(()=>{M&&ee(M)},[M,ee]),B=c.useMemo(()=>n.map(f=>f.messageId),[n]),ft=c.useMemo(()=>{const f=[];for(const S of n)Z.has(S.messageId)&&f.push({id:S.messageId,sender:S.fromName??S.fromEmail??"Unknown",email:S.fromEmail??"",subject:S.subject??"(No subject)",date:Qe(S.sentDate),accountId:b});return f},[n,Z,b]),mt=c.useCallback((f,S)=>S.shiftKey?(ue(B,f,M),!0):S.metaKey||S.ctrlKey?(ee(f),!0):(z(),N(f),!1),[B,M,ue,ee,z,N]),fe=c.useCallback(f=>{!u||f.length===0||(Se.current=M??null,he(f))},[u,M]),De=c.useCallback(f=>{const S=In(B,M,f);S!==void 0&&(ue(B,S),ve.current=S,ie.current=!1,Ie(void 0),Ce(S))},[B,M,ue]),tt=c.useCallback(()=>De(-1),[De]),st=c.useCallback(()=>De(1),[De]),nt=c.useCallback(()=>{B.length>0&&je(B)},[B,je]),ot=c.useCallback(f=>{const S=Mi({verb:f,confirmingDelete:Fe!==null,hasSelection:oe,junkMailboxId:le,currentMailboxId:e,deletableMessageId:u?M:void 0});return S.kind==="openWizard"?(_(f),!0):S.kind==="confirmDelete"?(fe([S.messageId]),!0):S.kind==="unavailable"?(ae({severity:"warning",title:S.reason}),!0):S.kind==="withheld"},[Fe,u,oe,le,e,_,M,fe,ae]),me=c.useCallback((f,S)=>{const ge=n.find(Q=>Q.messageId===f)?.threadId;ge&&L({threadId:ge,messageId:f},{replace:S?.replace})},[L,n]),it=c.useCallback(()=>{M&&me(M)},[M,me]),rt=c.useCallback(f=>me(f,{replace:!0}),[me]);Tn({keyboardFocusedMessageId:W,openMessageId:t,enabled:O&&q===0,open:rt});const Le=j.phase.kind==="escalated"?{scope:Rt(d??{}),total:j.phase.total,searchQuery:d??{},run:f=>j.runAction(f),stop:j.stop}:void 0,gt=c.useCallback(f=>{if(f.length===0){he(null);return}const S=new Set(f),ge=n.findIndex(X=>S.has(X.messageId));let Q;for(let X=ge+1;X<n.length;X++)if(!S.has(n[X].messageId)){Q=n[X].messageId;break}if(Q===void 0){for(let X=ge-1;X>=0;X--)if(!S.has(n[X].messageId)){Q=n[X].messageId;break}}u?.(f),z(),Se.current=null,he(null),Q!==void 0&&(ve.current=Q,ie.current=!1,V(Q),O&&me(Q,{replace:!0})),O||et(jn("delete",f.length,ce))},[n,u,z,me,O,V,ce]),pt=c.useCallback(()=>{const f=Se.current;Se.current=null,he(null),f!==null&&(ve.current=f,ie.current=!1,V(f))},[V]),qe=c.useMemo(()=>Bi(n,Z,b),[b,Z,n]),at=c.useCallback(()=>{if(Le){G();return}_("organize")},[Le,G,_]),xt=c.useCallback(f=>{u?.([f])},[u]),y=c.useCallback((f,S)=>{be([f],!S)},[be]),U=c.useCallback(f=>{O||Te(f)},[O,Te]),$=c.useCallback(()=>{if(j.isRunning||j.phase.kind==="counting"){j.stop();return}z()},[j,z]),ds=c.useCallback(()=>{j.clear()},[j]);c.useEffect(()=>{if(ie.current||!O&&t)return;const f=Y>=0?Y:Ve;f>=0&&ne.scrollToIndex(f,{align:"auto"})},[Y,Ve,ne,O,t]),c.useEffect(()=>{t&&(ie.current=!1,V(t))},[t,V]),c.useEffect(()=>{M&&(n.some(f=>f.messageId===M)||V(n[0]?.messageId))},[n,M,V]),c.useEffect(()=>{I?.({focusedMessageId:M,selectedIds:Array.from(Z),hasList:ke})},[M,Z,ke,I]);const Et=c.useRef(I);Et.current=I,c.useEffect(()=>()=>Et.current?.({focusedMessageId:void 0,selectedIds:[],hasList:!1}),[]),c.useEffect(()=>{j.phase.kind!=="idle"||j.isRunning||ze(n.map(f=>f.messageId))},[n,ze,j.phase,j.isRunning]);const At=c.useRef(e);c.useEffect(()=>{At.current!==e&&(At.current=e,z())},[e,z]),wn({shouldBlockFn:({action:f})=>Ri(f,oe,se)?(z(),!0):!1,enableBeforeUnload:!1,disabled:!oe||se!==void 0}),c.useEffect(()=>{const f=A.current;if(!f||!p||!m)return;const S=()=>{if(C)return;const{scrollTop:ge,scrollHeight:Q,clientHeight:X}=f;ge+X>=Q-200&&m()};return f.addEventListener("scroll",S,{passive:!0}),S(),()=>f.removeEventListener("scroll",S)},[p,C,m]),c.useEffect(()=>{const f=ve.current;if(!f)return;const S=A.current?.querySelector(`[data-message-id="${f}"]`);S&&(ve.current=null,S.focus({preventScroll:!0}))}),c.useEffect(()=>{if(T){if(!ke){T.current=null;return}return T.current={focusNext:Ke,focusPrevious:He,focusFirst:ye,focusLast:Me,openFocused:it,toggleSelect:Re,extendSelectDown:st,extendSelectUp:tt,selectAll:nt,clearSelection:()=>oe?(z(),!0):!1,requestVerb:ot,toggleDensity:xe},()=>{T.current=null}}},[T,ke,Ke,He,ye,Me,it,Re,st,tt,nt,oe,z,ot,xe]);const Ot=s?"loading":o?"error":n.length===0?"empty":"ready",us=o?Ro(i):void 0,hs=c.useCallback(()=>{const f=Bs($s());window.open(f,"_blank","noopener,noreferrer")},[]),fs=[{id:"inbox",threads:[]}],bt=B.length>0&&B.every(f=>Z.has(f)),ms=We&&p&&bt&&!h&&!g&&j.phase.kind==="idle"&&!j.isRunning,gs=h||g||j.isRunning,vt=j.phase.kind==="escalated"?j.phase.total:q,ps=j.runningAction?kn(j.runningAction.kind,j.progress?.done??0,j.progress?.total??vt):j.phase.kind==="counting"?"Counting matches…":j.phase.kind==="escalated"?ki(d??{},j.phase.total):void 0,xs=j.phase.kind!=="escalated"&&B.length>0?{checked:bt,indeterminate:q>0&&!bt,onChange:()=>$e(B)}:void 0,bs=j.runningAction?{value:j.progress?.done??0,max:j.progress?.total??vt,tone:Mn(j.runningAction.kind)}:void 0,vs=(j.phase.kind==="counting"?{tone:"info",text:"",action:{label:"Stop",onClick:j.stop}}:j.phase.kind==="escalated"&&!j.isRunning?{tone:"info",text:"",action:{label:"Clear selection",onClick:ds}}:ms?{tone:"info",text:"",action:{label:wi(d??{}),onClick:j.escalate}}:void 0)??(qe?{tone:"warning",text:qe}:void 0),Ss=r.jsx(Rn,{title:P.title||w,navSlot:P.navSlot,titleMeta:P.titleMeta,searchSlot:P.searchSlot,searchField:P.searchField,idleSlot:P.makeFilterSlot,count:vt,onCancel:$,onDelete:()=>_("delete"),onMove:()=>_("move"),onOrganize:at,onJunk:Ae?()=>_("junk"):void 0,onMarkRead:()=>_("markRead"),overflowSlot:b&&e&&q>0&&Pe.length>0?r.jsx(Ao,{accountId:b,mailboxId:e,messageIds:Array.from(Z)}):void 0,isBusy:gs,isCounting:j.phase.kind==="counting",selectAll:xs,statusLabel:ps,progress:bs,notice:vs}),ys=En(B,M),Cs=c.useCallback(f=>{ie.current=!0,V(f)},[V]),Is=r.jsxs(r.Fragment,{children:[pe&&a&&r.jsx(Pi,{query:a}),r.jsxs("div",{ref:A,role:"listbox","aria-multiselectable":!0,"aria-label":w,className:"flex-1 overflow-y-auto",children:[r.jsx("div",{role:"presentation",className:"relative w-full",style:{height:`${ne.getTotalSize()}px`},children:ne.getVirtualItems().map(f=>{const S=n[f.index];return r.jsx("div",{role:"presentation","data-index":f.index,ref:ne.measureElement,className:Ee("absolute left-0 top-0 w-full border-b border-line",j.isRunning&&"pointer-events-none opacity-50"),style:{transform:`translateY(${f.start}px)`},children:r.jsx(zi,{thread:S,mailboxId:e,isSelected:t===S.messageId,isFocused:M===S.messageId,isTabStop:ys===S.messageId,onFocusRow:Cs,isChecked:Ne(S.messageId),onToggleCheck:ee,onRowSelect:mt,isMultiSelectMode:R,onLongPress:U,isDesktop:O,onDelete:xt,onToggleRead:y,density:D})},f.key)})}),C&&r.jsx(uo,{})]})]});return r.jsxs(r.Fragment,{children:[Ze&&!O&&r.jsx(dt,{tone:"success",variant:"soft",className:"m-2 rounded-md",onDismiss:()=>et(null),children:Ze}),r.jsx(ho,{listTitle:w,listMeta:v,sections:fs,flatList:!0,listState:P.searchResults?"ready":Ot,searchQuery:pe?a:void 0,listFilter:x,listScopeLabel:k,errorMessage:us,onRetry:l,onReportError:hs,density:D,selectedThreadId:t,onSelectThread:f=>me(f),isDesktop:O,hideHeader:E,selectionBar:Ss,listBody:P.searchResults??(Ot==="ready"?Is:void 0)}),r.jsx(An,{isOpen:Fe!==null,messageIds:Fe??[],outcome:ce,accountId:b,trashFolderLabel:w,staleFolderLabel:K,guessedMailboxId:H,isDeleting:h,onConfirm:gt,onCancel:pt}),r.jsx(On,{verb:J,accountId:b,mailboxId:e,selection:ft,selectionRestriction:qe?"spansAccounts":void 0,escalated:Le,escalatedProgress:j.progress,onFinished:z,onRunEnded:Ye})]})},Wi=e=>Wt({path:{accountId:e}}),Vi=e=>{const n=It(),t=wt(),s=jt({...Vs(),onSuccess:()=>{t.recordEvent("sync.triggered"),n.invalidateQueries({queryKey:Wi(e)})}});return{trigger:()=>{s.mutate({path:{accountId:e}})},triggerAsync:()=>s.mutateAsync({path:{accountId:e}}),isPending:s.isPending,error:s.error,reset:s.reset}},Ki=({accountId:e,children:n})=>{const{triggerAsync:t,isPending:s}=Vi(e);return r.jsx(Po,{onRefresh:t,isRefreshing:s,children:n})};function Hi({accountId:e,currentMailboxId:n,candidates:t,onMove:s,children:o}){const[i,l]=c.useState(!1),a=wt(),d=Ks(),{inboxMailboxId:u}=zn(e),h=Fn(e),{data:g}=Tt({...Hs({path:{accountId:e}}),staleTime:1/0}),m=c.useMemo(()=>qs({mailboxes:g?.items??[],folderAppointments:h,currentMailboxId:n,translator:d}),[g?.items,h,n,d]),p=c.useMemo(()=>u||(m.find(x=>x.label.toLowerCase()==="inbox")?.id??m.find(x=>!x.isCurrent)?.id??""),[u,m]),C=c.useRef(!1);c.useEffect(()=>{C.current||(C.current=!0,Dn(a,t.length))},[a,t.length]);const b=c.useCallback(()=>{Ln(a,t.length),l(!0)},[a,t.length]),w=c.useCallback((v,x)=>{_n(a,{selected:v.length,total:t.length,toInbox:x===u}),s(v,x)},[a,t.length,u,s]);return r.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[r.jsx("div",{className:"shrink-0 px-row-inset pt-2",children:r.jsx($o,{count:t.length,onReview:b})}),r.jsx("div",{className:"min-h-0 flex-1",children:o}),r.jsx(Xo,{open:i,candidates:t,defaultDestinationId:p,availableFolders:m,delimiter:Us(g?.items??[]),onConfirmMove:w,onCancel:()=>l(!1)})]})}const qi=(e,n,t,s)=>`${e??""}|${n}|${t??""}|${s??""}`,Ui=({accountId:e,mailboxId:n})=>{const t=It(),{pushError:s}=$t(),{requestAppointment:o}=Qs(),{trashByAccount:i}=Yt(),l=e?i.get(e):void 0,a=qi(e,n,l?.mailboxId,l?.source),[d,u]=c.useState({scope:a});d.scope!==a&&u({scope:a});const h=d.scope===a?d:void 0,g=c.useCallback(()=>t.getQueryData(Js())?.accounts.find(T=>T.accountId===e)?.folderAppointments.find(T=>T.role==="Trash")?.mailboxId??n,[t,e,n]),m=c.useRef(void 0),{mutateAsync:p,isPending:C}=jt({...Xs(),onMutate:()=>(m.current=a,{scope:a,listMailboxId:g()}),onSuccess:(x,k,I)=>{I.scope===a&&u({scope:a,deletedCount:x.deletedCount})},onError:(x,k,I)=>{const T=Gs(x);if(!T){s({title:"Couldn't empty Trash",detail:Ys(x),error:x});return}I?.scope===a&&u({scope:a,refusal:T})},onSettled:(x,k,I,T)=>{m.current===T?.scope&&(m.current=void 0),So(t,yo([T?.listMailboxId??n])),e&&t.invalidateQueries({queryKey:Wt({path:{accountId:e}})})}}),b=c.useCallback(()=>e?(u({scope:a}),p({path:{accountId:e}}).then(()=>{},()=>{})):Promise.resolve(),[e,a,p]),w=c.useCallback(()=>{b()},[b]),v=c.useCallback(()=>{const x=h?.refusal;x&&o({accountId:x.accountId,role:x.role,reason:x.reason,action:{kind:"emptyTrash"},onAppointed:b})},[h,o,b]);return{emptyTrash:w,isEmptying:C&&m.current===a,deletedCount:h?.deletedCount,refusal:h?.refusal,repair:v}},Qi="We can verify this sender";function Ji(e){const{data:n}=Tt({...Zs({path:{mailboxId:e??""},query:{senderTrust:["vip","wellknown"],dkimMismatch:!1,results:!0,limit:500}}),enabled:!!e,staleTime:6e4});return{candidates:(n?.items??[]).map(s=>({id:s.messageId,senderName:s.fromName||s.fromEmail||"Unknown sender",senderAddress:s.fromEmail??"",subject:s.subject||"(no subject)",snippet:s.snippet??"",trustReason:Qi,trustSubReason:Pn(s.senderTrust),senderTrust:s.senderTrust}))}}const Gi=e=>{const n=new Set,t=[];for(const s of e)n.has(s.threadMessageId)||(n.add(s.threadMessageId),t.push(s));return t},Yi={unread:"unread",flagged:"starred",attachment:"attachments"},Xi=new Set(Object.values(en)),as=e=>Xi.has(e),Zi=e=>as(e.category)||e.attributes.size>0,er=e=>{const n={};as(e.category)&&(n.category=[e.category]);for(const t of e.attributes){const s=Yi[t];s&&(n[s]=!0)}return n},tr=e=>(e.senderTrust?.length??0)>0||e.dkimMismatch!==void 0?"loaded-pages":"whole-folder",sr=["category","unread","starred","attachments"],_t=e=>JSON.stringify(sr.map(n=>e?.[n]??null)),nr=e=>{if(!Array.isArray(e))return;const[n]=e;if(typeof n!="object"||n===null)return;const t=n.query;if(!(typeof t!="object"||t===null))return t},or=(e,n)=>{const t=nr(e);return t?_t(t)===_t(n):!1},lt=e=>e[0],ir=e=>{const n=lt(e.filter(a=>a.type==="from").map(a=>a.value)),t=lt(e.filter(a=>a.type==="subject").map(a=>a.value)),s=lt(e.filter(a=>a.type==="category").map(a=>a.category)),o=lt(e.filter(a=>a.type==="isUnread"||a.type==="isRead").map(a=>a.type==="isUnread")),i=e.some(a=>a.type==="isStarred")?!0:void 0,l=e.some(a=>a.type==="hasAttachment")?!0:void 0;return{...n!==void 0?{from:n}:{},...t!==void 0?{subject:t}:{},...s!==void 0?{category:[s]}:{},...o!==void 0?{unread:o}:{},...i!==void 0?{starred:i}:{},...l!==void 0?{attachments:l}:{}}},rr=(e,n)=>{switch(n.type){case"from":return e.from?.toLowerCase()===n.value.toLowerCase();case"subject":return e.subject?.toLowerCase()===n.value.toLowerCase();case"category":return e.category?.length===1&&e.category[0]===n.category;case"isUnread":return e.unread===!0;case"isRead":return e.unread===!1;case"isStarred":return e.starred===!0;case"hasAttachment":return e.attachments===!0;case"before":case"after":case"in":case"account":return!1}};function ar(e,n={}){const t=ir(e),s={...t,...n};return{params:t,residual:e.filter(o=>!rr(s,o))}}function lr(e,n,t){if(n.length===0)return e;const s=[...n];return e.filter(o=>{const i=Bn(o);return $n({...i,accountId:i.accountId??t},s)})}const cr=50,dr=new Map(ts().categories.filter(e=>e.id!=="all").map(e=>[e.id,e.label])),ls=c.createContext(null);function ht(){const e=c.useContext(ls);if(!e)throw new Error("MailboxPane.* must be used inside <MailboxPane>");return e}function ur({mailboxId:e,thread:n,children:t}){const s=Je(),o=Co(),i=_o(),l=n?.threadId,a=n?.messageId,d=wt(),{accounts:u,searchQuery:h,onToggleIntelligence:g}=Vt(),m=cn(),p=Lo(h),C=p.length>0,{freeText:b,tokens:w}=dn(p,m),[v,x]=c.useState("all"),[k,I]=c.useState(new Set),T=c.useMemo(()=>({category:v,attributes:k}),[v,k]),E=c.useMemo(()=>er(T),[T]),A=C||Zi(T),{params:L,residual:O}=ar(w,E),F={order:"desc",limit:cr,...b?{query:b}:{},...L,...E},J={category:F.category,unread:F.unread,starred:F.starred,attachments:F.attachments},_=A?tn({path:{mailboxId:e},query:F}):sn({path:{mailboxId:e},query:{order:"desc"}}),{data:G,isLoading:se,isError:pe,error:P,refetch:Pe,fetchNextPage:ae,hasNextPage:M,isFetchingNextPage:Ce}=fo({queryKey:_,queryFn:async({pageParam:y})=>{if(A){const{data:$}=await an({path:{mailboxId:e},query:{...F,continuationToken:y},throwOnError:!0});return $}const{data:U}=await ln({path:{mailboxId:e},query:{order:"desc",continuationToken:y},throwOnError:!0});return U},initialPageParam:void 0,getNextPageParam:y=>y.continuationToken,placeholderData:(y,U)=>or(U?.queryKey,J)?y:void 0}),{accountId:W,isLoading:Ie}=Wn(e),V=Io({accounts:u}),D=lr(Vn(Gi(G?.pages.flatMap(y=>y.items??[])??[])),O,W),Be=c.useCallback(y=>{x(y)},[]),xe=c.useCallback(y=>{I(U=>{const $=new Set(U);return $.has(y)?$.delete(y):$.add(y),$})},[]),be=c.useCallback(()=>{x("all"),I(new Set)},[]),le=dr.get(v),Ae=le?{label:le,reach:O.length>0?"loaded-pages":tr(F),onClear:be}:void 0,Oe=l?D.find(y=>y.messageId===a)??D.find(y=>y.threadId===l):void 0,ce=Kn(l,a),K=Oe??ce,H=a??K?.messageId,Z=c.useMemo(()=>{if(l)return{threadId:l,mailboxId:K?.mailboxId??e,subject:K?.subject,messageId:H,authenticity:K?.authenticity}},[l,K,H,e]),q=c.useCallback(y=>{H&&y.includes(H)&&o()},[H,o]),{deleteMessages:oe,isPending:Ne}=Nt({mailboxId:e,onAfterOptimisticRemove:q}),{moveMessages:ee,isPending:Te}=zt({mailboxId:e,accountId:W,onAfterOptimisticRemove:q}),de=c.useRef(null),ue=Hn(),{listCommandsRef:N,onTriageContextChange:je,focusedMessageId:$e,selectedIds:ze}=ue,R=D.find(y=>y.messageId===$e)??K,Fe=To({accounts:u})??0,he=qn({thread:K,isOpen:!0,mailboxId:e,accountId:W,onAfterOptimisticRemove:q}),{draftsMailboxId:We}=Un(W),Ge=We!==void 0&&We===e,{archiveMailboxId:j}=Qn(W),Ye=Jn(),we=nn(),Xe=c.useMemo(()=>on(we,l,H),[we,l,H]),z=c.useMemo(()=>{if(R)return y=>we({threadId:R.threadId,messageId:R.messageId,mode:y})},[we,R]),Ze=bo(),et=rn(),ve=vo(),ie=c.useCallback(y=>y?Ye(y):[],[Ye]),{toggleStar:Se}=Gn({threadId:R?.threadId??"",mailboxId:e}),{toggleReadFor:ke}=Qt({mailboxId:e,accountId:W}),{junkMailboxId:ne}=Jt(W),Ve=ne!=null&&ne===e,Y=Gt(ne,e),{candidates:re}=Ji(Ve?ne:void 0),{moveMessages:Ke}=zt({mailboxId:e,threadId:R?.threadId,accountId:W,onAfterOptimisticRemove:q}),{deleteMessages:He}=Nt({mailboxId:e,threadId:R?.threadId,onAfterOptimisticRemove:q}),{addressId:ye,address:Me}=Yn(R),{updateFlags:Re}=Xn({addressId:ye,senderEmail:R?.fromEmail??void 0}),B=c.useCallback(()=>z?.("reply"),[z]),ft=c.useCallback(()=>z?.("reply-all"),[z]),mt=c.useCallback(()=>z?.("forward"),[z]),fe=c.useCallback(()=>ie(R),[ie,R]),De=c.useCallback(()=>{if(N.current?.requestVerb("delete"))return;const y=fe();y.length>0&&He(y)},[N,fe,He]),tt=c.useCallback(()=>{if(N.current?.requestVerb("junk")||!Y)return;const y=fe();y.length!==0&&(Zn(d,{count:y.length,senderTrust:R?.senderTrust??"unknown",wasRescuable:R?eo(R):!1}),Ke(y,Y))},[N,Y,fe,Ke,d,R]),st=c.useCallback(()=>{if(ze.length>0){const y=!(R?.hasStars??!1),U=new Set(ze);for(const $ of D)U.has($.messageId)&&$.hasStars!==y&&Se($.messageId,$.hasStars);return}R&&Se(R.messageId,R.hasStars)},[ze,D,R,Se]),nt=c.useCallback(()=>{if(N.current?.requestVerb("markRead"))return;const y=fe();if(y.length===0)return;const U=!(R?.isRead??!1);ke(y,U)},[N,fe,R,ke]),ot=c.useCallback(()=>{if(!ye)return;const y=Me?.flags?.muted?.value!==!0;Re({muted:{value:y}})},[ye,Me,Re]),me=c.useCallback(()=>{if(!ye)return;const y=Me?.flags?.vip?.value!==!0;Re({vip:{value:y}})},[ye,Me,Re]),it=c.useCallback(()=>{de.current?.open()},[]),rt=Ge?"drafts":j===e?"archive":ne===e?"junk":"inbox",Le=c.useRef("");c.useEffect(()=>{const y=Le.current;Le.current=p,p.length>0&&y.length===0&&d.recordEvent("search.submitted",{mailboxType:rt})},[p,rt,d]);const{goBack:gt,nextMessageId:pt,previousMessageId:qe}=to({context:ue,orderedIds:D.map(y=>y.messageId),selectedMessageId:H,enabled:!Ze&&!et,hasOpenThread:l!==void 0,onClose:o,handlers:{reply:B,replyAll:ft,forward:mt,delete:De,toggleStar:st,toggleRead:nt,muteSender:ot,blockSender:K?it:void 0,vipSender:me,markJunk:tt,toggleIntelligence:K?()=>de.current?.toggle():void 0,compose:ve,goBrief:()=>i("brief"),goInbox:()=>i("brief"),goSent:()=>i("brief"),goFlagged:()=>i("flagged"),goSettings:()=>i("settings")}}),at=y=>{if(!y)return;const U=D.find($=>$.messageId===y);return U?{threadId:U.threadId,messageId:y}:void 0},xt={mailboxId:e,selectedMessageId:H,selectedThread:K,conversation:Z,onOpenThread:s,threads:D,isLoading:se,isError:pe,error:P,mailboxAccountId:W,mailboxAccountLoading:Ie,mailboxName:V,unreadCount:Fe,isDraftsMailbox:Ge,isSpamFolder:Ve,rescueCandidates:re,filterCategory:v,filterAttributes:k,onSelectFilterCategory:Be,onToggleFilterAttribute:xe,onClearFilters:be,listFilter:Ae,onToggleIntelligence:g,intelligenceRef:de,handleDeselectIfRemoved:q,searchPredicate:C&&O.length===0?F:void 0,onDeleteMessages:oe,onMoveMessages:ee,isDeleting:Ne,isMoving:Te,onLoadMore:ae,hasMore:M,isLoadingMore:Ce,onTriageContextChange:je,listCommandsRef:N,onRetry:()=>Pe(),onReply:Xe,onToolbarDelete:he.deleteThread,onToolbarStar:he.toggleStar,isStarred:he.isStarred,onToolbarMove:he.moveThread,onBack:gt,nextThread:at(pt),previousThread:at(qe)};return r.jsx(ls.Provider,{value:xt,children:t})}function cs(){const{mailboxId:e,selectedMessageId:n,threads:t,isLoading:s,isError:o,error:i,onDeleteMessages:l,onMoveMessages:a,isDeleting:d,isMoving:u,onLoadMore:h,hasMore:g,isLoadingMore:m,mailboxAccountId:p,mailboxName:C,unreadCount:b,isDraftsMailbox:w,isSpamFolder:v,rescueCandidates:x,onTriageContextChange:k,listCommandsRef:I,onRetry:T,filterCategory:E,filterAttributes:A,onSelectFilterCategory:L,onToggleFilterAttribute:O,onClearFilters:F,listFilter:J,searchPredicate:_}=ht(),{searchQuery:G,searchInput:se,accounts:pe,resultFolderIndex:P}=Vt(),Pe=jo(),ae=Je(),M=C??"Inbox",Ce=c.useMemo(()=>ts(),[]),{trashMailboxId:W}=ro(p),Ie=wo({accounts:pe}),{trashByAccount:V}=Yt(),D=Ui({accountId:p,mailboxId:e}),Be=W!=null&&W===e,xe=c.useMemo(()=>p?[p]:[],[p]),{hasNewMail:be}=hn(),{state:le,errorMessage:Ae,refresh:Oe}=fn(xe,{onSettled:T}),ce=c.useMemo(()=>r.jsx(mn,{state:le,onRefresh:Oe,label:`Refresh ${M}`,errorMessage:Ae,hasUpdate:be(xe)}),[le,Oe,M,Ae,be,xe]),K=c.useMemo(()=>t.map(N=>ao(N,P)),[t,P]),{hits:H,isLoading:Z}=No({mailboxId:e,filterCategory:E}),q=c.useMemo(()=>lo(H,t.map(N=>N.threadId),P),[H,t,P]),oe=c.useCallback(N=>{const je=N.threadId??t.find($e=>$e.messageId===N.id)?.threadId;je&&ae({threadId:je,messageId:N.id},{mailboxId:N.mailboxId??e,query:se})},[e,ae,se,t]);if(w&&p)return r.jsx(ii,{accountId:p,selectedMessageId:n,imapThreads:t,title:C??"Drafts",unreadCount:b??void 0});const Ne=r.jsx($i,{mailboxId:e,threads:t,selectedMessageId:n,isLoading:s,isError:o,error:i,onRetry:T,searchQuery:G,searchPredicate:_,onDeleteMessages:l,isDeleting:d,isMoving:u,onLoadMore:h,hasMore:g,isLoadingMore:m,accountId:p,listTitle:M,listFilter:J,listScopeLabel:M,hideHeader:!0,onTriageContextChange:k,commandsRef:I}),ee=pe[0]?.accountId,Te=Pe==="phone"&&ee?r.jsx(Ki,{accountId:ee,children:Ne}):Ne,de=v&&x.length>0&&p?r.jsx(Hi,{accountId:p,currentMailboxId:e,candidates:x,onMove:a,children:Te}):Te,ue=Be?r.jsx(li,{messageCount:Ie,isEmptying:D.isEmptying,deletedCount:D.deletedCount,refusalReason:D.refusal?.reason,trashFolderLabel:C??void 0,staleFolderLabel:p?V.get(p)?.staleFolderPath:void 0,onEmpty:D.emptyTrash,onRepair:D.repair,children:de}):de;return r.jsx(mo,{title:M,unreadCount:b,preset:Ce,selectedCategory:E,activeFilters:A,onSelectCategory:L,onToggleFilter:O,onClearFilters:F,searchResults:K,searchLoading:s,relatedResults:q,relatedLoading:Z,onSelectSearchResult:oe,searchResultsInBody:!0,refreshControl:ce,children:ue})}function hr(){const{mailboxId:e,mailboxAccountId:n,mailboxAccountLoading:t,selectedThread:s,conversation:o,onReply:i,onToolbarDelete:l,onToolbarStar:a,isStarred:d,onToolbarMove:u,handleDeselectIfRemoved:h,intelligenceRef:g}=ht(),m=!!o,p=oo(o?.threadId);Xt(g,p);const C=c.useRef(null),{railFits:b,openRail:w}=p;c.useEffect(()=>{if(!b)return;const x=s?.messageId??null;x&&C.current!==x&&s?.authenticity?.dkimMismatch&&(C.current=x,w())},[b,w,s?.messageId,s?.authenticity?.dkimMismatch]);const v=o?r.jsx(Zt,{threadId:o.threadId,mailboxId:o.mailboxId,subject:o.subject,selectedMessageId:o.messageId,authenticity:o.authenticity,onOpenIntelligence:p.open,listOnScreen:!0}):r.jsx(un,{});return r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[r.jsx(io,{hasThread:m,messageId:o?.messageId,intelligenceOpen:p.isShowing,canToggleIntelligence:p.canToggle,onToggleIntelligence:p.toggle,onReply:i?()=>i("reply"):void 0,onReplyAll:i?()=>i("reply-all"):void 0,onForward:i?()=>i("forward"):void 0,onDelete:m?l:void 0,onToggleStar:m?a:void 0,isStarred:d,moveContext:m&&n?{accountId:n,currentMailboxId:e,onMove:u}:void 0,moveContextLoading:t}),r.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:v})]}),r.jsx(es,{isOpen:p.drawerOpen,onClose:p.closeDrawer,thread:s,mailboxId:e,accountId:n,onAfterOptimisticRemove:h})]})}function fr(){const{mailboxId:e,mailboxAccountId:n,selectedThread:t,onToggleIntelligence:s,handleDeselectIfRemoved:o}=ht();return r.jsx(no,{onClose:s,thread:t,mailboxId:e,accountId:n,onAfterOptimisticRemove:o})}function mr(){const{mailboxId:e,mailboxAccountId:n,selectedThread:t,conversation:s,onOpenThread:o,onBack:i,nextThread:l,previousThread:a,handleDeselectIfRemoved:d,intelligenceRef:u}=ht(),h=so(s?.threadId??null);return Xt(u,h),s?r.jsxs(r.Fragment,{children:[r.jsx(Zt,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:i,onOpenIntelligence:h.toggle,onSwipeNext:l?()=>o(l):void 0,onSwipePrevious:a?()=>o(a):void 0,mobileIntelligenceOpen:h.isOpen}),r.jsx(es,{isOpen:h.isOpen,onClose:h.close,thread:t,mailboxId:e,accountId:n,onAfterOptimisticRemove:d})]}):r.jsx(cs,{})}const Lr=Object.assign(ur,{List:cs,Reading:hr,Intelligence:fr,Phone:mr});export{Lr as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ap as g,t as w,L as C,j as s,p as b,d0 as $,T as _,v as S,D as q,ad as H,ci as U,r as x,cj as W,d as K,W as G,Q as J,n as k,dN as R,d4 as V,u as X,ar as Y,bI as Z,f as v,at as y,cD as ee,bJ as se}from"./index-FpwHnbdV.js";import{u as te,p as ne,R as j,e as ae}from"./useSearchTokenContext-DH5XswlU.js";import{C as D}from"./circle-check-big-SYJDr4tY.js";import{C as I}from"./clock-C2olBfsH.js";import{R as oe}from"./row-actions-DgziqjAx.js";import{R as re}from"./rotate-ccw-CwLIBdgY.js";import{N as T}from"./NavMenuButton-n2Am7T-q.js";import{a as p,t as ie}from"./format-BSk7Do06.js";import{i as le,s as A}from"./outbox-status-BlKn6P0x.js";import{n as ce}from"./search-query-Cr_ZXBCp.js";import{c as de}from"./useMessageBodyContent-BOBb68Px.js";const ue={queued:{icon:I,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2",spin:!0},sent:{icon:D,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}};function O({status:e,iconOnly:n,className:a}){const t=ue[e],o=t.icon;return s.jsxs("span",{className:b("inline-flex items-center gap-1.5 text-xs font-medium",t.className,a),children:[s.jsx(o,{className:b("size-4",t.spin&&"animate-spin")}),!n&&t.label]})}const xe=(e,n)=>n?"bg-accent-2-soft":e==="failed"?"bg-danger-soft":e==="blocked"||e==="unfiled"?"bg-warning/10":"";function fe({recipients:e,subject:n,time:a,status:t,error:o,selected:l,onSelect:c,onRetry:r,retrying:d,onEdit:i,onDelete:f,deleting:u}){const m=t==="failed"||t==="blocked"||t==="unfiled";return s.jsxs("div",{className:b("flex items-start gap-3 border-b border-line px-4 py-3 transition-colors hover:bg-surface-raised",xe(t,l)),children:[s.jsxs("button",{type:"button",...$,onClick:c,className:"flex flex-1 min-w-0 items-start gap-3 text-left",children:[s.jsx("div",{className:"mt-0.5 shrink-0",children:s.jsx(O,{status:t,iconOnly:!0})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"truncate text-sm font-medium",children:e}),s.jsx("span",{className:"shrink-0 text-xs text-fg-muted",children:a})]}),s.jsx("div",{className:"truncate text-sm",children:n||"No subject"}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s.jsx(O,{status:t}),o&&s.jsxs("span",{className:"truncate text-xs text-fg-muted",children:["— ",o]})]})]})]}),m&&s.jsx("div",{className:"shrink-0",children:s.jsx(oe,{actions:[...t==="failed"&&r?[{label:"Retry sending",iconOnly:!0,icon:s.jsx(re,{className:"size-3.5"}),busy:d,onClick:r}]:[],...t==="unfiled"?[]:[{label:"Edit as draft",iconOnly:!0,icon:s.jsx(S,{className:"size-3.5"}),onClick:i}]],destructive:{label:"Delete message",iconOnly:!0,icon:s.jsx(_,{className:"size-3.5"}),busy:u,confirm:{prompt:"Delete this message?",confirmLabel:"Delete"},onClick:f}})})]})}function Ee(){return q({from:"/mail/outbox/draft/$outboxMessageId",shouldThrow:!1})?.outboxMessageId}function me(){const e=H(),n=U();return x.useCallback(a=>{e({to:"/mail/outbox/draft/$outboxMessageId",params:{outboxMessageId:a},search:t=>t,hash:n})},[e,n])}function he(){return W()}function be(e,n){const a=n.trim().toLowerCase();if(a.length===0)return!0;const t=[e.subject,e.fromAddress,e.fromName,...e.toAddresses??[],...e.ccAddresses??[]].filter(o=>typeof o=="string").join(" ").toLowerCase();return a.split(/\s+/).every(o=>o.length===0||t.includes(o))}function ge(e){return e.tokens.length>0&&e.freeText.trim().length===0}const L={queued:{icon:I,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2"},sent:{icon:D,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}},pe=e=>ie(e).toDateString()===new Date().toDateString()?p(e,{hour:"numeric",minute:"2-digit"}):p(e,{month:"short",day:"numeric"}),M=e=>p(e,{dateStyle:"medium",timeStyle:"short"}),je=e=>{const n=e.toAddresses??[];return n.length===0?"No recipients":n.length===1?n[0]:`${n[0]} +${n.length-1}`},E=(e,n)=>n?"The outbox cannot filter on those terms":e?"No matching outbox messages":"No outbox messages",Q=x.createContext(null);function N(){const e=x.useContext(Q);if(!e)throw new Error("OutboxPane.* must be used inside <OutboxPane>");return e}function Ne({outboxMessageId:e,children:n}){const a=me(),t=he(),{data:o,isLoading:l}=K(G()),{searchQuery:c}=J(),r=te(),d=ce(c),i=ne(d,r),f=d.length>0,u=ge(i),m=x.useMemo(()=>u?[]:(o?.items??[]).filter(h=>le(h.status)).filter(h=>be(h,i.freeText)),[o,i.freeText,u]),z=x.useMemo(()=>m.find(h=>h.outboxMessageId===e),[m,e]),F={messages:m,hasQuery:f,unsupportedQuery:u,isLoading:l,selectedMessageId:e,selectedMessage:z,onOpenMessage:a,onCloseMessage:t};return s.jsx(Q.Provider,{value:F,children:n})}function P({message:e,isSelected:n,onSelect:a}){const t=X(),o=de(),{pushError:l}=Y(),c=x.useCallback(()=>{t.invalidateQueries({queryKey:Z()})},[t]),r=v({...ee(),onSuccess:c,onError:u=>{l(y("Couldn't resend message","The message wasn't sent.",u))}}),d=v({...se(),onSuccess:c,onError:u=>{l(y("Couldn't delete message","The message wasn't deleted.",u))}}),i=e.status;if(!L[i])return null;const f=A(e.status);return s.jsx(fe,{recipients:je(e),subject:e.subject||"",time:pe(e.sentAt??e.updatedAt),status:i,error:f?e.lastError??void 0:void 0,selected:n,onSelect:a,onRetry:i==="failed"?()=>r.mutate({path:{outboxMessageId:e.outboxMessageId}}):void 0,retrying:r.isPending,onEdit:()=>o(e.outboxMessageId),onDelete:()=>d.mutate({path:{outboxMessageId:e.outboxMessageId}}),deleting:d.isPending})}function B({message:e,onBack:n}){const a=e.status,t=L[a],o=t?.icon??S,l=e.sentAt?M(e.sentAt):M(e.updatedAt);return s.jsxs("div",{className:"h-full overflow-y-auto bg-canvas",children:[s.jsxs("div",{className:"border-b border-line p-4",children:[n&&s.jsxs("button",{type:"button",onClick:n,className:"mb-3 inline-flex items-center gap-1 text-sm text-fg-muted hover:text-fg",children:[s.jsx(V,{className:"size-4"}),s.jsx("span",{children:"Back"})]}),s.jsx("h1",{className:"text-xl font-semibold mb-3",children:e.subject||"(No subject)"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"From:"}),s.jsx("span",{className:"text-fg",children:e.fromName?`${e.fromName} <${e.fromAddress}>`:e.fromAddress})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"To:"}),s.jsx("span",{className:"text-fg",children:(e.toAddresses??[]).join(", ")})]}),e.ccAddresses&&e.ccAddresses.length>0&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Cc:"}),s.jsx("span",{className:"text-fg",children:e.ccAddresses.join(", ")})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Date:"}),s.jsx("span",{className:"text-fg",children:l})]}),t&&s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(o,{className:b("size-4",t.className,a==="sending"&&"animate-spin")}),s.jsx("span",{className:b("text-xs font-medium",t.className),children:t.label}),A(e.status)&&e.lastError&&s.jsxs("span",{className:"text-xs text-fg-muted",children:["— ",e.lastError]})]})]})]}),s.jsx("div",{className:"p-4",children:s.jsx(ae,{html:e.htmlBody,text:e.textBody})})]})}function ve(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,onOpenMessage:l}=N(),c=x.useRef(null);return k({containerRef:c,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:E(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(T,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:e.map(r=>s.jsx(P,{message:r,isSelected:o===r.outboxMessageId,onSelect:()=>l(r.outboxMessageId)},r.outboxMessageId))})]})}function ye(){const{selectedMessage:e}=N();return s.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[s.jsx("header",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-3"}),s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?s.jsx(B,{message:e}):s.jsx(j,{message:"Select a message to read",showHints:!1})})]})}function Oe(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,selectedMessage:l,onOpenMessage:c,onCloseMessage:r}=N(),d=x.useRef(null);return k({containerRef:d,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):l?s.jsx(B,{message:l,onBack:r}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:E(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(T,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:d,className:"flex-1 overflow-y-auto",children:e.map(i=>s.jsx(P,{message:i,isSelected:o===i.outboxMessageId,onSelect:()=>c(i.outboxMessageId)},i.outboxMessageId))})]})}const Qe=Object.assign(Ne,{List:ve,Reading:ye,Phone:Oe});export{Qe as O,Ee as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ah as m,j as o,af as p}from"./index-FpwHnbdV.js";import{a}from"./MailShell-CvGuWCuj.js";import{M as r}from"./MailboxPane-COHQn6Yb.js";import{f as e}from"./search-token-index-C9KNJC5_.js";import{u as s}from"./search-mirror-B2LoSoNR.js";import"./FullCompose-0DIPCtd6.js";import"./ErrorState-4TfgxGLk.js";import"./index-CYwsmjFx.js";import"./useMessageBodyContent-BOBb68Px.js";import"./useSignature-HAuR6_Ul.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DU11pzlc.js";import"./sections-DDQm-Sbc.js";import"./format-BSk7Do06.js";import"./confirm-dialog-B4KJVTQx.js";import"./useSearchTokenContext-DH5XswlU.js";import"./kbd-tXno4rYH.js";import"./search-scope-DTcpOp3S.js";import"./useRefreshControl-CWjutjgw.js";import"./circle-check-big-SYJDr4tY.js";import"./useQueries-Dx2PHSps.js";import"./MailListHeader-Brjq4vBE.js";import"./attachment-file-ul58bxI4.js";import"./mail-DmVe7n1g.js";import"./avatar-G7g9Uwvc.js";import"./download-vw3zYEkx.js";import"./shield-check-Cs0C_oxK.js";import"./useFilters-BBJu_93Q.js";import"./clock-C2olBfsH.js";import"./menu-B-aaGy7K.js";import"./MailViewChrome-C7sCKY-n.js";import"./NavMenuButton-n2Am7T-q.js";import"./useLabels-GtiakPKP.js";import"./useSemanticSearch-CZUtmciE.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-B6YVIwAN.js";import"./circle-help-BoGPc17x.js";import"./circle-check-CsnMhxDa.js";function U(){const{mailboxId:t}=m.useParams(),i=e();return s({to:"/mail/$mailboxId",params:{mailboxId:t}}),o.jsx(r,{mailboxId:t,thread:i,children:o.jsx(a,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(p,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!i})})}export{U as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-FpwHnbdV.js";import{M as r}from"./MailboxPane-COHQn6Yb.js";import"./useSearchTokenContext-DH5XswlU.js";import"./kbd-tXno4rYH.js";import"./useMessageBodyContent-BOBb68Px.js";import"./search-scope-DTcpOp3S.js";import"./useRefreshControl-CWjutjgw.js";import"./circle-check-big-SYJDr4tY.js";import"./search-token-index-C9KNJC5_.js";import"./useQueries-Dx2PHSps.js";import"./MailListHeader-Brjq4vBE.js";import"./attachment-file-ul58bxI4.js";import"./mail-DmVe7n1g.js";import"./avatar-G7g9Uwvc.js";import"./index-CYwsmjFx.js";import"./useSignature-HAuR6_Ul.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DU11pzlc.js";import"./sections-DDQm-Sbc.js";import"./format-BSk7Do06.js";import"./ErrorState-4TfgxGLk.js";import"./download-vw3zYEkx.js";import"./shield-check-Cs0C_oxK.js";import"./useFilters-BBJu_93Q.js";import"./confirm-dialog-B4KJVTQx.js";import"./clock-C2olBfsH.js";import"./menu-B-aaGy7K.js";import"./MailViewChrome-C7sCKY-n.js";import"./NavMenuButton-n2Am7T-q.js";import"./useLabels-GtiakPKP.js";import"./useSemanticSearch-CZUtmciE.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-B6YVIwAN.js";import"./circle-help-BoGPc17x.js";import"./circle-check-CsnMhxDa.js";function I(){return o.jsx(r.Reading,{})}export{I as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-FpwHnbdV.js";import{B as o}from"./BriefPane-CfitNMEu.js";import"./useSearchTokenContext-DH5XswlU.js";import"./kbd-tXno4rYH.js";import"./useMessageBodyContent-BOBb68Px.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-Brjq4vBE.js";import"./search-token-index-C9KNJC5_.js";import"./useQueries-Dx2PHSps.js";import"./attachment-file-ul58bxI4.js";import"./mail-DmVe7n1g.js";import"./avatar-G7g9Uwvc.js";import"./index-CYwsmjFx.js";import"./useSignature-HAuR6_Ul.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DU11pzlc.js";import"./sections-DDQm-Sbc.js";import"./format-BSk7Do06.js";import"./ErrorState-4TfgxGLk.js";import"./download-vw3zYEkx.js";import"./shield-check-Cs0C_oxK.js";import"./useFilters-BBJu_93Q.js";import"./confirm-dialog-B4KJVTQx.js";import"./clock-C2olBfsH.js";import"./menu-B-aaGy7K.js";import"./useRefreshControl-CWjutjgw.js";import"./circle-check-big-SYJDr4tY.js";import"./useLabels-GtiakPKP.js";import"./useSemanticSearch-CZUtmciE.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function D(){return r.jsx(o.Reading,{})}export{D as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-FpwHnbdV.js";import{F as r}from"./FlaggedPane-B7mltHsE.js";import"./useSearchTokenContext-DH5XswlU.js";import"./kbd-tXno4rYH.js";import"./useMessageBodyContent-BOBb68Px.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-Brjq4vBE.js";import"./search-token-index-C9KNJC5_.js";import"./useQueries-Dx2PHSps.js";import"./attachment-file-ul58bxI4.js";import"./mail-DmVe7n1g.js";import"./avatar-G7g9Uwvc.js";import"./index-CYwsmjFx.js";import"./useSignature-HAuR6_Ul.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DU11pzlc.js";import"./sections-DDQm-Sbc.js";import"./format-BSk7Do06.js";import"./ErrorState-4TfgxGLk.js";import"./download-vw3zYEkx.js";import"./shield-check-Cs0C_oxK.js";import"./useFilters-BBJu_93Q.js";import"./confirm-dialog-B4KJVTQx.js";import"./clock-C2olBfsH.js";import"./menu-B-aaGy7K.js";import"./MailViewChrome-C7sCKY-n.js";import"./wizard-selection-B1bng5Jq.js";function y(){return o.jsx(r.Reading,{})}export{y as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-FpwHnbdV.js";import{O as t}from"./OutboxPane-C-_EQFRO.js";import"./useSearchTokenContext-DH5XswlU.js";import"./kbd-tXno4rYH.js";import"./useMessageBodyContent-BOBb68Px.js";import"./search-scope-DTcpOp3S.js";import"./circle-check-big-SYJDr4tY.js";import"./clock-C2olBfsH.js";import"./row-actions-DgziqjAx.js";import"./rotate-ccw-CwLIBdgY.js";import"./NavMenuButton-n2Am7T-q.js";import"./menu-B-aaGy7K.js";import"./format-BSk7Do06.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function P(){return o.jsx(t.Reading,{})}export{P as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{af as o}from"./index-FpwHnbdV.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{af as o}from"./index-FpwHnbdV.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{af as o}from"./index-FpwHnbdV.js";const n=o;export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a,am as De,a as te,o as Ps,X as Ce,an as ks,ao as Vs,ap as ut,a1 as Ds,p as Ge,aq as ee,u as ft,ar as Cs,d as Jt,e as Xt,r as F,as as Fs,f as Se,at as Os,k as Te,h as es,au as Is,av as Rs,aw as Ms,ax as ve,ay as At,L as it,az as Tt,aA as Ls,aB as Re,aC as be,aD as Et,P as Us,aE as Hs,aF as zs,aG as ts,aH as _t,ad as Bs,m as qs,aI as $s,aJ as Ws,B as Pt,b as Gs,aK as kt,aL as Ks,T as Ys}from"./index-FpwHnbdV.js";import{R as Qs}from"./row-actions-DgziqjAx.js";import{S as Zs,A as Js}from"./settings-screen-m0Uy9zlo.js";import{g as Vt,P as Xs,O as er}from"./OnboardingWizard-BtlDSuHk.js";import{s as Be,u as tr,b as sr,R as rr}from"./credential-steps-BNmmF6YJ.js";import{u as ar}from"./useSignature-HAuR6_Ul.js";import{c as ir,a as Dt,d as nr}from"./account-form-helpers-DhckT_PN.js";import{D as or}from"./download-vw3zYEkx.js";import{E as lr}from"./ErrorState-4TfgxGLk.js";import{f as cr}from"./format-BSk7Do06.js";import{a as dr}from"./help-copy-D6t16AP5.js";import"./avatar-G7g9Uwvc.js";import"./menu-B-aaGy7K.js";import"./circle-help-BoGPc17x.js";import"./kbd-tXno4rYH.js";import"./mail-DmVe7n1g.js";import"./card-B1IEp2-a.js";const ur=e=>{const s=new Set(e.map(ks));return Vs.map(t=>t.tag).filter(t=>!s.has(t)).sort((t,i)=>De(t).localeCompare(De(i)))},fr=({value:e,onChange:s,busy:t=!1})=>{const i=ur(e);return a.jsxs("div",{className:"space-y-2","data-testid":"compose-language-setting",children:[a.jsx("ul",{className:"space-y-1",children:e.map((o,d)=>a.jsxs("li",{"data-testid":`compose-language-row-${o}`,className:"flex items-center gap-2 rounded-md border border-line bg-surface-sunken px-3 py-1.5",children:[a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-fg",lang:o,children:De(o)}),d===0?a.jsx("span",{className:"shrink-0 text-2xs uppercase tracking-wider text-fg-subtle",children:"Default"}):a.jsx(te,{variant:"ghost",size:"sm",icon:a.jsx(Ps,{className:"size-3.5"}),disabled:t,"aria-label":`Write new messages in ${De(o)} by default`,onClick:()=>s([o,...e.filter(n=>n!==o)]),children:"Default"}),a.jsx(te,{variant:"ghost",size:"sm",icon:a.jsx(Ce,{className:"size-3.5"}),disabled:t||e.length===1,"aria-label":`Remove ${De(o)}`,onClick:()=>s(e.filter(n=>n!==o))})]},o))}),a.jsxs("select",{"aria-label":"Add a language",value:"",disabled:t||i.length===0,onChange:o=>{o.target.value!==""&&s([...e,o.target.value])},className:"w-full rounded-md border border-line bg-surface-sunken px-3 py-2 text-sm text-fg outline-none transition-colors focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30",children:[a.jsx("option",{value:"",children:"Add a language…"}),i.map(o=>a.jsx("option",{value:o,children:De(o)},o))]}),a.jsx("p",{className:"text-xs text-fg-muted",children:"A message is tagged with the language you write it in, picked from this list. Your browser, not this app, decides which dictionaries it spellchecks against — add the language there too to get its underlines."})]})};function mr({title:e,description:s,action:t}){return a.jsxs("div",{className:"rounded-sm border border-danger/50",children:[a.jsxs("div",{className:"flex items-center gap-2 border-b border-danger/30 bg-danger-soft px-row-inset py-2",children:[a.jsx(ut,{className:"size-4 text-danger"}),a.jsx("h2",{className:"text-sm font-semibold text-danger",children:"Danger zone"})]}),a.jsxs("div",{className:"flex flex-col gap-3 px-row-inset py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-sm font-medium text-fg",children:e}),a.jsx("p",{className:"text-xs text-fg-muted",children:s})]}),a.jsx("div",{className:"shrink-0",children:t})]})]})}function Ct({isOpen:e,onClose:s,title:t,children:i,footer:o}){return Ds({id:"slide-panel",open:e,answers:{back:s}}),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ge("fixed inset-0 z-40 bg-black/30 transition-opacity",e?"opacity-100":"pointer-events-none opacity-0"),onClick:s,"aria-hidden":"true"}),a.jsxs("div",{className:Ge("safe-area-frame fixed top-0 right-0 z-50 flex h-full w-full flex-col border-l border-line bg-canvas shadow-xl sm:w-[400px] sm:max-w-[90vw]","transform transition-transform duration-200 ease-out",e?"translate-x-0":"pointer-events-none translate-x-full"),role:"dialog","aria-modal":"true","aria-hidden":!e,inert:!e,"aria-labelledby":"slide-panel-title",children:[a.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-line px-4",children:[a.jsx("h2",{id:"slide-panel-title",className:"font-semibold",children:t}),a.jsx("button",{type:"button",onClick:s,className:"rounded-md p-1.5 transition-colors hover:bg-surface-raised","aria-label":"Close",children:a.jsx(Ce,{className:"size-5"})})]}),a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[a.jsx("div",{className:"flex-1 overflow-auto p-4",children:i}),o&&a.jsx("div",{className:"flex justify-end gap-3 border-t border-line bg-canvas p-4",children:o})]})]})]})}var Ue=e=>e.type==="checkbox",je=e=>e instanceof Date,K=e=>e==null;const mt=e=>typeof e=="object";var H=e=>!K(e)&&!Array.isArray(e)&&mt(e)&&!je(e),pr=e=>H(e)&&e.target?Ue(e.target)?e.target.checked:e.target.value:e,hr=(e,s)=>s.split(".").some((t,i,o)=>!isNaN(Number(t))&&e.has(o.slice(0,i).join("."))),ss=e=>{const s=e.constructor&&e.constructor.prototype;return H(s)&&s.hasOwnProperty("isPrototypeOf")},Qe=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function z(e){if(e instanceof Date)return new Date(e);const s=typeof FileList<"u"&&e instanceof FileList;if(Qe&&(e instanceof Blob||s))return e;const t=Array.isArray(e);if(!t&&!(H(e)&&ss(e)))return e;const i=t?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=z(e[o]));return i}const ke={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ue={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},de={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},rs="root",pt=["__proto__","constructor","prototype"],gr=/^\w*$/;var He=e=>gr.test(e),M=e=>e===void 0;const xr=/[.[\]'"]/;var Ze=e=>e.split(xr).filter(Boolean),y=(e,s,t)=>{if(!s||!H(e))return t;const i=He(s)?[s]:Ze(s);if(i.some(d=>pt.includes(d)))return t;const o=i.reduce((d,n)=>K(d)?void 0:d[n],e);return M(o)||o===e?M(e[s])?t:e[s]:o},pe=e=>typeof e=="boolean",ie=e=>typeof e=="function",C=(e,s,t)=>{let i=-1;const o=He(s)?[s]:Ze(s),d=o.length,n=d-1;for(;++i<d;){const u=o[i];let j=t;if(i!==n){const E=e[u];j=H(E)||Array.isArray(E)?E:isNaN(+o[i+1])?{}:[]}if(pt.includes(u))return;e[u]=j,e=e[u]}};const yr=ee.createContext(null);yr.displayName="HookFormControlContext";var vr=(e,s,t,i=!0)=>{const o={};for(const d in e)Object.defineProperty(o,d,{get:()=>{const n=d;return s._proxyFormState[n]!==ue.all&&(s._proxyFormState[n]=!i||ue.all),e[n]}});return o};const br=Qe?ee.useLayoutEffect:ee.useEffect;var Y=e=>typeof e=="string",jr=(e,s,t,i,o)=>Y(e)?(i&&s.watch.add(e),y(t,e,o)):Array.isArray(e)?e.map(d=>(i&&s.watch.add(d),y(t,d))):(i&&(s.watchAll=!0),t),nt=e=>K(e)||!mt(e);const Ft=(e,s)=>s.length===0&&!Array.isArray(e)&&!ss(e);function he(e,s,t=new WeakMap){if(e===s)return!0;if(nt(e)||nt(s))return Object.is(e,s);if(je(e)&&je(s))return Object.is(e.getTime(),s.getTime());const i=Object.keys(e),o=Object.keys(s);if(i.length!==o.length)return!1;if(Ft(e,i)||Ft(s,o))return Object.is(e,s);if(!i.length&&Array.isArray(e)!==Array.isArray(s))return!1;const d=t.get(e);if(d&&d.has(s))return!0;if(d)d.add(s);else{const n=new WeakSet;n.add(s),t.set(e,n)}for(const n of i){const u=e[n];if(!(n in s))return!1;if(n!=="ref"){const j=s[n];if(je(u)&&je(j)||(H(u)||Array.isArray(u))&&(H(j)||Array.isArray(j))?!he(u,j,t):!Object.is(u,j))return!1}}return!0}var qe=e=>({isOnSubmit:!e||e===ue.onSubmit,isOnBlur:e===ue.onBlur,isOnChange:e===ue.onChange,isOnAll:e===ue.all,isOnTouch:e===ue.onTouched}),st=(e,s,t)=>{if(t)return!1;if(s.watchAll||s.watch.has(e))return!0;for(const i of s.watch)if(e.startsWith(i)&&e.charAt(i.length)===".")return!0;return!1};const Le=(e,s,t,i)=>{for(const o of t||Object.keys(e)){const d=y(e,o);if(d){const{_f:n,...u}=d;if(n){if(n.refs&&n.refs[0]&&s(n.refs[0],o)&&!i)return!0;if(n.ref&&s(n.ref,n.name)&&!i)return!0;if(Le(u,s))break}else if(H(u)&&Le(u,s))break}}};var Ot=(e,s,t)=>{const i=y(e,t),o=Array.isArray(i)?i:[];return C(o,rs,s[t]),C(e,t,o),e},G=e=>H(e)&&!Object.keys(e).length,ht=e=>e.type==="file",Ke=e=>{if(!Qe)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},gt=e=>e.type==="radio",Ye=e=>e instanceof RegExp,xt=(e,s,t,i,o)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[i]:o||!0}}:{};const It={value:!1,isValid:!1},Rt={value:!0,isValid:!0};var as=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!M(e[0].attributes.value)?M(e[0].value)||e[0].value===""?Rt:{value:e[0].value,isValid:!0}:Rt:It}return It};const Mt={isValid:!1,value:null};var is=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,Mt):Mt;function Lt(e,s,t="validate"){if(Y(e)||Array.isArray(e)&&e.every(Y)||pe(e)&&!e)return{type:t,message:Y(e)?e:"",ref:s}}var Ve=e=>H(e)&&!Ye(e)?e:{value:e,message:""},Ut=async(e,s,t,i,o,d)=>{const{ref:n,refs:u,required:j,maxLength:E,minLength:P,min:U,max:R,pattern:O,validate:_,name:f,valueAsNumber:b,mount:re}=e._f,N=y(t,f);if(!re||s.has(f))return{};const $=u?u[0]:n,I=T=>{if(o&&$.reportValidity){const k=pe(T)?"":T||"";u?u.forEach(D=>D.setCustomValidity(k)):$.setCustomValidity(k),$.reportValidity()}},A={},ne=gt(n),ae=Ue(n),ge=ne||ae,oe=(b||ht(n))&&M(n.value)&&M(N)||Ke(n)&&n.value===""||N===""||Array.isArray(N)&&!N.length,Q=xt.bind(null,f,i,A),le=(T,k,D,q=de.maxLength,Z=de.minLength)=>{const S=T?k:D;A[f]={type:T?q:Z,message:S,ref:n,...Q(T?q:Z,S)}};if(d?!Array.isArray(N)||!N.length:j&&(!ge&&(oe||K(N))||pe(N)&&!N||ae&&!as(u).isValid||ne&&!is(u).isValid)){const{value:T,message:k}=Y(j)?{value:!!j,message:j}:Ve(j);if(T&&(A[f]={type:de.required,message:k,ref:$,...Q(de.required,k)},!i))return I(k),A}if(!oe&&(!K(U)||!K(R))){let T,k;const D=Ve(R),q=Ve(U);if(!K(N)&&!isNaN(N)){const Z=n.valueAsNumber||N&&+N;K(D.value)||(T=Z>D.value),K(q.value)||(k=Z<q.value)}else{const Z=n.valueAsDate||new Date(N),S=fe=>new Date(new Date().toDateString()+" "+fe),J=n.type=="time",W=n.type=="week";Y(D.value)&&N&&(T=J?S(N)>S(D.value):W?N>D.value:Z>new Date(D.value)),Y(q.value)&&N&&(k=J?S(N)<S(q.value):W?N<q.value:Z<new Date(q.value))}if((T||k)&&(le(!!T,D.message,q.message,de.max,de.min),!i))return I(A[f].message),A}if((E||P)&&!oe&&(Y(N)||d&&Array.isArray(N))){const T=Ve(E),k=Ve(P),D=!K(T.value)&&N.length>+T.value,q=!K(k.value)&&N.length<+k.value;if((D||q)&&(le(D,T.message,k.message),!i))return I(A[f].message),A}if(O&&!oe&&Y(N)){const{value:T,message:k}=Ve(O);if(Ye(T)&&!N.match(T)&&(A[f]={type:de.pattern,message:k,ref:n,...Q(de.pattern,k)},!i))return I(k),A}if(_){if(ie(_)){const T=await _(N,t),k=Lt(T,$);if(k&&(A[f]={...k,...Q(de.validate,k.message)},!i))return I(k.message),A}else if(H(_)){let T={};for(const k in _){if(!G(T)&&!i)break;const D=Lt(await _[k](N,t),$,k);D&&(T={...D,...Q(k,D.message)},I(D.message),i&&(A[f]=T))}if(!G(T)&&(A[f]={ref:$,...T},!i))return A}}return I(!0),A},We=e=>Array.isArray(e)?e:[e],ns=e=>Array.isArray(e)?e.filter(Boolean):[];function Sr(e,s){const t=s.slice(0,-1).length;let i=0;for(;i<t;){if(K(e)){e=void 0;break}e=e[s[i]],i++}return e}function wr(e){for(const s in e)if(e.hasOwnProperty(s)&&!M(e[s]))return!1;return!0}function B(e,s){if(Y(s)&&Object.prototype.hasOwnProperty.call(e,s))return delete e[s],e;const t=Array.isArray(s)?s:He(s)?[s]:Ze(s);if(t.some(n=>pt.includes(String(n))))return e;const i=t.length===1?e:Sr(e,t),o=t.length-1,d=t[o];return i&&delete i[d],o!==0&&(H(i)&&G(i)||Array.isArray(i)&&wr(i))&&B(e,t.slice(0,-1)),e}const os=e=>{const s={};for(const t of Object.keys(e))if(mt(e[t])&&e[t]!==null&&!je(e[t])){const i=os(e[t]);for(const o of Object.keys(i))s[`${t}.${o}`]=i[o]}else s[t]=e[t];return s},Nr=ee.createContext(null);Nr.displayName="HookFormContext";var Ht=()=>{let e=[];return{get observers(){return e},next:o=>{for(const d of e)d.next&&d.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(d=>d!==o)}}),unsubscribe:()=>{e=[]}}};function ls(e,s){const t={};for(const i in e)if(e.hasOwnProperty(i)){const o=e[i],d=s[i];if(o&&H(o)&&d){const n=ls(o,d);H(n)&&(t[i]=n)}else e[i]&&(t[i]=d)}return t}var cs=e=>e.type==="select-multiple",Ar=e=>gt(e)||Ue(e),rt=e=>Ke(e)&&e.isConnected,Tr=e=>{for(const s in e)if(ie(e[s]))return!0;return!1};function ds(e){return Array.isArray(e)||H(e)&&!Tr(e)}function us(e){return!!(e&&"_f"in e)}function fs(e){return Array.isArray(e)?!e.some(s=>!M(s)):!Object.keys(e).length}function ot(e,s){Array.isArray(e)?e[s]=void 0:delete e[s]}function lt(e,s={},t){for(const i in e){const o=e[i],d=t&&t[i];ds(o)&&(!Array.isArray(o)||!us(d))?(s[i]=Array.isArray(o)?[]:{},lt(o,s[i],d),fs(s[i])&&ot(s,i)):M(o)||(s[i]=!0)}return s}function Ae(e,s,t,i){t||(t=lt(s,{},i));for(const o in e){const d=e[o],n=i&&i[o];ds(d)&&(!Array.isArray(d)||!us(n))?(M(s)||nt(t[o])?t[o]=lt(d,Array.isArray(d)?[]:{},n):Ae(d,K(s)?{}:s[o],t[o],n),fs(t[o])&&ot(t,o)):he(d,s[o])?ot(t,o):t[o]=!0}return t}var ms=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:i})=>M(e)?e:s?e===""?NaN:e&&+e:t&&Y(e)?new Date(e):i?i(e):e;function zt(e){const s=e.ref;return ht(s)?s.files:gt(s)?is(e.refs).value:cs(s)?[...s.selectedOptions].map(({value:t})=>t):Ue(s)?as(e.refs).value:ms(M(s.value)?e.ref.value:s.value,e)}var Er=(e,s,t,i)=>{const o={};for(const d of e){const n=y(s,d);n&&C(o,d,n._f)}return{criteriaMode:t,names:[...e],fields:o,shouldUseNativeValidation:i}},Me=e=>M(e)?e:Ye(e)?e.source:H(e)?Ye(e.value)?e.value.source:e.value:e;const Bt="AsyncFunction";var _r=e=>{if(!e||!e.validate)return!1;if(ie(e.validate))return e.validate.constructor.name===Bt;if(H(e.validate)){for(const s in e.validate)if(e.validate[s].constructor.name===Bt)return!0}return!1},Pr=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function qt(e,s,t){const i=y(e,t);if(i||He(t))return{error:i,name:t};const o=t.split(".");for(;o.length;){const d=o.join("."),n=y(s,d),u=y(e,d);if(n&&!Array.isArray(n)&&t!==d)return{name:t};if(u&&u.type)return{name:d,error:u};if(u&&u.root&&u.root.type)return{name:`${d}.root`,error:u.root};o.pop()}return{name:t}}var kr=(e,s,t,i)=>{t(e);const{name:o,...d}=e,n=Object.keys(d);return!n.length||i&&n.length>=Object.keys(s).length||n.find(u=>s[u]===(!i||ue.all))},Vr=(e,s,t)=>!e||!s||e===s||We(e).some(i=>i&&(t?i===s||i.startsWith(s+"."):i.startsWith(s)||s.startsWith(i))),Dr=(e,s,t,i,o)=>o.isOnAll?!1:!t&&o.isOnTouch?!(s||e):(t?i.isOnBlur:o.isOnBlur)?!e:(t?i.isOnChange:o.isOnChange)?e:!0,Cr=(e,s)=>!ns(y(e,s)).length&&B(e,s);const Fr={mode:ue.onSubmit,reValidateMode:ue.onChange,shouldFocusError:!0},at="form",ps={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Or(e={}){let s={...Fr,...e},t={...z(ps),isLoading:ie(s.defaultValues),errors:s.errors||{},disabled:s.disabled||!1},i={},o=H(s.defaultValues)||H(s.values)?z(s.defaultValues||s.values)||{}:{},d=s.shouldUnregister?{}:z(o),n={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const j={},E={};let P=0,U=qe(s.mode),R=qe(s.reValidateMode);const O={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},_={...O};let f={..._};const b={array:Ht(),state:Ht()};let re=0;const N=s.criteriaMode===ue.all,$=(r,l)=>c=>{clearTimeout(E[r]),E[r]=setTimeout(l,c)},I=async r=>{if(!n.keepIsValid&&!s.disabled&&(_.isValid||f.isValid||r)){const l=++re;let c;s.resolver?(c=G((await D()).errors),l===re&&A()):c=await S({fields:i,onlyCheckValid:!0,eventType:ke.VALID}),l===re&&c!==t.isValid&&b.state.next({isValid:c})}},A=(r,l)=>{!s.disabled&&(_.isValidating||_.validatingFields||f.isValidating||f.validatingFields)&&((r||Array.from(u.mount)).forEach(c=>{c&&(l?C(t.validatingFields,c,l):B(t.validatingFields,c))}),b.state.next({validatingFields:t.validatingFields,isValidating:!G(t.validatingFields)}))},ne=()=>{t.dirtyFields=Ae(o,d,void 0,i)},ae=(r,l=[],c,m,p=!0,x=!0)=>{if(m&&c&&!s.disabled){if(n.action=!0,x&&Array.isArray(y(i,r))){const g=c(y(i,r),m.argA,m.argB);p&&C(i,r,g)}if(x&&Array.isArray(y(t.errors,r))){const g=c(y(t.errors,r),m.argA,m.argB);p&&C(t.errors,r,g),Cr(t.errors,r)}if((_.touchedFields||f.touchedFields)&&x&&Array.isArray(y(t.touchedFields,r))){const g=c(y(t.touchedFields,r),m.argA,m.argB);p&&C(t.touchedFields,r,g)}(_.dirtyFields||f.dirtyFields)&&ne(),b.state.next({name:r,isDirty:W(r,l),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else C(d,r,l)},ge=(r,l)=>{C(t.errors,r,l),t.errors={...t.errors},b.state.next({errors:t.errors})},oe=r=>{t.errors=r,b.state.next({errors:t.errors,isValid:!1})},Q=r=>{const l=He(r)?[r]:Ze(r);let c=d,m=o;for(let p=0;p<l.length-1;p++){const x=l[p];if(c=K(c)?c:c[x],m=K(m)?m:m[x],c===null&&m!==null)return!0}return!1},le=(r,l,c,m)=>{const p=y(i,r);if(p){if(Q(r))return;const x=M(y(d,r)),g=y(d,r,M(c)?y(o,r):c);M(g)||m&&m.defaultChecked||l?C(d,r,l?g:zt(p._f)):we(r,g),n.mount&&!n.action&&(I(),x&&t.isDirty&&(_.isDirty||f.isDirty)&&(W()||(t.isDirty=!1,b.state.next({...t}))),e.shouldUnregister&&x&&!M(y(d,r))&&st(r,u)&&(n.watch=!0))}},T=(r,l,c,m,p)=>{let x=!1,g=!1;const v={name:r};if(!s.disabled||m===!0){if(!c||m){const w=he(y(o,r),l);(_.isDirty||f.isDirty)&&(g=t.isDirty,t.isDirty=v.isDirty=!w||W(),x=g!==v.isDirty),g=!!y(t.dirtyFields,r),w!==t.isDirty?t.dirtyFields=Ae(o,d,void 0,i):w?B(t.dirtyFields,r):C(t.dirtyFields,r,!0),v.dirtyFields=t.dirtyFields,x=x||(_.dirtyFields||f.dirtyFields)&&g!==!w}if(c){const w=y(t.touchedFields,r);w||(C(t.touchedFields,r,c),v.touchedFields=t.touchedFields,x=x||(_.touchedFields||f.touchedFields)&&w!==c)}x&&p&&b.state.next(v)}return x?v:{}},k=(r,l,c,m)=>{const p=y(t.errors,r),x=(_.isValid||f.isValid)&&pe(l)&&t.isValid!==l;if(s.delayError&&c?(j[r]=$(r,()=>ge(r,c)),j[r](s.delayError)):(clearTimeout(E[r]),delete j[r],c?C(t.errors,r,c):B(t.errors,r),t.errors={...t.errors}),(c?!he(p,c):p)||!G(m)||x){const g={...m,...x&&pe(l)?{isValid:l}:{},errors:t.errors,name:r};t={...t,...g},b.state.next(g)}},D=async r=>(A(r,!0),await s.resolver(d,s.context,Er(r||u.mount,i,s.criteriaMode,s.shouldUseNativeValidation))),q=async r=>{const{errors:l}=await D(r);if(A(r),r){for(const c of r){const m=y(l,c);m?u.array.has(c)&&H(m)&&!Object.keys(m).some(p=>!Number.isNaN(Number(p)))?Ot(t.errors,{[c]:m},c):C(t.errors,c,m):B(t.errors,c)}t.errors={...t.errors}}else t.errors=l;return l},Z=async({name:r,eventType:l})=>{if(e.validate){const c=await e.validate({formValues:d,formState:t,name:r,eventType:l});if(H(c))for(const m in c){const p=c[m];p&&ze(`${at}.${m}`,{message:Y(p.message)?p.message:"",type:p.type||de.validate})}else Y(c)||!c?ze(at,{message:c||"",type:de.validate}):Pe(at);return c}return!0},S=async({fields:r,onlyCheckValid:l,name:c,eventType:m,context:p={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(p.runRootValidation=!0,!await Z({name:c,eventType:m})&&(p.valid=!1,l)))return p.valid;for(const x in r){const g=r[x];if(g){const{_f:v,...w}=g;if(v){const L=u.array.has(v.name),X=g._f&&_r(g._f),xe=_.validatingFields||_.isValidating||f.validatingFields||f.isValidating;X&&xe&&A([v.name],!0);const ye=await Ut(g,u.disabled,d,N,s.shouldUseNativeValidation&&!l,L);if(X&&xe&&A([v.name]),ye[v.name]&&(p.valid=!1,l)||(!l&&(y(ye,v.name)?L?Ot(t.errors,ye,v.name):C(t.errors,v.name,ye[v.name]):B(t.errors,v.name)),e.shouldUseNativeValidation&&ye[v.name]))break}!G(w)&&await S({context:p,onlyCheckValid:l,fields:w,name:x,eventType:m})}}return p.valid},J=()=>{for(const r of u.unMount){const l=y(i,r);l&&(l._f.refs?l._f.refs.every(c=>!rt(c)):!rt(l._f.ref))&&Xe(r)}u.unMount=new Set},W=(r,l)=>(r&&l&&C(d,r,l),!he(n.mount?d:o,o)),fe=(r,l,c)=>jr(r,u,{...n.mount?d:M(l)?o:Y(r)?{[r]:l}:l},c,l),Ee=r=>ns(y(n.mount?d:o,r,s.shouldUnregister?y(o,r,[]):[])),we=(r,l,c={},m=!1,p=!1)=>{const x=y(i,r);let g=l;if(x){const v=x._f;v&&(!v.disabled&&C(d,r,ms(l,v)),g=Ke(v.ref)&&K(l)?"":l,cs(v.ref)?[...v.ref.options].forEach(w=>w.selected=g.includes(w.value)):v.refs?Ue(v.ref)?v.refs.forEach(w=>{(!w.defaultChecked||!w.disabled)&&(Array.isArray(g)?w.checked=!!g.find(L=>L===w.value):w.checked=g===w.value||!!g)}):v.refs.forEach(w=>w.checked=w.value===g):ht(v.ref)?v.ref.value="":(v.ref.value=g,!v.ref.type&&!p&&b.state.next({name:r,values:m?d:z(d)})))}(c.shouldDirty||c.shouldTouch)&&T(r,g,c.shouldTouch,c.shouldDirty,!p),c.shouldValidate&&me(r,{delayError:c.delayError})},_e=(r,l,c,m=!1,p=!1)=>{for(const x in l){if(!l.hasOwnProperty(x))return;const g=l[x],v=r+"."+x,w=y(i,v);(u.array.has(r)||H(g)||w&&!w._f)&&!je(g)?_e(v,g,c,m,p):we(v,g,c,m,p)}},Je=(r,l,c,m,p=!1)=>{const x=y(i,r),g=u.array.has(r),v=m?l:z(l),w=y(d,r),L=he(w,v);if(L||C(d,r,v),g)b.array.next({name:r,values:m?d:z(d)}),(_.isDirty||_.dirtyFields||f.isDirty||f.dirtyFields)&&c.shouldDirty&&(ne(),p||b.state.next({name:r,dirtyFields:t.dirtyFields,isDirty:W(r,v)}));else{const X=Array.isArray(v)&&!v.length||G(v);!x||x._f||K(v)||X?we(r,v,c,m,p):_e(r,v,c,m,p)}if(!L&&!p){const X=st(r,u),xe=m?d:z(d);b.state.next({...X&&t,name:n.mount||X?r:void 0,values:xe})}},h=(r,l,c={})=>Je(r,l,c,!1),V=(r,l={})=>{const c=ie(r)?r(d):r;if(!he(d,c)){d={...d,...c};const m=os(c);for(const p of u.mount)p in m&&Je(p,m[p],l,!0,!0);b.state.next({...t,name:void 0,type:void 0,...P?{values:d}:{}}),l.shouldValidate&&I()}},ce=async r=>{n.mount=!0;const l=r.target;let c=l.name,m=!0;const p=y(i,c),x=g=>{m=Number.isNaN(g)||je(g)&&isNaN(g.getTime())||he(g,y(d,c,g))};if(p){let g,v;const w=l.type?zt(p._f):pr(r),L=r.type===ke.BLUR||r.type===ke.FOCUS_OUT,X=!Pr(p._f)&&!e.validate&&!s.resolver&&!y(t.errors,c)&&!p._f.deps,xe=X||Dr(L,y(t.touchedFields,c),t.isSubmitted,R,U),ye=st(c,u,L);if(C(d,c,w),L){if(!l||!l.readOnly){p._f.onBlur&&p._f.onBlur(r);const Ie=j[c];Ie&&Ie(0)}}else p._f.onChange&&p._f.onChange(r);const Oe=T(c,w,L),Es=!G(Oe)||ye;if(!L&&b.state.next({name:c,type:r.type,...P?{values:z(d)}:{}}),xe)return(!X||!t.isValid)&&(_.isValid||f.isValid)&&(s.mode==="onBlur"?L&&I():L||I()),Es&&b.state.next({name:c,...ye?{}:Oe});if(!s.resolver&&e.validate&&await Z({name:c,eventType:r.type}),!L&&ye&&b.state.next({...t}),s.resolver){const{errors:Ie}=await D([c]);if(A([c]),x(w),!m){!G(Oe)&&b.state.next(Oe);return}const _s=qt(t.errors,i,c),Nt=qt(Ie,i,_s.name||c);g=Nt.error,c=Nt.name,v=G(Ie)}else A([c],!0),g=(await Ut(p,u.disabled,d,N,s.shouldUseNativeValidation))[c],A([c]),x(w),m&&(g?v=!1:(_.isValid||f.isValid)&&(v=await S({fields:i,onlyCheckValid:!0,name:c,eventType:r.type})));m&&(p._f.deps&&(!Array.isArray(p._f.deps)||p._f.deps.length>0)&&me(p._f.deps),k(c,v,g,Oe))}},se=(r,l)=>{if(y(t.errors,l)&&r.focus)return r.focus(),1},me=async(r,l={})=>{let c,m;const p=We(r);if(s.resolver){const x=await q(M(r)?r:p);c=G(x),m=r?!p.some(g=>y(x,g)):c}else r?(m=(await Promise.all(p.map(async x=>{const g=y(i,x);return await S({fields:g&&g._f?{[x]:g}:g,eventType:ke.TRIGGER})}))).every(Boolean),!(!m&&!t.isValid)&&I()):m=c=await S({fields:i,name:r,eventType:ke.TRIGGER});if(l.delayError&&s.delayError&&Y(r)){const x=y(t.errors,r);x?(B(t.errors,r),j[r]=$(r,()=>ge(r,x)),j[r](s.delayError)):(clearTimeout(E[r]),delete j[r])}return b.state.next({...!Y(r)||(_.isValid||f.isValid)&&c!==t.isValid?{}:{name:r},...s.resolver||!r?{isValid:c}:{},errors:t.errors}),l.shouldFocus&&!m&&Le(i,se,r?p:u.mount),m},Ne=(r,l)=>{let c={...n.mount?d:o};return l&&(c=ls(l.dirtyFields?t.dirtyFields:t.touchedFields,c)),M(r)?c:Y(r)?y(c,r):r.map(m=>y(c,m))},Fe=(r,l)=>({invalid:!!y((l||t).errors,r),isDirty:!!y((l||t).dirtyFields,r),error:y((l||t).errors,r),isValidating:!!y(t.validatingFields,r),isTouched:!!y((l||t).touchedFields,r)}),Pe=r=>{const l=r?We(r):void 0;l?.forEach(c=>B(t.errors,c)),l?l.forEach(c=>{b.state.next({name:c,errors:t.errors})}):b.state.next({errors:{}})},ze=(r,l,c)=>{const m=(y(i,r,{_f:{}})._f||{}).ref,p=y(t.errors,r)||{},{ref:x,message:g,type:v,...w}=p;C(t.errors,r,{...w,...l,ref:m}),b.state.next({name:r,errors:t.errors,isValid:!1}),c&&c.shouldFocus&&m&&m.focus&&m.focus()},js=(r,l)=>{if(ie(r)){P++;const{unsubscribe:c}=b.state.subscribe({next:p=>"values"in p&&r(p.values||fe(void 0,l),p)});let m=!1;return{unsubscribe:()=>{m||(m=!0,P--,c())}}}return fe(r,l,!0)},yt=r=>{var l;const c=!!(!((l=r.formState)===null||l===void 0)&&l.values);c&&P++;const{unsubscribe:m}=b.state.subscribe({next:x=>{if(Vr(r.name,x.name,r.exact)&&kr(x,r.formState||_,Ts,r.reRenderRoot)){const g={...d};r.callback({values:g,...t,...x,defaultValues:o})}}});if(!c)return m;let p=!1;return()=>{p||(p=!0,P--,m())}},Ss=r=>(n.mount=!0,f={...f,...r.formState},yt({...r,formState:{...O,...r.formState}})),Xe=(r,l={})=>{for(const c of r?We(r):u.mount)u.mount.delete(c),u.array.delete(c),l.keepValue||(B(i,c),B(d,c)),!l.keepError&&B(t.errors,c),!l.keepDirty&&B(t.dirtyFields,c),!l.keepTouched&&B(t.touchedFields,c),!l.keepIsValidating&&B(t.validatingFields,c),!s.shouldUnregister&&!l.keepDefaultValue&&B(o,c);b.state.next({values:z(d)}),b.state.next({...t,...l.keepDirty?{isDirty:W()}:{}}),!l.keepIsValid&&I()},vt=({disabled:r,name:l})=>{if(pe(r)&&n.mount||r||u.disabled.has(l)){const p=u.disabled.has(l)!==!!r;r?u.disabled.add(l):u.disabled.delete(l),p&&n.mount&&!n.action&&I()}},et=(r,l={})=>{let c=y(i,r);const m=pe(l.disabled)||pe(s.disabled),p=!u.registerName.has(r)&&c&&c._f&&!c._f.mount;return C(i,r,{...c||{},_f:{...c&&c._f?c._f:{ref:{name:r}},name:r,mount:!0,...l}}),u.mount.add(r),c&&!p?vt({disabled:pe(l.disabled)?l.disabled:s.disabled,name:r}):le(r,!0,l.value),{...m?{disabled:l.disabled||s.disabled}:{},...s.progressive?{required:!!l.required,min:Me(l.min),max:Me(l.max),minLength:Me(l.minLength),maxLength:Me(l.maxLength),pattern:Me(l.pattern)}:{},name:r,onChange:ce,onBlur:ce,ref:x=>{if(x){u.registerName.add(r),et(r,l),u.registerName.delete(r),c=y(i,r);const g=M(x.value)&&x.querySelectorAll&&x.querySelectorAll("input,select,textarea")[0]||x,v=Ar(g),w=c._f.refs||[];if(v?w.find(L=>L===g):g===c._f.ref)return;C(i,r,{_f:{...c._f,...v?{refs:[...w.filter(rt),g,...Array.isArray(y(o,r))?[{}]:[]],ref:{type:g.type,name:r}}:{ref:g}}}),le(r,!1,void 0,g)}else c=y(i,r,{}),c._f&&(c._f.mount=!1),(s.shouldUnregister||l.shouldUnregister)&&!(hr(u.array,r)&&n.action)&&u.unMount.add(r)}}},tt=()=>s.shouldFocusError&&!s.shouldUseNativeValidation&&Le(i,se,u.mount),ws=r=>{pe(r)&&(b.state.next({disabled:r}),Le(i,(l,c)=>{const m=y(i,c);m&&(l.disabled=m._f.disabled||r,Array.isArray(m._f.refs)&&m._f.refs.forEach(p=>{p.disabled=m._f.disabled||r}))},0,!1))},bt=(r,l)=>async c=>{let m;c&&(c.preventDefault&&c.preventDefault(),c.persist&&c.persist());let p=z(d);if(b.state.next({isSubmitting:!0}),s.resolver){const{errors:x,values:g}=await D();A(),t.errors=x,p=z(g)}else await S({fields:i,eventType:ke.SUBMIT});if(u.disabled.size)for(const x of u.disabled)B(p,x);if(B(t.errors,rs),G(t.errors)){b.state.next({errors:{}});try{await r(p,c)}catch(x){m=x}}else l&&await l({...t.errors},c),tt(),setTimeout(tt);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:G(t.errors)&&!m,submitCount:t.submitCount+1,errors:t.errors}),m)throw m},Ns=(r,l={})=>{y(i,r)&&(M(l.defaultValue)?h(r,z(y(o,r))):(h(r,l.defaultValue),C(o,r,z(l.defaultValue))),l.keepTouched||B(t.touchedFields,r),l.keepDirty||(B(t.dirtyFields,r),t.isDirty=l.defaultValue?W(r,z(y(o,r))):W()),l.keepError||(B(t.errors,r),_.isValid&&I()),b.state.next({...t}))},jt=(r,l={})=>{const c=r?z(r):o,m=z(c),p=G(r),x=m,g=i;if(l.keepDefaultValues||(o=c),!l.keepValues){if(l.keepDirtyValues){const v=new Set([...u.mount,...Object.keys(Ae(o,d,void 0,g))]);for(const w of Array.from(v)){const L=y(t.dirtyFields,w),X=y(d,w),xe=y(x,w);L&&!M(X)?C(x,w,X):!L&&!M(xe)&&h(w,xe)}}else{if(Qe&&M(r))for(const v of u.mount){const w=y(i,v);if(w&&w._f){const L=Array.isArray(w._f.refs)?w._f.refs[0]:w._f.ref;if(Ke(L)){const X=L.closest("form");if(X){X.reset();break}}}}if(l.keepFieldsRef)for(const v of u.mount)h(v,y(x,v));else i={}}if(s.shouldUnregister){if(d=l.keepDefaultValues?z(o):{},l.keepFieldsRef)for(const v of u.mount)C(d,v,y(x,v))}else d=z(x);b.array.next({values:{...x}}),b.state.next({name:void 0,type:void 0,values:{...x}})}u={mount:l.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},n.mount=!_.isValid||!!l.keepIsValid||!!l.keepDirtyValues||!s.shouldUnregister&&!G(x),n.watch=!!s.shouldUnregister,n.keepIsValid=!!l.keepIsValid,n.action=!1,l.keepErrors||(t.errors={}),b.state.next({submitCount:l.keepSubmitCount?t.submitCount:0,isDirty:p?!1:l.keepDirty?t.isDirty:l.keepValues?W():!!(l.keepDefaultValues&&!he(r,o)),isSubmitted:l.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:p?{}:l.keepDirtyValues?l.keepDefaultValues&&d?Ae(o,d,void 0,g):t.dirtyFields:l.keepDefaultValues&&r?Ae(o,r,void 0,g):l.keepDirty?t.dirtyFields:{},touchedFields:l.keepTouched?t.touchedFields:{},errors:l.keepErrors?t.errors:{},isSubmitSuccessful:l.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},St=(r,l)=>jt(ie(r)?r(d):r,{...s.resetOptions,...l}),As=(r,l={})=>{const c=y(i,r),m=c&&c._f;if(m){const p=m.refs?m.refs[0]:m.ref;p.focus&&setTimeout(()=>{p.focus(),l.shouldSelect&&ie(p.select)&&p.select()})}},Ts=r=>{const{name:l,type:c,values:m,...p}=r;t={...t,...p}},wt={control:{register:et,unregister:Xe,getFieldState:Fe,handleSubmit:bt,setError:ze,_subscribe:yt,_runSchema:D,_updateIsValidating:A,_focusError:tt,_getWatch:fe,_getDirty:W,_setValid:I,_setFieldArray:ae,_setDisabledField:vt,_setErrors:oe,_getFieldArray:Ee,_reset:jt,_resetDefaultValues:()=>ie(s.defaultValues)&&s.defaultValues().then(r=>{St(r,s.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:J,_disableForm:ws,_subjects:b,_proxyFormState:_,get _fields(){return i},get _formValues(){return d},get _state(){return n},set _state(r){n=r},get _defaultValues(){return o},get _names(){return u},set _names(r){u=r},get _formState(){return t},get _options(){return s},set _options(r){s={...s,...r},U=qe(s.mode),R=qe(s.reValidateMode)}},subscribe:Ss,trigger:me,register:et,handleSubmit:bt,watch:js,setValue:h,setValues:V,getValues:Ne,reset:St,resetField:Ns,resetDefaultValues:(r,l={})=>{if(o=z(r),!l.keepDirty){const c=Ae(o,d,void 0,i);t.dirtyFields=c,t.isDirty=!G(c)}l.keepIsValid||I(),b.state.next({...t,defaultValues:o})},clearErrors:Pe,unregister:Xe,setError:ze,setFocus:As,getFieldState:Fe};return{...wt,formControl:wt}}function Ir(e={}){const s=ee.useRef(void 0),t=ee.useRef(void 0),i=ee.useRef(e.formControl),[o,d]=ee.useState(()=>({...z(ps),isLoading:ie(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ie(e.defaultValues)?void 0:e.defaultValues}));if(!s.current||e.formControl&&i.current!==e.formControl)if(i.current=e.formControl,e.formControl)s.current={...e.formControl,formState:o},e.defaultValues&&!ie(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:u,...j}=Or(e);s.current={...j,formState:o}}const n=s.current.control;return n._options=e,br(()=>{const u=n._subscribe({formState:n._proxyFormState,callback:()=>d({...n._formState,defaultValues:n._defaultValues}),reRenderRoot:!0});return d(j=>({...j,isReady:!0})),n._formState.isReady=!0,u},[n]),ee.useEffect(()=>n._disableForm(e.disabled),[n,e.disabled]),ee.useEffect(()=>{e.mode&&(n._options.mode=e.mode),e.reValidateMode&&(n._options.reValidateMode=e.reValidateMode)},[n,e.mode,e.reValidateMode]),ee.useEffect(()=>{e.errors&&(n._setErrors(e.errors),n._focusError())},[n,e.errors]),ee.useEffect(()=>{e.shouldUnregister&&n._subjects.state.next({values:n._getWatch()})},[n,e.shouldUnregister]),ee.useEffect(()=>{if(n._proxyFormState.isDirty){const u=n._getDirty();u!==o.isDirty&&n._subjects.state.next({isDirty:u})}},[n,o.isDirty]),ee.useEffect(()=>{var u;e.values&&!he(e.values,t.current)?(n._reset(e.values,{keepFieldsRef:!0,...n._options.resetOptions}),!((u=n._options.resetOptions)===null||u===void 0)&&u.keepIsValid||n._setValid(),t.current=e.values,d(j=>({...j}))):n._resetDefaultValues()},[n,e.values]),ee.useEffect(()=>{n._state.mount||(n._setValid(),n._state.mount=!0),n._state.watch&&(n._state.watch=!1,n._subjects.state.next({...n._formState})),n._removeUnmounted()}),s.current.formState=ee.useMemo(()=>vr(o,n),[n,o]),s.current}const $t=(e,s,t)=>{if(e&&"reportValidity"in e){const i=y(t,s);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},ct=(e,s)=>{for(const t in s.fields){const i=s.fields[t];i&&i.ref&&"reportValidity"in i.ref?$t(i.ref,t,e):i&&i.refs&&i.refs.forEach(o=>$t(o,t,e))}},Wt=(e,s)=>{s.shouldUseNativeValidation&&ct(e,s);const t={};for(const i in e){const o=y(s.fields,i),d=Object.assign(e[i]||{},{ref:o&&o.ref});if(Rr(s.names||Object.keys(e),i)){const n=Object.assign({},y(t,i));C(n,"root",d),C(t,i,n)}else C(t,i,d)}return t},Rr=(e,s)=>{const t=Gt(s).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(i=>Gt(i).match(`^${t}\\.\\d+`))};function Gt(e){return e.replace(/[\[\]]/g,"")}function hs(e,s,t){function i(u,j){var E;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(E=u._zod).traits??(E.traits=new Set),u._zod.traits.add(e),s(u,j);for(const P in n.prototype)P in u||Object.defineProperty(u,P,{value:n.prototype[P].bind(u)});u._zod.constr=n,u._zod.def=j}const o=t?.Parent??Object;class d extends o{}Object.defineProperty(d,"name",{value:e});function n(u){var j;const E=t?.Parent?new d:this;i(E,u),(j=E._zod).deferred??(j.deferred=[]);for(const P of E._zod.deferred)P();return E}return Object.defineProperty(n,"init",{value:i}),Object.defineProperty(n,Symbol.hasInstance,{value:u=>t?.Parent&&u instanceof t.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(n,"name",{value:e}),n}class Mr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Lr={};function gs(e){return Lr}function Ur(e,s){return typeof s=="bigint"?s.toString():s}const xs=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function $e(e){return typeof e=="string"?e:e?.message}function ys(e,s,t){const i={...e,path:e.path??[]};if(!e.message){const o=$e(e.inst?._zod.def?.error?.(e))??$e(s?.error?.(e))??$e(t.customError?.(e))??$e(t.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,s?.reportInput||delete i.input,i}const vs=(e,s)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:s,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(s,Ur,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Hr=hs("$ZodError",vs),bs=hs("$ZodError",vs,{Parent:Error}),zr=e=>(s,t,i,o)=>{const d=i?Object.assign(i,{async:!1}):{async:!1},n=s._zod.run({value:t,issues:[]},d);if(n instanceof Promise)throw new Mr;if(n.issues.length){const u=new(o?.Err??e)(n.issues.map(j=>ys(j,d,gs())));throw xs(u,o?.callee),u}return n.value},Br=zr(bs),qr=e=>async(s,t,i,o)=>{const d=i?Object.assign(i,{async:!0}):{async:!0};let n=s._zod.run({value:t,issues:[]},d);if(n instanceof Promise&&(n=await n),n.issues.length){const u=new(o?.Err??e)(n.issues.map(j=>ys(j,d,gs())));throw xs(u,o?.callee),u}return n.value},$r=qr(bs);function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},dt.apply(null,arguments)}function Kt(e,s){try{var t=e()}catch(i){return s(i)}return t&&t.then?t.then(void 0,s):t}function Wr(e,s){for(var t={};e.length;){var i=e[0],o=i.code,d=i.message,n=i.path.join(".");if(!t[n])if("unionErrors"in i){var u=i.unionErrors[0].errors[0];t[n]={message:u.message,type:u.code}}else t[n]={message:d,type:o};if("unionErrors"in i&&i.unionErrors.forEach(function(P){return P.errors.forEach(function(U){return e.push(U)})}),s){var j=t[n].types,E=j&&j[i.code];t[n]=xt(n,s,t,o,E?[].concat(E,i.message):i.message)}e.shift()}return t}function Gr(e,s){for(var t={},i=function(){var o=e[0],d=o.code,n=o.message,u=o.path.join(".");if(!t[u])if(o.code==="invalid_union"&&o.errors.length>0){var j=o.errors[0][0];t[u]={message:j.message,type:j.code}}else t[u]={message:n,type:d};if(o.code==="invalid_union"&&o.errors.forEach(function(U){return U.forEach(function(R){return e.push(dt({},R,{path:[].concat(o.path,R.path)}))})}),s){var E=t[u].types,P=E&&E[o.code];t[u]=xt(u,s,t,d,P?[].concat(P,o.message):o.message)}e.shift()};e.length;)i();return t}function Kr(e,s,t){if(t===void 0&&(t={}),(function(i){return"_def"in i&&typeof i._def=="object"&&"typeName"in i._def})(e))return function(i,o,d){try{return Promise.resolve(Kt(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](i,s)).then(function(n){return d.shouldUseNativeValidation&&ct({},d),{errors:{},values:t.raw?Object.assign({},i):n}})},function(n){if((function(u){return Array.isArray(u?.issues)})(n))return{values:{},errors:Wt(Wr(n.errors,!d.shouldUseNativeValidation&&d.criteriaMode==="all"),d)};throw n}))}catch(n){return Promise.reject(n)}};if((function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,o,d){try{return Promise.resolve(Kt(function(){return Promise.resolve((t.mode==="sync"?Br:$r)(e,i,s)).then(function(n){return d.shouldUseNativeValidation&&ct({},d),{errors:{},values:t.raw?Object.assign({},i):n}})},function(n){if((function(u){return u instanceof Hr})(n))return{values:{},errors:Wt(Gr(n.issues,!d.shouldUseNativeValidation&&d.criteriaMode==="all"),d)};throw n}))}catch(n){return Promise.reject(n)}};throw new Error("Invalid input: not a Zod schema")}const Yr=e=>{const s=ft(),{pushError:t}=Cs(),{data:i}=Jt({...Xt(),staleTime:1/0}),o=i?.accounts.find(j=>j.accountId===e)?.composeLanguages,d=F.useMemo(()=>o&&o.length>0?[...o]:Fs(navigator.languages),[o]),n=Se({...es(),onSuccess:()=>{s.invalidateQueries({queryKey:Te()})},onError:j=>{t(Os("Couldn't save languages","The writing languages weren't saved.",j))}}),u=F.useCallback(j=>{e&&n.mutate({path:{accountId:e},body:{composeLanguages:j}})},[e,n]);return{languages:d,setLanguages:u,isSaving:n.isPending}},Qr=e=>e.authType==="oauthMicrosoft",Zr="••••••••••",Jr=e=>{const s=e.smtpUsername?.trim();return s?s!==e.username:!1},Xr=Ls({email:be().email().min(1,"Email is required"),displayName:be().optional(),username:be().optional(),password:be().optional(),imapHost:be().min(1,"IMAP host is required"),imapPort:Et.number().int().min(1).max(65535),imapTls:Re(),imapStartTls:Re(),smtpHost:be().optional(),smtpPort:Et.number().int().min(1).max(65535).optional(),smtpTls:Re().optional(),smtpStartTls:Re().optional(),smtpUsername:be().optional(),smtpPassword:be().optional(),useDifferentSmtpCreds:Re().optional()}),ea=({isOpen:e,onClose:s,account:t,focusSmtp:i})=>{const o=ft(),d=!!t,[n,u]=F.useState(!1),[j,E]=F.useState(""),[P,U]=F.useState(!1),R=Vt(j),O=!!R&&!P,_=F.useRef(null),f=Ir({resolver:Kr(Xr),defaultValues:{email:"",displayName:"",username:"",password:"",imapHost:"",imapPort:993,imapTls:!0,imapStartTls:!1,smtpHost:"",smtpPort:587,smtpTls:!1,smtpStartTls:!0,useDifferentSmtpCreds:!1}});F.useEffect(()=>{if(t){const h=Jr(t);f.reset({email:t.email,displayName:t.displayName||"",username:t.username||"",password:Zr,imapHost:t.imapHost,imapPort:t.imapPort,imapTls:t.imapTls,imapStartTls:t.imapStartTls,smtpHost:t.smtpHost||"",smtpPort:t.smtpPort||587,smtpTls:t.smtpTls||!1,smtpStartTls:t.smtpStartTls||!0,smtpUsername:h&&t.smtpUsername||"",smtpPassword:"",useDifferentSmtpCreds:h}),u(!1)}else f.reset({email:"",displayName:"",username:"",password:"",imapHost:"",imapPort:993,imapTls:!0,imapStartTls:!1,smtpHost:"",smtpPort:587,smtpTls:!1,smtpStartTls:!0,useDifferentSmtpCreds:!1}),u(!1)},[t,f]);const b=Se({...Is()}),re=Se({...Rs(),onSuccess:()=>{o.invalidateQueries({queryKey:Te()}),s()}}),N=Se({...es(),onSuccess:()=>{o.invalidateQueries({queryKey:Te()}),s()}}),$=()=>{const h=f.getValues(),V=d&&!n;b.mutate({body:{accountId:V?t?.accountId:void 0,username:h.username||h.email,password:V?void 0:h.password||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls}})},I=()=>{const h=f.getValues(),V=d&&!n;b.mutate({body:{accountId:V?t?.accountId:void 0,username:h.username||h.email,password:V?void 0:h.password||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls,smtpHost:h.smtpHost||void 0,smtpPort:h.smtpPort?Number(h.smtpPort):void 0,smtpTls:h.smtpTls,smtpStartTls:h.smtpStartTls,smtpUsername:h.useDifferentSmtpCreds?h.smtpUsername:void 0,smtpPassword:h.useDifferentSmtpCreds?h.smtpPassword:void 0}})},A=f.handleSubmit(h=>{if(!d&&!h.password){f.setError("password",{message:"Password is required"});return}const V=ir({imapHost:h.imapHost,smtpHost:h.smtpHost,smtpPort:h.smtpPort,smtpTls:h.smtpTls,smtpStartTls:h.smtpStartTls});V&&(f.setValue("smtpHost",V.smtpHost),f.setValue("smtpPort",V.smtpPort),f.setValue("smtpTls",V.smtpTls),f.setValue("smtpStartTls",V.smtpStartTls));const ce=V?.smtpHost??h.smtpHost,se=V?.smtpPort??h.smtpPort,me=V?.smtpTls??h.smtpTls,Ne=V?.smtpStartTls??h.smtpStartTls,Fe={email:h.email,displayName:h.displayName?.trim()||void 0,username:h.username||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls,smtpHost:ce||void 0,smtpPort:se?Number(se):void 0,smtpTls:me,smtpStartTls:Ne,smtpUsername:h.useDifferentSmtpCreds&&h.smtpUsername||void 0,smtpPassword:h.useDifferentSmtpCreds&&h.smtpPassword||void 0};if(d&&t){const Pe={...Fe,password:n?h.password:void 0};N.mutate({path:{accountId:t.accountId},body:Pe})}else{const Pe={...Fe,password:h.password};re.mutate({body:Pe})}}),ne=re.isPending||N.isPending,{signature:ae,setSignature:ge,isSaving:oe}=ar(t?.accountId),[Q,le]=F.useState(ae.plainText),{languages:T,setLanguages:k,isSaving:D}=Yr(t?.accountId),q=a.jsxs("section",{children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Writing languages"}),a.jsx(fr,{value:T,onChange:k,busy:D})]});F.useEffect(()=>{le(ae.plainText)},[ae.plainText]),F.useEffect(()=>{if(!e||!i)return;const h=_.current;if(!h)return;const V=window.setTimeout(()=>{h.scrollIntoView({behavior:"smooth",block:"start"})},250);return()=>window.clearTimeout(V)},[e,i]);const Z=F.useCallback(()=>{Q!==ae.plainText&&ge(Q,Q)},[Q,ae.plainText,ge]),S=h=>{const{tls:V,startTls:ce}=Be(h);f.setValue("imapTls",V),f.setValue("imapStartTls",ce);const se=f.getValues("imapPort");(se===993||se===143)&&f.setValue("imapPort",h==="tls"?993:143)},J=h=>{const{tls:V,startTls:ce}=Be(h);f.setValue("smtpTls",V),f.setValue("smtpStartTls",ce);const se=f.getValues("smtpPort");if(se===465||se===587||se===25){const Ne=h==="tls"?465:h==="starttls"?587:25;f.setValue("smtpPort",Ne)}},W=()=>{const h=f.getValues("imapHost");f.setValue("smtpHost",nr(h)),f.setValue("smtpTls",!1),f.setValue("smtpStartTls",!0),f.setValue("smtpPort",587)},fe=h=>{E(h),U(!1);const V=Vt(h);if(!V)return;const ce=Be(V.imap.security);f.setValue("imapHost",V.imap.host),f.setValue("imapPort",V.imap.port),f.setValue("imapTls",ce.tls),f.setValue("imapStartTls",ce.startTls);const se=Be(V.smtp.security);f.setValue("smtpHost",V.smtp.host),f.setValue("smtpPort",V.smtp.port),f.setValue("smtpTls",se.tls),f.setValue("smtpStartTls",se.startTls);const me=f.getValues("email").trim(),Ne=f.getValues("username")?.trim();me&&!Ne&&f.setValue("username",me)},Ee=R?.passwordHelp.text,we=Dt(b.data?.imapError,Ee),_e=Dt(b.data?.smtpError,Ee);return(t?Qr(t):!1)&&d?a.jsx(Ct,{isOpen:e,onClose:s,title:"Edit Account",footer:a.jsx(te,{type:"button",variant:"secondary",onClick:s,children:"Close"}),children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("section",{children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Microsoft 365 Account"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"rounded-md border border-line bg-surface-sunken px-3 py-2.5 text-sm text-fg-muted",children:[a.jsx("span",{className:"block text-2xs font-medium uppercase tracking-wider text-fg-subtle mb-1",children:"Email"}),a.jsx("span",{className:"text-fg",children:t?.email})]}),a.jsxs("div",{className:"rounded-md border border-line bg-surface-sunken px-3 py-2.5 text-sm text-fg-muted",children:[a.jsx("span",{className:"block text-2xs font-medium uppercase tracking-wider text-fg-subtle mb-1",children:"Authentication"}),a.jsx("span",{className:"text-fg",children:"Microsoft OAuth (XOAUTH2)"})]}),a.jsx("p",{className:"text-xs text-fg-muted",children:"Server settings are managed automatically for Microsoft 365 accounts. To update credentials, use the Reconnect button."})]})]}),d&&a.jsxs("section",{children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Signature"}),a.jsx("div",{className:"space-y-3",children:a.jsxs("div",{children:[a.jsx("label",{htmlFor:"email-sig-view",className:"text-sm font-medium mb-1.5 block",children:"Email Signature"}),a.jsx("textarea",{id:"email-sig-view",value:Q,onChange:h=>le(h.target.value),onBlur:Z,rows:5,className:"w-full px-3 py-2 border border-line rounded-md bg-surface-sunken text-sm text-fg placeholder:text-fg-subtle focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors resize-y outline-none",placeholder:"Enter your email signature..."}),a.jsx("p",{className:"text-xs text-fg-muted mt-1",children:oe?"Saving signature...":"This signature will be appended to new emails."})]})})]}),d&&q]})}):a.jsx(Ct,{isOpen:e,onClose:s,title:d?"Edit Account":"Add Account",footer:a.jsxs(a.Fragment,{children:[a.jsx(te,{type:"button",variant:"secondary",onClick:s,children:"Cancel"}),a.jsx(te,{type:"submit",form:"account-form",variant:"primary",disabled:ne,children:ne?"Saving...":"Save Account"})]}),children:a.jsxs("form",{id:"account-form",onSubmit:A,className:"space-y-6",children:[a.jsxs("section",{children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Account Information"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"account-provider",className:"text-sm font-medium mb-1.5 block",children:"Provider"}),a.jsxs(Ms,{id:"account-provider",value:j,onChange:h=>fe(h.target.value),children:[a.jsx("option",{value:"",children:"Custom / other"}),Xs.map(h=>a.jsx("option",{value:h.id,children:h.label},h.id))]}),a.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Pick your email provider to fill in server settings automatically, or choose Custom to enter them by hand."})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"account-email",className:"text-sm font-medium mb-1.5 block",children:"Email Address"}),a.jsx(ve,{id:"account-email",...f.register("email"),placeholder:"alice@example.com"}),f.formState.errors.email&&a.jsx("p",{className:"text-sm text-danger mt-1",children:f.formState.errors.email.message})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"account-displayName",className:"text-sm font-medium mb-1.5 block",children:"Display name (optional)"}),a.jsx(ve,{id:"account-displayName",...f.register("displayName"),placeholder:"Alice"}),a.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"account-username",className:"text-sm font-medium mb-1.5 block",children:"Username"}),a.jsx(ve,{id:"account-username",...f.register("username"),placeholder:"Same as email if empty"})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"account-password",className:"text-sm font-medium mb-1.5 block",children:"Password"}),a.jsx(At,{id:"account-password",...f.register("password",{onChange:()=>u(!0)}),onFocus:()=>{d&&!n&&(f.setValue("password",""),u(!0))},placeholder:d?"Leave empty to keep current":""}),f.formState.errors.password&&a.jsx("p",{className:"text-sm text-danger mt-1",children:f.formState.errors.password.message}),R&&a.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[R.passwordHelp.text," ",a.jsx("a",{href:R.passwordHelp.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Get an app password"})]})]})]})]}),a.jsxs("section",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider",children:"Incoming Mail (IMAP)"}),R&&a.jsx("button",{type:"button",onClick:()=>U(h=>!h),className:"text-xs text-fg-muted hover:text-fg transition-colors",children:P?"Use preset settings":"Advanced"})]}),O&&a.jsxs("p",{className:"text-xs text-fg-muted mb-3",children:["Server settings are pre-filled for ",R?.label," and locked. Choose Advanced to edit them by hand."]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"imap-host",className:"text-sm font-medium mb-1.5 block",children:"Server"}),a.jsx(ve,{id:"imap-host",...f.register("imapHost"),readOnly:O,placeholder:"imap.example.com"}),f.formState.errors.imapHost&&a.jsx("p",{className:"text-sm text-danger mt-1",children:f.formState.errors.imapHost.message})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"imap-port",className:"text-sm font-medium mb-1.5 block",children:"Port"}),a.jsx(ve,{id:"imap-port",...f.register("imapPort"),readOnly:O,type:"number"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm font-medium mb-1.5 block",children:"Security"}),a.jsxs("div",{className:"space-y-1.5 mt-2",children:[a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:f.watch("imapTls"),onChange:()=>S("tls")}),"TLS (Port 993)"]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:!f.watch("imapTls")&&f.watch("imapStartTls"),onChange:()=>S("starttls")}),"STARTTLS (Port 143)"]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:!f.watch("imapTls")&&!f.watch("imapStartTls"),onChange:()=>S("none")}),"None (Unencrypted)"]})]})]})]}),a.jsx(te,{type:"button",variant:"secondary",onClick:$,disabled:b.isPending,className:"w-full",icon:b.isPending?a.jsx(it,{className:"size-4 animate-spin"}):void 0,children:b.isPending?"Testing...":"Test IMAP Connection"}),b.data&&a.jsxs("div",{className:Ge("p-2 rounded-md text-sm",b.data.imapSuccess?"bg-positive/10 text-positive":"bg-danger-soft text-danger"),children:[b.data.imapSuccess?a.jsx(Tt,{className:"inline size-4 mr-1"}):a.jsx(Ce,{className:"inline size-4 mr-1"}),b.data.imapSuccess?"IMAP Connected":we]})]})]}),a.jsxs("section",{ref:_,"data-testid":"smtp-section",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider",children:"Outgoing Mail (SMTP)"}),!O&&a.jsx("button",{type:"button",onClick:W,disabled:!f.watch("imapHost"),className:"text-xs text-fg-muted hover:text-fg transition-colors disabled:opacity-50",children:"Pre-fill from IMAP"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"smtp-host",className:"text-sm font-medium mb-1.5 block",children:"Server"}),a.jsx(ve,{id:"smtp-host",...f.register("smtpHost"),readOnly:O,placeholder:"smtp.example.com"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"smtp-port",className:"text-sm font-medium mb-1.5 block",children:"Port"}),a.jsx(ve,{id:"smtp-port",...f.register("smtpPort"),readOnly:O,type:"number"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm font-medium mb-1.5 block",children:"Security"}),a.jsxs("div",{className:"space-y-1.5 mt-2",children:[a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:f.watch("smtpTls")===!0,onChange:()=>J("tls")}),"TLS (Port 465)"]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:!f.watch("smtpTls")&&f.watch("smtpStartTls")===!0,onChange:()=>J("starttls")}),"STARTTLS (Port 587)"]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"radio",disabled:O,checked:!f.watch("smtpTls")&&!f.watch("smtpStartTls"),onChange:()=>J("none")}),"None (Unencrypted)"]})]})]})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[a.jsx("input",{type:"checkbox",...f.register("useDifferentSmtpCreds")}),"Use different credentials for SMTP"]}),f.watch("useDifferentSmtpCreds")&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"smtp-username",className:"text-sm font-medium mb-1.5 block",children:"SMTP Username"}),a.jsx(ve,{id:"smtp-username",...f.register("smtpUsername")})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"smtp-password",className:"text-sm font-medium mb-1.5 block",children:"SMTP Password"}),a.jsx(At,{id:"smtp-password",...f.register("smtpPassword")})]})]}),a.jsx(te,{type:"button",variant:"secondary",onClick:I,disabled:b.isPending||!f.watch("smtpHost"),className:"w-full",icon:b.isPending?a.jsx(it,{className:"size-4 animate-spin"}):void 0,children:b.isPending?"Testing...":"Test SMTP Connection"}),b.data?.smtpSuccess!==void 0&&a.jsxs("div",{className:Ge("p-2 rounded-md text-sm",b.data.smtpSuccess?"bg-positive/10 text-positive":"bg-danger-soft text-danger"),children:[b.data.smtpSuccess?a.jsx(Tt,{className:"inline size-4 mr-1"}):a.jsx(Ce,{className:"inline size-4 mr-1"}),b.data.smtpSuccess?"SMTP Connected":_e]})]})]}),d&&a.jsxs("section",{children:[a.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Signature"}),a.jsx("div",{className:"space-y-3",children:a.jsxs("div",{children:[a.jsx("label",{htmlFor:"email-sig-edit",className:"text-sm font-medium mb-1.5 block",children:"Email Signature"}),a.jsx("textarea",{id:"email-sig-edit",value:Q,onChange:h=>le(h.target.value),onBlur:Z,rows:5,className:"w-full px-3 py-2 border border-line rounded-md bg-surface-sunken text-sm text-fg placeholder:text-fg-subtle focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors resize-y outline-none",placeholder:"Enter your email signature..."}),a.jsx("p",{className:"text-xs text-fg-muted mt-1",children:oe?"Saving signature...":"This signature will be appended to new emails."})]})})]}),d&&q]})})};function Yt({open:e,onClose:s,accountEmail:t,signOut:i}){const[o,d]=F.useState(""),[n,u]=F.useState(!1),[j,E]=F.useState(!1),P=Se({...Hs(),onSuccess:()=>{E(!0),setTimeout(()=>i(),2e3)}}),U=Se(zs()),R=()=>{P.isPending||(d(""),u(!1),E(!1),P.reset(),U.reset(),s())},O=()=>{if(o.trim().toLowerCase()!==t.toLowerCase()){u(!0);return}u(!1),P.mutate({body:{confirmEmail:o.trim()}})};return a.jsxs(ts,{open:e,onClose:R,title:"Delete your Remit account",children:[a.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[a.jsx(ut,{className:"size-4 shrink-0 text-danger"}),a.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:"Delete your Remit account"}),a.jsx(te,{variant:"ghost",size:"sm",icon:a.jsx(Ce,{className:"size-3.5"}),onClick:R,"aria-label":"Cancel"})]}),j?a.jsxs("div",{className:"px-5 py-6 text-sm text-fg-muted",children:[a.jsx("p",{className:"font-medium text-fg",children:"Account deletion scheduled."}),a.jsx("p",{className:"mt-1",children:"Your data will be erased shortly. Signing you out…"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[a.jsx("p",{children:"This permanently erases everything Remit holds for you:"}),a.jsxs("ul",{className:"space-y-1.5 text-xs",children:[a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-danger",children:"•"}),"All connected accounts disconnected and access tokens revoked."]}),a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-danger",children:"•"}),"Synced mail cache and search index."]}),a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-danger",children:"•"}),"AI history and insights."]}),a.jsxs("li",{className:"flex gap-2",children:[a.jsx("span",{className:"text-danger",children:"•"}),"Preferences and rules."]})]}),a.jsxs("div",{className:"rounded-sm border border-line bg-surface-sunken px-3 py-2 text-xs",children:[a.jsx("strong",{className:"text-fg",children:"Your mail at Gmail / IMAP is not deleted."})," ","This only removes Remit's copy and its access — the mail stays in your provider mailboxes."]}),a.jsxs("div",{className:"text-xs",children:[a.jsxs("button",{type:"button",onClick:()=>U.mutate({}),"aria-busy":U.isPending,className:"inline-flex items-center gap-1.5 font-medium text-accent hover:underline",children:[a.jsx(or,{className:"size-3.5"}),U.isPending?"Requesting export…":"Export my data first"]}),U.isSuccess&&a.jsx("p",{className:"mt-1.5 text-fg-muted",role:"status",children:"Export requested. We'll prepare a ZIP of your mail — find it under your data exports when it's ready."}),U.isError&&a.jsx("p",{className:"mt-1.5 text-danger",role:"alert",children:"Couldn't start the export. Please try again."})]}),a.jsxs("div",{children:[a.jsxs("label",{htmlFor:"confirm-remit-email",className:"mb-1 block text-xs font-medium text-fg",children:["Type"," ",a.jsx("span",{className:"font-mono text-fg-muted",children:t})," ","to confirm"]}),a.jsx(ve,{id:"confirm-remit-email",type:"email",placeholder:t,value:o,onChange:_=>{d(_.target.value),n&&u(!1),P.isError&&P.reset()},autoComplete:"off"}),n&&a.jsx("p",{className:"mt-1.5 text-xs text-danger",role:"alert",children:"That doesn't match your account email. Type it exactly to confirm."}),P.isError&&a.jsx("p",{className:"mt-1.5 text-xs text-danger",role:"alert",children:P.error instanceof Error?P.error.message:"Something went wrong. Please try again."})]})]}),a.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[a.jsx(te,{variant:"secondary",size:"sm",onClick:R,children:"Cancel"}),a.jsx(te,{variant:"danger",size:"sm",onClick:O,"aria-busy":P.isPending,children:P.isPending?"Deleting…":"Delete everything"})]})]})]})}function ta(e){const{Account:s}=Us();return a.jsx(s,{fallback:a.jsx(Yt,{...e,accountEmail:"",signOut:()=>{}}),children:({email:t,signOut:i})=>a.jsx(Yt,{...e,accountEmail:t??"",signOut:i})})}function sa(){const[e,s]=F.useState(!1);return a.jsxs("section",{className:"mt-8 border-t border-line pt-6",children:[a.jsx(mr,{title:"Delete your Remit account",description:"Disconnects every account and erases Remit's copy of your mail, insights and preferences. Your mail at the providers is untouched.",action:a.jsx(te,{variant:"danger",size:"sm",onClick:()=>s(!0),children:"Delete your Remit account"})}),a.jsx(ta,{open:e,onClose:()=>s(!1)})]})}function ra(e){const s=e.toLowerCase();return s==="access_denied"?"You cancelled the sign-in.":s==="consent_required"||s.includes("admin_consent")||s.includes("interaction_required")?"Your organisation's admin needs to approve Remit. Ask your IT admin to grant the required permissions.":s.includes("imap_disabled")||s.includes("imap disabled")?"IMAP is disabled for this account. Ask your admin to enable IMAP access in the Microsoft 365 admin centre.":`Sign-in failed: ${e}. Please try again.`}function aa(e){const s=e.split("@")[0]??"";return s?s.split(/[._-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):e}function ia(e){const s=e.displayName?.trim();return s||aa(e.email)}function na(e){if(!e.lastSyncAt)return"never synced";const s=cr(e.lastSyncAt);return s?`synced ${s}`:"never synced"}function Qt(e){return e.muted?.value?"muted":e.lastError?"error":e.connectionState==="authenticated"?"healthy":"error"}function Zt(e){return e.connectionState==="reauth_required"}function oa(e){return e.connectionState==="credentials_missing"}const la=()=>a.jsx("div",{className:"space-y-3",role:"status","aria-busy":"true","aria-label":"Loading accounts",children:["skeleton-0","skeleton-1"].map(e=>a.jsx("div",{className:"rounded-sm border border-line bg-surface animate-pulse p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"size-10 rounded-full bg-surface-sunken"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-1/3"}),a.jsx("div",{className:"h-3 bg-surface-sunken rounded w-2/3"})]})]})},e))});function _a(){const e=_t.useSearch(),s=Bs({from:_t.fullPath}),[t,i]=F.useState(!0),[o,d]=F.useState(!1),[n,u]=F.useState(!1),[j,E]=F.useState(null),[P,U]=F.useState(!1),[R,O]=F.useState(null),[_,f]=F.useState(null),[b,re]=F.useState(null),[N,$]=F.useState(null),I=ft(),{data:A,isPending:ne,isError:ae,error:ge,refetch:oe}=Jt(Xt());F.useEffect(()=>{e.editAccountId&&(E(e.editAccountId),U(!!e.focusSmtp),s({search:{editAccountId:void 0,focusSmtp:void 0,connected:e.connected,oauthError:e.oauthError},replace:!0}))},[e.editAccountId,e.focusSmtp,s,e.connected,e.oauthError]),F.useEffect(()=>{e.connected&&(f("Account connected successfully."),E(e.connected),I.invalidateQueries({queryKey:Te()}),s({search:{connected:void 0,oauthError:void 0,editAccountId:void 0,focusSmtp:void 0},replace:!0}))},[e.connected,s,I]),F.useEffect(()=>{e.oauthError&&(re(ra(e.oauthError)),$(null),s({search:{oauthError:void 0,connected:void 0,editAccountId:void 0,focusSmtp:void 0},replace:!0}))},[e.oauthError,s]),tr(N!==null,()=>{I.invalidateQueries({queryKey:Te()})}),F.useEffect(()=>{if(!N||!A)return;const S=A.accounts.find(J=>J.accountId===N);(!S||!Zt(S))&&$(null)},[A,N]);const Q=sr(S=>{$(null),S==="stalled"&&re(rr)}),le=Se({...qs(),onSuccess:S=>{Q(),window.location.assign(S.authorizationUrl)},onError:S=>{re(S instanceof Error?S.message:"Failed to start reconnect"),$(null)}}),T=Se({...$s(),onSuccess:()=>{I.invalidateQueries({queryKey:Te()}),O(null)}}),k=A?.accounts.find(S=>S.accountId===R),D=A?.accounts.find(S=>S.accountId===j),q=()=>{d(!1),u(!1),E(null),U(!1)},Z=S=>{const J=Ks[S];J&&s({to:J})};return a.jsxs(Zs,{items:Ws,activeId:"accounts",title:"Accounts",description:"Every account keeps syncing — muted ones just stay out of unified views.",help:dr,helpOpen:t,onToggleHelp:()=>i(S=>!S),onSelect:Z,onBackToMail:()=>{s({to:"/mail"})},children:[_&&a.jsx(Pt,{tone:"success",variant:"soft","data-testid":"oauth-success-banner",onDismiss:()=>f(null),children:_}),b&&a.jsx(Pt,{tone:"danger",variant:"soft","data-testid":"oauth-error-banner",onDismiss:()=>re(null),children:b}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Gs,{tone:"neutral",children:ne||ae?"accounts":`${A.accounts.length} ${A.accounts.length===1?"account":"accounts"}`}),a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(kt,{className:"size-3.5"}),onClick:()=>u(!0),children:"Add account"})]}),ne?a.jsx(la,{}):ae?a.jsx(lr,{title:"Couldn't load accounts",error:ge,onRetry:()=>{oe()}}):A.accounts.length===0?a.jsxs("div",{className:"py-12 text-sm text-fg-muted","data-testid":"accounts-empty",children:[a.jsx("p",{className:"mb-3",children:"No accounts configured."}),a.jsx(te,{variant:"primary",size:"sm",icon:a.jsx(kt,{className:"size-3.5"}),onClick:()=>u(!0),children:"Add your first account"})]}):a.jsx("div",{className:"space-y-3",children:A.accounts.map(S=>{const J=Zt(S),W=oa(S),fe=S.authType==="oauthMicrosoft",Ee=N===S.accountId,we=J&&fe?{label:"Reconnect",variant:"secondary",busy:Ee,busyLabel:"Redirecting…",onClick:()=>{$(S.accountId),le.mutate({body:{email:S.email}})}}:W?{label:"Enter password",variant:"secondary",onClick:()=>E(S.accountId)}:Qt(S)==="error"?{label:"Reconnect",variant:"secondary",onClick:()=>E(S.accountId)}:{label:"Manage",variant:"ghost",onClick:()=>E(S.accountId)},_e=a.jsx(Qs,{actions:[we],destructive:{label:"Delete account",iconOnly:!0,icon:a.jsx(Ys,{className:"size-3.5"}),onClick:()=>O(S.accountId)}});return a.jsx(Js,{label:ia(S),email:S.email,connector:fe?"Microsoft 365":"IMAP",syncLabel:na(S),state:Qt(S),errorDetail:J?"Re-authentication required":W?"Imported from a config file, which carries no password. Enter one to start syncing.":S.lastError,trailing:_e},S.accountId)})}),n&&a.jsx("div",{className:"fixed inset-0 z-40 overflow-auto bg-canvas",children:a.jsx(er,{skipWelcome:!0,onComplete:()=>{u(!1),I.invalidateQueries({queryKey:Te()})},onCancel:()=>u(!1)})}),a.jsx(ea,{isOpen:o||!!j,account:D,focusSmtp:P,onClose:q}),a.jsxs(ts,{open:!!R,onClose:()=>O(null),title:"Delete account",children:[a.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[a.jsx(ut,{className:"size-4 shrink-0 text-danger"}),a.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:"Delete account"}),a.jsx(te,{variant:"ghost",size:"sm",icon:a.jsx(Ce,{className:"size-3.5"}),onClick:()=>O(null),"aria-label":"Cancel"})]}),a.jsxs("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:[a.jsx("p",{className:"text-center text-lg font-medium text-fg",children:"Are you sure?"}),k&&a.jsx("p",{className:"text-center",children:k.email}),a.jsxs("ul",{className:"list-inside list-disc space-y-1",children:[a.jsx("li",{children:"Remove the account from your settings"}),a.jsx("li",{children:"Stop syncing mail for this account"}),a.jsx("li",{children:"Delete all associated data (within 24 hours)"})]})]}),a.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[a.jsx(te,{variant:"secondary",size:"sm",onClick:()=>O(null),children:"Cancel"}),a.jsx(te,{variant:"danger",size:"sm","aria-busy":T.isPending,icon:T.isPending?a.jsx(it,{className:"size-3.5 animate-spin"}):void 0,onClick:()=>{T.isPending||R&&T.mutate({path:{accountId:R}})},children:T.isPending?"Deleting…":"Delete account"})]})]}),a.jsx(sa,{})]})}export{_a as component,ra as mapOauthError};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ad as x,r as a,b3 as g,j as e,aJ as S,b4 as n,aL as y,b5 as b}from"./index-FpwHnbdV.js";import{S as T}from"./settings-screen-m0Uy9zlo.js";import{c as v}from"./help-copy-D6t16AP5.js";import"./avatar-G7g9Uwvc.js";import"./menu-B-aaGy7K.js";import"./circle-help-BoGPc17x.js";import"./kbd-tXno4rYH.js";const o="remit.density";function N(){return typeof localStorage>"u"?"comfortable":localStorage.getItem(o)??"comfortable"}function H(){const s=x(),[i,r]=a.useState(!0),[c,m]=a.useState(N),[p,d]=a.useState(g),h=t=>{m(t),typeof localStorage<"u"&&localStorage.setItem(o,t)},f=t=>{d(t),b(t)},u=t=>{const l=y[t];l&&s({to:l})};return e.jsx(T,{items:S,activeId:"appearance",title:"Appearance",description:"Display density and colour theme — instant-apply.",help:v,helpOpen:i,onToggleHelp:()=>r(t=>!t),onSelect:u,onBackToMail:()=>{s({to:"/mail"})},children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Density"}),e.jsx(n,{name:"density","aria-label":"Density",value:c,onChange:h,options:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Controls the spacing of message rows in the mail list."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Theme"}),e.jsx(n,{name:"theme","aria-label":"Theme",value:p,onChange:f,options:[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Applies immediately. System default follows your OS preference."})]})]})})}export{H as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as R,bK as M,j as l,r as p,a1 as L,a as _,p as g}from"./index-FpwHnbdV.js";const S=R("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);const V=R("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),w=4,b=8;function I(e,t,s){const n=Math.max(b,window.innerWidth-t.width-b),o=s==="end"?e.right-t.width:e.left,r=Math.min(Math.max(o,b),n),a=e.bottom+w,i=e.top-w-t.height,u=a+t.height<=window.innerHeight-b||i<b?a:i;return{left:r,top:u}}function P(e,t,s,n){const[o,r]=p.useState(null),a=p.useRef(n);return a.current=n,p.useLayoutEffect(()=>{if(!t){r(null);return}const i=()=>{const d=e.current,m=a.current();if(!d||!m)return;const f=d.getBoundingClientRect(),x={width:f.right-f.left,height:f.bottom-f.top},c=I(m,x,s);r(E=>E?.left===c.left&&E.top===c.top?E:{position:"fixed",left:c.left,top:c.top})};i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0);const h=e.current;let u=null;return h&&typeof ResizeObserver<"u"&&(u=new ResizeObserver(i),u.observe(h)),()=>{u?.disconnect(),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[t,s,e]),o}function j({open:e,align:t="start",getAnchor:s,panelRef:n,children:o}){const r=P(n,e,t,s);return e?M.createPortal(l.jsx("div",{className:"z-50",style:r??{position:"fixed",visibility:"hidden"},children:o}),document.body):null}function k({label:e,children:t,className:s,ref:n,onKeyDown:o,"data-testid":r}){return l.jsx("div",{ref:n,role:"menu","aria-label":e,tabIndex:-1,onKeyDown:o,"data-testid":r,className:g("z-50 flex max-h-[60dvh] min-w-44 flex-col overflow-y-auto overscroll-contain rounded-md border border-line bg-surface py-1 shadow-lg outline-none",s),children:t})}function T({label:e,icon:t,onSelect:s,className:n,lang:o,"data-testid":r}){return l.jsxs("button",{type:"button",role:"menuitem",lang:o,onClick:s,"data-testid":r,className:g("flex min-h-11 items-center gap-3 px-4 py-2.5 text-left text-sm text-fg transition-colors hover:bg-surface-sunken",n),children:[t&&l.jsx("span",{className:"shrink-0 text-fg-subtle",children:t}),e]})}function $({triggerLabel:e,triggerIcon:t,triggerText:s,items:n,align:o="end",touch:r=!0,className:a,triggerClassName:i,nested:h=!1,children:u}){const[d,m]=p.useState(!1),f=p.useRef(null),x=p.useRef(null);return L({id:"popover-menu",open:d,answers:{back:()=>m(!1)}}),p.useEffect(()=>{if(!d)return;const c=E=>{const v=E.target;f.current?.contains(v)||x.current?.contains(v)||m(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[d]),n.length===0&&!u?null:l.jsxs("div",{ref:f,className:g("relative",a),...h?{role:"none"}:{},children:[l.jsx(_,{variant:"ghost",size:"sm",icon:t??l.jsx(S,{className:"size-5"}),onClick:()=>m(c=>!c),"aria-label":e,"aria-haspopup":"menu","aria-expanded":d,...h?{role:"menuitem"}:{},className:g(r&&"min-h-11 min-w-11 px-0",i),children:s}),l.jsx(j,{open:d,align:o,panelRef:x,getAnchor:()=>f.current?.getBoundingClientRect()??null,children:l.jsxs(k,{ref:x,children:[n.map(c=>l.jsx(T,{label:c.label,icon:c.icon,onSelect:()=>{m(!1),c.onSelect()}},c.key)),u]})})]})}const z=/[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u2028\u2029\u202a-\u202e\u2066-\u2069\ufeff]/g,B=/[<>:"|?*]/g,C=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\.|$)/i,y=120,H=12,O="attachment",N=e=>{const t=[...e];if(t.length<=y)return e;const s=e.lastIndexOf("."),n=s>0&&[...e.slice(s)].length<=H?e.slice(s):"",o=y-[...n].length;return t.slice(0,o).join("")+n},U=(e,t=O)=>{const n=e.replace(z,"").split(/[/\\]/),r=(n[n.length-1]??"").replace(B,"_").replace(/^[.\s]+/,"").replace(/[.\s]+$/,"");if(r.length===0)return N(t);const a=C.test(r)?`_${r}`:r;return N(a)},A=["KB","MB","GB","TB"],G=e=>{if(!Number.isFinite(e)||e<0)return"unknown size";const t=Math.round(e);if(t<1024)return t===1?"1 byte":`${t} bytes`;const s=1023.95;let n=t/1024,o=0;for(;n>=s&&o<A.length-1;)n/=1024,o+=1;return`${n.toFixed(1).replace(/\.0$/,"")} ${A[o]}`};export{S as E,$ as P,V as U,j as a,k as b,T as c,G as f,U as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a1 as j,r as s,j as o,p as v}from"./index-FpwHnbdV.js";const k=320,I="cubic-bezier(0.32, 0.9, 0.3, 1)",N=.5,C=.4,E=360;function P(n){return Math.sign(n)*Math.sqrt(Math.abs(n))*4}function A({open:n,onClose:i,children:g,dismissLabel:S="Dismiss"}){j({id:"bottom-sheet",open:n,answers:{back:i}});const d=s.useRef(null),[l,Y]=s.useState(E),[b,u]=s.useState(null);s.useLayoutEffect(()=>{const t=d.current;if(!t)return;const e=()=>Y(t.offsetHeight);e();const a=new ResizeObserver(e);return a.observe(t),()=>a.disconnect()},[]);const c=s.useRef(null),y=s.useCallback(t=>{t.currentTarget.setPointerCapture(t.pointerId),c.current={startY:t.clientY,lastY:t.clientY,lastT:t.timeStamp,velocity:0,moved:!1},u(0)},[]),w=s.useCallback(t=>{const e=c.current;if(!e)return;const a=t.timeStamp-e.lastT;a>0&&(e.velocity=(t.clientY-e.lastY)/a),e.lastY=t.clientY,e.lastT=t.timeStamp;const r=t.clientY-e.startY;Math.abs(r)>4&&(e.moved=!0);const M=r<0?P(r):r;u(M)},[]),m=s.useCallback(()=>{const t=c.current;if(c.current=null,!t)return;const e=t.lastY-t.startY,r=t.velocity>N||e>l*C;u(null),r&&i()},[l,i]),x=b!==null,p=n?b??0:l,f=Math.min(Math.max(1-p/l,0),1),h=x?"none":`transform ${k}ms ${I}`;return o.jsxs("div",{className:v("absolute inset-0 z-40 select-none overflow-hidden",n||x?"":"pointer-events-none"),children:[o.jsx("button",{type:"button","aria-label":S,tabIndex:-1,onClick:i,className:v("absolute inset-0 bg-black/40",f>0?"pointer-events-auto":"pointer-events-none"),style:{opacity:f*.6,transition:h.replace("transform","opacity")}}),o.jsxs("div",{ref:d,className:"absolute inset-x-0 bottom-0 flex max-h-[92%] flex-col rounded-t-3xl border-t border-line bg-surface pb-[env(safe-area-inset-bottom,0px)] shadow-2xl shadow-black/30",style:{transform:`translateY(${p}px)`,transition:h},children:[o.jsx("div",{role:"slider","aria-label":"Drag down to dismiss","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(f*100),tabIndex:0,onPointerDown:y,onPointerMove:w,onPointerUp:m,onPointerCancel:m,className:"flex cursor-grab touch-none justify-center pb-1 pt-2.5 active:cursor-grabbing",children:o.jsx("div",{className:"h-1 w-10 rounded-full bg-fg-subtle/40"})}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:g})]})]})}export{A as B};
|
package/assets/brief-Bc68FlBf.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,af as i}from"./index-FpwHnbdV.js";import{a as m}from"./MailShell-CvGuWCuj.js";import{B as o}from"./BriefPane-CfitNMEu.js";import{f as p}from"./search-token-index-C9KNJC5_.js";import{u as e}from"./search-mirror-B2LoSoNR.js";import"./FullCompose-0DIPCtd6.js";import"./ErrorState-4TfgxGLk.js";import"./index-CYwsmjFx.js";import"./useMessageBodyContent-BOBb68Px.js";import"./useSignature-HAuR6_Ul.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DU11pzlc.js";import"./sections-DDQm-Sbc.js";import"./format-BSk7Do06.js";import"./confirm-dialog-B4KJVTQx.js";import"./useSearchTokenContext-DH5XswlU.js";import"./kbd-tXno4rYH.js";import"./search-scope-DTcpOp3S.js";import"./MailListHeader-Brjq4vBE.js";import"./attachment-file-ul58bxI4.js";import"./mail-DmVe7n1g.js";import"./avatar-G7g9Uwvc.js";import"./download-vw3zYEkx.js";import"./shield-check-Cs0C_oxK.js";import"./useFilters-BBJu_93Q.js";import"./useQueries-Dx2PHSps.js";import"./clock-C2olBfsH.js";import"./menu-B-aaGy7K.js";import"./useRefreshControl-CWjutjgw.js";import"./circle-check-big-SYJDr4tY.js";import"./useLabels-GtiakPKP.js";import"./useSemanticSearch-CZUtmciE.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function H(){const t=p();return e({to:"/mail/brief"}),r.jsx(o,{thread:t,children:r.jsx(m,{phone:r.jsx(o.Phone,{}),list:r.jsx(o.List,{}),reading:r.jsx(i,{}),intelligence:r.jsx(o.Intelligence,{}),hasThread:!!t})})}export{H as component};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{dZ as A,a7 as $}from"./index-FpwHnbdV.js";function X(_,d){for(var b=0;b<d.length;b++){const y=d[b];if(typeof y!="string"&&!Array.isArray(y)){for(const l in y)if(l!=="default"&&!(l in _)){const p=Object.getOwnPropertyDescriptor(y,l);p&&Object.defineProperty(_,l,p.get?p:{enumerable:!0,get:()=>y[l]})}}}return Object.freeze(Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}))}var E={exports:{}},H;function Z(){return H||(H=1,(function(_,d){var b=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof A<"u"&&A,y=(function(){function p(){this.fetch=!1,this.DOMException=b.DOMException}return p.prototype=b,new p})();(function(p){(function(h){var a=typeof p<"u"&&p||typeof self<"u"&&self||typeof A<"u"&&A||{},u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function F(e){return e&&DataView.prototype.isPrototypeOf(e)}if(u.arrayBuffer)var q=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],C=ArrayBuffer.isView||function(e){return e&&q.indexOf(Object.prototype.toString.call(e))>-1};function v(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function T(e){return typeof e!="string"&&(e=String(e)),e}function B(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return u.iterable&&(t[Symbol.iterator]=function(){return t}),t}function i(e){this.map={},e instanceof i?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}i.prototype.append=function(e,t){e=v(e),t=T(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},i.prototype.delete=function(e){delete this.map[v(e)]},i.prototype.get=function(e){return e=v(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(v(e))},i.prototype.set=function(e,t){this.map[v(e)]=T(t)},i.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),B(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),B(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),B(e)},u.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);function O(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function D(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function I(e){var t=new FileReader,r=D(t);return t.readAsArrayBuffer(e),r}function M(e){var t=new FileReader,r=D(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=n?n[1]:"utf-8";return t.readAsText(e,s),r}function L(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function R(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:u.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:u.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u.arrayBuffer&&u.blob&&F(e)?(this._bodyArrayBuffer=R(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||C(e))?this._bodyArrayBuffer=R(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=O(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(u.blob)return this.blob().then(I);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=O(this);if(e)return e;if(this._bodyBlob)return M(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(L(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(z)}),this.json=function(){return this.text().then(JSON.parse)},this}var N=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function k(e){var t=e.toUpperCase();return N.indexOf(t)>-1?t:e}function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new i(t.headers)),this.method=k(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||(function(){if("AbortController"in a){var o=new AbortController;return o.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var s=/\?/;this.url+=(s.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})};function z(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),s=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(o))}}),t}function G(e){var t=new i,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
|
|
2
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var s=n.split(":"),o=s.shift().trim();if(o){var g=s.join(":").trim();try{t.append(o,g)}catch(x){console.warn("Response "+x.message)}}}),t}U.call(w.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}U.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var V=[301,302,303,307,308];c.redirect=function(e,t){if(V.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},h.DOMException=a.DOMException;try{new h.DOMException}catch{h.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},h.DOMException.prototype=Object.create(Error.prototype),h.DOMException.prototype.constructor=h.DOMException}function P(e,t){return new Promise(function(r,n){var s=new w(e,t);if(s.signal&&s.signal.aborted)return n(new h.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function g(){o.abort()}o.onload=function(){var f={statusText:o.statusText,headers:G(o.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(o.status<200||o.status>599)?f.status=200:f.status=o.status,f.url="responseURL"in o?o.responseURL:f.headers.get("X-Request-URL");var m="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(m,f))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){n(new h.DOMException("Aborted","AbortError"))},0)};function x(f){try{return f===""&&a.location.href?a.location.href:f}catch{return f}}if(o.open(s.method,x(s.url),!0),s.credentials==="include"?o.withCredentials=!0:s.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(u.blob?o.responseType="blob":u.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof i||a.Headers&&t.headers instanceof a.Headers)){var j=[];Object.getOwnPropertyNames(t.headers).forEach(function(f){j.push(v(f)),o.setRequestHeader(f,T(t.headers[f]))}),s.headers.forEach(function(f,m){j.indexOf(m)===-1&&o.setRequestHeader(m,f)})}else s.headers.forEach(function(f,m){o.setRequestHeader(m,f)});s.signal&&(s.signal.addEventListener("abort",g),o.onreadystatechange=function(){o.readyState===4&&s.signal.removeEventListener("abort",g)}),o.send(typeof s._bodyInit>"u"?null:s._bodyInit)})}return P.polyfill=!0,a.fetch||(a.fetch=P,a.Headers=i,a.Request=w,a.Response=c),h.Headers=i,h.Request=w,h.Response=c,h.fetch=P,h})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var l=b.fetch?b:y;d=l.fetch,d.default=l.fetch,d.fetch=l.fetch,d.Headers=l.Headers,d.Request=l.Request,d.Response=l.Response,_.exports=d})(E,E.exports)),E.exports}var S=Z();const J=$(S),Q=X({__proto__:null,default:J},[S]);export{Q as b};
|
package/assets/card-B1IEp2-a.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,j as s,p as t}from"./index-FpwHnbdV.js";const o=d("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);function c({raised:a,className:e,...r}){return s.jsx("div",{className:t("rounded-sm border border-line bg-surface",a?"bg-surface-raised shadow-sm":"",e),...r})}function i({className:a,...e}){return s.jsx("div",{className:t("px-4 pt-3 pb-2",a),...e})}function m({className:a,...e}){return s.jsx("h3",{className:t("text-md font-semibold text-fg",a),...e})}function p({className:a,...e}){return s.jsx("div",{className:t("px-4 pb-3 text-sm text-fg-muted",a),...e})}export{c as C,o as F,i as a,m as b,p as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c}from"./index-FpwHnbdV.js";const r=c("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{r as C};
|
package/assets/clock-C2olBfsH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c}from"./index-FpwHnbdV.js";const o=c("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);export{o as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-0DIPCtd6.js";import"./index-FpwHnbdV.js";import"./ErrorState-4TfgxGLk.js";import"./index-CYwsmjFx.js";import"./useMessageBodyContent-BOBb68Px.js";import"./useSignature-HAuR6_Ul.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DU11pzlc.js";import"./sections-DDQm-Sbc.js";import"./format-BSk7Do06.js";import"./confirm-dialog-B4KJVTQx.js";const C=o;export{C as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-0DIPCtd6.js";import"./index-FpwHnbdV.js";import"./ErrorState-4TfgxGLk.js";import"./index-CYwsmjFx.js";import"./useMessageBodyContent-BOBb68Px.js";import"./useSignature-HAuR6_Ul.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DU11pzlc.js";import"./sections-DDQm-Sbc.js";import"./format-BSk7Do06.js";import"./confirm-dialog-B4KJVTQx.js";const C=o;export{C as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-0DIPCtd6.js";import"./index-FpwHnbdV.js";import"./ErrorState-4TfgxGLk.js";import"./index-CYwsmjFx.js";import"./useMessageBodyContent-BOBb68Px.js";import"./useSignature-HAuR6_Ul.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DU11pzlc.js";import"./sections-DDQm-Sbc.js";import"./format-BSk7Do06.js";import"./confirm-dialog-B4KJVTQx.js";const C=o;export{C as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-0DIPCtd6.js";import"./index-FpwHnbdV.js";import"./ErrorState-4TfgxGLk.js";import"./index-CYwsmjFx.js";import"./useMessageBodyContent-BOBb68Px.js";import"./useSignature-HAuR6_Ul.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DU11pzlc.js";import"./sections-DDQm-Sbc.js";import"./format-BSk7Do06.js";import"./confirm-dialog-B4KJVTQx.js";const C=o;export{C as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,a1 as x,j as e,a2 as b,p as n}from"./index-FpwHnbdV.js";const h=({isOpen:s,title:r,description:a,confirmLabel:c,cancelLabel:d="Cancel",destructive:m=!1,isBusy:u=!1,onConfirm:f,onCancel:t})=>{const i=o.useRef(null);return x({id:"confirm-dialog",open:s,answers:{back:t}}),o.useEffect(()=>{if(!s)return;const l=document.activeElement instanceof HTMLElement?document.activeElement:null;return i.current?.focus(),()=>{l?.isConnected&&l.focus()}},[s]),s?e.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center",children:[e.jsx(b,{label:"Dismiss confirmation",onDismiss:t,className:"backdrop-blur-sm"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":r,className:n("relative z-10 w-full max-w-sm","bg-surface border border-line rounded-sm shadow-lg","p-6"),children:[e.jsx("h2",{className:"text-lg font-semibold",children:r}),a&&e.jsx("p",{className:"mt-2 text-sm text-fg-muted",children:a}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2",children:[e.jsx("button",{ref:i,type:"button",onClick:t,className:n("min-h-11 inline-flex items-center justify-center px-4 rounded text-sm font-medium transition-colors","border border-line hover:bg-surface-raised"),children:d}),e.jsx("button",{type:"button",onClick:f,disabled:u,className:n("min-h-11 inline-flex items-center justify-center px-4 rounded text-sm font-medium transition-colors",m?"bg-danger text-canvas hover:bg-danger/90":"bg-accent text-accent-fg hover:bg-accent-hover","disabled:opacity-50 disabled:cursor-not-allowed"),children:c})]})]})]}):null};export{h as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as o}from"./index-FpwHnbdV.js";const a=o("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);export{a as D};
|