@remit/web-client-dist 0.0.644 → 0.0.646

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 (158) hide show
  1. package/assets/{BriefPane-CWpjvftR.js → BriefPane-NTEZn5iT.js} +1 -1
  2. package/assets/{CalendarComposePane-DJNhu2LK.js → CalendarComposePane-CTOr6Y9H.js} +1 -1
  3. package/assets/{CalendarComposeSeed-SL4UWmtL.js → CalendarComposeSeed-DnC9M3Bc.js} +1 -1
  4. package/assets/{CalendarShell-DAe5WXuU.js → CalendarShell-DFdIYCjl.js} +1 -1
  5. package/assets/{EmptyState-5AzHvbUg.js → EmptyState-iJkDD5wT.js} +1 -1
  6. package/assets/{ErrorState-C9wNWNx-.js → ErrorState-DBbVLnRy.js} +1 -1
  7. package/assets/{FlaggedPane-CzACUDwI.js → FlaggedPane-BKPeEpex.js} +1 -1
  8. package/assets/{FullCompose-EZk91vKc.js → FullCompose-DVarPVpc.js} +1 -1
  9. package/assets/{MailListHeader-KM5hxzzQ.js → MailListHeader-BF_0ASsH.js} +1 -1
  10. package/assets/{MailNav-BvsTwsus.js → MailNav-BIKpkzZO.js} +1 -1
  11. package/assets/{MailShell-CO4UHszY.js → MailShell-2Uz12rUT.js} +1 -1
  12. package/assets/{MailViewChrome-D0DIIe1s.js → MailViewChrome-D3QfNfHi.js} +1 -1
  13. package/assets/{MailboxPane-CSXmclwC.js → MailboxPane-BW8Oo31r.js} +1 -1
  14. package/assets/{NavMenuButton-DipQuqqU.js → NavMenuButton-BDbMyjBe.js} +1 -1
  15. package/assets/{OnboardingWizard-DLthp-gp.js → OnboardingWizard-DXfD69y4.js} +1 -1
  16. package/assets/{OpenCalendarEvent-DdZ8T5JX.js → OpenCalendarEvent-DQxup_5A.js} +1 -1
  17. package/assets/{OutboxPane-BQ2C8Exq.js → OutboxPane-51AmIoV1.js} +1 -1
  18. package/assets/_calendarObjectId-DJ80udMy.js +1 -0
  19. package/assets/_mailboxId-C9UW9W4T.js +1 -0
  20. package/assets/_messageId-1d6VRzrV.js +1 -0
  21. package/assets/_messageId-D9MRmCiH.js +1 -0
  22. package/assets/_messageId-DKygSbee.js +1 -0
  23. package/assets/_outboxMessageId-CeDsl4kP.js +1 -0
  24. package/assets/_recurrenceId-Dbda2nYB.js +1 -0
  25. package/assets/_threadId-BeZ5Vxp6.js +1 -0
  26. package/assets/_threadId-BtM_kvlj.js +1 -0
  27. package/assets/_threadId-Der4olFj.js +1 -0
  28. package/assets/{_view._date-DhatDbEl.js → _view._date-DsHOBJGZ.js} +1 -1
  29. package/assets/{accounts-DD5lbrRg.js → accounts-AqojvJPO.js} +1 -1
  30. package/assets/{advanced-Di1sbe8-.js → advanced-B6LXVBZn.js} +1 -1
  31. package/assets/{appearance-CuPQNqbK.js → appearance-hDHe0sCR.js} +1 -1
  32. package/assets/{attendee-row-COD-JhkD.js → attendee-row-D056H7on.js} +1 -1
  33. package/assets/{avatar-BG16DP0I.js → avatar-KiM5ncyR.js} +1 -1
  34. package/assets/{bell-off-BJ8oYylk.js → bell-off-aDzc6-uu.js} +1 -1
  35. package/assets/{bottom-sheet-CXKnmLHB.js → bottom-sheet-CyaTcIno.js} +1 -1
  36. package/assets/brief-C5rFb2wO.js +1 -0
  37. package/assets/{brief-QIMUKa1x.js → brief-w0GjdNJg.js} +1 -1
  38. package/assets/{browser-ponyfill-yqX8DQOe.js → browser-ponyfill-BxYoyQUR.js} +1 -1
  39. package/assets/{bug-my1LBhjO.js → bug-Dz6mFK2v.js} +1 -1
  40. package/assets/{calendar-BKm9jIHX.js → calendar-6scIQiwU.js} +1 -1
  41. package/assets/{calendar-clash-strip-BFeaJEFd.js → calendar-clash-strip-4uWwSJgT.js} +1 -1
  42. package/assets/{calendar-format-Df04vYeX.js → calendar-format-B3u8XeCh.js} +1 -1
  43. package/assets/{calendar-report-cFSv6gSl.js → calendar-report-DcwY6HH-.js} +1 -1
  44. package/assets/{calendar-suggestion-BOcnceiU.js → calendar-suggestion-D1-lMf3B.js} +1 -1
  45. package/assets/{calendars-C2NvDUee.js → calendars-1qdVhrw6.js} +1 -1
  46. package/assets/{card-Cvm6QXrr.js → card-CPp6hN7Y.js} +1 -1
  47. package/assets/{checkbox-CnlRLXiS.js → checkbox-FDumPklc.js} +1 -1
  48. package/assets/chevron-left-DCZx9oDN.js +1 -0
  49. package/assets/{circle-check-CmDRPJ4x.js → circle-check-Bcrk6K1k.js} +1 -1
  50. package/assets/{circle-check-big-ZWmAdG5O.js → circle-check-big-CFRFqxT6.js} +1 -1
  51. package/assets/{circle-help-xoO8qyO7.js → circle-help-cF1gR2q7.js} +1 -1
  52. package/assets/{clock-Bkjyx82e.js → clock-CMYYJ0a3.js} +1 -1
  53. package/assets/compose._-_outboxMessageId_-BO_7_qza.js +1 -0
  54. package/assets/compose._-_outboxMessageId_-C8mE4Dmv.js +1 -0
  55. package/assets/compose._-_outboxMessageId_-D0dLVmgz.js +1 -0
  56. package/assets/compose._-_outboxMessageId_-Z5XM3aWq.js +1 -0
  57. package/assets/{config-import-D_1i4Wai.js → config-import-B5ShP2v6.js} +1 -1
  58. package/assets/{confirm-dialog-D8E0auet.js → confirm-dialog-DP653uUK.js} +1 -1
  59. package/assets/{copy-Cz51csqc.js → copy-CIm_o4Mr.js} +1 -1
  60. package/assets/{credential-steps-Cm_vhM0c.js → credential-steps-DpKvw37C.js} +1 -1
  61. package/assets/{download-2vcTam8D.js → download-13r0ltdh.js} +1 -1
  62. package/assets/{file-json-Wb3Oc2-o.js → file-json-YH4c3ZTR.js} +1 -1
  63. package/assets/{filters-C2qWze-2.js → filters-dukwnLt3.js} +1 -1
  64. package/assets/flagged-BFmI2rSm.js +1 -0
  65. package/assets/{flagged-DSaiUTNf.js → flagged-C0QU0Pz_.js} +1 -1
  66. package/assets/{folders-B-31lHew.js → folders-BlohuMsA.js} +1 -1
  67. package/assets/{help-copy-yEiBqFt2.js → help-copy-CBHMrKUf.js} +1 -1
  68. package/assets/{import-I5hFVfa3.js → import-3YvqTmkU.js} +1 -1
  69. package/assets/index-1d6VRzrV.js +1 -0
  70. package/assets/index-B0s4iZrX.js +1 -0
  71. package/assets/index-BUYn5SAl.js +1 -0
  72. package/assets/index-Bn7jIKxB.js +1 -0
  73. package/assets/{index-DYY0nrsl.js → index-Cgq4hxti.js} +4 -4
  74. package/assets/index-Cy7peBCe.js +1 -0
  75. package/assets/index-DKygSbee.js +1 -0
  76. package/assets/index-DwDnm88d.js +1 -0
  77. package/assets/{index-CVyiXes6.js → index-DyXh0uZR.js} +4 -4
  78. package/assets/{index-BZT8HZ--.js → index-aC5-hvDE.js} +1 -1
  79. package/assets/index-rIsTYCqN.js +1 -0
  80. package/assets/index-wZGBzbmC.js +1 -0
  81. package/assets/{kbd-BAzd-ZzK.js → kbd-BZqsDz_U.js} +1 -1
  82. package/assets/{labels-D5anCXRT.js → labels-BIaU1vWQ.js} +1 -1
  83. package/assets/{mail-3L2_JePI.js → mail-B7zN4zHx.js} +1 -1
  84. package/assets/{mail-7SgAUbqy.js → mail-D-devbMY.js} +1 -1
  85. package/assets/{map-pin-C_G0KnPH.js → map-pin-xN7wT2-l.js} +1 -1
  86. package/assets/{menu-Diz2jlXK.js → menu-Cp4H-jyN.js} +1 -1
  87. package/assets/minus-DL9Mw3nM.js +1 -0
  88. package/assets/{new-CcPLKlc0.js → new-KA2ie897.js} +1 -1
  89. package/assets/onboarding-CjzRDnvm.js +1 -0
  90. package/assets/{onboarding-completion-BgX6tyKE.js → onboarding-completion-CwuHJfhv.js} +1 -1
  91. package/assets/outbox-Cy9JZikZ.js +1 -0
  92. package/assets/{pane-header-CaA1aTlU.js → pane-header-DidbhnoI.js} +1 -1
  93. package/assets/{pencil-TKs_c6Iw.js → pencil-DqDMjiQE.js} +1 -1
  94. package/assets/{popover-menu-Bmzk7h6e.js → popover-menu-2PYa43as.js} +1 -1
  95. package/assets/{refresh-cw-og-Ybvo3.js → refresh-cw-DWAbkoT3.js} +1 -1
  96. package/assets/{rich-text-CHZBDrnR.js → rich-text-D9n_7aOO.js} +1 -1
  97. package/assets/{rich-text-spellcheck-worker-provider-BllEMU79.js → rich-text-spellcheck-worker-provider-BbFToiMX.js} +1 -1
  98. package/assets/{rotate-ccw-FAgCjZMZ.js → rotate-ccw-cBgqjisw.js} +1 -1
  99. package/assets/{roving-focus-DYnDzdRR.js → roving-focus-lihtPwbC.js} +1 -1
  100. package/assets/{row-actions-DFIk5ZFA.js → row-actions-CfL_K-t9.js} +1 -1
  101. package/assets/{search-mirror-By7sgEWK.js → search-mirror-DhqKXhMJ.js} +1 -1
  102. package/assets/{search-token-index-CDtHdqiP.js → search-token-index-Bkj6PIXs.js} +1 -1
  103. package/assets/{sections-D-n9QfX4.js → sections-wK3DX2yg.js} +1 -1
  104. package/assets/{senders-D4sO52ZM.js → senders-B9DfZ-ZD.js} +1 -1
  105. package/assets/settings-Cr283p3E.js +1 -0
  106. package/assets/{settings-screen-DvNcGJK6.js → settings-screen-pRDnJYvp.js} +1 -1
  107. package/assets/{shield-check-8L17Kh_I.js → shield-check-D1Sajk90.js} +1 -1
  108. package/assets/{suggested-vips-Q_s_mJiL.js → suggested-vips-DpmmsrLE.js} +1 -1
  109. package/assets/{suggestion._suggestionId-BAj90-2v.js → suggestion._suggestionId-DQy5Hr1g.js} +1 -1
  110. package/assets/{undo-2-BSHTchh1.js → undo-2-C8HhV7-9.js} +1 -1
  111. package/assets/{useCalendarData-emMg6If8.js → useCalendarData-C2ICAesb.js} +1 -1
  112. package/assets/{useCalendarFreeBusy-oamX9h5O.js → useCalendarFreeBusy-xzt10efX.js} +1 -1
  113. package/assets/{useCalendarWrites-B6o3xQNN.js → useCalendarWrites-BqWuIv6N.js} +1 -1
  114. package/assets/{useCalendars-CzwJUnpW.js → useCalendars-B-DdrqSn.js} +1 -1
  115. package/assets/{useDebouncedValue-3uXEWBzO.js → useDebouncedValue-BnDpBnRn.js} +1 -1
  116. package/assets/{useFilters-D5DypOXB.js → useFilters-Ctb8KI_h.js} +1 -1
  117. package/assets/{useLabels-CEOAQRXe.js → useLabels-Cae2UsI0.js} +1 -1
  118. package/assets/{useLayoutTier-BLBwlToe.js → useLayoutTier-ob5yzPuz.js} +1 -1
  119. package/assets/{useMessageBodyContent-Bq-24837.js → useMessageBodyContent-BAKTxkDn.js} +1 -1
  120. package/assets/{useQueries-CqQkOWRS.js → useQueries-DWGt2_77.js} +1 -1
  121. package/assets/{useRefreshControl-URETybK8.js → useRefreshControl-DcMVjO86.js} +1 -1
  122. package/assets/{useResultFolderIndex-DgIMhZlz.js → useResultFolderIndex-Dt4mGDHa.js} +1 -1
  123. package/assets/useSearchTokenContext-DdCG0VLu.js +84 -0
  124. package/assets/{useSemanticSearch-CzayQYky.js → useSemanticSearch-CEWP6FrA.js} +1 -1
  125. package/assets/{useSignature-BraM8Nn7.js → useSignature-DdekzCf5.js} +1 -1
  126. package/index.html +1 -1
  127. package/package.json +1 -1
  128. package/assets/_calendarObjectId-Bmm-aQm4.js +0 -1
  129. package/assets/_mailboxId-BSG_TwdK.js +0 -1
  130. package/assets/_messageId-BdBHeA_W.js +0 -1
  131. package/assets/_messageId-DPyP0hLB.js +0 -1
  132. package/assets/_messageId-zXtGiOsw.js +0 -1
  133. package/assets/_outboxMessageId-DI-yjQl-.js +0 -1
  134. package/assets/_recurrenceId-xeHK4wQN.js +0 -1
  135. package/assets/_threadId-BWNiD5_L.js +0 -1
  136. package/assets/_threadId-BYme1h9o.js +0 -1
  137. package/assets/_threadId-BkVElb5l.js +0 -1
  138. package/assets/brief-DBfWEKXi.js +0 -1
  139. package/assets/chevron-left-B_-IAj1P.js +0 -1
  140. package/assets/compose._-_outboxMessageId_-BRWb_gzB.js +0 -1
  141. package/assets/compose._-_outboxMessageId_-D-8v_F-x.js +0 -1
  142. package/assets/compose._-_outboxMessageId_-D54zCsk7.js +0 -1
  143. package/assets/compose._-_outboxMessageId_-DlyKxAyJ.js +0 -1
  144. package/assets/flagged-BIby7mOe.js +0 -1
  145. package/assets/index--G6_bbnZ.js +0 -1
  146. package/assets/index-BdBHeA_W.js +0 -1
  147. package/assets/index-BswNQxjJ.js +0 -1
  148. package/assets/index-CeBLFOSc.js +0 -1
  149. package/assets/index-ChJF8JuK.js +0 -1
  150. package/assets/index-Ct3c_-_h.js +0 -1
  151. package/assets/index-Cu0O7J1a.js +0 -1
  152. package/assets/index-DVEw13Tk.js +0 -1
  153. package/assets/index-zXtGiOsw.js +0 -1
  154. package/assets/minus-D5h1w2Lk.js +0 -1
  155. package/assets/onboarding-kI2wRexG.js +0 -1
  156. package/assets/outbox-C60Ip38a.js +0 -1
  157. package/assets/settings-BGp6tn2L.js +0 -1
  158. package/assets/useSearchTokenContext-V_0MB9r5.js +0 -84
@@ -1 +1 @@
1
- import{r as m,j as c}from"./index-CVyiXes6.js";import{y as b,C as D,j as x,s as w}from"./calendar-suggestion-BOcnceiU.js";import{e as C,p as T,a as j,E as v,u as A,C as k}from"./CalendarComposePane-DJNhu2LK.js";import{E as N}from"./EmptyState-5AzHvbUg.js";import{e as F,h as O,u as R,d as E,f as Z,U as L}from"./useCalendars-CzwJUnpW.js";import{c as P}from"./calendar-report-cFSv6gSl.js";import{M as U,n as H}from"./calendar-format-Df04vYeX.js";import"./ErrorState-C9wNWNx-.js";import"./calendar-clash-strip-BFeaJEFd.js";import"./useQueries-CqQkOWRS.js";function z(e,t,d){const n={title:e.summary,location:e.location};if(e.allDay){const o=e.dtStart.slice(0,10),i=e.dtEnd.slice(0,10);return{...C(o,t),...n,allDay:!0,startTime:"",endDate:i>o?F(i,-1):o,endTime:""}}const a=o=>e.zoneCertainty==="Ambiguous"?o:O(o,d),s=a(e.dtStart),l=a(e.dtEnd);return{...C(s.slice(0,10),t),...n,startTime:s.slice(11,16),endDate:l.slice(0,10),endTime:l.slice(11,16)}}function B(e,t,d,n){const a=T(t,d,n);if(!a.ok)return a;const l=e.zoneCertainty==="Ambiguous"||a.patch.start!==void 0?{...a.patch,...j(d,n.clock),allDay:d.allDay,timeZone:n.anchor}:a.patch;return{ok:!0,input:{calendarId:d.calendarId,event:l}}}const g="Add from mail",M="The invitation named a time zone nothing could resolve. The time below is as the mail wrote it — check it before adding.";function _({suggestionId:e,onClose:t}){const{suggestion:d,isLoading:n,error:a}=b(e),s=d??void 0,[l,o]=m.useState(void 0);s!==void 0&&l===void 0&&o(s);const i=l??s;if(i!==void 0)return c.jsx($,{suggestion:i,onClose:t},i.suggestionId);if(a!==null){const u="Couldn't read what your mail is waiting on.";return c.jsx(v,{title:g,onClose:t,children:c.jsx(D,{text:`${u} Close this and try again.`,reportHref:P(u),className:"m-row-inset"})})}return c.jsx(v,{title:g,onClose:t,children:c.jsx(N,{message:n?"Reading the suggestion…":"This suggestion is no longer waiting on you. It was answered, or a later message replaced it."})})}function $({suggestion:e,onClose:t}){const{calendars:d,defaultCalendarId:n,timeZoneByCalendarId:a}=R(),s=d.filter(r=>!r.readOnly),l=x(),[o]=m.useState(()=>z(e,"",E())),[i,u]=m.useState(o),[y,f]=m.useState(""),S=A(i),p=s.some(r=>r.id===n)?n:s[0]?.id??"";m.useEffect(()=>{p!==""&&u(r=>r.calendarId===""?{...r,calendarId:p}:r)},[p]);const I=()=>{const r=B(e,o,i,{clock:E(),anchor:Z(a[i.calendarId]??L)});if(!r.ok){f(r.problem);return}f(""),l.acceptEdited(e.suggestionId,r.input).then(h=>{if(h.kind==="answered"){t();return}f(`Couldn't add this to your calendar: ${h.message}`)})};return c.jsx(k,{title:g,subtitle:w(e),notice:e.zoneCertainty==="Ambiguous"?M:"",calendars:s,draft:i,onChange:u,problem:y,saveLabel:"Add",isSaving:l.isAnswering,repeatEditable:!1,clashes:S,onSave:I,onCancel:t})}function te(){const e=U(),{closeEvent:t}=H();return e===void 0?null:c.jsx(_,{suggestionId:e,onClose:t})}export{te as component};
1
+ import{r as m,j as c}from"./index-DyXh0uZR.js";import{y as b,C as D,j as x,s as w}from"./calendar-suggestion-D1-lMf3B.js";import{e as C,p as T,a as j,E as v,u as A,C as k}from"./CalendarComposePane-CTOr6Y9H.js";import{E as N}from"./EmptyState-iJkDD5wT.js";import{e as F,h as O,u as R,d as E,f as Z,U as L}from"./useCalendars-B-DdrqSn.js";import{c as P}from"./calendar-report-DcwY6HH-.js";import{M as U,n as H}from"./calendar-format-B3u8XeCh.js";import"./ErrorState-DBbVLnRy.js";import"./calendar-clash-strip-4uWwSJgT.js";import"./useQueries-DWGt2_77.js";function z(e,t,d){const n={title:e.summary,location:e.location};if(e.allDay){const o=e.dtStart.slice(0,10),i=e.dtEnd.slice(0,10);return{...C(o,t),...n,allDay:!0,startTime:"",endDate:i>o?F(i,-1):o,endTime:""}}const a=o=>e.zoneCertainty==="Ambiguous"?o:O(o,d),s=a(e.dtStart),l=a(e.dtEnd);return{...C(s.slice(0,10),t),...n,startTime:s.slice(11,16),endDate:l.slice(0,10),endTime:l.slice(11,16)}}function B(e,t,d,n){const a=T(t,d,n);if(!a.ok)return a;const l=e.zoneCertainty==="Ambiguous"||a.patch.start!==void 0?{...a.patch,...j(d,n.clock),allDay:d.allDay,timeZone:n.anchor}:a.patch;return{ok:!0,input:{calendarId:d.calendarId,event:l}}}const g="Add from mail",M="The invitation named a time zone nothing could resolve. The time below is as the mail wrote it — check it before adding.";function _({suggestionId:e,onClose:t}){const{suggestion:d,isLoading:n,error:a}=b(e),s=d??void 0,[l,o]=m.useState(void 0);s!==void 0&&l===void 0&&o(s);const i=l??s;if(i!==void 0)return c.jsx($,{suggestion:i,onClose:t},i.suggestionId);if(a!==null){const u="Couldn't read what your mail is waiting on.";return c.jsx(v,{title:g,onClose:t,children:c.jsx(D,{text:`${u} Close this and try again.`,reportHref:P(u),className:"m-row-inset"})})}return c.jsx(v,{title:g,onClose:t,children:c.jsx(N,{message:n?"Reading the suggestion…":"This suggestion is no longer waiting on you. It was answered, or a later message replaced it."})})}function $({suggestion:e,onClose:t}){const{calendars:d,defaultCalendarId:n,timeZoneByCalendarId:a}=R(),s=d.filter(r=>!r.readOnly),l=x(),[o]=m.useState(()=>z(e,"",E())),[i,u]=m.useState(o),[y,f]=m.useState(""),S=A(i),p=s.some(r=>r.id===n)?n:s[0]?.id??"";m.useEffect(()=>{p!==""&&u(r=>r.calendarId===""?{...r,calendarId:p}:r)},[p]);const I=()=>{const r=B(e,o,i,{clock:E(),anchor:Z(a[i.calendarId]??L)});if(!r.ok){f(r.problem);return}f(""),l.acceptEdited(e.suggestionId,r.input).then(h=>{if(h.kind==="answered"){t();return}f(`Couldn't add this to your calendar: ${h.message}`)})};return c.jsx(k,{title:g,subtitle:w(e),notice:e.zoneCertainty==="Ambiguous"?M:"",calendars:s,draft:i,onChange:u,problem:y,saveLabel:"Add",isSaving:l.isAnswering,repeatEditable:!1,clashes:S,onSave:I,onCancel:t})}function te(){const e=U(),{closeEvent:t}=H();return e===void 0?null:c.jsx(_,{suggestionId:e,onClose:t})}export{te as component};
@@ -1 +1 @@
1
- import{e as a}from"./index-CVyiXes6.js";const o=a("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);export{o as U};
1
+ import{e as a}from"./index-DyXh0uZR.js";const o=a("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);export{o as U};
@@ -1 +1 @@
1
- import{r as m}from"./index-CVyiXes6.js";import{u as C,d as g,i as I,t as v,U as p,b as D,r as E}from"./useCalendars-CzwJUnpW.js";import{x as y,I as L}from"./calendar-format-Df04vYeX.js";function Z(a,n){const t=a.map(e=>e.id);if(n.length===0)return t;const s=new Set(n),o=t.filter(e=>s.has(e));return o.length===0?t:o}function b(a){const{calendars:n,colorByCalendarId:t,timeZoneByCalendarId:s,isLoading:o}=C(),e=Z(n,a),r=e.length===n.length?[]:e,c=a.length===0||n.length>0;return{calendars:n,colorByCalendarId:t,timeZoneByCalendarId:s,shown:e,narrowed:r,resolved:c,isLoading:o}}function x(a,n,t){const s=t.join(",");return m.useMemo(()=>{const o=g(),e=new Set(s===""?[]:s.split(","));return a.filter(r=>I(r)&&e.has(r.calendarId)).map(r=>v(r,n[r.calendarId]??p,o))},[a,n,s])}function S({view:a,date:n,calendarIds:t,enabled:s=!0}){const{calendars:o,colorByCalendarId:e,timeZoneByCalendarId:r,shown:c,narrowed:l,resolved:u,isLoading:w}=b(t),h=D(a,n),i=s&&u,d=y({...h,calendarIds:l,enabled:i});L(a,n,l,i);const f=x(d.instances,r,c);return{calendars:o,events:f,colorByCalendarId:e,timeZoneByCalendarId:r,isLoading:w||d.isLoading,error:d.error,retry:d.refetch,instanceOf:E}}export{x as a,S as b,b as u};
1
+ import{r as m}from"./index-DyXh0uZR.js";import{u as C,d as g,i as I,t as v,U as p,b as D,r as E}from"./useCalendars-B-DdrqSn.js";import{x as y,I as L}from"./calendar-format-B3u8XeCh.js";function Z(a,n){const t=a.map(e=>e.id);if(n.length===0)return t;const s=new Set(n),o=t.filter(e=>s.has(e));return o.length===0?t:o}function b(a){const{calendars:n,colorByCalendarId:t,timeZoneByCalendarId:s,isLoading:o}=C(),e=Z(n,a),r=e.length===n.length?[]:e,c=a.length===0||n.length>0;return{calendars:n,colorByCalendarId:t,timeZoneByCalendarId:s,shown:e,narrowed:r,resolved:c,isLoading:o}}function x(a,n,t){const s=t.join(",");return m.useMemo(()=>{const o=g(),e=new Set(s===""?[]:s.split(","));return a.filter(r=>I(r)&&e.has(r.calendarId)).map(r=>v(r,n[r.calendarId]??p,o))},[a,n,s])}function S({view:a,date:n,calendarIds:t,enabled:s=!0}){const{calendars:o,colorByCalendarId:e,timeZoneByCalendarId:r,shown:c,narrowed:l,resolved:u,isLoading:w}=b(t),h=D(a,n),i=s&&u,d=y({...h,calendarIds:l,enabled:i});L(a,n,l,i);const f=x(d.instances,r,c);return{calendars:o,events:f,colorByCalendarId:e,timeZoneByCalendarId:r,isLoading:w||d.isLoading,error:d.error,retry:d.refetch,instanceOf:E}}export{x as a,S as b,b as u};
@@ -1 +1 @@
1
- import{e as R,t as c,j as e,r as N,W as D,X as P,ar as T,dp as Z,f as z,aQ as I,ah as L,ev as O,s as _}from"./index-CVyiXes6.js";import{c as F,R as B,C as W}from"./calendar-format-Df04vYeX.js";import{M as C}from"./mail-3L2_JePI.js";import{G as A}from"./map-pin-C_G0KnPH.js";import{u as G}from"./useQueries-CqQkOWRS.js";const U=R("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);function X(s){const n=F(s.color),a=s.rsvp==="tentative"||s.status==="tentative";return c("flex min-w-0 overflow-hidden rounded-sm border-l-2 px-1.5 py-0.5",n.soft,n.text,n.rail,s.layout==="column"||s.stacked?"flex-col":"items-center gap-1.5",a&&"border-y border-r border-dashed",a&&n.border,s.rsvp==="declined"&&"opacity-60",s.selected&&"ring-2 ring-ring",s.density==="compact"?"text-2xs":"text-xs")}function $({title:s,timeText:n,layout:a,rsvp:l,hasThread:d,isRecurring:m,zoneCertainty:x,trailing:t,detail:p}){const r=a==="column",i=x==="ambiguous",o=!r&&p!==void 0,u=e.jsxs("span",{className:c("flex min-w-0 items-center gap-1",r&&"w-full",l==="declined"&&"line-through"),children:[n!==""&&e.jsx("span",{className:"shrink-0 tabular-nums opacity-80",children:n}),e.jsx("span",{className:"truncate font-medium",children:s})]}),h=(m||d||i)&&e.jsxs("span",{className:c("flex shrink-0 items-center gap-1",r&&"mt-0.5",!r&&t===void 0&&"ml-auto"),children:[m&&e.jsx(B,{className:"size-2.5","aria-label":"Repeats"}),d&&e.jsx(C,{className:"size-2.5","aria-label":"From mail"}),i&&e.jsx(A,{className:"size-2.5 text-warning","aria-label":"Unclear zone"})]}),g=t!==void 0&&e.jsx("span",{className:c("shrink-0 opacity-80",!r&&"ml-auto"),children:t});return e.jsxs(e.Fragment,{children:[o?e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u,h,g]}):e.jsxs(e.Fragment,{children:[u,h,g]}),p]})}function ne({title:s,timeText:n,color:a,layout:l,density:d,rsvp:m,status:x,hasThread:t,isRecurring:p,zoneCertainty:r,selected:i,onClick:o,leading:u,trailing:h,detail:g}){const j=l==="column";return e.jsxs("button",{type:"button",onClick:o,"aria-pressed":i,className:c("group flex w-full min-w-0 text-left outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",j?"h-full":"items-start",u!==void 0&&"gap-2"),children:[u,e.jsx("span",{className:c(X({color:a,layout:l,density:d,rsvp:m,status:x,selected:i,stacked:g!==void 0}),"flex-1",j&&"h-full"),children:e.jsx($,{title:s,timeText:n,layout:l,rsvp:m,hasThread:t,isRecurring:p,zoneCertainty:r,trailing:h,detail:g})})]})}const E=96,q=6;function ae({children:s,hasCard:n,onConfirm:a,onReject:l,blocked:d,blockedReason:m,remaining:x,confirmLabel:t="Add",emptyText:p="Nothing in your mail is waiting on a decision about time.",className:r}){const[i,o]=N.useState(0),[u,h]=N.useState(null);if(!n)return e.jsxs("div",{className:c("flex flex-col items-center gap-2 p-6 text-center",r),children:[e.jsx(D,{className:"size-6 text-fg-subtle","aria-hidden":!0}),e.jsx("p",{className:"text-sm text-fg-muted",children:p})]});const g=Math.abs(i)>E,j=i>0;return e.jsxs("div",{className:c("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"touch-pan-y select-none",style:{transform:`translateX(${i}px) rotate(${i/40}deg)`,transition:u===null?"transform 180ms ease-out":"none"},onPointerDown:b=>{h(b.clientX)},onPointerMove:b=>{if(u===null)return;const v=b.clientX-u;Math.abs(v)>q&&!b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.setPointerCapture(b.pointerId),o(v)},onPointerUp:()=>{Math.abs(i)>E&&(i>0&&!d&&a(),i<0&&l()),h(null),o(0)},onPointerCancel:()=>{h(null),o(0)},children:s}),g&&e.jsx("span",{className:c("pointer-events-none absolute top-3 rounded-md px-2 py-1 text-xs font-semibold",j?"right-3 bg-accent-soft text-accent":"left-3 bg-danger-soft text-danger"),children:j?d?m:t:"Not this"})]}),e.jsxs("p",{className:"text-center text-2xs text-fg-subtle",children:[x," left · swipe right to accept, left to drop, or use the buttons"]})]})}const H="Pick a clock first. The mail never said, and the reader will not choose for you.";function Q(s,n){const a=s.zoneOptions;return a===void 0?{settled:!0,timeZone:""}:a.some(l=>l.timeZone===n)?{settled:!0,timeZone:n}:{settled:!1,reason:H}}function S(s){return s.threadSubject===""?s.sender:`${s.sender} — ${s.threadSubject}`}function K(s){return s>=.85?"Read cleanly":s>=.6?"Read with gaps":"Barely read"}function re({suggestion:s,whenText:n,onAdd:a,onReview:l,onDismiss:d,onOpenThread:m,busy:x=!1,addBlocked:t=!1,zoneChoice:p,onZoneChoice:r,addLabel:i="Add",touch:o,className:u}){const[h,g]=N.useState(""),[j,b]=N.useState(!1),v=N.useId(),k=p??h,M=f=>{b(!1),r?r(f):g(f)},y=Q(s,k),w=f=>()=>{if(!y.settled){b(!0);return}f(y.timeZone)};return e.jsxs("article",{"aria-label":s.title,className:c("flex flex-col gap-2 rounded-lg border border-dashed border-line-strong bg-surface-sunken p-3",u),children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"block text-2xs uppercase tracking-wider text-fg-subtle",children:["Suggested from mail · ",K(s.confidence)]}),e.jsx("span",{className:"block truncate text-sm font-medium text-fg",children:s.title}),e.jsx("span",{className:"block text-xs text-fg-muted",children:n}),s.location!==""&&e.jsx("span",{className:"block truncate text-xs text-fg-muted",children:s.location})]}),e.jsx("button",{type:"button","aria-label":"Dismiss suggestion",onClick:d,disabled:x,className:c("flex shrink-0 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",o?"size-11":"size-7"),children:e.jsx(P,{className:"size-4"})})]}),s.ambiguity!==""&&e.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-warning",children:[e.jsx(T,{className:"mt-0.5 size-3 shrink-0","aria-hidden":!0}),s.ambiguity]}),m?e.jsxs("button",{type:"button",onClick:m,className:"flex w-full min-w-0 items-center gap-1.5 rounded-sm text-left text-2xs text-accent-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx(C,{className:"size-3 shrink-0"}),e.jsx("span",{className:"truncate",children:S(s)})]}):e.jsxs("p",{className:"flex w-full min-w-0 items-center gap-1.5 text-2xs text-fg-subtle",children:[e.jsx(C,{className:"size-3 shrink-0"}),e.jsx("span",{className:"truncate",children:S(s)})]}),s.zoneOptions&&e.jsxs("div",{className:"flex flex-col gap-1.5 rounded-md border border-warning/40 p-2",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-2xs font-semibold text-warning",children:[e.jsx(A,{className:"size-3 shrink-0","aria-hidden":!0}),"Which clock is this on?"]}),s.zoneOptions.map(f=>e.jsxs("button",{type:"button","aria-pressed":k===f.timeZone,onClick:()=>M(f.timeZone),className:c("rounded-md border px-2 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",o&&"min-h-11",k===f.timeZone?"border-accent bg-accent-soft":"border-line bg-surface hover:border-line-strong"),children:[e.jsx("span",{className:"block text-xs font-medium text-fg",children:f.label}),e.jsx("span",{className:"block text-2xs text-fg-subtle",children:f.note})]},f.timeZone))]}),!y.settled&&e.jsx(Z,{id:v,reason:y.reason,nudged:j,className:"text-2xs text-warning"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{variant:"primary",size:o?"md":"sm",icon:e.jsx(I,{className:"size-3.5"}),onClick:w(a),disabled:x||t,"aria-describedby":y.settled?void 0:v,className:c(o&&"min-h-11 flex-1",!y.settled&&"opacity-55"),children:i}),l&&e.jsx(z,{variant:"secondary",size:o?"md":"sm",icon:e.jsx(U,{className:"size-3.5"}),onClick:w(l),disabled:x,"aria-describedby":y.settled?void 0:v,className:c(o&&"min-h-11",!y.settled&&"opacity-55"),children:"Change first"})]})]})}function ie(s){return s.defaultCalendarId!==""?"ready":s.error!==null?"failed":s.isLoading?"loading":"none"}function le(s,n){if(s!=="ready")return s==="loading"?"Reading your calendars…":s==="failed"?e.jsxs(e.Fragment,{children:["Couldn't read your calendars, so there is nowhere to add this yet. Reload to try again."," ",e.jsx("a",{href:n,target:"_blank",rel:"noreferrer",className:"font-medium text-accent hover:underline",children:"Report an issue"})]}):e.jsxs(e.Fragment,{children:["You have no calendar yet, so there is nowhere to add this."," ",e.jsx(L,{to:"/settings/calendars",className:"font-medium text-accent hover:underline",children:"Create a calendar"})]})}const Y=_(400,404);function oe(s){const n=G({queries:s.map(t=>({...O({query:{from:t.from,to:t.to}}),meta:Y,staleTime:W}))}),a=s.map(t=>t.from).join("|"),l=n.map(t=>t.data),d=n.map(t=>t.isPending).join("|"),m=N.useMemo(()=>l.flatMap(t=>t?.items??[]),[a,d]),x=N.useMemo(()=>{const t=new Set;return s.forEach((p,r)=>{n[r]?.isPending&&t.add(p.from)}),t},[a,d]);return{spans:m,pendingWindows:x,error:n.find(t=>t.error)?.error??null,refetch:()=>{for(const t of n)t.error&&t.refetch()}}}export{ne as C,re as E,H as Z,$ as a,ae as b,X as c,le as d,ie as e,Q as s,oe as u};
1
+ import{e as R,t as c,j as e,r as N,W as D,X as P,ar as T,dp as Z,f as z,aQ as I,ah as L,ev as O,s as _}from"./index-DyXh0uZR.js";import{c as F,R as B,C as W}from"./calendar-format-B3u8XeCh.js";import{M as C}from"./mail-B7zN4zHx.js";import{G as A}from"./map-pin-xN7wT2-l.js";import{u as G}from"./useQueries-DWGt2_77.js";const U=R("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);function X(s){const n=F(s.color),a=s.rsvp==="tentative"||s.status==="tentative";return c("flex min-w-0 overflow-hidden rounded-sm border-l-2 px-1.5 py-0.5",n.soft,n.text,n.rail,s.layout==="column"||s.stacked?"flex-col":"items-center gap-1.5",a&&"border-y border-r border-dashed",a&&n.border,s.rsvp==="declined"&&"opacity-60",s.selected&&"ring-2 ring-ring",s.density==="compact"?"text-2xs":"text-xs")}function $({title:s,timeText:n,layout:a,rsvp:l,hasThread:d,isRecurring:m,zoneCertainty:x,trailing:t,detail:p}){const r=a==="column",i=x==="ambiguous",o=!r&&p!==void 0,u=e.jsxs("span",{className:c("flex min-w-0 items-center gap-1",r&&"w-full",l==="declined"&&"line-through"),children:[n!==""&&e.jsx("span",{className:"shrink-0 tabular-nums opacity-80",children:n}),e.jsx("span",{className:"truncate font-medium",children:s})]}),h=(m||d||i)&&e.jsxs("span",{className:c("flex shrink-0 items-center gap-1",r&&"mt-0.5",!r&&t===void 0&&"ml-auto"),children:[m&&e.jsx(B,{className:"size-2.5","aria-label":"Repeats"}),d&&e.jsx(C,{className:"size-2.5","aria-label":"From mail"}),i&&e.jsx(A,{className:"size-2.5 text-warning","aria-label":"Unclear zone"})]}),g=t!==void 0&&e.jsx("span",{className:c("shrink-0 opacity-80",!r&&"ml-auto"),children:t});return e.jsxs(e.Fragment,{children:[o?e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u,h,g]}):e.jsxs(e.Fragment,{children:[u,h,g]}),p]})}function ne({title:s,timeText:n,color:a,layout:l,density:d,rsvp:m,status:x,hasThread:t,isRecurring:p,zoneCertainty:r,selected:i,onClick:o,leading:u,trailing:h,detail:g}){const j=l==="column";return e.jsxs("button",{type:"button",onClick:o,"aria-pressed":i,className:c("group flex w-full min-w-0 text-left outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",j?"h-full":"items-start",u!==void 0&&"gap-2"),children:[u,e.jsx("span",{className:c(X({color:a,layout:l,density:d,rsvp:m,status:x,selected:i,stacked:g!==void 0}),"flex-1",j&&"h-full"),children:e.jsx($,{title:s,timeText:n,layout:l,rsvp:m,hasThread:t,isRecurring:p,zoneCertainty:r,trailing:h,detail:g})})]})}const E=96,q=6;function ae({children:s,hasCard:n,onConfirm:a,onReject:l,blocked:d,blockedReason:m,remaining:x,confirmLabel:t="Add",emptyText:p="Nothing in your mail is waiting on a decision about time.",className:r}){const[i,o]=N.useState(0),[u,h]=N.useState(null);if(!n)return e.jsxs("div",{className:c("flex flex-col items-center gap-2 p-6 text-center",r),children:[e.jsx(D,{className:"size-6 text-fg-subtle","aria-hidden":!0}),e.jsx("p",{className:"text-sm text-fg-muted",children:p})]});const g=Math.abs(i)>E,j=i>0;return e.jsxs("div",{className:c("flex flex-col gap-3",r),children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"touch-pan-y select-none",style:{transform:`translateX(${i}px) rotate(${i/40}deg)`,transition:u===null?"transform 180ms ease-out":"none"},onPointerDown:b=>{h(b.clientX)},onPointerMove:b=>{if(u===null)return;const v=b.clientX-u;Math.abs(v)>q&&!b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.setPointerCapture(b.pointerId),o(v)},onPointerUp:()=>{Math.abs(i)>E&&(i>0&&!d&&a(),i<0&&l()),h(null),o(0)},onPointerCancel:()=>{h(null),o(0)},children:s}),g&&e.jsx("span",{className:c("pointer-events-none absolute top-3 rounded-md px-2 py-1 text-xs font-semibold",j?"right-3 bg-accent-soft text-accent":"left-3 bg-danger-soft text-danger"),children:j?d?m:t:"Not this"})]}),e.jsxs("p",{className:"text-center text-2xs text-fg-subtle",children:[x," left · swipe right to accept, left to drop, or use the buttons"]})]})}const H="Pick a clock first. The mail never said, and the reader will not choose for you.";function Q(s,n){const a=s.zoneOptions;return a===void 0?{settled:!0,timeZone:""}:a.some(l=>l.timeZone===n)?{settled:!0,timeZone:n}:{settled:!1,reason:H}}function S(s){return s.threadSubject===""?s.sender:`${s.sender} — ${s.threadSubject}`}function K(s){return s>=.85?"Read cleanly":s>=.6?"Read with gaps":"Barely read"}function re({suggestion:s,whenText:n,onAdd:a,onReview:l,onDismiss:d,onOpenThread:m,busy:x=!1,addBlocked:t=!1,zoneChoice:p,onZoneChoice:r,addLabel:i="Add",touch:o,className:u}){const[h,g]=N.useState(""),[j,b]=N.useState(!1),v=N.useId(),k=p??h,M=f=>{b(!1),r?r(f):g(f)},y=Q(s,k),w=f=>()=>{if(!y.settled){b(!0);return}f(y.timeZone)};return e.jsxs("article",{"aria-label":s.title,className:c("flex flex-col gap-2 rounded-lg border border-dashed border-line-strong bg-surface-sunken p-3",u),children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"block text-2xs uppercase tracking-wider text-fg-subtle",children:["Suggested from mail · ",K(s.confidence)]}),e.jsx("span",{className:"block truncate text-sm font-medium text-fg",children:s.title}),e.jsx("span",{className:"block text-xs text-fg-muted",children:n}),s.location!==""&&e.jsx("span",{className:"block truncate text-xs text-fg-muted",children:s.location})]}),e.jsx("button",{type:"button","aria-label":"Dismiss suggestion",onClick:d,disabled:x,className:c("flex shrink-0 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",o?"size-11":"size-7"),children:e.jsx(P,{className:"size-4"})})]}),s.ambiguity!==""&&e.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-warning",children:[e.jsx(T,{className:"mt-0.5 size-3 shrink-0","aria-hidden":!0}),s.ambiguity]}),m?e.jsxs("button",{type:"button",onClick:m,className:"flex w-full min-w-0 items-center gap-1.5 rounded-sm text-left text-2xs text-accent-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx(C,{className:"size-3 shrink-0"}),e.jsx("span",{className:"truncate",children:S(s)})]}):e.jsxs("p",{className:"flex w-full min-w-0 items-center gap-1.5 text-2xs text-fg-subtle",children:[e.jsx(C,{className:"size-3 shrink-0"}),e.jsx("span",{className:"truncate",children:S(s)})]}),s.zoneOptions&&e.jsxs("div",{className:"flex flex-col gap-1.5 rounded-md border border-warning/40 p-2",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-2xs font-semibold text-warning",children:[e.jsx(A,{className:"size-3 shrink-0","aria-hidden":!0}),"Which clock is this on?"]}),s.zoneOptions.map(f=>e.jsxs("button",{type:"button","aria-pressed":k===f.timeZone,onClick:()=>M(f.timeZone),className:c("rounded-md border px-2 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",o&&"min-h-11",k===f.timeZone?"border-accent bg-accent-soft":"border-line bg-surface hover:border-line-strong"),children:[e.jsx("span",{className:"block text-xs font-medium text-fg",children:f.label}),e.jsx("span",{className:"block text-2xs text-fg-subtle",children:f.note})]},f.timeZone))]}),!y.settled&&e.jsx(Z,{id:v,reason:y.reason,nudged:j,className:"text-2xs text-warning"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{variant:"primary",size:o?"md":"sm",icon:e.jsx(I,{className:"size-3.5"}),onClick:w(a),disabled:x||t,"aria-describedby":y.settled?void 0:v,className:c(o&&"min-h-11 flex-1",!y.settled&&"opacity-55"),children:i}),l&&e.jsx(z,{variant:"secondary",size:o?"md":"sm",icon:e.jsx(U,{className:"size-3.5"}),onClick:w(l),disabled:x,"aria-describedby":y.settled?void 0:v,className:c(o&&"min-h-11",!y.settled&&"opacity-55"),children:"Change first"})]})]})}function ie(s){return s.defaultCalendarId!==""?"ready":s.error!==null?"failed":s.isLoading?"loading":"none"}function le(s,n){if(s!=="ready")return s==="loading"?"Reading your calendars…":s==="failed"?e.jsxs(e.Fragment,{children:["Couldn't read your calendars, so there is nowhere to add this yet. Reload to try again."," ",e.jsx("a",{href:n,target:"_blank",rel:"noreferrer",className:"font-medium text-accent hover:underline",children:"Report an issue"})]}):e.jsxs(e.Fragment,{children:["You have no calendar yet, so there is nowhere to add this."," ",e.jsx(L,{to:"/settings/calendars",className:"font-medium text-accent hover:underline",children:"Create a calendar"})]})}const Y=_(400,404);function oe(s){const n=G({queries:s.map(t=>({...O({query:{from:t.from,to:t.to}}),meta:Y,staleTime:W}))}),a=s.map(t=>t.from).join("|"),l=n.map(t=>t.data),d=n.map(t=>t.isPending).join("|"),m=N.useMemo(()=>l.flatMap(t=>t?.items??[]),[a,d]),x=N.useMemo(()=>{const t=new Set;return s.forEach((p,r)=>{n[r]?.isPending&&t.add(p.from)}),t},[a,d]);return{spans:m,pendingWindows:x,error:n.find(t=>t.error)?.error??null,refetch:()=>{for(const t of n)t.error&&t.refetch()}}}export{ne as C,re as E,H as Z,$ as a,ae as b,X as c,le as d,ie as e,Q as s,oe as u};
@@ -1 +1 @@
1
- import{h as C,r,i as c,eV as h,eW as f,eX as y,s as g,b5 as m}from"./index-CVyiXes6.js";import{f as I}from"./ErrorState-C9wNWNx-.js";const o=g(400,404,412),b=new Set(["calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy"]),d={kind:"written"},i=e=>m(e)===412?{kind:"conflict"}:{kind:"refused",message:I(e)},O={this:"This",following:"Following",all:"All"};function A(){const e=C();return r.useCallback(()=>{e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const s=n._id;return typeof s=="string"&&b.has(s)}})},[e])}const p=({scope:e,recurrenceId:t})=>e===void 0?{}:{scope:O[e],recurrenceId:t};function k(){const e=A(),t=c({...h(),meta:o,onSuccess:e}),n=c({...f(),meta:o,onSuccess:e}),s=c({...y(),meta:o,onSuccess:e}),l=r.useCallback(a=>t.mutateAsync({body:a}).then(()=>d).catch(i),[t]),u=r.useCallback((a,v)=>n.mutateAsync({path:{calendarObjectId:a.calendarObjectId},query:{calendarId:a.calendarId,...p(a)},headers:{"If-Match":a.etag},body:v}).then(()=>d).catch(i),[n]),E=r.useCallback(a=>s.mutateAsync({path:{calendarObjectId:a.calendarObjectId},query:{calendarId:a.calendarId,...p(a)},headers:{"If-Match":a.etag}}).then(()=>d).catch(i),[s]);return r.useMemo(()=>({createEvent:l,updateEvent:u,deleteEvent:E,isWriting:t.isPending||n.isPending||s.isPending}),[l,u,E,t.isPending,n.isPending,s.isPending])}export{k as a,A as u};
1
+ import{h as C,r,i as c,eV as h,eW as f,eX as y,s as g,b5 as m}from"./index-DyXh0uZR.js";import{f as I}from"./ErrorState-DBbVLnRy.js";const o=g(400,404,412),b=new Set(["calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy"]),d={kind:"written"},i=e=>m(e)===412?{kind:"conflict"}:{kind:"refused",message:I(e)},O={this:"This",following:"Following",all:"All"};function A(){const e=C();return r.useCallback(()=>{e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const s=n._id;return typeof s=="string"&&b.has(s)}})},[e])}const p=({scope:e,recurrenceId:t})=>e===void 0?{}:{scope:O[e],recurrenceId:t};function k(){const e=A(),t=c({...h(),meta:o,onSuccess:e}),n=c({...f(),meta:o,onSuccess:e}),s=c({...y(),meta:o,onSuccess:e}),l=r.useCallback(a=>t.mutateAsync({body:a}).then(()=>d).catch(i),[t]),u=r.useCallback((a,v)=>n.mutateAsync({path:{calendarObjectId:a.calendarObjectId},query:{calendarId:a.calendarId,...p(a)},headers:{"If-Match":a.etag},body:v}).then(()=>d).catch(i),[n]),E=r.useCallback(a=>s.mutateAsync({path:{calendarObjectId:a.calendarObjectId},query:{calendarId:a.calendarId,...p(a)},headers:{"If-Match":a.etag}}).then(()=>d).catch(i),[s]);return r.useMemo(()=>({createEvent:l,updateEvent:u,deleteEvent:E,isWriting:t.isPending||n.isPending||s.isPending}),[l,u,E,t.isPending,n.isPending,s.isPending])}export{k as a,A as u};
@@ -1 +1 @@
1
- import{c as g,ew as T,r as h}from"./index-CVyiXes6.js";const o=e=>String(e).padStart(2,"0"),y=e=>`${e.getUTCFullYear()}-${o(e.getUTCMonth()+1)}-${o(e.getUTCDate())}`,f=e=>{const t=e<0?"-":"+",r=Math.abs(e);return`${t}${o(Math.floor(r/60))}:${o(r%60)}`};function $(e,t){const r=new Date(`${e}T${t}:00`);return`${e}T${t}:00${f(-r.getTimezoneOffset())}`}const i=new Map;function N(e){if(i.has(e))return i.get(e);let t;try{t=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{t=void 0}return i.set(e,t),t}function d(e,t){const r=N(e);if(!r)return Number.NaN;const n=r.formatToParts(new Date(t)),a=O=>Number(n.find(b=>b.type===O)?.value),s=a("hour")%24;return(Date.UTC(a("year"),a("month")-1,a("day"),s,a("minute"),a("second"))-t)/6e4}function L(e,t,r){if(r==="")return`${e}T${t}:00+00:00`;const n=Date.parse(`${e}T${t}:00Z`),a=d(r,n);if(Number.isNaN(a))return $(e,t);const s=d(r,n-a*6e4);return`${e}T${t}:00${f(Number.isNaN(s)?a:s)}`}function p(e,t){const r=Date.parse(e),n=d(t,r),a=Number.isNaN(n)?-new Date(r).getTimezoneOffset():n,s=new Date(r+a*6e4);return`${y(s)}T${o(s.getUTCHours())}:${o(s.getUTCMinutes())}:${o(s.getUTCSeconds())}${f(a)}`}const c=e=>$(e,"00:00");function u(e,t){const[r,n,a]=e.split("-").map(Number);return y(new Date(Date.UTC(r,n-1,a+t)))}function U(e){const[t,r,n]=e.split("-").map(Number),a=new Date(Date.UTC(t,r-1,n));return u(e,-((a.getUTCDay()+6)%7))}function E(e,t){const[r,n]=t.split("-").map(Number);if(e==="year")return[`${r}-01-01`,`${r+1}-01-01`];if(e==="month"){const s=`${r}-${o(n)}-01`,m=n===12?`${r+1}-01-01`:`${r}-${o(n+1)}-01`;return[s,m]}if(e==="day")return[t,u(t,1)];const a=U(t);return[a,u(a,7)]}function M(e,t){const[r,n]=E(e,t);return{from:c(r),to:c(n)}}function F(e,t){return{from:c(e),to:c(u(e,t))}}const R=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,C="";function k(e){if(e!==C)return e;const t=R();return Intl.supportedValuesOf("timeZone").includes(t)?t:C}const w={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},v={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},D="#";function z(e,t){return t===""?e:`${e}${D}${t}`}function l(e){const t=e.indexOf(D);return t===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,t),recurrenceId:e.slice(t+1)}}const I=(e,t)=>{const r=[...e].sort((n,a)=>Date.parse(n.start)-Date.parse(a.start));return r.find(n=>Date.parse(n.end)>Date.parse(t))??r[0]};function B(e,t,r){const n=I(e.filter(a=>{const s=l(a.id);return s.calendarObjectId===t&&s.recurrenceId!==""}),r);return n?l(n.id):void 0}function P(e,t,r,n){const a=I(e.filter(s=>s.calendarObjectId===t&&j(s)).map(s=>x(s,"",n)),r);if(a)return{...l(a.id),calendarId:a.calendarId,date:a.start.slice(0,10)}}function S(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:w[e.color]??"cal-1",...e.source==="Subscribed"?{readOnly:!0,sync:e.subscriptionEnabled?"live":"paused",syncError:e.subscriptionError}:{}}}function x(e,t,r){return{id:z(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.allDay?e.start.slice(0,10):p(e.start,r),end:e.allDay?e.end.slice(0,10):p(e.end,r),allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:"accepted",threadId:"",threadSubject:"",timeZone:t,zoneCertainty:v[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const j=e=>e.status!=="Cancelled";function W(){const{data:e,isLoading:t,error:r}=g(T());return h.useMemo(()=>{const n=e?.items??[],a=n.map(S);return{calendars:a,collections:n,colorByCalendarId:Object.fromEntries(a.map(s=>[s.id,s.color])),timeZoneByCalendarId:Object.fromEntries(n.map(s=>[s.calendarId,s.timezone])),defaultCalendarId:(n.find(s=>s.source==="Default")??n[0])?.calendarId??"",isLoading:t,error:r??null}},[e,t,r])}export{C as U,F as a,M as b,z as c,R as d,u as e,k as f,L as g,p as h,j as i,P as j,l as r,B as s,x as t,W as u};
1
+ import{c as g,ew as T,r as h}from"./index-DyXh0uZR.js";const o=e=>String(e).padStart(2,"0"),y=e=>`${e.getUTCFullYear()}-${o(e.getUTCMonth()+1)}-${o(e.getUTCDate())}`,f=e=>{const t=e<0?"-":"+",r=Math.abs(e);return`${t}${o(Math.floor(r/60))}:${o(r%60)}`};function $(e,t){const r=new Date(`${e}T${t}:00`);return`${e}T${t}:00${f(-r.getTimezoneOffset())}`}const i=new Map;function N(e){if(i.has(e))return i.get(e);let t;try{t=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{t=void 0}return i.set(e,t),t}function d(e,t){const r=N(e);if(!r)return Number.NaN;const n=r.formatToParts(new Date(t)),a=O=>Number(n.find(b=>b.type===O)?.value),s=a("hour")%24;return(Date.UTC(a("year"),a("month")-1,a("day"),s,a("minute"),a("second"))-t)/6e4}function L(e,t,r){if(r==="")return`${e}T${t}:00+00:00`;const n=Date.parse(`${e}T${t}:00Z`),a=d(r,n);if(Number.isNaN(a))return $(e,t);const s=d(r,n-a*6e4);return`${e}T${t}:00${f(Number.isNaN(s)?a:s)}`}function p(e,t){const r=Date.parse(e),n=d(t,r),a=Number.isNaN(n)?-new Date(r).getTimezoneOffset():n,s=new Date(r+a*6e4);return`${y(s)}T${o(s.getUTCHours())}:${o(s.getUTCMinutes())}:${o(s.getUTCSeconds())}${f(a)}`}const c=e=>$(e,"00:00");function u(e,t){const[r,n,a]=e.split("-").map(Number);return y(new Date(Date.UTC(r,n-1,a+t)))}function U(e){const[t,r,n]=e.split("-").map(Number),a=new Date(Date.UTC(t,r-1,n));return u(e,-((a.getUTCDay()+6)%7))}function E(e,t){const[r,n]=t.split("-").map(Number);if(e==="year")return[`${r}-01-01`,`${r+1}-01-01`];if(e==="month"){const s=`${r}-${o(n)}-01`,m=n===12?`${r+1}-01-01`:`${r}-${o(n+1)}-01`;return[s,m]}if(e==="day")return[t,u(t,1)];const a=U(t);return[a,u(a,7)]}function M(e,t){const[r,n]=E(e,t);return{from:c(r),to:c(n)}}function F(e,t){return{from:c(e),to:c(u(e,t))}}const R=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,C="";function k(e){if(e!==C)return e;const t=R();return Intl.supportedValuesOf("timeZone").includes(t)?t:C}const w={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},v={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},D="#";function z(e,t){return t===""?e:`${e}${D}${t}`}function l(e){const t=e.indexOf(D);return t===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,t),recurrenceId:e.slice(t+1)}}const I=(e,t)=>{const r=[...e].sort((n,a)=>Date.parse(n.start)-Date.parse(a.start));return r.find(n=>Date.parse(n.end)>Date.parse(t))??r[0]};function B(e,t,r){const n=I(e.filter(a=>{const s=l(a.id);return s.calendarObjectId===t&&s.recurrenceId!==""}),r);return n?l(n.id):void 0}function P(e,t,r,n){const a=I(e.filter(s=>s.calendarObjectId===t&&j(s)).map(s=>x(s,"",n)),r);if(a)return{...l(a.id),calendarId:a.calendarId,date:a.start.slice(0,10)}}function S(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:w[e.color]??"cal-1",...e.source==="Subscribed"?{readOnly:!0,sync:e.subscriptionEnabled?"live":"paused",syncError:e.subscriptionError}:{}}}function x(e,t,r){return{id:z(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.allDay?e.start.slice(0,10):p(e.start,r),end:e.allDay?e.end.slice(0,10):p(e.end,r),allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:"accepted",threadId:"",threadSubject:"",timeZone:t,zoneCertainty:v[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const j=e=>e.status!=="Cancelled";function W(){const{data:e,isLoading:t,error:r}=g(T());return h.useMemo(()=>{const n=e?.items??[],a=n.map(S);return{calendars:a,collections:n,colorByCalendarId:Object.fromEntries(a.map(s=>[s.id,s.color])),timeZoneByCalendarId:Object.fromEntries(n.map(s=>[s.calendarId,s.timezone])),defaultCalendarId:(n.find(s=>s.source==="Default")??n[0])?.calendarId??"",isLoading:t,error:r??null}},[e,t,r])}export{C as U,F as a,M as b,z as c,R as d,u as e,k as f,L as g,p as h,j as i,P as j,l as r,B as s,x as t,W as u};
@@ -1 +1 @@
1
- import{r as o}from"./index-CVyiXes6.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-DyXh0uZR.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,eI as x,c as M,eJ as D,e1 as I,eK as N,h as v,eL as P,eM as L,eN as T,eO as w,bm as z}from"./index-CVyiXes6.js";const V=(e,t)=>{if(e.state==="Expired")return"Expired";const r=e.state==="Disabled"?"Disabled":"Active";if(e.scope!=="Temporary"||!e.expiresAt)return r;const s=Date.parse(e.expiresAt);return Number.isNaN(s)?r:s<=t?"Expired":r},y={UserDisabled:"Turned off. Turn it on to run it on new mail again.",AwaitingFolder:"Off until its folder exists on the mail server. It turns on by itself once the folder is created.",FolderCreateFailed:"Off: the mail server refused to create its folder. Pick another folder in the rule, then turn it on.",FolderMissing:"Off: the folder it moves mail into no longer exists. Pick another folder in the rule, then turn it on."},Y=e=>e.disabledReason==="None"?void 0:(e.disabledReason==="AwaitingFolder"||e.disabledReason==="FolderCreateFailed")&&e.actionMailboxId!=="None"?y.UserDisabled:y[e.disabledReason],G=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"})},A=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,n,i]=r,a=new Date(Number(s),Number(n)-1,Number(i),23,59,59,0);if(Number.isNaN(a.getTime()))return;const o=-t.getTimezoneOffset(),c=o>=0?"+":"-",u=Math.abs(o),d=String(Math.floor(u/60)).padStart(2,"0"),f=String(u%60).padStart(2,"0"),l=p=>String(p).padStart(2,"0");return`${a.getFullYear()}-${l(a.getMonth()+1)}-${l(a.getDate())}T${l(a.getHours())}:${l(a.getMinutes())}:${l(a.getSeconds())}${c}${d}:${f}`},h="None",X=e=>!e.literalClauses.some(t=>t.field==="HasWords"),E=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),Z=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",ee=({mode:e,ruleScope:t,anchorMessageId:r,clauses:s,matchOperator:n,moveMailboxId:i,until:a})=>({...e==="similar"&&r?{anchorMessageId:r}:{},matchOperator:n==="all"?"And":"Or",literalClauses:s.map(o=>({field:o.field,value:o.value})),moveMailboxId:i,expiresAt:t==="until"?A(a??""):void 0}),C=(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}:{}}),R=new Set(["Complete","Failed"]),O=e=>e!==void 0&&R.has(e),k=1e3,_=15e3,J=e=>{const t=Math.max(0,e),r=k*2**t;return Math.min(r,_)},$=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},te=e=>{const[t,r]=m.useState(),s=b({...x(),onSuccess:g=>r(g.organizeJobId)}),{mutate:n}=s,i=M({...D({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const F=g.state.data?.state;return O(F)?!1:J(g.state.dataUpdateCount)}}),a=m.useCallback(g=>{e&&n({path:{accountId:e},body:E(g)})},[e,n]),{refetch:o}=i,c=m.useCallback(()=>{o()},[o]),u=i.data,d=s.isPending?void 0:u,f=d?.state??s.data?.state,l=O(d?.state),p={state:f,matchedCount:d?.matchedCount??0,appliedCount:d?.appliedCount??0,failedCount:d?.failedCount??0,errorMessage:d?.errorMessage??""};return{start:a,refreshStatus:c,progress:p,isStarting:s.isPending,isRunning:!!t&&!l,isDone:l,failure:$(s.error,i.error,!!u)}},re=["From","Subject","HasWords","ListId","FromDomain"],U=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},se=(e,t)=>e==="ListId"?U(t):t.trim(),q=e=>e==="all"?"And":"Or",Q=(e,t)=>{const r=e.widen!==void 0&&!e.widen.inactive,s=e.clauses.map(n=>({field:n.field,value:n.value}));return{...r&&t?{anchorMessageId:t}:{},matchOperator:q(e.matchOperator),literalClauses:s}},K=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}`)}),ae=(e,t)=>{const r=Q(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?A(e.until??""):void 0}},B=(e,t)=>{if(e.error!==void 0&&e.errorSignature===t)return{status:"error",reason:e.error};if(e.count===void 0)return{status:"loading"};const r=e.indexEmpty===!0?{indexEmpty:!0}:{};return e.previewedSignature===t?{status:"ready",count:e.count,...r}:{status:"ready",count:e.count,stale:!0,...r}},H=350,ne=(e,t,r)=>{const s=b(I()),{mutateAsync:n}=s,i=j(t),[a,o]=m.useState(()=>({})),c=m.useRef(t);c.current=t;const u=m.useRef(i),d=K(t);return m.useEffect(()=>{if(!e||!d||i===a.previewedSignature||i===a.errorSignature)return;const f=setTimeout(()=>{const l=i;u.current=l,n({path:{accountId:e},body:E({...c.current})}).then(p=>{u.current===l&&o({count:p.matchedCount,matchedIds:p.messageIds,indexEmpty:p.semanticIndexEmpty===!0,previewedSignature:l})}).catch(p=>{u.current===l&&o(g=>({...g,error:p instanceof Error?p.message:"Couldn't count matches.",errorSignature:l}))})},H);return()=>clearTimeout(f)},[e,d,i,a.previewedSignature,a.errorSignature,n]),d?{count:B(a,i),matchedIds:a.previewedSignature===i?a.matchedIds??[]:[]}:{count:{status:"error",reason:N},matchedIds:[]}},S=e=>L({path:{accountId:e}}),ie=e=>{const t=M({...T({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},oe=e=>{const t=v(),r=b({...P(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:S(e)})}}),{mutate:s,mutateAsync:n}=r,i=m.useCallback((o,c,u)=>{e&&s({path:{accountId:e},body:C(o,c,u)})},[e,s]),a=m.useCallback(async(o,c,u)=>e?n({path:{accountId:e},body:C(o,c,u)}).then(()=>!0,()=>!1):!1,[e,n]);return{createFilter:i,createFilterAsync:a,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},le=e=>{const t=v(),r=b({...w(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:S(e)})}}),{mutate:s}=r;return{deleteFilter:m.useCallback(i=>{e&&s({path:{accountId:e,filterId:i}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}},ue=e=>{const t=v(),r=b({...z(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:S(e)})}}),{mutate:s,variables:n}=r,i=m.useCallback((o,c)=>{e&&s({path:{accountId:e,filterId:o},body:{state:c?"Active":"Disabled"}})},[e,s]),a=m.useCallback(()=>{n&&s(n)},[s,n]);return{toggleFilter:i,retry:a,togglingFilterId:r.isPending?n?.path.filterId:void 0,isError:r.isError,error:r.error,enabling:n?.body?.state==="Active"}};export{h as N,re as S,te as a,S as b,ae as c,Y as d,G as e,V as f,ie as g,le as h,ue as i,E as j,oe as k,ee as l,X as m,se as n,Z as o,A as p,Q as r,ne as u};
1
+ import{r as m,i as b,eI as x,c as M,eJ as D,e1 as I,eK as N,h as v,eL as P,eM as L,eN as T,eO as w,bm as z}from"./index-DyXh0uZR.js";const V=(e,t)=>{if(e.state==="Expired")return"Expired";const r=e.state==="Disabled"?"Disabled":"Active";if(e.scope!=="Temporary"||!e.expiresAt)return r;const s=Date.parse(e.expiresAt);return Number.isNaN(s)?r:s<=t?"Expired":r},y={UserDisabled:"Turned off. Turn it on to run it on new mail again.",AwaitingFolder:"Off until its folder exists on the mail server. It turns on by itself once the folder is created.",FolderCreateFailed:"Off: the mail server refused to create its folder. Pick another folder in the rule, then turn it on.",FolderMissing:"Off: the folder it moves mail into no longer exists. Pick another folder in the rule, then turn it on."},Y=e=>e.disabledReason==="None"?void 0:(e.disabledReason==="AwaitingFolder"||e.disabledReason==="FolderCreateFailed")&&e.actionMailboxId!=="None"?y.UserDisabled:y[e.disabledReason],G=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"})},A=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,n,i]=r,a=new Date(Number(s),Number(n)-1,Number(i),23,59,59,0);if(Number.isNaN(a.getTime()))return;const o=-t.getTimezoneOffset(),c=o>=0?"+":"-",u=Math.abs(o),d=String(Math.floor(u/60)).padStart(2,"0"),f=String(u%60).padStart(2,"0"),l=p=>String(p).padStart(2,"0");return`${a.getFullYear()}-${l(a.getMonth()+1)}-${l(a.getDate())}T${l(a.getHours())}:${l(a.getMinutes())}:${l(a.getSeconds())}${c}${d}:${f}`},h="None",X=e=>!e.literalClauses.some(t=>t.field==="HasWords"),E=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),Z=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",ee=({mode:e,ruleScope:t,anchorMessageId:r,clauses:s,matchOperator:n,moveMailboxId:i,until:a})=>({...e==="similar"&&r?{anchorMessageId:r}:{},matchOperator:n==="all"?"And":"Or",literalClauses:s.map(o=>({field:o.field,value:o.value})),moveMailboxId:i,expiresAt:t==="until"?A(a??""):void 0}),C=(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}:{}}),R=new Set(["Complete","Failed"]),O=e=>e!==void 0&&R.has(e),k=1e3,_=15e3,J=e=>{const t=Math.max(0,e),r=k*2**t;return Math.min(r,_)},$=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},te=e=>{const[t,r]=m.useState(),s=b({...x(),onSuccess:g=>r(g.organizeJobId)}),{mutate:n}=s,i=M({...D({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const F=g.state.data?.state;return O(F)?!1:J(g.state.dataUpdateCount)}}),a=m.useCallback(g=>{e&&n({path:{accountId:e},body:E(g)})},[e,n]),{refetch:o}=i,c=m.useCallback(()=>{o()},[o]),u=i.data,d=s.isPending?void 0:u,f=d?.state??s.data?.state,l=O(d?.state),p={state:f,matchedCount:d?.matchedCount??0,appliedCount:d?.appliedCount??0,failedCount:d?.failedCount??0,errorMessage:d?.errorMessage??""};return{start:a,refreshStatus:c,progress:p,isStarting:s.isPending,isRunning:!!t&&!l,isDone:l,failure:$(s.error,i.error,!!u)}},re=["From","Subject","HasWords","ListId","FromDomain"],U=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},se=(e,t)=>e==="ListId"?U(t):t.trim(),q=e=>e==="all"?"And":"Or",Q=(e,t)=>{const r=e.widen!==void 0&&!e.widen.inactive,s=e.clauses.map(n=>({field:n.field,value:n.value}));return{...r&&t?{anchorMessageId:t}:{},matchOperator:q(e.matchOperator),literalClauses:s}},K=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}`)}),ae=(e,t)=>{const r=Q(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?A(e.until??""):void 0}},B=(e,t)=>{if(e.error!==void 0&&e.errorSignature===t)return{status:"error",reason:e.error};if(e.count===void 0)return{status:"loading"};const r=e.indexEmpty===!0?{indexEmpty:!0}:{};return e.previewedSignature===t?{status:"ready",count:e.count,...r}:{status:"ready",count:e.count,stale:!0,...r}},H=350,ne=(e,t,r)=>{const s=b(I()),{mutateAsync:n}=s,i=j(t),[a,o]=m.useState(()=>({})),c=m.useRef(t);c.current=t;const u=m.useRef(i),d=K(t);return m.useEffect(()=>{if(!e||!d||i===a.previewedSignature||i===a.errorSignature)return;const f=setTimeout(()=>{const l=i;u.current=l,n({path:{accountId:e},body:E({...c.current})}).then(p=>{u.current===l&&o({count:p.matchedCount,matchedIds:p.messageIds,indexEmpty:p.semanticIndexEmpty===!0,previewedSignature:l})}).catch(p=>{u.current===l&&o(g=>({...g,error:p instanceof Error?p.message:"Couldn't count matches.",errorSignature:l}))})},H);return()=>clearTimeout(f)},[e,d,i,a.previewedSignature,a.errorSignature,n]),d?{count:B(a,i),matchedIds:a.previewedSignature===i?a.matchedIds??[]:[]}:{count:{status:"error",reason:N},matchedIds:[]}},S=e=>L({path:{accountId:e}}),ie=e=>{const t=M({...T({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},oe=e=>{const t=v(),r=b({...P(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:S(e)})}}),{mutate:s,mutateAsync:n}=r,i=m.useCallback((o,c,u)=>{e&&s({path:{accountId:e},body:C(o,c,u)})},[e,s]),a=m.useCallback(async(o,c,u)=>e?n({path:{accountId:e},body:C(o,c,u)}).then(()=>!0,()=>!1):!1,[e,n]);return{createFilter:i,createFilterAsync:a,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},le=e=>{const t=v(),r=b({...w(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:S(e)})}}),{mutate:s}=r;return{deleteFilter:m.useCallback(i=>{e&&s({path:{accountId:e,filterId:i}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}},ue=e=>{const t=v(),r=b({...z(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:S(e)})}}),{mutate:s,variables:n}=r,i=m.useCallback((o,c)=>{e&&s({path:{accountId:e,filterId:o},body:{state:c?"Active":"Disabled"}})},[e,s]),a=m.useCallback(()=>{n&&s(n)},[s,n]);return{toggleFilter:i,retry:a,togglingFilterId:r.isPending?n?.path.filterId:void 0,isError:r.isError,error:r.error,enabling:n?.body?.state==="Active"}};export{h as N,re as S,te as a,S as b,ae as c,Y as d,G as e,V as f,ie as g,le as h,ue as i,E as j,oe as k,ee as l,X as m,se as n,Z as o,A as p,Q as r,ne as u};
@@ -1 +1 @@
1
- import{c as L,eq as p,h as n,i as l,er as d,r as u,es as y,et as c,eu as g}from"./index-CVyiXes6.js";const o=e=>y({path:{accountId:e}}),f=e=>{const r=L({...p({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({...d(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:o(e)})}}),{mutateAsync:s}=t;return{createLabel:u.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:o(e)})}}),{mutate:s}=t;return{updateLabel:u.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:o(e)})}}),{mutate:s}=t;return{deleteLabel:u.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 L,eq as p,h as n,i as l,er as d,r as u,es as y,et as c,eu as g}from"./index-DyXh0uZR.js";const o=e=>y({path:{accountId:e}}),f=e=>{const r=L({...p({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({...d(),onSuccess:()=>{e&&r.invalidateQueries({queryKey:o(e)})}}),{mutateAsync:s}=t;return{createLabel:u.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:o(e)})}}),{mutate:s}=t;return{updateLabel:u.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:o(e)})}}),{mutate:s}=t;return{deleteLabel:u.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{c0 as s,c1 as e}from"./index-CVyiXes6.js";const i=768,r=t=>t!=="desktop",a=()=>{const t=s(`(min-width: ${i}px)`);return s(e)?"desktop":t?"tablet":"phone"};export{r as i,a as u};
1
+ import{c0 as s,c1 as e}from"./index-DyXh0uZR.js";const i=768,r=t=>t!=="desktop",a=()=>{const t=s(`(min-width: ${i}px)`);return s(e)?"desktop":t?"tablet":"phone"};export{r as i,a as u};
@@ -1 +1 @@
1
- import{r as a,u as M,cm as O,cn as N,cN as B,a9 as y,co as P,q as U,ab as $,h as D,c as F,cO as v,cC as L}from"./index-CVyiXes6.js";const w="/mail/brief/compose/{-$outboxMessageId}",R="/mail/flagged/compose/{-$outboxMessageId}",E="/mail/outbox/compose/{-$outboxMessageId}",k="/mail/$mailboxId/compose/{-$outboxMessageId}";function T(){const e=y({from:w,shouldThrow:!1}),t=y({from:R,shouldThrow:!1}),r=y({from:E,shouldThrow:!1}),s=y({from:k,shouldThrow:!1});return e??t??r??s}function j(){return T()!==void 0}function J(){return T()?.outboxMessageId}function _(e,t,r){return e==="flagged"?{to:R,params:{outboxMessageId:r}}:e==="outbox"?{to:E,params:{outboxMessageId:r}}:e==="mailbox"&&t?{to:k,params:{mailboxId:t,outboxMessageId:r}}:{to:w,params:{outboxMessageId:r}}}function g(){const e=M(),t=O(),{list:r,mailboxId:s}=N();return a.useCallback((n,o)=>{e({..._(r,s,n),search:B,hash:o?.keepPanels?!0:t,replace:o?.replace??!1})},[e,t,r,s])}function V(){const e=g();return a.useCallback(()=>e(void 0),[e])}function Z(){const e=g();return a.useCallback(t=>e(t),[e])}function ee(){const e=g();return a.useCallback(t=>e(t,{replace:!0,keepPanels:!0}),[e])}function te(){return P()}const q=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},b={all:["messages"],detail:e=>[...b.all,"detail",e],body:e=>[...b.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 K=e=>{const t=Number.parseInt(e??"",10);return!Number.isFinite(t)||t<=0?1:Math.min(t,30)},Q=8,I="x-remit-403-reason",X=(e,t)=>{const r=t?.trim()??"";return e===401?"auth":e===403?r.length>0?"auth":"body-missing":e===404?"body-missing":"generic"},G=(e,t)=>(t??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(e):!1,H=(e,t)=>{const r=(t??"").toLowerCase();return!!(e==="text"&&r.startsWith("text/html"))},W=async(e,t,r=async()=>null)=>{const s={},n=await r();n&&(s.Authorization=`Bearer ${n}`);const o=await L(e,{headers:s});if(o.status===202)throw new f("not-ready","Message body is still syncing",202,K(o.headers.get("Retry-After")));if(!o.ok){const l=o.headers.get(I),h=X(o.status,l);throw new f(h,`Failed to load message body (${o.status} ${o.statusText})`,o.status)}const c=o.headers.get("content-type");if(H(t,c))throw new f("content-type-mismatch",`Refusing to render message body — expected ${t}, got Content-Type ${c}`);const m=await o.text();if(G(m,c))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},z=async(e,t)=>(t.isRetryAfterNotReady&&await e.refetchDescribeMessage(),e.fetchContent(t.contentUrl,t.kind)),se=({messageId:e,bodyParts:t,enabled:r=!0})=>{const s=t?q(t):null,n=U(),{getToken:o}=$(),c=a.useRef(null),m=D(),l=a.useRef(!1),h=a.useRef(null),C=e&&s?`${e}:${s.contentUrl}`:null;h.current!==C&&(h.current=C,l.current=!1);const i=F({queryKey:e?[...b.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,z({fetchContent:(u,S)=>W(u,S,o),refetchDescribeMessage:()=>m.refetchQueries({queryKey:v({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<Q: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;a.useEffect(()=>{p&&(c.current=performance.now())},[p]),a.useEffect(()=>{i.isSuccess&&c.current!==null&&(n.recordTiming("message.body.load",Math.round(performance.now()-c.current)),c.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,j as a,se as b,X as c,J as d,ee as e,te as f,Z as g,V as u};
1
+ import{r as a,u as M,cm as O,cn as N,cN as B,a9 as y,co as P,q as U,ab as $,h as D,c as F,cO as v,cC as L}from"./index-DyXh0uZR.js";const w="/mail/brief/compose/{-$outboxMessageId}",R="/mail/flagged/compose/{-$outboxMessageId}",E="/mail/outbox/compose/{-$outboxMessageId}",k="/mail/$mailboxId/compose/{-$outboxMessageId}";function T(){const e=y({from:w,shouldThrow:!1}),t=y({from:R,shouldThrow:!1}),r=y({from:E,shouldThrow:!1}),s=y({from:k,shouldThrow:!1});return e??t??r??s}function j(){return T()!==void 0}function J(){return T()?.outboxMessageId}function _(e,t,r){return e==="flagged"?{to:R,params:{outboxMessageId:r}}:e==="outbox"?{to:E,params:{outboxMessageId:r}}:e==="mailbox"&&t?{to:k,params:{mailboxId:t,outboxMessageId:r}}:{to:w,params:{outboxMessageId:r}}}function g(){const e=M(),t=O(),{list:r,mailboxId:s}=N();return a.useCallback((n,o)=>{e({..._(r,s,n),search:B,hash:o?.keepPanels?!0:t,replace:o?.replace??!1})},[e,t,r,s])}function V(){const e=g();return a.useCallback(()=>e(void 0),[e])}function Z(){const e=g();return a.useCallback(t=>e(t),[e])}function ee(){const e=g();return a.useCallback(t=>e(t,{replace:!0,keepPanels:!0}),[e])}function te(){return P()}const q=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},b={all:["messages"],detail:e=>[...b.all,"detail",e],body:e=>[...b.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 K=e=>{const t=Number.parseInt(e??"",10);return!Number.isFinite(t)||t<=0?1:Math.min(t,30)},Q=8,I="x-remit-403-reason",X=(e,t)=>{const r=t?.trim()??"";return e===401?"auth":e===403?r.length>0?"auth":"body-missing":e===404?"body-missing":"generic"},G=(e,t)=>(t??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(e):!1,H=(e,t)=>{const r=(t??"").toLowerCase();return!!(e==="text"&&r.startsWith("text/html"))},W=async(e,t,r=async()=>null)=>{const s={},n=await r();n&&(s.Authorization=`Bearer ${n}`);const o=await L(e,{headers:s});if(o.status===202)throw new f("not-ready","Message body is still syncing",202,K(o.headers.get("Retry-After")));if(!o.ok){const l=o.headers.get(I),h=X(o.status,l);throw new f(h,`Failed to load message body (${o.status} ${o.statusText})`,o.status)}const c=o.headers.get("content-type");if(H(t,c))throw new f("content-type-mismatch",`Refusing to render message body — expected ${t}, got Content-Type ${c}`);const m=await o.text();if(G(m,c))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},z=async(e,t)=>(t.isRetryAfterNotReady&&await e.refetchDescribeMessage(),e.fetchContent(t.contentUrl,t.kind)),se=({messageId:e,bodyParts:t,enabled:r=!0})=>{const s=t?q(t):null,n=U(),{getToken:o}=$(),c=a.useRef(null),m=D(),l=a.useRef(!1),h=a.useRef(null),C=e&&s?`${e}:${s.contentUrl}`:null;h.current!==C&&(h.current=C,l.current=!1);const i=F({queryKey:e?[...b.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,z({fetchContent:(u,S)=>W(u,S,o),refetchDescribeMessage:()=>m.refetchQueries({queryKey:v({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<Q: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;a.useEffect(()=>{p&&(c.current=performance.now())},[p]),a.useEffect(()=>{i.isSuccess&&c.current!==null&&(n.recordTiming("message.body.load",Math.round(performance.now()-c.current)),c.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,j as a,se as b,X as c,J as d,ee as e,te as f,Z as g,V as u};
@@ -1 +1 @@
1
- import{c2 as Q,c3 as y,c4 as S,c5 as w,c6 as C,h as k,c7 as q,c8 as x,r as p,c9 as M,ca as H,cb as L,cc as P,cd as O,ce as B,cf as A}from"./index-CVyiXes6.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{c2 as Q,c3 as y,c4 as S,c5 as w,c6 as C,h as k,c7 as q,c8 as x,r as p,c9 as M,ca as H,cb as L,cc as P,cd as O,ce as B,cf as A}from"./index-DyXh0uZR.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,a0 as K,t as Q,f as U,r as o,aT as R,h as N,C as $,E as z,F as B,q as G,P as I,Q as X,R as V,S as J}from"./index-CVyiXes6.js";import{C as Y}from"./circle-check-big-ZWmAdG5O.js";import{R as Z}from"./refresh-cw-og-Ybvo3.js";import{u as P}from"./useQueries-CqQkOWRS.js";function ye({state:e,onRefresh:s,label:t,errorMessage:n,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",r=e==="error",h=e==="success",S=r?E.jsx(K,{className:"size-4 text-danger"}):h?E.jsx(Y,{className:"size-4 text-positive"}):E.jsx(Z,{className:Q("size-4",i&&"animate-spin")}),w=r?`${t} — failed: ${n??"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:S,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:r?n: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 F=3e3,te=F*2,C={syncing:!1,resolved:!1,synced:0,total:0};function we(e,s){const t=e.join(","),[n,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&&!n,refetchInterval:F,meta:{softError:!0}}))}),r=i.every(m=>m.isSuccess||m.isError),h=i.length===0||r||u;let S=!1,w=0,y=0;for(const m of i)if(L(m.data?.syncPhase)){S=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,y+=l.messagesTotal}const x=s&&h&&!S;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?C:{syncing:S,resolved:!0,synced:w,total:y}}const se=180*1e3,xe=30*1e3;let q=0;const M=new Set,re=(e=Date.now())=>{q=e+se;for(const s of M)s()},pe=(e=Date.now())=>e<q,Ee=e=>(M.add(e),()=>{M.delete(e)}),T=6e4,ne=new Set(["sent","drafts","trash","archive"]),_=(e,s)=>{const t=new Map;for(const n of e){const a=s.get(n.mailboxId)?.role;a&&ne.has(a)||t.set(n.mailboxId,n.highWaterMarkUid)}return t},j=(e,s)=>{const t=[];for(const[n,a]of s)a>(e.get(n)??0)&&t.push(n);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 be({accountIds:e,children:s}){const t=N(),{resultFolderIndex:n}=$(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,r]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:T,staleTime:T,meta:{softError:!0}}))}),S=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=_(b.mailboxes??[],n),v=c.current.get(d);if(c.current.set(d,g),v){const A=j(v,g);A.length>0&&z(t,B(A))}if(!u.current.has(d)){u.current.add(d),a.current.set(d,g);return}if(f.has(d))return;const W=a.current.get(d)??new Map;oe(W,g)&&(f.add(d),l=!0)}),l&&r(f)},[w,S]);const y=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{r(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,_(d?.mailboxes??[],n)),u.current.add(f)}},[t,n]),m=o.useMemo(()=>({hasNewMail:y,acknowledge:x}),[y,x]);return E.jsx(D.Provider,{value:m,children:s})}const ie=2e3,ce=45e3,ue=e=>new Promise(s=>setTimeout(s,e)),k=e=>e instanceof Error&&e.message?e.message:"Something went wrong",le=e=>{V(e,{softError:!0},"user")&&J(e)},O=(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:n=0,onInboxSynced:a,deadline:u,pollMs:c=ie})=>{let i=!1;for(;;){const r=await s().then(y=>({ok:!0,data:y})).catch(y=>({ok:!1,error:y}));if(!r.ok)return{accountId:e,message:k(r.error)};const{syncPhase:h,lastSyncAt:S}=r.data;if((S??0)>t&&!L(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(r.data)>n&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ue(c)}},de=async(e,s,t,n,a)=>{const u=await O(e,t).then(r=>({ok:!0,lastSyncAt:r.lastSyncAt??0,inboxSyncedAt:H(r)})).catch(r=>({ok:!1,error:r}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:k(u.error)};const c=await I({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(r=>({ok:!1,error:r}));if(!c.ok)return le(c.error),{accountId:t,enqueued:!1,ok:!1,message:k(c.error)};s.recordEvent("sync.triggered");const i=await fe({accountId:t,readStatus:()=>O(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:n});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},Re=(e,s={})=>{const t=N(),n=G(),{acknowledge:a}=ae(),[u,c]=o.useState("idle"),[i,r]=o.useState(),h=o.useRef(0),S=o.useRef(e);S.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 y=o.useCallback(()=>{const x=S.current;if(x.length===0){c("error"),r("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),r(void 0),re();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:X({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ce,d=await Promise.all(x.map(g=>de(t,n,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"),r(b[0]?.message))})()},[a,t,n]);return{state:u,errorMessage:i,refresh:y}};export{xe as H,be as M,ye as R,Re as a,L as b,we as c,pe as i,Ee as s,ae as u};
1
+ import{j as E,a0 as K,t as Q,f as U,r as o,aT as R,h as N,C as $,E as z,F as B,q as G,P as I,Q as X,R as V,S as J}from"./index-DyXh0uZR.js";import{C as Y}from"./circle-check-big-CFRFqxT6.js";import{R as Z}from"./refresh-cw-DWAbkoT3.js";import{u as P}from"./useQueries-DWGt2_77.js";function ye({state:e,onRefresh:s,label:t,errorMessage:n,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",r=e==="error",h=e==="success",S=r?E.jsx(K,{className:"size-4 text-danger"}):h?E.jsx(Y,{className:"size-4 text-positive"}):E.jsx(Z,{className:Q("size-4",i&&"animate-spin")}),w=r?`${t} — failed: ${n??"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:S,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:r?n: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 F=3e3,te=F*2,C={syncing:!1,resolved:!1,synced:0,total:0};function we(e,s){const t=e.join(","),[n,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&&!n,refetchInterval:F,meta:{softError:!0}}))}),r=i.every(m=>m.isSuccess||m.isError),h=i.length===0||r||u;let S=!1,w=0,y=0;for(const m of i)if(L(m.data?.syncPhase)){S=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,y+=l.messagesTotal}const x=s&&h&&!S;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?C:{syncing:S,resolved:!0,synced:w,total:y}}const se=180*1e3,xe=30*1e3;let q=0;const M=new Set,re=(e=Date.now())=>{q=e+se;for(const s of M)s()},pe=(e=Date.now())=>e<q,Ee=e=>(M.add(e),()=>{M.delete(e)}),T=6e4,ne=new Set(["sent","drafts","trash","archive"]),_=(e,s)=>{const t=new Map;for(const n of e){const a=s.get(n.mailboxId)?.role;a&&ne.has(a)||t.set(n.mailboxId,n.highWaterMarkUid)}return t},j=(e,s)=>{const t=[];for(const[n,a]of s)a>(e.get(n)??0)&&t.push(n);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 be({accountIds:e,children:s}){const t=N(),{resultFolderIndex:n}=$(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,r]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:T,staleTime:T,meta:{softError:!0}}))}),S=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=_(b.mailboxes??[],n),v=c.current.get(d);if(c.current.set(d,g),v){const A=j(v,g);A.length>0&&z(t,B(A))}if(!u.current.has(d)){u.current.add(d),a.current.set(d,g);return}if(f.has(d))return;const W=a.current.get(d)??new Map;oe(W,g)&&(f.add(d),l=!0)}),l&&r(f)},[w,S]);const y=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{r(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,_(d?.mailboxes??[],n)),u.current.add(f)}},[t,n]),m=o.useMemo(()=>({hasNewMail:y,acknowledge:x}),[y,x]);return E.jsx(D.Provider,{value:m,children:s})}const ie=2e3,ce=45e3,ue=e=>new Promise(s=>setTimeout(s,e)),k=e=>e instanceof Error&&e.message?e.message:"Something went wrong",le=e=>{V(e,{softError:!0},"user")&&J(e)},O=(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:n=0,onInboxSynced:a,deadline:u,pollMs:c=ie})=>{let i=!1;for(;;){const r=await s().then(y=>({ok:!0,data:y})).catch(y=>({ok:!1,error:y}));if(!r.ok)return{accountId:e,message:k(r.error)};const{syncPhase:h,lastSyncAt:S}=r.data;if((S??0)>t&&!L(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(r.data)>n&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ue(c)}},de=async(e,s,t,n,a)=>{const u=await O(e,t).then(r=>({ok:!0,lastSyncAt:r.lastSyncAt??0,inboxSyncedAt:H(r)})).catch(r=>({ok:!1,error:r}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:k(u.error)};const c=await I({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(r=>({ok:!1,error:r}));if(!c.ok)return le(c.error),{accountId:t,enqueued:!1,ok:!1,message:k(c.error)};s.recordEvent("sync.triggered");const i=await fe({accountId:t,readStatus:()=>O(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:n});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},Re=(e,s={})=>{const t=N(),n=G(),{acknowledge:a}=ae(),[u,c]=o.useState("idle"),[i,r]=o.useState(),h=o.useRef(0),S=o.useRef(e);S.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 y=o.useCallback(()=>{const x=S.current;if(x.length===0){c("error"),r("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),r(void 0),re();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:X({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ce,d=await Promise.all(x.map(g=>de(t,n,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"),r(b[0]?.message))})()},[a,t,n]);return{state:u,errorMessage:i,refresh:y}};export{xe as H,be as M,ye as R,Re as a,L as b,we as c,pe as i,Ee as s,ae as u};
@@ -1 +1 @@
1
- import{K as r,r as s,b7 as t}from"./index-CVyiXes6.js";import{u as m}from"./useQueries-CqQkOWRS.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{K as r,r as s,b7 as t}from"./index-DyXh0uZR.js";import{u as m}from"./useQueries-DWGt2_77.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};
@@ -0,0 +1,84 @@
1
+ import{r as p,j as a,ct as ee,t as y,I as te,h as se,at as re,i as ne,av as ae,cO as oe,bS as ie,ab as ce,a0 as le,X as de,d6 as D,d7 as F,C as ue,cn as me}from"./index-DyXh0uZR.js";import{K as S}from"./kbd-BZqsDz_U.js";import{B as fe,b as he}from"./useMessageBodyContent-BAKTxkDn.js";import{i as ge}from"./search-scope-B5-OK3Cq.js";const pe='"Geist Variable", "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',A={light:{fg:"oklch(0.3 0.025 235)",canvas:"oklch(0.96 0.015 90)",accent:"oklch(0.55 0.14 150)"},dark:{fg:"oklch(0.88 0.02 90)",canvas:"oklch(0.22 0.025 220)",accent:"oklch(0.78 0.16 150)"}},be={background:!1,spacing:!1},ye="16px",xe=()=>`html{padding:0}body{padding:${ye};box-sizing:border-box}`,we=()=>"html{overflow:hidden}body{overflow-x:auto}",ve=/prefers-color-scheme\s*:\s*dark|color-scheme\s*:\s*[^;}"']*\bdark\b/i,ke='<meta name="viewport" content="width=device-width, initial-scale=1">',Ae=e=>{const t=e?A.dark:A.light;return`
2
+ /* Plain-email base: UI font-stack + theme-aware colors (#424) */
3
+ html, body {
4
+ font-family: ${pe};
5
+ font-size: 14px;
6
+ line-height: 1.6;
7
+ color: ${t.fg};
8
+ background-color: ${t.canvas};
9
+ margin: 0;
10
+ padding: 0;
11
+ }
12
+ /* Strip author unreadable text colors and element backgrounds, scoped to body
13
+ descendants so the themed html/body surface above survives this reset. */
14
+ body * {
15
+ color: inherit !important;
16
+ background-color: transparent !important;
17
+ }
18
+ a, a:visited {
19
+ color: ${t.accent} !important;
20
+ text-decoration: underline;
21
+ }
22
+ `},N="invert(0.92) hue-rotate(180deg)",j=`img,picture,video,svg,canvas,[style*='background-image'],[background]{filter:${N}}`,Se=(e,t,s)=>{const r=e?A.dark.canvas:A.light.canvas;return s?e?t?`html,body{margin:0;background-color:${r};color-scheme:dark light}`:`html{margin:0;background-color:#ffffff;filter:${N}}body{margin:0}${j}`:"html,body{margin:0;background-color:#ffffff;color-scheme:light}":e?t?`html,body{margin:0;background-color:${r};color-scheme:dark light}`:`html{margin:0;background-color:${r}}body{margin:0;filter:${N}}${j}`:`html,body{margin:0;background-color:${r};color-scheme:light}`},Ee=(e,t,s,r=be)=>{const n=t==="plain"?Ae(s):Se(s,ve.test(e),r.background),o=r.spacing?"":xe();return`${ke}<style>${n}</style>${e}<style>${we()}${o}</style>`},R=5e4,Ne="allow-same-origin allow-popups allow-popups-to-escape-sandbox",L=(e,t,s)=>Math.min(Math.ceil(Math.max(e,t)),s),T=.5,_=(e,t)=>t>0&&e>t+1?Math.max(t/e,T):1,Te=["box-sizing","width","max-width","transform","transform-origin","margin-bottom","overflow-x"],Ce=e=>{for(const i of Te)e.style.removeProperty(i);const t=e.clientWidth,s=e.scrollWidth;if(_(s,t)===1)return 1;const r=(i,h)=>e.style.setProperty(i,h,"important");r("box-sizing","border-box"),r("max-width","none"),r("width",`${s}px`);const n=Math.max(s,e.scrollWidth),o=_(n,t);return o>T?r("overflow-x","visible"):r("width",`${t/T}px`),r("transform-origin","0 0"),r("transform",`scale(${o})`),r("margin-bottom",`${-e.offsetHeight*(1-o)}px`),o},je=new Set(["Enter","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),Re=e=>e===" "?!1:e.length===1?!0:je.has(e),E=e=>{if(e.metaKey||e.ctrlKey||e.altKey||!Re(e.key))return;const t=e.currentTarget??e.target,s=t?.defaultView?.parent;!s||s===t?.defaultView||s.dispatchEvent(new KeyboardEvent("keydown",{key:e.key,code:e.code,shiftKey:e.shiftKey,bubbles:!0,cancelable:!0}))},I=({html:e,variant:t="framed",isDark:s=!1,declares:r,className:n})=>{const o=p.useRef(null),[i,h]=p.useState(0),c=p.useMemo(()=>Ee(e,t,s,r),[e,t,s,r]);return p.useEffect(()=>{const l=o.current;if(!l)return;const d=()=>{const m=l.contentDocument;if(!m?.body)return;const v=m.documentElement,x=Ce(m.body)<1?L(m.body.getBoundingClientRect().height,0,R):L(m.body.scrollHeight,v?.scrollHeight??0,R);h(k=>k===x?k:x)};let f=0;const b=()=>{cancelAnimationFrame(f),f=requestAnimationFrame(d)};let g,u;const w=()=>{d(),g?.disconnect(),g=void 0,u?.removeEventListener("keydown",E),u?.removeEventListener("load",d,!0),u=void 0;const m=l.contentDocument;m?.body&&(g=new ResizeObserver(b),g.observe(m.body),m.documentElement&&g.observe(m.documentElement),m.addEventListener("load",d,!0),m.fonts?.ready.then(d),m.addEventListener("keydown",E),u=m)};return l.addEventListener("load",w),()=>{l.removeEventListener("load",w),u?.removeEventListener("keydown",E),u?.removeEventListener("load",d,!0),g?.disconnect(),cancelAnimationFrame(f)}},[]),a.jsx("iframe",{ref:o,title:"Email content",sandbox:Ne,srcDoc:c,className:n,style:{width:"100%",border:"none",display:"block",height:i===0?"1px":`${i}px`,colorScheme:"normal"}})},Le=(e,t)=>{const r=e==="newsletter"||e==="marketing"||t;return{framed:r,isPlain:!r}},_e=()=>`
23
+ /* Zero the UA default body margin and clamp the document to the iframe width so
24
+ wide author markup can't push the body (and the page) past the viewport. */
25
+ html, body {
26
+ margin: 0;
27
+ padding: 0;
28
+ max-width: 100%;
29
+ }
30
+ body {
31
+ overflow-wrap: anywhere;
32
+ word-break: break-word;
33
+ }
34
+ /* Media never wider than the frame; keep aspect ratio when width is capped. */
35
+ img, video, iframe, svg, canvas {
36
+ max-width: 100% !important;
37
+ height: auto;
38
+ }
39
+ /* Fixed-width author tables (\`<table width="600">\`) collapse to fit. */
40
+ table {
41
+ max-width: 100% !important;
42
+ table-layout: auto;
43
+ }
44
+ /* Cells carry the fixed widths in real newsletters (\`<td width="600">\`);
45
+ cap them too or the table can't actually shrink. */
46
+ td, th {
47
+ max-width: 100% !important;
48
+ }
49
+ /* \`max-width\` alone can't beat an inline \`min-width\`; zeroing the min lets
50
+ flex / grid / table children actually collapse to the clamped width. */
51
+ * {
52
+ min-width: 0;
53
+ }
54
+ /* An author \`nowrap\` assumes a viewport as wide as the line. The frame is the
55
+ pane's width whatever the mail is, so a pinned paragraph turns reading one
56
+ sentence into a sideways drag — and inside an author \`overflow:hidden\` it is
57
+ cut mid-character with nothing left to scroll at all. Flowing text wraps. The
58
+ \`i\` flag is load-bearing: Outlook and older generators emit \`WHITE-SPACE:
59
+ NOWRAP\`, and an attribute value match is case-sensitive without it. */
60
+ [nowrap]:not(pre, code, pre *, code *),
61
+ [style*="nowrap" i]:not(pre, code, pre *, code *) {
62
+ white-space: normal !important;
63
+ }
64
+ /* Long unbroken strings (URLs, tokens) wrap instead of forcing a wide line. */
65
+ pre, code {
66
+ white-space: pre-wrap;
67
+ overflow-wrap: anywhere;
68
+ word-break: break-word;
69
+ }
70
+ /* Preformatted text keeps its spacing even where a nowrap is declared — on the
71
+ block or on a span inside it. \`normal\` would collapse the runs of spaces that
72
+ are the entire content of a \`pre\`, and the un-important rule above cannot
73
+ defend an inline style, so this wraps to \`pre-wrap\` instead of unwrapping. */
74
+ :is(pre, code, pre *, code *):is([nowrap], [style*="nowrap" i]) {
75
+ white-space: pre-wrap !important;
76
+ }
77
+ `,Ie=e=>{const t=new Map;for(const s of e){if(!s.contentId||s.contentUrl.length===0)continue;const r=s.contentId.replace(/^<|>$/g,"");t.set(r,s.contentUrl)}return s=>t.get(s.replace(/^<|>$/g,""))},$e=/^(none|transparent|inherit|initial|unset)\s*$/i,P=e=>{const t=[],s=/<style[^>]*>([\s\S]*?)<\/style>/gi;let r;for(r=s.exec(e);r!==null;)t.push(r[1]),r=s.exec(e);return t},Oe=e=>{const t=/background(?:-color)?\s*:\s*([^;}\n]+)/gi;let s;for(s=t.exec(e);s!==null;){const r=s[1].trim();if(!$e.test(r))return!0;s=t.exec(e)}return!1},Me=e=>{if(/\bstyle\s*=\s*["'][^"']*background/i.test(e)||/\bbgcolor\s*=/i.test(e))return!0;for(const t of P(e))if(Oe(t))return!0;return!1},Be=new Set(["auto","none","initial","inherit","unset","revert","revert-layer"]),De=new RegExp(`(?<![-\\w])(?:padding|margin)(?:-(top|right|bottom|left|block|inline)(?:-(?:start|end))?)?\\s*:\\s*([^;}"']+)`,"gi"),Fe=new Set(["top","bottom","block"]),z=e=>e.replace(/\/\*[\s\S]*?\*\//g,""),$=e=>{const t=e.toLowerCase();if(!t||Be.has(t)||t.startsWith("-"))return!1;const s=/^\+?(\d*\.?\d+)[a-z%]*$/.exec(t);return s?Number.parseFloat(s[1])!==0:!0},Pe=e=>{const t=e.split(/\s+/).filter(Boolean);return t.length<2?t:t.length<4?[t[1]]:[t[1],t[3]]},ze=(e,t)=>{if(e&&Fe.has(e))return!1;const s=t.replace(/!\s*important/gi,"").trim();return s?e?s.split(/\s+/).some($):Pe(s).some($):!1},O=e=>{for(const t of z(e).matchAll(De))if(ze(t[1],t[2]))return!0;return!1},K=new Set(["blockquote"]),Ke=e=>e.replace(/<!--[\s\S]*?-->/g,""),He=e=>{const t=[],s=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,r=/\bstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;for(const[,n,o]of e.matchAll(s))for(const i of o.matchAll(r))t.push({tag:n.toLowerCase(),style:i[1]??i[2]??""});return t},Ge=e=>[...z(e).matchAll(/([^{}]*)\{([^{}]*)\}/g)].map(t=>({selector:t[1].trim(),body:t[2]})),Ue=e=>{const t=e.trim().split(/[\s>+~]+/).pop()??"";return(/^[a-zA-Z][\w-]*/.exec(t)?.[0]??"").toLowerCase()},We=e=>e.split(",").every(t=>K.has(Ue(t))),Ve=e=>{const t=P(e),s=Ke(e);if(/\bcellpadding\s*=\s*["']?(?!0["'\s>])\d/i.test(s))return!0;for(const{tag:r,style:n}of He(s))if(!K.has(r)&&O(n))return!0;for(const r of t)for(const n of Ge(r))if(!We(n.selector)&&O(n.body))return!0;return!1},Qe=["script","iframe","object","embed","form","input","button","textarea","select","meta","link","base"],qe=["onerror","onload","onclick","onmouseover","onmouseout","onfocus","onblur","onsubmit","onkeydown","onkeyup","formaction","xlink:href","data-bind"],Ye="data:image/svg+xml,"+encodeURIComponent(`
78
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
79
+ <rect fill="#f0f0f0" width="100" height="100"/>
80
+ <text x="50" y="50" text-anchor="middle" dy=".3em" fill="#999" font-size="12">
81
+ Image blocked
82
+ </text>
83
+ </svg>
84
+ `),Xe=e=>e.replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Ze=e=>e.replace(/@import[^;]*;/gi,"/* @import blocked */").replace(/url\s*\([^)]*\)/gi,"none").replace(/expression\s*\([^)]*\)/gi,"").replace(/-moz-binding\s*:[^;]*/gi,""),Je=(e={})=>{const t=ee(),s={FORBID_TAGS:Qe,FORBID_ATTR:qe,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1};return t.addHook("afterSanitizeAttributes",r=>{if(e.allowExternalImages||(r.tagName==="IMG"&&r.removeAttribute("srcset"),r.tagName==="SOURCE"&&(r.removeAttribute("srcset"),r.removeAttribute("src")),r.tagName==="VIDEO"&&r.removeAttribute("poster")),r.tagName==="IMG"){const n=r.getAttribute("src")||"";if(n.startsWith("data:"))return;if(n.startsWith("cid:")){const i=n.slice(4).replace(/^<|>$/g,""),h=e.resolveCid?.(i);h&&(r.setAttribute("src",h),r.classList.add("inline-content"));return}e.allowExternalImages||(r.setAttribute("data-blocked-src",n),r.setAttribute("src",Ye),r.setAttribute("alt","[Blocked image]"),r.classList.add("blocked-image"))}if(r.tagName==="A"){const n=r.getAttribute("href")||"";if(/^(javascript|data):/i.test(n)){r.removeAttribute("href");return}r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer nofollow"),r.classList.add("external-link")}if(r.hasAttribute("style")){const n=r.getAttribute("style")||"";r.setAttribute("style",Xe(n))}}),t.addHook("uponSanitizeElement",(r,n)=>{if(n.tagName==="style"){const o=r.textContent||"";r.textContent=Ze(o)}}),r=>{const n=Me(r),o=Ve(r),i=t.sanitize(r,s);return{html:`<style>${_e()}</style>${i}`,hasAuthorBackground:n,hasAuthorSpacing:o}}},M=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),jt=({className:e,children:t})=>a.jsx("div",{className:y("[&_.message-body-frame]:-mx-2 lg:[&_.message-body-frame]:-mx-4",e),children:t}),et=({html:e,text:t,isDark:s=!1,category:r,allowImages:n=!1,resolveCid:o,className:i,renderBlockedNotice:h})=>{const c=p.useMemo(()=>!e||typeof document>"u"?null:Je({allowExternalImages:n,resolveCid:o})(e),[e,n,o]),l=c?.html??null,{framed:d,isPlain:f}=Le(r,c?.hasAuthorBackground??!1),b=p.useMemo(()=>({background:c?.hasAuthorBackground??!1,spacing:c?.hasAuthorSpacing??!1}),[c?.hasAuthorBackground,c?.hasAuthorSpacing]),g=p.useMemo(()=>!l||n?0:(l.match(/data-blocked-src/g)||[]).length,[l,n]);return!l&&!t?a.jsx("div",{className:y("message-body",i),children:a.jsx(M,{})}):a.jsxs("div",{className:y("message-body",i),children:[g>0&&a.jsx("div",{children:h?.(g)}),l?a.jsx("div",{className:"message-body-frame",children:d?a.jsx("div",{className:"w-full max-w-full",children:a.jsx(I,{html:l,variant:"framed",isDark:s,declares:b})}):a.jsx("div",{className:"max-w-full lg:max-w-2xl",children:a.jsx(I,{html:l,variant:f?"plain":"framed",isDark:s,declares:b})})}):t?a.jsx("pre",{className:"email-text whitespace-pre-wrap text-sm leading-relaxed",children:t}):a.jsx(M,{})]})};function Rt({message:e="Select a thread to read",icon:t,showHints:s=!0,className:r}){return a.jsxs("div",{className:y("flex flex-1 flex-col items-center justify-center text-center",r),children:[t??a.jsx(te,{className:"size-10 text-fg-subtle"}),a.jsx("p",{className:"mt-3 text-sm text-fg-muted",children:e}),s&&a.jsxs("p",{className:"text-2xs text-fg-subtle",children:[a.jsx(S,{children:"j"})," / ",a.jsx(S,{children:"k"})," to move, ",a.jsx(S,{children:"Enter"})," to open"]})]})}function H(e){const t=[];let s=-1,r=!1;for(let n=0;n<e.length;n++){const o=e[n];if(o==='"'){r=!r,s<0&&(s=n);continue}if(!r&&/\s/.test(o)){s>=0&&t.push({raw:e.slice(s,n),start:s,end:n}),s=-1;continue}s<0&&(s=n)}return s>=0&&t.push({raw:e.slice(s),start:s,end:e.length}),t}const tt=e=>{if(!e.startsWith('"'))return e;const t=e.slice(1);return t.endsWith('"')?t.slice(0,-1):t};function st(e){const t=e.indexOf(":");if(t<=0)return;const s=e.slice(t+1);return{name:e.slice(0,t).toLowerCase(),value:tt(s),rawValue:s}}const rt=e=>/[\s"]/.test(e),nt=e=>rt(e)?`"${e.replace(/"/g,"")}"`:e,Lt=(e,t)=>`${e}:${nt(t)}`,G=(e,t=Date.now())=>({value:e,setAt:t}),at=(e,t,s,r)=>{if(e.addressId!==t)return e;const n={...e.flags??{}};return s?n.trusted=G(!0,r):delete n.trusted,{...e,flags:n}},ot=(e,t,s,r)=>{const n=o=>o.map(i=>at(i,t,s,r));return{...e,envelope:{...e.envelope,from:n(e.envelope.from),to:n(e.envelope.to),cc:n(e.envelope.cc),bcc:n(e.envelope.bcc),replyTo:n(e.envelope.replyTo)}}},it=({messageId:e})=>{const t=se(),{pushError:s}=re(),{mutate:r,isPending:n,error:o,reset:i}=ne({...ie(),onMutate:async c=>{const l=c.path.addressId,f=c.body.flags?.trusted?.value===!0,b=oe({path:{messageId:e}});await t.cancelQueries({queryKey:b});const g=t.getQueriesData({queryKey:b}).filter(u=>u[1]!==void 0).map(([u,w])=>({queryKey:u,data:w}));return t.setQueriesData({queryKey:b},u=>u&&ot(u,l,f)),{describePrefix:b,previous:g}},onError:(c,l,d)=>{if(d)for(const f of d.previous)t.setQueryData(f.queryKey,f.data);s(ae("Couldn't trust sender","The change wasn't saved.",c))},onSettled:(c,l,d,f)=>{f&&t.invalidateQueries({queryKey:f.describePrefix})}});return{toggleTrusted:(c,l)=>{r({path:{addressId:c},body:{flags:{trusted:G(!l)}}})},isPending:n,error:o,reset:i}},ct=()=>{const[e,t]=p.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark"));return p.useEffect(()=>{const s=document.documentElement,r=new MutationObserver(()=>{t(s.classList.contains("dark"))});return r.observe(s,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e},lt=(e,t)=>{const s=`${e} image${e>1?"s":""}`;return t?`${s} hidden — you blocked this sender`:`${s} blocked for privacy`},dt=({blockedImageCount:e,canAlwaysTrust:t,isTrustPending:s,isSenderBlocked:r,onLoadOnce:n,onAlwaysTrust:o})=>a.jsxs("div",{"data-testid":"blocked-images-notice",className:"mb-3 flex items-center justify-between rounded-md bg-surface-sunken/50 px-3 py-2 text-sm",children:[a.jsx("span",{className:"text-fg-muted",children:lt(e,r)}),!r&&a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{type:"button",onClick:n,className:"text-accent hover:underline",children:"Load once"}),t&&a.jsx("button",{type:"button",onClick:o,"aria-busy":s,className:"text-accent hover:underline aria-busy:opacity-50",children:s?"Trusting…":"Always trust"})]})]}),ut=(e,t)=>{switch(e){case"auth":return{title:"Your session expired",detail:"Sign in again to reload the message body. Other parts of the app may also stop responding until you do."};case"body-missing":return{title:"Message body is missing in storage",detail:"A sync failure may have left this message without its body bytes. Contact support, or run the reconcile script to refetch from the upstream IMAP server."};case"content-type-mismatch":return{title:"Couldn't load message body",detail:"The server returned an unexpected content type for this part. The message body has not been rendered to keep you safe."};case"spa-shell-leak":return{title:"Couldn't load message body",detail:"The server returned the app shell instead of the message body. This is an infrastructure bug — please report it."};case"not-ready":return{title:"Message body is still syncing",detail:"This message's body hasn't finished downloading from the mail server yet. It should appear shortly — reopen the message to try again."};default:return{title:"Couldn't load message body",detail:t}}},mt=e=>e instanceof fe?e.reason:"generic",ft=e=>e instanceof Error?e.message:typeof e=="string"?e:"An unexpected error occurred while loading the message body.",ht=({error:e,onRetry:t})=>{const s=mt(e),r=ft(e),{title:n,detail:o}=ut(s,r),[i,h]=p.useState(!1),{Account:c}=ce();return i?null:a.jsxs("div",{role:"alert","data-testid":"message-body-error-banner","data-reason":s,className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",children:[a.jsx(le,{className:"size-4 shrink-0 text-danger mt-0.5","aria-hidden":"true"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"font-medium text-danger",children:n}),a.jsx("p",{className:"text-fg-muted mt-1 break-words",children:o})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[s==="auth"&&a.jsx(c,{children:({signOut:l})=>a.jsx("button",{type:"button",onClick:()=>l(),className:"text-sm font-medium text-accent hover:underline",children:"Sign in again"})}),t&&a.jsx("button",{type:"button",onClick:t,className:"text-sm font-medium text-accent hover:underline",children:"Retry"}),a.jsx("button",{type:"button",onClick:()=>h(!0),"aria-label":"Dismiss message body error",className:"rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors",children:a.jsx(de,{className:"size-4","aria-hidden":"true"})})]})]})},gt=()=>a.jsxs("div",{className:"animate-pulse space-y-2",role:"status","aria-label":"Loading message body",children:[a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-11/12"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"}),a.jsx("div",{className:"h-4 bg-surface-sunken rounded w-5/6"})]}),B=()=>a.jsx("p",{className:"text-fg-muted text-sm italic",children:"This message has no body content."}),_t=({bodyParts:e,html:t,text:s,isTrusted:r=!1,isBlocked:n=!1,messageId:o,fromAddressId:i,category:h,className:c})=>{const[l,d]=p.useState(!1),[f,b]=p.useState(o);f!==o&&(b(o),d(!1));const g=!n&&(r||l),u=ct(),{toggleTrusted:w,isPending:m}=it({messageId:o??""}),v=!!e&&e.length>0,{picked:C,data:x,isLoading:k,isError:U,error:W,refetch:V}=he({messageId:o,bodyParts:e,enabled:v}),Q=p.useMemo(()=>Ie(e??[]),[e]),q=v&&x?.kind==="html"?x.body:t,Y=v&&x?.kind==="text"?x.body:s;if(v){if(k)return a.jsx("div",{className:y("message-body",c),children:a.jsx(gt,{})});if(U)return a.jsx("div",{className:y("message-body",c),children:a.jsx(ht,{error:W,onRetry:()=>V()})});if(!C)return a.jsx("div",{className:y("message-body",c),children:a.jsx(B,{})})}else if(!t&&!s)return a.jsx("div",{className:y("message-body",c),children:a.jsx(B,{})});const X=!!(i&&o),Z=()=>{!i||m||(d(!0),w(i,!1))};return a.jsx(et,{className:c,html:q,text:Y,isDark:u,category:h,allowImages:g,resolveCid:Q,renderBlockedNotice:J=>a.jsx(dt,{blockedImageCount:J,canAlwaysTrust:X,isTrustPending:m,isSenderBlocked:n,onLoadOnce:()=>d(!0),onAlwaysTrust:Z})})},pt=Object.values(D).map(e=>({value:e,label:F[e]})),bt={unclassified:"uncategorized"},yt=[{name:"from",label:"Sender",values:"contact"},{name:"subject",label:"Subject",values:"text"},{name:"category",label:"Category",values:"fixed",options:pt},{name:"is",label:"State",values:"fixed",options:[{value:"unread",label:"Unread"},{value:"read",label:"Read"},{value:"starred",label:"Starred"}]},{name:"has",label:"Contents",values:"fixed",options:[{value:"attachment",label:"Has attachment"}]},{name:"in",label:"Folder",values:"mailbox"},{name:"account",label:"Account",values:"account"},{name:"after",label:"Sent on or after",values:"date"},{name:"before",label:"Sent before",values:"date"}],xt=new Map(yt.map(e=>[e.name,e])),It=e=>xt.get(e.toLowerCase()),wt=/^\d{4}-\d{2}-\d{2}$/;function vt(e,t,s){if(!wt.test(s))return;const r=Date.parse(`${s}T00:00:00Z`);if(!Number.isNaN(r))return{type:e,raw:t,value:s,epochSeconds:Math.floor(r/1e3)}}function kt(e){const t=e.toLowerCase(),s=bt[t];return s||Object.values(D).find(n=>n===t)}function At(e,t){switch(t.toLowerCase()){case"unread":return{type:"isUnread",raw:e};case"read":return{type:"isRead",raw:e};case"starred":case"flagged":return{type:"isStarred",raw:e};default:return}}function St(e,t){const s=st(e);if(!s||s.value.length===0)return;const{name:r,value:n}=s;switch(r){case"from":return{type:"from",raw:e,value:n};case"subject":return{type:"subject",raw:e,value:n};case"category":{const o=kt(n);return o?{type:"category",raw:e,value:n,category:o}:void 0}case"is":return At(e,n);case"has":return n.toLowerCase()==="attachment"?{type:"hasAttachment",raw:e}:void 0;case"before":case"after":return vt(r,e,n);case"in":{const o=t.mailboxesByName?.get(n.toLowerCase());return o?{type:"in",raw:e,value:n,mailboxId:o}:void 0}case"account":{const o=t.accountsByName?.get(n.toLowerCase());return o?{type:"account",raw:e,value:n,accountId:o}:void 0}default:return}}function $t(e,t={}){const s=[],r=[];for(const n of H(e)){const o=St(n.raw,t);o?s.push(o):r.push(n.raw)}return{freeText:r.join(" "),tokens:s}}function Ot(e,t){return H(e).filter(s=>s.raw!==t.raw).map(s=>s.raw).join(" ")}function Mt(e){switch(e.type){case"from":return`From: ${e.value}`;case"subject":return`Subject: ${e.value}`;case"category":return`Category: ${F[e.category]}`;case"hasAttachment":return"Has attachment";case"isUnread":return"Unread";case"isRead":return"Read";case"isStarred":return"Starred";case"before":return`Before ${e.value}`;case"after":return`After ${e.value}`;case"in":return`In: ${e.value}`;case"account":return`Account: ${e.value}`}}function Bt(){const{mailboxNameIndex:e,accountNameIndex:t}=ue(),s=me();return{...ge(s)?{}:{mailboxesByName:e},accountsByName:t}}export{jt as M,Rt as R,yt as S,et as a,it as b,_t as c,It as d,H as e,st as f,Lt as g,$t as p,Ot as r,Mt as s,Bt as u};
@@ -1 +1 @@
1
- import{h as L,at as M,i as k,E as I,F as E,cy as A,em as R,r as v,dy as j,j as p,en as h,eo as w,ep as D,C as _,cn as N,c as Q,dT as z,d6 as O}from"./index-CVyiXes6.js";import{c as U}from"./popover-menu-Bmzk7h6e.js";import{aj as q}from"./MailListHeader-KM5hxzzQ.js";import{a as P}from"./useLabels-CEOAQRXe.js";import{n as B}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-V_0MB9r5.js";const ne=e=>{const t=new Set;for(const s of e)s&&t.add(s);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}},K=e=>{const{mailboxId:t,messages:s}=e,n=L(),{pushError:l}=M(),{mutateAsync:c,isPending:a}=k({...R(),onError:(r,u)=>{l({title:u.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:A(r),error:r})},onSettled:(r,u,d)=>{I(n,E(q(d.body.messageIds??[],s??[],t)))}});return{applyLabel:v.useCallback((r,u,d)=>{r.length!==0&&j(r,m=>c({body:{messageIds:m,labelId:u,action:d}}))},[c]),isPending:a}};function re({accountId:e,mailboxId:t,messageIds:s}){const{labels:n}=P(e),{applyLabel:l}=K({mailboxId:t}),c=v.useMemo(()=>n.map(a=>({key:a.labelId,label:a.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${w(a.color)?h[a.color]:h.Default}`}),onSelect:()=>l(s,a.labelId,"Apply")})),[n,s,l]);return c.length===0?null:p.jsx(U,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(D,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:c,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 V=3,ie=({hasSearchQuery:e,freeText:t,residualTokenCount:s})=>{if(!e||s>0)return!1;const n=t.trim();return n.length===0||n.length>=V},ce=e=>e===void 0?{kind:"unknown"}:{kind:"exact",value:e},Y=20,$=new Set(Object.values(O)),J=e=>e!==void 0&&$.has(e)?e:void 0,W=e=>{if(e.some(t=>t.type==="isUnread"))return!1;if(e.some(t=>t.type==="isRead"))return!0};function le({mailboxId:e,filterCategory:t}={}){const{searchQuery:s}=_(),n=G(),l=N(),c=B(s),{freeText:a,tokens:i}=H(c,n),r=a.length>0,u=i.find(o=>o.type==="category"),d=J(t)??u?.category,m=i.some(o=>o.type==="hasAttachment")?!0:void 0,f=i.some(o=>o.type==="isStarred")?!0:void 0,y=W(i),b=i.find(o=>o.type==="after"),g=i.find(o=>o.type==="before"),x=i.find(o=>o.type==="in"),S=F({browsed:l,callerMailboxId:e,inTokenMailboxId:x?.mailboxId}),{data:T,isLoading:C}=Q({...z({query:{query:a,mailboxId:S,limit:Y,...d!==void 0?{category:d}:{},...m!==void 0?{hasAttachment:m}:{},...f!==void 0?{hasStars:f}:{},...y!==void 0?{isRead:y}:{},...b?{sentDateFrom:b.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:r,staleTime:6e4});return{hits:T?.items??[],isLoading:r&&C}}export{re as L,ne as r,ie as s,ce as t,le as u};
1
+ import{h as L,at as M,i as k,E as I,F as E,cy as A,em as R,r as v,dy as j,j as p,en as h,eo as w,ep as D,C as _,cn as N,c as Q,dT as z,d6 as O}from"./index-DyXh0uZR.js";import{c as U}from"./popover-menu-2PYa43as.js";import{aj as q}from"./MailListHeader-BF_0ASsH.js";import{a as P}from"./useLabels-Cae2UsI0.js";import{n as B}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-DdCG0VLu.js";const ne=e=>{const t=new Set;for(const s of e)s&&t.add(s);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}},K=e=>{const{mailboxId:t,messages:s}=e,n=L(),{pushError:l}=M(),{mutateAsync:c,isPending:a}=k({...R(),onError:(r,u)=>{l({title:u.body.action==="Remove"?"Couldn't remove label":"Couldn't apply label",detail:A(r),error:r})},onSettled:(r,u,d)=>{I(n,E(q(d.body.messageIds??[],s??[],t)))}});return{applyLabel:v.useCallback((r,u,d)=>{r.length!==0&&j(r,m=>c({body:{messageIds:m,labelId:u,action:d}}))},[c]),isPending:a}};function re({accountId:e,mailboxId:t,messageIds:s}){const{labels:n}=P(e),{applyLabel:l}=K({mailboxId:t}),c=v.useMemo(()=>n.map(a=>({key:a.labelId,label:a.name,icon:p.jsx("span",{className:`size-2.5 rounded-full ${w(a.color)?h[a.color]:h.Default}`}),onSelect:()=>l(s,a.labelId,"Apply")})),[n,s,l]);return c.length===0?null:p.jsx(U,{triggerLabel:"Apply label to selected messages",triggerIcon:p.jsx(D,{className:"size-4 text-fg-subtle"}),triggerText:"Apply label",items:c,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 V=3,ie=({hasSearchQuery:e,freeText:t,residualTokenCount:s})=>{if(!e||s>0)return!1;const n=t.trim();return n.length===0||n.length>=V},ce=e=>e===void 0?{kind:"unknown"}:{kind:"exact",value:e},Y=20,$=new Set(Object.values(O)),J=e=>e!==void 0&&$.has(e)?e:void 0,W=e=>{if(e.some(t=>t.type==="isUnread"))return!1;if(e.some(t=>t.type==="isRead"))return!0};function le({mailboxId:e,filterCategory:t}={}){const{searchQuery:s}=_(),n=G(),l=N(),c=B(s),{freeText:a,tokens:i}=H(c,n),r=a.length>0,u=i.find(o=>o.type==="category"),d=J(t)??u?.category,m=i.some(o=>o.type==="hasAttachment")?!0:void 0,f=i.some(o=>o.type==="isStarred")?!0:void 0,y=W(i),b=i.find(o=>o.type==="after"),g=i.find(o=>o.type==="before"),x=i.find(o=>o.type==="in"),S=F({browsed:l,callerMailboxId:e,inTokenMailboxId:x?.mailboxId}),{data:T,isLoading:C}=Q({...z({query:{query:a,mailboxId:S,limit:Y,...d!==void 0?{category:d}:{},...m!==void 0?{hasAttachment:m}:{},...f!==void 0?{hasStars:f}:{},...y!==void 0?{isRead:y}:{},...b?{sentDateFrom:b.epochSeconds}:{},...g?{sentDateTo:g.epochSeconds}:{}}}),enabled:r,staleTime:6e4});return{hits:T?.items??[],isLoading:r&&C}}export{re as L,ne as r,ie as s,ce as t,le as u};
@@ -1 +1 @@
1
- import{h as g,at as p,c as f,d as m,r,i as y,av as T,o as E,l as d}from"./index-CVyiXes6.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,at as p,c as f,d as m,r,i as y,av as T,o as E,l as d}from"./index-DyXh0uZR.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};
package/index.html CHANGED
@@ -38,7 +38,7 @@
38
38
  } catch (_) {}
39
39
  })();
40
40
  </script>
41
- <script type="module" crossorigin src="/assets/index-CVyiXes6.js"></script>
41
+ <script type="module" crossorigin src="/assets/index-DyXh0uZR.js"></script>
42
42
  <link rel="stylesheet" crossorigin href="/assets/index-BtYEmjxr.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.644",
3
+ "version": "0.0.646",
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-CVyiXes6.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{aj as m,j as o,O as p}from"./index-CVyiXes6.js";import{a}from"./MailShell-CO4UHszY.js";import{M as r}from"./MailboxPane-CSXmclwC.js";import{a as e}from"./search-token-index-CDtHdqiP.js";import{u as s}from"./search-mirror-By7sgEWK.js";import"./FullCompose-EZk91vKc.js";import"./ErrorState-C9wNWNx-.js";import"./index-DYY0nrsl.js";import"./useMessageBodyContent-Bq-24837.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./confirm-dialog-D8E0auet.js";import"./useSearchTokenContext-V_0MB9r5.js";import"./kbd-BAzd-ZzK.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-URETybK8.js";import"./circle-check-big-ZWmAdG5O.js";import"./refresh-cw-og-Ybvo3.js";import"./useQueries-CqQkOWRS.js";import"./MailListHeader-KM5hxzzQ.js";import"./roving-focus-DYnDzdRR.js";import"./popover-menu-Bmzk7h6e.js";import"./mail-3L2_JePI.js";import"./avatar-BG16DP0I.js";import"./EmptyState-5AzHvbUg.js";import"./undo-2-BSHTchh1.js";import"./download-2vcTam8D.js";import"./useCalendarFreeBusy-oamX9h5O.js";import"./calendar-format-Df04vYeX.js";import"./useCalendars-CzwJUnpW.js";import"./map-pin-C_G0KnPH.js";import"./calendar-suggestion-BOcnceiU.js";import"./attendee-row-COD-JhkD.js";import"./minus-D5h1w2Lk.js";import"./clock-Bkjyx82e.js";import"./calendar-clash-strip-BFeaJEFd.js";import"./bell-off-BJ8oYylk.js";import"./shield-check-8L17Kh_I.js";import"./calendar-report-cFSv6gSl.js";import"./useFilters-D5DypOXB.js";import"./checkbox-CnlRLXiS.js";import"./useLayoutTier-BLBwlToe.js";import"./menu-Diz2jlXK.js";import"./MailViewChrome-D0DIIe1s.js";import"./pane-header-CaA1aTlU.js";import"./NavMenuButton-DipQuqqU.js";import"./useLabels-CEOAQRXe.js";import"./useSemanticSearch-CzayQYky.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CXKnmLHB.js";import"./circle-help-xoO8qyO7.js";import"./circle-check-CmDRPJ4x.js";function no(){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{no as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-CVyiXes6.js";import{M as r}from"./MailboxPane-CSXmclwC.js";import"./useSearchTokenContext-V_0MB9r5.js";import"./kbd-BAzd-ZzK.js";import"./useMessageBodyContent-Bq-24837.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-URETybK8.js";import"./circle-check-big-ZWmAdG5O.js";import"./refresh-cw-og-Ybvo3.js";import"./useQueries-CqQkOWRS.js";import"./MailListHeader-KM5hxzzQ.js";import"./roving-focus-DYnDzdRR.js";import"./search-token-index-CDtHdqiP.js";import"./popover-menu-Bmzk7h6e.js";import"./mail-3L2_JePI.js";import"./avatar-BG16DP0I.js";import"./index-DYY0nrsl.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./EmptyState-5AzHvbUg.js";import"./ErrorState-C9wNWNx-.js";import"./undo-2-BSHTchh1.js";import"./download-2vcTam8D.js";import"./useCalendarFreeBusy-oamX9h5O.js";import"./calendar-format-Df04vYeX.js";import"./useCalendars-CzwJUnpW.js";import"./map-pin-C_G0KnPH.js";import"./calendar-suggestion-BOcnceiU.js";import"./attendee-row-COD-JhkD.js";import"./minus-D5h1w2Lk.js";import"./clock-Bkjyx82e.js";import"./calendar-clash-strip-BFeaJEFd.js";import"./bell-off-BJ8oYylk.js";import"./shield-check-8L17Kh_I.js";import"./calendar-report-cFSv6gSl.js";import"./useFilters-D5DypOXB.js";import"./checkbox-CnlRLXiS.js";import"./confirm-dialog-D8E0auet.js";import"./useLayoutTier-BLBwlToe.js";import"./menu-Diz2jlXK.js";import"./MailViewChrome-D0DIIe1s.js";import"./pane-header-CaA1aTlU.js";import"./NavMenuButton-DipQuqqU.js";import"./useLabels-CEOAQRXe.js";import"./useSemanticSearch-CzayQYky.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CXKnmLHB.js";import"./circle-help-xoO8qyO7.js";import"./circle-check-CmDRPJ4x.js";function $(){return o.jsx(r.Reading,{})}export{$ as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-CVyiXes6.js";import{F as r}from"./FlaggedPane-CzACUDwI.js";import"./useSearchTokenContext-V_0MB9r5.js";import"./kbd-BAzd-ZzK.js";import"./useMessageBodyContent-Bq-24837.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-KM5hxzzQ.js";import"./roving-focus-DYnDzdRR.js";import"./search-token-index-CDtHdqiP.js";import"./useQueries-CqQkOWRS.js";import"./popover-menu-Bmzk7h6e.js";import"./mail-3L2_JePI.js";import"./avatar-BG16DP0I.js";import"./index-DYY0nrsl.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./EmptyState-5AzHvbUg.js";import"./ErrorState-C9wNWNx-.js";import"./undo-2-BSHTchh1.js";import"./download-2vcTam8D.js";import"./useCalendarFreeBusy-oamX9h5O.js";import"./calendar-format-Df04vYeX.js";import"./useCalendars-CzwJUnpW.js";import"./map-pin-C_G0KnPH.js";import"./calendar-suggestion-BOcnceiU.js";import"./attendee-row-COD-JhkD.js";import"./minus-D5h1w2Lk.js";import"./clock-Bkjyx82e.js";import"./calendar-clash-strip-BFeaJEFd.js";import"./bell-off-BJ8oYylk.js";import"./shield-check-8L17Kh_I.js";import"./calendar-report-cFSv6gSl.js";import"./useFilters-D5DypOXB.js";import"./checkbox-CnlRLXiS.js";import"./confirm-dialog-D8E0auet.js";import"./useLayoutTier-BLBwlToe.js";import"./menu-Diz2jlXK.js";import"./MailViewChrome-D0DIIe1s.js";import"./refresh-cw-og-Ybvo3.js";import"./wizard-selection-DxUM65kM.js";function S(){return o.jsx(r.Reading,{})}export{S as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-CVyiXes6.js";import{B as o}from"./BriefPane-CWpjvftR.js";import"./useSearchTokenContext-V_0MB9r5.js";import"./kbd-BAzd-ZzK.js";import"./useMessageBodyContent-Bq-24837.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-KM5hxzzQ.js";import"./roving-focus-DYnDzdRR.js";import"./search-token-index-CDtHdqiP.js";import"./useQueries-CqQkOWRS.js";import"./popover-menu-Bmzk7h6e.js";import"./mail-3L2_JePI.js";import"./avatar-BG16DP0I.js";import"./index-DYY0nrsl.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./EmptyState-5AzHvbUg.js";import"./ErrorState-C9wNWNx-.js";import"./undo-2-BSHTchh1.js";import"./download-2vcTam8D.js";import"./useCalendarFreeBusy-oamX9h5O.js";import"./calendar-format-Df04vYeX.js";import"./useCalendars-CzwJUnpW.js";import"./map-pin-C_G0KnPH.js";import"./calendar-suggestion-BOcnceiU.js";import"./attendee-row-COD-JhkD.js";import"./minus-D5h1w2Lk.js";import"./clock-Bkjyx82e.js";import"./calendar-clash-strip-BFeaJEFd.js";import"./bell-off-BJ8oYylk.js";import"./shield-check-8L17Kh_I.js";import"./calendar-report-cFSv6gSl.js";import"./useFilters-D5DypOXB.js";import"./checkbox-CnlRLXiS.js";import"./confirm-dialog-D8E0auet.js";import"./useLayoutTier-BLBwlToe.js";import"./menu-Diz2jlXK.js";import"./useRefreshControl-URETybK8.js";import"./circle-check-big-ZWmAdG5O.js";import"./refresh-cw-og-Ybvo3.js";import"./useSemanticSearch-CzayQYky.js";import"./useLabels-CEOAQRXe.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function W(){return r.jsx(o.Reading,{})}export{W as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-CVyiXes6.js";import{O as t}from"./OutboxPane-BQ2C8Exq.js";import"./roving-focus-DYnDzdRR.js";import"./useSearchTokenContext-V_0MB9r5.js";import"./kbd-BAzd-ZzK.js";import"./useMessageBodyContent-Bq-24837.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-ZWmAdG5O.js";import"./clock-Bkjyx82e.js";import"./row-actions-DFIk5ZFA.js";import"./rotate-ccw-FAgCjZMZ.js";import"./pane-header-CaA1aTlU.js";import"./NavMenuButton-DipQuqqU.js";import"./menu-Diz2jlXK.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function R(){return o.jsx(t.Reading,{})}export{R as component};
@@ -1 +0,0 @@
1
- import{e_ as o,j as m}from"./index-CVyiXes6.js";import{O as p}from"./OpenCalendarEvent-DdZ8T5JX.js";import"./CalendarComposePane-DJNhu2LK.js";import"./calendar-format-Df04vYeX.js";import"./useQueries-CqQkOWRS.js";import"./useCalendars-CzwJUnpW.js";import"./calendar-clash-strip-BFeaJEFd.js";import"./attendee-row-COD-JhkD.js";import"./avatar-BG16DP0I.js";import"./minus-D5h1w2Lk.js";import"./clock-Bkjyx82e.js";import"./map-pin-C_G0KnPH.js";import"./mail-3L2_JePI.js";import"./pencil-TKs_c6Iw.js";import"./useCalendarWrites-B6o3xQNN.js";import"./ErrorState-C9wNWNx-.js";import"./useCalendarData-emMg6If8.js";import"./calendar-report-cFSv6gSl.js";import"./calendar-subscription-B-aAc2Gy.js";function P(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:t})}export{P as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-CVyiXes6.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-CVyiXes6.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-CVyiXes6.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{j as r,O as i}from"./index-CVyiXes6.js";import{a as m}from"./MailShell-CO4UHszY.js";import{B as o}from"./BriefPane-CWpjvftR.js";import{a as p}from"./search-token-index-CDtHdqiP.js";import{u as e}from"./search-mirror-By7sgEWK.js";import"./FullCompose-EZk91vKc.js";import"./ErrorState-C9wNWNx-.js";import"./index-DYY0nrsl.js";import"./useMessageBodyContent-Bq-24837.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./confirm-dialog-D8E0auet.js";import"./useSearchTokenContext-V_0MB9r5.js";import"./kbd-BAzd-ZzK.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-KM5hxzzQ.js";import"./roving-focus-DYnDzdRR.js";import"./popover-menu-Bmzk7h6e.js";import"./mail-3L2_JePI.js";import"./avatar-BG16DP0I.js";import"./EmptyState-5AzHvbUg.js";import"./undo-2-BSHTchh1.js";import"./download-2vcTam8D.js";import"./useCalendarFreeBusy-oamX9h5O.js";import"./calendar-format-Df04vYeX.js";import"./useQueries-CqQkOWRS.js";import"./useCalendars-CzwJUnpW.js";import"./map-pin-C_G0KnPH.js";import"./calendar-suggestion-BOcnceiU.js";import"./attendee-row-COD-JhkD.js";import"./minus-D5h1w2Lk.js";import"./clock-Bkjyx82e.js";import"./calendar-clash-strip-BFeaJEFd.js";import"./bell-off-BJ8oYylk.js";import"./shield-check-8L17Kh_I.js";import"./calendar-report-cFSv6gSl.js";import"./useFilters-D5DypOXB.js";import"./checkbox-CnlRLXiS.js";import"./useLayoutTier-BLBwlToe.js";import"./menu-Diz2jlXK.js";import"./useRefreshControl-URETybK8.js";import"./circle-check-big-ZWmAdG5O.js";import"./refresh-cw-og-Ybvo3.js";import"./useSemanticSearch-CzayQYky.js";import"./useLabels-CEOAQRXe.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-DxUM65kM.js";function tr(){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{tr as component};
@@ -1 +0,0 @@
1
- import{e}from"./index-CVyiXes6.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-EZk91vKc.js";import"./index-CVyiXes6.js";import"./ErrorState-C9wNWNx-.js";import"./index-DYY0nrsl.js";import"./useMessageBodyContent-Bq-24837.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./confirm-dialog-D8E0auet.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-EZk91vKc.js";import"./index-CVyiXes6.js";import"./ErrorState-C9wNWNx-.js";import"./index-DYY0nrsl.js";import"./useMessageBodyContent-Bq-24837.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./confirm-dialog-D8E0auet.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-EZk91vKc.js";import"./index-CVyiXes6.js";import"./ErrorState-C9wNWNx-.js";import"./index-DYY0nrsl.js";import"./useMessageBodyContent-Bq-24837.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./confirm-dialog-D8E0auet.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-EZk91vKc.js";import"./index-CVyiXes6.js";import"./ErrorState-C9wNWNx-.js";import"./index-DYY0nrsl.js";import"./useMessageBodyContent-Bq-24837.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./confirm-dialog-D8E0auet.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{j as o,O as i}from"./index-CVyiXes6.js";import{a as m}from"./MailShell-CO4UHszY.js";import{F as r}from"./FlaggedPane-CzACUDwI.js";import{a as p}from"./search-token-index-CDtHdqiP.js";import{u as e}from"./search-mirror-By7sgEWK.js";import"./FullCompose-EZk91vKc.js";import"./ErrorState-C9wNWNx-.js";import"./index-DYY0nrsl.js";import"./useMessageBodyContent-Bq-24837.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./confirm-dialog-D8E0auet.js";import"./useSearchTokenContext-V_0MB9r5.js";import"./kbd-BAzd-ZzK.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-KM5hxzzQ.js";import"./roving-focus-DYnDzdRR.js";import"./popover-menu-Bmzk7h6e.js";import"./mail-3L2_JePI.js";import"./avatar-BG16DP0I.js";import"./EmptyState-5AzHvbUg.js";import"./undo-2-BSHTchh1.js";import"./download-2vcTam8D.js";import"./useCalendarFreeBusy-oamX9h5O.js";import"./calendar-format-Df04vYeX.js";import"./useQueries-CqQkOWRS.js";import"./useCalendars-CzwJUnpW.js";import"./map-pin-C_G0KnPH.js";import"./calendar-suggestion-BOcnceiU.js";import"./attendee-row-COD-JhkD.js";import"./minus-D5h1w2Lk.js";import"./clock-Bkjyx82e.js";import"./calendar-clash-strip-BFeaJEFd.js";import"./bell-off-BJ8oYylk.js";import"./shield-check-8L17Kh_I.js";import"./calendar-report-cFSv6gSl.js";import"./useFilters-D5DypOXB.js";import"./checkbox-CnlRLXiS.js";import"./useLayoutTier-BLBwlToe.js";import"./menu-Diz2jlXK.js";import"./MailViewChrome-D0DIIe1s.js";import"./refresh-cw-og-Ybvo3.js";import"./wizard-selection-DxUM65kM.js";function _(){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{_ as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-CVyiXes6.js";import{F as r}from"./FlaggedPane-CzACUDwI.js";import"./useSearchTokenContext-V_0MB9r5.js";import"./kbd-BAzd-ZzK.js";import"./useMessageBodyContent-Bq-24837.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-KM5hxzzQ.js";import"./roving-focus-DYnDzdRR.js";import"./search-token-index-CDtHdqiP.js";import"./useQueries-CqQkOWRS.js";import"./popover-menu-Bmzk7h6e.js";import"./mail-3L2_JePI.js";import"./avatar-BG16DP0I.js";import"./index-DYY0nrsl.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./EmptyState-5AzHvbUg.js";import"./ErrorState-C9wNWNx-.js";import"./undo-2-BSHTchh1.js";import"./download-2vcTam8D.js";import"./useCalendarFreeBusy-oamX9h5O.js";import"./calendar-format-Df04vYeX.js";import"./useCalendars-CzwJUnpW.js";import"./map-pin-C_G0KnPH.js";import"./calendar-suggestion-BOcnceiU.js";import"./attendee-row-COD-JhkD.js";import"./minus-D5h1w2Lk.js";import"./clock-Bkjyx82e.js";import"./calendar-clash-strip-BFeaJEFd.js";import"./bell-off-BJ8oYylk.js";import"./shield-check-8L17Kh_I.js";import"./calendar-report-cFSv6gSl.js";import"./useFilters-D5DypOXB.js";import"./checkbox-CnlRLXiS.js";import"./confirm-dialog-D8E0auet.js";import"./useLayoutTier-BLBwlToe.js";import"./menu-Diz2jlXK.js";import"./MailViewChrome-D0DIIe1s.js";import"./refresh-cw-og-Ybvo3.js";import"./wizard-selection-DxUM65kM.js";function Q(){return o.jsx(r.Reading,{})}export{Q as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-CVyiXes6.js";import{M as r}from"./MailboxPane-CSXmclwC.js";import"./useSearchTokenContext-V_0MB9r5.js";import"./kbd-BAzd-ZzK.js";import"./useMessageBodyContent-Bq-24837.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-URETybK8.js";import"./circle-check-big-ZWmAdG5O.js";import"./refresh-cw-og-Ybvo3.js";import"./useQueries-CqQkOWRS.js";import"./MailListHeader-KM5hxzzQ.js";import"./roving-focus-DYnDzdRR.js";import"./search-token-index-CDtHdqiP.js";import"./popover-menu-Bmzk7h6e.js";import"./mail-3L2_JePI.js";import"./avatar-BG16DP0I.js";import"./index-DYY0nrsl.js";import"./useSignature-BraM8Nn7.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-3uXEWBzO.js";import"./sections-D-n9QfX4.js";import"./EmptyState-5AzHvbUg.js";import"./ErrorState-C9wNWNx-.js";import"./undo-2-BSHTchh1.js";import"./download-2vcTam8D.js";import"./useCalendarFreeBusy-oamX9h5O.js";import"./calendar-format-Df04vYeX.js";import"./useCalendars-CzwJUnpW.js";import"./map-pin-C_G0KnPH.js";import"./calendar-suggestion-BOcnceiU.js";import"./attendee-row-COD-JhkD.js";import"./minus-D5h1w2Lk.js";import"./clock-Bkjyx82e.js";import"./calendar-clash-strip-BFeaJEFd.js";import"./bell-off-BJ8oYylk.js";import"./shield-check-8L17Kh_I.js";import"./calendar-report-cFSv6gSl.js";import"./useFilters-D5DypOXB.js";import"./checkbox-CnlRLXiS.js";import"./confirm-dialog-D8E0auet.js";import"./useLayoutTier-BLBwlToe.js";import"./menu-Diz2jlXK.js";import"./MailViewChrome-D0DIIe1s.js";import"./pane-header-CaA1aTlU.js";import"./NavMenuButton-DipQuqqU.js";import"./useLabels-CEOAQRXe.js";import"./useSemanticSearch-CzayQYky.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CXKnmLHB.js";import"./circle-help-xoO8qyO7.js";import"./circle-check-CmDRPJ4x.js";function $(){return o.jsx(r.Reading,{})}export{$ as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-CVyiXes6.js";import{O as t}from"./OutboxPane-BQ2C8Exq.js";import"./roving-focus-DYnDzdRR.js";import"./useSearchTokenContext-V_0MB9r5.js";import"./kbd-BAzd-ZzK.js";import"./useMessageBodyContent-Bq-24837.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-ZWmAdG5O.js";import"./clock-Bkjyx82e.js";import"./row-actions-DFIk5ZFA.js";import"./rotate-ccw-FAgCjZMZ.js";import"./pane-header-CaA1aTlU.js";import"./NavMenuButton-DipQuqqU.js";import"./menu-Diz2jlXK.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function d(){return o.jsx(t.Reading,{})}export{d as component};