@remit/web-client-dist 0.0.639 → 0.0.641
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-D1p8nleB.js +1 -0
- package/assets/{CalendarComposePane-C5loQEEz.js → CalendarComposePane-FU6MwnAy.js} +1 -1
- package/assets/{CalendarComposeSeed-B602bh7Z.js → CalendarComposeSeed-Ddue6yGg.js} +1 -1
- package/assets/{CalendarShell-BP7ONGRL.js → CalendarShell-ay8jVvby.js} +1 -1
- package/assets/{EmptyState-ClLPPGI1.js → EmptyState-DxT13qcR.js} +1 -1
- package/assets/{ErrorState-CX8jPS64.js → ErrorState-CHxEHbvf.js} +1 -1
- package/assets/FlaggedPane-CJ__xJpf.js +1 -0
- package/assets/{FullCompose-CgTCPbiG.js → FullCompose-DkV5Z3KV.js} +1 -1
- package/assets/MailListHeader-BZRxmnIb.js +7 -0
- package/assets/{MailNav-CFYn6k9r.js → MailNav-DBY9OW6Y.js} +1 -1
- package/assets/{MailShell-BnAscFqh.js → MailShell-LEDBmXGr.js} +1 -1
- package/assets/{MailViewChrome-BgP0RFzV.js → MailViewChrome-7gtXtr7X.js} +1 -1
- package/assets/MailboxPane-sccwyPwa.js +1 -0
- package/assets/{NavMenuButton-ggAVFYnQ.js → NavMenuButton-C3UDJB1v.js} +1 -1
- package/assets/{OnboardingWizard-CrpfDnhV.js → OnboardingWizard-DWrpEauO.js} +1 -1
- package/assets/{OpenCalendarEvent-C-aoRB9f.js → OpenCalendarEvent-B1DYETG7.js} +1 -1
- package/assets/OutboxPane-oxeCJEiZ.js +1 -0
- package/assets/_calendarObjectId-DpUi-YzJ.js +1 -0
- package/assets/_mailboxId-DW6pvCIw.js +1 -0
- package/assets/_messageId-BAQFECvK.js +1 -0
- package/assets/_messageId-BVnDwNl2.js +1 -0
- package/assets/_messageId-Bvuxe_8r.js +1 -0
- package/assets/_outboxMessageId-BjD8wilW.js +1 -0
- package/assets/_recurrenceId-DBx4vqgw.js +1 -0
- package/assets/_threadId-B5nqfV-L.js +1 -0
- package/assets/_threadId-CazI55hb.js +1 -0
- package/assets/_threadId-DUn5RY_Y.js +1 -0
- package/assets/{_view._date-8_v9V7g9.js → _view._date-Bpb6TKNU.js} +1 -1
- package/assets/{accounts-ezV4xN2p.js → accounts-D080vGx7.js} +1 -1
- package/assets/{advanced-CHdzXVPf.js → advanced-CkUEORb7.js} +1 -1
- package/assets/{appearance-Dzm_Xcwd.js → appearance-C7pPonlu.js} +1 -1
- package/assets/{attendee-row-DaC0cWu0.js → attendee-row-t7d1gEVn.js} +1 -1
- package/assets/{avatar-CMrR_WCW.js → avatar-C2R7xqlA.js} +1 -1
- package/assets/{bell-off-CjFQsmU0.js → bell-off-CD1iuAQA.js} +1 -1
- package/assets/{bottom-sheet-lVnXVWKS.js → bottom-sheet-DZ2d0h_L.js} +1 -1
- package/assets/{brief-B2hZLxBG.js → brief-BVo4rf_J.js} +1 -1
- package/assets/brief-CH-e1O9N.js +1 -0
- package/assets/{browser-ponyfill-_Ty7DcLK.js → browser-ponyfill-BdQcytd0.js} +2 -2
- package/assets/{bug-ysY2Lcys.js → bug-DI9j6s_O.js} +1 -1
- package/assets/{calendar-CozJzlZZ.js → calendar-0_V8JbUq.js} +1 -1
- package/assets/{calendar-clash-strip-DH-rkJMi.js → calendar-clash-strip-AV6ir0kb.js} +1 -1
- package/assets/{calendar-format-CHntutZg.js → calendar-format-CyOmp12n.js} +1 -1
- package/assets/{calendar-report-DAUzkHX3.js → calendar-report-rx459ZNk.js} +1 -1
- package/assets/{calendar-suggestion-CaACTNVX.js → calendar-suggestion-OndzGSan.js} +1 -1
- package/assets/{calendars-CYKvOlYj.js → calendars-Dav4B8o3.js} +1 -1
- package/assets/{card-ChUQkNyW.js → card-hG_Il7pd.js} +1 -1
- package/assets/{checkbox-lv4ht1p0.js → checkbox-B_JY_6mN.js} +1 -1
- package/assets/chevron-left-D3r7M2xH.js +1 -0
- package/assets/{circle-check-CmZH70G9.js → circle-check-Cmp8Rqlz.js} +1 -1
- package/assets/{circle-check-big-DsPxeo1f.js → circle-check-big-B9Ca4u10.js} +1 -1
- package/assets/{circle-help-CxlWBIxf.js → circle-help-Cmc2Km1C.js} +1 -1
- package/assets/{clock-BQFlXobK.js → clock-DC78l7yK.js} +1 -1
- package/assets/compose._-_outboxMessageId_-Bt9J2-qp.js +1 -0
- package/assets/compose._-_outboxMessageId_-C1FaW9o1.js +1 -0
- package/assets/compose._-_outboxMessageId_-D5zB1ABW.js +1 -0
- package/assets/compose._-_outboxMessageId_-R5L6KgB1.js +1 -0
- package/assets/{config-import-CO5AR73r.js → config-import-hoC0Y2SG.js} +1 -1
- package/assets/{confirm-dialog-DM1V3tLO.js → confirm-dialog-CCDHX_6Q.js} +1 -1
- package/assets/{copy-D9w0yOJZ.js → copy-B0aWQGDa.js} +1 -1
- package/assets/{credential-steps-8oD-bgsd.js → credential-steps-uXZK9Zmr.js} +1 -1
- package/assets/{download-D3c-jAvE.js → download-D3fQ48lB.js} +1 -1
- package/assets/{file-json-DgAW6fCg.js → file-json-CCQAXfEc.js} +1 -1
- package/assets/{filters-COsyZM0t.js → filters-DjsJshjt.js} +1 -1
- package/assets/{flagged-PvSBYoZf.js → flagged-DU9q4oil.js} +1 -1
- package/assets/flagged-Q3VMHIjI.js +1 -0
- package/assets/{folders-9bvPOa--.js → folders-EdBrFHzG.js} +1 -1
- package/assets/{help-copy-Bfcrl0wG.js → help-copy-BFATWnBQ.js} +1 -1
- package/assets/{import-CZn1xOPk.js → import-wN7xkLN8.js} +1 -1
- package/assets/index-B3qUW5A0.js +1 -0
- package/assets/index-BAQFECvK.js +1 -0
- package/assets/index-BUYR1pAl.js +1 -0
- package/assets/index-Bvuxe_8r.js +1 -0
- package/assets/{index-BOf0CjTQ.css → index-C5Dozv2m.css} +1 -1
- package/assets/index-CxIBpGfW.js +1 -0
- package/assets/index-D9CK5EEZ.js +1 -0
- package/assets/index-DE-NAKWZ.js +57 -0
- package/assets/index-DFpWp13S.js +1 -0
- package/assets/{index-J89guRVU.js → index-DKo99WG1.js} +64 -64
- package/assets/{index-COLU2y0-.js → index-DY5mGxwG.js} +1 -1
- package/assets/index-EsGaYQlh.js +1 -0
- package/assets/index-p4X-Ys_z.js +1 -0
- package/assets/{kbd-CKw25IK5.js → kbd-xYIrsDlz.js} +1 -1
- package/assets/{labels-CfHv29D2.js → labels-CToNdujY.js} +1 -1
- package/assets/{mail-5fD0jufv.js → mail-CFqLOB4w.js} +1 -1
- package/assets/{mail-Daw23XZE.js → mail-DxfGucaQ.js} +1 -1
- package/assets/{menu-lOydIsUw.js → menu-u9D-cJXQ.js} +1 -1
- package/assets/minus-Bnr4gKCE.js +1 -0
- package/assets/{new-Bx8aW3eQ.js → new-DarKu0Ji.js} +1 -1
- package/assets/onboarding-DRQo7PkQ.js +1 -0
- package/assets/{onboarding-completion-Dyuup5X9.js → onboarding-completion-DK9cy93Q.js} +1 -1
- package/assets/outbox-BJK9d-c1.js +1 -0
- package/assets/{pane-header-CKSUzAfS.js → pane-header-DmEVnHem.js} +1 -1
- package/assets/{pencil-mpUWk0sq.js → pencil-hPJlTnvS.js} +1 -1
- package/assets/{popover-menu-Cl-N1YPe.js → popover-menu-BDeljNyh.js} +1 -1
- package/assets/{refresh-cw-D2y2CKsF.js → refresh-cw-DNbEUXcm.js} +1 -1
- package/assets/rich-text-CQJUj3SY.js +30 -0
- package/assets/{rich-text-spellcheck-worker-provider-DrY6X3cn.js → rich-text-spellcheck-worker-provider-YjewF802.js} +1 -1
- package/assets/{rotate-ccw-86rVy6Oh.js → rotate-ccw-DFe52ITT.js} +1 -1
- package/assets/{roving-focus-CzTCkI7v.js → roving-focus-DWecg5C9.js} +1 -1
- package/assets/{row-actions-C0iitOlE.js → row-actions-Cp8U_ugi.js} +1 -1
- package/assets/{search-mirror-BlS_Ifso.js → search-mirror-CjZ7cATA.js} +1 -1
- package/assets/{search-token-index-BXCXhECA.js → search-token-index-DL0AoAlj.js} +1 -1
- package/assets/{sections-CmVNNIn5.js → sections-DDBMQxXz.js} +1 -1
- package/assets/{senders-D9KOa6tO.js → senders-Di3Hbnh-.js} +1 -1
- package/assets/settings-CFMotOQ7.js +1 -0
- package/assets/{settings-screen-CPKUaFTz.js → settings-screen-v6xny9wU.js} +1 -1
- package/assets/{shield-check-Bz65Alvp.js → shield-check-BgoZBruM.js} +1 -1
- package/assets/{suggested-vips-jAg1lHBx.js → suggested-vips-C6Pc81iu.js} +1 -1
- package/assets/{undo-2-C5A6ikAQ.js → undo-2-nUyUEATC.js} +1 -1
- package/assets/{useCalendarData-Di1HMX87.js → useCalendarData-4YBnFK2x.js} +1 -1
- package/assets/{useCalendarWrites-B_iDGi_d.js → useCalendarWrites-qcdW_JmG.js} +1 -1
- package/assets/{useCalendars-Du8oLBQy.js → useCalendars-sfh2BICi.js} +1 -1
- package/assets/{useDebouncedValue-Cyjl5fcM.js → useDebouncedValue-Bq8RVLfv.js} +1 -1
- package/assets/{useFilters-Dn74lJWT.js → useFilters-zXsB3pIM.js} +1 -1
- package/assets/{useLabels-Bhad46sq.js → useLabels-xQerI8AK.js} +1 -1
- package/assets/{useLayoutTier-I-ZeE96x.js → useLayoutTier-C1kzvb61.js} +1 -1
- package/assets/useMessageBodyContent-BRyDdu_J.js +1 -0
- package/assets/{useQueries-Ch9XYsKm.js → useQueries-CY9FUcC8.js} +1 -1
- package/assets/{useRefreshControl-sKR2_udi.js → useRefreshControl-DKJ_Eyfn.js} +1 -1
- package/assets/{useResultFolderIndex-CizpN02R.js → useResultFolderIndex-BFXa90Ay.js} +1 -1
- package/assets/{useSearchTokenContext-Dl9jDzQw.js → useSearchTokenContext-C0_GGpQj.js} +3 -3
- package/assets/{useSemanticSearch-NkagUfNs.js → useSemanticSearch-lVNhyaIe.js} +1 -1
- package/assets/{useSignature-z9_OAiTD.js → useSignature-CR4J3Q1V.js} +1 -1
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/BriefPane-CdiCvSuF.js +0 -1
- package/assets/FlaggedPane-CD2pUbFg.js +0 -1
- package/assets/MailListHeader-C8fUfLdY.js +0 -7
- package/assets/MailboxPane-CG-dcZ55.js +0 -1
- package/assets/OutboxPane-CM3kwG8i.js +0 -1
- package/assets/_calendarObjectId-UmX8K95N.js +0 -1
- package/assets/_mailboxId-DRa01xOQ.js +0 -1
- package/assets/_messageId-BMOloRC2.js +0 -1
- package/assets/_messageId-UrdBJAzT.js +0 -1
- package/assets/_messageId-s6b1mjWq.js +0 -1
- package/assets/_outboxMessageId-C8DuFjhs.js +0 -1
- package/assets/_recurrenceId-qf3rXRrq.js +0 -1
- package/assets/_threadId-CkqELJtN.js +0 -1
- package/assets/_threadId-DdjdPPV9.js +0 -1
- package/assets/_threadId-Dehzj5sp.js +0 -1
- package/assets/brief-CbnxY4As.js +0 -1
- package/assets/chevron-left-BnXYRBLM.js +0 -1
- package/assets/compose._-_outboxMessageId_-BFJxAVoN.js +0 -1
- package/assets/compose._-_outboxMessageId_-Bth4jzBG.js +0 -1
- package/assets/compose._-_outboxMessageId_-C8FGmbP_.js +0 -1
- package/assets/compose._-_outboxMessageId_-Kpi3RLY9.js +0 -1
- package/assets/flagged-DKGPYmqT.js +0 -1
- package/assets/index-BMOloRC2.js +0 -1
- package/assets/index-BNf6kiaX.js +0 -55
- package/assets/index-BT8lpC7o.js +0 -1
- package/assets/index-B_EiAJWG.js +0 -1
- package/assets/index-C3ge01DK.js +0 -1
- package/assets/index-Ca6ZI10M.js +0 -1
- package/assets/index-CpzmW4H6.js +0 -1
- package/assets/index-DLln0xg-.js +0 -1
- package/assets/index-Ncy8w6TK.js +0 -1
- package/assets/index-UrdBJAzT.js +0 -1
- package/assets/minus-oqpCotLr.js +0 -1
- package/assets/onboarding-CeRgXqq1.js +0 -1
- package/assets/outbox-ughpF9_W.js +0 -1
- package/assets/rich-text-D3O6tZw_.js +0 -30
- package/assets/settings-CGcDDxqi.js +0 -1
- package/assets/useMessageBodyContent-Bl5Y6AAH.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aa as v,j as s,r as u,al as l,am as p}from"./index-
|
|
1
|
+
import{aa as v,j as s,r as u,al as l,am as p}from"./index-DKo99WG1.js";import{F as x}from"./FullCompose-DkV5Z3KV.js";import{a as m}from"./useMessageBodyContent-BRyDdu_J.js";function S(o,n,r){if(o!==n)return r}function d(o,n){return o===""?"":n}function j({searchInput:o,committedQuery:n,urlQuery:r,pathname:a,listPath:t}){return!v(a,t)||n!==o?!1:n!==r}const c=u.createContext(null),C=({chrome:o,children:n})=>s.jsx(c.Provider,{value:o,children:n});function M({phone:o,list:n,reading:r,intelligence:a,hasThread:t=!1}){const e=u.useContext(c),f=m();if(!e)return s.jsx(l,{});const i={nav:e.nav,overlay:e.overlay,skeleton:s.jsx(l,{}),isLoading:e.isLoading,navOpen:e.navOpen,onOpenNav:e.onOpenNav,onCloseNav:e.onCloseNav};return e.isSinglePane?s.jsx(p,{...i,list:f?s.jsx(x,{}):o,intelligenceOpen:e.intelligenceOpen}):s.jsx(p,{...i,topBar:e.topBar,list:n,reading:r,intelligence:a,intelligenceOpen:e.intelligenceOpen,hasThread:t})}export{C as M,M as a,j as b,d as c,S as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,L as le,f as $,a0 as ue,r as g,t as K,aB as de,a3 as fe,d8 as me,c6 as xe,eg as ge,eh as he,ei as pe,C as be,ej as ve,d9 as je}from"./index-J89guRVU.js";import{j as we,n as Ne}from"./search-token-index-BXCXhECA.js";import{u as ye,L as Q}from"./roving-focus-CzTCkI7v.js";import{a8 as Pe,a9 as Re,c as Ce,C as G,aa as Se,m as Ee,ab as Me,ac as ke,ad as Ie,ae as Le,af as Te,ag as ee,ah as ze}from"./MailListHeader-C8fUfLdY.js";import{A as Ae}from"./avatar-CMrR_WCW.js";import{M as Oe}from"./mail-Daw23XZE.js";import{R as De}from"./refresh-cw-D2y2CKsF.js";import{M as $e}from"./menu-lOydIsUw.js";function _e(){return s.jsx("div",{className:"space-y-0",role:"status","aria-busy":"true","aria-label":"Loading messages",children:Array.from({length:8}).map((e,t)=>s.jsxs("div",{className:"animate-pulse border-b border-line px-3 py-2",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("div",{className:"h-4 w-32 rounded bg-surface-sunken"}),s.jsx("div",{className:"h-3 w-16 rounded bg-surface-sunken"})]}),s.jsx("div",{className:"mb-2 h-4 w-48 rounded bg-surface-sunken"}),s.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]},t))})}function Fe({filter:e,scopeLabel:t,searchQuery:n}){const u=n?.trim();return e?s.jsxs(q,{children:[s.jsx("p",{className:"font-medium text-fg",children:Be(e.label,t,u)}),s.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:He[e.reach]}),s.jsx($,{variant:"secondary",size:"sm",className:"mt-4",onClick:e.onClear,children:"Clear filter"})]}):s.jsx(q,{children:s.jsx("p",{className:"text-fg-muted",children:Xe(u,t)})})}const He={"whole-folder":"Every message in this folder was checked.","loaded-pages":"Only the messages loaded so far were checked."};function Xe(e,t){return e?"No messages match your search":t?`No messages in ${t}`:"No messages in this mailbox"}function Be(e,t,n){return n?`No results for “${n}” in ${e}`:t?`No ${e} in ${t}`:`No ${e}`}function q({children:e}){return s.jsx("div",{className:"flex h-full flex-1 items-center justify-center",children:s.jsx("div",{className:"flex max-w-sm flex-col items-center justify-center p-8 text-center",children:e})})}function us(){return s.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-sm text-fg-muted",role:"status","aria-live":"polite",children:[s.jsx(le,{className:"size-4 animate-spin","aria-hidden":"true"}),s.jsx("span",{children:"Loading more…"})]})}function Ue({message:e="Something went wrong loading this mailbox.",onRetry:t,onReport:n}){return s.jsx("div",{className:"flex h-full flex-1 items-center justify-center p-4",children:s.jsxs("div",{role:"alert",className:"flex max-w-sm flex-col items-center justify-center gap-3 text-center",children:[s.jsx(ue,{className:"size-8 text-danger","aria-hidden":"true"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-danger",children:"Couldn't load messages"}),s.jsx("p",{className:"mt-1 break-words text-sm text-fg-muted",children:e})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx($,{variant:"secondary",size:"sm",onClick:t,children:"Retry"}),n&&s.jsx($,{variant:"ghost",size:"sm",onClick:n,children:"Report a problem"})]})]})})}const L=72,V=10,We=L/2,J="__swipeableRowAxisCancel";function Z(e){return e==="leading"?L:e==="trailing"?-L:0}function Ye(e){return e>=L/2?"leading":e<=-L/2?"trailing":"none"}function Ke({thread:e,selectionMode:t,checked:n,active:u,peek:f,onPeek:c,onToggleCheck:p,onLongPress:w,onOpen:b,onAct:v}){const x=g.useRef(null),[j,h]=g.useState(null),{longPressProps:P}=Pe({onLongPress:w,isDisabled:t,accessibilityDescription:"Select message"}),S=i=>{const o=new PointerEvent("pointercancel",{bubbles:!0});o[J]=!0,i.currentTarget.dispatchEvent(o)},r=Re(P,{onPointerDown:i=>{x.current={startX:i.clientX,startY:i.clientY,axis:"none",escaped:!1}},onPointerMove:i=>{if(t)return;const o=x.current;if(!o)return;const m=i.clientX-o.startX,M=i.clientY-o.startY;if(o.axis==="none"&&(Math.abs(M)>V&&Math.abs(M)>Math.abs(m)?o.axis="vertical":Math.abs(m)>V&&Math.abs(m)>Math.abs(M)&&(o.axis="horizontal",i.currentTarget.setPointerCapture(i.pointerId))),o.axis==="none")return;const T=o.axis==="horizontal"?Math.abs(m):Math.abs(M);if(!o.escaped&&T>We&&(o.escaped=!0,S(i)),o.axis!=="horizontal")return;const F=Z(f),H=Math.max(-L,Math.min(L,F+m));h(H)},onPointerUp:i=>{const o=x.current;x.current=null;const m=j;if(h(null),!!o){if(o.axis!=="none"&&!o.escaped&&S(i),o.axis==="horizontal"){m!==null&&c(Ye(m));return}if(o.axis!=="vertical"){if(t){p();return}if(f!=="none"){c("none");return}b()}}},onPointerCancel:i=>{i.nativeEvent[J]||(x.current=null,h(null))}}),d=j??Z(f),y=d>0?"leading":d<0?"trailing":"none",R=K("relative touch-pan-y bg-surface","select-none",Ce({active:n||u})),A={transform:d!==0?`translateX(${d}px)`:void 0,transition:j===null?"transform 150ms ease":"none",minHeight:44},_=!e.isRead,I=i=>i.stopPropagation(),O=t?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:K("inline-flex size-7 shrink-0 items-center justify-center rounded-full border",n?"border-accent bg-accent text-accent-fg":"border-line-strong bg-canvas"),children:n&&s.jsx(de,{className:"size-3.5"})}),s.jsx(G,{thread:e})]}):s.jsxs(s.Fragment,{children:[_&&s.jsx("span",{className:"absolute left-1.5 top-1/2 size-1.5 -translate-y-1/2 rounded-full bg-accent"}),s.jsx("span",{role:"checkbox",tabIndex:0,"aria-checked":n,"aria-label":`Select message from ${e.fromName}`,onPointerDown:I,onPointerMove:I,onPointerUp:I,onClick:i=>{i.preventDefault(),i.stopPropagation(),w()},onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),i.stopPropagation(),w())},className:"-m-2 inline-flex size-11 shrink-0 items-center justify-center rounded-full",children:s.jsx(Ae,{name:e.fromName,email:e.fromEmail,size:"sm"})}),s.jsx(G,{thread:e})]});return s.jsxs("div",{className:"relative overflow-hidden",children:[y==="leading"&&s.jsx("button",{type:"button",onClick:()=>v("leading"),"aria-label":e.isRead?"Mark as unread":"Mark as read",className:"absolute inset-y-0 left-0 flex items-center justify-start bg-accent-2 px-6 text-accent-fg",children:e.isRead?s.jsx(Oe,{className:"size-6"}):s.jsx(Se,{className:"size-6"})}),y==="trailing"&&s.jsx("button",{type:"button",onClick:()=>v("trailing"),"aria-label":"Delete message",className:"absolute inset-y-0 right-0 flex items-center justify-end bg-danger px-6 text-canvas",children:s.jsx(fe,{className:"size-6"})}),s.jsx("button",{type:"button",role:t?"checkbox":void 0,"aria-checked":t?n:void 0,"data-message-row":!0,"data-message-id":e.id,...r,className:R,style:A,children:O})]})}function Qe({sections:e,selectedThreadId:t,selectionMode:n,checkedIds:u,initialPeek:f,onToggleCheck:c,onEnterSelection:p,onOpenThread:w,onRefresh:b,refreshing:v,busy:x=!1}){const[j,h]=g.useState(new Set),[P,S]=g.useState(new Map),N=e.flatMap(r=>r.threads).filter(r=>!j.has(r.id)).map(r=>{const d=P.get(r.id);return d===void 0?r:{...r,isRead:d}}),[E,C]=g.useState(f&&f!=="none"&&N[1]?{id:N[1].id,side:f}:null),k=(r,d)=>{if(d==="trailing")h(y=>new Set(y).add(r));else{const y=N.find(R=>R.id===r);S(R=>new Map(R).set(r,!y?.isRead))}C(null)};return s.jsxs("div",{className:"flex-1 overflow-y-auto",children:[v&&s.jsxs("div",{className:"flex items-center justify-center gap-2 border-b border-line py-3 text-fg-muted",children:[s.jsx(De,{className:"size-4 animate-spin"}),s.jsx("span",{className:"text-xs",children:"Checking for new mail…"})]}),s.jsx("div",{className:"divide-y divide-line",children:N.map(r=>s.jsx("div",{className:x?"pointer-events-none opacity-50":void 0,children:s.jsx(Ke,{thread:r,selectionMode:n,checked:u.has(r.id),active:r.id===t,peek:E?.id===r.id?E.side:"none",onPeek:d=>C(d==="none"?null:{id:r.id,side:d}),onToggleCheck:()=>c(r.id),onLongPress:()=>p(r.id),onOpen:()=>w(r.id),onAct:d=>k(r.id,d)})},r.id))}),!n&&!v&&!x&&s.jsx("button",{type:"button",onClick:b,className:"w-full border-t border-line py-2 text-center text-2xs text-fg-subtle transition-colors hover:bg-surface-sunken",children:"Pull to refresh"})]})}const Ge=new Set;function ds({listTitle:e,listMeta:t,sections:n,briefFilters:u,flatList:f,listState:c="ready",searchQuery:p,listFilter:w,listScopeLabel:b,errorMessage:v,onRetry:x,onReportError:j,briefFilter:h,selectedThreadId:P,density:S="comfortable",onSelectThread:N,onOpenNav:E,isDesktop:C,initialTouchState:k,selection:r,keyboard:d,selectionBar:y,paneOverlay:R,listBody:A,hideHeader:_=!1}){const I=S==="compact"?ke:Ie,O=g.useRef(null),i=g.useRef(null),o=me(d);ye({containerRef:O,itemSelector:Q,enabled:!o});const m=o?d.focusedId:void 0,M=o?m??n[0]?.threads[0]?.id:void 0,T=g.useCallback(a=>M===void 0?void 0:a===M?0:-1,[M]);g.useEffect(()=>{if(m===void 0)return;const a=i.current;if(!a)return;const l=a.querySelector(`${Q}[data-message-id="${m}"]`);!l||l===a.ownerDocument.activeElement||l.focus({preventScroll:!1})},[m]),g.useEffect(()=>{if(!o)return;const a=i.current;if(!a)return;const l=a.ownerDocument.activeElement;l!==null&&l!==a.ownerDocument.body||a.focus({preventScroll:!0})},[o]);const F=!C&&!u&&c==="ready",[H,W]=g.useState(!1),ae=k==="peek-trailing"?"trailing":k==="peek-leading"?"leading":void 0,re=()=>{W(!0),setTimeout(()=>W(!1),1400)},D=r?.selectedIds??Ge,z=r?.onToggle,Y=r?.onRowSelect,ie=Ee(D.size,C),X=g.useCallback(a=>{if(z)return{checked:D.has(a),onToggle:l=>{l.preventDefault(),l.stopPropagation(),z(a)}}},[D,z]),B=g.useCallback((a,l)=>Y?.(a,Me(l))?(l.preventDefault(),l.shiftKey&&window.getSelection()?.removeAllRanges(),!0):!1,[Y]),oe=g.useCallback(({thread:a,active:l,onClick:U})=>s.jsx(I,{thread:a,active:l,focused:a.id===m,tabIndex:T(a.id),selection:X(a.id),onClick:ce=>{B(a.id,ce)||U?.()}}),[I,X,B,m,T]);return s.jsxs("section",{ref:a=>{i.current=a,d?.ref(a)},tabIndex:o?-1:void 0,className:"relative flex h-full w-full flex-col bg-surface outline-none",children:[y??(_?null:s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[E&&s.jsx($,{variant:"ghost",size:"sm",icon:s.jsx($e,{className:"size-4"}),onClick:E,"aria-label":"Open folders",className:"-ml-1 shrink-0"}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:e}),t&&s.jsx("span",{className:"shrink-0 text-2xs text-fg-subtle",children:t})]})),c==="loading"?s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsx(_e,{})}):c==="empty"?s.jsx(Fe,{filter:w,scopeLabel:b,searchQuery:p}):c==="error"?s.jsx(Ue,{message:v,onRetry:x,onReport:j}):u&&h?s.jsx(Le,{...h,sections:n,selectedThreadId:P,Row:oe,keyboard:d,onSelectThread:N}):A??(F?s.jsx(Qe,{sections:n,selectedThreadId:P,selectionMode:ie,checkedIds:D,initialPeek:ae,onToggleCheck:a=>z?.(a),onEnterSelection:a=>z?.(a),onOpenThread:a=>N?.(a),onRefresh:re,refreshing:H}):s.jsx("div",{ref:O,className:"flex-1 overflow-y-auto",children:n.map(a=>s.jsxs("div",{children:[!f&&a.label&&s.jsxs("div",{className:"sticky top-0 flex h-section-row items-center justify-between border-b border-line bg-surface-sunken px-row-inset",children:[s.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:a.label}),s.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:a.threads.length})]}),s.jsx("div",{className:"divide-y divide-line",children:a.threads.map(l=>s.jsx(I,{thread:l,active:l.id===P,focused:l.id===m,tabIndex:T(l.id),selection:X(l.id),onClick:U=>{B(l.id,U)||N?.(l.id)}},l.id))})]},a.id))})),C&&s.jsx(Te,{hints:d?Ne(d.handlers):we}),R]})}var qe=class extends xe{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:f,isRefetching:c,isError:p,isRefetchError:w}=u,b=n.fetchMeta?.fetchMore?.direction,v=p&&b==="forward",x=f&&b==="forward",j=p&&b==="backward",h=f&&b==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:he(t,n.data),hasPreviousPage:ge(t,n.data),isFetchNextPageError:v,isFetchingNextPage:x,isFetchPreviousPageError:j,isFetchingPreviousPage:h,isRefetchError:w&&!v&&!j,isRefetching:c&&!x&&!h}}};function fs(e,t){return pe(e,qe)}const se={dimension:"read",position:"pre",text:"unread"},Ve={dimension:"read",position:"pre",text:"read"},te={dimension:"starred",position:"pre",text:"starred"},ne={dimension:"attachment",position:"post",text:"with an attachment"},Je=[["unread",se],["flagged",te],["attachment",ne]],Ze=e=>{switch(e.type){case"category":return{dimension:"category",position:"pre",text:ee(e.category)??e.value};case"isUnread":return se;case"isRead":return Ve;case"isStarred":return te;case"hasAttachment":return ne;case"from":return{dimension:e.raw,position:"post",text:`from ${e.value}`};case"subject":return{dimension:e.raw,position:"post",text:`about “${e.value}”`};case"before":return{dimension:e.raw,position:"post",text:`sent before ${e.value}`};case"after":return{dimension:e.raw,position:"post",text:`sent on or after ${e.value}`};case"in":return{dimension:e.raw,position:"post",text:`in ${e.value}`};case"account":return{dimension:e.raw,position:"post",text:`in the ${e.value} account`}}},es=(e,t)=>{const n=new Map,u=c=>{n.has(c.dimension)||n.set(c.dimension,c)},f=ee(e.category);f&&u({dimension:"category",position:"pre",text:f});for(const[c,p]of Je)e.attributes.has(c)&&u(p);for(const c of t)u(Ze(c));return[...n.values()]},ss=(e,t)=>{const n=es(e,t);if(n.length===0)return;const u=f=>n.filter(c=>c.position===f).map(c=>c.text);return[...u("pre"),"mail",...u("post")].join(" ")},ms=({chips:e,tokens:t,reach:n,onClear:u})=>{const f=ss(e,t);if(f)return{label:f,reach:n,onClear:u}};function xs({title:e,unreadCount:t,preset:n,selectedCategory:u,activeFilters:f,onSelectCategory:c,onToggleFilter:p,onSelectSource:w,onClearFilters:b,children:v,footer:x,searchResults:j,searchLoading:h,relatedResults:P,relatedLoading:S,onSelectSearchResult:N,searchResultsLabel:E,relatedResultsLabel:C,searchResultsInBody:k,refreshControl:r}){const{searchInput:d}=be(),y=d.trim().length>0,R={categories:n.categories,filters:n.filters,sources:n.sources,selectedCategory:u,activeFilters:f,onSelectCategory:c,onSelectSource:w,onToggleFilter:p,onClear:b};return s.jsx(ve,{hasSheet:!y,children:s.jsx(ze,{title:e,unreadCount:t,footer:x,searchFilter:R,searchResults:j,searchLoading:h,relatedResults:P,relatedLoading:S,onSelectSearchResult:N,searchResultsLabel:E,relatedResultsLabel:C,searchResultsInBody:k,refreshControl:r,children:s.jsx(je,{...R,hideChrome:y,children:v})})})}export{us as M,Ke as S,ds as a,xs as b,ms as l,fs as u};
|
|
1
|
+
import{j as s,L as le,f as $,a0 as ue,r as g,t as K,aB as de,a3 as fe,d9 as me,c6 as xe,eh as ge,ei as he,ej as pe,C as be,ek as ve,da as je}from"./index-DKo99WG1.js";import{j as we,n as Ne}from"./search-token-index-DL0AoAlj.js";import{u as ye,L as Q}from"./roving-focus-DWecg5C9.js";import{a9 as Pe,aa as Re,c as Ce,C as G,ab as Se,m as Ee,ac as Me,ad as ke,ae as Ie,af as Le,ag as Te,ah as ee,ai as ze}from"./MailListHeader-BZRxmnIb.js";import{A as Ae}from"./avatar-C2R7xqlA.js";import{M as Oe}from"./mail-DxfGucaQ.js";import{R as De}from"./refresh-cw-DNbEUXcm.js";import{M as $e}from"./menu-u9D-cJXQ.js";function _e(){return s.jsx("div",{className:"space-y-0",role:"status","aria-busy":"true","aria-label":"Loading messages",children:Array.from({length:8}).map((e,t)=>s.jsxs("div",{className:"animate-pulse border-b border-line px-3 py-2",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("div",{className:"h-4 w-32 rounded bg-surface-sunken"}),s.jsx("div",{className:"h-3 w-16 rounded bg-surface-sunken"})]}),s.jsx("div",{className:"mb-2 h-4 w-48 rounded bg-surface-sunken"}),s.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]},t))})}function Fe({filter:e,scopeLabel:t,searchQuery:n}){const u=n?.trim();return e?s.jsxs(q,{children:[s.jsx("p",{className:"font-medium text-fg",children:Be(e.label,t,u)}),s.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:He[e.reach]}),s.jsx($,{variant:"secondary",size:"sm",className:"mt-4",onClick:e.onClear,children:"Clear filter"})]}):s.jsx(q,{children:s.jsx("p",{className:"text-fg-muted",children:Xe(u,t)})})}const He={"whole-folder":"Every message in this folder was checked.","loaded-pages":"Only the messages loaded so far were checked."};function Xe(e,t){return e?"No messages match your search":t?`No messages in ${t}`:"No messages in this mailbox"}function Be(e,t,n){return n?`No results for “${n}” in ${e}`:t?`No ${e} in ${t}`:`No ${e}`}function q({children:e}){return s.jsx("div",{className:"flex h-full flex-1 items-center justify-center",children:s.jsx("div",{className:"flex max-w-sm flex-col items-center justify-center p-8 text-center",children:e})})}function us(){return s.jsxs("div",{className:"flex items-center justify-center gap-2 py-4 text-sm text-fg-muted",role:"status","aria-live":"polite",children:[s.jsx(le,{className:"size-4 animate-spin","aria-hidden":"true"}),s.jsx("span",{children:"Loading more…"})]})}function Ue({message:e="Something went wrong loading this mailbox.",onRetry:t,onReport:n}){return s.jsx("div",{className:"flex h-full flex-1 items-center justify-center p-4",children:s.jsxs("div",{role:"alert",className:"flex max-w-sm flex-col items-center justify-center gap-3 text-center",children:[s.jsx(ue,{className:"size-8 text-danger","aria-hidden":"true"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-danger",children:"Couldn't load messages"}),s.jsx("p",{className:"mt-1 break-words text-sm text-fg-muted",children:e})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx($,{variant:"secondary",size:"sm",onClick:t,children:"Retry"}),n&&s.jsx($,{variant:"ghost",size:"sm",onClick:n,children:"Report a problem"})]})]})})}const L=72,V=10,We=L/2,J="__swipeableRowAxisCancel";function Z(e){return e==="leading"?L:e==="trailing"?-L:0}function Ye(e){return e>=L/2?"leading":e<=-L/2?"trailing":"none"}function Ke({thread:e,selectionMode:t,checked:n,active:u,peek:f,onPeek:c,onToggleCheck:p,onLongPress:w,onOpen:b,onAct:v}){const x=g.useRef(null),[j,h]=g.useState(null),{longPressProps:P}=Pe({onLongPress:w,isDisabled:t,accessibilityDescription:"Select message"}),S=i=>{const o=new PointerEvent("pointercancel",{bubbles:!0});o[J]=!0,i.currentTarget.dispatchEvent(o)},r=Re(P,{onPointerDown:i=>{x.current={startX:i.clientX,startY:i.clientY,axis:"none",escaped:!1}},onPointerMove:i=>{if(t)return;const o=x.current;if(!o)return;const m=i.clientX-o.startX,M=i.clientY-o.startY;if(o.axis==="none"&&(Math.abs(M)>V&&Math.abs(M)>Math.abs(m)?o.axis="vertical":Math.abs(m)>V&&Math.abs(m)>Math.abs(M)&&(o.axis="horizontal",i.currentTarget.setPointerCapture(i.pointerId))),o.axis==="none")return;const T=o.axis==="horizontal"?Math.abs(m):Math.abs(M);if(!o.escaped&&T>We&&(o.escaped=!0,S(i)),o.axis!=="horizontal")return;const F=Z(f),H=Math.max(-L,Math.min(L,F+m));h(H)},onPointerUp:i=>{const o=x.current;x.current=null;const m=j;if(h(null),!!o){if(o.axis!=="none"&&!o.escaped&&S(i),o.axis==="horizontal"){m!==null&&c(Ye(m));return}if(o.axis!=="vertical"){if(t){p();return}if(f!=="none"){c("none");return}b()}}},onPointerCancel:i=>{i.nativeEvent[J]||(x.current=null,h(null))}}),d=j??Z(f),y=d>0?"leading":d<0?"trailing":"none",R=K("relative touch-pan-y bg-surface","select-none",Ce({active:n||u})),A={transform:d!==0?`translateX(${d}px)`:void 0,transition:j===null?"transform 150ms ease":"none",minHeight:44},_=!e.isRead,I=i=>i.stopPropagation(),O=t?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:K("inline-flex size-7 shrink-0 items-center justify-center rounded-full border",n?"border-accent bg-accent text-accent-fg":"border-line-strong bg-canvas"),children:n&&s.jsx(de,{className:"size-3.5"})}),s.jsx(G,{thread:e})]}):s.jsxs(s.Fragment,{children:[_&&s.jsx("span",{className:"absolute left-1.5 top-1/2 size-1.5 -translate-y-1/2 rounded-full bg-accent"}),s.jsx("span",{role:"checkbox",tabIndex:0,"aria-checked":n,"aria-label":`Select message from ${e.fromName}`,onPointerDown:I,onPointerMove:I,onPointerUp:I,onClick:i=>{i.preventDefault(),i.stopPropagation(),w()},onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),i.stopPropagation(),w())},className:"-m-2 inline-flex size-11 shrink-0 items-center justify-center rounded-full",children:s.jsx(Ae,{name:e.fromName,email:e.fromEmail,size:"sm"})}),s.jsx(G,{thread:e})]});return s.jsxs("div",{className:"relative overflow-hidden",children:[y==="leading"&&s.jsx("button",{type:"button",onClick:()=>v("leading"),"aria-label":e.isRead?"Mark as unread":"Mark as read",className:"absolute inset-y-0 left-0 flex items-center justify-start bg-accent-2 px-6 text-accent-fg",children:e.isRead?s.jsx(Oe,{className:"size-6"}):s.jsx(Se,{className:"size-6"})}),y==="trailing"&&s.jsx("button",{type:"button",onClick:()=>v("trailing"),"aria-label":"Delete message",className:"absolute inset-y-0 right-0 flex items-center justify-end bg-danger px-6 text-canvas",children:s.jsx(fe,{className:"size-6"})}),s.jsx("button",{type:"button",role:t?"checkbox":void 0,"aria-checked":t?n:void 0,"data-message-row":!0,"data-message-id":e.id,...r,className:R,style:A,children:O})]})}function Qe({sections:e,selectedThreadId:t,selectionMode:n,checkedIds:u,initialPeek:f,onToggleCheck:c,onEnterSelection:p,onOpenThread:w,onRefresh:b,refreshing:v,busy:x=!1}){const[j,h]=g.useState(new Set),[P,S]=g.useState(new Map),N=e.flatMap(r=>r.threads).filter(r=>!j.has(r.id)).map(r=>{const d=P.get(r.id);return d===void 0?r:{...r,isRead:d}}),[E,C]=g.useState(f&&f!=="none"&&N[1]?{id:N[1].id,side:f}:null),k=(r,d)=>{if(d==="trailing")h(y=>new Set(y).add(r));else{const y=N.find(R=>R.id===r);S(R=>new Map(R).set(r,!y?.isRead))}C(null)};return s.jsxs("div",{className:"flex-1 overflow-y-auto",children:[v&&s.jsxs("div",{className:"flex items-center justify-center gap-2 border-b border-line py-3 text-fg-muted",children:[s.jsx(De,{className:"size-4 animate-spin"}),s.jsx("span",{className:"text-xs",children:"Checking for new mail…"})]}),s.jsx("div",{className:"divide-y divide-line",children:N.map(r=>s.jsx("div",{className:x?"pointer-events-none opacity-50":void 0,children:s.jsx(Ke,{thread:r,selectionMode:n,checked:u.has(r.id),active:r.id===t,peek:E?.id===r.id?E.side:"none",onPeek:d=>C(d==="none"?null:{id:r.id,side:d}),onToggleCheck:()=>c(r.id),onLongPress:()=>p(r.id),onOpen:()=>w(r.id),onAct:d=>k(r.id,d)})},r.id))}),!n&&!v&&!x&&s.jsx("button",{type:"button",onClick:b,className:"w-full border-t border-line py-2 text-center text-2xs text-fg-subtle transition-colors hover:bg-surface-sunken",children:"Pull to refresh"})]})}const Ge=new Set;function ds({listTitle:e,listMeta:t,sections:n,briefFilters:u,flatList:f,listState:c="ready",searchQuery:p,listFilter:w,listScopeLabel:b,errorMessage:v,onRetry:x,onReportError:j,briefFilter:h,selectedThreadId:P,density:S="comfortable",onSelectThread:N,onOpenNav:E,isDesktop:C,initialTouchState:k,selection:r,keyboard:d,selectionBar:y,paneOverlay:R,listBody:A,hideHeader:_=!1}){const I=S==="compact"?ke:Ie,O=g.useRef(null),i=g.useRef(null),o=me(d);ye({containerRef:O,itemSelector:Q,enabled:!o});const m=o?d.focusedId:void 0,M=o?m??n[0]?.threads[0]?.id:void 0,T=g.useCallback(a=>M===void 0?void 0:a===M?0:-1,[M]);g.useEffect(()=>{if(m===void 0)return;const a=i.current;if(!a)return;const l=a.querySelector(`${Q}[data-message-id="${m}"]`);!l||l===a.ownerDocument.activeElement||l.focus({preventScroll:!1})},[m]),g.useEffect(()=>{if(!o)return;const a=i.current;if(!a)return;const l=a.ownerDocument.activeElement;l!==null&&l!==a.ownerDocument.body||a.focus({preventScroll:!0})},[o]);const F=!C&&!u&&c==="ready",[H,W]=g.useState(!1),ae=k==="peek-trailing"?"trailing":k==="peek-leading"?"leading":void 0,re=()=>{W(!0),setTimeout(()=>W(!1),1400)},D=r?.selectedIds??Ge,z=r?.onToggle,Y=r?.onRowSelect,ie=Ee(D.size,C),X=g.useCallback(a=>{if(z)return{checked:D.has(a),onToggle:l=>{l.preventDefault(),l.stopPropagation(),z(a)}}},[D,z]),B=g.useCallback((a,l)=>Y?.(a,Me(l))?(l.preventDefault(),l.shiftKey&&window.getSelection()?.removeAllRanges(),!0):!1,[Y]),oe=g.useCallback(({thread:a,active:l,onClick:U})=>s.jsx(I,{thread:a,active:l,focused:a.id===m,tabIndex:T(a.id),selection:X(a.id),onClick:ce=>{B(a.id,ce)||U?.()}}),[I,X,B,m,T]);return s.jsxs("section",{ref:a=>{i.current=a,d?.ref(a)},tabIndex:o?-1:void 0,className:"relative flex h-full w-full flex-col bg-surface outline-none",children:[y??(_?null:s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[E&&s.jsx($,{variant:"ghost",size:"sm",icon:s.jsx($e,{className:"size-4"}),onClick:E,"aria-label":"Open folders",className:"-ml-1 shrink-0"}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:e}),t&&s.jsx("span",{className:"shrink-0 text-2xs text-fg-subtle",children:t})]})),c==="loading"?s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsx(_e,{})}):c==="empty"?s.jsx(Fe,{filter:w,scopeLabel:b,searchQuery:p}):c==="error"?s.jsx(Ue,{message:v,onRetry:x,onReport:j}):u&&h?s.jsx(Le,{...h,sections:n,selectedThreadId:P,Row:oe,keyboard:d,onSelectThread:N}):A??(F?s.jsx(Qe,{sections:n,selectedThreadId:P,selectionMode:ie,checkedIds:D,initialPeek:ae,onToggleCheck:a=>z?.(a),onEnterSelection:a=>z?.(a),onOpenThread:a=>N?.(a),onRefresh:re,refreshing:H}):s.jsx("div",{ref:O,className:"flex-1 overflow-y-auto",children:n.map(a=>s.jsxs("div",{children:[!f&&a.label&&s.jsxs("div",{className:"sticky top-0 flex h-section-row items-center justify-between border-b border-line bg-surface-sunken px-row-inset",children:[s.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:a.label}),s.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:a.threads.length})]}),s.jsx("div",{className:"divide-y divide-line",children:a.threads.map(l=>s.jsx(I,{thread:l,active:l.id===P,focused:l.id===m,tabIndex:T(l.id),selection:X(l.id),onClick:U=>{B(l.id,U)||N?.(l.id)}},l.id))})]},a.id))})),C&&s.jsx(Te,{hints:d?Ne(d.handlers):we}),R]})}var qe=class extends xe{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:f,isRefetching:c,isError:p,isRefetchError:w}=u,b=n.fetchMeta?.fetchMore?.direction,v=p&&b==="forward",x=f&&b==="forward",j=p&&b==="backward",h=f&&b==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:he(t,n.data),hasPreviousPage:ge(t,n.data),isFetchNextPageError:v,isFetchingNextPage:x,isFetchPreviousPageError:j,isFetchingPreviousPage:h,isRefetchError:w&&!v&&!j,isRefetching:c&&!x&&!h}}};function fs(e,t){return pe(e,qe)}const se={dimension:"read",position:"pre",text:"unread"},Ve={dimension:"read",position:"pre",text:"read"},te={dimension:"starred",position:"pre",text:"starred"},ne={dimension:"attachment",position:"post",text:"with an attachment"},Je=[["unread",se],["flagged",te],["attachment",ne]],Ze=e=>{switch(e.type){case"category":return{dimension:"category",position:"pre",text:ee(e.category)??e.value};case"isUnread":return se;case"isRead":return Ve;case"isStarred":return te;case"hasAttachment":return ne;case"from":return{dimension:e.raw,position:"post",text:`from ${e.value}`};case"subject":return{dimension:e.raw,position:"post",text:`about “${e.value}”`};case"before":return{dimension:e.raw,position:"post",text:`sent before ${e.value}`};case"after":return{dimension:e.raw,position:"post",text:`sent on or after ${e.value}`};case"in":return{dimension:e.raw,position:"post",text:`in ${e.value}`};case"account":return{dimension:e.raw,position:"post",text:`in the ${e.value} account`}}},es=(e,t)=>{const n=new Map,u=c=>{n.has(c.dimension)||n.set(c.dimension,c)},f=ee(e.category);f&&u({dimension:"category",position:"pre",text:f});for(const[c,p]of Je)e.attributes.has(c)&&u(p);for(const c of t)u(Ze(c));return[...n.values()]},ss=(e,t)=>{const n=es(e,t);if(n.length===0)return;const u=f=>n.filter(c=>c.position===f).map(c=>c.text);return[...u("pre"),"mail",...u("post")].join(" ")},ms=({chips:e,tokens:t,reach:n,onClear:u})=>{const f=ss(e,t);if(f)return{label:f,reach:n,onClear:u}};function xs({title:e,unreadCount:t,preset:n,selectedCategory:u,activeFilters:f,onSelectCategory:c,onToggleFilter:p,onSelectSource:w,onClearFilters:b,children:v,footer:x,searchResults:j,searchLoading:h,relatedResults:P,relatedLoading:S,onSelectSearchResult:N,searchResultsLabel:E,relatedResultsLabel:C,searchResultsInBody:k,refreshControl:r}){const{searchInput:d}=be(),y=d.trim().length>0,R={categories:n.categories,filters:n.filters,sources:n.sources,selectedCategory:u,activeFilters:f,onSelectCategory:c,onSelectSource:w,onToggleFilter:p,onClear:b};return s.jsx(ve,{hasSheet:!y,children:s.jsx(ze,{title:e,unreadCount:t,footer:x,searchFilter:R,searchResults:j,searchLoading:h,relatedResults:P,relatedLoading:S,onSelectSearchResult:N,searchResultsLabel:E,relatedResultsLabel:C,searchResultsInBody:k,refreshControl:r,children:s.jsx(je,{...R,hideChrome:y,children:v})})})}export{us as M,Ke as S,ds as a,xs as b,ms as l,fs as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r,bU as js,c0 as Ms,c1 as Rs,cP as Es,B as ft,f as X,W as Os,t as Re,g as Kt,r as c,_ as As,$ as Ns,bw as zs,cQ as Ge,h as jt,c as mt,ad as Fs,i as Mt,cR as Ds,cL as _s,I as Ls,a7 as Ps,a3 as Vt,cS as $s,cT as qt,bY as Ws,bq as Bs,cU as Ks,cV as Vs,at as Ht,cW as qs,cX as Hs,aH as Qs,aI as Us,cY as Js,cZ as Gs,q as Rt,m as Ys,Q as Qt,bt as Xs,K as Zs,bu as en,bv as tn,c_ as sn,o as nn,E as on,F as rn,c$ as an,cy as ln,s as cn,d0 as un,d1 as dn,d2 as Ut,d3 as Jt,C as Gt,ai as hn,d4 as fn,d5 as mn,ak as gn,bF as pn}from"./index-DKo99WG1.js";import{u as xn,p as _t,R as bn}from"./useSearchTokenContext-C0_GGpQj.js";import{u as vn,a as Sn,R as yn}from"./useRefreshControl-DKJ_Eyfn.js";import{r as Et,C as Yt,c as Xt,j as Cn,M as In,t as Zt,u as Tn,a as kn,b as es,d as ts,e as wn,f as jn,g as Mn,n as Rn,h as En,i as On,S as An,k as Nn,D as zn,l as Fn,m as Dn,o as ss,p as _n,q as Ln,s as Pn,v as $n,w as Wn,x as ns,y as Bn,z as Kn,A as Vn,B as qn,E as Hn,F as Qn,G as Un,H as Jn,I as Gn,J as Lt,K as Pt,L as Yn,N as Xn,O as Zn,P as eo,Q as to,R as so,T as no,U as oo,V as io,W as ro,X as ao,Y as Ot,Z as lo,_ as os,$ as is,a0 as rs,a1 as co,a2 as uo,a3 as ho,a4 as fo,a5 as mo,a6 as go,a7 as po,a8 as xo}from"./MailListHeader-BZRxmnIb.js";import{S as bo,M as vo,a as So,u as yo,l as Co,b as Io}from"./MailViewChrome-7gtXtr7X.js";import{A as At}from"./avatar-C2R7xqlA.js";import{P as To}from"./pane-header-DmEVnHem.js";import{d as ko,g as wo,a as jo,u as Mo}from"./useMessageBodyContent-BRyDdu_J.js";import{e as Ye,f as Ro,g as Eo,h as Oo,i as Ao}from"./search-token-index-DL0AoAlj.js";import{N as No}from"./NavMenuButton-C3UDJB1v.js";import{C as zo}from"./confirm-dialog-CCDHX_6Q.js";import{f as Fo}from"./ErrorState-CHxEHbvf.js";import{a as Do}from"./useLabels-xQerI8AK.js";import{L as _o,r as Lo,t as Po,s as $o,u as Wo}from"./useSemanticSearch-lVNhyaIe.js";import{S as gt}from"./shield-check-BgoZBruM.js";import{B as Bo}from"./bottom-sheet-DZ2d0h_L.js";import{C as as}from"./checkbox-B_JY_6mN.js";import{C as Ko}from"./circle-help-Cmc2Km1C.js";import{C as Vo}from"./circle-check-Cmp8Rqlz.js";import{u as qo}from"./useLayoutTier-C1kzvb61.js";import{n as Ho}from"./search-query-Cr_ZXBCp.js";import{u as Qo}from"./sections-DDBMQxXz.js";const Uo=e=>e.toLocaleString(),Jo=(e,o)=>{if(e.kind==="unknown")return`Results for “${o}”`;const t=e.value===1?"result":"results";return`${Uo(e.value)} ${t} for “${o}”`};function Go({query:e,count:o}){return r.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-surface-sunken/30 px-3 py-2",children:[r.jsx(js,{className:"size-4 text-fg-muted","aria-hidden":"true"}),r.jsx("span",{className:"text-sm text-fg-muted",children:Jo(o,e)})]})}const Yo=({children:e,onRefresh:o,isRefreshing:t})=>Ms(Rs)?e:r.jsx(Es,{onRefresh:o,isPullable:!t,children:e}),Xo=e=>e===1?"message":"messages";function Zo({count:e,onReview:o,onDismiss:t,actionLabel:s="Review & rescue"}){return r.jsx(ft,{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(gt,{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} ${Xo(e)} here`})," ","may not be spam — they're from senders we can verify."]})]}),r.jsx(X,{variant:"primary",size:"sm",onClick:o,className:"self-start",children:s})]})})}const ei=(e,o)=>e==="vip"?"vip":e==="unknown"&&o==="md"?"unknown-pill":"hidden",ls=({senderTrust:e,size:o="sm",className:t})=>{const s=ei(e,o);return s==="vip"?r.jsx(Os,{className:Re("text-warning shrink-0",o==="sm"&&"size-3.5",o==="md"&&"size-4",t),"aria-label":"VIP sender","data-testid":"sender-trust-vip"}):s==="unknown-pill"?r.jsx("span",{className:Re("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 ti({candidate:e,selected:o,onToggle:t,hideSender:s=!1}){const{senderName:n,senderAddress:i,subject:l,snippet:a,trustReason:u,trustSubReason:d,senderTrust:h}=e;return r.jsxs("label",{className:Re("flex w-full cursor-pointer items-start gap-3 px-3 py-2.5 text-left transition-colors",s&&"pl-11",o?"bg-positive/10":"bg-surface hover:bg-surface-sunken"),children:[r.jsx(as,{className:"mt-0.5",checked:o,onChange:t,"aria-label":`${o?"Deselect":"Select"} ${s?l:`message from ${n}`}`}),!s&&r.jsx(At,{name:n,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:n}),h&&r.jsx(ls,{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(Kt,{tone:"positive",children:[r.jsx(gt,{className:"size-3","aria-hidden":!0}),u]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:d})]})]})]})}const si=e=>{const o=new Map,t=[];for(const s of e){const n=(s.senderAddress||s.senderName).toLowerCase(),i=o.get(n);if(i){i.messages.push(s);continue}o.set(n,{key:n,senderName:s.senderName,senderAddress:s.senderAddress,trustReason:s.trustReason,trustSubReason:s.trustSubReason,senderTrust:s.senderTrust,messages:[s]}),t.push(n)}return t.map(s=>o.get(s)).sort((s,n)=>n.messages.length-s.messages.length)},ni=(e,o)=>{const t=e.messages.filter(s=>o.has(s.id)).length;return t===0?"none":t===e.messages.length?"all":"some"},$t=e=>e===1?"message":"messages";function oi({group:e,selected:o,onToggleGroup:t,onToggleMessage:s}){const[n,i]=c.useState(!1),l=ni(e,o),a=e.messages.length,u=n?As:Ns;return r.jsxs("div",{className:Re(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(as,{className:"mt-0.5",checked:l==="all",indeterminate:l==="some",onChange:()=>t(e,l!=="all"),"aria-label":`${l==="all"?"Deselect":"Select"} all ${a} ${$t(a)} from ${e.senderName}`}),r.jsx(At,{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(ls,{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(Kt,{tone:"positive",children:[r.jsx(gt,{className:"size-3","aria-hidden":!0}),e.trustReason]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:e.trustSubReason})]})]}),r.jsxs("button",{type:"button",onClick:()=>i(d=>!d),"aria-expanded":n,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} ${$t(a)}`,r.jsx(u,{className:"size-3.5","aria-hidden":!0})]})]}),n&&r.jsx("div",{className:"divide-y divide-line border-t border-line",children:e.messages.map(d=>r.jsx(ti,{candidate:d,selected:o.has(d.id),onToggle:()=>s(d.id),hideSender:!0},d.id))})]})}const Nt=e=>e===1?"message":"messages",ii=(e,o)=>`Moves ${e===1?"this message":`these ${e} ${Nt(e)}`} out of Spam to ${o} now. Nothing later.`,wt=(e,o)=>e.find(t=>t.id===o)?.label??"Inbox";function ri(){return r.jsx(ft,{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 ai({candidates:e,selected:o,onToggle:t,onToggleGroup:s,onSelectAll:n,onSelectNone:i,onContinue:l,onCancel:a}){const[u,d]=c.useState(!1),h=o.size,g=c.useMemo(()=>si(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(gt,{className:"size-4 text-positive","aria-hidden":!0}),"Rescue from Spam"]}),r.jsx(X,{variant:"ghost",size:"sm",icon:r.jsx(Ko,{className:"size-3.5"}),onClick:()=>d(m=>!m),className:"-mr-1.5 -mt-0.5",children:"Why these?"})]}),r.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"These look safe — from senders we can verify. Uncheck any sender that belongs in Spam, or open a sender to pick individual messages."}),u&&r.jsx("div",{className:"mt-2",children:r.jsx(ri,{})})]}),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(X,{variant:"ghost",size:"sm",onClick:n,children:"Select all"}),r.jsx(X,{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(oi,{group:m,selected:o,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(X,{variant:"primary",onClick:l,className:"h-11 w-full font-semibold",children:`Continue with ${h} ${Nt(h)}`}),r.jsx(X,{variant:"ghost",onClick:a,className:"h-11 w-full",children:"Cancel"})]})]})}function li({count:e,folders:o,delimiter:t,destination:s,onPick:n,onMove:i,onBack:l}){const[a,u]=c.useState(!1);return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"px-row-inset pb-2 pt-1",children:[r.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Where should they go?"}),r.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"Pick a folder, then we move them out of Spam."})]}),r.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto px-row-inset py-2",children:a?r.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden rounded-xl border border-line bg-surface",children:r.jsx(zs,{folders:o,selectedId:s,delimiter:t,onSelect:n,onCancel:()=>u(!1)})}):r.jsxs("div",{className:"rounded-xl border border-line bg-surface-sunken p-3",children:[r.jsx("p",{className:"text-2xs text-fg-subtle",children:"Destination"}),r.jsx("p",{className:"mt-0.5 text-sm font-medium text-fg",children:wt(o,s)}),r.jsx(X,{variant:"ghost",size:"sm",onClick:()=>u(!0),className:"mt-2 px-0",children:"Move to a different folder"})]})}),r.jsxs("div",{className:"space-y-2 border-t border-line bg-surface px-row-inset py-3",children:[r.jsx("p",{className:"text-2xs text-fg-subtle",children:ii(e,wt(o,s))}),r.jsx(X,{variant:"primary",onClick:i,className:"h-11 w-full font-semibold",children:`Move ${e} out of Spam`}),r.jsx(X,{variant:"ghost",onClick:l,className:"h-11 w-full",children:"Back"})]})]})}function ci({count:e,destinationLabel:o,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(Vo,{className:"size-10 text-positive","aria-hidden":!0}),r.jsx("p",{className:"text-base font-semibold text-fg",children:`Moved ${e} ${Nt(e)} out of Spam.`}),r.jsx("p",{className:"text-2xs text-fg-subtle",children:`You'll find them in ${o}.`})]}),r.jsx("div",{className:"border-t border-line bg-surface px-row-inset py-3",children:r.jsx(X,{variant:"primary",onClick:t,className:"h-11 w-full font-semibold",children:"Done"})})]})}function ui({open:e,candidates:o,defaultDestinationId:t,availableFolders:s,delimiter:n,onConfirmMove:i,onCancel:l}){const[a,u]=c.useState("review"),[d,h]=c.useState(()=>e?new Set(o.map(T=>T.id)):new Set),[g,m]=c.useState(t),[p,v]=c.useState(0),y=c.useRef(!1);c.useEffect(()=>{e&&!y.current&&(u("review"),h(new Set(o.map(T=>T.id))),m(t),v(0)),y.current=e},[e,o,t]);const I=d.size,x=T=>{h(w=>{const O=new Set(w);return O.has(T)?O.delete(T):O.add(T),O})},b=(T,w)=>{h(O=>{const A=new Set(O);for(const W of T.messages)w?A.add(W.id):A.delete(W.id);return A})},j=()=>{const T=Array.from(d);v(T.length),i(T,g),u("done")};return r.jsxs(Bo,{open:e,onClose:l,label:"Rescue from spam",dismissLabel:"Close rescue",children:[a==="review"&&r.jsx(ai,{candidates:o,selected:d,onToggle:x,onToggleGroup:b,onSelectAll:()=>h(new Set(o.map(T=>T.id))),onSelectNone:()=>h(new Set),onContinue:()=>u("destination"),onCancel:l}),a==="destination"&&r.jsx(li,{count:I,folders:s,delimiter:n,destination:g,onPick:m,onMove:j,onBack:()=>u("review")}),a==="done"&&r.jsx(ci,{count:p,destinationLabel:wt(s,g),onClose:l})]})}function di(e){const o=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:o?`To: ${o}`:"(No recipients)",timeLabel:Ge(e.updatedAt),isRead:!0}}function hi(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:Ge(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,...Et(e)}}function fi({outboxMessages:e,accountId:o,imapThreads:t}){const s=e.filter(l=>l.status==="draft"&&l.accountId===o).map(di),n=t.map(hi),i=[];return s.length>0&&i.push({id:"remit-drafts",label:"Not yet sent (Remit)",threads:s}),n.length>0&&i.push({id:"imap-drafts",label:"On the server",threads:n}),i}const mi=({label:e,count:o})=>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:o})]}),gi=({row:e,isSelected:o,onOpen:t,onDelete:s,isDeleting:n})=>r.jsxs("button",{type:"button",onClick:()=>t(e.id),className:Re("group",Xt({active:o})),children:[r.jsx(Ps,{className:"size-7 shrink-0 text-fg-muted mt-0.5"}),r.jsx(Yt,{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:n,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(Vt,{className:"size-3.5"})})})]}),pi=({row:e,isSelected:o,onOpen:t})=>{const s=!e.isRead;return r.jsxs("button",{type:"button",onClick:()=>t(e.id),className:Re("group",Xt({active:o})),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(At,{name:e.fromName,email:e.fromEmail,size:"sm"}),r.jsx(Yt,{thread:e})]})};function xi({accountId:e,selectedMessageId:o,imapThreads:t,title:s,unreadCount:n}){const i=ko(),l=wo(),a=Ye(),u=jt(),{data:d}=mt(Fs()),h=c.useMemo(()=>fi({outboxMessages:d?.items??[],accountId:e,imapThreads:t}),[d?.items,e,t]),g=Mt({..._s(),onSuccess:()=>{u.invalidateQueries({queryKey:Ds()})}}),m=y=>{g.mutate({path:{outboxMessageId:y}})},p=y=>{const I=t.find(x=>x.messageId===y)?.threadId;I&&a({threadId:I,messageId:y})},v=h.length===0;return r.jsxs("section",{className:"flex h-full w-full flex-col bg-surface",children:[r.jsx(To,{title:s,leading:r.jsx(No,{}),children:(n??0)>0&&r.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:[n," unread"]})}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:v?r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-center px-4",children:[r.jsx(Ls,{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(y=>r.jsxs("div",{children:[y.label&&r.jsx(mi,{label:y.label,count:y.threads.length}),r.jsx("div",{className:"divide-y divide-line",children:y.threads.map(I=>y.id==="remit-drafts"?r.jsx(gi,{row:I,isSelected:I.id===i,onOpen:l,onDelete:m,isDeleting:g.isPending},I.id):r.jsx(pi,{row:I,isSelected:I.id===o,onOpen:p},I.id))})]},y.id))})]})}const cs=e=>e===1?"1 message":`${qt(e)} messages`,bi=e=>({title:"Empty Trash?",description:`${cs(e)} ${e===1?"is":"are"} erased from the mail server and cannot be restored.`,confirmLabel:"Empty Trash"}),vi=(e,o={})=>{const{trashFolderLabel:t,staleFolderLabel:s}=o;if(e==="unconfirmed"){const n=$s(0,"unconfirmed",{trashFolderLabel:t});return{headline:n.title,body:n.description,actionLabel:n.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 Si({messageCount:e,isEmptying:o,deletedCount:t,refusalReason:s,trashFolderLabel:n,staleFolderLabel:i,onEmpty:l,onRepair:a,children:u}){const[d,h]=c.useState(!1);if(e<1&&s===void 0&&t===void 0)return r.jsx(r.Fragment,{children:u});const g=s?vi(s,{trashFolderLabel:n,staleFolderLabel:i}):void 0,m=bi(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:`${cs(t)} erased from the mail server.`}),r.jsx(X,{variant:"ghost",size:"sm",icon:r.jsx(Vt,{className:"size-3.5","aria-hidden":!0}),disabled:o||e<1,"aria-busy":o,onClick:()=>h(!0),children:o?"Emptying…":"Empty Trash"})]}),g&&r.jsx(ft,{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(X,{variant:"primary",size:"sm",className:"self-start",onClick:a,children:g.actionLabel})]})})]})}),r.jsx("div",{className:"min-h-0 flex-1",children:u}),r.jsx(zo,{isOpen:d,title:m.title,description:m.description,confirmLabel:m.confirmLabel,destructive:!0,onConfirm:()=>{h(!1),l()},onCancel:()=>h(!1)})]})}function yi(e,o,t){const s=new Array(e);return new Proxy(s,{get(n,i,l){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const u=+i;if(Number.isInteger(u)&&u>=0&&u<e){let d=n[u];if(!d){const h=o[u*2];d=n[u]={index:u,key:t(u),start:h,size:o[u*2+1],end:h+o[u*2+1],lane:0}}return d}}if(i==="length")return e}return Reflect.get(n,i,l)}})}function Le(e,o,t){let s=t.initialDeps??[],n,i=!0;function l(){const a=e();return(a.length!==s.length||a.some((d,h)=>s[h]!==d))&&(s=a,n=o(...a),t?.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(n),i=!1),n}return l.updateDeps=a=>{s=a},l}function Wt(e,o){if(e===void 0)throw new Error("Unexpected undefined");return e}const Ci=(e,o)=>Math.abs(e-o)<1.01,Ii=(e,o,t)=>{let s;return function(...n){e.clearTimeout(s),s=e.setTimeout(()=>o.apply(this,n),t)}};let Je;const Tt=()=>{if(Je!==void 0)return Je;if(typeof navigator>"u")return Je=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Je=!0;const e=navigator.maxTouchPoints;return Je=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Bt=e=>{const{offsetWidth:o,offsetHeight:t}=e;return{width:o,height:t}},Ti=e=>e,ki=e=>{const o=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1)-o+1,n=new Array(s);for(let i=0;i<s;i++)n[i]=o+i;return n},wi=(e,o)=>{const t=e.scrollElement;if(!t)return;const s=e.targetWindow;if(!s)return;const n=l=>{const{width:a,height:u}=l;o({width:Math.round(a),height:Math.round(u)})};if(n(Bt(t)),!s.ResizeObserver)return()=>{};const i=new s.ResizeObserver(l=>{const a=()=>{const u=l[0];if(u?.borderBoxSize){const d=u.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(Bt(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},ht={passive:!0},ji=typeof window>"u"?!0:"onscrollend"in window,Mi=(e,o,t)=>{const s=e.scrollElement;if(!s)return;const n=e.targetWindow;if(!n)return;const i=e.options.useScrollendEvent&&ji;let l=0;const a=i?null:Ii(n,()=>o(l,!1),e.options.isScrollingResetDelay),u=g=>()=>{l=t(s),a?.(),o(l,g)},d=u(!0),h=u(!1);return s.addEventListener("scroll",d,ht),i&&s.addEventListener("scrollend",h,ht),()=>{s.removeEventListener("scroll",d),i&&s.removeEventListener("scrollend",h)}},Ri=(e,o)=>Mi(e,o,t=>{const{horizontal:s,isRtl:n}=e.options;return s?t.scrollLeft*(n&&-1||1):t.scrollTop}),Ei=(e,o,t)=>{if(t.options.useCachedMeasurements){const s=t.indexFromElement(e),n=t.options.getItemKey(s);return t.itemSizeCache.get(n)??t.options.estimateSize(s)}if(o?.borderBoxSize){const s=o.borderBoxSize[0];if(s)return Math.round(s[t.options.horizontal?"inlineSize":"blockSize"])}if(!o){const s=t.indexFromElement(e),n=t.options.getItemKey(s),i=t.itemSizeCache.get(n);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},Oi=(e,{adjustments:o=0,behavior:t},s)=>{var n,i;(i=(n=s.scrollElement)==null?void 0:n.scrollTo)==null||i.call(n,{[s.options.horizontal?"left":"top"]:e+o,behavior:t})},Ai=Oi;class Ni{constructor(o){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,n;return((n=(s=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:s.now)==null?void 0:n.call(s))??Date.now()},this.observer=(()=>{let t=null;const s=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(i=>{const l=()=>{const a=i.target,u=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[d,h]of this.elementsCache)if(h===a){this.elementsCache.delete(d);break}return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var n;(n=s())==null||n.disconnect(),t=null},observe:n=>{var i;return(i=s())==null?void 0:i.observe(n,{box:"border-box"})},unobserve:n=>{var i;return(i=s())==null?void 0:i.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{var s,n;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ti,rangeExtractor:ki,onChange:()=>{},measureElement:Ei,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,u=null,d=!1;if(l!==void 0&&l.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const m=l.count,p=i.count,v=this.getMeasurements(),y=m>0?((s=v[0])==null?void 0:s.key)??l.getItemKey(0):null,I=m>0?((n=v[m-1])==null?void 0:n.key)??l.getItemKey(m-1):null;if(p!==m||m>0&&p>0&&(i.getItemKey(0)!==y||i.getItemKey(p-1)!==I)){d=!0;const j=m>0?this.getVirtualItemForOffset(this.getScrollOffset())??v[0]:null;j&&(a=[j.key,this.getScrollOffset()-j.start]);const T=i.followOnAppend===!0?"auto":i.followOnAppend||null;T&&p>m&&this.isAtEnd(l.scrollEndThreshold)&&(m===0||i.getItemKey(p-1)!==I)&&(u=T)}}this.options=i,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let h=!1,g=0;if(a&&this.scrollOffset!==null){const[m,p]=a,v=this.getMeasurements(),{count:y,getItemKey:I}=this.options;let x=0;for(;x<y&&I(x)!==m;)x++;if(x<y){const b=v[x];if(b){const j=b.start+p;j!==this.scrollOffset&&(g=j-this.scrollOffset,this.scrollOffset=j,h=!0)}}}(h||u)&&(this.pendingScrollAnchor=[h?a[0]:null,h?a[1]:0,u,g])},this.notify=t=>{var s,n;(n=(s=this.options).onChange)==null||n.call(s,this,t)},this.maybeNotify=Le(()=>(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,!(!Tt()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",l,ht),i.addEventListener("touchend",a,ht),this.unsubs.push(()=>{i.removeEventListener("touchstart",l),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const n=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,n&&this.scrollElement&&this.options.enabled){const[i,l,a,u]=n;i!==null&&!a&&(Tt()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?u!==0&&(this._iosDeferredAdjustment+=u):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),s=this.getMaxScrollOffset();if(t<0||t>s)return;const n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=n,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=Le(()=>[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,n,i,l,a,u,d)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:t,paddingStart:s,scrollMargin:n,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:u,gap:d}),{key:!1}),this.getMeasurements=Le(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:s,scrollMargin:n,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:u,gap:d},h)=>{const g=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const x of this.laneAssignments.keys())x>=t&&this.laneAssignments.delete(x);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(x=>{this.itemSizeCache.set(x.key,x.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 x=t*2;let b=this._flatMeasurements;if(!b||b.length<x){const w=new Float64Array(x);b&&m>0&&w.set(b.subarray(0,m*2)),b=w,this._flatMeasurements=b}let j;if(m===0)j=s+n;else{const w=m-1;j=b[w*2]+b[w*2+1]+d}for(let w=m;w<t;w++){const O=i(w),A=g.get(O),W=typeof A=="number"?A:this.options.estimateSize(w);b[w*2]=j,b[w*2+1]=W,j+=W+d}const T=yi(t,b,i);return this.measurementsCache=T,T}const p=this.measurementsCache.slice(0,m),v=new Array(a).fill(void 0),y=new Float64Array(a);let I=0;for(let x=0;x<m;x++){const b=p[x];b&&(v[b.lane]===void 0&&I++,v[b.lane]=x,y[b.lane]=b.end)}for(let x=m;x<t;x++){const b=i(x),j=this.laneAssignments.get(x);let T,w;const O=u==="estimate"||g.has(b);if(j!==void 0&&this.options.lanes>1){T=j;const G=v[T],R=G!==void 0?p[G]:void 0;w=R?R.end+d:s+n}else if(I===a){let G=0,R=y[0],oe=v[0];for(let F=1;F<a;F++){const P=y[F];(P<R||P===R&&v[F]<oe)&&(G=F,R=P,oe=v[F])}T=G,w=R+d,O&&this.laneAssignments.set(x,T)}else T=x%this.options.lanes,w=s+n,O&&this.laneAssignments.set(x,T);const A=g.get(b),W=typeof A=="number"?A:this.options.estimateSize(x),J=w+W;p[x]={index:x,start:w,size:W,end:J,key:b,lane:T},v[T]===void 0&&I++,v[T]=x,y[T]=J}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Le(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,s,n,i)=>t.length===0||s===0?(this.range=null,null):(this.range=Fi(t,s,n,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Le(()=>{let t=null,s=null;const n=this.calculateRange();return n&&(t=n.startIndex,s=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,s]},(t,s,n,i,l)=>i===null||l===null?[]:t({startIndex:i,endIndex:l,overscan:s,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const s=this.options.indexAttribute,n=t.getAttribute(s);return n?parseInt(n,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 n=this.scrollState.index??((s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:s.index);if(n!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,n-i),a=Math.min(this.options.count-1,n+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),n=this.options.getItemKey(s),i=this.elementsCache.get(n);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(n,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,s)=>{var n,i;if(t<0||t>=this.options.count)return;let l,a,u;const d=this._flatMeasurements;if(this.options.lanes===1&&d!==null)u=this.options.getItemKey(t),a=d[t*2],l=d[t*2+1];else{const m=this.measurementsCache[t];if(!m)return;u=m.key,a=m.start,l=m.size}const h=this.itemSizeCache.get(u)??l,g=s-h;if(g!==0){const m=this.options.anchorTo==="end"&&((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,p=m?this.getTotalSize():0,v=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:u,start:a,size:l,end:a+l,lane:0},g,this):a<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(u)||this.scrollDirection!=="backward"));(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(u,s),this.itemSizeCacheVersion++,m?this.applyScrollAdjustment(this.getTotalSize()-p):v&&this.applyScrollAdjustment(g),this.notify(!1)}},this.getVirtualItems=Le(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,s)=>{const n=[];for(let i=0,l=t.length;i<l;i++){const a=t[i],u=s[a];n.push(u)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const s=this.getMeasurements();if(s.length===0)return;const n=this._flatMeasurements,i=this.options.lanes===1&&n!=null,l=us(0,s.length-1,i?a=>n[a*2]:a=>Wt(s[a]).start,t);return Wt(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,n=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),l=this.getScrollOffset();s==="auto"&&(s=t>=l+i?"end":"start"),s==="center"?t+=(n-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 n=this.getSize(),i=this.getScrollOffset(),l=this.measurementsCache[t];if(!l)return;if(s==="auto")if(l.end>=i+n-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:n="auto"}={})=>{const i=this.getOffsetForAlignment(t,s),l=this.now();this.scrollState={index:null,align:s,behavior:n,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:s="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,s);if(!i)return;const[l,a]=i,u=this.now();this.scrollState={index:t,align:a,behavior:n,startedAt:u,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:s="auto"}={})=>{const n=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:i,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{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 n;if(s.length===0)n=this.options.paddingStart;else if(this.options.lanes===1){const i=s.length-1,l=this._flatMeasurements;l!=null?n=l[i*2]+l[i*2+1]:n=((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--}n=Math.max(...i.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const s=this.getMeasurements();for(const n of s)n&&this.itemSizeCache.has(n.key)&&t.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return t},this._scrollToOffset=(t,{adjustments:s,behavior:n})=>{this._intendedScrollOffset=t+(s??0),this.options.scrollToFn(t,{behavior:n,adjustments:s},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(o)}applyScrollAdjustment(o,t){o!==0&&(Tt()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=o:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,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,n=s?s[0]:this.scrollState.lastTargetOffset,i=1,l=n!==this.scrollState.lastTargetOffset;if(!l&&Ci(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==n&&this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const a=this.getSize()||600,u=Math.abs(n-this.getScrollOffset()),d=this.scrollState.behavior==="smooth"&&u>a;this.scrollState.lastTargetOffset=n,d||(this.scrollState.behavior="auto"),this._scrollToOffset(n,{adjustments:void 0,behavior:d?"smooth":"auto"})}this.scheduleScrollReconcile()}}const us=(e,o,t,s)=>{for(;e<=o;){const n=(e+o)/2|0,i=t(n);if(i<s)e=n+1;else if(i>s)o=n-1;else return n}return e>0?e-1:0};function zi(e,o,t){let s=0;for(;s<=o;){const n=(s+o)/2|0,i=e[n*2];if(i<t)s=n+1;else if(i>t)o=n-1;else return n}return s>0?s-1:0}function Fi(e,o,t,s,n){const i=e.length-1;if(e.length<=s)return{startIndex:0,endIndex:i};if(s===1&&n!==null){const d=zi(n,i,t);let h=d;const g=t+o;for(;h<i&&n[h*2]+n[h*2+1]<g;)h++;return{startIndex:d,endIndex:h}}let a=us(0,i,d=>e[d].start,t),u=a;if(s===1)for(;u<i&&e[u].end<t+o;)u++;else if(s>1){const d=Array(s).fill(0);for(;u<i&&d.some(g=>g<t+o);){const g=e[u];d[g.lane]=g.end,u++}const h=Array(s).fill(t+o);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),u=Math.min(i,u+(s-1-u%s))}return{startIndex:a,endIndex:u}}const kt=typeof document<"u"?c.useLayoutEffect:c.useEffect;function Di({useFlushSync:e=!0,directDomUpdates:o=!1,directDomUpdatesMode:t="transform",...s}){const n=c.useReducer(d=>d+1,0)[1],i=c.useRef({enabled:o,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=o,i.current.mode=t;const l=d=>{const h=i.current;if(!h.enabled||!h.container)return;const g=d.getTotalSize();if(g!==h.lastSize){h.lastSize=g;const x=d.options.horizontal?"width":"height";h.container.style[x]=`${g}px`}const m=!!d.options.horizontal,p=h.mode==="transform",v=m?"left":"top",y=d.options.scrollMargin,I=d.getVirtualItems();for(const x of I){const b=x.start-y,j=d.elementsCache.get(x.key);j&&h.lastPositions.get(j)!==b&&(h.lastPositions.set(j,b),p?j.style.transform=m?`translate3d(${b}px, 0, 0)`:`translate3d(0, ${b}px, 0)`:j.style[v]=`${b}px`)}},a={...s,onChange:(d,h)=>{var g;const m=i.current;let p=!0;if(m.enabled){l(d);const v=d.range,y=m.prevRange;p=!y||y.isScrolling!==d.isScrolling||y.startIndex!==v?.startIndex||y.endIndex!==v?.endIndex,p&&(m.prevRange=v?{startIndex:v.startIndex,endIndex:v.endIndex,isScrolling:d.isScrolling}:null)}p&&(e&&h?Ws.flushSync(n):n()),(g=s.onChange)==null||g.call(s,d,h)}},[u]=c.useState(()=>{const d=new Ni(a);return Object.assign(d,{containerRef:h=>{const g=i.current;if(g.container=h,g.lastSize=null,h&&g.enabled){const m=d.getTotalSize();g.lastSize=m;const p=d.options.horizontal?"width":"height";h.style[p]=`${m}px`}}})});return u.setOptions(a),kt(()=>u._didMount(),[]),kt(()=>u._willUpdate()),kt(()=>{l(u)}),u}function _i(e){return Di({observeElementRect:wi,observeElementOffset:Ri,scrollToFn:Ai,...e})}const zt=e=>e.query?`matching "${e.query}"`:e.from?`from "${e.from}"`:"matching your search",Li=e=>`Select all ${zt(e)}`,Pi=(e,o)=>`All ${qt(o)} ${zt(e)} selected`,$i=({verb:e,confirmingDelete:o,hasSelection:t,junkMailboxId:s,currentMailboxId:n,deletableMessageId:i})=>{if(o)return{kind:"withheld"};if(e==="junk"){const l=Cn(s,n);if(l!==void 0)return{kind:"unavailable",reason:l}}return t?{kind:"openWizard"}:e!=="delete"||i===void 0?{kind:"declined"}:{kind:"confirmDelete",messageId:i}},Wi=(e,o,t)=>e==="BACK"&&o&&t===void 0,Bi=(e,o)=>({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:Ge(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Zt(e.category),messageCount:o,suspicious:e.authenticity?.dkimMismatch===!0,labels:e.labels,...Et(e)}),Ki=({thread:e,mailboxId:o,isSelected:t,isFocused:s,isTabStop:n,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,messageCount:d,isMultiSelectMode:h,onLongPress:g,isDesktop:m,density:p})=>r.jsx(In,{thread:Bi(e,d),link:{mailboxId:o,threadId:e.threadId},inListbox:!0,active:t,focused:s,isTabStop:n,density:p,isDesktop:m,onFocusRow:i,selection:{isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:h,onLongPress:g}}),Vi=c.memo(Ki),qi=e=>{const o=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:Ge(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Zt(e.category),suspicious:o,...Et(e)}},Hi=({thread:e,mailboxId:o,isSelected:t,isFocused:s,isTabStop:n,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:d,onLongPress:h,isDesktop:g,onDelete:m,onToggleRead:p,density:v})=>{const[y,I]=c.useState("none"),x=Ye(),b=c.useCallback(A=>{navigator.vibrate?.(10),A==="trailing"?m(e.messageId):p(e.messageId,e.isRead),I("none")},[m,p,e.messageId,e.isRead]),j=c.useCallback(()=>{h(e.messageId)},[h,e.messageId]),T=c.useCallback(()=>{a(e.messageId)},[a,e.messageId]),w=c.useCallback(()=>{x({threadId:e.threadId,messageId:e.messageId})},[x,e.threadId,e.messageId]),O=Tn(e.messageId,u);return g||d?r.jsx(Vi,{thread:e,mailboxId:o,isSelected:t,isFocused:s,isTabStop:n,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:d,onLongPress:h,isDesktop:g,density:v}):r.jsx("div",{role:"presentation",onPointerDownCapture:O.onMouseDown,onClickCapture:O.claimClick,onContextMenu:O.onContextMenu,children:r.jsx(bo,{thread:qi(e),selectionMode:!1,checked:!1,active:t,peek:y,onPeek:I,onToggleCheck:T,onLongPress:j,onOpen:w,onAct:b})})},Qi=72,Ui=32,Ji=5,ds="remit:list-density",Gi=()=>{try{const e=localStorage.getItem(ds);if(e==="compact"||e==="comfortable")return e}catch{}return"comfortable"},Yi=(e,o,t)=>Lo(e.filter(s=>o.has(s.messageId)).map(s=>s.accountId??t)).moveDisabledHint,Xi=({mailboxId:e,threads:o,selectedMessageId:t,isLoading:s,isError:n=!1,error:i,onRetry:l,searchQuery:a,searchPredicate:u,resultCount:d={kind:"unknown"},onDeleteMessages:h,isDeleting:g=!1,isMoving:m=!1,onLoadMore:p,hasMore:v=!1,isLoadingMore:y=!1,accountId:I,listTitle:x,listMeta:b,listFilter:j,listSearchText:T,listScopeLabel:w,onTriageContextChange:O,commandsRef:A,hideHeader:W=!1})=>{const J=c.useRef(null),G=Ye(),R=Bs(),oe=Ks(),{verb:F,start:P,startFromSearch:Ee}=oe,Se=Vs(),ye=!!a?.trim(),B=kn(),{labels:Pe}=Do(I),{pushError:ie}=Ht(),[M,Ce]=c.useState(t),[Oe,Ie]=c.useState(),N=c.useCallback(f=>{Ie(S=>S===f?S:void 0),Ce(f)},[]),[Z,$e]=c.useState(Gi),K=c.useCallback(()=>{$e(f=>{const S=f==="comfortable"?"compact":"comfortable";try{localStorage.setItem(ds,S)}catch{}return S})},[]),{toggleReadFor:Te}=es({mailboxId:e}),{junkMailboxId:fe}=ts(I),me=ss(fe,e),Ae=c.useMemo(()=>[{accountId:I,mailboxId:e}],[I,e]),{outcome:re,staleFolderLabel:We,guessedMailboxId:Ne}=wn(Ae),{selectedIds:z,selectedCount:_,hasSelection:ne,isSelected:ee,toggle:Y,select:ke,clearSelection:we,selectRange:ge,setAnchor:V,selectAll:pe,toggleAll:te,intersectWith:Xe}=jn(),Be=Dn(_,R),[xe,E]=c.useState(null),Ze=c.useCallback((f,S,he)=>{const Q=qs(f,S,he,re);Q&&ie(Q)},[ie,re]),je=ye&&!!u,et=`${e}|${JSON.stringify(u??{})}`,k=Mn({mailboxId:e,mailboxLabel:x,accountId:I,enabled:je,predicateKey:et,searchQuery:u??{},reportEnding:Ze}),tt=k.phase.kind,Ke=k.clear,L=c.useCallback(()=>{tt==="escalated"&&Ke(),we()},[we,Ke,tt]),[st,ae]=c.useState(null),be=c.useRef(null),le=c.useRef(!1),ze=c.useRef(null),Me=!s&&o.length>0,ce=_i({count:o.length,getScrollElement:()=>J.current,estimateSize:()=>Z==="compact"?Ui:Qi,overscan:Ji}),Ve=t?o.findIndex(f=>f.messageId===t):-1,q=M?o.findIndex(f=>f.messageId===M):-1,se=c.useCallback(f=>{if(f<0||f>=o.length)return;const S=o[f];if(Be){Y(S.messageId);return}be.current=S.messageId,le.current=!1,Ie(S.messageId),Ce(S.messageId)},[o,Be,Y]),Fe=c.useCallback(()=>{if(o.length===0)return;const f=q<0?0:Math.min(q+1,o.length-1);se(f)},[o.length,q,se]),nt=c.useCallback(()=>{if(o.length===0)return;const f=q<=0?0:q-1;se(f)},[o.length,q,se]),qe=c.useCallback(()=>se(0),[se]),He=c.useCallback(()=>se(o.length-1),[se,o.length]),ve=c.useCallback(()=>{M&&Y(M)},[M,Y]),D=c.useMemo(()=>o.map(f=>f.messageId),[o]),De=c.useMemo(()=>{const f=[];for(const S of o)z.has(S.messageId)&&f.push({id:S.messageId,sender:S.fromName??S.fromEmail??"Unknown",email:S.fromEmail??"",subject:S.subject??"(No subject)",date:Ge(S.sentDate),accountId:I});return f},[o,z,I]),xt=c.useCallback((f,S)=>S.shiftKey?(ge(D,f,M),!0):S.metaKey||S.ctrlKey?(Y(f),!0):(L(),V(f),!1),[D,M,ge,Y,L,V]),ot=c.useCallback(f=>{!h||f.length===0||(ze.current=M??null,E(f))},[h,M]),_e=c.useCallback(f=>{const S=Rn(D,M,f);S!==void 0&&(ge(D,S),be.current=S,le.current=!1,Ie(void 0),Ce(S))},[D,M,ge]),ue=c.useCallback(()=>_e(-1),[_e]),it=c.useCallback(()=>_e(1),[_e]),rt=c.useCallback(()=>{D.length>0&&pe(D)},[D,pe]),at=c.useCallback(f=>{const S=$i({verb:f,confirmingDelete:xe!==null,hasSelection:ne,junkMailboxId:fe,currentMailboxId:e,deletableMessageId:h?M:void 0});return S.kind==="openWizard"?(P(f),!0):S.kind==="confirmDelete"?(ot([S.messageId]),!0):S.kind==="unavailable"?(ie({severity:"warning",title:S.reason}),!0):S.kind==="withheld"},[xe,h,ne,fe,e,P,M,ot,ie]),de=c.useCallback((f,S)=>{const he=o.find(Q=>Q.messageId===f)?.threadId;he&&G({threadId:he,messageId:f},{replace:S?.replace})},[G,o]),lt=c.useCallback(()=>{M&&de(M)},[M,de]),bt=c.useCallback(f=>de(f,{replace:!0}),[de]);En({keyboardFocusedMessageId:Oe,openMessageId:t,enabled:R&&_===0,open:bt});const Qe=k.phase.kind==="escalated"?{scope:zt(u??{}),total:k.phase.total,searchQuery:u??{},run:(f,S)=>k.runAction(f,void 0,S),stop:k.stop}:void 0,ct=c.useCallback(f=>{if(f.length===0){E(null);return}const S=new Set(f),he=o.findIndex(U=>S.has(U.messageId));let Q;for(let U=he+1;U<o.length;U++)if(!S.has(o[U].messageId)){Q=o[U].messageId;break}if(Q===void 0){for(let U=he-1;U>=0;U--)if(!S.has(o[U].messageId)){Q=o[U].messageId;break}}h?.(f),L(),ze.current=null,E(null),Q!==void 0&&(be.current=Q,le.current=!1,N(Q),R&&de(Q,{replace:!0})),R||ae(Hs("delete",f.length,re))},[o,h,L,de,R,N,re]),ut=c.useCallback(()=>{const f=ze.current;ze.current=null,E(null),f!==null&&(be.current=f,le.current=!1,N(f))},[N]),Ue=c.useMemo(()=>Yi(o,z,I),[I,z,o]),vt=c.useCallback(()=>{if(Qe){Ee();return}P("organize")},[Qe,Ee,P]),St=c.useCallback(f=>{h?.([f])},[h]),dt=c.useCallback((f,S)=>{Te([f],!S)},[Te]),yt=c.useCallback(f=>{R||ke(f)},[R,ke]),C=c.useCallback(()=>{if(k.isRunning||k.phase.kind==="counting"){k.stop();return}L()},[k,L]),H=c.useCallback(()=>{k.clear()},[k]);c.useEffect(()=>{if(le.current||!R&&t)return;const f=q>=0?q:Ve;f>=0&&ce.scrollToIndex(f,{align:"auto"})},[q,Ve,ce,R,t]),c.useEffect(()=>{t&&(le.current=!1,N(t))},[t,N]),c.useEffect(()=>{M&&(o.some(f=>f.messageId===M)||N(o[0]?.messageId))},[o,M,N]),c.useEffect(()=>{O?.({focusedMessageId:M,selectedIds:Array.from(z),hasList:Me})},[M,z,Me,O]);const $=c.useRef(O);$.current=O,c.useEffect(()=>()=>$.current?.({focusedMessageId:void 0,selectedIds:[],hasList:!1}),[]),c.useEffect(()=>{k.phase.kind!=="idle"||k.isRunning||Xe(o.map(f=>f.messageId))},[o,Xe,k.phase,k.isRunning]);const Ft=c.useRef(e);c.useEffect(()=>{Ft.current!==e&&(Ft.current=e,L())},[e,L]),On({shouldBlockFn:({action:f})=>Wi(f,ne,Se)?(L(),!0):!1,enableBeforeUnload:!1,disabled:!ne||Se!==void 0}),c.useEffect(()=>{const f=J.current;if(!f||!v||!p)return;const S=()=>{if(y)return;const{scrollTop:he,scrollHeight:Q,clientHeight:U}=f;he+U>=Q-200&&p()};return f.addEventListener("scroll",S,{passive:!0}),S(),()=>f.removeEventListener("scroll",S)},[v,y,p]),c.useEffect(()=>{const f=be.current;if(!f)return;const S=J.current?.querySelector(`[data-message-id="${f}"]`);S&&(be.current=null,S.focus({preventScroll:!0}))}),c.useEffect(()=>{if(A){if(!Me){A.current=null;return}return A.current={focusNext:Fe,focusPrevious:nt,focusFirst:qe,focusLast:He,openFocused:lt,toggleSelect:ve,extendSelectDown:it,extendSelectUp:ue,selectAll:rt,clearSelection:()=>ne?(L(),!0):!1,requestVerb:at,toggleDensity:K},()=>{A.current=null}}},[A,Me,Fe,nt,qe,He,lt,ve,it,ue,rt,ne,L,at,K]);const Dt=s?"loading":n?"error":o.length===0?"empty":"ready",ms=n?Fo(i):void 0,gs=c.useCallback(()=>{const f=Qs(Us());window.open(f,"_blank","noopener,noreferrer")},[]),ps=[{id:"inbox",threads:[]}],Ct=D.length>0&&D.every(f=>z.has(f)),xs=je&&v&&Ct&&!g&&!m&&k.phase.kind==="idle"&&!k.isRunning,bs=g||m||k.isRunning,It=k.phase.kind==="escalated"?k.phase.total:k.progress?k.progress.total:_,vs=k.runningAction?Js(k.runningAction.kind,k.progress?.done??0,k.progress?.total??It):k.phase.kind==="counting"?"Counting matches…":k.phase.kind==="escalated"?Pi(u??{},k.phase.total):void 0,Ss=k.phase.kind!=="escalated"&&D.length>0?{checked:Ct,indeterminate:_>0&&!Ct,onChange:()=>te(D)}:void 0,ys=k.runningAction?{value:k.progress?.done??0,max:k.progress?.total??It,tone:Gs(k.runningAction.kind)}:void 0,Cs=(k.isRunning||k.phase.kind==="counting"?{tone:"info",text:"",action:{label:"Stop",onClick:k.stop}}:k.phase.kind==="escalated"?{tone:"info",text:"",action:{label:"Clear selection",onClick:H}}:xs?{tone:"info",text:"",action:{label:Li(u??{}),onClick:k.escalate}}:void 0)??(Ue?{tone:"warning",text:Ue}:void 0),Is=r.jsx(An,{title:B.title||x,navSlot:B.navSlot,titleMeta:B.titleMeta,searchSlot:B.searchSlot,searchField:B.searchField,idleSlot:B.makeFilterSlot,count:It,onCancel:C,onDelete:()=>P("delete"),onMove:()=>P("move"),onOrganize:vt,onJunk:me?()=>P("junk"):void 0,onMarkRead:()=>P("markRead"),overflowSlot:I&&e&&_>0&&Pe.length>0?r.jsx(_o,{accountId:I,mailboxId:e,messageIds:Array.from(z)}):void 0,isBusy:bs,isCounting:k.phase.kind==="counting",selectAll:Ss,statusLabel:vs,progress:ys,notice:Cs}),Ts=Nn(D,M),ks=c.useCallback(f=>{le.current=!0,N(f)},[N]),ws=r.jsxs(r.Fragment,{children:[ye&&a&&r.jsx(Go,{query:a,count:d}),r.jsxs("div",{ref:J,role:"listbox","aria-multiselectable":!0,"aria-label":x,className:"flex-1 overflow-y-auto",children:[r.jsx("div",{role:"presentation",className:"relative w-full",style:{height:`${ce.getTotalSize()}px`},children:ce.getVirtualItems().map(f=>{const S=o[f.index];return r.jsx("div",{role:"presentation","data-index":f.index,ref:ce.measureElement,className:Re("absolute left-0 top-0 w-full border-b border-line",k.isRunning&&"pointer-events-none opacity-50"),style:{transform:`translateY(${f.start}px)`},children:r.jsx(Hi,{thread:S,mailboxId:e,isSelected:t===S.messageId,isFocused:M===S.messageId,isTabStop:Ts===S.messageId,onFocusRow:ks,isChecked:ee(S.messageId),onToggleCheck:Y,onRowSelect:xt,isMultiSelectMode:Be,onLongPress:yt,isDesktop:R,onDelete:St,onToggleRead:dt,density:Z})},f.key)})}),y&&r.jsx(vo,{})]})]});return r.jsxs(r.Fragment,{children:[st&&!R&&r.jsx(ft,{tone:"success",variant:"soft",className:"m-2 rounded-md",onDismiss:()=>ae(null),children:st}),r.jsx(So,{listTitle:x,listMeta:b,sections:ps,flatList:!0,listState:B.searchResults?"ready":Dt,searchQuery:T,listFilter:j,listScopeLabel:w,errorMessage:ms,onRetry:l,onReportError:gs,density:Z,selectedThreadId:t,onSelectThread:f=>de(f),isDesktop:R,hideHeader:W,selectionBar:Is,listBody:B.searchResults??(Dt==="ready"?ws:void 0)}),r.jsx(zn,{isOpen:xe!==null,messageIds:xe??[],outcome:re,accountId:I,trashFolderLabel:x,staleFolderLabel:We,guessedMailboxId:Ne,isDeleting:g,onConfirm:ct,onCancel:ut}),r.jsx(Fn,{verb:F,accountId:I,mailboxId:e,mailboxLabel:x,selection:De,selectionRestriction:Ue?"spansAccounts":void 0,escalated:Qe,escalatedProgress:k.progress,onFinished:L,onRunEnded:Ze})]})},Zi=e=>Qt({path:{accountId:e}}),er=e=>{const o=jt(),t=Rt(),s=Mt({...Ys(),onSuccess:()=>{t.recordEvent("sync.triggered"),o.invalidateQueries({queryKey:Zi(e)})}});return{trigger:()=>{s.mutate({path:{accountId:e}})},triggerAsync:()=>s.mutateAsync({path:{accountId:e}}),isPending:s.isPending,error:s.error,reset:s.reset}},tr=({accountId:e,children:o})=>{const{triggerAsync:t,isPending:s}=er(e);return r.jsx(Yo,{onRefresh:t,isRefreshing:s,children:o})};function sr({accountId:e,currentMailboxId:o,candidates:t,onMove:s,children:n}){const[i,l]=c.useState(!1),a=Rt(),u=Xs(),{inboxMailboxId:d}=_n(e),h=Ln(e),{data:g}=mt({...Zs({path:{accountId:e}}),staleTime:1/0}),m=c.useMemo(()=>en({mailboxes:g?.items??[],folderAppointments:h,currentMailboxId:o,translator:u}),[g?.items,h,o,u]),p=c.useMemo(()=>d||(m.find(b=>b.label.toLowerCase()==="inbox")?.id??m.find(b=>!b.isCurrent)?.id??""),[d,m]),v=c.useRef(!1);c.useEffect(()=>{v.current||(v.current=!0,Pn(a,t.length))},[a,t.length]);const y=c.useCallback(()=>{$n(a,t.length),l(!0)},[a,t.length]),I=c.useCallback((x,b)=>{Wn(a,{selected:x.length,total:t.length,toInbox:b===d}),s(x,b)},[a,t.length,d,s]);return r.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[r.jsx("div",{className:"shrink-0 px-row-inset pt-2",children:r.jsx(Zo,{count:t.length,onReview:y})}),r.jsx("div",{className:"min-h-0 flex-1",children:n}),r.jsx(ui,{open:i,candidates:t,defaultDestinationId:p,availableFolders:m,delimiter:tn(g?.items??[]),onConfirmMove:I,onCancel:()=>l(!1)})]})}const nr=(e,o,t,s)=>`${e??""}|${o}|${t??""}|${s??""}`,or=({accountId:e,mailboxId:o})=>{const t=jt(),{pushError:s}=Ht(),{requestAppointment:n}=sn(),{trashByAccount:i}=ns(),l=e?i.get(e):void 0,a=nr(e,o,l?.mailboxId,l?.source),[u,d]=c.useState({scope:a});u.scope!==a&&d({scope:a});const h=u.scope===a?u:void 0,g=c.useCallback(()=>t.getQueryData(nn())?.accounts.find(w=>w.accountId===e)?.folderAppointments.find(w=>w.role==="Trash")?.mailboxId??o,[t,e,o]),m=c.useRef(void 0),{mutateAsync:p,isPending:v}=Mt({...un(),meta:cn(409),onMutate:()=>(m.current=a,{scope:a,listMailboxId:g()}),onSuccess:(b,j,T)=>{T.scope===a&&d({scope:a,deletedCount:b.deletedCount})},onError:(b,j,T)=>{const w=an(b);if(!w){s({title:"Couldn't empty Trash",detail:ln(b),error:b});return}T?.scope===a&&d({scope:a,refusal:w})},onSettled:(b,j,T,w)=>{m.current===w?.scope&&(m.current=void 0),on(t,rn([w?.listMailboxId??o])),e&&t.invalidateQueries({queryKey:Qt({path:{accountId:e}})})}}),y=c.useCallback(()=>e?(d({scope:a}),p({path:{accountId:e}}).then(()=>{},()=>{})):Promise.resolve(),[e,a,p]),I=c.useCallback(()=>{y()},[y]),x=c.useCallback(()=>{const b=h?.refusal;b&&n({accountId:b.accountId,role:b.role,reason:b.reason,action:{kind:"emptyTrash"},onAppointed:y})},[h,n,y]);return{emptyTrash:I,isEmptying:v&&m.current===a,deletedCount:h?.deletedCount,refusal:h?.refusal,repair:x}},ir="We can verify this sender";function rr(e){const{data:o}=mt({...dn({path:{mailboxId:e??""},query:{senderTrust:["vip","wellknown"],dkimMismatch:!1,results:!0,limit:500}}),enabled:!!e,staleTime:6e4});return{candidates:(o?.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:ir,trustSubReason:Bn(s.senderTrust),senderTrust:s.senderTrust}))}}const ar=6e4,lr=({mailboxId:e,criteria:o,enabled:t})=>{const s={...o,count:!0,results:!1},{data:n}=mt({queryKey:Ut({path:{mailboxId:e},query:s}),queryFn:async()=>{const{data:i}=await Jt({path:{mailboxId:e},query:s,throwOnError:!0});return i},enabled:t,staleTime:ar});return t?Po(n?.count):{kind:"unknown"}},cr=e=>{const o=new Set,t=[];for(const s of e)o.has(s.threadMessageId)||(o.add(s.threadMessageId),t.push(s));return t},ur=50,hs=c.createContext(null);function pt(){const e=c.useContext(hs);if(!e)throw new Error("MailboxPane.* must be used inside <MailboxPane>");return e}function dr({mailboxId:e,thread:o,children:t}){const s=Ye(),n=Ro(),i=Qo(),l=o?.threadId,a=o?.messageId,u=Rt(),{accounts:d,searchQuery:h,onToggleIntelligence:g,onSearchClearQuery:m}=Gt(),p=xn(),v=Ho(h),y=v.length>0,{freeText:I,tokens:x}=_t(v,p),b=_t(h.trim(),p).freeText,[j,T]=c.useState("all"),[w,O]=c.useState(new Set),A=c.useMemo(()=>({category:j,attributes:w}),[j,w]),W=c.useMemo(()=>Kn(A),[A]),J=y||Vn(A),{params:G,residual:R}=qn(x,W),oe={order:"desc",...I?{query:I}:{},...G,...W},F={...oe,limit:ur},P={category:F.category,unread:F.unread,starred:F.starred,attachments:F.attachments},Ee=J?Ut({path:{mailboxId:e},query:F}):hn({path:{mailboxId:e},query:{order:"desc"}}),{data:Se,isLoading:ye,isError:B,error:Pe,refetch:ie,fetchNextPage:M,hasNextPage:Ce,isFetchingNextPage:Oe}=yo({queryKey:Ee,queryFn:async({pageParam:C})=>{if(J){const{data:$}=await Jt({path:{mailboxId:e},query:{...F,continuationToken:C},throwOnError:!0});return $}const{data:H}=await pn({path:{mailboxId:e},query:{order:"desc",continuationToken:C},throwOnError:!0});return H},initialPageParam:void 0,getNextPageParam:C=>C.continuationToken,placeholderData:(C,H)=>xo(H?.queryKey,P)?C:void 0}),Ie=lr({mailboxId:e,criteria:oe,enabled:$o({hasSearchQuery:y,freeText:I,residualTokenCount:R.length})}),{accountId:N,isLoading:Z}=Hn(e),$e=Eo({accounts:d}),K=Qn(Un(cr(Se?.pages.flatMap(C=>C.items??[])??[])),R,N),Te=c.useCallback(C=>{T(C)},[]),fe=c.useCallback(C=>{O(H=>{const $=new Set(H);return $.has(C)?$.delete(C):$.add(C),$})},[]),me=c.useCallback(()=>{T("all"),O(new Set)},[]),Ae=c.useCallback(()=>{me(),m()},[me,m]),re=Co({chips:A,tokens:x,reach:R.length>0?"loaded-pages":Jn(F),onClear:Ae}),We=l?K.find(C=>C.messageId===a)??K.find(C=>C.threadId===l):void 0,Ne=Gn(l,a),z=We??Ne,_=a??z?.messageId,ne=c.useMemo(()=>{if(l)return{threadId:l,mailboxId:z?.mailboxId??e,subject:z?.subject,messageId:_,authenticity:z?.authenticity}},[l,z,_,e]),ee=c.useCallback(C=>{_&&C.includes(_)&&n()},[_,n]),{deleteMessages:Y,isPending:ke}=Lt({mailboxId:e,onAfterOptimisticRemove:ee}),{moveMessages:we,isPending:ge}=Pt({mailboxId:e,accountId:N,onAfterOptimisticRemove:ee}),V=c.useRef(null),pe=Yn(),{listCommandsRef:te,onTriageContextChange:Xe,focusedMessageId:Be,selectedIds:xe}=pe,E=K.find(C=>C.messageId===Be)??z,Ze=Oo({accounts:d})??null,je=Xn({thread:z,isOpen:!0,mailboxId:e,accountId:N,onAfterOptimisticRemove:ee}),{draftsMailboxId:et}=Zn(N),k=et!==void 0&&et===e,{archiveMailboxId:tt}=eo(N),Ke=to(),L=fn(),st=c.useMemo(()=>mn(L,l,_),[L,l,_]),ae=c.useMemo(()=>{if(E)return C=>L({threadId:E.threadId,messageId:E.messageId,mode:C})},[L,E]),be=jo(),le=gn(),ze=Mo(),Me=c.useCallback(C=>C?Ke(C):[],[Ke]),{toggleStar:ce}=so({threadId:E?.threadId??"",mailboxId:e}),{toggleReadFor:Ve}=es({mailboxId:e,accountId:N}),{junkMailboxId:q}=ts(N),se=q!=null&&q===e,Fe=ss(q,e),{candidates:nt}=rr(se?q:void 0),{moveMessages:qe}=Pt({mailboxId:e,threadId:E?.threadId,accountId:N,onAfterOptimisticRemove:ee}),{deleteMessages:He}=Lt({mailboxId:e,threadId:E?.threadId,onAfterOptimisticRemove:ee}),{addressId:ve,address:D}=no(E),{updateFlags:De}=oo({addressId:ve,senderEmail:E?.fromEmail??void 0}),xt=c.useCallback(()=>ae?.("reply"),[ae]),ot=c.useCallback(()=>ae?.("reply-all"),[ae]),_e=c.useCallback(()=>ae?.("forward"),[ae]),ue=c.useCallback(()=>Me(E),[Me,E]),it=c.useCallback(()=>{if(te.current?.requestVerb("delete"))return;const C=ue();C.length>0&&He(C)},[te,ue,He]),rt=c.useCallback(()=>{if(te.current?.requestVerb("junk")||!Fe)return;const C=ue();C.length!==0&&(io(u,{count:C.length,senderTrust:E?.senderTrust??"unknown",wasRescuable:E?ro(E):!1}),qe(C,Fe))},[te,Fe,ue,qe,u,E]),at=c.useCallback(()=>{if(xe.length>0){const C=!(E?.hasStars??!1),H=new Set(xe);for(const $ of K)H.has($.messageId)&&$.hasStars!==C&&ce($.messageId,$.hasStars);return}E&&ce(E.messageId,E.hasStars)},[xe,K,E,ce]),de=c.useCallback(()=>{if(te.current?.requestVerb("markRead"))return;const C=ue();if(C.length===0)return;const H=!(E?.isRead??!1);Ve(C,H)},[te,ue,E,Ve]),lt=c.useCallback(()=>{if(!ve)return;const C=D?.flags?.muted?.value!==!0;De({muted:{value:C}})},[ve,D,De]),bt=c.useCallback(()=>{if(!ve)return;const C=D?.flags?.vip?.value!==!0;De({vip:{value:C}})},[ve,D,De]),Qe=c.useCallback(()=>{V.current?.open()},[]),ct=k?"drafts":tt===e?"archive":q===e?"junk":"inbox",ut=c.useRef("");c.useEffect(()=>{const C=ut.current;ut.current=v,v.length>0&&C.length===0&&u.recordEvent("search.submitted",{mailboxType:ct})},[v,ct,u]);const{goBack:Ue,nextMessageId:vt,previousMessageId:St}=ao({context:pe,orderedIds:K.map(C=>C.messageId),selectedMessageId:_,enabled:!be&&!le,hasOpenThread:l!==void 0,onClose:n,handlers:{reply:xt,replyAll:ot,forward:_e,delete:it,toggleStar:at,toggleRead:de,muteSender:lt,blockSender:z?Qe:void 0,vipSender:bt,markJunk:rt,toggleIntelligence:z?()=>V.current?.toggle():void 0,compose:ze,goBrief:()=>i("brief"),goInbox:()=>i("brief"),goSent:()=>i("brief"),goFlagged:()=>i("flagged"),goSettings:()=>i("settings")}}),dt=C=>{if(!C)return;const H=K.find($=>$.messageId===C);return H?{threadId:H.threadId,messageId:C}:void 0},yt={mailboxId:e,selectedMessageId:_,selectedThread:z,conversation:ne,onOpenThread:s,threads:K,isLoading:ye,isError:B,error:Pe,mailboxAccountId:N,mailboxAccountLoading:Z,mailboxName:$e,unreadCount:Ze,isDraftsMailbox:k,isSpamFolder:se,rescueCandidates:nt,filterCategory:j,filterAttributes:w,onSelectFilterCategory:Te,onToggleFilterAttribute:fe,onClearFilters:me,listFilter:re,listSearchText:b||void 0,onToggleIntelligence:g,intelligenceRef:V,handleDeselectIfRemoved:ee,searchPredicate:y&&R.length===0?F:void 0,resultCount:Ie,onDeleteMessages:Y,onMoveMessages:we,isDeleting:ke,isMoving:ge,onLoadMore:M,hasMore:Ce,isLoadingMore:Oe,onTriageContextChange:Xe,listCommandsRef:te,onRetry:()=>ie(),onReply:st,onToolbarDelete:je.deleteThread,onToolbarStar:je.toggleStar,isStarred:je.isStarred,onToolbarMove:je.moveThread,onBack:Ue,nextThread:dt(vt),previousThread:dt(St)};return r.jsx(hs.Provider,{value:yt,children:t})}function fs(){const{mailboxId:e,selectedMessageId:o,threads:t,isLoading:s,isError:n,error:i,onDeleteMessages:l,onMoveMessages:a,isDeleting:u,isMoving:d,onLoadMore:h,hasMore:g,isLoadingMore:m,mailboxAccountId:p,mailboxName:v,unreadCount:y,isDraftsMailbox:I,isSpamFolder:x,rescueCandidates:b,onTriageContextChange:j,listCommandsRef:T,onRetry:w,filterCategory:O,filterAttributes:A,onSelectFilterCategory:W,onToggleFilterAttribute:J,onClearFilters:G,listFilter:R,listSearchText:oe,searchPredicate:F,resultCount:P}=pt(),{searchQuery:Ee,searchInput:Se,accounts:ye,resultFolderIndex:B}=Gt(),Pe=qo(),ie=Ye(),M=v??"Inbox",Ce=c.useMemo(()=>fo(),[]),{trashMailboxId:Oe}=mo(p),Ie=Ao({accounts:ye}),{trashByAccount:N}=ns(),Z=or({accountId:p,mailboxId:e}),$e=Oe!=null&&Oe===e,K=c.useMemo(()=>p?[p]:[],[p]),{hasNewMail:Te}=vn(),{state:fe,errorMessage:me,refresh:Ae}=Sn(K,{onSettled:w}),re=c.useMemo(()=>r.jsx(yn,{state:fe,onRefresh:Ae,label:`Refresh ${M}`,errorMessage:me,hasUpdate:Te(K)}),[fe,Ae,M,me,Te,K]),We=c.useMemo(()=>t.map(V=>go(V,B)),[t,B]),{hits:Ne,isLoading:z}=Wo({mailboxId:e,filterCategory:O}),_=c.useMemo(()=>po(Ne,t.map(V=>V.threadId),B),[Ne,t,B]),ne=c.useCallback(V=>{const pe=V.threadId??t.find(te=>te.messageId===V.id)?.threadId;pe&&ie({threadId:pe,messageId:V.id},{mailboxId:V.mailboxId??e,query:Se})},[e,ie,Se,t]);if(I&&p)return r.jsx(xi,{accountId:p,selectedMessageId:o,imapThreads:t,title:v??"Drafts",unreadCount:y??void 0});const ee=r.jsx(Xi,{mailboxId:e,threads:t,selectedMessageId:o,isLoading:s,isError:n,error:i,onRetry:w,searchQuery:Ee,searchPredicate:F,resultCount:P,onDeleteMessages:l,isDeleting:u,isMoving:d,onLoadMore:h,hasMore:g,isLoadingMore:m,accountId:p,listTitle:M,listFilter:R,listSearchText:oe,listScopeLabel:M,hideHeader:!0,onTriageContextChange:j,commandsRef:T}),Y=ye[0]?.accountId,ke=Pe==="phone"&&Y?r.jsx(tr,{accountId:Y,children:ee}):ee,we=x&&b.length>0&&p?r.jsx(sr,{accountId:p,currentMailboxId:e,candidates:b,onMove:a,children:ke}):ke,ge=$e?r.jsx(Si,{messageCount:Ie,isEmptying:Z.isEmptying,deletedCount:Z.deletedCount,refusalReason:Z.refusal?.reason,trashFolderLabel:v??void 0,staleFolderLabel:p?N.get(p)?.staleFolderPath:void 0,onEmpty:Z.emptyTrash,onRepair:Z.repair,children:we}):we;return r.jsx(Io,{title:M,unreadCount:y,preset:Ce,selectedCategory:O,activeFilters:A,onSelectCategory:W,onToggleFilter:J,onClearFilters:G,searchResults:We,searchLoading:s,relatedResults:_,relatedLoading:z,onSelectSearchResult:ne,searchResultsInBody:!0,refreshControl:re,children:ge})}function hr(){const e=Ot(),{mailboxId:o,mailboxAccountId:t,mailboxAccountLoading:s,selectedThread:n,conversation:i,onReply:l,onToolbarDelete:a,onToolbarStar:u,isStarred:d,onToolbarMove:h,handleDeselectIfRemoved:g,intelligenceRef:m}=pt(),p=!!i,v=uo(i?.threadId);os(m,v);const y=c.useRef(null),{railFits:I,openRail:x}=v;c.useEffect(()=>{if(!I)return;const j=n?.messageId??null;j&&y.current!==j&&n?.authenticity?.dkimMismatch&&(y.current=j,x())},[I,x,n?.messageId,n?.authenticity?.dkimMismatch]);const b=i?r.jsx(is,{threadId:i.threadId,mailboxId:i.mailboxId,subject:i.subject,selectedMessageId:i.messageId,authenticity:i.authenticity,onOpenIntelligence:v.open,listOnScreen:!0}):r.jsx(bn,{});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(ho,{hasThread:p,messageId:i?.messageId,intelligenceOpen:v.isShowing,canToggleIntelligence:v.canToggle,onToggleIntelligence:v.toggle,onReply:l?()=>l("reply"):void 0,onReplyAll:l?()=>l("reply-all"):void 0,onForward:l?()=>l("forward"):void 0,onDelete:p?a:void 0,onToggleStar:p?u:void 0,isStarred:d,moveContext:p&&t?{accountId:t,currentMailboxId:o,onMove:h}:void 0,moveContextLoading:s}),r.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:b})]}),r.jsx(rs,{isOpen:v.drawerOpen,onClose:v.closeDrawer,thread:n,mailboxId:o,accountId:t,onAfterOptimisticRemove:g,onReplyWithText:e})]})}function fr(){const e=Ot(),{mailboxId:o,mailboxAccountId:t,selectedThread:s,onToggleIntelligence:n,handleDeselectIfRemoved:i}=pt();return r.jsx(co,{onClose:n,thread:s,mailboxId:o,accountId:t,onAfterOptimisticRemove:i,onReplyWithText:e})}function mr(){const e=Ot(),{mailboxId:o,mailboxAccountId:t,selectedThread:s,conversation:n,onOpenThread:i,onBack:l,nextThread:a,previousThread:u,handleDeselectIfRemoved:d,intelligenceRef:h}=pt(),g=lo(n?.threadId??null);return os(h,g),n?r.jsxs(r.Fragment,{children:[r.jsx(is,{threadId:n.threadId,mailboxId:n.mailboxId,subject:n.subject,selectedMessageId:n.messageId,authenticity:n.authenticity,onBack:l,onOpenIntelligence:g.toggle,onSwipeNext:a?()=>i(a):void 0,onSwipePrevious:u?()=>i(u):void 0,mobileIntelligenceOpen:g.isOpen}),r.jsx(rs,{isOpen:g.isOpen,onClose:g.close,thread:s,mailboxId:o,accountId:t,onAfterOptimisticRemove:d,onReplyWithText:e})]}):r.jsx(fs,{})}const Pr=Object.assign(dr,{List:fs,Reading:hr,Intelligence:fr,Phone:mr});export{Pr as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as n,j as a,f as o}from"./index-
|
|
1
|
+
import{v as n,j as a,f as o}from"./index-DKo99WG1.js";import{M as e}from"./menu-u9D-cJXQ.js";function i(){const s=n();return!s||s.showNavPane?null:a.jsx(o,{variant:"ghost",size:"sm",icon:a.jsx(e,{className:"size-4"}),onClick:s.openNav,"aria-label":"Open folders",className:"-ml-1 shrink-0"})}export{i as N};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as le,r as t,j as e,B as L,h as de,i as te,o as ue,ax as me,c as D,aT as Q,d as U,f as C,L as G,aU as W,ay as pe,az as q,I as he,n as fe}from"./index-J89guRVU.js";import{C as xe}from"./checkbox-lv4ht1p0.js";import{K as ge}from"./kbd-CKw25IK5.js";import{A as ye,c as ve,d as Se,s as V,W as R,C as _,g as je,e as K,f as be,h as Ce,a as X,S as we,b as ke,R as Ee}from"./credential-steps-8oD-bgsd.js";import{c as Ne}from"./account-form-helpers-DhckT_PN.js";import{M as Ae}from"./mail-Daw23XZE.js";import{F as Me}from"./file-json-DgAW6fCg.js";const se=le("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]),Te="Pick at least one. An account has to sync something.",ne=[{id:"Mail",label:"Mail",description:"Messages, folders and sending."},{id:"Calendar",label:"Calendar",description:"This account's provider calendar, read into Remit."}];function Ie({providerName:s,offered:i,selected:c,onChange:o,error:u}){const g=t.useId(),r=ne.filter(p=>i.includes(p.id)),f=u?e.jsx(L,{tone:"danger",variant:"soft",className:"mt-2 text-xs",children:u}):null;if(r.length<2)return f;const l=(p,y)=>{if(!y){o(c.filter(a=>a!==p));return}o(r.filter(a=>a.id===p||c.includes(a.id)).map(a=>a.id))};return e.jsxs("fieldset",{"aria-describedby":g,children:[e.jsx("legend",{className:"text-sm font-semibold text-fg",children:"What should Remit sync?"}),e.jsx("div",{className:"mt-1 divide-y divide-line",children:r.map(p=>e.jsx(xe,{label:p.label,description:p.description,checked:c.includes(p.id),onChange:y=>l(p.id,y.target.checked)},p.id))}),e.jsx("p",{id:g,className:"mt-1.5 text-2xs text-fg-subtle",children:`Adding a service later means signing in with ${s} again.`}),f]})}const ae=[{id:"icloud",label:"iCloud",username:"full-email",imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},passwordHelp:{text:"iCloud requires an app-specific password, not your Apple ID password. Generate one under Sign-In & Security → App-Specific Passwords.",url:"https://support.apple.com/en-us/102654"}},{id:"yahoo",label:"Yahoo",username:"full-email",imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},passwordHelp:{text:"Yahoo requires an app password, not your login password. Generate one under Account Security.",url:"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html"}},{id:"aol",label:"AOL",username:"full-email",imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},passwordHelp:{text:"AOL requires an app password, not your login password. Generate one under Account Security.",url:"https://login.aol.com/account/security"}},{id:"fastmail",label:"Fastmail",username:"full-email",imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},passwordHelp:{text:"Fastmail requires an app password, not your login password. Create one under Settings → Privacy & Security → App passwords.",url:"https://www.fastmail.help/hc/en-us/articles/360058752854"}},{id:"gmail",label:"Gmail",username:"full-email",imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},passwordHelp:{text:"Gmail requires an app password, not your Google password. First turn on 2-Step Verification for your Google Account, then create an app password under Security → 2-Step Verification → App passwords.",url:ye["gmail.com"]}}];function Y(s){return ae.find(i=>i.id===s)}const Pe={"icloud.com":"icloud","me.com":"icloud","mac.com":"icloud","yahoo.com":"yahoo","yahoo.co.uk":"yahoo","ymail.com":"yahoo","aol.com":"aol","fastmail.com":"fastmail","fastmail.fm":"fastmail","gmail.com":"gmail","googlemail.com":"gmail"};function Re(s){const i=s.indexOf("@");if(i===-1)return"";const c=s.slice(i+1).toLowerCase();return Pe[c]??""}const M=["Connector","Address","Servers","Credentials","Test","Sync"],P={connector:0,"microsoft-granted":5,address:1,servers:2,credentials:3,test:4,sync:5},J={host:"",port:993,security:"tls"},Z={host:"",port:587,security:"starttls"};function Fe({onStart:s,onImportConfig:i}){return t.useEffect(()=>{const c=o=>{o.key==="Enter"&&s()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),e.jsx(R,{steps:M,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:i?"Set up your first account, or bring the settings from another Reader.":"One inbox for all your mail, with context about every message.",footer:e.jsxs(e.Fragment,{children:[i?e.jsx(C,{variant:"secondary",icon:e.jsx(Me,{className:"size-4"}),onClick:i,children:"Import a config file"}):e.jsxs("span",{className:"text-2xs text-fg-subtle",children:[e.jsx(ge,{children:"Enter"})," to continue"]}),e.jsx(C,{variant:"primary",onClick:s,children:"Add your first account"})]}),children:e.jsxs("div",{className:"flex flex-col items-start py-5",children:[e.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:e.jsx(Ae,{className:"size-7 text-accent"})}),e.jsx("p",{className:"mt-5 max-w-sm text-sm leading-relaxed text-fg-muted",children:"Remit syncs your existing mailboxes and tells you who is really writing to you — sender history, authenticity checks, and similar messages, right next to every email."}),i&&e.jsx("p",{className:"mt-3 max-w-sm text-sm leading-relaxed text-fg-muted",children:"A config file carries your accounts, folder roles, rules, flagged senders and appearance from another Reader. It never carries passwords, so you sign in again here."})]})})}function Le({onContinue:s,onMicrosoft:i,onBack:c,showBack:o}){const[u,g]=t.useState("imap");t.useEffect(()=>{const f=l=>{l.key==="Enter"&&(u==="microsoft"?i():s()),l.key==="Escape"&&c()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[s,i,c,u]);const r=()=>{u==="microsoft"?i():s()};return e.jsx(R,{steps:M,activeStep:P.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:e.jsxs(e.Fragment,{children:[o?e.jsx(C,{variant:"ghost",onClick:c,children:"Back"}):e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:r,children:u==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(X,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:e.jsx(we,{className:"size-5"}),selected:u==="imap",onSelect:()=>g("imap")}),e.jsx(X,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:e.jsx(he,{className:"size-5"}),selected:u==="microsoft",onSelect:()=>g("microsoft")})]})})}const ee=["Mail","Calendar"];function Oe({refusal:s,onBack:i,onConnected:c}){const[o,u]=t.useState(s?.email??""),[g,r]=t.useState(s?.services??ee),[f,l]=t.useState(!1),[p,y]=t.useState(s?.message??null),[a,w]=t.useState(!1),[N,j]=t.useState(!1),h=t.useRef(!0);t.useEffect(()=>(h.current=!0,()=>{h.current=!1}),[]);const v=t.useRef(new Set),{refetch:b}=D(U()),k=ke(d=>{if(j(!1),d==="stalled"){w(!1),y(Ee);return}b().then(({data:S,isError:x})=>{if(!h.current)return;if(x||!S){y("Couldn't check whether the sign-in finished. Open Settings › Accounts to see whether the account is connected.");return}y(null);const m=S.accounts.find(n=>!v.current.has(n.accountId));m&&c(m.accountId)})}),F=te({...fe(),onSuccess:d=>{h.current&&(k(),w(!0),window.location.assign(d.authorizationUrl))},onError:d=>{j(!1),y(d instanceof Error?d.message:"Failed to start sign-in")}}),T=N||F.isPending,A=()=>{if(!T){if(g.length===0){l(!0);return}y(null),j(!0),b().then(({data:d,isError:S})=>{if(h.current){if(S||!d){j(!1),y("Couldn't read this instance's accounts, so sign-in can't be tracked. Check your connection and try again.");return}v.current=new Set(d.accounts.map(x=>x.accountId)),F.mutate({body:{email:o.trim()||void 0,services:g}})}})}},I=t.useRef(A);return I.current=A,t.useEffect(()=>{const d=S=>{S.key==="Enter"&&I.current(),S.key==="Escape"&&i()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[i]),e.jsx(R,{steps:M,activeStep:P.connector,title:s?.reconnect&&s.email?`Reconnect ${s.email}`:"Sign in with Microsoft",subtitle:"Microsoft is asked for the mail and calendar access you pick here.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:i,children:"Back"}),e.jsx(C,{variant:"primary",onClick:A,disabled:T,icon:T?e.jsx(G,{className:"size-4 animate-spin"}):void 0,children:T?"Redirecting…":a?"Start over":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ie,{providerName:"Microsoft",offered:ee,selected:g,onChange:d=>{r(d),d.length>0&&l(!1)},error:f?Te:void 0}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"microsoft-email",children:"Email address (optional)"}),e.jsx(q,{id:"microsoft-email",icon:e.jsx(se,{className:"size-4"}),placeholder:"you@outlook.com",value:o,onChange:d=>u(d.target.value),type:"email",autoComplete:"email"}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"Pre-fills the Microsoft sign-in form. Leave blank to choose on the Microsoft page."})]}),a&&e.jsx(L,{tone:"info",children:"Waiting for Microsoft. Finish signing in — this window carries on the moment the account is connected, wherever you finished."}),p&&e.jsx(L,{tone:"danger",children:p})]})})}function _e({accountId:s,onSignInAgain:i,onContinue:c}){const{data:o,isError:u,isFetching:g,refetch:r}=D(U()),f=o?.accounts.find(l=>l.accountId===s);return u?e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"Couldn't read the new account",subtitle:"Microsoft finished, but this instance did not answer.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:()=>{r()},disabled:g,children:"Retry"})]}),children:e.jsx(L,{tone:"danger",children:"Couldn't load the account Microsoft just connected. Check your connection and retry, or open Settings › Accounts to see it."})}):!o||!f&&g?e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"Reading the new account",subtitle:"Checking what Microsoft granted.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Loading…"}),e.jsx("span",{})]}),children:e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(G,{className:"size-4 animate-spin text-accent"}),"Loading the account…"]})}):f?e.jsx(Ge,{account:f,onContinue:c}):e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"The account is not here",subtitle:"Microsoft sent the sign-in back, but no account was kept.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:i,children:"Sign in again"})]}),children:e.jsx(L,{tone:"danger",children:"This instance holds no account from that sign-in. Sign in with Microsoft again to connect it."})})}function Ge({account:s,onContinue:i}){const c=s.syncedServices.includes("Mail");return e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:`Connected ${s.email}`,subtitle:"Microsoft granted access to what you picked.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Change this later in Settings › Accounts"}),e.jsx(C,{variant:"primary",onClick:()=>i(s.accountId),children:c?"Go to inbox":"Continue"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"divide-y divide-line",children:ne.map(o=>s.syncedServices.includes(o.id)?e.jsx(_,{label:o.label,detail:"Access granted — syncing",state:"ok"},o.id):e.jsx(_,{label:o.label,detail:"Not synced. Turn it on in Settings › Accounts; Microsoft asks for access then.",state:"pending"},o.id))}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Permissions Microsoft granted"}),e.jsx("code",{className:"mt-1 block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted","data-testid":"granted-scopes",children:s.grantedScopes.join(" ")})]})]})})}function He({initialEmail:s,initialDisplayName:i,onContinue:c,onBack:o}){const[u,g]=t.useState(s),[r,f]=t.useState(i),[l,p]=t.useState(!1),[y,a]=t.useState(""),[w,N]=t.useState(null),j=t.useCallback(async()=>{const h=u.trim();if(!h.includes("@")||!h.includes(".")){N("Enter a valid email address.");return}N(null),p(!0),a(be(h));try{const v=await Ce(h);c(h,r.trim(),v)}finally{p(!1)}},[u,r,c]);return t.useEffect(()=>{const h=v=>{v.key==="Enter"&&!l&&j(),v.key==="Escape"&&o()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[j,l,o]),e.jsx(R,{steps:M,activeStep:P.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:o,children:"Back"}),e.jsx(C,{variant:"primary",disabled:l,onClick:()=>{j()},children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(W,{htmlFor:"onboarding-email",children:"Email address"}),e.jsx(q,{id:"onboarding-email",icon:e.jsx(se,{className:"size-4"}),placeholder:"you@example.com",value:u,onChange:h=>{g(h.target.value),N(null)},type:"email",autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),e.jsx(q,{id:"onboarding-display-name",placeholder:"Alice",value:r,onChange:h=>f(h.target.value)}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),l&&e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(G,{className:"size-3.5 animate-spin text-accent"}),y]}),w&&!l&&e.jsx("div",{className:"mt-3",children:e.jsx(L,{tone:"danger",children:w})})]})})}function ze({email:s,imapConfig:i,smtpConfig:c,discovered:o,onContinue:u,onBack:g,onChange:r}){const[f,l]=t.useState(i),[p,y]=t.useState(c),[a,w]=t.useState(()=>Re(s)),[N,j]=t.useState(!1),[h,v]=t.useState(null),b=Y(a),k=b!==void 0&&!N,F=t.useCallback(m=>{w(m),j(!1),v(null);const n=Y(m);n&&(l({host:n.imap.host,port:n.imap.port,security:n.imap.security}),y({host:n.smtp.host,port:n.smtp.port,security:n.smtp.security}))},[]);t.useEffect(()=>{r(f,p)},[f,p,r]);const T=f.host.trim()!=="",A=t.useCallback(()=>{if(!T){v("Enter the IMAP host.");return}v(null),u()},[T,u]);t.useEffect(()=>{const m=n=>{n.key==="Enter"&&A(),n.key==="Escape"&&g()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[A,g]);const I=s.split("@")[1]??"your domain",d=b?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":o?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${I} — enter them manually.`,S=k?{label:"preset",tone:"neutral"}:!b&&o?{label:"detected",tone:"positive"}:void 0,x=b?.passwordHelp.url??je(s);return e.jsx(R,{steps:M,activeStep:P.servers,title:"Confirm server settings",subtitle:d,footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:g,children:"Back"}),e.jsx(C,{variant:"primary",onClick:A,children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-5",children:[h&&e.jsx(L,{tone:"danger",children:h}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"provider-select",children:"Provider"}),e.jsxs(pe,{id:"provider-select",value:a,onChange:m=>F(m.target.value),children:[e.jsx("option",{value:"",children:"Custom / other"}),ae.map(m=>e.jsx("option",{value:m.id,children:m.label},m.id))]}),b&&e.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:k?e.jsxs(e.Fragment,{children:["Server settings are pre-filled for ",b.label," and locked."," ",e.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>j(!0),children:"Advanced"})," ","lets you edit them by hand."]}):e.jsxs(e.Fragment,{children:["Editing ",b.label,"'s settings by hand."]})})]}),e.jsx(K,{legend:"IMAP — incoming",badge:S,readOnly:k,host:f.host,port:String(f.port),security:f.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:m=>{l(n=>({...n,host:m})),v(null)},onPortChange:m=>l(n=>({...n,port:Number(m)})),onSecurityChange:m=>l(n=>({...n,security:m}))}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Sending (SMTP) is optional — leave it blank to set up a receive-only account and add sending later in Settings."}),e.jsx(K,{legend:"SMTP — outgoing (optional)",badge:S,readOnly:k,host:p.host,port:String(p.port),security:p.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:m=>{y(n=>({...n,host:m})),v(null)},onPortChange:m=>y(n=>({...n,port:Number(m)})),onSecurityChange:m=>y(n=>({...n,security:m}))}),b&&e.jsxs("p",{className:"text-2xs text-fg-subtle",children:[b.passwordHelp.text," ",x&&e.jsx("a",{href:x,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}const Be=2e4;function De({email:s,displayName:i,imapConfig:c,smtpConfig:o,username:u,password:g,onGoToInbox:r}){const f=de(),[l,p]=t.useState(null),[y,a]=t.useState(null),w=t.useRef(!1),N=V(c.security),j=V(o.security),h=te({...me(),onSuccess:E=>{p(E.accountId),f.invalidateQueries({queryKey:ue()})},onError:E=>{a(E instanceof Error?E.message:"Failed to create account")}});t.useEffect(()=>{if(w.current)return;w.current=!0;const E=o.host.trim()!=="",z=Ne({imapHost:c.host,smtpHost:o.host,smtpPort:o.port}),B=E?z??{smtpHost:o.host,smtpPort:o.port,smtpTls:j.tls,smtpStartTls:j.startTls}:null;h.mutate({body:{email:s,displayName:i||void 0,username:u!==s?u:void 0,password:g,imapHost:c.host,imapPort:c.port,imapTls:N.tls,imapStartTls:N.startTls,smtpHost:B?.smtpHost||void 0,smtpPort:B?.smtpPort||void 0,smtpTls:B?.smtpTls??!1,smtpStartTls:B?.smtpStartTls??!1}})},[]);const{data:v,isError:b}=D({...Q({path:{accountId:l??""}}),enabled:!!l,refetchInterval:E=>{const z=E.state.data?.syncPhase;return z==="complete"||z==="error"?!1:2e3}}),k=v?.syncPhase==="error",{data:F}=D({...U(),enabled:!!l&&k}),T=F?.accounts.find(E=>E.accountId===l)?.lastError,A=v?.mailboxes.find(E=>E.fullPath==="INBOX"||E.fullPath==="Inbox"),I=v?.mailboxCountTotal??0,d=v?.mailboxCountSynced??0,S=A?.messagesTotal??0,x=A?.messagesSynced??0,m=S>0?x/S:0,n=v?.syncPhase,H=k?"failed":n==="idle"||n===void 0||n==="discovering_mailboxes"?"running":I>0?"ok":"running",O=k?"failed":!n||n==="idle"||n==="discovering_mailboxes"?"pending":n==="syncing_inbox"||n==="syncing_others"?"running":"ok",$=k?"failed":!n||n==="idle"||n==="discovering_mailboxes"||n==="syncing_inbox"?"pending":n==="syncing_others"?"running":"ok",ie=x>0||A?.phase==="complete"||n==="complete"||k,[oe,re]=t.useState(!1);t.useEffect(()=>{if(!l)return;const E=setTimeout(()=>re(!0),Be);return()=>clearTimeout(E)},[l]);const ce=!!l&&(ie||b||oe);return y?e.jsx(R,{steps:M,activeStep:P.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:()=>{w.current=!1,a(null),h.mutate({body:{email:s,displayName:i||void 0,username:u!==s?u:void 0,password:g,imapHost:c.host,imapPort:c.port,imapTls:N.tls,imapStartTls:N.startTls,smtpHost:o.host||void 0,smtpPort:o.port||void 0,smtpTls:j.tls,smtpStartTls:j.startTls}})},children:"Retry"})]}),children:e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:y})}):e.jsx(R,{steps:M,activeStep:P.sync,title:`Syncing ${s}`,subtitle:"Newest mail first — you can start reading right away.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),ce?e.jsx(C,{variant:"primary",onClick:()=>l&&r(l),children:"Go to inbox"}):e.jsx(C,{variant:"primary",disabled:!0,icon:e.jsx(G,{className:"size-3.5 animate-spin"}),children:"Getting your mail…"})]}),children:h.isPending?e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(G,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):e.jsxs("div",{className:"space-y-3",children:[S>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[e.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),e.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[x.toLocaleString()," / ",S.toLocaleString()," ","messages"]})]}),e.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,m*100)}%`}})})]}),e.jsxs("div",{className:"divide-y divide-line",children:[e.jsx(_,{label:"Mailboxes discovered",detail:I>0?`${I} mailbox${I===1?"":"es"} found`:"Discovering…",state:H}),e.jsx(_,{label:"INBOX",detail:O==="ok"?`${x.toLocaleString()} messages synced`:O==="running"?"Syncing newest first…":"Queued",state:O}),d>1||n==="syncing_others"||n==="complete"?e.jsx(_,{label:"Other mailboxes",detail:$==="ok"?`${d-1} mailboxes synced`:$==="running"?"Syncing…":"Queued",state:$}):null]}),k&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>{f.invalidateQueries({queryKey:Q({path:{accountId:l??""}}).queryKey})},children:"retry"})]}),T&&e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:T})]})]})})}const We=(s,i)=>i?.kind==="connected"?"microsoft-granted":i?.kind==="refused"?"microsoft-email":s?"connector":"welcome";function Ye({skipWelcome:s=!1,onComplete:i,onCancel:c,onImportConfig:o,microsoftReturn:u}){const[g,r]=t.useState(We(s,u)),[f,l]=t.useState(u?.kind==="refused"?u:void 0),[p,y]=t.useState(u?.kind==="connected"?u.accountId:null),[a,w]=t.useState({email:"",displayName:"",imapConfig:J,smtpConfig:Z,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),N=t.useCallback(()=>r("connector"),[]),j=t.useCallback(()=>r("address"),[]),h=t.useCallback(()=>r("microsoft-email"),[]),v=t.useCallback(()=>{s?c?.():r("welcome")},[s,c]),b=t.useCallback((d,S,x)=>{let m=J,n=Z,H=!1;x&&(H=x.source!=="heuristic",m={host:x.imap.host,port:x.imap.port,security:x.imap.security},n={host:x.smtp.host,port:x.smtp.port,security:x.smtp.security}),w(O=>({...O,email:d,displayName:S,imapConfig:m,smtpConfig:n,discoveryResult:x,discovered:H,username:d})),r("servers")},[]),k=t.useCallback((d,S)=>{w(x=>({...x,imapConfig:d,smtpConfig:S}))},[]),F=t.useCallback((d,S)=>{w(x=>({...x,username:d,password:S}))},[]),T=t.useCallback(()=>r("sync"),[]),A=t.useCallback(d=>{i(d)},[i]),I=e.jsx(Oe,{refusal:f,onBack:()=>{l(void 0),r("connector")},onConnected:d=>{y(d),r("microsoft-granted")}});switch(g){case"welcome":return e.jsx(Fe,{onStart:N,onImportConfig:o});case"connector":return e.jsx(Le,{onContinue:j,onMicrosoft:h,onBack:v,showBack:!s});case"microsoft-email":return I;case"microsoft-granted":return p===null?I:e.jsx(_e,{accountId:p,onSignInAgain:()=>r("microsoft-email"),onContinue:A});case"address":return e.jsx(He,{initialEmail:a.email,initialDisplayName:a.displayName,onContinue:b,onBack:()=>r("connector")});case"servers":return e.jsx(ze,{email:a.email,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,discovered:a.discovered,onContinue:()=>r("credentials"),onBack:()=>r("address"),onChange:k});case"credentials":return e.jsx(Se,{steps:M,activeStep:P.credentials,title:`Sign in to ${a.email.split("@")[1]||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",email:a.email,username:a.username,password:a.password,onContinue:()=>r("test"),onBack:()=>r("servers"),onChange:F});case"test":return e.jsx(ve,{steps:M,activeStep:P.test,email:a.email,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,username:a.username,password:a.password,onSuccess:T,onBackToCredentials:()=>r("credentials"),onBackToServers:()=>r("servers")});case"sync":return e.jsx(De,{email:a.email,displayName:a.displayName,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,username:a.username,password:a.password,onGoToInbox:A})}}export{ne as A,Ye as O,ae as P,Y as g};
|
|
1
|
+
import{e as le,r as t,j as e,B as L,h as de,i as te,o as ue,ax as me,c as D,aT as Q,d as U,f as C,L as G,aU as W,ay as pe,az as q,I as he,n as fe}from"./index-DKo99WG1.js";import{C as xe}from"./checkbox-B_JY_6mN.js";import{K as ge}from"./kbd-xYIrsDlz.js";import{A as ye,c as ve,d as Se,s as V,W as R,C as _,g as je,e as K,f as be,h as Ce,a as X,S as we,b as ke,R as Ee}from"./credential-steps-uXZK9Zmr.js";import{c as Ne}from"./account-form-helpers-DhckT_PN.js";import{M as Ae}from"./mail-DxfGucaQ.js";import{F as Me}from"./file-json-CCQAXfEc.js";const se=le("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]),Te="Pick at least one. An account has to sync something.",ne=[{id:"Mail",label:"Mail",description:"Messages, folders and sending."},{id:"Calendar",label:"Calendar",description:"This account's provider calendar, read into Remit."}];function Ie({providerName:s,offered:i,selected:c,onChange:o,error:u}){const g=t.useId(),r=ne.filter(p=>i.includes(p.id)),f=u?e.jsx(L,{tone:"danger",variant:"soft",className:"mt-2 text-xs",children:u}):null;if(r.length<2)return f;const l=(p,y)=>{if(!y){o(c.filter(a=>a!==p));return}o(r.filter(a=>a.id===p||c.includes(a.id)).map(a=>a.id))};return e.jsxs("fieldset",{"aria-describedby":g,children:[e.jsx("legend",{className:"text-sm font-semibold text-fg",children:"What should Remit sync?"}),e.jsx("div",{className:"mt-1 divide-y divide-line",children:r.map(p=>e.jsx(xe,{label:p.label,description:p.description,checked:c.includes(p.id),onChange:y=>l(p.id,y.target.checked)},p.id))}),e.jsx("p",{id:g,className:"mt-1.5 text-2xs text-fg-subtle",children:`Adding a service later means signing in with ${s} again.`}),f]})}const ae=[{id:"icloud",label:"iCloud",username:"full-email",imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},passwordHelp:{text:"iCloud requires an app-specific password, not your Apple ID password. Generate one under Sign-In & Security → App-Specific Passwords.",url:"https://support.apple.com/en-us/102654"}},{id:"yahoo",label:"Yahoo",username:"full-email",imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},passwordHelp:{text:"Yahoo requires an app password, not your login password. Generate one under Account Security.",url:"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html"}},{id:"aol",label:"AOL",username:"full-email",imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},passwordHelp:{text:"AOL requires an app password, not your login password. Generate one under Account Security.",url:"https://login.aol.com/account/security"}},{id:"fastmail",label:"Fastmail",username:"full-email",imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},passwordHelp:{text:"Fastmail requires an app password, not your login password. Create one under Settings → Privacy & Security → App passwords.",url:"https://www.fastmail.help/hc/en-us/articles/360058752854"}},{id:"gmail",label:"Gmail",username:"full-email",imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},passwordHelp:{text:"Gmail requires an app password, not your Google password. First turn on 2-Step Verification for your Google Account, then create an app password under Security → 2-Step Verification → App passwords.",url:ye["gmail.com"]}}];function Y(s){return ae.find(i=>i.id===s)}const Pe={"icloud.com":"icloud","me.com":"icloud","mac.com":"icloud","yahoo.com":"yahoo","yahoo.co.uk":"yahoo","ymail.com":"yahoo","aol.com":"aol","fastmail.com":"fastmail","fastmail.fm":"fastmail","gmail.com":"gmail","googlemail.com":"gmail"};function Re(s){const i=s.indexOf("@");if(i===-1)return"";const c=s.slice(i+1).toLowerCase();return Pe[c]??""}const M=["Connector","Address","Servers","Credentials","Test","Sync"],P={connector:0,"microsoft-granted":5,address:1,servers:2,credentials:3,test:4,sync:5},J={host:"",port:993,security:"tls"},Z={host:"",port:587,security:"starttls"};function Fe({onStart:s,onImportConfig:i}){return t.useEffect(()=>{const c=o=>{o.key==="Enter"&&s()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),e.jsx(R,{steps:M,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:i?"Set up your first account, or bring the settings from another Reader.":"One inbox for all your mail, with context about every message.",footer:e.jsxs(e.Fragment,{children:[i?e.jsx(C,{variant:"secondary",icon:e.jsx(Me,{className:"size-4"}),onClick:i,children:"Import a config file"}):e.jsxs("span",{className:"text-2xs text-fg-subtle",children:[e.jsx(ge,{children:"Enter"})," to continue"]}),e.jsx(C,{variant:"primary",onClick:s,children:"Add your first account"})]}),children:e.jsxs("div",{className:"flex flex-col items-start py-5",children:[e.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:e.jsx(Ae,{className:"size-7 text-accent"})}),e.jsx("p",{className:"mt-5 max-w-sm text-sm leading-relaxed text-fg-muted",children:"Remit syncs your existing mailboxes and tells you who is really writing to you — sender history, authenticity checks, and similar messages, right next to every email."}),i&&e.jsx("p",{className:"mt-3 max-w-sm text-sm leading-relaxed text-fg-muted",children:"A config file carries your accounts, folder roles, rules, flagged senders and appearance from another Reader. It never carries passwords, so you sign in again here."})]})})}function Le({onContinue:s,onMicrosoft:i,onBack:c,showBack:o}){const[u,g]=t.useState("imap");t.useEffect(()=>{const f=l=>{l.key==="Enter"&&(u==="microsoft"?i():s()),l.key==="Escape"&&c()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[s,i,c,u]);const r=()=>{u==="microsoft"?i():s()};return e.jsx(R,{steps:M,activeStep:P.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:e.jsxs(e.Fragment,{children:[o?e.jsx(C,{variant:"ghost",onClick:c,children:"Back"}):e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:r,children:u==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(X,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:e.jsx(we,{className:"size-5"}),selected:u==="imap",onSelect:()=>g("imap")}),e.jsx(X,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:e.jsx(he,{className:"size-5"}),selected:u==="microsoft",onSelect:()=>g("microsoft")})]})})}const ee=["Mail","Calendar"];function Oe({refusal:s,onBack:i,onConnected:c}){const[o,u]=t.useState(s?.email??""),[g,r]=t.useState(s?.services??ee),[f,l]=t.useState(!1),[p,y]=t.useState(s?.message??null),[a,w]=t.useState(!1),[N,j]=t.useState(!1),h=t.useRef(!0);t.useEffect(()=>(h.current=!0,()=>{h.current=!1}),[]);const v=t.useRef(new Set),{refetch:b}=D(U()),k=ke(d=>{if(j(!1),d==="stalled"){w(!1),y(Ee);return}b().then(({data:S,isError:x})=>{if(!h.current)return;if(x||!S){y("Couldn't check whether the sign-in finished. Open Settings › Accounts to see whether the account is connected.");return}y(null);const m=S.accounts.find(n=>!v.current.has(n.accountId));m&&c(m.accountId)})}),F=te({...fe(),onSuccess:d=>{h.current&&(k(),w(!0),window.location.assign(d.authorizationUrl))},onError:d=>{j(!1),y(d instanceof Error?d.message:"Failed to start sign-in")}}),T=N||F.isPending,A=()=>{if(!T){if(g.length===0){l(!0);return}y(null),j(!0),b().then(({data:d,isError:S})=>{if(h.current){if(S||!d){j(!1),y("Couldn't read this instance's accounts, so sign-in can't be tracked. Check your connection and try again.");return}v.current=new Set(d.accounts.map(x=>x.accountId)),F.mutate({body:{email:o.trim()||void 0,services:g}})}})}},I=t.useRef(A);return I.current=A,t.useEffect(()=>{const d=S=>{S.key==="Enter"&&I.current(),S.key==="Escape"&&i()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[i]),e.jsx(R,{steps:M,activeStep:P.connector,title:s?.reconnect&&s.email?`Reconnect ${s.email}`:"Sign in with Microsoft",subtitle:"Microsoft is asked for the mail and calendar access you pick here.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:i,children:"Back"}),e.jsx(C,{variant:"primary",onClick:A,disabled:T,icon:T?e.jsx(G,{className:"size-4 animate-spin"}):void 0,children:T?"Redirecting…":a?"Start over":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(Ie,{providerName:"Microsoft",offered:ee,selected:g,onChange:d=>{r(d),d.length>0&&l(!1)},error:f?Te:void 0}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"microsoft-email",children:"Email address (optional)"}),e.jsx(q,{id:"microsoft-email",icon:e.jsx(se,{className:"size-4"}),placeholder:"you@outlook.com",value:o,onChange:d=>u(d.target.value),type:"email",autoComplete:"email"}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"Pre-fills the Microsoft sign-in form. Leave blank to choose on the Microsoft page."})]}),a&&e.jsx(L,{tone:"info",children:"Waiting for Microsoft. Finish signing in — this window carries on the moment the account is connected, wherever you finished."}),p&&e.jsx(L,{tone:"danger",children:p})]})})}function _e({accountId:s,onSignInAgain:i,onContinue:c}){const{data:o,isError:u,isFetching:g,refetch:r}=D(U()),f=o?.accounts.find(l=>l.accountId===s);return u?e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"Couldn't read the new account",subtitle:"Microsoft finished, but this instance did not answer.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:()=>{r()},disabled:g,children:"Retry"})]}),children:e.jsx(L,{tone:"danger",children:"Couldn't load the account Microsoft just connected. Check your connection and retry, or open Settings › Accounts to see it."})}):!o||!f&&g?e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"Reading the new account",subtitle:"Checking what Microsoft granted.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Loading…"}),e.jsx("span",{})]}),children:e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(G,{className:"size-4 animate-spin text-accent"}),"Loading the account…"]})}):f?e.jsx(Ge,{account:f,onContinue:c}):e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:"The account is not here",subtitle:"Microsoft sent the sign-in back, but no account was kept.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:i,children:"Sign in again"})]}),children:e.jsx(L,{tone:"danger",children:"This instance holds no account from that sign-in. Sign in with Microsoft again to connect it."})})}function Ge({account:s,onContinue:i}){const c=s.syncedServices.includes("Mail");return e.jsx(R,{steps:M,activeStep:P["microsoft-granted"],title:`Connected ${s.email}`,subtitle:"Microsoft granted access to what you picked.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Change this later in Settings › Accounts"}),e.jsx(C,{variant:"primary",onClick:()=>i(s.accountId),children:c?"Go to inbox":"Continue"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"divide-y divide-line",children:ne.map(o=>s.syncedServices.includes(o.id)?e.jsx(_,{label:o.label,detail:"Access granted — syncing",state:"ok"},o.id):e.jsx(_,{label:o.label,detail:"Not synced. Turn it on in Settings › Accounts; Microsoft asks for access then.",state:"pending"},o.id))}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Permissions Microsoft granted"}),e.jsx("code",{className:"mt-1 block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted","data-testid":"granted-scopes",children:s.grantedScopes.join(" ")})]})]})})}function He({initialEmail:s,initialDisplayName:i,onContinue:c,onBack:o}){const[u,g]=t.useState(s),[r,f]=t.useState(i),[l,p]=t.useState(!1),[y,a]=t.useState(""),[w,N]=t.useState(null),j=t.useCallback(async()=>{const h=u.trim();if(!h.includes("@")||!h.includes(".")){N("Enter a valid email address.");return}N(null),p(!0),a(be(h));try{const v=await Ce(h);c(h,r.trim(),v)}finally{p(!1)}},[u,r,c]);return t.useEffect(()=>{const h=v=>{v.key==="Enter"&&!l&&j(),v.key==="Escape"&&o()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[j,l,o]),e.jsx(R,{steps:M,activeStep:P.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:o,children:"Back"}),e.jsx(C,{variant:"primary",disabled:l,onClick:()=>{j()},children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(W,{htmlFor:"onboarding-email",children:"Email address"}),e.jsx(q,{id:"onboarding-email",icon:e.jsx(se,{className:"size-4"}),placeholder:"you@example.com",value:u,onChange:h=>{g(h.target.value),N(null)},type:"email",autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),e.jsx(q,{id:"onboarding-display-name",placeholder:"Alice",value:r,onChange:h=>f(h.target.value)}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),l&&e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(G,{className:"size-3.5 animate-spin text-accent"}),y]}),w&&!l&&e.jsx("div",{className:"mt-3",children:e.jsx(L,{tone:"danger",children:w})})]})})}function ze({email:s,imapConfig:i,smtpConfig:c,discovered:o,onContinue:u,onBack:g,onChange:r}){const[f,l]=t.useState(i),[p,y]=t.useState(c),[a,w]=t.useState(()=>Re(s)),[N,j]=t.useState(!1),[h,v]=t.useState(null),b=Y(a),k=b!==void 0&&!N,F=t.useCallback(m=>{w(m),j(!1),v(null);const n=Y(m);n&&(l({host:n.imap.host,port:n.imap.port,security:n.imap.security}),y({host:n.smtp.host,port:n.smtp.port,security:n.smtp.security}))},[]);t.useEffect(()=>{r(f,p)},[f,p,r]);const T=f.host.trim()!=="",A=t.useCallback(()=>{if(!T){v("Enter the IMAP host.");return}v(null),u()},[T,u]);t.useEffect(()=>{const m=n=>{n.key==="Enter"&&A(),n.key==="Escape"&&g()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[A,g]);const I=s.split("@")[1]??"your domain",d=b?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":o?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${I} — enter them manually.`,S=k?{label:"preset",tone:"neutral"}:!b&&o?{label:"detected",tone:"positive"}:void 0,x=b?.passwordHelp.url??je(s);return e.jsx(R,{steps:M,activeStep:P.servers,title:"Confirm server settings",subtitle:d,footer:e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"ghost",onClick:g,children:"Back"}),e.jsx(C,{variant:"primary",onClick:A,children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-5",children:[h&&e.jsx(L,{tone:"danger",children:h}),e.jsxs("div",{children:[e.jsx(W,{htmlFor:"provider-select",children:"Provider"}),e.jsxs(pe,{id:"provider-select",value:a,onChange:m=>F(m.target.value),children:[e.jsx("option",{value:"",children:"Custom / other"}),ae.map(m=>e.jsx("option",{value:m.id,children:m.label},m.id))]}),b&&e.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:k?e.jsxs(e.Fragment,{children:["Server settings are pre-filled for ",b.label," and locked."," ",e.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>j(!0),children:"Advanced"})," ","lets you edit them by hand."]}):e.jsxs(e.Fragment,{children:["Editing ",b.label,"'s settings by hand."]})})]}),e.jsx(K,{legend:"IMAP — incoming",badge:S,readOnly:k,host:f.host,port:String(f.port),security:f.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:m=>{l(n=>({...n,host:m})),v(null)},onPortChange:m=>l(n=>({...n,port:Number(m)})),onSecurityChange:m=>l(n=>({...n,security:m}))}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Sending (SMTP) is optional — leave it blank to set up a receive-only account and add sending later in Settings."}),e.jsx(K,{legend:"SMTP — outgoing (optional)",badge:S,readOnly:k,host:p.host,port:String(p.port),security:p.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:m=>{y(n=>({...n,host:m})),v(null)},onPortChange:m=>y(n=>({...n,port:Number(m)})),onSecurityChange:m=>y(n=>({...n,security:m}))}),b&&e.jsxs("p",{className:"text-2xs text-fg-subtle",children:[b.passwordHelp.text," ",x&&e.jsx("a",{href:x,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}const Be=2e4;function De({email:s,displayName:i,imapConfig:c,smtpConfig:o,username:u,password:g,onGoToInbox:r}){const f=de(),[l,p]=t.useState(null),[y,a]=t.useState(null),w=t.useRef(!1),N=V(c.security),j=V(o.security),h=te({...me(),onSuccess:E=>{p(E.accountId),f.invalidateQueries({queryKey:ue()})},onError:E=>{a(E instanceof Error?E.message:"Failed to create account")}});t.useEffect(()=>{if(w.current)return;w.current=!0;const E=o.host.trim()!=="",z=Ne({imapHost:c.host,smtpHost:o.host,smtpPort:o.port}),B=E?z??{smtpHost:o.host,smtpPort:o.port,smtpTls:j.tls,smtpStartTls:j.startTls}:null;h.mutate({body:{email:s,displayName:i||void 0,username:u!==s?u:void 0,password:g,imapHost:c.host,imapPort:c.port,imapTls:N.tls,imapStartTls:N.startTls,smtpHost:B?.smtpHost||void 0,smtpPort:B?.smtpPort||void 0,smtpTls:B?.smtpTls??!1,smtpStartTls:B?.smtpStartTls??!1}})},[]);const{data:v,isError:b}=D({...Q({path:{accountId:l??""}}),enabled:!!l,refetchInterval:E=>{const z=E.state.data?.syncPhase;return z==="complete"||z==="error"?!1:2e3}}),k=v?.syncPhase==="error",{data:F}=D({...U(),enabled:!!l&&k}),T=F?.accounts.find(E=>E.accountId===l)?.lastError,A=v?.mailboxes.find(E=>E.fullPath==="INBOX"||E.fullPath==="Inbox"),I=v?.mailboxCountTotal??0,d=v?.mailboxCountSynced??0,S=A?.messagesTotal??0,x=A?.messagesSynced??0,m=S>0?x/S:0,n=v?.syncPhase,H=k?"failed":n==="idle"||n===void 0||n==="discovering_mailboxes"?"running":I>0?"ok":"running",O=k?"failed":!n||n==="idle"||n==="discovering_mailboxes"?"pending":n==="syncing_inbox"||n==="syncing_others"?"running":"ok",$=k?"failed":!n||n==="idle"||n==="discovering_mailboxes"||n==="syncing_inbox"?"pending":n==="syncing_others"?"running":"ok",ie=x>0||A?.phase==="complete"||n==="complete"||k,[oe,re]=t.useState(!1);t.useEffect(()=>{if(!l)return;const E=setTimeout(()=>re(!0),Be);return()=>clearTimeout(E)},[l]);const ce=!!l&&(ie||b||oe);return y?e.jsx(R,{steps:M,activeStep:P.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(C,{variant:"primary",onClick:()=>{w.current=!1,a(null),h.mutate({body:{email:s,displayName:i||void 0,username:u!==s?u:void 0,password:g,imapHost:c.host,imapPort:c.port,imapTls:N.tls,imapStartTls:N.startTls,smtpHost:o.host||void 0,smtpPort:o.port||void 0,smtpTls:j.tls,smtpStartTls:j.startTls}})},children:"Retry"})]}),children:e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:y})}):e.jsx(R,{steps:M,activeStep:P.sync,title:`Syncing ${s}`,subtitle:"Newest mail first — you can start reading right away.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),ce?e.jsx(C,{variant:"primary",onClick:()=>l&&r(l),children:"Go to inbox"}):e.jsx(C,{variant:"primary",disabled:!0,icon:e.jsx(G,{className:"size-3.5 animate-spin"}),children:"Getting your mail…"})]}),children:h.isPending?e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(G,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):e.jsxs("div",{className:"space-y-3",children:[S>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[e.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),e.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[x.toLocaleString()," / ",S.toLocaleString()," ","messages"]})]}),e.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,m*100)}%`}})})]}),e.jsxs("div",{className:"divide-y divide-line",children:[e.jsx(_,{label:"Mailboxes discovered",detail:I>0?`${I} mailbox${I===1?"":"es"} found`:"Discovering…",state:H}),e.jsx(_,{label:"INBOX",detail:O==="ok"?`${x.toLocaleString()} messages synced`:O==="running"?"Syncing newest first…":"Queued",state:O}),d>1||n==="syncing_others"||n==="complete"?e.jsx(_,{label:"Other mailboxes",detail:$==="ok"?`${d-1} mailboxes synced`:$==="running"?"Syncing…":"Queued",state:$}):null]}),k&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>{f.invalidateQueries({queryKey:Q({path:{accountId:l??""}}).queryKey})},children:"retry"})]}),T&&e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:T})]})]})})}const We=(s,i)=>i?.kind==="connected"?"microsoft-granted":i?.kind==="refused"?"microsoft-email":s?"connector":"welcome";function Ye({skipWelcome:s=!1,onComplete:i,onCancel:c,onImportConfig:o,microsoftReturn:u}){const[g,r]=t.useState(We(s,u)),[f,l]=t.useState(u?.kind==="refused"?u:void 0),[p,y]=t.useState(u?.kind==="connected"?u.accountId:null),[a,w]=t.useState({email:"",displayName:"",imapConfig:J,smtpConfig:Z,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),N=t.useCallback(()=>r("connector"),[]),j=t.useCallback(()=>r("address"),[]),h=t.useCallback(()=>r("microsoft-email"),[]),v=t.useCallback(()=>{s?c?.():r("welcome")},[s,c]),b=t.useCallback((d,S,x)=>{let m=J,n=Z,H=!1;x&&(H=x.source!=="heuristic",m={host:x.imap.host,port:x.imap.port,security:x.imap.security},n={host:x.smtp.host,port:x.smtp.port,security:x.smtp.security}),w(O=>({...O,email:d,displayName:S,imapConfig:m,smtpConfig:n,discoveryResult:x,discovered:H,username:d})),r("servers")},[]),k=t.useCallback((d,S)=>{w(x=>({...x,imapConfig:d,smtpConfig:S}))},[]),F=t.useCallback((d,S)=>{w(x=>({...x,username:d,password:S}))},[]),T=t.useCallback(()=>r("sync"),[]),A=t.useCallback(d=>{i(d)},[i]),I=e.jsx(Oe,{refusal:f,onBack:()=>{l(void 0),r("connector")},onConnected:d=>{y(d),r("microsoft-granted")}});switch(g){case"welcome":return e.jsx(Fe,{onStart:N,onImportConfig:o});case"connector":return e.jsx(Le,{onContinue:j,onMicrosoft:h,onBack:v,showBack:!s});case"microsoft-email":return I;case"microsoft-granted":return p===null?I:e.jsx(_e,{accountId:p,onSignInAgain:()=>r("microsoft-email"),onContinue:A});case"address":return e.jsx(He,{initialEmail:a.email,initialDisplayName:a.displayName,onContinue:b,onBack:()=>r("connector")});case"servers":return e.jsx(ze,{email:a.email,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,discovered:a.discovered,onContinue:()=>r("credentials"),onBack:()=>r("address"),onChange:k});case"credentials":return e.jsx(Se,{steps:M,activeStep:P.credentials,title:`Sign in to ${a.email.split("@")[1]||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",email:a.email,username:a.username,password:a.password,onContinue:()=>r("test"),onBack:()=>r("servers"),onChange:F});case"test":return e.jsx(ve,{steps:M,activeStep:P.test,email:a.email,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,username:a.username,password:a.password,onSuccess:T,onBackToCredentials:()=>r("credentials"),onBackToServers:()=>r("servers")});case"sync":return e.jsx(De,{email:a.email,displayName:a.displayName,imapConfig:a.imapConfig,smtpConfig:a.smtpConfig,username:a.username,password:a.password,onGoToInbox:A})}}export{ne as A,Ye as O,ae as P,Y as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as pe,j as t,t as k,f as W,a3 as ge,X as ve,c as F,
|
|
1
|
+
import{e as pe,j as t,t as k,f as W,a3 as ge,X as ve,c as F,eW as le,s as V,r as E,eE as ee,b5 as Z,Y as be,a0 as Ne,an as P,ab as je}from"./index-DKo99WG1.js";import{u as ke,e as we,m as ye,t as Ce,C as Se,d as Ee,p as Te}from"./CalendarComposePane-FU6MwnAy.js";import{c as Ie,R as De,F as ce,u as Oe,n as Re}from"./calendar-format-CyOmp12n.js";import{R as Fe,A as Ae}from"./attendee-row-t7d1gEVn.js";import{C as ze}from"./clock-DC78l7yK.js";import{G as te,M as Le,a as $e}from"./calendar-report-rx459ZNk.js";import{M as Me}from"./mail-DxfGucaQ.js";import{P as Pe}from"./pencil-hPJlTnvS.js";import{f as We,d as de,j as se,u as Ze,c as _e,s as Ue,U as ne,h as Ve}from"./useCalendars-sfh2BICi.js";import{a as qe}from"./useCalendarWrites-qcdW_JmG.js";import{b as Be}from"./useCalendarData-4YBnFK2x.js";import{a as Ge}from"./calendar-subscription-B-aAc2Gy.js";const He=pe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);function S({icon:e,children:s}){return t.jsxs("div",{className:"flex items-start gap-2.5 py-1",children:[t.jsx("span",{className:"mt-0.5 shrink-0 text-fg-subtle",children:e}),t.jsx("div",{className:"min-w-0 flex-1 text-sm text-fg",children:s})]})}function Ye({event:e,calendar:s,whenText:r,onEdit:n,onDelete:i,onOpenThread:l,onClose:d,activeAttendee:c="",onActivateAttendee:u,renderAttendeeContext:p,touch:x=!1,chrome:f="header",className:v}){const N=Ie(s.color),a=t.jsxs(t.Fragment,{children:[t.jsx("h1",{className:"text-xl font-semibold text-fg",children:e.title}),t.jsxs("div",{className:"mt-3 flex flex-col border-b border-line pb-3",children:[t.jsx(S,{icon:t.jsx(ze,{className:"size-4"}),children:t.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[r,e.attendees.length>0&&t.jsx(Fe,{rsvp:e.myRsvp})]})}),e.zoneCertainty==="ambiguous"?t.jsx(S,{icon:t.jsx(te,{className:"size-4 text-warning"}),children:t.jsx("span",{className:"text-warning",children:"The mail said a time but never a zone. Shown in your own; confirm before you travel for it."})}):e.timeZone!==""&&t.jsx(S,{icon:t.jsx(te,{className:"size-4"}),children:e.timeZone}),e.recurrenceRule!==""&&t.jsx(S,{icon:t.jsx(De,{className:"size-4"}),children:t.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.recurrenceRule,e.seriesException&&t.jsx("span",{className:"rounded-xs bg-warning-soft px-1.5 py-0.5 text-2xs text-warning",children:"Moved out of the series"})]})}),e.location!==""&&t.jsx(S,{icon:t.jsx(Le,{className:"size-4"}),children:e.location})]}),e.threadId!==""&&l&&t.jsxs("button",{type:"button",onClick:l,className:"mt-3 flex w-full items-center gap-2.5 rounded-md border border-line bg-surface-sunken px-3 py-2 text-left outline-none hover:border-line-strong focus-visible:ring-2 focus-visible:ring-ring",children:[t.jsx(Me,{className:"size-4 shrink-0 text-accent-2"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block text-2xs uppercase tracking-wider text-fg-subtle",children:"From this thread"}),t.jsx("span",{className:"block truncate text-sm text-fg",children:e.threadSubject})]})]}),e.attendees.length>0&&t.jsx(Ae,{attendees:e.attendees,activeEmail:c,onActivate:u,renderContext:p,touch:x,className:"mt-3"}),e.notes!==""&&t.jsx("p",{className:"mt-3 whitespace-pre-wrap text-sm text-fg-muted",children:e.notes})]});return f==="bare"?t.jsx("div",{className:k("flex flex-col",v),children:a}):t.jsxs("article",{className:k("flex h-full w-full flex-col bg-surface",v),children:[t.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[t.jsx("span",{className:k("size-2.5 shrink-0 rounded-full",N.solid)}),t.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:[s.name," · ",s.accountLabel]}),n&&t.jsx(W,{variant:"ghost",size:"sm",icon:t.jsx(Pe,{className:"size-3.5"}),onClick:n,children:"Edit"}),i&&t.jsx(W,{variant:"ghost",size:"sm",icon:t.jsx(ge,{className:"size-3.5"}),onClick:i,className:"text-danger",children:"Delete"}),d&&t.jsx("button",{type:"button","aria-label":"Close event",onClick:d,className:"flex size-7 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",children:t.jsx(ve,{className:"size-4"})})]}),t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-row-inset py-3",children:a})]})}const Je=[{scope:"this",label:"This event",note:"Leaves the rest of the series alone"},{scope:"following",label:"This and everything after",note:"Splits the series here"},{scope:"all",label:"The whole series",note:"Rewrites the rule itself"}];function Ke({title:e,ruleText:s,instanceText:r,onChoose:n,onCancel:i,touch:l,className:d}){return t.jsxs("div",{className:k("flex flex-col gap-3",d),children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-md font-semibold text-fg",children:[e," repeats"]}),t.jsx("p",{className:"text-xs text-fg-muted",children:s}),t.jsxs("p",{className:"text-xs text-fg-subtle",children:["You clicked ",r,"."]})]}),t.jsx("p",{className:"text-sm text-fg",children:"What should the change apply to?"}),t.jsx("div",{className:"flex flex-col gap-1.5",children:Je.map(c=>t.jsxs("button",{type:"button",onClick:()=>n(c.scope),className:k("flex flex-col rounded-md border border-line bg-surface px-3 py-2 text-left outline-none transition-colors hover:border-line-strong hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",l&&"min-h-11 justify-center"),children:[t.jsx("span",{className:"text-sm font-medium text-fg",children:c.label}),t.jsx("span",{className:"text-2xs text-fg-subtle",children:c.note})]},c.scope))}),t.jsx(W,{variant:"ghost",size:l?"md":"sm",onClick:i,className:k("self-start",l&&"min-h-11"),children:"Cancel"})]})}const ue=e=>e.replace(/\r?\n[ \t]/g,""),re=e=>e.replace(/\\n/gi,`
|
|
2
2
|
`).replace(/\\,/g,",").replace(/\\;/g,";").replace(/\\\\/g,"\\");function _(e,s){let r=!1;for(let n=s.length;n<e.length;n+=1){const i=e[n];if(n===s.length&&i!==";"&&i!==":")return;if(i==='"'){r=!r;continue}if(!r&&i===":")return e.slice(n+1).trim()}}function U(e,s){for(const r of ue(e).split(/\r?\n/)){if(!r.startsWith(s))continue;const n=_(r,s);if(n!==void 0)return n}return""}const Qe=e=>U(e,"RRULE"),Xe=e=>({location:re(U(e,"LOCATION")),description:re(U(e,"DESCRIPTION"))});function et(e,s){const r=ue(e).split(/\r?\n/).find(i=>i.startsWith("DTSTART")&&_(i,"DTSTART")!==void 0);if(r===void 0)return We(s);const n=/;TZID="?([^;:"]+)"?/i.exec(r)?.[1];return n!==void 0?Intl.supportedValuesOf("timeZone").includes(n)?n:s:_(r,"DTSTART")?.toUpperCase().endsWith("Z")?"":s}const tt=V(404);function st(e,s){const{data:r,isLoading:n,error:i,refetch:l}=F({...le({path:{calendarObjectId:e},query:{calendarId:s}}),meta:tt,enabled:e!==""&&s!==""});return{resource:r,isLoading:n,error:i,refetch:()=>{l()}}}const ae=365*24*60*6e4,nt=1440*6e4,ie=V(401),rt=V(401,404),R=e=>new Date(e).toISOString().replace(/\.\d{3}Z$/,"+00:00"),at=e=>{const s=e instanceof Error&&e.message!==""?e.message:"no reason given",r=Z(e);return r===void 0?s:`${s} (HTTP ${r})`};function it(e,s){const[r]=E.useState(()=>Date.now()),n=de(),i=new Date(r).toISOString(),l=F({...ee({query:{from:R(r),to:R(r+ae),calendarObjectId:e}}),meta:ie,retry:!1,enabled:s}),d=l.data?se(l.data.items,e,i,n):void 0,c=F({...le({path:{calendarObjectId:e}}),meta:rt,retry:!1,enabled:s&&l.data!==void 0&&d===void 0}),u=Date.parse(c.data?.dtStart??""),p=c.data!==void 0&&Number.isNaN(u),x=Number.isNaN(u)?0:u-nt,f=F({...ee({query:{from:R(x),to:R(x+ae),calendarObjectId:e}}),meta:ie,retry:!1,enabled:s&&c.data!==void 0&&!p}),v=f.data?se(f.data.items,e,i,n):void 0;if(!s)return{kind:"Idle"};if(d)return{kind:"Found",jump:d};if(v)return{kind:"Found",jump:v};const N=Z(c.error)===404,a=[l.error,N?null:c.error,f.error].find(w=>w!==null);return a!==void 0?Z(a)===401?{kind:"SignedOut"}:{kind:"Failed",reason:at(a)}:N?{kind:"Deleted"}:p?{kind:"Failed",reason:`the stored event names no readable start (${c.data?.dtStart??""})`}:f.data!==void 0?{kind:"NoOccurrenceFound"}:{kind:"Searching"}}const ot={kind:"NotInView"},oe="rounded-md border border-line px-2.5 py-1 text-sm font-medium text-fg outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring";function lt(e){switch(e.kind){case"Finding":return{title:"Finding the event",detail:"Looking for the day it falls on."};case"Deleted":return{title:"This event was deleted",detail:"None of your calendars holds it any more."};case"NoOccurrenceFound":return{title:"No occurrence in its first year or the coming year",detail:"Its repeat rule, or the days taken out of it, leave it no day in either."};case"SignedOut":return{title:"Your session has ended",detail:"Sign in again to open this event."};case"Failed":return{title:"The event couldn't be looked up",detail:e.reason};case"NotInView":return{title:"That event isn't on this week",detail:"The address names an event the calendar doesn't have here."}}}function ct({event:e,calendar:s,isOccurrence:r,absence:n=ot,problem:i="",readOnlyNote:l="",onEdit:d,onDelete:c,onClose:u}){if(!e||!s){const{title:p,detail:x}=lt(n),f=n.kind==="Failed"||n.kind==="SignedOut";return t.jsxs("div",{role:f?"alert":void 0,className:"flex h-full flex-col items-center justify-center gap-2 bg-surface p-8 text-center",children:[t.jsx(be,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:p}),t.jsx("p",{className:"max-w-xs break-words text-sm text-fg-muted",children:x}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[n.kind==="SignedOut"&&n.signIn,n.kind==="Failed"&&t.jsx("a",{href:n.reportHref,target:"_blank",rel:"noreferrer",className:oe,children:"Report an issue"}),t.jsx("button",{type:"button",onClick:u,className:oe,children:"Back to the calendar"})]})]})}return t.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-surface",children:[r&&t.jsx("p",{className:"shrink-0 border-b border-line bg-surface-sunken px-row-inset py-1.5 text-2xs uppercase tracking-wider text-fg-subtle",children:"One occurrence of a repeating event"}),l!==""&&t.jsxs("p",{className:"flex shrink-0 items-start gap-2 border-b border-line bg-surface-sunken px-row-inset py-2 text-sm text-fg-muted",children:[t.jsx(He,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),t.jsx("span",{className:"min-w-0 flex-1 break-words",children:l})]}),i!==""&&t.jsxs("div",{role:"alert",className:"flex shrink-0 items-start gap-2 border-b border-danger/40 bg-danger-soft px-row-inset py-2 text-sm",children:[t.jsx(Ne,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),t.jsx("p",{className:"min-w-0 flex-1 break-words text-fg",children:i})]}),t.jsx(Ye,{event:e,calendar:s,whenText:ce(e),onEdit:d,onDelete:c,onClose:u,className:"min-h-0 flex-1"})]})}const dt="This event changed somewhere else — over CalDAV, or in another tab. Nothing was saved. Close it and open it again to see the version that's stored now.";function ut(){const{Account:e}=je();return t.jsx(e,{children:({signOut:s})=>t.jsx("button",{type:"button",onClick:()=>s(),className:"rounded-md border border-line px-2.5 py-1 text-sm font-medium text-fg outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Sign in again"})})}const ft=(e,s)=>{switch(e.kind){case"Deleted":case"NoOccurrenceFound":return{kind:e.kind};case"SignedOut":return{kind:"SignedOut",signIn:t.jsx(ut,{})};case"Failed":return{kind:"Failed",reason:e.reason,reportHref:$e(`opening an event failed: ${e.reason}`)};case"Searching":return{kind:"Finding"};default:return{kind:s?"Finding":"NotInView"}}};function Ct({calendarObjectId:e,recurrenceId:s}){const{view:r,date:n,calendarIds:i}=Oe(),{events:l,isLoading:d}=Be({view:r,date:n,calendarIds:i}),{calendars:c,collections:u,timeZoneByCalendarId:p}=Ze(),{closeEvent:x}=Re(),{updateEvent:f,deleteEvent:v,isWriting:N}=qe(),a=l.find(o=>o.id===_e(e,s??"")),w=s===void 0&&a===void 0,A=w?Ue(l,e,new Date().toISOString()):void 0,z=it(e,w&&!d&&A===void 0),T=c.find(o=>o.id===a?.calendarId),{resource:g}=st(e,a?.calendarId??""),[q,y]=E.useState(void 0),[b,L]=E.useState(void 0),[j,I]=E.useState(void 0),[B,C]=E.useState(""),fe=ke(j??we("",""),e),D=g?Xe(g.icalData):void 0,$=g?Qe(g.icalData):"",me=a&&!a.allDay?a.start.slice(11,16):"",M=g?et(g.icalData,p[a?.calendarId??""]??ne):ne,xe=a&&!a.allDay?ye($,Ve(a.start,M===""?"UTC":M).slice(0,10),a.start.slice(0,10)):$,O=$===""?"":Ce(xe,me)??"Repeats",G=a!==void 0&&a.seriesId!==""&&s!==void 0&&s!=="",H=a!==void 0&&g!==void 0&&!T?.readOnly,Y=(o,m)=>{if(o.kind==="written"){C(""),m();return}C(o.kind==="conflict"?dt:o.message)},J=o=>({calendarObjectId:e,calendarId:a?.calendarId??"",recurrenceId:s??"",scope:o,etag:g?.etag??""}),K=o=>{if(!a)return;const m=Ee(a,{repeat:O,location:D?.location??"",notes:D?.description??""});y(void 0),L({before:m,scope:o}),I(m),C("")},Q=o=>{y(void 0),v(J(o)).then(m=>Y(m,x))},he=()=>{if(!b||!j)return;const o=Te(b.before,j,{clock:de(),anchor:M});if(!o.ok){C(o.problem);return}f(J(b.scope),o.patch).then(m=>Y(m,()=>{L(void 0),I(void 0)}))};if(A)return t.jsx(P,{to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:r,date:n,calendarObjectId:e,recurrenceId:A.recurrenceId},search:!0,hash:!0,replace:!0});const h=z.kind==="Found"?z.jump:void 0,X=h!==void 0&&i.length>0&&!i.includes(h.calendarId);if(h&&(h.date!==n||X)){const o=X?m=>({...m,calendarId:[...i,h.calendarId]}):!0;return h.recurrenceId===""?t.jsx(P,{to:"/calendar/$view/$date/$calendarObjectId",params:{view:r,date:h.date,calendarObjectId:e},search:o,hash:!0,replace:!0}):t.jsx(P,{to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:r,date:h.date,calendarObjectId:e,recurrenceId:h.recurrenceId},search:o,hash:!0,replace:!0})}return q!==void 0&&a?t.jsx("div",{className:"flex h-full flex-col justify-center bg-surface px-row-inset",children:t.jsx(Ke,{className:"mx-auto w-full max-w-md",title:a.title,ruleText:O===""?"It repeats":O,instanceText:ce(a),onChoose:q==="edit"?K:Q,onCancel:()=>y(void 0)})}):b&&j?t.jsx(Se,{title:"Edit event",subtitle:b.scope==="this"?"This occurrence only":j.date,calendars:c,draft:j,onChange:I,problem:B,saveLabel:"Save",isSaving:N,repeatEditable:b.scope===void 0||b.scope==="all",calendarEditable:!1,clashes:fe,onSave:he,onCancel:()=>{L(void 0),I(void 0),C("")}}):t.jsx(ct,{event:a&&{...a,location:D?.location??"",notes:D?.description??"",recurrenceRule:O},calendar:T,readOnlyNote:T?.readOnly?Ge(u.find(o=>o.calendarId===T.id)?.subscriptionUrl??""):"",isOccurrence:s!==void 0,absence:ft(z,w&&d),problem:B,onEdit:H?()=>G?y("edit"):K(void 0):void 0,onDelete:H?()=>G?y("delete"):Q(void 0):void 0,onClose:x})}export{Ct as O};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ar as g,a0 as w,L as C,j as s,t as b,a3 as H,a1 as S,a9 as _,u as q,cm as K,r as x,cN as U,co as W,c as G,ad as J,C as V,dl as X,h as Y,at as Z,cR as ee,i as v,av as y,cK as se,cL as te,bT as p,eR as ne}from"./index-DKo99WG1.js";import{a as ae,u as k,L as R}from"./roving-focus-DWecg5C9.js";import{u as oe,p as re,R as j,c as ie}from"./useSearchTokenContext-C0_GGpQj.js";import{C as L}from"./circle-check-big-B9Ca4u10.js";import{C as I}from"./clock-DC78l7yK.js";import{R as le}from"./row-actions-Cp8U_ugi.js";import{R as ce}from"./rotate-ccw-DFe52ITT.js";import{P as T}from"./pane-header-DmEVnHem.js";import{N as ue}from"./NavMenuButton-C3UDJB1v.js";import{i as de,s as D}from"./outbox-status-BlKn6P0x.js";import{n as xe}from"./search-query-Cr_ZXBCp.js";import{g as fe}from"./useMessageBodyContent-BRyDdu_J.js";const me={queued:{icon:I,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2",spin:!0},sent:{icon:L,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:t,className:a}){const n=me[e],o=n.icon;return s.jsxs("span",{className:b("inline-flex items-center gap-1.5 text-xs font-medium",n.className,a),children:[s.jsx(o,{className:b("size-4",n.spin&&"animate-spin")}),!t&&n.label]})}const he=(e,t)=>t?"bg-accent-2-soft":e==="failed"?"bg-danger-soft":e==="blocked"||e==="unfiled"?"bg-warning/10":"";function be({recipients:e,subject:t,time:a,status:n,error:o,selected:l,onSelect:c,onRetry:r,retrying:u,onEdit:i,onDelete:f,deleting:d}){const m=n==="failed"||n==="blocked"||n==="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",he(n,l)),children:[s.jsxs("button",{type:"button",...ae,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:n,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:t||"No subject"}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s.jsx(O,{status:n}),o&&s.jsxs("span",{className:"truncate text-xs text-fg-muted",children:["— ",o]})]})]})]}),m&&s.jsx("div",{className:"shrink-0",children:s.jsx(le,{actions:[...n==="failed"&&r?[{label:"Retry sending",iconOnly:!0,icon:s.jsx(ce,{className:"size-3.5"}),busy:u,onClick:r}]:[],...n==="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(H,{className:"size-3.5"}),busy:d,confirm:{prompt:"Delete this message?",confirmLabel:"Delete"},onClick:f}})})]})}function ze(){return _({from:"/mail/outbox/draft/$outboxMessageId",shouldThrow:!1})?.outboxMessageId}function ge(){const e=q(),t=K();return x.useCallback(a=>{e({to:"/mail/outbox/draft/$outboxMessageId",params:{outboxMessageId:a},search:U,hash:t})},[e,t])}function pe(){return W()}function je(e,t){const a=t.trim().toLowerCase();if(a.length===0)return!0;const n=[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||n.includes(o))}function Ne(e){return e.tokens.length>0&&e.freeText.trim().length===0}const A={queued:{icon:I,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2"},sent:{icon:L,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"}},ve=e=>ne(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"}),ye=e=>{const t=e.toAddresses??[];return t.length===0?"No recipients":t.length===1?t[0]:`${t[0]} +${t.length-1}`},E=(e,t)=>t?"The outbox cannot filter on those terms":e?"No matching outbox messages":"No outbox messages",P=x.createContext(null);function N(){const e=x.useContext(P);if(!e)throw new Error("OutboxPane.* must be used inside <OutboxPane>");return e}function Oe({outboxMessageId:e,children:t}){const a=ge(),n=pe(),{data:o,isLoading:l}=G(J()),{searchQuery:c}=V(),r=oe(),u=xe(c),i=re(u,r),f=u.length>0,d=Ne(i),m=x.useMemo(()=>d?[]:(o?.items??[]).filter(h=>de(h.status)).filter(h=>je(h,i.freeText)),[o,i.freeText,d]),F=x.useMemo(()=>m.find(h=>h.outboxMessageId===e),[m,e]),$={messages:m,hasQuery:f,unsupportedQuery:d,isLoading:l,selectedMessageId:e,selectedMessage:F,onOpenMessage:a,onCloseMessage:n};return s.jsx(P.Provider,{value:$,children:t})}function Q({message:e,isSelected:t,onSelect:a}){const n=Y(),o=fe(),{pushError:l}=Z(),c=x.useCallback(()=>{n.invalidateQueries({queryKey:ee()})},[n]),r=v({...se(),onSuccess:c,onError:d=>{l(y("Couldn't resend message","The message wasn't sent.",d))}}),u=v({...te(),onSuccess:c,onError:d=>{l(y("Couldn't delete message","The message wasn't deleted.",d))}}),i=e.status;if(!A[i])return null;const f=D(e.status);return s.jsx(be,{recipients:ye(e),subject:e.subject||"",time:ve(e.sentAt??e.updatedAt),status:i,error:f?e.lastError??void 0:void 0,selected:t,onSelect:a,onRetry:i==="failed"?()=>r.mutate({path:{outboxMessageId:e.outboxMessageId}}):void 0,retrying:r.isPending,onEdit:()=>o(e.outboxMessageId),onDelete:()=>u.mutate({path:{outboxMessageId:e.outboxMessageId}}),deleting:u.isPending})}function B({message:e,onBack:t}){const a=e.status,n=A[a],o=n?.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:[t&&s.jsxs("button",{type:"button",onClick:t,className:"mb-3 inline-flex items-center gap-1 text-sm text-fg-muted hover:text-fg",children:[s.jsx(X,{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})]}),n&&s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(o,{className:b("size-4",n.className,a==="sending"&&"animate-spin")}),s.jsx("span",{className:b("text-xs font-medium",n.className),children:n.label}),D(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(ie,{html:e.htmlBody,text:e.textBody})})]})}function Me(){const{messages:e,hasQuery:t,unsupportedQuery:a,isLoading:n,selectedMessageId:o,onOpenMessage:l}=N(),c=x.useRef(null);return k({containerRef:c,itemSelector:R}),n?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(t,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsx(z,{count:e.length}),s.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:e.map(r=>s.jsx(Q,{message:r,isSelected:o===r.outboxMessageId,onSelect:()=>l(r.outboxMessageId)},r.outboxMessageId))})]})}function z({count:e}){return s.jsx(T,{title:"Outbox",leading:s.jsx(ue,{}),children:s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e," ",e===1?"message":"messages"]})})}function we(){const{selectedMessage:e}=N();return s.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[s.jsx(T,{}),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 Ce(){const{messages:e,hasQuery:t,unsupportedQuery:a,isLoading:n,selectedMessageId:o,selectedMessage:l,onOpenMessage:c,onCloseMessage:r}=N(),u=x.useRef(null);return k({containerRef:u,itemSelector:R}),n?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(t,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsx(z,{count:e.length}),s.jsx("div",{ref:u,className:"flex-1 overflow-y-auto",children:e.map(i=>s.jsx(Q,{message:i,isSelected:o===i.outboxMessageId,onSelect:()=>c(i.outboxMessageId)},i.outboxMessageId))})]})}const Fe=Object.assign(Oe,{List:Me,Reading:we,Phone:Ce});export{Fe as O,ze as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-DKo99WG1.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aj as m,j as o,O as p}from"./index-DKo99WG1.js";import{a}from"./MailShell-LEDBmXGr.js";import{M as r}from"./MailboxPane-sccwyPwa.js";import{a as e}from"./search-token-index-DL0AoAlj.js";import{u as s}from"./search-mirror-CjZ7cATA.js";import"./FullCompose-DkV5Z3KV.js";import"./ErrorState-CHxEHbvf.js";import"./index-DE-NAKWZ.js";import"./useMessageBodyContent-BRyDdu_J.js";import"./useSignature-CR4J3Q1V.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Bq8RVLfv.js";import"./sections-DDBMQxXz.js";import"./confirm-dialog-CCDHX_6Q.js";import"./useSearchTokenContext-C0_GGpQj.js";import"./kbd-xYIrsDlz.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-DKJ_Eyfn.js";import"./circle-check-big-B9Ca4u10.js";import"./refresh-cw-DNbEUXcm.js";import"./useQueries-CY9FUcC8.js";import"./MailListHeader-BZRxmnIb.js";import"./roving-focus-DWecg5C9.js";import"./popover-menu-BDeljNyh.js";import"./mail-DxfGucaQ.js";import"./avatar-C2R7xqlA.js";import"./EmptyState-DxT13qcR.js";import"./undo-2-nUyUEATC.js";import"./download-D3fQ48lB.js";import"./calendar-suggestion-OndzGSan.js";import"./calendar-format-CyOmp12n.js";import"./useCalendars-sfh2BICi.js";import"./calendar-report-rx459ZNk.js";import"./attendee-row-t7d1gEVn.js";import"./minus-Bnr4gKCE.js";import"./clock-DC78l7yK.js";import"./calendar-clash-strip-AV6ir0kb.js";import"./bell-off-CD1iuAQA.js";import"./shield-check-BgoZBruM.js";import"./useFilters-zXsB3pIM.js";import"./checkbox-B_JY_6mN.js";import"./useLayoutTier-C1kzvb61.js";import"./menu-u9D-cJXQ.js";import"./MailViewChrome-7gtXtr7X.js";import"./pane-header-DmEVnHem.js";import"./NavMenuButton-C3UDJB1v.js";import"./useLabels-xQerI8AK.js";import"./useSemanticSearch-lVNhyaIe.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-DZ2d0h_L.js";import"./circle-help-Cmc2Km1C.js";import"./circle-check-Cmp8Rqlz.js";function eo(){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{eo as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-DKo99WG1.js";import{B as o}from"./BriefPane-D1p8nleB.js";import"./useSearchTokenContext-C0_GGpQj.js";import"./kbd-xYIrsDlz.js";import"./useMessageBodyContent-BRyDdu_J.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BZRxmnIb.js";import"./roving-focus-DWecg5C9.js";import"./search-token-index-DL0AoAlj.js";import"./useQueries-CY9FUcC8.js";import"./popover-menu-BDeljNyh.js";import"./mail-DxfGucaQ.js";import"./avatar-C2R7xqlA.js";import"./index-DE-NAKWZ.js";import"./useSignature-CR4J3Q1V.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Bq8RVLfv.js";import"./sections-DDBMQxXz.js";import"./EmptyState-DxT13qcR.js";import"./ErrorState-CHxEHbvf.js";import"./undo-2-nUyUEATC.js";import"./download-D3fQ48lB.js";import"./calendar-suggestion-OndzGSan.js";import"./calendar-format-CyOmp12n.js";import"./useCalendars-sfh2BICi.js";import"./calendar-report-rx459ZNk.js";import"./attendee-row-t7d1gEVn.js";import"./minus-Bnr4gKCE.js";import"./clock-DC78l7yK.js";import"./calendar-clash-strip-AV6ir0kb.js";import"./bell-off-CD1iuAQA.js";import"./shield-check-BgoZBruM.js";import"./useFilters-zXsB3pIM.js";import"./checkbox-B_JY_6mN.js";import"./confirm-dialog-CCDHX_6Q.js";import"./useLayoutTier-C1kzvb61.js";import"./menu-u9D-cJXQ.js";import"./useRefreshControl-DKJ_Eyfn.js";import"./circle-check-big-B9Ca4u10.js";import"./refresh-cw-DNbEUXcm.js";import"./useSemanticSearch-lVNhyaIe.js";import"./useLabels-xQerI8AK.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function U(){return r.jsx(o.Reading,{})}export{U as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-DKo99WG1.js";import{F as r}from"./FlaggedPane-CJ__xJpf.js";import"./useSearchTokenContext-C0_GGpQj.js";import"./kbd-xYIrsDlz.js";import"./useMessageBodyContent-BRyDdu_J.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BZRxmnIb.js";import"./roving-focus-DWecg5C9.js";import"./search-token-index-DL0AoAlj.js";import"./useQueries-CY9FUcC8.js";import"./popover-menu-BDeljNyh.js";import"./mail-DxfGucaQ.js";import"./avatar-C2R7xqlA.js";import"./index-DE-NAKWZ.js";import"./useSignature-CR4J3Q1V.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Bq8RVLfv.js";import"./sections-DDBMQxXz.js";import"./EmptyState-DxT13qcR.js";import"./ErrorState-CHxEHbvf.js";import"./undo-2-nUyUEATC.js";import"./download-D3fQ48lB.js";import"./calendar-suggestion-OndzGSan.js";import"./calendar-format-CyOmp12n.js";import"./useCalendars-sfh2BICi.js";import"./calendar-report-rx459ZNk.js";import"./attendee-row-t7d1gEVn.js";import"./minus-Bnr4gKCE.js";import"./clock-DC78l7yK.js";import"./calendar-clash-strip-AV6ir0kb.js";import"./bell-off-CD1iuAQA.js";import"./shield-check-BgoZBruM.js";import"./useFilters-zXsB3pIM.js";import"./checkbox-B_JY_6mN.js";import"./confirm-dialog-CCDHX_6Q.js";import"./useLayoutTier-C1kzvb61.js";import"./menu-u9D-cJXQ.js";import"./MailViewChrome-7gtXtr7X.js";import"./refresh-cw-DNbEUXcm.js";import"./wizard-selection-DxUM65kM.js";function O(){return o.jsx(r.Reading,{})}export{O as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-DKo99WG1.js";import{M as r}from"./MailboxPane-sccwyPwa.js";import"./useSearchTokenContext-C0_GGpQj.js";import"./kbd-xYIrsDlz.js";import"./useMessageBodyContent-BRyDdu_J.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-DKJ_Eyfn.js";import"./circle-check-big-B9Ca4u10.js";import"./refresh-cw-DNbEUXcm.js";import"./useQueries-CY9FUcC8.js";import"./MailListHeader-BZRxmnIb.js";import"./roving-focus-DWecg5C9.js";import"./search-token-index-DL0AoAlj.js";import"./popover-menu-BDeljNyh.js";import"./mail-DxfGucaQ.js";import"./avatar-C2R7xqlA.js";import"./index-DE-NAKWZ.js";import"./useSignature-CR4J3Q1V.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-Bq8RVLfv.js";import"./sections-DDBMQxXz.js";import"./EmptyState-DxT13qcR.js";import"./ErrorState-CHxEHbvf.js";import"./undo-2-nUyUEATC.js";import"./download-D3fQ48lB.js";import"./calendar-suggestion-OndzGSan.js";import"./calendar-format-CyOmp12n.js";import"./useCalendars-sfh2BICi.js";import"./calendar-report-rx459ZNk.js";import"./attendee-row-t7d1gEVn.js";import"./minus-Bnr4gKCE.js";import"./clock-DC78l7yK.js";import"./calendar-clash-strip-AV6ir0kb.js";import"./bell-off-CD1iuAQA.js";import"./shield-check-BgoZBruM.js";import"./useFilters-zXsB3pIM.js";import"./checkbox-B_JY_6mN.js";import"./confirm-dialog-CCDHX_6Q.js";import"./useLayoutTier-C1kzvb61.js";import"./menu-u9D-cJXQ.js";import"./MailViewChrome-7gtXtr7X.js";import"./pane-header-DmEVnHem.js";import"./NavMenuButton-C3UDJB1v.js";import"./useLabels-xQerI8AK.js";import"./useSemanticSearch-lVNhyaIe.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-DZ2d0h_L.js";import"./circle-help-Cmc2Km1C.js";import"./circle-check-Cmp8Rqlz.js";function Z(){return o.jsx(r.Reading,{})}export{Z as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-DKo99WG1.js";import{O as t}from"./OutboxPane-oxeCJEiZ.js";import"./roving-focus-DWecg5C9.js";import"./useSearchTokenContext-C0_GGpQj.js";import"./kbd-xYIrsDlz.js";import"./useMessageBodyContent-BRyDdu_J.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-B9Ca4u10.js";import"./clock-DC78l7yK.js";import"./row-actions-Cp8U_ugi.js";import"./rotate-ccw-DFe52ITT.js";import"./pane-header-DmEVnHem.js";import"./NavMenuButton-C3UDJB1v.js";import"./menu-u9D-cJXQ.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function R(){return o.jsx(t.Reading,{})}export{R as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{eX as o,j as m}from"./index-DKo99WG1.js";import{O as p}from"./OpenCalendarEvent-B1DYETG7.js";import"./CalendarComposePane-FU6MwnAy.js";import"./calendar-format-CyOmp12n.js";import"./useQueries-CY9FUcC8.js";import"./useCalendars-sfh2BICi.js";import"./calendar-clash-strip-AV6ir0kb.js";import"./attendee-row-t7d1gEVn.js";import"./avatar-C2R7xqlA.js";import"./minus-Bnr4gKCE.js";import"./clock-DC78l7yK.js";import"./calendar-report-rx459ZNk.js";import"./mail-DxfGucaQ.js";import"./pencil-hPJlTnvS.js";import"./useCalendarWrites-qcdW_JmG.js";import"./ErrorState-CHxEHbvf.js";import"./useCalendarData-4YBnFK2x.js";import"./calendar-subscription-B-aAc2Gy.js";function v(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:t})}export{v as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-DKo99WG1.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-DKo99WG1.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-DKo99WG1.js";const n=o;export{n as component};
|