@remit/web-client-dist 0.0.696 → 0.0.697

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 (201) hide show
  1. package/assets/{BriefPane-DqAium13.js → BriefPane-BQx5RRpb.js} +1 -1
  2. package/assets/{CalendarEventEditor-53hot8oY.js → CalendarEventEditor-B3bVY-Oc.js} +1 -1
  3. package/assets/{CalendarEventPopup-BBlKWgkP.js → CalendarEventPopup-D6PNfUfu.js} +1 -1
  4. package/assets/{CalendarLoadFailed-D9O_t7aS.js → CalendarLoadFailed-Cm6trTQZ.js} +1 -1
  5. package/assets/{CalendarQuickCreate-B39DWHxB.js → CalendarQuickCreate-B_n983kv.js} +1 -1
  6. package/assets/{CalendarSession-CjGsYSn3.js → CalendarSession-BosFoHg2.js} +1 -1
  7. package/assets/{CollectionPane-DH6KjfeW.js → CollectionPane-BzktgIp0.js} +1 -1
  8. package/assets/{DesktopChrome-DrLXNfAF.js → DesktopChrome-GxTHTvqD.js} +1 -1
  9. package/assets/{DropdownMenu-CgMO6e8h.js → DropdownMenu-C2J8u8zN.js} +1 -1
  10. package/assets/{EmptyState-FjON9Ve2.js → EmptyState-BJU14tbt.js} +1 -1
  11. package/assets/{ErrorState-DHsQU1XS.js → ErrorState-BTHOmsYP.js} +1 -1
  12. package/assets/{FullCompose-karPPSLh.js → FullCompose-DiZNltCL.js} +1 -1
  13. package/assets/{LabelApplyTrigger-BLIxuWTi.js → LabelApplyTrigger-P8IoLKME.js} +1 -1
  14. package/assets/{MailShell-jW6JmRUB.js → MailShell-tKLYT5hn.js} +1 -1
  15. package/assets/{MailViewChrome-By52WjOW.js → MailViewChrome-CLgaFbe-.js} +1 -1
  16. package/assets/{MailboxPane-dO1WtQIE.js → MailboxPane-BxNCkl6s.js} +1 -1
  17. package/assets/{MessageBody-bibpHbC1.js → MessageBody-jG4Dhul6.js} +1 -1
  18. package/assets/{MessageToolbar-BK8iddsy.js → MessageToolbar-DeDUhCvg.js} +1 -1
  19. package/assets/{NavMenuButton-DMqlg3at.js → NavMenuButton-CLp6InRG.js} +1 -1
  20. package/assets/{OnboardingWizard-BVm-45mM.js → OnboardingWizard-BSlPpmI5.js} +1 -1
  21. package/assets/{OutboxPane-BwIG-6n1.js → OutboxPane-B6UfixBP.js} +1 -1
  22. package/assets/{ReportLink-DbjCeZ9_.js → ReportLink-BELrQR40.js} +1 -1
  23. package/assets/_calendarObjectId-BiaBDCEt.js +1 -0
  24. package/assets/_labelId-DLeWLaow.js +1 -0
  25. package/assets/_mailboxId-DWvQ-9gi.js +1 -0
  26. package/assets/_messageId-BB9xOwfs.js +1 -0
  27. package/assets/_messageId-C2YSZxRF.js +1 -0
  28. package/assets/_messageId-CPvSvBZB.js +1 -0
  29. package/assets/_messageId-DbVH08AL.js +1 -0
  30. package/assets/_outboxMessageId-BFgW_k_u.js +1 -0
  31. package/assets/_recurrenceId-96pqeQMh.js +1 -0
  32. package/assets/{_slotId-ipxsVzxt.js → _slotId-DQqfctAf.js} +1 -1
  33. package/assets/_threadId-Bm7b75jN.js +1 -0
  34. package/assets/_threadId-CCwEReI2.js +1 -0
  35. package/assets/_threadId-Db39B53v.js +1 -0
  36. package/assets/_threadId-Dht02PUZ.js +1 -0
  37. package/assets/{_view._date-kxLdB_iw.js → _view._date-BQeaBjoE.js} +1 -1
  38. package/assets/{account-service-status-jau7OHM-.js → account-service-status-DsLvRU-X.js} +1 -1
  39. package/assets/{accounts-Dv0XYTrh.js → accounts-D0rPQMGH.js} +1 -1
  40. package/assets/{advanced-Co1jIx2-.js → advanced-q_hG98BB.js} +1 -1
  41. package/assets/{agenda-time--0lz2pGX.js → agenda-time-D0yU-H44.js} +1 -1
  42. package/assets/{app-chrome-BtWv1mrl.js → app-chrome-BfyGOiSA.js} +1 -1
  43. package/assets/{appearance-CIaVIf5W.js → appearance-DM1k2Ta7.js} +1 -1
  44. package/assets/{avatar-BLhNXW-W.js → avatar-Bq7beWCy.js} +1 -1
  45. package/assets/{badge-CoJzTE5F.js → badge-BB80tGxy.js} +1 -1
  46. package/assets/{bottom-sheet-BSnl2giv.js → bottom-sheet-DKF_Dkid.js} +1 -1
  47. package/assets/{brief-BIpUj9JN.js → brief-8diVJSZ9.js} +1 -1
  48. package/assets/brief-CFBkxoDK.js +1 -0
  49. package/assets/{calendar-B4zVNn1v.js → calendar-BqFIadRy.js} +1 -1
  50. package/assets/{calendar-BRsmtlld.js → calendar-Ds9kgvU8.js} +1 -1
  51. package/assets/{calendar-event-popup-DsOb1y1u.js → calendar-event-popup-Cr_LW8IP.js} +1 -1
  52. package/assets/{calendar-event-sidebar-Bi4U7yon.js → calendar-event-sidebar-B_eR1h5J.js} +1 -1
  53. package/assets/{calendar-failure-note-DlpRkxBL.js → calendar-failure-note-C4gNXDQV.js} +1 -1
  54. package/assets/{calendar-guests-BQoxXEOG.js → calendar-guests-Cay9Ub8h.js} +1 -1
  55. package/assets/{calendar-suggestion-CJMwfDpf.js → calendar-suggestion-EosZrXZC.js} +1 -1
  56. package/assets/{calendars-0hXvo4Yo.js → calendars-52NaEZbX.js} +1 -1
  57. package/assets/{card-CAuqZLKK.js → card-CLJYKox8.js} +1 -1
  58. package/assets/{checkbox-ImKY_DpK.js → checkbox-CYOm-zGr.js} +1 -1
  59. package/assets/{chevron-down-CHMH78GK.js → chevron-down-De4wQzka.js} +1 -1
  60. package/assets/{chevron-left-Brxnh-p_.js → chevron-left-CUHU8UT9.js} +1 -1
  61. package/assets/{circle-check-bdTVfKb7.js → circle-check-DlR8I4Hf.js} +1 -1
  62. package/assets/{circle-check-big-D7T0Fr-Y.js → circle-check-big-CMsxQSjY.js} +1 -1
  63. package/assets/{circle-question-mark-BJ-7TUgf.js → circle-question-mark-DhNa_A16.js} +1 -1
  64. package/assets/{classification-IsZmGA3c.js → classification-BgDJ1gwK.js} +1 -1
  65. package/assets/{clock-CcJSq9G-.js → clock-Dds4zv6u.js} +1 -1
  66. package/assets/{cloud-off-KCT2nWKe.js → cloud-off-BYulqayx.js} +1 -1
  67. package/assets/compose._-_outboxMessageId_-BY1Sf-7o.js +1 -0
  68. package/assets/compose._-_outboxMessageId_-ByGI1c-o.js +1 -0
  69. package/assets/compose._-_outboxMessageId_-CvOAO1iL.js +1 -0
  70. package/assets/compose._-_outboxMessageId_-EZpX9L3H.js +1 -0
  71. package/assets/compose._-_outboxMessageId_-urlj3DLH.js +1 -0
  72. package/assets/{config-import-CDPSmiwE.js → config-import-VTZQj3gU.js} +1 -1
  73. package/assets/{confirm-dialog-Nw9MwHVJ.js → confirm-dialog-XvccFJdE.js} +1 -1
  74. package/assets/{copy-CBfiykpW.js → copy-BokIobZ4.js} +1 -1
  75. package/assets/{credential-steps-DijGQsa7.js → credential-steps-O1OzlOow.js} +1 -1
  76. package/assets/{download-BGcYYhWw.js → download-DEuAIIIQ.js} +1 -1
  77. package/assets/{draft-BIlfX99J.js → draft-BEiHkDpm.js} +1 -1
  78. package/assets/edit-B9dhadKH.js +1 -0
  79. package/assets/edit-vn6fIBd6.js +1 -0
  80. package/assets/{external-link-D7g7AAZP.js → external-link-L7NXOTeQ.js} +1 -1
  81. package/assets/{file-braces-GrxXAr-8.js → file-braces-BN8-S---.js} +1 -1
  82. package/assets/{filters-DfUsL7bX.js → filters-VSaDpnX3.js} +1 -1
  83. package/assets/{flagged-B833_7J0.js → flagged-B-j-3yRr.js} +1 -1
  84. package/assets/flagged-BZJepVc-.js +1 -0
  85. package/assets/{folder-input-uYHmZSIB.js → folder-input-B0q8wLhf.js} +1 -1
  86. package/assets/{folders-B2KHLLXQ.js → folders-CTNX9Hcm.js} +1 -1
  87. package/assets/{help-copy-DWTmr8ZJ.js → help-copy-DUjzIPXf.js} +1 -1
  88. package/assets/{import-S0-kKNSZ.js → import-DLM5VFnJ.js} +1 -1
  89. package/assets/index-B--m5QrT.js +1 -0
  90. package/assets/index-BuawSiTp.js +1 -0
  91. package/assets/index-C2YSZxRF.js +1 -0
  92. package/assets/index-CO1X8-aP.js +1 -0
  93. package/assets/index-CPvSvBZB.js +1 -0
  94. package/assets/{index-Baytk5ez.js → index-Caon2n2j.js} +4 -4
  95. package/assets/index-ChWo5_90.js +1 -0
  96. package/assets/index-DGb7Ls8y.js +1 -0
  97. package/assets/index-DLRo9M2D.js +1 -0
  98. package/assets/index-DemsYVll.js +1 -0
  99. package/assets/index-Dylwxpr-.js +1 -0
  100. package/assets/index-YwusJB4d.js +1 -0
  101. package/assets/index-Zfii_-4V.js +1 -0
  102. package/assets/{index-9QMShYZC.js → index-fsuIswbe.js} +62 -62
  103. package/assets/{kbd-BD-ER_Yv.js → kbd-jzPSd-a2.js} +1 -1
  104. package/assets/{label-chip-D6mHiJlY.js → label-chip-DtBVyALF.js} +1 -1
  105. package/assets/{labels-SmD1KE3F.js → labels-CUXsONgB.js} +1 -1
  106. package/assets/{mail-AiBxTd_5.js → mail-BodKXw3C.js} +1 -1
  107. package/assets/{mail-DZhnB5_L.js → mail-BzFJWQZy.js} +1 -1
  108. package/assets/{menu-BQAGsNoE.js → menu-Bh94jr77.js} +1 -1
  109. package/assets/{nav-link-BaRr8ufx.js → nav-link-ed0mFCCx.js} +1 -1
  110. package/assets/new-DlRrHbU8.js +1 -0
  111. package/assets/onboarding-8O2rW7qq.js +1 -0
  112. package/assets/{onboarding-completion-CEthyLI-.js → onboarding-completion-qKzJSmsI.js} +1 -1
  113. package/assets/outbox-nrXvnMTk.js +1 -0
  114. package/assets/{pencil-Dp-S5che.js → pencil-BDbmS56C.js} +1 -1
  115. package/assets/{people-CFuQvhz_.js → people-eWwwIt4_.js} +1 -1
  116. package/assets/{plus-ivySO7aD.js → plus-D5-2sA5v.js} +1 -1
  117. package/assets/{popover-menu-CNRsrfGN.js → popover-menu-DhcuKv1N.js} +1 -1
  118. package/assets/{refresh-cw-D43K-uJ_.js → refresh-cw-Cu9_I3cT.js} +1 -1
  119. package/assets/{reply-CdhmgK8D.js → reply-CXuSMyqp.js} +1 -1
  120. package/assets/{rich-text-BNnd4RhC.js → rich-text-Ds4rQc2o.js} +1 -1
  121. package/assets/{rich-text-spellcheck-worker-provider-D35wa69O.js → rich-text-spellcheck-worker-provider-ChKzrvjg.js} +1 -1
  122. package/assets/{rotate-ccw-DY-C3cnl.js → rotate-ccw-hQhPZwrx.js} +1 -1
  123. package/assets/{roving-focus-CfNxjWPW.js → roving-focus-DZX7IpN4.js} +1 -1
  124. package/assets/{row-actions-DMyxcQFg.js → row-actions-BDfQKXdD.js} +1 -1
  125. package/assets/{search-mirror-PLEys8yY.js → search-mirror-B2xnwy77.js} +1 -1
  126. package/assets/{search-scope-DowTds7f.js → search-scope-B-3MTDpD.js} +1 -1
  127. package/assets/{search-token-index-Qe9FLPUx.js → search-token-index-BYKMNlJD.js} +1 -1
  128. package/assets/{sections-aErIO9A7.js → sections-DpRVKuXF.js} +1 -1
  129. package/assets/{segmented-control-CZRUmZT-.js → segmented-control-BwvsufVp.js} +1 -1
  130. package/assets/{select-Bar5gCGO.js → select-TYdrgtW5.js} +1 -1
  131. package/assets/senders-vh4OQfD0.js +1 -0
  132. package/assets/settings-MlHARJWl.js +1 -0
  133. package/assets/{settings-screen-DjVJZ-eS.js → settings-screen-DTYVWAkg.js} +1 -1
  134. package/assets/{shield-check-C-ddv9so.js → shield-check-C-tOrPEx.js} +1 -1
  135. package/assets/{spam-CfM26JXy.js → spam-CecFwFHS.js} +1 -1
  136. package/assets/{suggest-list-BU1CAWaS.js → suggest-list-BCqr1j26.js} +1 -1
  137. package/assets/{suggested-vips-CVTKxBdO.js → suggested-vips--pG2iuOT.js} +1 -1
  138. package/assets/{suggestion._suggestionId-LOmWNAzV.js → suggestion._suggestionId-DiMWWP0r.js} +1 -1
  139. package/assets/{switch-C60zzRNi.js → switch-CyAtRlCz.js} +1 -1
  140. package/assets/{task._calendarTaskId-CwbcSZL4.js → task._calendarTaskId-D-wpEifQ.js} +1 -1
  141. package/assets/{undo-2-D6HzUJ41.js → undo-2-D1IMLq7c.js} +1 -1
  142. package/assets/{useCalendarData-n3x_s1Nb.js → useCalendarData-DFG3pzeG.js} +1 -1
  143. package/assets/{useCalendarScheduling-B3bHM8TC.js → useCalendarScheduling-B_INtO-h.js} +1 -1
  144. package/assets/{useCalendarSuggestions-dbmN8tRh.js → useCalendarSuggestions-DXbA0boT.js} +1 -1
  145. package/assets/{useCalendarTasks-CC9jcVTp.js → useCalendarTasks-b_UNFPQH.js} +1 -1
  146. package/assets/{useClassificationSettings-DDXeuHc9.js → useClassificationSettings-DBRecrmp.js} +1 -1
  147. package/assets/{useCollectionThreads-bR-HQDXT.js → useCollectionThreads-DgofDKen.js} +1 -1
  148. package/assets/{useDebouncedValue-nIbP08sa.js → useDebouncedValue-CFZ4EPXW.js} +1 -1
  149. package/assets/{useFilters-C3QPNclJ.js → useFilters-DHWZEIQe.js} +1 -1
  150. package/assets/{useInfiniteQuery-CneHLmnO.js → useInfiniteQuery-B-vOuANs.js} +1 -1
  151. package/assets/{useJunkMailboxIds-BCvLXlA_.js → useJunkMailboxIds-CW7aI25D.js} +1 -1
  152. package/assets/{useLabels-BiYidhrJ.js → useLabels-k1VKuQrr.js} +1 -1
  153. package/assets/{useLayoutTier-c01ZWqQ0.js → useLayoutTier-BNUKvwJD.js} +1 -1
  154. package/assets/{useMediaQuery-BL50IiYB.js → useMediaQuery-Hy81MQ2M.js} +1 -1
  155. package/assets/{useMessageBodyContent-DdX1ZZwR.js → useMessageBodyContent-CpTD2HGg.js} +1 -1
  156. package/assets/{useQueries-B2w-f15M.js → useQueries-DPH-PeHV.js} +1 -1
  157. package/assets/{useRefreshControl-C-8PJltS.js → useRefreshControl-DdbTrGxq.js} +1 -1
  158. package/assets/{useResultFolderIndex-BTY9xXDW.js → useResultFolderIndex-BVyfzXH5.js} +1 -1
  159. package/assets/{useSignature-DQ-8mjVB.js → useSignature-W9HBbZ_n.js} +1 -1
  160. package/assets/{warnings-iL5faBYa.js → warnings-B2sNE31D.js} +1 -1
  161. package/index.html +1 -1
  162. package/package.json +1 -1
  163. package/assets/_calendarObjectId-DcrqQ1pT.js +0 -1
  164. package/assets/_labelId-B-uoAJUi.js +0 -1
  165. package/assets/_mailboxId-B_BsU1d4.js +0 -1
  166. package/assets/_messageId-BBhFHooJ.js +0 -1
  167. package/assets/_messageId-BC4E5AdD.js +0 -1
  168. package/assets/_messageId-BFceTya0.js +0 -1
  169. package/assets/_messageId-CaLvmUYl.js +0 -1
  170. package/assets/_outboxMessageId-D3RH7suq.js +0 -1
  171. package/assets/_recurrenceId-BmFnTbJZ.js +0 -1
  172. package/assets/_threadId-BdAvQAKq.js +0 -1
  173. package/assets/_threadId-Ok6MuUb2.js +0 -1
  174. package/assets/_threadId-PwztExmU.js +0 -1
  175. package/assets/_threadId-oAltpOkl.js +0 -1
  176. package/assets/brief-E24hWVP8.js +0 -1
  177. package/assets/compose._-_outboxMessageId_-5h4Thyui.js +0 -1
  178. package/assets/compose._-_outboxMessageId_-CG67dlL2.js +0 -1
  179. package/assets/compose._-_outboxMessageId_-Dm_l3weH.js +0 -1
  180. package/assets/compose._-_outboxMessageId_-TYmtS11N.js +0 -1
  181. package/assets/compose._-_outboxMessageId_-wdQo3fol.js +0 -1
  182. package/assets/edit-DPWo7v-f.js +0 -1
  183. package/assets/edit-DZEKnuQ0.js +0 -1
  184. package/assets/flagged-zsMPG8wt.js +0 -1
  185. package/assets/index-BBhFHooJ.js +0 -1
  186. package/assets/index-BC4E5AdD.js +0 -1
  187. package/assets/index-BeYdWLSr.js +0 -1
  188. package/assets/index-BlWjdYaS.js +0 -1
  189. package/assets/index-CgyMBBs4.js +0 -1
  190. package/assets/index-D2U9KSTT.js +0 -1
  191. package/assets/index-DB540_Zp.js +0 -1
  192. package/assets/index-DX3L0os1.js +0 -1
  193. package/assets/index-DwKXH-XS.js +0 -1
  194. package/assets/index-dE8tDfaV.js +0 -1
  195. package/assets/index-gg1vreMW.js +0 -1
  196. package/assets/index-opRNV15g.js +0 -1
  197. package/assets/new-CBzvvAzX.js +0 -1
  198. package/assets/onboarding-Boe7D95J.js +0 -1
  199. package/assets/outbox-BqHfAcnr.js +0 -1
  200. package/assets/senders-6bWn5dUX.js +0 -1
  201. package/assets/settings-BfuOXGy8.js +0 -1
@@ -1 +1 @@
1
- import{b as ee,az as Q,aA as B,f5 as N,a as C,f6 as te,r as d,e as v,s as b,f as m,f7 as ne,f8 as ae,f9 as se,aS as A,b2 as re,b0 as oe,b1 as ie,fa as ce,cj as w,fb as h,f4 as de,co as le,fc as ue,fd as fe,fe as ge,ff as pe,fg as me,fh as Ce,fi as be,fj as ye}from"./index-9QMShYZC.js";import{f as I}from"./ErrorState-DHsQU1XS.js";import{u as G}from"./useQueries-B2w-f15M.js";const z={name:"map-pin",size:24,node:[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]};z.node;const Fe=ee(z),Ee={"cal-1":{solid:"bg-cal-1",soft:"bg-cal-1-soft",text:"text-cal-1",border:"border-cal-1",rail:"border-l-cal-1"},"cal-2":{solid:"bg-cal-2",soft:"bg-cal-2-soft",text:"text-cal-2",border:"border-cal-2",rail:"border-l-cal-2"},"cal-3":{solid:"bg-cal-3",soft:"bg-cal-3-soft",text:"text-cal-3",border:"border-cal-3",rail:"border-l-cal-3"},"cal-4":{solid:"bg-cal-4",soft:"bg-cal-4-soft",text:"text-cal-4",border:"border-cal-4",rail:"border-l-cal-4"},"cal-5":{solid:"bg-cal-5",soft:"bg-cal-5-soft",text:"text-cal-5",border:"border-cal-5",rail:"border-l-cal-5"},"cal-6":{solid:"bg-cal-6",soft:"bg-cal-6-soft",text:"text-cal-6",border:"border-cal-6",rail:"border-l-cal-6"}};function We(e){return Ee[e]}function Ue(e){return Q(B({title:`Calendar invitation: ${e}`,errorMessage:e}))}function $e(e){return Q(B({title:`Calendar event: ${e}`,errorMessage:e}))}const K=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,x="";function Qe(e){if(e!==x)return e;const t=K();return Intl.supportedValuesOf("timeZone").includes(t)?t:x}const Oe={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},Z={Unscheduled:"accepted",Organizer:"accepted",Accepted:"accepted",Tentative:"tentative",Declined:"declined",NeedsAction:"noReply"},Be=e=>Z[e],he={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},H="#";function Se(e,t){return t===""?e:`${e}${H}${t}`}function P(e){const t=e.indexOf(H);return t===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,t),recurrenceId:e.slice(t+1)}}const V=(e,t)=>{const n=[...e].sort((a,r)=>Date.parse(a.start)-Date.parse(r.start));return n.find(a=>Date.parse(a.end)>Date.parse(t))??n[0]};function we(e,t,n){const a=V(e.filter(r=>{const o=P(r.id);return o.calendarObjectId===t&&o.recurrenceId!==""}),n);return a?P(a.id):void 0}function q(e,t,n,a){const r=V(e.filter(o=>o.calendarObjectId===t&&Ae(o)).map(o=>ve(o,"",a)),n);if(r)return{...P(r.id),calendarId:r.calendarId,date:r.start.slice(0,10)}}function j(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:Oe[e.color]??"cal-1",...e.source==="Subscribed"?{readOnly:!0,sync:e.subscriptionEnabled?"live":"paused",syncError:e.subscriptionError}:{}}}function ve(e,t,n){return{id:Se(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.allDay?e.start.slice(0,10):N(e.start,n),end:e.allDay?e.end.slice(0,10):N(e.end,n),allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:Z[e.participation],threadId:"",threadSubject:"",timeZone:t,zoneCertainty:he[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const Ae=e=>e.status!=="Cancelled";function Ge(){const{data:e,isLoading:t,error:n,refetch:a}=C(te());return d.useMemo(()=>{const r=e?.items??[],o=r.filter(i=>i.componentSet!=="VtodoOnly"),l=o.map(j),s=r.filter(i=>i.componentSet==="VtodoOnly").map(j);return{calendars:l,taskLists:s,collections:r,colorByCalendarId:Object.fromEntries(l.map(i=>[i.id,i.color])),timeZoneByCalendarId:Object.fromEntries(r.map(i=>[i.calendarId,i.timezone])),defaultCalendarId:(o.find(i=>i.source==="Default")??o[0])?.calendarId??"",isLoading:t,error:n??null,retry:()=>{a()}}},[e,t,n,a])}const D=b(400,404,412),Ie=new Set(["calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","calendarTaskOperationsListCalendarTasks","calendarTaskDetailOperationsGetCalendarTask"]),F=e=>A(e)===412?{kind:"conflict"}:{kind:"refused",message:I(e)},ke={this:"This",following:"Following",all:"All"};function Y(){const e=v();return d.useCallback(()=>{e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&Ie.has(a)}})},[e])}const W=({scope:e,recurrenceId:t})=>e===void 0?{}:{scope:ke[e],recurrenceId:t};function ze(){const e=Y(),t=m({...ne(),meta:D,onSuccess:e}),n=m({...ae(),meta:D,onSuccess:e}),a=m({...se(),meta:D,onSuccess:e}),r=d.useCallback(s=>t.mutateAsync({body:s}).then(i=>({kind:"created",calendarObjectId:i.calendarObjectId,sends:i.sends})).catch(i=>A(i)===412?{kind:"conflict"}:{kind:"refused",message:I(i)}),[t]),o=d.useCallback((s,i)=>n.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...W(s)},headers:{"If-Match":s.etag},body:i}).then(f=>({kind:"written",sends:f.sends})).catch(F),[n]),l=d.useCallback(s=>a.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...W(s)},headers:{"If-Match":s.etag}}).then(i=>({kind:"written",sends:i.sends})).catch(F),[a]);return d.useMemo(()=>({createEvent:r,updateEvent:o,deleteEvent:l,isWriting:t.isPending||n.isPending||a.isPending}),[r,o,l,t.isPending,n.isPending,a.isPending])}const M=b(400,404),L={kind:"written"},R=e=>({kind:"refused",message:I(e)});function Ke(){const e=v(),t=Y(),n=d.useCallback(()=>e.invalidateQueries({queryKey:re()}),[e]),a=d.useCallback(()=>(t(),n()),[t,n]),r=m({...oe(),meta:M,onSuccess:n}),o=m({...ie(),meta:M,onSuccess:a}),l=m({...ce(),meta:M,onSuccess:a}),s=d.useCallback(c=>r.mutateAsync({body:c}).then(()=>L).catch(R),[r]),i=d.useCallback((c,g)=>o.mutateAsync({path:{calendarId:c},body:g}).then(()=>L).catch(R),[o]),f=d.useCallback(c=>l.mutateAsync({path:{calendarId:c}}).then(()=>L).catch(R),[l]);return d.useMemo(()=>({createCalendar:s,updateCalendar:i,deleteCalendar:f,isWriting:r.isPending||o.isPending||l.isPending}),[s,i,f,r.isPending,o.isPending,l.isPending])}const De=b(404);function Ze(e,t){const{data:n,isLoading:a,error:r,refetch:o}=C({...w({path:{calendarObjectId:e},query:{calendarId:t}}),meta:De,enabled:e!==""&&t!==""});return{resource:n,isLoading:a,error:r,refetch:()=>{o()}}}const J=b(400,404),k=5*6e4,T=({from:e,to:t,calendarIds:n})=>({query:n.length===0?{from:e,to:t}:{from:e,to:t,calendarId:[...n]}});function He(e){const{data:t,isLoading:n,error:a,refetch:r}=C({...h(T(e)),meta:J,staleTime:k,enabled:e.enabled??!0});return{instances:t?.items??[],isLoading:n,error:a,refetch:()=>{r()}}}function Ve(e,t,n){const a=G({queries:e.map(c=>({...h(T({...c,calendarIds:t})),meta:J,staleTime:k,enabled:n}))}),r=e.map(c=>c.from).join("|"),o=a.map(c=>c.data),l=a.map(c=>c.isPending).join("|"),s=a.find(c=>c.error)?.error??null,i=d.useMemo(()=>o.flatMap(c=>c?.items??[]),[r,l]),f=d.useMemo(()=>{const c=new Set;return e.forEach((g,u)=>{a[u]?.isPending&&c.add(g.from)}),c},[r,l]);return{instances:i,pendingWindows:f,error:s,refetch:()=>{for(const c of a)c.error&&c.refetch()}}}function Ye(e,t,n,a){const r=v(),o=[...n].join(",");d.useEffect(()=>{if(!a)return;const l=o===""?[]:o.split(",");for(const s of[-1,1]){const i=de(e,le(t,e,s));r.prefetchQuery({...h(T({...i,calendarIds:l})),staleTime:k})}},[r,e,t,o,a])}const Me=b(400,404);function Je(e){const t=G({queries:e.map(s=>({...ue({query:{from:s.from,to:s.to}}),meta:Me,staleTime:k}))}),n=e.map(s=>s.from).join("|"),a=t.map(s=>s.data),r=t.map(s=>s.isPending).join("|"),o=d.useMemo(()=>a.flatMap(s=>s?.items??[]),[n,r]),l=d.useMemo(()=>{const s=new Set;return e.forEach((i,f)=>{t[f]?.isPending&&s.add(i.from)}),s},[n,r]);return{spans:o,pendingWindows:l,error:t.find(s=>s.error)?.error??null,refetch:()=>{for(const s of t)s.error&&s.refetch()}}}const U=365*24*60*6e4,Le=1440*6e4,$=b(),Re=b(404),S=e=>new Date(e).toISOString().replace(/\.\d{3}Z$/,"+00:00"),Pe=e=>{const t=e instanceof Error&&e.message!==""?e.message:"no reason given",n=A(e);return n===void 0?t:`${t} (HTTP ${n})`};function Xe(e,t){const[n]=d.useState(()=>Date.now()),a=K(),r=new Date(n).toISOString(),o=C({...h({query:{from:S(n),to:S(n+U),calendarObjectId:e}}),meta:$,retry:!1,enabled:t}),l=o.data?q(o.data.items,e,r,a):void 0,s=C({...w({path:{calendarObjectId:e}}),meta:Re,retry:!1,enabled:t&&o.data!==void 0&&l===void 0}),i=Date.parse(s.data?.dtStart??""),f=s.data!==void 0&&Number.isNaN(i),c=Number.isNaN(i)?0:i-Le,g=C({...h({query:{from:S(c),to:S(c+U),calendarObjectId:e}}),meta:$,retry:!1,enabled:t&&s.data!==void 0&&!f}),u=g.data?q(g.data.items,e,r,a):void 0;if(!t)return{kind:"Idle"};if(l)return{kind:"Found",jump:l};if(u)return{kind:"Found",jump:u};const p=A(s.error)===404,_=[o.error,p?null:s.error,g.error].find(X=>X!==null);return _!==void 0?{kind:"Failed",reason:Pe(_)}:p?{kind:"Deleted"}:f?{kind:"Failed",reason:`the stored event names no readable start (${s.data?.dtStart??""})`}:g.data!==void 0?{kind:"NoOccurrenceFound"}:{kind:"Searching"}}const y=b(400,404),Te=new Set(["calendarSuggestionOperationsListCalendarSuggestions","messageCalendarSuggestionOperationsListMessageCalendarSuggestions","calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","filterOperationsListFilters"]),_e=e=>e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&Te.has(a)}});function et(e){const{data:t,isLoading:n,error:a}=C({...fe({path:{messageId:e}}),meta:y});return{suggestions:t?.items??[],isLoading:n,error:a??null}}function tt(){const{data:e,isLoading:t,error:n}=C({...be({query:{state:"Pending"}}),meta:y});return{suggestions:e?.items??[],isLoading:t,error:n??null}}const Ne=async(e,t)=>{let n;do{const{data:a}=await ye({query:{state:"Pending",continuationToken:n},signal:t,throwOnError:!0}),r=a.items.find(o=>o.suggestionId===e);if(r)return r;n=a.continuationToken}while(n);return null};function nt(e){const{data:t,isLoading:n,error:a}=C({queryKey:[{_id:"calendarSuggestionOperationsListCalendarSuggestions",suggestionId:e}],queryFn:({signal:r})=>Ne(e,r),meta:y});return{suggestion:t,isLoading:n,error:a??null}}const E={kind:"answered"},O=e=>({kind:"refused",message:I(e)});function at(){const e=v(),t=d.useCallback(()=>_e(e),[e]),n=m({...ge(),meta:y,onSuccess:t}),a=m({...pe(),meta:y,onSuccess:t}),r=m({...me(),meta:y,onSuccess:t}),o=m({...Ce(),meta:y,onSuccess:t}),l=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:p}}).then(()=>E).catch(O),[n]),s=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:p,answer:"Tentative"}}).then(()=>E).catch(O),[n]),i=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:p}).then(()=>E).catch(O),[n]),f=d.useCallback(u=>a.mutateAsync({path:{suggestionId:u}}).then(()=>E).catch(O),[a]),c=d.useCallback((u,p)=>r.mutateAsync({path:{suggestionId:u},body:{muteSender:p}}).then(()=>E).catch(O),[r]),g=d.useCallback(u=>o.mutateAsync({path:{suggestionId:u}}).then(()=>E).catch(O),[o]);return d.useMemo(()=>({accept:l,tentative:s,acceptEdited:i,decline:f,dismiss:c,reopen:g,isAnswering:n.isPending||a.isPending||r.isPending||o.isPending}),[l,s,i,f,c,g,n.isPending,a.isPending,r.isPending,o.isPending])}export{D as C,Fe as M,x as U,Y as a,Ge as b,$e as c,We as d,ze as e,K as f,Ve as g,Je as h,Se as i,tt as j,at as k,Ue as l,et as m,He as n,Ae as o,Qe as p,Ye as q,P as r,Ze as s,ve as t,Ke as u,we as v,Xe as w,Be as x,nt as y};
1
+ import{b as ee,az as Q,aA as B,f5 as N,a as C,f6 as te,r as d,e as v,s as b,f as m,f7 as ne,f8 as ae,f9 as se,aS as A,b2 as re,b0 as oe,b1 as ie,fa as ce,cj as w,fb as h,f4 as de,co as le,fc as ue,fd as fe,fe as ge,ff as pe,fg as me,fh as Ce,fi as be,fj as ye}from"./index-fsuIswbe.js";import{f as I}from"./ErrorState-BTHOmsYP.js";import{u as G}from"./useQueries-DPH-PeHV.js";const z={name:"map-pin",size:24,node:[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]};z.node;const Fe=ee(z),Ee={"cal-1":{solid:"bg-cal-1",soft:"bg-cal-1-soft",text:"text-cal-1",border:"border-cal-1",rail:"border-l-cal-1"},"cal-2":{solid:"bg-cal-2",soft:"bg-cal-2-soft",text:"text-cal-2",border:"border-cal-2",rail:"border-l-cal-2"},"cal-3":{solid:"bg-cal-3",soft:"bg-cal-3-soft",text:"text-cal-3",border:"border-cal-3",rail:"border-l-cal-3"},"cal-4":{solid:"bg-cal-4",soft:"bg-cal-4-soft",text:"text-cal-4",border:"border-cal-4",rail:"border-l-cal-4"},"cal-5":{solid:"bg-cal-5",soft:"bg-cal-5-soft",text:"text-cal-5",border:"border-cal-5",rail:"border-l-cal-5"},"cal-6":{solid:"bg-cal-6",soft:"bg-cal-6-soft",text:"text-cal-6",border:"border-cal-6",rail:"border-l-cal-6"}};function We(e){return Ee[e]}function Ue(e){return Q(B({title:`Calendar invitation: ${e}`,errorMessage:e}))}function $e(e){return Q(B({title:`Calendar event: ${e}`,errorMessage:e}))}const K=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,x="";function Qe(e){if(e!==x)return e;const t=K();return Intl.supportedValuesOf("timeZone").includes(t)?t:x}const Oe={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},Z={Unscheduled:"accepted",Organizer:"accepted",Accepted:"accepted",Tentative:"tentative",Declined:"declined",NeedsAction:"noReply"},Be=e=>Z[e],he={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},H="#";function Se(e,t){return t===""?e:`${e}${H}${t}`}function P(e){const t=e.indexOf(H);return t===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,t),recurrenceId:e.slice(t+1)}}const V=(e,t)=>{const n=[...e].sort((a,r)=>Date.parse(a.start)-Date.parse(r.start));return n.find(a=>Date.parse(a.end)>Date.parse(t))??n[0]};function we(e,t,n){const a=V(e.filter(r=>{const o=P(r.id);return o.calendarObjectId===t&&o.recurrenceId!==""}),n);return a?P(a.id):void 0}function q(e,t,n,a){const r=V(e.filter(o=>o.calendarObjectId===t&&Ae(o)).map(o=>ve(o,"",a)),n);if(r)return{...P(r.id),calendarId:r.calendarId,date:r.start.slice(0,10)}}function j(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:Oe[e.color]??"cal-1",...e.source==="Subscribed"?{readOnly:!0,sync:e.subscriptionEnabled?"live":"paused",syncError:e.subscriptionError}:{}}}function ve(e,t,n){return{id:Se(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.allDay?e.start.slice(0,10):N(e.start,n),end:e.allDay?e.end.slice(0,10):N(e.end,n),allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:Z[e.participation],threadId:"",threadSubject:"",timeZone:t,zoneCertainty:he[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const Ae=e=>e.status!=="Cancelled";function Ge(){const{data:e,isLoading:t,error:n,refetch:a}=C(te());return d.useMemo(()=>{const r=e?.items??[],o=r.filter(i=>i.componentSet!=="VtodoOnly"),l=o.map(j),s=r.filter(i=>i.componentSet==="VtodoOnly").map(j);return{calendars:l,taskLists:s,collections:r,colorByCalendarId:Object.fromEntries(l.map(i=>[i.id,i.color])),timeZoneByCalendarId:Object.fromEntries(r.map(i=>[i.calendarId,i.timezone])),defaultCalendarId:(o.find(i=>i.source==="Default")??o[0])?.calendarId??"",isLoading:t,error:n??null,retry:()=>{a()}}},[e,t,n,a])}const D=b(400,404,412),Ie=new Set(["calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","calendarTaskOperationsListCalendarTasks","calendarTaskDetailOperationsGetCalendarTask"]),F=e=>A(e)===412?{kind:"conflict"}:{kind:"refused",message:I(e)},ke={this:"This",following:"Following",all:"All"};function Y(){const e=v();return d.useCallback(()=>{e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&Ie.has(a)}})},[e])}const W=({scope:e,recurrenceId:t})=>e===void 0?{}:{scope:ke[e],recurrenceId:t};function ze(){const e=Y(),t=m({...ne(),meta:D,onSuccess:e}),n=m({...ae(),meta:D,onSuccess:e}),a=m({...se(),meta:D,onSuccess:e}),r=d.useCallback(s=>t.mutateAsync({body:s}).then(i=>({kind:"created",calendarObjectId:i.calendarObjectId,sends:i.sends})).catch(i=>A(i)===412?{kind:"conflict"}:{kind:"refused",message:I(i)}),[t]),o=d.useCallback((s,i)=>n.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...W(s)},headers:{"If-Match":s.etag},body:i}).then(f=>({kind:"written",sends:f.sends})).catch(F),[n]),l=d.useCallback(s=>a.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...W(s)},headers:{"If-Match":s.etag}}).then(i=>({kind:"written",sends:i.sends})).catch(F),[a]);return d.useMemo(()=>({createEvent:r,updateEvent:o,deleteEvent:l,isWriting:t.isPending||n.isPending||a.isPending}),[r,o,l,t.isPending,n.isPending,a.isPending])}const M=b(400,404),L={kind:"written"},R=e=>({kind:"refused",message:I(e)});function Ke(){const e=v(),t=Y(),n=d.useCallback(()=>e.invalidateQueries({queryKey:re()}),[e]),a=d.useCallback(()=>(t(),n()),[t,n]),r=m({...oe(),meta:M,onSuccess:n}),o=m({...ie(),meta:M,onSuccess:a}),l=m({...ce(),meta:M,onSuccess:a}),s=d.useCallback(c=>r.mutateAsync({body:c}).then(()=>L).catch(R),[r]),i=d.useCallback((c,g)=>o.mutateAsync({path:{calendarId:c},body:g}).then(()=>L).catch(R),[o]),f=d.useCallback(c=>l.mutateAsync({path:{calendarId:c}}).then(()=>L).catch(R),[l]);return d.useMemo(()=>({createCalendar:s,updateCalendar:i,deleteCalendar:f,isWriting:r.isPending||o.isPending||l.isPending}),[s,i,f,r.isPending,o.isPending,l.isPending])}const De=b(404);function Ze(e,t){const{data:n,isLoading:a,error:r,refetch:o}=C({...w({path:{calendarObjectId:e},query:{calendarId:t}}),meta:De,enabled:e!==""&&t!==""});return{resource:n,isLoading:a,error:r,refetch:()=>{o()}}}const J=b(400,404),k=5*6e4,T=({from:e,to:t,calendarIds:n})=>({query:n.length===0?{from:e,to:t}:{from:e,to:t,calendarId:[...n]}});function He(e){const{data:t,isLoading:n,error:a,refetch:r}=C({...h(T(e)),meta:J,staleTime:k,enabled:e.enabled??!0});return{instances:t?.items??[],isLoading:n,error:a,refetch:()=>{r()}}}function Ve(e,t,n){const a=G({queries:e.map(c=>({...h(T({...c,calendarIds:t})),meta:J,staleTime:k,enabled:n}))}),r=e.map(c=>c.from).join("|"),o=a.map(c=>c.data),l=a.map(c=>c.isPending).join("|"),s=a.find(c=>c.error)?.error??null,i=d.useMemo(()=>o.flatMap(c=>c?.items??[]),[r,l]),f=d.useMemo(()=>{const c=new Set;return e.forEach((g,u)=>{a[u]?.isPending&&c.add(g.from)}),c},[r,l]);return{instances:i,pendingWindows:f,error:s,refetch:()=>{for(const c of a)c.error&&c.refetch()}}}function Ye(e,t,n,a){const r=v(),o=[...n].join(",");d.useEffect(()=>{if(!a)return;const l=o===""?[]:o.split(",");for(const s of[-1,1]){const i=de(e,le(t,e,s));r.prefetchQuery({...h(T({...i,calendarIds:l})),staleTime:k})}},[r,e,t,o,a])}const Me=b(400,404);function Je(e){const t=G({queries:e.map(s=>({...ue({query:{from:s.from,to:s.to}}),meta:Me,staleTime:k}))}),n=e.map(s=>s.from).join("|"),a=t.map(s=>s.data),r=t.map(s=>s.isPending).join("|"),o=d.useMemo(()=>a.flatMap(s=>s?.items??[]),[n,r]),l=d.useMemo(()=>{const s=new Set;return e.forEach((i,f)=>{t[f]?.isPending&&s.add(i.from)}),s},[n,r]);return{spans:o,pendingWindows:l,error:t.find(s=>s.error)?.error??null,refetch:()=>{for(const s of t)s.error&&s.refetch()}}}const U=365*24*60*6e4,Le=1440*6e4,$=b(),Re=b(404),S=e=>new Date(e).toISOString().replace(/\.\d{3}Z$/,"+00:00"),Pe=e=>{const t=e instanceof Error&&e.message!==""?e.message:"no reason given",n=A(e);return n===void 0?t:`${t} (HTTP ${n})`};function Xe(e,t){const[n]=d.useState(()=>Date.now()),a=K(),r=new Date(n).toISOString(),o=C({...h({query:{from:S(n),to:S(n+U),calendarObjectId:e}}),meta:$,retry:!1,enabled:t}),l=o.data?q(o.data.items,e,r,a):void 0,s=C({...w({path:{calendarObjectId:e}}),meta:Re,retry:!1,enabled:t&&o.data!==void 0&&l===void 0}),i=Date.parse(s.data?.dtStart??""),f=s.data!==void 0&&Number.isNaN(i),c=Number.isNaN(i)?0:i-Le,g=C({...h({query:{from:S(c),to:S(c+U),calendarObjectId:e}}),meta:$,retry:!1,enabled:t&&s.data!==void 0&&!f}),u=g.data?q(g.data.items,e,r,a):void 0;if(!t)return{kind:"Idle"};if(l)return{kind:"Found",jump:l};if(u)return{kind:"Found",jump:u};const p=A(s.error)===404,_=[o.error,p?null:s.error,g.error].find(X=>X!==null);return _!==void 0?{kind:"Failed",reason:Pe(_)}:p?{kind:"Deleted"}:f?{kind:"Failed",reason:`the stored event names no readable start (${s.data?.dtStart??""})`}:g.data!==void 0?{kind:"NoOccurrenceFound"}:{kind:"Searching"}}const y=b(400,404),Te=new Set(["calendarSuggestionOperationsListCalendarSuggestions","messageCalendarSuggestionOperationsListMessageCalendarSuggestions","calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","filterOperationsListFilters"]),_e=e=>e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&Te.has(a)}});function et(e){const{data:t,isLoading:n,error:a}=C({...fe({path:{messageId:e}}),meta:y});return{suggestions:t?.items??[],isLoading:n,error:a??null}}function tt(){const{data:e,isLoading:t,error:n}=C({...be({query:{state:"Pending"}}),meta:y});return{suggestions:e?.items??[],isLoading:t,error:n??null}}const Ne=async(e,t)=>{let n;do{const{data:a}=await ye({query:{state:"Pending",continuationToken:n},signal:t,throwOnError:!0}),r=a.items.find(o=>o.suggestionId===e);if(r)return r;n=a.continuationToken}while(n);return null};function nt(e){const{data:t,isLoading:n,error:a}=C({queryKey:[{_id:"calendarSuggestionOperationsListCalendarSuggestions",suggestionId:e}],queryFn:({signal:r})=>Ne(e,r),meta:y});return{suggestion:t,isLoading:n,error:a??null}}const E={kind:"answered"},O=e=>({kind:"refused",message:I(e)});function at(){const e=v(),t=d.useCallback(()=>_e(e),[e]),n=m({...ge(),meta:y,onSuccess:t}),a=m({...pe(),meta:y,onSuccess:t}),r=m({...me(),meta:y,onSuccess:t}),o=m({...Ce(),meta:y,onSuccess:t}),l=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:p}}).then(()=>E).catch(O),[n]),s=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:p,answer:"Tentative"}}).then(()=>E).catch(O),[n]),i=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:p}).then(()=>E).catch(O),[n]),f=d.useCallback(u=>a.mutateAsync({path:{suggestionId:u}}).then(()=>E).catch(O),[a]),c=d.useCallback((u,p)=>r.mutateAsync({path:{suggestionId:u},body:{muteSender:p}}).then(()=>E).catch(O),[r]),g=d.useCallback(u=>o.mutateAsync({path:{suggestionId:u}}).then(()=>E).catch(O),[o]);return d.useMemo(()=>({accept:l,tentative:s,acceptEdited:i,decline:f,dismiss:c,reopen:g,isAnswering:n.isPending||a.isPending||r.isPending||o.isPending}),[l,s,i,f,c,g,n.isPending,a.isPending,r.isPending,o.isPending])}export{D as C,Fe as M,x as U,Y as a,Ge as b,$e as c,We as d,ze as e,K as f,Ve as g,Je as h,Se as i,tt as j,at as k,Ue as l,et as m,He as n,Ae as o,Qe as p,Ye as q,P as r,Ze as s,ve as t,Ke as u,we as v,Xe as w,Be as x,nt as y};
@@ -1 +1 @@
1
- import{r as u,j as O,p as v,f as y,fn as P,fo as q,fp as W,a as E,fq as R,aS as I,fr as j,s as D}from"./index-9QMShYZC.js";import{a as z,C as k}from"./useCalendarSuggestions-dbmN8tRh.js";import{f as B}from"./ErrorState-DHsQU1XS.js";const i=8,x=(e,t,a)=>Math.min(Math.max(e,t),Math.max(t,a)),G=(e,t)=>e.width>0&&e.height>0&&e.left<t.width&&e.left+e.width>0&&e.top<t.height&&e.top+e.height>0;function C(e,t){return{left:Math.max(i,(t.width-e.width)/2),top:Math.max(i,(t.height-e.height)/2),side:"center"}}function H(e,t,a){if(!e||!G(e,a))return C(t,a);const r=x(e.top,i,a.height-t.height-i),c=e.left+e.width+i;if(c+t.width<=a.width-i)return{left:c,top:r,side:"right"};const f=e.left-i-t.width;if(f>=i)return{left:f,top:r,side:"left"};const l=x(e.left,i,a.width-t.width-i),s=e.top+e.height+i;if(s+t.height<=a.height-i)return{left:l,top:s,side:"below"};const h=e.top-i-t.height;return h>=i?{left:l,top:h,side:"above"}:C(t,a)}const N='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function _({anchor:e,anchorKey:t,labelledBy:a,children:r,header:c,wrapTab:f=!1,panelRef:l,className:s}){const h=u.useRef(null),[w,M]=u.useState(null),[p,A]=u.useState({key:t,x:0,y:0}),g=p.key===t?p:{x:0,y:0};u.useLayoutEffect(()=>{const n=h.current;if(!n||t==="")return;const d=()=>{const o=(typeof e=="string"?document.querySelector(e):e)?.getBoundingClientRect();M(H(o?{left:o.left,top:o.top,width:o.width,height:o.height}:null,{width:n.offsetWidth,height:n.offsetHeight},{width:window.innerWidth,height:window.innerHeight}))};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[e,t]);const S=n=>{if(n.button!==0||n.target instanceof Element&&n.target.closest("button, input, select, a"))return;n.preventDefault();const d={x:n.clientX-g.x,y:n.clientY-g.y},m=b=>A({key:t,x:b.clientX-d.x,y:b.clientY-d.y}),o=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",o)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",o)},L=n=>{if(!f||n.key!=="Tab")return;const d=Array.from(n.currentTarget.querySelectorAll(N));if(d.length===0)return;const m=d[0],o=d[d.length-1];n.shiftKey&&document.activeElement===m?(n.preventDefault(),o.focus()):!n.shiftKey&&document.activeElement===o&&(n.preventDefault(),m.focus())};return O.jsxs("div",{ref:n=>{h.current=n,typeof l=="function"?l(n):l&&(l.current=n)},role:"dialog","aria-modal":"false","aria-labelledby":a,"data-calendar-popover":"",onKeyDown:L,className:v("fixed z-40 w-[26rem] max-w-[calc(100vw-1rem)] rounded-xl border border-line bg-surface-raised text-fg shadow-xl shadow-black/20",w===null&&"opacity-0",s),style:{left:(w?.left??0)+g.x,top:(w?.top??0)+g.y},children:[c?.({onPointerDown:S}),r]})}const F=e=>({calendarTaskId:e.calendarTaskId,calendarId:e.calendarId,title:e.summary,due:e.allDay?e.due.slice(0,10):e.dueAt,allDay:e.allDay,completed:e.completed});function Q(e,t=!0){const{data:a,error:r,refetch:c}=E({...R({query:{from:e.from,to:e.to}}),meta:D(400,404),enabled:t});return{tasks:u.useMemo(()=>a?.items??[],[a?.items]),error:r,refetch:c}}function V(e){const{data:t,error:a,refetch:r}=E({...j({path:{calendarTaskId:e}}),meta:D(404),retry:!1});return t?{kind:"found",task:t}:a===null?{kind:"loading"}:I(a)===404?{kind:"gone"}:{kind:"failed",error:a,retry:()=>{r()}}}const T=e=>({kind:"refused",message:I(e)===412?"This task changed while you were looking at it. Close it and open it again.":B(e)});function J(){const e=z(),t=y({...P(),meta:k,onSuccess:e}),a=y({...q(),meta:k,onSuccess:e}),r=y({...W(),meta:k,onSuccess:e}),c=u.useCallback(s=>t.mutateAsync({body:s}).then(()=>({kind:"written"})).catch(T),[t]),f=u.useCallback((s,h)=>a.mutateAsync({path:{calendarTaskId:s.calendarTaskId},query:{calendarId:s.calendarId},headers:{"If-Match":s.etag},body:h}).then(()=>({kind:"written"})).catch(T),[a]),l=u.useCallback(s=>r.mutateAsync({path:{calendarTaskId:s.calendarTaskId},query:{calendarId:s.calendarId},headers:{"If-Match":s.etag}}).then(()=>({kind:"written"})).catch(T),[r]);return{createTask:c,updateTask:f,deleteTask:l,isWriting:t.isPending||a.isPending||r.isPending}}export{_ as C,Q as a,V as b,F as t,J as u};
1
+ import{r as u,j as O,p as v,f as y,fn as P,fo as q,fp as W,a as E,fq as R,aS as I,fr as j,s as D}from"./index-fsuIswbe.js";import{a as z,C as k}from"./useCalendarSuggestions-DXbA0boT.js";import{f as B}from"./ErrorState-BTHOmsYP.js";const i=8,x=(e,t,a)=>Math.min(Math.max(e,t),Math.max(t,a)),G=(e,t)=>e.width>0&&e.height>0&&e.left<t.width&&e.left+e.width>0&&e.top<t.height&&e.top+e.height>0;function C(e,t){return{left:Math.max(i,(t.width-e.width)/2),top:Math.max(i,(t.height-e.height)/2),side:"center"}}function H(e,t,a){if(!e||!G(e,a))return C(t,a);const r=x(e.top,i,a.height-t.height-i),c=e.left+e.width+i;if(c+t.width<=a.width-i)return{left:c,top:r,side:"right"};const f=e.left-i-t.width;if(f>=i)return{left:f,top:r,side:"left"};const l=x(e.left,i,a.width-t.width-i),s=e.top+e.height+i;if(s+t.height<=a.height-i)return{left:l,top:s,side:"below"};const h=e.top-i-t.height;return h>=i?{left:l,top:h,side:"above"}:C(t,a)}const N='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function _({anchor:e,anchorKey:t,labelledBy:a,children:r,header:c,wrapTab:f=!1,panelRef:l,className:s}){const h=u.useRef(null),[w,M]=u.useState(null),[p,A]=u.useState({key:t,x:0,y:0}),g=p.key===t?p:{x:0,y:0};u.useLayoutEffect(()=>{const n=h.current;if(!n||t==="")return;const d=()=>{const o=(typeof e=="string"?document.querySelector(e):e)?.getBoundingClientRect();M(H(o?{left:o.left,top:o.top,width:o.width,height:o.height}:null,{width:n.offsetWidth,height:n.offsetHeight},{width:window.innerWidth,height:window.innerHeight}))};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[e,t]);const S=n=>{if(n.button!==0||n.target instanceof Element&&n.target.closest("button, input, select, a"))return;n.preventDefault();const d={x:n.clientX-g.x,y:n.clientY-g.y},m=b=>A({key:t,x:b.clientX-d.x,y:b.clientY-d.y}),o=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",o)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",o)},L=n=>{if(!f||n.key!=="Tab")return;const d=Array.from(n.currentTarget.querySelectorAll(N));if(d.length===0)return;const m=d[0],o=d[d.length-1];n.shiftKey&&document.activeElement===m?(n.preventDefault(),o.focus()):!n.shiftKey&&document.activeElement===o&&(n.preventDefault(),m.focus())};return O.jsxs("div",{ref:n=>{h.current=n,typeof l=="function"?l(n):l&&(l.current=n)},role:"dialog","aria-modal":"false","aria-labelledby":a,"data-calendar-popover":"",onKeyDown:L,className:v("fixed z-40 w-[26rem] max-w-[calc(100vw-1rem)] rounded-xl border border-line bg-surface-raised text-fg shadow-xl shadow-black/20",w===null&&"opacity-0",s),style:{left:(w?.left??0)+g.x,top:(w?.top??0)+g.y},children:[c?.({onPointerDown:S}),r]})}const F=e=>({calendarTaskId:e.calendarTaskId,calendarId:e.calendarId,title:e.summary,due:e.allDay?e.due.slice(0,10):e.dueAt,allDay:e.allDay,completed:e.completed});function Q(e,t=!0){const{data:a,error:r,refetch:c}=E({...R({query:{from:e.from,to:e.to}}),meta:D(400,404),enabled:t});return{tasks:u.useMemo(()=>a?.items??[],[a?.items]),error:r,refetch:c}}function V(e){const{data:t,error:a,refetch:r}=E({...j({path:{calendarTaskId:e}}),meta:D(404),retry:!1});return t?{kind:"found",task:t}:a===null?{kind:"loading"}:I(a)===404?{kind:"gone"}:{kind:"failed",error:a,retry:()=>{r()}}}const T=e=>({kind:"refused",message:I(e)===412?"This task changed while you were looking at it. Close it and open it again.":B(e)});function J(){const e=z(),t=y({...P(),meta:k,onSuccess:e}),a=y({...q(),meta:k,onSuccess:e}),r=y({...W(),meta:k,onSuccess:e}),c=u.useCallback(s=>t.mutateAsync({body:s}).then(()=>({kind:"written"})).catch(T),[t]),f=u.useCallback((s,h)=>a.mutateAsync({path:{calendarTaskId:s.calendarTaskId},query:{calendarId:s.calendarId},headers:{"If-Match":s.etag},body:h}).then(()=>({kind:"written"})).catch(T),[a]),l=u.useCallback(s=>r.mutateAsync({path:{calendarTaskId:s.calendarTaskId},query:{calendarId:s.calendarId},headers:{"If-Match":s.etag}}).then(()=>({kind:"written"})).catch(T),[r]);return{createTask:c,updateTask:f,deleteTask:l,isWriting:t.isPending||a.isPending||r.isPending}}export{_ as C,Q as a,V as b,F as t,J as u};
@@ -1 +1 @@
1
- import{j as a,d as U,B as C,aS as k,az as x,aA as N,c8 as E,b3 as n,bU as P,s as y,c9 as w,a as K,c3 as I,r as M,bN as S,e as g,f as u,ca as A,cb as B,cc as $}from"./index-9QMShYZC.js";function V({title:e,message:s,reportHref:t,onRetry:r,retryLabel:o="Retry",retryRef:c}){return a.jsxs(U,{tone:"danger",variant:"soft",children:[a.jsx("p",{className:"font-medium",children:e}),a.jsx("p",{className:"mt-0.5 break-words text-fg-muted",children:s}),a.jsxs("p",{className:"flex flex-wrap items-center gap-x-4",children:[r&&a.jsx(C,{ref:c,variant:"secondary",className:"min-h-11",onClick:r,children:o}),a.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"inline-flex min-h-11 items-center font-medium text-accent hover:underline",children:"Report an issue"})]})]})}const L=y(403),d={...y(400,403,404,409,422,429),...E},v=e=>k(e)===403,i=e=>e.state==="NotConfigured"?{presetId:void 0,sources:void 0}:e.state==="Unrunnable"?{presetId:e.presetId,sources:void 0}:{presetId:e.presetId,sources:e.sources},O=(e,s)=>{const t=i(e);return t.presetId===s?t.sources:void 0},f=(e,s)=>e.state==="Configured"&&e.sources[s]===n.Saved?e[s]:"",R=(e,s,t)=>e.state==="Configured"&&e.presetId===s&&e[t]!==""?e[t]:void 0,F=e=>({presetId:i(e).presetId,model:f(e,"model"),baseUrl:f(e,"baseUrl"),apiKey:""}),G=(e,s)=>i(s).presetId===e.presetId?F(s):{presetId:e.presetId,model:"",baseUrl:"",apiKey:""},Y=e=>e.state==="Unrunnable"?!0:e.state==="NotConfigured"?!1:Object.values(e.sources).includes(n.Saved),j={Hosted:"Hosted",Custom:"Your own endpoint",Local:"Self-hosted"},z=e=>{const s=[];for(const t of e){const r=s.find(o=>o.group===t.group);if(r){r.presets.push(t);continue}s.push({group:t.group,label:j[t.group],presets:[t]})}return s},D=e=>e.defaultBaseUrl===void 0,X=(e,s)=>s===n.Saved?`${e} Saved by you.`:s===n.Deployment?`${e} Provided by the deployment.`:e,T="Paste an API key",Z=e=>w(e)?.code==="ClassificationApiKeyRequired",p="Enter a URL that starts with http:// or https://",q=e=>{if(!URL.canParse(e))return!1;const{protocol:s}=new URL(e);return s==="http:"||s==="https:"},J=(e,s,t)=>{const r=e.baseUrl.trim(),o=e.apiKey.trim(),c=O(t,s.presetId);if(r!==""&&!q(r))return{ok:!1,field:"BaseUrl",message:p};if(r===""&&D(s)&&R(t,s.presetId,"baseUrl")===void 0)return{ok:!1,field:"BaseUrl",message:p};const b=c?.apiKey??n.Default;return s.needsKey&&o===""&&b===n.Default?{ok:!1,field:"ApiKey",message:T}:{ok:!0,body:{...i(t).presetId!==s.presetId?{classificationPresetId:s.presetId}:{},classificationModel:e.model.trim(),classificationBaseUrl:r,...s.needsKey&&o!==""?{classificationApiKey:o}:{}}}},W=(e,s,t)=>{const r=i(e).presetId;if(!(r===void 0||s===void 0)&&r!==s)return t.find(o=>o.presetId===r)},ee=e=>{const s=e.status===void 0?e.kind:`${e.status}`;return`Test failed after ${e.latencyMs} ms: ${s}`},se=(e,s)=>x(N({title:`Mail classification: ${e}`,errorMessage:`${e}. ${s}`})),te=e=>{const s=e.needsKey?"Needs an API key.":"No key needed.";if(e.price.state!=="Priced")return s;const t=new Intl.NumberFormat("en",{style:"currency",currency:e.price.currency,maximumFractionDigits:4}).format(e.price.perMillionInputTokens);return`${s} ${t} per million input tokens.`},m="Enter a whole number of 1 or more.",H=2147483647,re=e=>{const s=e.trim();if(!/^\d+$/.test(s))return{ok:!1,message:m};const t=Number(s);return t<1||t>H?{ok:!1,message:m}:{ok:!0,limit:t}},oe=e=>e.calls>=e.dailyLimit,ae=(e,s)=>{const{cost:t}=e;if(t.state==="Priced"){const r=new Intl.NumberFormat("en",{style:"currency",currency:t.currency,maximumFractionDigits:2});return t.amount>0&&t.amount<.01?`under ${r.format(.01)}`:t.amount===0?r.format(0):`about ${r.format(t.amount)}`}return s?.group==="Local"?"no price, self-hosted":"no price"},ne=e=>P(e,{hour:"2-digit",minute:"2-digit",timeZoneName:"shortOffset"}),l=e=>{v(e)&&S()},h=e=>s=>{e.setQueryData(I().queryKey,s)},ie=()=>{const e=K({...I(),meta:L}),s=e.isError&&v(e.error);return M.useEffect(()=>{s&&S()},[s]),{...e,signedOut:s}},ce=()=>{const e=g();return u({...A(),meta:d,onSuccess:h(e),onError:l})},ue=()=>{const e=g();return u({...B(),meta:d,onSuccess:h(e),onError:l})},de=()=>u({...$(),meta:d,onError:l});export{V as F,T as P,ue as a,te as b,se as c,F as d,i as e,de as f,z as g,Y as h,G as i,O as j,R as k,J as l,Z as m,D as n,ie as o,re as p,oe as q,ne as r,W as s,ee as t,ce as u,ae as v,X as w};
1
+ import{j as a,d as U,B as C,aS as k,az as x,aA as N,c8 as E,b3 as n,bU as P,s as y,c9 as w,a as K,c3 as I,r as M,bN as S,e as g,f as u,ca as A,cb as B,cc as $}from"./index-fsuIswbe.js";function V({title:e,message:s,reportHref:t,onRetry:r,retryLabel:o="Retry",retryRef:c}){return a.jsxs(U,{tone:"danger",variant:"soft",children:[a.jsx("p",{className:"font-medium",children:e}),a.jsx("p",{className:"mt-0.5 break-words text-fg-muted",children:s}),a.jsxs("p",{className:"flex flex-wrap items-center gap-x-4",children:[r&&a.jsx(C,{ref:c,variant:"secondary",className:"min-h-11",onClick:r,children:o}),a.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"inline-flex min-h-11 items-center font-medium text-accent hover:underline",children:"Report an issue"})]})]})}const L=y(403),d={...y(400,403,404,409,422,429),...E},v=e=>k(e)===403,i=e=>e.state==="NotConfigured"?{presetId:void 0,sources:void 0}:e.state==="Unrunnable"?{presetId:e.presetId,sources:void 0}:{presetId:e.presetId,sources:e.sources},O=(e,s)=>{const t=i(e);return t.presetId===s?t.sources:void 0},f=(e,s)=>e.state==="Configured"&&e.sources[s]===n.Saved?e[s]:"",R=(e,s,t)=>e.state==="Configured"&&e.presetId===s&&e[t]!==""?e[t]:void 0,F=e=>({presetId:i(e).presetId,model:f(e,"model"),baseUrl:f(e,"baseUrl"),apiKey:""}),G=(e,s)=>i(s).presetId===e.presetId?F(s):{presetId:e.presetId,model:"",baseUrl:"",apiKey:""},Y=e=>e.state==="Unrunnable"?!0:e.state==="NotConfigured"?!1:Object.values(e.sources).includes(n.Saved),j={Hosted:"Hosted",Custom:"Your own endpoint",Local:"Self-hosted"},z=e=>{const s=[];for(const t of e){const r=s.find(o=>o.group===t.group);if(r){r.presets.push(t);continue}s.push({group:t.group,label:j[t.group],presets:[t]})}return s},D=e=>e.defaultBaseUrl===void 0,X=(e,s)=>s===n.Saved?`${e} Saved by you.`:s===n.Deployment?`${e} Provided by the deployment.`:e,T="Paste an API key",Z=e=>w(e)?.code==="ClassificationApiKeyRequired",p="Enter a URL that starts with http:// or https://",q=e=>{if(!URL.canParse(e))return!1;const{protocol:s}=new URL(e);return s==="http:"||s==="https:"},J=(e,s,t)=>{const r=e.baseUrl.trim(),o=e.apiKey.trim(),c=O(t,s.presetId);if(r!==""&&!q(r))return{ok:!1,field:"BaseUrl",message:p};if(r===""&&D(s)&&R(t,s.presetId,"baseUrl")===void 0)return{ok:!1,field:"BaseUrl",message:p};const b=c?.apiKey??n.Default;return s.needsKey&&o===""&&b===n.Default?{ok:!1,field:"ApiKey",message:T}:{ok:!0,body:{...i(t).presetId!==s.presetId?{classificationPresetId:s.presetId}:{},classificationModel:e.model.trim(),classificationBaseUrl:r,...s.needsKey&&o!==""?{classificationApiKey:o}:{}}}},W=(e,s,t)=>{const r=i(e).presetId;if(!(r===void 0||s===void 0)&&r!==s)return t.find(o=>o.presetId===r)},ee=e=>{const s=e.status===void 0?e.kind:`${e.status}`;return`Test failed after ${e.latencyMs} ms: ${s}`},se=(e,s)=>x(N({title:`Mail classification: ${e}`,errorMessage:`${e}. ${s}`})),te=e=>{const s=e.needsKey?"Needs an API key.":"No key needed.";if(e.price.state!=="Priced")return s;const t=new Intl.NumberFormat("en",{style:"currency",currency:e.price.currency,maximumFractionDigits:4}).format(e.price.perMillionInputTokens);return`${s} ${t} per million input tokens.`},m="Enter a whole number of 1 or more.",H=2147483647,re=e=>{const s=e.trim();if(!/^\d+$/.test(s))return{ok:!1,message:m};const t=Number(s);return t<1||t>H?{ok:!1,message:m}:{ok:!0,limit:t}},oe=e=>e.calls>=e.dailyLimit,ae=(e,s)=>{const{cost:t}=e;if(t.state==="Priced"){const r=new Intl.NumberFormat("en",{style:"currency",currency:t.currency,maximumFractionDigits:2});return t.amount>0&&t.amount<.01?`under ${r.format(.01)}`:t.amount===0?r.format(0):`about ${r.format(t.amount)}`}return s?.group==="Local"?"no price, self-hosted":"no price"},ne=e=>P(e,{hour:"2-digit",minute:"2-digit",timeZoneName:"shortOffset"}),l=e=>{v(e)&&S()},h=e=>s=>{e.setQueryData(I().queryKey,s)},ie=()=>{const e=K({...I(),meta:L}),s=e.isError&&v(e.error);return M.useEffect(()=>{s&&S()},[s]),{...e,signedOut:s}},ce=()=>{const e=g();return u({...A(),meta:d,onSuccess:h(e),onError:l})},ue=()=>{const e=g();return u({...B(),meta:d,onSuccess:h(e),onError:l})},de=()=>u({...$(),meta:d,onError:l});export{V as F,T as P,ue as a,te as b,se as c,F as d,i as e,de as f,z as g,Y as h,G as i,O as j,R as k,J as l,Z as m,D as n,ie as o,re as p,oe as q,ne as r,W as s,ee as t,ce as u,ae as v,X as w};
@@ -1 +1 @@
1
- import{r as u,c7 as i,d6 as c,a as g}from"./index-9QMShYZC.js";import{u as T}from"./useQueries-B2w-f15M.js";import{u as q}from"./useInfiniteQuery-CneHLmnO.js";const s=(e,t)=>({...t,...e,order:"desc"}),P=(e,t={})=>c({query:s(e,t)});function M(e,t={}){const{data:r,isLoading:n,isError:o,error:y,refetch:f,fetchNextPage:m,hasNextPage:p,isFetchingNextPage:h}=q({queryKey:P(e,t),queryFn:async({pageParam:a})=>{const{data:l}=await i({query:{...s(e,t),continuationToken:a},throwOnError:!0});return l},initialPageParam:void 0,getNextPageParam:a=>a.continuationToken,staleTime:6e4});return{threads:u.useMemo(()=>(r?.pages??[]).flatMap(a=>a.items??[]),[r]),isLoading:n,isError:o,error:y,refetch:f,fetchNextPage:m,hasNextPage:p,isFetchingNextPage:h}}function E(e,t={}){const{data:r}=g(d(e,t));return r?.count}function K(e){const t=T({queries:e.map(r=>d({labelId:r})),combine:x});return u.useMemo(()=>new Map(e.flatMap((r,n)=>{const o=t[n];return o===void 0?[]:[[r,o]]})),[e,t])}const x=e=>e.map(t=>t.data?.count);function d(e,t={}){const r={...s(e,t),unread:!0,count:!0,results:!1};return{queryKey:c({query:r}),queryFn:async()=>{const{data:n}=await i({query:r,throwOnError:!0});return n},staleTime:6e4}}export{M as a,E as b,K as u};
1
+ import{r as u,c7 as i,d6 as c,a as g}from"./index-fsuIswbe.js";import{u as T}from"./useQueries-DPH-PeHV.js";import{u as q}from"./useInfiniteQuery-B-vOuANs.js";const s=(e,t)=>({...t,...e,order:"desc"}),P=(e,t={})=>c({query:s(e,t)});function M(e,t={}){const{data:r,isLoading:n,isError:o,error:y,refetch:f,fetchNextPage:m,hasNextPage:p,isFetchingNextPage:h}=q({queryKey:P(e,t),queryFn:async({pageParam:a})=>{const{data:l}=await i({query:{...s(e,t),continuationToken:a},throwOnError:!0});return l},initialPageParam:void 0,getNextPageParam:a=>a.continuationToken,staleTime:6e4});return{threads:u.useMemo(()=>(r?.pages??[]).flatMap(a=>a.items??[]),[r]),isLoading:n,isError:o,error:y,refetch:f,fetchNextPage:m,hasNextPage:p,isFetchingNextPage:h}}function E(e,t={}){const{data:r}=g(d(e,t));return r?.count}function K(e){const t=T({queries:e.map(r=>d({labelId:r})),combine:x});return u.useMemo(()=>new Map(e.flatMap((r,n)=>{const o=t[n];return o===void 0?[]:[[r,o]]})),[e,t])}const x=e=>e.map(t=>t.data?.count);function d(e,t={}){const r={...s(e,t),unread:!0,count:!0,results:!1};return{queryKey:c({query:r}),queryFn:async()=>{const{data:n}=await i({query:r,throwOnError:!0});return n},staleTime:6e4}}export{M as a,E as b,K as u};
@@ -1 +1 @@
1
- import{r as o}from"./index-9QMShYZC.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-fsuIswbe.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{j as u,eU as x,X as E,p as M,eV as z,eW as L,ar as w,B as O,r as p,f as v,eX as T,a as D,eY as R,eZ as $,e_ as _,e$ as J,e as S,f0 as U,f1 as q,f2 as B,bd as K}from"./index-9QMShYZC.js";import{u as Q,S as H}from"./suggest-list-BU1CAWaS.js";import{S as W}from"./select-Bar5gCGO.js";import{P as X}from"./plus-ivySO7aD.js";const P="inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs";function pe({clause:e,onEdit:t,onRemove:r}){return u.jsxs("span",{className:M(P,e.derived?"border-dashed border-line-strong bg-surface-sunken":"border-line bg-surface"),children:[u.jsxs("button",{type:"button",onClick:t,"aria-label":`Edit ${x(e.field)} clause`,className:"flex items-center gap-1 text-left",children:[u.jsx("span",{className:"font-medium text-fg-muted",children:x(e.field)}),u.jsx("span",{className:"text-fg",children:e.value})]}),e.derived&&u.jsx("span",{className:"text-2xs text-fg-subtle",children:"from sender"}),r&&u.jsx("button",{type:"button",onClick:r,"aria-label":`Remove ${x(e.field)} clause`,className:"flex size-4 items-center justify-center rounded-full text-fg-subtle hover:bg-surface-sunken hover:text-fg-muted",children:u.jsx(E,{className:"size-3"})})]})}function fe({label:e,onClick:t}){return u.jsxs("button",{type:"button",onClick:t,className:M(P,"border-dashed border-line-strong text-fg-muted hover:border-accent-2 hover:text-accent-2"),children:[u.jsx(X,{className:"size-3","aria-hidden":"true"}),e]})}function be({draft:e,mode:t,fields:r=L,suggestions:s=[],onChangeField:o,onChangeValue:a,onSubmit:n,onCancel:c}){const d=z(e.field),l=Q({count:s.length,onAccept:i=>a?.(s[i].value)});return u.jsxs("div",{className:"space-y-1.5 rounded-lg border border-accent-2 bg-surface p-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(W,{"aria-label":"Clause field",value:e.field,onChange:i=>o?.(i.target.value),className:"h-8 w-32 shrink-0",children:r.map(i=>u.jsx("option",{value:i,children:x(i)},i))}),u.jsx(w,{"aria-label":"Clause value",value:e.value,placeholder:"value…",autoComplete:"off",onChange:i=>{l.reopen(),a?.(i.target.value)},onKeyDown:i=>{l.handleKeyDown(i)||i.key==="Enter"&&n?.()},className:"h-8 min-w-40 flex-1",...l.comboboxProps}),u.jsx(O,{variant:"primary",size:"sm",onClick:n,disabled:e.value.trim()==="",className:"shrink-0",children:t==="add"?"Add":"Save"}),u.jsx(O,{variant:"ghost",size:"sm",onClick:c,"aria-label":"Cancel clause edit",icon:u.jsx(E,{className:"size-4"}),className:"shrink-0 px-2"})]}),l.open&&u.jsx(H,{id:l.listId,suggestions:s,activeIndex:l.activeIndex,optionId:l.optionId,onPick:i=>{a?.(i.value),l.dismiss()},onHighlight:l.setActiveIndex,label:`${x(e.field)} suggestions`}),d&&u.jsx("p",{className:"px-0.5 text-2xs text-fg-subtle",children:d})]})}const ge=(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},N={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."},he=e=>e.disabledReason==="None"?void 0:(e.disabledReason==="AwaitingFolder"||e.disabledReason==="FolderCreateFailed")&&e.actionMailboxId!=="None"?N.UserDisabled:N[e.disabledReason],xe=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"})},j=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,o,a]=r,n=new Date(Number(s),Number(o)-1,Number(a),23,59,59,0);if(Number.isNaN(n.getTime()))return;const c=-t.getTimezoneOffset(),d=c>=0?"+":"-",l=Math.abs(c),i=String(Math.floor(l/60)).padStart(2,"0"),f=String(l%60).padStart(2,"0"),m=b=>String(b).padStart(2,"0");return`${n.getFullYear()}-${m(n.getMonth()+1)}-${m(n.getDate())}T${m(n.getHours())}:${m(n.getMinutes())}:${m(n.getSeconds())}${d}${i}:${f}`},h="None",Y=e=>({filterId:e,matchOperator:"And",literalClauses:[],actionLabelId:h,actionMailboxId:h}),k=e=>({matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),ve=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",Ce=({ruleScope:e,clauses:t,matchOperator:r,moveMailboxId:s,until:o})=>({matchOperator:r==="all"?"And":"Or",literalClauses:t.map(a=>({field:a.field,value:a.value})),moveMailboxId:s,expiresAt:e==="until"?j(o??""):void 0}),F=(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}),G=new Set(["Complete","Failed"]),A=e=>e!==void 0&&G.has(e),V=1e3,Z=15e3,ee=e=>{const t=Math.max(0,e),r=V*2**t;return Math.min(r,Z)},te=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},Se=e=>{const[t,r]=p.useState(),s=v({...T(),onSuccess:g=>r(g.organizeJobId)}),{mutate:o}=s,a=D({...R({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const I=g.state.data?.state;return A(I)?!1:ee(g.state.dataUpdateCount)}}),n=p.useCallback(g=>{e&&o({path:{accountId:e},body:k(g)})},[e,o]),c=p.useCallback(g=>{e&&o({path:{accountId:e},body:Y(g)})},[e,o]),{refetch:d}=a,l=p.useCallback(()=>{d()},[d]),i=a.data,f=s.isPending?void 0:i,m=f?.state??s.data?.state,b=A(f?.state),C={state:m,matchedCount:f?.matchedCount??0,appliedCount:f?.appliedCount??0,failedCount:f?.failedCount??0,errorMessage:f?.errorMessage??""};return{start:n,startForFilter:c,watch:r,refreshStatus:l,progress:C,isStarting:s.isPending,isRunning:!!t&&!b,isDone:b,failure:te(s.error,a.error,!!i)}},ye=["From","Subject","HasWords","ListId","FromDomain"],re=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},Oe=(e,t)=>e==="ListId"?re(t):t.trim(),se=e=>e==="all"?"And":"Or",ae=e=>({matchOperator:se(e.matchOperator),literalClauses:e.clauses.map(t=>({field:t.field,value:t.value}))}),ie=e=>!e.literalClauses.some(t=>t.field==="HasWords"),ne=e=>JSON.stringify({operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),Ne=e=>{const t=ae(e);return{matchOperator:t.matchOperator,literalClauses:t.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?j(e.until??""):void 0}},oe=(e,t)=>e.error!==void 0&&e.errorSignature===t?{status:"error",reason:e.error}:e.count===void 0?{status:"loading"}:e.previewedSignature===t?{status:"ready",count:e.count}:{status:"ready",count:e.count,stale:!0},le=350,Fe=(e,t,r)=>{const s=v($()),{mutateAsync:o}=s,a=ne(t),[n,c]=p.useState(()=>({})),d=p.useRef(t);d.current=t;const l=p.useRef(a),i=ie(t);return p.useEffect(()=>{if(!e||!i||a===n.previewedSignature||a===n.errorSignature)return;const f=setTimeout(()=>{const m=a;l.current=m,o({path:{accountId:e},body:k({...d.current})}).then(b=>{l.current===m&&c({count:b.matchedCount,matchedIds:b.messageIds,previewedSignature:m})}).catch(b=>{l.current===m&&c(C=>({...C,error:b instanceof Error?b.message:"Couldn't count matches.",errorSignature:m}))})},le);return()=>clearTimeout(f)},[e,i,a,n.previewedSignature,n.errorSignature,o]),i?{count:oe(n,a),matchedIds:n.previewedSignature===a?n.matchedIds??[]:[]}:{count:{status:"error",reason:_},matchedIds:[]}},y=e=>q({path:{accountId:e}}),Ae=e=>{const t=D({...J({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},Ee=e=>{const t=S(),r=v({...U(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:y(e)})}}),{mutate:s,mutateAsync:o}=r,a=p.useCallback((c,d,l)=>{e&&s({path:{accountId:e},body:F(c,d,l)})},[e,s]),n=p.useCallback(async(c,d,l)=>{if(e)return o({path:{accountId:e},body:F(c,d,l)}).then(i=>i,()=>{})},[e,o]);return{createFilter:a,createFilterAsync:n,data:r.data,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},Me=e=>{const t=S(),r=v({...B(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:y(e)})}}),{mutate:s}=r;return{deleteFilter:p.useCallback(a=>{e&&s({path:{accountId:e,filterId:a}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}},De=e=>{const t=S(),r=v({...K(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:y(e)})}}),{mutate:s,variables:o}=r,a=p.useCallback((c,d)=>{e&&s({path:{accountId:e,filterId:c},body:{state:d?"Active":"Disabled"}})},[e,s]),n=p.useCallback(()=>{o&&s(o)},[s,o]);return{toggleFilter:a,retry:n,togglingFilterId:r.isPending?o?.path.filterId:void 0,isError:r.isError,error:r.error,enabling:o?.body?.state==="Active"}};export{fe as A,pe as C,h as N,ye as S,be as a,y as b,Se as c,Ne as d,he as e,ge as f,xe as g,Ae as h,Me as i,De as j,Ee as k,Ce as l,Oe as n,ve as o,j as p,ae as r,Fe as u};
1
+ import{j as u,eU as x,X as E,p as M,eV as z,eW as L,ar as w,B as O,r as p,f as v,eX as T,a as D,eY as R,eZ as $,e_ as _,e$ as J,e as S,f0 as U,f1 as q,f2 as B,bd as K}from"./index-fsuIswbe.js";import{u as Q,S as H}from"./suggest-list-BCqr1j26.js";import{S as W}from"./select-TYdrgtW5.js";import{P as X}from"./plus-D5-2sA5v.js";const P="inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs";function pe({clause:e,onEdit:t,onRemove:r}){return u.jsxs("span",{className:M(P,e.derived?"border-dashed border-line-strong bg-surface-sunken":"border-line bg-surface"),children:[u.jsxs("button",{type:"button",onClick:t,"aria-label":`Edit ${x(e.field)} clause`,className:"flex items-center gap-1 text-left",children:[u.jsx("span",{className:"font-medium text-fg-muted",children:x(e.field)}),u.jsx("span",{className:"text-fg",children:e.value})]}),e.derived&&u.jsx("span",{className:"text-2xs text-fg-subtle",children:"from sender"}),r&&u.jsx("button",{type:"button",onClick:r,"aria-label":`Remove ${x(e.field)} clause`,className:"flex size-4 items-center justify-center rounded-full text-fg-subtle hover:bg-surface-sunken hover:text-fg-muted",children:u.jsx(E,{className:"size-3"})})]})}function fe({label:e,onClick:t}){return u.jsxs("button",{type:"button",onClick:t,className:M(P,"border-dashed border-line-strong text-fg-muted hover:border-accent-2 hover:text-accent-2"),children:[u.jsx(X,{className:"size-3","aria-hidden":"true"}),e]})}function be({draft:e,mode:t,fields:r=L,suggestions:s=[],onChangeField:o,onChangeValue:a,onSubmit:n,onCancel:c}){const d=z(e.field),l=Q({count:s.length,onAccept:i=>a?.(s[i].value)});return u.jsxs("div",{className:"space-y-1.5 rounded-lg border border-accent-2 bg-surface p-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(W,{"aria-label":"Clause field",value:e.field,onChange:i=>o?.(i.target.value),className:"h-8 w-32 shrink-0",children:r.map(i=>u.jsx("option",{value:i,children:x(i)},i))}),u.jsx(w,{"aria-label":"Clause value",value:e.value,placeholder:"value…",autoComplete:"off",onChange:i=>{l.reopen(),a?.(i.target.value)},onKeyDown:i=>{l.handleKeyDown(i)||i.key==="Enter"&&n?.()},className:"h-8 min-w-40 flex-1",...l.comboboxProps}),u.jsx(O,{variant:"primary",size:"sm",onClick:n,disabled:e.value.trim()==="",className:"shrink-0",children:t==="add"?"Add":"Save"}),u.jsx(O,{variant:"ghost",size:"sm",onClick:c,"aria-label":"Cancel clause edit",icon:u.jsx(E,{className:"size-4"}),className:"shrink-0 px-2"})]}),l.open&&u.jsx(H,{id:l.listId,suggestions:s,activeIndex:l.activeIndex,optionId:l.optionId,onPick:i=>{a?.(i.value),l.dismiss()},onHighlight:l.setActiveIndex,label:`${x(e.field)} suggestions`}),d&&u.jsx("p",{className:"px-0.5 text-2xs text-fg-subtle",children:d})]})}const ge=(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},N={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."},he=e=>e.disabledReason==="None"?void 0:(e.disabledReason==="AwaitingFolder"||e.disabledReason==="FolderCreateFailed")&&e.actionMailboxId!=="None"?N.UserDisabled:N[e.disabledReason],xe=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"})},j=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,o,a]=r,n=new Date(Number(s),Number(o)-1,Number(a),23,59,59,0);if(Number.isNaN(n.getTime()))return;const c=-t.getTimezoneOffset(),d=c>=0?"+":"-",l=Math.abs(c),i=String(Math.floor(l/60)).padStart(2,"0"),f=String(l%60).padStart(2,"0"),m=b=>String(b).padStart(2,"0");return`${n.getFullYear()}-${m(n.getMonth()+1)}-${m(n.getDate())}T${m(n.getHours())}:${m(n.getMinutes())}:${m(n.getSeconds())}${d}${i}:${f}`},h="None",Y=e=>({filterId:e,matchOperator:"And",literalClauses:[],actionLabelId:h,actionMailboxId:h}),k=e=>({matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??h,actionMailboxId:e.moveMailboxId??h}),ve=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",Ce=({ruleScope:e,clauses:t,matchOperator:r,moveMailboxId:s,until:o})=>({matchOperator:r==="all"?"And":"Or",literalClauses:t.map(a=>({field:a.field,value:a.value})),moveMailboxId:s,expiresAt:e==="until"?j(o??""):void 0}),F=(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}),G=new Set(["Complete","Failed"]),A=e=>e!==void 0&&G.has(e),V=1e3,Z=15e3,ee=e=>{const t=Math.max(0,e),r=V*2**t;return Math.min(r,Z)},te=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},Se=e=>{const[t,r]=p.useState(),s=v({...T(),onSuccess:g=>r(g.organizeJobId)}),{mutate:o}=s,a=D({...R({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const I=g.state.data?.state;return A(I)?!1:ee(g.state.dataUpdateCount)}}),n=p.useCallback(g=>{e&&o({path:{accountId:e},body:k(g)})},[e,o]),c=p.useCallback(g=>{e&&o({path:{accountId:e},body:Y(g)})},[e,o]),{refetch:d}=a,l=p.useCallback(()=>{d()},[d]),i=a.data,f=s.isPending?void 0:i,m=f?.state??s.data?.state,b=A(f?.state),C={state:m,matchedCount:f?.matchedCount??0,appliedCount:f?.appliedCount??0,failedCount:f?.failedCount??0,errorMessage:f?.errorMessage??""};return{start:n,startForFilter:c,watch:r,refreshStatus:l,progress:C,isStarting:s.isPending,isRunning:!!t&&!b,isDone:b,failure:te(s.error,a.error,!!i)}},ye=["From","Subject","HasWords","ListId","FromDomain"],re=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},Oe=(e,t)=>e==="ListId"?re(t):t.trim(),se=e=>e==="all"?"And":"Or",ae=e=>({matchOperator:se(e.matchOperator),literalClauses:e.clauses.map(t=>({field:t.field,value:t.value}))}),ie=e=>!e.literalClauses.some(t=>t.field==="HasWords"),ne=e=>JSON.stringify({operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),Ne=e=>{const t=ae(e);return{matchOperator:t.matchOperator,literalClauses:t.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?j(e.until??""):void 0}},oe=(e,t)=>e.error!==void 0&&e.errorSignature===t?{status:"error",reason:e.error}:e.count===void 0?{status:"loading"}:e.previewedSignature===t?{status:"ready",count:e.count}:{status:"ready",count:e.count,stale:!0},le=350,Fe=(e,t,r)=>{const s=v($()),{mutateAsync:o}=s,a=ne(t),[n,c]=p.useState(()=>({})),d=p.useRef(t);d.current=t;const l=p.useRef(a),i=ie(t);return p.useEffect(()=>{if(!e||!i||a===n.previewedSignature||a===n.errorSignature)return;const f=setTimeout(()=>{const m=a;l.current=m,o({path:{accountId:e},body:k({...d.current})}).then(b=>{l.current===m&&c({count:b.matchedCount,matchedIds:b.messageIds,previewedSignature:m})}).catch(b=>{l.current===m&&c(C=>({...C,error:b instanceof Error?b.message:"Couldn't count matches.",errorSignature:m}))})},le);return()=>clearTimeout(f)},[e,i,a,n.previewedSignature,n.errorSignature,o]),i?{count:oe(n,a),matchedIds:n.previewedSignature===a?n.matchedIds??[]:[]}:{count:{status:"error",reason:_},matchedIds:[]}},y=e=>q({path:{accountId:e}}),Ae=e=>{const t=D({...J({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},Ee=e=>{const t=S(),r=v({...U(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:y(e)})}}),{mutate:s,mutateAsync:o}=r,a=p.useCallback((c,d,l)=>{e&&s({path:{accountId:e},body:F(c,d,l)})},[e,s]),n=p.useCallback(async(c,d,l)=>{if(e)return o({path:{accountId:e},body:F(c,d,l)}).then(i=>i,()=>{})},[e,o]);return{createFilter:a,createFilterAsync:n,data:r.data,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},Me=e=>{const t=S(),r=v({...B(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:y(e)})}}),{mutate:s}=r;return{deleteFilter:p.useCallback(a=>{e&&s({path:{accountId:e,filterId:a}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}},De=e=>{const t=S(),r=v({...K(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:y(e)})}}),{mutate:s,variables:o}=r,a=p.useCallback((c,d)=>{e&&s({path:{accountId:e,filterId:c},body:{state:d?"Active":"Disabled"}})},[e,s]),n=p.useCallback(()=>{o&&s(o)},[s,o]);return{toggleFilter:a,retry:n,togglingFilterId:r.isPending?o?.path.filterId:void 0,isError:r.isError,error:r.error,enabling:o?.body?.state==="Active"}};export{fe as A,pe as C,h as N,ye as S,be as a,y as b,Se as c,Ne as d,he as e,ge as f,xe as g,Ae as h,Me as i,De as j,Ee as k,Ce as l,Oe as n,ve as o,j as p,ae as r,Fe as u};
@@ -1 +1 @@
1
- import{cY as g,dc as d,dd as v,de as x}from"./index-9QMShYZC.js";var p=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:f,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",n=c&&r==="forward",o=a&&r==="backward",u=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:P&&!h&&!o,isRefetching:f&&!n&&!u}}};function N(e,t){return x(e,p)}export{N as u};
1
+ import{cY as g,dc as d,dd as v,de as x}from"./index-fsuIswbe.js";var p=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:f,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",n=c&&r==="forward",o=a&&r==="backward",u=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:P&&!h&&!o,isRefetching:f&&!n&&!u}}};function N(e,t){return x(e,p)}export{N as u};
@@ -1 +1 @@
1
- import{a,c as n,r}from"./index-9QMShYZC.js";const c=new Set,u=()=>{const{data:s}=a({...n(),staleTime:1/0});return r.useMemo(()=>{const e=(s?.accounts??[]).flatMap(o=>o.folderAppointments.flatMap(t=>t.role==="Junk"&&t.mailboxId?[t.mailboxId]:[]));return e.length===0?c:new Set(e)},[s?.accounts])};export{u};
1
+ import{a,c as n,r}from"./index-fsuIswbe.js";const c=new Set,u=()=>{const{data:s}=a({...n(),staleTime:1/0});return r.useMemo(()=>{const e=(s?.accounts??[]).flatMap(o=>o.folderAppointments.flatMap(t=>t.role==="Junk"&&t.mailboxId?[t.mailboxId]:[]));return e.length===0?c:new Set(e)},[s?.accounts])};export{u};
@@ -1 +1 @@
1
- import{a as d,d7 as g,e as i,f as o,d8 as y,r as u,d9 as p,da as L,db as c}from"./index-9QMShYZC.js";const f={Default:"bg-fg-subtle",Red:"bg-red-500",Orange:"bg-orange-500",Yellow:"bg-yellow-500",Green:"bg-green-500",Teal:"bg-teal-500",Blue:"bg-blue-500",Purple:"bg-purple-500",Gray:"bg-gray-500"},O=["Default","Red","Orange","Yellow","Green","Teal","Blue","Purple","Gray"],m=e=>Object.hasOwn(f,e),l=e=>g({path:{accountId:e}}),h=async e=>{const t=[];let a;do{const{data:s}=await c({path:{accountId:e},query:{continuationToken:a},throwOnError:!0});t.push(...s.items),a=s.continuationToken}while(a);return t},P=[],q=e=>{const t=d({queryKey:l(e??""),queryFn:()=>h(e??""),enabled:!!e});return{labels:t.data??P,isSuccess:t.isSuccess,isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},w=e=>{const t=i(),a=o({...y(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:l(e)})}}),{mutateAsync:s}=a;return{createLabel:u.useCallback((r,n="Default")=>e?s({path:{accountId:e},body:{name:r,color:n}}):Promise.reject(new Error("No account")),[e,s]),isPending:a.isPending,isError:a.isError,error:a.error,reset:a.reset}},D=e=>{const t=i(),a=o({...p(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:l(e)})}}),{mutate:s}=a;return{updateLabel:u.useCallback((r,n)=>{e&&s({path:{accountId:e,labelId:r},body:n})},[e,s]),isPending:a.isPending,updatingLabelId:a.isPending?a.variables?.path.labelId:void 0}},E=e=>{const t=i(),a=o({...L(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:l(e)})}}),{mutate:s}=a;return{deleteLabel:u.useCallback(r=>{e&&s({path:{accountId:e,labelId:r}})},[e,s]),isPending:a.isPending,deletingLabelId:a.isPending?a.variables?.path.labelId:void 0}};export{w as a,O as b,D as c,E as d,m as i,f as l,q as u};
1
+ import{a as d,d7 as g,e as i,f as o,d8 as y,r as u,d9 as p,da as L,db as c}from"./index-fsuIswbe.js";const f={Default:"bg-fg-subtle",Red:"bg-red-500",Orange:"bg-orange-500",Yellow:"bg-yellow-500",Green:"bg-green-500",Teal:"bg-teal-500",Blue:"bg-blue-500",Purple:"bg-purple-500",Gray:"bg-gray-500"},O=["Default","Red","Orange","Yellow","Green","Teal","Blue","Purple","Gray"],m=e=>Object.hasOwn(f,e),l=e=>g({path:{accountId:e}}),h=async e=>{const t=[];let a;do{const{data:s}=await c({path:{accountId:e},query:{continuationToken:a},throwOnError:!0});t.push(...s.items),a=s.continuationToken}while(a);return t},P=[],q=e=>{const t=d({queryKey:l(e??""),queryFn:()=>h(e??""),enabled:!!e});return{labels:t.data??P,isSuccess:t.isSuccess,isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},w=e=>{const t=i(),a=o({...y(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:l(e)})}}),{mutateAsync:s}=a;return{createLabel:u.useCallback((r,n="Default")=>e?s({path:{accountId:e},body:{name:r,color:n}}):Promise.reject(new Error("No account")),[e,s]),isPending:a.isPending,isError:a.isError,error:a.error,reset:a.reset}},D=e=>{const t=i(),a=o({...p(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:l(e)})}}),{mutate:s}=a;return{updateLabel:u.useCallback((r,n)=>{e&&s({path:{accountId:e,labelId:r},body:n})},[e,s]),isPending:a.isPending,updatingLabelId:a.isPending?a.variables?.path.labelId:void 0}},E=e=>{const t=i(),a=o({...L(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:l(e)})}}),{mutate:s}=a;return{deleteLabel:u.useCallback(r=>{e&&s({path:{accountId:e,labelId:r}})},[e,s]),isPending:a.isPending,deletingLabelId:a.isPending?a.variables?.path.labelId:void 0}};export{w as a,O as b,D as c,E as d,m as i,f as l,q as u};
@@ -1 +1 @@
1
- import{a as s,D as e}from"./useMediaQuery-BL50IiYB.js";const i=768,a=t=>t!=="desktop",r=()=>{const t=s(`(min-width: ${i}px)`);return s(e)?"desktop":t?"tablet":"phone"};export{a as i,r as u};
1
+ import{a as s,D as e}from"./useMediaQuery-Hy81MQ2M.js";const i=768,a=t=>t!=="desktop",r=()=>{const t=s(`(min-width: ${i}px)`);return s(e)?"desktop":t?"tablet":"phone"};export{a as i,r as u};
@@ -1 +1 @@
1
- import{r as s}from"./index-9QMShYZC.js";const r=1024,c=`(min-width: ${r}px) and (not ((orientation: portrait) and (pointer: coarse)))`,d=e=>{const[o,n]=s.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return s.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const t=window.matchMedia(e);n(t.matches);const a=i=>n(i.matches);return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e]),o},m=()=>d(c);export{c as D,d as a,m as u};
1
+ import{r as s}from"./index-fsuIswbe.js";const r=1024,c=`(min-width: ${r}px) and (not ((orientation: portrait) and (pointer: coarse)))`,d=e=>{const[o,n]=s.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return s.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const t=window.matchMedia(e);n(t.matches);const a=i=>n(i.matches);return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e]),o},m=()=>d(c);export{c as D,d as a,m as u};
@@ -1,3 +1,3 @@
1
- import{r as V,u as _o,cw as Eo,K as De,l as yo,aa as Ao,e as bo,a as So,cT as Ro,cG as Oo}from"./index-9QMShYZC.js";import{d as wo,e as Do}from"./reply-CdhmgK8D.js";import{c as Lo}from"./nav-link-BaRr8ufx.js";function fn(n,o){(o==null||o>n.length)&&(o=n.length);for(var a=0,l=Array(o);a<o;a++)l[a]=n[a];return l}function Co(n){if(Array.isArray(n))return n}function No(n,o){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,c,m,h,F=[],A=!0,G=!1;try{if(m=(a=a.call(n)).next,o!==0)for(;!(A=(l=m.call(a)).done)&&(F.push(l.value),F.length!==o);A=!0);}catch(W){G=!0,c=W}finally{try{if(!A&&a.return!=null&&(h=a.return(),Object(h)!==h))return}finally{if(G)throw c}}return F}}function Io(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as V,u as _o,cw as Eo,K as De,l as yo,aa as Ao,e as bo,a as So,cT as Ro,cG as Oo}from"./index-fsuIswbe.js";import{d as wo,e as Do}from"./reply-CXuSMyqp.js";import{c as Lo}from"./nav-link-ed0mFCCx.js";function fn(n,o){(o==null||o>n.length)&&(o=n.length);for(var a=0,l=Array(o);a<o;a++)l[a]=n[a];return l}function Co(n){if(Array.isArray(n))return n}function No(n,o){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,c,m,h,F=[],A=!0,G=!1;try{if(m=(a=a.call(n)).next,o!==0)for(;!(A=(l=m.call(a)).done)&&(F.push(l.value),F.length!==o);A=!0);}catch(W){G=!0,c=W}finally{try{if(!A&&a.return!=null&&(h=a.return(),Object(h)!==h))return}finally{if(G)throw c}}return F}}function Io(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mo(n,o){return Co(n)||No(n,o)||Po(n,o)||Io()}function Po(n,o){if(n){if(typeof n=="string")return fn(n,o);var a={}.toString.call(n).slice(8,-1);return a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set"?Array.from(n):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?fn(n,o):void 0}}const wn=Object.entries,pn=Object.setPrototypeOf,xo=Object.isFrozen,Dn=Object.getPrototypeOf,Ln=Object.getOwnPropertyDescriptor;let O=Object.freeze,D=Object.seal,Te=Object.create,Cn=typeof Reflect<"u"&&Reflect,Dt=Cn.apply,Lt=Cn.construct;O||(O=function(o){return o});D||(D=function(o){return o});Dt||(Dt=function(o,a){for(var l=arguments.length,c=new Array(l>2?l-2:0),m=2;m<l;m++)c[m-2]=arguments[m];return o.apply(a,c)});Lt||(Lt=function(o){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return new o(...l)});const $=E(Array.prototype.forEach),vo=E(Array.prototype.lastIndexOf),mn=E(Array.prototype.pop),Le=E(Array.prototype.push),ko=E(Array.prototype.slice),Uo=E(Array.prototype.splice),_e=Array.isArray,_t=Nn(Set),Et=E(Set.prototype.add),Ce=E(Set.prototype.has),se=E(String.prototype.toLowerCase),yt=E(String.prototype.toString),dn=E(String.prototype.match),Ne=E(String.prototype.replace),hn=E(String.prototype.indexOf),Fo=E(String.prototype.trim),zo=E(Number.prototype.toString),Ho=E(Boolean.prototype.toString),Tn=typeof BigInt>"u"?null:E(BigInt.prototype.toString),gn=typeof Symbol>"u"?null:E(Symbol.prototype.toString),P=E(Object.prototype.hasOwnProperty),Ie=E(Object.prototype.toString),w=E(RegExp.prototype.test),j=Nn(TypeError);function E(n){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return Dt(n,o,l)}}function Nn(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return Lt(n,a)}}function d(n,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:se;if(pn&&pn(n,null),!_e(o))return n;let l=o.length;for(;l--;){let c=o[l];if(typeof c=="string"){const m=a(c);m!==c&&(xo(o)||(o[l]=m),c=m)}n[c]=!0}return n}function Bo(n){for(let o=0;o<n.length;o++)P(n,o)||(n[o]=null);return n}function x(n){const o=Te(null);for(const l of wn(n)){var a=Mo(l,2);const c=a[0],m=a[1];P(n,c)&&(_e(m)?o[c]=Bo(m):m&&typeof m=="object"&&m.constructor===Object?o[c]=x(m):o[c]=m)}return o}function Go(n){switch(typeof n){case"string":return n;case"number":return zo(n);case"boolean":return Ho(n);case"bigint":return Tn?Tn(n):"0";case"symbol":return gn?gn(n):"Symbol()";case"undefined":return Ie(n);case"function":case"object":{if(n===null)return Ie(n);const o=n,a=k(o,"toString");if(typeof a=="function"){const l=a(o);return typeof l=="string"?l:Ie(l)}return Ie(n)}default:return Ie(n)}}function k(n,o){for(;n!==null;){const l=Ln(n,o);if(l){if(l.get)return E(l.get);if(typeof l.value=="function")return E(l.value)}n=Dn(n)}function a(){return null}return a}function Wo(n,o){for(;n!==null;){const a=Ln(n,o);if(a)return a.get?E(a.get):null;n=Dn(n)}return null}function Yo(n){try{return w(n,""),!0}catch{return!1}}const _n=O(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),At=O(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),bt=O(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),$o=O(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),St=O(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),jo=O(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),En=O(["#text"]),yn=O(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Rt=O(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),An=O(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ye=O(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Vo=D(/{{[\w\W]*|^[\w\W]*}}/g),Xo=D(/<%[\w\W]*|^[\w\W]*%>/g),Ko=D(/\${[\w\W]*/g),qo=D(/^data-[\-\w.\u00B7-\uFFFF]+$/),Qo=D(/^aria-[\-\w]+$/),bn=D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Zo=D(/^(?:\w+script|data):/i),Jo=D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),er=D(/^html$/i),tr=D(/^[a-z][.\w]*(-[.\w]+)+$/i),Ot=D(/<[/\w!]/g),Sn=D(/<[/\w]/g),nr=D(/<\/no(script|embed|frames)/i),Rn=D(/\/>/i),b={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},or=O(d({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),rr=function(){return typeof window>"u"?null:window},ir=function(o,a){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let l=null;const c="data-tt-policy-suffix";a&&a.hasAttribute(c)&&(l=a.getAttribute(c));const m="dompurify"+(l?"#"+l:"");try{return o.createPolicy(m,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+m+" could not be created."),null}},On=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Z=function(o,a,l,c){return P(o,a)&&_e(o[a])?d(c.base?x(c.base):{},o[a],c.transform):l},wt=function(o,a,l){const c=P(o,a)?o[a]:void 0;return c&&typeof c=="object"?x(c):l()};function In(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rr();const o=s=>In(s);if(o.version="3.4.17",o.removed=[],!n||!n.document||n.document.nodeType!==b.document||!n.Element)return o.isSupported=!1,o;let a=n.document;const l=a,c=l.currentScript;n.DocumentFragment;const m=n.HTMLTemplateElement,h=n.Node,F=n.Element,A=n.NodeFilter;n.NamedNodeMap===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const G=n.DOMParser,W=n.trustedTypes,R=F.prototype,Ee=k(R,"cloneNode"),ye=k(R,"remove"),Me=k(R,"removeAttributeNode"),J=k(R,"nextSibling"),C=k(R,"childNodes"),X=k(R,"parentNode"),$e=k(R,"shadowRoot"),je=k(R,"attributes"),ee=h&&h.prototype?k(h.prototype,"nodeType"):null,ae=h&&h.prototype?k(h.prototype,"nodeName"):null,Pe=h&&h.prototype?k(h.prototype,"ownerDocument"):null,v=function(e){return ee?ee(e):e.nodeType},Ae=function(e){return ae?ae(e):e.nodeName},It=Wo(R,"namespaceURI"),Ve=function(e){return It?It(e):e.namespaceURI};if(typeof m=="function"){const s=a.createElement("template");s.content&&s.content.ownerDocument&&(a=s.content.ownerDocument)}let N,te="",Xe,Mt=!1,be=0;const Pt=function(){if(be>0)throw j('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},le=function(e){Pt(),be++;try{return N.createHTML(e)}finally{be--}},zn=function(e){Pt(),be++;try{return N.createScriptURL(e)}finally{be--}},Hn=function(){return Mt||(Xe=ir(W,c),Mt=!0),Xe},xe=a,Ke=xe.implementation,xt=xe.createNodeIterator,Bn=xe.createDocumentFragment,Gn=xe.getElementsByTagName,Wn=l.importNode;let T=On();o.isSupported=typeof wn=="function"&&typeof X=="function"&&Ke&&Ke.createHTMLDocument!==void 0;const Yn=Vo,$n=Xo,jn=Ko,Vn=qo,Xn=Qo,Kn=Zo,vt=Jo,qn=tr;let kt=bn,g=null;const qe=d({},[..._n,...At,...bt,...St,...En]);let _=null;const Qe=d({},[...yn,...Rt,...An,...Ye]);let z=Object.seal(Te(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Ut=null;const K=Object.seal(Te(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ft=!0,Ze=!0,zt=!1,Je=!0,Y=!1,ne=!0,oe=!1,et=!1,ve=null,ke=null,tt=!1,ce=!1,Ue=!1,Fe=!1,Ht=!0,Bt=!1;const Gt="user-content-";let nt=!0,ot=!1,re=null,ue={},ie=null;const Wt=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Yt=null;const $t=d({},["audio","video","img","source","image","track"]);let jt=null;const Vt=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ze="http://www.w3.org/1998/Math/MathML",He="http://www.w3.org/2000/svg",H="http://www.w3.org/1999/xhtml";let fe=H,rt=!1,it=null;const Qn=d({},[ze,He,H],yt),Xt=O(["mi","mo","mn","ms","mtext"]);let st=d({},Xt);const Kt=O(["annotation-xml"]);let at=d({},Kt);const Zn=d({},["title","style","font","a","script"]);let Re=null;const Jn=["application/xhtml+xml","text/html"],eo="text/html";let y=null,pe=null;const to=a.createElement("form"),qt=function(e){return e instanceof RegExp||e instanceof Function},lt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pe&&pe===e)return;(!e||typeof e!="object")&&(e={}),e=x(e),Re=Jn.indexOf(e.PARSER_MEDIA_TYPE)===-1?eo:e.PARSER_MEDIA_TYPE,y=Re==="application/xhtml+xml"?yt:se,g=Z(e,"ALLOWED_TAGS",qe,{transform:y}),_=Z(e,"ALLOWED_ATTR",Qe,{transform:y}),it=Z(e,"ALLOWED_NAMESPACES",Qn,{transform:yt}),jt=Z(e,"ADD_URI_SAFE_ATTR",Vt,{transform:y,base:Vt}),Yt=Z(e,"ADD_DATA_URI_TAGS",$t,{transform:y,base:$t}),ie=Z(e,"FORBID_CONTENTS",Wt,{transform:y}),Se=Z(e,"FORBID_TAGS",x({}),{transform:y}),Ut=Z(e,"FORBID_ATTR",x({}),{transform:y}),ue=P(e,"USE_PROFILES")?e.USE_PROFILES&&typeof e.USE_PROFILES=="object"?x(e.USE_PROFILES):e.USE_PROFILES:!1,Ft=e.ALLOW_ARIA_ATTR!==!1,Ze=e.ALLOW_DATA_ATTR!==!1,zt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Je=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=e.SAFE_FOR_TEMPLATES||!1,ne=e.SAFE_FOR_XML!==!1,oe=e.WHOLE_DOCUMENT||!1,ce=e.RETURN_DOM||!1,Ue=e.RETURN_DOM_FRAGMENT||!1,Fe=e.RETURN_TRUSTED_TYPE||!1,tt=e.FORCE_BODY||!1,Ht=e.SANITIZE_DOM!==!1,Bt=e.SANITIZE_NAMED_PROPS||!1,nt=e.KEEP_CONTENT!==!1,ot=e.IN_PLACE||!1,kt=Yo(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:bn,fe=typeof e.NAMESPACE=="string"?e.NAMESPACE:H,st=wt(e,"MATHML_TEXT_INTEGRATION_POINTS",()=>d({},Xt)),at=wt(e,"HTML_INTEGRATION_POINTS",()=>d({},Kt));const t=wt(e,"CUSTOM_ELEMENT_HANDLING",()=>Te(null));if(z=Te(null),P(t,"tagNameCheck")&&qt(t.tagNameCheck)&&(z.tagNameCheck=t.tagNameCheck),P(t,"attributeNameCheck")&&qt(t.attributeNameCheck)&&(z.attributeNameCheck=t.attributeNameCheck),P(t,"allowCustomizedBuiltInElements")&&typeof t.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),D(z),Y&&(Ze=!1),Ue&&(ce=!0),ue&&(g=d({},En),_=Te(null),ue.html===!0&&(d(g,_n),d(_,yn)),ue.svg===!0&&(d(g,At),d(_,Rt),d(_,Ye)),ue.svgFilters===!0&&(d(g,bt),d(_,Rt),d(_,Ye)),ue.mathMl===!0&&(d(g,St),d(_,An),d(_,Ye))),K.tagCheck=null,K.attributeCheck=null,P(e,"ADD_TAGS")&&(typeof e.ADD_TAGS=="function"?K.tagCheck=e.ADD_TAGS:_e(e.ADD_TAGS)&&(g===qe&&(g=x(g)),d(g,e.ADD_TAGS,y))),P(e,"ADD_ATTR")&&(typeof e.ADD_ATTR=="function"?K.attributeCheck=e.ADD_ATTR:_e(e.ADD_ATTR)&&(_===Qe&&(_=x(_)),d(_,e.ADD_ATTR,y))),P(e,"ADD_FORBID_CONTENTS")&&_e(e.ADD_FORBID_CONTENTS)&&(ie===Wt&&(ie=x(ie)),d(ie,e.ADD_FORBID_CONTENTS,y)),nt&&(g["#text"]=!0),oe&&d(g,["html","head","body"]),g.table&&(d(g,["tbody"]),delete Se.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw j('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw j('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const r=N;N=e.TRUSTED_TYPES_POLICY;try{te=le("")}catch(i){throw N=r,i}}else e.TRUSTED_TYPES_POLICY===null?(N=void 0,te=""):(N===void 0&&(N=Hn()),N&&typeof te=="string"&&(te=le("")));O&&O(e),pe=e},Qt=d({},[...At,...bt,...$o]),Zt=d({},[...St,...jo]),no=function(e,t,r){return t.namespaceURI===H?e==="svg":t.namespaceURI===ze?e==="svg"&&(r==="annotation-xml"||st[r]):!!Qt[e]},oo=function(e,t,r){return t.namespaceURI===H?e==="math":t.namespaceURI===He?e==="math"&&at[r]:!!Zt[e]},ro=function(e,t,r){return t.namespaceURI===He&&!at[r]||t.namespaceURI===ze&&!st[r]?!1:!Zt[e]&&(Zn[e]||!Qt[e])},io=function(e){const t=Ve(e),r=se(Ae(e)),i=X(e);let u,f;return i&&v(i)===b.element?(u={namespaceURI:Ve(i)},f=se(Ae(i))):(u={namespaceURI:fe},f="template"),it[t]?t===He?no(r,u,f):t===ze?oo(r,u,f):t===H?ro(r,u,f):!!(Re==="application/xhtml+xml"&&it[t]):!1},q=function(e){Le(o.removed,{element:e});try{X(e).removeChild(e)}catch{if(ye(e),!X(e))throw j("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Jt=function(e,t,r){try{Me(e,t)}catch{try{e.removeAttribute(r)}catch{}}},ct=function(e){ft(e);const t=C(e);t&&$(ko(t),i=>{try{ye(i)}catch{}});const r=v(e)===b.element?je(e):null;if(r)for(let i=r.length-1;i>=0;--i){const u=r[i],f=u&&u.name;typeof f=="string"&&Jt(e,u,f)}},me=function(e,t,r){if(!r)try{r=t.getAttributeNode(e)}catch{r=null}Le(o.removed,{attribute:r||null,from:t});try{r?Me(t,r):t.removeAttribute(e)}catch{try{t.removeAttribute(e)}catch{}}if(e==="is")if(ce||Ue)try{q(t)}catch{}else try{t.setAttribute(e,"")}catch{}},en=function(e){const t=je(e);if(t)for(let r=t.length-1;r>=0;--r){const i=t[r],u=i&&i.name;typeof u!="string"||_[y(u)]||Jt(e,i,u)}},ut=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[e];for(;i.length>0;){const u=i.pop();if(t(u)===!1)continue;if(r&&v(u)===b.element){const p=$e(u);Q(p)&&i.push(p)}const f=C(u);if(f)for(let p=f.length-1;p>=0;--p)i.push(f[p])}},ft=function(e){ut(e,t=>{v(t)===b.element&&en(t)})},pt=function(e){const t=[];return ut(e,r=>{t.push(r)},!0),t},so=function(e,t){const r=_t();$(pt(e),i=>{v(i)===b.element&&Et(r,i)}),$(t,i=>{v(i)===b.element&&!Ce(r,i)&&en(i)})},tn=function(e,t){let r=!1;return $(o.removed,i=>{i.element&&(r=r||i.element===e,ft(i.element))}),so(e,t),r},ao=8,lo=function(e,t){const r=re;let i=null;const u=()=>(i||(i=_t(),$(t,f=>{Et(i,f)})),i);for(let f=0;;f++){const p=pt(e),S=[e];let B=!1;if($(p,L=>{v(L)===b.documentFragment?Le(S,L):!B&&!Ce(r,L)&&(B=Ce(u(),L))}),!B)return;if(f>=ao)throw j("the tree kept changing during in-place sanitization; refusing to return it");$(S,(L,I)=>{co(L,I>0,e,u())})}},co=function(e,t,r,i){const u=mt(e);let f;for(;f=u.nextNode();)!Ce(i,f)||Ce(re,f)||(t&&U(T.uponSanitizeShadowNode,f,null),ht(f,r),Tt(f,r),Q(f.content)&&we(f.content))},uo=function(e){re&&Et(re,e)},nn=function(e,t){return ne?e==="patchsrc"?!0:e==="for"&&t!=="label"&&t!=="output":!1},fo=function(e){ne&&ut(e,t=>{const r=v(t);if(r===b.processingInstruction||r===b.comment&&w(Sn,t.data)){try{ye(t)}catch{}return!1}if(r===b.element){const i=t,u=y(Ae(t));try{i.hasAttribute&&i.hasAttribute("patchsrc")&&i.removeAttribute("patchsrc"),i.hasAttribute&&i.hasAttribute("for")&&nn("for",u)&&i.removeAttribute("for")}catch{}}return!0})},on=function(e){let t=null,r=null;if(tt)e="<remove></remove>"+e;else{const f=dn(e,/^[\r\n\t ]+/);r=f&&f[0]}Re==="application/xhtml+xml"&&fe===H&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=N?le(e):e;if(fe===H)try{t=new G().parseFromString(i,Re)}catch{}if(!t||!t.documentElement){t=Ke.createDocument(fe,"template",null);try{t.documentElement.innerHTML=rt?te:i}catch{}}const u=t.body||t.documentElement;return e&&r&&u.insertBefore(a.createTextNode(r),u.childNodes[0]||null),fe===H?Gn.call(t,oe?"html":"body")[0]:oe?t.documentElement:u},mt=function(e){const t=Pe?Pe(e):e.ownerDocument;return xt.call(t||e,e,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT|A.SHOW_PROCESSING_INSTRUCTION|A.SHOW_CDATA_SECTION,null)},Be=function(e){return e=Ne(e,Yn," "),e=Ne(e,$n," "),e=Ne(e,jn," "),e},dt=function(e){var t;rn(e);const r=(t=e.querySelectorAll)===null||t===void 0?void 0:t.call(e,"template");r&&$(r,i=>{Q(i.content)&&dt(i.content)})},rn=function(e){e.normalize();const t=Pe?Pe(e):e.ownerDocument,r=xt.call(t||e,e,A.SHOW_TEXT|A.SHOW_COMMENT|A.SHOW_CDATA_SECTION|A.SHOW_PROCESSING_INSTRUCTION,null);let i=r.nextNode();for(;i;)i.data=Be(i.data),i=r.nextNode()},Ge=function(e){const t=ae?ae(e):null;return typeof t!="string"||y(t)!=="form"?!1:typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||e.attributes!==je(e)||typeof e.removeAttribute!="function"||typeof e.removeAttributeNode!="function"||typeof e.getAttributeNode!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function"||e.nodeType!==ee(e)||e.childNodes!==C(e)},Q=function(e){if(!ee||typeof e!="object"||e===null)return!1;try{return ee(e)===b.documentFragment}catch{return!1}},Oe=function(e){if(!ee||typeof e!="object"||e===null)return!1;try{return typeof ee(e)=="number"}catch{return!1}};function U(s,e,t){s.length!==0&&$(s,r=>{r.call(o,e,t,pe)})}const po=function(e,t){return!!(ne&&e.hasChildNodes()&&!Oe(e.firstElementChild)&&w(Ot,e.textContent)&&w(Ot,e.innerHTML)||ne&&or[t]&&v(e)===b.element&&Ve(e)===H&&(Oe(e.firstElementChild)||typeof e.textContent=="string"&&w(Ot,e.textContent))||e.nodeType===b.processingInstruction||ne&&e.nodeType===b.comment&&w(Sn,e.data))},We=function(e,t){if(e instanceof RegExp)return w(e,t);if(e instanceof Function){for(var r=arguments.length,i=new Array(r>2?r-2:0),u=2;u<r;u++)i[u-2]=arguments[u];return!!e(t,...i)}return!1},mo=function(e,t,r){if(!Se[t]&&ln(t)&&We(z.tagNameCheck,t))return!1;if(nt&&!ie[t]&&!ie[se(t)]){const i=X(e),u=C(e);if(u&&i){const f=u.length;for(let p=f-1;p>=0;--p){const S=e===r?Ee(u[p],!0):u[p];i.insertBefore(S,J(e))}}}return q(e),!0},sn=function(e,t,r,i){return e.length===0?t:t===r||t===i?x(t):t},de=function(e,t){return e===t||X(e)!==null?!1:(ot&&ft(e),!0)},ht=function(e,t){if(uo(e),U(T.beforeSanitizeElements,e,null),de(e,t))return!0;if(Ge(e))return q(e),!0;const r=y(Ae(e));if(g=sn(T.uponSanitizeElement,g,qe,ve),U(T.uponSanitizeElement,e,{tagName:r,allowedTags:g}),de(e,t))return!0;if(po(e,r))return q(e),!0;if(Se[r]||!(K.tagCheck instanceof Function&&K.tagCheck(r))&&!g[r]){const i=mo(e,r,t);return i===!1&&(U(T.afterSanitizeElements,e,null),de(e,t))?!0:i}if(v(e)===b.element&&!io(e)||(r==="noscript"||r==="noembed"||r==="noframes")&&w(nr,e.innerHTML))return q(e),!0;if(Y&&e.nodeType===b.text){const i=Be(e.textContent);e.textContent!==i&&(Le(o.removed,{element:e.cloneNode()}),e.textContent=i)}return U(T.afterSanitizeElements,e,null),de(e,t)},an=function(e,t,r){if(Ut[t]||nn(t,e)||Ht&&(t==="id"||t==="name")&&(r in a||r in to))return!1;const i=_[t]||K.attributeCheck instanceof Function&&K.attributeCheck(t,e);return Ze&&w(Vn,t)||Ft&&w(Xn,t)?!0:i?jt[t]||w(kt,Ne(r,vt,""))||(t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&hn(r,"data:")===0&&Yt[e]||zt&&!w(Kn,Ne(r,vt,""))?!0:!r:ln(e)&&We(z.tagNameCheck,e)&&We(z.attributeNameCheck,t,e)||t==="is"&&z.allowCustomizedBuiltInElements&&We(z.tagNameCheck,r)},ho=d({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ln=function(e){return!ho[se(e)]&&w(qn,e)},To=function(e,t,r,i){if(N&&typeof W=="object"&&typeof W.getAttributeType=="function"&&!r)switch(W.getAttributeType(e,t)){case"TrustedHTML":return le(i);case"TrustedScriptURL":return zn(i)}return i},go=function(e,t,r,i){try{return r?e.setAttributeNS(r,t,i):e.setAttribute(t,i),Ge(e)?(q(e),!1):!0}catch{return me(t,e),!1}},cn=function(e,t){return ne&&w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:se(e)==="attributename"&&dn(t,"href")!==null},Tt=function(e,t){if(U(T.beforeSanitizeAttributes,e,null),de(e,t))return;const r=e.attributes;if(!r||Ge(e))return;_=sn(T.uponSanitizeAttribute,_,Qe,ke);const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let u=r.length;const f=y(e.nodeName);for(;u--;){const p=r[u],S=p.name,B=p.namespaceURI,L=p.value,I=y(S),he=L;let M=S==="value"?he:Fo(he),un=!1;if(i.attrName=I,i.attrValue=M,i.keepAttr=!0,i.forceKeepAttr=void 0,U(T.uponSanitizeAttribute,e,i),M=i.attrValue,Bt&&(I==="id"||I==="name")&&hn(M,Gt)!==0&&(me(S,e,p),M=Gt+M,un=!0),cn(S,M)){me(S,e,p);continue}if(!i.forceKeepAttr){if(!i.keepAttr){me(S,e,p);continue}if(!Je&&w(Rn,M)){me(S,e,p);continue}if(Y&&(M=Be(M)),!an(f,I,M)){me(S,e,p);continue}M=To(f,I,B,M),M!==he&&go(e,S,B,M)&&un&&mn(o.removed)}}U(T.afterSanitizeAttributes,e,null),de(e,t)},we=function(e){let t=null;const r=mt(e);for(U(T.beforeSanitizeShadowDOM,e,null);t=r.nextNode();)if(U(T.uponSanitizeShadowNode,t,null),ht(t,e),Tt(t,e),Q(t.content)&&we(t.content),v(t)===b.element){const i=$e(t);Q(i)&&(gt(i),we(i))}Y&&rn(e),U(T.afterSanitizeShadowDOM,e,null)},gt=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const r=t.pop();if(r.shadow){we(r.shadow);continue}const i=r.node,u=v(i)===b.element,f=C(i);if(f)for(let p=f.length-1;p>=0;--p)t.push({node:f[p],shadow:null});if(u){const p=ae?ae(i):null;if(typeof p=="string"&&y(p)==="template"){const S=i.content;Q(S)&&t.push({node:S,shadow:null})}}if(u){const p=$e(i);Q(p)&&t.push({node:null,shadow:p},{node:p,shadow:null})}}};return o.sanitize=function(s){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,r=null,i=null,u=null;if(rt=!s,rt&&(s="<!-->"),typeof s!="string"&&!Oe(s)&&(s=Go(s),typeof s!="string"))throw j("dirty is not a string, aborting");if(!o.isSupported)return s;et?(g=ve,_=ke):lt(e),(T.uponSanitizeElement.length>0||T.uponSanitizeAttribute.length>0)&&(g=x(g)),T.uponSanitizeAttribute.length>0&&(_=x(_)),o.removed=[];const f=ot&&typeof s!="string"&&Oe(s);let p=[];const S=re;if(f){fo(s);const I=Ae(s);if(typeof I=="string"){const he=y(I);if(!g[he]||Se[he])throw ct(s),j("root node is forbidden and cannot be sanitized in-place")}if(Ge(s))throw ct(s),j("root node is clobbered and cannot be sanitized in-place");p=pt(s),re=_t()}else if(Oe(s))t=on("<!---->"),r=t.ownerDocument.importNode(s,!0),r.nodeType===b.element&&r.nodeName==="BODY"||r.nodeName==="HTML"?t=r:t.appendChild(r),gt(t);else{if(!ce&&!Y&&!oe&&s.indexOf("<")===-1)return N&&Fe?le(s):s;if(t=on(s),!t)return ce?null:Fe?te:""}t&&tt&&q(t.firstChild);const B=f?s:t;try{f&&gt(s);const I=mt(B);for(;i=I.nextNode();)ht(i,B),Tt(i,B),Q(i.content)&&we(i.content);f&&lo(s,p)}catch(I){throw f&&(ct(s),tn(s,p)),I}finally{re=S}if(f){if(tn(s,p))throw j("a node selected for removal could not be safely returned; refusing to sanitize in place");return Y&&dt(s),s}if(ce){if(Y&&dt(t),Ue)for(u=Bn.call(t.ownerDocument);t.firstChild;)u.appendChild(t.firstChild);else u=t;return(_.shadowroot||_.shadowrootmode)&&(u=Wn.call(l,u,!0)),u}let L=oe?t.outerHTML:t.innerHTML;return oe&&g["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&w(er,t.ownerDocument.doctype.name)&&(L="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
3
3
  `+L),Y&&(L=Be(L)),N&&Fe?le(L):L},o.setConfig=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lt(s),et=!0,ve=g,ke=_},o.clearConfig=function(){pe=null,et=!1,ve=null,ke=null,N=Xe,te=""},o.isValidAttribute=function(s,e,t){pe||lt({});const r=y(s),i=y(e);return typeof t=="string"&&(cn(e,t)||!Je&&w(Rn,t))?!1:an(r,i,t)},o.addHook=function(s,e){typeof e=="function"&&P(T,s)&&Le(T[s],e)},o.removeHook=function(s,e){if(P(T,s)){if(e!==void 0){const t=vo(T[s],e);return t===-1?void 0:Uo(T[s],t,1)[0]}return mn(T[s])}},o.removeHooks=function(s){P(T,s)&&(T[s]=[])},o.removeAllHooks=function(){T=On()},o}var br=In();const Mn="/mail/brief/compose/{-$outboxMessageId}",Pn="/mail/flagged/compose/{-$outboxMessageId}",xn="/mail/outbox/compose/{-$outboxMessageId}",vn="/mail/$mailboxId/compose/{-$outboxMessageId}",kn="/mail/label/$labelId/compose/{-$outboxMessageId}";function Un(){const n=De({from:Mn,shouldThrow:!1}),o=De({from:Pn,shouldThrow:!1}),a=De({from:xn,shouldThrow:!1}),l=De({from:vn,shouldThrow:!1}),c=De({from:kn,shouldThrow:!1});return n??o??a??l??c}function Sr(){return Un()!==void 0}function Rr(){return Un()?.outboxMessageId}function sr({list:n,mailboxId:o,labelId:a},l){return n==="flagged"?{to:Pn,params:{outboxMessageId:l}}:n==="outbox"?{to:xn,params:{outboxMessageId:l}}:n==="mailbox"&&o?{to:vn,params:{mailboxId:o,outboxMessageId:l}}:n==="label"&&a?{to:kn,params:{labelId:a,outboxMessageId:l}}:{to:Mn,params:{outboxMessageId:l}}}function Nt(){const n=_o(),o=Lo(),a=wo();return V.useCallback((l,c)=>{n({...sr(a,l),search:Eo,hash:c?.keepPanels?!0:o,replace:c?.replace??!1})},[n,o,a])}function Or(){const n=Nt();return V.useCallback(()=>n(void 0),[n])}function wr(){const n=Nt();return V.useCallback(o=>n(o),[n])}function Dr(){const n=Nt();return V.useCallback(o=>n(o,{replace:!0,keepPanels:!0}),[n])}function Lr(){return Do()}const ar=new Set(["rfc822","global"]),lr=n=>n.mediaType.toUpperCase()==="MESSAGE"&&ar.has(n.mediaSubtype.toLowerCase()),Fn=(n,o)=>n.partPath.startsWith(`${o}.`),cr=n=>{const o=n.filter(lr);return n.filter(a=>!o.some(l=>Fn(a,l.partPath)))},Cr=(n,o)=>n.filter(a=>Fn(a,o)),ur=n=>{const o=cr(n).filter(c=>!c.isMultipart&&c.disposition!=="attachment"&&c.mediaType==="TEXT"&&c.contentUrl.length>0),a=o.find(c=>c.mediaSubtype.toUpperCase()==="HTML");if(a)return{kind:"html",contentUrl:a.contentUrl};const l=o.find(c=>c.mediaSubtype.toUpperCase()==="PLAIN");return l?{kind:"text",contentUrl:l.contentUrl}:null},Ct={all:["messages"],detail:n=>[...Ct.all,"detail",n],body:n=>[...Ct.detail(n),"body"]};class ge extends Error{reason;status;retryAfterSeconds;constructor(o,a,l,c){super(a),this.name="BodyFetchError",this.reason=o,this.status=l,this.retryAfterSeconds=c}}const fr=n=>{const o=Number.parseInt(n??"",10);return!Number.isFinite(o)||o<=0?1:Math.min(o,30)},pr=8,mr="x-remit-403-reason",dr=(n,o)=>{const a=o?.trim()??"";return n===401?"auth":n===403?a.length>0?"auth":"body-missing":n===404?"body-missing":"generic"},hr=(n,o)=>(o??"").toLowerCase().startsWith("text/html")?/<div\s+id=["']root["']/i.test(n):!1,Tr=(n,o)=>{const a=(o??"").toLowerCase();return!!(n==="text"&&a.startsWith("text/html"))},gr=async(n,o,a=async()=>null)=>{const l={},c=await a();c&&(l.Authorization=`Bearer ${c}`);const m=await Oo(n,{headers:l});if(m.status===202)throw new ge("not-ready","Message body is still syncing",202,fr(m.headers.get("Retry-After")));if(!m.ok){const A=m.headers.get(mr),G=dr(m.status,A);throw new ge(G,`Failed to load message body (${m.status} ${m.statusText})`,m.status)}const h=m.headers.get("content-type");if(Tr(o,h))throw new ge("content-type-mismatch",`Refusing to render message body — expected ${o}, got Content-Type ${h}`);const F=await m.text();if(hr(F,h))throw new ge("spa-shell-leak","Refusing to render message body — response looks like the SPA shell (CloudFront 403/404 fallback leaked through to /content/*)");return F},_r=async(n,o)=>(o.isRetryAfterNotReady&&await n.refetchDescribeMessage(),n.fetchContent(o.contentUrl,o.kind)),Nr=({messageId:n,bodyParts:o,enabled:a=!0})=>{const l=o?ur(o):null,c=yo(),{getToken:m}=Ao(),h=V.useRef(null),F=bo(),A=V.useRef(!1),G=V.useRef(null),W=n&&l?`${n}:${l.contentUrl}`:null;G.current!==W&&(G.current=W,A.current=!1);const R=So({queryKey:n?[...Ct.body(n),l?.contentUrl??null]:["messages","body","noop"],queryFn:()=>{if(!l)throw new Error("No renderable body part");if(!n)throw new Error("No messageId");const J=A.current;return A.current=!1,_r({fetchContent:(C,X)=>gr(C,X,m),refetchDescribeMessage:()=>F.refetchQueries({queryKey:Ro({path:{messageId:n}})})},{contentUrl:l.contentUrl,kind:l.kind,isRetryAfterNotReady:J})},enabled:a&&!!n&&!!l,staleTime:300*1e3,gcTime:1800*1e3,retry:(J,C)=>C instanceof ge&&C.reason==="not-ready"?J<pr:J<1,retryDelay:(J,C)=>C instanceof ge&&C.reason==="not-ready"?(A.current=!0,(C.retryAfterSeconds??1)*1e3):1e3,meta:{softError:!0}}),Ee=R.isLoading&&!!l,ye=o!==void 0&&l===null;V.useEffect(()=>{Ee&&(h.current=performance.now())},[Ee]),V.useEffect(()=>{R.isSuccess&&h.current!==null&&(c.recordTiming("message.body.load",Math.round(performance.now()-h.current)),h.current=null)},[R.isSuccess,c]);const Me=R.data&&l?{kind:l.kind,body:R.data}:void 0;return{picked:l,data:Me,isLoading:Ee,hasNoRenderablePart:ye,isError:R.isError,error:R.error,refetch:R.refetch}};export{ge as B,Sr as a,Nr as b,dr as c,Rr as d,Dr as e,Lr as f,wr as g,Cr as h,lr as i,cr as o,br as p,Or as u};
@@ -1 +1 @@
1
- import{cU as Q,cV as y,cW as S,cX as w,cY as C,e as k,cZ as q,c_ as x,r as p,c$ as M,d0 as H,d1 as L,d2 as P,d3 as O,d4 as B,d5 as A}from"./index-9QMShYZC.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 U=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.#f(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.#d(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,f)=>o!==s[f]),d=u||a,b=d?!0:n.some((o,f)=>{const g=this.#e[f];return!g||!S(o,g)});!d&&!b||(d&&(this.#c=t,this.#s=i),this.#e=n,this.hasListeners()&&(d&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(f=>{this.#f(o,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#d(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)}#d(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}#f(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 I({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 U(t,u,e)),[d,b,o]=a.getOptimisticResult(u,e.combine),f=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>f?a.subscribe(y.batchCalls(h)):P,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p.useEffect(()=>{a.setQueries(u,e)},[u,e,a]);const m=d.some((h,c)=>O(u[c],h))?d.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=d.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{I as u};
1
+ import{cU as Q,cV as y,cW as S,cX as w,cY as C,e as k,cZ as q,c_ as x,r as p,c$ as M,d0 as H,d1 as L,d2 as P,d3 as O,d4 as B,d5 as A}from"./index-fsuIswbe.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 U=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.#f(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.#d(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,f)=>o!==s[f]),d=u||a,b=d?!0:n.some((o,f)=>{const g=this.#e[f];return!g||!S(o,g)});!d&&!b||(d&&(this.#c=t,this.#s=i),this.#e=n,this.hasListeners()&&(d&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(f=>{this.#f(o,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#d(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)}#d(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}#f(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 I({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 U(t,u,e)),[d,b,o]=a.getOptimisticResult(u,e.combine),f=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>f?a.subscribe(y.batchCalls(h)):P,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p.useEffect(()=>{a.setQueries(u,e)},[u,e,a]);const m=d.some((h,c)=>O(u[c],h))?d.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=d.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{I as u};
@@ -1 +1 @@
1
- import{j as E,y as K,p as Q,B as U,e as N,P as B,r as o,aI as R,U as $,V as z,l as G,a3 as I,a4 as V,a7 as X}from"./index-9QMShYZC.js";import{C as J}from"./circle-check-big-D7T0Fr-Y.js";import{R as Y}from"./refresh-cw-D43K-uJ_.js";import{u as P}from"./useQueries-B2w-f15M.js";function ye({state:e,onRefresh:s,label:t,errorMessage:r,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",n=e==="error",h=e==="success",y=n?E.jsx(K,{className:"size-4 text-danger"}):h?E.jsx(J,{className:"size-4 text-positive"}):E.jsx(Y,{className:Q("size-4",i&&"animate-spin")}),w=n?`${t} — failed: ${r??"try again"}`:i?`${t} — refreshing`:h?`${t} — up to date`:a?`${t} — new mail`:t;return E.jsxs("div",{className:"relative inline-flex",children:[E.jsx(U,{variant:"ghost",size:u,icon:y,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:n?r:t,className:c}),e==="idle"&&a&&E.jsx("span",{"aria-hidden":"true",className:"absolute right-1 top-1 size-1.5 rounded-full bg-accent-2"})]})}const Z=180*1e3,Se=30*1e3;let L=0;const M=new Set,ee=(e=Date.now())=>{L=e+Z;for(const s of M)s()},we=(e=Date.now())=>e<L,xe=e=>(M.add(e),()=>{M.delete(e)}),_=6e4,te=new Set(["sent","drafts","trash","archive"]),C=(e,s)=>{const t=new Map;for(const r of e){const a=s.get(r.mailboxId)?.role;a&&te.has(a)||t.set(r.mailboxId,r.highWaterMarkUid)}return t},q=(e,s)=>{const t=[];for(const[r,a]of s)a>(e.get(r)??0)&&t.push(r);return t},se=(e,s)=>q(e,s).length>0,F=o.createContext(null),ne=()=>{const e=o.useContext(F);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function pe({accountIds:e,children:s}){const t=N(),{resultFolderIndex:r}=B(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,n]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:_,staleTime:_,meta:{softError:!0}}))}),y=h.map(l=>l.dataUpdatedAt).join(","),w=e.join(",");o.useEffect(()=>{let l=!1;const f=new Set(i);e.forEach((d,p)=>{const b=h[p]?.data;if(!b)return;const g=C(b.mailboxes??[],r),v=c.current.get(d);if(c.current.set(d,g),v){const A=q(v,g);A.length>0&&$(t,z(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;se(W,g)&&(f.add(d),l=!0)}),l&&n(f)},[w,y]);const S=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{n(f=>{if(l.every(p=>!f.has(p)))return f;const d=new Set(f);for(const p of l)d.delete(p);return d});for(const f of l){const d=t.getQueryData(R({path:{accountId:f}}).queryKey);a.current.set(f,C(d?.mailboxes??[],r)),u.current.add(f)}},[t,r]),m=o.useMemo(()=>({hasNewMail:S,acknowledge:x}),[S,x]);return E.jsx(F.Provider,{value:m,children:s})}const re=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function j(e){return!!e&&re.has(e)}const D=3e3,oe=D*2,O={syncing:!1,resolved:!1,synced:0,total:0};function Ee(e,s){const t=e.join(","),[r,a]=o.useState(!1),[u,c]=o.useState(!1);o.useEffect(()=>{a(!1),c(!1)},[t,s]),o.useEffect(()=>{if(!s)return;const m=setTimeout(()=>c(!0),oe);return()=>clearTimeout(m)},[t,s]);const i=P({queries:e.map(m=>({...R({path:{accountId:m}}),enabled:s&&!r,refetchInterval:D,meta:{softError:!0}}))}),n=i.every(m=>m.isSuccess||m.isError),h=i.length===0||n||u;let y=!1,w=0,S=0;for(const m of i)if(j(m.data?.syncPhase)){y=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,S+=l.messagesTotal}const x=s&&h&&!y;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?O:{syncing:y,resolved:!0,synced:w,total:S}}const ae=2e3,ie=45e3,ce=e=>new Promise(s=>setTimeout(s,e)),k=e=>e instanceof Error&&e.message?e.message:"Something went wrong",ue=e=>{X(e,{softError:!0})},T=(e,s)=>e.fetchQuery({...R({path:{accountId:s}}),staleTime:0}),H=e=>e.mailboxes?.find(s=>s.fullPath?.toUpperCase()==="INBOX")?.lastSyncedAt??0,le=async({accountId:e,readStatus:s,baselineLastSyncAt:t,baselineInboxSyncedAt:r=0,onInboxSynced:a,deadline:u,pollMs:c=ae})=>{let i=!1;for(;;){const n=await s().then(S=>({ok:!0,data:S})).catch(S=>({ok:!1,error:S}));if(!n.ok)return{accountId:e,message:k(n.error)};const{syncPhase:h,lastSyncAt:y}=n.data;if((y??0)>t&&!j(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(n.data)>r&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ce(c)}},fe=async(e,s,t,r,a)=>{const u=await T(e,t).then(n=>({ok:!0,lastSyncAt:n.lastSyncAt??0,inboxSyncedAt:H(n)})).catch(n=>({ok:!1,error:n}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:k(u.error)};const c=await I({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(n=>({ok:!1,error:n}));if(!c.ok)return ue(c.error),{accountId:t,enqueued:!1,ok:!1,message:k(c.error)};s.recordEvent("sync.triggered");const i=await le({accountId:t,readStatus:()=>T(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:r});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},be=(e,s={})=>{const t=N(),r=G(),{acknowledge:a}=ne(),[u,c]=o.useState("idle"),[i,n]=o.useState(),h=o.useRef(0),y=o.useRef(e);y.current=e;const w=o.useRef(s);w.current=s,o.useEffect(()=>{if(u!=="success")return;const x=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(x)},[u]);const S=o.useCallback(()=>{const x=y.current;if(x.length===0){c("error"),n("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),n(void 0),ee();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:V({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ie,d=await Promise.all(x.map(g=>fe(t,r,g,f,l)));if(h.current!==m)return;const p=d.filter(g=>g.enqueued).map(g=>g.accountId);for(const g of p)l(g);p.length>0&&a(p);const b=d.filter(g=>!g.ok);b.length===0?c("success"):(c("error"),n(b[0]?.message))})()},[a,t,r]);return{state:u,errorMessage:i,refresh:S}};export{Se as H,pe as M,ye as R,be as a,j as b,Ee as c,we as i,xe as s,ne as u};
1
+ import{j as E,y as K,p as Q,B as U,e as N,P as B,r as o,aI as R,U as $,V as z,l as G,a3 as I,a4 as V,a7 as X}from"./index-fsuIswbe.js";import{C as J}from"./circle-check-big-CMsxQSjY.js";import{R as Y}from"./refresh-cw-Cu9_I3cT.js";import{u as P}from"./useQueries-DPH-PeHV.js";function ye({state:e,onRefresh:s,label:t,errorMessage:r,hasUpdate:a,size:u="sm",className:c}){const i=e==="refreshing",n=e==="error",h=e==="success",y=n?E.jsx(K,{className:"size-4 text-danger"}):h?E.jsx(J,{className:"size-4 text-positive"}):E.jsx(Y,{className:Q("size-4",i&&"animate-spin")}),w=n?`${t} — failed: ${r??"try again"}`:i?`${t} — refreshing`:h?`${t} — up to date`:a?`${t} — new mail`:t;return E.jsxs("div",{className:"relative inline-flex",children:[E.jsx(U,{variant:"ghost",size:u,icon:y,onClick:s,disabled:i,"aria-label":w,"aria-busy":i||void 0,title:n?r:t,className:c}),e==="idle"&&a&&E.jsx("span",{"aria-hidden":"true",className:"absolute right-1 top-1 size-1.5 rounded-full bg-accent-2"})]})}const Z=180*1e3,Se=30*1e3;let L=0;const M=new Set,ee=(e=Date.now())=>{L=e+Z;for(const s of M)s()},we=(e=Date.now())=>e<L,xe=e=>(M.add(e),()=>{M.delete(e)}),_=6e4,te=new Set(["sent","drafts","trash","archive"]),C=(e,s)=>{const t=new Map;for(const r of e){const a=s.get(r.mailboxId)?.role;a&&te.has(a)||t.set(r.mailboxId,r.highWaterMarkUid)}return t},q=(e,s)=>{const t=[];for(const[r,a]of s)a>(e.get(r)??0)&&t.push(r);return t},se=(e,s)=>q(e,s).length>0,F=o.createContext(null),ne=()=>{const e=o.useContext(F);if(!e)throw new Error("useMailFreshness must be used inside <MailFreshnessProvider>");return e};function pe({accountIds:e,children:s}){const t=N(),{resultFolderIndex:r}=B(),a=o.useRef(new Map),u=o.useRef(new Set),c=o.useRef(new Map),[i,n]=o.useState(new Set),h=P({queries:e.map(l=>({...R({path:{accountId:l}}),refetchInterval:_,staleTime:_,meta:{softError:!0}}))}),y=h.map(l=>l.dataUpdatedAt).join(","),w=e.join(",");o.useEffect(()=>{let l=!1;const f=new Set(i);e.forEach((d,p)=>{const b=h[p]?.data;if(!b)return;const g=C(b.mailboxes??[],r),v=c.current.get(d);if(c.current.set(d,g),v){const A=q(v,g);A.length>0&&$(t,z(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;se(W,g)&&(f.add(d),l=!0)}),l&&n(f)},[w,y]);const S=o.useCallback(l=>l.some(f=>i.has(f)),[i]),x=o.useCallback(l=>{n(f=>{if(l.every(p=>!f.has(p)))return f;const d=new Set(f);for(const p of l)d.delete(p);return d});for(const f of l){const d=t.getQueryData(R({path:{accountId:f}}).queryKey);a.current.set(f,C(d?.mailboxes??[],r)),u.current.add(f)}},[t,r]),m=o.useMemo(()=>({hasNewMail:S,acknowledge:x}),[S,x]);return E.jsx(F.Provider,{value:m,children:s})}const re=new Set(["discovering_mailboxes","syncing_inbox","syncing_others"]);function j(e){return!!e&&re.has(e)}const D=3e3,oe=D*2,O={syncing:!1,resolved:!1,synced:0,total:0};function Ee(e,s){const t=e.join(","),[r,a]=o.useState(!1),[u,c]=o.useState(!1);o.useEffect(()=>{a(!1),c(!1)},[t,s]),o.useEffect(()=>{if(!s)return;const m=setTimeout(()=>c(!0),oe);return()=>clearTimeout(m)},[t,s]);const i=P({queries:e.map(m=>({...R({path:{accountId:m}}),enabled:s&&!r,refetchInterval:D,meta:{softError:!0}}))}),n=i.every(m=>m.isSuccess||m.isError),h=i.length===0||n||u;let y=!1,w=0,S=0;for(const m of i)if(j(m.data?.syncPhase)){y=!0;for(const l of m.data?.mailboxes??[])w+=l.messagesSynced,S+=l.messagesTotal}const x=s&&h&&!y;return o.useEffect(()=>{x&&a(!0)},[x]),!s||!h?O:{syncing:y,resolved:!0,synced:w,total:S}}const ae=2e3,ie=45e3,ce=e=>new Promise(s=>setTimeout(s,e)),k=e=>e instanceof Error&&e.message?e.message:"Something went wrong",ue=e=>{X(e,{softError:!0})},T=(e,s)=>e.fetchQuery({...R({path:{accountId:s}}),staleTime:0}),H=e=>e.mailboxes?.find(s=>s.fullPath?.toUpperCase()==="INBOX")?.lastSyncedAt??0,le=async({accountId:e,readStatus:s,baselineLastSyncAt:t,baselineInboxSyncedAt:r=0,onInboxSynced:a,deadline:u,pollMs:c=ae})=>{let i=!1;for(;;){const n=await s().then(S=>({ok:!0,data:S})).catch(S=>({ok:!1,error:S}));if(!n.ok)return{accountId:e,message:k(n.error)};const{syncPhase:h,lastSyncAt:y}=n.data;if((y??0)>t&&!j(h))return h==="error"?{accountId:e,message:"Sync failed for this account"}:void 0;if(!i&&H(n.data)>r&&(i=!0,a?.()),Date.now()>=u)return{accountId:e,message:"Refresh is taking longer than usual"};await ce(c)}},fe=async(e,s,t,r,a)=>{const u=await T(e,t).then(n=>({ok:!0,lastSyncAt:n.lastSyncAt??0,inboxSyncedAt:H(n)})).catch(n=>({ok:!1,error:n}));if(!u.ok)return{accountId:t,enqueued:!1,ok:!1,message:k(u.error)};const c=await I({path:{accountId:t},throwOnError:!0}).then(()=>({ok:!0})).catch(n=>({ok:!1,error:n}));if(!c.ok)return ue(c.error),{accountId:t,enqueued:!1,ok:!1,message:k(c.error)};s.recordEvent("sync.triggered");const i=await le({accountId:t,readStatus:()=>T(e,t),baselineLastSyncAt:u.lastSyncAt,baselineInboxSyncedAt:u.inboxSyncedAt,onInboxSynced:()=>a(t),deadline:r});return i?{accountId:t,enqueued:!0,ok:!1,message:i.message}:{accountId:t,enqueued:!0,ok:!0}},be=(e,s={})=>{const t=N(),r=G(),{acknowledge:a}=ne(),[u,c]=o.useState("idle"),[i,n]=o.useState(),h=o.useRef(0),y=o.useRef(e);y.current=e;const w=o.useRef(s);w.current=s,o.useEffect(()=>{if(u!=="success")return;const x=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(x)},[u]);const S=o.useCallback(()=>{const x=y.current;if(x.length===0){c("error"),n("Nothing to refresh yet");return}const m=++h.current;c("refreshing"),n(void 0),ee();const l=f=>{h.current===m&&(t.invalidateQueries({queryKey:V({path:{accountId:f}})}),w.current.onSettled?.())};(async()=>{const f=Date.now()+ie,d=await Promise.all(x.map(g=>fe(t,r,g,f,l)));if(h.current!==m)return;const p=d.filter(g=>g.enqueued).map(g=>g.accountId);for(const g of p)l(g);p.length>0&&a(p);const b=d.filter(g=>!g.ok);b.length===0?c("success"):(c("error"),n(b[0]?.message))})()},[a,t,r]);return{state:u,errorMessage:i,refresh:S}};export{Se as H,pe as M,ye as R,be as a,j as b,Ee as c,we as i,xe as s,ne as u};
@@ -1 +1 @@
1
- import{b as n,Y as s,r as d,cg as r}from"./index-9QMShYZC.js";import{u as p}from"./useQueries-B2w-f15M.js";const i={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};i.node;const h=n(i),m=a=>({items:a.map(e=>e.data?.items??[]),isPending:a.some(e=>e.isPending),error:a.find(e=>e.error)?.error??null});function y(a){const e=p({queries:a.map(t=>({...s({path:{accountId:t.accountId}}),staleTime:1/0})),combine:m});return{index:d.useMemo(()=>r(a.map((t,o)=>({folderAppointments:t.folderAppointments,mailboxes:e.items[o]??[]}))),[a,e]),isPending:e.isPending,error:e.error}}export{h as B,y as u};
1
+ import{b as n,Y as s,r as d,cg as r}from"./index-fsuIswbe.js";import{u as p}from"./useQueries-DPH-PeHV.js";const i={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};i.node;const h=n(i),m=a=>({items:a.map(e=>e.data?.items??[]),isPending:a.some(e=>e.isPending),error:a.find(e=>e.error)?.error??null});function y(a){const e=p({queries:a.map(t=>({...s({path:{accountId:t.accountId}}),staleTime:1/0})),combine:m});return{index:d.useMemo(()=>r(a.map((t,o)=>({folderAppointments:t.folderAppointments,mailboxes:e.items[o]??[]}))),[a,e]),isPending:e.isPending,error:e.error}}export{h as B,y as u};
@@ -1 +1 @@
1
- import{e as m,an as y,a as b,c as L,r as c,f as w,ao as S,k as E,h as k}from"./index-9QMShYZC.js";var u={en:1199414,"en-GB":1199758,nl:3180464},g=["en","en-GB","nl"];const C=()=>typeof g>"u"?[]:g,M=()=>{const e="/spellcheck/de99b00dc30674fd/";return typeof document>"u"?e:new URL(e,document.baseURI).href},_=e=>typeof u>"u"?0:u[e]??0,O=(e,n=C())=>{const t=e.toLowerCase(),a=n.find(i=>i.toLowerCase()===t);if(a)return a;const o=t.split("-")[0];return n.find(i=>i.toLowerCase().split("-")[0]===o)??null},T=[{tag:"ar",detectionCode:"arb"},{tag:"az",detectionCode:"azj"},{tag:"be",detectionCode:"bel"},{tag:"bg",detectionCode:"bul"},{tag:"bs",detectionCode:"bos"},{tag:"cs",detectionCode:"ces"},{tag:"de",detectionCode:"deu"},{tag:"en",detectionCode:"eng"},{tag:"es",detectionCode:"spa"},{tag:"fa",detectionCode:"pes"},{tag:"fr",detectionCode:"fra"},{tag:"ha",detectionCode:"hau"},{tag:"hi",detectionCode:"hin"},{tag:"hr",detectionCode:"hrv"},{tag:"hu",detectionCode:"hun"},{tag:"id",detectionCode:"ind"},{tag:"ig",detectionCode:"ibo"},{tag:"it",detectionCode:"ita"},{tag:"jv",detectionCode:"jav"},{tag:"kk",detectionCode:"kaz"},{tag:"mr",detectionCode:"mar"},{tag:"ms",detectionCode:"zlm"},{tag:"ne",detectionCode:"npi"},{tag:"nl",detectionCode:"nld"},{tag:"pl",detectionCode:"pol"},{tag:"ps",detectionCode:"pbu"},{tag:"pt",detectionCode:"por"},{tag:"ro",detectionCode:"ron"},{tag:"ru",detectionCode:"rus"},{tag:"so",detectionCode:"som"},{tag:"sr",detectionCode:"srp"},{tag:"su",detectionCode:"sun"},{tag:"sv",detectionCode:"swe"},{tag:"sw",detectionCode:"swh"},{tag:"tl",detectionCode:"tgl"},{tag:"tr",detectionCode:"tur"},{tag:"uk",detectionCode:"ukr"},{tag:"ur",detectionCode:"urd"},{tag:"vi",detectionCode:"vie"},{tag:"yo",detectionCode:"yor"},{tag:"zu",detectionCode:"zul"}],d=e=>(e.split("-")[0]??"").toLowerCase(),v=new Map(T.map(e=>[e.tag,e])),x=e=>v.get(d(e))?.detectionCode??null,P=/^[a-z]{2,3}(-[a-z0-9]{2,8})*$/i,G=e=>d(e).toUpperCase(),H=e=>{if(!P.test(e))return e;const t=new Intl.DisplayNames([e],{type:"language",fallback:"none"}).of(e);return t?t.charAt(0).toLocaleUpperCase(e)+t.slice(1):e},z=(e,n=C())=>{const t=[...e,...n].filter(o=>x(o)!==null),a=[...new Set(t.map(d))];return a.includes("en")||a.push("en"),a},N=e=>/iPhone|iPad|iPod/.test(e)?"On iPhone and iPad the keyboard decides this. Add the language under Settings, then General, then Keyboard.":/Edg\//.test(e)?"Edge checks every language you add under Settings, then Languages. Adding one there checks it alongside the others.":/Firefox\//.test(e)?"Firefox uses this setting. Right-click the message to add a dictionary for it.":/Chrome\/|Chromium\//.test(e)?"Chrome checks every language you add under Settings, then Languages. Adding one there checks it alongside the others.":/Safari\//.test(e)?"macOS decides this under Keyboard, then Text Input, then Spelling. Automatic by Language covers every language enabled there.":"Your browser decides which dictionaries it checks. Add this language in its own language settings to have it spellchecked.",h=e=>new DOMParser().parseFromString(e,"text/html"),p=e=>{const n=[...e.children];if(n.length!==1)return null;const t=n[0];return t?[...e.childNodes].some(o=>o!==t&&(o.textContent??"").trim()!=="")?null:t:null},R=(e,n)=>{if(e==="")return"";const t=h(e),a=p(t.body);if(a?.tagName==="DIV"&&a.hasAttribute("lang"))return a.setAttribute("lang",n),t.body.innerHTML;const o=t.createElement("div");for(o.setAttribute("lang",n);t.body.firstChild;)o.append(t.body.firstChild);return t.body.append(o),t.body.innerHTML},U=e=>{if(e==="")return{html:e,language:null};const n=h(e),t=p(n.body);return t?.tagName!=="DIV"||!t.hasAttribute("lang")?{html:e,language:null}:{html:t.innerHTML,language:t.getAttribute("lang")}},l={html:"",plainText:""},B=e=>{const n=m(),{pushError:t}=y(),{data:a}=b({...L(),staleTime:1/0}),o=c.useMemo(()=>{if(!e||!a)return l;const s=a.accounts.find(r=>r.accountId===e);return s?{html:s.signatureHtml??"",plainText:s.signaturePlainText??""}:l},[e,a]),i=w({...k(),onSuccess:()=>{n.invalidateQueries({queryKey:E()})},onError:s=>{t(S("Couldn't save signature","The signature wasn't saved.",s))}}),f=c.useCallback((s,r)=>{e&&i.mutate({path:{accountId:e},body:{signatureHtml:s,signaturePlainText:r}})},[e,i]);return{signature:o,setSignature:f,isSaving:i.isPending}};export{T as C,U as a,G as b,N as c,z as d,x as e,O as f,_ as g,H as l,d as p,M as s,B as u,R as w};
1
+ import{e as m,an as y,a as b,c as L,r as c,f as w,ao as S,k as E,h as k}from"./index-fsuIswbe.js";var u={en:1199414,"en-GB":1199758,nl:3180464},g=["en","en-GB","nl"];const C=()=>typeof g>"u"?[]:g,M=()=>{const e="/spellcheck/de99b00dc30674fd/";return typeof document>"u"?e:new URL(e,document.baseURI).href},_=e=>typeof u>"u"?0:u[e]??0,O=(e,n=C())=>{const t=e.toLowerCase(),a=n.find(i=>i.toLowerCase()===t);if(a)return a;const o=t.split("-")[0];return n.find(i=>i.toLowerCase().split("-")[0]===o)??null},T=[{tag:"ar",detectionCode:"arb"},{tag:"az",detectionCode:"azj"},{tag:"be",detectionCode:"bel"},{tag:"bg",detectionCode:"bul"},{tag:"bs",detectionCode:"bos"},{tag:"cs",detectionCode:"ces"},{tag:"de",detectionCode:"deu"},{tag:"en",detectionCode:"eng"},{tag:"es",detectionCode:"spa"},{tag:"fa",detectionCode:"pes"},{tag:"fr",detectionCode:"fra"},{tag:"ha",detectionCode:"hau"},{tag:"hi",detectionCode:"hin"},{tag:"hr",detectionCode:"hrv"},{tag:"hu",detectionCode:"hun"},{tag:"id",detectionCode:"ind"},{tag:"ig",detectionCode:"ibo"},{tag:"it",detectionCode:"ita"},{tag:"jv",detectionCode:"jav"},{tag:"kk",detectionCode:"kaz"},{tag:"mr",detectionCode:"mar"},{tag:"ms",detectionCode:"zlm"},{tag:"ne",detectionCode:"npi"},{tag:"nl",detectionCode:"nld"},{tag:"pl",detectionCode:"pol"},{tag:"ps",detectionCode:"pbu"},{tag:"pt",detectionCode:"por"},{tag:"ro",detectionCode:"ron"},{tag:"ru",detectionCode:"rus"},{tag:"so",detectionCode:"som"},{tag:"sr",detectionCode:"srp"},{tag:"su",detectionCode:"sun"},{tag:"sv",detectionCode:"swe"},{tag:"sw",detectionCode:"swh"},{tag:"tl",detectionCode:"tgl"},{tag:"tr",detectionCode:"tur"},{tag:"uk",detectionCode:"ukr"},{tag:"ur",detectionCode:"urd"},{tag:"vi",detectionCode:"vie"},{tag:"yo",detectionCode:"yor"},{tag:"zu",detectionCode:"zul"}],d=e=>(e.split("-")[0]??"").toLowerCase(),v=new Map(T.map(e=>[e.tag,e])),x=e=>v.get(d(e))?.detectionCode??null,P=/^[a-z]{2,3}(-[a-z0-9]{2,8})*$/i,G=e=>d(e).toUpperCase(),H=e=>{if(!P.test(e))return e;const t=new Intl.DisplayNames([e],{type:"language",fallback:"none"}).of(e);return t?t.charAt(0).toLocaleUpperCase(e)+t.slice(1):e},z=(e,n=C())=>{const t=[...e,...n].filter(o=>x(o)!==null),a=[...new Set(t.map(d))];return a.includes("en")||a.push("en"),a},N=e=>/iPhone|iPad|iPod/.test(e)?"On iPhone and iPad the keyboard decides this. Add the language under Settings, then General, then Keyboard.":/Edg\//.test(e)?"Edge checks every language you add under Settings, then Languages. Adding one there checks it alongside the others.":/Firefox\//.test(e)?"Firefox uses this setting. Right-click the message to add a dictionary for it.":/Chrome\/|Chromium\//.test(e)?"Chrome checks every language you add under Settings, then Languages. Adding one there checks it alongside the others.":/Safari\//.test(e)?"macOS decides this under Keyboard, then Text Input, then Spelling. Automatic by Language covers every language enabled there.":"Your browser decides which dictionaries it checks. Add this language in its own language settings to have it spellchecked.",h=e=>new DOMParser().parseFromString(e,"text/html"),p=e=>{const n=[...e.children];if(n.length!==1)return null;const t=n[0];return t?[...e.childNodes].some(o=>o!==t&&(o.textContent??"").trim()!=="")?null:t:null},R=(e,n)=>{if(e==="")return"";const t=h(e),a=p(t.body);if(a?.tagName==="DIV"&&a.hasAttribute("lang"))return a.setAttribute("lang",n),t.body.innerHTML;const o=t.createElement("div");for(o.setAttribute("lang",n);t.body.firstChild;)o.append(t.body.firstChild);return t.body.append(o),t.body.innerHTML},U=e=>{if(e==="")return{html:e,language:null};const n=h(e),t=p(n.body);return t?.tagName!=="DIV"||!t.hasAttribute("lang")?{html:e,language:null}:{html:t.innerHTML,language:t.getAttribute("lang")}},l={html:"",plainText:""},B=e=>{const n=m(),{pushError:t}=y(),{data:a}=b({...L(),staleTime:1/0}),o=c.useMemo(()=>{if(!e||!a)return l;const s=a.accounts.find(r=>r.accountId===e);return s?{html:s.signatureHtml??"",plainText:s.signaturePlainText??""}:l},[e,a]),i=w({...k(),onSuccess:()=>{n.invalidateQueries({queryKey:E()})},onError:s=>{t(S("Couldn't save signature","The signature wasn't saved.",s))}}),f=c.useCallback((s,r)=>{e&&i.mutate({path:{accountId:e},body:{signatureHtml:s,signaturePlainText:r}})},[e,i]);return{signature:o,setSignature:f,isSaving:i.isPending}};export{T as C,U as a,G as b,N as c,z as d,x as e,O as f,_ as g,H as l,d as p,M as s,B as u,R as w};
@@ -1,4 +1,4 @@
1
- import{j as s,aE as T,B as d,aL as C,bl as j,bj as N,d as $,ag as A,aa as E,bB as k,cd as f,ce as _,cf as M,a as P,c as W,r as l,a5 as z,az as p,aA as x,u as O,af as B}from"./index-9QMShYZC.js";import{B as h,u as L}from"./useResultFolderIndex-BTY9xXDW.js";import{B as y}from"./badge-CoJzTE5F.js";import{C as S}from"./circle-check-bdTVfKb7.js";import{C as q}from"./copy-CBfiykpW.js";import{E as D}from"./external-link-D7g7AAZP.js";import{f as U}from"./ErrorState-DHsQU1XS.js";import{a as F}from"./sections-aErIO9A7.js";import{w as G}from"./help-copy-DWTmr8ZJ.js";import{S as H}from"./settings-screen-DjVJZ-eS.js";import"./useQueries-B2w-f15M.js";import"./kbd-BD-ER_Yv.js";import"./avatar-BLhNXW-W.js";import"./chevron-left-Brxnh-p_.js";import"./menu-BQAGsNoE.js";import"./circle-question-mark-BJ-7TUgf.js";function Q({report:e,onClose:t,issueUrl:n,onCopy:a}){return e===null?null:s.jsx(T,{open:!0,onClose:t,title:"Report this message",children:s.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[s.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[s.jsx("h3",{className:"text-sm font-semibold text-fg",children:"Report this message"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"This is everything the report contains. It describes what went wrong with the message — never its contents, addresses, subject, attachment names, folder name, or the parser's own error text."})]}),s.jsx("pre",{className:"flex-1 overflow-auto bg-surface-sunken px-4 py-3 text-2xs leading-relaxed whitespace-pre-wrap text-fg-muted",children:e}),s.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[s.jsx(d,{variant:"ghost",size:"sm",onClick:t,children:"Cancel"}),s.jsx(d,{variant:"secondary",size:"sm",icon:s.jsx(q,{className:"size-3.5"}),onClick:()=>a(e),children:"Copy report"}),s.jsx(C,{external:!0,size:"sm",href:n,icon:s.jsx(D,{className:"size-3.5"}),children:"Open on GitHub"})]})]})})}const V={BodyParse:"The message is built in a way Remit could not read."};function Y(e){return V[e]}function R(e){return e.split(";")[0].trim()}const b=/^[A-Za-z0-9!#$%&'*+._-]+$/,v=/^[A-Za-z0-9!#$%&'*+._-]+\/[A-Za-z0-9!#$%&'*+._-]+$/;function m(e,t){return t.test(e)?`\`${e}\``:`\`${JSON.stringify(e).replace(/`/g,"\\u0060")}\` (malformed)`}function Z(e){const t=R(e);return v.test(t)?t:JSON.stringify(t)}const g="_not read_";function J(e){return e.length===0?["(no MIME structure was read)"]:e.map(t=>`${" ".repeat(t.depth)}- ${Z(t.contentType)}`)}const K="_No message content, addresses, subject, attachment names or parser output are included._";function w(e){return{head:[`### Message quarantined at \`${e.failureStage}\``,"",`- **Failure**: \`${e.failureCode}\``,`- **Folder role**: ${e.mailboxRole??"_none appointed_"}`,`- **Failing part**: ${e.failurePartPath==null?"_whole message_":`\`${e.failurePartPath}\``}`,`- **Attempts before quarantine**: ${e.attempts}`,`- **Worker build**: ${e.workerVersion}`,`- **Message-ID hash**: ${e.messageIdHash==null?"_none declared_":`\`${e.messageIdHash}\``}`,"","#### Message shape","",`- **Content-Type**: ${e.contentType==null?g:m(R(e.contentType),v)}`,`- **Content-Transfer-Encoding**: ${e.transferEncoding==null?g:m(e.transferEncoding,b)}`,`- **Charset**: ${e.charset==null?"_not declared_":m(e.charset,b)}`,`- **Size**: ${e.sizeBytes==null?g:`${e.sizeBytes} bytes`}`,"","MIME structure:"].join(`
1
+ import{j as s,aE as T,B as d,aL as C,bl as j,bj as N,d as $,ag as A,aa as E,bB as k,cd as f,ce as _,cf as M,a as P,c as W,r as l,a5 as z,az as p,aA as x,u as O,af as B}from"./index-fsuIswbe.js";import{B as h,u as L}from"./useResultFolderIndex-BVyfzXH5.js";import{B as y}from"./badge-BB80tGxy.js";import{C as S}from"./circle-check-DlR8I4Hf.js";import{C as q}from"./copy-BokIobZ4.js";import{E as D}from"./external-link-L7NXOTeQ.js";import{f as U}from"./ErrorState-BTHOmsYP.js";import{a as F}from"./sections-DpRVKuXF.js";import{w as G}from"./help-copy-DUjzIPXf.js";import{S as H}from"./settings-screen-DTYVWAkg.js";import"./useQueries-DPH-PeHV.js";import"./kbd-jzPSd-a2.js";import"./avatar-Bq7beWCy.js";import"./chevron-left-CUHU8UT9.js";import"./menu-Bh94jr77.js";import"./circle-question-mark-DhNa_A16.js";function Q({report:e,onClose:t,issueUrl:n,onCopy:a}){return e===null?null:s.jsx(T,{open:!0,onClose:t,title:"Report this message",children:s.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[s.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[s.jsx("h3",{className:"text-sm font-semibold text-fg",children:"Report this message"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"This is everything the report contains. It describes what went wrong with the message — never its contents, addresses, subject, attachment names, folder name, or the parser's own error text."})]}),s.jsx("pre",{className:"flex-1 overflow-auto bg-surface-sunken px-4 py-3 text-2xs leading-relaxed whitespace-pre-wrap text-fg-muted",children:e}),s.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[s.jsx(d,{variant:"ghost",size:"sm",onClick:t,children:"Cancel"}),s.jsx(d,{variant:"secondary",size:"sm",icon:s.jsx(q,{className:"size-3.5"}),onClick:()=>a(e),children:"Copy report"}),s.jsx(C,{external:!0,size:"sm",href:n,icon:s.jsx(D,{className:"size-3.5"}),children:"Open on GitHub"})]})]})})}const V={BodyParse:"The message is built in a way Remit could not read."};function Y(e){return V[e]}function R(e){return e.split(";")[0].trim()}const b=/^[A-Za-z0-9!#$%&'*+._-]+$/,v=/^[A-Za-z0-9!#$%&'*+._-]+\/[A-Za-z0-9!#$%&'*+._-]+$/;function m(e,t){return t.test(e)?`\`${e}\``:`\`${JSON.stringify(e).replace(/`/g,"\\u0060")}\` (malformed)`}function Z(e){const t=R(e);return v.test(t)?t:JSON.stringify(t)}const g="_not read_";function J(e){return e.length===0?["(no MIME structure was read)"]:e.map(t=>`${" ".repeat(t.depth)}- ${Z(t.contentType)}`)}const K="_No message content, addresses, subject, attachment names or parser output are included._";function w(e){return{head:[`### Message quarantined at \`${e.failureStage}\``,"",`- **Failure**: \`${e.failureCode}\``,`- **Folder role**: ${e.mailboxRole??"_none appointed_"}`,`- **Failing part**: ${e.failurePartPath==null?"_whole message_":`\`${e.failurePartPath}\``}`,`- **Attempts before quarantine**: ${e.attempts}`,`- **Worker build**: ${e.workerVersion}`,`- **Message-ID hash**: ${e.messageIdHash==null?"_none declared_":`\`${e.messageIdHash}\``}`,"","#### Message shape","",`- **Content-Type**: ${e.contentType==null?g:m(R(e.contentType),v)}`,`- **Content-Transfer-Encoding**: ${e.transferEncoding==null?g:m(e.transferEncoding,b)}`,`- **Charset**: ${e.charset==null?"_not declared_":m(e.charset,b)}`,`- **Size**: ${e.sizeBytes==null?g:`${e.sizeBytes} bytes`}`,"","MIME structure:"].join(`
2
2
  `),structure:J(e.structure).join(`
3
3
  `),disclaimer:K}}function X(e){const{head:t,structure:n,disclaimer:a}=w(e);return[t,"","```",n,"```","",a].join(`
4
4
  `)}function ee(e){return`Message quarantined: ${e.failureCode} at ${e.failureStage}`}function se(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function te({entry:e,onCutBug:t}){return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:Y(e.failureStage)}),s.jsx("p",{className:"truncate text-xs text-fg-muted",title:e.failureMessage,children:e.failureMessage}),s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[e.mailboxRole&&s.jsx(y,{tone:"warning",children:j(e.mailboxRole)}),s.jsx("span",{className:"truncate",title:e.mailboxPath,children:N(e.mailboxPath,e.mailboxDelimiter)}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`uid ${e.uid}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:se(e.quarantinedAt)}),e.attempts>1&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`${e.attempts} attempts`})]})]})]}),s.jsx(d,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>t(e),children:"Cut a bug"})]})}function ne({entries:e,onCutBug:t}){return s.jsxs("section",{className:"space-y-3",children:[s.jsxs("header",{className:"space-y-1",children:[s.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"Mail Remit could not read is set aside here instead of being skipped, so nothing goes missing quietly. The rest of the folder keeps syncing. Recovering a set-aside message is a re-sync, not a per-row action."})]}),e.length===0&&s.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[s.jsx(S,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Every message has been read successfully. Nothing is set aside."})]}),e.length>1&&s.jsx($,{tone:"warning",children:s.jsxs("p",{className:"flex items-start gap-2",children:[s.jsx(A,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),s.jsxs("span",{children:[s.jsx("span",{className:"font-semibold",children:`${e.length} messages could not be read.`})," ","More than one means something is wrong with how Remit reads mail, not with the mail. Reporting one of these gets it fixed."]})]})}),e.length>0&&s.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:e.map(n=>s.jsx(te,{entry:n,onCutBug:t},n.quarantineId))})]})}const ae={Retrying:"The message could not be synced. Remit tries again every sync.",GaveUp:"The message body could not be downloaded. Remit has stopped trying."};function re(e){return ae[e.state]}const ie="_No message content, addresses, subject, folder name or error text are included._";function oe(e){return[`### Message failed to sync at \`${e.stage}\``,"",`- **State**: \`${e.state}\``,`- **Attempts**: ${e.attempts}`,"",ie].join(`
package/index.html CHANGED
@@ -35,7 +35,7 @@
35
35
  } catch (_) {}
36
36
  })();
37
37
  </script>
38
- <script type="module" crossorigin src="/assets/index-9QMShYZC.js"></script>
38
+ <script type="module" crossorigin src="/assets/index-fsuIswbe.js"></script>
39
39
  <link rel="stylesheet" crossorigin href="/assets/index-DS2W4dIw.css">
40
40
  </head>
41
41
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/web-client-dist",
3
- "version": "0.0.696",
3
+ "version": "0.0.697",
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-9QMShYZC.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{fs as n,P as l,r as c,j as o,O as u}from"./index-9QMShYZC.js";import{a as x}from"./MailShell-jW6JmRUB.js";import{C as r}from"./CollectionPane-DH6KjfeW.js";import{u as d}from"./useLabels-BiYidhrJ.js";import"./nav-link-BaRr8ufx.js";import{a as h}from"./search-token-index-Qe9FLPUx.js";import"./reply-CdhmgK8D.js";import{u as f}from"./search-mirror-PLEys8yY.js";import"./useMessageBodyContent-DdX1ZZwR.js";import"./FullCompose-karPPSLh.js";import"./index-Baytk5ez.js";import"./useSignature-DQ-8mjVB.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-nIbP08sa.js";import"./suggest-list-BU1CAWaS.js";import"./sections-aErIO9A7.js";import"./useMediaQuery-BL50IiYB.js";import"./chevron-down-CHMH78GK.js";import"./ErrorState-DHsQU1XS.js";import"./confirm-dialog-Nw9MwHVJ.js";import"./search-scope-DowTds7f.js";import"./app-chrome-BtWv1mrl.js";import"./useCollectionThreads-bR-HQDXT.js";import"./useQueries-B2w-f15M.js";import"./useInfiniteQuery-CneHLmnO.js";import"./MessageToolbar-BK8iddsy.js";import"./MessageBody-bibpHbC1.js";import"./kbd-BD-ER_Yv.js";import"./roving-focus-CfNxjWPW.js";import"./useJunkMailboxIds-BCvLXlA_.js";import"./badge-CoJzTE5F.js";import"./undo-2-D6HzUJ41.js";import"./DropdownMenu-CgMO6e8h.js";import"./refresh-cw-D43K-uJ_.js";import"./popover-menu-CNRsrfGN.js";import"./mail-DZhnB5_L.js";import"./download-BGcYYhWw.js";import"./avatar-BLhNXW-W.js";import"./EmptyState-FjON9Ve2.js";import"./circle-question-mark-BJ-7TUgf.js";import"./useFilters-C3QPNclJ.js";import"./select-Bar5gCGO.js";import"./plus-ivySO7aD.js";import"./calendar-suggestion-CJMwfDpf.js";import"./useCalendarSuggestions-dbmN8tRh.js";import"./agenda-time--0lz2pGX.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BRsmtlld.js";import"./calendar-failure-note-DlpRkxBL.js";import"./checkbox-ImKY_DpK.js";import"./clock-CcJSq9G-.js";import"./segmented-control-CZRUmZT-.js";import"./useLayoutTier-c01ZWqQ0.js";import"./menu-BQAGsNoE.js";import"./folder-input-uYHmZSIB.js";import"./label-chip-D6mHiJlY.js";import"./cloud-off-KCT2nWKe.js";import"./MailViewChrome-By52WjOW.js";import"./wizard-selection-zWa1qc6-.js";function go(){const{labelId:t}=n.useParams(),{accounts:m}=l(),i=h(),{labels:p}=d(m[0]?.accountId),e=p.find(s=>s.labelId===t)?.name??"";f({to:"/mail/label/$labelId",params:{labelId:t}});const a=c.useMemo(()=>({labelId:t}),[t]);return o.jsx(r,{collection:a,title:e,thread:i,children:o.jsx(x,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(u,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!i})})}export{go as component};
@@ -1 +0,0 @@
1
- import{ac as m,j as o,O as p}from"./index-9QMShYZC.js";import{a}from"./MailShell-jW6JmRUB.js";import{M as r}from"./MailboxPane-dO1WtQIE.js";import"./nav-link-BaRr8ufx.js";import{a as e}from"./search-token-index-Qe9FLPUx.js";import"./reply-CdhmgK8D.js";import{u as s}from"./search-mirror-PLEys8yY.js";import"./useMessageBodyContent-DdX1ZZwR.js";import"./FullCompose-karPPSLh.js";import"./index-Baytk5ez.js";import"./useSignature-DQ-8mjVB.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-nIbP08sa.js";import"./suggest-list-BU1CAWaS.js";import"./sections-aErIO9A7.js";import"./useMediaQuery-BL50IiYB.js";import"./chevron-down-CHMH78GK.js";import"./ErrorState-DHsQU1XS.js";import"./confirm-dialog-Nw9MwHVJ.js";import"./search-scope-DowTds7f.js";import"./app-chrome-BtWv1mrl.js";import"./useInfiniteQuery-CneHLmnO.js";import"./MessageToolbar-BK8iddsy.js";import"./MessageBody-bibpHbC1.js";import"./kbd-BD-ER_Yv.js";import"./roving-focus-CfNxjWPW.js";import"./useQueries-B2w-f15M.js";import"./useJunkMailboxIds-BCvLXlA_.js";import"./badge-CoJzTE5F.js";import"./undo-2-D6HzUJ41.js";import"./DropdownMenu-CgMO6e8h.js";import"./refresh-cw-D43K-uJ_.js";import"./popover-menu-CNRsrfGN.js";import"./mail-DZhnB5_L.js";import"./download-BGcYYhWw.js";import"./avatar-BLhNXW-W.js";import"./EmptyState-FjON9Ve2.js";import"./circle-question-mark-BJ-7TUgf.js";import"./useFilters-C3QPNclJ.js";import"./select-Bar5gCGO.js";import"./plus-ivySO7aD.js";import"./calendar-suggestion-CJMwfDpf.js";import"./useCalendarSuggestions-dbmN8tRh.js";import"./agenda-time--0lz2pGX.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BRsmtlld.js";import"./calendar-failure-note-DlpRkxBL.js";import"./checkbox-ImKY_DpK.js";import"./clock-CcJSq9G-.js";import"./segmented-control-CZRUmZT-.js";import"./useLayoutTier-c01ZWqQ0.js";import"./menu-BQAGsNoE.js";import"./folder-input-uYHmZSIB.js";import"./label-chip-D6mHiJlY.js";import"./useLabels-BiYidhrJ.js";import"./cloud-off-KCT2nWKe.js";import"./useRefreshControl-C-8PJltS.js";import"./circle-check-big-D7T0Fr-Y.js";import"./LabelApplyTrigger-BLIxuWTi.js";import"./MailViewChrome-By52WjOW.js";import"./NavMenuButton-DMqlg3at.js";import"./shield-check-C-ddv9so.js";import"./bottom-sheet-BSnl2giv.js";import"./circle-check-bdTVfKb7.js";function Po(){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{Po as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-9QMShYZC.js";import{B as o}from"./BriefPane-DqAium13.js";import"./MessageToolbar-BK8iddsy.js";import"./MessageBody-bibpHbC1.js";import"./kbd-BD-ER_Yv.js";import"./search-scope-DowTds7f.js";import"./app-chrome-BtWv1mrl.js";import"./nav-link-BaRr8ufx.js";import"./useMediaQuery-BL50IiYB.js";import"./reply-CdhmgK8D.js";import"./useMessageBodyContent-DdX1ZZwR.js";import"./roving-focus-CfNxjWPW.js";import"./chevron-down-CHMH78GK.js";import"./search-token-index-Qe9FLPUx.js";import"./useQueries-B2w-f15M.js";import"./useLabels-BiYidhrJ.js";import"./index-Baytk5ez.js";import"./useSignature-DQ-8mjVB.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-nIbP08sa.js";import"./suggest-list-BU1CAWaS.js";import"./sections-aErIO9A7.js";import"./useJunkMailboxIds-BCvLXlA_.js";import"./badge-CoJzTE5F.js";import"./undo-2-D6HzUJ41.js";import"./DropdownMenu-CgMO6e8h.js";import"./refresh-cw-D43K-uJ_.js";import"./popover-menu-CNRsrfGN.js";import"./ErrorState-DHsQU1XS.js";import"./mail-DZhnB5_L.js";import"./download-BGcYYhWw.js";import"./avatar-BLhNXW-W.js";import"./EmptyState-FjON9Ve2.js";import"./circle-question-mark-BJ-7TUgf.js";import"./useFilters-C3QPNclJ.js";import"./select-Bar5gCGO.js";import"./plus-ivySO7aD.js";import"./calendar-suggestion-CJMwfDpf.js";import"./useCalendarSuggestions-dbmN8tRh.js";import"./agenda-time--0lz2pGX.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BRsmtlld.js";import"./calendar-failure-note-DlpRkxBL.js";import"./checkbox-ImKY_DpK.js";import"./clock-CcJSq9G-.js";import"./segmented-control-CZRUmZT-.js";import"./useLayoutTier-c01ZWqQ0.js";import"./menu-BQAGsNoE.js";import"./folder-input-uYHmZSIB.js";import"./confirm-dialog-Nw9MwHVJ.js";import"./label-chip-D6mHiJlY.js";import"./cloud-off-KCT2nWKe.js";import"./LabelApplyTrigger-BLIxuWTi.js";import"./useRefreshControl-C-8PJltS.js";import"./circle-check-big-D7T0Fr-Y.js";import"./wizard-selection-zWa1qc6-.js";function mr(){return r.jsx(o.Reading,{})}export{mr as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-9QMShYZC.js";import{M as r}from"./MailboxPane-dO1WtQIE.js";import"./useInfiniteQuery-CneHLmnO.js";import"./MessageToolbar-BK8iddsy.js";import"./MessageBody-bibpHbC1.js";import"./kbd-BD-ER_Yv.js";import"./search-scope-DowTds7f.js";import"./app-chrome-BtWv1mrl.js";import"./nav-link-BaRr8ufx.js";import"./useMediaQuery-BL50IiYB.js";import"./reply-CdhmgK8D.js";import"./useMessageBodyContent-DdX1ZZwR.js";import"./roving-focus-CfNxjWPW.js";import"./chevron-down-CHMH78GK.js";import"./search-token-index-Qe9FLPUx.js";import"./useQueries-B2w-f15M.js";import"./useLabels-BiYidhrJ.js";import"./index-Baytk5ez.js";import"./useSignature-DQ-8mjVB.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-nIbP08sa.js";import"./suggest-list-BU1CAWaS.js";import"./sections-aErIO9A7.js";import"./useJunkMailboxIds-BCvLXlA_.js";import"./badge-CoJzTE5F.js";import"./undo-2-D6HzUJ41.js";import"./DropdownMenu-CgMO6e8h.js";import"./refresh-cw-D43K-uJ_.js";import"./popover-menu-CNRsrfGN.js";import"./ErrorState-DHsQU1XS.js";import"./mail-DZhnB5_L.js";import"./download-BGcYYhWw.js";import"./avatar-BLhNXW-W.js";import"./EmptyState-FjON9Ve2.js";import"./circle-question-mark-BJ-7TUgf.js";import"./useFilters-C3QPNclJ.js";import"./select-Bar5gCGO.js";import"./plus-ivySO7aD.js";import"./calendar-suggestion-CJMwfDpf.js";import"./useCalendarSuggestions-dbmN8tRh.js";import"./agenda-time--0lz2pGX.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BRsmtlld.js";import"./calendar-failure-note-DlpRkxBL.js";import"./checkbox-ImKY_DpK.js";import"./clock-CcJSq9G-.js";import"./segmented-control-CZRUmZT-.js";import"./useLayoutTier-c01ZWqQ0.js";import"./menu-BQAGsNoE.js";import"./folder-input-uYHmZSIB.js";import"./confirm-dialog-Nw9MwHVJ.js";import"./label-chip-D6mHiJlY.js";import"./cloud-off-KCT2nWKe.js";import"./useRefreshControl-C-8PJltS.js";import"./circle-check-big-D7T0Fr-Y.js";import"./LabelApplyTrigger-BLIxuWTi.js";import"./MailViewChrome-By52WjOW.js";import"./NavMenuButton-DMqlg3at.js";import"./shield-check-C-ddv9so.js";import"./bottom-sheet-BSnl2giv.js";import"./circle-check-bdTVfKb7.js";function so(){return o.jsx(r.Reading,{})}export{so as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-9QMShYZC.js";import{C as t}from"./CollectionPane-DH6KjfeW.js";import"./useCollectionThreads-bR-HQDXT.js";import"./useQueries-B2w-f15M.js";import"./useInfiniteQuery-CneHLmnO.js";import"./MessageToolbar-BK8iddsy.js";import"./MessageBody-bibpHbC1.js";import"./kbd-BD-ER_Yv.js";import"./search-scope-DowTds7f.js";import"./app-chrome-BtWv1mrl.js";import"./nav-link-BaRr8ufx.js";import"./useMediaQuery-BL50IiYB.js";import"./reply-CdhmgK8D.js";import"./useMessageBodyContent-DdX1ZZwR.js";import"./roving-focus-CfNxjWPW.js";import"./chevron-down-CHMH78GK.js";import"./search-token-index-Qe9FLPUx.js";import"./useLabels-BiYidhrJ.js";import"./index-Baytk5ez.js";import"./useSignature-DQ-8mjVB.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-nIbP08sa.js";import"./suggest-list-BU1CAWaS.js";import"./sections-aErIO9A7.js";import"./useJunkMailboxIds-BCvLXlA_.js";import"./badge-CoJzTE5F.js";import"./undo-2-D6HzUJ41.js";import"./DropdownMenu-CgMO6e8h.js";import"./refresh-cw-D43K-uJ_.js";import"./popover-menu-CNRsrfGN.js";import"./ErrorState-DHsQU1XS.js";import"./mail-DZhnB5_L.js";import"./download-BGcYYhWw.js";import"./avatar-BLhNXW-W.js";import"./EmptyState-FjON9Ve2.js";import"./circle-question-mark-BJ-7TUgf.js";import"./useFilters-C3QPNclJ.js";import"./select-Bar5gCGO.js";import"./plus-ivySO7aD.js";import"./calendar-suggestion-CJMwfDpf.js";import"./useCalendarSuggestions-dbmN8tRh.js";import"./agenda-time--0lz2pGX.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BRsmtlld.js";import"./calendar-failure-note-DlpRkxBL.js";import"./checkbox-ImKY_DpK.js";import"./clock-CcJSq9G-.js";import"./segmented-control-CZRUmZT-.js";import"./useLayoutTier-c01ZWqQ0.js";import"./menu-BQAGsNoE.js";import"./folder-input-uYHmZSIB.js";import"./confirm-dialog-Nw9MwHVJ.js";import"./label-chip-D6mHiJlY.js";import"./cloud-off-KCT2nWKe.js";import"./MailViewChrome-By52WjOW.js";import"./wizard-selection-zWa1qc6-.js";function mo(){return o.jsx(t.Reading,{})}export{mo as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-9QMShYZC.js";import{C as t}from"./CollectionPane-DH6KjfeW.js";import"./useCollectionThreads-bR-HQDXT.js";import"./useQueries-B2w-f15M.js";import"./useInfiniteQuery-CneHLmnO.js";import"./MessageToolbar-BK8iddsy.js";import"./MessageBody-bibpHbC1.js";import"./kbd-BD-ER_Yv.js";import"./search-scope-DowTds7f.js";import"./app-chrome-BtWv1mrl.js";import"./nav-link-BaRr8ufx.js";import"./useMediaQuery-BL50IiYB.js";import"./reply-CdhmgK8D.js";import"./useMessageBodyContent-DdX1ZZwR.js";import"./roving-focus-CfNxjWPW.js";import"./chevron-down-CHMH78GK.js";import"./search-token-index-Qe9FLPUx.js";import"./useLabels-BiYidhrJ.js";import"./index-Baytk5ez.js";import"./useSignature-DQ-8mjVB.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-nIbP08sa.js";import"./suggest-list-BU1CAWaS.js";import"./sections-aErIO9A7.js";import"./useJunkMailboxIds-BCvLXlA_.js";import"./badge-CoJzTE5F.js";import"./undo-2-D6HzUJ41.js";import"./DropdownMenu-CgMO6e8h.js";import"./refresh-cw-D43K-uJ_.js";import"./popover-menu-CNRsrfGN.js";import"./ErrorState-DHsQU1XS.js";import"./mail-DZhnB5_L.js";import"./download-BGcYYhWw.js";import"./avatar-BLhNXW-W.js";import"./EmptyState-FjON9Ve2.js";import"./circle-question-mark-BJ-7TUgf.js";import"./useFilters-C3QPNclJ.js";import"./select-Bar5gCGO.js";import"./plus-ivySO7aD.js";import"./calendar-suggestion-CJMwfDpf.js";import"./useCalendarSuggestions-dbmN8tRh.js";import"./agenda-time--0lz2pGX.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-BRsmtlld.js";import"./calendar-failure-note-DlpRkxBL.js";import"./checkbox-ImKY_DpK.js";import"./clock-CcJSq9G-.js";import"./segmented-control-CZRUmZT-.js";import"./useLayoutTier-c01ZWqQ0.js";import"./menu-BQAGsNoE.js";import"./folder-input-uYHmZSIB.js";import"./confirm-dialog-Nw9MwHVJ.js";import"./label-chip-D6mHiJlY.js";import"./cloud-off-KCT2nWKe.js";import"./MailViewChrome-By52WjOW.js";import"./wizard-selection-zWa1qc6-.js";function mo(){return o.jsx(t.Reading,{})}export{mo as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-9QMShYZC.js";import{O as t}from"./OutboxPane-BwIG-6n1.js";import"./MessageBody-bibpHbC1.js";import"./kbd-BD-ER_Yv.js";import"./search-scope-DowTds7f.js";import"./app-chrome-BtWv1mrl.js";import"./nav-link-BaRr8ufx.js";import"./useMediaQuery-BL50IiYB.js";import"./reply-CdhmgK8D.js";import"./useMessageBodyContent-DdX1ZZwR.js";import"./outbox-status-BlKn6P0x.js";import"./NavMenuButton-DMqlg3at.js";import"./menu-BQAGsNoE.js";import"./roving-focus-CfNxjWPW.js";import"./circle-check-big-D7T0Fr-Y.js";import"./clock-CcJSq9G-.js";import"./row-actions-DMyxcQFg.js";import"./rotate-ccw-DY-C3cnl.js";function g(){return o.jsx(t.Reading,{})}export{g as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-9QMShYZC.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-9QMShYZC.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-9QMShYZC.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-9QMShYZC.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-9QMShYZC.js";const n=o;export{n as component};