@remit/web-client-dist 0.0.510 → 0.0.512

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.
Files changed (156) hide show
  1. package/assets/{BriefPane-f1plGWaf.js → BriefPane-Dewrjh6q.js} +1 -1
  2. package/assets/{CalendarComposePane-CvKpoaLd.js → CalendarComposePane-DFJF5rON.js} +1 -1
  3. package/assets/{CalendarComposeSeed-BFw9Xcyv.js → CalendarComposeSeed-DY92bKTd.js} +1 -1
  4. package/assets/{CalendarShell-2mC1mwZz.js → CalendarShell-BecDfXDb.js} +1 -1
  5. package/assets/{EmptyState-DMV0fkvR.js → EmptyState-Utd2bP_N.js} +1 -1
  6. package/assets/{ErrorState-CyVYcmVT.js → ErrorState-TJlWpK6b.js} +1 -1
  7. package/assets/{FlaggedPane-PUHbNN_x.js → FlaggedPane-B4CCVcQK.js} +1 -1
  8. package/assets/{FullCompose-mvt6fbW1.js → FullCompose-BR7E4-g0.js} +1 -1
  9. package/assets/{MailListHeader-D23dSnHZ.js → MailListHeader-Bi5jkOPb.js} +1 -1
  10. package/assets/{MailNav-RVAADMXj.js → MailNav-DhxUuqgu.js} +1 -1
  11. package/assets/{MailShell-DlOlRRYj.js → MailShell-B8QXh-M7.js} +1 -1
  12. package/assets/{MailViewChrome-DpYVT5yN.js → MailViewChrome-CRfz86AO.js} +1 -1
  13. package/assets/{MailboxPane-C6l_0N2O.js → MailboxPane-BQsOcIZp.js} +1 -1
  14. package/assets/{NavMenuButton-BPDa4SMb.js → NavMenuButton-3KGFpzQx.js} +1 -1
  15. package/assets/{OnboardingWizard-BwdkqOoc.js → OnboardingWizard-CKnv0BJR.js} +1 -1
  16. package/assets/{OpenCalendarEvent-DG2I65B_.js → OpenCalendarEvent-CV9Qt0IW.js} +1 -1
  17. package/assets/{OutboxPane-CJsXFqtp.js → OutboxPane-BIEL1S0a.js} +1 -1
  18. package/assets/_calendarObjectId-C5HWfYVC.js +1 -0
  19. package/assets/_mailboxId-Otr6r78n.js +1 -0
  20. package/assets/_messageId-CHxgeZ89.js +1 -0
  21. package/assets/_messageId-CTMh7zjH.js +1 -0
  22. package/assets/_messageId-Cq2PPnLw.js +1 -0
  23. package/assets/_outboxMessageId-DvkmYF-q.js +1 -0
  24. package/assets/_recurrenceId-BZoKNWXS.js +1 -0
  25. package/assets/_threadId-BKh_G1Ya.js +1 -0
  26. package/assets/_threadId-CxN8ztKG.js +1 -0
  27. package/assets/_threadId-DXBoArRe.js +1 -0
  28. package/assets/{_view._date-CBzj7Dva.js → _view._date-D5s0FJ4P.js} +1 -1
  29. package/assets/{accounts-wN77-X6v.js → accounts-lJ_RDDS_.js} +1 -1
  30. package/assets/{advanced-98AQfdEi.js → advanced-DKkvojk3.js} +1 -1
  31. package/assets/{appearance-BHGXKnwC.js → appearance-DqWQ8lCS.js} +1 -1
  32. package/assets/{attachment-file-BUzsbGzm.js → attachment-file-gfs-I8K6.js} +1 -1
  33. package/assets/{attendee-row-CZSI9WXI.js → attendee-row-BqgUSlhv.js} +1 -1
  34. package/assets/{avatar-Dx5yz20k.js → avatar-CRe-Sp9q.js} +1 -1
  35. package/assets/{bottom-sheet-Dphhrv7V.js → bottom-sheet-gWePRc9n.js} +1 -1
  36. package/assets/{brief-CBbfPBLo.js → brief-CMT9WC3c.js} +1 -1
  37. package/assets/brief-CbNSzJTC.js +1 -0
  38. package/assets/{browser-ponyfill-DUcQxmj-.js → browser-ponyfill-DIb7RFwA.js} +1 -1
  39. package/assets/{bug-Cl62NIvJ.js → bug-Cu6Ffglh.js} +1 -1
  40. package/assets/{calendar-2S2zlmkV.js → calendar-B25ZIL-N.js} +1 -1
  41. package/assets/{calendar-color-BOEi-xKF.js → calendar-color-C0ESuRyU.js} +1 -1
  42. package/assets/{calendar-event-chip-BHQzHlqv.js → calendar-event-chip-014Bv8jo.js} +1 -1
  43. package/assets/{calendars-D_lhBYmy.js → calendars-DVyeJvrp.js} +1 -1
  44. package/assets/{card-pYyUnqGS.js → card-_TRlGSrv.js} +1 -1
  45. package/assets/chevron-left-HdL-YS5N.js +1 -0
  46. package/assets/{circle-check-DJTw8XeH.js → circle-check-CkfedD6V.js} +1 -1
  47. package/assets/{circle-check-big-B-r3FrmI.js → circle-check-big-B_fzcouO.js} +1 -1
  48. package/assets/{circle-help-DgIUxvXo.js → circle-help-D6A0A7aE.js} +1 -1
  49. package/assets/{clock-_4KA3nTB.js → clock-BaB3GU92.js} +1 -1
  50. package/assets/compose._-_outboxMessageId_-8khLgJ3x.js +1 -0
  51. package/assets/compose._-_outboxMessageId_-BetUvaXA.js +1 -0
  52. package/assets/compose._-_outboxMessageId_-BzQO6iSI.js +1 -0
  53. package/assets/compose._-_outboxMessageId_-D01z_dXy.js +1 -0
  54. package/assets/{config-import-5vhFHyk3.js → config-import-DGejwr-b.js} +1 -1
  55. package/assets/{confirm-dialog-fMpZDQwU.js → confirm-dialog-6A8iqiSf.js} +1 -1
  56. package/assets/{copy-RQZMcjGv.js → copy-COEsR3n9.js} +1 -1
  57. package/assets/{credential-steps-8d0gtdWR.js → credential-steps-BHRH8jm_.js} +1 -1
  58. package/assets/{download-BhCMX5hr.js → download-Bugci_ov.js} +1 -1
  59. package/assets/{file-json-D2BEEAab.js → file-json-C_Oc9XjO.js} +1 -1
  60. package/assets/{filters-4J2qwwp4.js → filters-DR5nzc6h.js} +1 -1
  61. package/assets/flagged-CS-rHzAn.js +1 -0
  62. package/assets/{flagged-CXfkrK9K.js → flagged-DTg3anks.js} +1 -1
  63. package/assets/folders-B4mTmNG2.js +1 -0
  64. package/assets/{format-r3it-qYv.js → format-DgZ6-fIr.js} +1 -1
  65. package/assets/{help-copy-CvWWk4nR.js → help-copy-COknA69W.js} +1 -1
  66. package/assets/{import-Nn8FOgZK.js → import-DdMKwA_V.js} +1 -1
  67. package/assets/index-BYdVAr3I.js +1 -0
  68. package/assets/index-Bk32FOJa.js +1 -0
  69. package/assets/index-BkpZLzSP.js +1 -0
  70. package/assets/index-CHxgeZ89.js +1 -0
  71. package/assets/index-CTMh7zjH.js +1 -0
  72. package/assets/{index-BiyAH7mw.js → index-CZWRMIhG.js} +4 -4
  73. package/assets/{index-BHv-NPe9.js → index-CdEOtGjn.js} +4 -4
  74. package/assets/{index-BS6bNAj0.js → index-CoShUjXE.js} +1 -1
  75. package/assets/index-DRNxy7U9.js +1 -0
  76. package/assets/index-fF04Tnvq.js +1 -0
  77. package/assets/index-ivUVs99a.js +1 -0
  78. package/assets/index-yIBPIyT6.js +1 -0
  79. package/assets/{kbd-CGsQ66xw.js → kbd-BP0jHRYr.js} +1 -1
  80. package/assets/{labels-nEMG5Pd1.js → labels-Cn6WZ9nj.js} +1 -1
  81. package/assets/{mail-DB0oT6Wn.js → mail-BfJXnBhQ.js} +1 -1
  82. package/assets/{mail-BeV_y5QD.js → mail-C-jSi52k.js} +1 -1
  83. package/assets/{map-pin-DbmaCcFB.js → map-pin-CwtMkSP7.js} +1 -1
  84. package/assets/{menu-_yyuL7QC.js → menu-C6-yRhCZ.js} +1 -1
  85. package/assets/{new-B70KCHJ_.js → new-0oD0gARs.js} +1 -1
  86. package/assets/onboarding-DrxMr8u6.js +1 -0
  87. package/assets/{onboarding-completion-CKUxRW8T.js → onboarding-completion-Dtu3BBgi.js} +1 -1
  88. package/assets/outbox-DcWb74s3.js +1 -0
  89. package/assets/{pencil-BalLODT0.js → pencil-CnN1II6z.js} +1 -1
  90. package/assets/{refresh-cw-Cj8CzO6f.js → refresh-cw-CPIcFBXF.js} +1 -1
  91. package/assets/{rich-text-C7NuI04t.js → rich-text-Dw115CUN.js} +1 -1
  92. package/assets/{rich-text-spellcheck-worker-provider-BNnlaa92.js → rich-text-spellcheck-worker-provider-COG3rWh6.js} +1 -1
  93. package/assets/{rotate-ccw-CXNasDFs.js → rotate-ccw-Bpd9i3EB.js} +1 -1
  94. package/assets/{row-actions-C8lDaql_.js → row-actions-Ci8-K_jh.js} +1 -1
  95. package/assets/{search-mirror-BRprscwL.js → search-mirror-BjhpdKld.js} +1 -1
  96. package/assets/{search-token-index-h8qI1Yib.js → search-token-index-CFt66zmj.js} +1 -1
  97. package/assets/{sections-B9m609Vf.js → sections-Cp02iPnH.js} +1 -1
  98. package/assets/{senders-BiDOMG99.js → senders-CtsNVO74.js} +1 -1
  99. package/assets/settings-BpHe5Yr5.js +1 -0
  100. package/assets/{settings-screen-DafglU7A.js → settings-screen-BVw0fkgb.js} +1 -1
  101. package/assets/{shield-check-34u10gOB.js → shield-check-D4z7nZDo.js} +1 -1
  102. package/assets/{suggested-vips-CdZnsebq.js → suggested-vips-BNphQzTS.js} +1 -1
  103. package/assets/{useCalendarData-yANfj0Yx.js → useCalendarData-DCfjQY3r.js} +1 -1
  104. package/assets/{useCalendars-SFBYFCoG.js → useCalendars-DKxuOnTj.js} +1 -1
  105. package/assets/{useDebouncedValue-vtzrU6u5.js → useDebouncedValue-1XTFvzhb.js} +1 -1
  106. package/assets/{useFilters-DuQCR3Qa.js → useFilters-B_ycDJO8.js} +1 -1
  107. package/assets/{useLabels-BtdFNvp3.js → useLabels-DMUnrEOj.js} +1 -1
  108. package/assets/{useLayoutTier-CzUPxRwt.js → useLayoutTier-C94LYk3A.js} +1 -1
  109. package/assets/{useMessageBodyContent-BbMnogZm.js → useMessageBodyContent-C7oxEm55.js} +1 -1
  110. package/assets/{useQueries-BArSdAIw.js → useQueries-Dw5Oc_5Z.js} +1 -1
  111. package/assets/{useRefreshControl-Bx-djS5M.js → useRefreshControl-E_WJ8w06.js} +1 -1
  112. package/assets/{useResultFolderIndex-CKFj47J1.js → useResultFolderIndex-CcGRPcQ-.js} +1 -1
  113. package/assets/{useSearchTokenContext-Chuk9_R2.js → useSearchTokenContext-B3r4oTZj.js} +1 -1
  114. package/assets/{useSemanticSearch-Cxd2wzTv.js → useSemanticSearch-DDRbxfTi.js} +1 -1
  115. package/assets/{useSignature-DtOMT-01.js → useSignature-7CGOES8z.js} +1 -1
  116. package/assets/{window-B2eb-Kbg.js → window-KQr6gbuJ.js} +1 -1
  117. package/index.html +1 -1
  118. package/package.json +1 -1
  119. package/assets/_calendarObjectId-BXwZA2I7.js +0 -1
  120. package/assets/_mailboxId-CtG7y-EJ.js +0 -1
  121. package/assets/_messageId-BzPFJxKt.js +0 -1
  122. package/assets/_messageId-Dcu8sUsq.js +0 -1
  123. package/assets/_messageId-Spjvc6pv.js +0 -1
  124. package/assets/_outboxMessageId-DEU0AUwE.js +0 -1
  125. package/assets/_recurrenceId-By5RNb62.js +0 -1
  126. package/assets/_threadId-DF6fpdaO.js +0 -1
  127. package/assets/_threadId-Kwg9hW11.js +0 -1
  128. package/assets/_threadId-uvBlkxMk.js +0 -1
  129. package/assets/brief-H8GO5Ykn.js +0 -1
  130. package/assets/chevron-left-CSsgMmPr.js +0 -1
  131. package/assets/compose._-_outboxMessageId_-QK_0kSaV.js +0 -1
  132. package/assets/compose._-_outboxMessageId_-b1wzWP0B.js +0 -1
  133. package/assets/compose._-_outboxMessageId_-lmC91927.js +0 -1
  134. package/assets/compose._-_outboxMessageId_-nakgsUZI.js +0 -1
  135. package/assets/flagged-BWoqELYa.js +0 -1
  136. package/assets/folders-Cm0yY5UA.js +0 -1
  137. package/assets/index-BDRDYV3S.js +0 -1
  138. package/assets/index-BIIJnn1p.js +0 -1
  139. package/assets/index-BrgdD2cq.js +0 -1
  140. package/assets/index-DChht77v.js +0 -1
  141. package/assets/index-DHHnA7ex.js +0 -1
  142. package/assets/index-Dcu8sUsq.js +0 -1
  143. package/assets/index-NKp7Sg9v.js +0 -1
  144. package/assets/index-Spjvc6pv.js +0 -1
  145. package/assets/index-hSx2SRmx.js +0 -1
  146. package/assets/onboarding-sEAv1Dpg.js +0 -1
  147. package/assets/outbox-D0Bjrexp.js +0 -1
  148. package/assets/settings-CoVD8Lo3.js +0 -1
  149. package/locales/de/errors.json +0 -1
  150. package/locales/de/settings.json +0 -1
  151. package/locales/en/errors.json +0 -1
  152. package/locales/en/settings.json +0 -1
  153. package/locales/fr/errors.json +0 -1
  154. package/locales/fr/settings.json +0 -1
  155. package/locales/nl/errors.json +0 -1
  156. package/locales/nl/settings.json +0 -1
@@ -1 +1 @@
1
- import{c as o,ed as s,r as l}from"./index-BHv-NPe9.js";const I=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,p="",d={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},i={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},n="#";function u(e,a){return a===""?e:`${e}${n}${a}`}function O(e){const a=e.indexOf(n);return a===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,a),recurrenceId:e.slice(a+1)}}function m(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:d[e.color]??"cal-1"}}function f(e,a){return{id:u(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.start,end:e.end,allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:"accepted",threadId:"",threadSubject:"",timeZone:a,zoneCertainty:i[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const E=e=>e.status!=="Cancelled";function R(){const{data:e,isLoading:a}=o(s());return l.useMemo(()=>{const r=e?.items??[],c=r.map(m);return{calendars:c,colorByCalendarId:Object.fromEntries(c.map(t=>[t.id,t.color])),timeZoneByCalendarId:Object.fromEntries(r.map(t=>[t.calendarId,t.timezone])),isLoading:a}},[e,a])}export{p as U,u as c,I as d,E as i,O as r,f as t,R as u};
1
+ import{c as o,ed as s,r as l}from"./index-CdEOtGjn.js";const I=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,p="",d={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},i={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},n="#";function u(e,a){return a===""?e:`${e}${n}${a}`}function O(e){const a=e.indexOf(n);return a===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,a),recurrenceId:e.slice(a+1)}}function m(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:d[e.color]??"cal-1"}}function f(e,a){return{id:u(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.start,end:e.end,allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:"accepted",threadId:"",threadSubject:"",timeZone:a,zoneCertainty:i[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const E=e=>e.status!=="Cancelled";function R(){const{data:e,isLoading:a}=o(s());return l.useMemo(()=>{const r=e?.items??[],c=r.map(m);return{calendars:c,colorByCalendarId:Object.fromEntries(c.map(t=>[t.id,t.color])),timeZoneByCalendarId:Object.fromEntries(r.map(t=>[t.calendarId,t.timezone])),isLoading:a}},[e,a])}export{p as U,u as c,I as d,E as i,O as r,f as t,R as u};
@@ -1 +1 @@
1
- import{r as o}from"./index-BHv-NPe9.js";const n=(e,t)=>{const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r};export{n as u};
1
+ import{r as o}from"./index-CdEOtGjn.js";const n=(e,t)=>{const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r};export{n as u};
@@ -1 +1 @@
1
- import{r as m,i as b,e2 as E,c as C,e3 as x,dC as F,e4 as D,h as M,e5 as N,e6 as P,e7 as L,e8 as z}from"./index-BHv-NPe9.js";const B=(e,t)=>{if(e.state==="Expired")return"Expired";if(e.scope!=="Temporary"||!e.expiresAt)return"Active";const r=Date.parse(e.expiresAt);return Number.isNaN(r)?"Active":r<=t?"Expired":"Active"},K=e=>{if(!e)return;const t=Date.parse(e);if(!Number.isNaN(t))return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},O=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,a,i,n]=r,s=new Date(Number(a),Number(i)-1,Number(n),23,59,59,0);if(Number.isNaN(s.getTime()))return;const o=-t.getTimezoneOffset(),d=o>=0?"+":"-",l=Math.abs(o),c=String(Math.floor(l/60)).padStart(2,"0"),f=String(l%60).padStart(2,"0"),u=p=>String(p).padStart(2,"0");return`${s.getFullYear()}-${u(s.getMonth()+1)}-${u(s.getDate())}T${u(s.getHours())}:${u(s.getMinutes())}:${u(s.getSeconds())}${d}${c}:${f}`},h="None",V=e=>!e.literalClauses.some(t=>t.field==="HasWords"),y=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),G=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",X=({mode:e,ruleScope:t,anchorMessageId:r,clauses:a,matchOperator:i,moveMailboxId:n,until:s})=>({...e==="similar"&&r?{anchorMessageId:r}:{},matchOperator:i==="all"?"And":"Or",literalClauses:a.map(o=>({field:o.field,value:o.value})),moveMailboxId:n,expiresAt:t==="until"?O(s??""):void 0}),S=(e,t,r)=>({name:r,scope:t==="standing"?"Standing":"Temporary",...t==="temporary"&&e.expiresAt?{expiresAt:e.expiresAt}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h,...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{}}),T=new Set(["Complete","Failed"]),v=e=>e!==void 0&&T.has(e),w=1e3,J=15e3,_=e=>{const t=Math.max(0,e),r=w*2**t;return Math.min(r,J)},$=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},Y=e=>{const[t,r]=m.useState(),a=b({...E(),onSuccess:g=>r(g.organizeJobId)}),{mutate:i}=a,n=C({...x({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const I=g.state.data?.state;return v(I)?!1:_(g.state.dataUpdateCount)}}),s=m.useCallback(g=>{e&&i({path:{accountId:e},body:y(g)})},[e,i]),{refetch:o}=n,d=m.useCallback(()=>{o()},[o]),l=n.data,c=a.isPending?void 0:l,f=c?.state??a.data?.state,u=v(c?.state),p={state:f,matchedCount:c?.matchedCount??0,appliedCount:c?.appliedCount??0,failedCount:c?.failedCount??0,errorMessage:c?.errorMessage??""};return{start:s,refreshStatus:d,progress:p,isStarting:a.isPending,isRunning:!!t&&!u,isDone:u,failure:$(a.error,n.error,!!l)}},Z=["From","Subject","HasWords","ListId","FromDomain"],k=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},ee=(e,t)=>e==="ListId"?k(t):t.trim(),R=e=>e==="all"?"And":"Or",U=(e,t)=>{const r=e.widen!==void 0&&!e.widen.inactive,a=e.clauses.map(i=>({field:i.field,value:i.value}));return{...r&&t?{anchorMessageId:t}:{},matchOperator:R(e.matchOperator),literalClauses:a}},Q=e=>e.anchorMessageId!==void 0||!e.literalClauses.some(t=>t.field==="HasWords"),j=e=>JSON.stringify({anchor:e.anchorMessageId??null,operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),te=(e,t)=>{const r=U(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?O(e.until??""):void 0}},q=(e,t)=>e.error!==void 0&&e.errorSignature===t?{status:"error",reason:e.error}:e.count===void 0?{status:"loading"}:e.previewedSignature===t?{status:"ready",count:e.count}:{status:"ready",count:e.count,stale:!0},H=350,re=(e,t,r)=>{const a=b(F()),{mutateAsync:i}=a,n=j(t),[s,o]=m.useState(()=>({})),d=m.useRef(t);d.current=t;const l=m.useRef(n),c=Q(t);return m.useEffect(()=>{if(!e||!c||n===s.previewedSignature||n===s.errorSignature)return;const f=setTimeout(()=>{const u=n;l.current=u,i({path:{accountId:e},body:y({...d.current})}).then(p=>{l.current===u&&o({count:p.matchedCount,matchedIds:p.messageIds,previewedSignature:u})}).catch(p=>{l.current===u&&o(g=>({...g,error:p instanceof Error?p.message:"Couldn't count matches.",errorSignature:u}))})},H);return()=>clearTimeout(f)},[e,c,n,s.previewedSignature,s.errorSignature,i]),c?{count:q(s,n),matchedIds:s.previewedSignature===n?s.matchedIds??[]:[]}:{count:{status:"error",reason:D},matchedIds:[]}},A=e=>P({path:{accountId:e}}),se=e=>{const t=C({...L({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},ae=e=>{const t=M(),r=b({...N(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:A(e)})}}),{mutate:a,mutateAsync:i}=r,n=m.useCallback((o,d,l)=>{e&&a({path:{accountId:e},body:S(o,d,l)})},[e,a]),s=m.useCallback(async(o,d,l)=>e?i({path:{accountId:e},body:S(o,d,l)}).then(()=>!0,()=>!1):!1,[e,i]);return{createFilter:n,createFilterAsync:s,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},ne=e=>{const t=M(),r=b({...z(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:A(e)})}}),{mutate:a}=r;return{deleteFilter:m.useCallback(n=>{e&&a({path:{accountId:e,filterId:n}})},[e,a]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}};export{h as N,Z as S,Y as a,A as b,te as c,K as d,se as e,B as f,ne as g,y as h,ae as i,X as j,V as k,ee as n,G as o,O as p,U as r,re as u};
1
+ import{r as m,i as b,e2 as E,c as C,e3 as x,dC as F,e4 as D,h as M,e5 as N,e6 as P,e7 as L,e8 as z}from"./index-CdEOtGjn.js";const B=(e,t)=>{if(e.state==="Expired")return"Expired";if(e.scope!=="Temporary"||!e.expiresAt)return"Active";const r=Date.parse(e.expiresAt);return Number.isNaN(r)?"Active":r<=t?"Expired":"Active"},K=e=>{if(!e)return;const t=Date.parse(e);if(!Number.isNaN(t))return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},O=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,a,i,n]=r,s=new Date(Number(a),Number(i)-1,Number(n),23,59,59,0);if(Number.isNaN(s.getTime()))return;const o=-t.getTimezoneOffset(),d=o>=0?"+":"-",l=Math.abs(o),c=String(Math.floor(l/60)).padStart(2,"0"),f=String(l%60).padStart(2,"0"),u=p=>String(p).padStart(2,"0");return`${s.getFullYear()}-${u(s.getMonth()+1)}-${u(s.getDate())}T${u(s.getHours())}:${u(s.getMinutes())}:${u(s.getSeconds())}${d}${c}:${f}`},h="None",V=e=>!e.literalClauses.some(t=>t.field==="HasWords"),y=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),G=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",X=({mode:e,ruleScope:t,anchorMessageId:r,clauses:a,matchOperator:i,moveMailboxId:n,until:s})=>({...e==="similar"&&r?{anchorMessageId:r}:{},matchOperator:i==="all"?"And":"Or",literalClauses:a.map(o=>({field:o.field,value:o.value})),moveMailboxId:n,expiresAt:t==="until"?O(s??""):void 0}),S=(e,t,r)=>({name:r,scope:t==="standing"?"Standing":"Temporary",...t==="temporary"&&e.expiresAt?{expiresAt:e.expiresAt}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h,...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{}}),T=new Set(["Complete","Failed"]),v=e=>e!==void 0&&T.has(e),w=1e3,J=15e3,_=e=>{const t=Math.max(0,e),r=w*2**t;return Math.min(r,J)},$=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},Y=e=>{const[t,r]=m.useState(),a=b({...E(),onSuccess:g=>r(g.organizeJobId)}),{mutate:i}=a,n=C({...x({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const I=g.state.data?.state;return v(I)?!1:_(g.state.dataUpdateCount)}}),s=m.useCallback(g=>{e&&i({path:{accountId:e},body:y(g)})},[e,i]),{refetch:o}=n,d=m.useCallback(()=>{o()},[o]),l=n.data,c=a.isPending?void 0:l,f=c?.state??a.data?.state,u=v(c?.state),p={state:f,matchedCount:c?.matchedCount??0,appliedCount:c?.appliedCount??0,failedCount:c?.failedCount??0,errorMessage:c?.errorMessage??""};return{start:s,refreshStatus:d,progress:p,isStarting:a.isPending,isRunning:!!t&&!u,isDone:u,failure:$(a.error,n.error,!!l)}},Z=["From","Subject","HasWords","ListId","FromDomain"],k=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},ee=(e,t)=>e==="ListId"?k(t):t.trim(),R=e=>e==="all"?"And":"Or",U=(e,t)=>{const r=e.widen!==void 0&&!e.widen.inactive,a=e.clauses.map(i=>({field:i.field,value:i.value}));return{...r&&t?{anchorMessageId:t}:{},matchOperator:R(e.matchOperator),literalClauses:a}},Q=e=>e.anchorMessageId!==void 0||!e.literalClauses.some(t=>t.field==="HasWords"),j=e=>JSON.stringify({anchor:e.anchorMessageId??null,operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),te=(e,t)=>{const r=U(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?O(e.until??""):void 0}},q=(e,t)=>e.error!==void 0&&e.errorSignature===t?{status:"error",reason:e.error}:e.count===void 0?{status:"loading"}:e.previewedSignature===t?{status:"ready",count:e.count}:{status:"ready",count:e.count,stale:!0},H=350,re=(e,t,r)=>{const a=b(F()),{mutateAsync:i}=a,n=j(t),[s,o]=m.useState(()=>({})),d=m.useRef(t);d.current=t;const l=m.useRef(n),c=Q(t);return m.useEffect(()=>{if(!e||!c||n===s.previewedSignature||n===s.errorSignature)return;const f=setTimeout(()=>{const u=n;l.current=u,i({path:{accountId:e},body:y({...d.current})}).then(p=>{l.current===u&&o({count:p.matchedCount,matchedIds:p.messageIds,previewedSignature:u})}).catch(p=>{l.current===u&&o(g=>({...g,error:p instanceof Error?p.message:"Couldn't count matches.",errorSignature:u}))})},H);return()=>clearTimeout(f)},[e,c,n,s.previewedSignature,s.errorSignature,i]),c?{count:q(s,n),matchedIds:s.previewedSignature===n?s.matchedIds??[]:[]}:{count:{status:"error",reason:D},matchedIds:[]}},A=e=>P({path:{accountId:e}}),se=e=>{const t=C({...L({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},ae=e=>{const t=M(),r=b({...N(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:A(e)})}}),{mutate:a,mutateAsync:i}=r,n=m.useCallback((o,d,l)=>{e&&a({path:{accountId:e},body:S(o,d,l)})},[e,a]),s=m.useCallback(async(o,d,l)=>e?i({path:{accountId:e},body:S(o,d,l)}).then(()=>!0,()=>!1):!1,[e,i]);return{createFilter:n,createFilterAsync:s,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},ne=e=>{const t=M(),r=b({...z(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:A(e)})}}),{mutate:a}=r;return{deleteFilter:m.useCallback(n=>{e&&a({path:{accountId:e,filterId:n}})},[e,a]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}};export{h as N,Z as S,Y as a,A as b,te as c,K as d,se as e,B as f,ne as g,y as h,ae as i,X as j,V as k,ee as n,G as o,O as p,U as r,re as u};
@@ -1 +1 @@
1
- import{c as d,dZ as L,h as n,i as l,d_ as p,r as o,d$ as y,e0 as c,e1 as g}from"./index-BHv-NPe9.js";const u=e=>y({path:{accountId:e}}),f=e=>{const r=d({...L({path:{accountId:e??""}}),enabled:!!e});return{labels:r.data?.items??[],isPending:r.isPending,isError:r.isError,error:r.error,refetch:r.refetch}},h=e=>{const r=n(),t=l({...p(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutateAsync:s}=t;return{createLabel:o.useCallback((a,i="Default")=>e?s({path:{accountId:e},body:{name:a,color:i}}):Promise.reject(new Error("No account")),[e,s]),isPending:t.isPending,isError:t.isError,error:t.error,reset:t.reset}},m=e=>{const r=n(),t=l({...c(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{updateLabel:o.useCallback((a,i)=>{e&&s({path:{accountId:e,labelId:a},body:i})},[e,s]),isPending:t.isPending,updatingLabelId:t.isPending?t.variables?.path.labelId:void 0}},C=e=>{const r=n(),t=l({...g(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{deleteLabel:o.useCallback(a=>{e&&s({path:{accountId:e,labelId:a}})},[e,s]),isPending:t.isPending,deletingLabelId:t.isPending?t.variables?.path.labelId:void 0}};export{f as a,m as b,C as c,h as u};
1
+ import{c as d,dZ as L,h as n,i as l,d_ as p,r as o,d$ as y,e0 as c,e1 as g}from"./index-CdEOtGjn.js";const u=e=>y({path:{accountId:e}}),f=e=>{const r=d({...L({path:{accountId:e??""}}),enabled:!!e});return{labels:r.data?.items??[],isPending:r.isPending,isError:r.isError,error:r.error,refetch:r.refetch}},h=e=>{const r=n(),t=l({...p(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutateAsync:s}=t;return{createLabel:o.useCallback((a,i="Default")=>e?s({path:{accountId:e},body:{name:a,color:i}}):Promise.reject(new Error("No account")),[e,s]),isPending:t.isPending,isError:t.isError,error:t.error,reset:t.reset}},m=e=>{const r=n(),t=l({...c(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{updateLabel:o.useCallback((a,i)=>{e&&s({path:{accountId:e,labelId:a},body:i})},[e,s]),isPending:t.isPending,updatingLabelId:t.isPending?t.variables?.path.labelId:void 0}},C=e=>{const r=n(),t=l({...g(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:u(e)})}}),{mutate:s}=t;return{deleteLabel:o.useCallback(a=>{e&&s({path:{accountId:e,labelId:a}})},[e,s]),isPending:t.isPending,deletingLabelId:t.isPending?t.variables?.path.labelId:void 0}};export{f as a,m as b,C as c,h as u};
@@ -1 +1 @@
1
- import{e as r,u as s,r as o,bU as t,bV as n}from"./index-BHv-NPe9.js";const p=r("BellOff",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]);function l(){const e=s();return o.useCallback(a=>{e({to:"/mail/brief",search:{q:a||void 0}})},[e])}function h(){const e=s();return o.useCallback((a,i)=>{e({to:"/mail/$mailboxId",params:{mailboxId:a},search:{q:i||void 0}})},[e])}const c=768,d=e=>e!=="desktop",b=()=>{const e=t(`(min-width: ${c}px)`);return t(n)?"desktop":e?"tablet":"phone"};export{p as B,l as a,h as b,d as i,b as u};
1
+ import{e as r,u as s,r as o,bU as t,bV as n}from"./index-CdEOtGjn.js";const p=r("BellOff",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]);function l(){const e=s();return o.useCallback(a=>{e({to:"/mail/brief",search:{q:a||void 0}})},[e])}function h(){const e=s();return o.useCallback((a,i)=>{e({to:"/mail/$mailboxId",params:{mailboxId:a},search:{q:i||void 0}})},[e])}const c=768,d=e=>e!=="desktop",b=()=>{const e=t(`(min-width: ${c}px)`);return t(n)?"desktop":e?"tablet":"phone"};export{p as B,l as a,h as b,d as i,b as u};
@@ -1 +1 @@
1
- import{r as c,u as S,ce as O,cf as B,a8 as h,cg as N,q as P,aa as U,h as D,c as $,cD as F,cE as v}from"./index-BHv-NPe9.js";const R="/mail/brief/compose/{-$outboxMessageId}",w="/mail/flagged/compose/{-$outboxMessageId}",E="/mail/outbox/compose/{-$outboxMessageId}",k="/mail/$mailboxId/compose/{-$outboxMessageId}";function T(){const e=h({from:R,shouldThrow:!1}),t=h({from:w,shouldThrow:!1}),r=h({from:E,shouldThrow:!1}),s=h({from:k,shouldThrow:!1});return e??t??r??s}function Y(){return T()!==void 0}function j(){return T()?.outboxMessageId}function L(e,t,r){return e==="flagged"?{to:w,params:{outboxMessageId:r}}:e==="outbox"?{to:E,params:{outboxMessageId:r}}:e==="mailbox"&&t?{to:k,params:{mailboxId:t,outboxMessageId:r}}:{to:R,params:{outboxMessageId:r}}}function b(){const e=S(),t=O(),{list:r,mailboxId:s}=B();return c.useCallback((n,o)=>{e({...L(r,s,n),search:a=>a,hash:o?.keepPanels?!0:t,replace:o?.replace??!1})},[e,t,r,s])}function J(){const e=b();return c.useCallback(()=>e(void 0),[e])}function V(){const e=b();return c.useCallback(t=>e(t),[e])}function Z(){const e=b();return c.useCallback(t=>e(t,{replace:!0,keepPanels:!0}),[e])}function ee(){return N()}const _=e=>{const t=e.filter(n=>!n.isMultipart&&n.disposition!=="attachment"&&n.mediaType==="TEXT"&&n.contentUrl.length>0),r=t.find(n=>n.mediaSubtype.toUpperCase()==="HTML");if(r)return{kind:"html",contentUrl:r.contentUrl};const s=t.find(n=>n.mediaSubtype.toUpperCase()==="PLAIN");return s?{kind:"text",contentUrl:s.contentUrl}:null},g={all:["messages"],detail:e=>[...g.all,"detail",e],body:e=>[...g.detail(e),"body"]};class f extends Error{reason;status;retryAfterSeconds;constructor(t,r,s,n){super(r),this.name="BodyFetchError",this.reason=t,this.status=s,this.retryAfterSeconds=n}}const q=e=>{const t=Number.parseInt(e??"",10);return!Number.isFinite(t)||t<=0?1:Math.min(t,30)},K=8,Q="x-remit-403-reason",I=(e,t)=>{const r=t?.trim()??"";return e===401?"auth":e===403?r.length>0?"auth":"body-missing":e===404?"body-missing":"generic"},X=(e,t)=>(t??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(e):!1,G=(e,t)=>{const r=(t??"").toLowerCase();return!!(e==="text"&&r.startsWith("text/html"))},H=async(e,t,r=async()=>null)=>{const s={},n=await r();n&&(s.Authorization=`Bearer ${n}`);const o=await v(e,{headers:s});if(o.status===202)throw new f("not-ready","Message body is still syncing",202,q(o.headers.get("Retry-After")));if(!o.ok){const l=o.headers.get(Q),y=I(o.status,l);throw new f(y,`Failed to load message body (${o.status} ${o.statusText})`,o.status)}const a=o.headers.get("content-type");if(G(t,a))throw new f("content-type-mismatch",`Refusing to render message body — expected ${t}, got Content-Type ${a}`);const m=await o.text();if(X(m,a))throw new f("spa-shell-leak","Refusing to render message body — response looks like the SPA shell (CloudFront 403/404 fallback leaked through to /content/*)");return m},W=async(e,t)=>(t.isRetryAfterNotReady&&await e.refetchDescribeMessage(),e.fetchContent(t.contentUrl,t.kind)),te=({messageId:e,bodyParts:t,enabled:r=!0})=>{const s=t?_(t):null,n=P(),{getToken:o}=U(),a=c.useRef(null),m=D(),l=c.useRef(!1),y=c.useRef(null),C=e&&s?`${e}:${s.contentUrl}`:null;y.current!==C&&(y.current=C,l.current=!1);const i=$({queryKey:e?[...g.body(e),s?.contentUrl??null]:["messages","body","noop"],queryFn:()=>{if(!s)throw new Error("No renderable body part");if(!e)throw new Error("No messageId");const d=l.current;return l.current=!1,W({fetchContent:(u,M)=>H(u,M,o),refetchDescribeMessage:()=>m.refetchQueries({queryKey:F({path:{messageId:e}})})},{contentUrl:s.contentUrl,kind:s.kind,isRetryAfterNotReady:d})},enabled:r&&!!e&&!!s,staleTime:300*1e3,gcTime:1800*1e3,retry:(d,u)=>u instanceof f&&u.reason==="not-ready"?d<K:d<1,retryDelay:(d,u)=>u instanceof f&&u.reason==="not-ready"?(l.current=!0,(u.retryAfterSeconds??1)*1e3):1e3,meta:{softError:!0}}),p=i.isLoading&&!!s,x=t!==void 0&&s===null;c.useEffect(()=>{p&&(a.current=performance.now())},[p]),c.useEffect(()=>{i.isSuccess&&a.current!==null&&(n.recordTiming("message.body.load",Math.round(performance.now()-a.current)),a.current=null)},[i.isSuccess,n]);const A=i.data&&s?{kind:s.kind,body:i.data}:void 0;return{picked:s,data:A,isLoading:p,hasNoRenderablePart:x,isError:i.isError,error:i.error,refetch:i.refetch}};export{f as B,Y as a,te as b,j as c,Z as d,ee as e,V as f,I as g,J as u};
1
+ import{r as c,u as S,ce as O,cf as B,a8 as h,cg as N,q as P,aa as U,h as D,c as $,cD as F,cE as v}from"./index-CdEOtGjn.js";const R="/mail/brief/compose/{-$outboxMessageId}",w="/mail/flagged/compose/{-$outboxMessageId}",E="/mail/outbox/compose/{-$outboxMessageId}",k="/mail/$mailboxId/compose/{-$outboxMessageId}";function T(){const e=h({from:R,shouldThrow:!1}),t=h({from:w,shouldThrow:!1}),r=h({from:E,shouldThrow:!1}),s=h({from:k,shouldThrow:!1});return e??t??r??s}function Y(){return T()!==void 0}function j(){return T()?.outboxMessageId}function L(e,t,r){return e==="flagged"?{to:w,params:{outboxMessageId:r}}:e==="outbox"?{to:E,params:{outboxMessageId:r}}:e==="mailbox"&&t?{to:k,params:{mailboxId:t,outboxMessageId:r}}:{to:R,params:{outboxMessageId:r}}}function b(){const e=S(),t=O(),{list:r,mailboxId:s}=B();return c.useCallback((n,o)=>{e({...L(r,s,n),search:a=>a,hash:o?.keepPanels?!0:t,replace:o?.replace??!1})},[e,t,r,s])}function J(){const e=b();return c.useCallback(()=>e(void 0),[e])}function V(){const e=b();return c.useCallback(t=>e(t),[e])}function Z(){const e=b();return c.useCallback(t=>e(t,{replace:!0,keepPanels:!0}),[e])}function ee(){return N()}const _=e=>{const t=e.filter(n=>!n.isMultipart&&n.disposition!=="attachment"&&n.mediaType==="TEXT"&&n.contentUrl.length>0),r=t.find(n=>n.mediaSubtype.toUpperCase()==="HTML");if(r)return{kind:"html",contentUrl:r.contentUrl};const s=t.find(n=>n.mediaSubtype.toUpperCase()==="PLAIN");return s?{kind:"text",contentUrl:s.contentUrl}:null},g={all:["messages"],detail:e=>[...g.all,"detail",e],body:e=>[...g.detail(e),"body"]};class f extends Error{reason;status;retryAfterSeconds;constructor(t,r,s,n){super(r),this.name="BodyFetchError",this.reason=t,this.status=s,this.retryAfterSeconds=n}}const q=e=>{const t=Number.parseInt(e??"",10);return!Number.isFinite(t)||t<=0?1:Math.min(t,30)},K=8,Q="x-remit-403-reason",I=(e,t)=>{const r=t?.trim()??"";return e===401?"auth":e===403?r.length>0?"auth":"body-missing":e===404?"body-missing":"generic"},X=(e,t)=>(t??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(e):!1,G=(e,t)=>{const r=(t??"").toLowerCase();return!!(e==="text"&&r.startsWith("text/html"))},H=async(e,t,r=async()=>null)=>{const s={},n=await r();n&&(s.Authorization=`Bearer ${n}`);const o=await v(e,{headers:s});if(o.status===202)throw new f("not-ready","Message body is still syncing",202,q(o.headers.get("Retry-After")));if(!o.ok){const l=o.headers.get(Q),y=I(o.status,l);throw new f(y,`Failed to load message body (${o.status} ${o.statusText})`,o.status)}const a=o.headers.get("content-type");if(G(t,a))throw new f("content-type-mismatch",`Refusing to render message body — expected ${t}, got Content-Type ${a}`);const m=await o.text();if(X(m,a))throw new f("spa-shell-leak","Refusing to render message body — response looks like the SPA shell (CloudFront 403/404 fallback leaked through to /content/*)");return m},W=async(e,t)=>(t.isRetryAfterNotReady&&await e.refetchDescribeMessage(),e.fetchContent(t.contentUrl,t.kind)),te=({messageId:e,bodyParts:t,enabled:r=!0})=>{const s=t?_(t):null,n=P(),{getToken:o}=U(),a=c.useRef(null),m=D(),l=c.useRef(!1),y=c.useRef(null),C=e&&s?`${e}:${s.contentUrl}`:null;y.current!==C&&(y.current=C,l.current=!1);const i=$({queryKey:e?[...g.body(e),s?.contentUrl??null]:["messages","body","noop"],queryFn:()=>{if(!s)throw new Error("No renderable body part");if(!e)throw new Error("No messageId");const d=l.current;return l.current=!1,W({fetchContent:(u,M)=>H(u,M,o),refetchDescribeMessage:()=>m.refetchQueries({queryKey:F({path:{messageId:e}})})},{contentUrl:s.contentUrl,kind:s.kind,isRetryAfterNotReady:d})},enabled:r&&!!e&&!!s,staleTime:300*1e3,gcTime:1800*1e3,retry:(d,u)=>u instanceof f&&u.reason==="not-ready"?d<K:d<1,retryDelay:(d,u)=>u instanceof f&&u.reason==="not-ready"?(l.current=!0,(u.retryAfterSeconds??1)*1e3):1e3,meta:{softError:!0}}),p=i.isLoading&&!!s,x=t!==void 0&&s===null;c.useEffect(()=>{p&&(a.current=performance.now())},[p]),c.useEffect(()=>{i.isSuccess&&a.current!==null&&(n.recordTiming("message.body.load",Math.round(performance.now()-a.current)),a.current=null)},[i.isSuccess,n]);const A=i.data&&s?{kind:s.kind,body:i.data}:void 0;return{picked:s,data:A,isLoading:p,hasNoRenderablePart:x,isError:i.isError,error:i.error,refetch:i.refetch}};export{f as B,Y as a,te as b,j as c,Z as d,ee as e,V as f,I as g,J as u};
@@ -1 +1 @@
1
- import{bW as Q,bX as y,bY as S,bZ as w,b_ as C,h as k,b$ as q,c0 as x,r as p,c1 as M,c2 as H,c3 as L,c4 as P,c5 as O,c6 as B,c7 as A}from"./index-BHv-NPe9.js";function R(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function T(r,e,s){const t=r.slice(0);return t[e]=s,t}var z=class extends Q{#i;#e;#n;#r;#s;#t;#o;#u;#h;#c=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#d(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,a=i.some((o,d)=>o!==s[d]),f=u||a,b=f?!0:n.some((o,d)=>{const g=this.#e[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#c=t,this.#s=i),this.#e=n,this.hasListeners()&&(f&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#f(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#a(t,s)]}#a(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#f(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new C(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#d(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=T(this.#e,s,e),this.#p())}#p(){if(this.hasListeners()){const r=this.#a(this.#e,this.#c),e=this.#b(),s=this.#t,t=e?s:this.#l(r,this.#r?.combine);(e||s!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function U({queries:r,...e},s){const t=k(),i=q(),n=x(),u=p.useMemo(()=>r.map(h=>{const c=t.defaultQueryOptions(h);return c._optimisticResults=i?"isRestoring":"optimistic",c}),[r,t,i]);u.forEach(h=>{M(h);const c=t.getQueryCache().get(h.queryHash);H(h,n,c)}),L(n);const[a]=p.useState(()=>new z(t,u,e)),[f,b,o]=a.getOptimisticResult(u,e.combine),d=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>d?a.subscribe(y.batchCalls(h)):P,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p.useEffect(()=>{a.setQueries(u,e)},[u,e,a]);const m=f.some((h,c)=>O(u[c],h))?f.flatMap((h,c)=>{const l=u[c];if(l&&O(l,h)){const E=new C(t,l);return B(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=f.find((h,c)=>{const l=u[c];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{U as u};
1
+ import{bW as Q,bX as y,bY as S,bZ as w,b_ as C,h as k,b$ as q,c0 as x,r as p,c1 as M,c2 as H,c3 as L,c4 as P,c5 as O,c6 as B,c7 as A}from"./index-CdEOtGjn.js";function R(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function T(r,e,s){const t=r.slice(0);return t[e]=s,t}var z=class extends Q{#i;#e;#n;#r;#s;#t;#o;#u;#h;#c=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#d(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#f(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,a=i.some((o,d)=>o!==s[d]),f=u||a,b=f?!0:n.some((o,d)=>{const g=this.#e[d];return!g||!S(o,g)});!f&&!b||(f&&(this.#c=t,this.#s=i),this.#e=n,this.hasListeners()&&(f&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(d=>{this.#d(o,d)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#f(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#a(t,s)]}#a(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#f(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new C(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#d(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=T(this.#e,s,e),this.#p())}#p(){if(this.hasListeners()){const r=this.#a(this.#e,this.#c),e=this.#b(),s=this.#t,t=e?s:this.#l(r,this.#r?.combine);(e||s!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function U({queries:r,...e},s){const t=k(),i=q(),n=x(),u=p.useMemo(()=>r.map(h=>{const c=t.defaultQueryOptions(h);return c._optimisticResults=i?"isRestoring":"optimistic",c}),[r,t,i]);u.forEach(h=>{M(h);const c=t.getQueryCache().get(h.queryHash);H(h,n,c)}),L(n);const[a]=p.useState(()=>new z(t,u,e)),[f,b,o]=a.getOptimisticResult(u,e.combine),d=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>d?a.subscribe(y.batchCalls(h)):P,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p.useEffect(()=>{a.setQueries(u,e)},[u,e,a]);const m=f.some((h,c)=>O(u[c],h))?f.flatMap((h,c)=>{const l=u[c];if(l&&O(l,h)){const E=new C(t,l);return B(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=f.find((h,c)=>{const l=u[c];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{U as u};
@@ -1 +1 @@
1
- import{j as E,_ as W,t as Q,f as U,r as o,aN as R,h as O,C as $,q as z,K as B,M as G,N as I,P as X}from"./index-BHv-NPe9.js";import{C as V}from"./circle-check-big-B-r3FrmI.js";import{R as J}from"./refresh-cw-Cj8CzO6f.js";import{u as P}from"./useQueries-BArSdAIw.js";import{i as Y,t as Z}from"./search-token-index-h8qI1Yib.js";function we({state:e,onRefresh:s,label:t,errorMessage:r,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",n=e==="error",h=e==="success",y=n?E.jsx(W,{className:"size-4 text-danger"}):h?E.jsx(V,{className:"size-4 text-positive"}):E.jsx(J,{className:Q("size-4",i&&"animate-spin")}),w=n?`${t} — failed: ${r??"try again"}`:i?`${t} — refreshing`:h?`${t} — up to date`:a?`${t} — new mail`:t;return E.jsxs("div",{className:"relative inline-flex",children:[E.jsx(U,{variant:"ghost",size:u,icon:y,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:n?r:t,className:c}),e==="idle"&&a&&E.jsx("span",{"aria-hidden":"true",className:"absolute right-1 top-1 size-1.5 rounded-full bg-accent-2"})]})}const ee=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function L(e){return!!e&&ee.has(e)}const q=3e3,te=q*2,T={syncing:!1,resolved:!1,synced:0,total:0};function xe(e,s){const t=e.join(","),[r,a]=o.useState(!1),[u,c]=o.useState(!1);o.useEffect(()=>{a(!1),c(!1)},[t,s]),o.useEffect(()=>{if(!s)return;const m=setTimeout(()=>c(!0),te);return()=>clearTimeout(m)},[t,s]);const i=P({queries:e.map(m=>({...R({path:{accountId:m}}),enabled:s&&!r,refetchInterval:q,meta:{softError:!0}}))}),n=i.every(m=>m.isSuccess||m.isError),h=i.length===0||n||u;let y=!1,w=0,S=0;for(const m of i)if(L(m.data?.syncPhase)){y=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,S+=l.messagesTotal}const x=s&&h&&!y;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?T:{syncing:y,resolved:!0,synced:w,total:S}}const se=180*1e3,pe=30*1e3;let F=0;const M=new Set,ne=(e=Date.now())=>{F=e+se;for(const s of M)s()},Ee=(e=Date.now())=>e<F,be=e=>(M.add(e),()=>{M.delete(e)}),_=6e4,re=new Set(["sent","drafts","trash","archive"]),C=(e,s)=>{const t=new Map;for(const r of e){const a=s.get(r.mailboxId)?.role;a&&re.has(a)||t.set(r.mailboxId,r.messagesTotal)}return t},j=(e,s)=>{const t=[];for(const[r,a]of s)a>(e.get(r)??0)&&t.push(r);return t},oe=(e,s)=>j(e,s).length>0,D=o.createContext(null),ae=()=>{const e=o.useContext(D);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function Re({accountIds:e,children:s}){const t=O(),{resultFolderIndex:r}=$(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,n]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:_,staleTime:_,meta:{softError:!0}}))}),y=h.map(l=>l.dataUpdatedAt).join(","),w=e.join(",");o.useEffect(()=>{let l=!1;const f=new Set(i);e.forEach((d,p)=>{const b=h[p]?.data;if(!b)return;const g=C(b.mailboxes??[],r),k=c.current.get(d);if(c.current.set(d,g),k){const A=j(k,g);A.length>0&&Y(t,Z(A))}if(!u.current.has(d)){u.current.add(d),a.current.set(d,g);return}if(f.has(d))return;const K=a.current.get(d)??new Map;oe(K,g)&&(f.add(d),l=!0)}),l&&n(f)},[w,y]);const S=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{n(f=>{if(l.every(p=>!f.has(p)))return f;const d=new Set(f);for(const p of l)d.delete(p);return d});for(const f of l){const d=t.getQueryData(R({path:{accountId:f}}).queryKey);a.current.set(f,C(d?.mailboxes??[],r)),u.current.add(f)}},[t,r]),m=o.useMemo(()=>({hasNewMail:S,acknowledge:x}),[S,x]);return E.jsx(D.Provider,{value:m,children:s})}const ie=2e3,ce=45e3,ue=e=>new Promise(s=>setTimeout(s,e)),v=e=>e instanceof Error&&e.message?e.message:"Something went wrong",le=e=>{I(e,{softError:!0},"user")&&X(e)},N=(e,s)=>e.fetchQuery({...R({path:{accountId:s}}),staleTime:0}),H=e=>e.mailboxes?.find(s=>s.fullPath?.toUpperCase()==="INBOX")?.lastSyncedAt??0,fe=async({accountId:e,readStatus:s,baselineLastSyncAt:t,baselineInboxSyncedAt:r=0,onInboxSynced:a,deadline:u,pollMs:c=ie})=>{let i=!1;for(;;){const n=await s().then(S=>({ok:!0,data:S})).catch(S=>({ok:!1,error:S}));if(!n.ok)return{accountId:e,message:v(n.error)};const{syncPhase:h,lastSyncAt:y}=n.data;if((y??0)>t&&!L(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(n.data)>r&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ue(c)}},de=async(e,s,t,r,a)=>{const u=await N(e,t).then(n=>({ok:!0,lastSyncAt:n.lastSyncAt??0,inboxSyncedAt:H(n)})).catch(n=>({ok:!1,error:n}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:v(u.error)};const c=await B({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(n=>({ok:!1,error:n}));if(!c.ok)return le(c.error),{accountId:t,enqueued:!1,ok:!1,message:v(c.error)};s.recordEvent("sync.triggered");const i=await fe({accountId:t,readStatus:()=>N(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:r});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},Me=(e,s={})=>{const t=O(),r=z(),{acknowledge:a}=ae(),[u,c]=o.useState("idle"),[i,n]=o.useState(),h=o.useRef(0),y=o.useRef(e);y.current=e;const w=o.useRef(s);w.current=s,o.useEffect(()=>{if(u!=="success")return;const x=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(x)},[u]);const S=o.useCallback(()=>{const x=y.current;if(x.length===0){c("error"),n("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),n(void 0),ne();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:G({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ce,d=await Promise.all(x.map(g=>de(t,r,g,f,l)));if(h.current!==m)return;const p=d.filter(g=>g.enqueued).map(g=>g.accountId);for(const g of p)l(g);p.length>0&&a(p);const b=d.filter(g=>!g.ok);b.length===0?c("success"):(c("error"),n(b[0]?.message))})()},[a,t,r]);return{state:u,errorMessage:i,refresh:S}};export{pe as H,Re as M,we as R,Me as a,L as b,xe as c,Ee as i,be as s,ae as u};
1
+ import{j as E,_ as W,t as Q,f as U,r as o,aN as R,h as O,C as $,q as z,K as B,M as G,N as I,P as X}from"./index-CdEOtGjn.js";import{C as V}from"./circle-check-big-B_fzcouO.js";import{R as J}from"./refresh-cw-CPIcFBXF.js";import{u as P}from"./useQueries-Dw5Oc_5Z.js";import{i as Y,t as Z}from"./search-token-index-CFt66zmj.js";function we({state:e,onRefresh:s,label:t,errorMessage:r,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",n=e==="error",h=e==="success",y=n?E.jsx(W,{className:"size-4 text-danger"}):h?E.jsx(V,{className:"size-4 text-positive"}):E.jsx(J,{className:Q("size-4",i&&"animate-spin")}),w=n?`${t} — failed: ${r??"try again"}`:i?`${t} — refreshing`:h?`${t} — up to date`:a?`${t} — new mail`:t;return E.jsxs("div",{className:"relative inline-flex",children:[E.jsx(U,{variant:"ghost",size:u,icon:y,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:n?r:t,className:c}),e==="idle"&&a&&E.jsx("span",{"aria-hidden":"true",className:"absolute right-1 top-1 size-1.5 rounded-full bg-accent-2"})]})}const ee=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function L(e){return!!e&&ee.has(e)}const q=3e3,te=q*2,T={syncing:!1,resolved:!1,synced:0,total:0};function xe(e,s){const t=e.join(","),[r,a]=o.useState(!1),[u,c]=o.useState(!1);o.useEffect(()=>{a(!1),c(!1)},[t,s]),o.useEffect(()=>{if(!s)return;const m=setTimeout(()=>c(!0),te);return()=>clearTimeout(m)},[t,s]);const i=P({queries:e.map(m=>({...R({path:{accountId:m}}),enabled:s&&!r,refetchInterval:q,meta:{softError:!0}}))}),n=i.every(m=>m.isSuccess||m.isError),h=i.length===0||n||u;let y=!1,w=0,S=0;for(const m of i)if(L(m.data?.syncPhase)){y=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,S+=l.messagesTotal}const x=s&&h&&!y;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?T:{syncing:y,resolved:!0,synced:w,total:S}}const se=180*1e3,pe=30*1e3;let F=0;const M=new Set,ne=(e=Date.now())=>{F=e+se;for(const s of M)s()},Ee=(e=Date.now())=>e<F,be=e=>(M.add(e),()=>{M.delete(e)}),_=6e4,re=new Set(["sent","drafts","trash","archive"]),C=(e,s)=>{const t=new Map;for(const r of e){const a=s.get(r.mailboxId)?.role;a&&re.has(a)||t.set(r.mailboxId,r.messagesTotal)}return t},j=(e,s)=>{const t=[];for(const[r,a]of s)a>(e.get(r)??0)&&t.push(r);return t},oe=(e,s)=>j(e,s).length>0,D=o.createContext(null),ae=()=>{const e=o.useContext(D);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function Re({accountIds:e,children:s}){const t=O(),{resultFolderIndex:r}=$(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,n]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:_,staleTime:_,meta:{softError:!0}}))}),y=h.map(l=>l.dataUpdatedAt).join(","),w=e.join(",");o.useEffect(()=>{let l=!1;const f=new Set(i);e.forEach((d,p)=>{const b=h[p]?.data;if(!b)return;const g=C(b.mailboxes??[],r),k=c.current.get(d);if(c.current.set(d,g),k){const A=j(k,g);A.length>0&&Y(t,Z(A))}if(!u.current.has(d)){u.current.add(d),a.current.set(d,g);return}if(f.has(d))return;const K=a.current.get(d)??new Map;oe(K,g)&&(f.add(d),l=!0)}),l&&n(f)},[w,y]);const S=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{n(f=>{if(l.every(p=>!f.has(p)))return f;const d=new Set(f);for(const p of l)d.delete(p);return d});for(const f of l){const d=t.getQueryData(R({path:{accountId:f}}).queryKey);a.current.set(f,C(d?.mailboxes??[],r)),u.current.add(f)}},[t,r]),m=o.useMemo(()=>({hasNewMail:S,acknowledge:x}),[S,x]);return E.jsx(D.Provider,{value:m,children:s})}const ie=2e3,ce=45e3,ue=e=>new Promise(s=>setTimeout(s,e)),v=e=>e instanceof Error&&e.message?e.message:"Something went wrong",le=e=>{I(e,{softError:!0},"user")&&X(e)},N=(e,s)=>e.fetchQuery({...R({path:{accountId:s}}),staleTime:0}),H=e=>e.mailboxes?.find(s=>s.fullPath?.toUpperCase()==="INBOX")?.lastSyncedAt??0,fe=async({accountId:e,readStatus:s,baselineLastSyncAt:t,baselineInboxSyncedAt:r=0,onInboxSynced:a,deadline:u,pollMs:c=ie})=>{let i=!1;for(;;){const n=await s().then(S=>({ok:!0,data:S})).catch(S=>({ok:!1,error:S}));if(!n.ok)return{accountId:e,message:v(n.error)};const{syncPhase:h,lastSyncAt:y}=n.data;if((y??0)>t&&!L(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(n.data)>r&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ue(c)}},de=async(e,s,t,r,a)=>{const u=await N(e,t).then(n=>({ok:!0,lastSyncAt:n.lastSyncAt??0,inboxSyncedAt:H(n)})).catch(n=>({ok:!1,error:n}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:v(u.error)};const c=await B({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(n=>({ok:!1,error:n}));if(!c.ok)return le(c.error),{accountId:t,enqueued:!1,ok:!1,message:v(c.error)};s.recordEvent("sync.triggered");const i=await fe({accountId:t,readStatus:()=>N(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:r});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},Me=(e,s={})=>{const t=O(),r=z(),{acknowledge:a}=ae(),[u,c]=o.useState("idle"),[i,n]=o.useState(),h=o.useRef(0),y=o.useRef(e);y.current=e;const w=o.useRef(s);w.current=s,o.useEffect(()=>{if(u!=="success")return;const x=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(x)},[u]);const S=o.useCallback(()=>{const x=y.current;if(x.length===0){c("error"),n("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),n(void 0),ne();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:G({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ce,d=await Promise.all(x.map(g=>de(t,r,g,f,l)));if(h.current!==m)return;const p=d.filter(g=>g.enqueued).map(g=>g.accountId);for(const g of p)l(g);p.length>0&&a(p);const b=d.filter(g=>!g.ok);b.length===0?c("success"):(c("error"),n(b[0]?.message))})()},[a,t,r]);return{state:u,errorMessage:i,refresh:S}};export{pe as H,Re as M,we as R,Me as a,L as b,xe as c,Ee as i,be as s,ae as u};
@@ -1 +1 @@
1
- import{G as r,r as s,b3 as t}from"./index-BHv-NPe9.js";import{u as m}from"./useQueries-BArSdAIw.js";const a=i=>({items:i.map(e=>e.data?.items??[]),isPending:i.some(e=>e.isPending),error:i.find(e=>e.error)?.error??null});function u(i){const e=m({queries:i.map(o=>({...r({path:{accountId:o.accountId}}),staleTime:1/0})),combine:a});return{index:s.useMemo(()=>t(i.map((o,n)=>({folderAppointments:o.folderAppointments,mailboxes:e.items[n]??[]}))),[i,e]),isPending:e.isPending,error:e.error}}export{u};
1
+ import{G as r,r as s,b3 as t}from"./index-CdEOtGjn.js";import{u as m}from"./useQueries-Dw5Oc_5Z.js";const a=i=>({items:i.map(e=>e.data?.items??[]),isPending:i.some(e=>e.isPending),error:i.find(e=>e.error)?.error??null});function u(i){const e=m({queries:i.map(o=>({...r({path:{accountId:o.accountId}}),staleTime:1/0})),combine:a});return{index:s.useMemo(()=>t(i.map((o,n)=>({folderAppointments:o.folderAppointments,mailboxes:e.items[n]??[]}))),[i,e]),isPending:e.isPending,error:e.error}}export{u};
@@ -1,4 +1,4 @@
1
- import{cn as V,r as g,j as a,t as b,I as Q,h as Y,as as q,i as X,au as Z,cD as J,bL as ee,aa as te,_ as se,X as re,cS as R,C as ne,cf as ae}from"./index-BHv-NPe9.js";import{K as k}from"./kbd-CGsQ66xw.js";import{B as oe,b as ie}from"./useMessageBodyContent-BbMnogZm.js";import{i as ce}from"./search-scope-B5-OK3Cq.js";const le=(e,t)=>{const r=e==="newsletter"||e==="marketing"||t;return{framed:r,isPlain:!r}},de=()=>`
1
+ import{cn as V,r as g,j as a,t as b,I as Q,h as Y,as as q,i as X,au as Z,cD as J,bL as ee,aa as te,_ as se,X as re,cS as R,C as ne,cf as ae}from"./index-CdEOtGjn.js";import{K as k}from"./kbd-BP0jHRYr.js";import{B as oe,b as ie}from"./useMessageBodyContent-C7oxEm55.js";import{i as ce}from"./search-scope-B5-OK3Cq.js";const le=(e,t)=>{const r=e==="newsletter"||e==="marketing"||t;return{framed:r,isPlain:!r}},de=()=>`
2
2
  /* Zero the UA default body margin and clamp the document to the iframe width so
3
3
  wide author markup can't push the body (and the page) past the viewport. */
4
4
  html, body {
@@ -1 +1 @@
1
- import{h as T,as as C,i as I,cz as k,dV as A,r as v,j as p,dW as h,dX as E,dY as j,C as w,cf as z,c as D,dv as Q,cS as R}from"./index-BHv-NPe9.js";import{P as O}from"./attachment-file-BUzsbGzm.js";import{ag as P,ah as _}from"./MailListHeader-D23dSnHZ.js";import{i as N,t as q}from"./search-token-index-h8qI1Yib.js";import{a as B}from"./useLabels-BtdFNvp3.js";import{n as U}from"./search-query-Cr_ZXBCp.js";import{b as F}from"./search-scope-B5-OK3Cq.js";import{u as G,p as H}from"./useSearchTokenContext-Chuk9_R2.js";const ne=e=>{const t=new Set;for(const a of e)a&&t.add(a);return t.size>1?{accountId:void 0,restriction:"spansAccounts",moveDisabledHint:"Move only works within one account — clear selection or pick messages from a single account"}:{accountId:t.size===1?[...t][0]:void 0,restriction:void 0,moveDisabledHint:void 0}},V=e=>{const{mailboxId:t,messages:a}=e,c=T(),{pushError:l}=C(),{mutateAsync:i,isPending:o}=I({...A(),onError:(n,d)=>{l({title:d.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:k(n),error:n})},onSettled:(n,d,u)=>{N(c,q(P(u.body.messageIds??[],a??[],t)))}});return{applyLabel:v.useCallback((n,d,u)=>{n.length!==0&&_(n,m=>i({body:{messageIds:m,labelId:d,action:u}}))},[i]),isPending:o}};function re({accountId:e,mailboxId:t,messageIds:a}){const{labels:c}=B(e),{applyLabel:l}=V({mailboxId:t}),i=v.useMemo(()=>c.map(o=>({key:o.labelId,label:o.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${E(o.color)?h[o.color]:h.Default}`}),onSelect:()=>l(a,o.labelId,"Apply")})),[c,a,l]);return i.length===0?null:p.jsx(O,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(j,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:i,align:"start",nested:!0,touch:!1,triggerClassName:"min-h-11 w-full justify-start gap-3 px-4 py-2.5 text-sm font-normal text-fg"})}const K=20,W=new Set(Object.values(R)),X=e=>e!==void 0&&W.has(e)?e:void 0,Y=e=>{if(e.some(t=>t.type==="isUnread"))return!1;if(e.some(t=>t.type==="isRead"))return!0};function ie({mailboxId:e,filterCategory:t}={}){const{searchQuery:a}=w(),c=G(),l=z(),i=U(a),{freeText:o,tokens:r}=H(i,c),n=o.length>0,d=r.find(s=>s.type==="category"),u=X(t)??d?.category,m=r.some(s=>s.type==="hasAttachment")?!0:void 0,f=r.some(s=>s.type==="isStarred")?!0:void 0,y=Y(r),b=r.find(s=>s.type==="after"),g=r.find(s=>s.type==="before"),S=r.find(s=>s.type==="in"),x=F({browsed:l,callerMailboxId:e,inTokenMailboxId:S?.mailboxId}),{data:L,isLoading:M}=D({...Q({query:{query:o,mailboxId:x,limit:K,...u!==void 0?{category:u}:{},...m!==void 0?{hasAttachment:m}:{},...f!==void 0?{hasStars:f}:{},...y!==void 0?{isRead:y}:{},...b?{sentDateFrom:b.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:n,staleTime:6e4});return{hits:L?.items??[],isLoading:n&&M}}export{re as L,ne as r,ie as u};
1
+ import{h as T,as as C,i as I,cz as k,dV as A,r as v,j as p,dW as h,dX as E,dY as j,C as w,cf as z,c as D,dv as Q,cS as R}from"./index-CdEOtGjn.js";import{P as O}from"./attachment-file-gfs-I8K6.js";import{ag as P,ah as _}from"./MailListHeader-Bi5jkOPb.js";import{i as N,t as q}from"./search-token-index-CFt66zmj.js";import{a as B}from"./useLabels-DMUnrEOj.js";import{n as U}from"./search-query-Cr_ZXBCp.js";import{b as F}from"./search-scope-B5-OK3Cq.js";import{u as G,p as H}from"./useSearchTokenContext-B3r4oTZj.js";const ne=e=>{const t=new Set;for(const a of e)a&&t.add(a);return t.size>1?{accountId:void 0,restriction:"spansAccounts",moveDisabledHint:"Move only works within one account — clear selection or pick messages from a single account"}:{accountId:t.size===1?[...t][0]:void 0,restriction:void 0,moveDisabledHint:void 0}},V=e=>{const{mailboxId:t,messages:a}=e,c=T(),{pushError:l}=C(),{mutateAsync:i,isPending:o}=I({...A(),onError:(n,d)=>{l({title:d.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:k(n),error:n})},onSettled:(n,d,u)=>{N(c,q(P(u.body.messageIds??[],a??[],t)))}});return{applyLabel:v.useCallback((n,d,u)=>{n.length!==0&&_(n,m=>i({body:{messageIds:m,labelId:d,action:u}}))},[i]),isPending:o}};function re({accountId:e,mailboxId:t,messageIds:a}){const{labels:c}=B(e),{applyLabel:l}=V({mailboxId:t}),i=v.useMemo(()=>c.map(o=>({key:o.labelId,label:o.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${E(o.color)?h[o.color]:h.Default}`}),onSelect:()=>l(a,o.labelId,"Apply")})),[c,a,l]);return i.length===0?null:p.jsx(O,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(j,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:i,align:"start",nested:!0,touch:!1,triggerClassName:"min-h-11 w-full justify-start gap-3 px-4 py-2.5 text-sm font-normal text-fg"})}const K=20,W=new Set(Object.values(R)),X=e=>e!==void 0&&W.has(e)?e:void 0,Y=e=>{if(e.some(t=>t.type==="isUnread"))return!1;if(e.some(t=>t.type==="isRead"))return!0};function ie({mailboxId:e,filterCategory:t}={}){const{searchQuery:a}=w(),c=G(),l=z(),i=U(a),{freeText:o,tokens:r}=H(i,c),n=o.length>0,d=r.find(s=>s.type==="category"),u=X(t)??d?.category,m=r.some(s=>s.type==="hasAttachment")?!0:void 0,f=r.some(s=>s.type==="isStarred")?!0:void 0,y=Y(r),b=r.find(s=>s.type==="after"),g=r.find(s=>s.type==="before"),S=r.find(s=>s.type==="in"),x=F({browsed:l,callerMailboxId:e,inTokenMailboxId:S?.mailboxId}),{data:L,isLoading:M}=D({...Q({query:{query:o,mailboxId:x,limit:K,...u!==void 0?{category:u}:{},...m!==void 0?{hasAttachment:m}:{},...f!==void 0?{hasStars:f}:{},...y!==void 0?{isRead:y}:{},...b?{sentDateFrom:b.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:n,staleTime:6e4});return{hits:L?.items??[],isLoading:n&&M}}export{re as L,ne as r,ie as u};
@@ -1 +1 @@
1
- import{h as g,as as p,c as f,d as m,r,i as y,au as T,o as E,l as d}from"./index-BHv-NPe9.js";const i={html:"",plainText:""},x=e=>{const u=g(),{pushError:o}=p(),{data:n}=f({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(a=>a.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),s=y({...d(),onSuccess:()=>{u.invalidateQueries({queryKey:E()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),c=r.useCallback((t,a)=>{e&&s.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:a}})},[e,s]);return{signature:l,setSignature:c,isSaving:s.isPending}};export{x as u};
1
+ import{h as g,as as p,c as f,d as m,r,i as y,au as T,o as E,l as d}from"./index-CdEOtGjn.js";const i={html:"",plainText:""},x=e=>{const u=g(),{pushError:o}=p(),{data:n}=f({...m(),staleTime:1/0}),l=r.useMemo(()=>{if(!e||!n)return i;const t=n.accounts.find(a=>a.accountId===e);return t?{html:t.signatureHtml??"",plainText:t.signaturePlainText??""}:i},[e,n]),s=y({...d(),onSuccess:()=>{u.invalidateQueries({queryKey:E()})},onError:t=>{o(T("Couldn't save signature","The signature wasn't saved.",t))}}),c=r.useCallback((t,a)=>{e&&s.mutate({path:{accountId:e},body:{signatureHtml:t,signaturePlainText:a}})},[e,s]);return{signature:l,setSignature:c,isSaving:s.isPending}};export{x as u};
@@ -1 +1 @@
1
- import{a8 as d,eg as g,r as u,eh as y,bQ as m,u as D,ce as b,ef as C}from"./index-BHv-NPe9.js";const i="/calendar/$view/$date";function I(){const e=d({from:i,shouldThrow:!1}),a=g({from:i,shouldThrow:!1}),t=e?.view??"",n=e?.date??"",r=a?.calendarId;return u.useMemo(()=>({...y({view:t,date:n},m(new Date)),calendarIds:r??[]}),[t,n,r])}function z(){const e=d({from:"/calendar/$view/$date/$calendarObjectId",shouldThrow:!1}),a=d({from:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",shouldThrow:!1}),t=e?.calendarObjectId,n=a?.recurrenceId;return u.useMemo(()=>t?{calendarObjectId:t,recurrenceId:n}:void 0,[t,n])}function j(){return d({from:"/calendar/$view/$date/new",shouldThrow:!1})!==void 0}function A(){const e=D(),a=b(),{view:t,date:n}=I(),r=u.useCallback(s=>{e({to:i,params:s,search:!0,hash:a})},[e,a]);return u.useMemo(()=>({goToView:s=>r({view:s,date:n}),step:s=>r({view:t,date:C(n,t,s)}),goToToday:()=>r({view:t,date:m(new Date)}),setAnchorDate:s=>e({to:i,params:{view:t,date:s},search:!0,hash:a,replace:!0}),zoomToDay:s=>r({view:"day",date:s}),openEvent:(s,o)=>e(o===void 0||o===""?{to:"/calendar/$view/$date/$calendarObjectId",params:{view:t,date:n,calendarObjectId:s},search:!0,hash:a}:{to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:t,date:n,calendarObjectId:s,recurrenceId:o},search:!0,hash:a}),closeEvent:()=>r({view:t,date:n}),openComposer:()=>e({to:"/calendar/$view/$date/new",params:{view:t,date:n},search:!0,hash:a})}),[r,e,a,t,n])}const c=e=>String(e).padStart(2,"0"),N=e=>`${e.getUTCFullYear()}-${c(e.getUTCMonth()+1)}-${c(e.getUTCDate())}`,p=e=>{const a=e<0?"-":"+",t=Math.abs(e);return`${a}${c(Math.floor(t/60))}:${c(t%60)}`};function w(e,a){const t=new Date(`${e}T${a}:00`);return`${e}T${a}:00${p(-t.getTimezoneOffset())}`}const l=new Map;function O(e){if(l.has(e))return l.get(e);let a;try{a=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{a=void 0}return l.set(e,a),a}function h(e,a){const t=O(e);if(!t)return Number.NaN;const n=t.formatToParts(new Date(a)),r=T=>Number(n.find(v=>v.type===T)?.value),s=r("hour")%24;return(Date.UTC(r("year"),r("month")-1,r("day"),s,r("minute"),r("second"))-a)/6e4}function P(e,a,t){if(t==="")return`${e}T${a}:00+00:00`;const n=Date.parse(`${e}T${a}:00Z`),r=h(t,n);if(Number.isNaN(r))return w(e,a);const s=h(t,n-r*6e4);return`${e}T${a}:00${p(Number.isNaN(s)?r:s)}`}const $=e=>w(e,"00:00");function f(e,a){const[t,n,r]=e.split("-").map(Number);return N(new Date(Date.UTC(t,n-1,r+a)))}function U(e){const[a,t,n]=e.split("-").map(Number),r=new Date(Date.UTC(a,t-1,n));return f(e,-((r.getUTCDay()+6)%7))}function E(e,a){const[t,n]=a.split("-").map(Number);if(e==="year")return[`${t}-01-01`,`${t+1}-01-01`];if(e==="month"){const s=`${t}-${c(n)}-01`,o=n===12?`${t+1}-01-01`:`${t}-${c(n+1)}-01`;return[s,o]}if(e==="day")return[a,f(a,1)];const r=U(a);return[r,f(r,7)]}function S(e,a){const[t,n]=E(e,a);return{from:$(t),to:$(n)}}export{f as a,A as b,S as c,z as d,j as e,P as i,I as u};
1
+ import{a8 as d,eg as g,r as u,eh as y,bQ as m,u as D,ce as b,ef as C}from"./index-CdEOtGjn.js";const i="/calendar/$view/$date";function I(){const e=d({from:i,shouldThrow:!1}),a=g({from:i,shouldThrow:!1}),t=e?.view??"",n=e?.date??"",r=a?.calendarId;return u.useMemo(()=>({...y({view:t,date:n},m(new Date)),calendarIds:r??[]}),[t,n,r])}function z(){const e=d({from:"/calendar/$view/$date/$calendarObjectId",shouldThrow:!1}),a=d({from:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",shouldThrow:!1}),t=e?.calendarObjectId,n=a?.recurrenceId;return u.useMemo(()=>t?{calendarObjectId:t,recurrenceId:n}:void 0,[t,n])}function j(){return d({from:"/calendar/$view/$date/new",shouldThrow:!1})!==void 0}function A(){const e=D(),a=b(),{view:t,date:n}=I(),r=u.useCallback(s=>{e({to:i,params:s,search:!0,hash:a})},[e,a]);return u.useMemo(()=>({goToView:s=>r({view:s,date:n}),step:s=>r({view:t,date:C(n,t,s)}),goToToday:()=>r({view:t,date:m(new Date)}),setAnchorDate:s=>e({to:i,params:{view:t,date:s},search:!0,hash:a,replace:!0}),zoomToDay:s=>r({view:"day",date:s}),openEvent:(s,o)=>e(o===void 0||o===""?{to:"/calendar/$view/$date/$calendarObjectId",params:{view:t,date:n,calendarObjectId:s},search:!0,hash:a}:{to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:t,date:n,calendarObjectId:s,recurrenceId:o},search:!0,hash:a}),closeEvent:()=>r({view:t,date:n}),openComposer:()=>e({to:"/calendar/$view/$date/new",params:{view:t,date:n},search:!0,hash:a})}),[r,e,a,t,n])}const c=e=>String(e).padStart(2,"0"),N=e=>`${e.getUTCFullYear()}-${c(e.getUTCMonth()+1)}-${c(e.getUTCDate())}`,p=e=>{const a=e<0?"-":"+",t=Math.abs(e);return`${a}${c(Math.floor(t/60))}:${c(t%60)}`};function w(e,a){const t=new Date(`${e}T${a}:00`);return`${e}T${a}:00${p(-t.getTimezoneOffset())}`}const l=new Map;function O(e){if(l.has(e))return l.get(e);let a;try{a=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{a=void 0}return l.set(e,a),a}function h(e,a){const t=O(e);if(!t)return Number.NaN;const n=t.formatToParts(new Date(a)),r=T=>Number(n.find(v=>v.type===T)?.value),s=r("hour")%24;return(Date.UTC(r("year"),r("month")-1,r("day"),s,r("minute"),r("second"))-a)/6e4}function P(e,a,t){if(t==="")return`${e}T${a}:00+00:00`;const n=Date.parse(`${e}T${a}:00Z`),r=h(t,n);if(Number.isNaN(r))return w(e,a);const s=h(t,n-r*6e4);return`${e}T${a}:00${p(Number.isNaN(s)?r:s)}`}const $=e=>w(e,"00:00");function f(e,a){const[t,n,r]=e.split("-").map(Number);return N(new Date(Date.UTC(t,n-1,r+a)))}function U(e){const[a,t,n]=e.split("-").map(Number),r=new Date(Date.UTC(a,t-1,n));return f(e,-((r.getUTCDay()+6)%7))}function E(e,a){const[t,n]=a.split("-").map(Number);if(e==="year")return[`${t}-01-01`,`${t+1}-01-01`];if(e==="month"){const s=`${t}-${c(n)}-01`,o=n===12?`${t+1}-01-01`:`${t}-${c(n+1)}-01`;return[s,o]}if(e==="day")return[a,f(a,1)];const r=U(a);return[r,f(r,7)]}function S(e,a){const[t,n]=E(e,a);return{from:$(t),to:$(n)}}export{f as a,A as b,S as c,z as d,j as e,P as i,I as u};
package/index.html CHANGED
@@ -38,7 +38,7 @@
38
38
  } catch (_) {}
39
39
  })();
40
40
  </script>
41
- <script type="module" crossorigin src="/assets/index-BHv-NPe9.js"></script>
41
+ <script type="module" crossorigin src="/assets/index-CdEOtGjn.js"></script>
42
42
  <link rel="stylesheet" crossorigin href="/assets/index-SEZpqOSx.css">
43
43
  </head>
44
44
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client-dist",
3
- "version": "0.0.510",
3
+ "version": "0.0.512",
4
4
  "description": "Built Remit web client — static assets and the default runtime config.",
5
5
  "files": [
6
6
  "**/*"
@@ -1 +0,0 @@
1
- import{O as o}from"./index-BHv-NPe9.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{ai as m,j as o,O as p}from"./index-BHv-NPe9.js";import{a}from"./MailShell-DlOlRRYj.js";import{M as r}from"./MailboxPane-C6l_0N2O.js";import{d as e}from"./search-token-index-h8qI1Yib.js";import{u as s}from"./search-mirror-BRprscwL.js";import"./FullCompose-mvt6fbW1.js";import"./ErrorState-CyVYcmVT.js";import"./index-BiyAH7mw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./confirm-dialog-fMpZDQwU.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-Bx-djS5M.js";import"./circle-check-big-B-r3FrmI.js";import"./refresh-cw-Cj8CzO6f.js";import"./useQueries-BArSdAIw.js";import"./MailListHeader-D23dSnHZ.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./EmptyState-DMV0fkvR.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./useLayoutTier-CzUPxRwt.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./menu-_yyuL7QC.js";import"./MailViewChrome-DpYVT5yN.js";import"./NavMenuButton-BPDa4SMb.js";import"./useLabels-BtdFNvp3.js";import"./useSemanticSearch-Cxd2wzTv.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-Dphhrv7V.js";import"./circle-help-DgIUxvXo.js";import"./circle-check-DJTw8XeH.js";function oo(){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{oo as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BHv-NPe9.js";import{M as r}from"./MailboxPane-C6l_0N2O.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-Bx-djS5M.js";import"./circle-check-big-B-r3FrmI.js";import"./refresh-cw-Cj8CzO6f.js";import"./useQueries-BArSdAIw.js";import"./search-token-index-h8qI1Yib.js";import"./useLayoutTier-CzUPxRwt.js";import"./MailListHeader-D23dSnHZ.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./index-BiyAH7mw.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./EmptyState-DMV0fkvR.js";import"./ErrorState-CyVYcmVT.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./confirm-dialog-fMpZDQwU.js";import"./menu-_yyuL7QC.js";import"./MailViewChrome-DpYVT5yN.js";import"./NavMenuButton-BPDa4SMb.js";import"./useLabels-BtdFNvp3.js";import"./useSemanticSearch-Cxd2wzTv.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-Dphhrv7V.js";import"./circle-help-DgIUxvXo.js";import"./circle-check-DJTw8XeH.js";function S(){return o.jsx(r.Reading,{})}export{S as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BHv-NPe9.js";import{F as r}from"./FlaggedPane-PUHbNN_x.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-D23dSnHZ.js";import"./search-token-index-h8qI1Yib.js";import"./useLayoutTier-CzUPxRwt.js";import"./useQueries-BArSdAIw.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./index-BiyAH7mw.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./EmptyState-DMV0fkvR.js";import"./ErrorState-CyVYcmVT.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./confirm-dialog-fMpZDQwU.js";import"./menu-_yyuL7QC.js";import"./MailViewChrome-DpYVT5yN.js";import"./refresh-cw-Cj8CzO6f.js";import"./wizard-selection-B1bng5Jq.js";function H(){return o.jsx(r.Reading,{})}export{H as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-BHv-NPe9.js";import{B as o}from"./BriefPane-f1plGWaf.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-D23dSnHZ.js";import"./search-token-index-h8qI1Yib.js";import"./useLayoutTier-CzUPxRwt.js";import"./useQueries-BArSdAIw.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./index-BiyAH7mw.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./EmptyState-DMV0fkvR.js";import"./ErrorState-CyVYcmVT.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./confirm-dialog-fMpZDQwU.js";import"./menu-_yyuL7QC.js";import"./useRefreshControl-Bx-djS5M.js";import"./circle-check-big-B-r3FrmI.js";import"./refresh-cw-Cj8CzO6f.js";import"./useLabels-BtdFNvp3.js";import"./useSemanticSearch-Cxd2wzTv.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function L(){return r.jsx(o.Reading,{})}export{L as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BHv-NPe9.js";import{O as t}from"./OutboxPane-CJsXFqtp.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-B-r3FrmI.js";import"./clock-_4KA3nTB.js";import"./row-actions-C8lDaql_.js";import"./rotate-ccw-CXNasDFs.js";import"./NavMenuButton-BPDa4SMb.js";import"./menu-_yyuL7QC.js";import"./format-r3it-qYv.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function P(){return o.jsx(t.Reading,{})}export{P as component};
@@ -1 +0,0 @@
1
- import{en as o,j as m}from"./index-BHv-NPe9.js";import{O as e}from"./OpenCalendarEvent-DG2I65B_.js";import"./CalendarComposePane-CvKpoaLd.js";import"./window-B2eb-Kbg.js";import"./ErrorState-CyVYcmVT.js";import"./calendar-color-BOEi-xKF.js";import"./attendee-row-CZSI9WXI.js";import"./avatar-Dx5yz20k.js";import"./clock-_4KA3nTB.js";import"./map-pin-DbmaCcFB.js";import"./mail-BeV_y5QD.js";import"./pencil-BalLODT0.js";import"./useCalendars-SFBYFCoG.js";import"./useCalendarData-yANfj0Yx.js";import"./useQueries-BArSdAIw.js";function E(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return m.jsx(e,{calendarObjectId:r,recurrenceId:t})}export{E as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-BHv-NPe9.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-BHv-NPe9.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-BHv-NPe9.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{j as r,O as i}from"./index-BHv-NPe9.js";import{a as m}from"./MailShell-DlOlRRYj.js";import{B as o}from"./BriefPane-f1plGWaf.js";import{d as p}from"./search-token-index-h8qI1Yib.js";import{u as e}from"./search-mirror-BRprscwL.js";import"./FullCompose-mvt6fbW1.js";import"./ErrorState-CyVYcmVT.js";import"./index-BiyAH7mw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./confirm-dialog-fMpZDQwU.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-D23dSnHZ.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./EmptyState-DMV0fkvR.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./useLayoutTier-CzUPxRwt.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./useQueries-BArSdAIw.js";import"./menu-_yyuL7QC.js";import"./useRefreshControl-Bx-djS5M.js";import"./circle-check-big-B-r3FrmI.js";import"./refresh-cw-Cj8CzO6f.js";import"./useLabels-BtdFNvp3.js";import"./useSemanticSearch-Cxd2wzTv.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function W(){const t=p();return e({to:"/mail/brief"}),r.jsx(o,{thread:t,children:r.jsx(m,{phone:r.jsx(o.Phone,{}),list:r.jsx(o.List,{}),reading:r.jsx(i,{}),intelligence:r.jsx(o.Intelligence,{}),hasThread:!!t})})}export{W as component};
@@ -1 +0,0 @@
1
- import{e}from"./index-BHv-NPe9.js";const t=e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);export{t as C};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-mvt6fbW1.js";import"./index-BHv-NPe9.js";import"./ErrorState-CyVYcmVT.js";import"./index-BiyAH7mw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./confirm-dialog-fMpZDQwU.js";const C=o;export{C as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-mvt6fbW1.js";import"./index-BHv-NPe9.js";import"./ErrorState-CyVYcmVT.js";import"./index-BiyAH7mw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./confirm-dialog-fMpZDQwU.js";const C=o;export{C as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-mvt6fbW1.js";import"./index-BHv-NPe9.js";import"./ErrorState-CyVYcmVT.js";import"./index-BiyAH7mw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./confirm-dialog-fMpZDQwU.js";const C=o;export{C as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-mvt6fbW1.js";import"./index-BHv-NPe9.js";import"./ErrorState-CyVYcmVT.js";import"./index-BiyAH7mw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./confirm-dialog-fMpZDQwU.js";const C=o;export{C as component};
@@ -1 +0,0 @@
1
- import{j as o,O as i}from"./index-BHv-NPe9.js";import{a as m}from"./MailShell-DlOlRRYj.js";import{F as r}from"./FlaggedPane-PUHbNN_x.js";import{d as p}from"./search-token-index-h8qI1Yib.js";import{u as e}from"./search-mirror-BRprscwL.js";import"./FullCompose-mvt6fbW1.js";import"./ErrorState-CyVYcmVT.js";import"./index-BiyAH7mw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./confirm-dialog-fMpZDQwU.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-D23dSnHZ.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./EmptyState-DMV0fkvR.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./useLayoutTier-CzUPxRwt.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./useQueries-BArSdAIw.js";import"./menu-_yyuL7QC.js";import"./MailViewChrome-DpYVT5yN.js";import"./refresh-cw-Cj8CzO6f.js";import"./wizard-selection-B1bng5Jq.js";function N(){const t=p();return e({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{N as component};
@@ -1 +0,0 @@
1
- import{j as e,f as N,a2 as B,bo as Y,r as c,aH as W,X,aO as he,ay as Z,a0 as xe,aR as H,bp as fe,ax as pe,aA as ge,B as L,aQ as be,bq as ve,h as J,M as ee,o as se,br as ye,bs as je,aN as Ne,K as ke,bt as Ce,bu as _,bv as we,bw as Se,bx as te,by as Me,bz as Q,bf as ae,bl as re,bm as Ie,ae as G,ad as ne,L as K,bA as V,bB as Ee,aq as Ae,bC as De,u as Oe,c as ie,d as Te,aK as Re,aM as Fe,G as Pe,i as U,s as $e,bD as ze,bE as Le,bF as _e,aV as Be,bG as Ge,bH as Ke}from"./index-BHv-NPe9.js";import{P as qe}from"./pencil-BalLODT0.js";import{S as He}from"./settings-screen-DafglU7A.js";import{E as oe}from"./ErrorState-CyVYcmVT.js";import"./avatar-Dx5yz20k.js";import"./chevron-left-CSsgMmPr.js";import"./menu-_yyuL7QC.js";import"./circle-help-DgIUxvXo.js";const Qe=({label:s,onRename:t,onDelete:a,deleteBlockedReason:o,renameLabel:m=u=>`Rename ${u}`,deleteLabel:r=u=>`Delete ${u}`})=>{const u=o?`${r(s)} — ${o}`:r(s);return e.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 pr-2",children:[e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(qe,{className:"size-3.5"}),"aria-label":m(s),onClick:t}),e.jsx("span",{title:o,children:e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),"aria-label":u,disabled:o!==void 0,onClick:a})})]})},Ve=({folders:s,onRename:t,onDelete:a,onCreateFolder:o,delimiter:m,labels:r})=>{const u=new Map(s.map(l=>[l.id,l]));return e.jsx(Y,{folders:s,onCreateFolder:o,delimiter:m,labels:{treeAriaLabel:"Your folders",optionLabel:l=>l.label,...r},rowActions:l=>{const i=u.get(l.id);return i?e.jsx(Qe,{label:i.label,deleteBlockedReason:i.deleteBlockedReason,renameLabel:r?.rename,deleteLabel:r?.remove,onRename:()=>t(i),onDelete:()=>a(i)}):null}})},Ue=({open:s,folderLabel:t,defaultLabel:a,name:o,onNameChange:m,onSubmit:r,onClose:u,pending:l=!1,error:i})=>{const d=c.useId(),g=`Rename ${t}`;return s?e.jsxs(W,{open:s,onClose:u,title:g,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:g}),e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(X,{className:"size-3.5"}),onClick:u,"aria-label":"Cancel"})]}),e.jsxs("div",{className:"space-y-3 px-5 py-4",children:[e.jsxs("div",{children:[e.jsx(he,{htmlFor:d,children:"Folder name"}),e.jsx(Z,{id:d,value:o,placeholder:a,onChange:p=>m(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),r())}})]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["Shown everywhere in Remit. Leave it blank to use"," ",e.jsx("span",{className:"font-medium text-fg",children:a}),"."]}),i&&e.jsx("p",{className:"text-xs text-danger",role:"alert",children:i})]}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(N,{variant:"secondary",size:"sm",onClick:u,children:"Cancel"}),e.jsx(N,{variant:"primary",size:"sm",onClick:r,disabled:l,children:l?"Saving…":"Save name"})]})]}):null},Ye=["inbox","drafts","sent","archive","junk","trash"],q="",We={mailboxId:null,source:"None"};function Xe(s){const t=s.messageCount===1?"msg":"msgs";return`${H(s.providerPath,s.hierarchyDelimiter)} · ${s.messageCount} ${t}`}const le=s=>`${s} ${s===1?"message":"messages"}`,Ze=(s,t)=>s==="Appointed"?"Chosen by you":s==="Flagged"?`The mail server marks it as ${t}`:s==="Reserved"?"The account's own INBOX":"Matched by name, not confirmed";function Je({role:s,folders:t,appointment:a,displayName:o,onAppoint:m,onRename:r}){const[u,l]=c.useState(o),i=c.useRef(null),d=c.useRef(!1),g=c.useId(),{mailboxId:p,source:v,staleFolderPath:y}=a,h=t.find(j=>j.mailboxId===p)??null,f=be(s),O=h!=null&&u.trim()!==o.trim();c.useEffect(()=>{!d.current||v==="Proposed"||(d.current=!1,i.current?.focus())},[v]);const I=(()=>{if(v==="None"){const j=s==="trash"?" Deleting mail needs one.":"";return e.jsx("span",{id:g,className:"pl-[7.5rem] text-xs text-fg-muted",children:`Not set — pick the folder this account uses for ${f}.${j}`})}return v==="Stale"||!h?null:e.jsx("span",{id:g,className:"truncate pl-[7.5rem] text-2xs text-fg-subtle",title:h.providerPath,children:`${Ze(v,f)} · ${h.providerPath} · ${le(h.messageCount)}`})})(),w=s==="trash"?" Deleting mail is stopped until you pick another one.":h?` reader is using ${H(h.providerPath,h.hierarchyDelimiter)} instead.`:"",D=`The folder you chose for ${f}${y?` — ${y} —`:""} is gone from the mail server.${w}`;return e.jsxs("div",{className:"flex flex-col gap-1 border-b border-line px-row-inset py-2.5 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"flex w-28 shrink-0 items-center gap-2 text-sm font-medium text-fg",children:[fe(s),f]}),e.jsxs(pe,{ref:i,className:"w-56 shrink-0",value:p??q,"aria-label":`Folder for ${f}`,"aria-describedby":I||v==="Stale"?g:void 0,onChange:j=>m(s,j.target.value===q?null:j.target.value),children:[e.jsx("option",{value:q,children:"None"}),t.map(j=>e.jsx("option",{value:j.mailboxId,children:Xe(j)},j.mailboxId))]}),v==="Proposed"&&h&&e.jsx(N,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{d.current=!0,m(s,h.mailboxId)},children:`Set as ${f}`}),h&&e.jsxs(e.Fragment,{children:[e.jsx(Z,{className:"flex-1",value:u,placeholder:f,"aria-label":`Display name for ${f}`,onChange:j=>l(j.target.value)}),O&&e.jsx(N,{variant:"ghost",size:"sm",className:"shrink-0",icon:e.jsx(ge,{className:"size-4"}),"aria-label":"Save display name",onClick:()=>r(h.mailboxId,u)})]})]}),I,v==="Stale"&&e.jsx(L,{tone:"warning",variant:"soft",className:"ml-[7.5rem]",children:e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{id:g,className:"flex-1",children:D}),e.jsx(N,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>i.current?.focus(),children:"Pick a folder"})]})})]})}function es(){return e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Each canonical role — Inbox, Drafts, Sent, Archive, Spam, Trash — points at one of your account's real folders. Pick the one that actually holds the mail; the message counts tell real folders from empty look-alikes."}),e.jsx("p",{children:`Appointing a folder to a role here doesn't touch any other role, and doesn't move or rename anything on the server — it just tells Remit which folder to treat as e.g. "Drafts" everywhere (sidebar, unread badges, the compose flow).`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Your folders"})," is the account's real hierarchy. Open a folder to see what's inside it, make a new one where you're looking, and rename or delete any of them from its row."]})]})}function ss({accountEmail:s,folders:t,appointments:a,displayNames:o={},onAppoint:m,onRename:r}){const u=new Set(Object.values(a).map(i=>i.mailboxId).filter(i=>i!=null)),l=t.filter(i=>!u.has(i.mailboxId));return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsxs("h2",{className:"text-sm font-semibold text-fg",children:["Folder roles — ",s]}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Each row says where its answer came from — your choice, the mail server's own flag, or a name reader matched."})]}),e.jsx("div",{className:"rounded-sm border border-line bg-surface",children:Ye.map(i=>{const d=a[i]??We;return e.jsx(Je,{role:i,folders:t,appointment:d,displayName:d.mailboxId?o[d.mailboxId]??"":"",onAppoint:m,onRename:r},i)})}),l.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h3",{className:"text-xs font-medium text-fg-muted",children:"Other folders"}),e.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:l.map(i=>e.jsxs("li",{className:"flex items-center gap-2 border-b border-line px-row-inset py-2 text-sm text-fg last:border-b-0",children:[e.jsx(xe,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate",children:H(i.providerPath,i.hierarchyDelimiter)}),e.jsx("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:le(i.messageCount)})]},i.mailboxId))})]})]})}const ts=12e4,as=2e3,rs="This folder is no longer in the account's folder list, so nothing was deleted.",ce=(s,t)=>{const a=s.find(o=>o.mailboxId===t);if(!a)throw new Error(rs);return a},ns=(s,t)=>ce(s,t).lastSyncedAt??0;async function is({readMailboxes:s,mailboxId:t,since:a,signal:o,segmentMs:m=ts,pollIntervalMs:r=as,delay:u=ve,now:l=Date.now}){const i=l()+m;for(;;){o?.throwIfAborted();const d=ce(await s(),t);if((d.lastSyncedAt??0)>a)return{status:"fresh",messageCount:d.messagesTotal};if(l()>=i)return{status:"pending"};await u(r,o)}}const de=50,os=s=>s instanceof Error?s.message:"Something went wrong.",$=s=>s.then(t=>({ok:!0,value:t}),t=>({ok:!1,error:os(t)})),ls=async(s,t,a,o)=>{const m=[];let r;for(let u=0;u<de;u+=1){if(o.aborted)return m;const{data:l}=await te({path:{mailboxId:s},query:{order:"desc",continuationToken:r},throwOnError:!0});for(const i of l.items)if(!i.isDeleted&&!t.has(i.messageId)&&!m.includes(i.messageId)&&(m.push(i.messageId),m.length>=a))return m;if(!l.continuationToken)break;r=l.continuationToken}return m},cs=async(s,t)=>{let a=0,o;for(let m=0;m<de;m+=1){if(t.aborted)return a;const{data:r}=await te({path:{mailboxId:s},query:{order:"desc",continuationToken:o},throwOnError:!0});for(const u of r.items)u.isDeleted||(a+=1);if(!r.continuationToken)break;o=r.continuationToken}return a};function ds({accountId:s,mailboxId:t,onDeleted:a}){const o=J(),[m,r]=c.useState("idle"),[u,l]=c.useState(null),[i,d]=c.useState(),[g,p]=c.useState(),v=c.useRef(null),y=c.useRef(void 0),h=c.useCallback(()=>{o.invalidateQueries({queryKey:ee({path:{accountId:s}})}),o.invalidateQueries({queryKey:se()})},[o,s]),f=c.useCallback(async()=>{r("deleting");const k=await $(ye({path:{accountId:s,mailboxId:t},throwOnError:!0}));if(!k.ok){d(k.error),r("error");return}h(),r("done"),a()},[s,t,h,a]),O=c.useCallback(()=>je({path:{accountId:s},throwOnError:!0}).then(({data:k})=>k.items.find(S=>S.mailboxId===t)?.messageCount??0),[s,t]),I=c.useCallback(()=>o.fetchQuery({...Ne({path:{accountId:s}}),staleTime:0}).then(k=>k.mailboxes??[]),[o,s]),w=c.useCallback(async()=>{const k=new AbortController;v.current=k;const{signal:S}=k;r("checking"),d(void 0);const M=y.current!==void 0,C=await $((async()=>(M||(S.throwIfAborted(),y.current=ns(await I(),t),S.throwIfAborted(),p(Date.now()),await ke({path:{accountId:s},throwOnError:!0})),is({readMailboxes:I,mailboxId:t,since:y.current??0,signal:S})))());return S.aborted?(r("idle"),y.current=void 0,{status:"failed"}):C.ok?C.value.status==="pending"?(r("check-stalled"),{status:"pending"}):(y.current=void 0,C.value.messageCount>0?(r("idle"),h(),{status:"blocked",messageCount:C.value.messageCount}):(await f(),{status:"deleted"})):(y.current=void 0,d(C.error),r("error"),{status:"failed"})},[s,t,I,f,h]),D=c.useCallback(()=>{v.current?.abort()},[]),j=c.useCallback(async k=>{const S=new AbortController;v.current=S;const{signal:M}=S;r("moving"),d(void 0);const C=await $(O());if(M.aborted)return;if(!C.ok){d(C.error),r("error");return}let x=Ce(C.value);l(x);const E=new Set;for(;;){if(M.aborted)return;const n=await $(ls(t,E,Me,M));if(M.aborted)return;if(!n.ok){x=_(x,n.error),l(x),d(n.error),r("error");return}const b=n.value;if(b.length===0)break;const T=await $(we({body:{messageIds:b,destinationMailboxId:k},throwOnError:!0}));if(M.aborted)return;if(!T.ok){x=_(x,T.error),l(x),d(T.error),r("error");return}for(const P of b)E.add(P);x=Se(x,b.length),l(x)}const A=await $(cs(t,M));if(!M.aborted){if(!A.ok){x=_(x,A.error),l(x),d(A.error),r("error");return}if(A.value>0){const n=`${A.value} ${A.value===1?"email is":"emails are"} still syncing. Re-open delete to finish removing this folder.`;x=_(x,n),l(x),d(n),r("error"),h();return}await f()}},[t,O,f,h]),R=c.useCallback(()=>{v.current?.abort(),v.current=null,y.current=void 0,r("idle"),l(null),d(void 0),p(void 0)},[]);return{phase:m,progress:u,errorMessage:i,checkStartedAt:g,deleteMailbox:f,deleteIfEmpty:w,moveThenDelete:j,cancel:D,reset:R}}const z=s=>`${s} ${s===1?"email":"emails"}`;function ms({open:s,accountId:t,folder:a,mailboxes:o,appointments:m,onClose:r}){const[u,l]=c.useState(()=>Q(a.messageCount)),[i,d]=c.useState(),[g,p]=c.useState(),{createFolderIn:v}=ae(t),y=re(),{phase:h,progress:f,errorMessage:O,checkStartedAt:I,deleteMailbox:w,deleteIfEmpty:D,moveThenDelete:j,cancel:R,reset:k}=ds({accountId:t,mailboxId:a.mailboxId,onDeleted:r}),[S,M]=c.useState("0:00"),C=h==="checking"||h==="check-stalled";c.useEffect(()=>{if(!C||I===void 0)return;const F=()=>M(De(Date.now()-I));F();const ue=setInterval(F,1e3);return()=>clearInterval(ue)},[C,I]),c.useEffect(()=>{s&&(l(Q(a.messageCount)),d(void 0),k())},[s,k]),c.useEffect(()=>{s&&p(void 0)},[s]),c.useEffect(()=>R,[R]);const x=c.useCallback(()=>{R(),r()},[R,r]),E=c.useCallback(async()=>{const F=await D();F.status==="blocked"&&(d(F.messageCount),l("choose-fate"))},[D]),A=c.useMemo(()=>Ie({mailboxes:o,folderAppointments:m,excludeMailboxId:a.mailboxId,translator:y}),[o,m,a.mailboxId,y]),n=A.find(F=>F.id===g),b=c.useMemo(()=>G(a,ne(m).get(a.mailboxId),y),[a,m,y]);if(!s)return null;const T=`Delete ${b}`,P=i??a.messageCount,me=h==="moving"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(K,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving emails…"}),e.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:f?V(f):"Moved 0 of 0"})]}):h==="checking"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(K,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Checking the folder on the mail server…"}),e.jsx("p",{className:"text-xs text-fg-muted",role:"status","aria-live":"polite",children:`Waiting ${S}. Nothing is deleted until the server answers.`})]}):h==="check-stalled"?e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[e.jsx(L,{tone:"warning",variant:"soft",children:`The mail server hasn't reported back on this folder yet — ${S} so far. Nothing has been deleted.`}),e.jsx("p",{className:"text-xs text-fg-muted",children:"A sync covers the whole account, so a busy mailbox can take a while to come round to this folder."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(N,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"}),e.jsx(N,{size:"sm",onClick:()=>E(),children:"Keep waiting"})]})]}):h==="deleting"||h==="done"?e.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[e.jsx(K,{className:"size-8 animate-spin text-accent-2"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"Deleting folder…"})]}):h==="error"?e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[e.jsx(L,{tone:"danger",variant:"soft",children:O??"Something went wrong. Please try again."}),f&&e.jsxs("p",{className:"text-xs text-fg-muted",children:[V(f),". Already-moved emails stay moved — re-open delete to continue with the rest."]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(N,{variant:"secondary",size:"sm",onClick:x,children:"Close"})})]}):u==="confirm-empty"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:e.jsxs("p",{children:["Delete ",e.jsx("strong",{className:"text-fg",children:b}),"? This folder is empty and will be removed from the server."]})}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(N,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"}),e.jsx(N,{variant:"danger",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),onClick:()=>E(),children:"Delete folder"})]})]}):u==="choose-fate"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:[i!==void 0&&e.jsx(L,{tone:"warning",variant:"soft",children:`This folder is not empty: the mail server reports ${z(i)} in it. Nothing was deleted.`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:b})," holds"," ",z(P),". What should happen to them?"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",onClick:()=>l("confirm-delete-all"),className:"flex w-full items-center gap-3 rounded-sm border border-line px-3 py-2.5 text-left hover:bg-surface-raised",children:[e.jsx(B,{className:"size-4 shrink-0 text-danger"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-fg",children:"Delete them with the folder"}),e.jsx("span",{className:"block text-xs text-fg-muted",children:"The emails are removed from the server and can't be recovered."})]})]}),e.jsxs("button",{type:"button",onClick:()=>l("pick-destination"),className:"flex w-full items-center gap-3 rounded-sm border border-line px-3 py-2.5 text-left hover:bg-surface-raised",children:[e.jsx(Ee,{className:"size-4 shrink-0 text-accent-2"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-fg",children:"Move them to another folder"}),e.jsx("span",{className:"block text-xs text-fg-muted",children:"Keep the emails, then delete the emptied folder."})]})]})]})]}),e.jsx("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:e.jsx(N,{variant:"secondary",size:"sm",onClick:x,children:"Cancel"})})]}):u==="confirm-delete-all"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:e.jsxs("p",{children:["Delete ",e.jsx("strong",{className:"text-fg",children:b})," and its"," ",z(P),"? The messages are removed from the server with the folder and can't be recovered."]})}),e.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[e.jsx(N,{variant:"secondary",size:"sm",onClick:()=>l("choose-fate"),children:"Back"}),e.jsx(N,{variant:"danger",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),onClick:()=>w(),children:"Delete folder and emails"})]})]}):e.jsxs("div",{className:"flex h-[26rem] flex-col",children:[e.jsxs("p",{className:"px-5 pt-4 text-sm text-fg-muted",children:["Move the ",z(P)," in"," ",e.jsx("strong",{className:"text-fg",children:b})," to:"]}),e.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:e.jsx(Y,{folders:A,selectedId:g,delimiter:o[0]?.hierarchyDelimiter??"/",onSelect:p,onCreateFolder:v,onCancel:()=>{p(void 0),l("choose-fate")},labels:{filterPlaceholder:"Move emails to…"}})}),n&&e.jsx("footer",{className:"shrink-0 border-t border-line p-2",children:e.jsx(N,{variant:"danger",onClick:()=>j(n.id),className:"h-11 w-full font-semibold",children:e.jsx("span",{className:"truncate",children:`Move ${z(P)} to ${n.label}`})})})]});return e.jsxs(W,{open:s,onClose:x,title:T,children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[e.jsx(Ae,{className:"size-4 shrink-0 text-danger"}),e.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:T}),e.jsx(N,{variant:"ghost",size:"sm",icon:e.jsx(X,{className:"size-3.5"}),onClick:x,"aria-label":"Cancel"})]}),me]})}function us({account:s}){const t=J(),a=s.accountId,o=re(),{data:m,isPending:r,isError:u,error:l,refetch:i}=ie(Pe({path:{accountId:a}})),{createFolderIn:d}=ae(a),g=U({...ze(),meta:$e(409),onSuccess:()=>{t.invalidateQueries({queryKey:se()})}}),p=U({...Le(),onSuccess:()=>{t.invalidateQueries({queryKey:ee({path:{accountId:a}})})}}),[v,y]=c.useState(),[h,f]=c.useState(),[O,I]=c.useState(""),w=c.useMemo(()=>m?.items??[],[m]),D=c.useMemo(()=>ne(s.folderAppointments),[s.folderAppointments]),j=c.useMemo(()=>w.map(n=>({id:n.mailboxId,label:G(n,D.get(n.mailboxId),o),path:n.fullPath,deleteBlockedReason:_e(n,w,s.folderAppointments).message})),[w,D,o,s.folderAppointments]),R=(n,b)=>{g.mutate({path:{accountId:a,role:Ke[n]},body:{mailboxId:b}})},k=(n,b)=>{const T=b.trim();p.mutate({path:{accountId:a,mailboxId:n},body:{displayNameOverride:T===""?null:T}})};if(r)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":`Loading folders for ${s.email}`});if(u)return e.jsx(oe,{variant:"inline",title:`Couldn't load folders for ${s.email}`,error:l,onRetry:()=>{i()}});const S=w.map(n=>({mailboxId:n.mailboxId,providerPath:n.fullPath,hierarchyDelimiter:n.hierarchyDelimiter,messageCount:n.messageCount})),M={};for(const n of s.folderAppointments){const b=Be[n.role];b&&(M[b]={mailboxId:n.mailboxId??null,source:n.source,staleFolderPath:n.staleAppointmentPath})}const C={};for(const n of w)n.displayNameOverride&&(C[n.mailboxId]=n.displayNameOverride);const x=n=>w.find(b=>b.mailboxId===n),E=x(h),A=x(v);return e.jsxs("div",{className:"space-y-4",children:[(g.isError||p.isError)&&e.jsx(L,{tone:"danger",variant:"soft",children:Ge(g.error)?"That folder is still being created on the mail server — wait for it to finish, then try again.":"Couldn't save that change. Please try again."}),e.jsx(ss,{accountEmail:s.email,folders:S,appointments:M,displayNames:C,onAppoint:R,onRename:k}),e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Your folders — ",s.email]}),e.jsx("div",{className:"flex h-[28rem] flex-col overflow-hidden rounded-sm border border-line bg-surface",children:e.jsx(Ve,{folders:j,delimiter:w[0]?.hierarchyDelimiter??"/",onCreateFolder:d,onRename:n=>{f(n.id),I(x(n.id)?.displayNameOverride?.trim()??"")},onDelete:n=>y(n.id),labels:{treeAriaLabel:`All folders for ${s.email}`}})})]}),E&&e.jsx(Ue,{open:!0,folderLabel:G(E,D.get(E.mailboxId),o),defaultLabel:G({fullPath:E.fullPath,hierarchyDelimiter:E.hierarchyDelimiter},D.get(E.mailboxId),o),name:O,onNameChange:I,pending:p.isPending,error:p.isError?"Couldn't save that name. Please try again.":void 0,onSubmit:()=>{const n=O.trim();p.mutate({path:{accountId:a,mailboxId:E.mailboxId},body:{displayNameOverride:n===""?null:n}},{onSuccess:()=>f(void 0)})},onClose:()=>f(void 0)}),A&&e.jsx(ms,{open:!0,accountId:a,folder:A,mailboxes:w,appointments:s.folderAppointments,onClose:()=>y(void 0)})]})}function js(){const s=Oe(),[t,a]=c.useState(!0),{data:o,isPending:m,isError:r,error:u,refetch:l}=ie(Te()),i=d=>{const g=Fe[d];g&&s({to:g})};return e.jsx(He,{items:Re,activeId:"folders",title:"Folder roles",description:"Appoint which real folder fills each canonical role, per account.",help:e.jsx(es,{}),helpOpen:t,onToggleHelp:()=>a(d=>!d),onSelect:i,onBackToMail:()=>{s({to:"/mail"})},children:m?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):r?e.jsx(oe,{title:"Couldn't load accounts",error:u,onRetry:()=>{l()}}):o.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:o.accounts.map(d=>e.jsx(us,{account:d},d.accountId))})})}export{js as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BHv-NPe9.js";import{O as t}from"./OutboxPane-CJsXFqtp.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-B-r3FrmI.js";import"./clock-_4KA3nTB.js";import"./row-actions-C8lDaql_.js";import"./rotate-ccw-CXNasDFs.js";import"./NavMenuButton-BPDa4SMb.js";import"./menu-_yyuL7QC.js";import"./format-r3it-qYv.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function c(){return o.jsx(t.Reading,{})}export{c as component};
@@ -1 +0,0 @@
1
- import{el as o,j as r}from"./index-BHv-NPe9.js";import{O as m}from"./OpenCalendarEvent-DG2I65B_.js";import"./CalendarComposePane-CvKpoaLd.js";import"./window-B2eb-Kbg.js";import"./ErrorState-CyVYcmVT.js";import"./calendar-color-BOEi-xKF.js";import"./attendee-row-CZSI9WXI.js";import"./avatar-Dx5yz20k.js";import"./clock-_4KA3nTB.js";import"./map-pin-DbmaCcFB.js";import"./mail-BeV_y5QD.js";import"./pencil-BalLODT0.js";import"./useCalendars-SFBYFCoG.js";import"./useCalendarData-yANfj0Yx.js";import"./useQueries-BArSdAIw.js";function R(){const{calendarObjectId:t}=o.useParams();return r.jsx(m,{calendarObjectId:t})}export{R as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BHv-NPe9.js";import{M as r}from"./MailboxPane-C6l_0N2O.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-Bx-djS5M.js";import"./circle-check-big-B-r3FrmI.js";import"./refresh-cw-Cj8CzO6f.js";import"./useQueries-BArSdAIw.js";import"./search-token-index-h8qI1Yib.js";import"./useLayoutTier-CzUPxRwt.js";import"./MailListHeader-D23dSnHZ.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./index-BiyAH7mw.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./EmptyState-DMV0fkvR.js";import"./ErrorState-CyVYcmVT.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./confirm-dialog-fMpZDQwU.js";import"./menu-_yyuL7QC.js";import"./MailViewChrome-DpYVT5yN.js";import"./NavMenuButton-BPDa4SMb.js";import"./useLabels-BtdFNvp3.js";import"./useSemanticSearch-Cxd2wzTv.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-Dphhrv7V.js";import"./circle-help-DgIUxvXo.js";import"./circle-check-DJTw8XeH.js";function Q(){return o.jsx(r.Reading,{})}export{Q as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BHv-NPe9.js";import{F as r}from"./FlaggedPane-PUHbNN_x.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-D23dSnHZ.js";import"./search-token-index-h8qI1Yib.js";import"./useLayoutTier-CzUPxRwt.js";import"./useQueries-BArSdAIw.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./index-BiyAH7mw.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./EmptyState-DMV0fkvR.js";import"./ErrorState-CyVYcmVT.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./confirm-dialog-fMpZDQwU.js";import"./menu-_yyuL7QC.js";import"./MailViewChrome-DpYVT5yN.js";import"./refresh-cw-Cj8CzO6f.js";import"./wizard-selection-B1bng5Jq.js";function I(){return o.jsx(r.Reading,{})}export{I as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BHv-NPe9.js";import{M as i}from"./MailboxPane-C6l_0N2O.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-Bx-djS5M.js";import"./circle-check-big-B-r3FrmI.js";import"./refresh-cw-Cj8CzO6f.js";import"./useQueries-BArSdAIw.js";import"./search-token-index-h8qI1Yib.js";import"./useLayoutTier-CzUPxRwt.js";import"./MailListHeader-D23dSnHZ.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./index-BiyAH7mw.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./EmptyState-DMV0fkvR.js";import"./ErrorState-CyVYcmVT.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./confirm-dialog-fMpZDQwU.js";import"./menu-_yyuL7QC.js";import"./MailViewChrome-DpYVT5yN.js";import"./NavMenuButton-BPDa4SMb.js";import"./useLabels-BtdFNvp3.js";import"./useSemanticSearch-Cxd2wzTv.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-Dphhrv7V.js";import"./circle-help-DgIUxvXo.js";import"./circle-check-DJTw8XeH.js";function S(){return o.jsx(i.Reading,{})}export{S as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BHv-NPe9.js";import{F as r}from"./FlaggedPane-PUHbNN_x.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-D23dSnHZ.js";import"./search-token-index-h8qI1Yib.js";import"./useLayoutTier-CzUPxRwt.js";import"./useQueries-BArSdAIw.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./index-BiyAH7mw.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./EmptyState-DMV0fkvR.js";import"./ErrorState-CyVYcmVT.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./confirm-dialog-fMpZDQwU.js";import"./menu-_yyuL7QC.js";import"./MailViewChrome-DpYVT5yN.js";import"./refresh-cw-Cj8CzO6f.js";import"./wizard-selection-B1bng5Jq.js";function H(){return o.jsx(r.Reading,{})}export{H as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-BHv-NPe9.js";import{B as o}from"./BriefPane-f1plGWaf.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-D23dSnHZ.js";import"./search-token-index-h8qI1Yib.js";import"./useLayoutTier-CzUPxRwt.js";import"./useQueries-BArSdAIw.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./index-BiyAH7mw.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./EmptyState-DMV0fkvR.js";import"./ErrorState-CyVYcmVT.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./confirm-dialog-fMpZDQwU.js";import"./menu-_yyuL7QC.js";import"./useRefreshControl-Bx-djS5M.js";import"./circle-check-big-B-r3FrmI.js";import"./refresh-cw-Cj8CzO6f.js";import"./useLabels-BtdFNvp3.js";import"./useSemanticSearch-Cxd2wzTv.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function M(){return r.jsx(o.Reading,{})}export{M as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-BHv-NPe9.js";import{B as o}from"./BriefPane-f1plGWaf.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-D23dSnHZ.js";import"./search-token-index-h8qI1Yib.js";import"./useLayoutTier-CzUPxRwt.js";import"./useQueries-BArSdAIw.js";import"./attachment-file-BUzsbGzm.js";import"./mail-BeV_y5QD.js";import"./avatar-Dx5yz20k.js";import"./index-BiyAH7mw.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./EmptyState-DMV0fkvR.js";import"./ErrorState-CyVYcmVT.js";import"./download-BhCMX5hr.js";import"./calendar-event-chip-BHQzHlqv.js";import"./calendar-color-BOEi-xKF.js";import"./map-pin-DbmaCcFB.js";import"./attendee-row-CZSI9WXI.js";import"./clock-_4KA3nTB.js";import"./shield-check-34u10gOB.js";import"./useFilters-DuQCR3Qa.js";import"./confirm-dialog-fMpZDQwU.js";import"./menu-_yyuL7QC.js";import"./useRefreshControl-Bx-djS5M.js";import"./circle-check-big-B-r3FrmI.js";import"./refresh-cw-Cj8CzO6f.js";import"./useLabels-BtdFNvp3.js";import"./useSemanticSearch-Cxd2wzTv.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function L(){return r.jsx(o.Reading,{})}export{L as component};
@@ -1 +0,0 @@
1
- import{j as t,am as o}from"./index-BHv-NPe9.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
@@ -1 +0,0 @@
1
- import{q as n,h as i,u as a,r as m,j as s}from"./index-BHv-NPe9.js";import{O as p}from"./OnboardingWizard-BwdkqOoc.js";import{c}from"./onboarding-completion-CKUxRW8T.js";import"./kbd-CGsQ66xw.js";import"./credential-steps-8d0gtdWR.js";import"./card-pYyUnqGS.js";import"./account-form-helpers-DhckT_PN.js";import"./mail-BeV_y5QD.js";import"./file-json-D2BEEAab.js";function O(){const o=n(),e=i(),t=a(),r=m.useCallback(l=>{c({queryClient:e,recordCompleted:()=>o.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[o,e]);return s.jsx(p,{skipWelcome:!1,onComplete:r,onImportConfig:()=>{t({to:"/import"})}})}export{O as component};
@@ -1 +0,0 @@
1
- import{j as o,O as i}from"./index-BHv-NPe9.js";import{a as m}from"./MailShell-DlOlRRYj.js";import{u as p,O as t}from"./OutboxPane-CJsXFqtp.js";import{u as s}from"./search-mirror-BRprscwL.js";import"./FullCompose-mvt6fbW1.js";import"./ErrorState-CyVYcmVT.js";import"./index-BiyAH7mw.js";import"./useMessageBodyContent-BbMnogZm.js";import"./useSignature-DtOMT-01.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-vtzrU6u5.js";import"./sections-B9m609Vf.js";import"./format-r3it-qYv.js";import"./confirm-dialog-fMpZDQwU.js";import"./useSearchTokenContext-Chuk9_R2.js";import"./kbd-CGsQ66xw.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-B-r3FrmI.js";import"./clock-_4KA3nTB.js";import"./row-actions-C8lDaql_.js";import"./rotate-ccw-CXNasDFs.js";import"./NavMenuButton-BPDa4SMb.js";import"./menu-_yyuL7QC.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function v(){const r=p();return s({to:"/mail/outbox"}),o.jsx(t,{outboxMessageId:r,children:o.jsx(m,{phone:o.jsx(t.Phone,{}),list:o.jsx(t.List,{}),reading:o.jsx(i,{})})})}export{v as component};
@@ -1 +0,0 @@
1
- import{j as t,O as o}from"./index-BHv-NPe9.js";const n=()=>t.jsx(o,{});export{n as component};
@@ -1 +0,0 @@
1
- {}
@@ -1 +0,0 @@
1
- {}
@@ -1 +0,0 @@
1
- {}
@@ -1 +0,0 @@
1
- {}
@@ -1 +0,0 @@
1
- {}
@@ -1 +0,0 @@
1
- {}
@@ -1 +0,0 @@
1
- {}
@@ -1 +0,0 @@
1
- {}